src/array_list.c

changeset 1019
09c6fe8fe3b9
parent 1018
c773da859bad
child 1022
2911c1f4a570
--- 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
     }

mercurial