summaryrefslogtreecommitdiffstats
path: root/hl/src
diff options
context:
space:
mode:
Diffstat (limited to 'hl/src')
-rw-r--r--hl/src/H5DS.c50
-rw-r--r--hl/src/H5LT.c54
-rw-r--r--hl/src/H5LTanalyze.c20
-rw-r--r--hl/src/H5LTparse.c50
-rw-r--r--hl/src/H5LTprivate.h4
-rw-r--r--hl/src/H5PTprivate.h2
-rw-r--r--hl/src/H5TB.c34
7 files changed, 107 insertions, 107 deletions
diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c
index 254f7df..fa158a5 100644
--- a/hl/src/H5DS.c
+++ b/hl/src/H5DS.c
@@ -25,11 +25,11 @@
/*-------------------------------------------------------------------------
* Function: H5DSset_scale
*
- * Purpose: The dataset DSID is converted to a Dimension Scale dataset.
- * Creates the CLASS attribute, set to the value "DIMENSION_SCALE"
- * and an empty REFERENCE_LIST attribute.
- * If DIMNAME is specified, then an attribute called NAME is created,
- * with the value DIMNAME.
+ * Purpose: The dataset DSID is converted to a Dimension Scale dataset.
+ * Creates the CLASS attribute, set to the value "DIMENSION_SCALE"
+ * and an empty REFERENCE_LIST attribute.
+ * If DIMNAME is specified, then an attribute called NAME is created,
+ * with the value DIMNAME.
*
* Return: Success: SUCCEED, Failure: FAIL
*
@@ -95,17 +95,17 @@ herr_t H5DSset_scale(hid_t dsid,
/*-------------------------------------------------------------------------
* Function: H5DSattach_scale
*
- * Purpose: Define Dimension Scale DSID to be associated with dimension IDX
- * of Dataset DID. Entries are created in the DIMENSION_LIST and
- * REFERENCE_LIST attributes.
+ * Purpose: Define Dimension Scale DSID to be associated with dimension IDX
+ * of Dataset DID. Entries are created in the DIMENSION_LIST and
+ * REFERENCE_LIST attributes.
*
* Return:
* Success: SUCCEED
* Failure: FAIL
*
- * Fails if: Bad arguments
- * If DSID is not a Dimension Scale
- * If DID is a Dimension Scale (A Dimension Scale cannot have scales)
+ * Fails if: Bad arguments
+ * If DSID is not a Dimension Scale
+ * If DID is a Dimension Scale (A Dimension Scale cannot have scales)
*
* Programmer: pvn@ncsa.uiuc.edu
*
@@ -556,20 +556,20 @@ out:
/*-------------------------------------------------------------------------
* Function: H5DSdetach_scale
*
- * Purpose: If possible, deletes association of Dimension Scale DSID with
- * dimension IDX of Dataset DID. This deletes the entries in the
- * DIMENSION_LIST and REFERENCE_LIST attributes.
+ * Purpose: If possible, deletes association of Dimension Scale DSID with
+ * dimension IDX of Dataset DID. This deletes the entries in the
+ * DIMENSION_LIST and REFERENCE_LIST attributes.
*
* Return:
* Success: SUCCEED
* Failure: FAIL
*
- * Fails if: Bad arguments
- * The dataset DID or DSID do not exist.
- * The DSID is not a Dimension Scale
- * DSID is not attached to DID.
- * Note that a scale may be associated with more than dimension of the same dataset.
- * If so, the detach operation only deletes one of the associations, for DID.
+ * Fails if: Bad arguments
+ * The dataset DID or DSID do not exist.
+ * The DSID is not a Dimension Scale
+ * DSID is not attached to DID.
+ * Note that a scale may be associated with more than dimension of the same dataset.
+ * If so, the detach operation only deletes one of the associations, for DID.
*
* Programmer: pvn@ncsa.uiuc.edu
*
@@ -934,9 +934,9 @@ out:
* 0: one of them or both do not match
* FAIL (-1): error
*
- * Fails if: Bad arguments
- * If DSID is not a Dimension Scale
- * If DID is a Dimension Scale (A Dimension Scale cannot have scales)
+ * Fails if: Bad arguments
+ * If DSID is not a Dimension Scale
+ * If DID is a Dimension Scale (A Dimension Scale cannot have scales)
*
* Programmer: pvn@ncsa.uiuc.edu
*
@@ -1209,7 +1209,7 @@ out:
*
* hid_t DID; IN: the dataset
* unsigned int dim; IN: the dimension of the dataset
- * int *idx; IN/OUT: input the index to start iterating, output the
+ * int *idx; IN/OUT: input the index to start iterating, output the
* next index to visit. If NULL, start at the first position.
* H5DS_iterate_t visitor; IN: the visitor function
* void *visitor_data; IN: arbitrary data to pass to the visitor function.
@@ -1964,7 +1964,7 @@ int H5DSget_num_scales(hid_t did,
*-------------------------------------------------------------------------
*/
- else
+ else
{
if ((aid = H5Aopen_name(did,DIMENSION_LIST))<0)
goto out;
diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c
index acc30b8..5db6cd4 100644
--- a/hl/src/H5LT.c
+++ b/hl/src/H5LT.c
@@ -985,11 +985,11 @@ herr_t H5LTget_dataset_info( hid_t loc_id,
/* get the dataspace handle */
if ( (sid = H5Dget_space( did )) < 0 )
goto out;
-
+
/* get dimensions */
if ( H5Sget_simple_extent_dims( sid, dims, NULL) < 0 )
goto out;
-
+
/* terminate access to the dataspace */
if ( H5Sclose( sid ) < 0 )
goto out;
@@ -1756,7 +1756,7 @@ static herr_t find_attr( hid_t loc_id, const char *name, void *op_data)
/*-------------------------------------------------------------------------
* Function: H5LTfind_attribute
*
- * Purpose: Inquires if an attribute named attr_name exists attached to
+ * Purpose: Inquires if an attribute named attr_name exists attached to
* the object loc_id.
*
* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
@@ -2039,7 +2039,7 @@ out:
hid_t H5LTtext_to_dtype(const char *text, H5LT_lang_t lang_type)
{
extern int yyparse(void);
- hid_t type_id;
+ hid_t type_id;
if(lang_type <= H5LT_LANG_ERR || lang_type >= H5LT_NO_LANG)
goto out;
@@ -2048,7 +2048,7 @@ hid_t H5LTtext_to_dtype(const char *text, H5LT_lang_t lang_type)
fprintf(stderr, "only DDL is supported for now.\n");
goto out;
}
-
+
input_len = strlen(text);
myinput = strdup(text);
@@ -2118,17 +2118,17 @@ print_enum(hid_t type, char* str, int indt)
size_t dst_size; /*destination value type size */
int i;
herr_t ret = SUCCEED;
-
+
if((nmembs = H5Tget_nmembers(type))==0)
goto out;
assert(nmembs>0);
if((super = H5Tget_super(type))<0)
goto out;
-
+
/* Use buffer of INT or UNSIGNED INT to print enum values because
* we don't expect these values to be so big that INT or UNSIGNED
* INT can't hold.
- */
+ */
if (H5T_SGN_NONE == H5Tget_sign(super)) {
native = H5T_NATIVE_UINT;
} else {
@@ -2137,7 +2137,7 @@ print_enum(hid_t type, char* str, int indt)
super_size = H5Tget_size(super);
dst_size = H5Tget_size(native);
-
+
/* Get the names and raw values of all members */
name = (char**)calloc((size_t)nmembs, sizeof(char *));
value = (unsigned char*)calloc((size_t)nmembs, MAX(dst_size, super_size));
@@ -2154,7 +2154,7 @@ print_enum(hid_t type, char* str, int indt)
if(H5Tconvert(super, native, (size_t)nmembs, value, NULL, H5P_DEFAULT)<0)
goto out;
}
-
+
/*
* Sort members by increasing value
* ***not implemented yet***
@@ -2167,7 +2167,7 @@ print_enum(hid_t type, char* str, int indt)
strcat(str, tmp_str);
sprintf(tmp_str, "%*s ", MAX(0, 16 - nchars), "");
strcat(str, tmp_str);
-
+
if (H5T_SGN_NONE == H5Tget_sign(native)) {
/*On SGI Altix(cobalt), wrong values were printed out with "value+i*dst_size"
*strangely, unless use another pointer "copy".*/
@@ -2226,7 +2226,7 @@ herr_t H5LTdtype_to_text(hid_t dtype, char *str, H5LT_lang_t lang_type, size_t *
size_t str_len = INCREMENT;
char *text_str;
herr_t ret = -1;
-
+
if(lang_type <= H5LT_LANG_ERR || lang_type >= H5LT_NO_LANG)
goto out;
@@ -2265,7 +2265,7 @@ out:
*
*-------------------------------------------------------------------------
*/
-herr_t H5LT_dtype_to_text(hid_t dtype, char **dt_str, H5LT_lang_t lang, size_t *slen,
+herr_t H5LT_dtype_to_text(hid_t dtype, char **dt_str, H5LT_lang_t lang, size_t *slen,
hbool_t no_user_buf)
{
H5T_class_t tcls;
@@ -2282,15 +2282,15 @@ herr_t H5LT_dtype_to_text(hid_t dtype, char **dt_str, H5LT_lang_t lang, size_t *
*dt_str = tmp;
}
}
-
+
if(lang != H5LT_DDL) {
sprintf(*dt_str, "only DDL is supported for now");
goto out;
}
-
+
if((tcls = H5Tget_class(dtype))<0)
goto out;
-
+
switch (tcls) {
case H5T_INTEGER:
if (H5Tequal(dtype, H5T_STD_I8BE)) {
@@ -2451,7 +2451,7 @@ herr_t H5LT_dtype_to_text(hid_t dtype, char **dt_str, H5LT_lang_t lang, size_t *
if (H5Tequal(tmp_type, str_type)) {
strcat(*dt_str, "CTYPE H5T_C_S1;\n");
goto next;
- }
+ }
/* Change the endianness and see if they're equal. */
if((order = H5Tget_order(tmp_type))<0)
@@ -2463,7 +2463,7 @@ herr_t H5LT_dtype_to_text(hid_t dtype, char **dt_str, H5LT_lang_t lang, size_t *
if(H5Tset_order(str_type, H5T_ORDER_BE)<0)
goto out;
}
-
+
if (H5Tequal(tmp_type, str_type)) {
strcat(*dt_str, "H5T_C_S1;\n");
goto next;
@@ -2481,7 +2481,7 @@ herr_t H5LT_dtype_to_text(hid_t dtype, char **dt_str, H5LT_lang_t lang, size_t *
goto out;
if(H5Tset_strpad(str_type, str_pad)<0)
goto out;
-
+
/* Are the two types equal? */
if (H5Tequal(tmp_type, str_type)) {
strcat(*dt_str, "CTYPE H5T_FORTRAN_S1;\n");
@@ -2523,7 +2523,7 @@ next:
/* Print lead-in */
sprintf(*dt_str, "H5T_OPAQUE {\n");
indent += COL;
-
+
indentation(indent + COL, *dt_str);
sprintf(tmp_str, "OPQ_SIZE %lu;\n", (unsigned long)H5Tget_size(dtype));
strcat(*dt_str, tmp_str);
@@ -2531,7 +2531,7 @@ next:
indentation(indent + COL, *dt_str);
sprintf(tmp_str, "OPQ_TAG \"%s\";\n", H5Tget_tag(dtype));
strcat(*dt_str, tmp_str);
-
+
/* Print closing */
indent -= COL;
indentation(indent + COL, *dt_str);
@@ -2548,14 +2548,14 @@ next:
sprintf(*dt_str, "H5T_ENUM {\n");
indent += COL;
indentation(indent + COL, *dt_str);
-
+
if((super = H5Tget_super(dtype))<0)
goto out;
if(H5LTdtype_to_text(super, NULL, lang, &super_len)<0)
goto out;
stmp = (char*)calloc(super_len, sizeof(char));
if(H5LTdtype_to_text(super, stmp, lang, &super_len)<0)
- goto out;
+ goto out;
strcat(*dt_str, stmp);
free(stmp);
strcat(*dt_str, ";\n");
@@ -2588,7 +2588,7 @@ next:
goto out;
stmp = (char*)calloc(super_len, sizeof(char));
if(H5LTdtype_to_text(super, stmp, lang, &super_len)<0)
- goto out;
+ goto out;
strcat(*dt_str, stmp);
free(stmp);
strcat(*dt_str, "\n");
@@ -2633,7 +2633,7 @@ next:
goto out;
stmp = (char*)calloc(super_len, sizeof(char));
if(H5LTdtype_to_text(super, stmp, lang, &super_len)<0)
- goto out;
+ goto out;
strcat(*dt_str, stmp);
free(stmp);
strcat(*dt_str, "\n");
@@ -2655,7 +2655,7 @@ next:
size_t mlen;
char* mtmp;
int nmembs;
-
+
if((nmembs = H5Tget_nmembers(dtype))<0)
goto out;
@@ -2679,7 +2679,7 @@ next:
goto out;
mtmp = (char*)calloc(mlen, sizeof(char));
if(H5LTdtype_to_text(mtype, mtmp, lang, &mlen)<0)
- goto out;
+ goto out;
strcat(*dt_str, mtmp);
free(mtmp);
diff --git a/hl/src/H5LTanalyze.c b/hl/src/H5LTanalyze.c
index 2b31f11..2b2603c 100644
--- a/hl/src/H5LTanalyze.c
+++ b/hl/src/H5LTanalyze.c
@@ -829,7 +829,7 @@ hbool_t first_quote = 1;
/* For Lex and Yacc */
/*int input_len;
char *myinput;*/
-
+
#define TAG_STRING 1
#line 815 "H5LTanalyze.c"
@@ -1268,17 +1268,17 @@ YY_RULE_SETUP
case 40:
YY_RULE_SETUP
#line 120 "H5LTanalyze.l"
-{return token(H5T_STR_NULLTERM_TOKEN);}
+{return token(H5T_STR_NULLTERM_TOKEN);}
YY_BREAK
case 41:
YY_RULE_SETUP
#line 121 "H5LTanalyze.l"
-{return token(H5T_STR_NULLPAD_TOKEN);}
+{return token(H5T_STR_NULLPAD_TOKEN);}
YY_BREAK
case 42:
YY_RULE_SETUP
#line 122 "H5LTanalyze.l"
-{return token(H5T_STR_SPACEPAD_TOKEN);}
+{return token(H5T_STR_SPACEPAD_TOKEN);}
YY_BREAK
case 43:
YY_RULE_SETUP
@@ -1343,12 +1343,12 @@ YY_RULE_SETUP
case 55:
YY_RULE_SETUP
#line 138 "H5LTanalyze.l"
-{
- if( is_str_size || (is_enum && is_enum_memb) ||
+{
+ if( is_str_size || (is_enum && is_enum_memb) ||
is_opq_size || (asindex>-1 && arr_stack[asindex].is_dim) ||
(csindex>-1 && cmpd_stack[csindex].is_field) ) {
yylval.ival = atoi(yytext);
- return NUMBER;
+ return NUMBER;
} else
REJECT;
}
@@ -1358,7 +1358,7 @@ YY_RULE_SETUP
#line 148 "H5LTanalyze.l"
{
/*if it's first quote, and is a compound field name or an enum symbol*/
- if((is_opq_tag || is_enum || (csindex>-1 && cmpd_stack[csindex].is_field))
+ if((is_opq_tag || is_enum || (csindex>-1 && cmpd_stack[csindex].is_field))
&& first_quote) {
first_quote = 0;
BEGIN TAG_STRING;
@@ -2302,8 +2302,8 @@ int main()
int my_yyinput(char *buf, int max_size)
{
int ret;
-
- memcpy(buf, myinput, input_len);
+
+ memcpy(buf, myinput, input_len);
ret = input_len;
return ret;
}
diff --git a/hl/src/H5LTparse.c b/hl/src/H5LTparse.c
index 4867d5a..32258d0 100644
--- a/hl/src/H5LTparse.c
+++ b/hl/src/H5LTparse.c
@@ -17,7 +17,7 @@
*/
#ifndef lint
-static char const
+static char const
yyrcsid[] = "$FreeBSD: src/usr.bin/yacc/skeleton.c,v 1.28 2000/01/17 02:04:06 bde Exp $";
#endif
#include <stdlib.h>
@@ -65,7 +65,7 @@ struct arr_info {
};
/*stack for nested array type*/
struct arr_info arr_stack[STACK_SIZE];
-int asindex = -1; /*pointer to the top of array stack*/
+int asindex = -1; /*pointer to the top of array stack*/
hbool_t is_str_size = 0; /*flag to lexer for string size*/
hbool_t is_str_pad = 0; /*flag to lexer for string padding*/
@@ -73,7 +73,7 @@ H5T_pad_t str_pad; /*variable for string padding*/
H5T_cset_t str_cset; /*variable for string character set*/
hbool_t is_variable = 0; /*variable for variable-length string*/
size_t str_size; /*variable for string size*/
-
+
hid_t enum_id; /*type ID*/
hbool_t is_enum = 0; /*flag to lexer for enum type*/
hbool_t is_enum_memb = 0; /*flag to lexer for enum member*/
@@ -796,9 +796,9 @@ case 46:
break;
case 47:
#line 155 "H5LTparse.y"
-{ yyval.ival = cmpd_stack[csindex].id;
+{ yyval.ival = cmpd_stack[csindex].id;
cmpd_stack[csindex].id = 0;
- cmpd_stack[csindex].first_memb = 1;
+ cmpd_stack[csindex].first_memb = 1;
csindex--;
}
break;
@@ -808,7 +808,7 @@ case 50:
break;
case 51:
#line 166 "H5LTparse.y"
-{
+{
size_t origin_size, new_size;
hid_t dtype_id = cmpd_stack[csindex].id;
@@ -822,7 +822,7 @@ case 51:
cmpd_stack[csindex].first_memb = 0;
} else {
origin_size = H5Tget_size(dtype_id);
-
+
if(yyvsp[-1].ival == 0) {
new_size = origin_size + H5Tget_size(yyvsp[-6].ival);
H5Tset_size(dtype_id, new_size);
@@ -833,10 +833,10 @@ case 51:
H5Tinsert(dtype_id, yyvsp[-3].sval, yyvsp[-1].ival, yyvsp[-6].ival);
}
}
-
+
cmpd_stack[csindex].is_field = 0;
H5Tclose(yyvsp[-6].ival);
-
+
new_size = H5Tget_size(dtype_id);
}
break;
@@ -860,7 +860,7 @@ case 56:
break;
case 57:
#line 212 "H5LTparse.y"
-{
+{
yyval.ival = H5Tarray_create(yyvsp[-1].ival, arr_stack[asindex].ndims, arr_stack[asindex].dims, NULL);
arr_stack[asindex].ndims = 0;
asindex--;
@@ -874,9 +874,9 @@ break;
case 61:
#line 223 "H5LTparse.y"
{ int ndims = arr_stack[asindex].ndims;
- arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival;
+ arr_stack[asindex].dims[ndims] = (hsize_t)yylval.ival;
arr_stack[asindex].ndims++;
- arr_stack[asindex].is_dim = 0;
+ arr_stack[asindex].is_dim = 0;
}
break;
case 64:
@@ -889,10 +889,10 @@ case 65:
break;
case 66:
#line 240 "H5LTparse.y"
-{
+{
size_t size = (size_t)yylval.ival;
yyval.ival = H5Tcreate(H5T_OPAQUE, size);
- is_opq_size = 0;
+ is_opq_size = 0;
}
break;
case 67:
@@ -901,7 +901,7 @@ case 67:
break;
case 68:
#line 246 "H5LTparse.y"
-{
+{
H5Tset_tag(yyvsp[-6].ival, yylval.sval);
is_opq_tag = 0;
}
@@ -916,12 +916,12 @@ case 72:
break;
case 73:
#line 259 "H5LTparse.y"
-{
+{
if(yyvsp[-1].ival == H5T_VARIABLE_TOKEN)
is_variable = 1;
- else
+ else
str_size = yylval.ival;
- is_str_size = 0;
+ is_str_size = 0;
}
break;
case 74:
@@ -937,7 +937,7 @@ case 74:
break;
case 75:
#line 276 "H5LTparse.y"
-{
+{
if(yyvsp[-1].ival == H5T_CSET_ASCII_TOKEN)
str_cset = H5T_CSET_ASCII;
else if(yyvsp[-1].ival == H5T_CSET_UTF8_TOKEN)
@@ -955,7 +955,7 @@ case 76:
break;
case 77:
#line 290 "H5LTparse.y"
-{
+{
hid_t str_id = yyvsp[-1].ival;
/*set string size*/
@@ -964,12 +964,12 @@ case 77:
is_variable = 0;
} else
H5Tset_size(str_id, str_size);
-
+
/*set string padding and character set*/
H5Tset_strpad(str_id, str_pad);
H5Tset_cset(str_id, str_cset);
- yyval.ival = str_id;
+ yyval.ival = str_id;
}
break;
case 78:
@@ -1016,7 +1016,7 @@ case 91:
#line 329 "H5LTparse.y"
{
is_enum_memb = 1; /*indicate member of enum*/
- enum_memb_symbol = strdup(yylval.sval);
+ enum_memb_symbol = strdup(yylval.sval);
}
break;
case 92:
@@ -1029,7 +1029,7 @@ case 92:
long_long llong_val=(long_long)yylval.ival;
hid_t super = H5Tget_super(enum_id);
hid_t native = H5Tget_native_type(super, H5T_DIR_ASCEND);
-
+
if(is_enum && is_enum_memb) { /*if it's an enum member*/
/*To handle machines of different endianness*/
if(H5Tequal(native, H5T_NATIVE_SCHAR) || H5Tequal(native, H5T_NATIVE_UCHAR))
@@ -1043,7 +1043,7 @@ case 92:
else if(H5Tequal(native, H5T_NATIVE_LLONG) || H5Tequal(native, H5T_NATIVE_ULLONG))
H5Tenum_insert(enum_id, enum_memb_symbol, &llong_val);
- is_enum_memb = 0;
+ is_enum_memb = 0;
if(enum_memb_symbol) free(enum_memb_symbol);
}
diff --git a/hl/src/H5LTprivate.h b/hl/src/H5LTprivate.h
index 426c223..6e54c54 100644
--- a/hl/src/H5LTprivate.h
+++ b/hl/src/H5LTprivate.h
@@ -19,7 +19,7 @@
#include "H5HLprivate2.h"
/* public LT prototypes */
-#include "H5LTpublic.h"
+#include "H5LTpublic.h"
/*-------------------------------------------------------------------------
* Private functions
@@ -49,7 +49,7 @@ H5_HLDLL herr_t H5LT_set_attribute_string( hid_t dset_id,
H5_HLDLL herr_t H5LT_find_attribute( hid_t loc_id, const char *name );
-H5_HLDLL herr_t H5LT_dtype_to_text(hid_t dtype, char **dt_str, H5LT_lang_t lang,
+H5_HLDLL herr_t H5LT_dtype_to_text(hid_t dtype, char **dt_str, H5LT_lang_t lang,
size_t *slen, hbool_t no_user_buf);
diff --git a/hl/src/H5PTprivate.h b/hl/src/H5PTprivate.h
index 3bba9d2..4c36813 100644
--- a/hl/src/H5PTprivate.h
+++ b/hl/src/H5PTprivate.h
@@ -19,7 +19,7 @@
#include "H5HLprivate2.h"
/* public LT prototypes */
-#include "H5PTpublic.h"
+#include "H5PTpublic.h"
#endif
diff --git a/hl/src/H5TB.c b/hl/src/H5TB.c
index d9579c3..7cbd5c4 100644
--- a/hl/src/H5TB.c
+++ b/hl/src/H5TB.c
@@ -3686,40 +3686,40 @@ herr_t H5TB_common_append_records( hid_t dataset_id,
hid_t mem_space_id = H5I_BADID;
hsize_t dims[1];
hsize_t mem_dims[1];
-
+
/* Extend the dataset */
dims[0] = nrecords + orig_table_size;
if ( H5Dextend ( dataset_id, dims ) < 0 )
goto out;
-
+
/* Create a simple memory data space */
mem_dims[0]=nrecords;
if ( (mem_space_id = H5Screate_simple( 1, mem_dims, NULL )) < 0 )
goto out;
-
+
/* Get a copy of the new file data space for writing */
if ( (space_id = H5Dget_space( dataset_id )) < 0 )
goto out;
-
+
/* Define a hyperslab in the dataset */
offset[0] = orig_table_size;
count[0] = nrecords;
if ( H5Sselect_hyperslab( space_id, H5S_SELECT_SET, offset, NULL, count, NULL)<0)
goto out;
-
+
/* Write the records */
if ( H5Dwrite( dataset_id, mem_type_id, mem_space_id, space_id, H5P_DEFAULT, data )<0)
goto out;
-
+
/* Terminate access to the dataspace */
if ( H5Sclose( mem_space_id ) < 0 )
goto out;
-
+
if ( H5Sclose( space_id ) < 0 )
goto out;
-
+
return 0;
-
+
out:
H5E_BEGIN_TRY
H5Sclose(mem_space_id);
@@ -3760,38 +3760,38 @@ herr_t H5TB_common_read_records( hid_t dataset_id,
hid_t space_id = H5I_BADID;
hid_t mem_space_id = H5I_BADID;
hsize_t mem_size[1];
-
+
/* Make sure the read request is in bounds */
if ( start + nrecords > table_size )
goto out;
-
+
/* Get the dataspace handle */
if ( (space_id = H5Dget_space( dataset_id )) < 0 )
goto out;
-
+
/* Define a hyperslab in the dataset of the size of the records */
offset[0] = start;
count[0] = nrecords;
if ( H5Sselect_hyperslab( space_id, H5S_SELECT_SET, offset, NULL, count, NULL) < 0 )
goto out;
-
+
/* Create a memory dataspace handle */
mem_size[0] = count[0];
if ((mem_space_id = H5Screate_simple( 1, mem_size, NULL )) < 0 )
goto out;
if ((H5Dread( dataset_id, mem_type_id, mem_space_id, space_id, H5P_DEFAULT, data))<0)
goto out;
-
+
/* Terminate access to the memory dataspace */
if ( H5Sclose( mem_space_id ) < 0 )
goto out;
-
+
/* Terminate access to the dataspace */
if ( H5Sclose( space_id ) < 0 )
goto out;
-
+
return 0;
-
+
out:
H5E_BEGIN_TRY
H5Sclose(space_id);