summaryrefslogtreecommitdiffstats
path: root/src/H5S.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2002-04-18 20:10:05 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2002-04-18 20:10:05 (GMT)
commit40117dd3849be65d039ca6aa02bb6d6a338c7f7b (patch)
treeb589fe0fa3486826e63600f57a02f6bedba22e55 /src/H5S.c
parentfa3c25fbf0dafa1d5bd9817eb208a0db72f57232 (diff)
downloadhdf5-40117dd3849be65d039ca6aa02bb6d6a338c7f7b.zip
hdf5-40117dd3849be65d039ca6aa02bb6d6a338c7f7b.tar.gz
hdf5-40117dd3849be65d039ca6aa02bb6d6a338c7f7b.tar.bz2
[svn-r5203] Purpose:
Code cleanup Description: Re-indented new code to match coding style of rest of library. Platforms tested: FreeBSD 4.5 (sleipnir)
Diffstat (limited to 'src/H5S.c')
-rw-r--r--src/H5S.c57
1 files changed, 23 insertions, 34 deletions
diff --git a/src/H5S.c b/src/H5S.c
index f681615..076155f 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -1973,9 +1973,7 @@ H5S_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth)
FUNC_LEAVE(SUCCEED);
}
-
-
-
+
/*-------------------------------------------------------------------------
* Function: H5S_set_extent
*
@@ -1991,39 +1989,30 @@ H5S_debug(H5F_t *f, const void *_mesg, FILE *stream, int indent, int fwidth)
*
*-------------------------------------------------------------------------
*/
-
int H5S_set_extent( H5S_t *space, const hsize_t *size )
{
- int ret_value = 0;
- unsigned u;
-
- FUNC_ENTER( H5S_set_extent, FAIL );
-
- /* Check args */
- assert( space && H5S_SIMPLE==space->extent.type );
- assert( size);
-
- for ( u = 0; u < space->extent.u.simple.rank; u++ )
- {
- if ( space->extent.u.simple.max &&
- H5S_UNLIMITED != space->extent.u.simple.max[u] &&
- space->extent.u.simple.max[u]<size[u] )
- {
- HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL,"dimension cannot be modified");
- }
-
- ret_value++;
- }
-
- /* Update */
- if ( ret_value )
- {
- for ( u = 0; u < space->extent.u.simple.rank; u++ )
- {
- space->extent.u.simple.size[u] = size[u];
- }
- }
+ int ret_value;
+ unsigned u;
+
+ FUNC_ENTER( H5S_set_extent, FAIL );
+
+ /* Check args */
+ assert( space && H5S_SIMPLE==space->extent.type );
+ assert( size);
+
+ for ( u = 0; u < space->extent.u.simple.rank; u++ )
+ if ( space->extent.u.simple.max &&
+ H5S_UNLIMITED != space->extent.u.simple.max[u] &&
+ space->extent.u.simple.max[u]<size[u] )
+ HRETURN_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL,"dimension cannot be modified");
+
+ /* Update dimensions with new values */
+ for ( u = 0; u < space->extent.u.simple.rank; u++ )
+ space->extent.u.simple.size[u] = size[u];
+
+ /* Set return value */
+ ret_value=space->extent.u.simple.rank;
- FUNC_LEAVE( ret_value );
+ FUNC_LEAVE( ret_value );
}