[svn-r24138] Cast constants to specified type.

Cast smaller vars to larger type.
Cast calculation result to correct type.
Changed int member to hbool_t

Tested: local linux
This commit is contained in:
Allen Byrne
2013-09-13 16:11:30 -05:00
parent 3c021d3a77
commit a8c63e28d5
6 changed files with 24 additions and 23 deletions

View File

@@ -5792,14 +5792,14 @@ int ull2float(unsigned long long ull_value, float *f_value)
src_size = H5Tget_size(H5T_NATIVE_ULLONG);
dst_size = H5Tget_size(H5T_NATIVE_FLOAT);
buf = (unsigned char*)HDcalloc(1, MAX(src_size, dst_size));
buf = (unsigned char*)HDcalloc((size_t)1, MAX(src_size, dst_size));
if(!buf)
goto error;
HDmemcpy(buf, &ull_value, src_size);
/* do conversion */
if(H5Tconvert(H5T_NATIVE_ULLONG, H5T_NATIVE_FLOAT, 1, buf, NULL, dxpl_id)<0)
if(H5Tconvert(H5T_NATIVE_ULLONG, H5T_NATIVE_FLOAT, (size_t)1, buf, NULL, dxpl_id)<0)
goto error;
HDmemcpy(f_value, buf, dst_size);
@@ -6358,9 +6358,9 @@ static void get_member_types(hid_t tid, mcomp_t *members)
return;
members->n = (unsigned)nmembs;
members->ids = (hid_t *)HDcalloc(members->n, sizeof(hid_t));
members->offsets = (size_t *)HDcalloc(members->n, sizeof(size_t));
members->m = (mcomp_t **)HDcalloc(members->n, sizeof(mcomp_t *));
members->ids = (hid_t *)HDcalloc((size_t)members->n, sizeof(hid_t));
members->offsets = (size_t *)HDcalloc((size_t)members->n, sizeof(size_t));
members->m = (mcomp_t **)HDcalloc((size_t)members->n, sizeof(mcomp_t *));
for(u = 0; u < members->n; u++)
{