From a5090007114d141bb3a52e4e2cedb2041551bc5c Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Fri, 5 Jul 2013 14:45:47 +0000 Subject: [PATCH] warnings popped up on Linux fixed --- src/h5core/h5_model.c | 23 ++++++++++------ src/h5core/h5_openclose.c | 56 ++++++++++++++++++++++++++------------- src/include/H5.h | 6 ++--- test/h5_attach_test.c | 6 +++-- 4 files changed, 59 insertions(+), 32 deletions(-) diff --git a/src/h5core/h5_model.c b/src/h5core/h5_model.c index ad8cd1b..b97ca25 100644 --- a/src/h5core/h5_model.c +++ b/src/h5core/h5_model.c @@ -167,9 +167,12 @@ h5_set_throttle ( H5_CORE_API_ENTER (h5_err_t, "f=%p, factor=%d", f, factor); if ( (f->props->mode & H5_VFD_MPIIO_IND) || (f->props->mode & H5_VFD_MPIPOSIX) ) { f->props->throttle = factor; - h5_info ("Throttling enabled with factor = %lld", f->props->throttle ); + h5_info ( + "Throttling enabled with factor = %lld", + (long long int)f->props->throttle ); } else { - h5_warn ("Throttling is only permitted with the MPI-POSIX " + h5_warn ( + "Throttling is only permitted with the MPI-POSIX " "or MPI-IO Independent VFD." ); } @@ -183,12 +186,15 @@ h5priv_start_throttle ( H5_CORE_API_ENTER (h5_err_t, "f=%p", f); if (f->props->throttle > 0) { int token = 1; - h5_info ("Throttling with factor = %lld", f->props->throttle); + h5_info ( + "Throttling with factor = %lld", + (long long int)f->props->throttle); if (f->myproc / f->props->throttle > 0) { - h5_debug ("throttle: waiting on token from %lld", - f->myproc - f->props->throttle); + h5_debug ( + "throttle: waiting on token from %lld", + (long long int)(f->myproc - f->props->throttle)); // wait to receive token before continuing with read - TRY( h5priv_mpi_recv( + TRY( h5priv_mpi_recv( &token, 1, MPI_INT, f->myproc - f->props->throttle, // receive from previous proc f->myproc, // use this proc id as message tag @@ -209,8 +215,9 @@ h5priv_end_throttle ( int token; if (f->myproc + f->props->throttle < f->nprocs) { // pass token to next proc - h5_debug ("throttle: passing token to %lld", - f->myproc + f->props->throttle); + h5_debug ( + "throttle: passing token to %lld", + (long long int)(f->myproc + f->props->throttle)); TRY (h5priv_mpi_send( &token, 1, MPI_INT, f->myproc + f->props->throttle, // send to next proc diff --git a/src/h5core/h5_openclose.c b/src/h5core/h5_openclose.c index c7dc041..cd3231e 100644 --- a/src/h5core/h5_openclose.c +++ b/src/h5core/h5_openclose.c @@ -116,14 +116,17 @@ set_alignment ( ) { H5_INLINE_FUNC_ENTER (h5_err_t); if ( f->props->align != 0 ) { - h5_info ("Setting HDF5 alignment to %llu bytes " - "with threshold at half that many bytes.", - f->props->align); + h5_info ( + "Setting HDF5 alignment to %lld bytes " + "with threshold at half that many bytes.", + (long long int)f->props->align); TRY (hdf5_set_alignment_property ( f->props->access_prop, f->props->align / 2, f->props->align)); - h5_info ("Setting HDF5 meta block to %llu bytes", f->props->align); + h5_info ( + "Setting HDF5 meta block to %lld bytes", + (long long int)f->props->align); TRY (H5Pset_meta_block_size (f->props->access_prop, f->props->align)); } H5_INLINE_FUNC_RETURN (H5_SUCCESS); @@ -158,7 +161,8 @@ h5_set_prop_file_mpio ( H5_INLINE_FUNC_LEAVE ( h5_error ( H5_ERR_INVAL, - "Invalid property class: %lld", prop->class)); + "Invalid property class: %lld", + (long long int)prop->class)); } h5_prop_file_t* file_prop = (h5_prop_file_t*)prop; file_prop->comm = *comm; @@ -171,12 +175,16 @@ h5_set_prop_file_align ( h5_int64_t align ) { h5_prop_p prop = (h5_prop_p)_prop; - H5_CORE_API_ENTER (h5_err_t, "prop=%p, align=%lld", prop, align); + H5_CORE_API_ENTER ( + h5_err_t, + "prop=%p, align=%lld", + prop, (long long int)align); if (prop->class != H5_PROP_FILE) { H5_INLINE_FUNC_LEAVE ( h5_error ( H5_ERR_INVAL, - "Invalid property class: %lld", prop->class)); + "Invalid property class: %lld", + (long long int)prop->class)); } h5_prop_file_t* file_prop = (h5_prop_file_t*)prop; file_prop->align = align; @@ -189,12 +197,16 @@ h5_set_prop_file_throttle ( h5_int64_t throttle ) { h5_prop_p prop = (h5_prop_p)_prop; - H5_CORE_API_ENTER (h5_err_t, "prop=%p, throttle=%lld", prop, throttle); + H5_CORE_API_ENTER ( + h5_err_t, + "prop=%p, throttle=%lld", + prop, (long long int)throttle); if (prop->class != H5_PROP_FILE) { H5_INLINE_FUNC_LEAVE ( h5_error ( H5_ERR_INVAL, - "Invalid property class: %lld", prop->class)); + "Invalid property class: %lld", + (long long int)prop->class)); } h5_prop_file_t* file_prop = (h5_prop_file_t*)prop; file_prop->throttle = throttle; @@ -206,8 +218,10 @@ h5_prop_t h5_create_prop ( h5_int64_t class ) { - H5_CORE_API_ENTER (h5_prop_t, - "class=%lld", class); + H5_CORE_API_ENTER ( + h5_prop_t, + "class=%lld", + (long long int)class); h5_prop_t* prop; switch (class) { case H5_PROP_FILE: @@ -218,7 +232,8 @@ h5_create_prop ( H5_CORE_API_LEAVE ( h5_error ( H5_ERR_INVAL, - "Invalid property class: %lld", class)); + "Invalid property class: %lld", + (long long int)class)); } H5_CORE_API_RETURN ((h5_prop_t)prop); } @@ -239,7 +254,8 @@ h5_close_prop ( H5_CORE_API_LEAVE ( h5_error ( H5_ERR_INVAL, - "Invalid property class: %lld", prop->class)); + "Invalid property class: %lld", + (long long int)prop->class)); } H5_CORE_API_RETURN (h5_free (prop)); } @@ -298,7 +314,8 @@ open_file ( H5_PRIV_FUNC_LEAVE ( h5_error ( H5_ERR_INVAL, - "Invalid file access mode '%lld'.", f->props->mode)); + "Invalid file access mode '%lld'.", + (long long int)f->props->mode)); } if (f->file < 0) @@ -306,7 +323,7 @@ open_file ( h5_error ( H5_ERR_HDF5, "Cannot open file '%s' with mode '%lld'", - filename, f->props->mode)); + filename, (long long int)f->props->mode)); TRY (f->root_gid = hdf5_open_group (f->file, "/" )); TRY (h5upriv_open_file (f)); @@ -339,7 +356,7 @@ h5_open_file2 ( h5_error ( H5_ERR_INVAL, "Invalid property class: %lld.", - props->class)); + (long long int)props->class)); } f->props->comm = props->comm; f->props->mode |= props->mode; @@ -381,9 +398,10 @@ h5_open_file ( MPI_Comm comm, h5_size_t align ) { - H5_CORE_API_ENTER (h5_file_t, - "filename='%s', mode=%d, comm=?, align=%llu", - filename, mode, align); + H5_CORE_API_ENTER ( + h5_file_t, + "filename='%s', mode=%d, comm=?, align=%llu", + filename, mode, (long long int)align); h5_prop_file_t* props; h5_file_t f; TRY (props = (h5_prop_file_t*)h5_create_prop (H5_PROP_FILE)); diff --git a/src/include/H5.h b/src/include/H5.h index 4125bdf..d57e5ea 100644 --- a/src/include/H5.h +++ b/src/include/H5.h @@ -41,7 +41,7 @@ H5SetPropFileAlign ( h5_prop_t prop, h5_int64_t align ) { - H5_API_ENTER (h5_err_t, "prop=%p, align=%lld", (void*)prop, align); + H5_API_ENTER (h5_err_t, "prop=%p, align=%lld", (void*)prop, (long long int)align); H5_API_RETURN (h5_set_prop_file_align (prop, align)); } @@ -50,7 +50,7 @@ H5SetPropFileThrottle ( h5_prop_t prop, h5_int64_t throttle ) { - H5_API_ENTER (h5_err_t, "prop=%p, throttle=%lld", (void*)prop, throttle); + H5_API_ENTER (h5_err_t, "prop=%p, throttle=%lld", (void*)prop, (long long int)throttle); H5_API_RETURN (h5_set_prop_file_throttle (prop, throttle)); } @@ -108,7 +108,7 @@ H5OpenFile2 ( ) { H5_API_ENTER (h5_file_t, "filename='%s', mode=%lld, props=%p", - filename, mode, (void*)props); + filename, (long long int)mode, (void*)props); H5_API_RETURN (h5_open_file2 (filename, mode, props)); } diff --git a/test/h5_attach_test.c b/test/h5_attach_test.c index f12900c..688b23d 100644 --- a/test/h5_attach_test.c +++ b/test/h5_attach_test.c @@ -19,13 +19,15 @@ main ( H5CloseFile (f); f = H5OpenFile (FNAME, H5_O_RDONLY, 0); h5_ssize_t num_attachments = H5GetNumAttachments (f); - printf ("Number of attachments: %lld\n", num_attachments); + printf ("Number of attachments: %lld\n", (long long int)num_attachments); int i; char fname[FILENAME_MAX]; h5_size_t fsize; for (i=0; i < num_attachments; i++) { H5GetAttachmentInfoByIdx (f, i, fname, sizeof(fname), &fsize); - printf ("Attachment %d: Name: %s, Size: %llu\n", i, fname, fsize); + printf ( + "Attachment %d: Name: %s, Size: %llu\n", + i, fname, (long long unsigned)fsize); H5GetAttachment (f, fname); H5DeleteAttachment (f, fname); }