summaryrefslogtreecommitdiffstats
path: root/hl
diff options
context:
space:
mode:
Diffstat (limited to 'hl')
-rw-r--r--hl/c++/test/ptableTest.cpp4
-rw-r--r--hl/examples/ex_table_01.c2
-rw-r--r--hl/examples/ex_table_02.c2
-rw-r--r--hl/examples/ex_table_03.c2
-rw-r--r--hl/examples/ex_table_04.c2
-rw-r--r--hl/examples/ex_table_05.c2
-rw-r--r--hl/examples/ex_table_06.c2
-rw-r--r--hl/examples/ex_table_07.c2
-rw-r--r--hl/examples/ex_table_08.c2
-rw-r--r--hl/examples/ex_table_09.c2
-rw-r--r--hl/examples/ex_table_10.c2
-rw-r--r--hl/examples/ex_table_11.c2
-rw-r--r--hl/examples/ex_table_12.c2
-rwxr-xr-xhl/fortran/src/H5TBfc.c2
-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
-rw-r--r--hl/test/test_image.c286
-rw-r--r--hl/test/test_packet.c6
-rw-r--r--hl/test/test_table.c8
-rw-r--r--hl/tools/gif2h5/gif2hdf.c4
-rw-r--r--hl/tools/gif2h5/h52gifgentst.c16
-rw-r--r--hl/tools/gif2h5/hdf2gif.c66
-rw-r--r--hl/tools/gif2h5/writehdf.c6
25 files changed, 302 insertions, 302 deletions
diff --git a/hl/c++/test/ptableTest.cpp b/hl/c++/test/ptableTest.cpp
index da84006..9c48f77 100644
--- a/hl/c++/test/ptableTest.cpp
+++ b/hl/c++/test/ptableTest.cpp
@@ -253,13 +253,13 @@ out:
int TestCompress()
{
-
+
unsigned int flags = 0;
unsigned int config = 0;
size_t cd_nelemts = 0;
TESTING("compression")
-#ifdef H5_HAVE_FILTER_DEFLATE
+#ifdef H5_HAVE_FILTER_DEFLATE
try {
/* Create packet table with compression. */
FL_PacketTable wrapper(fileID, "/compressTest", H5T_NATIVE_CHAR, 100, 8);
diff --git a/hl/examples/ex_table_01.c b/hl/examples/ex_table_01.c
index 1ffcb22..de304d9 100644
--- a/hl/examples/ex_table_01.c
+++ b/hl/examples/ex_table_01.c
@@ -129,7 +129,7 @@ int main( void )
/* close type */
H5Tclose( string_type );
-
+
/* close the file */
H5Fclose( file_id );
diff --git a/hl/examples/ex_table_02.c b/hl/examples/ex_table_02.c
index 1ef661c..98e33d3 100644
--- a/hl/examples/ex_table_02.c
+++ b/hl/examples/ex_table_02.c
@@ -123,7 +123,7 @@ int main( void )
/* close type */
H5Tclose( string_type );
-
+
/* close the file */
H5Fclose( file_id );
diff --git a/hl/examples/ex_table_03.c b/hl/examples/ex_table_03.c
index af3894e..7315fd3 100644
--- a/hl/examples/ex_table_03.c
+++ b/hl/examples/ex_table_03.c
@@ -129,7 +129,7 @@ int main( void )
/* close type */
H5Tclose( string_type );
-
+
/* close the file */
H5Fclose( file_id );
diff --git a/hl/examples/ex_table_04.c b/hl/examples/ex_table_04.c
index 10d888f..0a01116 100644
--- a/hl/examples/ex_table_04.c
+++ b/hl/examples/ex_table_04.c
@@ -155,7 +155,7 @@ int main( void )
/* close type */
H5Tclose( string_type );
-
+
/* close the file */
H5Fclose( file_id );
diff --git a/hl/examples/ex_table_05.c b/hl/examples/ex_table_05.c
index ee671e0..f0c96eb 100644
--- a/hl/examples/ex_table_05.c
+++ b/hl/examples/ex_table_05.c
@@ -166,7 +166,7 @@ int main( void )
/* close type */
H5Tclose( string_type );
-
+
/* close the file */
H5Fclose( file_id );
diff --git a/hl/examples/ex_table_06.c b/hl/examples/ex_table_06.c
index e2e1038..261b23c 100644
--- a/hl/examples/ex_table_06.c
+++ b/hl/examples/ex_table_06.c
@@ -87,7 +87,7 @@ int main( void )
/* close type */
H5Tclose( string_type );
-
+
/* close the file */
H5Fclose( file_id );
diff --git a/hl/examples/ex_table_07.c b/hl/examples/ex_table_07.c
index 1be9f13..3479aa8 100644
--- a/hl/examples/ex_table_07.c
+++ b/hl/examples/ex_table_07.c
@@ -105,7 +105,7 @@ int main( void )
/* close type */
H5Tclose( string_type );
-
+
/* close the file */
H5Fclose( file_id );
diff --git a/hl/examples/ex_table_08.c b/hl/examples/ex_table_08.c
index 6ec0ac1..4078bea 100644
--- a/hl/examples/ex_table_08.c
+++ b/hl/examples/ex_table_08.c
@@ -136,7 +136,7 @@ int main( void )
/* close type */
H5Tclose( string_type );
-
+
/* close the file */
H5Fclose( file_id );
diff --git a/hl/examples/ex_table_09.c b/hl/examples/ex_table_09.c
index 82dca3f..7ba0aa1 100644
--- a/hl/examples/ex_table_09.c
+++ b/hl/examples/ex_table_09.c
@@ -137,7 +137,7 @@ int main( void )
/* close type */
H5Tclose( string_type );
-
+
/* close the file */
H5Fclose( file_id );
diff --git a/hl/examples/ex_table_10.c b/hl/examples/ex_table_10.c
index fb11a98..20543c2 100644
--- a/hl/examples/ex_table_10.c
+++ b/hl/examples/ex_table_10.c
@@ -129,7 +129,7 @@ int main( void )
/* close type */
H5Tclose( string_type );
-
+
/* close the file */
H5Fclose( file_id );
diff --git a/hl/examples/ex_table_11.c b/hl/examples/ex_table_11.c
index 7679ac6..872fa4e 100644
--- a/hl/examples/ex_table_11.c
+++ b/hl/examples/ex_table_11.c
@@ -109,7 +109,7 @@ int main( void )
/* close type */
H5Tclose( string_type );
-
+
/* close the file */
H5Fclose( file_id );
diff --git a/hl/examples/ex_table_12.c b/hl/examples/ex_table_12.c
index b4a5a3a..b6cc2b4 100644
--- a/hl/examples/ex_table_12.c
+++ b/hl/examples/ex_table_12.c
@@ -102,7 +102,7 @@ int main( void )
/* close type */
H5Tclose( string_type );
-
+
/* close the file */
H5Fclose( file_id );
diff --git a/hl/fortran/src/H5TBfc.c b/hl/fortran/src/H5TBfc.c
index cea094a..c641cf4 100755
--- a/hl/fortran/src/H5TBfc.c
+++ b/hl/fortran/src/H5TBfc.c
@@ -635,7 +635,7 @@ int_f
nh5tbinsert_field_c(hid_t_f *loc_id,
int_f *namelen,
_fcd name,
- int_f *namelen1,
+ int_f *namelen1,
_fcd field_name,
hid_t_f *field_type,
int_f *position,
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;
-
+
}
diff --git a/hl/test/test_image.c b/hl/test/test_image.c
index 9645bad..2a365e2 100644
--- a/hl/test/test_image.c
+++ b/hl/test/test_image.c
@@ -68,15 +68,15 @@ unsigned char *image_data = NULL;
int main(void)
{
int nerrors=0;
-
+
nerrors += test_simple()<0 ?1:0;
nerrors += test_data()<0 ?1:0;
nerrors += test_generate()<0 ?1:0;
-
+
if (nerrors) goto error;
printf("All image tests passed.\n");
return 0;
-
+
error:
printf("***** %d IMAGE TEST%s FAILED! *****\n",nerrors, 1 == nerrors ? "" : "S");
return 1;
@@ -96,21 +96,21 @@ static int test_simple(void)
int i, j, n, space;
char interlace[20];
hssize_t npals;
-
+
/* 8-bit image */
unsigned char buf1 [ WIDTH*HEIGHT ];
unsigned char pal[ PAL_ENTRIES * 3 ]; /* palette array */
hsize_t pal_dims[2] = {PAL_ENTRIES,3}; /* palette dimensions */
-
+
/* 24-bit image */
unsigned char buf2 [ WIDTH*HEIGHT*3 ];
-
+
/* read data */
unsigned char buf1_out [ WIDTH*HEIGHT ];
unsigned char buf2_out [ WIDTH*HEIGHT*3 ];
unsigned char pal_out[ PAL_ENTRIES * 3 ]; /* palette array */
hsize_t pal_dims_out[2]; /* palette dimensions */
-
+
/* create an image */
space = WIDTH*HEIGHT / PAL_ENTRIES;
for (i=0, j=0, n=0; i < WIDTH*HEIGHT; i++, j++ )
@@ -121,10 +121,10 @@ static int test_simple(void)
n++;
j=0;
}
-
+
}
-
-
+
+
/* create an image */
space = WIDTH*HEIGHT / 256;
for (i=0, j=0, n=0; i < WIDTH*HEIGHT*3; i+=3, j++ )
@@ -141,9 +141,9 @@ static int test_simple(void)
j=0;
}
}
-
+
/*-------------------------------------------------------------------------
- * define a palette, blue to red tones
+ * define a palette, blue to red tones
*-------------------------------------------------------------------------
*/
for ( i=0, n=0; i<PAL_ENTRIES*3; i+=3, n++)
@@ -152,140 +152,140 @@ static int test_simple(void)
pal[i+1]=0; /* green */
pal[i+2]=255-n; /* blue */
}
-
+
/* Create a new HDF5 file using default properties. */
fid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT );
-
+
/*-------------------------------------------------------------------------
* Indexed image test
*-------------------------------------------------------------------------
*/
-
+
TESTING("indexed image");
-
+
/* Write image */
if ( H5IMmake_image_8bit( fid, IMAGE1_NAME, width, height, buf1 ) < 0 )
goto out;
-
+
/* Make a palette */
if ( H5IMmake_palette( fid, PAL_NAME, pal_dims, pal ) < 0 )
goto out;
-
+
/* Attach a palette to the image dataset */
if ( H5IMlink_palette( fid, IMAGE1_NAME, PAL_NAME ) < 0 )
goto out;
-
+
/* Read image */
if ( H5IMget_image_info( fid, IMAGE1_NAME, &width, &height, &planes, interlace, &npals ) < 0 )
goto out;
-
+
if ( H5IMread_image( fid, IMAGE1_NAME, buf1_out ) < 0 )
goto out;
-
- for (i = 0; i < height*width*planes; i++)
+
+ for (i = 0; i < height*width*planes; i++)
{
- if ( buf1[i] != buf1_out[i] )
+ if ( buf1[i] != buf1_out[i] )
goto out;
-
+
}
-
-
+
+
PASSED();
-
+
/*-------------------------------------------------------------------------
* True color image test
*-------------------------------------------------------------------------
*/
-
+
TESTING("true color image");
-
+
/* Write image */
if ( H5IMmake_image_24bit( fid, IMAGE2_NAME, width, height, "INTERLACE_PIXEL", buf2 ) )
goto out;
-
+
/* Read image */
if ( H5IMget_image_info( fid, IMAGE2_NAME, &width, &height, &planes, interlace, &npals ) < 0 )
goto out;
-
+
if ( H5IMread_image( fid, IMAGE2_NAME, buf2_out ) < 0 )
goto out;
-
- for (i = 0; i < height*width*planes; i++)
+
+ for (i = 0; i < height*width*planes; i++)
{
- if ( buf2[i] != buf2_out[i] )
+ if ( buf2[i] != buf2_out[i] )
goto out;
}
-
-
+
+
PASSED();
-
+
/*-------------------------------------------------------------------------
* H5IMget_npalettes test
*-------------------------------------------------------------------------
*/
-
+
TESTING("pallete functions");
-
+
if ( H5IMget_npalettes( fid, IMAGE1_NAME, &npals ) < 0 )
goto out;
-
+
/*-------------------------------------------------------------------------
* H5IMget_palette_info test
*-------------------------------------------------------------------------
*/
-
+
if ( H5IMget_palette_info( fid, IMAGE1_NAME, 0, pal_dims_out ) < 0 )
goto out;
-
- for (i = 0; i < 2; i++)
+
+ for (i = 0; i < 2; i++)
{
- if ( pal_dims[i] != pal_dims_out[i] )
+ if ( pal_dims[i] != pal_dims_out[i] )
goto out;
}
-
+
/*-------------------------------------------------------------------------
* H5IMget_palette test
*-------------------------------------------------------------------------
*/
-
+
if ( H5IMget_palette( fid, IMAGE1_NAME, 0, pal_out ) < 0 )
goto out;
-
- for (i = 0; i < PAL_ENTRIES * 3; i++)
+
+ for (i = 0; i < PAL_ENTRIES * 3; i++)
{
- if ( pal[i] != pal_out[i] )
+ if ( pal[i] != pal_out[i] )
goto out;
}
-
+
/*-------------------------------------------------------------------------
* H5IMis_image test
*-------------------------------------------------------------------------
*/
-
+
if ( H5IMis_image( fid, IMAGE1_NAME ) < 0 )
goto out;
-
+
if ( H5IMis_image( fid, IMAGE2_NAME ) < 0 )
goto out;
-
+
/*-------------------------------------------------------------------------
* H5IMis_palette test
*-------------------------------------------------------------------------
*/
-
+
if ( H5IMis_palette( fid, PAL_NAME ) < 0 )
goto out;
-
+
/*-------------------------------------------------------------------------
* end tests
*-------------------------------------------------------------------------
*/
-
+
/* Close the file. */
- if(H5Fclose( fid ) < 0)
+ if(H5Fclose( fid ) < 0)
goto out;
-
-
+
+
PASSED();
return 0;
@@ -314,60 +314,60 @@ static int test_data(void)
unsigned char pal[256*3]; /* buffer to hold an HDF5 palette */
rgb_t rgb[256]; /* buffer to hold a .pal file palette */
int i, n;
-
+
/* create a file using default properties */
if ((fid=H5Fcreate(FILE2,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
goto out;
-
+
printf("Testing read ascii image data and generate images\n");
-
+
/*-------------------------------------------------------------------------
* read 8bit image data
*-------------------------------------------------------------------------
*/
-
+
TESTING2("make indexed image");
-
+
/* read first data file */
if (read_data(DATA_FILE1,&width,&height)<0)
goto out;
-
+
/* make an image */
if (H5IMmake_image_8bit(fid,IMAGE1_NAME,width,height,image_data)<0)
goto out;
-
+
PASSED();
-
-
+
+
TESTING2("attaching palettes");
-
+
/*-------------------------------------------------------------------------
* palette #1. rainbow palette. data is contained in "pal_rgb.h"
*-------------------------------------------------------------------------
*/
-
+
/* initialize the palette data */
pal_dims[0] = 256;
pal_dims[1] = 3;
-
+
/* make a palette */
if (H5IMmake_palette(fid,PAL1_NAME,pal_dims,pal_rgb)<0)
goto out;
-
+
/* attach a palette to the image dataset */
if (H5IMlink_palette(fid,IMAGE1_NAME,PAL1_NAME)<0)
goto out;
-
+
/*-------------------------------------------------------------------------
* palette #2. sepia palette.
* read a PAL file and attach the palette to the HDF5 file
*-------------------------------------------------------------------------
*/
-
+
/* read a PAL file */
if (read_palette(PAL2_FILE, rgb, sizeof(rgb))<0)
goto out;
-
+
/* transfer to the HDF5 buffer */
for ( i=0, n=0; i<256*3; i+=3, n++)
{
@@ -375,25 +375,25 @@ static int test_data(void)
pal[i+1]=rgb[n].g;
pal[i+2]=rgb[n].b;
}
-
+
/* make a palette */
if (H5IMmake_palette(fid,PAL2_NAME,pal_dims,pal)<0)
goto out;
-
+
/* attach the palette to the image dataset */
if (H5IMlink_palette(fid,IMAGE1_NAME,PAL2_NAME)<0)
goto out;
-
+
/*-------------------------------------------------------------------------
* palette #3. earth palette.
* read a PAL file and attach the palette to the HDF5 file
*-------------------------------------------------------------------------
*/
-
+
/* read a PAL file */
if (read_palette(PAL3_FILE, rgb, sizeof(rgb))<0)
goto out;
-
+
/* transfer to the HDF5 buffer */
for ( i=0, n=0; i<256*3; i+=3, n++)
{
@@ -401,18 +401,18 @@ static int test_data(void)
pal[i+1]=rgb[n].g;
pal[i+2]=rgb[n].b;
}
-
+
/* make a palette */
if (H5IMmake_palette(fid,PAL3_NAME,pal_dims,pal)<0)
goto out;
-
+
/* attach the palette to the image dataset */
if (H5IMlink_palette(fid,IMAGE1_NAME,PAL3_NAME)<0)
goto out;
-
+
PASSED();
-
-
+
+
/*-------------------------------------------------------------------------
* palette #4. blue-red
* make a palette whith blue to red colors
@@ -424,60 +424,60 @@ static int test_data(void)
pal[i+1]=0;
pal[i+2]=255-n;
}
-
+
/* make a palette */
if (H5IMmake_palette(fid,PAL4_NAME,pal_dims,pal)<0)
goto out;
-
+
/* attach the palette to the image dataset */
if (H5IMlink_palette(fid,IMAGE1_NAME,PAL4_NAME)<0)
goto out;
-
-
+
+
/*-------------------------------------------------------------------------
* true color image example with pixel interlace
*-------------------------------------------------------------------------
*/
-
+
TESTING2("make true color image with pixel interlace");
-
+
/* read second data file */
if ((read_data(DATA_FILE2,&width,&height))<0)
goto out;
-
+
/* make image */
if ((H5IMmake_image_24bit(fid,IMAGE2_NAME,width,height,"INTERLACE_PIXEL",image_data))<0)
goto out;
-
+
PASSED();
-
+
/*-------------------------------------------------------------------------
* True color image example with plane interlace
*-------------------------------------------------------------------------
*/
-
+
TESTING2("make true color image with plane interlace");
-
+
/* read third data file */
if ((read_data(DATA_FILE3,&width,&height))<0)
goto out;
-
+
/* make image */
if ((H5IMmake_image_24bit(fid,IMAGE3_NAME,width,height,"INTERLACE_PLANE",image_data))<0)
goto out;
-
+
PASSED();
-
-
+
+
/*-------------------------------------------------------------------------
* close
*-------------------------------------------------------------------------
*/
if (H5Fclose(fid)<0)
goto out;
-
+
return 0;
-
+
/* error zone, gracefully close */
out:
H5E_BEGIN_TRY {
@@ -512,13 +512,13 @@ static int test_generate(void)
char *srcdir = getenv("srcdir"); /* the source directory */
char data_file[512]=""; /* buffer to hold name of existing data file */
int i;
-
+
/* create a file using default properties */
if ((fid=H5Fcreate(FILE3,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
goto out;
-
+
printf("Testing read and process data and make indexed images\n");
-
+
/*-------------------------------------------------------------------------
* compose the name of the file to open, using the srcdir, if appropriate
*-------------------------------------------------------------------------
@@ -529,12 +529,12 @@ static int test_generate(void)
strcat(data_file, "/");
}
strcat(data_file,DATA_FILE4);
-
+
/*-------------------------------------------------------------------------
* read data; the file data format is described below
*-------------------------------------------------------------------------
*/
-
+
f = fopen( data_file, "r" ) ;
if ( f == NULL )
{
@@ -581,44 +581,44 @@ static int test_generate(void)
fscanf( f, "%d %d %d", &imax, &jmax, &kmax );
fscanf( f, "%f %f %f", &valex, &xmin, &xmax );
-
+
data = (float*) malloc ( imax * jmax * kmax * sizeof( float ));
image_data = (unsigned char*) malloc ( imax * jmax * kmax * sizeof( unsigned char ));
-
+
for ( i = 0; i < imax * jmax * kmax; i++ )
{
fscanf( f, "%f ", &value );
data[i] = value;
}
fclose( f );
-
+
/*-------------------------------------------------------------------------
* transform the data from floating point to unsigned char
* we are processing all the data here
*-------------------------------------------------------------------------
*/
-
+
TESTING2("make indexed image from all the data");
-
+
for ( i = 0; i < imax * jmax * kmax; i++ )
{
image_data[i] = (unsigned char)(( 255 * (data[i] - xmin ) ) / (xmax - xmin ));
}
-
+
/* Make the image */
if ((H5IMmake_image_8bit(fid,"All data",(hsize_t)imax,(hsize_t)jmax,image_data))<0)
goto out;
-
+
PASSED();
-
+
/*-------------------------------------------------------------------------
* transform the data from floating point to unsigned char
* here we just process the land data
*-------------------------------------------------------------------------
*/
-
+
TESTING2("make indexed image from land data");
-
+
for ( i = 0; i < imax * jmax * kmax; i++ )
{
if ( data[i] < 0 )
@@ -626,21 +626,21 @@ static int test_generate(void)
else
image_data[i] = (unsigned char)(( 255 * (data[i] ) ) / xmax );
}
-
+
/* make the image */
if ((H5IMmake_image_8bit(fid,"Land data",(hsize_t)imax,(hsize_t)jmax,image_data))<0)
goto out;
-
+
PASSED();
-
+
/*-------------------------------------------------------------------------
* transform the data from floating point to unsigned char
* here we just process the sea data
*-------------------------------------------------------------------------
*/
-
+
TESTING2("make indexed image from sea data");
-
+
for ( i = 0; i < imax * jmax * kmax; i++ )
{
if ( data[i] > 0 )
@@ -648,24 +648,24 @@ static int test_generate(void)
else
image_data[i] = (unsigned char)(( 255 * (data[i] - xmin ) ) / xmin );
}
-
+
/* make the image */
if ((H5IMmake_image_8bit(fid,"Sea data",(hsize_t)imax,(hsize_t)jmax,image_data))<0)
goto out;
-
+
PASSED();
-
+
/*-------------------------------------------------------------------------
* make a palette and attach it to the datasets
*-------------------------------------------------------------------------
*/
-
+
TESTING2("attaching palettes");
-
+
/* make a palette */
if ((H5IMmake_palette(fid,PAL1_NAME,pal_dims,pal_rgb))<0)
goto out;
-
+
/* attach the palette to the image datasets */
if ((H5IMlink_palette(fid,"All data",PAL1_NAME))<0)
goto out;
@@ -673,19 +673,19 @@ static int test_generate(void)
goto out;
if ((H5IMlink_palette(fid,"Sea data",PAL1_NAME))<0)
goto out;
-
+
PASSED();
-
-
+
+
/*-------------------------------------------------------------------------
* close
*-------------------------------------------------------------------------
*/
if (H5Fclose(fid)<0)
goto out;
-
+
return 0;
-
+
/* error zone, gracefully close */
out:
H5E_BEGIN_TRY {
@@ -724,7 +724,7 @@ static int read_data( const char* fname, /*IN*/
int w, h;
char *srcdir = getenv("srcdir"); /* the source directory */
char data_file[512]=""; /* buffer to hold name of existing data file */
-
+
/*-------------------------------------------------------------------------
* compose the name of the file to open, using "srcdir", if appropriate
*-------------------------------------------------------------------------
@@ -736,46 +736,46 @@ static int read_data( const char* fname, /*IN*/
strcat(data_file, "/");
}
strcat(data_file,fname);
-
+
/*-------------------------------------------------------------------------
* read
*-------------------------------------------------------------------------
*/
-
+
f = fopen(data_file, "r");
if ( f == NULL )
{
printf( "Could not open file %s. Try set $srcdir \n", data_file );
return -1;
}
-
+
fscanf( f, "%s", str );
fscanf( f, "%d", &color_planes );
fscanf( f, "%s", str );
fscanf( f, "%d", &h);
fscanf( f, "%s", str );
fscanf( f, "%d", &w);
-
+
*width = (hsize_t)w;
*height = (hsize_t)h;
-
+
if ( image_data )
{
free( image_data );
image_data=NULL;
}
-
+
image_data = (unsigned char*) malloc (w * h * color_planes * sizeof( unsigned char ));
-
+
for (i = 0; i < h * w * color_planes ; i++)
{
fscanf( f, "%d",&n );
image_data[i] = (unsigned char)n;
}
fclose(f);
-
+
return 1;
-
+
}
diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c
index 7b594ca..7a612a8 100644
--- a/hl/test/test_packet.c
+++ b/hl/test/test_packet.c
@@ -820,7 +820,7 @@ test_compress(void)
err = H5PTclose(table);
if( err < 0) TEST_ERROR;
- /* Open the packet table as a regular dataset and make sure that the
+ /* Open the packet table as a regular dataset and make sure that the
* compression filter is set.
*/
dset_id = H5Dopen2(fid1, "Compressed Test Dataset", H5P_DEFAULT);
@@ -850,7 +850,7 @@ test_compress(void)
err = H5PTclose(table);
if( err < 0) TEST_ERROR;
- /* Open the packet table as a regular dataset and make sure that the
+ /* Open the packet table as a regular dataset and make sure that the
* compression filter is not set.
*/
dset_id = H5Dopen2(fid1, "Uncompressed Dataset", H5P_DEFAULT);
@@ -887,7 +887,7 @@ error:
H5Tclose(part_t);
H5PTclose(table);
H5Fclose(fid1);
- } H5E_END_TRY
+ } H5E_END_TRY
H5_FAILED();
return -1;
}
diff --git a/hl/test/test_table.c b/hl/test/test_table.c
index 16172c4..1b36b15 100644
--- a/hl/test/test_table.c
+++ b/hl/test/test_table.c
@@ -591,7 +591,7 @@ int test_table(hid_t fid, int write)
wbufd[i].pressure = wbuf[i].pressure;
wbufd[i].temperature = wbuf[i].temperature;
strcpy(wbufd[i].name, wbuf[i].name );
-
+
}
@@ -935,8 +935,8 @@ int test_table(hid_t fid, int write)
goto out;
{
-
-
+
+
/* compare the read values with the initial values */
for( i = 0; i < NRECORDS; i++ )
{
@@ -1098,7 +1098,7 @@ int test_table(hid_t fid, int write)
}
}
-
+
PASSED();
diff --git a/hl/tools/gif2h5/gif2hdf.c b/hl/tools/gif2h5/gif2hdf.c
index 24aaf31..c7e4ab6 100644
--- a/hl/tools/gif2h5/gif2hdf.c
+++ b/hl/tools/gif2h5/gif2hdf.c
@@ -53,7 +53,7 @@ main(int argv , char *argc[])
{
print_version("gif2h5");
exit(EXIT_SUCCESS);
-
+
}
if (argv < 3) {
@@ -120,7 +120,7 @@ main(int argv , char *argc[])
if (gifImageDesc.Image != NULL)
free(gifImageDesc.Image);
-
+
if (GifMemoryStruct.GifImageDesc[i] != NULL)
{
free(GifMemoryStruct.GifImageDesc[i]);
diff --git a/hl/tools/gif2h5/h52gifgentst.c b/hl/tools/gif2h5/h52gifgentst.c
index e0a50a1..eb83335 100644
--- a/hl/tools/gif2h5/h52gifgentst.c
+++ b/hl/tools/gif2h5/h52gifgentst.c
@@ -45,7 +45,7 @@
*-------------------------------------------------------------------------
*/
-int main(void)
+int main(void)
{
hid_t fid;
int i, j, n, space;
@@ -55,7 +55,7 @@ int main(void)
hsize_t width = WIDTH;
hsize_t height = HEIGHT;
-
+
/* create a file */
if ((fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT))<0)
return 1;
@@ -70,7 +70,7 @@ int main(void)
n++;
j=0;
}
-
+
}
/* make the image */
@@ -78,7 +78,7 @@ int main(void)
return 1;
/*-------------------------------------------------------------------------
- * define a palette, blue to red tones
+ * define a palette, blue to red tones
*-------------------------------------------------------------------------
*/
for ( i=0, n=0; i<PAL_ENTRIES*3; i+=3, n++)
@@ -87,18 +87,18 @@ int main(void)
pal[i+1]=0; /* green */
pal[i+2]=255-n; /* blue */
}
-
+
/* make a palette */
if (H5IMmake_palette( fid, PAL_NAME, pal_dims, pal )<0)
return 1;
-
+
/* attach the palette to the image */
if (H5IMlink_palette( fid, IMAGE1_NAME, PAL_NAME )<0)
return 1;
-
+
if(H5Fclose(fid)<0)
return 1;
-
+
return 0;
}
diff --git a/hl/tools/gif2h5/hdf2gif.c b/hl/tools/gif2h5/hdf2gif.c
index 7def4f0..9c252e1 100644
--- a/hl/tools/gif2h5/hdf2gif.c
+++ b/hl/tools/gif2h5/hdf2gif.c
@@ -38,7 +38,7 @@ usage(void)
fprintf(stdout, " h52gif -V \n");
fprintf(stdout, " Print HDF5 library version and exit\n");
printf("h52gif expects *at least* one h5_image.\n");
-
+
}
FILE *fpGif = NULL;
@@ -69,16 +69,16 @@ int main(int argc , char **argv)
int bool_is_image = 0; /* 0 = false , 1 = true */
char *image_name = NULL;
int idx;
-
+
if ( argv[1] && (strcmp("-V",argv[1])==0) )
{
print_version("gif2h5");
exit(EXIT_SUCCESS);
-
+
}
- if (argc < 4)
+ if (argc < 4)
{
/* they didn't supply at least one image -- bail */
usage();
@@ -89,14 +89,14 @@ int main(int argc , char **argv)
GIFName = argv[2];
/* get the options */
- while (arg_index++ < argc - 1)
+ while (arg_index++ < argc - 1)
{
if (!strcmp(argv[arg_index] , "-i")) {
bool_is_image = 1;
continue;
}
- if (bool_is_image)
+ if (bool_is_image)
{
/* allocate space to store the image name */
size_t len = strlen(argv[arg_index]);
@@ -118,7 +118,7 @@ int main(int argc , char **argv)
b = (BYTE *) &idx;
EndianOrder = (b[0] ? 1:0);
- if (!(fpGif = fopen(GIFName , "wb")))
+ if (!(fpGif = fopen(GIFName , "wb")))
{
printf("Error opening gif file for output. Aborting.\n");
goto out;
@@ -132,19 +132,19 @@ int main(int argc , char **argv)
hssize_t npals;
hsize_t pal_dims[2];
unsigned char *pal;
-
- if ((fid = H5Fopen(HDFName , H5F_ACC_RDONLY , H5P_DEFAULT)) < 0)
+
+ if ((fid = H5Fopen(HDFName , H5F_ACC_RDONLY , H5P_DEFAULT)) < 0)
{
fprintf(stderr , "Unable to open HDF file for input. Aborting.\n");
goto out;
}
-
+
/* read image */
if ( H5IMget_image_info( fid, image_name, &width, &height, &planes, interlace, &npals ) < 0 )
goto out;
Image = (BYTE*) malloc( (size_t) width * (size_t) height );
-
+
if ( H5IMread_image( fid, image_name, Image ) < 0 )
goto out;
@@ -154,7 +154,7 @@ int main(int argc , char **argv)
goto out;
pal = (BYTE*) malloc( (size_t) pal_dims[0] * (size_t) pal_dims[1] );
-
+
if ( H5IMget_palette( fid, image_name, 0, pal ) < 0 )
goto out;
@@ -169,9 +169,9 @@ int main(int argc , char **argv)
free(pal);
}
-
+
H5Fclose(fid);
-
+
RWidth = (int)width;
RHeight = (int)height;
@@ -185,17 +185,17 @@ int main(int argc , char **argv)
* palette
* 2. Check for palettes in any of the other images.
*/
- if (!npals)
+ if (!npals)
{
numcols = 256;
- for (i = 0 ; i < numcols ; i++)
+ for (i = 0 ; i < numcols ; i++)
{
Red[i] = 255 - i;
Green[i] = 255 - i;
Blue[i] = 255 - i;
}
- }
- else
+ }
+ else
{
for (i = 0 ; i < numcols ; i++)
{
@@ -205,7 +205,7 @@ int main(int argc , char **argv)
}
}
- for (i = 0; i < numcols; i++)
+ for (i = 0; i < numcols; i++)
{
pc2nc[i] = r1[i] = g1[i] = b1[i] = 0;
}
@@ -213,16 +213,16 @@ int main(int argc , char **argv)
/* compute number of unique colors */
nc = 0;
- for (i = 0; i < numcols; i++)
+ for (i = 0; i < numcols; i++)
{
/* see if color #i is already used */
- for (j = 0; j < i; j++)
+ for (j = 0; j < i; j++)
{
if (Red[i] == Red[j] && Green[i] == Green[j] && Blue[i] == Blue[j])
break;
}
-
- if (j==i)
+
+ if (j==i)
{
/* wasn't found */
pc2nc[i] = nc;
@@ -230,15 +230,15 @@ int main(int argc , char **argv)
g1[nc] = Green[i];
b1[nc] = Blue[i];
nc++;
- }
- else
+ }
+ else
{
pc2nc[i] = pc2nc[j];
}
}
/* figure out 'BitsPerPixel' */
- for (i = 1; i < 8; i++)
+ for (i = 1; i < 8; i++)
{
if ((1<<i) >= nc)
break;
@@ -252,23 +252,23 @@ int main(int argc , char **argv)
else
InitCodeSize = BitsPerPixel;
- if (!fpGif)
+ if (!fpGif)
{
fprintf(stderr, "WriteGIF: file not open for writing\n" );
goto out;
}
-
+
fwrite("GIF87a", sizeof( char ), 6, fpGif); /* the GIF magic number */
-
+
putword(RWidth, fpGif); /* screen descriptor */
putword(RHeight, fpGif);
-
+
i = 0x00; /* No, there is no color map */
i |= (8-1)<<4; /* OR in the color resolution (hardwired 8) */
i |= (BitsPerPixel - 1); /* OR in the # of bits per pixel */
fputc(i,fpGif);
-
+
fputc(Background,fpGif); /* background color */
fputc(0, fpGif); /* future expansion byte */
@@ -286,7 +286,7 @@ int main(int argc , char **argv)
/* since we always have a local color palette ... */
fputc((0x80 | (BitsPerPixel - 1)) , fpGif);
- for (i = 0; i < ColorMapSize; i++)
+ for (i = 0; i < ColorMapSize; i++)
{
/* write out Global colormap */
fputc(r1[i], fpGif);
@@ -301,7 +301,7 @@ int main(int argc , char **argv)
free(Image);
}
- if (fputc(';',fpGif) == EOF)
+ if (fputc(';',fpGif) == EOF)
{
/* Write GIF file terminator */
fprintf(stderr , "Error!");
diff --git a/hl/tools/gif2h5/writehdf.c b/hl/tools/gif2h5/writehdf.c
index 7c2b063..a150b3c 100644
--- a/hl/tools/gif2h5/writehdf.c
+++ b/hl/tools/gif2h5/writehdf.c
@@ -83,7 +83,7 @@ WriteHDF(GIFTOMEM GifMemoryStruct, char *HDFName , char *GIFFileName)
/* size of the palette is tablesize (rows) X 3 (columns) */
dims[0] = gifHead.TableSize;
dims[1] = 3;
-
+
/* make a palette */
if (H5IMmake_palette(file_id,PAL_NAME,dims,(unsigned char *)gifHead.HDFPalette)<0)
return -1;
@@ -102,11 +102,11 @@ WriteHDF(GIFTOMEM GifMemoryStruct, char *HDFName , char *GIFFileName)
/* create the image name */
sprintf(ImageName , "Image%d" , i);
-
+
/* write image */
if (H5IMmake_image_8bit(file_id,ImageName,dims[1],dims[0],(gifImageDesc->Image))<0)
return -1;
-
+
/* attach the palette to the image dataset */
if (has_pal)
{