summaryrefslogtreecommitdiffstats
path: root/hl/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2008-09-16 15:52:51 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2008-09-16 15:52:51 (GMT)
commitbdd7d59902483885dd8b883f3b2393e77383e5e8 (patch)
treeaaf20ab132d057b95b3c016d50fc22b77719084b /hl/src
parent8bc0d5ed9019a681e1ea20c24264415d01c1cf2a (diff)
downloadhdf5-bdd7d59902483885dd8b883f3b2393e77383e5e8.zip
hdf5-bdd7d59902483885dd8b883f3b2393e77383e5e8.tar.gz
hdf5-bdd7d59902483885dd8b883f3b2393e77383e5e8.tar.bz2
[svn-r15628] Description:
Remove trailing whitespace from C/C++ source files, with the following script: foreach f (*.[ch] *.cpp) sed 's/[[:blank:]]*$//' $f > sed.out && mv sed.out $f end Tested on: Mac OS X/32 10.5.5 (amazon) No need for h5committest, just whitespace changes...
Diffstat (limited to 'hl/src')
-rw-r--r--hl/src/H5IM.c94
-rw-r--r--hl/src/H5LTanalyze.c20
-rw-r--r--hl/src/H5LTparse.c50
-rw-r--r--hl/src/H5TB.c18
4 files changed, 91 insertions, 91 deletions
diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c
index d760675..2fec7e0 100644
--- a/hl/src/H5IM.c
+++ b/hl/src/H5IM.c
@@ -575,62 +575,62 @@ herr_t H5IMlink_palette( hid_t loc_id,
{
if((attr_id = H5Aopen(image_id, "PALETTE", H5P_DEFAULT)) < 0)
goto out;
-
+
if((attr_type = H5Aget_type(attr_id)) < 0)
goto out;
-
+
if((attr_class = H5Tget_class(attr_type)) < 0)
goto out;
-
+
/* Get and save the old reference(s) */
if((attr_space_id = H5Aget_space(attr_id)) < 0)
goto out;
-
+
n_refs = H5Sget_simple_extent_npoints(attr_space_id);
-
+
dim_ref = n_refs + 1;
-
+
refbuf = malloc( sizeof(hobj_ref_t) * (int)dim_ref );
-
+
if ( H5Aread( attr_id, attr_type, refbuf ) < 0)
goto out;
-
+
/* The attribute must be deleted, in order to the new one can reflect the changes*/
if(H5Adelete(image_id, "PALETTE") < 0)
goto out;
-
+
/* Create a new reference for this palette. */
if ( H5Rcreate( &ref, loc_id, pal_name, H5R_OBJECT, -1 ) < 0)
goto out;
-
+
refbuf[n_refs] = ref;
-
+
/* Create the data space for the new references */
if(H5Sclose(attr_space_id) < 0)
goto out;
-
+
if((attr_space_id = H5Screate_simple(1, &dim_ref, NULL)) < 0)
goto out;
-
+
/* Create the attribute again with the changes of space */
if(H5Aclose(attr_id) < 0)
goto out;
if((attr_id = H5Acreate2(image_id, "PALETTE", attr_type, attr_space_id, H5P_DEFAULT, H5P_DEFAULT)) < 0)
goto out;
-
+
/* Write the attribute with the new references */
if(H5Awrite(attr_id, attr_type, refbuf) < 0)
goto out;
-
+
/* close */
if(H5Sclose(attr_space_id) < 0)
goto out;
if(H5Aclose(attr_id) < 0)
goto out;
-
+
free( refbuf );
-
+
} /* ok_pal == 1 */
/* Close the image dataset. */
@@ -869,51 +869,51 @@ herr_t H5IMget_palette_info( hid_t loc_id,
hid_t pal_id;
hid_t pal_space_id;
hsize_t pal_maxdims[2];
-
+
/* Open the dataset. */
if((image_id = H5Dopen2(loc_id, image_name, H5P_DEFAULT)) < 0)
return -1;
-
+
/* Try to find the attribute "PALETTE" on the >>image<< dataset */
has_pal = H5IM_find_palette(image_id);
-
+
if(has_pal == 1)
{
if((attr_id = H5Aopen(image_id, "PALETTE", H5P_DEFAULT)) < 0)
goto out;
-
+
if((attr_type = H5Aget_type(attr_id)) < 0)
goto out;
-
+
if((attr_class = H5Tget_class(attr_type)) < 0)
goto out;
-
+
/* Get the reference(s) */
if((attr_space_id = H5Aget_space(attr_id)) < 0)
goto out;
-
+
n_refs = H5Sget_simple_extent_npoints(attr_space_id);
-
+
dim_ref = n_refs;
-
+
refbuf = malloc( sizeof(hobj_ref_t) * (int)dim_ref );
-
+
if ( H5Aread( attr_id, attr_type, refbuf ) < 0)
goto out;
-
+
/* Get the actual palette */
if ( (pal_id = H5Rdereference( image_id, H5R_OBJECT, &refbuf[pal_number] )) < 0)
goto out;
-
+
if ( (pal_space_id = H5Dget_space( pal_id )) < 0)
goto out;
-
+
if ( H5Sget_simple_extent_ndims( pal_space_id ) < 0)
goto out;
-
+
if ( H5Sget_simple_extent_dims( pal_space_id, pal_dims, pal_maxdims ) < 0)
goto out;
-
+
/* close */
if (H5Dclose(pal_id)<0)
goto out;
@@ -926,23 +926,23 @@ herr_t H5IMget_palette_info( hid_t loc_id,
if ( H5Aclose( attr_id ) < 0)
goto out;
free( refbuf );
-
-
+
+
}
-
+
/* Close the image dataset. */
if ( H5Dclose( image_id ) < 0)
return -1;
-
+
return 0;
-
+
out:
H5Dclose( image_id );
H5Sclose( attr_space_id );
H5Tclose( attr_type );
H5Aclose( attr_id );
return -1;
-
+
}
@@ -993,30 +993,30 @@ herr_t H5IMget_palette( hid_t loc_id,
{
if((attr_id = H5Aopen(image_id, "PALETTE", H5P_DEFAULT)) < 0)
goto out;
-
+
if((attr_type = H5Aget_type(attr_id)) < 0)
goto out;
-
+
if((attr_class = H5Tget_class(attr_type)) < 0)
goto out;
-
+
/* Get the reference(s) */
if((attr_space_id = H5Aget_space(attr_id)) < 0)
goto out;
-
+
n_refs = H5Sget_simple_extent_npoints(attr_space_id);
-
+
dim_ref = n_refs;
-
+
refbuf = malloc( sizeof(hobj_ref_t) * (int)dim_ref );
-
+
if ( H5Aread( attr_id, attr_type, refbuf ) < 0)
goto out;
-
+
/* Get the palette id */
if ( (pal_id = H5Rdereference( image_id, H5R_OBJECT, &refbuf[pal_number] )) < 0)
goto out;
-
+
/* Read the palette dataset */
if ( H5Dread( pal_id, H5Dget_type(pal_id), H5S_ALL, H5S_ALL, H5P_DEFAULT, pal_data ) < 0)
goto out;
diff --git a/hl/src/H5LTanalyze.c b/hl/src/H5LTanalyze.c
index f46b9ea..9e9eec2 100644
--- a/hl/src/H5LTanalyze.c
+++ b/hl/src/H5LTanalyze.c
@@ -849,7 +849,7 @@ hbool_t first_quote = 1;
/* For Lex and Yacc */
/*int input_len;
char *myinput;*/
-
+
#define TAG_STRING 1
#line 834 "H5LTanalyze.c"
@@ -1288,17 +1288,17 @@ YY_RULE_SETUP
case 40:
YY_RULE_SETUP
#line 121 "H5LTanalyze.l"
-{return token(H5T_STR_NULLTERM_TOKEN);}
+{return token(H5T_STR_NULLTERM_TOKEN);}
YY_BREAK
case 41:
YY_RULE_SETUP
#line 122 "H5LTanalyze.l"
-{return token(H5T_STR_NULLPAD_TOKEN);}
+{return token(H5T_STR_NULLPAD_TOKEN);}
YY_BREAK
case 42:
YY_RULE_SETUP
#line 123 "H5LTanalyze.l"
-{return token(H5T_STR_SPACEPAD_TOKEN);}
+{return token(H5T_STR_SPACEPAD_TOKEN);}
YY_BREAK
case 43:
YY_RULE_SETUP
@@ -1363,12 +1363,12 @@ YY_RULE_SETUP
case 55:
YY_RULE_SETUP
#line 139 "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) ) {
H5LTyylval.ival = atoi(yytext);
- return NUMBER;
+ return NUMBER;
} else
REJECT;
}
@@ -1378,7 +1378,7 @@ YY_RULE_SETUP
#line 149 "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;
@@ -2323,8 +2323,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 35c4670..9f67175 100644
--- a/hl/src/H5LTparse.c
+++ b/hl/src/H5LTparse.c
@@ -18,7 +18,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>
@@ -92,7 +92,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*/
@@ -100,7 +100,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*/
@@ -823,9 +823,9 @@ case 46:
break;
case 47:
#line 156 "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;
@@ -835,7 +835,7 @@ case 50:
break;
case 51:
#line 167 "H5LTparse.y"
-{
+{
size_t origin_size, new_size;
hid_t dtype_id = cmpd_stack[csindex].id;
@@ -849,7 +849,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);
@@ -860,10 +860,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;
@@ -887,7 +887,7 @@ case 56:
break;
case 57:
#line 213 "H5LTparse.y"
-{
+{
yyval.ival = H5Tarray_create2(yyvsp[-1].ival, arr_stack[asindex].ndims, arr_stack[asindex].dims);
arr_stack[asindex].ndims = 0;
asindex--;
@@ -901,9 +901,9 @@ break;
case 61:
#line 224 "H5LTparse.y"
{ unsigned 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:
@@ -916,10 +916,10 @@ case 65:
break;
case 66:
#line 241 "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:
@@ -928,7 +928,7 @@ case 67:
break;
case 68:
#line 247 "H5LTparse.y"
-{
+{
H5Tset_tag(yyvsp[-6].ival, yylval.sval);
is_opq_tag = 0;
}
@@ -943,12 +943,12 @@ case 72:
break;
case 73:
#line 260 "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:
@@ -964,7 +964,7 @@ case 74:
break;
case 75:
#line 277 "H5LTparse.y"
-{
+{
if(yyvsp[-1].ival == H5T_CSET_ASCII_TOKEN)
str_cset = H5T_CSET_ASCII;
else if(yyvsp[-1].ival == H5T_CSET_UTF8_TOKEN)
@@ -982,7 +982,7 @@ case 76:
break;
case 77:
#line 291 "H5LTparse.y"
-{
+{
hid_t str_id = yyvsp[-1].ival;
/*set string size*/
@@ -991,12 +991,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:
@@ -1043,7 +1043,7 @@ case 91:
#line 330 "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:
@@ -1056,7 +1056,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))
@@ -1070,7 +1070,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/H5TB.c b/hl/src/H5TB.c
index e80f86c..bbe9be5 100644
--- a/hl/src/H5TB.c
+++ b/hl/src/H5TB.c
@@ -61,7 +61,7 @@ static hid_t H5TB_create_type(hid_t loc_id,
*
* Date: January 17, 2001
*
- * Comments:
+ * Comments:
*
* Modifications:
*
@@ -113,7 +113,7 @@ herr_t H5TBmake_table( const char *table_title,
}
/* Create a simple data space with unlimited size */
- if((sid = H5Screate_simple( 1, dims, maxdims )) < 0)
+ if((sid = H5Screate_simple( 1, dims, maxdims )) < 0)
return -1;
/* Modify dataset creation properties, i.e. enable chunking */
@@ -2306,7 +2306,7 @@ herr_t H5TBinsert_field( hid_t loc_id,
if(inserted )
idx = i - 1;
- if(i == position ) {
+ if(i == position ) {
/* Get the new member size */
new_member_size = H5Tget_size( field_type );
@@ -2854,7 +2854,7 @@ herr_t H5TBdelete_field( hid_t loc_id,
* We have to read field by field of the old dataset and save it into the new one
*-------------------------------------------------------------------------
*/
- for ( i = 0; i < nfields; i++) {
+ for ( i = 0; i < nfields; i++) {
/* Get the member name */
member_name = H5Tget_member_name(type_id1, (unsigned)i);
@@ -3437,20 +3437,20 @@ int H5TB_find_field( const char *field, const char *field_list )
{
const char *start = field_list;
const char *end;
-
- while ( (end = strstr( start, "," )) != 0 )
+
+ while ( (end = strstr( start, "," )) != 0 )
{
size_t count = end - start;
if(strncmp(start, field, count) == 0 && count == strlen(field) )
return 1;
start = end + 1;
}
-
+
if(strcmp( start, field ) == 0 )
return 1;
-
+
return -1;
-
+
}