summaryrefslogtreecommitdiffstats
path: root/tools/h5repack/h5repack_parse.c
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 /tools/h5repack/h5repack_parse.c
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 'tools/h5repack/h5repack_parse.c')
-rw-r--r--tools/h5repack/h5repack_parse.c122
1 files changed, 61 insertions, 61 deletions
diff --git a/tools/h5repack/h5repack_parse.c b/tools/h5repack/h5repack_parse.c
index 2475068..f7188bf 100644
--- a/tools/h5repack/h5repack_parse.c
+++ b/tools/h5repack/h5repack_parse.c
@@ -67,12 +67,12 @@ obj_list_t* parse_filter(const char *str,
char smask[3];
obj_list_t* obj_list=NULL;
unsigned pixels_per_block;
-
-
+
+
/* initialize compression info */
memset(filt,0,sizeof(filter_info_t));
*is_glb = 0;
-
+
/* check for the end of object list and number of objects */
for ( i = 0, n = 0; i < len; i++)
{
@@ -86,14 +86,14 @@ obj_list_t* parse_filter(const char *str,
n++;
}
}
-
+
if (end_obj==-1) /* missing : */
- {
+ {
/* apply to all objects */
options->all_filter=1;
*is_glb = 1;
}
-
+
n++;
obj_list = malloc(n*sizeof(obj_list_t));
if (obj_list==NULL)
@@ -102,7 +102,7 @@ obj_list_t* parse_filter(const char *str,
return NULL;
}
*n_objs=n;
-
+
/* get object list */
for ( j = 0, k = 0, n = 0; j < end_obj; j++, k++)
{
@@ -124,8 +124,8 @@ obj_list_t* parse_filter(const char *str,
error_msg(progname, "input Error: Invalid compression type in <%s>\n",str);
exit(1);
}
-
-
+
+
/* get filter additional parameters */
m=0;
for ( i=end_obj+1, k=0, j=0; i<len; i++,k++)
@@ -135,9 +135,9 @@ obj_list_t* parse_filter(const char *str,
if ( c=='=' || i==len-1)
{
if ( c=='=') /*one more parameter */
- {
+ {
scomp[k]='\0'; /*cut space */
-
+
/*-------------------------------------------------------------------------
* H5Z_FILTER_SZIP
* szip has the format SZIP=<pixels per block,coding>
@@ -182,14 +182,14 @@ obj_list_t* parse_filter(const char *str,
error_msg(progname, "szip mask must be 'NN' or 'EC' \n");
exit(1);
}
-
-
+
+
}
}
-
+
} /* u */
} /*if */
-
+
/*-------------------------------------------------------------------------
* H5Z_FILTER_SCALEOFFSET
* scaleoffset has the format SOFF=<scale_factor,scale_type>
@@ -204,7 +204,7 @@ obj_list_t* parse_filter(const char *str,
* SOFF=3,DF
*-------------------------------------------------------------------------
*/
-
+
else if (strcmp(scomp,"SOFF")==0)
{
l=-1; /* mask index check */
@@ -242,19 +242,19 @@ obj_list_t* parse_filter(const char *str,
error_msg(progname, "scale type must be 'IN' or 'DS' \n");
exit(1);
}
-
+
}
}
-
+
} /* u */
} /*if */
-
-
+
+
/*-------------------------------------------------------------------------
* all other filters
*-------------------------------------------------------------------------
*/
-
+
else
{
/* here we could have 1 or 2 digits */
@@ -268,16 +268,16 @@ obj_list_t* parse_filter(const char *str,
}
stype[m]=c;
} /* u */
-
+
stype[m]='\0';
} /*if */
-
-
-
+
+
+
filt->cd_values[j++]=atoi(stype);
i+=m; /* jump */
}
- else if (i==len-1)
+ else if (i==len-1)
{ /*no more parameters */
scomp[k+1]='\0';
no_param=1;
@@ -287,7 +287,7 @@ obj_list_t* parse_filter(const char *str,
* translate from string to filter symbol
*-------------------------------------------------------------------------
*/
-
+
/*-------------------------------------------------------------------------
* H5Z_FILTER_NONE
*-------------------------------------------------------------------------
@@ -297,7 +297,7 @@ obj_list_t* parse_filter(const char *str,
filt->filtn=H5Z_FILTER_NONE;
filt->cd_nelmts = 0;
}
-
+
/*-------------------------------------------------------------------------
* H5Z_FILTER_DEFLATE
*-------------------------------------------------------------------------
@@ -306,14 +306,14 @@ obj_list_t* parse_filter(const char *str,
{
filt->filtn=H5Z_FILTER_DEFLATE;
filt->cd_nelmts = 1;
- if (no_param)
+ if (no_param)
{ /*no more parameters, GZIP must have parameter */
if (obj_list) free(obj_list);
error_msg(progname, "missing compression parameter in <%s>\n",str);
exit(1);
}
}
-
+
/*-------------------------------------------------------------------------
* H5Z_FILTER_SZIP
*-------------------------------------------------------------------------
@@ -322,14 +322,14 @@ obj_list_t* parse_filter(const char *str,
{
filt->filtn=H5Z_FILTER_SZIP;
filt->cd_nelmts = 2;
- if (no_param)
+ if (no_param)
{ /*no more parameters, SZIP must have parameter */
if (obj_list) free(obj_list);
error_msg(progname, "missing compression parameter in <%s>\n",str);
exit(1);
}
}
-
+
/*-------------------------------------------------------------------------
* H5Z_FILTER_SHUFFLE
*-------------------------------------------------------------------------
@@ -383,7 +383,7 @@ obj_list_t* parse_filter(const char *str,
{
filt->filtn=H5Z_FILTER_SCALEOFFSET;
filt->cd_nelmts = 2;
- if (no_param)
+ if (no_param)
{ /*no more parameters, SOFF must have parameter */
if (obj_list) free(obj_list);
error_msg(progname, "missing compression parameter in <%s>\n",str);
@@ -397,12 +397,12 @@ obj_list_t* parse_filter(const char *str,
}
}
} /*i*/
-
+
/*-------------------------------------------------------------------------
* check valid parameters
*-------------------------------------------------------------------------
*/
-
+
switch (filt->filtn)
{
@@ -410,7 +410,7 @@ obj_list_t* parse_filter(const char *str,
* H5Z_FILTER_DEFLATE
*-------------------------------------------------------------------------
*/
-
+
case H5Z_FILTER_DEFLATE:
if (filt->cd_values[0]<0 || filt->cd_values[0]>9 )
{
@@ -419,27 +419,27 @@ obj_list_t* parse_filter(const char *str,
exit(1);
}
break;
-
+
/*-------------------------------------------------------------------------
* H5Z_FILTER_SZIP
*-------------------------------------------------------------------------
*/
-
+
case H5Z_FILTER_SZIP:
pixels_per_block=filt->cd_values[0];
- if ((pixels_per_block%2)==1)
+ if ((pixels_per_block%2)==1)
{
if (obj_list) free(obj_list);
error_msg(progname, "pixels_per_block is not even in <%s>\n",str);
exit(1);
}
- if (pixels_per_block>H5_SZIP_MAX_PIXELS_PER_BLOCK)
+ if (pixels_per_block>H5_SZIP_MAX_PIXELS_PER_BLOCK)
{
if (obj_list) free(obj_list);
error_msg(progname, "pixels_per_block is too large in <%s>\n",str);
exit(1);
}
- if ( (strcmp(smask,"NN")!=0) && (strcmp(smask,"EC")!=0) )
+ if ( (strcmp(smask,"NN")!=0) && (strcmp(smask,"EC")!=0) )
{
if (obj_list) free(obj_list);
error_msg(progname, "szip mask must be 'NN' or 'EC' \n");
@@ -461,7 +461,7 @@ obj_list_t* parse_filter(const char *str,
}
break;
};
-
+
return obj_list;
}
@@ -501,12 +501,12 @@ obj_list_t* parse_layout(const char *str,
char sobj[MAX_NC_NAME];
char sdim[10];
char slayout[10];
-
-
+
+
memset(sdim, '\0', sizeof(sdim));
memset(sobj, '\0', sizeof(sobj));
memset(slayout, '\0', sizeof(slayout));
-
+
/* check for the end of object list and number of objects */
for ( i=0, n=0; i<len; i++)
{
@@ -520,11 +520,11 @@ obj_list_t* parse_layout(const char *str,
n++;
}
}
-
+
if (end_obj==-1) { /* missing : chunk all */
options->all_layout=1;
}
-
+
n++;
obj_list=malloc(n*sizeof(obj_list_t));
if (obj_list==NULL)
@@ -533,7 +533,7 @@ obj_list_t* parse_layout(const char *str,
return NULL;
}
*n_objs=n;
-
+
/* get object list */
for ( j=0, k=0, n=0; j<end_obj; j++,k++)
{
@@ -548,7 +548,7 @@ obj_list_t* parse_layout(const char *str,
k=-1;
}
}
-
+
/* nothing after : */
if (end_obj+1==(int)len)
{
@@ -556,7 +556,7 @@ obj_list_t* parse_layout(const char *str,
error_msg(progname, "in parse layout, no characters after : in <%s>\n",str);
exit(1);
}
-
+
/* get layout info */
for ( j=end_obj+1, n=0; n<=5; j++,n++)
{
@@ -580,30 +580,30 @@ obj_list_t* parse_layout(const char *str,
slayout[n]=c;
}
} /* j */
-
-
+
+
if ( pack->layout==H5D_CHUNKED )
{
-
+
/*-------------------------------------------------------------------------
* get chunk info
*-------------------------------------------------------------------------
*/
k=0;
-
+
if (j>(int)len)
{
if (obj_list) free(obj_list);
error_msg(progname, "in parse layout, <%s> Chunk dimensions missing\n",str);
exit(1);
}
-
+
for ( i=j, c_index=0; i<len; i++)
{
c = str[i];
sdim[k]=c;
k++; /*increment sdim index */
-
+
if (!isdigit(c) && c!='x'
&& c!='N' && c!='O' && c!='N' && c!='E'
){
@@ -612,7 +612,7 @@ obj_list_t* parse_layout(const char *str,
sdim,str);
exit(1);
}
-
+
if ( c=='x' || i==len-1)
{
if ( c=='x') {
@@ -648,11 +648,11 @@ obj_list_t* parse_layout(const char *str,
} /*if */
} /*if c=='x' || i==len-1 */
} /*i*/
-
-
+
+
} /*H5D_CHUNKED*/
-
-
+
+
return obj_list;
}