Skip to content

Commit 41faa08

Browse files
nmoinvazDead2
authored andcommitted
Fixed clang signed/unsigned warning in chunkcopy_safe.
inflate_p.h:159:18: warning: comparison of integers of different signs: 'int32_t' (aka 'int') and 'size_t' (aka 'unsigned long') [-Wsign-compare] tocopy = MIN(non_olap_size, len); ^ ~~~~~~~~~~~~~ ~~~ zbuild.h:74:24: note: expanded from macro 'MIN' #define MIN(a, b) ((a) > (b) ? (b) : (a)) ~ ^ ~
1 parent fadaca4 commit 41faa08

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

inflate_p.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ static inline uint8_t* chunkcopy_safe(uint8_t *out, uint8_t *from, size_t len, u
146146
* initial bulk memcpy of the nonoverlapping region. Then, we can leverage the size of this to determine the safest
147147
* atomic memcpy size we can pick such that we have non-overlapping regions. This effectively becomes a safe look
148148
* behind or lookahead distance */
149-
int32_t non_olap_size = (int32_t)((from > out) ? from - out : out - from);
149+
size_t non_olap_size = ((from > out) ? from - out : out - from);
150150

151151
memcpy(out, from, non_olap_size);
152152
out += non_olap_size;

0 commit comments

Comments
 (0)