From 625da6f5603f33168572597cda8b72b5bd1b96d1 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sat, 25 Feb 2023 13:15:36 -0500 Subject: map: Fix shift overflow warning src/resources/map.c: In function ‘tmx_data_end’: src/resources/map.c:541:35: warning: result of ‘255 << 24’ requires 33 bits to represent, but ‘int’ only has 32 bits [-Wshift-overflow=] 541 | (decomp_buf[i * 4 + 3] & 0xFF << 030); | ^~ --- (limited to 'src/resources/map.c') diff --git a/src/resources/map.c b/src/resources/map.c index e190282..38928d3 100644 --- a/src/resources/map.c +++ b/src/resources/map.c @@ -535,10 +535,10 @@ tmx_data_end(void *pv, const char *name) for (i = 0; i < decomp_len / 4; ++i) { /* Convert each tile GID to the system's byte order. */ ly->tiles[i] = - (decomp_buf[i * 4 + 0] & 0xFF << 000) | - (decomp_buf[i * 4 + 1] & 0xFF << 010) | - (decomp_buf[i * 4 + 2] & 0xFF << 020) | - (decomp_buf[i * 4 + 3] & 0xFF << 030); + (decomp_buf[i * 4 + 0] & (Uint32) 0xFF << 000) | + (decomp_buf[i * 4 + 1] & (Uint32) 0xFF << 010) | + (decomp_buf[i * 4 + 2] & (Uint32) 0xFF << 020) | + (decomp_buf[i * 4 + 3] & (Uint32) 0xFF << 030); } free(decomp_buf); xml_node_pop(p); -- cgit v0.9.1