summaryrefslogtreecommitdiffstats
path: root/src/H5Tvlen.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2008-09-10 19:10:41 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2008-09-10 19:10:41 (GMT)
commitc465e18a68f2a77550d93366a5b6c8fac2e24502 (patch)
treebd3649f75f1507040b68d8e15c63333600816360 /src/H5Tvlen.c
parent068620ea815d8590982069cfb6374e07d3c8e1e6 (diff)
downloadhdf5-c465e18a68f2a77550d93366a5b6c8fac2e24502.zip
hdf5-c465e18a68f2a77550d93366a5b6c8fac2e24502.tar.gz
hdf5-c465e18a68f2a77550d93366a5b6c8fac2e24502.tar.bz2
[svn-r15609] Description:
Omnibus compiler warning cleanup & some reformatting also. Tested on: Mac OS X/32 10.5.4 (amazon) Too minor to require h5committest
Diffstat (limited to 'src/H5Tvlen.c')
-rw-r--r--src/H5Tvlen.c66
1 files changed, 32 insertions, 34 deletions
diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c
index 0404707..d80bd94 100644
--- a/src/H5Tvlen.c
+++ b/src/H5Tvlen.c
@@ -203,68 +203,63 @@ done:
* Programmer: Quincey Koziol
* Friday, June 4, 1999
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
htri_t
H5T_vlen_set_loc(const H5T_t *dt, H5F_t *f, H5T_loc_t loc)
{
- htri_t ret_value = 0; /* Indicate that success, but no location change */
+ htri_t ret_value = FALSE; /* Indicate success, but no location change */
FUNC_ENTER_NOAPI_NOINIT(H5T_vlen_set_loc)
/* check parameters */
- assert(dt);
- assert(loc>H5T_LOC_BADLOC && loc<H5T_LOC_MAXLOC);
+ HDassert(dt);
+ HDassert(loc > H5T_LOC_BADLOC && loc < H5T_LOC_MAXLOC);
/* Only change the location if it's different */
if(loc != dt->shared->u.vlen.loc || f != dt->shared->u.vlen.f) {
- /* Indicate that the location changed */
- ret_value=TRUE;
-
switch(loc) {
case H5T_LOC_MEMORY: /* Memory based VL datatype */
- assert(f==NULL);
+ HDassert(NULL == f);
/* Mark this type as being stored in memory */
- dt->shared->u.vlen.loc=H5T_LOC_MEMORY;
+ dt->shared->u.vlen.loc = H5T_LOC_MEMORY;
- if(dt->shared->u.vlen.type==H5T_VLEN_SEQUENCE) {
+ if(dt->shared->u.vlen.type == H5T_VLEN_SEQUENCE) {
/* size in memory, disk size is different */
dt->shared->size = sizeof(hvl_t);
/* Set up the function pointers to access the VL sequence in memory */
- dt->shared->u.vlen.getlen=H5T_vlen_seq_mem_getlen;
- dt->shared->u.vlen.getptr=H5T_vlen_seq_mem_getptr;
- dt->shared->u.vlen.isnull=H5T_vlen_seq_mem_isnull;
- dt->shared->u.vlen.read=H5T_vlen_seq_mem_read;
- dt->shared->u.vlen.write=H5T_vlen_seq_mem_write;
- dt->shared->u.vlen.setnull=H5T_vlen_seq_mem_setnull;
- } else if(dt->shared->u.vlen.type==H5T_VLEN_STRING) {
+ dt->shared->u.vlen.getlen = H5T_vlen_seq_mem_getlen;
+ dt->shared->u.vlen.getptr = H5T_vlen_seq_mem_getptr;
+ dt->shared->u.vlen.isnull = H5T_vlen_seq_mem_isnull;
+ dt->shared->u.vlen.read = H5T_vlen_seq_mem_read;
+ dt->shared->u.vlen.write = H5T_vlen_seq_mem_write;
+ dt->shared->u.vlen.setnull = H5T_vlen_seq_mem_setnull;
+ } else if(dt->shared->u.vlen.type == H5T_VLEN_STRING) {
/* size in memory, disk size is different */
dt->shared->size = sizeof(char *);
/* Set up the function pointers to access the VL string in memory */
- dt->shared->u.vlen.getlen=H5T_vlen_str_mem_getlen;
- dt->shared->u.vlen.getptr=H5T_vlen_str_mem_getptr;
- dt->shared->u.vlen.isnull=H5T_vlen_str_mem_isnull;
- dt->shared->u.vlen.read=H5T_vlen_str_mem_read;
- dt->shared->u.vlen.write=H5T_vlen_str_mem_write;
- dt->shared->u.vlen.setnull=H5T_vlen_str_mem_setnull;
+ dt->shared->u.vlen.getlen = H5T_vlen_str_mem_getlen;
+ dt->shared->u.vlen.getptr = H5T_vlen_str_mem_getptr;
+ dt->shared->u.vlen.isnull = H5T_vlen_str_mem_isnull;
+ dt->shared->u.vlen.read = H5T_vlen_str_mem_read;
+ dt->shared->u.vlen.write = H5T_vlen_str_mem_write;
+ dt->shared->u.vlen.setnull = H5T_vlen_str_mem_setnull;
} else {
assert(0 && "Invalid VL type");
}
/* Reset file ID (since this VL is in memory) */
- dt->shared->u.vlen.f=NULL;
+ dt->shared->u.vlen.f = NULL;
break;
case H5T_LOC_DISK: /* Disk based VL datatype */
- assert(f);
+ HDassert(f);
/* Mark this type as being stored on disk */
- dt->shared->u.vlen.loc=H5T_LOC_DISK;
+ dt->shared->u.vlen.loc = H5T_LOC_DISK;
/*
* Size of element on disk is 4 bytes for the length, plus the size
@@ -275,20 +270,23 @@ H5T_vlen_set_loc(const H5T_t *dt, H5F_t *f, H5T_loc_t loc)
/* Set up the function pointers to access the VL information on disk */
/* VL sequences and VL strings are stored identically on disk, so use the same functions */
- dt->shared->u.vlen.getlen=H5T_vlen_disk_getlen;
- dt->shared->u.vlen.getptr=H5T_vlen_disk_getptr;
- dt->shared->u.vlen.isnull=H5T_vlen_disk_isnull;
- dt->shared->u.vlen.read=H5T_vlen_disk_read;
- dt->shared->u.vlen.write=H5T_vlen_disk_write;
- dt->shared->u.vlen.setnull=H5T_vlen_disk_setnull;
+ dt->shared->u.vlen.getlen = H5T_vlen_disk_getlen;
+ dt->shared->u.vlen.getptr = H5T_vlen_disk_getptr;
+ dt->shared->u.vlen.isnull = H5T_vlen_disk_isnull;
+ dt->shared->u.vlen.read = H5T_vlen_disk_read;
+ dt->shared->u.vlen.write = H5T_vlen_disk_write;
+ dt->shared->u.vlen.setnull = H5T_vlen_disk_setnull;
/* Set file ID (since this VL is on disk) */
- dt->shared->u.vlen.f=f;
+ dt->shared->u.vlen.f = f;
break;
default:
HGOTO_ERROR(H5E_DATATYPE, H5E_BADRANGE, FAIL, "invalid VL datatype location")
} /* end switch */ /*lint !e788 All appropriate cases are covered */
+
+ /* Indicate that the location changed */
+ ret_value = TRUE;
} /* end if */
done: