diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2015-03-30 15:12:49 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2015-03-30 15:12:49 (GMT) |
commit | 01093ad350365e1a29f1726c4ff8c72f1d4d739a (patch) | |
tree | 3bbf175988e76609bb804b0099207a041465b92c /src | |
parent | bf7c3fb6708a2f77bd333b20a5167b9eead392a9 (diff) | |
download | hdf5-01093ad350365e1a29f1726c4ff8c72f1d4d739a.zip hdf5-01093ad350365e1a29f1726c4ff8c72f1d4d739a.tar.gz hdf5-01093ad350365e1a29f1726c4ff8c72f1d4d739a.tar.bz2 |
[svn-r26649] squish warnings.
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Epublic.h | 2 | ||||
-rw-r--r-- | src/H5FDmpio.c | 48 | ||||
-rw-r--r-- | src/H5Gdeprec.c | 2 | ||||
-rw-r--r-- | src/H5RS.c | 4 | ||||
-rw-r--r-- | src/H5RSprivate.h | 2 | ||||
-rw-r--r-- | src/H5Sdbg.c | 1 | ||||
-rw-r--r-- | src/H5TS.c | 2 | ||||
-rw-r--r-- | src/H5TSprivate.h | 2 |
8 files changed, 33 insertions, 30 deletions
diff --git a/src/H5Epublic.h b/src/H5Epublic.h index 17a35d9..1639ab4 100644 --- a/src/H5Epublic.h +++ b/src/H5Epublic.h @@ -165,7 +165,7 @@ H5_DLL herr_t H5Eclose_stack(hid_t stack_id); H5_DLL ssize_t H5Eget_class_name(hid_t class_id, char *name, size_t size); H5_DLL herr_t H5Eset_current_stack(hid_t err_stack_id); H5_DLL herr_t H5Epush2(hid_t err_stack, const char *file, const char *func, unsigned line, - hid_t cls_id, hid_t maj_id, hid_t min_id, const char *msg, ...); + hid_t cls_id, hid_t maj_id, hid_t min_id, const char *msg, ...)__attribute__((format (printf, 8, 9))); H5_DLL herr_t H5Epop(hid_t err_stack, size_t count); H5_DLL herr_t H5Eprint2(hid_t err_stack, FILE *stream); H5_DLL herr_t H5Ewalk2(hid_t err_stack, H5E_direction_t direction, H5E_walk2_t func, diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 70cf49a..d81509a 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -1049,8 +1049,7 @@ H5FD_mpio_open(const char *name, unsigned flags, hid_t fapl_id, char debug_str[128]; int flag, i; if (MPI_INFO_NULL != info_dup) { - /*OKAY: CAST DISCARDS CONST*/ - MPI_Info_get(fa->info, (char *)H5F_MPIO_DEBUG_KEY, 127, debug_str, &flag); + MPI_Info_get(fa->info, H5F_MPIO_DEBUG_KEY, sizeof(debug_str)-1, debug_str, &flag); if (flag) { fprintf(stdout, "H5FD_mpio debug flags=%s\n", debug_str ); for (i=0; @@ -1063,8 +1062,7 @@ H5FD_mpio_open(const char *name, unsigned flags, hid_t fapl_id, } #endif - /*OKAY: CAST DISCARDS CONST*/ - if(MPI_SUCCESS != (mpi_code = MPI_File_open(comm_dup, (char*)name, mpi_amode, info_dup, &fh))) + if(MPI_SUCCESS != (mpi_code = MPI_File_open(comm_dup, name, mpi_amode, info_dup, &fh))) HMPI_GOTO_ERROR(NULL, "MPI_File_open failed", mpi_code) file_opened=1; @@ -1460,12 +1458,13 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id, haddr_t add MPI_Count bytes_read; /* Number of bytes read in */ MPI_Count type_size; /* MPI datatype used for I/O's size */ MPI_Count io_size; /* Actual number of bytes requested */ + MPI_Count n; #else int bytes_read; /* Number of bytes read in */ int type_size; /* MPI datatype used for I/O's size */ int io_size; /* Actual number of bytes requested */ -#endif int n; +#endif H5P_genplist_t *plist = NULL; /* Property list pointer */ hbool_t use_view_this_time = FALSE; herr_t ret_value = SUCCEED; @@ -1506,7 +1505,10 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id, haddr_t add /* Obtain the data transfer properties */ if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - xfer_mode = (H5FD_mpio_xfer_t)H5P_peek_unsigned(plist, H5D_XFER_IO_XFER_MODE_NAME); + + /* get the transfer mode from the dxpl */ + if(H5P_get(plist, H5D_XFER_IO_XFER_MODE_NAME, &xfer_mode)<0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O transfer mode") /* * Set up for a fancy xfer using complex types, or single byte block. We @@ -1521,15 +1523,14 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id, haddr_t add use_view_this_time = TRUE; /* prepare for a full-blown xfer using btype, ftype, and disp */ - if(H5P_get(plist,H5FD_MPI_XFER_MEM_MPI_TYPE_NAME,&buf_type)<0) + if(H5P_get(plist, H5FD_MPI_XFER_MEM_MPI_TYPE_NAME, &buf_type)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property") - if(H5P_get(plist,H5FD_MPI_XFER_FILE_MPI_TYPE_NAME,&file_type)<0) + if(H5P_get(plist, H5FD_MPI_XFER_FILE_MPI_TYPE_NAME, &file_type)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O type property") /* * Set the file view when we are using MPI derived types */ - /*OKAY: CAST DISCARDS CONST QUALIFIER*/ if (MPI_SUCCESS != (mpi_code=MPI_File_set_view(file->f, mpi_off, MPI_BYTE, file_type, H5FD_mpi_native_g, file->info))) HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mpi_code) @@ -1548,9 +1549,12 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id, haddr_t add if (H5FD_mpio_Debug[(int)'t']) fprintf(stdout, "H5FD_mpio_read: using MPIO collective mode\n"); #endif - /* Peek the collective_opt property to check whether the application wants to do IO individually. */ + /* Get the collective_opt property to check whether the application wants to do IO individually. */ HDassert(plist); - coll_opt_mode = (H5FD_mpio_collective_opt_t)H5P_peek_unsigned(plist, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME); + + /* get the transfer mode from the dxpl */ + if(H5P_get(plist, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, &coll_opt_mode)<0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O collective_op property") if(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO) { #ifdef H5FDmpio_DEBUG @@ -1573,7 +1577,6 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id, haddr_t add /* * Reset the file view when we used MPI derived types */ - /*OKAY: CAST DISCARDS CONST QUALIFIER*/ if(MPI_SUCCESS != (mpi_code = MPI_File_set_view(file->f, (MPI_Offset)0, MPI_BYTE, MPI_BYTE, H5FD_mpi_native_g, file->info))) HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mpi_code) } else { @@ -1799,8 +1802,9 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, if(NULL == (plist = (H5P_genplist_t *)H5I_object(dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - /* Obtain the data transfer properties */ - xfer_mode = (H5FD_mpio_xfer_t)H5P_peek_unsigned(plist, H5D_XFER_IO_XFER_MODE_NAME); + /* get the transfer mode from the dxpl */ + if(H5P_get(plist, H5D_XFER_IO_XFER_MODE_NAME, &xfer_mode)<0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O transfer mode") /* * Set up for a fancy xfer using complex types, or single byte block. We @@ -1823,7 +1827,6 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, /* * Set the file view when we are using MPI derived types */ - /*OKAY: CAST DISCARDS CONST QUALIFIER*/ if(MPI_SUCCESS != (mpi_code = MPI_File_set_view(file->f, mpi_off, MPI_BYTE, file_type, H5FD_mpi_native_g, file->info))) HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mpi_code) @@ -1853,17 +1856,18 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, if(H5FD_mpio_Debug[(int)'t']) fprintf(stdout, "H5FD_mpio_write: using MPIO collective mode\n"); #endif - /* Peek the collective_opt property to check whether the application wants to do IO individually. */ + /* Get the collective_opt property to check whether the application wants to do IO individually. */ HDassert(plist); - coll_opt_mode = (H5FD_mpio_collective_opt_t)H5P_peek_unsigned(plist, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME); + /* get the transfer mode from the dxpl */ + if(H5P_get(plist, H5D_XFER_MPIO_COLLECTIVE_OPT_NAME, &coll_opt_mode)<0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get MPI-I/O collective_op property") - /*OKAY: CAST DISCARDS CONST QUALIFIER*/ if(coll_opt_mode == H5FD_MPIO_COLLECTIVE_IO) { #ifdef H5FDmpio_DEBUG if(H5FD_mpio_Debug[(int)'t']) fprintf(stdout, "H5FD_mpio_write: doing MPI collective IO\n"); #endif - if(MPI_SUCCESS != (mpi_code = MPI_File_write_at_all(file->f, mpi_off, (void*)buf, size_i, buf_type, &mpi_stat))) + if(MPI_SUCCESS != (mpi_code = MPI_File_write_at_all(file->f, mpi_off, buf, size_i, buf_type, &mpi_stat))) HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at_all failed", mpi_code) } /* end if */ else { @@ -1871,17 +1875,15 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, if(H5FD_mpio_Debug[(int)'t']) fprintf(stdout, "H5FD_mpio_write: doing MPI independent IO\n"); #endif - if(MPI_SUCCESS != (mpi_code = MPI_File_write_at(file->f, mpi_off, (void*)buf, size_i, buf_type, &mpi_stat))) + if(MPI_SUCCESS != (mpi_code = MPI_File_write_at(file->f, mpi_off, buf, size_i, buf_type, &mpi_stat))) HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at failed", mpi_code) } /* end else */ /* Reset the file view when we used MPI derived types */ - /*OKAY: CAST DISCARDS CONST QUALIFIER*/ if(MPI_SUCCESS != (mpi_code = MPI_File_set_view(file->f, (MPI_Offset)0, MPI_BYTE, MPI_BYTE, H5FD_mpi_native_g, file->info))) HMPI_GOTO_ERROR(FAIL, "MPI_File_set_view failed", mpi_code) } else { - /*OKAY: CAST DISCARDS CONST QUALIFIER*/ - if(MPI_SUCCESS != (mpi_code = MPI_File_write_at(file->f, mpi_off, (void*)buf, size_i, buf_type, &mpi_stat))) + if(MPI_SUCCESS != (mpi_code = MPI_File_write_at(file->f, mpi_off, buf, size_i, buf_type, &mpi_stat))) HMPI_GOTO_ERROR(FAIL, "MPI_File_write_at failed", mpi_code) } diff --git a/src/H5Gdeprec.c b/src/H5Gdeprec.c index 17920ab..6433544 100644 --- a/src/H5Gdeprec.c +++ b/src/H5Gdeprec.c @@ -261,7 +261,7 @@ H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get group info") /* Set the non-default local heap size hint */ - ginfo.lheap_size_hint = size_hint; + H5_ASSIGN_OVERFLOW(ginfo.lheap_size_hint, size_hint, size_t, uint32_t); if(H5P_set(gc_plist, H5G_CRT_GROUP_INFO_NAME, &ginfo) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set group info") } /* end if */ @@ -139,7 +139,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ H5RS_str_t * -H5RS_wrap(const char *s) +H5RS_wrap(char *s) { H5RS_str_t *ret_value; /* Return value */ @@ -150,7 +150,7 @@ H5RS_wrap(const char *s) HGOTO_ERROR(H5E_RS, H5E_NOSPACE, NULL, "memory allocation failed") /* Set the internal fields */ - ret_value->s = (char *)s; /* (Cast away const OK - QAK) */ + ret_value->s = s; ret_value->wrapped = 1; ret_value->n = 1; diff --git a/src/H5RSprivate.h b/src/H5RSprivate.h index c46f53c..757e0e4 100644 --- a/src/H5RSprivate.h +++ b/src/H5RSprivate.h @@ -46,7 +46,7 @@ typedef struct H5RS_str_t H5RS_str_t; /* Private routines */ /********************/ H5_DLL H5RS_str_t *H5RS_create(const char *s); -H5_DLL H5RS_str_t *H5RS_wrap(const char *s); +H5_DLL H5RS_str_t *H5RS_wrap(char *s); H5_DLL H5RS_str_t *H5RS_own(char *s); H5_DLL herr_t H5RS_decr(H5RS_str_t *rs); H5_DLL herr_t H5RS_incr(H5RS_str_t *rs); diff --git a/src/H5Sdbg.c b/src/H5Sdbg.c index df033da..0cbe4f2 100644 --- a/src/H5Sdbg.c +++ b/src/H5Sdbg.c @@ -113,6 +113,7 @@ H5S_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, int indent, indent + 3, MAX(0, fwidth - 3)); break; + case H5S_NO_CLASS: default: fprintf(stream, "%*s%-*s **UNKNOWN-%ld**\n", indent, "", fwidth, "Space class:", (long)(H5S_GET_EXTENT_TYPE(mesg))); @@ -489,7 +489,7 @@ H5TS_win32_thread_exit(void) *-------------------------------------------------------------------------- */ H5TS_thread_t -H5TS_create_thread(void *func, H5TS_attr_t *attr, void *udata) +H5TS_create_thread(void *(*func)(void *), H5TS_attr_t *attr, void *udata) { H5TS_thread_t ret_value; diff --git a/src/H5TSprivate.h b/src/H5TSprivate.h index cc22f96..5394b77 100644 --- a/src/H5TSprivate.h +++ b/src/H5TSprivate.h @@ -122,7 +122,7 @@ H5_DLL herr_t H5TS_mutex_lock(H5TS_mutex_t *mutex); H5_DLL herr_t H5TS_mutex_unlock(H5TS_mutex_t *mutex); H5_DLL herr_t H5TS_cancel_count_inc(void); H5_DLL herr_t H5TS_cancel_count_dec(void); -H5_DLL H5TS_thread_t H5TS_create_thread(void * func, H5TS_attr_t * attr, void *udata); +H5_DLL H5TS_thread_t H5TS_create_thread(void *(*func)(void *), H5TS_attr_t * attr, void *udata); #if defined c_plusplus || defined __cplusplus } |