summaryrefslogtreecommitdiffstats
path: root/tools/h4toh5vdata.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2001-01-09 21:22:30 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2001-01-09 21:22:30 (GMT)
commit35bc545296209684a5c46db0cde11beb9403a4dc (patch)
tree98b5a037ed928085b98abc1fee71fc62f81073c1 /tools/h4toh5vdata.c
parent1290c4808d3e9890c765b1445f66b823c9026734 (diff)
downloadhdf5-35bc545296209684a5c46db0cde11beb9403a4dc.zip
hdf5-35bc545296209684a5c46db0cde11beb9403a4dc.tar.gz
hdf5-35bc545296209684a5c46db0cde11beb9403a4dc.tar.bz2
[svn-r3252] Purpose:
Code cleanup. Description: Fixed _lots_ (I mean _tons_) of warnings spit out by the gcc with the extra warnings. Including a few show-stoppers for compression on IRIX machines. Solution: Changed lots of variables' types to more sensible and consistent types, more range-checking, more variable typecasts, etc. Platforms tested: FreeBSD 4.2 (hawkwind), IRIX64-64 (modi4)
Diffstat (limited to 'tools/h4toh5vdata.c')
-rw-r--r--tools/h4toh5vdata.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/h4toh5vdata.c b/tools/h4toh5vdata.c
index ed692a9..55a8bf9 100644
--- a/tools/h4toh5vdata.c
+++ b/tools/h4toh5vdata.c
@@ -28,6 +28,7 @@ Author: Kent Yang(ymuqun@ncsa.uiuc.edu)
*****************************************************************************/
#include "h4toh5main.h"
+#include <assert.h>
/*-------------------------------------------------------------------------
* Function: Vdata_h4_to_h5
@@ -152,10 +153,11 @@ int Vdata_h4_to_h5(int32 file_id,int32 vdata_id, hid_t group_id) {
return FAIL;
}
- h5memtype = calloc(nfields,sizeof(hid_t));
- h5type = calloc(nfields,sizeof(hid_t));
- h4memsize = calloc(nfields,sizeof(size_t));
- h4size = calloc(nfields,sizeof(size_t));
+ assert(nfields>0);
+ h5memtype = calloc((size_t)nfields,sizeof(hid_t));
+ h5type = calloc((size_t)nfields,sizeof(hid_t));
+ h4memsize = calloc((size_t)nfields,sizeof(size_t));
+ h4size = calloc((size_t)nfields,sizeof(size_t));
for (i=0;i<nfields;i++) {
@@ -199,7 +201,7 @@ int Vdata_h4_to_h5(int32 file_id,int32 vdata_id, hid_t group_id) {
}
- vd_data = malloc(vdatamem_size*n_records);
+ vd_data = malloc((size_t)(vdatamem_size*n_records));
istat = VSsetfields(vdata_id,field_name_list);