Skip to content

Commit

Permalink
Correct types in debug prints
Browse files Browse the repository at this point in the history
  • Loading branch information
mattjala committed Dec 16, 2024
1 parent 82c09e8 commit 0eb679f
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 26 deletions.
4 changes: 2 additions & 2 deletions src/rest_vol.c
Original file line number Diff line number Diff line change
Expand Up @@ -2965,15 +2965,15 @@ 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) {
printf("-> MaxDims: [ ");
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");
}
Expand Down
8 changes: 4 additions & 4 deletions src/rest_vol_attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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");
Expand Down
16 changes: 11 additions & 5 deletions src/rest_vol_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
/* Define to 1 if you have the <mach/mach_time.h> header file. */
#undef HAVE_MACH_MACH_TIME_H

/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H

/* Define to 1 if you have the <setjmp.h> header file. */
#undef HAVE_SETJMP_H

Expand All @@ -48,6 +45,9 @@
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H

/* Define to 1 if you have the <stdio.h> header file. */
#undef HAVE_STDIO_H

/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H

Expand Down Expand Up @@ -81,6 +81,9 @@
/* Define to 1 if you have the <unistd.h> 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

Expand Down Expand Up @@ -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 <sys/time.h> and <time.h>. */
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. This
macro is obsolete. */
#undef TIME_WITH_SYS_TIME

/* Define to have the REST VOL track memory usage. */
Expand Down
16 changes: 6 additions & 10 deletions src/rest_vol_dataset.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand All @@ -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");
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/rest_vol_datatype.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion src/rest_vol_group.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/rest_vol_link.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
2 changes: 1 addition & 1 deletion src/rest_vol_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 0eb679f

Please sign in to comment.