diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2010-01-30 04:33:04 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2010-01-30 04:33:04 (GMT) |
commit | fa1f33701da4489a4626a057844fa799878feddf (patch) | |
tree | bfb0efbe3f126b46fbf0bf9bd8516bf1076ab8a4 /tools/h5repack | |
parent | e3c80277440ec153a180ef89f7867bdedb51b87a (diff) | |
download | hdf5-fa1f33701da4489a4626a057844fa799878feddf.zip hdf5-fa1f33701da4489a4626a057844fa799878feddf.tar.gz hdf5-fa1f33701da4489a4626a057844fa799878feddf.tar.bz2 |
[svn-r18198] Description:
Trim trailing whitespace from source code files, with following command:
find . \( -name "*.[ch]" -or -name "*.cpp" -or -name "*.f90" \) -print |xargs -n 1 sed -i "" 's/[[:blank:]]*$//'
Tested on:
None - eyeballed only
Diffstat (limited to 'tools/h5repack')
-rw-r--r-- | tools/h5repack/h5repack.c | 20 | ||||
-rw-r--r-- | tools/h5repack/h5repack.h | 6 | ||||
-rw-r--r-- | tools/h5repack/h5repack_copy.c | 222 | ||||
-rw-r--r-- | tools/h5repack/h5repack_filters.c | 16 | ||||
-rw-r--r-- | tools/h5repack/h5repack_main.c | 28 | ||||
-rw-r--r-- | tools/h5repack/h5repack_parse.c | 2 | ||||
-rw-r--r-- | tools/h5repack/h5repack_refs.c | 46 | ||||
-rw-r--r-- | tools/h5repack/h5repack_verify.c | 4 | ||||
-rw-r--r-- | tools/h5repack/h5repacktst.c | 148 |
9 files changed, 246 insertions, 246 deletions
diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c index 6b10e2c..ab0ca66 100644 --- a/tools/h5repack/h5repack.c +++ b/tools/h5repack/h5repack.c @@ -268,7 +268,7 @@ static int check_options(pack_opt_t *options) if (options->verbose && have_request(options) /* only print if requested */) { printf("Objects to modify layout are...\n"); - if (options->all_layout==1) + if (options->all_layout==1) { switch (options->layout_g) { @@ -290,7 +290,7 @@ static int check_options(pack_opt_t *options) return -1; } printf(" Apply %s layout to all\n", slayout); - if (H5D_CHUNKED==options->layout_g) + if (H5D_CHUNKED==options->layout_g) { printf("with dimension ["); for ( j = 0; j < options->chunk_g.rank; j++) @@ -396,24 +396,24 @@ static int check_options(pack_opt_t *options) *------------------------------------------------------------------------- */ - if (options->grp_compact < 0) + if (options->grp_compact < 0) { error_msg(progname, "invalid maximum number of links to store as header messages\n"); return -1; } - if (options->grp_indexed < 0) + if (options->grp_indexed < 0) { error_msg(progname, "invalid minimum number of links to store in the indexed format\n"); return -1; } - if (options->grp_indexed > options->grp_compact) + if (options->grp_indexed > options->grp_compact) { error_msg(progname, "minimum indexed size is greater than the maximum compact size\n"); return -1; } - for (i=0; i<8; i++) + for (i=0; i<8; i++) { - if (options->msg_size[i]<0) + if (options->msg_size[i]<0) { error_msg(progname, "invalid shared message size\n"); return -1; @@ -513,14 +513,14 @@ static int check_objects(const char* fname, if(options->verbose) printf("Opening file <%s>. Searching for objects to modify...\n", fname); - for(i = 0; i < options->op_tbl->nelems; i++) + for(i = 0; i < options->op_tbl->nelems; i++) { char* name=options->op_tbl->objs[i].path; if(options->verbose) printf(" <%s>",name); /* the input object names are present in the file and are valid */ - if(h5trav_getindext(name, travt) < 0) + if(h5trav_getindext(name, travt) < 0) { error_msg(progname, "%s Could not find <%s> in file <%s>. Exiting...\n", (options->verbose?"\n":""),name,fname); @@ -530,7 +530,7 @@ static int check_objects(const char* fname, printf("...Found\n"); /* check for extra filter conditions */ - switch(options->op_tbl->objs[i].filter->filtn) + switch(options->op_tbl->objs[i].filter->filtn) { /* chunk size must be smaller than pixels per block */ case H5Z_FILTER_SZIP: diff --git a/tools/h5repack/h5repack.h b/tools/h5repack/h5repack.h index cb3d75a..653958f 100644 --- a/tools/h5repack/h5repack.h +++ b/tools/h5repack/h5repack.h @@ -102,11 +102,11 @@ typedef struct { H5D_layout_t layout_g; /*global layout information for the ALL case */ int verbose; /*verbose mode */ hsize_t min_comp; /*minimum size to compress, in bytes */ - int use_native; /*use a native type in write */ + int use_native; /*use a native type in write */ int latest; /*pack file with the latest file format */ int grp_compact; /* Set the maximum number of links to store as header messages in the group */ int grp_indexed; /* Set the minimum number of links to store in the indexed format */ - int msg_size[8]; /* Minimum size of shared messages: dataspace, + int msg_size[8]; /* Minimum size of shared messages: dataspace, datatype, fill value, filter pipleline, attribute */ const char *ublock_filename; /* user block file name */ hsize_t ublock_size; /* user block size */ @@ -159,7 +159,7 @@ int copy_objects (const char* fnamein, int do_copy_refobjs(hid_t fidin, hid_t fidout, trav_table_t *travt, - pack_opt_t *options); + pack_opt_t *options); /*------------------------------------------------------------------------- * filters and verify module diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index 0fb8fc8..d4b47fd 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -55,7 +55,7 @@ static hid_t copy_named_datatype(hid_t type_in, hid_t fidout, named_dt_t **named trav_table_t *travt, pack_opt_t *options); static int named_datatype_free(named_dt_t **named_dt_head_p, int ignore_err); static int copy_user_block(const char *infile, const char *outfile, hsize_t size); -#if defined (H5REPACK_DEBUG_USER_BLOCK) +#if defined (H5REPACK_DEBUG_USER_BLOCK) static void print_user_block(const char *filename, hid_t fid); #endif @@ -98,7 +98,7 @@ int copy_objects(const char* fnamein, * open input file *------------------------------------------------------------------------- */ - if((fidin = h5tools_fopen(fnamein, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) + if((fidin = h5tools_fopen(fnamein, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t)0)) < 0) { error_msg(progname, "<%s>: %s\n", fnamein, H5FOPENERROR ); goto out; @@ -108,61 +108,61 @@ int copy_objects(const char* fnamein, { hid_t fcpl_in; /* file creation property list ID for input file */ - if((fcpl_in = H5Fget_create_plist(fidin)) < 0) + if((fcpl_in = H5Fget_create_plist(fidin)) < 0) { error_msg(progname, "failed to retrieve file creation property list\n"); goto out; - } + } - if(H5Pget_userblock(fcpl_in, &ub_size) < 0) + if(H5Pget_userblock(fcpl_in, &ub_size) < 0) { error_msg(progname, "failed to retrieve userblock size\n"); goto out; - } + } - if(H5Pclose(fcpl_in) < 0) + if(H5Pclose(fcpl_in) < 0) { error_msg(progname, "failed to close property list\n"); goto out; - } - } + } + } /* Check if we need to create a non-default file creation property list */ - if(options->latest || ub_size > 0) + if(options->latest || ub_size > 0) { /* Create file creation property list */ - if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) { error_msg(progname, "fail to create a file creation property list\n"); goto out; - } + } if(ub_size > 0) { - if(H5Pset_userblock(fcpl, ub_size) < 0) + if(H5Pset_userblock(fcpl, ub_size) < 0) { error_msg(progname, "failed to set non-default userblock size\n"); goto out; - } + } } - if(options->latest) + if(options->latest) { unsigned i = 0, nindex = 0, mesg_type_flags[5], min_mesg_sizes[5]; /* Adjust group creation parameters for root group */ /* (So that it is created in "dense storage" form) */ - if(H5Pset_link_phase_change(fcpl, (unsigned)options->grp_compact, (unsigned)options->grp_indexed) < 0) + if(H5Pset_link_phase_change(fcpl, (unsigned)options->grp_compact, (unsigned)options->grp_indexed) < 0) { error_msg(progname, "fail to adjust group creation parameters for root group\n"); goto out; - } + } - for(i = 0; i < 5; i++) + for(i = 0; i < 5; i++) { - if(options->msg_size[i] > 0) + if(options->msg_size[i] > 0) { - switch(i) + switch(i) { case 0: mesg_type_flags[nindex] = H5O_SHMESG_SDSPACE_FLAG; @@ -192,16 +192,16 @@ int copy_objects(const char* fnamein, } /* end if */ } /* end for */ - if(nindex > 0) + if(nindex > 0) { - if(H5Pset_shared_mesg_nindexes(fcpl, nindex) < 0) + if(H5Pset_shared_mesg_nindexes(fcpl, nindex) < 0) { error_msg(progname, "fail to set the number of shared object header message indexes\n"); goto out; - } + } /* msg_size[0]=dataspace, 1=datatype, 2=file value, 3=filter pipleline, 4=attribute */ - for(i = 0; i < (nindex - 1); i++) + for(i = 0; i < (nindex - 1); i++) { if(H5Pset_shared_mesg_index(fcpl, i, mesg_type_flags[i], min_mesg_sizes[i]) < 0) { error_msg(progname, "fail to configure the specified shared object header message index\n"); @@ -211,13 +211,13 @@ int copy_objects(const char* fnamein, } /* if (nindex>0) */ /* Create file access property list */ - if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) { error_msg(progname, "Could not create file access property list\n"); goto out; } /* end if */ - if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) + if(H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) { error_msg(progname, "Could not set property for using latest version of the format\n"); goto out; @@ -228,7 +228,7 @@ int copy_objects(const char* fnamein, -#if defined (H5REPACK_DEBUG_USER_BLOCK) +#if defined (H5REPACK_DEBUG_USER_BLOCK) print_user_block(fnamein,fidin); #endif @@ -244,11 +244,11 @@ int copy_objects(const char* fnamein, if(fcpl != H5P_DEFAULT) { /* set user block size */ - if(H5Pset_userblock(fcpl, options->ublock_size) < 0) + if(H5Pset_userblock(fcpl, options->ublock_size) < 0) { error_msg(progname, "failed to set userblock size\n"); goto out; - } + } } @@ -256,18 +256,18 @@ int copy_objects(const char* fnamein, { /* create a file creation property list */ - if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) + if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) { error_msg(progname, "fail to create a file creation property list\n"); goto out; - } + } /* set user block size */ - if(H5Pset_userblock(fcpl, options->ublock_size) < 0) + if(H5Pset_userblock(fcpl, options->ublock_size) < 0) { error_msg(progname, "failed to set userblock size\n"); goto out; - } + } } @@ -300,11 +300,11 @@ int copy_objects(const char* fnamein, { /* create a file access property list */ - if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) + if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) { error_msg(progname, "Could not create file access property list\n"); goto out; - } + } if (H5Pset_alignment(fapl, options->threshold, options->alignment) < 0) { @@ -312,7 +312,7 @@ int copy_objects(const char* fnamein, goto out; } - } + } } @@ -327,11 +327,11 @@ int copy_objects(const char* fnamein, printf("Making file <%s>...\n",fnameout); - if((fidout = H5Fcreate(fnameout,H5F_ACC_TRUNC, fcpl, fapl)) < 0) + if((fidout = H5Fcreate(fnameout,H5F_ACC_TRUNC, fcpl, fapl)) < 0) { error_msg(progname, "<%s>: Could not create file\n", fnameout ); goto out; - } + } /*------------------------------------------------------------------------- @@ -339,7 +339,7 @@ int copy_objects(const char* fnamein, *------------------------------------------------------------------------- */ if ( options->ublock_size > 0 ) - { + { if ( copy_user_block( options->ublock_filename, fnameout, options->ublock_size) < 0 ) { error_msg(progname, "Could not copy user block. Exiting...\n"); @@ -364,7 +364,7 @@ int copy_objects(const char* fnamein, * do the copy *------------------------------------------------------------------------- */ - if(do_copy_objects(fidin, fidout, travt, options) < 0) + if(do_copy_objects(fidin, fidout, travt, options) < 0) { error_msg(progname, "<%s>: Could not copy data to: %s\n", fnamein, fnameout); goto out; @@ -375,11 +375,11 @@ int copy_objects(const char* fnamein, * and create hard links *------------------------------------------------------------------------- */ - if ( do_copy_refobjs(fidin, fidout, travt, options) < 0 ) + if ( do_copy_refobjs(fidin, fidout, travt, options) < 0 ) { printf("h5repack: <%s>: Could not copy data to: %s\n", fnamein, fnameout); goto out; - } + } /*------------------------------------------------------------------------- * close @@ -422,7 +422,7 @@ int copy_objects(const char* fnamein, */ out: - H5E_BEGIN_TRY + H5E_BEGIN_TRY { H5Pclose(fapl); H5Pclose(fcpl); @@ -446,7 +446,7 @@ out: * * Date: October, 23, 2003 * -* Modifications: +* Modifications: * * July 2004: Introduced the extra EC or NN option for SZIP * @@ -458,47 +458,47 @@ out: * October 2006: Read by hyperslabs for big datasets. * * A threshold of H5TOOLS_MALLOCSIZE (128 MB) is the limit upon which I/O hyperslab is done -* i.e., if the memory needed to read a dataset is greater than this limit, -* then hyperslab I/O is done instead of one operation I/O +* i.e., if the memory needed to read a dataset is greater than this limit, +* then hyperslab I/O is done instead of one operation I/O * For each dataset, the memory needed is calculated according to * * memory needed = number of elements * size of each element * -* if the memory needed is lower than H5TOOLS_MALLOCSIZE, then the following operations +* if the memory needed is lower than H5TOOLS_MALLOCSIZE, then the following operations * are done * * H5Dread( input_dataset1 ) * H5Dread( input_dataset2 ) * -* with all elements in the datasets selected. If the memory needed is greater than +* with all elements in the datasets selected. If the memory needed is greater than * H5TOOLS_MALLOCSIZE, then the following operations are done instead: * -* a strip mine is defined for each dimension k (a strip mine is defined as a +* a strip mine is defined for each dimension k (a strip mine is defined as a * hyperslab whose size is memory manageable) according to the formula * * (1) strip_mine_size[k ] = MIN(dimension[k ], H5TOOLS_BUFSIZE / size of memory type) * -* where H5TOOLS_BUFSIZE is a constant currently defined as 1MB. This formula assures -* that for small datasets (small relative to the H5TOOLS_BUFSIZE constant), the strip -* mine size k is simply defined as its dimension k, but for larger datasets the +* where H5TOOLS_BUFSIZE is a constant currently defined as 1MB. This formula assures +* that for small datasets (small relative to the H5TOOLS_BUFSIZE constant), the strip +* mine size k is simply defined as its dimension k, but for larger datasets the * hyperslab size is still memory manageable. -* a cycle is done until the number of elements in the dataset is reached. In each -* iteration, two parameters are defined for the function H5Sselect_hyperslab, +* a cycle is done until the number of elements in the dataset is reached. In each +* iteration, two parameters are defined for the function H5Sselect_hyperslab, * the start and size of each hyperslab, according to * * (2) hyperslab_size [k] = MIN(dimension[k] - hyperslab_offset[k], strip_mine_size [k]) * -* where hyperslab_offset [k] is initially set to zero, and later incremented in -* hyperslab_size[k] offsets. The reason for the operation +* where hyperslab_offset [k] is initially set to zero, and later incremented in +* hyperslab_size[k] offsets. The reason for the operation * * dimension[k] - hyperslab_offset[k] * -* in (2) is that, when using the strip mine size, it assures that the "remaining" part +* in (2) is that, when using the strip mine size, it assures that the "remaining" part * of the dataset that does not fill an entire strip mine is processed. * -* November 2006: Use H5Ocopy in the copy of objects. The logic for using -* H5Ocopy or not is if a change of filters or layout is requested by the user -* then use read/write else use H5Ocopy. +* November 2006: Use H5Ocopy in the copy of objects. The logic for using +* H5Ocopy or not is if a change of filters or layout is requested by the user +* then use read/write else use H5Ocopy. * * May, 1, 2008: Add a printing of the compression ratio of old size / new size * @@ -547,18 +547,18 @@ int do_copy_objects(hid_t fidin, *------------------------------------------------------------------------- */ - if (options->verbose) + if (options->verbose) { printf("-----------------------------------------\n"); printf(" Type Filter (Compression) Name\n"); printf("-----------------------------------------\n"); } - for ( i = 0; i < travt->nobjs; i++) + for ( i = 0; i < travt->nobjs; i++) { buf = NULL; - switch ( travt->objs[i].type ) + switch ( travt->objs[i].type ) { case H5TRAV_TYPE_UNKNOWN: @@ -600,7 +600,7 @@ int do_copy_objects(hid_t fidin, * and copy its attributes using that ID *------------------------------------------------------------------------- */ - if(HDstrcmp(travt->objs[i].name, "/") == 0) + if(HDstrcmp(travt->objs[i].name, "/") == 0) { if ((grp_out = H5Gopen2(fidout, "/", H5P_DEFAULT)) < 0) goto error; @@ -609,7 +609,7 @@ int do_copy_objects(hid_t fidin, else { - if (options->grp_compact>0 || options->grp_indexed>0) + if (options->grp_compact>0 || options->grp_indexed>0) { if(H5Pset_link_phase_change(gcpl_out, (unsigned)options->grp_compact, (unsigned)options->grp_indexed) < 0) goto error; @@ -655,7 +655,7 @@ int do_copy_objects(hid_t fidin, /* check if filters were requested for individual objects */ for( u = 0; u < options->op_tbl->nelems; u++) { - int k; + int k; for( k = 0; k < options->op_tbl->objs[u].nfilters; k++) { @@ -696,11 +696,11 @@ int do_copy_objects(hid_t fidin, * otherwise we do a copy using H5Ocopy *------------------------------------------------------------------------- */ - if ( options->op_tbl->nelems || - options->all_filter == 1 || - options->all_layout == 1 || + if ( options->op_tbl->nelems || + options->all_filter == 1 || + options->all_layout == 1 || is_ref || - is_named) + is_named) { int j; @@ -765,7 +765,7 @@ int do_copy_objects(hid_t fidin, apply_s=0; /* apply the filter */ - if (apply_s) + if (apply_s) { if (apply_filters(travt->objs[i].name, rank, @@ -787,7 +787,7 @@ int do_copy_objects(hid_t fidin, dset_out = H5Dcreate2(fidout, travt->objs[i].name, wtype_id, f_space_id, H5P_DEFAULT, dcpl_out, H5P_DEFAULT); } H5E_END_TRY; - if(dset_out == FAIL) + if(dset_out == FAIL) { if(options->verbose) printf(" warning: could not create dataset <%s>. Applying original settings\n", @@ -814,7 +814,7 @@ int do_copy_objects(hid_t fidin, goto error; if (H5Dwrite(dset_out,wtype_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0) goto error; - } + } else /* possibly not enough memory, read/write by hyperslabs */ { @@ -835,7 +835,7 @@ int do_copy_objects(hid_t fidin, hsize_t hs_size[H5S_MAX_RANK]; /*size this pass */ hsize_t hs_nelmts; /*elements in request */ hsize_t zero[8]; /*vector of zeros */ - int k; + int k; /* check if we have VL data in the dataset's datatype */ if (H5Tdetect_class(wtype_id, H5T_VLEN) == TRUE) @@ -847,7 +847,7 @@ int do_copy_objects(hid_t fidin, */ sm_nbytes = p_type_nbytes; - for (k = rank; k > 0; --k) + for (k = rank; k > 0; --k) { hsize_t size = H5TOOLS_BUFSIZE / sm_nbytes; if ( size == 0) /* datum size > H5TOOLS_BUFSIZE */ @@ -865,12 +865,12 @@ int do_copy_objects(hid_t fidin, memset(hs_offset, 0, sizeof hs_offset); memset(zero, 0, sizeof zero); - for (elmtno = 0; elmtno < p_nelmts; elmtno += hs_nelmts) + for (elmtno = 0; elmtno < p_nelmts; elmtno += hs_nelmts) { /* calculate the hyperslab size */ - if (rank > 0) + if (rank > 0) { - for (k = 0, hs_nelmts = 1; k < rank; k++) + for (k = 0, hs_nelmts = 1; k < rank; k++) { hs_size[k] = MIN(dims[k] - hs_offset[k], sm_size[k]); hs_nelmts *= hs_size[k]; @@ -880,8 +880,8 @@ int do_copy_objects(hid_t fidin, goto error; if (H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &hs_nelmts, NULL) < 0) goto error; - } - else + } + else { H5Sselect_all(f_space_id); H5Sselect_all(sm_space); @@ -889,9 +889,9 @@ int do_copy_objects(hid_t fidin, } /* rank */ /* read/write */ - if (H5Dread(dset_in, wtype_id, sm_space, f_space_id, H5P_DEFAULT, sm_buf) < 0) + if (H5Dread(dset_in, wtype_id, sm_space, f_space_id, H5P_DEFAULT, sm_buf) < 0) goto error; - if (H5Dwrite(dset_out, wtype_id, sm_space, f_space_id, H5P_DEFAULT, sm_buf) < 0) + if (H5Dwrite(dset_out, wtype_id, sm_space, f_space_id, H5P_DEFAULT, sm_buf) < 0) goto error; /* reclaim any VL memory, if necessary */ @@ -899,7 +899,7 @@ int do_copy_objects(hid_t fidin, H5Dvlen_reclaim(wtype_id, sm_space, H5P_DEFAULT, sm_buf); /* calculate the next hyperslab offset */ - for (k = rank, carry = 1; k > 0 && carry; --k) + for (k = rank, carry = 1; k > 0 && carry; --k) { hs_offset[k - 1] += hs_size[k - 1]; if (hs_offset[k - 1] == dims[k - 1]) @@ -923,7 +923,7 @@ int do_copy_objects(hid_t fidin, * amount of compression used *------------------------------------------------------------------------- */ - if (options->verbose) + if (options->verbose) { double ratio=0; @@ -942,7 +942,7 @@ int do_copy_objects(hid_t fidin, else print_dataset_info(dcpl_id,travt->objs[i].name,ratio,0); - /* print a message that the filter was not applied + /* print a message that the filter was not applied (in case there was a filter) */ if ( has_filter && apply_s == 0 ) @@ -993,16 +993,16 @@ int do_copy_objects(hid_t fidin, * we do not have request for filter/chunking use H5Ocopy instead *------------------------------------------------------------------------- */ - else + else { hid_t pid; /* create property to pass copy options */ - if ( (pid = H5Pcreate(H5P_OBJECT_COPY)) < 0) + if ( (pid = H5Pcreate(H5P_OBJECT_COPY)) < 0) goto error; /* set options for object copy */ - if(H5Pset_copy_object(pid, H5O_COPY_WITHOUT_ATTR_FLAG) < 0) + if(H5Pset_copy_object(pid, H5O_COPY_WITHOUT_ATTR_FLAG) < 0) goto error; /*------------------------------------------------------------------------- @@ -1015,7 +1015,7 @@ int do_copy_objects(hid_t fidin, fidout, /* Destination file or group identifier */ travt->objs[i].name, /* Name of the destination object */ pid, /* Properties which apply to the copy */ - H5P_DEFAULT) < 0) /* Properties which apply to the new hard link */ + H5P_DEFAULT) < 0) /* Properties which apply to the new hard link */ goto error; /* close property */ @@ -1276,7 +1276,7 @@ int copy_attr(hid_t loc_in, { ; } - else + else { /*------------------------------------------------------------------------- * read to memory @@ -1582,13 +1582,13 @@ error: /*------------------------------------------------------------------------- -* Function: copy_user_block +* Function: copy_user_block * * Purpose: copy user block from one file to another * * Return: 0, ok, -1 no * -* Programmer: Peter Cao +* Programmer: Peter Cao * * Date: October, 25, 2007 * @@ -1662,26 +1662,26 @@ done: if(outfid > 0) HDclose(outfid); - return status; + return status; } /*------------------------------------------------------------------------- -* Function: print_user_block +* Function: print_user_block * * Purpose: print user block * * Return: 0, ok, -1 no * -* Programmer: Pedro Vicente +* Programmer: Pedro Vicente * * Date: August, 20, 2008 * *------------------------------------------------------------------------- */ -#if defined (H5REPACK_DEBUG_USER_BLOCK) -static +#if defined (H5REPACK_DEBUG_USER_BLOCK) +static void print_user_block(const char *filename, hid_t fid) { int fh; /* file handle */ @@ -1690,27 +1690,27 @@ void print_user_block(const char *filename, hid_t fid) hid_t fcpl; /* file creation property list ID for HDF5 file */ int i; - /* get user block size */ - if(( fcpl = H5Fget_create_plist(fid)) < 0) + /* get user block size */ + if(( fcpl = H5Fget_create_plist(fid)) < 0) { error_msg(progname, "failed to retrieve file creation property list\n"); goto done; - } + } - if(H5Pget_userblock(fcpl, &ub_size) < 0) + if(H5Pget_userblock(fcpl, &ub_size) < 0) { error_msg(progname, "failed to retrieve userblock size\n"); goto done; - } + } - if(H5Pclose(fcpl) < 0) + if(H5Pclose(fcpl) < 0) { error_msg(progname, "failed to close property list\n"); goto done; - } + } /* open file */ - if((fh = HDopen(filename, O_RDONLY, 0)) < 0) + if((fh = HDopen(filename, O_RDONLY, 0)) < 0) { goto done; } @@ -1718,7 +1718,7 @@ void print_user_block(const char *filename, hid_t fid) size = ub_size; /* read file */ - while(size > 0) + while(size > 0) { ssize_t nread; /* # of bytes read */ char rbuf[USERBLOCK_XFER_SIZE]; /* buffer for reading */ @@ -1729,7 +1729,7 @@ void print_user_block(const char *filename, hid_t fid) else nread = HDread(fh, rbuf, (size_t)size); - for(i = 0; i < nread; i++) + for(i = 0; i < nread; i++) { printf("%c ", rbuf[i]); @@ -1737,22 +1737,22 @@ void print_user_block(const char *filename, hid_t fid) } printf("\n"); - if(nread < 0) + if(nread < 0) { goto done; - } + } /* update size of userblock left to transfer */ size -= nread; - } + } done: if(fh > 0) HDclose(fh); - return; + return; } #endif diff --git a/tools/h5repack/h5repack_filters.c b/tools/h5repack/h5repack_filters.c index 92b263b..8075a77 100644 --- a/tools/h5repack/h5repack_filters.c +++ b/tools/h5repack/h5repack_filters.c @@ -300,7 +300,7 @@ int apply_filters(const char* name, /* object name from traverse list */ */ if (obj.layout==-1) { - + /* stripmine info */ hsize_t sm_size[H5S_MAX_RANK]; /*stripmine size */ hsize_t sm_nbytes; /*bytes per stripmine */ @@ -312,10 +312,10 @@ int apply_filters(const char* name, /* object name from traverse list */ * a hyperslab whose size is manageable. */ - - + + sm_nbytes = msize; - for ( i = rank; i > 0; --i) + for ( i = rank; i > 0; --i) { hsize_t size = H5TOOLS_BUFSIZE / sm_nbytes; if ( size == 0) /* datum size > H5TOOLS_BUFSIZE */ @@ -445,18 +445,18 @@ int apply_filters(const char* name, /* object name from traverse list */ if (H5Pset_layout(dcpl_id, obj.layout)<0) return -1; - if (H5D_CHUNKED == obj.layout) - { + if (H5D_CHUNKED == obj.layout) + { if(H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths)<0) return -1; } - else if (H5D_COMPACT == obj.layout) + else if (H5D_COMPACT == obj.layout) { if (H5Pset_alloc_time(dcpl_id, H5D_ALLOC_TIME_EARLY)<0) return -1; } /* remove filters for the H5D_CONTIGUOUS case */ - else if (H5D_CONTIGUOUS == obj.layout) + else if (H5D_CONTIGUOUS == obj.layout) { if (H5Premove_filter(dcpl_id,H5Z_FILTER_ALL)<0) return -1; diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c index d873a4b..659e4b8 100644 --- a/tools/h5repack/h5repack_main.c +++ b/tools/h5repack/h5repack_main.c @@ -101,33 +101,33 @@ static struct long_options l_opts[] = { */ int main(int argc, const char **argv) { - + pack_opt_t options; /*the global options */ int ret=-1; - + /* initialize options */ - h5repack_init (&options,0); - + h5repack_init (&options,0); + parse_command_line(argc, argv, &options); - + /* get file names if they were not yet got */ if ( has_i_o == 0 ) { - + if ( argv[ opt_ind ] != NULL && argv[ opt_ind + 1 ] != NULL ) { infile = argv[ opt_ind ]; outfile = argv[ opt_ind + 1 ]; - + if ( strcmp( infile, outfile ) == 0 ) { error_msg(progname, "file names cannot be the same\n"); usage(progname); exit(EXIT_FAILURE); - + } } - + else { error_msg(progname, "file names missing\n"); @@ -135,14 +135,14 @@ int main(int argc, const char **argv) exit(EXIT_FAILURE); } } - - + + /* pack it */ ret=h5repack(infile,outfile,&options); - + /* free tables */ h5repack_end(&options); - + if (ret==-1) return 1; else @@ -279,7 +279,7 @@ static void usage(const char *prog) *------------------------------------------------------------------------- */ -static +static void parse_command_line(int argc, const char **argv, pack_opt_t* options) { diff --git a/tools/h5repack/h5repack_parse.c b/tools/h5repack/h5repack_parse.c index 15dc812..2d8f040 100644 --- a/tools/h5repack/h5repack_parse.c +++ b/tools/h5repack/h5repack_parse.c @@ -449,7 +449,7 @@ obj_list_t* parse_filter(const char *str, default: break; - + }; return obj_list; diff --git a/tools/h5repack/h5repack_refs.c b/tools/h5repack/h5repack_refs.c index cd725cd..fddcf0e 100644 --- a/tools/h5repack/h5repack_refs.c +++ b/tools/h5repack/h5repack_refs.c @@ -74,7 +74,7 @@ int do_copy_refobjs(hid_t fidin, *------------------------------------------------------------------------- */ for(i = 0; i < travt->nobjs; i++) { - switch(travt->objs[i].type) + switch(travt->objs[i].type) { /*------------------------------------------------------------------------- * H5TRAV_TYPE_GROUP @@ -194,8 +194,8 @@ int do_copy_refobjs(hid_t fidin, goto error; if(options->verbose) { - - + + printf(FORMAT_OBJ,"dset",travt->objs[i].name ); printf("object <%s> object reference created to <%s>\n", travt->objs[i].name, @@ -278,9 +278,9 @@ int do_copy_refobjs(hid_t fidin, goto error; if(options->verbose) { - - - + + + printf(FORMAT_OBJ,"dset",travt->objs[i].name ); printf("object <%s> region reference created to <%s>\n", travt->objs[i].name, @@ -441,7 +441,7 @@ static int copy_refs_attr(hid_t loc_in, if(H5Oget_info(loc_in, &oinfo) < 0) goto error; - for(u = 0; u < (unsigned)oinfo.num_attrs; u++) + for(u = 0; u < (unsigned)oinfo.num_attrs; u++) { /*------------------------------------------------------------------------- * open @@ -488,7 +488,7 @@ static int copy_refs_attr(hid_t loc_in, * we cannot just copy the buffers, but instead we recreate the reference *------------------------------------------------------------------------- */ - if(H5Tequal(mtype_id, H5T_STD_REF_OBJ)) + if(H5Tequal(mtype_id, H5T_STD_REF_OBJ)) { hid_t refobj_id; hobj_ref_t *refbuf = NULL; @@ -501,10 +501,10 @@ static int copy_refs_attr(hid_t loc_in, *------------------------------------------------------------------------- */ - if (nelmts) + if (nelmts) { buf = (hobj_ref_t *)HDmalloc((unsigned)(nelmts * msize)); - if(buf == NULL) + if(buf == NULL) { printf("cannot read into memory\n"); goto error; @@ -513,15 +513,15 @@ static int copy_refs_attr(hid_t loc_in, goto error; refbuf = (hobj_ref_t *)HDcalloc((unsigned)nelmts, msize); - if(refbuf == NULL) + if(refbuf == NULL) { printf( "cannot allocate memory\n" ); goto error; } /* end if */ - for(k = 0; k < nelmts; k++) + for(k = 0; k < nelmts; k++) { - H5E_BEGIN_TRY + H5E_BEGIN_TRY { if((refobj_id = H5Rdereference(attr_id, H5R_OBJECT, &buf[k])) < 0) goto error; @@ -530,7 +530,7 @@ static int copy_refs_attr(hid_t loc_in, /* get the name. a valid name could only occur in the * second traversal of the file */ - if((refname = MapIdToName(refobj_id, travt)) != NULL) + if((refname = MapIdToName(refobj_id, travt)) != NULL) { /* create the reference */ if(H5Rcreate(&refbuf[k], fidout, refname, H5R_OBJECT, -1) < 0) @@ -565,7 +565,7 @@ static int copy_refs_attr(hid_t loc_in, * dataset region references *------------------------------------------------------------------------- */ - else if(H5Tequal(mtype_id, H5T_STD_REF_DSETREG)) + else if(H5Tequal(mtype_id, H5T_STD_REF_DSETREG)) { hid_t refobj_id; hdset_reg_ref_t *refbuf = NULL; /* input buffer for region references */ @@ -577,10 +577,10 @@ static int copy_refs_attr(hid_t loc_in, * read input to memory *------------------------------------------------------------------------- */ - if(nelmts) + if(nelmts) { buf = (hdset_reg_ref_t *)HDmalloc((unsigned)(nelmts * msize)); - if(buf == NULL) + if(buf == NULL) { printf( "cannot read into memory\n" ); goto error; @@ -593,15 +593,15 @@ static int copy_refs_attr(hid_t loc_in, *------------------------------------------------------------------------- */ refbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)nelmts); /*init to zero */ - if(refbuf == NULL) + if(refbuf == NULL) { printf( "cannot allocate memory\n" ); goto error; } /* end if */ - for(k = 0; k < nelmts; k++) + for(k = 0; k < nelmts; k++) { - H5E_BEGIN_TRY + H5E_BEGIN_TRY { if((refobj_id = H5Rdereference(attr_id, H5R_DATASET_REGION, &buf[k])) < 0) continue; @@ -610,7 +610,7 @@ static int copy_refs_attr(hid_t loc_in, /* get the name. a valid name could only occur in the * second traversal of the file */ - if((refname = MapIdToName(refobj_id, travt)) != NULL) + if((refname = MapIdToName(refobj_id, travt)) != NULL) { hid_t region_id; /* region id of the referenced dataset */ @@ -692,9 +692,9 @@ static const char* MapIdToName(hid_t refobj_id, unsigned int i; /* linear search */ - for(i = 0; i < travt->nobjs; i++) + for(i = 0; i < travt->nobjs; i++) { - if(travt->objs[i].type == H5O_TYPE_DATASET) + if(travt->objs[i].type == H5O_TYPE_DATASET) { H5O_info_t ref_oinfo; /* Stat for the refobj id */ diff --git a/tools/h5repack/h5repack_verify.c b/tools/h5repack/h5repack_verify.c index 83985c9..e64e85a 100644 --- a/tools/h5repack/h5repack_verify.c +++ b/tools/h5repack/h5repack_verify.c @@ -332,7 +332,7 @@ int h5repack_cmp_pl(const char *fname1, trav_table_init(&trav); if(h5trav_gettable(fid1, trav) < 0) goto error; - + /*------------------------------------------------------------------------- * traverse the suppplied object list *------------------------------------------------------------------------- @@ -472,7 +472,7 @@ error: *------------------------------------------------------------------------- */ -static +static int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *filter) { int nfilters_dcpl; /* number of filters in DCPL*/ diff --git a/tools/h5repack/h5repacktst.c b/tools/h5repack/h5repacktst.c index 0a885c7..cc49f34 100644 --- a/tools/h5repack/h5repacktst.c +++ b/tools/h5repack/h5repacktst.c @@ -1560,10 +1560,10 @@ error: * *------------------------------------------------------------------------- */ -static +static int make_testfiles(void) { - hid_t fid; + hid_t fid; /*------------------------------------------------------------------------- * create a file for general copy test @@ -1770,7 +1770,7 @@ out: * *------------------------------------------------------------------------- */ -static +static int make_all_objects(hid_t loc_id) { hid_t did=-1; @@ -1778,7 +1778,7 @@ int make_all_objects(hid_t loc_id) hid_t tid=-1; hid_t rid=-1; hid_t sid=-1; - hid_t gcplid=-1; + hid_t gcplid=-1; hsize_t dims[1]={2}; /* compound datatype */ typedef struct s_t @@ -1795,7 +1795,7 @@ int make_all_objects(hid_t loc_id) goto out; if ((did = H5Dcreate2(loc_id, "dset_referenced", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; - + /*------------------------------------------------------------------------- * H5G_GROUP @@ -1804,7 +1804,7 @@ int make_all_objects(hid_t loc_id) if ((gid = H5Gcreate2(loc_id, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if (H5Gclose(gid) < 0) - goto out; + goto out; /* create a group "g2" with H5P_CRT_ORDER_TRACKED set */ if ((gcplid = H5Pcreate(H5P_GROUP_CREATE)) < 0) @@ -1872,7 +1872,7 @@ int make_all_objects(hid_t loc_id) return 0; out: - H5E_BEGIN_TRY + H5E_BEGIN_TRY { H5Dclose(did); H5Gclose(gid); @@ -1892,7 +1892,7 @@ out: * *------------------------------------------------------------------------- */ -static +static int make_attributes(hid_t loc_id) { hid_t did=-1; @@ -1908,7 +1908,7 @@ int make_attributes(hid_t loc_id) if ((sid = H5Screate_simple(1, dims, NULL)) < 0) goto out; if ((did = H5Dcreate2(loc_id, "dset", H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) - goto out; + goto out; /*------------------------------------------------------------------------- * H5G_GROUP @@ -1940,11 +1940,11 @@ int make_attributes(hid_t loc_id) goto out; if (H5Sclose(sid) < 0) goto out; - + return 0; out: - H5E_BEGIN_TRY + H5E_BEGIN_TRY { H5Dclose(did); H5Gclose(gid); @@ -1962,7 +1962,7 @@ out: * *------------------------------------------------------------------------- */ -static +static int make_hlinks(hid_t loc_id) { hid_t g1id=-1; @@ -2010,11 +2010,11 @@ int make_hlinks(hid_t loc_id) goto out; if (H5Gclose(g3id) < 0) goto out; - + return 0; out: - H5E_BEGIN_TRY + H5E_BEGIN_TRY { H5Gclose(g1id); H5Gclose(g2id); @@ -2033,7 +2033,7 @@ out: *------------------------------------------------------------------------- */ #ifdef H5_HAVE_FILTER_SZIP -static +static int make_szip(hid_t loc_id) { hid_t dcpl; /* dataset creation property list */ @@ -2068,19 +2068,19 @@ int make_szip(hid_t loc_id) *------------------------------------------------------------------------- */ /* Make sure encoding is enabled */ - if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) + if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) { szip_can_encode = 1; } - if (szip_can_encode) + if (szip_can_encode) { /* set szip data */ if(H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block) < 0) goto out; if (make_dset(loc_id,"dset_szip",sid,dcpl,buf) < 0) goto out; - } - else + } + else { /* WARNING? SZIP is decoder only, can't generate test files */ } @@ -2110,7 +2110,7 @@ out: * *------------------------------------------------------------------------- */ -static +static int make_deflate(hid_t loc_id) { hid_t dcpl; /* dataset creation property list */ @@ -2187,7 +2187,7 @@ out: * *------------------------------------------------------------------------- */ -static +static int make_shuffle(hid_t loc_id) { hid_t dcpl; /* dataset creation property list */ @@ -2253,7 +2253,7 @@ out: * *------------------------------------------------------------------------- */ -static +static int make_fletcher32(hid_t loc_id) { hid_t dcpl; /* dataset creation property list */ @@ -2323,7 +2323,7 @@ out: * *------------------------------------------------------------------------- */ -static +static int make_nbit(hid_t loc_id) { hid_t dcpl; /* dataset creation property list */ @@ -2564,11 +2564,11 @@ int make_all_filters(hid_t loc_id) #endif #if defined (H5_HAVE_FILTER_SZIP) - if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) + if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) { szip_can_encode = 1; } - if (szip_can_encode) + if (szip_can_encode) { /* set szip data */ if(H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block) < 0) @@ -2601,7 +2601,7 @@ int make_all_filters(hid_t loc_id) /* Make sure encoding is enabled */ #if defined (H5_HAVE_FILTER_SZIP) - if (szip_can_encode) + if (szip_can_encode) { /* remove the filters from the dcpl */ if (H5Premove_filter(dcpl,H5Z_FILTER_ALL) < 0) @@ -2611,7 +2611,7 @@ int make_all_filters(hid_t loc_id) goto out; if (make_dset(loc_id,"dset_szip",sid,dcpl,buf) < 0) goto out; - } else + } else { /* WARNING? SZIP is decoder only, can't generate test dataset */ } @@ -2675,7 +2675,7 @@ int make_all_filters(hid_t loc_id) return 0; out: - H5E_BEGIN_TRY + H5E_BEGIN_TRY { H5Pclose(dcpl); H5Sclose(sid); @@ -2720,7 +2720,7 @@ int make_early(void) if (H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY) < 0) goto out; - for(i = 0; i < iter; i++) + for(i = 0; i < iter; i++) { if ((fid = H5Fopen(FNAME5, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) goto out; @@ -2749,7 +2749,7 @@ int make_early(void) if ((fid = H5Fcreate(FNAME6, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) return -1; - for(i = 0; i < iter; i++) + for(i = 0; i < iter; i++) { if ((tid = H5Tcopy(H5T_NATIVE_DOUBLE)) < 0) goto out; @@ -2770,7 +2770,7 @@ int make_early(void) return 0; out: - H5E_BEGIN_TRY + H5E_BEGIN_TRY { H5Tclose(tid); H5Pclose(dcpl); @@ -2879,7 +2879,7 @@ int make_layout(hid_t loc_id) return 0; out: - H5E_BEGIN_TRY + H5E_BEGIN_TRY { H5Pclose(dcpl); H5Sclose(sid); @@ -3065,7 +3065,7 @@ int make_external(hid_t loc_id) return 0; out: - H5E_BEGIN_TRY + H5E_BEGIN_TRY { H5Pclose(dcpl); H5Sclose(sid); @@ -3619,9 +3619,9 @@ int write_dset_in(hid_t loc_id, if ((tid = H5Tcopy(H5T_STD_B8LE)) < 0) goto out; if (write_dset(loc_id,2,dims2,"bitfield2D",tid,buf22) < 0) - goto out; + goto out; if (H5Tclose(tid) < 0) - goto out; + goto out; /*------------------------------------------------------------------------- * H5T_OPAQUE @@ -3630,7 +3630,7 @@ int write_dset_in(hid_t loc_id, if ((tid = H5Tcreate(H5T_OPAQUE, (size_t)1)) < 0) goto out; if (H5Tset_tag(tid, "1-byte opaque type") < 0) - goto out; + goto out; if (write_dset(loc_id,2,dims2,"opaque2D",tid,buf22) < 0) goto out; if (H5Tclose(tid) < 0) @@ -3695,7 +3695,7 @@ int write_dset_in(hid_t loc_id, n = 0; for(i = 0; i < 3; i++) { - for(j = 0; j < 2; j++) + for(j = 0; j < 2; j++) { int l; @@ -3916,7 +3916,7 @@ int write_dset_in(hid_t loc_id, { for(j = 0; j < 3; j++) { - for(k = 0; k < 2; k++) + for(k = 0; k < 2; k++) { int l; @@ -3944,7 +3944,7 @@ int write_dset_in(hid_t loc_id, if (H5Dvlen_reclaim(tid, sid, H5P_DEFAULT, buf53) < 0) goto out; - + if (H5Dclose(did) < 0) goto out; if (H5Tclose(tid) < 0) @@ -4006,7 +4006,7 @@ int write_dset_in(hid_t loc_id, out: - H5E_BEGIN_TRY + H5E_BEGIN_TRY { H5Pclose(pid); H5Sclose(sid); @@ -4016,7 +4016,7 @@ out: return -1; } - + /*------------------------------------------------------------------------- * Function: make_dset_reg_ref @@ -4111,7 +4111,7 @@ out: if(dwbuf) free(dwbuf); - H5E_BEGIN_TRY + H5E_BEGIN_TRY { H5Sclose(sid1); H5Sclose(sid2); @@ -4476,7 +4476,7 @@ int write_attr_in(hid_t loc_id, if(make_diffs) { - for(i = 0; i < 2; i++) + for(i = 0; i < 2; i++) { buf7[i]=0; buf8[i]=0; @@ -4651,9 +4651,9 @@ int write_attr_in(hid_t loc_id, /* Create references to dataset */ if (dset_name) { - for (i = 0; i < 3; i++) + for (i = 0; i < 3; i++) { - for (j = 0; j < 2; j++) + for (j = 0; j < 2; j++) { if (H5Rcreate(&buf42[i][j],fid,dset_name,H5R_OBJECT,-1) < 0) goto out; @@ -4706,9 +4706,9 @@ int write_attr_in(hid_t loc_id, /* Allocate and initialize VL dataset to write */ n=0; - for (i = 0; i < 3; i++) + for (i = 0; i < 3; i++) { - for (j = 0; j < 2; j++) + for (j = 0; j < 2; j++) { int l; buf52[i][j].p = malloc((i + 1) * sizeof(int)); @@ -4803,7 +4803,7 @@ int write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ - if(make_diffs) + if(make_diffs) { HDmemset(buf72, 0, sizeof buf72); HDmemset(buf82, 0, sizeof buf82); @@ -4924,11 +4924,11 @@ int write_attr_in(hid_t loc_id, */ n=1; - for (i = 0; i < 4; i++) + for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) + for (j = 0; j < 3; j++) { - for (k = 0; k < 2; k++) + for (k = 0; k < 2; k++) { if (make_diffs) buf23[i][j][k]=0; else buf23[i][j][k]=n++; @@ -4993,18 +4993,18 @@ int write_attr_in(hid_t loc_id, */ n=1; - for (i = 0; i < 4; i++) + for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) + for (j = 0; j < 3; j++) { - for (k = 0; k < 2; k++) + for (k = 0; k < 2; k++) { - if (make_diffs) + if (make_diffs) { buf33[i][j][k].a=0; buf33[i][j][k].b=0; } - else + else { buf33[i][j][k].a=n++; buf33[i][j][k].b=n++; @@ -5085,9 +5085,9 @@ int write_attr_in(hid_t loc_id, /* Create references to dataset */ if (dset_name) { - for (i = 0; i < 4; i++) + for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) + for (j = 0; j < 3; j++) { for (k = 0; k < 2; k++) if (H5Rcreate(&buf43[i][j][k],fid,dset_name,H5R_OBJECT,-1) < 0) @@ -5103,17 +5103,17 @@ int write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ - for (i = 0; i < 4; i++) + for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) + for (j = 0; j < 3; j++) { - for (k = 0; k < 2; k++) + for (k = 0; k < 2; k++) { - if (make_diffs) + if (make_diffs) { - buf453[i][j][k]=RED; + buf453[i][j][k]=RED; } - else + else { buf453[i][j][k]=GREEN; } @@ -5170,11 +5170,11 @@ int write_attr_in(hid_t loc_id, /* Allocate and initialize VL dataset to write */ n=0; - for (i = 0; i < 4; i++) + for (i = 0; i < 4; i++) { - for (j = 0; j < 3; j++) + for (j = 0; j < 3; j++) { - for (k = 0; k < 2; k++) + for (k = 0; k < 2; k++) { int l; buf53[i][j][k].p = malloc((i + 1) * sizeof(int)); @@ -5184,7 +5184,7 @@ int write_attr_in(hid_t loc_id, { ((int *)buf53[i][j][k].p)[l] = 0; } - else + else ((int *)buf53[i][j][k].p)[l] = n++; } } @@ -5229,9 +5229,9 @@ int write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ n=1; - for (i = 0; i < 24; i++) + for (i = 0; i < 24; i++) { - for (j = 0; j < (int)dimarray[0]; j++) + for (j = 0; j < (int)dimarray[0]; j++) { if (make_diffs) buf63[i][j]=0; else buf63[i][j]=n++; @@ -5269,12 +5269,12 @@ int write_attr_in(hid_t loc_id, { for(k = 0; k < 2; k++) { - if(make_diffs) + if(make_diffs) { buf73[i][j][k] = 0; buf83[i][j][k] = 0; } - else + else { buf73[i][j][k] = n++; buf83[i][j][k] = f++; @@ -5307,7 +5307,7 @@ int write_attr_in(hid_t loc_id, return 0; out: - H5E_BEGIN_TRY + H5E_BEGIN_TRY { H5Aclose(aid); H5Sclose(sid); @@ -5563,7 +5563,7 @@ int make_named_dtype(hid_t loc_id) return 0; out: - H5E_BEGIN_TRY + H5E_BEGIN_TRY { H5Tclose(tid); H5Aclose(aid); |