mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-02-17 16:10:24 +08:00
[svn-r6131] Purpose:
Code cleanup Description: Clean up compiler warnings from IRIX64 builds. Platforms tested: IRIX64 6.5 (modi4)
This commit is contained in:
parent
f3674477db
commit
bc2d9432b3
@ -215,7 +215,7 @@ write_file(Bytef *source, uLongf sourceLen)
|
||||
|
||||
/* destination buffer needs to be at least 0.1% larger than sourceLen
|
||||
* plus 12 bytes */
|
||||
destLen = (uLongf)((double)sourceLen + (sourceLen * 0.1)) + 12;
|
||||
destLen = (uLongf)((double)sourceLen + ((double)sourceLen * 0.1)) + 12;
|
||||
dest = (Bytef *)malloc(destLen);
|
||||
|
||||
if (!dest)
|
||||
@ -231,7 +231,7 @@ write_file(Bytef *source, uLongf sourceLen)
|
||||
((double)timer_start.tv_usec) / MICROSECOND);
|
||||
|
||||
if (report_once_flag) {
|
||||
printf("\tCompression Ratio: %g\n", ((double)destLen) / sourceLen);
|
||||
printf("\tCompression Ratio: %g\n", ((double)destLen) / (double)sourceLen);
|
||||
report_once_flag = 0;
|
||||
}
|
||||
|
||||
@ -240,7 +240,7 @@ write_file(Bytef *source, uLongf sourceLen)
|
||||
|
||||
/* loop to make sure we write everything out that we want to write */
|
||||
for (;;) {
|
||||
int rc = write(output, d_ptr, (size_t)d_len);
|
||||
int rc = (int)write(output, d_ptr, (size_t)d_len);
|
||||
|
||||
if (rc == -1)
|
||||
error(strerror(errno));
|
||||
@ -462,7 +462,7 @@ fill_with_random_data(Bytef *src, uLongf src_len)
|
||||
printf("Using random() for random data\n");
|
||||
|
||||
for (u = 0; u < src_len; ++u)
|
||||
src[u] = 0xff & random();
|
||||
src[u] = (Bytef)(0xff & random());
|
||||
}
|
||||
|
||||
if (compress_percent) {
|
||||
@ -482,7 +482,7 @@ do_write_test(unsigned long file_size, unsigned long min_buf_size,
|
||||
Bytef *src;
|
||||
|
||||
for (src_len = min_buf_size; src_len <= max_buf_size; src_len <<= 1) {
|
||||
register int i, iters;
|
||||
register unsigned long i, iters;
|
||||
|
||||
iters = file_size / src_len;
|
||||
src = (Bytef *)calloc(1, sizeof(Bytef) * src_len);
|
||||
@ -612,7 +612,7 @@ main(int argc, char **argv)
|
||||
min_buf_size = parse_size_directive(opt_arg);
|
||||
break;
|
||||
case 'c':
|
||||
compress_percent = strtol(opt_arg, NULL, 10);
|
||||
compress_percent = (int)strtol(opt_arg, NULL, 10);
|
||||
|
||||
if (compress_percent < 0)
|
||||
compress_percent = 0;
|
||||
|
@ -1168,7 +1168,7 @@ H5Iget_name(hid_t id, char *name/*out*/, size_t size)
|
||||
} /* end if */
|
||||
|
||||
/* Set return value */
|
||||
ret_value=len;
|
||||
ret_value=(ssize_t)len;
|
||||
|
||||
done:
|
||||
FUNC_LEAVE(ret_value);
|
||||
|
@ -370,7 +370,7 @@ H5O_plist_encode(H5F_t UNUSED *f, uint8_t *p, const void *mesg)
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(stderr, "number of bytes == %d\n", p - old);
|
||||
fprintf(stderr, "number of bytes == %u\n", (unsigned)(p - old));
|
||||
|
||||
done:
|
||||
FUNC_LEAVE(ret_value);
|
||||
|
@ -270,7 +270,7 @@ test_multi(void)
|
||||
HDmemset(memb_addr, 0, sizeof memb_addr);
|
||||
HDmemset(sv, 0, sizeof sv);
|
||||
|
||||
for(mt=0; mt<H5FD_MEM_NTYPES; mt++)
|
||||
for(mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt))
|
||||
memb_map[mt] = H5FD_MEM_SUPER;
|
||||
memb_map[H5FD_MEM_DRAW] = H5FD_MEM_DRAW;
|
||||
|
||||
|
@ -188,7 +188,7 @@ test_attr_basic_write(void)
|
||||
if(attr_name_size>0)
|
||||
attr_name = (char*)HDcalloc((size_t)(attr_name_size+1), sizeof(char));
|
||||
|
||||
ret=H5Aget_name(attr, (size_t)(attr_name_size+1), attr_name);
|
||||
ret=(herr_t)H5Aget_name(attr, (size_t)(attr_name_size+1), attr_name);
|
||||
CHECK(ret, FAIL, "H5Aget_name");
|
||||
ret=HDstrcmp(attr_name, ATTR_TMP_NAME);
|
||||
VERIFY(ret, 0, "HDstrcmp");
|
||||
@ -223,7 +223,7 @@ test_attr_basic_write(void)
|
||||
if(attr_name_size>0)
|
||||
attr_name = (char*)HDcalloc((size_t)(attr_name_size+1), sizeof(char));
|
||||
|
||||
ret=H5Aget_name(attr2, (size_t)(attr_name_size+1), attr_name);
|
||||
ret=(herr_t)H5Aget_name(attr2, (size_t)(attr_name_size+1), attr_name);
|
||||
CHECK(ret, FAIL, "H5Aget_name");
|
||||
ret=HDstrcmp(attr_name, ATTR1A_NAME);
|
||||
VERIFY(ret, 0, "HDstrcmp");
|
||||
|
@ -239,7 +239,6 @@ static void test_vlstring_type(void)
|
||||
H5T_cset_t cset;
|
||||
H5T_str_t pad;
|
||||
herr_t ret;
|
||||
size_t size;
|
||||
|
||||
/* Output message about test being performed */
|
||||
MESSAGE(5, ("Testing VL String type\n"));
|
||||
@ -391,9 +390,6 @@ static void test_read_vl_string_attribute(void)
|
||||
hid_t type;
|
||||
herr_t ret;
|
||||
char *string_att_check;
|
||||
hsize_t size[64];
|
||||
hid_t space;
|
||||
int ndims;
|
||||
|
||||
file = H5Fopen(DATAFILE, H5F_ACC_RDONLY, H5P_DEFAULT);
|
||||
CHECK(file, FAIL, "H5Fopen");
|
||||
@ -411,9 +407,6 @@ static void test_read_vl_string_attribute(void)
|
||||
att = H5Aopen_name(root, "test_scalar");
|
||||
CHECK(att, FAIL, "H5Aopen_name");
|
||||
|
||||
space = H5Aget_space(att);
|
||||
ndims = H5Sget_simple_extent_dims(space, size, NULL);
|
||||
|
||||
ret = H5Aread(att, type, &string_att_check);
|
||||
CHECK(ret, FAIL, "H5Aread");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user