From 5f2a34b462bcbbe73befa3730b6f327f6a5695fe Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Fri, 4 Oct 2013 14:28:22 -0500 Subject: [svn-r24256] Description: Clean up warnings Tested on: Mac OSX/64 10.8.4 (amazon) w/C++ & FORTRAN (too minor for h5committest) --- hl/src/H5PT.c | 2 +- src/H5FS.c | 6 ++--- src/H5FSdbg.c | 2 +- src/H5FSpkg.h | 6 ++--- src/H5FSprivate.h | 6 ++--- src/H5FSsection.c | 2 +- src/H5HFpkg.h | 2 +- src/H5HFspace.c | 2 +- src/H5HGcache.c | 2 +- test/ttsafe.c | 80 ++++++++++++++++++++++++++++--------------------------- 10 files changed, 56 insertions(+), 54 deletions(-) diff --git a/hl/src/H5PT.c b/hl/src/H5PT.c index ff4347a..92b041a 100644 --- a/hl/src/H5PT.c +++ b/hl/src/H5PT.c @@ -371,7 +371,7 @@ herr_t H5PTclose( hid_t table_id ) htbl_t * table; /* Remove the ID from the library */ - if((table = H5Iremove_verify(table_id, H5PT_ptable_id_type)) ==NULL) + if((table = (htbl_t *)H5Iremove_verify(table_id, H5PT_ptable_id_type)) ==NULL) goto out; /* If the library found the table, remove it */ diff --git a/src/H5FS.c b/src/H5FS.c index 7c09beb..9dcf081 100644 --- a/src/H5FS.c +++ b/src/H5FS.c @@ -104,7 +104,7 @@ H5FL_DEFINE(H5FS_t); */ H5FS_t * H5FS_create(H5F_t *f, hid_t dxpl_id, haddr_t *fs_addr, const H5FS_create_t *fs_create, - size_t nclasses, const H5FS_section_class_t *classes[], void *cls_init_udata, hsize_t alignment, hsize_t threshold) + uint16_t nclasses, const H5FS_section_class_t *classes[], void *cls_init_udata, hsize_t alignment, hsize_t threshold) { H5FS_t *fspace = NULL; /* New free space structure */ H5FS_t *ret_value; /* Return value */ @@ -191,7 +191,7 @@ HDfprintf(stderr, "%s: Leaving, ret_value = %d\n", FUNC, ret_value); *------------------------------------------------------------------------- */ H5FS_t * -H5FS_open(H5F_t *f, hid_t dxpl_id, haddr_t fs_addr, size_t nclasses, +H5FS_open(H5F_t *f, hid_t dxpl_id, haddr_t fs_addr, uint16_t nclasses, const H5FS_section_class_t *classes[], void *cls_init_udata, hsize_t alignment, hsize_t threshold) { H5FS_t *fspace = NULL; /* New free space structure */ @@ -586,7 +586,7 @@ HDfprintf(stderr, "%s: Leaving, ret_value = %d, fspace->rc = %u\n", FUNC, ret_va *------------------------------------------------------------------------- */ H5FS_t * -H5FS_new(const H5F_t *f, size_t nclasses, const H5FS_section_class_t *classes[], +H5FS_new(const H5F_t *f, uint16_t nclasses, const H5FS_section_class_t *classes[], void *cls_init_udata) { H5FS_t *fspace = NULL; /* Free space manager */ diff --git a/src/H5FSdbg.c b/src/H5FSdbg.c index fe3ca71..7edbbf8 100644 --- a/src/H5FSdbg.c +++ b/src/H5FSdbg.c @@ -148,7 +148,7 @@ H5FS_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int fspace->ghost_sect_count); HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth, "Number of free space section classes:", - fspace->nclasses); + (unsigned)fspace->nclasses); HDfprintf(stream, "%*s%-*s %u%%\n", indent, "", fwidth, "Shrink percent:", fspace->shrink_percent); diff --git a/src/H5FSpkg.h b/src/H5FSpkg.h index e22e411..b6c240e 100644 --- a/src/H5FSpkg.h +++ b/src/H5FSpkg.h @@ -96,7 +96,7 @@ /* Callback info for loading a free space header into the cache */ typedef struct H5FS_hdr_cache_ud_t { H5F_t *f; /* File that free space header is within */ - size_t nclasses; /* Number of section classes */ + uint16_t nclasses; /* Number of section classes */ const H5FS_section_class_t **classes; /* Array of section class info */ void *cls_init_udata; /* Pointer to class init user data */ haddr_t addr; /* Address of header */ @@ -163,7 +163,7 @@ struct H5FS_t { /* Creation parameters */ H5FS_client_t client; /* Type of user of this free space manager */ - unsigned nclasses; /* Number of section classes handled */ + uint16_t nclasses; /* Number of section classes handled */ unsigned shrink_percent; /* Percent of "normal" serialized size to shrink serialized space at */ unsigned expand_percent; /* Percent of "normal" serialized size to expand serialized space at */ unsigned max_sect_addr; /* Size of address space free sections are within (log2 of actual value) */ @@ -221,7 +221,7 @@ H5FL_EXTERN(H5FS_t); /******************************/ /* Free space manager header routines */ -H5_DLL H5FS_t *H5FS_new(const H5F_t *f, size_t nclasses, +H5_DLL H5FS_t *H5FS_new(const H5F_t *f, uint16_t nclasses, const H5FS_section_class_t *classes[], void *cls_init_udata); H5_DLL herr_t H5FS_incr(H5FS_t *fspace); H5_DLL herr_t H5FS_decr(H5FS_t *fspace); diff --git a/src/H5FSprivate.h b/src/H5FSprivate.h index 8cb3f95..37bc0ea 100644 --- a/src/H5FSprivate.h +++ b/src/H5FSprivate.h @@ -173,10 +173,10 @@ H5FL_SEQ_EXTERN(H5FS_section_class_t); /* Free space manager routines */ H5_DLL H5FS_t *H5FS_create(H5F_t *f, hid_t dxpl_id, haddr_t *fs_addr, - const H5FS_create_t *fs_create, size_t nclasses, + const H5FS_create_t *fs_create, uint16_t nclasses, const H5FS_section_class_t *classes[], void *cls_init_udata, hsize_t alignment, hsize_t threshold); H5_DLL H5FS_t *H5FS_open(H5F_t *f, hid_t dxpl_id, haddr_t fs_addr, - size_t nclasses, const H5FS_section_class_t *classes[], void *cls_init_udata, hsize_t alignment, hsize_t threshold); + uint16_t nclasses, const H5FS_section_class_t *classes[], void *cls_init_udata, hsize_t alignment, hsize_t threshold); H5_DLL herr_t H5FS_size(const H5F_t *f, const H5FS_t *fspace, hsize_t *meta_size); H5_DLL herr_t H5FS_delete(H5F_t *f, hid_t dxpl_id, haddr_t fs_addr); H5_DLL herr_t H5FS_close(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace); @@ -199,7 +199,7 @@ H5_DLL herr_t H5FS_sect_iterate(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, H5FS_op H5_DLL herr_t H5FS_sect_stats(const H5FS_t *fspace, hsize_t *tot_space, hsize_t *nsects); H5_DLL herr_t H5FS_sect_change_class(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, - H5FS_section_info_t *sect, unsigned new_class); + H5FS_section_info_t *sect, uint16_t new_class); H5_DLL htri_t H5FS_sect_try_shrink_eoa(const H5F_t *f, hid_t dxpl_id, const H5FS_t *fspace, void *op_data); H5_DLL herr_t H5FS_sect_query_last_sect(const H5FS_t *fspace, haddr_t *sect_addr, hsize_t *sect_size); diff --git a/src/H5FSsection.c b/src/H5FSsection.c index fa24f85..c0084b8 100644 --- a/src/H5FSsection.c +++ b/src/H5FSsection.c @@ -2072,7 +2072,7 @@ H5FS_sect_stats(const H5FS_t *fspace, hsize_t *tot_space, hsize_t *nsects) */ herr_t H5FS_sect_change_class(H5F_t *f, hid_t dxpl_id, H5FS_t *fspace, - H5FS_section_info_t *sect, unsigned new_class) + H5FS_section_info_t *sect, uint16_t new_class) { const H5FS_section_class_t *old_cls; /* Old class of section */ const H5FS_section_class_t *new_cls; /* New class of section */ diff --git a/src/H5HFpkg.h b/src/H5HFpkg.h index 3e2db99..23b7c35 100644 --- a/src/H5HFpkg.h +++ b/src/H5HFpkg.h @@ -754,7 +754,7 @@ H5_DLL herr_t H5HF_space_remove(H5HF_hdr_t *hdr, hid_t dxpl_id, H5_DLL herr_t H5HF_space_close(H5HF_hdr_t *hdr, hid_t dxpl_id); H5_DLL herr_t H5HF_space_delete(H5HF_hdr_t *hdr, hid_t dxpl_id); H5_DLL herr_t H5HF_space_sect_change_class(H5HF_hdr_t *hdr, hid_t dxpl_id, - H5HF_free_section_t *sect, unsigned new_class); + H5HF_free_section_t *sect, uint16_t new_class); /* Free space section routines */ H5_DLL H5HF_free_section_t *H5HF_sect_single_new(hsize_t sect_off, diff --git a/src/H5HFspace.c b/src/H5HFspace.c index 01330d3..577d3b8 100644 --- a/src/H5HFspace.c +++ b/src/H5HFspace.c @@ -613,7 +613,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5HF_space_sect_change_class(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect, unsigned new_class) +H5HF_space_sect_change_class(H5HF_hdr_t *hdr, hid_t dxpl_id, H5HF_free_section_t *sect, uint16_t new_class) { herr_t ret_value = SUCCEED; /* Return value */ diff --git a/src/H5HGcache.c b/src/H5HGcache.c index afb2a75..4e3f568 100644 --- a/src/H5HGcache.c +++ b/src/H5HGcache.c @@ -184,7 +184,7 @@ H5HG_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *udata) * assume that it's free space. */ HDassert(NULL == heap->obj[0].begin); - heap->obj[0].size = ((const uint8_t *)heap->chunk + heap->size) - p; + heap->obj[0].size = (size_t)(((const uint8_t *)heap->chunk + heap->size) - p); heap->obj[0].begin = p; p += heap->obj[0].size; } /* end if */ diff --git a/test/ttsafe.c b/test/ttsafe.c index 253470b..d0ab81a 100644 --- a/test/ttsafe.c +++ b/test/ttsafe.c @@ -52,69 +52,71 @@ int main(void) #define NAME_OFFSET 6 /* offset for "name" */ /* pre-condition: num must be a non-negative number */ -static int num_digits(int num) +static unsigned +num_digits(int num) { - int i; + unsigned u; - if (num == 0) - return 1; + if(num == 0) + return 1; - for (i = 0; num > 0; i++) - num = num / 10; + for(u = 0; num > 0; u++) + num = num / 10; - return i; + return u; } /* Routine to generate attribute names for numeric values */ char *gen_name(int value) { - char *temp; - int i, length; + char *temp; + unsigned length; + int i; - length = num_digits(MAX_NUM_NAME - 1); - temp = (char *)HDmalloc((NAME_OFFSET + length + 1) * sizeof(char)); - temp = HDstrcpy(temp, "attrib"); - temp[NAME_OFFSET + length] = '\0'; + length = num_digits(MAX_NUM_NAME - 1); + temp = (char *)HDmalloc(NAME_OFFSET + length + 1); + temp = HDstrcpy(temp, "attrib"); + temp[NAME_OFFSET + length] = '\0'; - for (i = length - 1; i >= 0; i--) { - temp[NAME_OFFSET + i] = (char)((int)'0' + value % 10); - value = value / 10; - } + for (i = (int)(length - 1); i >= 0; i--) { + temp[NAME_OFFSET + i] = (char)((int)'0' + value % 10); + value = value / 10; + } - return temp; + return temp; } int main(int argc, char *argv[]) { - /* Initialize testing framework */ - TestInit(argv[0], NULL, NULL); + /* Initialize testing framework */ + TestInit(argv[0], NULL, NULL); - /* Tests are generally arranged from least to most complexity... */ - AddTest("dcreate", tts_dcreate, cleanup_dcreate, "multi-dataset creation", NULL); - AddTest("error", tts_error, cleanup_error, "per-thread error stacks", NULL); + /* Tests are generally arranged from least to most complexity... */ + AddTest("dcreate", tts_dcreate, cleanup_dcreate, "multi-dataset creation", NULL); + AddTest("error", tts_error, cleanup_error, "per-thread error stacks", NULL); #ifdef H5_HAVE_PTHREAD_H - /* Thread cancellability only supported with pthreads ... */ - AddTest("cancel", tts_cancel, cleanup_cancel, "thread cancellation safety test", NULL); + /* Thread cancellability only supported with pthreads ... */ + AddTest("cancel", tts_cancel, cleanup_cancel, "thread cancellation safety test", NULL); #endif /* H5_HAVE_PTHREAD_H */ - AddTest("acreate", tts_acreate, cleanup_acreate, "multi-attribute creation", NULL); + AddTest("acreate", tts_acreate, cleanup_acreate, "multi-attribute creation", NULL); - /* Display testing information */ - TestInfo(argv[0]); + /* Display testing information */ + TestInfo(argv[0]); - /* Parse command line arguments */ - TestParseCmdLine(argc,argv); + /* Parse command line arguments */ + TestParseCmdLine(argc,argv); - /* Perform requested testing */ - PerformTests(); + /* Perform requested testing */ + PerformTests(); - /* Display test summary, if requested */ - if (GetTestSummary()) - TestSummary(); + /* Display test summary, if requested */ + if (GetTestSummary()) + TestSummary(); - /* Clean up test files, if allowed */ - if (GetTestCleanup() && !getenv("HDF5_NOCLEANUP")) - TestCleanup(); + /* Clean up test files, if allowed */ + if (GetTestCleanup() && !getenv("HDF5_NOCLEANUP")) + TestCleanup(); - return GetTestNumErrs(); + return GetTestNumErrs(); } /* end main() */ #endif /*H5_HAVE_THREADSAFE*/ -- cgit v0.12