Skip to content

Commit 52aac6f

Browse files
Fujimoto Seijiedsiper
authored andcommitted
gzip: fix GCC warnings about signedness
This resolves the following warning occurring on GCC. > warning: pointer targets in assignment from ‘char *’ to > ‘uint8_t *’ {aka ‘unsigned char *’} differ in signedness Since the buffer pointer was declared as (uint8_t *), I should have casted the value to unsigned char, not signed one. Fix it. Signed-off-by: Fujimoto Seiji <[email protected]>
1 parent e8aa968 commit 52aac6f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/flb_gzip.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ int flb_gzip_compress(void *in_data, size_t in_len,
8787
gzip_header(out_buf);
8888

8989
/* Header offset */
90-
pb = (char *) out_buf + FLB_GZIP_HEADER_OFFSET;
90+
pb = (uint8_t *) out_buf + FLB_GZIP_HEADER_OFFSET;
9191

9292
flush = Z_NO_FLUSH;
9393
while (1) {
@@ -116,7 +116,7 @@ int flb_gzip_compress(void *in_data, size_t in_len,
116116

117117
/* Construct the gzip checksum (CRC32 footer) */
118118
footer_start = FLB_GZIP_HEADER_OFFSET + *out_len;
119-
pb = (char *) out_buf + footer_start;
119+
pb = (uint8_t *) out_buf + footer_start;
120120

121121
crc = mz_crc32(MZ_CRC32_INIT, in_data, in_len);
122122
*pb++ = crc & 0xFF;
@@ -175,7 +175,7 @@ int flb_gzip_uncompress(void *in_data, size_t in_len,
175175
}
176176

177177
/* Map zip content */
178-
zip_data = (char *) in_data + FLB_GZIP_HEADER_OFFSET;
178+
zip_data = (uint8_t *) in_data + FLB_GZIP_HEADER_OFFSET;
179179
zip_len = in_len - (FLB_GZIP_HEADER_OFFSET + 8);
180180

181181
mz_stream stream;

0 commit comments

Comments
 (0)