From 0eb679f8a7e88f1a5b5ed39c0bd277db9775ad68 Mon Sep 17 00:00:00 2001 From: Matthew Larson Date: Fri, 13 Dec 2024 16:38:10 -0600 Subject: [PATCH] Correct types in debug prints --- src/rest_vol.c | 4 ++-- src/rest_vol_attr.c | 8 ++++---- src/rest_vol_config.h.in | 16 +++++++++++----- src/rest_vol_dataset.c | 16 ++++++---------- src/rest_vol_datatype.c | 4 ++-- src/rest_vol_group.c | 2 +- src/rest_vol_link.c | 2 +- src/rest_vol_object.c | 2 +- 8 files changed, 28 insertions(+), 26 deletions(-) diff --git a/src/rest_vol.c b/src/rest_vol.c index 5dbf90c1..545d2136 100644 --- a/src/rest_vol.c +++ b/src/rest_vol.c @@ -2965,7 +2965,7 @@ RV_parse_dataspace(char *space) for (i = 0; i < dims_obj->u.array.len; i++) { if (i > 0) printf(", "); - printf("%llu", space_dims[i]); + printf("%" PRIuHSIZE, space_dims[i]); } printf(" ]\n\n"); if (maxdims_specified) { @@ -2973,7 +2973,7 @@ RV_parse_dataspace(char *space) for (i = 0; i < maxdims_obj->u.array.len; i++) { if (i > 0) printf(", "); - printf("%llu", space_maxdims[i]); + printf("%" PRIuHSIZE, space_maxdims[i]); } printf(" ]\n\n"); } diff --git a/src/rest_vol_attr.c b/src/rest_vol_attr.c index d612ac24..65e66ba8 100644 --- a/src/rest_vol_attr.c +++ b/src/rest_vol_attr.c @@ -710,7 +710,7 @@ RV_attr_read(void *attr, hid_t dtype_id, void *buf, hid_t dxpl_id, void **req) FUNC_GOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "memory datatype is invalid"); #ifdef RV_CONNECTOR_DEBUG - printf("-> %lld points selected for attribute read\n", file_select_npoints); + printf("-> %" PRIuHSIZE "points selected for attribute read\n", file_select_npoints); printf("-> Attribute's datatype size: %zu\n\n", dtype_size); #endif @@ -827,7 +827,7 @@ RV_attr_write(void *attr, hid_t dtype_id, const void *buf, hid_t dxpl_id, void * FUNC_GOTO_ERROR(H5E_DATASPACE, H5E_BADVALUE, FAIL, "memory datatype is invalid"); #ifdef RV_CONNECTOR_DEBUG - printf("-> %lld points selected for attribute write\n", file_select_npoints); + printf("-> %" PRIuHSIZE "points selected for attribute write\n", file_select_npoints); printf("-> Attribute's datatype size: %zu\n\n", dtype_size); #endif @@ -2525,7 +2525,7 @@ RV_traverse_attr_table(attr_table_entry *attr_table, size_t num_entries, const i #ifdef RV_CONNECTOR_DEBUG printf("-> Attribute %zu name: %s\n", last_idx, attr_table[last_idx].attr_name); printf("-> Attribute %zu creation time: %f\n", last_idx, attr_table[last_idx].crt_time); - printf("-> Attribute %zu data size: %llu\n\n", last_idx, + printf("-> Attribute %zu data size: %" PRIuHSIZE "\n\n", last_idx, attr_table[last_idx].attr_info.data_size); printf("-> Calling supplied callback function\n\n"); @@ -2556,7 +2556,7 @@ RV_traverse_attr_table(attr_table_entry *attr_table, size_t num_entries, const i #ifdef RV_CONNECTOR_DEBUG printf("-> Attribute %zu name: %s\n", last_idx, attr_table[last_idx].attr_name); printf("-> Attribute %zu creation time: %f\n", last_idx, attr_table[last_idx].crt_time); - printf("-> Attribute %zu data size: %llu\n\n", last_idx, + printf("-> Attribute %zu data size: %" PRIuHSIZE "\n\n", last_idx, attr_table[last_idx].attr_info.data_size); printf("-> Calling supplied callback function\n\n"); diff --git a/src/rest_vol_config.h.in b/src/rest_vol_config.h.in index 5e0997d4..c49f1de1 100644 --- a/src/rest_vol_config.h.in +++ b/src/rest_vol_config.h.in @@ -30,9 +30,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MACH_MACH_TIME_H -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - /* Define to 1 if you have the header file. */ #undef HAVE_SETJMP_H @@ -48,6 +45,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H @@ -81,6 +81,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H +/* Whether HDF5 version is at least 2.0.0 */ +#undef HDF5_2 + /* Define to the sub-directory where libtool stores uninstalled libraries. */ #undef LT_OBJDIR @@ -111,10 +114,13 @@ /* The size of `off_t', as computed by sizeof. */ #undef SIZEOF_OFF_T -/* Define to 1 if you have the ANSI C header files. */ +/* Define to 1 if all of the C90 standard headers exist (not just the ones + required in a freestanding environment). This macro is provided for + backward compatibility; new code need not use it. */ #undef STDC_HEADERS -/* Define to 1 if you can safely include both and . */ +/* Define to 1 if you can safely include both and . This + macro is obsolete. */ #undef TIME_WITH_SYS_TIME /* Define to have the REST VOL track memory usage. */ diff --git a/src/rest_vol_dataset.c b/src/rest_vol_dataset.c index 34aaa506..226cfab9 100644 --- a/src/rest_vol_dataset.c +++ b/src/rest_vol_dataset.c @@ -607,8 +607,8 @@ RV_dataset_read(size_t count, void *dset[], hid_t mem_type_id[], hid_t _mem_spac "memory selection num points != file selection num points"); #ifdef RV_CONNECTOR_DEBUG - printf("-> %lld points selected in file dataspace\n", file_select_npoints); - printf("-> %lld points selected in memory dataspace\n\n", mem_select_npoints); + printf("-> %" PRIuHSIZE "points selected in file dataspace\n", file_select_npoints); + printf("-> %" PRIuHSIZE "points selected in memory dataspace\n\n", mem_select_npoints); #endif /* Setup the host header */ @@ -986,8 +986,8 @@ RV_dataset_write(size_t count, void *dset[], hid_t mem_type_id[], hid_t _mem_spa "memory selection num points != file selection num points"); #ifdef RV_CONNECTOR_DEBUG - printf("-> %lld points selected in file dataspace\n", file_select_npoints); - printf("-> %lld points selected in memory dataspace\n\n", mem_select_npoints); + printf("-> %" PRIuHSIZE "points selected in file dataspace\n", file_select_npoints); + printf("-> %" PRIuHSIZE "points selected in memory dataspace\n\n", mem_select_npoints); #endif if ((file_type_size = H5Tget_size(transfer_info[i].file_type_id)) == 0) @@ -1266,7 +1266,7 @@ RV_dataset_write(size_t count, void *dset[], hid_t mem_type_id[], hid_t _mem_spa #ifdef RV_CONNECTOR_DEBUG printf("-> Base64-encoded data buffer for dataset %zu: %s\n\n", i, - transfer_info[i].u.write_info.base64_encoded_values); + (char *) transfer_info[i].u.write_info.base64_encoded_values); #endif /* Copy encoded values into format string */ write_body_len = (strlen(fmt_string) - 4) + selection_body_len + value_body_len; @@ -1280,10 +1280,6 @@ RV_dataset_write(size_t count, void *dset[], hid_t mem_type_id[], hid_t _mem_spa transfer_info[i].u.write_info.uinfo.buffer = transfer_info[i].u.write_info.point_sel_buf; -#ifdef RV_CONNECTOR_DEBUG - printf("-> Write body: %s\n\n", transfer_info[i].u.write_info.selection_buf); -#endif - if (bytes_printed >= write_body_len + 1) FUNC_GOTO_ERROR(H5E_DATASET, H5E_SYSERRSTR, FAIL, "point selection write buffer exceeded allocated buffer size"); @@ -2509,7 +2505,7 @@ RV_parse_dataset_creation_properties_callback(char *HTTP_response, const void *c for (i = 0; i < YAJL_GET_ARRAY(chunk_dims_obj)->len; i++) { if (i > 0) printf(", "); - printf("%llu", chunk_dims[i]); + printf("%" PRIuHSIZE, chunk_dims[i]); } printf(" ]\n"); #endif diff --git a/src/rest_vol_datatype.c b/src/rest_vol_datatype.c index b6bbceb6..6ae7cf92 100644 --- a/src/rest_vol_datatype.c +++ b/src/rest_vol_datatype.c @@ -1948,7 +1948,7 @@ RV_convert_JSON_to_datatype(const char *type) for (i = 0; i < YAJL_GET_ARRAY(key_obj)->len; i++) { if (i > 0) printf(", "); - printf("%llu", array_dims[i]); + printf("%" PRIuHSIZE, array_dims[i]); } printf("]\n"); #endif @@ -2170,7 +2170,7 @@ RV_convert_JSON_to_datatype(const char *type) memcpy(tmp_vlen_type_buffer + 2, type_class_keys[0], strlen(type_class_keys[0])); #ifdef RV_CONNECTOR_DEBUG - printf("-> Converting variable length datatype's parent type from JSON to hid_t\n", i); + printf("-> Converting variable length datatype's parent type from JSON to hid_t\n"); #endif /* Recursively parse parent datatype from JSON */ diff --git a/src/rest_vol_group.c b/src/rest_vol_group.c index 9c9825a1..6696cca0 100644 --- a/src/rest_vol_group.c +++ b/src/rest_vol_group.c @@ -729,7 +729,7 @@ RV_get_group_info_callback(char *HTTP_response, const void *callback_data_in, vo group_info->nlinks = (hsize_t)YAJL_GET_INTEGER(key_obj); #ifdef RV_CONNECTOR_DEBUG - printf("-> Group had %llu links in it\n\n", group_info->nlinks); + printf("-> Group had %" PRIuHSIZE "links in it\n\n", group_info->nlinks); #endif done: diff --git a/src/rest_vol_link.c b/src/rest_vol_link.c index 88e03f38..b98c555e 100644 --- a/src/rest_vol_link.c +++ b/src/rest_vol_link.c @@ -1574,7 +1574,7 @@ RV_get_link_name_by_idx_callback(char *HTTP_response, const void *callback_data_ FUNC_GOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "link index number larger than number of links"); #ifdef RV_CONNECTOR_DEBUG - printf("-> Retrieving link name of link at index %PRIuHSIZE\n\n", *by_idx_data->idx_p); + printf("-> Retrieving link name of link at index %" PRIuHSIZE "\n\n", *by_idx_data->idx_p); #endif /* Retrieve the nth link name */ diff --git a/src/rest_vol_object.c b/src/rest_vol_object.c index 5c4ea994..0ab5a2b5 100644 --- a/src/rest_vol_object.c +++ b/src/rest_vol_object.c @@ -1127,7 +1127,7 @@ RV_get_object_info_callback(char *HTTP_response, const void *callback_data_in, v obj_info->num_attrs = (hsize_t)YAJL_GET_INTEGER(key_obj); #ifdef RV_CONNECTOR_DEBUG - printf("-> Object had %llu attributes attached to it\n\n", obj_info->num_attrs); + printf("-> Object had %" PRIuHSIZE "attributes attached to it\n\n", obj_info->num_attrs); #endif /* Retrieve the object's class */