[svn-r7211] Purpose:

Code cleanup

Description:
    Various code cleanups suggested by lint tool

Platforms tested:
    FreeBSD 4.8 (sleipnir)
    h5committest
This commit is contained in:
Quincey Koziol 2003-07-11 13:06:51 -05:00
parent 2c92c3ca18
commit 01e9075358
6 changed files with 531 additions and 458 deletions

916
src/H5D.c

File diff suppressed because it is too large Load Diff

View File

@ -46,7 +46,7 @@
#define H5D_CRT_CHUNK_SIZE_NAME "chunk_size"
#define H5D_CRT_CHUNK_SIZE_SIZE sizeof(hsize_t[H5O_LAYOUT_NDIMS])
#define H5D_CRT_CHUNK_SIZE_DEF {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1}
/* Definitions for fill value. size=0 means fill value will be 0 as
* library default; size=-1 means fill value is undefined. */
#define H5D_CRT_FILL_VALUE_NAME "fill_value"
@ -149,7 +149,7 @@ H5_DLL herr_t H5D_init(void);
H5_DLL hid_t H5D_open(H5G_entry_t *ent, hid_t dxpl_id);
H5_DLL htri_t H5D_isa(H5G_entry_t *ent, hid_t dxpl_id);
H5_DLL H5G_entry_t *H5D_entof(H5D_t *dataset);
H5_DLL H5T_t *H5D_typeof(H5D_t *dset);
H5_DLL H5T_t *H5D_typeof(const H5D_t *dset);
H5_DLL herr_t H5D_crt_copy(hid_t new_plist_t, hid_t old_plist_t,
void *copy_data);
H5_DLL herr_t H5D_crt_close(hid_t dxpl_id, void *close_data);

View File

@ -95,8 +95,8 @@ H5_DLL herr_t H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t plist_id, voi
H5_DLL herr_t H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, hsize_t *size);
H5_DLL herr_t H5Dfill(const void *fill, hid_t fill_type, void *buf,
hid_t buf_type, hid_t space);
H5_DLL herr_t H5Ddebug(hid_t dset_id, unsigned int flags);
H5_DLL herr_t H5Dset_extent (hid_t dset_id, const hsize_t *size);
H5_DLL herr_t H5Ddebug(hid_t dset_id);
#ifdef __cplusplus

View File

