Sun, 15 Dec 2024 15:44:40 +0100
add explicit casts to silence warnings
src/array_list.c | file | annotate | diff | comparison | revisions |
--- a/src/array_list.c Sun Dec 15 15:41:18 2024 +0100 +++ b/src/array_list.c Sun Dec 15 15:44:40 2024 +0100 @@ -165,13 +165,13 @@ if (width == 0 || width == CX_WORDSIZE) { *(size_t*) capacity = newcap; } else if (width == 16) { - *(uint16_t*) capacity = newcap; + *(uint16_t*) capacity = (uint16_t) newcap; } else if (width == 8) { - *(uint8_t*) capacity = newcap; + *(uint8_t*) capacity = (uint8_t) newcap; } #if CX_WORDSIZE == 64 else if (width == 32) { - *(uint32_t*) capacity = newcap; + *(uint32_t*) capacity = (uint32_t) newcap; } #endif } @@ -282,16 +282,16 @@ *(size_t*) capacity = newcap; *(size_t*) size = newsize; } else if (width == 16) { - *(uint16_t*) capacity = newcap; - *(uint16_t*) size = newsize; + *(uint16_t*) capacity = (uint16_t) newcap; + *(uint16_t*) size = (uint16_t) newsize; } else if (width == 8) { - *(uint8_t*) capacity = newcap; - *(uint8_t*) size = newsize; + *(uint8_t*) capacity = (uint8_t) newcap; + *(uint8_t*) size = (uint8_t) newsize; } #if CX_WORDSIZE == 64 else if (width == 32) { - *(uint32_t*) capacity = newcap; - *(uint32_t*) size = newsize; + *(uint32_t*) capacity = (uint32_t) newcap; + *(uint32_t*) size = (uint32_t) newsize; } #endif }