diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2004-09-01 17:43:30 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2004-09-01 17:43:30 (GMT) |
commit | cb7f03a26ff906175e5bf37af57547681683770f (patch) | |
tree | d8d167353c83fe6caebc6df15c33ca1c7f6dc521 /src | |
parent | 226f162ce75ff63e3d1468d17528ba629c51db58 (diff) | |
download | hdf5-cb7f03a26ff906175e5bf37af57547681683770f.zip hdf5-cb7f03a26ff906175e5bf37af57547681683770f.tar.gz hdf5-cb7f03a26ff906175e5bf37af57547681683770f.tar.bz2 |
[svn-r9183] Purpose: New feature
Description: Restore 6 old error API functions back to the library to be backward
compatible with v1.6. They are H5Epush, H5Eprint, H5Ewalk, H5Eclear, H5Eset_auto,
H5Eget_auto. These functions do not have error stack as parameter.
Solution: Internally, these functions use default error stack.
Platforms tested: h5committest and fuss.
Misc. update: RELEASE.txt
Diffstat (limited to 'src')
-rw-r--r-- | src/H5.c | 6 | ||||
-rw-r--r-- | src/H5A.c | 8 | ||||
-rw-r--r-- | src/H5AC.c | 2 | ||||
-rw-r--r-- | src/H5D.c | 8 | ||||
-rw-r--r-- | src/H5Distore.c | 4 | ||||
-rw-r--r-- | src/H5E.c | 202 | ||||
-rw-r--r-- | src/H5Eprivate.h | 6 | ||||
-rw-r--r-- | src/H5Epublic.h | 79 | ||||
-rw-r--r-- | src/H5F.c | 2 | ||||
-rw-r--r-- | src/H5FDfamily.c | 2 | ||||
-rw-r--r-- | src/H5FDmulti.c | 156 | ||||
-rw-r--r-- | src/H5FDstdio.c | 72 | ||||
-rw-r--r-- | src/H5G.c | 12 | ||||
-rw-r--r-- | src/H5Gnode.c | 6 | ||||
-rw-r--r-- | src/H5HL.c | 2 | ||||
-rw-r--r-- | src/H5I.c | 2 | ||||
-rw-r--r-- | src/H5MPprivate.h | 6 | ||||
-rw-r--r-- | src/H5O.c | 6 | ||||
-rw-r--r-- | src/H5T.c | 14 | ||||
-rw-r--r-- | src/H5Z.c | 8 | ||||
-rw-r--r-- | src/H5private.h | 2 | ||||
-rwxr-xr-x | src/hdf5.lnt | 2 |
22 files changed, 194 insertions, 413 deletions
@@ -194,11 +194,7 @@ H5_term_library(void) goto done; /* Check if we should display error output */ -#ifdef H5_WANT_H5_V1_6_COMPAT - (void)H5Eget_auto(&func,NULL); -#else - (void)H5Eget_auto(H5E_DEFAULT,&func,NULL); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + (void)H5Eget_auto_stack(H5E_DEFAULT,&func,NULL); /* * Terminate each interface. The termination functions return a positive @@ -293,7 +293,7 @@ H5A_create(const H5G_entry_t *ent, const char *name, const H5T_t *type, HGOTO_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't release attribute info") seq++; } - H5E_clear(NULL); + H5E_clear_stack(NULL); /* Create the attribute message and save the attribute index */ if (H5O_modify(&(attr->ent), H5O_ATTR_ID, H5O_NEW_MESG, 0, 1, attr, dxpl_id) < 0) @@ -365,7 +365,7 @@ H5A_get_index(H5G_entry_t *ent, const char *name, hid_t dxpl_id) HGOTO_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't release attribute info") i++; } - H5E_clear(NULL); + H5E_clear_stack(NULL); if(ret_value<0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "attribute not found") @@ -1346,7 +1346,7 @@ H5Aiterate(hid_t loc_id, unsigned *attr_num, H5A_operator_t op, void *op_data) if(H5O_reset (H5O_ATTR_ID, &found_attr)<0) HGOTO_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't release attribute info") } - H5E_clear(NULL); + H5E_clear_stack(NULL); } else if(start_idx>0) @@ -1421,7 +1421,7 @@ H5Adelete(hid_t loc_id, const char *name) HGOTO_ERROR(H5E_ATTR, H5E_CANTFREE, FAIL, "can't release attribute info") idx++; } - H5E_clear(NULL); + H5E_clear_stack(NULL); if (found<0) HGOTO_ERROR(H5E_ATTR, H5E_NOTFOUND, FAIL, "attribute not found") @@ -276,7 +276,7 @@ H5AC_term_interface(void) if (H5I_dec_ref(H5AC_dxpl_id) < 0 || H5I_dec_ref(H5AC_noblock_dxpl_id) < 0 || H5I_dec_ref(H5AC_ind_dxpl_id) < 0) - H5E_clear(NULL); /*ignore error*/ + H5E_clear_stack(NULL); /*ignore error*/ else { /* Reset static IDs */ H5AC_dxpl_id=(-1); @@ -2487,7 +2487,7 @@ H5D_open(H5G_entry_t *ent, hid_t dxpl_id) H5D_t *dataset; /*the dataset which was found */ /* Clear any errors from H5FO_opened() */ - H5E_clear(NULL); + H5E_clear_stack(NULL); /* Open the dataset object */ if ((dataset=H5D_open_oid(ent, dxpl_id)) ==NULL) @@ -2593,7 +2593,7 @@ H5D_open_oid(const H5G_entry_t *ent, hid_t dxpl_id) /* Get the optional filters message */ if(NULL == H5O_read(&(dataset->ent), H5O_PLINE_ID, 0, &pline, dxpl_id)) { - H5E_clear(NULL); + H5E_clear_stack(NULL); HDmemset(&pline, 0, sizeof(pline)); } if(H5P_set(plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0) @@ -2668,7 +2668,7 @@ H5D_open_oid(const H5G_entry_t *ent, hid_t dxpl_id) /* Get the new fill value message */ if(NULL == H5O_read(&(dataset->ent), H5O_FILL_NEW_ID, 0, &fill, dxpl_id)) { - H5E_clear(NULL); + H5E_clear_stack(NULL); HDmemset(&fill, 0, sizeof(fill)); /* Set the space allocation time appropriately, based on the type of dataset storage */ @@ -2699,7 +2699,7 @@ H5D_open_oid(const H5G_entry_t *ent, hid_t dxpl_id) /* For compatibility with v1.4. Retrieve the old fill value message. * If size is 0, make it -1 for undefined. */ if(NULL == H5O_read(&(dataset->ent), H5O_FILL_ID, 0, fill_prop, dxpl_id)) { - H5E_clear(NULL); + H5E_clear_stack(NULL); HDmemset(fill_prop, 0, sizeof(H5O_fill_t)); } if(fill_prop->size == 0) { diff --git a/src/H5Distore.c b/src/H5Distore.c index 5182d29..6135e83 100644 --- a/src/H5Distore.c +++ b/src/H5Distore.c @@ -1571,7 +1571,7 @@ H5D_istore_lock(H5F_t *f, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, #ifdef OLD_WAY /* Clear the error stack from not finding the chunk on disk */ - H5E_clear(NULL); + H5E_clear_stack(NULL); #endif /* OLD_WAY */ /* Chunk size on disk isn't [likely] the same size as the final chunk @@ -2266,7 +2266,7 @@ H5D_istore_get_addr(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout, * if a chunk exists in the B-tree or not. -QAK */ #ifdef OLD_WAY - H5E_clear(NULL); + H5E_clear_stack(NULL); HGOTO_ERROR(H5E_BTREE,H5E_NOTFOUND,HADDR_UNDEF,"Can't locate chunk info"); #else /* OLD_WAY */ @@ -108,17 +108,13 @@ static herr_t H5E_set_current_stack(H5E_t *estack); static herr_t H5E_close_stack(H5E_t *err_stack); static int H5E_get_num(const H5E_t *err_stack); static herr_t H5E_pop(H5E_t *err_stack, size_t count); -static herr_t H5E_clear_entries(H5E_t *estack, size_t nentries); -static herr_t H5E_print(const H5E_t *estack, FILE *stream); -static herr_t H5E_walk (const H5E_t *estack, H5E_direction_t direction, H5E_walk_t func, +static herr_t H5E_clear_entries(H5E_t *estack, unsigned nentries); +static herr_t H5E_print_stack(const H5E_t *estack, FILE *stream); +static herr_t H5E_walk_stack(const H5E_t *estack, H5E_direction_t direction, H5E_walk_t func, void *client_data); -#ifdef H5_WANT_H5_V1_6_COMPAT -static herr_t H5E_walk_cb(int n, H5E_error_t *err_desc, void *client_data); -#else /* H5_WANT_H5_V1_6_COMPAT */ static herr_t H5E_walk_cb(unsigned n, const H5E_error_t *err_desc, void *client_data); -#endif /* H5_WANT_H5_V1_6_COMPAT */ -static herr_t H5E_get_auto(const H5E_t *estack, H5E_auto_t *func, void **client_data); -static herr_t H5E_set_auto(H5E_t *estack, H5E_auto_t func, void *client_data); +static herr_t H5E_get_auto_stack(const H5E_t *estack, H5E_auto_t *func, void **client_data); +static herr_t H5E_set_auto_stack(H5E_t *estack, H5E_auto_t func, void *client_data); /*------------------------------------------------------------------------- @@ -186,7 +182,11 @@ H5E_init_interface(void) #ifndef H5_HAVE_THREADSAFE H5E_stack_g[0].nused = 0; +#ifdef H5_WANT_H5_V1_6_COMPAT H5E_stack_g[0].func = (H5E_auto_t)H5Eprint; +#else /*H5_WANT_H5_V1_6_COMPAT*/ + H5E_stack_g[0].func = (H5E_auto_t)H5Eprint_stack; +#endif /*H5_WANT_H5_V1_6_COMPAT*/ H5E_stack_g[0].auto_data = NULL; #endif /* H5_HAVE_THREADSAFE */ @@ -310,7 +310,7 @@ H5E_get_stack(void) /* no associated value with current thread - create one */ estack = (H5E_t *)H5MM_malloc(sizeof(H5E_t)); estack->nused = 0; - estack->func = (H5E_auto_t)H5Eprint; + estack->func = (H5E_auto_t)H5Eprint_stack; estack->auto_data = NULL; pthread_setspecific(H5TS_errstk_key_g, (void *)estack); } @@ -767,7 +767,6 @@ done: FUNC_LEAVE_NOAPI(ret_value) } -#ifdef H5_WANT_H5_V1_6_COMPAT /*------------------------------------------------------------------------- * Function: H5Eget_major @@ -867,7 +866,6 @@ H5Eget_minor(H5E_minor_t min) done: FUNC_LEAVE_API(ret_value) } -#endif /* H5_WANT_H5_V1_6_COMPAT */ /*------------------------------------------------------------------------- @@ -1054,7 +1052,7 @@ H5E_get_current_stack(void) } /* end for */ /* Empty current error stack */ - H5E_clear(current_stack); + H5E_clear_stack(current_stack); /* Set the return value */ ret_value = estack_copy; @@ -1137,7 +1135,7 @@ H5E_set_current_stack(H5E_t *estack) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack") /* Empty current error stack */ - H5E_clear(current_stack); + H5E_clear_stack(current_stack); /* Copy new stack to current error stack */ current_stack->nused = estack->nused; @@ -1233,7 +1231,7 @@ H5E_close_stack(H5E_t *estack) assert(estack); /* Release the stack's error information */ - H5E_clear(estack); + H5E_clear_stack(estack); /* Free the stack structure */ H5MM_xfree((void*)estack); @@ -1274,7 +1272,7 @@ H5Eget_num(hid_t error_stack_id) } /* end if */ else { /* Only clear the error stack if it's not the default stack */ - H5E_clear(NULL); + H5E_clear_stack(NULL); /* Get the error stack to operate on */ if((estack = H5I_object_verify(error_stack_id, H5I_ERROR_STACK))==NULL) @@ -1351,7 +1349,7 @@ H5Epop(hid_t err_stack, size_t count) } /* end if */ else { /* Only clear the error stack if it's not the default stack */ - H5E_clear(NULL); + H5E_clear_stack(NULL); /* Get the error stack to operate on */ if((estack = H5I_object_verify(err_stack, H5I_ERROR_STACK))==NULL) @@ -1405,7 +1403,6 @@ done: FUNC_LEAVE_NOAPI(ret_value) } -#ifdef H5_WANT_H5_V1_6_COMPAT /*------------------------------------------------------------------------- * Function: H5Epush @@ -1420,7 +1417,10 @@ done: * Programmer: Raymond Lu * Tuesday, Sep 16, 2003 * - * Notes: Basically a public API wrapper around the H5E_push function. + * Notes: Basically a public API wrapper around the H5E_push_stack + * function. For backward compatibility, it maintains the + * same parameter as the old function, in contrary to + * H5Epush_stack. * * Modifications: * @@ -1438,17 +1438,16 @@ H5Epush(const char *file, const char *func, unsigned line, H5TRACE6("e","ssIuiis",file,func,line,maj,min,str); /* Push the error on the stack */ - if(H5E_push(estack, file, func, line, H5E_ERR_CLS_g, maj, min, str)<0) + if(H5E_push_stack(estack, file, func, line, H5E_ERR_CLS_g, maj, min, str)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTSET, FAIL, "can't push error on stack") done: FUNC_LEAVE_API(ret_value) } -#else /* H5_WANT_H5_V1_6_COMPAT */ /*------------------------------------------------------------------------- - * Function: H5Epush + * Function: H5Epush_stack * * Purpose: Pushes a new error record onto error stack for the current * thread. The error has major and minor IDs MAJ_ID and @@ -1463,7 +1462,8 @@ done: * Programmer: Quincey Koziol * Monday, October 18, 1999 * - * Notes: Basically a public API wrapper around the H5E_push function. + * Notes: Basically a new public API wrapper around the H5E_push_stack + * function. * * Modifications: * Raymond Lu @@ -1476,7 +1476,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Epush(hid_t err_stack, const char *file, const char *func, unsigned line, +H5Epush_stack(hid_t err_stack, const char *file, const char *func, unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *fmt, ...) { va_list ap; /* Varargs info */ @@ -1486,14 +1486,14 @@ H5Epush(hid_t err_stack, const char *file, const char *func, unsigned line, herr_t ret_value=SUCCEED; /* Return value */ /* Don't clear the error stack! :-) */ - FUNC_ENTER_API_NOCLEAR(H5Epush, FAIL) + FUNC_ENTER_API_NOCLEAR(H5Epush_stack, FAIL) H5TRACE7("e","issIuiis",err_stack,file,func,line,maj_id,min_id,fmt); if(err_stack == H5E_DEFAULT) estack = NULL; else { /* Only clear the error stack if it's not the default stack */ - H5E_clear(NULL); + H5E_clear_stack(NULL); /* Get the error stack to operate on */ if((estack = H5I_object_verify(err_stack, H5I_ERROR_STACK))==NULL) @@ -1514,17 +1514,16 @@ H5Epush(hid_t err_stack, const char *file, const char *func, unsigned line, va_end(ap); /* Push the error on the stack */ - if(H5E_push(estack, file, func, line, cls_id, maj_id, min_id, tmp)<0) + if(H5E_push_stack(estack, file, func, line, cls_id, maj_id, min_id, tmp)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTSET, FAIL, "can't push error on stack") done: FUNC_LEAVE_API(ret_value) } -#endif /* H5_WANT_H5_V1_6_COMPAT */ /*------------------------------------------------------------------------- - * Function: H5E_push + * Function: H5E_push_stack * * Purpose: Pushes a new error record onto error stack for the current * thread. The error has major and minor IDs MAJ_ID and @@ -1552,7 +1551,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5E_push(H5E_t *estack, const char *file, const char *func, unsigned line, +H5E_push_stack(H5E_t *estack, const char *file, const char *func, unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *desc) { herr_t ret_value=SUCCEED; /* Return value */ @@ -1564,7 +1563,7 @@ H5E_push(H5E_t *estack, const char *file, const char *func, unsigned line, * HERROR(). HERROR() is called by HRETURN_ERROR() which could * be called by FUNC_ENTER(). */ - FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_push) + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_push_stack) /* Sanity check */ assert(cls_id>0); @@ -1614,7 +1613,6 @@ done: FUNC_LEAVE_NOAPI(ret_value) } -#ifdef H5_WANT_H5_V1_6_COMPAT /*------------------------------------------------------------------------- * Function: H5Eclear @@ -1642,17 +1640,16 @@ H5Eclear(void) H5TRACE0("e",""); /* Clear the error stack */ - if(H5E_clear(estack)<0) + if(H5E_clear_stack(estack)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTSET, FAIL, "can't clear error stack") done: FUNC_LEAVE_API(ret_value) } -#else /*------------------------------------------------------------------------- - * Function: H5Eclear + * Function: H5Eclear_stack * * Purpose: Clears the error stack for the specified error stack. * @@ -1666,13 +1663,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Eclear(hid_t err_stack) +H5Eclear_stack(hid_t err_stack) { H5E_t *estack; /* Error stack to operate on */ herr_t ret_value=SUCCEED; /* Return value */ /* Don't clear the error stack! :-) */ - FUNC_ENTER_API_NOCLEAR(H5Eclear, FAIL) + FUNC_ENTER_API_NOCLEAR(H5Eclear_stack, FAIL) H5TRACE1("e","i",err_stack); /* Need to check for errors */ @@ -1680,20 +1677,19 @@ H5Eclear(hid_t err_stack) estack = NULL; else { /* Only clear the error stack if it's not the default stack */ - H5E_clear(NULL); + H5E_clear_stack(NULL); if((estack = H5I_object_verify(err_stack, H5I_ERROR_STACK))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error stack ID") } /* end else */ /* Clear the error stack */ - if(H5E_clear(estack)<0) + if(H5E_clear_stack(estack)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTSET, FAIL, "can't clear error stack") done: FUNC_LEAVE_API(ret_value) } -#endif /* H5_WANT_H5_V1_6_COMPAT */ /*------------------------------------------------------------------------- @@ -1712,7 +1708,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5E_clear_entries(H5E_t *estack, size_t nentries) +H5E_clear_entries(H5E_t *estack, unsigned nentries) { H5E_error_t *error; /* Pointer to error stack entry to clear */ unsigned u; /* Local index variable */ @@ -1755,7 +1751,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5E_clear + * Function: H5E_clear_stack * * Purpose: Private function to clear the error stack for the * specified error stack. @@ -1770,11 +1766,11 @@ done: *------------------------------------------------------------------------- */ herr_t -H5E_clear(H5E_t *estack) +H5E_clear_stack(H5E_t *estack) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5E_clear, FAIL) + FUNC_ENTER_NOAPI(H5E_clear_stack, FAIL) /* Check for 'default' error stack */ if(estack==NULL) @@ -1791,7 +1787,6 @@ done: FUNC_LEAVE_NOAPI(ret_value) } -#ifdef H5_WANT_H5_V1_6_COMPAT /*------------------------------------------------------------------------- * Function: H5Eprint * @@ -1828,17 +1823,16 @@ H5Eprint(FILE *stream) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack") /* Print error stack */ - if(H5E_print(estack, stream)<0) + if(H5E_print_stack(estack, stream)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTLIST, FAIL, "can't display error stack") done: FUNC_LEAVE_API(ret_value) } -#else /*------------------------------------------------------------------------- - * Function: H5Eprint + * Function: H5Eprint_stack * * Purpose: Prints the error stack in some default way. This is just a * convenience function for H5Ewalk() with a function that @@ -1864,13 +1858,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Eprint(hid_t err_stack, FILE *stream) +H5Eprint_stack(hid_t err_stack, FILE *stream) { H5E_t *estack; /* Error stack to operate on */ herr_t ret_value=SUCCEED; /* Return value */ /* Don't clear the error stack! :-) */ - FUNC_ENTER_API_NOCLEAR(H5Eprint, FAIL) + FUNC_ENTER_API_NOCLEAR(H5Eprint_stack, FAIL) /*NO TRACE*/ /* Need to check for errors */ @@ -1880,29 +1874,29 @@ H5Eprint(hid_t err_stack, FILE *stream) } /* end if */ else { /* Only clear the error stack if it's not the default stack */ - H5E_clear(NULL); + H5E_clear_stack(NULL); if((estack = H5I_object_verify(err_stack, H5I_ERROR_STACK))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error stack ID") } /* end else */ /* Print error stack */ - if(H5E_print(estack, stream)<0) + if(H5E_print_stack(estack, stream)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTLIST, FAIL, "can't display error stack") done: FUNC_LEAVE_API(ret_value) } -#endif /* H5_WANT_H5_V1_6_COMPAT */ /*------------------------------------------------------------------------- - * Function: H5E_print + * Function: H5E_print_stack * * Purpose: Private function to print the error stack in some default - * way. This is just a convenience function for H5Ewalk() - * with a function that prints error messages. Users are - * encouraged to write there own more specific error handlers. + * way. This is just a convenience function for H5Ewalk() and + * H5Ewalk_stack() with a function that prints error messages. + * Users are encouraged to write there own more specific error + * handlers. * * Return: Non-negative on success/Negative on failure * @@ -1923,13 +1917,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5E_print(const H5E_t *estack, FILE *stream) +H5E_print_stack(const H5E_t *estack, FILE *stream) { H5E_print_t eprint; /* Callback information to pass to H5E_walk_cb() */ herr_t ret_value = SUCCEED; /* Don't clear the error stack! :-) */ - FUNC_ENTER_NOAPI(H5E_print, FAIL) + FUNC_ENTER_NOAPI(H5E_print_stack, FAIL) /* Sanity check */ assert(estack); @@ -1944,14 +1938,13 @@ H5E_print(const H5E_t *estack, FILE *stream) HDmemset(&eprint.cls,0,sizeof(H5E_cls_t)); /* Walk the error stack */ - if(H5E_walk (estack, H5E_WALK_DOWNWARD, H5E_walk_cb, (void*)&eprint)<0) + if(H5E_walk_stack(estack, H5E_WALK_DOWNWARD, H5E_walk_cb, (void*)&eprint)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTLIST, FAIL, "can't walk error stack") done: FUNC_LEAVE_NOAPI(ret_value) } -#ifdef H5_WANT_H5_V1_6_COMPAT /*------------------------------------------------------------------------- * Function: H5Ewalk @@ -1983,17 +1976,16 @@ H5Ewalk(H5E_direction_t direction, H5E_walk_t func, void *client_data) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack") /* Walk the error stack */ - if(H5E_walk (estack, direction, func, client_data)<0) + if(H5E_walk_stack(estack, direction, func, client_data)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTLIST, FAIL, "can't walk error stack") done: FUNC_LEAVE_API(ret_value) } -#else /*------------------------------------------------------------------------- - * Function: H5Ewalk + * Function: H5Ewalk_stack * * Purpose: Walks the error stack for the current thread and calls some * function for each error along the way. @@ -2012,13 +2004,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Ewalk(hid_t err_stack, H5E_direction_t direction, H5E_walk_t func, void *client_data) +H5Ewalk_stack(hid_t err_stack, H5E_direction_t direction, H5E_walk_t func, void *client_data) { H5E_t *estack; /* Error stack to operate on */ herr_t ret_value=SUCCEED; /* Return value */ /* Don't clear the error stack! :-) */ - FUNC_ENTER_API_NOCLEAR(H5Ewalk, FAIL) + FUNC_ENTER_API_NOCLEAR(H5Ewalk_stack, FAIL) /*NO TRACE*/ /* Need to check for errors */ @@ -2028,24 +2020,23 @@ H5Ewalk(hid_t err_stack, H5E_direction_t direction, H5E_walk_t func, void *clien } /* end if */ else { /* Only clear the error stack if it's not the default stack */ - H5E_clear(NULL); + H5E_clear_stack(NULL); if((estack = H5I_object_verify(err_stack, H5I_ERROR_STACK))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error stack ID") } /* end else */ /* Walk the error stack */ - if(H5E_walk (estack, direction, func, client_data)<0) + if(H5E_walk_stack(estack, direction, func, client_data)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTLIST, FAIL, "can't walk error stack") done: FUNC_LEAVE_API(ret_value) } -#endif /* H5_WANT_H5_V1_6_COMPAT */ /*------------------------------------------------------------------------- - * Function: H5E_walk + * Function: H5E_walk_stack * * Purpose: Private function for H5Ewalk. * Walks the error stack, calling the specified function for @@ -2076,13 +2067,13 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5E_walk (const H5E_t *estack, H5E_direction_t direction, H5E_walk_t func, void *client_data) +H5E_walk_stack(const H5E_t *estack, H5E_direction_t direction, H5E_walk_t func, void *client_data) { int i; /* Local index variable */ herr_t status; /* Status from callback function */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5E_walk, FAIL) + FUNC_ENTER_NOAPI(H5E_walk_stack, FAIL) /* Sanity check */ assert (estack); @@ -2094,16 +2085,7 @@ H5E_walk (const H5E_t *estack, H5E_direction_t direction, H5E_walk_t func, void /* Walk the stack if a callback function was given */ if(func) { status=SUCCEED; -#ifdef H5_WANT_H5_V1_6_COMPAT - if (H5E_WALK_UPWARD==direction) { - for (i=0; i<(int)estack->nused && status>=0; i++) - status = (func)(i, estack->slot+i, client_data); - } else { - H5_CHECK_OVERFLOW(estack->nused-1,size_t,int); - for (i=(int)(estack->nused-1); i>=0 && status>=0; i--) - status = (func)((int)estack->nused-(i+1), estack->slot+i, client_data); - } -#else /* H5_WANT_H5_V1_6_COMPAT */ + if (H5E_WALK_UPWARD==direction) { for (i=0; i<(int)estack->nused && status>=0; i++) status = (func)((unsigned)i, estack->slot+i, client_data); @@ -2112,7 +2094,7 @@ H5E_walk (const H5E_t *estack, H5E_direction_t direction, H5E_walk_t func, void for (i=(int)(estack->nused-1); i>=0 && status>=0; i--) status = (func)((unsigned)(estack->nused-(size_t)(i+1)), estack->slot+i, client_data); } -#endif /* H5_WANT_H5_V1_6_COMPAT */ + if(status<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTLIST, FAIL, "can't walk error stack") } /* end if */ @@ -2155,13 +2137,8 @@ done: * *------------------------------------------------------------------------- */ -#ifdef H5_WANT_H5_V1_6_COMPAT -static herr_t -H5E_walk_cb(int n, H5E_error_t *err_desc, void *client_data) -#else /* H5_WANT_H5_V1_6_COMPAT */ static herr_t H5E_walk_cb(unsigned n, const H5E_error_t *err_desc, void *client_data) -#endif /* H5_WANT_H5_V1_6_COMPAT */ { H5E_print_t *eprint = (H5E_print_t *)client_data; FILE *stream; /* I/O stream to print output to */ @@ -2225,24 +2202,16 @@ H5E_walk_cb(unsigned n, const H5E_error_t *err_desc, void *client_data) have_desc=0; /* Print error message */ -#ifdef H5_WANT_H5_V1_6_COMPAT - fprintf (stream, "%*s#%03d: %s line %u in %s()%s%s\n", - H5E_INDENT, "", n, err_desc->file_name, err_desc->line, - err_desc->func_name, (have_desc ? ": " : ""), - (err_desc->desc ? err_desc->desc : "")); -#else /* H5_WANT_H5_V1_6_COMPAT */ fprintf (stream, "%*s#%03u: %s line %u in %s()%s%s\n", H5E_INDENT, "", n, err_desc->file_name, err_desc->line, err_desc->func_name, (have_desc ? ": " : ""), (have_desc ? err_desc->desc : "")); -#endif /* H5_WANT_H5_V1_6_COMPAT */ fprintf (stream, "%*smajor: %s\n", H5E_INDENT*2, "", maj_str); fprintf (stream, "%*sminor: %s\n", H5E_INDENT*2, "", min_str); FUNC_LEAVE_NOAPI(SUCCEED) } -#ifdef H5_WANT_H5_V1_6_COMPAT /*------------------------------------------------------------------------- * Function: H5Eget_auto @@ -2276,17 +2245,16 @@ H5Eget_auto(H5E_auto_t *func, void **client_data) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack") /* Get the automatic error reporting information */ - if(H5E_get_auto(estack, func, client_data)<0) + if(H5E_get_auto_stack(estack, func, client_data)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get automatic error info") done: FUNC_LEAVE_API(ret_value) } -#else /*------------------------------------------------------------------------- - * Function: H5Eget_auto + * Function: H5Eget_auto_stack * * Purpose: Returns the current settings for the automatic error stack * traversal function and its data for specific error stack. @@ -2307,12 +2275,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Eget_auto(hid_t estack_id, H5E_auto_t *func, void **client_data) +H5Eget_auto_stack(hid_t estack_id, H5E_auto_t *func, void **client_data) { H5E_t *estack; /* Error stack to operate on */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Eget_auto, FAIL) + FUNC_ENTER_API(H5Eget_auto_stack, FAIL) H5TRACE3("e","i*xx",estack_id,func,client_data); if(estack_id == H5E_DEFAULT) { @@ -2324,17 +2292,16 @@ H5Eget_auto(hid_t estack_id, H5E_auto_t *func, void **client_data) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error stack ID") /* Get the automatic error reporting information */ - if(H5E_get_auto(estack, func, client_data)<0) + if(H5E_get_auto_stack(estack, func, client_data)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get automatic error info") done: FUNC_LEAVE_API(ret_value) } -#endif /* H5_WANT_H5_V1_6_COMPAT */ /*------------------------------------------------------------------------- - * Function: H5E_get_auto + * Function: H5E_get_auto_stack * * Purpose: Private function to return the current settings for the * automatic error stack traversal function and its data @@ -2351,11 +2318,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5E_get_auto(const H5E_t *estack, H5E_auto_t *func, void **client_data) +H5E_get_auto_stack(const H5E_t *estack, H5E_auto_t *func, void **client_data) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5E_get_auto, FAIL) + FUNC_ENTER_NOAPI(H5E_get_auto_stack, FAIL) assert (estack); @@ -2367,7 +2334,6 @@ done: FUNC_LEAVE_NOAPI(ret_value) } -#ifdef H5_WANT_H5_V1_6_COMPAT /*------------------------------------------------------------------------- * Function: H5Eset_auto @@ -2409,17 +2375,16 @@ H5Eset_auto(H5E_auto_t func, void *client_data) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack") /* Set the automatic error reporting information */ - if(H5E_set_auto(estack, func, client_data)<0) + if(H5E_set_auto_stack(estack, func, client_data)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTSET, FAIL, "can't set automatic error info") done: FUNC_LEAVE_API(ret_value) } -#else /*------------------------------------------------------------------------- - * Function: H5Eset_auto + * Function: H5Eset_auto_stack * * Purpose: Turns on or off automatic printing of errors for certain * error stack. When turned on (non-null FUNC pointer) any @@ -2445,12 +2410,12 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Eset_auto(hid_t estack_id, H5E_auto_t func, void *client_data) +H5Eset_auto_stack(hid_t estack_id, H5E_auto_t func, void *client_data) { H5E_t *estack; /* Error stack to operate on */ herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_API(H5Eset_auto, FAIL) + FUNC_ENTER_API(H5Eset_auto_stack, FAIL) H5TRACE3("e","ixx",estack_id,func,client_data); if(estack_id == H5E_DEFAULT) { @@ -2462,17 +2427,16 @@ H5Eset_auto(hid_t estack_id, H5E_auto_t func, void *client_data) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error stack ID") /* Set the automatic error reporting information */ - if(H5E_set_auto(estack, func, client_data)<0) + if(H5E_set_auto_stack(estack, func, client_data)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTSET, FAIL, "can't set automatic error info") done: FUNC_LEAVE_API(ret_value) } -#endif /* H5_WANT_H5_V1_6_COMPAT */ /*------------------------------------------------------------------------- - * Function: H5E_set_auto + * Function: H5E_set_auto_stack * * Purpose: Private function to turn on or off automatic printing of * errors for certain error stack. When turned on (non-null @@ -2499,11 +2463,11 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5E_set_auto(H5E_t *estack, H5E_auto_t func, void *client_data) +H5E_set_auto_stack(H5E_t *estack, H5E_auto_t func, void *client_data) { herr_t ret_value=SUCCEED; /* Return value */ - FUNC_ENTER_NOAPI(H5E_set_auto, FAIL) + FUNC_ENTER_NOAPI(H5E_set_auto_stack, FAIL) assert(estack); @@ -2545,11 +2509,7 @@ H5E_dump_api_stack(int is_api) assert(estack); if (estack->func) -#ifdef H5_WANT_H5_V1_6_COMPAT - (void)((estack->func)(estack->auto_data)); -#else /*H5_WANT_H5_V1_6_COMPAT*/ (void)((estack->func)(H5E_DEFAULT, estack->auto_data)); -#endif /* H5_WANT_H5_V1_6_COMPAT */ } /* end if */ done: diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h index b874157..4dbb670 100644 --- a/src/H5Eprivate.h +++ b/src/H5Eprivate.h @@ -63,7 +63,7 @@ typedef struct H5E_print_t { * and a FUNC_LEAVE() within a function body. The arguments are the major * error number, the minor error number, and a description of the error. */ -#define HERROR(maj_id, min_id, str) H5E_push(NULL, __FILE__, FUNC, __LINE__, H5E_ERR_CLS_g, maj_id, min_id, str) +#define HERROR(maj_id, min_id, str) H5E_push_stack(NULL, __FILE__, FUNC, __LINE__, H5E_ERR_CLS_g, maj_id, min_id, str) /* * HCOMMON_ERROR macro, used by HDONE_ERROR and HGOTO_ERROR @@ -109,9 +109,9 @@ typedef struct H5E_print_t { /* Library-private functions defined in H5E package */ H5_DLL herr_t H5E_init(void); -H5_DLL herr_t H5E_push(H5E_t *estack, const char *file, const char *func, unsigned line, +H5_DLL herr_t H5E_push_stack(H5E_t *estack, const char *file, const char *func, unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *desc); -H5_DLL herr_t H5E_clear(H5E_t *estack); +H5_DLL herr_t H5E_clear_stack(H5E_t *estack); H5_DLL herr_t H5E_dump_api_stack(int is_api); #ifdef H5_HAVE_PARALLEL diff --git a/src/H5Epublic.h b/src/H5Epublic.h index e9cf481..247767c 100644 --- a/src/H5Epublic.h +++ b/src/H5Epublic.h @@ -36,10 +36,9 @@ typedef enum H5E_type_t { H5E_MINOR } H5E_type_t; -#ifdef H5_WANT_H5_V1_6_COMPAT +/* For backward compatibility with v1.6 */ typedef hid_t H5E_major_t; typedef hid_t H5E_minor_t; -#endif /* H5_WANT_H5_V1_6_COMPAT */ /* Information about an error; element of error stack */ typedef struct H5E_error_t { @@ -81,69 +80,43 @@ H5_DLLVAR hid_t H5E_ERR_CLS_g; * * Warning: don't break, return, or longjmp() from the body of the loop or * the error reporting won't be properly restored! + * + * These two macros still use the old API functions for backward compatibility + * purpose. */ -#ifdef H5_WANT_H5_V1_6_COMPAT #define H5E_BEGIN_TRY { \ H5E_auto_t H5E_saved_efunc; \ void *H5E_saved_edata; \ - (void)H5Eget_auto(&H5E_saved_efunc, &H5E_saved_edata); \ - (void)H5Eset_auto(NULL, NULL); + (void)H5Eget_auto_stack(H5E_DEFAULT, &H5E_saved_efunc, &H5E_saved_edata); \ + (void)H5Eset_auto_stack(H5E_DEFAULT, NULL, NULL); #define H5E_END_TRY \ - (void)H5Eset_auto (H5E_saved_efunc, H5E_saved_edata); \ + (void)H5Eset_auto_stack(H5E_DEFAULT, H5E_saved_efunc, H5E_saved_edata); \ } -#else /* H5_WANT_H5_V1_6_COMPAT */ -#define H5E_BEGIN_TRY { \ - H5E_auto_t H5E_saved_efunc; \ - void *H5E_saved_edata; \ - (void)H5Eget_auto(H5E_DEFAULT, &H5E_saved_efunc, &H5E_saved_edata); \ - (void)H5Eset_auto(H5E_DEFAULT, NULL, NULL); - -#define H5E_END_TRY \ - (void)H5Eset_auto (H5E_DEFAULT, H5E_saved_efunc, H5E_saved_edata); \ -} -#endif /* H5_WANT_H5_V1_6_COMPAT */ /* * Public API Convenience Macros for Error reporting - Documented */ /* Use the Standard C __FILE__ & __LINE__ macros instead of typing them in */ -#ifdef H5_WANT_H5_V1_6_COMPAT -#define H5Epush_sim(func,cls,maj,min,str) H5Epush(__FILE__,func,__LINE__,maj,min,str) -#else -#define H5Epush_sim(func,cls,maj,min,str) H5Epush(H5E_DEFAULT,__FILE__,func,__LINE__,cls,maj,min,str) -#endif /* H5_WANT_H5_V1_6_COMPAT */ +#define H5Epush_sim(func,cls,maj,min,str) H5Epush_stack(H5E_DEFAULT,__FILE__,func,__LINE__,cls,maj,min,str) /* * Public API Convenience Macros for Error reporting - Undocumented */ /* Use the Standard C __FILE__ & __LINE__ macros instead of typing them in */ /* And return after pushing error onto stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT #define H5Epush_ret(func,cls,maj,min,str,ret) { \ - H5Epush(__FILE__,func,__LINE__,maj,min,str); \ + H5Epush_stack(H5E_DEFAULT,__FILE__,func,__LINE__,cls,maj,min,str); \ return(ret); \ } -#else -#define H5Epush_ret(func,cls,maj,min,str,ret) { \ - H5Epush(H5E_DEFAULT,__FILE__,func,__LINE__,cls,maj,min,str); \ - return(ret); \ -} -#endif /* H5_WANT_H5_V1_6_COMPAT */ -/* Use the Standard C __FILE__ & __LINE__ macros instead of typing them in */ -/* And goto a label after pushing error onto stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT -#define H5Epush_goto(func,cls,maj,min,str,label) { \ - H5Epush(__FILE__,func,__LINE__,maj,min,str); \ - goto label; \ -} -#else +/* Use the Standard C __FILE__ & __LINE__ macros instead of typing them in + * And goto a label after pushing error onto stack. + */ #define H5Epush_goto(func,cls,maj,min,str,label) { \ - H5Epush(H5E_DEFAULT,__FILE__,func,__LINE__,cls,maj,min,str); \ + H5Epush_stack(H5E_DEFAULT,__FILE__,func,__LINE__,cls,maj,min,str); \ goto label; \ } -#endif /* H5_WANT_H5_V1_6_COMPAT */ /* Error stack traversal direction */ typedef enum H5E_direction_t { @@ -157,13 +130,8 @@ extern "C" { #endif /* Error stack traversal callback function pointers */ -#ifdef H5_WANT_H5_V1_6_COMPAT -typedef herr_t (*H5E_walk_t)(int n, H5E_error_t *err_desc, void *client_data); -typedef herr_t (*H5E_auto_t)(void *client_data); -#else typedef herr_t (*H5E_walk_t)(unsigned n, const H5E_error_t *err_desc, void *client_data); typedef herr_t (*H5E_auto_t)(hid_t estack, void *client_data); -#endif /* H5_WANT_H5_V1_6_COMPAT */ /* Public API functions */ H5_DLL hid_t H5Eregister_class(const char *cls_name, const char *lib_name, const char *version); @@ -177,7 +145,9 @@ H5_DLL ssize_t H5Eget_msg(hid_t msg_id, H5E_type_t *type, char *msg, size_t size H5_DLL int H5Eget_num(hid_t error_stack_id); H5_DLL herr_t H5Eset_current_stack(hid_t err_stack_id); H5_DLL herr_t H5Epop(hid_t err_stack, size_t count); -#ifdef H5_WANT_H5_V1_6_COMPAT + +/* These old APIs are kept for backward compatibility. They don't have + * the error stack in the parameters. */ H5_DLL herr_t H5Epush(const char *file, const char *func, unsigned line, H5E_major_t maj, H5E_minor_t min, const char *str); H5_DLL herr_t H5Eprint(FILE *stream); @@ -188,16 +158,17 @@ H5_DLL herr_t H5Eset_auto(H5E_auto_t func, void *client_data); H5_DLL herr_t H5Eclear(void); H5_DLL const char * H5Eget_major(H5E_major_t maj); H5_DLL const char * H5Eget_minor(H5E_minor_t min); -#else -H5_DLL herr_t H5Epush(hid_t err_stack, const char *file, const char *func, unsigned line, + +/* New APIs function the same as the old ones above, with the error stack + * in the parameters */ +H5_DLL herr_t H5Epush_stack(hid_t err_stack, const char *file, const char *func, unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *msg, ...); -H5_DLL herr_t H5Eprint(hid_t err_stack, FILE *stream); -H5_DLL herr_t H5Ewalk(hid_t err_stack, H5E_direction_t direction, H5E_walk_t func, +H5_DLL herr_t H5Eprint_stack(hid_t err_stack, FILE *stream); +H5_DLL herr_t H5Ewalk_stack(hid_t err_stack, H5E_direction_t direction, H5E_walk_t func, void *client_data); -H5_DLL herr_t H5Eget_auto(hid_t estack_id, H5E_auto_t *func, void **client_data); -H5_DLL herr_t H5Eset_auto(hid_t estack_id, H5E_auto_t func, void *client_data); -H5_DLL herr_t H5Eclear(hid_t err_stack); -#endif /* H5_WANT_H5_V1_6_COMPAT */ +H5_DLL herr_t H5Eget_auto_stack(hid_t estack_id, H5E_auto_t *func, void **client_data); +H5_DLL herr_t H5Eset_auto_stack(hid_t estack_id, H5E_auto_t func, void *client_data); +H5_DLL herr_t H5Eclear_stack(hid_t err_stack); #ifdef __cplusplus } #endif @@ -1748,7 +1748,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d if (NULL==(lf=H5FD_open(name, tent_flags, fapl_id, HADDR_UNDEF))) { if (tent_flags == flags) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file") - H5E_clear(NULL); + H5E_clear_stack(NULL); tent_flags = flags; if (NULL==(lf=H5FD_open(name, tent_flags, fapl_id, HADDR_UNDEF))) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open file") diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index 5f94b68..7d35b41 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -651,7 +651,7 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, if (!file->memb[file->nmembs]) { if (0==file->nmembs) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to open member file") - H5E_clear(NULL); + H5E_clear_stack(NULL); break; } file->nmembs++; diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index 01048d6..d1d0b6e 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -231,11 +231,7 @@ hid_t H5FD_multi_init(void) { /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); if (H5I_VFL!=H5Iget_type(H5FD_MULTI_g)) { H5FD_MULTI_g = H5FDregister(&H5FD_multi_g); @@ -304,11 +300,7 @@ H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id, /*NO TRACE*/ /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); /* Initialize */ for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) { @@ -452,11 +444,7 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map, /*NO TRACE*/ /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); /* Check arguments and supply default values */ if(H5I_GENPROP_LST != H5Iget_type(fapl_id) || @@ -557,11 +545,7 @@ H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map/*out*/, /*NO TRACE*/ /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); if(H5I_GENPROP_LST != H5Iget_type(fapl_id) || TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS)) @@ -628,11 +612,7 @@ H5Pset_dxpl_multi(hid_t dxpl_id, const hid_t *memb_dxpl) /*NO TRACE*/ /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); /* Check arguments */ if (TRUE!=H5Pisa_class(dxpl_id, H5P_DATASET_XFER)) @@ -684,11 +664,7 @@ H5Pget_dxpl_multi(hid_t dxpl_id, hid_t *memb_dxpl/*out*/) /*NO TRACE*/ /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); if (TRUE!=H5Pisa_class(dxpl_id, H5P_DATASET_XFER)) H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADTYPE, "not a file access property list", -1) @@ -735,11 +711,7 @@ H5FD_multi_sb_size(H5FD_t *_file) hsize_t nbytes = 8; /*size of header*/ /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); /* How many unique files? */ UNIQUE_MEMBERS(file->fa.memb_map, mt) { @@ -797,11 +769,7 @@ H5FD_multi_sb_encode(H5FD_t *_file, char *name/*out*/, static const char *func="H5FD_multi_sb_encode"; /* Function Name for error reporting */ /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); /* Name and version number */ strncpy(name, "NCSAmulti",8); @@ -886,11 +854,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) static const char *func="H5FD_multi_sb_decode"; /* Function Name for error reporting */ /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); /* Make sure the name/version number is correct */ if (strcmp(name, "NCSAmult")) @@ -1032,11 +996,7 @@ H5FD_multi_fapl_get(H5FD_t *_file) H5FD_multi_t *file = (H5FD_multi_t*)_file; /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); return H5FD_multi_fapl_copy(&(file->fa)); } @@ -1070,11 +1030,7 @@ H5FD_multi_fapl_copy(const void *_old_fa) assert(new_fa); /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); memcpy(new_fa, old_fa, sizeof(H5FD_multi_fapl_t)); for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) { @@ -1125,11 +1081,7 @@ H5FD_multi_fapl_free(void *_fa) static const char *func="H5FD_multi_fapl_free"; /* Function Name for error reporting */ /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) { if (fa->memb_fapl[mt]>=0) @@ -1172,11 +1124,7 @@ H5FD_multi_dxpl_copy(const void *_old_dx) assert(new_dx); /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); memcpy(new_dx, old_dx, sizeof(H5FD_multi_dxpl_t)); for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) { @@ -1220,11 +1168,7 @@ H5FD_multi_dxpl_free(void *_dx) static const char *func="H5FD_multi_dxpl_free"; /* Function Name for error reporting */ /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) if (dx->memb_dxpl[mt]>=0) @@ -1264,11 +1208,7 @@ H5FD_multi_open(const char *name, unsigned flags, hid_t fapl_id, static const char *func="H5FD_multi_open"; /* Function Name for error reporting */ /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); /* Check arguments */ if (!name || !*name) @@ -1363,11 +1303,7 @@ H5FD_multi_close(H5FD_t *_file) static const char *func="H5FD_multi_close"; /* Function Name for error reporting */ /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); /* Close as many members as possible */ ALL_MEMBERS(mt) { @@ -1433,11 +1369,7 @@ H5FD_multi_cmp(const H5FD_t *_f1, const H5FD_t *_f2) int cmp=0; /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) { if (f1->memb[mt] && f2->memb[mt]) break; @@ -1511,11 +1443,7 @@ H5FD_multi_get_eoa(H5FD_t *_file) H5FD_multi_t *file = (H5FD_multi_t*)_file; /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); return file->eoa; } @@ -1549,11 +1477,7 @@ H5FD_multi_set_eoa(H5FD_t *_file, haddr_t eoa) static const char *func="H5FD_multi_set_eoa"; /* Function Name for error reporting */ /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); /* Find the subfile in which the new EOA value falls */ for (mt=H5FD_MEM_SUPER; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) { @@ -1609,11 +1533,7 @@ H5FD_multi_get_eof(H5FD_t *_file) static const char *func="H5FD_multi_eof"; /* Function Name for error reporting */ /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); UNIQUE_MEMBERS(file->fa.memb_map, mt) { if (file->memb[mt]) { @@ -1735,11 +1655,7 @@ H5FD_multi_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsi H5FD_mem_t mmt; /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); mmt = file->fa.memb_map[type]; if (H5FD_MEM_DEFAULT==mmt) mmt = type; @@ -1779,11 +1695,7 @@ H5FD_multi_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz haddr_t start_addr=0; /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); /* Get the data transfer properties */ if (H5P_FILE_ACCESS_DEFAULT!=dxpl_id && H5FD_MULTI==H5Pget_driver(dxpl_id)) { @@ -1838,11 +1750,7 @@ H5FD_multi_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, si haddr_t start_addr=0; /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); /* Get the data transfer properties */ if (H5P_FILE_ACCESS_DEFAULT!=dxpl_id && H5FD_MULTI==H5Pget_driver(dxpl_id)) { @@ -1926,11 +1834,7 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing) #endif /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); /* Flush each file */ for (mt=H5FD_MEM_SUPER; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) { @@ -1968,11 +1872,7 @@ static int compute_next(H5FD_multi_t *file) { /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); ALL_MEMBERS(mt) { file->memb_next[mt] = HADDR_UNDEF; @@ -2019,11 +1919,7 @@ open_members(H5FD_multi_t *file) static const char *func="(H5FD_multi)open_members"; /* Function Name for error reporting */ /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); UNIQUE_MEMBERS(file->fa.memb_map, mt) { if (file->memb[mt]) continue; /*already open*/ diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index 77864e0..5b5747f 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -216,11 +216,7 @@ hid_t H5FD_stdio_init(void) { /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); if (H5I_VFL!=H5Iget_type(H5FD_STDIO_g)) H5FD_STDIO_g = H5FDregister(&H5FD_stdio_g); @@ -276,11 +272,7 @@ H5Pset_fapl_stdio(hid_t fapl_id) /*NO TRACE*/ /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); if(0 == H5Pisa_class(fapl_id, H5P_FILE_ACCESS)) H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADTYPE, "not a file access property list", -1) @@ -340,11 +332,7 @@ H5FD_stdio_open( const char *name, unsigned flags, hid_t fapl_id, fapl_id=fapl_id; /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); /* Check arguments */ if (!name || !*name) @@ -432,11 +420,7 @@ H5FD_stdio_close(H5FD_t *_file) static const char *func="H5FD_stdio_close"; /* Function Name for error reporting */ /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); if (fclose(file->fp) < 0) H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_CLOSEERROR, "fclose failed", -1) @@ -473,11 +457,7 @@ H5FD_stdio_cmp(const H5FD_t *_f1, const H5FD_t *_f2) const H5FD_stdio_t *f2 = (const H5FD_stdio_t*)_f2; /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); #ifdef WIN32 if (f1->fileindexhi < f2->fileindexhi) return -1; @@ -567,11 +547,7 @@ H5FD_stdio_get_eoa(H5FD_t *_file) H5FD_stdio_t *file = (H5FD_stdio_t*)_file; /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); return(file->eoa); } @@ -602,11 +578,7 @@ H5FD_stdio_set_eoa(H5FD_t *_file, haddr_t addr) H5FD_stdio_t *file = (H5FD_stdio_t*)_file; /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); file->eoa = addr; @@ -641,11 +613,7 @@ H5FD_stdio_get_eof(H5FD_t *_file) H5FD_stdio_t *file = (H5FD_stdio_t*)_file; /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); return(MAX(file->eof, file->eoa)); } @@ -675,11 +643,7 @@ H5FD_stdio_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) fapl=fapl; /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); *file_handle = &(file->fp); if(*file_handle==NULL) @@ -725,11 +689,7 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz dxpl_id=dxpl_id; /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); /* Check for overflow */ if (HADDR_UNDEF==addr) @@ -827,11 +787,7 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, type=type; /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); /* Check for overflow conditions */ if (HADDR_UNDEF==addr) @@ -908,11 +864,7 @@ H5FD_stdio_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing) dxpl_id=dxpl_id; /* Clear the error stack */ -#ifdef H5_WANT_H5_V1_6_COMPAT - H5Eclear(); -#else - H5Eclear(H5E_DEFAULT); -#endif /* H5_WANT_H5_V1_6_COMPAT */ + H5Eclear_stack(H5E_DEFAULT); /* Only try to flush the file if we have write access */ if(file->write_access) { @@ -2393,7 +2393,7 @@ H5G_link (H5G_entry_t *cur_loc, const char *cur_name, H5G_entry_t *new_loc, if (H5G_namei(new_loc, norm_new_name, &rest, &grp_ent, NULL, H5G_TARGET_NORMAL, NULL, H5G_NAMEI_TRAVERSE, NULL, dxpl_id)>=0) HGOTO_ERROR (H5E_SYM, H5E_EXISTS, FAIL, "already exists"); - H5E_clear (NULL); /*it's okay that we didn't find it*/ + H5E_clear_stack (NULL); /*it's okay that we didn't find it*/ rest = H5G_component (rest, &nchars); /* @@ -2588,14 +2588,14 @@ H5G_get_objinfo (H5G_entry_t *loc, const char *name, hbool_t follow_link, statbuf->objno = obj_ent.header; statbuf->nlink = H5O_link (&obj_ent, 0, dxpl_id); if (NULL==H5O_read(&obj_ent, H5O_MTIME_ID, 0, &(statbuf->mtime), dxpl_id)) { - H5E_clear(NULL); + H5E_clear_stack(NULL); if (NULL==H5O_read(&obj_ent, H5O_MTIME_NEW_ID, 0, &(statbuf->mtime), dxpl_id)) { - H5E_clear(NULL); + H5E_clear_stack(NULL); statbuf->mtime = 0; } } statbuf->type = H5G_get_type(&obj_ent, dxpl_id); - H5E_clear(NULL); /*clear errors resulting from checking type*/ + H5E_clear_stack(NULL); /*clear errors resulting from checking type*/ /* Get object header information */ if(H5O_get_info(&obj_ent, &(statbuf->ohdr), dxpl_id)<0) @@ -2868,7 +2868,7 @@ H5G_set_comment(H5G_entry_t *loc, const char *name, const char *buf, hid_t dxpl_ /* Remove the previous comment message if any */ if (H5O_remove(&obj_ent, H5O_NAME_ID, 0, dxpl_id)<0) - H5E_clear(NULL); + H5E_clear_stack(NULL); /* Add the new message */ if (buf && *buf) { @@ -3159,7 +3159,7 @@ H5G_insertion_file(H5G_entry_t *loc, const char *name, hid_t dxpl_id) H5G_free_ent_name(&grp_ent); HGOTO_ERROR(H5E_SYM, H5E_EXISTS, NULL, "name already exists"); } /* end if */ - H5E_clear(NULL); + H5E_clear_stack(NULL); /* Make sure only the last component wasn't resolved */ rest = H5G_component(rest, &size); diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 52194cc..1b3bbb7 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -1310,7 +1310,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, if (found) H5HL_remove(f, dxpl_id, bt_udata->heap_addr, sn->entry[idx].cache.slink.lval_offset, len); - H5E_clear(NULL); /* no big deal */ + H5E_clear_stack(NULL); /* no big deal */ } else { /* Decrement the reference count */ assert(H5F_addr_defined(sn->entry[idx].header)); @@ -1338,7 +1338,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, if (found) H5HL_remove(f, dxpl_id, bt_udata->heap_addr, sn->entry[idx].name_off, len); - H5E_clear(NULL); /* no big deal */ + H5E_clear_stack(NULL); /* no big deal */ /* Remove the entry from the symbol table node */ if (1==sn->nsyms) { @@ -1880,7 +1880,7 @@ H5G_node_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent, if (NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, NULL, NULL, H5AC_READ))) { H5G_bt_ud1_t udata; /*data to pass through B-tree */ - H5E_clear(NULL); /* discard that error */ + H5E_clear_stack(NULL); /* discard that error */ udata.heap_addr = heap; if ( H5B_debug(f, dxpl_id, addr, stream, indent, fwidth, H5B_SNODE, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, FAIL, "unable to debug B-tree node"); @@ -438,7 +438,7 @@ H5HL_minimize_heap_space(H5F_t *f, hid_t dxpl_id, H5HL_t *heap) /* Release old space on disk */ H5_CHECK_OVERFLOW(heap->disk_alloc, size_t, hsize_t); H5MF_xfree(f, H5FD_MEM_LHEAP, dxpl_id, old_addr, (hsize_t)heap->disk_alloc); - H5E_clear(NULL); /* don't really care if the free failed */ + H5E_clear_stack(NULL); /* don't really care if the free failed */ /* Allocate new space on disk */ H5_CHECK_OVERFLOW(heap->mem_alloc, size_t, hsize_t); @@ -751,7 +751,7 @@ herr_t H5I_destroy_type(H5I_type_t type) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type"); H5I_clear_type(type, TRUE); - H5E_clear(NULL); /*don't care about errors*/ + H5E_clear_stack(NULL); /*don't care about errors*/ H5MM_xfree(type_ptr->id_list); H5MM_free(type_ptr); diff --git a/src/H5MPprivate.h b/src/H5MPprivate.h index a47a6fe..401d407 100644 --- a/src/H5MPprivate.h +++ b/src/H5MPprivate.h @@ -97,10 +97,12 @@ #define color_H5Dget_offset "red" #define color_H5Eclear "red" +#define color_H5Eclear_stack "red" #define color_H5Eclose_msg "red" #define color_H5Eclose_stack "red" #define color_H5Ecreate_msg "red" #define color_H5Eget_auto "red" +#define color_H5Eget_auto_stack "red" #define color_H5Eget_class_name "red" #define color_H5Eget_current_stack "red" #define color_H5Eget_major "red" @@ -109,12 +111,16 @@ #define color_H5Eget_num "red" #define color_H5Epop "red" #define color_H5Eprint "red" +#define color_H5Eprint_stack "red" #define color_H5Epush "red" +#define color_H5Epush_stack "red" #define color_H5Eregister_class "red" #define color_H5Eset_auto "red" +#define color_H5Eset_auto_stack "red" #define color_H5Eset_current_stack "red" #define color_H5Eunregister_class "red" #define color_H5Ewalk "red" +#define color_H5Ewalk_stack "red" #define color_H5Fis_hdf5 "red" #define color_H5Fcreate "red" @@ -1598,7 +1598,7 @@ H5O_read_real(H5G_entry_t *ent, const H5O_class_t *type, int sequence, void *mes ret_value = (H5O_fast_g[cache_type]) (cache, type, mesg); if (ret_value) HGOTO_DONE(ret_value); - H5E_clear(NULL); /*don't care, try reading from header */ + H5E_clear_stack(NULL); /*don't care, try reading from header */ } /* copy the message to the user-supplied buffer */ @@ -2140,7 +2140,7 @@ H5O_new_mesg(H5F_t *f, H5O_t *oh, unsigned *flags, const H5O_class_t *orig_type, * If the message isn't shared then turn off the shared bit * and treat it as an unshared message. */ - H5E_clear (NULL); + H5E_clear_stack (NULL); *flags &= ~H5O_FLAG_SHARED; } else { /* Change type & message to use shared information */ @@ -2993,7 +2993,7 @@ H5O_alloc(H5F_t *f, H5O_t *oh, const H5O_class_t *type, size_t size) if ((idx = H5O_alloc_extend_chunk(f, oh, chunkno, size)) != UFAIL) { break; } - H5E_clear(NULL); + H5E_clear_stack(NULL); } /* @@ -1287,7 +1287,7 @@ H5T_term_interface(void) (unsigned long)(path->func), path->name); } #endif - H5E_clear(NULL); /*ignore the error*/ + H5E_clear_stack(NULL); /*ignore the error*/ } } @@ -2198,7 +2198,7 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5I_dec_ref(tmp_sid); H5I_dec_ref(tmp_did); tmp_sid = tmp_did = -1; - H5E_clear(NULL); + H5E_clear_stack(NULL); continue; } /* end if */ @@ -2240,7 +2240,7 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, tmp_sid = tmp_did = -1; /* We don't care about any failures during the freeing process */ - H5E_clear(NULL); + H5E_clear_stack(NULL); } /* end for */ } /* end else */ @@ -2406,7 +2406,7 @@ H5T_unregister(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5T_close(path->src); H5T_close(path->dst); H5FL_FREE(H5T_path_t,path); - H5E_clear(NULL); /*ignore all shutdown errors*/ + H5E_clear_stack(NULL); /*ignore all shutdown errors*/ } /* end else */ } /* end for */ @@ -4011,7 +4011,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, "conversion function (ignored)\n"); } #endif - H5E_clear(NULL); /*ignore the error*/ + H5E_clear_stack(NULL); /*ignore the error*/ } H5T_g.path[0]->is_noop = TRUE; H5T_g.npaths = 1; @@ -4122,7 +4122,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, if ((H5T_g.soft[i].func) (src_id, dst_id, &(path->cdata), 0, 0, 0, NULL, NULL, dxpl_id)<0) { HDmemset (&(path->cdata), 0, sizeof(H5T_cdata_t)); - H5E_clear(NULL); /*ignore the error*/ + H5E_clear_stack(NULL); /*ignore the error*/ } else { HDstrcpy (path->name, H5T_g.soft[i].name); path->func = H5T_g.soft[i].func; @@ -4172,7 +4172,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, (unsigned long)(path->func), path->name); } #endif - H5E_clear(NULL); /*ignore the failure*/ + H5E_clear_stack(NULL); /*ignore the failure*/ } if (table->src) H5T_close(table->src); if (table->dst) H5T_close(table->dst); @@ -518,7 +518,7 @@ H5Z_prelude_callback(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_ty if (NULL==(fclass=H5Z_find(dcpl_pline.filter[u].id))) { /* Ignore errors from optional filters */ if (dcpl_pline.filter[u].flags & H5Z_FLAG_OPTIONAL) - H5E_clear(NULL); + H5E_clear_stack(NULL); else HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "required filter was not located") } /* end if */ @@ -956,7 +956,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, *nbytes = *buf_size; failed |= (unsigned)1 << idx; - H5E_clear(NULL); + H5E_clear_stack(NULL); } else { *nbytes = new_nbytes; } @@ -973,7 +973,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "required filter is not registered") failed |= (unsigned)1 << idx; - H5E_clear(NULL); + H5E_clear_stack(NULL); continue; /*filter excluded*/ } fclass=&H5Z_table_g[fclass_idx]; @@ -998,7 +998,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, } failed |= (unsigned)1 << idx; - H5E_clear(NULL); + H5E_clear_stack(NULL); } else { *nbytes = new_nbytes; } diff --git a/src/H5private.h b/src/H5private.h index 38484f0..f09ae7d 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1179,7 +1179,7 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); FUNC_ENTER_API_THREADSAFE; \ FUNC_ENTER_API_COMMON(func_name,err); \ /* Clear thread error stack entering public functions */ \ - H5E_clear(NULL); \ + H5E_clear_stack(NULL); \ { /* diff --git a/src/hdf5.lnt b/src/hdf5.lnt index c66de8a..b3576ce 100755 --- a/src/hdf5.lnt +++ b/src/hdf5.lnt @@ -3,7 +3,7 @@ // Turn off warnings about not using the return value from these functions: -esym(534, HDfprintf, HDsnprintf, HDvsnprintf) --esym(534, H5E_clear, H5E_push) +-esym(534, H5E_clear_stack, H5E_push_stack) -esym(534, H5FL_arr_free, H5FL_blk_free, H5FL_reg_free) -esym(534, H5I_clear_group, H5I_destroy_group) -esym(534, H5MM_xfree) |