From d423367d4fa22feb20a4e68fbaa6c046103057db Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Thu, 8 Nov 2018 15:34:32 +0100 Subject: [PATCH] most warnings fixed if compiling with NDEBUG defined --- src/Fortran/H5.c | 3 +-- src/h5core/h5_file.c | 3 +-- src/h5core/h5t_store.c | 2 ++ src/h5core/h5u_io.c | 3 +-- src/h5core/private/h5_log.h | 8 +++++++- src/h5core/private/h5t_model_tetm.c | 4 ++-- src/h5core/private/h5t_model_trim.c | 4 ++-- 7 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/Fortran/H5.c b/src/Fortran/H5.c index e72bc79..cbeda59 100644 --- a/src/Fortran/H5.c +++ b/src/Fortran/H5.c @@ -165,10 +165,9 @@ h5_openfile ( h5_int64_t* _props, const int _len_fname ) { - int len_fname = strlenf (_fname, _len_fname); H5_API_ENTER (h5_int64_t, "fname = %*s, mode=%lld, props=%lld", - len_fname, _fname, (long long int)*_mode, (long long int)*_props); + _len_fname, _fname, (long long int)*_mode, (long long int)*_props); char* fname = h5_strdupfor2c (_fname, _len_fname); h5_int64_t mode = *_mode; h5_prop_t props = (h5_prop_t)*_props; diff --git a/src/h5core/h5_file.c b/src/h5core/h5_file.c index d984a6f..1ac7e5f 100644 --- a/src/h5core/h5_file.c +++ b/src/h5core/h5_file.c @@ -765,8 +765,7 @@ h5_err_t h5_start_traverse_iterations ( const h5_file_t f_ /*!< file handle */ ) { - h5_file_p f = (h5_file_p)f_; - H5_CORE_API_ENTER (int, "f=%p", f); + H5_CORE_API_ENTER (int, "f=%p", (void*)f_); /* fast test: Does Step#0 or Step#1 exist? diff --git a/src/h5core/h5t_store.c b/src/h5core/h5t_store.c index aa5a642..b9565ff 100644 --- a/src/h5core/h5t_store.c +++ b/src/h5core/h5t_store.c @@ -687,6 +687,7 @@ rebuild_map_elem_g2l ( H5_RETURN (H5_SUCCESS); } +#if defined(WITH_PARALLEL_H5GRID) /* Rebuild mapping of global element indices to their local indices. */ @@ -716,6 +717,7 @@ rebuild_map_elem_g2l_partial ( h5priv_sort_idxmap (map); H5_RETURN (H5_SUCCESS); } +#endif h5_err_t h5t_end_store_elems ( diff --git a/src/h5core/h5u_io.c b/src/h5core/h5u_io.c index ec781b9..be5959a 100644 --- a/src/h5core/h5u_io.c +++ b/src/h5core/h5u_io.c @@ -248,10 +248,9 @@ h5u_write_dataset ( const void* data, /*!< IN: Array to commit to disk */ const h5_types_t type /*!< IN: Type of data */ ) { - h5_file_p f = (h5_file_p)fh; H5_CORE_API_ENTER (h5_err_t, "f=%p, name='%s', data=%p, type=%lld", - f, name, data, (long long int)type); + (void*)fh, name, data, (long long int)type); hid_t dset_id; TRY (dset_id = h5u_open_dataset (fh, name, type)); TRY (h5u_write (fh, dset_id, type, data)); diff --git a/src/h5core/private/h5_log.h b/src/h5core/private/h5_log.h index 7a56f74..44486b4 100644 --- a/src/h5core/private/h5_log.h +++ b/src/h5core/private/h5_log.h @@ -43,9 +43,15 @@ #define H5_PRIV_FUNC_ENTER(type, fmt, ...) \ __FUNC_ENTER(type, H5_DEBUG_PRIV_FUNC, fmt, __VA_ARGS__ ) +#ifdef NDEBUG +#define H5_INLINE_FUNC_ENTER(type) \ + type ret_value = (type)H5_ERR; + +#else #define H5_INLINE_FUNC_ENTER(type) \ type ret_value = (type)H5_ERR; int __log__ = 0; - +#endif + #define HDF5_WRAPPER_ENTER(type, fmt, ...) \ __FUNC_ENTER(type, H5_DEBUG_HDF5, fmt, __VA_ARGS__ ) diff --git a/src/h5core/private/h5t_model_tetm.c b/src/h5core/private/h5t_model_tetm.c index 6c49935..66e9128 100644 --- a/src/h5core/private/h5t_model_tetm.c +++ b/src/h5core/private/h5t_model_tetm.c @@ -191,9 +191,9 @@ h5t_add_chunked_tetrahedral_mesh ( const h5_weight_t num_weights, h5t_mesh_t** mesh ) { - h5_file_p f = (h5_file_p)fh; - H5_CORE_API_ENTER (h5_err_t, "f=%p, name=%s, mesh=%p", f, name, mesh); + H5_CORE_API_ENTER (h5_err_t, "f=%p, name=%s, mesh=%p", (void*)fh, name, mesh); #ifdef WITH_PARALLEL_H5GRID + h5_file_p f = (h5_file_p)fh; CHECK_WRITABLE_MODE (f); h5_err_t exists; TRY (exists = h5priv_link_exists ( diff --git a/src/h5core/private/h5t_model_trim.c b/src/h5core/private/h5t_model_trim.c index b98831f..f6891a8 100644 --- a/src/h5core/private/h5t_model_trim.c +++ b/src/h5core/private/h5t_model_trim.c @@ -209,9 +209,9 @@ h5t_add_chunked_triangle_mesh( const h5_weight_t num_weights, h5t_mesh_t** mesh ) { - h5_file_p f = (h5_file_p)fh; - H5_CORE_API_ENTER (h5_err_t, "f=%p, name=%s, mesh=%p", f, name, mesh); + H5_CORE_API_ENTER (h5_err_t, "f=%p, name=%s, mesh=%p", (void*)fh, name, mesh); #ifdef WITH_PARALLEL_H5GRID + h5_file_p f = (h5_file_p)fh; int size = -1; TRY (h5priv_mpi_comm_size (f->props->comm, &size)); if (size != 1) {