RFR: 8292981: Unify and restructure integer printing format specifiers [v4]

Stefan Karlsson stefank at openjdk.org
Tue Aug 30 14:22:14 UTC 2022


On Tue, 30 Aug 2022 13:33:18 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> Stefan Karlsson has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Move INTPTR_FORMAT_H_W to Shenandoah
>
> src/hotspot/share/utilities/globalDefinitions.hpp line 110:
> 
>> 108: // Format 16-bit quantities.
>> 109: #define INT16_FORMAT_X_0         "0x%04"      PRIx16
>> 110: #define UINT16_FORMAT_X_0        "0x%04"      PRIx16
> 
> I'm confused.  What's the trailing 0 ?  is it to print the "0x" part of the hex format?  And why wouldn't you want that?

I tried to describe it above:

//  _X    - print as hexadecimal, without leading 0s: 0x12345
//  _X_0  - print as hexadecimal, with leading 0s: 0x00012345


It's about padding with 0s. So, that you get 0x00012345 instead of 0x12345. Do you have a suggestion on how to write that comment any clearer?

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

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


More information about the hotspot-dev mailing list