]> granicus.if.org Git - zziplib/commit
zzip: format: explicitly mark header length constants as unsigned
authorPatrick Steinhardt <ps@pks.im>
Tue, 21 May 2019 11:15:36 +0000 (13:15 +0200)
committerPatrick Steinhardt <ps@pks.im>
Thu, 1 Aug 2019 06:33:34 +0000 (08:33 +0200)
commitda9a6f8a2a1c3d4a4d4958d4179dfc7add90235e
treebd9b290a080b976f9f450ae04dae46567556bcc8
parent0ef64059b1aecee0c670d3925a101da89be20a13
zzip: format: explicitly mark header length constants as unsigned

The various different `headerlength` macros in "format.h" are defined as
simple additions of all the field lengths of its struct representation.
While it is obvious that the resulting constants are always positive,
the C language specifies the result as a signed integer, causing
warnings at several places due to comparisons with different signedness.

Fix the issue by explicitly marking the constants as unsigned. A simpler
fix would just replace those constants with `sizeof`, which should be
fine due to the struct's being marked as packed. But for the sake of
simplicitly, let's just stay with the more obvious fix.
zzip/format.h