[svn-r29978] Description:

Bring r29914 from revise_chunks branch to trunk:

Banished -Wformat= warnings from the library, tools, and tests.

Tested on:
    MacOSX/64 10.11.5 (amazon) w/serial, parallel & production
    (h5committest forthcoming)
This commit is contained in:
Quincey Koziol 2016-05-30 02:03:37 -05:00
parent 8e5447a185
commit cc95ed32fd
4 changed files with 44 additions and 40 deletions

View File

@ -296,7 +296,7 @@ if(was_adjusted)
item->start = start;
item->end = end;
if(H5SL_insert(file->dirty_list, item, &item->start) < 0)
HGOTO_ERROR(H5E_SLIST, H5E_CANTINSERT, FAIL, "can't insert new dirty region: (%llu, %llu)\n", start, end)
HGOTO_ERROR(H5E_SLIST, H5E_CANTINSERT, FAIL, "can't insert new dirty region: (%llu, %llu)\n", (unsigned long long)start, (unsigned long long)end)
}
else {
/* Store the new item endpoint if it's bigger */
@ -755,11 +755,11 @@ H5FD__core_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr
/* Allocate memory for the file's data, using the file image callback if available. */
if(file->fi_callbacks.image_malloc) {
if(NULL == (file->mem = (unsigned char*)file->fi_callbacks.image_malloc(size, H5FD_FILE_IMAGE_OP_FILE_OPEN, file->fi_callbacks.udata)))
HGOTO_ERROR(H5E_FILE, H5E_CANTALLOC, NULL, "image malloc callback failed")
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "image malloc callback failed")
} /* end if */
else {
if(NULL == (file->mem = (unsigned char*)H5MM_malloc(size)))
HGOTO_ERROR(H5E_FILE, H5E_CANTALLOC, NULL, "unable to allocate memory block")
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, NULL, "unable to allocate memory block")
} /* end else */
/* Set up data structures */
@ -1288,11 +1288,11 @@ H5FD__core_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UN
/* (Re)allocate memory for the file buffer, using callbacks if available */
if(file->fi_callbacks.image_realloc) {
if(NULL == (x = (unsigned char *)file->fi_callbacks.image_realloc(file->mem, new_eof, H5FD_FILE_IMAGE_OP_FILE_RESIZE, file->fi_callbacks.udata)))
HGOTO_ERROR(H5E_FILE, H5E_CANTALLOC, FAIL, "unable to allocate memory block of %llu bytes with callback", (unsigned long long)new_eof)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "unable to allocate memory block of %llu bytes with callback", (unsigned long long)new_eof)
} /* end if */
else {
if(NULL == (x = (unsigned char *)H5MM_realloc(file->mem, new_eof)))
HGOTO_ERROR(H5E_FILE, H5E_CANTALLOC, FAIL, "unable to allocate memory block of %llu bytes", (unsigned long long)new_eof)
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "unable to allocate memory block of %llu bytes", (unsigned long long)new_eof)
} /* end else */
HDmemset(x + file->eof, 0, (size_t)(new_eof - file->eof));
@ -1307,7 +1307,7 @@ H5FD__core_write(H5FD_t *_file, H5FD_mem_t H5_ATTR_UNUSED type, hid_t H5_ATTR_UN
haddr_t end = addr + (haddr_t)size - 1;
if(H5FD__core_add_dirty_region(file, start, end) != SUCCEED)
HGOTO_ERROR(H5E_VFL, H5E_CANTINSERT, FAIL, "unable to add core VFD dirty region during write call - addresses: start=%llu end=%llu", start, end)
HGOTO_ERROR(H5E_VFL, H5E_CANTINSERT, FAIL, "unable to add core VFD dirty region during write call - addresses: start=%llu end=%llu", (unsigned long long)start, (unsigned long long)end)
}
/* Write from BUF to memory */
@ -1460,11 +1460,11 @@ H5FD__core_truncate(H5FD_t *_file, hid_t H5_ATTR_UNUSED dxpl_id, hbool_t closing
/* (Re)allocate memory for the file buffer, using callback if available */
if(file->fi_callbacks.image_realloc) {
if(NULL == (x = (unsigned char *)file->fi_callbacks.image_realloc(file->mem, new_eof, H5FD_FILE_IMAGE_OP_FILE_RESIZE, file->fi_callbacks.udata)))
HGOTO_ERROR(H5E_FILE, H5E_CANTALLOC, FAIL, "unable to allocate memory block with callback")
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "unable to allocate memory block with callback")
} /* end if */
else {
if(NULL == (x = (unsigned char *)H5MM_realloc(file->mem, new_eof)))
HGOTO_ERROR(H5E_FILE, H5E_CANTALLOC, FAIL, "unable to allocate memory block")
HGOTO_ERROR(H5E_RESOURCE, H5E_CANTALLOC, FAIL, "unable to allocate memory block")
} /* end else */
if(file->eof < new_eof)

View File

