summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/H5.c360
-rw-r--r--src/H5Distore.c6
-rw-r--r--src/H5Fistore.c6
-rw-r--r--src/H5Ipublic.h7
-rw-r--r--src/H5P.c4
-rw-r--r--src/H5S.c13
-rw-r--r--src/H5Spublic.h3
-rw-r--r--src/H5T.c2
8 files changed, 329 insertions, 72 deletions
diff --git a/src/H5.c b/src/H5.c
index 3cb6aed..9f0b9a7 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -93,17 +93,6 @@ H5_init_library(void)
{
FUNC_ENTER_INIT(H5_init_library, NULL, FAIL);
-#ifdef H5_DEBUG_API
- {
- /* Turn on tracing? */
- const char *s = getenv ("HDF5_TRACE");
- if (s && isdigit(*s)) {
- int fd = HDstrtol (s, NULL, 0);
- H5_trace_g = HDfdopen (fd, "w");
- }
- }
-#endif
-
/* Install atexit() library cleanup routine */
if (install_atexit_g == TRUE)
if (HDatexit(&H5_term_library) != 0)
@@ -118,6 +107,18 @@ H5_init_library(void)
HRETURN_ERROR(H5E_FUNC, H5E_CANTINIT, FAIL,
"unable to initialize type interface");
}
+
+#ifdef H5_DEBUG_API
+ {
+ /* Turn on tracing? */
+ const char *s = getenv ("HDF5_TRACE");
+ if (s && isdigit(*s)) {
+ int fd = HDstrtol (s, NULL, 0);
+ H5_trace_g = HDfdopen (fd, "w");
+ }
+ }
+#endif
+
FUNC_LEAVE(SUCCEED);
}
@@ -962,9 +963,11 @@ void
H5_trace (hbool_t returning, const char *func, const char *type, ...)
{
va_list ap;
- char buf[64];
+ char buf[64], *rest;
const char *argname;
- intn argno=0, ptr, n;
+ intn argno=0, ptr, n, asize_idx;
+ hssize_t asize[16];
+ hssize_t i;
void *vp = NULL;
FILE *out = H5_trace_g;
@@ -977,10 +980,28 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
fprintf (out, "%s(", func);
}
- while (*type) {
+ /* Clear array sizes */
+ for (i=0; i<NELMTS(asize); i++) asize[i] = -1;
+
+ /* Parse the argument types */
+ for (argno=0; *type; argno++, type+=isupper(*type)?2:1) {
/* Count levels of indirection */
for (ptr=0; '*'==*type; type++) ptr++;
-
+ if ('['==*type) {
+ if ('a'==type[1]) {
+ asize_idx = strtol(type+2, &rest, 10);
+ assert(']'==*rest);
+ type = rest+1;
+ } else {
+ rest = strchr(type, ']');
+ assert(rest);
+ type = rest+1;
+ asize_idx = -1;
+ }
+ } else {
+ asize_idx = -1;
+ }
+
/*
* The argument name. Leave off the `_id' part. If the argument
* name is the null pointer then don't print the argument or the
@@ -994,7 +1015,7 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
buf[MIN((int)sizeof(buf)-1, n)] = '\0';
argname = buf;
}
- fprintf (out, "%s%s=", argno++?", ":"", argname);
+ fprintf (out, "%s%s=", argno?", ":"", argname);
} else {
argname = "";
}
@@ -1004,7 +1025,11 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
switch (type[0]) {
case 'b':
if (ptr) {
- fprintf (out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
hbool_t bool = va_arg (ap, hbool_t);
if (TRUE==bool) fprintf (out, "TRUE");
@@ -1015,7 +1040,11 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
case 'd':
if (ptr) {
- fprintf (out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
double dbl = va_arg (ap, double);
fprintf (out, "%g", dbl);
@@ -1026,7 +1055,11 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
switch (type[1]) {
case 'l':
if (ptr) {
- fprintf (out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
H5D_layout_t layout = va_arg (ap, H5D_layout_t);
switch (layout) {
@@ -1051,7 +1084,11 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
case 't':
if (ptr) {
- fprintf (out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
H5D_transfer_t transfer = va_arg (ap, H5D_transfer_t);
switch (transfer) {
@@ -1079,7 +1116,11 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
case 'e':
if (ptr) {
- fprintf (out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
herr_t status = va_arg (ap, herr_t);
if (SUCCEED==status) fprintf (out, "SUCCEED");
@@ -1092,7 +1133,11 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
switch (type[1]) {
case 'd':
if (ptr) {
- fprintf (out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
H5E_direction_t direction = va_arg (ap, H5E_direction_t);
switch (direction) {
@@ -1111,7 +1156,11 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
case 'e':
if (ptr) {
- fprintf (out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
H5E_error_t *error = va_arg (ap, H5E_error_t*);
fprintf (out, "0x%lx", (unsigned long)error);
@@ -1128,7 +1177,11 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
switch (type[1]) {
case 'd':
if (ptr) {
- fprintf(out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf(out, "0x%lx", (unsigned long)vp);
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
H5F_driver_t driver = va_arg(ap, H5F_driver_t);
switch (driver) {
@@ -1170,7 +1223,11 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
switch (type[1]) {
case 'l':
if (ptr) {
- fprintf (out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
H5G_link_t link_type = va_arg (ap, H5G_link_t);
switch (link_type) {
@@ -1192,7 +1249,11 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
case 's':
if (ptr) {
- fprintf (out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
H5G_stat_t *statbuf = va_arg (ap, H5G_stat_t*);
fprintf (out, "0x%lx", (unsigned long)statbuf);
@@ -1207,10 +1268,31 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
case 'h':
if (ptr) {
- fprintf (out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ if (asize_idx>=0 && asize[asize_idx]>=0) {
+ hsize_t *p = (hsize_t*)vp;
+ fprintf(out, " {");
+ for (i=0; i<asize[asize_idx]; i++) {
+ if (H5S_UNLIMITED==p[i]) {
+ HDfprintf(out, "%sH5S_UNLIMITED", i?", ":"");
+ } else {
+ HDfprintf(out, "%s%Hu", i?", ":"", p[i]);
+ }
+ }
+ fprintf(out, "}");
+ }
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
hsize_t hsize = va_arg (ap, hsize_t);
- HDfprintf (out, "%Hu", hsize);
+ if (H5S_UNLIMITED==hsize) {
+ HDfprintf(out, "H5S_UNLIMITED");
+ } else {
+ HDfprintf (out, "%Hu", hsize);
+ asize[argno] = (hssize_t)hsize;
+ }
}
break;
@@ -1218,10 +1300,23 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
switch (type[1]) {
case 's':
if (ptr) {
- fprintf (out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ if (asize_idx>=0 && asize[asize_idx]>=0) {
+ hssize_t *p = (hssize_t*)vp;
+ fprintf(out, " {");
+ for (i=0; i<asize[asize_idx]; i++) {
+ HDfprintf(out, "%s%Hd", i?", ":"", p[i]);
+ }
+ fprintf(out, "}");
+ }
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
hssize_t hssize = va_arg (ap, hssize_t);
HDfprintf (out, "%Hd", hssize);
+ asize[argno] = (hssize_t)hssize;
}
break;
@@ -1233,7 +1328,11 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
case 'i':
if (ptr) {
- fprintf (out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
hid_t obj = va_arg (ap, hid_t);
if (-2 == obj) {
@@ -1241,12 +1340,12 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
} else if (FAIL==obj) {
fprintf (out, "FAIL");
} else {
- fprintf (out, "%ld", (long)obj);
switch (H5I_group (obj)) {
case BADGROUP:
- fprintf (out, " (error)");
+ fprintf (out, "%ld (error)", (long)obj);
break;
case H5_FILE:
+ fprintf(out, "%ld", (long)obj);
if (strcmp (argname, "file")) {
fprintf (out, " (file)");
}
@@ -1259,36 +1358,71 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
case H5_TEMPLATE_5:
case H5_TEMPLATE_6:
case H5_TEMPLATE_7:
+ fprintf(out, "%ld", (long)obj);
if (strcmp (argname, "plist")) {
fprintf (out, " (plist)");
}
break;
case H5_GROUP:
+ fprintf(out, "%ld", (long)obj);
if (strcmp (argname, "group")) {
fprintf (out, " (group)");
}
break;
case H5_DATATYPE:
- if (strcmp (argname, "type")) {
- fprintf (out, " (type)");
+ if (obj==H5T_NATIVE_CHAR_g) {
+ fprintf(out, "H5T_NATIVE_CHAR");
+ } else if (obj==H5T_NATIVE_UCHAR_g) {
+ fprintf(out, "H5T_NATIVE_UCHAR");
+ } else if (obj==H5T_NATIVE_SHORT_g) {
+ fprintf(out, "H5T_NATIVE_SHORT");
+ } else if (obj==H5T_NATIVE_USHORT_g) {
+ fprintf(out, "H5T_NATIVE_USHORT");
+ } else if (obj==H5T_NATIVE_INT_g) {
+ fprintf(out, "H5T_NATIVE_INT");
+ } else if (obj==H5T_NATIVE_UINT_g) {
+ fprintf(out, "H5T_NATIVE_UINT");
+ } else if (obj==H5T_NATIVE_LONG_g) {
+ fprintf(out, "H5T_NATIVE_LONG");
+ } else if (obj==H5T_NATIVE_ULONG_g) {
+ fprintf(out, "H5T_NATIVE_ULONG");
+ } else if (obj==H5T_NATIVE_LLONG_g) {
+ fprintf(out, "H5T_NATIVE_LLONG");
+ } else if (obj==H5T_NATIVE_ULLONG_g) {
+ fprintf(out, "H5T_NATIVE_ULLONG");
+ } else if (obj==H5T_NATIVE_FLOAT_g) {
+ fprintf(out, "H5T_NATIVE_FLOAT");
+ } else if (obj==H5T_NATIVE_DOUBLE_g) {
+ fprintf(out, "H5T_NATIVE_DOUBLE");
+ } else if (obj==H5T_NATIVE_LDOUBLE_g) {
+ fprintf(out, "H5T_NATIVE_LDOUBLE");
+ } else {
+ fprintf(out, "%ld", (long)obj);
+ if (strcmp (argname, "type")) {
+ fprintf (out, " (type)");
+ }
}
break;
case H5_DATASPACE:
+ fprintf(out, "%ld", (long)obj);
if (strcmp (argname, "space")) {
fprintf (out, " (space)");
}
break;
case H5_DATASET:
+ fprintf(out, "%ld", (long)obj);
if (strcmp (argname, "dset")) {
fprintf (out, " (dset)");
}
break;
case H5_ATTR:
+ fprintf(out, "%ld", (long)obj);
if (strcmp (argname, "attr")) {
fprintf (out, " (attr)");
}
break;
default:
+ fprintf(out, "%ld", (long)obj);
fprintf (out, " (unknown class)");
break;
}
@@ -1300,19 +1434,45 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
switch (type[1]) {
case 's':
if (ptr) {
- fprintf (out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ if (asize_idx>=0 && asize[asize_idx]>=0) {
+ int *p = (int*)vp;
+ fprintf(out, " {");
+ for (i=0; i<asize[asize_idx]; i++) {
+ fprintf(out, "%s%d", i?", ":"", p[i]);
+ }
+ fprintf(out, "}");
+ }
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
int is = va_arg (ap, int);
fprintf (out, "%d", is);
+ asize[argno] = is;
}
break;
case 'u':
if (ptr) {
- fprintf (out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ if (asize_idx>=0 && asize[asize_idx]>=0) {
+ int *p = (int*)vp;
+ fprintf(out, " {");
+ for (i=0; i<asize[asize_idx]; i++) {
+ HDfprintf(out, "%s%Hu", i?", ":"", p[i]);
+ }
+ fprintf(out, "}");
+ }
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
unsigned iu = va_arg (ap, unsigned);
fprintf (out, "%u", iu);
+ asize[argno] = iu;
}
break;
@@ -1326,7 +1486,11 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
switch (type[1]) {
case 'c':
if (ptr) {
- fprintf (out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
#ifdef HAVE_PARALLEL
MPI_Comm comm = va_arg (ap, MPI_Comm);
@@ -1336,7 +1500,11 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
break;
case 'i':
if (ptr) {
- fprintf (out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
#ifdef HAVE_PARALLEL
MPI_Info info = va_arg (ap, MPI_Info);
@@ -1351,7 +1519,11 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
case 'o':
if (ptr) {
- fprintf (out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
off_t offset = va_arg (ap, off_t);
fprintf (out, "%ld", (long)offset);
@@ -1360,7 +1532,11 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
case 'p':
if (ptr) {
- fprintf (out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
H5P_class_t plist_class = va_arg (ap, H5P_class_t);
switch (plist_class) {
@@ -1390,7 +1566,11 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
switch (type[1]) {
case 'c':
if (ptr) {
- fprintf(out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf(out, "0x%lx", (unsigned long)vp);
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
H5S_class_t cls = va_arg(ap, H5S_class_t);
switch (cls) {
@@ -1415,7 +1595,11 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
case 's':
if (ptr) {
- fprintf(out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf(out, "0x%lx", (unsigned long)vp);
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
H5S_seloper_t so = va_arg(ap, H5S_seloper_t);
switch (so) {
@@ -1440,7 +1624,11 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
case 's':
if (ptr) {
- fprintf (out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
const char *str = va_arg (ap, const char*);
fprintf (out, "\"%s\"", str);
@@ -1451,7 +1639,11 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
switch (type[1]) {
case 'c':
if (ptr) {
- fprintf (out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
H5T_cset_t cset = va_arg (ap, H5T_cset_t);
switch (cset) {
@@ -1470,7 +1662,11 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
case 'n':
if (ptr) {
- fprintf (out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
H5T_norm_t norm = va_arg (ap, H5T_norm_t);
switch (norm) {
@@ -1495,7 +1691,11 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
case 'o':
if (ptr) {
- fprintf (out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
H5T_order_t order = va_arg (ap, H5T_order_t);
switch (order) {
@@ -1523,7 +1723,11 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
case 'p':
if (ptr) {
- fprintf (out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
H5T_pad_t pad = va_arg (ap, H5T_pad_t);
switch (pad) {
@@ -1548,7 +1752,11 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
case 's':
if (ptr) {
- fprintf (out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
H5T_sign_t sign = va_arg (ap, H5T_sign_t);
switch (sign) {
@@ -1570,7 +1778,11 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
case 't':
if (ptr) {
- fprintf (out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
H5T_class_t type_class = va_arg (ap, H5T_class_t);
switch (type_class) {
@@ -1607,7 +1819,11 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
case 'z':
if (ptr) {
- fprintf (out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
H5T_str_t str = va_arg (ap, H5T_str_t);
switch (str) {
@@ -1635,7 +1851,11 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
case 'x':
if (ptr) {
- fprintf (out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
vp = va_arg (ap, void*);
fprintf (out, "0x%lx", (unsigned long)vp);
@@ -1644,10 +1864,23 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
case 'z':
if (ptr) {
- fprintf (out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ if (asize_idx>=0 && asize[asize_idx]>=0) {
+ size_t *p = (size_t*)vp;
+ fprintf(out, " {");
+ for (i=0; i<asize[asize_idx]; i++) {
+ HDfprintf(out, "%s%Zu", i?", ":"", p[i]);
+ }
+ fprintf(out, "}");
+ }
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
size_t size = va_arg (ap, size_t);
HDfprintf (out, "%Zu", size);
+ asize[argno] = (hssize_t)size;
}
break;
@@ -1655,7 +1888,11 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
switch (type[1]) {
case 'm':
if (ptr) {
- fprintf (out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
H5Z_method_t zmeth = va_arg (ap, H5Z_method_t);
if (zmeth<0) {
@@ -1676,10 +1913,23 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
case 's':
if (ptr) {
- fprintf (out, "0x%lx", (unsigned long)vp);
+ if (vp) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ if (vp && asize_idx>=0 && asize[asize_idx]>=0) {
+ ssize_t *p = (ssize_t*)vp;
+ fprintf(out, " {");
+ for (i=0; i<asize[asize_idx]; i++) {
+ HDfprintf(out, "%s%Zd", i?", ":"", p[i]);
+ }
+ fprintf(out, "}");
+ }
+ } else {
+ fprintf(out, "NULL");
+ }
} else {
ssize_t ssize = va_arg (ap, ssize_t);
HDfprintf (out, "%Zd", ssize);
+ asize[argno] = (hssize_t)ssize;
}
break;
@@ -1697,8 +1947,6 @@ H5_trace (hbool_t returning, const char *func, const char *type, ...)
}
goto error;
}
-
- type += isupper(*type)?2:1;
}
error:
diff --git a/src/H5Distore.c b/src/H5Distore.c
index 8c9d22e..262a58f 100644
--- a/src/H5Distore.c
+++ b/src/H5Distore.c
@@ -994,7 +994,8 @@ H5F_istore_lock (H5F_t *f, const H5O_layout_t *layout,
/* First use the hint */
if (idx_hint && *idx_hint>=0 && *idx_hint<rdcc->nused) {
ent = rdcc->slot + *idx_hint;
- if (layout->ndims==ent->layout->ndims) {
+ if (layout->ndims==ent->layout->ndims &&
+ H5F_addr_eq(&(layout->addr), &(ent->layout->addr))) {
for (i=0, found=*idx_hint; found>=0 && i<ent->layout->ndims; i++) {
if (offset[i]!=ent->offset[i]) found = -1;
}
@@ -1004,7 +1005,8 @@ H5F_istore_lock (H5F_t *f, const H5O_layout_t *layout,
/* Then look at all the entries */
for (i=0; found<0 && i<rdcc->nused; i++) {
ent = rdcc->slot + i;
- if (layout->ndims==ent->layout->ndims) {
+ if (layout->ndims==ent->layout->ndims &&
+ H5F_addr_eq(&(layout->addr), &(ent->layout->addr))) {
for (j=0, found=i; found>=0 && j<ent->layout->ndims; j++) {
if (offset[j]!=ent->offset[j]) found = -1;
}
diff --git a/src/H5Fistore.c b/src/H5Fistore.c
index 8c9d22e..262a58f 100644
--- a/src/H5Fistore.c
+++ b/src/H5Fistore.c
@@ -994,7 +994,8 @@ H5F_istore_lock (H5F_t *f, const H5O_layout_t *layout,
/* First use the hint */
if (idx_hint && *idx_hint>=0 && *idx_hint<rdcc->nused) {
ent = rdcc->slot + *idx_hint;
- if (layout->ndims==ent->layout->ndims) {
+ if (layout->ndims==ent->layout->ndims &&
+ H5F_addr_eq(&(layout->addr), &(ent->layout->addr))) {
for (i=0, found=*idx_hint; found>=0 && i<ent->layout->ndims; i++) {
if (offset[i]!=ent->offset[i]) found = -1;
}
@@ -1004,7 +1005,8 @@ H5F_istore_lock (H5F_t *f, const H5O_layout_t *layout,
/* Then look at all the entries */
for (i=0; found<0 && i<rdcc->nused; i++) {
ent = rdcc->slot + i;
- if (layout->ndims==ent->layout->ndims) {
+ if (layout->ndims==ent->layout->ndims &&
+ H5F_addr_eq(&(layout->addr), &(ent->layout->addr))) {
for (j=0, found=i; found>=0 && j<ent->layout->ndims; j++) {
if (offset[j]!=ent->offset[j]) found = -1;
}
diff --git a/src/H5Ipublic.h b/src/H5Ipublic.h
index 74b0bd8..e673734 100644
--- a/src/H5Ipublic.h
+++ b/src/H5Ipublic.h
@@ -20,10 +20,13 @@
/* Public headers needed by this file */
#include <H5public.h>
-/* Group values allowed */
+/*
+ * Group values allowed. Start with `1' instead of `0' because it makes the
+ * tracing output look better when hid_t values are large numbers.
+ */
typedef enum {
BADGROUP = (-1),/*invalid Group */
- H5_FILE = 0, /*group ID for File objects */
+ H5_FILE = 1, /*group ID for File objects */
H5_TEMPLATE_0, /*group ID for Template objects */
H5_TEMPLATE_1, /*group ID for Template objects */
H5_TEMPLATE_2, /*group ID for Template objects */
diff --git a/src/H5P.c b/src/H5P.c
index 459e7d6..c40d7c3 100644
--- a/src/H5P.c
+++ b/src/H5P.c
@@ -1038,13 +1038,13 @@ H5Pget_layout (hid_t tid)
*-------------------------------------------------------------------------
*/
herr_t
-H5Pset_chunk (hid_t tid, int ndims, const hsize_t dim[])
+H5Pset_chunk (hid_t tid, int ndims, const hsize_t dim[/*ndims*/])
{
int i;
H5D_create_t *tmpl = NULL;
FUNC_ENTER(H5Pset_chunk, FAIL);
- H5TRACE3("e","iIs*h",tid,ndims,dim);
+ H5TRACE3("e","iIs*[a1]h",tid,ndims,dim);
/* Check arguments */
if (H5P_DATASET_CREATE != H5P_get_class(tid) ||
diff --git a/src/H5S.c b/src/H5S.c
index 215267b..4905aed 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -1029,14 +1029,14 @@ H5Sis_simple (hid_t sid)
dimension in the array (the slowest) may be unlimited in size.
--------------------------------------------------------------------------*/
herr_t
-H5Sset_extent_simple (hid_t sid, int rank, const hsize_t *dims,
- const hsize_t *max)
+H5Sset_extent_simple (hid_t sid, int rank, const hsize_t dims[/*rank*/],
+ const hsize_t max[/*rank*/])
{
H5S_t *space = NULL; /* dataspace to modify */
intn u; /* local counting variable */
FUNC_ENTER(H5Sset_extent_simple, FAIL);
- H5TRACE4("e","iIs*h*h",sid,rank,dims,max);
+ H5TRACE4("e","iIs*[a1]h*[a1]h",sid,rank,dims,max);
/* Check args */
if ((space = H5I_object(sid)) == NULL) {
@@ -1382,14 +1382,15 @@ H5S_extend (H5S_t *space, const hsize_t *size)
*-------------------------------------------------------------------------
*/
hid_t
-H5Screate_simple (int rank, const hsize_t *dims, const hsize_t *maxdims)
+H5Screate_simple (int rank, const hsize_t dims[/*rank*/],
+ const hsize_t maxdims[/*rank*/])
{
hid_t ret_value = FAIL;
H5S_t *space = NULL;
int i;
- FUNC_ENTER(H5Screate, FAIL);
- H5TRACE3("i","Is*h*h",rank,dims,maxdims);
+ FUNC_ENTER(H5Screate_simple, FAIL);
+ H5TRACE3("i","Is*[a0]h*[a0]h",rank,dims,maxdims);
/* Check arguments */
if (rank<0) {
diff --git a/src/H5Spublic.h b/src/H5Spublic.h
index 022f108..68a5fd1 100644
--- a/src/H5Spublic.h
+++ b/src/H5Spublic.h
@@ -45,7 +45,8 @@ extern "C" {
/* Functions in H5S.c */
hid_t H5Screate(H5S_class_t type);
hid_t H5Screate_simple (int rank, const hsize_t dims[], const hsize_t maxdims[]);
-herr_t H5Sset_extent_simple (hid_t sid, int rank, const hsize_t *dims, const hsize_t *max);
+herr_t H5Sset_extent_simple (hid_t sid, int rank, const hsize_t dims[],
+ const hsize_t max[]);
hid_t H5Scopy (hid_t space_id);
herr_t H5Sclose (hid_t space_id);
hsize_t H5Sextent_npoints (hid_t space_id);
diff --git a/src/H5T.c b/src/H5T.c
index 11eef4b..bf0f03b 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -615,7 +615,7 @@ H5T_init_interface(void)
HRETURN_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL,
"unable to register conversion function");
}
-
+
FUNC_LEAVE(ret_value);
}