RFR: 8256379: Replace SIZE_FORMAT with 'z' length modifier

Coleen Phillimore coleenp at openjdk.org
Thu Aug 3 00:18:20 UTC 2023


Replace SIZE_FORMAT with %zu and SIZE_FORMAT_X with 0x%zx using a 4 line sed script:

  sed -e 's/" SIZE_FORMAT "/%zu/g' -e 's/" SIZE_FORMAT,/%zu",/' \
      -e 's/print(SIZE_FORMAT "/print("%zu/g' \
      -e 's/" SIZE_FORMAT_X "/0x%zx/g' -e 's/" SIZE_FORMAT_X,/0x%zx",/g' \
      -e 's/" SIZE_FORMAT$/%zu"/' \
       $f >$f.new

Minor fixups afterwards.  I didn't change SIZE_FORMAT_W(number) because it would have required a better sed script.

The definitions in globalDefinitions.hpp can be removed with a later PR, once all instances are cleaned out.  This is partial so that people start using %zu instead.

Tested with tier1 on Oracle supported platforms.

-------------

Commit messages:
 - Fix Shenandoah file.
 - Hand fixups.
 - More conversions.
 - Fixed SSIZE_FORMAT (now there are none), also more SIZE_FORMAT in os and cpu directories.
 - Sed the gc code too.
 - Fix SIZE_FORMAT, SIZE_FORMAT_X in all but gc.
 - Update gtest

Changes: https://git.openjdk.org/jdk/pull/15115/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=15115&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8256379
  Stats: 1161 lines in 257 files changed: 5 ins; 2 del; 1154 mod
  Patch: https://git.openjdk.org/jdk/pull/15115.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/15115/head:pull/15115

PR: https://git.openjdk.org/jdk/pull/15115


More information about the serviceability-dev mailing list