RFR: 8347576: Error output in libjsound has non matching format strings [v4]
Matthias Baesken
mbaesken at openjdk.org
Wed Jan 15 14:14:47 UTC 2025
On Wed, 15 Jan 2025 13:58:53 GMT, Julian Waters <jwaters at openjdk.org> wrote:
>> Matthias Baesken has updated the pull request incrementally with one additional commit since the last revision:
>>
>> change format specifiers at some places in Windows coding
>
> src/java.desktop/share/native/libjsound/MidiOutDevice.c line 97:
>
>> 95: /* Handle error codes. */
>> 96: if (ret < -1) {
>> 97: ERROR1("Java_com_sun_media_sound_MidiOutDevice_nGetTimeStamp: MIDI_IN_GetTimeStamp returned %lld\n", (long long int) ret);
>
> I wonder if we could use the format specifier for jlong here somehow, avoiding the cast here
I think we do not have this now in this lib. Of course we can copy something like this
test/hotspot/jtreg/vmTestbase/nsk/share/native/nsk_tools.hpp
30 #include <inttypes.h>
34 #if defined(_LP64) && defined(__APPLE__)
35 #define JLONG_FORMAT "%ld"
36 #else // _LP64 && __APPLE__
37 #define JLONG_FORMAT "%" PRId64
38 #endif // _LP64 && __APPLE__
into the file and then use JLONG_FORMAT .
Is this worth it?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23076#discussion_r1916717612
More information about the client-libs-dev
mailing list