summaryrefslogtreecommitdiffstats
path: root/fortran/src/H5Tf.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2010-10-21 13:08:44 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2010-10-21 13:08:44 (GMT)
commitba665404620b16f0e5140c5f1d19b18ffb68590e (patch)
tree8759a98880bc6b7fc7cc1b1612f6548207837cef /fortran/src/H5Tf.c
parent9e2fff4540bbbc1718e1395f101973800f706eb9 (diff)
downloadhdf5-ba665404620b16f0e5140c5f1d19b18ffb68590e.zip
hdf5-ba665404620b16f0e5140c5f1d19b18ffb68590e.tar.gz
hdf5-ba665404620b16f0e5140c5f1d19b18ffb68590e.tar.bz2
[svn-r19654] Description:
Bring Coverity revisions from branch back to trunk, and clean up some other misc. compiler warnings also. r19500: Fix coverity items 1446 and 1447. Moved up calls to memset in test_cont in ohdr.c so the test never tries to close uninitialized locations. r19501: Fix coverity items 1398-1445. Various uninitialized variable errors in fheap.c. r19502: Fixed coverity issue 579 and some additional warnings in the file as well. r19503: Bug fix: This fix addressed the "RESOURCE_LEAK" problems #789 and 790, run 26 r19504: minor mods to try to keep coverity from flagging false positives. r19505: Fixed coverity issues 566 - 571. Declared variables that are passed to functions that use them as arrays to be arrays of size 1. Tested on: Mac OS X/32 10.6.4 (amazon) w/debug, production & parallel (h5committested on trunk)
Diffstat (limited to 'fortran/src/H5Tf.c')
-rw-r--r--fortran/src/H5Tf.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/fortran/src/H5Tf.c b/fortran/src/H5Tf.c
index 13fea93..37cfca0 100644
--- a/fortran/src/H5Tf.c
+++ b/fortran/src/H5Tf.c
@@ -990,7 +990,7 @@ nh5tget_member_name_c ( hid_t_f *type_id ,int_f* idx, _fcd member_name, int_f *n
char *c_name;
c_type_id = *type_id;
- c_index = *idx;
+ c_index = (unsigned)*idx;
c_name = H5Tget_member_name(c_type_id, c_index);
if (c_name == NULL ) return ret_value;
@@ -1199,7 +1199,7 @@ nh5tget_member_type_c ( hid_t_f *type_id ,int_f* field_idx, hid_t_f * datatype)
/*----------------------------------------------------------------------------
* Name: h5tcreate_c
* Purpose: Call H5Tcreate to create a datatype
- * Inputs: class - class type
+ * Inputs: cls - class type
* size - size of the class memeber
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -1208,14 +1208,14 @@ nh5tget_member_type_c ( hid_t_f *type_id ,int_f* field_idx, hid_t_f * datatype)
*---------------------------------------------------------------------------*/
int_f
-nh5tcreate_c(int_f *class, size_t_f *size, hid_t_f *type_id)
+nh5tcreate_c(int_f *cls, size_t_f *size, hid_t_f *type_id)
{
int ret_value = -1;
H5T_class_t c_class;
size_t c_size;
c_size =(size_t) *size;
- c_class = (H5T_class_t) *class;
+ c_class = (H5T_class_t) *cls;
*type_id = (hid_t_f)H5Tcreate(c_class, c_size);
if(*type_id < 0) return ret_value;
@@ -1419,7 +1419,7 @@ nh5tenum_nameof_c(hid_t_f *type_id, int_f* value, _fcd name, size_t_f* namelen)
int_f c_value;
c_value = *value;
c_namelen = ((size_t)*namelen) +1;
- c_name = (char *)malloc(sizeof(char)*c_namelen);
+ c_name = (char *)HDmalloc(sizeof(char)*c_namelen);
c_type_id = (hid_t)*type_id;
error = H5Tenum_nameof(c_type_id, &c_value, c_name, c_namelen);
HD5packFstring(c_name, _fcdtocp(name), strlen(c_name));
@@ -1617,7 +1617,7 @@ nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag )
* datatype member
* Inputs: type_id - identifier of the dataspace
* member_no - member's index
- * Outputs: class - member's class
+ * Outputs: cls - member's class
* and negative on failure.
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
@@ -1626,7 +1626,7 @@ nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag )
*---------------------------------------------------------------------------*/
int_f
-nh5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, int_f *class )
+nh5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, int_f *cls )
{
int ret_value = 0;
hid_t c_type_id;
@@ -1638,7 +1638,7 @@ nh5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, int_f *class )
c_class = H5Tget_member_class(c_type_id, c_member_no);
if ( c_class == H5T_NO_CLASS ) ret_value = -1;
- *class = (int_f)c_class;
+ *cls = (int_f)c_class;
return ret_value;
}
@@ -1766,18 +1766,18 @@ nh5tencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc )
return ret_value;
}
- c_size = (size_t)*nalloc;
/*
* Allocate buffer
*/
- if ((c_buf = HDmalloc(c_size)) == NULL)
+ c_size = (size_t)*nalloc;
+ if(NULL == (c_buf = (unsigned char *)HDmalloc(c_size)))
return ret_value;
+
/*
* Call H5Tencode function.
*/
- if(H5Tencode((hid_t)*obj_id, c_buf, &c_size) < 0){
+ if(H5Tencode((hid_t)*obj_id, c_buf, &c_size) < 0)
return ret_value;
- }
/* copy the C buffer to the FORTRAN buffer.
* Can not use HD5packFstring because we don't want to
@@ -1788,7 +1788,8 @@ nh5tencode_c (_fcd buf, hid_t_f *obj_id, size_t_f *nalloc )
HDmemcpy(_fcdtocp(buf),(char *)c_buf,c_size);
ret_value = 0;
- if(c_buf) HDfree(c_buf);
+ if(c_buf)
+ HDfree(c_buf);
return ret_value;
}