@ -23,6 +23,10 @@ Bentley and Robert Sedgewick in the April, 1998, Dr. Dobb's Journal.
#include "H5FLprivate.h" /* Free lists */
#include "H5STprivate.h" /* Ternary search trees */
#ifdef H5ST_DEBUG
static herr_t H5ST__dump_internal(H5ST_ptr_t p);
#endif /* H5ST_DEBUG */
/* Declare a free list to manage the H5ST_node_t struct */
H5FL_DEFINE_STATIC(H5ST_node_t);
@ -719,7 +723,7 @@ done:
/*--------------------------------------------------------------------------
NAME
H5ST_dump_internal
H5ST__dump_internal
PURPOSE
Dump all the nodes of a TST
USAGE
@ -735,30 +739,30 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
herr_t
H5ST_dump_internal(H5ST_ptr_t p)
static herr_t
H5ST__dump_internal(H5ST_ptr_t p)
{
FUNC_ENTER_NOAPI_NOINIT_NOERR
FUNC_ENTER_STATIC_NOERR
if(p) {
printf("p=%p\n", p);
printf("\tp->up=%p\n", p->up);
printf("\tp->parent=%p\n", p->parent);
printf("\tp->lokid=%p\n", p->lokid);
printf("\tp->hikid=%p\n", p->hikid);
printf("\tp->eqkid=%p\n", p->eqkid);
printf("p=%p\n", (void *)p);
printf("\tp->up=%p\n", (void *)p->up);
printf("\tp->parent=%p\n", (void *)p->parent);
printf("\tp->lokid=%p\n", (void *)p->lokid);
printf("\tp->hikid=%p\n", (void *)p->hikid);
printf("\tp->eqkid=%p\n", (void *)p->eqkid);
printf("\tp->splitchar=%c\n", p->splitchar);
H5ST_dump_internal(p->lokid);
H5ST__dump_internal(p->lokid);
if(p->splitchar)
H5ST_dump_internal(p->eqkid);
H5ST__dump_internal(p->eqkid);
else
printf("%s\n", (char *)p->eqkid);
H5ST_dump_internal(p->hikid);
H5ST__dump_internal(p->hikid);
} /* end if */
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5ST_dump_internal() */
} /* end H5ST__dump_internal() */
/*--------------------------------------------------------------------------
@ -785,7 +789,7 @@ H5ST_dump(H5ST_tree_t *tree)
FUNC_ENTER_NOAPI_NOINIT_NOERR
/* Dump the tree */
H5ST_dump_internal(tree->root);
H5ST__dump_internal(tree->root);
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5ST_dump() */

View File

@ -4507,10 +4507,10 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst)
printf(" %29lu\n", *((unsigned long*)hw));
break;
case INT_LLONG:
printf(" %29"H5_PRINTF_LL_WIDTH"d\n", *((long long*)hw));
HDfprintf(stdout, " %29"H5_PRINTF_LL_WIDTH"d\n", *((long long*)hw));
break;
case INT_ULLONG:
printf(" %29"H5_PRINTF_LL_WIDTH"u\n", *((unsigned long long*)hw));
HDfprintf(stdout, " %29"H5_PRINTF_LL_WIDTH"u\n", *((unsigned long long*)hw));
break;
case FLT_FLOAT:
printf(" %29f\n", (double)*((float*)hw));
@ -5181,36 +5181,36 @@ main(void)
/* Do the tests */
/* Test H5Tcompiler_conv() for querying hard conversion. */
nerrors += test_hard_query();
nerrors += (unsigned long)test_hard_query();
/* Test user-define, query functions and software conversion
* for user-defined floating-point types */
nerrors += test_derived_flt();
nerrors += (unsigned long)test_derived_flt();
/* Test user-define, query functions and software conversion
* for user-defined integer types */
nerrors += test_derived_integer();
nerrors += (unsigned long)test_derived_integer();
/* Does floating point overflow generate a SIGFPE? */
generates_sigfpe();
/* Test degenerate cases */
nerrors += run_fp_tests("noop");
nerrors += (unsigned long)run_fp_tests("noop");
/* Test hardware floating-point conversion functions */
nerrors += run_fp_tests("hard");
nerrors += (unsigned long)run_fp_tests("hard");
/* Test hardware integer conversion functions */
nerrors += run_integer_tests("hard");
nerrors += (unsigned long)run_integer_tests("hard");
/* Test hardware integer-float conversion functions */
nerrors += run_int_fp_conv("hard");
nerrors += (unsigned long)run_int_fp_conv("hard");
/* Test hardware float-integer conversion functions */
nerrors += run_fp_int_conv("hard");
nerrors += (unsigned long)run_fp_int_conv("hard");
/* Test a few special values for hardware float-integer conversions */
nerrors += test_particular_fp_integer();
nerrors += (unsigned long)test_particular_fp_integer();
/*----------------------------------------------------------------------
* Software tests
@ -5224,17 +5224,17 @@ main(void)
reset_hdf5();
/* Test software floating-point conversion functions */
nerrors += run_fp_tests("soft");
nerrors += (unsigned long)run_fp_tests("soft");
/* Test software integer conversion functions */
nerrors += test_conv_int_2();
nerrors += run_integer_tests("soft");
nerrors += (unsigned long)test_conv_int_2();
nerrors += (unsigned long)run_integer_tests("soft");
/* Test software float-integer conversion functions */
nerrors += run_fp_int_conv("soft");
nerrors += (unsigned long)run_fp_int_conv("soft");
/* Test software integer-float conversion functions */
nerrors += run_int_fp_conv("soft");
nerrors += (unsigned long)run_int_fp_conv("soft");
/* Restore the default error handler (set in h5_reset()) */
h5_restore_err();

View File

@ -43,7 +43,7 @@
#define vrfy_macrosize(type, macro, macroname) \
if (sizeof(type) != macro) \
TestErrPrintf("Error: sizeof(%s) is %d but %s is %d\n", \
#type, sizeof(type), macroname, macro);
#type, (int)sizeof(type), macroname, (int)macro);
/* local routine prototypes */
void test_config_ctypes(void);