Closed voidbert closed 3 months ago
Fixed code that assumed the size of some integer types to be a fixed number of bytes, when it can very between platforms. The warnings fixed were:
printf
size_t
%zu
time_t
POS_FROM_PARENT
ssize_t
I didn't test if these warnings caused any runtime errors, but they can do so, so it's better to have them fixed.
I hereby attach the warnings that resulted from compiling swayimg on GCC 13.2.0, on a 32-bit glibc system.
swayimg
Sounds reasonable, thank you!
Fixed code that assumed the size of some integer types to be a fixed number of bytes, when it can very between platforms. The warnings fixed were:
printf
formats forsize_t
. Now, the platform-independent%zu
(C99 required);time_t
may be less than 64 bits, requiring a cast to a bigger size if a left shift by 32 bits is used.POS_FROM_PARENT
may assume a value too large forssize_t
.I didn't test if these warnings caused any runtime errors, but they can do so, so it's better to have them fixed.