diff --git a/stb_ds.h b/stb_ds.h index e84c82d1d..a20968529 100644 --- a/stb_ds.h +++ b/stb_ds.h @@ -536,7 +536,7 @@ extern void * stbds_shmode_func(size_t elemsize, int mode); #define stbds_temp_key(t) (*(char **) stbds_header(t)->hash_table) #define stbds_arrsetcap(a,n) (stbds_arrgrow(a,0,n)) -#define stbds_arrsetlen(a,n) ((stbds_arrcap(a) < (size_t) (n) ? stbds_arrsetcap((a),(size_t)(n)),0 : 0), (a) ? stbds_header(a)->length = (size_t) (n) : 0) +#define stbds_arrsetlen(a,n) (((ptrdiff_t) stbds_arrcap(a) < (ptrdiff_t) (n) ? stbds_arrsetcap((a),(size_t)(n)),0 : 0), (a) ? stbds_header(a)->length = (size_t) (n) : 0) #define stbds_arrcap(a) ((a) ? stbds_header(a)->capacity : 0) #define stbds_arrlen(a) ((a) ? (ptrdiff_t) stbds_header(a)->length : 0) #define stbds_arrlenu(a) ((a) ? stbds_header(a)->length : 0)