From 78158e8dbffcbf025257a72bb42c1fbe8c7660b7 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Wed, 11 Apr 2007 10:36:06 -0500 Subject: [svn-r13635] Description: Clean up code and reduce compiler warnings... Tested on: Mac OS X/32 10.4.9 (amazon) --- src/H5Aint.c | 2 +- src/H5FDcore.c | 2 +- src/H5FDstdio.c | 20 ++++++++++++-------- src/H5Gobj.c | 2 +- src/H5MF.c | 1 - src/H5T.c | 4 ++-- 6 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/H5Aint.c b/src/H5Aint.c index 1af97d9..fd1e3cd 100644 --- a/src/H5Aint.c +++ b/src/H5Aint.c @@ -644,7 +644,7 @@ H5A_get_ainfo(H5F_t *f, hid_t dxpl_id, H5O_t *oh, H5O_ainfo_t *ainfo) HDassert(oh); /* Retrieve the "attribute info" structure */ - if(ret_value = H5O_msg_read_real(f, dxpl_id, oh, H5O_AINFO_ID, ainfo)) { + if((ret_value = H5O_msg_read_real(f, dxpl_id, oh, H5O_AINFO_ID, ainfo))) { /* Check if we don't know how many attributes there are */ if(ret_value->nattrs == HSIZET_MAX) { /* Check if we are using "dense" attribute storage */ diff --git a/src/H5FDcore.c b/src/H5FDcore.c index ecc18bc..dba902b 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -578,7 +578,7 @@ done: *------------------------------------------------------------------------- */ static haddr_t -H5FD_core_get_eoa(const H5FD_t *_file, H5FD_mem_t type) +H5FD_core_get_eoa(const H5FD_t *_file, H5FD_mem_t UNUSED type) { haddr_t ret_value; /* Return value */ diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index 358b036..7498ae7 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -560,9 +560,13 @@ H5FD_stdio_alloc(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxp { H5FD_stdio_t *file = (H5FD_stdio_t*)_file; haddr_t addr; - static const char *func="H5FD_stdio_alloc"; /* Function Name for error reporting */ + static const char *func = "H5FD_stdio_alloc"; /* Function Name for error reporting */ haddr_t ret_value; /* Return value */ + /* Shut compiler up */ + type = type; + dxpl_id = dxpl_id; + /* Clear the error stack */ H5Eclear_stack(H5E_DEFAULT); @@ -570,22 +574,22 @@ H5FD_stdio_alloc(H5FD_t *_file, H5FD_mem_t /*UNUSED*/ type, hid_t /*UNUSED*/ dxp addr = file->eoa; /* Check if we need to align this block */ - if(size>=file->pub.threshold) { + if(size >= file->pub.threshold) { /* Check for an already aligned block */ - if(addr%file->pub.alignment!=0) - addr=((addr/file->pub.alignment)+1)*file->pub.alignment; + if((addr % file->pub.alignment) != 0) + addr = ((addr / file->pub.alignment) + 1) * file->pub.alignment; } /* end if */ #ifndef H5_HAVE_FSEEKO /* If fseeko isn't available, big files (>2GB) won't be supported. */ - if(addr+size>BIG_FILE) - H5Epush_ret (func, H5E_ERR_CLS, H5E_IO, H5E_SEEKERROR, "can't write file bigger than 2GB because fseeko isn't available", -1) + if((addr + size) > BIG_FILE) + H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_SEEKERROR, "can't write file bigger than 2GB because fseeko isn't available", HADDR_UNDEF) #endif - file->eoa = addr+size; + file->eoa = addr + size; /* Set return value */ - ret_value=addr; + ret_value = addr; return(ret_value); } /* H5FD_stdio_alloc() */ diff --git a/src/H5Gobj.c b/src/H5Gobj.c index e91b162..9c8b8e6 100644 --- a/src/H5Gobj.c +++ b/src/H5Gobj.c @@ -333,7 +333,7 @@ H5G_obj_get_linfo(const H5O_loc_t *grp_oloc, H5O_linfo_t *linfo, hid_t dxpl_id) HDassert(grp_oloc); /* Retrieve the "link info" structure */ - if(ret_value = H5O_msg_read(grp_oloc, H5O_LINFO_ID, linfo, dxpl_id)) { + if((ret_value = H5O_msg_read(grp_oloc, H5O_LINFO_ID, linfo, dxpl_id))) { /* Check if we don't know how many links there are */ if(ret_value->nlinks == HSIZET_MAX) { /* Check if we are using "dense" link storage */ diff --git a/src/H5MF.c b/src/H5MF.c index e7af521..8dff17d 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -237,7 +237,6 @@ hbool_t H5MF_alloc_overflow(H5F_t *f, hsize_t size) { hsize_t space_needed = 0; /* Accumulator variable */ - H5FD_mem_t type; /* Type of memory */ size_t c; /* Local index variable */ hbool_t ret_value; /* Return value */ diff --git a/src/H5T.c b/src/H5T.c index f494928..a231e3d 100644 --- a/src/H5T.c +++ b/src/H5T.c @@ -4639,7 +4639,7 @@ done: H5O_loc_t * H5T_oloc(H5T_t *dt) { - H5O_loc_t *ret_value = NULL; + H5O_loc_t *ret_value; FUNC_ENTER_NOAPI(H5T_oloc, NULL) @@ -4678,7 +4678,7 @@ done: H5G_name_t * H5T_nameof(H5T_t *dt) { - H5G_name_t *ret_value = NULL; + H5G_name_t *ret_value; FUNC_ENTER_NOAPI(H5T_nameof, NULL) -- cgit v0.12