@ -125,13 +125,13 @@ H5V_vector_reduce_product(unsigned n, const hsize_t *v)
hsize_t ret_value = 1;
/* Use FUNC_ENTER_NOINIT here to avoid performance issues */
FUNC_ENTER_NOINIT(H5V_vector_reduce_product);
FUNC_ENTER_NOINIT(H5V_vector_reduce_product)
if (n && !v) HGOTO_DONE(0);
if (n && !v) HGOTO_DONE(0)
while (n--) ret_value *= *v++;
done:
FUNC_LEAVE_NOAPI(ret_value);
FUNC_LEAVE_NOAPI(ret_value)
}
/*-------------------------------------------------------------------------
@ -157,16 +157,16 @@ H5V_vector_zerop_u(int n, const hsize_t *v)
htri_t ret_value=TRUE; /* Return value */
/* Use FUNC_ENTER_NOINIT here to avoid performance issues */
FUNC_ENTER_NOINIT(H5V_vector_zerop_u);
FUNC_ENTER_NOINIT(H5V_vector_zerop_u)
if (!v)
HGOTO_DONE(TRUE);
HGOTO_DONE(TRUE)
while (n--)
if (*v++)
HGOTO_DONE(FALSE);
HGOTO_DONE(FALSE)
done:
FUNC_LEAVE_NOAPI(ret_value);
FUNC_LEAVE_NOAPI(ret_value)
}
/*-------------------------------------------------------------------------
@ -192,16 +192,16 @@ H5V_vector_zerop_s(int n, const hssize_t *v)
htri_t ret_value=TRUE; /* Return value */
/* Use FUNC_ENTER_NOINIT here to avoid performance issues */
FUNC_ENTER_NOINIT(H5V_vector_zerop_s);
FUNC_ENTER_NOINIT(H5V_vector_zerop_s)
if (!v)
HGOTO_DONE(TRUE);
HGOTO_DONE(TRUE)
while (n--)
if (*v++)
HGOTO_DONE(FALSE);
HGOTO_DONE(FALSE)
done:
FUNC_LEAVE_NOAPI(ret_value);
FUNC_LEAVE_NOAPI(ret_value)
}
/*-------------------------------------------------------------------------
@ -229,18 +229,18 @@ H5V_vector_cmp_u (int n, const hsize_t *v1, const hsize_t *v2)
int ret_value=0; /* Return value */
/* Use FUNC_ENTER_NOINIT here to avoid performance issues */
FUNC_ENTER_NOINIT(H5V_vector_cmp_u);
FUNC_ENTER_NOINIT(H5V_vector_cmp_u)
if (v1 == v2) HGOTO_DONE(0);
if (v1 == v2) HGOTO_DONE(0)
while (n--) {
if ((v1 ? *v1 : 0) < (v2 ? *v2 : 0)) HGOTO_DONE(-1);
if ((v1 ? *v1 : 0) > (v2 ? *v2 : 0)) HGOTO_DONE(1);
if ((v1 ? *v1 : 0) < (v2 ? *v2 : 0)) HGOTO_DONE(-1)
if ((v1 ? *v1 : 0) > (v2 ? *v2 : 0)) HGOTO_DONE(1)
if (v1) v1++;
if (v2) v2++;
}
done:
FUNC_LEAVE_NOAPI(ret_value);
FUNC_LEAVE_NOAPI(ret_value)
}
@ -269,18 +269,18 @@ H5V_vector_cmp_s (unsigned n, const hssize_t *v1, const hssize_t *v2)
int ret_value=0; /* Return value */
/* Use FUNC_ENTER_NOINIT here to avoid performance issues */
FUNC_ENTER_NOINIT(H5V_vector_cmp_s);
FUNC_ENTER_NOINIT(H5V_vector_cmp_s)
if (v1 == v2) HGOTO_DONE(0);
if (v1 == v2) HGOTO_DONE(0)
while (n--) {
if ((v1 ? *v1 : 0) < (v2 ? *v2 : 0)) HGOTO_DONE(-1);
if ((v1 ? *v1 : 0) > (v2 ? *v2 : 0)) HGOTO_DONE(1);
if ((v1 ? *v1 : 0) < (v2 ? *v2 : 0)) HGOTO_DONE(-1)
if ((v1 ? *v1 : 0) > (v2 ? *v2 : 0)) HGOTO_DONE(1)
if (v1) v1++;
if (v2) v2++;
}
done:
FUNC_LEAVE_NOAPI(ret_value);
FUNC_LEAVE_NOAPI(ret_value)
}

View File

@ -3,6 +3,19 @@
-esym(534, H5FL_arr_free, H5FL_blk_free, H5FL_reg_free)
-esym(534, H5I_clear_group, H5I_destroy_group)
-esym(534, H5MM_xfree)
-esym(534, H5V_array_fill)
// Turn off warnings about not using the inlined H5V* functions:
-esym(528, H5V_vector_reduce_product, H5V_vector_inc)
-esym(528, H5V_vector_cmp, H5V_vector_cmp_s, H5V_vector_cmp_u)
-esym(528, H5V_vector_zerop_s, H5V_vector_zerop_u)
// Turn off warnings about not "Expression-like macro not parenthesized" for
// enumerated type increment & decrement macros:
-esym(773, H5_INC_ENUM, H5_DEC_ENUM)
// Turn off warnings about not using PABLO_MASK macro
-esym(750, PABLO_MASK)
// Suppress message about our use of 'goto' in our error macros
-emacro(801,HGOTO_DONE)
@ -22,6 +35,15 @@
// Suppress message about "Boolean within 'if' always evaluates false" in FUNC_ENTER* macros
-emacro(774,FUNC_ENTER_API,FUNC_ENTER_NOAPI)
// Suppress message about "Constant value boolean" in IS_H5FD_MPI* macros
-emacro(506,IS_H5FD_MPI)
// Suppress message about "Boolean within 'if' always evaluates false" in IS_H5FD_MPI* macros
-emacro((774),IS_H5FD_MPI)
// Suppress message about "Static variable found within inline function" in FUNC_ENTER* macros
-emacro(1534,FUNC_ENTER_NOINIT)
// Suppress message about "Shift right of signed quantity" in H5I_GRP macro
-emacro(702,H5I_GRP)
@ -49,4 +71,5 @@
H5A.c
H5AC.c
H5B.c
H5D.c
*/

View File

@ -1600,7 +1600,7 @@ dataset_list2(hid_t dset, const char UNUSED *name)
printf("\n");
/* Print address information */
if (address_g) H5Ddebug(dset, 0);
if (address_g) H5Ddebug(dset);
/* Close stuff */
H5Tclose(type);