floooh / sokol

minimal cross-platform standalone C headers
https://floooh.github.io/sokol-html5
zlib License
6.63k stars 472 forks source link

Fix -Wpointer-sign warnings in sokol_gfx.h #877

Closed danielchasehooper closed 10 months ago

danielchasehooper commented 10 months ago

The unused out parameter was the wrong sign, removing it fixes the -Wpointer-sign warnings

floooh commented 10 months ago

Hmm, I was confused too when looking at the code, but GLsizei is actually a regular 32-bit signed integer even on 64-bit platforms, so that code should be good.

(also I checked and looks like -Wpointer-sign is part of the default warning set: https://clang.llvm.org/docs/DiagnosticsReference.html#wpointer-sign - otherwise I would have added it to the sokol-test compile options, currently that's -Wall -Wextra -Werror -Wsign-conversion)

danielchasehooper commented 10 months ago

My bad, one of the headers I was using had GLsizei incorrectly defined as unsigned int.