diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2003-05-31 16:15:19 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2003-05-31 16:15:19 (GMT) |
commit | 119891e4b61cd58fbd35f3e9e73bf48ecad2ca34 (patch) | |
tree | fadcd63dc8640083b0a9322a3f7105bf611ce48b | |
parent | 10009e7c1b5e1c0b23076161574f68855fe39809 (diff) | |
download | hdf5-119891e4b61cd58fbd35f3e9e73bf48ecad2ca34.zip hdf5-119891e4b61cd58fbd35f3e9e73bf48ecad2ca34.tar.gz hdf5-119891e4b61cd58fbd35f3e9e73bf48ecad2ca34.tar.bz2 |
[svn-r6936] Purpose:
Bug fix
Description:
When free lists where disabled, the macros for array free list operations
could possibly expand in ways that allowed incorrect numbers of objects to be
operated on.
Solution:
Put parentheses around macro arguments when performing operations with them.
Platforms tested:
h5committestted (although Fortran tests failed for some reason)
-rw-r--r-- | src/H5FLprivate.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/H5FLprivate.h b/src/H5FLprivate.h index 749882f..4f3d938 100644 --- a/src/H5FLprivate.h +++ b/src/H5FLprivate.h @@ -236,10 +236,10 @@ typedef struct H5FL_arr_head_t { #define H5FL_ARR_DEFINE(t,m) H5_DLL H5FL_ARR_DEFINE_COMMON(t,m) #define H5FL_ARR_EXTERN(t) extern H5_DLL int H5FL_ARR_NAME(t) #define H5FL_ARR_DEFINE_STATIC(t,m) static H5FL_ARR_DEFINE_COMMON(t,m) -#define H5FL_ARR_MALLOC(t,elem) H5MM_malloc(elem*sizeof(t)) -#define H5FL_ARR_CALLOC(t,elem) H5MM_calloc(elem*sizeof(t)) +#define H5FL_ARR_MALLOC(t,elem) H5MM_malloc((elem)*sizeof(t)) +#define H5FL_ARR_CALLOC(t,elem) H5MM_calloc((elem)*sizeof(t)) #define H5FL_ARR_FREE(t,obj) H5MM_xfree(obj) -#define H5FL_ARR_REALLOC(t,obj,new_elem) H5MM_realloc(obj,new_elem*sizeof(t)) +#define H5FL_ARR_REALLOC(t,obj,new_elem) H5MM_realloc(obj,(new_elem)*sizeof(t)) #endif /* H5_NO_ARR_FREE_LISTS */ /* |