summaryrefslogtreecommitdiffstats
path: root/src/misc/util/abc_global.h
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2019-03-05 15:57:50 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2019-03-05 15:57:50 -0800
commit01569b8f5f2394c534c3aba7276caf22493fce82 (patch)
tree40d52cf2d4d76c1e1e5bf6443c34836627f4e5f9 /src/misc/util/abc_global.h
parentb632c8496cc48bb8be0851ea2c183f94c201f791 (diff)
downloadabc-01569b8f5f2394c534c3aba7276caf22493fce82.tar.gz
abc-01569b8f5f2394c534c3aba7276caf22493fce82.tar.bz2
abc-01569b8f5f2394c534c3aba7276caf22493fce82.zip
Fixing some warnings by adding cast from 'int' to 'size_t' in memset, memcpy, etc.
Diffstat (limited to 'src/misc/util/abc_global.h')
-rw-r--r--src/misc/util/abc_global.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/misc/util/abc_global.h b/src/misc/util/abc_global.h
index c27b907e..28f0dd57 100644
--- a/src/misc/util/abc_global.h
+++ b/src/misc/util/abc_global.h
@@ -256,13 +256,13 @@ typedef ABC_INT64_T iword;
#define ABC_PRMn(a,f) (Abc_Print(1, "%s =", (a)), Abc_Print(1, "%10.3f MB ", 1.0*(f)/(1<<20)))
#define ABC_PRMP(a,f,F) (Abc_Print(1, "%s =", (a)), Abc_Print(1, "%10.3f MB (%6.2f %%)\n", (1.0*(f)/(1<<20)), ((F)? 100.0*(f)/(F) : 0.0) ) )
-#define ABC_ALLOC(type, num) ((type *) malloc(sizeof(type) * (num)))
-#define ABC_CALLOC(type, num) ((type *) calloc((num), sizeof(type)))
-#define ABC_FALLOC(type, num) ((type *) memset(malloc(sizeof(type) * (num)), 0xff, sizeof(type) * (num)))
+#define ABC_ALLOC(type, num) ((type *) malloc(sizeof(type) * (size_t)(num)))
+#define ABC_CALLOC(type, num) ((type *) calloc((size_t)(num), sizeof(type)))
+#define ABC_FALLOC(type, num) ((type *) memset(malloc(sizeof(type) * (size_t)(num)), 0xff, sizeof(type) * (size_t)(num)))
#define ABC_FREE(obj) ((obj) ? (free((char *) (obj)), (obj) = 0) : 0)
#define ABC_REALLOC(type, obj, num) \
- ((obj) ? ((type *) realloc((char *)(obj), sizeof(type) * (num))) : \
- ((type *) malloc(sizeof(type) * (num))))
+ ((obj) ? ((type *) realloc((char *)(obj), sizeof(type) * (size_t)(num))) : \
+ ((type *) malloc(sizeof(type) * (size_t)(num))))
static inline int Abc_AbsInt( int a ) { return a < 0 ? -a : a; }
static inline int Abc_MaxInt( int a, int b ) { return a > b ? a : b; }