explicit cast to size_t

This commit is contained in:
Yuichi Nishiwaki 2015-05-28 00:17:12 +09:00
parent 7923f947d7
commit 9885bdd982
1 changed files with 6 additions and 6 deletions

View File

@ -54,7 +54,7 @@
#define xv_push(type, v, x) \
do { \
if ((v).n == (v).m) { \
(v).m = (v).m? (v).m<<1 : 2; \
(v).m = (v).m? (v).m<<1 : (size_t)2; \
(v).a = (type*)xv_realloc((v).a, sizeof(type) * (v).m); \
} \
(v).a[(v).n++] = (x); \
@ -62,7 +62,7 @@
#define xv_pushp(type, v) \
(((v).n == (v).m)? \
((v).m = ((v).m? (v).m<<1 : 2), \
((v).m = ((v).m? (v).m<<1 : (size_t)2), \
(v).a = (type*)xv_realloc((v).a, sizeof(type) * (v).m), 0) \
: 0), ((v).a + ((v).n++))
@ -71,6 +71,6 @@
((v).m = (v).n = (i) + 1, xv_roundup32((v).m), \
(v).a = (type*)xv_realloc((v).a, sizeof(type) * (v).m), 0) \
: (v).n <= (size_t)(i)? (v).n = (i) + 1 \
: 0), (v).a[(i)])
: (size_t)0), (v).a[(i)])
#endif