diff options
author | Dana Robinson <derobins@hdfgroup.org> | 2020-01-15 17:32:01 (GMT) |
---|---|---|
committer | Dana Robinson <derobins@hdfgroup.org> | 2020-01-15 17:32:01 (GMT) |
commit | 1f8f6f019c85df6c031a32f6bf703fa18e225973 (patch) | |
tree | 29e642ec8de803f102bb0a593c86368e786b1a4b /test/efc.c | |
parent | d14b96e95976967c03c7623f6800506b89292656 (diff) | |
download | hdf5-1f8f6f019c85df6c031a32f6bf703fa18e225973.zip hdf5-1f8f6f019c85df6c031a32f6bf703fa18e225973.tar.gz hdf5-1f8f6f019c85df6c031a32f6bf703fa18e225973.tar.bz2 |
Fixed stack and frame size warnings. Not complete, but fixes most of
the easier cases.
Diffstat (limited to 'test/efc.c')
-rw-r--r-- | test/efc.c | 31 |
1 files changed, 24 insertions, 7 deletions
@@ -33,7 +33,8 @@ const char *FILENAME[] = { }; /* Global patched filename buffer */ -static char filename[6][1024]; +#define N_FILENAMES 6 +static char *filename[N_FILENAMES]; /* Global property lists - just copies of the defaults (necessary to use * internal functions */ @@ -2896,10 +2897,11 @@ error: int main(void) { - unsigned nerrors = 0; /* track errors */ - H5P_genplist_t *plist; /* Property list pointer for FAPL */ - H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */ - hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + unsigned nerrors = 0; /* track errors */ + H5P_genplist_t *plist; /* Property list pointer for FAPL */ + H5VL_connector_prop_t connector_prop; /* Property for VOL connector ID & info */ + hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ + int i; /* iterator */ /* Test Setup */ HDputs("Testing the external file cache"); @@ -2908,6 +2910,11 @@ main(void) fcpl_id = H5Pcreate(H5P_FILE_CREATE); fapl_id = h5_fileaccess(); + /* Allocate memory for filenames */ + for(i = 0; i < N_FILENAMES; i++) { + filename[i] = (char *)HDcalloc(PATH_MAX, sizeof(char)); + } + /* Patch filenames */ h5_fixname(FILENAME[0], fapl_id, filename[0], sizeof(filename[0])); h5_fixname(FILENAME[1], fapl_id, filename[1], sizeof(filename[1])); @@ -2942,7 +2949,8 @@ main(void) nerrors += (h5_verify_cached_stabs(FILENAME, fapl_id) < 0 ? 1 : 0); /* Pop API context */ - if(api_ctx_pushed && H5CX_pop() < 0) FAIL_STACK_ERROR + if(api_ctx_pushed && H5CX_pop() < 0) + FAIL_STACK_ERROR api_ctx_pushed = FALSE; if(nerrors) @@ -2952,6 +2960,10 @@ main(void) h5_clean_files(FILENAME, fapl_id); + for(i = 0; i < N_FILENAMES; i++) { + HDfree(filename[i]); + } + return EXIT_SUCCESS; error: @@ -2961,7 +2973,12 @@ error: H5Pclose(fapl_id); } H5E_END_TRY - if(api_ctx_pushed) H5CX_pop(); + if(api_ctx_pushed) + H5CX_pop(); + + for(i = 0; i < N_FILENAMES; i++) { + HDfree(filename[i]); + } return EXIT_FAILURE; } /* end main() */ |