From c7bf502798ed500d9637ff3dd23a83420afd5070 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sat, 13 Aug 2005 16:06:26 -0500 Subject: [svn-r11246] Purpose: Code cleanup Description: Trim trailing whitespace, which is making 'diff'ing the two branches difficult. Solution: Ran this script in each directory: foreach f (*.[ch] *.cpp) sed 's/[[:blank:]]*$//' $f > sed.out && mv sed.out $f end Platforms tested: FreeBSD 4.11 (sleipnir) Too minor to require h5committest --- c++/examples/chunks.cpp | 80 +- c++/examples/compound.cpp | 16 +- c++/examples/create.cpp | 18 +- c++/examples/extend_ds.cpp | 48 +- c++/examples/h5group.cpp | 28 +- c++/examples/readdata.cpp | 20 +- c++/examples/writedata.cpp | 48 +- c++/src/H5AbstractDs.cpp | 18 +- c++/src/H5AbstractDs.h | 12 +- c++/src/H5ArrayType.cpp | 20 +- c++/src/H5ArrayType.h | 2 +- c++/src/H5AtomType.cpp | 32 +- c++/src/H5AtomType.h | 16 +- c++/src/H5Attribute.cpp | 16 +- c++/src/H5Attribute.h | 6 +- c++/src/H5CommonFG.cpp | 108 +-- c++/src/H5CommonFG.h | 12 +- c++/src/H5CompType.cpp | 88 +- c++/src/H5CompType.h | 28 +- c++/src/H5CppDoc.h | 12 +- c++/src/H5DataSet.cpp | 42 +- c++/src/H5DataSet.h | 6 +- c++/src/H5DataSpace.cpp | 58 +- c++/src/H5DataSpace.h | 4 +- c++/src/H5DataType.cpp | 124 +-- c++/src/H5DataType.h | 32 +- c++/src/H5DcreatProp.cpp | 14 +- c++/src/H5DcreatProp.h | 8 +- c++/src/H5DxferProp.cpp | 46 +- c++/src/H5DxferProp.h | 14 +- c++/src/H5EnumType.cpp | 20 +- c++/src/H5EnumType.h | 12 +- c++/src/H5Exception.cpp | 30 +- c++/src/H5Exception.h | 10 +- c++/src/H5FaccProp.cpp | 54 +- c++/src/H5FaccProp.h | 4 +- c++/src/H5FcreatProp.cpp | 38 +- c++/src/H5FcreatProp.h | 4 +- c++/src/H5File.cpp | 124 +-- c++/src/H5File.h | 6 +- c++/src/H5FloatType.cpp | 48 +- c++/src/H5FloatType.h | 20 +- c++/src/H5Group.cpp | 14 +- c++/src/H5IdComponent.cpp | 32 +- c++/src/H5IntType.cpp | 10 +- c++/src/H5IntType.h | 2 +- c++/src/H5Library.cpp | 36 +- c++/src/H5Library.h | 22 +- c++/src/H5Object.cpp | 32 +- c++/src/H5Object.h | 8 +- c++/src/H5PredType.cpp | 16 +- c++/src/H5PredType.h | 10 +- c++/src/H5PropList.cpp | 62 +- c++/src/H5PropList.h | 2 +- c++/src/H5StrType.cpp | 18 +- c++/src/H5StrType.h | 12 +- c++/src/H5VarLenType.cpp | 2 +- c++/test/dsets.cpp | 116 +-- c++/test/h5cpputil.cpp | 10 +- c++/test/h5cpputil.h | 4 +- c++/test/testhdf5.cpp | 2 +- c++/test/tfile.cpp | 26 +- c++/test/th5s.cpp | 48 +- examples/h5_attribute.c | 78 +- examples/h5_chunk_read.c | 90 +- examples/h5_compound.c | 16 +- examples/h5_drivers.c | 8 +- examples/h5_extend_write.c | 62 +- examples/h5_group.c | 74 +- examples/h5_mount.c | 40 +- examples/h5_read.c | 60 +- examples/h5_reference.c | 66 +- examples/h5_select.c | 162 ++-- examples/h5_write.c | 28 +- examples/ph5example.c | 84 +- fortran/src/H5Af.c | 78 +- fortran/src/H5Df.c | 264 +++--- fortran/src/H5Ef.c | 40 +- fortran/src/H5FDmpiof.c | 80 +- fortran/src/H5Ff.c | 76 +- fortran/src/H5Gf.c | 112 +-- fortran/src/H5If.c | 24 +- fortran/src/H5Pf.c | 646 +++++++------- fortran/src/H5Rf.c | 66 +- fortran/src/H5Sf.c | 238 ++--- fortran/src/H5Tf.c | 508 +++++------ fortran/src/H5Zf.c | 4 +- fortran/src/H5_f.c | 168 ++-- fortran/src/H5f90.h | 2 +- fortran/src/H5f90i.h | 8 +- fortran/src/H5f90kit.c | 2 +- fortran/src/H5f90proto.h | 56 +- fortran/test/t.c | 28 +- fortran/test/t.h | 6 +- hl/src/H5IM.c | 286 +++--- hl/src/H5IM.h | 40 +- hl/src/H5LT.c | 556 ++++++------ hl/src/H5LT.h | 200 ++--- hl/src/H5TA.c | 652 +++++++------- hl/src/H5TA.h | 48 +- hl/test/test_image.c | 8 +- hl/test/test_lite.c | 88 +- hl/test/test_table.c | 516 +++++------ hl/tools/gif2h5/decompress.c | 30 +- hl/tools/gif2h5/gif.h | 12 +- hl/tools/gif2h5/gif2mem.c | 42 +- hl/tools/gif2h5/gifread.c | 50 +- hl/tools/gif2h5/hdf2gif.c | 16 +- hl/tools/gif2h5/hdfgifwr.c | 18 +- hl/tools/gif2h5/readhdf.c | 12 +- hl/tools/gif2h5/writehdf.c | 12 +- perform/benchpar.c | 4 +- perform/chunk.c | 14 +- perform/iopipe.c | 88 +- perform/mpi-perf.c | 48 +- perform/overhead.c | 28 +- perform/perf.c | 66 +- perform/perf_meta.c | 154 ++-- perform/pio_engine.c | 14 +- perform/pio_perf.c | 6 +- src/H5.c | 68 +- src/H5A.c | 122 +-- src/H5AC.c | 110 +-- src/H5ACprivate.h | 6 +- src/H5B.c | 48 +- src/H5Bprivate.h | 6 +- src/H5C.c | 636 +++++++------- src/H5Cprivate.h | 90 +- src/H5D.c | 244 +++--- src/H5Dcompact.c | 58 +- src/H5Dcontig.c | 16 +- src/H5Defl.c | 24 +- src/H5Dio.c | 238 ++--- src/H5Distore.c | 154 ++-- src/H5Dmpio.c | 54 +- src/H5Dpkg.h | 8 +- src/H5Dprivate.h | 12 +- src/H5Dpublic.h | 4 +- src/H5Dselect.c | 8 +- src/H5E.c | 40 +- src/H5F.c | 260 +++--- src/H5FD.c | 102 +-- src/H5FDcore.c | 44 +- src/H5FDfamily.c | 74 +- src/H5FDgass.c | 72 +- src/H5FDgass.h | 4 +- src/H5FDlog.c | 58 +- src/H5FDmpi.c | 16 +- src/H5FDmpio.c | 54 +- src/H5FDmpiposix.c | 48 +- src/H5FDmulti.c | 78 +- src/H5FDpublic.h | 4 +- src/H5FDsec2.c | 36 +- src/H5FDsrb.c | 102 +-- src/H5FDstdio.c | 54 +- src/H5FDstream.c | 14 +- src/H5FDstream.h | 2 +- src/H5FL.c | 78 +- src/H5FLprivate.h | 2 +- src/H5FS.c | 16 +- src/H5Fdbg.c | 2 +- src/H5Fmount.c | 34 +- src/H5Fpkg.h | 2 +- src/H5Fprivate.h | 14 +- src/H5Fpublic.h | 2 +- src/H5Fsfile.c | 6 +- src/H5Fsuper.c | 18 +- src/H5G.c | 226 ++--- src/H5Gent.c | 12 +- src/H5Gnode.c | 42 +- src/H5Gpkg.h | 2 +- src/H5Gpublic.h | 6 +- src/H5Gstab.c | 16 +- src/H5HG.c | 66 +- src/H5HL.c | 2 +- src/H5I.c | 64 +- src/H5Ipublic.h | 2 +- src/H5MF.c | 10 +- src/H5MM.c | 2 +- src/H5MPprivate.h | 12 +- src/H5O.c | 92 +- src/H5Oattr.c | 22 +- src/H5Obogus.c | 2 +- src/H5Ocont.c | 2 +- src/H5Odtype.c | 28 +- src/H5Oefl.c | 20 +- src/H5Ofill.c | 64 +- src/H5Olayout.c | 48 +- src/H5Omtime.c | 22 +- src/H5Oname.c | 4 +- src/H5Onull.c | 2 +- src/H5Opkg.h | 4 +- src/H5Opline.c | 16 +- src/H5Oprivate.h | 16 +- src/H5Osdspace.c | 22 +- src/H5Oshared.c | 12 +- src/H5Ostab.c | 4 +- src/H5P.c | 96 +-- src/H5Pdcpl.c | 138 +-- src/H5Pdxpl.c | 32 +- src/H5Pfapl.c | 308 +++---- src/H5Pfcpl.c | 22 +- src/H5Pprivate.h | 2 +- src/H5Ppublic.h | 16 +- src/H5R.c | 32 +- src/H5S.c | 54 +- src/H5SL.c | 2 +- src/H5ST.c | 14 +- src/H5Sall.c | 4 +- src/H5Shyper.c | 58 +- src/H5Smpio.c | 54 +- src/H5Snone.c | 2 +- src/H5Spkg.h | 6 +- src/H5Spoint.c | 14 +- src/H5T.c | 210 ++--- src/H5TS.c | 12 +- src/H5Tarray.c | 20 +- src/H5Tbit.c | 26 +- src/H5Tcommit.c | 10 +- src/H5Tcompound.c | 24 +- src/H5Tconv.c | 174 ++-- src/H5Tcset.c | 12 +- src/H5Tenum.c | 28 +- src/H5Tfields.c | 36 +- src/H5Tfixed.c | 10 +- src/H5Tfloat.c | 22 +- src/H5Tnative.c | 278 +++--- src/H5Toffset.c | 10 +- src/H5Topaque.c | 4 +- src/H5Torder.c | 2 +- src/H5Tpad.c | 6 +- src/H5Tpkg.h | 4 +- src/H5Tprecis.c | 6 +- src/H5Tpublic.h | 2 +- src/H5Tstrpad.c | 8 +- src/H5Tvlen.c | 42 +- src/H5V.c | 6 +- src/H5Z.c | 46 +- src/H5Zdeflate.c | 8 +- src/H5Zfletcher32.c | 50 +- src/H5Zprivate.h | 2 +- src/H5Zpublic.h | 16 +- src/H5Zshuffle.c | 8 +- src/H5Zszip.c | 18 +- src/H5detect.c | 48 +- src/H5private.h | 24 +- src/H5public.h | 6 +- test/big.c | 32 +- test/bittests.c | 32 +- test/cache.c | 550 ++++++------ test/cmpd_dset.c | 48 +- test/dangle.c | 32 +- test/dsets.c | 418 ++++----- test/dtypes.c | 380 ++++---- test/enum.c | 56 +- test/extend.c | 6 +- test/external.c | 20 +- test/file_handle.c | 134 +-- test/fillval.c | 148 ++-- test/flush1.c | 2 +- test/flush2.c | 8 +- test/gass_append.c | 40 +- test/gass_read.c | 70 +- test/gass_write.c | 42 +- test/gen_deflate.c | 6 +- test/gen_new_array.c | 6 +- test/gen_new_fill.c | 12 +- test/gen_new_mtime.c | 6 +- test/gen_new_super.c | 4 +- test/gen_nullspace.c | 16 +- test/gen_old_array.c | 6 +- test/gen_old_layout.c | 6 +- test/gen_old_mtime.c | 6 +- test/getname.c | 246 +++--- test/gheap.c | 16 +- test/h5test.c | 54 +- test/h5test.h | 12 +- test/hyperslab.c | 20 +- test/istore.c | 4 +- test/lheap.c | 2 +- test/links.c | 32 +- test/mount.c | 140 +-- test/mtime.c | 18 +- test/ntypes.c | 414 ++++----- test/ohdr.c | 10 +- test/reserved.c | 24 +- test/set_extent.c | 16 +- test/space_overflow.c | 6 +- test/srb_append.c | 94 +- test/srb_read.c | 122 +-- test/srb_write.c | 94 +- test/stab.c | 10 +- test/tarray.c | 148 ++-- test/tattr.c | 84 +- test/tconfig.c | 4 +- test/testframe.c | 8 +- test/testhdf5.c | 2 +- test/testmeta.c | 60 +- test/tfile.c | 202 ++--- test/tgenprop.c | 108 +-- test/th5s.c | 38 +- test/theap.c | 70 +- test/titerate.c | 106 +-- test/tmeta.c | 4 +- test/tmisc.c | 194 ++--- test/trefer.c | 44 +- test/trefstr.c | 34 +- test/tselect.c | 424 ++++----- test/tskiplist.c | 76 +- test/ttime.c | 36 +- test/ttsafe.c | 2 +- test/ttsafe_acreate.c | 2 +- test/ttsafe_cancel.c | 2 +- test/ttsafe_dcreate.c | 2 +- test/ttsafe_error.c | 2 +- test/ttst.c | 26 +- test/tvlstr.c | 78 +- test/tvltypes.c | 92 +- test/unlink.c | 46 +- testpar/t_coll_chunk.c | 48 +- testpar/t_dset.c | 2 +- testpar/t_mdset.c | 292 +++---- testpar/t_mpi.c | 12 +- testpar/t_ph5basic.c | 6 +- testpar/t_span_tree.c | 282 +++--- testpar/testphdf5.c | 56 +- testpar/testphdf5.h | 170 ++-- tools/gifconv/decompress.c | 30 +- tools/gifconv/gif.h | 12 +- tools/gifconv/gif2mem.c | 42 +- tools/gifconv/gifread.c | 50 +- tools/gifconv/hdf2gif.c | 16 +- tools/gifconv/hdfgifwr.c | 18 +- tools/gifconv/readhdf.c | 12 +- tools/gifconv/writehdf.c | 12 +- tools/h5diff/h5diff_main.c | 56 +- tools/h5diff/testh5diff.h | 24 +- tools/h5diff/testh5diff_attr.c | 96 +-- tools/h5diff/testh5diff_basic.c | 64 +- tools/h5diff/testh5diff_dset.c | 60 +- tools/h5diff/testh5diff_main.c | 8 +- tools/h5diff/testh5diff_util.c | 26 +- tools/h5dump/h5dump.c | 264 +++--- tools/h5dump/h5dumpgentest.c | 314 +++---- tools/h5import/h5import.c | 702 +++++++-------- tools/h5import/h5import.h | 24 +- tools/h5import/h5importtest.c | 52 +- tools/h5jam/getub.c | 8 +- tools/h5jam/h5jam.c | 20 +- tools/h5jam/h5jamgentest.c | 18 +- tools/h5jam/h5unjam.c | 26 +- tools/h5jam/tellub.c | 10 +- tools/h5ls/h5ls.c | 96 +-- tools/h5repack/h5repack.c | 86 +- tools/h5repack/h5repack.h | 76 +- tools/h5repack/h5repack_copy.c | 258 +++--- tools/h5repack/h5repack_filters.c | 168 ++-- tools/h5repack/h5repack_list.c | 44 +- tools/h5repack/h5repack_main.c | 34 +- tools/h5repack/h5repack_opttable.c | 100 +-- tools/h5repack/h5repack_parse.c | 90 +- tools/h5repack/h5repack_refs.c | 268 +++--- tools/h5repack/h5repack_verify.c | 144 ++-- tools/h5repack/testh5repack_attr.c | 92 +- tools/h5repack/testh5repack_detect_szip.c | 8 +- tools/h5repack/testh5repack_dset.c | 88 +- tools/h5repack/testh5repack_main.c | 128 +-- tools/h5repack/testh5repack_make.c | 170 ++-- tools/h5repack/testh5repack_util.c | 46 +- tools/lib/h5diff.c | 166 ++-- tools/lib/h5diff.h | 240 +++--- tools/lib/h5diff_array.c | 1342 ++++++++++++++--------------- tools/lib/h5diff_attr.c | 106 +-- tools/lib/h5diff_dset.c | 132 +-- tools/lib/h5diff_util.c | 62 +- tools/lib/h5tools.c | 50 +- tools/lib/h5tools.h | 22 +- tools/lib/h5tools_filters.c | 44 +- tools/lib/h5tools_str.c | 28 +- tools/lib/h5tools_utils.c | 26 +- tools/lib/h5tools_utils.h | 4 +- tools/lib/h5trav.c | 134 +-- tools/lib/h5trav.h | 28 +- tools/lib/h5trav_table.c | 50 +- tools/misc/h5debug.c | 8 +- tools/misc/h5import.c | 8 +- tools/misc/h5repart.c | 12 +- tools/misc/pdb2hdf.c | 38 +- 388 files changed, 13285 insertions(+), 13285 deletions(-) diff --git a/c++/examples/chunks.cpp b/c++/examples/chunks.cpp index 0efd95d..b6db2ad 100644 --- a/c++/examples/chunks.cpp +++ b/c++/examples/chunks.cpp @@ -12,11 +12,11 @@ * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* +/* * This example shows how to read data from a chunked dataset. - * We will read from the file created by extend.C + * We will read from the file created by extend.C */ - + #include #ifdef OLD_HEADER_FILENAME @@ -55,7 +55,7 @@ int main (void) */ H5File file( FILE_NAME, H5F_ACC_RDONLY ); DataSet dataset = file.openDataSet( DATASET_NAME ); - + /* * Get filespace for rank and dimension */ @@ -69,18 +69,18 @@ int main (void) /* * Get and print the dimension sizes of the file dataspace */ - hsize_t dims[2]; // dataset dimensions + hsize_t dims[2]; // dataset dimensions rank = filespace.getSimpleExtentDims( dims ); - cout << "dataset rank = " << rank << ", dimensions " + cout << "dataset rank = " << rank << ", dimensions " << (unsigned long)(dims[0]) << " x " << (unsigned long)(dims[1]) << endl; /* * Get creation properties list. */ - DSetCreatPropList cparms = dataset.getCreatePlist(); + DSetCreatPropList cparms = dataset.getCreatePlist(); - /* + /* * Check if dataset is chunked. */ hsize_t chunk_dims[2]; @@ -91,16 +91,16 @@ int main (void) * Get chunking information: rank and dimensions */ rank_chunk = cparms.getChunk( 2, chunk_dims); - cout << "chunk rank " << rank_chunk << "dimensions " - << (unsigned long)(chunk_dims[0]) << " x " + cout << "chunk rank " << rank_chunk << "dimensions " + << (unsigned long)(chunk_dims[0]) << " x " << (unsigned long)(chunk_dims[1]) << endl; } - + /* * Define the memory space to read dataset. */ DataSpace mspace1( RANK, dims ); - + /* * Read dataset back and display. */ @@ -113,23 +113,23 @@ int main (void) for (i = 0; i < dims[1]; i++) cout << data_out[j][i] << " "; cout << endl; - } + } /* - * dataset rank 2, dimensions 10 x 5 - * chunk rank 2, dimensions 2 x 5 + * dataset rank 2, dimensions 10 x 5 + * chunk rank 2, dimensions 2 x 5 * Dataset: - * 1 1 1 3 3 - * 1 1 1 3 3 - * 1 1 1 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 + * 1 1 1 3 3 + * 1 1 1 3 3 + * 1 1 1 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 */ /* @@ -157,17 +157,17 @@ int main (void) cout << column[i] << endl; /* - * Third column: - * 1 - * 1 - * 1 - * 0 - * 0 - * 0 - * 0 - * 0 - * 0 - * 0 + * Third column: + * 1 + * 1 + * 1 + * 0 + * 0 + * 0 + * 0 + * 0 + * 0 + * 0 */ /* @@ -196,11 +196,11 @@ int main (void) for (i = 0; i < chunk_dims[1]; i++) cout << chunk_out[j][i] << " "; cout << endl; - } + } /* - * Chunk: - * 1 1 1 0 0 - * 2 0 0 0 0 + * Chunk: + * 1 1 1 0 0 + * 2 0 0 0 0 */ } // end of try block diff --git a/c++/examples/compound.cpp b/c++/examples/compound.cpp index d3163d6..dfbd544 100644 --- a/c++/examples/compound.cpp +++ b/c++/examples/compound.cpp @@ -45,7 +45,7 @@ int main(void) typedef struct s1_t { int a; float b; - double c; + double c; } s1_t; /* Second structure (subset of s1_t) and dataset*/ @@ -87,21 +87,21 @@ int main(void) H5File* file = new H5File( FILE_NAME, H5F_ACC_TRUNC ); /* - * Create the memory datatype. + * Create the memory datatype. */ CompType mtype1( sizeof(s1_t) ); mtype1.insertMember( MEMBER1, HOFFSET(s1_t, a), PredType::NATIVE_INT); mtype1.insertMember( MEMBER3, HOFFSET(s1_t, c), PredType::NATIVE_DOUBLE); mtype1.insertMember( MEMBER2, HOFFSET(s1_t, b), PredType::NATIVE_FLOAT); - /* + /* * Create the dataset. */ DataSet* dataset; dataset = new DataSet( file->createDataSet( DATASET_NAME, mtype1, space )); /* - * Wtite data to the dataset; + * Wtite data to the dataset; */ dataset->write( s1, mtype1 ); @@ -110,7 +110,7 @@ int main(void) */ delete dataset; delete file; - + // Get the class of the first member in mtype1, then get its type H5T_class_t member1_class = mtype1.getMemberClass( 2 ); if( member1_class == H5T_FLOAT ) @@ -127,7 +127,7 @@ int main(void) file = new H5File( FILE_NAME, H5F_ACC_RDONLY ); dataset = new DataSet (file->openDataSet( DATASET_NAME )); - /* + /* * Create a datatype for s2 */ CompType mtype2( sizeof(s2_t) ); @@ -151,11 +151,11 @@ int main(void) cout << endl; cout << endl << "Field a : " << endl; - for( i = 0; i < LENGTH; i++) + for( i = 0; i < LENGTH; i++) cout << s2[i].a << " "; cout << endl; - /* + /* * Create a datatype for s3. */ CompType mtype3( sizeof(float) ); diff --git a/c++/examples/create.cpp b/c++/examples/create.cpp index 06d5d4d..3e93cb4 100644 --- a/c++/examples/create.cpp +++ b/c++/examples/create.cpp @@ -12,10 +12,10 @@ * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* +/* * This example writes a dataset to a new HDF5 file. */ - + #include #ifdef OLD_HEADER_FILENAME @@ -37,8 +37,8 @@ const int RANK = 2; int main (void) { - /* - * Data initialization. + /* + * Data initialization. */ int i, j; int data[NX][NY]; // buffer for data to write @@ -46,9 +46,9 @@ int main (void) { for (i = 0; i < NY; i++) data[j][i] = i + j; - } + } /* - * 0 1 2 3 4 5 + * 0 1 2 3 4 5 * 1 2 3 4 5 6 * 2 3 4 5 6 7 * 3 4 5 6 7 8 @@ -73,12 +73,12 @@ int main (void) /* * Define the size of the array and create the data space for fixed - * size dataset. + * size dataset. */ hsize_t dimsf[2]; // dataset dimensions dimsf[0] = NX; dimsf[1] = NY; - DataSpace dataspace( RANK, dimsf ); + DataSpace dataspace( RANK, dimsf ); /* * Define datatype for the data in the file. @@ -129,5 +129,5 @@ int main (void) } return 0; // successfully terminated -} +} diff --git a/c++/examples/extend_ds.cpp b/c++/examples/extend_ds.cpp index 9c12304..614a2b1 100644 --- a/c++/examples/extend_ds.cpp +++ b/c++/examples/extend_ds.cpp @@ -12,13 +12,13 @@ * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* +/* * This example shows how to work with extendible dataset. * In the current version of the library dataset MUST be * chunked. - * + * */ - + #include #ifdef OLD_HEADER_FILENAME @@ -52,18 +52,18 @@ int main (void) Exception::dontPrint(); /* - * Create the data space with unlimited dimensions. + * Create the data space with unlimited dimensions. */ - hsize_t dims[2] = { 3, 3}; // dataset dimensions at creation + hsize_t dims[2] = { 3, 3}; // dataset dimensions at creation hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; - DataSpace mspace1( RANK, dims, maxdims); + DataSpace mspace1( RANK, dims, maxdims); /* * Create a new file. If file exists its contents will be overwritten. */ H5File file( FILE_NAME, H5F_ACC_TRUNC ); - /* + /* * Modify dataset creation properties, i.e. enable chunking. */ DSetCreatPropList cparms; @@ -87,8 +87,8 @@ int main (void) * Extend the dataset. This call assures that dataset is at least 3 x 3. */ hsize_t size[2]; - size[0] = 3; - size[1] = 3; + size[0] = 3; + size[1] = 3; dataset.extend( size ); /* @@ -98,24 +98,24 @@ int main (void) hsize_t offset[2]; offset[0] = 0; offset[1] = 0; - hsize_t dims1[2] = { 3, 3}; /* data1 dimensions */ - fspace1.selectHyperslab( H5S_SELECT_SET, dims1, offset ); + hsize_t dims1[2] = { 3, 3}; /* data1 dimensions */ + fspace1.selectHyperslab( H5S_SELECT_SET, dims1, offset ); /* * Write the data to the hyperslab. */ int data1[3][3] = { {1, 1, 1}, /* data to write */ {1, 1, 1}, - {1, 1, 1} }; + {1, 1, 1} }; dataset.write( data1, PredType::NATIVE_INT, mspace1, fspace1 ); /* * Extend the dataset. Dataset becomes 10 x 3. */ - hsize_t dims2[2] = { 7, 1}; /* data2 dimensions */ + hsize_t dims2[2] = { 7, 1}; /* data2 dimensions */ dims[0] = dims1[0] + dims2[0]; - size[0] = dims[0]; - size[1] = dims[1]; + size[0] = dims[0]; + size[1] = dims[1]; dataset.extend( size ); /* @@ -124,12 +124,12 @@ int main (void) DataSpace fspace2 = dataset.getSpace (); offset[0] = 3; offset[1] = 0; - fspace2.selectHyperslab( H5S_SELECT_SET, dims2, offset ); + fspace2.selectHyperslab( H5S_SELECT_SET, dims2, offset ); /* * Define memory space */ - DataSpace mspace2( RANK, dims2 ); + DataSpace mspace2( RANK, dims2 ); /* * Write the data to the hyperslab. @@ -140,10 +140,10 @@ int main (void) /* * Extend the dataset. Dataset becomes 10 x 5. */ - hsize_t dims3[2] = { 2, 2}; /* data3 dimensions */ + hsize_t dims3[2] = { 2, 2}; /* data3 dimensions */ dims[1] = dims1[1] + dims3[1]; - size[0] = dims[0]; - size[1] = dims[1]; + size[0] = dims[0]; + size[1] = dims[1]; dataset.extend( size ); /* @@ -152,12 +152,12 @@ int main (void) DataSpace fspace3 = dataset.getSpace (); offset[0] = 0; offset[1] = 3; - fspace3.selectHyperslab( H5S_SELECT_SET, dims3, offset ); + fspace3.selectHyperslab( H5S_SELECT_SET, dims3, offset ); /* * Define memory space. */ - DataSpace mspace3( RANK, dims3 ); + DataSpace mspace3( RANK, dims3 ); /* * Write the data to the hyperslab. @@ -178,7 +178,7 @@ int main (void) dataset.read( data_out, PredType::NATIVE_INT ); /* * Resulting dataset - * + * * 1 1 1 3 3 * 1 1 1 3 3 * 1 1 1 0 0 @@ -229,4 +229,4 @@ int main (void) return -1; } return 0; -} +} diff --git a/c++/examples/h5group.cpp b/c++/examples/h5group.cpp index d7f3c66..a69f2f4 100644 --- a/c++/examples/h5group.cpp +++ b/c++/examples/h5group.cpp @@ -13,13 +13,13 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * This example creates a group in the file and dataset in the group. + * This example creates a group in the file and dataset in the group. * Hard link to the group object is created and the dataset is accessed - * under different names. + * under different names. * Iterator function is used to find the object names in the root group. * Note that the C++ API iterator function is not completed yet, thus * the C version is used in this example. - */ + */ #include #ifdef OLD_HEADER_FILENAME @@ -67,9 +67,9 @@ int main(void) /* * Create dataset "Compressed Data" in the group using absolute - * name. Dataset creation property list is modified to use - * GZIP compression with the compression effort set to 6. - * Note that compression can be used only when dataset is chunked. + * name. Dataset creation property list is modified to use + * GZIP compression with the compression effort set to 6. + * Note that compression can be used only when dataset is chunked. */ dims[0] = 1000; dims[1] = 20; @@ -92,13 +92,13 @@ int main(void) delete file; /* - * Now reopen the file and group in the file. + * Now reopen the file and group in the file. */ file = new H5File( FILE_NAME, H5F_ACC_RDWR ); group = new Group( file->openGroup( "Data" )); /* - * Access "Compressed_Data" dataset in the group. + * Access "Compressed_Data" dataset in the group. */ try { // to determine if the dataset exists in the group dataset = new DataSet( group->openDataSet( "Compressed_Data" )); @@ -121,11 +121,11 @@ int main(void) /* * We can access "Compressed_Data" dataset using created - * hard link "Data_new". + * hard link "Data_new". */ try { // to determine if the dataset exists in the file dataset = new DataSet( file->openDataSet( "/Data_new/Compressed_Data" )); - } + } catch( FileIException not_found_error ) { cout << " Dataset is not found." << endl; @@ -150,9 +150,9 @@ int main(void) * of the objects in the file root direvtory. */ cout << "Unlinking..." << endl; - try { // attempt to unlink the dataset + try { // attempt to unlink the dataset file->unlink( "Data" ); - } + } catch( FileIException unlink_error ) { cout << " unlink failed." << endl; @@ -211,12 +211,12 @@ file_info(hid_t loc_id, const char *name, void *opdata) * Open the group using its name. */ group = H5Gopen(loc_id, name); - + /* * Display group name. */ cout << "Name : " << name << endl; - + H5Gclose(group); return 0; } diff --git a/c++/examples/readdata.cpp b/c++/examples/readdata.cpp index 7e5b195..5a1ec51 100644 --- a/c++/examples/readdata.cpp +++ b/c++/examples/readdata.cpp @@ -12,10 +12,10 @@ * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -// +// // This example reads hyperslab from the SDS.h5 file into -// two-dimensional plane of a three-dimensional array. Various -// information about the dataset in the SDS.h5 file is obtained. +// two-dimensional plane of a three-dimensional array. Various +// information about the dataset in the SDS.h5 file is obtained. // #include @@ -54,7 +54,7 @@ int main (void) for (k = 0; k < NZ ; k++) data_out[j][i][k] = 0; } - } + } /* * Try block to detect exceptions raised by any of the calls inside it @@ -125,7 +125,7 @@ int main (void) (unsigned long)(dims_out[1]) << endl; /* - * Define hyperslab in the dataset; implicitly giving strike and + * Define hyperslab in the dataset; implicitly giving strike and * block NULL. */ hsize_t offset[2]; // hyperslab offset in the file @@ -143,10 +143,10 @@ int main (void) dimsm[0] = NX; dimsm[1] = NY; dimsm[2] = NZ ; - DataSpace memspace( RANK_OUT, dimsm ); + DataSpace memspace( RANK_OUT, dimsm ); /* - * Define memory hyperslab. + * Define memory hyperslab. */ hsize_t offset_out[3]; // hyperslab offset in memory hsize_t count_out[3]; // size of the hyperslab in memory @@ -159,7 +159,7 @@ int main (void) memspace.selectHyperslab( H5S_SELECT_SET, count_out, offset_out ); /* - * Read data from hyperslab in the file into the hyperslab in + * Read data from hyperslab in the file into the hyperslab in * memory and display the data. */ dataset.read( data_out, PredType::NATIVE_INT, memspace, dataspace ); @@ -174,7 +174,7 @@ int main (void) * 0 0 0 0 0 0 0 * 0 0 0 0 0 0 0 * 0 0 0 0 0 0 0 - * 3 4 5 6 0 0 0 + * 3 4 5 6 0 0 0 * 4 5 6 7 0 0 0 * 5 6 7 8 0 0 0 * 0 0 0 0 0 0 0 @@ -210,5 +210,5 @@ int main (void) } return 0; // successfully terminated -} +} diff --git a/c++/examples/writedata.cpp b/c++/examples/writedata.cpp index 0bed680..f50927d 100644 --- a/c++/examples/writedata.cpp +++ b/c++/examples/writedata.cpp @@ -12,15 +12,15 @@ * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* +/* * This program shows how the select_hyperslab and select_elements * functions are used to write selected data from memory to the file. * Program takes 48 elements from the linear buffer and writes them into - * the matrix using 3x2 blocks, (4,3) stride and (2,4) count. - * Then four elements of the matrix are overwritten with the new values and + * the matrix using 3x2 blocks, (4,3) stride and (2,4) count. + * Then four elements of the matrix are overwritten with the new values and * file is closed. Program reopens the file and reads and displays the result. - */ - + */ + #include #ifdef OLD_HEADER_FILENAME @@ -29,7 +29,7 @@ #include #endif #include "H5Cpp.h" - + #ifndef H5_NO_NAMESPACE using namespace H5; #endif @@ -42,7 +42,7 @@ const int MSPACE2_RANK = 1; // Rank of the second dataset in memory const int MSPACE2_DIM = 4; // Dataset size in memory const int FSPACE_RANK = 2; // Dataset rank as it is stored in the file const int FSPACE_DIM1 = 8; // Dimension sizes of the dataset as it is... -const int FSPACE_DIM2 = 12; // ...stored in the file +const int FSPACE_DIM2 = 12; // ...stored in the file const int MSPACE_DIM1 = 8; // We will read dataset back from the file... const int MSPACE_DIM2 = 12; // ...to the dataset in memory with these ... // ...dataspace parameters @@ -90,12 +90,12 @@ int main (void) /* * Create dataset and write it into the file. */ - DataSet* dataset = new DataSet( + DataSet* dataset = new DataSet( file->createDataSet( DATASET_NAME, PredType::NATIVE_INT, fspace )); dataset->write( matrix, PredType::NATIVE_INT ); /* - * Select hyperslab for the dataset in the file, using 3x2 blocks, + * Select hyperslab for the dataset in the file, using 3x2 blocks, * (4,3) stride and (2,4) count starting at the position (0,1). */ hsize_t start[2]; // Start of hyperslab @@ -104,20 +104,20 @@ int main (void) hsize_t block[2]; // Block sizes start[0] = 0; start[1] = 1; stride[0] = 4; stride[1] = 3; - count[0] = 2; count[1] = 4; + count[0] = 2; count[1] = 4; block[0] = 3; block[1] = 2; fspace.selectHyperslab( H5S_SELECT_SET, count, start, stride, block); /* * Create dataspace for the first dataset. */ - hsize_t dim1[] = {MSPACE1_DIM}; /* Dimension size of the first dataset - (in memory) */ + hsize_t dim1[] = {MSPACE1_DIM}; /* Dimension size of the first dataset + (in memory) */ DataSpace mspace1( MSPACE1_RANK, dim1 ); /* - * Select hyperslab. - * We will use 48 elements of the vector buffer starting at the + * Select hyperslab. + * We will use 48 elements of the vector buffer starting at the * second element. Selected elements are 1 2 3 . . . 48 */ start[0] = 1; @@ -125,12 +125,12 @@ int main (void) count[0] = 48; block[0] = 1; mspace1.selectHyperslab( H5S_SELECT_SET, count, start, stride, block); - + /* * Write selection from the vector buffer to the dataset in the file. * - * File dataset should look like this: - * 0 1 2 0 3 4 0 5 6 0 7 8 + * File dataset should look like this: + * 0 1 2 0 3 4 0 5 6 0 7 8 * 0 9 10 0 11 12 0 13 14 0 15 16 * 0 17 18 0 19 20 0 21 22 0 23 24 * 0 0 0 0 0 0 0 0 0 0 0 0 @@ -150,14 +150,14 @@ int main (void) * Create dataspace for the second dataset. */ hsize_t dim2[] = {MSPACE2_DIM}; /* Dimension size of the second dataset - (in memory */ + (in memory */ DataSpace mspace2( MSPACE2_RANK, dim2 ); /* * Select sequence of NPOINTS points in the file dataspace. */ - hsize_t coord[NPOINTS][FSPACE_RANK]; /* Array to store selected points - from the file dataspace */ + hsize_t coord[NPOINTS][FSPACE_RANK]; /* Array to store selected points + from the file dataspace */ coord[0][0] = 0; coord[0][1] = 0; coord[1][0] = 3; coord[1][1] = 3; coord[2][0] = 3; coord[2][1] = 5; @@ -169,11 +169,11 @@ int main (void) * Write new selection of points to the dataset. */ int values[] = {53, 59, 61, 67}; /* New values to be written */ - dataset->write( values, PredType::NATIVE_INT, mspace2, fspace ); + dataset->write( values, PredType::NATIVE_INT, mspace2, fspace ); /* - * File dataset should look like this: - * 53 1 2 0 3 4 0 5 6 0 7 8 + * File dataset should look like this: + * 53 1 2 0 3 4 0 5 6 0 7 8 * 0 9 10 0 11 12 0 13 14 0 15 16 * 0 17 18 0 19 20 0 21 22 0 23 24 * 0 0 0 59 0 61 0 0 0 0 0 0 @@ -181,7 +181,7 @@ int main (void) * 0 33 34 0 35 36 67 37 38 0 39 40 * 0 41 42 0 43 44 0 45 46 0 47 48 * 0 0 0 0 0 0 0 0 0 0 0 0 - * + * */ /* diff --git a/c++/src/H5AbstractDs.cpp b/c++/src/H5AbstractDs.cpp index 5c0fa6b..2b9d6f6 100644 --- a/c++/src/H5AbstractDs.cpp +++ b/c++/src/H5AbstractDs.cpp @@ -51,7 +51,7 @@ AbstractDs::AbstractDs( const AbstractDs& original ) : H5Object( original ) {} //-------------------------------------------------------------------------- // Function: AbstractDs::getTypeClass -///\brief Returns the class of the datatype that is used by this +///\brief Returns the class of the datatype that is used by this /// object, which can be a dataset or an attribute. ///\return Datatype class identifier ///\exception H5::DataTypeIException @@ -60,7 +60,7 @@ AbstractDs::AbstractDs( const AbstractDs& original ) : H5Object( original ) {} H5T_class_t AbstractDs::getTypeClass() const { // Gets the datatype used by this dataset or attribute. - // p_get_type calls either H5Dget_type or H5Aget_type depending on + // p_get_type calls either H5Dget_type or H5Aget_type depending on // which object invokes getTypeClass DataType datatype(p_get_type()); @@ -70,7 +70,7 @@ H5T_class_t AbstractDs::getTypeClass() const return( type_class ); else { - throw DataTypeIException("AbstractDs::getTypeClass", + throw DataTypeIException("AbstractDs::getTypeClass", "H5Tget_class returns H5T_NO_CLASS"); } } @@ -86,7 +86,7 @@ H5T_class_t AbstractDs::getTypeClass() const DataType AbstractDs::getDataType() const { // Gets the id of the datatype used by this dataset or attribute. - // p_get_type calls either H5Dget_type or H5Aget_type depending on + // p_get_type calls either H5Dget_type or H5Aget_type depending on // which object invokes getTypeClass hid_t datatype_id = p_get_type(); // returned value is already validated @@ -97,7 +97,7 @@ DataType AbstractDs::getDataType() const //-------------------------------------------------------------------------- // Function: AbstractDs::getArrayType -///\brief Returns the compound datatype of this abstract dataset which +///\brief Returns the compound datatype of this abstract dataset which /// can be a dataset or an attribute. ///\return ArrayType instance ///\exception H5::DataTypeIException @@ -111,7 +111,7 @@ ArrayType AbstractDs::getArrayType() const //-------------------------------------------------------------------------- // Function: AbstractDs::getCompType -///\brief Returns the compound datatype of this abstract dataset which +///\brief Returns the compound datatype of this abstract dataset which /// can be a dataset or an attribute. ///\return CompType instance ///\exception H5::DataTypeIException @@ -125,7 +125,7 @@ CompType AbstractDs::getCompType() const //-------------------------------------------------------------------------- // Function: AbstractDs::getEnumType -///\brief Returns the enumeration datatype of this abstract dataset which +///\brief Returns the enumeration datatype of this abstract dataset which /// can be a dataset or an attribute. ///\return EnumType instance ///\exception H5::DataTypeIException @@ -153,7 +153,7 @@ FloatType AbstractDs::getFloatType() const //-------------------------------------------------------------------------- // Function: AbstractDs::getIntType -///\brief Returns the integer datatype of this abstract dataset which +///\brief Returns the integer datatype of this abstract dataset which /// can be a dataset or an attribute. ///\return IntType instance ///\exception H5::DataTypeIException @@ -167,7 +167,7 @@ IntType AbstractDs::getIntType() const //-------------------------------------------------------------------------- // Function: AbstractDs::getStrType -///\brief Returns the string datatype of this abstract dataset which +///\brief Returns the string datatype of this abstract dataset which /// can be a dataset or an attribute. ///\return StrType instance ///\exception H5::DataTypeIException diff --git a/c++/src/H5AbstractDs.h b/c++/src/H5AbstractDs.h index b1b422c..a4af13b 100644 --- a/c++/src/H5AbstractDs.h +++ b/c++/src/H5AbstractDs.h @@ -34,9 +34,9 @@ class VarLenType; class H5_DLLCPP AbstractDs : public H5Object { public: // Gets a copy the datatype of that this abstract dataset uses. - // Note that this datatype is a generic one and can only be accessed - // via generic member functions, i.e., member functions belong - // to DataType. To get specific datatype, i.e. EnumType, FloatType, + // Note that this datatype is a generic one and can only be accessed + // via generic member functions, i.e., member functions belong + // to DataType. To get specific datatype, i.e. EnumType, FloatType, // etc..., use the specific functions, that follow, instead . DataType getDataType() const; @@ -52,8 +52,8 @@ class H5_DLLCPP AbstractDs : public H5Object { // Gets the dataspace of this abstract dataset - pure virtual virtual DataSpace getSpace() const = 0; - // Gets the class of the datatype that is used by this abstract - // dataset + // Gets the class of the datatype that is used by this abstract + // dataset H5T_class_t getTypeClass() const; // Returns the amount of storage size required for this abstract @@ -63,7 +63,7 @@ class H5_DLLCPP AbstractDs : public H5Object { // Copy constructor AbstractDs( const AbstractDs& original ); - virtual ~AbstractDs(); + virtual ~AbstractDs(); protected: // Default constructor diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp index 3db7a4b..c84d6ec 100644 --- a/c++/src/H5ArrayType.cpp +++ b/c++/src/H5ArrayType.cpp @@ -33,11 +33,11 @@ namespace H5 { ///\brief Default constructor: Creates a stub ArrayType // Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- -ArrayType::ArrayType() : DataType() +ArrayType::ArrayType() : DataType() { // Initialize members rank = -1; - dimensions = NULL; + dimensions = NULL; } //-------------------------------------------------------------------------- @@ -47,7 +47,7 @@ ArrayType::ArrayType() : DataType() ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- -ArrayType::ArrayType( const hid_t existing_id ) : DataType( existing_id ) +ArrayType::ArrayType( const hid_t existing_id ) : DataType( existing_id ) { // Get the rank of the existing array and store it in this array rank = H5Tget_array_ndims(existing_id); @@ -71,17 +71,17 @@ ArrayType::ArrayType( const hid_t existing_id ) : DataType( existing_id ) ///\brief Copy constructor: makes a copy of the original ArrayType object. // Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- -ArrayType::ArrayType( const ArrayType& original ) : DataType( original ) +ArrayType::ArrayType( const ArrayType& original ) : DataType( original ) { rank = original.rank; dimensions = new hsize_t[rank]; for (int i = 0; i < rank; i++) - dimensions[i] = original.dimensions[i]; + dimensions[i] = original.dimensions[i]; } //-------------------------------------------------------------------------- // Function: ArrayType overloaded constructor -///\brief Creates a new array data type based on the specified +///\brief Creates a new array data type based on the specified /// \a base_type. ///\param base_type - IN: Existing datatype ///\param ndims - IN: Rank of the array, [0..H5S_MAX_RANK] @@ -100,7 +100,7 @@ ArrayType::ArrayType(const DataType& base_type, int ndims, const hsize_t* dims) rank = ndims; dimensions = new hsize_t[rank]; for (int i = 0; i < rank; i++) - dimensions[i] = dims[i]; + dimensions[i] = dims[i]; } //-------------------------------------------------------------------------- @@ -147,11 +147,11 @@ int ArrayType::getArrayDims(hsize_t* dims) rank = ndims; dimensions = new hsize_t[rank]; for (int i = 0; i < rank; i++) - dimensions[i] = dims[i]; + dimensions[i] = dims[i]; } // otherwise, simply copy what's in 'dimensions' to 'dims' for (int i = 0; i < rank; i++) - dims[i] = dimensions[i]; + dims[i] = dimensions[i]; return(rank); } @@ -160,7 +160,7 @@ int ArrayType::getArrayDims(hsize_t* dims) ///\brief Properly terminates access to this array datatype. // Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- -ArrayType::~ArrayType() +ArrayType::~ArrayType() { // Free allocated memory if (dimensions != NULL) diff --git a/c++/src/H5ArrayType.h b/c++/src/H5ArrayType.h index 3f1ddc5..302dc9a 100644 --- a/c++/src/H5ArrayType.h +++ b/c++/src/H5ArrayType.h @@ -24,7 +24,7 @@ namespace H5 { #endif class H5_DLLCPP ArrayType : public DataType { public: - // Constructor that creates a new array data type based on the + // Constructor that creates a new array data type based on the // specified base type. ArrayType(const DataType& base_type, int ndims, const hsize_t* dims); diff --git a/c++/src/H5AtomType.cpp b/c++/src/H5AtomType.cpp index 97a8692..2451b30 100644 --- a/c++/src/H5AtomType.cpp +++ b/c++/src/H5AtomType.cpp @@ -55,7 +55,7 @@ AtomType::AtomType( const AtomType& original ) : DataType( original ) {} //-------------------------------------------------------------------------- // Function: AtomType::setSize -///\brief Sets the total size for an atomic datatype. +///\brief Sets the total size for an atomic datatype. ///\param size - IN: Size to set ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 @@ -148,12 +148,12 @@ void AtomType::setOrder( H5T_order_t order ) const //-------------------------------------------------------------------------- // Function: AtomType::getPrecision -///\brief Returns the precision of an atomic datatype. -///\return Number of significant bits +///\brief Returns the precision of an atomic datatype. +///\return Number of significant bits ///\exception H5::DataTypeIException ///\par Description -/// The precision is the number of significant bits which, -/// unless padding is present, is 8 times larger than the +/// The precision is the number of significant bits which, +/// unless padding is present, is 8 times larger than the /// value returned by \c DataType::getSize(). // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -172,7 +172,7 @@ size_t AtomType::getPrecision() const //-------------------------------------------------------------------------- // Function: AtomType::setPrecision -///\brief Sets the precision of an atomic datatype. +///\brief Sets the precision of an atomic datatype. ///\param precision - IN: Number of bits of precision ///\exception H5::DataTypeIException ///\par Description @@ -192,7 +192,7 @@ void AtomType::setPrecision( size_t precision ) const //-------------------------------------------------------------------------- // Function: AtomType::getOffset -///\brief Retrieves the bit offset of the first significant bit. +///\brief Retrieves the bit offset of the first significant bit. ///\return Offset value ///\exception H5::DataTypeIException ///\par Description @@ -219,7 +219,7 @@ int AtomType::getOffset() const //-------------------------------------------------------------------------- // Function: AtomType::setOffset -///\brief Sets the bit offset of the first significant bit. +///\brief Sets the bit offset of the first significant bit. ///\param offset - IN: Offset of first significant bit ///\exception H5::DataTypeIException ///\par Description @@ -239,16 +239,16 @@ void AtomType::setOffset( size_t offset ) const //-------------------------------------------------------------------------- // Function: AtomType::getPad -///\brief Retrieves the padding type of the least and most-significant -/// bit padding. +///\brief Retrieves the padding type of the least and most-significant +/// bit padding. ///\param lsb - OUT: Least-significant bit padding type ///\param msb - OUT: Most-significant bit padding type ///\exception H5::DataTypeIException ///\par Description /// Possible values for \a lsb and \a msb include: -/// \li \c H5T_PAD_ZERO (0) - Set background to zeros. -/// \li \c H5T_PAD_ONE (1) - Set background to ones. -/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone. +/// \li \c H5T_PAD_ZERO (0) - Set background to zeros. +/// \li \c H5T_PAD_ONE (1) - Set background to ones. +/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void AtomType::getPad( H5T_pad_t& lsb, H5T_pad_t& msb ) const @@ -269,9 +269,9 @@ void AtomType::getPad( H5T_pad_t& lsb, H5T_pad_t& msb ) const ///\exception H5::DataTypeIException ///\par Description /// Valid values for \a lsb and \a msb include: -/// \li \c H5T_PAD_ZERO (0) - Set background to zeros. -/// \li \c H5T_PAD_ONE (1) - Set background to ones. -/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone. +/// \li \c H5T_PAD_ZERO (0) - Set background to zeros. +/// \li \c H5T_PAD_ONE (1) - Set background to ones. +/// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void AtomType::setPad( H5T_pad_t lsb, H5T_pad_t msb ) const diff --git a/c++/src/H5AtomType.h b/c++/src/H5AtomType.h index f9b43c4..5f045ec 100644 --- a/c++/src/H5AtomType.h +++ b/c++/src/H5AtomType.h @@ -26,33 +26,33 @@ namespace H5 { #endif class H5_DLLCPP AtomType : public DataType { public: - // Returns the byte order of an atomic datatype. + // Returns the byte order of an atomic datatype. H5T_order_t getOrder( string& order_string ) const; H5T_order_t getOrder() const; - // Sets the byte ordering of an atomic datatype. + // Sets the byte ordering of an atomic datatype. void setOrder( H5T_order_t order ) const; - // Retrieves the bit offset of the first significant bit. + // Retrieves the bit offset of the first significant bit. // 12/05/00 - changed return type to int from size_t - C API int getOffset() const; - // Sets the bit offset of the first significant bit. + // Sets the bit offset of the first significant bit. void setOffset( size_t offset ) const; - // Retrieves the padding type of the least and most-significant bit padding. + // Retrieves the padding type of the least and most-significant bit padding. void getPad( H5T_pad_t& lsb, H5T_pad_t& msb ) const; // Sets the least and most-significant bits padding types void setPad( H5T_pad_t lsb, H5T_pad_t msb ) const; - // Returns the precision of an atomic datatype. + // Returns the precision of an atomic datatype. size_t getPrecision() const; - // Sets the precision of an atomic datatype. + // Sets the precision of an atomic datatype. void setPrecision( size_t precision ) const; - // Sets the total size for an atomic datatype. + // Sets the total size for an atomic datatype. void setSize( size_t size ) const; // Copy constructor - makes copy of the original object diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index cd6e737..8ca779b 100644 --- a/c++/src/H5Attribute.cpp +++ b/c++/src/H5Attribute.cpp @@ -52,7 +52,7 @@ Attribute::Attribute( const Attribute& original ) : AbstractDs( original ) {} //-------------------------------------------------------------------------- // Function: Attribute overloaded constructor -///\brief Creates an Attribute object using the id of an existing +///\brief Creates an Attribute object using the id of an existing /// attribute. ///\param existing_id - IN: Id of an existing attribute ///\exception H5::AttributeIException @@ -203,7 +203,7 @@ ssize_t Attribute::getName( size_t buf_size, string& attr_name ) const { throw AttributeIException("Attribute::getName", "H5Aget_name failed"); } - // otherwise, convert the C attribute name and return + // otherwise, convert the C attribute name and return attr_name = name_C; delete []name_C; return( name_size ); @@ -212,7 +212,7 @@ ssize_t Attribute::getName( size_t buf_size, string& attr_name ) const //-------------------------------------------------------------------------- // Function: Attribute::getName ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it returns the +/// It differs from the above function in that it returns the /// attribute's name, not the length. ///\return Name of the attribute ///\param buf_size - IN: Desired length of the name @@ -223,7 +223,7 @@ string Attribute::getName( size_t buf_size ) const { string attr_name; ssize_t name_size = getName( buf_size, attr_name ); - return( attr_name ); + return( attr_name ); // let caller catch exception if any } @@ -238,8 +238,8 @@ string Attribute::getName( size_t buf_size ) const //-------------------------------------------------------------------------- string Attribute::getName() const { - // Try with 256 characters for the name first, if the name's length - // returned is more than that then, read the name again with the + // Try with 256 characters for the name first, if the name's length + // returned is more than that then, read the name again with the // appropriate space allocation char* name_C = new char[256]; // temporary C-string for C API ssize_t name_size = H5Aget_name(id, 255, name_C); @@ -248,12 +248,12 @@ string Attribute::getName() const if (name_size >= 256) name_size = getName(name_size, attr_name); - // otherwise, convert the C attribute name and return + // otherwise, convert the C attribute name and return else attr_name = name_C; delete []name_C; - return( attr_name ); + return( attr_name ); } //-------------------------------------------------------------------------- diff --git a/c++/src/H5Attribute.h b/c++/src/H5Attribute.h index 87b2253..60ba825 100644 --- a/c++/src/H5Attribute.h +++ b/c++/src/H5Attribute.h @@ -57,9 +57,9 @@ class H5_DLLCPP Attribute : public AbstractDs { virtual ~Attribute(); private: - // This function contains the common code that is used by - // getTypeClass and various API functions getXxxType - // defined in AbstractDs for generic datatype and specific + // This function contains the common code that is used by + // getTypeClass and various API functions getXxxType + // defined in AbstractDs for generic datatype and specific // sub-types virtual hid_t p_get_type() const; diff --git a/c++/src/H5CommonFG.cpp b/c++/src/H5CommonFG.cpp index e9ec03f..2636e3a 100644 --- a/c++/src/H5CommonFG.cpp +++ b/c++/src/H5CommonFG.cpp @@ -50,10 +50,10 @@ namespace H5 { //-------------------------------------------------------------------------- // Function: CommonFG::createGroup -///\brief Creates a new group at this location which can be a file +///\brief Creates a new group at this location which can be a file /// or another group. ///\param name - IN: Name of the group to create -///\param size_hint - IN: Indicates the number of bytes to reserve for +///\param size_hint - IN: Indicates the number of bytes to reserve for /// the names that will appear in the group ///\return Group instance ///\exception H5::FileIException or H5::GroupIException @@ -66,7 +66,7 @@ namespace H5 { //-------------------------------------------------------------------------- Group CommonFG::createGroup( const char* name, size_t size_hint ) const { - // Call C routine H5Gcreate to create the named group, giving the + // Call C routine H5Gcreate to create the named group, giving the // location id which can be a file id or a group id hid_t group_id = H5Gcreate( getLocId(), name, size_hint ); @@ -84,7 +84,7 @@ Group CommonFG::createGroup( const char* name, size_t size_hint ) const //-------------------------------------------------------------------------- // Function: CommonFG::createGroup ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -95,7 +95,7 @@ Group CommonFG::createGroup( const string& name, size_t size_hint ) const //-------------------------------------------------------------------------- // Function: CommonFG::openGroup -///\brief Opens an existing group in a location which can be a file +///\brief Opens an existing group in a location which can be a file /// or another group. ///\param name - IN: Name of the group to open ///\return Group instance @@ -104,11 +104,11 @@ Group CommonFG::createGroup( const string& name, size_t size_hint ) const //-------------------------------------------------------------------------- Group CommonFG::openGroup( const char* name ) const { - // Call C routine H5Gopen to open the named group, giving the + // Call C routine H5Gopen to open the named group, giving the // location id which can be a file id or a group id hid_t group_id = H5Gopen( getLocId(), name ); - // If the opening of the group failed, throw an exception + // If the opening of the group failed, throw an exception if( group_id < 0 ) { throwException("openGroup", "H5Gopen failed"); @@ -122,7 +122,7 @@ Group CommonFG::openGroup( const char* name ) const //-------------------------------------------------------------------------- // Function: CommonFG::openGroup ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -152,7 +152,7 @@ DataSet CommonFG::createDataSet( const char* name, const DataType& data_type, co // Call C routine H5Dcreate to create the named dataset hid_t dataset_id = H5Dcreate( getLocId(), name, type_id, space_id, create_plist_id ); - // If the creation of the dataset failed, throw an exception + // If the creation of the dataset failed, throw an exception if( dataset_id < 0 ) { throwException("createDataSet", "H5Dcreate failed"); @@ -166,7 +166,7 @@ DataSet CommonFG::createDataSet( const char* name, const DataType& data_type, co //-------------------------------------------------------------------------- // Function: CommonFG::createDataSet ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -186,7 +186,7 @@ DataSet CommonFG::createDataSet( const string& name, const DataType& data_type, DataSet CommonFG::openDataSet( const char* name ) const { // Call C function H5Dopen to open the specified dataset, giving - // the location id and the dataset's name + // the location id and the dataset's name hid_t dataset_id = H5Dopen( getLocId(), name ); // If the dataset's opening failed, throw an exception @@ -203,7 +203,7 @@ DataSet CommonFG::openDataSet( const char* name ) const //-------------------------------------------------------------------------- // Function: CommonFG::openDataSet ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -214,17 +214,17 @@ DataSet CommonFG::openDataSet( const string& name ) const //-------------------------------------------------------------------------- // Function: CommonFG::link -///\brief Creates a link of the specified type from \a new_name to +///\brief Creates a link of the specified type from \a new_name to /// \a curr_name. -///\param link_type - IN: Link type; possible values are +///\param link_type - IN: Link type; possible values are /// \li \c H5G_LINK_HARD /// \li \c H5G_LINK_SOFT -///\param curr_name - IN: Name of the existing object if link is a hard +///\param curr_name - IN: Name of the existing object if link is a hard /// link; can be anything for the soft link ///\param new_name - IN: New name for the object ///\exception H5::FileIException or H5::GroupIException ///\par Description -/// Note that both names are interpreted relative to the +/// Note that both names are interpreted relative to the /// specified location. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -240,7 +240,7 @@ void CommonFG::link( H5G_link_t link_type, const char* curr_name, const char* ne //-------------------------------------------------------------------------- // Function: CommonFG::link ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a curr_name and \a new_name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -268,7 +268,7 @@ void CommonFG::unlink( const char* name ) const //-------------------------------------------------------------------------- // Function: CommonFG::unlink ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -297,7 +297,7 @@ void CommonFG::move( const char* src, const char* dst ) const //-------------------------------------------------------------------------- // Function: CommonFG::move ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a src and \a dst. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -327,7 +327,7 @@ void CommonFG::getObjinfo( const char* name, hbool_t follow_link, H5G_stat_t& st //-------------------------------------------------------------------------- // Function: CommonFG::getObjinfo ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -339,7 +339,7 @@ void CommonFG::getObjinfo( const string& name, hbool_t follow_link, H5G_stat_t& //-------------------------------------------------------------------------- // Function: CommonFG::getLinkval ///\brief Returns the name of the object that the symbolic link points to. -///\param name - IN: Symbolic link to the object +///\param name - IN: Symbolic link to the object ///\param size - IN: Maximum number of characters of value to be returned ///\return Name of the object ///\exception H5::FileIException or H5::GroupIException @@ -362,7 +362,7 @@ string CommonFG::getLinkval( const char* name, size_t size ) const //-------------------------------------------------------------------------- // Function: CommonFG::getLinkval ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -378,11 +378,11 @@ string CommonFG::getLinkval( const string& name, size_t size ) const ///\param comment - IN: New comment ///\exception H5::FileIException or H5::GroupIException ///\par Description -/// If \a comment is an empty string or a null pointer, the comment -/// message is removed from the object. -/// Comments should be relatively short, null-terminated, ASCII -/// strings. They can be attached to any object that has an -/// object header, e.g., data sets, groups, named data types, +/// If \a comment is an empty string or a null pointer, the comment +/// message is removed from the object. +/// Comments should be relatively short, null-terminated, ASCII +/// strings. They can be attached to any object that has an +/// object header, e.g., data sets, groups, named data types, /// and data spaces, but not symbolic links. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -398,7 +398,7 @@ void CommonFG::setComment( const char* name, const char* comment ) const //-------------------------------------------------------------------------- // Function: CommonFG::setComment ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name and \a comment. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -486,7 +486,7 @@ string CommonFG::getComment (const string& name) const string CommonFG::getComment( const char* name, size_t bufsize ) const { // temporary C-string for the object's comment - char* comment_C = new char[bufsize+1]; + char* comment_C = new char[bufsize+1]; herr_t ret_value = H5Gget_comment( getLocId(), name, bufsize, comment_C ); @@ -503,7 +503,7 @@ string CommonFG::getComment( const char* name, size_t bufsize ) const //-------------------------------------------------------------------------- // Function: CommonFG::getComment ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -540,7 +540,7 @@ void CommonFG::mount( const char* name, H5File& child, PropList& plist ) const //-------------------------------------------------------------------------- // Function: CommonFG::mount ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -571,7 +571,7 @@ void CommonFG::unmount( const char* name ) const //-------------------------------------------------------------------------- // Function: CommonFG::unmount ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -592,20 +592,20 @@ void CommonFG::unmount( const string& name ) const // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- hid_t CommonFG::p_open_data_type( const char* name ) const -{ +{ // Call C function H5Topen to open the named datatype in this group, - // giving either the file or group id + // giving either the file or group id hid_t datatype_id = H5Topen( getLocId(), name ); - + // If the datatype's opening failed, throw an exception - if( datatype_id < 0 ) - { + if( datatype_id < 0 ) + { throwException("openDataType", "H5Topen failed"); - } + } // No failure, return the datatype id return( datatype_id ); -} +} // // The following member functions use the private function @@ -629,7 +629,7 @@ DataType CommonFG::openDataType( const char* name ) const //-------------------------------------------------------------------------- // Function: CommonFG::openDataType ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -681,7 +681,7 @@ CompType CommonFG::openCompType( const char* name ) const //-------------------------------------------------------------------------- // Function: CommonFG::openCompType ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -702,19 +702,19 @@ EnumType CommonFG::openEnumType( const char* name ) const { EnumType enum_type(p_open_data_type(name)); return(enum_type); -} +} //-------------------------------------------------------------------------- // Function: CommonFG::openEnumType ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- EnumType CommonFG::openEnumType( const string& name ) const { return( openEnumType( name.c_str()) ); -} +} //-------------------------------------------------------------------------- // Function: CommonFG::openIntType @@ -725,7 +725,7 @@ EnumType CommonFG::openEnumType( const string& name ) const // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IntType CommonFG::openIntType( const char* name ) const -{ +{ IntType int_type(p_open_data_type(name)); return(int_type); } @@ -733,12 +733,12 @@ IntType CommonFG::openIntType( const char* name ) const //-------------------------------------------------------------------------- // Function: CommonFG::openIntType ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IntType CommonFG::openIntType( const string& name ) const -{ +{ return( openIntType( name.c_str()) ); } @@ -751,7 +751,7 @@ IntType CommonFG::openIntType( const string& name ) const // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FloatType CommonFG::openFloatType( const char* name ) const -{ +{ FloatType float_type(p_open_data_type(name)); return(float_type); } @@ -759,12 +759,12 @@ FloatType CommonFG::openFloatType( const char* name ) const //-------------------------------------------------------------------------- // Function: CommonFG::openFloatType ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FloatType CommonFG::openFloatType( const string& name ) const -{ +{ return( openFloatType( name.c_str()) ); } @@ -785,7 +785,7 @@ StrType CommonFG::openStrType( const char* name ) const //-------------------------------------------------------------------------- // Function: CommonFG::openStrType ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -827,8 +827,8 @@ VarLenType CommonFG::openVarLenType( const string& name ) const ///\param idx - IN/OUT: Starting (IN) and ending (OUT) entry indices ///\param op - IN : User's function to operate on each entry ///\param op_data - IN/OUT: Data associated with the operation -///\return The return value of the first operator that returns non-zero, -/// or zero if all members were processed with no operator +///\return The return value of the first operator that returns non-zero, +/// or zero if all members were processed with no operator /// returning non-zero. ///\exception H5::FileIException or H5::GroupIException // Programmer Binh-Minh Ribler - 2000 @@ -846,7 +846,7 @@ int CommonFG::iterateElems( const char* name, int *idx, H5G_iterate_t op , void* //-------------------------------------------------------------------------- // Function: CommonFG::iterateElems ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes an +/// It differs from the above function in that it takes an /// \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- diff --git a/c++/src/H5CommonFG.h b/c++/src/H5CommonFG.h index 1ad18f2..7a32547 100644 --- a/c++/src/H5CommonFG.h +++ b/c++/src/H5CommonFG.h @@ -30,12 +30,12 @@ class ArrayType; class VarLenType; class H5_DLLCPP CommonFG { public: - // Creates a new group at this location which can be a file + // Creates a new group at this location which can be a file // or another group. Group createGroup(const char* name, size_t size_hint = 0) const; Group createGroup(const string& name, size_t size_hint = 0) const; - // Opens an existing group in a location which can be a file + // Opens an existing group in a location which can be a file // or another group. Group openGroup(const char* name) const; Group openGroup(const string& name) const; @@ -68,7 +68,7 @@ class H5_DLLCPP CommonFG { // Returns the number of objects in this group. hsize_t getNumObjs() const; - // Returns information about an HDF5 object, given by its name, + // Returns information about an HDF5 object, given by its name, // at this location. void getObjinfo(const char* name, hbool_t follow_link, H5G_stat_t& statbuf) const; void getObjinfo(const string& name, hbool_t follow_link, H5G_stat_t& statbuf) const; @@ -141,9 +141,9 @@ class H5_DLLCPP CommonFG { VarLenType openVarLenType(const char* name) const; VarLenType openVarLenType(const string& name) const; - /// For subclasses, H5File and Group, to return the correct + /// For subclasses, H5File and Group, to return the correct /// object id, i.e. file or group id. - virtual hid_t getLocId() const = 0; + virtual hid_t getLocId() const = 0; /// For subclasses, H5File and Group, to throw appropriate exception. virtual void throwException(const string func_name, const string msg) const = 0; @@ -155,7 +155,7 @@ class H5_DLLCPP CommonFG { virtual ~CommonFG(); private: - // Common code for member functions openXxxType + // Common code for member functions openXxxType hid_t p_open_data_type(const char* name) const; }; // end of CommonFG declaration diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp index db4fe9e..447c512 100644 --- a/c++/src/H5CompType.cpp +++ b/c++/src/H5CompType.cpp @@ -89,7 +89,7 @@ CompType::CompType( const DataSet& dataset ) : DataType() //-------------------------------------------------------------------------- // Function: CompType::getNmembers -///\brief Returns the number of members in this compound datatype. +///\brief Returns the number of members in this compound datatype. ///\return Number of members ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 @@ -99,7 +99,7 @@ int CompType::getNmembers() const int num_members = H5Tget_nmembers( id ); if( num_members < 0 ) { - throw DataTypeIException("CompType::getNmembers", + throw DataTypeIException("CompType::getNmembers", "H5Tget_nmembers returns negative number of members"); } return( num_members ); @@ -107,7 +107,7 @@ int CompType::getNmembers() const //-------------------------------------------------------------------------- // Function: CompType::getMemberName -///\brief Returns the name of a member in this compound datatype. +///\brief Returns the name of a member in this compound datatype. ///\param member_num - IN: Zero-based index of the member ///\return Name of member ///\exception H5::DataTypeIException @@ -118,23 +118,23 @@ string CompType::getMemberName( unsigned member_num ) const char* member_name_C = H5Tget_member_name( id, member_num ); if( member_name_C == NULL ) // NULL means failure { - throw DataTypeIException("CompType::getMemberName", + throw DataTypeIException("CompType::getMemberName", "H5Tget_member_name returns NULL for member name"); } - string member_name = string(member_name_C); // convert C string to string - HDfree(member_name_C); // free the C string + string member_name = string(member_name_C); // convert C string to string + HDfree(member_name_C); // free the C string return( member_name ); // return the member name string } //-------------------------------------------------------------------------- // Function: CompType::getMemberIndex -///\brief Returns the index of a member in this compound datatype. +///\brief Returns the index of a member in this compound datatype. ///\param name - IN: Name of the member ///\return Index of member ///\exception H5::DataTypeIException ///\par Description -/// Members are stored in no particular order with numbers 0 -/// through N-1, where N is the value returned by the member +/// Members are stored in no particular order with numbers 0 +/// through N-1, where N is the value returned by the member /// function \c CompType::getNmembers. // Programmer Binh-Minh Ribler - May 16, 2002 //-------------------------------------------------------------------------- @@ -143,7 +143,7 @@ int CompType::getMemberIndex(const char* name) const int member_index = H5Tget_member_index(id, name); if( member_index < 0 ) { - throw DataTypeIException("CompType::getMemberIndex", + throw DataTypeIException("CompType::getMemberIndex", "H5Tget_member_index returns negative value"); } return( member_index ); @@ -162,8 +162,8 @@ int CompType::getMemberIndex(const string& name) const ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 // Description -/// Members are stored in no particular order with numbers 0 -/// through N-1, where N is the value returned by the member +/// Members are stored in no particular order with numbers 0 +/// through N-1, where N is the value returned by the member /// function \c CompType::getNmembers. // // Note that byte offset being returned as 0 doesn't indicate @@ -175,11 +175,11 @@ size_t CompType::getMemberOffset( unsigned member_num ) const return( offset ); } -// Returns the dimensionality of the member. +// Returns the dimensionality of the member. int CompType::getMemberDims( unsigned member_num, size_t* dims, int* perm ) const { throw DataTypeIException( "Error: getMemberDims is no longer supported." ); - return (-1); // unreachable statement; but without it, the compiler + return (-1); // unreachable statement; but without it, the compiler // will complain } @@ -198,13 +198,13 @@ H5T_class_t CompType::getMemberClass( unsigned member_num ) const H5T_class_t member_class = H5Tget_member_class(id, member_num); if( member_class == H5T_NO_CLASS ) { - throw DataTypeIException("CompType::getMemberClass", + throw DataTypeIException("CompType::getMemberClass", "H5Tget_member_class returns H5T_NO_CLASS"); } return(member_class); } -// This private member function calls the C API to get the identifier +// This private member function calls the C API to get the identifier // of the specified member. It provides the id to construct appropriate // sub-types in the functions getMemberXxxType below, where Xxx indicates // the sub-types. @@ -217,15 +217,15 @@ hid_t CompType::p_get_member_type(unsigned member_num) const else { // p_get_member_type is private, use caller's function name for api - throw DataTypeIException("CompType::p_get_member_type", + throw DataTypeIException("CompType::p_get_member_type", "H5Tget_member_type failed"); } } //-------------------------------------------------------------------------- // Function: CompType::getMemberDataType -///\brief Returns the generic datatype of the specified member in this -/// compound datatype. +///\brief Returns the generic datatype of the specified member in this +/// compound datatype. ///\param member_num - IN: Zero-based index of the member ///\return DataType instance ///\exception H5::DataTypeIException @@ -233,7 +233,7 @@ hid_t CompType::p_get_member_type(unsigned member_num) const //-------------------------------------------------------------------------- DataType CompType::getMemberDataType( unsigned member_num ) const { - DataType datatype(p_get_member_type(member_num)); + DataType datatype(p_get_member_type(member_num)); return(datatype); } @@ -254,8 +254,8 @@ ArrayType CompType::getMemberArrayType( unsigned member_num ) const //-------------------------------------------------------------------------- // Function: CompType::getMemberCompType -///\brief Returns the compound datatype of the specified member in this -/// compound datatype. +///\brief Returns the compound datatype of the specified member in this +/// compound datatype. ///\param member_num - IN: Zero-based index of the member ///\return CompType instance ///\exception H5::DataTypeIException @@ -263,14 +263,14 @@ ArrayType CompType::getMemberArrayType( unsigned member_num ) const //-------------------------------------------------------------------------- CompType CompType::getMemberCompType( unsigned member_num ) const { - CompType comptype(p_get_member_type(member_num)); + CompType comptype(p_get_member_type(member_num)); return(comptype); } //-------------------------------------------------------------------------- // Function: CompType::getMemberEnumType -///\brief Returns the enumeration datatype of the specified member in -/// this compound datatype. +///\brief Returns the enumeration datatype of the specified member in +/// this compound datatype. ///\param member_num - IN: Zero-based index of the member ///\return EnumType instance ///\exception H5::DataTypeIException @@ -278,14 +278,14 @@ CompType CompType::getMemberCompType( unsigned member_num ) const //-------------------------------------------------------------------------- EnumType CompType::getMemberEnumType( unsigned member_num ) const { - EnumType enumtype(p_get_member_type(member_num)); + EnumType enumtype(p_get_member_type(member_num)); return(enumtype); } //-------------------------------------------------------------------------- // Function: CompType::getMemberIntType -///\brief Returns the integer datatype of the specified member in this -/// compound datatype. +///\brief Returns the integer datatype of the specified member in this +/// compound datatype. ///\param member_num - IN: Zero-based index of the member ///\return IntType instance ///\exception H5::DataTypeIException @@ -293,14 +293,14 @@ EnumType CompType::getMemberEnumType( unsigned member_num ) const //-------------------------------------------------------------------------- IntType CompType::getMemberIntType( unsigned member_num ) const { - IntType inttype(p_get_member_type(member_num)); + IntType inttype(p_get_member_type(member_num)); return(inttype); } //-------------------------------------------------------------------------- // Function: CompType::getMemberFloatType -///\brief Returns the floating-point datatype of the specified member -/// in this compound datatype. +///\brief Returns the floating-point datatype of the specified member +/// in this compound datatype. ///\param member_num - IN: Zero-based index of the member ///\return FloatType instance ///\exception H5::DataTypeIException @@ -308,14 +308,14 @@ IntType CompType::getMemberIntType( unsigned member_num ) const //-------------------------------------------------------------------------- FloatType CompType::getMemberFloatType( unsigned member_num ) const { - FloatType floatype(p_get_member_type(member_num)); + FloatType floatype(p_get_member_type(member_num)); return(floatype); } //-------------------------------------------------------------------------- // Function: CompType::getMemberStrType -///\brief Returns the string datatype of the specified member in this -/// compound datatype. +///\brief Returns the string datatype of the specified member in this +/// compound datatype. ///\param member_num - IN: Zero-based index of the member ///\return StrType instance ///\exception H5::DataTypeIException @@ -323,9 +323,9 @@ FloatType CompType::getMemberFloatType( unsigned member_num ) const //-------------------------------------------------------------------------- StrType CompType::getMemberStrType( unsigned member_num ) const { - StrType strtype(p_get_member_type(member_num)); + StrType strtype(p_get_member_type(member_num)); return(strtype); -} +} //-------------------------------------------------------------------------- // Function: CompType::getMemberVarLenType @@ -342,35 +342,35 @@ VarLenType CompType::getMemberVarLenType( unsigned member_num ) const return(varlentype); } -/* old style of getMemberType - using overloads; new style above +/* old style of getMemberType - using overloads; new style above returns the appropriate datatypes but has different named functions. In the old style, a datatype must be passed into the function. May, 2004: These should be reconsidered to provide more convenience. -// Returns the datatype of the specified member in this compound datatype. +// Returns the datatype of the specified member in this compound datatype. // Several overloading of getMemberType are for different datatypes void CompType::getMemberType( unsigned member_num, EnumType& enumtype ) const { - p_get_member_type(member_num, enumtype); + p_get_member_type(member_num, enumtype); } void CompType::getMemberType( unsigned member_num, CompType& comptype ) const { - p_get_member_type(member_num, comptype); + p_get_member_type(member_num, comptype); } void CompType::getMemberType( unsigned member_num, IntType& inttype ) const { - p_get_member_type(member_num, inttype); + p_get_member_type(member_num, inttype); } void CompType::getMemberType( unsigned member_num, FloatType& floatype ) const { - p_get_member_type(member_num, floatype); + p_get_member_type(member_num, floatype); } void CompType::getMemberType( unsigned member_num, StrType& strtype ) const { - p_get_member_type(member_num, strtype); + p_get_member_type(member_num, strtype); } // end of overloading of getMemberType */ @@ -402,7 +402,7 @@ void CompType::insertMember( const string& name, size_t offset, const DataType& //-------------------------------------------------------------------------- // Function: CompType::pack -///\brief Recursively removes padding from within a compound datatype. +///\brief Recursively removes padding from within a compound datatype. /// ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 diff --git a/c++/src/H5CompType.h b/c++/src/H5CompType.h index 3dace19..72f5a37 100644 --- a/c++/src/H5CompType.h +++ b/c++/src/H5CompType.h @@ -36,58 +36,58 @@ class H5_DLLCPP CompType : public DataType { // to create another datatype of the same class H5T_class_t getMemberClass( unsigned member_num ) const; - // Returns the dimensionality of the specified member. + // Returns the dimensionality of the specified member. int getMemberDims( unsigned member_num, size_t* dims, int* perm ) const; // obsolete // Returns the index of a member in this compound data type. int getMemberIndex(const char* name) const; int getMemberIndex(const string& name) const; - // Returns the offset of a member of this compound datatype. + // Returns the offset of a member of this compound datatype. size_t getMemberOffset( unsigned memb_no ) const; - // Returns the name of a member of this compound datatype. + // Returns the name of a member of this compound datatype. string getMemberName( unsigned member_num ) const; - // Returns the generic datatype of the specified member in + // Returns the generic datatype of the specified member in // this compound datatype. DataType getMemberDataType( unsigned member_num ) const; - // Returns the compound datatype of the specified member in + // Returns the compound datatype of the specified member in // this compound datatype. ArrayType getMemberArrayType( unsigned member_num ) const; - // Returns the compound datatype of the specified member in + // Returns the compound datatype of the specified member in // this compound datatype. CompType getMemberCompType( unsigned member_num ) const; - // Returns the enumeration datatype of the specified member in + // Returns the enumeration datatype of the specified member in // this compound datatype. EnumType getMemberEnumType( unsigned member_num ) const; - // Returns the integer datatype of the specified member in + // Returns the integer datatype of the specified member in // this compound datatype. IntType getMemberIntType( unsigned member_num ) const; - // Returns the floating-point datatype of the specified member in + // Returns the floating-point datatype of the specified member in // this compound datatype. FloatType getMemberFloatType( unsigned member_num ) const; - // Returns the string datatype of the specified member in + // Returns the string datatype of the specified member in // this compound datatype. StrType getMemberStrType( unsigned member_num ) const; - // Returns the compound datatype of the specified member in + // Returns the compound datatype of the specified member in // this compound datatype. VarLenType getMemberVarLenType( unsigned member_num ) const; - // Returns the number of members in this compound datatype. + // Returns the number of members in this compound datatype. int getNmembers() const; // Adds a new member to this compound datatype. void insertMember( const string& name, size_t offset, const DataType& new_member ) const; - // Recursively removes padding from within this compound datatype. + // Recursively removes padding from within this compound datatype. void pack() const; // Default constructor @@ -105,7 +105,7 @@ class H5_DLLCPP CompType : public DataType { private: // Contains common code that is used by the member functions // getMemberXxxType - hid_t p_get_member_type(unsigned member_num) const; + hid_t p_get_member_type(unsigned member_num) const; }; #ifndef H5_NO_NAMESPACE } diff --git a/c++/src/H5CppDoc.h b/c++/src/H5CppDoc.h index f451d56..d215f19 100644 --- a/c++/src/H5CppDoc.h +++ b/c++/src/H5CppDoc.h @@ -17,7 +17,7 @@ #define _H5CPPDOC_H //------------------------------------------------------------------------- -// The following section will be used to generate the 'Mainpage' +// The following section will be used to generate the 'Mainpage' // and the 'Examples' for the RM. // ------------------------------------------------------------------------ @@ -26,15 +26,15 @@ * \section intro_sec Introduction * * The C++ API provides C++ wrappers for the HDF5 C library. - * It is assumed that the user has knowledge of the HDF5 file format + * It is assumed that the user has knowledge of the HDF5 file format * and its components. If you are not familiar with HDF5 file format, * and would like to find out more, please refer to the HDF5 documentation * at http://hdf.ncsa.uiuc.edu/HDF5/doc/H5.intro.html * - * Because the HDF5 library maps very well to - * the object oriented design approach, classes in the C++ API can + * Because the HDF5 library maps very well to + * the object oriented design approach, classes in the C++ API can * closely represent the interfaces of the HDF5 APIs, as followed: - * + * * \verbatim HDF5 C APIs C++ Classes ----------- ----------- @@ -54,7 +54,7 @@ * under the top directory for information about installing, building, * and testing the C++ API. * - * + * */ /// This example shows how to create datasets. diff --git a/c++/src/H5DataSet.cpp b/c++/src/H5DataSet.cpp index 4c5da3d..adff659 100644 --- a/c++/src/H5DataSet.cpp +++ b/c++/src/H5DataSet.cpp @@ -82,7 +82,7 @@ DataSpace DataSet::getSpace() const return( data_space ); } -// This private member function calls the C API to get the identifier +// This private member function calls the C API to get the identifier // of the datatype that is used by this dataset. It is used // by the various AbstractDs functions to get the specific datatype. hid_t DataSet::p_get_type() const @@ -110,7 +110,7 @@ DSetCreatPropList DataSet::getCreatePlist() const { throw DataSetIException("DataSet::getCreatePlist", "H5Dget_create_plist failed"); } - // create and return the DSetCreatPropList object + // create and return the DSetCreatPropList object DSetCreatPropList create_plist( create_plist_id ); return( create_plist ); } @@ -190,9 +190,9 @@ hsize_t DataSet::getVlenBufSize( DataType& type, DataSpace& space ) const //-------------------------------------------------------------------------- // Function: DataSet::vlenReclaim -///\brief Reclaims VL datatype memory buffers. +///\brief Reclaims VL datatype memory buffers. ///\param type - IN: Datatype, which is the datatype stored in the buffer -///\param space - IN: Selection for the memory buffer to free the +///\param space - IN: Selection for the memory buffer to free the /// VL datatypes within ///\param xfer_plist - IN: Property list used to create the buffer ///\param buf - IN: Pointer to the buffer to be reclaimed @@ -223,9 +223,9 @@ void DataSet::vlenReclaim( DataType& type, DataSpace& space, DSetMemXferPropList ///\param xfer_plist - IN: Transfer property list for this I/O operation ///\exception H5::DataSetIException ///\par Description -/// This function reads raw data from this dataset into the -/// buffer \a buf, converting from file datatype and dataspace -/// to memory datatype \a mem_type and dataspace \a mem_space. +/// This function reads raw data from this dataset into the +/// buffer \a buf, converting from file datatype and dataspace +/// to memory datatype \a mem_type and dataspace \a mem_space. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataSet::read( void* buf, const DataType& mem_type, const DataSpace& mem_space, const DataSpace& file_space, const DSetMemXferPropList& xfer_plist ) const @@ -273,9 +273,9 @@ void DataSet::read( string& strg, const DataType& mem_type, const DataSpace& mem ///\param xfer_plist - IN: Transfer property list for this I/O operation ///\exception H5::DataSetIException ///\par Description -/// This function writes raw data from an application buffer -/// \a buf to a dataset, converting from memory datatype -/// \a mem_type and dataspace \a mem_space to file datatype +/// This function writes raw data from an application buffer +/// \a buf to a dataset, converting from memory datatype +/// \a mem_type and dataspace \a mem_space to file datatype /// and dataspace. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -312,18 +312,18 @@ void DataSet::write( const string& strg, const DataType& mem_type, const DataSpa //-------------------------------------------------------------------------- // Function: DataSet::iterateElems -///\brief Iterates over all selected elements in a dataspace. -///\param buf - IN/OUT: Pointer to the buffer in memory containing the +///\brief Iterates over all selected elements in a dataspace. +///\param buf - IN/OUT: Pointer to the buffer in memory containing the /// elements to iterate over ///\param type - IN: Datatype for the elements stored in \a buf -///\param space - IN: Dataspace for \a buf. Also contains the selection +///\param space - IN: Dataspace for \a buf. Also contains the selection /// to iterate over. -///\param op - IN: Function pointer to the routine to be called for +///\param op - IN: Function pointer to the routine to be called for /// each element in \a buf iterated over -///\param op_data - IN/OUT: Pointer to any user-defined data associated +///\param op_data - IN/OUT: Pointer to any user-defined data associated /// with the operation ///\exception H5::DataSetIException -///\note This function may not work correctly yet - it's still +///\note This function may not work correctly yet - it's still /// under development. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -430,7 +430,7 @@ void* DataSet::Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_ ///\return A reference ///\exception H5::IdComponentException ///\par Description -// This function passes H5R_OBJECT and -1 to the protected +// This function passes H5R_OBJECT and -1 to the protected // function for it to pass to the C API H5Rcreate // to create a reference to the named object. // Programmer Binh-Minh Ribler - May, 2004 @@ -446,10 +446,10 @@ void* DataSet::Reference(const char* name) const ///\param ref_type - IN: Type of reference to query ///\param ref - IN: Reference to query // Return An object type, which can be one of the following: -// H5G_LINK Object is a symbolic link. -// H5G_GROUP Object is a group. -// H5G_DATASET Object is a dataset. -// H5G_TYPE Object is a named datatype +// H5G_LINK Object is a symbolic link. +// H5G_GROUP Object is a group. +// H5G_DATASET Object is a dataset. +// H5G_TYPE Object is a named datatype // Exception H5::IdComponentException // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- diff --git a/c++/src/H5DataSet.h b/c++/src/H5DataSet.h index 7255e17..b899f90 100644 --- a/c++/src/H5DataSet.h +++ b/c++/src/H5DataSet.h @@ -29,7 +29,7 @@ class H5_DLLCPP DataSet : public AbstractDs { // Fills a selection in memory with a value void fillMemBuf(const void *fill, DataType& fill_type, void *buf, DataType& buf_type, DataSpace& space); - // Fills a selection in memory with zero + // Fills a selection in memory with zero void fillMemBuf(void *buf, DataType& buf_type, DataSpace& space); // Gets the creation property list of this dataset. @@ -37,7 +37,7 @@ class H5_DLLCPP DataSet : public AbstractDs { // Returns the address of this dataset in the file. haddr_t getOffset() const; - + // Gets the dataspace of this dataset. virtual DataSpace getSpace() const; @@ -96,7 +96,7 @@ class H5_DLLCPP DataSet : public AbstractDs { private: // This function contains the common code that is used by - // getTypeClass and various API functions getXxxType + // getTypeClass and various API functions getXxxType // defined in AbstractDs for generic datatype and specific // sub-types virtual hid_t p_get_type() const; diff --git a/c++/src/H5DataSpace.cpp b/c++/src/H5DataSpace.cpp index ea556d8..604c2b4 100644 --- a/c++/src/H5DataSpace.cpp +++ b/c++/src/H5DataSpace.cpp @@ -36,7 +36,7 @@ const DataSpace DataSpace::ALL( H5S_ALL ); //-------------------------------------------------------------------------- // Function: DataSpace constructor ///\brief Creates a new dataspace given a dataspace type. -///\param type - IN: Type of the dataspace to be created, which +///\param type - IN: Type of the dataspace to be created, which /// currently can be either \c H5S_SCALAR or \c H5S_SIMPLE; /// default to \c H5S_SCALAR. ///\exception H5::DataSpaceIException @@ -54,9 +54,9 @@ DataSpace::DataSpace( H5S_class_t type ) : IdComponent() //-------------------------------------------------------------------------- // Function: DataSpace overloaded constructor ///\brief Creates a new simple dataspace. -///\param rank - IN: Number of dimensions of dataspace. -///\param dims - IN: An array of the size of each dimension. -///\param maxdims - IN: An array of the maximum size of each dimension. +///\param rank - IN: Number of dimensions of dataspace. +///\param dims - IN: An array of the size of each dimension. +///\param maxdims - IN: An array of the maximum size of each dimension. ///\exception H5::DataSpaceIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -71,7 +71,7 @@ DataSpace::DataSpace( int rank, const hsize_t * dims, const hsize_t * maxdims) : //-------------------------------------------------------------------------- // Function: DataSpace overloaded constructor -///\brief Creates a DataSpace object using the id of an existing +///\brief Creates a DataSpace object using the id of an existing /// dataspace. ///\param existing_id - IN: Id of an existing dataspace ///\exception H5::DataSpaceIException @@ -94,7 +94,7 @@ DataSpace::DataSpace( const DataSpace& original ) : IdComponent( original ) {} ///\exception H5::DataSpaceIException // Programmer Binh-Minh Ribler - 2000 // Modification -// Replaced resetIdComponent with decRefCount to use C library +// Replaced resetIdComponent with decRefCount to use C library // ID reference counting mechanism - BMR, Feb 20, 2005 //-------------------------------------------------------------------------- void DataSpace::copy( const DataSpace& like_space ) @@ -137,7 +137,7 @@ DataSpace& DataSpace::operator=( const DataSpace& rhs ) //-------------------------------------------------------------------------- // Function: DataSpace::isSimple ///\brief Determines whether this dataspace is a simple dataspace. -///\return \c true if the dataspace is a simple dataspace, and \c false, +///\return \c true if the dataspace is a simple dataspace, and \c false, /// otherwise ///\exception H5::DataSpaceIException // Programmer Binh-Minh Ribler - 2000 @@ -151,7 +151,7 @@ bool DataSpace::isSimple () const return false; else { - throw DataSpaceIException("DataSpace::isSimple", + throw DataSpaceIException("DataSpace::isSimple", "H5Sis_simple returns negative value"); } } @@ -162,9 +162,9 @@ bool DataSpace::isSimple () const ///\param offset - IN: Offset to position the selection at ///\exception H5::DataSpaceIException ///\par Description -/// This function creates an offset for the selection within -/// an extent, allowing the same shaped selection to be moved -/// to different locations within a dataspace without requiring +/// This function creates an offset for the selection within +/// an extent, allowing the same shaped selection to be moved +/// to different locations within a dataspace without requiring /// it to be re-defined. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -182,7 +182,7 @@ void DataSpace::offsetSimple ( const hssize_t* offset ) const ///\brief Retrieves dataspace dimension size and maximum size. ///\param dims - IN: Name of the new member ///\param maxdims - IN: Pointer to the value of the new member -///\return Number of dimensions, the same value as returned by +///\return Number of dimensions, the same value as returned by /// \c DataSpace::getSimpleExtentNdims() ///\exception H5::DataSpaceIException // Programmer Binh-Minh Ribler - 2000 @@ -192,7 +192,7 @@ int DataSpace::getSimpleExtentDims ( hsize_t *dims, hsize_t *maxdims ) const int ndims = H5Sget_simple_extent_dims( id, dims, maxdims ); if( ndims < 0 ) { - throw DataSpaceIException("DataSpace::getSimpleExtentDims", + throw DataSpaceIException("DataSpace::getSimpleExtentDims", "H5Sget_simple_extent_dims returns negative number of dimensions"); } return( ndims ); @@ -210,7 +210,7 @@ int DataSpace::getSimpleExtentNdims () const int ndims = H5Sget_simple_extent_ndims( id ); if( ndims < 0 ) { - throw DataSpaceIException("DataSpace::getSimpleExtentNdims", + throw DataSpaceIException("DataSpace::getSimpleExtentNdims", "H5Sget_simple_extent_ndims returns negative value for dimensionality of the dataspace"); } return( ndims ); @@ -235,7 +235,7 @@ hssize_t DataSpace::getSimpleExtentNpoints () const return( num_elements ); else { - throw DataSpaceIException("DataSpace::getSimpleExtentNpoints", + throw DataSpaceIException("DataSpace::getSimpleExtentNpoints", "H5Sget_simple_extent_npoints returns negative value for the number of elements in the dataspace"); } } @@ -252,7 +252,7 @@ H5S_class_t DataSpace::getSimpleExtentType () const H5S_class_t class_name = H5Sget_simple_extent_type( id ); if( class_name == H5S_NO_CLASS ) { - throw DataSpaceIException("DataSpace::getSimpleExtentType", + throw DataSpaceIException("DataSpace::getSimpleExtentType", "H5Sget_simple_extent_type returns H5S_NO_CLASS"); } return( class_name ); @@ -322,7 +322,7 @@ hssize_t DataSpace::getSelectNpoints () const hssize_t num_elements = H5Sget_select_npoints( id ); if( num_elements < 0 ) { - throw DataSpaceIException("DataSpace::getSelectNpoints", + throw DataSpaceIException("DataSpace::getSelectNpoints", "H5Sget_select_npoints returns negative value for number of elements in the dataspace selection"); } return( num_elements ); @@ -340,7 +340,7 @@ hssize_t DataSpace::getSelectHyperNblocks () const hssize_t num_blocks = H5Sget_select_hyper_nblocks( id ); if( num_blocks < 0 ) { - throw DataSpaceIException("DataSpace::getSelectHyperNblocks", + throw DataSpaceIException("DataSpace::getSelectHyperNblocks", "H5Sget_select_hyper_nblocks returns negative value for the number of hyperslab blocks"); } return( num_blocks ); @@ -361,7 +361,7 @@ void DataSpace::getSelectHyperBlocklist( hsize_t startblock, hsize_t numblocks, ret_value = H5Sget_select_hyper_blocklist( id, startblock, numblocks, buf ); if( ret_value < 0 ) { - throw DataSpaceIException("DataSpace::getSelectHyperBlocklist", + throw DataSpaceIException("DataSpace::getSelectHyperBlocklist", "H5Sget_select_hyper_blocklist failed"); } } @@ -378,7 +378,7 @@ hssize_t DataSpace::getSelectElemNpoints () const hssize_t num_points = H5Sget_select_elem_npoints( id ); if( num_points < 0 ) { - throw DataSpaceIException("DataSpace::getSelectElemNpoints", + throw DataSpaceIException("DataSpace::getSelectElemNpoints", "H5Sget_select_elem_npoints failed"); } return( num_points ); @@ -412,7 +412,7 @@ void DataSpace::getSelectElemPointlist ( hsize_t startpoint, hsize_t numpoints, // Function: DataSpace::getSelectBounds ///\brief Gets the bounding box containing the current selection. ///\param start - IN: Starting coordinates of the bounding box -///\param end - IN: Ending coordinates of the bounding box, i.e., +///\param end - IN: Ending coordinates of the bounding box, i.e., /// the coordinates of the diagonally opposite corner ///\exception H5::DataSpaceIException ///\par Description @@ -433,12 +433,12 @@ void DataSpace::getSelectBounds ( hsize_t* start, hsize_t* end ) const //-------------------------------------------------------------------------- // Function: DataSpace::H5Sselect_elements -///\brief Selects array elements to be included in the selection for +///\brief Selects array elements to be included in the selection for /// this dataspace. -///\param op - IN: Operator specifying how the new selection is to be +///\param op - IN: Operator specifying how the new selection is to be /// combined with the existing selection for the dataspace ///\param num_elements - IN: Number of elements to be selected -///\param coord - IN: A 2-dimensional array of 0-based values +///\param coord - IN: A 2-dimensional array of 0-based values /// specifying the coordinates of the elements being selected ///\exception H5::DataSpaceIException ///\par Description @@ -493,7 +493,7 @@ void DataSpace::selectNone () const //-------------------------------------------------------------------------- // Function: DataSpace::selectValid -///\brief Verifies that the selection is within the extent of the +///\brief Verifies that the selection is within the extent of the /// dataspace. ///\return \c true if the selection is within the extent of the /// dataspace, and \c false, otherwise @@ -525,7 +525,7 @@ bool DataSpace::selectValid () const ///\exception H5::DataSpaceIException ///\par Description /// For more information, please refer to the C layer Reference -/// Manual at: +/// Manual at: /// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5S.html#Dataspace-SelectHyperslab // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -568,11 +568,11 @@ void DataSpace::close() ///\brief Properly terminates access to this dataspace. // Programmer Binh-Minh Ribler - 2000 // Modification -// Replaced resetIdComponent with decRefCount to use C library +// Replaced resetIdComponent with decRefCount to use C library // ID reference counting mechanism - BMR, Feb 20, 2005 //-------------------------------------------------------------------------- DataSpace::~DataSpace() -{ +{ // If this object has a valid id, appropriately decrement reference // counter and close the id. if( id != H5S_ALL ) { @@ -583,7 +583,7 @@ DataSpace::~DataSpace() cerr << "DataSpace::~DataSpace - " << close_error.getDetailMsg() << endl; } } // if -} +} #ifndef H5_NO_NAMESPACE } // end namespace diff --git a/c++/src/H5DataSpace.h b/c++/src/H5DataSpace.h index 201332f..49071c4 100644 --- a/c++/src/H5DataSpace.h +++ b/c++/src/H5DataSpace.h @@ -65,7 +65,7 @@ class H5_DLLCPP DataSpace : public IdComponent { int getSimpleExtentNdims() const; // Gets the number of elements in this dataspace. - // 12/05/00 - changed return type to hssize_t from hsize_t - C API + // 12/05/00 - changed return type to hssize_t from hsize_t - C API hssize_t getSimpleExtentNpoints() const; // Gets the current class of this dataspace. @@ -80,7 +80,7 @@ class H5_DLLCPP DataSpace : public IdComponent { // Selects the entire dataspace. void selectAll() const; - // Selects array elements to be included in the selection for + // Selects array elements to be included in the selection for // this dataspace. void selectElements( H5S_seloper_t op, const size_t num_elements, const hsize_t *coord[ ] ) const; diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp index 2e19020..ed62777 100644 --- a/c++/src/H5DataType.cpp +++ b/c++/src/H5DataType.cpp @@ -43,11 +43,11 @@ namespace H5 { ///\param predefined - IN: Indicates whether or not this datatype is /// a predefined datatype; default to \c false // Description -// Constructor creates a copy of an existing DataType using -// its id. The argument "predefined" is default to false; -// when a default datatype is created, this argument is set -// to true so H5Tclose will not be called on it later. - need -// a reassessment after changing to the new ref counting mech. +// Constructor creates a copy of an existing DataType using +// its id. The argument "predefined" is default to false; +// when a default datatype is created, this argument is set +// to true so H5Tclose will not be called on it later. - need +// a reassessment after changing to the new ref counting mech. // - BMR 5/2004 // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -125,8 +125,8 @@ void DataType::copy( const DataType& like_type ) ///\return Reference to DataType instance ///\exception H5::DataTypeIException // Description -// Makes a copy of the type on the right hand side and stores -// the new id in the left hand side object. +// Makes a copy of the type on the right hand side and stores +// the new id in the left hand side object. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- DataType& DataType::operator=( const DataType& rhs ) @@ -137,7 +137,7 @@ DataType& DataType::operator=( const DataType& rhs ) //-------------------------------------------------------------------------- // Function: DataType::operator== -///\brief Compares this DataType against the given one to determines +///\brief Compares this DataType against the given one to determines /// whether the two objects refer to the same actual datatype. ///\param compared_type - IN: Reference to the datatype to compare ///\return true if the datatypes are equal, and false, otherwise. @@ -146,7 +146,7 @@ DataType& DataType::operator=( const DataType& rhs ) //-------------------------------------------------------------------------- bool DataType::operator==(const DataType& compared_type ) const { - // Call C routine H5Tequal to determines whether two datatype + // Call C routine H5Tequal to determines whether two datatype // identifiers refer to the same datatype htri_t ret_value = H5Tequal( id, compared_type.getId() ); if( ret_value > 0 ) @@ -155,14 +155,14 @@ bool DataType::operator==(const DataType& compared_type ) const return false; else { - throw DataTypeIException("DataType::operator==", + throw DataTypeIException("DataType::operator==", "H5Tequal returns negative value"); } } //-------------------------------------------------------------------------- // Function: DataType::commit -///\brief Commits a transient datatype to a file, creating a new +///\brief Commits a transient datatype to a file, creating a new /// named datatype ///\param loc - IN: Either a file or a group ///\param name - IN: Name of the datatype @@ -173,7 +173,7 @@ void DataType::commit(CommonFG& loc, const char* name) const { hid_t loc_id = loc.getLocId(); // get location id for C API - // Call C routine to commit the transient datatype + // Call C routine to commit the transient datatype herr_t ret_value = H5Tcommit( loc_id, name, id ); if( ret_value < 0 ) { @@ -184,7 +184,7 @@ void DataType::commit(CommonFG& loc, const char* name) const //-------------------------------------------------------------------------- // Function: DataType::commit ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of the +/// It differs from the above function only in the type of the /// argument \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -195,8 +195,8 @@ void DataType::commit(CommonFG& loc, const string& name) const //-------------------------------------------------------------------------- // Function: DataType::committed -///\brief Determines whether a datatype is a named type or a -/// transient type. +///\brief Determines whether a datatype is a named type or a +/// transient type. ///\return true if the datatype is a named type, and false, otherwise. ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 @@ -217,11 +217,11 @@ bool DataType::committed() const //-------------------------------------------------------------------------- // Function: DataType::find -///\brief Finds a conversion function that can handle a conversion +///\brief Finds a conversion function that can handle a conversion /// from this datatype to the specified datatype, \a dest. ///\param dest - IN: Destination datatype ///\param pcdata - IN: Pointer to type conversion data -///\return Pointer to a suitable conversion function +///\return Pointer to a suitable conversion function ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -238,14 +238,14 @@ H5T_conv_t DataType::find( const DataType& dest, H5T_cdata_t **pcdata ) const //-------------------------------------------------------------------------- // Function: DataType::convert -///\brief Converts data from this datatype to the specified datatypes. +///\brief Converts data from this datatype to the specified datatypes. ///\param dest - IN: Destination datatype ///\param nelmts - IN: Size of array \a buf -///\param buf - IN/OUT: Array containing pre- and post-conversion +///\param buf - IN/OUT: Array containing pre- and post-conversion /// values ///\param background - IN: Optional backgroud buffer ///\param plist - IN: Dataset transfer property list -///\return Pointer to a suitable conversion function +///\return Pointer to a suitable conversion function ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -264,7 +264,7 @@ void DataType::convert( const DataType& dest, size_t nelmts, void *buf, void *ba } } -// Sets the overflow handler to a specified function. +// Sets the overflow handler to a specified function. void DataType::setOverflow( H5T_overflow_t func ) const { // Call C routine H5Tset_overflow to set the overflow handler @@ -275,7 +275,7 @@ void DataType::setOverflow( H5T_overflow_t func ) const } } -// Returns a pointer to the current global overflow function. +// Returns a pointer to the current global overflow function. H5T_overflow_t DataType::getOverflow(void) const { return( H5Tget_overflow()); // C routine @@ -288,8 +288,8 @@ H5T_overflow_t DataType::getOverflow(void) const /// ///\exception H5::DataTypeIException ///\par Descrition -/// This is normally done by the library for predefined data -/// types so the application doesn't inadvertently change or +/// This is normally done by the library for predefined data +/// types so the application doesn't inadvertently change or /// delete a predefined type. /// /// Once a data type is locked it can never be unlocked unless @@ -308,7 +308,7 @@ void DataType::lock() const //-------------------------------------------------------------------------- // Function: DataType::getClass -///\brief Returns the datatype class identifier. +///\brief Returns the datatype class identifier. ///\return Datatype class identifier ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 @@ -320,7 +320,7 @@ H5T_class_t DataType::getClass() const // Return datatype class identifier if successful if( type_class == H5T_NO_CLASS ) { - throw DataTypeIException("DataType::getClass", + throw DataTypeIException("DataType::getClass", "H5Tget_class returns H5T_NO_CLASS"); } return( type_class ); @@ -328,7 +328,7 @@ H5T_class_t DataType::getClass() const //-------------------------------------------------------------------------- // Function: DataType::getSize -///\brief Returns the size of a datatype. +///\brief Returns the size of a datatype. ///\return Datatype size in bytes ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 @@ -339,7 +339,7 @@ size_t DataType::getSize() const size_t type_size = H5Tget_size( id ); if( type_size <= 0 ) // valid data types are never zero size { - throw DataTypeIException("DataType::getSize", + throw DataTypeIException("DataType::getSize", "H5Tget_size returns invalid datatype size"); } return( type_size ); @@ -347,7 +347,7 @@ size_t DataType::getSize() const //-------------------------------------------------------------------------- // Function: DataType::getSuper -///\brief Returns the base datatype from which a datatype is derived. +///\brief Returns the base datatype from which a datatype is derived. ///\return DataType object ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 @@ -355,7 +355,7 @@ size_t DataType::getSize() const DataType DataType::getSuper() const { // Call C routine to get the base datatype from which the specified - // datatype is derived. + // datatype is derived. hid_t base_type_id = H5Tget_super( id ); // If H5Tget_super returns a valid datatype id, create and return @@ -373,14 +373,14 @@ DataType DataType::getSuper() const //-------------------------------------------------------------------------- // Function: DataType::registerFunc -///\brief Registers the specified conversion function. +///\brief Registers the specified conversion function. ///\param pers - IN: Conversion option /// \li \c H5T_PERS_HARD for hard conversion functions -/// \li \c H5T_PERS_SOFT for soft conversion functions. -///\param name - IN: Name displayed in diagnostic output. +/// \li \c H5T_PERS_SOFT for soft conversion functions. +///\param name - IN: Name displayed in diagnostic output. ///\param dest - IN: Destination datatype. -///\param func - IN: Function to convert between source and -/// destination datatypes. +///\param func - IN: Function to convert between source and +/// destination datatypes. ///\exception H5::DataTypeIException ///\par Description /// For more information, please see: @@ -402,7 +402,7 @@ void DataType::registerFunc( H5T_pers_t pers, const char* name, const DataType& //-------------------------------------------------------------------------- // Function: DataType::registerFunc ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of the +/// It differs from the above function only in the type of the /// argument \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -413,14 +413,14 @@ void DataType::registerFunc( H5T_pers_t pers, const string& name, const DataType //-------------------------------------------------------------------------- // Function: DataType::unregister -///\brief Removes a conversion function from all conversion paths. +///\brief Removes a conversion function from all conversion paths. ///\param pers - IN: Conversion option /// \li \c H5T_PERS_HARD for hard conversion functions -/// \li \c H5T_PERS_SOFT for soft conversion functions. -///\param name - IN: Name displayed in diagnostic output. +/// \li \c H5T_PERS_SOFT for soft conversion functions. +///\param name - IN: Name displayed in diagnostic output. ///\param dest - IN: Destination datatype. -///\param func - IN: Function to convert between source and -/// destination datatypes. +///\param func - IN: Function to convert between source and +/// destination datatypes. ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -428,7 +428,7 @@ void DataType::unregister( H5T_pers_t pers, const char* name, const DataType& de { hid_t dest_id = dest.getId(); // get id of the dest datatype for C API - // Call C routine H5Tunregister to remove the conversion function + // Call C routine H5Tunregister to remove the conversion function herr_t ret_value = H5Tunregister( pers, name, id, dest_id, func ); if( ret_value < 0 ) { @@ -439,7 +439,7 @@ void DataType::unregister( H5T_pers_t pers, const char* name, const DataType& de //-------------------------------------------------------------------------- // Function: DataType::unregister ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of the +/// It differs from the above function only in the type of the /// argument \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -450,15 +450,15 @@ void DataType::unregister( H5T_pers_t pers, const string& name, const DataType& //-------------------------------------------------------------------------- // Function: DataType::setTag -///\brief Tags an opaque datatype. -///\param tag - IN: Descriptive ASCII string with which the opaque -/// datatype is to be tagged. +///\brief Tags an opaque datatype. +///\param tag - IN: Descriptive ASCII string with which the opaque +/// datatype is to be tagged. ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void DataType::setTag( const char* tag ) const { - // Call C routine H5Tset_tag to tag an opaque datatype. + // Call C routine H5Tset_tag to tag an opaque datatype. herr_t ret_value = H5Tset_tag( id, tag ); if( ret_value < 0 ) { @@ -469,7 +469,7 @@ void DataType::setTag( const char* tag ) const //-------------------------------------------------------------------------- // Function: DataType::setTag ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of the +/// It differs from the above function only in the type of the /// argument \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -480,7 +480,7 @@ void DataType::setTag( const string& tag ) const //-------------------------------------------------------------------------- // Function: DataType::getTag -///\brief Gets the tag associated with an opaque datatype. +///\brief Gets the tag associated with an opaque datatype. ///\return Tag associated with the opaque datatype ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 @@ -494,12 +494,12 @@ string DataType::getTag() const if( tag_Cstr != NULL ) { string tag = string(tag_Cstr); // convert C string to string object - HDfree(tag_Cstr); // free the C string - return (tag); // return the tag + HDfree(tag_Cstr); // free the C string + return (tag); // return the tag } else { - throw DataTypeIException("DataType::getTag", + throw DataTypeIException("DataType::getTag", "H5Tget_tag returns NULL for tag"); } } @@ -508,7 +508,7 @@ string DataType::getTag() const // Function: DataType::detectClass ///\brief Checks whether a datatype contains (or is) a certain type of /// datatype. -///\return true if this datatype contains or is the specified type, +///\return true if this datatype contains or is the specified type, /// and false, otherwise. ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - May, 2004 @@ -522,7 +522,7 @@ bool DataType::detectClass(H5T_class_t cls) const return false; else { - throw DataTypeIException("DataType::detectClass", + throw DataTypeIException("DataType::detectClass", "H5Tdetect_class returns negative value"); } } @@ -530,7 +530,7 @@ bool DataType::detectClass(H5T_class_t cls) const //-------------------------------------------------------------------------- // Function: DataType::isVariableStr ///\brief Check whether this datatype is a variable-length string. -///\return true if this datatype is a variable-length string, and +///\return true if this datatype is a variable-length string, and /// false, otherwise. ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - May, 2004 @@ -573,7 +573,7 @@ void* DataType::Reference(const char* name, DataSpace& dataspace, H5R_type_t ref ///\return A reference ///\exception H5::IdComponentException ///\par Description -// This function passes H5R_OBJECT and -1 to the protected +// This function passes H5R_OBJECT and -1 to the protected // function for it to pass to the C API H5Rcreate // to create a reference to the named object. // Programmer Binh-Minh Ribler - May, 2004 @@ -589,10 +589,10 @@ void* DataType::Reference(const char* name) const ///\param ref - IN: Reference to query ///\param ref_type - IN: Type of reference to query ///\return Object type, which can be one of the following: -/// \li \c H5G_LINK Object is a symbolic link. -/// \li \c H5G_GROUP Object is a group. -/// \li \c H5G_DATASET Object is a dataset. -/// \li \c H5G_TYPE Object is a named datatype +/// \li \c H5G_LINK Object is a symbolic link. +/// \li \c H5G_GROUP Object is a group. +/// \li \c H5G_DATASET Object is a dataset. +/// \li \c H5G_TYPE Object is a named datatype ///\exception H5::IdComponentException // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- @@ -649,7 +649,7 @@ void DataType::close() // ID reference counting mechanism - BMR, Feb 20, 2005 //-------------------------------------------------------------------------- DataType::~DataType() -{ +{ // The datatype id will be closed properly if( is_predtype == false ) { try { @@ -659,7 +659,7 @@ DataType::~DataType() cerr << "DataType::~DataType - " << close_error.getDetailMsg() << endl; } } -} +} #ifndef H5_NO_NAMESPACE } // end namespace diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h index 59870e1..cbd2ae5 100644 --- a/c++/src/H5DataType.h +++ b/c++/src/H5DataType.h @@ -34,23 +34,23 @@ class H5_DLLCPP DataType : public H5Object { // Copies an existing datatype to this datatype object void copy( const DataType& like_type ); - // Returns the datatype class identifier. + // Returns the datatype class identifier. H5T_class_t getClass() const; - // Commits a transient datatype to a file; this datatype becomes + // Commits a transient datatype to a file; this datatype becomes // a named datatype which can be accessed from the location. void commit( CommonFG& loc, const string& name ) const; void commit( CommonFG& loc, const char* name ) const; - // Determines whether this datatype is a named datatype or - // a transient datatype. + // Determines whether this datatype is a named datatype or + // a transient datatype. bool committed() const; - // Finds a conversion function that can handle the conversion + // Finds a conversion function that can handle the conversion // this datatype to the given datatype, dest. H5T_conv_t find( const DataType& dest, H5T_cdata_t **pcdata ) const; - // Converts data from between specified datatypes. + // Converts data from between specified datatypes. void convert( const DataType& dest, size_t nelmts, void *buf, void *background, PropList& plist ) const; // Assignment operator @@ -59,35 +59,35 @@ class H5_DLLCPP DataType : public H5Object { // Determines whether two datatypes are the same. bool operator==(const DataType& compared_type ) const; - // Locks a datatype. + // Locks a datatype. void lock() const; - // Returns a pointer to the current global overflow function. + // Returns a pointer to the current global overflow function. H5T_overflow_t getOverflow(void) const; - // Sets the overflow handler to a specified function. + // Sets the overflow handler to a specified function. void setOverflow(H5T_overflow_t func) const; - // Returns the size of a datatype. + // Returns the size of a datatype. size_t getSize() const; - // Returns the base datatype from which a datatype is derived. + // Returns the base datatype from which a datatype is derived. // Note: not quite right for specific types yet??? DataType getSuper() const; - // Registers a conversion function. + // Registers a conversion function. void registerFunc(H5T_pers_t pers, const string& name, const DataType& dest, H5T_conv_t func ) const; void registerFunc(H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const; - // Removes a conversion function from all conversion paths. + // Removes a conversion function from all conversion paths. void unregister( H5T_pers_t pers, const string& name, const DataType& dest, H5T_conv_t func ) const; void unregister( H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const; - // Tags an opaque datatype. + // Tags an opaque datatype. void setTag( const string& tag ) const; void setTag( const char* tag ) const; - // Gets the tag associated with an opaque datatype. + // Gets the tag associated with an opaque datatype. string getTag() const; // Checks whether this datatype contains (or is) a certain type class. @@ -109,7 +109,7 @@ class H5_DLLCPP DataType : public H5Object { // Retrieves a dataspace with the region pointed to selected. DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const; - // Creates a copy of an existing DataType using its id + // Creates a copy of an existing DataType using its id DataType( const hid_t type_id, bool predtype = false ); // Default constructor diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp index d960a83..30cefd7 100644 --- a/c++/src/H5DcreatProp.cpp +++ b/c++/src/H5DcreatProp.cpp @@ -49,7 +49,7 @@ DSetCreatPropList::DSetCreatPropList( const DSetCreatPropList& orig ) : PropList //-------------------------------------------------------------------------- // Function: DSetCreatPropList overloaded constructor -///\brief Creates a DSetCreatPropList object using the id of an +///\brief Creates a DSetCreatPropList object using the id of an /// existing dataset creation property list. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -93,7 +93,7 @@ int DSetCreatPropList::getChunk( int max_ndims, hsize_t* dim ) const int chunk_size = H5Pget_chunk( id, max_ndims, dim ); if( chunk_size < 0 ) { - throw PropListIException("DSetCreatPropList::getChunk", + throw PropListIException("DSetCreatPropList::getChunk", "H5Pget_chunk returns negative chunk size"); } return( chunk_size ); @@ -140,7 +140,7 @@ H5D_layout_t DSetCreatPropList::getLayout() const H5D_layout_t layout = H5Pget_layout( id ); if( layout == H5D_LAYOUT_ERROR ) { - throw PropListIException("DSetCreatPropList::getLayout", + throw PropListIException("DSetCreatPropList::getLayout", "H5Pget_layout returns H5D_LAYOUT_ERROR"); } return( layout ); @@ -314,10 +314,10 @@ int DSetCreatPropList::getNfilters() const //-------------------------------------------------------------------------- // Function: DSetCreatPropList::getFilter ///\brief Returns information about a filter in a pipeline -///\param filter_number - IN: Filter to get, range [0..N-1], where +///\param filter_number - IN: Filter to get, range [0..N-1], where /// N is returned by H5Pget_nfilters() ///\param flags - OUT: General properties of the filter -///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number +///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number /// of values defined by the filter ///\param cd_values - OUT: Array to hold the data; allocated by the user ///\param namelen - OUT: Length of \a name @@ -331,7 +331,7 @@ H5Z_filter_t DSetCreatPropList::getFilter(int filter_number, unsigned int &flags unsigned int* cd_values, size_t namelen, char name[] ) const { H5Z_filter_t filter_id; - filter_id = H5Pget_filter( id, filter_number, &flags, &cd_nelmts, + filter_id = H5Pget_filter( id, filter_number, &flags, &cd_nelmts, cd_values, namelen, name); if( filter_id == H5Z_FILTER_ERROR ) { @@ -348,7 +348,7 @@ H5Z_filter_t DSetCreatPropList::getFilter(int filter_number, unsigned int &flags /// filter id ///\param filter_id - IN: Filter to get ///\param flags - OUT: General properties of the filter -///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number +///\param cd_nelmts - IN/OUT: Number of elements in \a cd_values /Number /// of values defined by the filter ///\param cd_values - OUT: Array to hold the data; allocated by the user ///\param namelen - IN: Length of \a name diff --git a/c++/src/H5DcreatProp.h b/c++/src/H5DcreatProp.h index 61fa860..fb44aad 100644 --- a/c++/src/H5DcreatProp.h +++ b/c++/src/H5DcreatProp.h @@ -21,11 +21,11 @@ namespace H5 { #endif class H5_DLLCPP DSetCreatPropList : public PropList { - public: + public: // Default dataset creation property list. static const DSetCreatPropList DEFAULT; - // Queries whether all the filters set in this property list are + // Queries whether all the filters set in this property list are // available currently. bool allFiltersAvail(); @@ -69,7 +69,7 @@ class H5_DLLCPP DSetCreatPropList : public PropList { // property list. H5D_layout_t getLayout() const; - // Sets the type of storage used to store the raw data for the + // Sets the type of storage used to store the raw data for the // dataset that uses this property list. void setLayout(H5D_layout_t layout) const; @@ -106,7 +106,7 @@ class H5_DLLCPP DSetCreatPropList : public PropList { // Copy constructor: creates a copy of a DSetCreatPropList object. DSetCreatPropList(const DSetCreatPropList& orig); - // Creates a copy of an existing dataset creation property list + // Creates a copy of an existing dataset creation property list // using the property list id. DSetCreatPropList(const hid_t plist_id); diff --git a/c++/src/H5DxferProp.cpp b/c++/src/H5DxferProp.cpp index 46fed7c..38fbecf 100644 --- a/c++/src/H5DxferProp.cpp +++ b/c++/src/H5DxferProp.cpp @@ -51,7 +51,7 @@ DSetMemXferPropList::DSetMemXferPropList(const DSetMemXferPropList& original) : // Function DSetMemXferPropList overloaded constructor ///\brief Creates a DSetMemXferPropList object using the id of an /// existing DSetMemXferPropList. -///\param plist_id - IN: Id of an existing dataset memory and transfer +///\param plist_id - IN: Id of an existing dataset memory and transfer /// property list // Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -179,15 +179,15 @@ bool DSetMemXferPropList::getPreserve() const //-------------------------------------------------------------------------- // Function: DSetMemXferPropList::setHyperCache ///\brief Indicates whether to cache hyperslab blocks during I/O -///\param cache - IN: Flag indicating whether caching is to be set +///\param cache - IN: Flag indicating whether caching is to be set /// to on (1) or off (0) ///\param limit - IN: Maximum size of the hyperslab block to cache or /// 0 (zero) for no limit ///\exception H5::PropListIException -///\note This function is deprecated in HDF5 Release 1.6 and will -/// eventually be removed from the HDF5 distribution. It is -/// provided in this release only to enable backward compatibility -/// with HDF5 Releases 1.4.x and is enabled only if the HDF5 +///\note This function is deprecated in HDF5 Release 1.6 and will +/// eventually be removed from the HDF5 distribution. It is +/// provided in this release only to enable backward compatibility +/// with HDF5 Releases 1.4.x and is enabled only if the HDF5 /// library is configured with the flag H5_WANT_H5_V1_4_COMPAT. // Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -203,17 +203,17 @@ void DSetMemXferPropList::setHyperCache( bool cache, unsigned limit ) const //-------------------------------------------------------------------------- // Function: DSetMemXferPropList::getHyperCache -///\brief Returns information regarding the caching of hyperslab +///\brief Returns information regarding the caching of hyperslab /// blocks during I/O. -///\param cache - OUT: Flag indicating whether caching is set +///\param cache - OUT: Flag indicating whether caching is set /// to on (1) or off (0) ///\param limit - OUT: Maximum size of the hyperslab block to cache or /// 0 (zero) for no limit ///\exception H5::PropListIException -///\note This function is deprecated in HDF5 Release 1.6 and will -/// eventually be removed from the HDF5 distribution. It is -/// provided in this release only to enable backward compatibility -/// with HDF5 Releases 1.4.x and is enabled only if the HDF5 +///\note This function is deprecated in HDF5 Release 1.6 and will +/// eventually be removed from the HDF5 distribution. It is +/// provided in this release only to enable backward compatibility +/// with HDF5 Releases 1.4.x and is enabled only if the HDF5 /// library is configured with the flag H5_WANT_H5_V1_4_COMPAT. // Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -283,7 +283,7 @@ void DSetMemXferPropList::getBtreeRatios( double& left, double& middle, double& //-------------------------------------------------------------------------- void DSetMemXferPropList::setVlenMemManager( H5MM_allocate_t alloc_func, void* alloc_info, H5MM_free_t free_func, void* free_info ) const { - herr_t ret_value = H5Pset_vlen_mem_manager( id, alloc_func, alloc_info, + herr_t ret_value = H5Pset_vlen_mem_manager( id, alloc_func, alloc_info, free_func, free_info ); if( ret_value < 0 ) { @@ -294,7 +294,7 @@ void DSetMemXferPropList::setVlenMemManager( H5MM_allocate_t alloc_func, void* a //-------------------------------------------------------------------------- // Function: DSetMemXferPropList::setVlenMemManager -///\brief Sets the memory manager for variable-length datatype +///\brief Sets the memory manager for variable-length datatype /// allocation - system \c malloc and \c free will be used. /// ///\exception H5::PropListIException @@ -307,7 +307,7 @@ void DSetMemXferPropList::setVlenMemManager() const //-------------------------------------------------------------------------- // Function: DSetMemXferPropList::getVlenMemManager -///\brief Gets the memory manager for variable-length datatype allocation +///\brief Gets the memory manager for variable-length datatype allocation ///\param alloc_func - OUT: User's allocate routine ///\param alloc_info - OUT: User's allocation parameters ///\param free_func - OUT: User's free routine @@ -331,7 +331,7 @@ void DSetMemXferPropList::getVlenMemManager( H5MM_allocate_t& alloc_func, void** ///\param memb_dxpl - OUT: Array of data access property lists ///\exception H5::PropListIException ///\par Description -/// This function can only be used after the member map has +/// This function can only be used after the member map has /// been set with FileAccPropList::setMulti (not done - BMR.) // Programmer: Binh-Minh Ribler - July, 2004 //-------------------------------------------------------------------------- @@ -365,7 +365,7 @@ void DSetMemXferPropList::getMulti(hid_t *memb_dxpl) //-------------------------------------------------------------------------- // Function: DSetMemXferPropList::setSmallDataBlockSize ///\brief Sets the size of a contiguous block reserved for small data. -///\param size - IN: Maximum size, in bytes, of the small data block. +///\param size - IN: Maximum size, in bytes, of the small data block. ///\exception H5::PropListIException ///\par Description /// For detail, please refer to the C layer Reference Manual at: @@ -424,7 +424,7 @@ void DSetMemXferPropList::setHyperVectorSize(size_t vector_size) //-------------------------------------------------------------------------- // Function: DSetMemXferPropList::getSmallDataBlockSize -///\brief Returns the number of I/O vectors to be read/written in +///\brief Returns the number of I/O vectors to be read/written in /// hyperslab I/O. ///\return Number of I/O vectors ///\exception H5::PropListIException @@ -450,14 +450,14 @@ size_t DSetMemXferPropList::getHyperVectorSize() /// disabled ///\exception H5::PropListIException ///\par Description -/// The error detection algorithm used is the algorithm previously -/// specified in the corresponding dataset creation property -/// list. This function does not affect the use of error +/// The error detection algorithm used is the algorithm previously +/// specified in the corresponding dataset creation property +/// list. This function does not affect the use of error /// detection in the writing process. ///\par /// Valid values are as follows: -/// \li \c H5Z_ENABLE_EDC (default) -/// \li \c H5Z_DISABLE_EDC +/// \li \c H5Z_ENABLE_EDC (default) +/// \li \c H5Z_DISABLE_EDC // Programmer: Binh-Minh Ribler - July, 2004 //-------------------------------------------------------------------------- void DSetMemXferPropList::setEDCCheck(H5Z_EDC_t check) diff --git a/c++/src/H5DxferProp.h b/c++/src/H5DxferProp.h index c3fbee4..d602aad 100644 --- a/c++/src/H5DxferProp.h +++ b/c++/src/H5DxferProp.h @@ -45,7 +45,7 @@ class H5_DLLCPP DSetMemXferPropList : public PropList { size_t getBuffer( void** tconv, void** bkg ) const; #endif /* H5_WANT_H5_V1_4_COMPAT */ - // Sets B-tree split ratios for a dataset transfer property list + // Sets B-tree split ratios for a dataset transfer property list void setBtreeRatios( double left, double middle, double right ) const; // Gets B-tree split ratios for a dataset transfer property list @@ -57,18 +57,18 @@ class H5_DLLCPP DSetMemXferPropList : public PropList { // Checks status of the dataset transfer property list. bool getPreserve() const; - // Sets the memory manager for variable-length datatype + // Sets the memory manager for variable-length datatype // allocation in H5Dread and H5Dvlen_reclaim - void setVlenMemManager( H5MM_allocate_t alloc, void* alloc_info, + void setVlenMemManager( H5MM_allocate_t alloc, void* alloc_info, H5MM_free_t free, void* free_info ) const; - // alloc and free are set to NULL, indicating that system + // alloc and free are set to NULL, indicating that system // malloc and free are to be used void setVlenMemManager() const; - // Gets the memory manager for variable-length datatype + // Gets the memory manager for variable-length datatype // allocation in H5Dread and H5Tvlen_reclaim - void getVlenMemManager( H5MM_allocate_t& alloc, void** alloc_info, + void getVlenMemManager( H5MM_allocate_t& alloc, void** alloc_info, H5MM_free_t& free, void** free_info ) const; // Sets the data transfer property list for the multi-file driver. @@ -103,7 +103,7 @@ class H5_DLLCPP DSetMemXferPropList : public PropList { // Copy constructor: makes a copy of a DSetMemXferPropList object. DSetMemXferPropList(const DSetMemXferPropList& orig); - // Creates a copy of an existing dataset memory and transfer + // Creates a copy of an existing dataset memory and transfer // property list using the property list id. DSetMemXferPropList (const hid_t plist_id); diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp index 885be31..549d45b 100644 --- a/c++/src/H5EnumType.cpp +++ b/c++/src/H5EnumType.cpp @@ -117,7 +117,7 @@ EnumType::EnumType( const IntType& data_type ) : DataType() //-------------------------------------------------------------------------- void EnumType::insert( const char* name, void *value ) const { - // Calls C routine H5Tenum_insert to insert the new enum datatype member. + // Calls C routine H5Tenum_insert to insert the new enum datatype member. herr_t ret_value = H5Tenum_insert( id, name, value ); if( ret_value < 0 ) { @@ -128,7 +128,7 @@ void EnumType::insert( const char* name, void *value ) const //-------------------------------------------------------------------------- // Function: EnumType::insert ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of +/// It differs from the above function only in the type of /// argument \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -139,8 +139,8 @@ void EnumType::insert( const string& name, void *value ) const //-------------------------------------------------------------------------- // Function: EnumType::nameOf -///\brief Returns the symbol name corresponding to a specified member -/// of this enumeration datatype. +///\brief Returns the symbol name corresponding to a specified member +/// of this enumeration datatype. ///\param value - IN: Pointer to the value of the enum datatype ///\param size - IN: Size for the name ///\exception H5::DataTypeIException @@ -166,8 +166,8 @@ string EnumType::nameOf( void *value, size_t size ) const //-------------------------------------------------------------------------- // Function: EnumType::valueOf -///\brief Retrieves the value corresponding to a member of this -/// enumeration datatype, given the member's name. +///\brief Retrieves the value corresponding to a member of this +/// enumeration datatype, given the member's name. ///\param name - IN: Name of the queried member ///\param value - OUT: Pointer to the retrieved value ///\exception H5::DataTypeIException @@ -186,7 +186,7 @@ void EnumType::valueOf( const char* name, void *value ) const //-------------------------------------------------------------------------- // Function: EnumType::valueOf ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of +/// It differs from the above function only in the type of /// argument \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -200,7 +200,7 @@ void EnumType::valueOf( const string& name, void *value ) const ///\brief Returns the index of a member in this enumeration datatype. ///\param name - IN: Name of the queried member ///\return Index of the member if it exists. Index will have the value -/// between 0 and \c N-1, where \c N is the value returned by the +/// between 0 and \c N-1, where \c N is the value returned by the /// member function \c EnumType::getNmembers. ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - May 16, 2002 @@ -219,7 +219,7 @@ int EnumType::getMemberIndex(const char *name) const //-------------------------------------------------------------------------- // Function: EnumType::getMemberIndex ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in the type of +/// It differs from the above function only in the type of /// argument \a name. // Programmer Binh-Minh Ribler - May 16, 2002 //-------------------------------------------------------------------------- @@ -248,7 +248,7 @@ int EnumType::getNmembers() const //-------------------------------------------------------------------------- // Function: EnumType::getMemberValue -///\brief Retrieves the value of a member in this enumeration datatype, +///\brief Retrieves the value of a member in this enumeration datatype, /// given the member's index. ///\param memb_no - IN: Index of the queried member ///\param value - OUT: Pointer to the retrieved value diff --git a/c++/src/H5EnumType.h b/c++/src/H5EnumType.h index f88b337..a0c7a7e 100644 --- a/c++/src/H5EnumType.h +++ b/c++/src/H5EnumType.h @@ -23,7 +23,7 @@ namespace H5 { class H5_DLLCPP EnumType : public DataType { public: - // Creates an empty enumeration datatype based on a native signed + // Creates an empty enumeration datatype based on a native signed // integer type, whose size is given by size. EnumType( size_t size ); @@ -43,16 +43,16 @@ class H5_DLLCPP EnumType : public DataType { // Returns the value of an enumeration datatype member void getMemberValue( unsigned memb_no, void *value ) const; - // Inserts a new member to this enumeration type. + // Inserts a new member to this enumeration type. void insert( const char* name, void *value ) const; void insert( const string& name, void *value ) const; - // Returns the symbol name corresponding to a specified member - // of this enumeration datatype. + // Returns the symbol name corresponding to a specified member + // of this enumeration datatype. string nameOf( void *value, size_t size ) const; - // Returns the value corresponding to a specified member of this - // enumeration datatype. + // Returns the value corresponding to a specified member of this + // enumeration datatype. void valueOf( const char* name, void *value ) const; void valueOf( const string& name, void *value ) const; diff --git a/c++/src/H5Exception.cpp b/c++/src/H5Exception.cpp index 20e939e..8e88323 100644 --- a/c++/src/H5Exception.cpp +++ b/c++/src/H5Exception.cpp @@ -33,7 +33,7 @@ Exception::Exception() : detail_message(""), func_name("") {} //-------------------------------------------------------------------------- // Function: Exception overloaded constructor -///\brief Creates an exception with the name of the function, +///\brief Creates an exception with the name of the function, /// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure @@ -98,7 +98,7 @@ string Exception::getMinorString(H5E_minor_t err_minor) const ///\param client_data - IN: Data passed to the error function ///\par Description /// When the library is first initialized the auto printing -/// function, \a func, is set to the C API \c H5Eprint and +/// function, \a func, is set to the C API \c H5Eprint and /// \a client_data is the standard error stream pointer, \c stderr. /// Automatic stack traversal is always in the \c H5E_WALK_DOWNWARD /// direction. @@ -134,16 +134,16 @@ void Exception::dontPrint() // Function: Exception::getAutoPrint ///\brief Retrieves the current settings for the automatic error /// stack traversal function and its data. -///\param func - OUT: Current setting for the function to be +///\param func - OUT: Current setting for the function to be /// called upon an error condition -///\param client_data - OUT: Current setting for the data passed to +///\param client_data - OUT: Current setting for the data passed to /// the error function // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void Exception::getAutoPrint( H5E_auto_t& func, void** client_data ) { // calls the C API routine H5Eget_auto to get the current setting of - // the automatic error printing + // the automatic error printing herr_t ret_value = H5Eget_auto( &func, client_data ); if( ret_value < 0 ) throw Exception( "Exception::getAutoPrint", "H5Eget_auto failed" ); @@ -291,7 +291,7 @@ Exception::~Exception() {} FileIException::FileIException():Exception(){} //-------------------------------------------------------------------------- // Function: FileIException overloaded constructor -///\brief Creates a FileIException with the name of the function, +///\brief Creates a FileIException with the name of the function, /// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure @@ -314,7 +314,7 @@ FileIException::~FileIException() {} GroupIException::GroupIException():Exception(){} //-------------------------------------------------------------------------- // Function: GroupIException overloaded constructor -///\brief Creates a GroupIException with the name of the function, +///\brief Creates a GroupIException with the name of the function, /// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure @@ -337,7 +337,7 @@ GroupIException::~GroupIException() {} DataSpaceIException::DataSpaceIException():Exception(){} //-------------------------------------------------------------------------- // Function: DataSpaceIException overloaded constructor -///\brief Creates a DataSpaceIException with the name of the function, +///\brief Creates a DataSpaceIException with the name of the function, /// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure @@ -360,7 +360,7 @@ DataSpaceIException::~DataSpaceIException() {} DataTypeIException::DataTypeIException():Exception(){} //-------------------------------------------------------------------------- // Function: DataTypeIException overloaded constructor -///\brief Creates a DataTypeIException with the name of the function, +///\brief Creates a DataTypeIException with the name of the function, /// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure @@ -383,7 +383,7 @@ DataTypeIException::~DataTypeIException() {} PropListIException::PropListIException():Exception(){} //-------------------------------------------------------------------------- // Function: PropListIException overloaded constructor -///\brief Creates a PropListIException with the name of the function, +///\brief Creates a PropListIException with the name of the function, /// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure @@ -406,7 +406,7 @@ PropListIException::~PropListIException() {} DataSetIException::DataSetIException():Exception(){} //-------------------------------------------------------------------------- // Function: DataSetIException overloaded constructor -///\brief Creates a DataSetIException with the name of the function, +///\brief Creates a DataSetIException with the name of the function, /// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure @@ -429,7 +429,7 @@ DataSetIException::~DataSetIException() {} AttributeIException::AttributeIException():Exception(){} //-------------------------------------------------------------------------- // Function: AttributeIException overloaded constructor -///\brief Creates an AttributeIException with the name of the function, +///\brief Creates an AttributeIException with the name of the function, /// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure @@ -452,7 +452,7 @@ AttributeIException::~AttributeIException() {} ReferenceException::ReferenceException():Exception(){} //-------------------------------------------------------------------------- // Function: ReferenceException overloaded constructor -///\brief Creates a ReferenceException with the name of the function, +///\brief Creates a ReferenceException with the name of the function, /// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure @@ -475,7 +475,7 @@ ReferenceException::~ReferenceException() {} LibraryIException::LibraryIException():Exception(){} //-------------------------------------------------------------------------- // Function: LibraryIException overloaded constructor -///\brief Creates a LibraryIException with the name of the function, +///\brief Creates a LibraryIException with the name of the function, /// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure @@ -498,7 +498,7 @@ LibraryIException::~LibraryIException() {} IdComponentException::IdComponentException(): Exception() {} //-------------------------------------------------------------------------- // Function: IdComponentException overloaded constructor -///\brief Creates a IdComponentException with the name of the function, +///\brief Creates a IdComponentException with the name of the function, /// in which the failure occurs, and an optional detailed message. ///\param func_name - IN: Name of the function where failure occurs ///\param message - IN: Message on the failure diff --git a/c++/src/H5Exception.h b/c++/src/H5Exception.h index a70e7b4..482d252 100644 --- a/c++/src/H5Exception.h +++ b/c++/src/H5Exception.h @@ -43,7 +43,7 @@ class H5_DLLCPP Exception { string getDetailMsg() const; const char* getCDetailMsg() const; // C string of detailed message string getFuncName() const; // function name as a string object - const char* getCFuncName() const; // function name as a char string + const char* getCFuncName() const; // function name as a char string // Turns on the automatic error printing. static void setAutoPrint( H5E_auto_t& func, void* client_data); @@ -51,16 +51,16 @@ class H5_DLLCPP Exception { // Turns off the automatic error printing. static void dontPrint(); - // Retrieves the current settings for the automatic error stack + // Retrieves the current settings for the automatic error stack // traversal function and its data. static void getAutoPrint( H5E_auto_t& func, void** client_data); // Clears the error stack for the current thread. static void clearErrorStack(); - // Walks the error stack for the current thread, calling the + // Walks the error stack for the current thread, calling the // specified function. - static void walkErrorStack( H5E_direction_t direction, + static void walkErrorStack( H5E_direction_t direction, H5E_walk_t func, void* client_data); // Prints the error stack in a default manner. @@ -77,7 +77,7 @@ class H5_DLLCPP Exception { private: // Because 'string' is not instantiated at compilation time, this -// warning is displayed when building DLL; but the class is exported +// warning is displayed when building DLL; but the class is exported // so the warning is harmless #if defined(WIN32) #pragma warning(disable: 4251) diff --git a/c++/src/H5FaccProp.cpp b/c++/src/H5FaccProp.cpp index 9c27d96..b9c33f3 100644 --- a/c++/src/H5FaccProp.cpp +++ b/c++/src/H5FaccProp.cpp @@ -71,7 +71,7 @@ void FileAccPropList::setStdio() const //-------------------------------------------------------------------------- // Function: FileAccPropList::getDriver ///\brief Return the ID of the low-level file driver. -///\return A low-level driver ID which is the same ID used when the +///\return A low-level driver ID which is the same ID used when the /// driver was set for the property list. The driver ID is /// only valid as long as the file driver remains registered. /// Valid driver identifiers can be found at: @@ -96,7 +96,7 @@ hid_t FileAccPropList::getDriver() const ///\param new_driver_info - IN: Struct containing the driver-specific properites ///\exception H5::PropListIException ///\par Description -/// For a list of valid driver identifiers, please see the C +/// For a list of valid driver identifiers, please see the C /// layer Reference Manual at: /// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-GetDriver // Programmer: Binh-Minh Ribler - April, 2004 @@ -148,13 +148,13 @@ hsize_t FileAccPropList::getFamilyOffset() const // Function: FileAccPropList::setCore ///\brief Modifies this file access property list to use the \c H5FD_CORE /// driver. -///\param increment - IN: Specifies how much memory to increase each +///\param increment - IN: Specifies how much memory to increase each /// time more memory is needed, in bytes -///\param backing_store - IN: Indicating whether to write the file +///\param backing_store - IN: Indicating whether to write the file /// contents to disk when the file is closed ///\exception H5::PropListIException ///\par Description -/// For more details on the use of \c H5FD_CORE driver, please +/// For more details on the use of \c H5FD_CORE driver, please /// refer to /// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetFaplCore // Programmer: Binh-Minh Ribler - April, 2004 @@ -172,7 +172,7 @@ void FileAccPropList::setCore (size_t increment, hbool_t backing_store) const // Function: FileAccPropList::getCore ///\brief Queries core file driver properties. ///\param increment - OUT: Size of memory increment, in bytes -///\param backing_store - OUT: Indicating whether to write the file +///\param backing_store - OUT: Indicating whether to write the file /// contents to disk when the file is closed ///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 @@ -251,7 +251,7 @@ FileAccPropList FileAccPropList::getFamily(hsize_t& memb_size) const //-------------------------------------------------------------------------- // Function: FileAccPropList::setSplit -///\brief Emulates the old split file driver, which stored meta data +///\brief Emulates the old split file driver, which stored meta data /// in one file and raw data in another file. ///\param meta_plist - IN: File access plist for the metadata file ///\param raw_plist - IN: File access plist for the raw data file @@ -374,7 +374,7 @@ void FileAccPropList::setSieveBufSize(size_t bufsize) const //-------------------------------------------------------------------------- // Function: FileAccPropList::setMetaBlockSize ///\brief Sets the minimum size of metadata block allocations. -///\param block_size - IN: Minimum size, in bytes, of metadata +///\param block_size - IN: Minimum size, in bytes, of metadata /// block allocations ///\exception H5::PropListIException ///\par Description @@ -470,9 +470,9 @@ void FileAccPropList::setSec2() const ///\param alignment - IN: Alignment value ///\exception H5::PropListIException ///\par Description -/// The parameter \a threshold must have a non-negative value. -/// Note that setting the threshold value to 0 (zero) has the -/// effect of a special case, forcing everything to be aligned. +/// The parameter \a threshold must have a non-negative value. +/// Note that setting the threshold value to 0 (zero) has the +/// effect of a special case, forcing everything to be aligned. /// The parameter \a alignment must have a positive value. /// /// For detail on \a setting alignment, please refer to @@ -490,7 +490,7 @@ void FileAccPropList::setAlignment( hsize_t threshold, hsize_t alignment ) const //-------------------------------------------------------------------------- // Function: FileAccPropList::getAlignment -///\brief Returns the current settings for alignment properties from +///\brief Returns the current settings for alignment properties from /// this property list. ///\param threshold - OUT: Retrieved threshold value for file object size ///\param alignment - OUT: Retrieved alignment value @@ -555,12 +555,12 @@ H5FD_mem_t FileAccPropList::getMultiType() const ///\param rdcc_w0 - IN: Preemption policy ///\exception H5::PropListIException ///\par Description -/// The argument \a rdcc_w0 should hold a value between 0 and 1 -/// inclusive. This value indicates how much chunks that have -/// been fully read are favored for preemption. A value of zero -/// means fully read chunks are treated no differently than other -/// chunks (the preemption is strictly LRU) while a value of one -/// means fully read chunks are always preempted before other chunks. +/// The argument \a rdcc_w0 should hold a value between 0 and 1 +/// inclusive. This value indicates how much chunks that have +/// been fully read are favored for preemption. A value of zero +/// means fully read chunks are treated no differently than other +/// chunks (the preemption is strictly LRU) while a value of one +/// means fully read chunks are always preempted before other chunks. //-------------------------------------------------------------------------- #ifdef H5_WANT_H5_V1_4_COMPAT void FileAccPropList::setCache( int mdc_nelmts, int rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0 ) const @@ -599,12 +599,12 @@ void FileAccPropList::getCache( int& mdc_nelmts, int& rdcc_nelmts, size_t& rdcc_ ///\param rdcc_w0 - IN: Preemption policy ///\exception H5::PropListIException ///\par Description -/// The argument \a rdcc_w0 should hold a value between 0 and 1 -/// inclusive. This value indicates how much chunks that have -/// been fully read are favored for preemption. A value of zero -/// means fully read chunks are treated no differently than other -/// chunks (the preemption is strictly LRU) while a value of one -/// means fully read chunks are always preempted before other chunks. +/// The argument \a rdcc_w0 should hold a value between 0 and 1 +/// inclusive. This value indicates how much chunks that have +/// been fully read are favored for preemption. A value of zero +/// means fully read chunks are treated no differently than other +/// chunks (the preemption is strictly LRU) while a value of one +/// means fully read chunks are always preempted before other chunks. // Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileAccPropList::setCache( int mdc_nelmts, size_t rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0 ) const @@ -639,7 +639,7 @@ void FileAccPropList::getCache( int& mdc_nelmts, size_t& rdcc_nelmts, size_t& rd //-------------------------------------------------------------------------- // Function: FileAccPropList::setFcloseDegree ///\brief Sets the degree for the file close behavior. -///\param degree - IN: +///\param degree - IN: ///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- @@ -673,8 +673,8 @@ H5F_close_degree_t FileAccPropList::getFcloseDegree() //-------------------------------------------------------------------------- // Function: FileAccPropList::setGcReferences ///\brief Sets garbage collecting references flag. -///\param gc_ref - IN: Flag setting reference garbage collection to -/// on (1) or off (0). +///\param gc_ref - IN: Flag setting reference garbage collection to +/// on (1) or off (0). ///\exception H5::PropListIException ///\par Description /// For detail on \a fapl, please refer to diff --git a/c++/src/H5FaccProp.h b/c++/src/H5FaccProp.h index 6a447b0..a4f499a 100644 --- a/c++/src/H5FaccProp.h +++ b/c++/src/H5FaccProp.h @@ -58,9 +58,9 @@ class H5_DLLCPP FileAccPropList : public PropList { FileAccPropList getFamily(hsize_t& memb_size) const; // Emulates the old split file driver, - void setSplit( FileAccPropList& meta_plist, FileAccPropList& raw_plist, + void setSplit( FileAccPropList& meta_plist, FileAccPropList& raw_plist, const char* meta_ext = ".meta", const char* raw_ext = ".raw" ) const; - void setSplit( FileAccPropList& meta_plist, FileAccPropList& raw_plist, + void setSplit( FileAccPropList& meta_plist, FileAccPropList& raw_plist, const string& meta_ext, const string& raw_ext ) const; #ifdef H5_HAVE_STREAM // for Stream Virtual File Driver diff --git a/c++/src/H5FcreatProp.cpp b/c++/src/H5FcreatProp.cpp index 1943216..c87d348 100644 --- a/c++/src/H5FcreatProp.cpp +++ b/c++/src/H5FcreatProp.cpp @@ -38,7 +38,7 @@ FileCreatPropList::FileCreatPropList() : PropList( H5P_FILE_CREATE ) {} //-------------------------------------------------------------------------- // Function: FileCreatPropList copy constructor -///\brief Copy constructor: makes a copy of the original +///\brief Copy constructor: makes a copy of the original /// FileCreatPropList object. ///\param original - IN: FileCreatPropList instance to copy // Programmer Binh-Minh Ribler - 2000 @@ -71,7 +71,7 @@ void FileCreatPropList::getVersion(unsigned& super, unsigned& freelist, unsigned herr_t ret_value = H5Pget_version( id, &super, &freelist, &stab, &shhdr ); if( ret_value < 0 ) { - throw PropListIException("FileCreatPropList::getVersion", + throw PropListIException("FileCreatPropList::getVersion", "H5Pget_version failed"); } } @@ -82,7 +82,7 @@ void FileCreatPropList::getVersion(unsigned& super, unsigned& freelist, unsigned ///\param size - IN: User block size to be set, in bytes ///\exception H5::PropListIException ///\par Description -/// The default user block size is 0; it may be set to any power +/// The default user block size is 0; it may be set to any power /// of 2 equal to 512 or greater (512, 1024, 2048, etc.) // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -91,7 +91,7 @@ void FileCreatPropList::setUserblock( hsize_t size ) const herr_t ret_value = H5Pset_userblock( id, size); if( ret_value < 0 ) { - throw PropListIException("FileCreatPropList::setUserblock", + throw PropListIException("FileCreatPropList::setUserblock", "H5Pset_userblock failed"); } } @@ -109,7 +109,7 @@ hsize_t FileCreatPropList::getUserblock() const herr_t ret_value = H5Pget_userblock( id, &userblock_size ); if( ret_value < 0 ) { - throw PropListIException("FileCreatPropList::getUserblock", + throw PropListIException("FileCreatPropList::getUserblock", "H5Pget_userblock failed"); } return( userblock_size ); @@ -117,10 +117,10 @@ hsize_t FileCreatPropList::getUserblock() const //-------------------------------------------------------------------------- // Function: FileCreatPropList::setSizes -///\brief Sets the byte size of the offsets and lengths used to +///\brief Sets the byte size of the offsets and lengths used to /// address objects in an HDF5 file. ///\param sizeof_addr - IN: Size of an object offset in bytes -///\param sizeof_size - IN: Size of an object length in bytes. +///\param sizeof_size - IN: Size of an object length in bytes. ///\exception H5::PropListIException ///\par Description /// For information on setting sizes, please refer to the @@ -133,14 +133,14 @@ void FileCreatPropList::setSizes( size_t sizeof_addr, size_t sizeof_size ) const herr_t ret_value = H5Pset_sizes( id, sizeof_addr, sizeof_size ); if( ret_value < 0 ) { - throw PropListIException("FileCreatPropList::setSizes", + throw PropListIException("FileCreatPropList::setSizes", "H5Pset_sizes failed"); } } //-------------------------------------------------------------------------- // Function: FileCreatPropList::getSizes -///\brief Retrieves the size of the offsets and lengths used in an +///\brief Retrieves the size of the offsets and lengths used in an /// HDF5 file. /// ///\exception H5::PropListIException @@ -151,7 +151,7 @@ void FileCreatPropList::getSizes( size_t& sizeof_addr, size_t& sizeof_size ) con herr_t ret_value = H5Pget_sizes( id, &sizeof_addr, &sizeof_size ); if( ret_value < 0 ) { - throw PropListIException("FileCreatPropList::getSizes", + throw PropListIException("FileCreatPropList::getSizes", "H5Pget_sizes failed"); } } @@ -174,7 +174,7 @@ void FileCreatPropList::setSymk( int ik, int lk ) const herr_t ret_value = H5Pset_sym_k( id, ik, lk ); if( ret_value < 0 ) { - throw PropListIException("FileCreatPropList::setSymk", + throw PropListIException("FileCreatPropList::setSymk", "H5Pset_sym_k failed"); } } @@ -195,14 +195,14 @@ void FileCreatPropList::getSymk( int& ik, int& lk ) const herr_t ret_value = H5Pget_sym_k( id, &ik, &lk ); if( ret_value < 0 ) { - throw PropListIException("FileCreatPropList::getSymk", + throw PropListIException("FileCreatPropList::getSymk", "H5Pget_sym_k failed"); } } #else /* H5_WANT_H5_V1_4_COMPAT */ //-------------------------------------------------------------------------- // Function: FileCreatPropList::setSymk -///\brief Sets the size of parameters used to control the symbol table +///\brief Sets the size of parameters used to control the symbol table /// nodes. ///\param ik - IN: Symbol table tree rank ///\param lk - IN: Symbol table node size @@ -217,14 +217,14 @@ void FileCreatPropList::setSymk( unsigned ik, unsigned lk ) const herr_t ret_value = H5Pset_sym_k( id, ik, lk ); if( ret_value < 0 ) { - throw PropListIException("FileCreatPropList::setSymk", + throw PropListIException("FileCreatPropList::setSymk", "H5Pset_sym_k failed"); } } //-------------------------------------------------------------------------- // Function: FileCreatPropList::getSymk -///\brief Retrieves the size of the symbol table B-tree 1/2 rank and +///\brief Retrieves the size of the symbol table B-tree 1/2 rank and /// the symbol table leaf node 1/2 size. ///\exception H5::PropListIException ///\par Description @@ -237,7 +237,7 @@ void FileCreatPropList::getSymk( unsigned& ik, unsigned& lk ) const herr_t ret_value = H5Pget_sym_k( id, &ik, &lk ); if( ret_value < 0 ) { - throw PropListIException("FileCreatPropList::getSymk", + throw PropListIException("FileCreatPropList::getSymk", "H5Pget_sym_k failed"); } } @@ -245,7 +245,7 @@ void FileCreatPropList::getSymk( unsigned& ik, unsigned& lk ) const //-------------------------------------------------------------------------- // Function: FileCreatPropList::setIstorek -///\brief Sets the size of the parameter used to control the B-trees +///\brief Sets the size of the parameter used to control the B-trees /// for indexing chunked datasets. ///\param ik - IN: 1/2 rank of chunked storage B-tree ///\exception H5::PropListIException @@ -259,7 +259,7 @@ void FileCreatPropList::setIstorek( unsigned ik ) const herr_t ret_value = H5Pset_istore_k( id, ik ); if( ret_value < 0 ) { - throw PropListIException("FileCreatPropList::setIstorek", + throw PropListIException("FileCreatPropList::setIstorek", "H5Pset_istore_k failed"); } } @@ -280,7 +280,7 @@ unsigned FileCreatPropList::getIstorek() const herr_t ret_value = H5Pget_istore_k( id, &ik ); if( ret_value < 0 ) { - throw PropListIException("FileCreatPropList::getIstorek", + throw PropListIException("FileCreatPropList::getIstorek", "H5Pget_istore_k failed"); } return( ik ); diff --git a/c++/src/H5FcreatProp.h b/c++/src/H5FcreatProp.h index 66678e2..f12cfba 100644 --- a/c++/src/H5FcreatProp.h +++ b/c++/src/H5FcreatProp.h @@ -25,7 +25,7 @@ class H5_DLLCPP FileCreatPropList : public PropList { public: // Default file creation property list. static const FileCreatPropList DEFAULT; - + // Retrieves version information for various parts of a file. void getVersion( unsigned& super, unsigned& freelist, unsigned& stab, unsigned& shhdr ) const; @@ -35,7 +35,7 @@ class H5_DLLCPP FileCreatPropList : public PropList { // Gets the size of a user block in this file creation property list. hsize_t getUserblock() const; - // Retrieves the size-of address and size quantities stored in a + // Retrieves the size-of address and size quantities stored in a // file according to this file creation property list. void getSizes( size_t& sizeof_addr, size_t& sizeof_size ) const; diff --git a/c++/src/H5File.cpp b/c++/src/H5File.cpp index 1caba81..888c5dc 100644 --- a/c++/src/H5File.cpp +++ b/c++/src/H5File.cpp @@ -52,21 +52,21 @@ H5File::H5File() : IdComponent() {} ///\brief Creates or opens an HDF5 file depending on the parameter flags. ///\param name - IN: Name of the file ///\param flags - IN: File access flags -///\param create_plist - IN: File creation property list, used when -/// modifying default file meta-data. Default to +///\param create_plist - IN: File creation property list, used when +/// modifying default file meta-data. Default to /// FileCreatPropList::DEFAULT -///\param access_plist - IN: File access property list. Default to +///\param access_plist - IN: File access property list. Default to /// FileCreatPropList::DEFAULT ///\par Description /// Valid values of \a flags include: -/// \li \c H5F_ACC_TRUNC - Truncate file, if it already exists, -/// erasing all data previously stored in -/// the file. -/// \li \c H5F_ACC_EXCL - Fail if file already exists. +/// \li \c H5F_ACC_TRUNC - Truncate file, if it already exists, +/// erasing all data previously stored in +/// the file. +/// \li \c H5F_ACC_EXCL - Fail if file already exists. /// \c H5F_ACC_TRUNC and \c H5F_ACC_EXCL are mutually exclusive -/// \li \c H5F_ACC_DEBUG - print debug information. This flag is -/// used only by HDF5 library developers; it is neither -/// tested nor supported for use in applications. +/// \li \c H5F_ACC_DEBUG - print debug information. This flag is +/// used only by HDF5 library developers; it is neither +/// tested nor supported for use in applications. ///\par /// For info on file creation in the case of an already-open file, /// please refer to the \b Special \b case section in the C layer @@ -81,14 +81,14 @@ H5File::H5File( const char* name, unsigned int flags, const FileCreatPropList& c //-------------------------------------------------------------------------- // Function: H5File overloaded constructor -///\brief This is another overloaded constructor. It differs from the +///\brief This is another overloaded constructor. It differs from the /// above constructor only in the type of the \a name argument. ///\param name - IN: Name of the file - \c std::string ///\param flags - IN: File access flags -///\param create_plist - IN: File creation property list, used when -/// modifying default file meta-data. Default to +///\param create_plist - IN: File creation property list, used when +/// modifying default file meta-data. Default to /// FileCreatPropList::DEFAULT -///\param access_plist - IN: File access property list. Default to +///\param access_plist - IN: File access property list. Default to /// FileCreatPropList::DEFAULT // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -98,7 +98,7 @@ H5File::H5File( const string& name, unsigned int flags, const FileCreatPropList& } //-------------------------------------------------------------------------- -// This function is private and contains common code between the +// This function is private and contains common code between the // constructors taking a string or a char* // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -145,16 +145,16 @@ H5File::H5File( const H5File& original ) : IdComponent( original ) {} ///\exception H5::FileIException // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -bool H5File::isHdf5(const char* name ) +bool H5File::isHdf5(const char* name ) { - // Calls C routine H5Fis_hdf5 to determine whether the file is in + // Calls C routine H5Fis_hdf5 to determine whether the file is in // HDF5 format. It returns positive value, 0, or negative value htri_t ret_value = H5Fis_hdf5( name ); if( ret_value > 0 ) return true; else if( ret_value == 0 ) return false; - else // Raise exception when H5Fis_hdf5 returns a negative value + else // Raise exception when H5Fis_hdf5 returns a negative value { throw FileIException("H5File::isHdf5", "H5Fis_hdf5 returned negative value"); } @@ -167,7 +167,7 @@ bool H5File::isHdf5(const char* name ) ///\param name - IN: Name of the file - \c std::string // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- -bool H5File::isHdf5(const string& name ) +bool H5File::isHdf5(const string& name ) { return( isHdf5( name.c_str()) ); } @@ -288,21 +288,21 @@ hssize_t H5File::getFreeSpace() const //-------------------------------------------------------------------------- // Function: H5File::getObjCount -///\brief Returns the number of opened object IDs (files, datasets, +///\brief Returns the number of opened object IDs (files, datasets, /// groups and datatypes) in the same file. -///\param types - Type of object to retrieve the count +///\param types - Type of object to retrieve the count ///\return Number of opened object IDs ///\exception H5::FileIException ///\par Description /// The valid values for \a types include: -/// \li \c H5F_OBJ_FILE - Files only -/// \li \c H5F_OBJ_DATASET - Datasets only -/// \li \c H5F_OBJ_GROUP - Groups only -/// \li \c H5F_OBJ_DATATYPE - Named datatypes only -/// \li \c H5F_OBJ_ATTR - Attributes only -/// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE -/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP -/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR +/// \li \c H5F_OBJ_FILE - Files only +/// \li \c H5F_OBJ_DATASET - Datasets only +/// \li \c H5F_OBJ_GROUP - Groups only +/// \li \c H5F_OBJ_DATATYPE - Named datatypes only +/// \li \c H5F_OBJ_ATTR - Attributes only +/// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE +/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP +/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR ///\par /// Multiple object types can be combined with the logical OR operator (|). // Programmer Binh-Minh Ribler - May 2004 @@ -320,7 +320,7 @@ int H5File::getObjCount(unsigned types) const //-------------------------------------------------------------------------- // Function: H5File::getObjCount ///\brief This is an overloaded member function, provided for convenience. -/// It takes no parameter and returns the object count of all +/// It takes no parameter and returns the object count of all /// object types. ///\return Number of opened object IDs ///\exception H5::FileIException @@ -338,23 +338,23 @@ int H5File::getObjCount() const //-------------------------------------------------------------------------- // Function: H5File::getObjIDs -///\brief Retrieves a list of opened object IDs (files, datasets, +///\brief Retrieves a list of opened object IDs (files, datasets, /// groups and datatypes) in the same file. -///\param types - Type of object to retrieve the count -///\param max_objs - Maximum number of object identifiers to place +///\param types - Type of object to retrieve the count +///\param max_objs - Maximum number of object identifiers to place /// into obj_id_list. ///\param oid_list - List of open object identifiers ///\exception H5::FileIException ///\par Description /// The valid values for \a types include: -/// \li \c H5F_OBJ_FILE - Files only -/// \li \c H5F_OBJ_DATASET - Datasets only -/// \li \c H5F_OBJ_GROUP - Groups only -/// \li \c H5F_OBJ_DATATYPE - Named datatypes only -/// \li \c H5F_OBJ_ATTR - Attributes only -/// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE -/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP -/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR +/// \li \c H5F_OBJ_FILE - Files only +/// \li \c H5F_OBJ_DATASET - Datasets only +/// \li \c H5F_OBJ_GROUP - Groups only +/// \li \c H5F_OBJ_DATATYPE - Named datatypes only +/// \li \c H5F_OBJ_ATTR - Attributes only +/// \li \c H5F_OBJ_ALL - All of the above, i.e., \c H5F_OBJ_FILE +/// | \c H5F_OBJ_DATASET | \c H5F_OBJ_GROUP +/// | \c H5F_OBJ_DATATYPE | \c H5F_OBJ_ATTR ///\par /// Multiple object types can be combined with the logical OR operator (|). // @@ -379,13 +379,13 @@ void H5File::getObjIDs(unsigned types, int max_objs, hid_t *oid_list) const /// the low-level virtual file driver ///\exception H5::FileIException ///\par Description -/// For the \c FAMILY or \c MULTI drivers, \a fapl should be -/// defined through the property list functions: -/// \c FileAccPropList::setFamilyOffset for the \c FAMILY driver +/// For the \c FAMILY or \c MULTI drivers, \a fapl should be +/// defined through the property list functions: +/// \c FileAccPropList::setFamilyOffset for the \c FAMILY driver /// and \c FileAccPropList::setMultiType for the \c MULTI driver. /// -/// The obtained file handle is dynamic and is valid only while -/// the file remains open; it will be invalid if the file is +/// The obtained file handle is dynamic and is valid only while +/// the file remains open; it will be invalid if the file is /// closed and reopened or opened during a subsequent session. // Programmer Binh-Minh Ribler - May 2004 //-------------------------------------------------------------------------- @@ -456,11 +456,11 @@ void* H5File::Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_t ///\return A reference ///\exception H5::IdComponentException ///\par Description -// This function passes H5R_OBJECT and -1 to the protected +// This function passes H5R_OBJECT and -1 to the protected // function for it to pass to the C API H5Rcreate // to create a reference to the named object. ///\par -/// Note that, for H5File, name must be an absolute path to the +/// Note that, for H5File, name must be an absolute path to the /// object in the file. // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- @@ -475,10 +475,10 @@ void* H5File::Reference(const char* name) const ///\param ref - IN: Reference to query ///\param ref_type - IN: Type of reference to query ///\return Object type, which can be one of the following: -/// \li \c H5G_LINK - Object is a symbolic link. -/// \li \c H5G_GROUP - Object is a group. -/// \li \c H5G_DATASET - Object is a dataset. -/// \li \c H5G_TYPE - Object is a named datatype +/// \li \c H5G_LINK - Object is a symbolic link. +/// \li \c H5G_GROUP - Object is a group. +/// \li \c H5G_DATASET - Object is a dataset. +/// \li \c H5G_TYPE - Object is a named datatype ///\exception H5::IdComponentException // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- @@ -508,7 +508,7 @@ DataSpace H5File::getRegion(void *ref, H5R_type_t ref_type) const ///\return File size ///\exception H5::FileIException ///\par Description -/// This function is called after an existing file is opened in +/// This function is called after an existing file is opened in /// order to learn the true size of the underlying file. // Programmer Raymond Lu - June 24, 2004 //-------------------------------------------------------------------------- @@ -561,30 +561,30 @@ void H5File::close() ///\param msg - Message describing the failure ///\exception H5::FileIException // Description -// This function is used in CommonFG implementation so that -// proper exception can be thrown for file or group. The -// argument func_name is a member of CommonFG and "H5File::" -// will be inserted to indicate the function called is an +// This function is used in CommonFG implementation so that +// proper exception can be thrown for file or group. The +// argument func_name is a member of CommonFG and "H5File::" +// will be inserted to indicate the function called is an // implementation of H5File. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5File::throwException(const string func_name, const string msg) const { string full_name = func_name; - full_name.insert(0, "H5File::"); + full_name.insert(0, "H5File::"); throw FileIException(full_name, msg); } //-------------------------------------------------------------------------- // Function: H5File destructor -///\brief Properly terminates access to this file. +///\brief Properly terminates access to this file. // Programmer Binh-Minh Ribler - 2000 // Modification // Replaced resetIdComponent with decRefCount to use C library // ID reference counting mechanism - BMR, Feb 20, 2005 //-------------------------------------------------------------------------- -H5File::~H5File() -{ +H5File::~H5File() +{ // The HDF5 file id will be closed properly try { decRefCount(); @@ -592,7 +592,7 @@ H5File::~H5File() catch (Exception close_error) { cerr << "H5File::~H5File - " << close_error.getDetailMsg() << endl; } -} +} #ifndef H5_NO_NAMESPACE } // end namespace diff --git a/c++/src/H5File.h b/c++/src/H5File.h index 303c136..94995da 100644 --- a/c++/src/H5File.h +++ b/c++/src/H5File.h @@ -48,12 +48,12 @@ class H5_DLLCPP H5File : public IdComponent, public CommonFG { // Returns the amount of free space in the file. hssize_t getFreeSpace() const; - // Returns the number of opened object IDs (files, datasets, groups + // Returns the number of opened object IDs (files, datasets, groups // and datatypes) in the same file. int getObjCount(unsigned types) const; int getObjCount() const; - // Retrieves a list of opened object IDs (files, datasets, groups + // Retrieves a list of opened object IDs (files, datasets, groups // and datatypes) in the same file. void getObjIDs(unsigned types, int max_objs, hid_t *oid_list) const; @@ -75,7 +75,7 @@ class H5_DLLCPP H5File : public IdComponent, public CommonFG { void reOpen(); // added for better name void reopen(); - // Creates a reference to a named Hdf5 object or to a dataset region + // Creates a reference to a named Hdf5 object or to a dataset region // in this object. void* Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_type = H5R_DATASET_REGION) const; diff --git a/c++/src/H5FloatType.cpp b/c++/src/H5FloatType.cpp index a5b1c51..530868f 100644 --- a/c++/src/H5FloatType.cpp +++ b/c++/src/H5FloatType.cpp @@ -56,7 +56,7 @@ FloatType::FloatType( const PredType& pred_type ) : AtomType() //-------------------------------------------------------------------------- // Function: FloatType overloaded constructor -///\brief Creates an FloatType object using the id of an existing +///\brief Creates an FloatType object using the id of an existing /// datatype. ///\param existing_id - IN: Id of an existing datatype ///\exception H5::DataTypeIException @@ -74,7 +74,7 @@ FloatType::FloatType( const FloatType& original ) : AtomType( original ){} //-------------------------------------------------------------------------- // Function: EnumType overloaded constructor ///\brief Gets the floating-point datatype of the specified dataset -///\param dataset - IN: Dataset that this floating-point datatype +///\param dataset - IN: Dataset that this floating-point datatype /// associates with ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 @@ -92,7 +92,7 @@ FloatType::FloatType( const DataSet& dataset ) : AtomType() //-------------------------------------------------------------------------- // Function: FloatType::getFields -///\brief Retrieves floating point datatype bit field information. +///\brief Retrieves floating point datatype bit field information. ///\param spos - OUT: Retrieved floating-point sign bit ///\param epos - OUT: Retrieved exponent bit-position ///\param esize - OUT: Retrieved size of exponent, in bits @@ -112,8 +112,8 @@ void FloatType::getFields( size_t& spos, size_t& epos, size_t& esize, size_t& mp //-------------------------------------------------------------------------- // Function: FloatType::setFields -///\brief Sets locations and sizes of floating point bit fields. -///\param spos - OUT: Sign position, i.e., the bit offset of the +///\brief Sets locations and sizes of floating point bit fields. +///\param spos - OUT: Sign position, i.e., the bit offset of the /// floating-point sign bit. ///\param epos - OUT: Exponent bit position ///\param esize - OUT: Size of exponent, in bits @@ -133,7 +133,7 @@ void FloatType::setFields( size_t spos, size_t epos, size_t esize, size_t mpos, //-------------------------------------------------------------------------- // Function: FloatType::getEbias -///\brief Retrieves the exponent bias of a floating-point type. +///\brief Retrieves the exponent bias of a floating-point type. ///\return Exponent bias ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 @@ -151,7 +151,7 @@ size_t FloatType::getEbias() const //-------------------------------------------------------------------------- // Function: FloatType::setEbias -///\brief Sets the exponent bias of a floating-point type. +///\brief Sets the exponent bias of a floating-point type. ///\param ebias - Exponent bias value ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 @@ -167,16 +167,16 @@ void FloatType::setEbias( size_t ebias ) const //-------------------------------------------------------------------------- // Function: FloatType::getNorm -///\brief Retrieves mantissa normalization of a floating-point datatype. +///\brief Retrieves mantissa normalization of a floating-point datatype. ///\param norm_string - OUT: Text string of the normalization type ///\return Valid normalization type, which can be: /// \li \c H5T_NORM_IMPLIED (0) - MSB of mantissa is not stored -/// \li \c H5T_NORM_MSBSET (1) - MSB of mantissa is always 1 -/// \li \c H5T_NORM_NONE (2) - Mantissa is not normalized +/// \li \c H5T_NORM_MSBSET (1) - MSB of mantissa is always 1 +/// \li \c H5T_NORM_NONE (2) - Mantissa is not normalized ///\exception H5::DataTypeIException ///\par Description -/// For your convenience, this function also provides the text -/// string of the returned normalization type, via parameter +/// For your convenience, this function also provides the text +/// string of the returned normalization type, via parameter /// \a norm_string. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -199,14 +199,14 @@ H5T_norm_t FloatType::getNorm( string& norm_string ) const //-------------------------------------------------------------------------- // Function: FloatType::setNorm -///\brief Sets the mantissa normalization of a floating-point datatype. +///\brief Sets the mantissa normalization of a floating-point datatype. ///\param norm - IN: Mantissa normalization type ///\exception H5::DataTypeIException ///\par Description /// Valid values for normalization type include: /// \li \c H5T_NORM_IMPLIED (0) - MSB of mantissa is not stored -/// \li \c H5T_NORM_MSBSET (1) - MSB of mantissa is always 1 -/// \li \c H5T_NORM_NONE (2) - Mantissa is not normalized +/// \li \c H5T_NORM_MSBSET (1) - MSB of mantissa is always 1 +/// \li \c H5T_NORM_NONE (2) - Mantissa is not normalized // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FloatType::setNorm( H5T_norm_t norm ) const @@ -220,16 +220,16 @@ void FloatType::setNorm( H5T_norm_t norm ) const //-------------------------------------------------------------------------- // Function: FloatType::getInpad -///\brief Retrieves the internal padding type for unused bits in -/// this floating-point datatypes. +///\brief Retrieves the internal padding type for unused bits in +/// this floating-point datatypes. ///\return Internal padding type, which can be: /// \li \c H5T_PAD_ZERO (0) - Set background to zeros /// \li \c H5T_PAD_ONE (1) - Set background to ones /// \li \c H5T_PAD_BACKGROUND (2) - Leave background alone ///\exception H5::DataTypeIException ///\par Description -/// For your convenience, this function also provides the text -/// string of the returned internal padding type, via parameter +/// For your convenience, this function also provides the text +/// string of the returned internal padding type, via parameter /// \a pad_string. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -252,14 +252,14 @@ H5T_pad_t FloatType::getInpad( string& pad_string ) const //-------------------------------------------------------------------------- // Function: FloatType::setInpad -///\brief Fills unused internal floating point bits. +///\brief Fills unused internal floating point bits. ///\param inpad - IN: Internal padding type ///\exception H5::DataTypeIException ///\par Description -/// If any internal bits of a floating point type are unused -/// (that is, those significant bits which are not part of the -/// sign, exponent, or mantissa), then they will be filled -/// according to the padding value provided by \a inpad. +/// If any internal bits of a floating point type are unused +/// (that is, those significant bits which are not part of the +/// sign, exponent, or mantissa), then they will be filled +/// according to the padding value provided by \a inpad. ///\par /// Valid values for normalization type include: /// \li \c H5T_PAD_ZERO (0) - Set background to zeros diff --git a/c++/src/H5FloatType.h b/c++/src/H5FloatType.h index bdc2f6f..206443d 100644 --- a/c++/src/H5FloatType.h +++ b/c++/src/H5FloatType.h @@ -25,31 +25,31 @@ class H5_DLLCPP FloatType : public AtomType { // Creates a floating-point type using a predefined type FloatType( const PredType& pred_type ); - // Gets the floating-point datatype of the specified dataset + // Gets the floating-point datatype of the specified dataset FloatType( const DataSet& dataset ); - // Retrieves the exponent bias of a floating-point type. + // Retrieves the exponent bias of a floating-point type. size_t getEbias() const; - // Sets the exponent bias of a floating-point type. + // Sets the exponent bias of a floating-point type. void setEbias( size_t ebias ) const; - // Retrieves floating point datatype bit field information. + // Retrieves floating point datatype bit field information. void getFields( size_t& spos, size_t& epos, size_t& esize, size_t& mpos, size_t& msize ) const; - // Sets locations and sizes of floating point bit fields. + // Sets locations and sizes of floating point bit fields. void setFields( size_t spos, size_t epos, size_t esize, size_t mpos, size_t msize ) const; - // Retrieves the internal padding type for unused bits in floating-point datatypes. + // Retrieves the internal padding type for unused bits in floating-point datatypes. H5T_pad_t getInpad( string& pad_string ) const; - - // Fills unused internal floating point bits. + + // Fills unused internal floating point bits. void setInpad( H5T_pad_t inpad ) const; - // Retrieves mantissa normalization of a floating-point datatype. + // Retrieves mantissa normalization of a floating-point datatype. H5T_norm_t getNorm( string& norm_string ) const; - // Sets the mantissa normalization of a floating-point datatype. + // Sets the mantissa normalization of a floating-point datatype. void setNorm( H5T_norm_t norm ) const; // Default constructor diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index d2b96be..51e00a0 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -98,7 +98,7 @@ void* Group::Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_ty ///\return A reference ///\exception H5::IdComponentException ///\par Description -// This function passes H5R_OBJECT and -1 to the protected +// This function passes H5R_OBJECT and -1 to the protected // function for it to pass to the C API H5Rcreate // to create a reference to the named object. // Programmer Binh-Minh Ribler - May, 2004 @@ -114,10 +114,10 @@ void* Group::Reference(const char* name) const ///\param ref - IN: Reference to query ///\param ref_type - IN: Type of reference to query // Return An object type, which can be one of the following: -// H5G_LINK Object is a symbolic link. -// H5G_GROUP Object is a group. -// H5G_DATASET Object is a dataset. -// H5G_TYPE Object is a named datatype +// H5G_LINK Object is a symbolic link. +// H5G_GROUP Object is a group. +// H5G_DATASET Object is a dataset. +// H5G_TYPE Object is a named datatype // Exception H5::IdComponentException // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- @@ -189,7 +189,7 @@ void Group::throwException(const string func_name, const string msg) const // ID reference counting mechanism - BMR, Feb 20, 2005 //-------------------------------------------------------------------------- Group::~Group() -{ +{ // The group id will be closed properly try { decRefCount(); @@ -197,7 +197,7 @@ Group::~Group() catch (Exception close_error) { cerr << "Group::~Group - " << close_error.getDetailMsg() << endl; } -} +} #ifndef H5_NO_NAMESPACE } // end namespace diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp index dc7d99e..db52c97 100644 --- a/c++/src/H5IdComponent.cpp +++ b/c++/src/H5IdComponent.cpp @@ -79,10 +79,10 @@ void IdComponent::decRefCount(hid_t obj_id) const if (p_valid_id(obj_id)) if (H5Idec_ref(obj_id) < 0) if (H5Iget_ref(obj_id) <= 0) - throw IdComponentException("IdComponent::decRefCount", + throw IdComponentException("IdComponent::decRefCount", "object ref count is 0 or negative"); else - throw IdComponentException("IdComponent::decRefCount", + throw IdComponentException("IdComponent::decRefCount", "decrementing object ref count failed"); } @@ -135,8 +135,8 @@ int IdComponent::getCounter() const // Description // The underlaying reference counting in the C library ensures // that the current valid id of this object is properly closed. -// Copy the id from rhs to this object, then increment the -// reference counter of the id to indicate that another object +// Copy the id from rhs to this object, then increment the +// reference counter of the id to indicate that another object // is referencing it. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -177,7 +177,7 @@ void IdComponent::setId( hid_t new_id ) //-------------------------------------------------------------------------- // Function: IdComponent::getId -///\brief Returns the id of this object +///\brief Returns the id of this object ///\return HDF5 id // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -193,8 +193,8 @@ hid_t IdComponent::getId () const //-------------------------------------------------------------------------- IdComponent::~IdComponent() { -/* uncomment this block and complete it when deciding to use dontAtExit - unless the atexit/global destructor problem is fixed, then +/* uncomment this block and complete it when deciding to use dontAtExit + unless the atexit/global destructor problem is fixed, then remove it- BMR 11/14/00 if( id == NOTATEXIT ) @@ -219,7 +219,7 @@ IdComponent::~IdComponent() { // // Implementation of protected functions for HDF5 Reference Interface. -// +// #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- @@ -235,7 +235,7 @@ IdComponent::IdComponent() : id(-1) {} // Exception: H5::IdComponentException // Description: // This function is protected so that the user applications can -// only have access to its code via allowable classes, namely, +// only have access to its code via allowable classes, namely, // H5File and H5Object subclasses. // Programmer Binh-Minh Ribler - Jul, 2004 //-------------------------------------------------------------------------- @@ -247,7 +247,7 @@ string IdComponent::p_get_file_name() const // If H5Aget_name returns a negative value, raise an exception, if( name_size < 0 ) { - throw IdComponentException("IdComponent::p_get_file_name", + throw IdComponentException("IdComponent::p_get_file_name", "H5Fget_name failed"); } @@ -258,7 +258,7 @@ string IdComponent::p_get_file_name() const // Check for failure again if( name_size < 0 ) { - throw IdComponentException("IdComponent::p_get_file_name", + throw IdComponentException("IdComponent::p_get_file_name", "H5Fget_name failed"); } @@ -298,10 +298,10 @@ void* IdComponent::p_reference(const char* name, hid_t space_id, H5R_type_t ref_ // ref - IN: Reference to query // ref_type - IN: Type of reference to query // Return An object type, which can be one of the following: -// H5G_LINK Object is a symbolic link. -// H5G_GROUP Object is a group. -// H5G_DATASET Object is a dataset. -// H5G_TYPE Object is a named datatype +// H5G_LINK Object is a symbolic link. +// H5G_GROUP Object is a group. +// H5G_DATASET Object is a dataset. +// H5G_TYPE Object is a named datatype // Exception H5::IdComponentException // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- @@ -340,7 +340,7 @@ hid_t IdComponent::p_get_region(void *ref, H5R_type_t ref_type) const // // Local functions used in this class -// +// //-------------------------------------------------------------------------- // Function: p_valid_id diff --git a/c++/src/H5IntType.cpp b/c++/src/H5IntType.cpp index f161c13..868785b 100644 --- a/c++/src/H5IntType.cpp +++ b/c++/src/H5IntType.cpp @@ -64,7 +64,7 @@ IntType::IntType( const PredType& pred_type ) : AtomType() //-------------------------------------------------------------------------- // Function: IntType overloaded constructor -///\brief Creates an integer datatype using the id of an existing +///\brief Creates an integer datatype using the id of an existing /// datatype. ///\param existing_id - IN: Id of an existing datatype ///\exception H5::DataTypeIException @@ -80,7 +80,7 @@ IntType::IntType( const hid_t existing_id ) : AtomType( existing_id ) {} // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IntType::IntType( const DataSet& dataset ) : AtomType() -{ +{ // Calls C function H5Dget_type to get the id of the datatype id = H5Dget_type( dataset.getId() ); @@ -88,7 +88,7 @@ IntType::IntType( const DataSet& dataset ) : AtomType() { throw DataSetIException("IntType constructor", "H5Dget_type failed"); } -} +} //-------------------------------------------------------------------------- // Function: IntType::getSign @@ -104,7 +104,7 @@ H5T_sign_t IntType::getSign() const // Returns a valid sign type if no errors if( type_sign == H5T_SGN_ERROR ) { - throw DataTypeIException("IntType::getSign", + throw DataTypeIException("IntType::getSign", "H5Tget_sign failed - returned H5T_SGN_ERROR for the sign type"); } return( type_sign ); @@ -112,7 +112,7 @@ H5T_sign_t IntType::getSign() const //-------------------------------------------------------------------------- // Function: IntType::getSign -///\brief Sets the sign property for an integer type. +///\brief Sets the sign property for an integer type. ///\param sign - IN: Sign type ///\exception H5::DataTypeIException // Programmer Binh-Minh Ribler - 2000 diff --git a/c++/src/H5IntType.h b/c++/src/H5IntType.h index efbed39..8118c2e 100644 --- a/c++/src/H5IntType.h +++ b/c++/src/H5IntType.h @@ -30,7 +30,7 @@ class H5_DLLCPP IntType : public AtomType { // Retrieves the sign type for an integer type H5T_sign_t getSign() const; - // Sets the sign proprety for an integer type. + // Sets the sign proprety for an integer type. void setSign( H5T_sign_t sign ) const; // Default constructor diff --git a/c++/src/H5Library.cpp b/c++/src/H5Library.cpp index 8c0aace..71fdc7a 100644 --- a/c++/src/H5Library.cpp +++ b/c++/src/H5Library.cpp @@ -14,7 +14,7 @@ #include -#include "H5CppDoc.h" // included only for Doxygen to generate part of RM +#include "H5CppDoc.h" // included only for Doxygen to generate part of RM #include "H5Include.h" #include "H5Exception.h" #include "H5Library.h" @@ -30,7 +30,7 @@ bool H5Library::need_cleanup = false; //-------------------------------------------------------------------------- // Function: H5Library::open -///\brief Initializes the HDF5 library. +///\brief Initializes the HDF5 library. /// ///\exception H5::LibraryIException // Programmer Binh-Minh Ribler - 2000 @@ -46,7 +46,7 @@ void H5Library::open() //-------------------------------------------------------------------------- // Function: H5Library::close -///\brief Flushes all data to disk, closes files, and cleans up memory. +///\brief Flushes all data to disk, closes files, and cleans up memory. /// ///\exception H5::LibraryIException // Programmer Binh-Minh Ribler - 2000 @@ -78,7 +78,7 @@ void H5Library::dontAtExit() //-------------------------------------------------------------------------- // Function: H5Library::getLibVersion -///\brief Returns the HDF library release number. +///\brief Returns the HDF library release number. ///\param majnum - OUT: Major version of the library ///\param minnum - OUT: Minor version of the library ///\param relnum - OUT: Release number of the library @@ -96,7 +96,7 @@ void H5Library::getLibVersion( unsigned& majnum, unsigned& minnum, unsigned& rel //-------------------------------------------------------------------------- // Function: H5Library::checkVersion -///\brief Verifies that the arguments match the version numbers +///\brief Verifies that the arguments match the version numbers /// compiled into the library ///\param majnum - IN: Major version of the library ///\param minnum - IN: Minor version of the library @@ -120,21 +120,21 @@ void H5Library::checkVersion(unsigned majnum, unsigned minnum, unsigned relnum) //-------------------------------------------------------------------------- // Function: H5Library::garbageCollect ///\brief Walks through all the garbage collection routines for the -/// library, which are supposed to free any unused memory they +/// library, which are supposed to free any unused memory they /// have allocated. /// ///\exception H5::LibraryIException ///\par Description -/// It is not required that H5Library::garbageCollect be called -/// at any particular time; it is only necessary in certain -/// situations, such as when the application has performed actions -/// that cause the library to allocate many objects. The -/// application should call H5Library::garbageCollect if it -/// eventually releases those objects and wants to reduce the -/// memory used by the library from the peak usage required. +/// It is not required that H5Library::garbageCollect be called +/// at any particular time; it is only necessary in certain +/// situations, such as when the application has performed actions +/// that cause the library to allocate many objects. The +/// application should call H5Library::garbageCollect if it +/// eventually releases those objects and wants to reduce the +/// memory used by the library from the peak usage required. ///\par -/// The library automatically garbage collects all the free -/// lists when the application ends. +/// The library automatically garbage collects all the free +/// lists when the application ends. // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- void H5Library::garbageCollect() @@ -158,13 +158,13 @@ void H5Library::garbageCollect() ///\exception H5::LibraryIException ///\par Description /// Setting a value of -1 for a limit means no limit of that type. -/// For more information on free list limits, please refer to C +/// For more information on free list limits, please refer to C /// layer Reference Manual at: /// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5.html#Library-SetFreeListLimits // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- -void H5Library::setFreeListLimits(int reg_global_lim, int reg_list_lim, - int arr_global_lim, int arr_list_lim, int blk_global_lim, +void H5Library::setFreeListLimits(int reg_global_lim, int reg_list_lim, + int arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim) { herr_t ret_value = H5set_free_list_limits(reg_global_lim, reg_list_lim, arr_global_lim, arr_list_lim, blk_global_lim, blk_list_lim); diff --git a/c++/src/H5Library.h b/c++/src/H5Library.h index 4208cfb..58a53ad 100644 --- a/c++/src/H5Library.h +++ b/c++/src/H5Library.h @@ -23,7 +23,7 @@ namespace H5 { #ifndef DOXYGEN_SHOULD_SKIP_THIS #define NOTATEXIT (-10) // just in case the HDF5 library use more // negative constants. Note: the solution used for the atexit/global - // destructors is not reliable, and desperately needs improvement + // destructors is not reliable, and desperately needs improvement // It is not even working, inifiteloop message still printed when // calling H5close #endif // DOXYGEN_SHOULD_SKIP_THIS @@ -34,30 +34,30 @@ class H5_DLLCPP H5Library { static bool need_cleanup; // indicates if H5close should be called #endif // DOXYGEN_SHOULD_SKIP_THIS - // Initializes the HDF5 library. - static void open(); + // Initializes the HDF5 library. + static void open(); - // Flushes all data to disk, closes files, and cleans up memory. - static void close(); + // Flushes all data to disk, closes files, and cleans up memory. + static void close(); // Instructs library not to install atexit cleanup routine - static void dontAtExit(); + static void dontAtExit(); - // Returns the HDF library release number. - static void getLibVersion( unsigned& majnum, unsigned& minnum, unsigned& relnum ); + // Returns the HDF library release number. + static void getLibVersion( unsigned& majnum, unsigned& minnum, unsigned& relnum ); // Verifies that the arguments match the version numbers compiled // into the library - static void checkVersion( unsigned majnum, unsigned minnum, unsigned relnum ); + static void checkVersion( unsigned majnum, unsigned minnum, unsigned relnum ); - // Walks through all the garbage collection routines for the library, + // Walks through all the garbage collection routines for the library, // which are supposed to free any unused memory they have allocated. static void garbageCollect(); // Sets limits on the different kinds of free lists. static void setFreeListLimits(int reg_global_lim, int reg_list_lim, int arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim); - + private: // Default constructor - no instance ever created H5Library() {}; diff --git a/c++/src/H5Object.cpp b/c++/src/H5Object.cpp index a4c3071..fd982db 100644 --- a/c++/src/H5Object.cpp +++ b/c++/src/H5Object.cpp @@ -32,7 +32,7 @@ namespace H5 { #ifndef DOXYGEN_SHOULD_SKIP_THIS // userAttrOpWrpr simply interfaces between the user's function and the -// C library function H5Aiterate; used to resolve the different prototype +// C library function H5Aiterate; used to resolve the different prototype // problem. May be moved to Iterator later. extern "C" herr_t userAttrOpWrpr( hid_t loc_id, const char* attr_name, void* op_data ) { @@ -49,7 +49,7 @@ extern "C" herr_t userAttrOpWrpr( hid_t loc_id, const char* attr_name, void* op_ //-------------------------------------------------------------------------- // Function: H5Object default constructor (protected) // Description -// The id is set by IdComponent() but subclass constructor will +// The id is set by IdComponent() but subclass constructor will // set it to a valid HDF5 id. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -57,7 +57,7 @@ H5Object::H5Object() : IdComponent() {} //-------------------------------------------------------------------------- // Function: H5Object overloaded constructor (protected) -// Purpose Creates an H5Object object using the id of an existing HDF5 +// Purpose Creates an H5Object object using the id of an existing HDF5 // object. // Parameters object_id - IN: Id of an existing HDF5 object // Programmer Binh-Minh Ribler - 2000 @@ -68,7 +68,7 @@ H5Object::H5Object( const hid_t object_id ) : IdComponent( object_id ) {} //-------------------------------------------------------------------------- // Function: H5Object copy constructor -///\brief Copy constructor: makes a copy of the original H5Object +///\brief Copy constructor: makes a copy of the original H5Object /// instance. ///\param original - IN: H5Object instance to copy // Programmer Binh-Minh Ribler - 2000 @@ -80,18 +80,18 @@ H5Object::H5Object( const H5Object& original ) : IdComponent( original ) {} ///\brief Creates an attribute for a group, dataset, or named datatype. ///\param name - IN: Name of the attribute ///\param data_type - IN: Datatype for the attribute -///\param data_space - IN: Dataspace for the attribute - only simple +///\param data_space - IN: Dataspace for the attribute - only simple /// dataspaces are allowed at this time -///\param create_plist - IN: Creation property list - default to +///\param create_plist - IN: Creation property list - default to /// PropList::DEFAULT ///\return Attribute instance ///\exception H5::AttributeIException ///\par Description -/// The attribute name specified in \a name must be unique. -/// Attempting to create an attribute with the same name as an -/// existing attribute will raise an exception, leaving the -/// pre-existing attribute intact. To overwrite an existing -/// attribute with a new attribute of the same name, first +/// The attribute name specified in \a name must be unique. +/// Attempting to create an attribute with the same name as an +/// existing attribute will raise an exception, leaving the +/// pre-existing attribute intact. To overwrite an existing +/// attribute with a new attribute of the same name, first /// delete the existing one with \c H5Object::removeAttr, then /// recreate it with this function. // Programmer Binh-Minh Ribler - 2000 @@ -118,7 +118,7 @@ Attribute H5Object::createAttribute( const char* name, const DataType& data_type //-------------------------------------------------------------------------- // Function: H5Object::createAttribute ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes +/// It differs from the above function in that it takes /// a reference to an \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -152,7 +152,7 @@ Attribute H5Object::openAttribute( const char* name ) const //-------------------------------------------------------------------------- // Function: H5Object::openAttribute ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes +/// It differs from the above function in that it takes /// a reference to an \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -189,7 +189,7 @@ Attribute H5Object::openAttribute( const unsigned int idx ) const /// object, which may be a group, dataset or named datatype. ///\param user_op - IN: User's function to operate on each attribute ///\param idx - IN/OUT: Starting (IN) and ending (OUT) attribute indices -///\param op_data - IN: User's data to pass to user's operator function +///\param op_data - IN: User's data to pass to user's operator function ///\return Returned value of the last operator if it was non-zero, or /// zero if all attributes were processed ///\exception H5::AttributeIException @@ -233,7 +233,7 @@ int H5Object::getNumAttrs() const int num_attrs = H5Aget_num_attrs( id ); if( num_attrs < 0 ) { - throw AttributeIException("H5Object::getNumAttrs", + throw AttributeIException("H5Object::getNumAttrs", "H5Aget_num_attrs failed - returned negative number of attributes"); } else @@ -259,7 +259,7 @@ void H5Object::removeAttr( const char* name ) const //-------------------------------------------------------------------------- // Function: H5Object::removeAttr ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function in that it takes +/// It differs from the above function in that it takes /// a reference to an \c std::string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- diff --git a/c++/src/H5Object.h b/c++/src/H5Object.h index 6b0d0fd..405193f 100644 --- a/c++/src/H5Object.h +++ b/c++/src/H5Object.h @@ -18,8 +18,8 @@ #include "H5Classes.h" // constains forward class declarations -// H5Object is a baseclass. It has these subclasses: -// Group, AbstractDs, and DataType. +// H5Object is a baseclass. It has these subclasses: +// Group, AbstractDs, and DataType. // AbstractDs, in turn, has subclasses DataSet and Attribute. // DataType, in turn, has several specific datatypes as subclasses. @@ -31,8 +31,8 @@ namespace H5 { class H5_DLLCPP H5Object; // forward declaration for UserData4Aiterate // Define the operator function pointer for H5Aiterate(). -typedef void (*attr_operator_t)( H5Object& loc/*in*/, - const string attr_name/*in*/, +typedef void (*attr_operator_t)( H5Object& loc/*in*/, + const string attr_name/*in*/, void *operator_data/*in,out*/); class UserData4Aiterate { // user data for attribute iteration diff --git a/c++/src/H5PredType.cpp b/c++/src/H5PredType.cpp index a5233af..1809254 100644 --- a/c++/src/H5PredType.cpp +++ b/c++/src/H5PredType.cpp @@ -33,17 +33,17 @@ namespace H5 { #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- // Function: PredType overloaded constructor -///\brief Creates a PredType object using the id of an existing +///\brief Creates a PredType object using the id of an existing /// predefined datatype. ///\param predtype_id - IN: Id of a predefined datatype // Description -// This constructor creates a predefined datatype, so it sets +// This constructor creates a predefined datatype, so it sets // DataType::is_predtype to true. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- PredType::PredType( const hid_t predtype_id ) : AtomType( predtype_id ) -{ - is_predtype = true; +{ + is_predtype = true; } //-------------------------------------------------------------------------- @@ -64,7 +64,7 @@ PredType::PredType( const PredType& original ) : AtomType( original ) {} const PredType PredType::NotAtexit; // only for atexit/global dest. problem // Definition of pre-defined types -// Note: the parameter E_xxxx_yyyy is the enum value that represents +// Note: the parameter E_xxxx_yyyy is the enum value that represents // the corresponding HDF5 predefined type H5T_xxxx_yyyy. This enum value // is stored in PredType::id since it is a PredType object id, in a way. // In addition, this storage makes things safely simpler. When a PredType @@ -510,18 +510,18 @@ hid_t PredType::getId() const void PredType::commit( H5Object& loc, const char* name ) { throw DataTypeIException("PredType::commit", "Attempting to commit a predefined datatype. This operation is invalid" ); -} +} void PredType::commit( H5Object& loc, const string& name ) { commit( loc, name.c_str()); -} +} bool PredType::committed() { throw DataTypeIException("PredType::committed", "Error: Attempting to check for commit status on a predefined datatype." ); return (0); -} +} #endif // DOXYGEN_SHOULD_SKIP_THIS // Default destructor diff --git a/c++/src/H5PredType.h b/c++/src/H5PredType.h index 7742c90..ef1a782 100644 --- a/c++/src/H5PredType.h +++ b/c++/src/H5PredType.h @@ -28,7 +28,7 @@ namespace H5 { class H5_DLLCPP PredType : public AtomType { public: // Makes a copy of the predefined type and stores the new - // id in the left hand side object. + // id in the left hand side object. PredType& operator=( const PredType& rhs ); // Copy constructor - makes copy of the original object @@ -187,7 +187,7 @@ class H5_DLLCPP PredType : public AtomType { #endif // DOXYGEN_SHOULD_SKIP_THIS private: - // added this to work around the atexit/global destructor problem + // added this to work around the atexit/global destructor problem // temporarily - it'll prevent the use of atexit to clean up static const PredType NotAtexit; // not working yet @@ -203,7 +203,7 @@ class H5_DLLCPP PredType : public AtomType { E_STD_I8BE, E_STD_I8LE, E_STD_I16BE, E_STD_I16LE, E_STD_I32BE, E_STD_I32LE, E_STD_I64BE, E_STD_I64LE, E_STD_U8BE, E_STD_U8LE, E_STD_U16BE, E_STD_U16LE, E_STD_U32BE, E_STD_U32LE, E_STD_U64BE, - E_STD_U64LE, E_STD_B8BE, E_STD_B8LE, E_STD_B16BE, E_STD_B16LE, + E_STD_U64LE, E_STD_B8BE, E_STD_B8LE, E_STD_B16BE, E_STD_B16LE, E_STD_B32BE, E_STD_B32LE, E_STD_B64BE, E_STD_B64LE, E_STD_REF_OBJ, E_STD_REF_DSETREG, @@ -219,8 +219,8 @@ class H5_DLLCPP PredType : public AtomType { E_ALPHA_U16, E_ALPHA_U32, E_ALPHA_U64, E_ALPHA_B8, E_ALPHA_B16, E_ALPHA_B32, E_ALPHA_B64, E_ALPHA_F32, E_ALPHA_F64, - E_MIPS_I8, E_MIPS_I16, E_MIPS_I32, E_MIPS_I64, E_MIPS_U8, - E_MIPS_U16, E_MIPS_U32, E_MIPS_U64, E_MIPS_B8, E_MIPS_B16, + E_MIPS_I8, E_MIPS_I16, E_MIPS_I32, E_MIPS_I64, E_MIPS_U8, + E_MIPS_U16, E_MIPS_U32, E_MIPS_U64, E_MIPS_B8, E_MIPS_B16, E_MIPS_B32, E_MIPS_B64, E_MIPS_F32, E_MIPS_F64, E_NATIVE_CHAR, E_NATIVE_INT, E_NATIVE_FLOAT, E_NATIVE_SCHAR, diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp index 570edd6..ff06a8a 100644 --- a/c++/src/H5PropList.cpp +++ b/c++/src/H5PropList.cpp @@ -54,11 +54,11 @@ PropList::PropList( const PropList& original ) : IdComponent( original ) {} ///\param plist_id - IN: Id of the existing property list ///\exception H5::PropListIException // Description -// This function calls H5Pcreate to create a new property list -// if the given id, plist_id, is that of a property class. If -// the given id is equal to H5P_NO_CLASS, then set this -// property's id to H5P_DEFAULT, otherwise, to the given id. -// Note: someone else added this code without comments and this +// This function calls H5Pcreate to create a new property list +// if the given id, plist_id, is that of a property class. If +// the given id is equal to H5P_NO_CLASS, then set this +// property's id to H5P_DEFAULT, otherwise, to the given id. +// Note: someone else added this code without comments and this // description was what I came up with from reading the code. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -115,7 +115,7 @@ void PropList::copy( const PropList& like_plist ) ///\return Reference to PropList instance ///\exception H5::PropListIException // Description -// Makes a copy of the property list on the right hand side +// Makes a copy of the property list on the right hand side // and stores the new id in the left hand side object. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -146,7 +146,7 @@ void PropList::copyProp(PropList& dest, const char *name) const //-------------------------------------------------------------------------- // Function: PropList::copyProp ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it +/// It differs from the above function only in what arguments it /// accepts. ///\param dest - IN: Destination property list or class ///\param name - IN: Name of the property to copy - \c std::string @@ -182,7 +182,7 @@ void PropList::copyProp( PropList& dest, PropList& src, const char *name ) const //-------------------------------------------------------------------------- // Function: PropList::copyProp ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it +/// It differs from the above function only in what arguments it /// accepts. - Obsolete ///\param dest - IN: Destination property list or class ///\param src - IN: Source property list or class @@ -229,7 +229,7 @@ hid_t PropList::getClass() const hid_t plist_class = H5Pget_class( id ); if( plist_class == H5P_NO_CLASS ) { - throw PropListIException("PropList::getClass", + throw PropListIException("PropList::getClass", "H5Pget_class failed - returned H5P_NO_CLASS"); } return( plist_class ); @@ -243,14 +243,14 @@ hid_t PropList::getClass() const /// false, otherwise. ///\exception H5::PropListIException ///\par Description -/// This routine checks if a property exists within a property +/// This routine checks if a property exists within a property /// list or class. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- bool PropList::propExist(const char* name ) const { - // Calls C routine H5Pexist to determine whether a property exists - // within a property list or class. It returns a positive value, 0, + // Calls C routine H5Pexist to determine whether a property exists + // within a property list or class. It returns a positive value, 0, // or a negative value htri_t ret_value = H5Pexist(id, name); if( ret_value > 0 ) @@ -265,7 +265,7 @@ bool PropList::propExist(const char* name ) const //-------------------------------------------------------------------------- // Function: PropList::propExist ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it +/// It differs from the above function only in what arguments it /// accepts. ///\param name - IN: Name of property to check for - \c std::string // Programmer: Binh-Minh Ribler - April, 2004 @@ -281,7 +281,7 @@ bool PropList::propExist(const string& name ) const /// ///\exception H5::PropListIException ///\par Description -/// Releases memory and detaches a class from the property +/// Releases memory and detaches a class from the property /// list class hierarchy. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- @@ -301,8 +301,8 @@ void PropList::closeClass() const ///\param value - OUT: Pointer to the buffer for the property value ///\exception H5::PropListIException ///\par Description -/// Retrieves a copy of the value for a property in a property -/// list. The property name must exist or this routine will +/// Retrieves a copy of the value for a property in a property +/// list. The property name must exist or this routine will /// throw an exception. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- @@ -317,7 +317,7 @@ void PropList::getProperty(const char* name, void* value) const //-------------------------------------------------------------------------- // Function: PropList::getProperty ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it +/// It differs from the above function only in what arguments it /// accepts. ///\param name - IN: Name of property to query - \c char pointer ///\return The property that is a \c std::string. @@ -344,7 +344,7 @@ string PropList::getProperty(const char* name) const //-------------------------------------------------------------------------- // Function: PropList::getProperty ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it +/// It differs from the above function only in what arguments it /// accepts. ///\param name - IN: Name of property to query - \c str::string ///\param value - OUT: Pointer to the buffer for the property value @@ -357,7 +357,7 @@ void PropList::getProperty(const string& name, void* value) const //-------------------------------------------------------------------------- // Function: PropList::getProperty ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it +/// It differs from the above function only in what arguments it /// accepts. ///\param name - IN: Name of property to query - \c std::string ///\return The property that is a \c std::string. @@ -375,9 +375,9 @@ string PropList::getProperty(const string& name) const ///\return Size of the property ///\exception H5::PropListIException ///\par Description -/// This routine retrieves the size of a property's value -/// in bytes. Zero-sized properties are allowed and the return -/// value will be of 0. This function works for both property +/// This routine retrieves the size of a property's value +/// in bytes. Zero-sized properties are allowed and the return +/// value will be of 0. This function works for both property /// lists and classes. // Programmer: Binh-Minh Ribler - April, 2004 //-------------------------------------------------------------------------- @@ -394,7 +394,7 @@ size_t PropList::getPropSize(const char *name) const //-------------------------------------------------------------------------- // Function: PropList::getPropSize ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it +/// It differs from the above function only in what arguments it /// accepts. ///\param name - IN: Name of property to query - \c std::string /// @@ -463,7 +463,7 @@ void PropList::setProperty(const char* name, void* value) const //-------------------------------------------------------------------------- // Function: PropList::setProperty ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it +/// It differs from the above function only in what arguments it /// accepts. ///\param name - IN: Name of property to set - \c char pointer ///\param charptr - IN: Char pointer to the value for the property @@ -480,7 +480,7 @@ void PropList::setProperty(const char* name, const char* charptr) const //-------------------------------------------------------------------------- // Function: PropList::setProperty ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it +/// It differs from the above function only in what arguments it /// accepts. ///\param name - IN: Name of property to set - \c char pointer ///\param strg - IN: Value for the property is a \c std::string @@ -494,7 +494,7 @@ void PropList::setProperty(const char* name, string& strg) const //-------------------------------------------------------------------------- // Function: PropList::setProperty ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it +/// It differs from the above function only in what arguments it /// accepts. ///\param name - IN: Name of property to set - \c std::string ///\param value - IN: Void pointer to the value for the property @@ -508,7 +508,7 @@ void PropList::setProperty(const string& name, void* value) const //-------------------------------------------------------------------------- // Function: PropList::setProperty ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it +/// It differs from the above function only in what arguments it /// accepts. ///\param name - IN: Name of property to set - \c std::string ///\param strg - IN: Value for the property is a \c std::string @@ -523,7 +523,7 @@ void PropList::setProperty(const string& name, string& strg) const // Function: PropList::isAClass ///\brief Determines whether a property list is a certain class. ///\param prop_class - IN: Property class to query -///\return true if the property list is a member of the property list +///\return true if the property list is a member of the property list /// class, and false, otherwise. ///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 @@ -561,7 +561,7 @@ void PropList::removeProp(const char *name) const //-------------------------------------------------------------------------- // Function: PropList::removeProp ///\brief This is an overloaded member function, provided for convenience. -/// It differs from the above function only in what arguments it +/// It differs from the above function only in what arguments it /// accepts. ///\param name - IN: Name of property to remove - \c std::string // Programmer: Binh-Minh Ribler - April, 2004 @@ -575,7 +575,7 @@ void PropList::removeProp(const string& name) const // Function: PropList::operator== ///\brief Compares this property list or class against the given list or class. ///\param rhs - IN: Reference to the property list to compare -///\return true if the property lists or classes are equal, and +///\return true if the property lists or classes are equal, and /// false, otherwise. ///\exception H5::PropListIException // Programmer: Binh-Minh Ribler - April, 2004 @@ -628,7 +628,7 @@ PropList::~PropList() catch (Exception close_error) { cerr << "PropList::~PropList - " << close_error.getDetailMsg() << endl; } -} +} #ifndef H5_NO_NAMESPACE } // end namespace diff --git a/c++/src/H5PropList.h b/c++/src/H5PropList.h index 5d5eb3e..b2ebca6 100644 --- a/c++/src/H5PropList.h +++ b/c++/src/H5PropList.h @@ -25,7 +25,7 @@ class H5_DLLCPP PropList : public IdComponent { // Default property list static const PropList DEFAULT; - // Creates a property list of a given type or creates a copy of an + // Creates a property list of a given type or creates a copy of an // existing property list giving the property list id. PropList(const hid_t plist_id); diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp index 4bd946d..04fb147 100644 --- a/c++/src/H5StrType.cpp +++ b/c++/src/H5StrType.cpp @@ -60,18 +60,18 @@ StrType::StrType( const PredType& pred_type ) : AtomType() ///\param existing_id - IN: Id of an existing datatype ///\exception H5::DataTypeIException // Description -// The 1st argument could have been skipped, but this -// constructor will collide with the one that takes an +// The 1st argument could have been skipped, but this +// constructor will collide with the one that takes an // existing id. // // Update: by passing 'size' by reference will avoid the // clashing problem, so the 1st argument can actually be -// omitted. This constructor should be replaced by the +// omitted. This constructor should be replaced by the // other after announcing. - May, 2004 -///\note +///\note /// This constructor will be obsolete in later releases, /// please use StrType( const size_t& size ) instead. -// Programmer Binh-Minh Ribler - 2000 +// Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- StrType::StrType( const PredType& pred_type, const size_t size ) : AtomType() { @@ -124,7 +124,7 @@ StrType::StrType( const DataSet& dataset ) : AtomType () //-------------------------------------------------------------------------- // Function: StrType::getCset -///\brief Retrieves the character set type of this string datatype. +///\brief Retrieves the character set type of this string datatype. ///\return Character set type, which can be: /// \li \c H5T_CSET_ASCII (0) - Character set is US ASCII. ///\exception H5::DataTypeIException @@ -144,7 +144,7 @@ H5T_cset_t StrType::getCset() const //-------------------------------------------------------------------------- // Function: StrType::setCset -///\brief Sets character set to be used. +///\brief Sets character set to be used. ///\param cset - IN: character set type ///\exception H5::DataTypeIException /// \li \c H5T_CSET_ASCII (0) - Character set is US ASCII. @@ -162,7 +162,7 @@ void StrType::setCset( H5T_cset_t cset ) const //-------------------------------------------------------------------------- // Function: StrType::getCset -///\brief Retrieves the storage mechanism for of this string datatype. +///\brief Retrieves the storage mechanism for of this string datatype. ///\return String storage mechanism, which can be: /// \li \c H5T_STR_NULLTERM (0) - Null terminate (as C does) /// \li \c H5T_STR_NULLPAD (0) - Pad with zeros @@ -177,7 +177,7 @@ H5T_str_t StrType::getStrpad() const // Returns a valid string padding type if successful if( strpad == H5T_STR_ERROR ) { - throw DataTypeIException("StrType::getStrpad", + throw DataTypeIException("StrType::getStrpad", "H5Tget_strpad failed - returned H5T_STR_ERROR"); } return( strpad ); diff --git a/c++/src/H5StrType.h b/c++/src/H5StrType.h index 9e4483e..6724f31 100644 --- a/c++/src/H5StrType.h +++ b/c++/src/H5StrType.h @@ -31,22 +31,22 @@ class H5_DLLCPP StrType : public AtomType { // Creates a string type with specified length - will be obsolete StrType(const PredType& pred_type, const size_t size); - // Gets the string datatype of the specified dataset + // Gets the string datatype of the specified dataset StrType(const DataSet& dataset); - // Retrieves the character set type of this string datatype. + // Retrieves the character set type of this string datatype. H5T_cset_t getCset() const; - // Sets character set to be used. + // Sets character set to be used. void setCset(H5T_cset_t cset) const; - // Retrieves the string padding method for this string datatype. + // Retrieves the string padding method for this string datatype. H5T_str_t getStrpad() const; - // Defines the storage mechanism for character strings. + // Defines the storage mechanism for character strings. void setStrpad(H5T_str_t strpad) const; - // default constructor + // default constructor StrType(); // Creates a string datatype using an existing id diff --git a/c++/src/H5VarLenType.cpp b/c++/src/H5VarLenType.cpp index 076ba12..547bc8a 100644 --- a/c++/src/H5VarLenType.cpp +++ b/c++/src/H5VarLenType.cpp @@ -58,7 +58,7 @@ VarLenType::VarLenType(const VarLenType& original) : DataType(original) {} ///\param base_type - IN: Pointer to existing datatype ///\exception H5::DataTypeIException // Description -// DataType passed by pointer to avoid clashing with copy +// DataType passed by pointer to avoid clashing with copy // constructor. // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index 180cc1f..a20b758 100644 --- a/c++/test/dsets.cpp +++ b/c++/test/dsets.cpp @@ -50,7 +50,7 @@ const string DSET_BOGUS_NAME ("bogus"); const int H5Z_FILTER_BOGUS = 305; // Local prototypes -static size_t bogus(unsigned int flags, size_t cd_nelmts, +static size_t bogus(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); void cleanup_dsets(void); @@ -85,7 +85,7 @@ test_create( H5File& file) dims[1] = 512; DataSpace space (2, dims, NULL); - // Create a dataset using the default dataset creation properties. + // Create a dataset using the default dataset creation properties. // We're not sure what they are, so we won't check. dataset = new DataSet (file.createDataSet (DSET_DEFAULT_NAME, PredType::NATIVE_DOUBLE, space)); @@ -101,7 +101,7 @@ test_create( H5File& file) // dataset can only be created once. If an exception is not thrown for // this action by createDataSet, then throw an invalid action exception. try { - dataset = new DataSet (file.createDataSet + dataset = new DataSet (file.createDataSet (DSET_DEFAULT_NAME, PredType::NATIVE_DOUBLE, space)); // continuation here, that means no exception has been thrown @@ -140,7 +140,7 @@ test_create( H5File& file) csize[1] = 100; create_parms.setChunk( 2, csize ); - dataset = new DataSet (file.createDataSet + dataset = new DataSet (file.createDataSet (DSET_CHUNKED_NAME, PredType::NATIVE_DOUBLE, space, create_parms)); // Note: this one has no error message in C when failure occurs? @@ -176,7 +176,7 @@ test_create( H5File& file) /*------------------------------------------------------------------------- * Function: check_values * - * Purpose: Checks a read value against the written value. If they are + * Purpose: Checks a read value against the written value. If they are * different, the function will print out a message and the * different values. This function is made to reuse the code * segment that is used in various places throughout @@ -195,13 +195,13 @@ test_create( H5File& file) * *------------------------------------------------------------------------- */ -static int +static int check_values (hsize_t i, hsize_t j, int apoint, int acheck) { if (apoint != acheck) { cerr << " Read different values than written.\n" << endl; - cerr << " At index " << (unsigned long)i << "," << + cerr << " At index " << (unsigned long)i << "," << (unsigned long)j << endl; return -1; } @@ -245,7 +245,7 @@ test_simple_io( H5File& file) } char* tconv_buf = new char [1000]; - try + try { // Create the data space hsize_t dims[2]; @@ -322,7 +322,7 @@ test_tconv( H5File& file) //assert (in); TESTING("data type conversion"); - + // Initialize the dataset for (int i = 0; i < 1000000; i++) { out[i*4+0] = 0x11; @@ -352,7 +352,7 @@ test_tconv( H5File& file) if (in[4*i+0]!=out[4*i+3] || in[4*i+1]!=out[4*i+2] || in[4*i+2]!=out[4*i+1] || - in[4*i+3]!=out[4*i+0]) + in[4*i+3]!=out[4*i+0]) { throw Exception("DataSet::read", "Read with byte order conversion failed"); } @@ -453,7 +453,7 @@ test_compression(H5File& file) } char* tconv_buf = new char [1000]; DataSet* dataset = NULL; - try + try { const hsize_t size[2] = {100, 200}; // Create the data space @@ -463,37 +463,37 @@ test_compression(H5File& file) DSetMemXferPropList xfer; xfer.setBuffer (1000, tconv_buf, NULL); - + // Use chunked storage with compression DSetCreatPropList dscreatplist; const hsize_t chunk_size[2] = {2, 25}; dscreatplist.setChunk (2, chunk_size); dscreatplist.setDeflate (6); - + #ifdef H5_HAVE_FILTER_DEFLATE TESTING("compression (setup)"); - + // Create the dataset - dataset = new DataSet (file.createDataSet + dataset = new DataSet (file.createDataSet (DSET_COMPRESS_NAME, PredType::NATIVE_INT, space1, dscreatplist)); - + PASSED(); /*---------------------------------------------------------------------- * STEP 1: Read uninitialized data. It should be zero. - *---------------------------------------------------------------------- + *---------------------------------------------------------------------- */ TESTING("compression (uninitialized read)"); - + dataset->read ((void*) check, PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - + for (i=0; iread ((void*)check, PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); @@ -596,13 +596,13 @@ test_compression(H5File& file) } PASSED(); - + /*---------------------------------------------------------------------- * STEP 6: Test partial I/O by writing to and then reading from a * hyperslab of the dataset. The hyperslab does not line up on chunk * boundaries (we know that case already works from above tests). - *---------------------------------------------------------------------- + *---------------------------------------------------------------------- */ TESTING("compression (partial I/O)"); @@ -616,7 +616,7 @@ test_compression(H5File& file) space1.selectHyperslab( H5S_SELECT_SET, hs_size, hs_offset ); dataset->write ((void*)points, PredType::NATIVE_INT, space1, space1, xfer); dataset->read ((void*)check, PredType::NATIVE_INT, space1, space1, xfer); - + // Check that the values read are the same as the values written for (i=0; iwrite ((void*)points, PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); dataset->read ((void*)check, PredType::NATIVE_INT, DataSpace::ALL, DataSpace::ALL, xfer); - + // Check that the values read are the same as the values written for (i = 0; i < size[0]; i++) for (j = 0; j < size[1]; j++) { int status = check_values (i, j, points[i][j], check[i][j]); - if (status == -1) + if (status == -1) throw Exception("test_compression", "Failed in app-defined method"); } PASSED(); - + /*---------------------------------------------------------------------- * Cleanup - *---------------------------------------------------------------------- + *---------------------------------------------------------------------- */ delete dataset; delete [] tconv_buf; @@ -745,7 +745,7 @@ test_multiopen (H5File& file) // Create first dataset DataSet dset1 = file.createDataSet ("multiopen", PredType::NATIVE_INT, *space, dcpl); - + // Open again the first dataset from the file to another DataSet object. DataSet dset2 = file.openDataSet ("multiopen"); @@ -762,13 +762,13 @@ test_multiopen (H5File& file) hsize_t tmp_size[1]; space->getSimpleExtentDims (tmp_size); - if (cur_size[0]!=tmp_size[0]) + if (cur_size[0]!=tmp_size[0]) { - cerr << " Got " << (int)tmp_size[0] << " instead of " + cerr << " Got " << (int)tmp_size[0] << " instead of " << (int)cur_size[0] << "!" << endl; throw Exception("test_multiopen", "Failed in multi-open with extending"); } - + // clean up and return with success delete space; PASSED(); @@ -849,7 +849,7 @@ test_types(H5File& file) dset = new DataSet(grp.createDataSet("bitfield_1", type, space)); // Fill buffer - for (i=0; i=VERBO_HI) @@ -105,11 +105,11 @@ InvalidActionException::InvalidActionException():Exception(){} // Function: InvalidActionException overloaded constructor // // Purpose: Creates an InvalidActionException with the name of the function, -// which the failure should have occurred but didn't, and a +// which the failure should have occurred but didn't, and a // message explaining why it should fail. // Parameters // func_name - IN: Name of the function where failure should occur -// message - IN: Message +// message - IN: Message //-------------------------------------------------------------------------- InvalidActionException::InvalidActionException(const string func_name, const string message) : Exception(func_name, message) {} diff --git a/c++/test/h5cpputil.h b/c++/test/h5cpputil.h index 38ecbcb..5918afb 100644 --- a/c++/test/h5cpputil.h +++ b/c++/test/h5cpputil.h @@ -62,8 +62,8 @@ template { if (x != value) { - cerr << "*** UNEXPECTED VALUE: " << file_name << ":line " << line - << ":" << msg << " different: " << x << ", should be " << value + cerr << "*** UNEXPECTED VALUE: " << file_name << ":line " << line + << ":" << msg << " different: " << x << ", should be " << value << endl; IncTestNumErrs(); } diff --git a/c++/test/testhdf5.cpp b/c++/test/testhdf5.cpp index 7ea88a1..bf0bd7a 100644 --- a/c++/test/testhdf5.cpp +++ b/c++/test/testhdf5.cpp @@ -51,7 +51,7 @@ using namespace H5; #endif /* !H5_NO_NAMESPACE */ -int +int main(int argc, char *argv[]) { /* Initialize testing framework */ diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp index f4a68a9..fbc0a2e 100644 --- a/c++/test/tfile.cpp +++ b/c++/test/tfile.cpp @@ -99,7 +99,7 @@ const string FILE4("tfile4.h5"); * *------------------------------------------------------------------------- */ -static void +static void test_file_create(void) { // Output message about test being performed @@ -129,13 +129,13 @@ test_file_create(void) catch( FileIException E ) // catch truncating existing file {} // do nothing, FAIL expected - // Close file1 + // Close file1 delete file1; file1 = NULL; - // Try again with H5F_ACC_EXCL. This should fail because the file + // Try again with H5F_ACC_EXCL. This should fail because the file // already exists from the previous steps. - try { + try { H5File file2(FILE1, H5F_ACC_EXCL); // should throw E // Should FAIL but didn't, so throw an invalid action exception @@ -315,7 +315,7 @@ test_file_create(void) * *------------------------------------------------------------------------- */ -static void +static void test_file_open(void) { // Output message about test being performed @@ -340,9 +340,9 @@ test_file_open(void) verify_val(parm2, F2_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__); #ifdef H5_WANT_H5_V1_4_COMPAT - int iparm1, iparm2; // file-creation parameters + int iparm1, iparm2; // file-creation parameters #else /* H5_WANT_H5_V1_4_COMPAT */ - unsigned iparm1, iparm2; // file-creation parameters + unsigned iparm1, iparm2; // file-creation parameters #endif /* H5_WANT_H5_V1_4_COMPAT */ tmpl1.getSymk( iparm1, iparm2); verify_val(iparm1, F2_SYM_INTERN_K, "FileCreatPropList::getSymk", __LINE__, __FILE__); @@ -358,7 +358,7 @@ test_file_open(void) /*------------------------------------------------------------------------- * Function: test_file_size * - * Purpose: Test file size. + * Purpose: Test file size. * * Return: None * @@ -369,7 +369,7 @@ test_file_open(void) * *------------------------------------------------------------------------- */ -static void +static void test_file_size(void) { // Output message about test being performed @@ -405,14 +405,14 @@ test_file_size(void) // use C test utility routine to close property list. H5Pclose(fapl_id); - + } // test_file_size() /*------------------------------------------------------------------------- * Function: test_file_name * - * Purpose: Test getting file's name. + * Purpose: Test getting file's name. * * Return: None * @@ -437,7 +437,7 @@ typedef struct s1_t { float b; } s1_t; -static void +static void test_file_name() { // Output message about test being performed @@ -513,7 +513,7 @@ test_file_name() * *------------------------------------------------------------------------- */ -void +void test_file(void) { // Output message about test being performed diff --git a/c++/test/th5s.cpp b/c++/test/th5s.cpp index d8bde63..153d685 100644 --- a/c++/test/th5s.cpp +++ b/c++/test/th5s.cpp @@ -82,7 +82,7 @@ struct space4_struct { } space4_data={'v',987123,(float)-3.14,'g'}; /* Test data for 4th dataspace */ /*------------------------------------------------------------------------- - * + * * Function: test_h5s_basic * * Purpose: Test basic H5S (dataspace) code @@ -101,7 +101,7 @@ struct space4_struct { * with a special routine. *------------------------------------------------------------------------- */ -static void +static void test_h5s_basic(void) { hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; @@ -113,7 +113,7 @@ test_h5s_basic(void) // Output message about test being performed MESSAGE(5, ("Testing Dataspace Manipulation\n")); - try + try { // beginning of first try block // Create simple dataspace sid1 @@ -150,7 +150,7 @@ test_h5s_basic(void) rank = sid2.getSimpleExtentNdims(); verify_val(rank, SPACE2_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__); - // Retrieves dimension size and max size of dataspace sid2 and + // Retrieves dimension size and max size of dataspace sid2 and // verify them ndims = sid2.getSimpleExtentDims( tdims, tmax ); verify_val(HDmemcmp(tdims, dims2, SPACE2_RANK * sizeof(unsigned)), 0, @@ -160,7 +160,7 @@ test_h5s_basic(void) // Check to be sure we can't create a simple data space that has too // many dimensions. - try { + try { DataSpace manydims_ds(H5S_MAX_RANK+1, dims3, NULL); // Should FAIL but didn't, so throw an invalid action exception @@ -187,10 +187,10 @@ test_h5s_basic(void) // Create file H5File fid1(testfile, H5F_ACC_RDONLY); - // Try to open the dataset that has higher dimensionality than + // Try to open the dataset that has higher dimensionality than // what the library can handle and this operation should fail. try { - DataSet dset1 = fid1.openDataSet( "dset" ); + DataSet dset1 = fid1.openDataSet( "dset" ); // Should FAIL but didn't, so throw an invalid action exception throw InvalidActionException("H5File::openDataSet", "Opening a dataset with higher dimensionality than what the library can handle"); @@ -204,7 +204,7 @@ test_h5s_basic(void) // Verify that incorrect dimensions don't work dims1[0] = 0; try { - DataSpace wrongdim_ds (SPACE1_RANK, dims1); + DataSpace wrongdim_ds (SPACE1_RANK, dims1); // Should FAIL but didn't, so throw an invalid action exception throw InvalidActionException("DataSpace constructor", "Attempted to use incorrect dimensions"); @@ -230,14 +230,14 @@ test_h5s_basic(void) cerr << " <<< " << E.getDetailMsg() << " >>>" << endl << endl; } // catch all other exceptions - catch (Exception E) + catch (Exception E) { issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg()); } } // test_h5s_basic() /*------------------------------------------------------------------------- - * + * * Function: test_h5s_scalar_write * * Purpose: Test scalar H5S (dataspace) writing code @@ -256,7 +256,7 @@ test_h5s_basic(void) * with a special routine. *------------------------------------------------------------------------- */ -static void +static void test_h5s_scalar_write(void) { // Output message about test being performed @@ -302,7 +302,7 @@ test_h5s_scalar_write(void) } // test_h5s_scalar_write() /*------------------------------------------------------------------------- - * + * * Function: test_h5s_scalar_read * * Purpose: Test scalar H5S (dataspace) reading code @@ -321,7 +321,7 @@ test_h5s_scalar_write(void) * with a special routine. *------------------------------------------------------------------------- */ -static void +static void test_h5s_scalar_read(void) { hsize_t tdims[4]; // Dimension array to test with @@ -359,14 +359,14 @@ test_h5s_scalar_read(void) // all the exceptions caused by negative returned values by C APIs issue_fail_msg(E.getCFuncName(), __LINE__, __FILE__, E.getCDetailMsg()); } - + } // test_h5s_scalar_read() /*------------------------------------------------------------------------- - * + * * Function: test_h5s_compound_scalar_write * - * Purpose: Test scalar H5S (dataspace) writing for compound + * Purpose: Test scalar H5S (dataspace) writing for compound * datatypes * * Return: none @@ -383,7 +383,7 @@ test_h5s_scalar_read(void) * with a special routine. *------------------------------------------------------------------------- */ -static void +static void test_h5s_compound_scalar_write(void) { // Output message about test being performed @@ -437,10 +437,10 @@ test_h5s_compound_scalar_write(void) } // test_h5s_compound_scalar_write() /*------------------------------------------------------------------------- - * + * * Function: test_h5s_compound_scalar_read * - * Purpose: Test scalar H5S (dataspace) reading for compound + * Purpose: Test scalar H5S (dataspace) reading for compound * datatypes * * Return: none @@ -457,7 +457,7 @@ test_h5s_compound_scalar_write(void) * with a special routine. *------------------------------------------------------------------------- */ -static void +static void test_h5s_compound_scalar_read(void) { hsize_t tdims[4]; // Dimension array to test with @@ -487,14 +487,14 @@ test_h5s_compound_scalar_read(void) // Get the datatype of this dataset. CompType type(dataset); - + struct space4_struct rdata; // Scalar data read in dataset.read(&rdata, type); // Verify read data if(HDmemcmp(&space4_data,&rdata,sizeof(struct space4_struct))) { - cerr << "scalar data different: space4_data.c1=" + cerr << "scalar data different: space4_data.c1=" << space4_data.c1 << ", read_data4.c1=" << rdata.c1 << endl; cerr << "scalar data different: space4_data.u=" << space4_data.u << ", read_data4.u=" << rdata.u << endl; @@ -512,7 +512,7 @@ test_h5s_compound_scalar_read(void) } // test_h5s_compound_scalar_read() /*------------------------------------------------------------------------- - * + * * Function: test_h5s * * Purpose: Main dataspace testing routine @@ -525,7 +525,7 @@ test_h5s_compound_scalar_read(void) * Modifications: *------------------------------------------------------------------------- */ -void +void test_h5s(void) { // Output message about test being performed diff --git a/examples/h5_attribute.c b/examples/h5_attribute.c index 76609ec..6857236 100644 --- a/examples/h5_attribute.c +++ b/examples/h5_attribute.c @@ -12,52 +12,52 @@ * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* +/* * This program illustrates the usage of the H5A Interface functions. * It creates and writes a dataset, and then creates and writes array, - * scalar, and string attributes of the dataset. + * scalar, and string attributes of the dataset. * Program reopens the file, attaches to the scalar attribute using * attribute name and reads and displays its value. Then index of the * third attribute is used to read and display attribute values. * The H5Aiterate function is used to iterate through the dataset attributes, - * and display their names. The function is also reads and displays the values - * of the array attribute. - */ - + * and display their names. The function is also reads and displays the values + * of the array attribute. + */ + #include #include "hdf5.h" #define H5FILE_NAME "Attributes.h5" -#define RANK 1 /* Rank and size of the dataset */ +#define RANK 1 /* Rank and size of the dataset */ #define SIZE 7 #define ARANK 2 /* Rank and dimension sizes of the first dataset attribute */ #define ADIM1 2 -#define ADIM2 3 +#define ADIM2 3 #define ANAME "Float attribute" /* Name of the array attribute */ #define ANAMES "Character attribute" /* Name of the string attribute */ -herr_t attr_info(hid_t loc_id, const char *name, void *opdata); +herr_t attr_info(hid_t loc_id, const char *name, void *opdata); /* Operator function */ -int +int main (void) { hid_t file, dataset; /* File and dataset identifiers */ - + hid_t fid; /* Dataspace identifier */ hid_t attr1, attr2, attr3; /* Attribute identifiers */ hid_t attr; - hid_t aid1, aid2, aid3; /* Attribute dataspace identifiers */ + hid_t aid1, aid2, aid3; /* Attribute dataspace identifiers */ hid_t atype; /* Attribute type */ hsize_t fdim[] = {SIZE}; hsize_t adim[] = {ADIM1, ADIM2}; /* Dimensions of the first attribute */ - - float matrix[ADIM1][ADIM2]; /* Attribute data */ + + float matrix[ADIM1][ADIM2]; /* Attribute data */ herr_t ret; /* Return value */ unsigned i,j; /* Counters */ @@ -69,10 +69,10 @@ main (void) * Data initialization. */ int vector[] = {1, 2, 3, 4, 5, 6, 7}; /* Dataset data */ - int point = 1; /* Value of the scalar attribute */ + int point = 1; /* Value of the scalar attribute */ char string[] = "ABCD"; /* Value of the string attribute */ - + for (i=0; i < ADIM1; i++) { /* Values of the array attribute */ for (j=0; j < ADIM2; j++) matrix[i][j] = -1.; @@ -83,7 +83,7 @@ main (void) */ file = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - /* + /* * Create the dataspace for the dataset in the file. */ fid = H5Screate(H5S_SIMPLE); @@ -100,7 +100,7 @@ main (void) ret = H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL , H5S_ALL, H5P_DEFAULT, vector); /* - * Create dataspace for the first attribute. + * Create dataspace for the first attribute. */ aid1 = H5Screate(H5S_SIMPLE); ret = H5Sset_extent_simple(aid1, ARANK, adim, NULL); @@ -125,7 +125,7 @@ main (void) /* * Write scalar attribute. */ - ret = H5Awrite(attr2, H5T_NATIVE_INT, &point); + ret = H5Awrite(attr2, H5T_NATIVE_INT, &point); /* * Create string attribute. @@ -139,23 +139,23 @@ main (void) /* * Write string attribute. */ - ret = H5Awrite(attr3, atype, string); + ret = H5Awrite(attr3, atype, string); /* * Close attribute and file dataspaces. */ - ret = H5Sclose(aid1); - ret = H5Sclose(aid2); - ret = H5Sclose(aid3); - ret = H5Sclose(fid); + ret = H5Sclose(aid1); + ret = H5Sclose(aid2); + ret = H5Sclose(aid3); + ret = H5Sclose(fid); /* * Close the attributes. - */ + */ ret = H5Aclose(attr1); ret = H5Aclose(attr2); ret = H5Aclose(attr3); - + /* * Close the dataset. */ @@ -177,12 +177,12 @@ main (void) dataset = H5Dopen(file,"Dataset"); /* - * Attach to the scalar attribute using attribute name, then read and + * Attach to the scalar attribute using attribute name, then read and * display its value. */ attr = H5Aopen_name(dataset,"Integer attribute"); ret = H5Aread(attr, H5T_NATIVE_INT, &point_out); - printf("The value of the attribute \"Integer attribute\" is %d \n", point_out); + printf("The value of the attribute \"Integer attribute\" is %d \n", point_out); ret = H5Aclose(attr); /* @@ -197,7 +197,7 @@ main (void) ret = H5Tclose(atype); /* - * Get attribute info using iteration function. + * Get attribute info using iteration function. */ idx = H5Aiterate(dataset, NULL, attr_info, NULL); @@ -207,21 +207,21 @@ main (void) H5Dclose(dataset); H5Fclose(file); - return 0; + return 0; } /* * Operator function. */ -herr_t +herr_t attr_info(hid_t loc_id, const char *name, void *opdata) { hid_t attr, atype, aspace; /* Attribute, datatype and dataspace identifiers */ int rank; - hsize_t sdim[64]; + hsize_t sdim[64]; herr_t ret; int i; - size_t npoints; /* Number of elements in the array attribute. */ + size_t npoints; /* Number of elements in the array attribute. */ float *float_array; /* Pointer to the array attribute. */ /* avoid warnings */ @@ -229,7 +229,7 @@ attr_info(hid_t loc_id, const char *name, void *opdata) /* * Open the attribute using its name. - */ + */ attr = H5Aopen_name(loc_id, name); /* @@ -239,7 +239,7 @@ attr_info(hid_t loc_id, const char *name, void *opdata) printf("Name : "); puts(name); - /* + /* * Get attribute datatype, dataspace, rank, and dimensions. */ atype = H5Aget_type(attr); @@ -252,7 +252,7 @@ attr_info(hid_t loc_id, const char *name, void *opdata) */ if(rank > 0) { - printf("Rank : %d \n", rank); + printf("Rank : %d \n", rank); printf("Dimension sizes : "); for (i=0; i< rank; i++) printf("%d ", (int)sdim[i]); printf("\n"); @@ -263,12 +263,12 @@ attr_info(hid_t loc_id, const char *name, void *opdata) */ if (H5T_FLOAT == H5Tget_class(atype)) { - printf("Type : FLOAT \n"); + printf("Type : FLOAT \n"); npoints = H5Sget_simple_extent_npoints(aspace); - float_array = (float *)malloc(sizeof(float)*(int)npoints); + float_array = (float *)malloc(sizeof(float)*(int)npoints); ret = H5Aread(attr, atype, float_array); printf("Values : "); - for( i = 0; i < (int)npoints; i++) printf("%f ", float_array[i]); + for( i = 0; i < (int)npoints; i++) printf("%f ", float_array[i]); printf("\n"); free(float_array); } diff --git a/examples/h5_chunk_read.c b/examples/h5_chunk_read.c index af87c10..7bc7324 100644 --- a/examples/h5_chunk_read.c +++ b/examples/h5_chunk_read.c @@ -12,50 +12,50 @@ * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* +/* * This example shows how to read data from a chunked dataset. - * We will read from the file created by h5_extend_write.c + * We will read from the file created by h5_extend_write.c */ - + #include "hdf5.h" #define H5FILE_NAME "SDSextendible.h5" -#define DATASETNAME "ExtendibleArray" +#define DATASETNAME "ExtendibleArray" #define RANK 2 #define RANKC 1 #define NX 10 -#define NY 5 +#define NY 5 int main (void) { hid_t file; /* handles */ - hid_t dataset; - hid_t filespace; - hid_t memspace; - hid_t cparms; - hsize_t dims[2]; /* dataset and chunk dimensions*/ + hid_t dataset; + hid_t filespace; + hid_t memspace; + hid_t cparms; + hsize_t dims[2]; /* dataset and chunk dimensions*/ hsize_t chunk_dims[2]; hsize_t col_dims[1]; hsize_t count[2]; hsize_t offset[2]; - herr_t status, status_n; + herr_t status, status_n; int data_out[NX][NY]; /* buffer for dataset to be read */ int chunk_out[2][5]; /* buffer for chunk to be read */ int column[10]; /* buffer for column to be read */ int rank, rank_chunk; hsize_t i, j; - - + + /* * Open the file and the dataset. */ file = H5Fopen(H5FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT); dataset = H5Dopen(file, DATASETNAME); - + /* * Get dataset rank and dimension. */ @@ -70,7 +70,7 @@ main (void) * Define the memory space to read dataset. */ memspace = H5Screate_simple(RANK,dims,NULL); - + /* * Read dataset back and display. */ @@ -81,7 +81,7 @@ main (void) for (j = 0; j < dims[0]; j++) { for (i = 0; i < dims[1]; i++) printf("%d ", data_out[j][i]); printf("\n"); - } + } /* * Close/release resources. @@ -89,20 +89,20 @@ main (void) H5Sclose(memspace); /* - * dataset rank 2, dimensions 10 x 5 - * chunk rank 2, dimensions 2 x 5 + * dataset rank 2, dimensions 10 x 5 + * chunk rank 2, dimensions 2 x 5 * Dataset: - * 1 1 1 3 3 - * 1 1 1 3 3 - * 1 1 1 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 - * 2 0 0 0 0 + * 1 1 1 3 3 + * 1 1 1 3 3 + * 1 1 1 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 + * 2 0 0 0 0 */ /* @@ -136,17 +136,17 @@ main (void) H5Sclose(memspace); /* - * Third column: - * 1 - * 1 - * 1 - * 0 - * 0 - * 0 - * 0 - * 0 - * 0 - * 0 + * Third column: + * 1 + * 1 + * 1 + * 0 + * 0 + * 0 + * 0 + * 0 + * 0 + * 0 */ /* @@ -175,7 +175,7 @@ main (void) offset[1] = 0; count[0] = chunk_dims[0]; count[1] = chunk_dims[1]; - status = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, + status = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, count, NULL); /* @@ -188,11 +188,11 @@ main (void) for (j = 0; j < chunk_dims[0]; j++) { for (i = 0; i < chunk_dims[1]; i++) printf("%d ", chunk_out[j][i]); printf("\n"); - } + } /* - * Chunk: - * 1 1 1 0 0 - * 2 0 0 0 0 + * Chunk: + * 1 1 1 0 0 + * 2 0 0 0 0 */ /* @@ -210,4 +210,4 @@ main (void) H5Fclose(file); return 0; -} +} diff --git a/examples/h5_compound.c b/examples/h5_compound.c index 1819734..6a88448 100644 --- a/examples/h5_compound.c +++ b/examples/h5_compound.c @@ -33,7 +33,7 @@ main(void) typedef struct s1_t { int a; float b; - double c; + double c; } s1_t; s1_t s1[LENGTH]; hid_t s1_tid; /* File datatype identifier */ @@ -76,20 +76,20 @@ main(void) file = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); /* - * Create the memory data type. + * Create the memory data type. */ s1_tid = H5Tcreate (H5T_COMPOUND, sizeof(s1_t)); H5Tinsert(s1_tid, "a_name", HOFFSET(s1_t, a), H5T_NATIVE_INT); H5Tinsert(s1_tid, "c_name", HOFFSET(s1_t, c), H5T_NATIVE_DOUBLE); H5Tinsert(s1_tid, "b_name", HOFFSET(s1_t, b), H5T_NATIVE_FLOAT); - /* + /* * Create the dataset. */ dataset = H5Dcreate(file, DATASETNAME, s1_tid, space, H5P_DEFAULT); /* - * Wtite data to the dataset; + * Wtite data to the dataset; */ status = H5Dwrite(dataset, s1_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, s1); @@ -100,15 +100,15 @@ main(void) H5Sclose(space); H5Dclose(dataset); H5Fclose(file); - + /* * Open the file and the dataset. */ file = H5Fopen(H5FILE_NAME, H5F_ACC_RDONLY, H5P_DEFAULT); - + dataset = H5Dopen(file, DATASETNAME); - /* + /* * Create a data type for s2 */ s2_tid = H5Tcreate(H5T_COMPOUND, sizeof(s2_t)); @@ -135,7 +135,7 @@ main(void) for( i = 0; i < LENGTH; i++) printf("%d ", s2[i].a); printf("\n"); - /* + /* * Create a data type for s3. */ s3_tid = H5Tcreate(H5T_COMPOUND, sizeof(float)); diff --git a/examples/h5_drivers.c b/examples/h5_drivers.c index ebe870b..5dea143 100644 --- a/examples/h5_drivers.c +++ b/examples/h5_drivers.c @@ -12,13 +12,13 @@ * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* +/* * This shows how to use the hdf5 virtual file drivers. * The example codes here do not check return values for the * sake of simplicity. As in all proper programs, return codes * should be checked. */ - + #include "hdf5.h" #include "stdlib.h" @@ -96,8 +96,8 @@ split_file(void) int main (void) { - + split_file(); return(0); -} +} diff --git a/examples/h5_extend_write.c b/examples/h5_extend_write.c index bcb9949..9a30d46 100644 --- a/examples/h5_extend_write.c +++ b/examples/h5_extend_write.c @@ -12,46 +12,46 @@ * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* +/* * This example shows how to work with extendible dataset. * In the current version of the library dataset MUST be * chunked. - * + * */ - + #include "hdf5.h" #define H5FILE_NAME "SDSextendible.h5" -#define DATASETNAME "ExtendibleArray" +#define DATASETNAME "ExtendibleArray" #define RANK 2 #define NX 10 -#define NY 5 +#define NY 5 int main (void) { hid_t file; /* handles */ - hid_t dataspace, dataset; - hid_t filespace; - hid_t cparms; + hid_t dataspace, dataset; + hid_t filespace; + hid_t cparms; hsize_t dims[2] = { 3, 3}; /* - * dataset dimensions + * dataset dimensions * at the creation time */ - hsize_t dims1[2] = { 3, 3}; /* data1 dimensions */ - hsize_t dims2[2] = { 7, 1}; /* data2 dimensions */ - hsize_t dims3[2] = { 2, 2}; /* data3 dimensions */ + hsize_t dims1[2] = { 3, 3}; /* data1 dimensions */ + hsize_t dims2[2] = { 7, 1}; /* data2 dimensions */ + hsize_t dims3[2] = { 2, 2}; /* data3 dimensions */ hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED}; hsize_t chunk_dims[2] ={2, 5}; hsize_t size[2]; hsize_t offset[2]; - herr_t status; + herr_t status; int data1[3][3] = { {1, 1, 1}, /* data to write */ {1, 1, 1}, - {1, 1, 1} }; + {1, 1, 1} }; int data2[7] = { 2, 2, 2, 2, 2, 2, 2}; @@ -60,16 +60,16 @@ main (void) int fillvalue = 0; /* - * Create the data space with unlimited dimensions. + * Create the data space with unlimited dimensions. */ - dataspace = H5Screate_simple(RANK, dims, maxdims); + dataspace = H5Screate_simple(RANK, dims, maxdims); /* * Create a new file. If file exists its contents will be overwritten. */ file = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - /* + /* * Modify dataset creation properties, i.e. enable chunking. */ cparms = H5Pcreate(H5P_DATASET_CREATE); @@ -86,8 +86,8 @@ main (void) /* * Extend the dataset. This call assures that dataset is at least 3 x 3. */ - size[0] = 3; - size[1] = 3; + size[0] = 3; + size[1] = 3; status = H5Dextend (dataset, size); /* @@ -97,7 +97,7 @@ main (void) offset[0] = 0; offset[1] = 0; status = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, - dims1, NULL); + dims1, NULL); /* * Write the data to the hyperslab. @@ -109,8 +109,8 @@ main (void) * Extend the dataset. Dataset becomes 10 x 3. */ dims[0] = dims1[0] + dims2[0]; - size[0] = dims[0]; - size[1] = dims[1]; + size[0] = dims[0]; + size[1] = dims[1]; status = H5Dextend (dataset, size); /* @@ -120,12 +120,12 @@ main (void) offset[0] = 3; offset[1] = 0; status = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, - dims2, NULL); + dims2, NULL); /* * Define memory space */ - dataspace = H5Screate_simple(RANK, dims2, NULL); + dataspace = H5Screate_simple(RANK, dims2, NULL); /* * Write the data to the hyperslab. @@ -137,8 +137,8 @@ main (void) * Extend the dataset. Dataset becomes 10 x 5. */ dims[1] = dims1[1] + dims3[1]; - size[0] = dims[0]; - size[1] = dims[1]; + size[0] = dims[0]; + size[1] = dims[1]; status = H5Dextend (dataset, size); /* @@ -147,13 +147,13 @@ main (void) filespace = H5Dget_space (dataset); offset[0] = 0; offset[1] = 3; - status = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, - dims3, NULL); + status = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, + dims3, NULL); /* * Define memory space. */ - dataspace = H5Screate_simple(RANK, dims3, NULL); + dataspace = H5Screate_simple(RANK, dims3, NULL); /* * Write the data to the hyperslab. @@ -163,7 +163,7 @@ main (void) /* * Resulting dataset - * + * * 3 3 3 2 2 * 3 3 3 2 2 * 3 3 3 0 0 @@ -185,4 +185,4 @@ main (void) H5Fclose(file); return 0; -} +} diff --git a/examples/h5_group.c b/examples/h5_group.c index 4e3eac1..7afe19b 100644 --- a/examples/h5_group.c +++ b/examples/h5_group.c @@ -13,12 +13,12 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * This program creates a group in the file and two datasets in the group. + * This program creates a group in the file and two datasets in the group. * Hard link to the group object is created and one of the datasets is accessed - * under new name. + * under new name. * Iterator functions are used to find information about the objects - * in the root group and in the created group. - */ + * in the root group and in the created group. + */ #include "hdf5.h" @@ -38,12 +38,12 @@ main(void) hid_t file; hid_t grp; hid_t dataset, dataspace; - hid_t plist; + hid_t plist; herr_t status; hsize_t dims[2]; hsize_t cdims[2]; - + int idx_f, idx_g; /* @@ -52,15 +52,15 @@ main(void) file = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); /* - * Create a group in the file. + * Create a group in the file. */ grp = H5Gcreate(file, "/Data", 0); /* * Create dataset "Compressed Data" in the group using absolute - * name. Dataset creation property list is modified to use - * GZIP compression with the compression effort set to 6. - * Note that compression can be used only when dataset is chunked. + * name. Dataset creation property list is modified to use + * GZIP compression with the compression effort set to 6. + * Note that compression can be used only when dataset is chunked. */ dims[0] = 1000; dims[1] = 20; @@ -69,16 +69,16 @@ main(void) dataspace = H5Screate_simple(RANK, dims, NULL); plist = H5Pcreate(H5P_DATASET_CREATE); H5Pset_chunk(plist, 2, cdims); - H5Pset_deflate( plist, 6); - dataset = H5Dcreate(file, "/Data/Compressed_Data", H5T_NATIVE_INT, - dataspace, plist); - /* + H5Pset_deflate( plist, 6); + dataset = H5Dcreate(file, "/Data/Compressed_Data", H5T_NATIVE_INT, + dataspace, plist); + /* * Close the first dataset . */ H5Sclose(dataspace); H5Dclose(dataset); - /* + /* * Create the second dataset. */ dims[0] = 500; @@ -87,7 +87,7 @@ main(void) dataset = H5Dcreate(file, "/Data/Float_Data", H5T_NATIVE_FLOAT, dataspace, H5P_DEFAULT); - /* + /* *Close the second dataset and file. */ H5Sclose(dataspace); @@ -96,13 +96,13 @@ main(void) H5Fclose(file); /* - * Now reopen the file and group in the file. + * Now reopen the file and group in the file. */ file = H5Fopen(H5FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT); grp = H5Gopen(file, "Data"); - /* - * Access "Compressed_Data" dataset in the group. + /* + * Access "Compressed_Data" dataset in the group. */ dataset = H5Dopen(grp, "Compressed_Data"); if( dataset < 0) printf(" Dataset 'Compressed-Data' is not found. \n"); @@ -118,9 +118,9 @@ main(void) */ status = H5Glink(file, H5G_LINK_HARD, "Data", "Data_new"); - /* + /* * We can access "Compressed_Data" dataset using created - * hard link "Data_new". + * hard link "Data_new". */ dataset = H5Dopen(file, "/Data_new/Compressed_Data"); if( dataset < 0) printf(" Dataset is not found. \n"); @@ -132,7 +132,7 @@ main(void) status = H5Dclose(dataset); - /* + /* * Use iterator to see the names of the objects in the root group. */ idx_f = H5Giterate(file, "/", NULL, file_info, NULL); @@ -141,15 +141,15 @@ main(void) * Unlink name "Data" and use iterator to see the names * of the objects in the file root direvtory. */ - if (H5Gunlink(file, "Data") < 0) + if (H5Gunlink(file, "Data") < 0) printf(" H5Gunlink failed \n"); - else + else printf("\"Data\" is unlinked \n"); idx_f = H5Giterate(file, "/", NULL, file_info, NULL); - /* - * Use iterator to see the names of the objects in the group + /* + * Use iterator to see the names of the objects in the group * /Data_new. */ idx_g = H5Giterate(grp, "/Data_new", NULL, group_info, NULL); @@ -157,7 +157,7 @@ main(void) /* * Close the file. */ - + status = H5Fclose(file); return 0; @@ -173,13 +173,13 @@ herr_t file_info(hid_t loc_id, const char *name, void *opdata) opdata = opdata; /* - * Display group name. The name is passed to the function by + * Display group name. The name is passed to the function by * the Library. Some magic :-) */ printf("\n"); printf("Name : "); puts(name); - + return 0; } @@ -204,20 +204,20 @@ herr_t group_info(hid_t loc_id, const char *name, void *opdata) * Open the datasets using their names. */ did = H5Dopen(loc_id, name); - + /* * Display dataset name. */ printf("\n"); printf("Name : "); puts(name); - - /* + + /* * Display dataset information. */ tid = H5Dget_type(did); /* get datatype*/ pid = H5Dget_create_plist(did); /* get creation property list */ - + /* * Check if dataset is chunked. */ @@ -226,13 +226,13 @@ herr_t group_info(hid_t loc_id, const char *name, void *opdata) * get chunking information: rank and dimensions. */ rank_chunk = H5Pget_chunk(pid, 2, chunk_dims_out); - printf("chunk rank %d, dimensions %lu x %lu\n", rank_chunk, + printf("chunk rank %d, dimensions %lu x %lu\n", rank_chunk, (unsigned long)(chunk_dims_out[0]), (unsigned long)(chunk_dims_out[1])); - } + } else{ t_class = H5Tget_class(tid); - if(t_class < 0){ + if(t_class < 0){ puts(" Invalid datatype.\n"); } else { @@ -250,7 +250,7 @@ herr_t group_info(hid_t loc_id, const char *name, void *opdata) puts(" Datatype is 'H5T_NATIVE_COMPOUND'.\n"); } } - + H5Dclose(did); H5Pclose(pid); diff --git a/examples/h5_mount.c b/examples/h5_mount.c index 7075201..00927ff 100644 --- a/examples/h5_mount.c +++ b/examples/h5_mount.c @@ -12,12 +12,12 @@ * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* - * This program shows the concept of "mounting files". +/* + * This program shows the concept of "mounting files". * Program creates one file with group G in it, and another * file with dataset D. Then second file is mounted in the first one - * under the "mounting point" G. Dataset D is accessed in the first file - * under name /G/D and data is printed out. + * under the "mounting point" G. Dataset D is accessed in the first file + * under name /G/D and data is printed out. */ #include "hdf5.h" @@ -29,11 +29,11 @@ #define NX 4 #define NY 5 -int main(void) +int main(void) { hid_t fid1, fid2, gid; /* Files and group identifiers */ - hid_t did, tid, sid; /* Dataset and datatype identifiers */ + hid_t did, tid, sid; /* Dataset and datatype identifiers */ herr_t status; hsize_t dims[] = {NX,NY}; /* Dataset dimensions */ @@ -42,26 +42,26 @@ int main(void) int bm[NX][NY], bm_out[NX][NY]; /* Data buffers */ /* - * Initialization of buffer matrix "bm" + * Initialization of buffer matrix "bm" */ for(i =0; i @@ -30,38 +30,38 @@ int main(void) { - hid_t fid; /* File, group, datasets, datatypes */ + hid_t fid; /* File, group, datasets, datatypes */ hid_t gid_a; /* and dataspaces identifiers */ - hid_t did_b, sid_b, tid_b; + hid_t did_b, sid_b, tid_b; hid_t did_r, tid_r, sid_r; herr_t status; hobj_ref_t *wbuf; /* buffer to write to disk */ hobj_ref_t *rbuf; /* buffer to read from disk */ - - hsize_t dim_r[1]; + + hsize_t dim_r[1]; hsize_t dim_b[2]; - - /* + + /* * Create a file using default properties. */ fid = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - /* + /* * Create group "A" in the file. */ gid_a = H5Gcreate(fid, "A", 0); - - /* + + /* * Create dataset "B" in the file. */ dim_b[0] = 2; dim_b[1] = 6; - sid_b = H5Screate_simple(2, dim_b, NULL); + sid_b = H5Screate_simple(2, dim_b, NULL); did_b = H5Dcreate(fid, "B", H5T_NATIVE_FLOAT, sid_b, H5P_DEFAULT); - - /* + + /* * Create dataset "R" to store references to the objects "A" and "B". */ dim_r[0] = 2; @@ -69,62 +69,62 @@ main(void) { tid_r = H5Tcopy(H5T_STD_REF_OBJ); did_r = H5Dcreate(fid, "R", tid_r, sid_r, H5P_DEFAULT ); - /* + /* * Allocate write and read buffers. */ wbuf = (hobj_ref_t *)malloc(sizeof(hobj_ref_t)*2); rbuf = (hobj_ref_t *)malloc(sizeof(hobj_ref_t)*2); - + /* * Create references to the group "A" and dataset "B" * and store them in the wbuf. */ - H5Rcreate(&wbuf[0], fid, "A", H5R_OBJECT, -1); + H5Rcreate(&wbuf[0], fid, "A", H5R_OBJECT, -1); H5Rcreate(&wbuf[1], fid, "B", H5R_OBJECT, -1); - - /* + + /* * Write dataset R using default transfer properties. */ status = H5Dwrite(did_r, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf); - /* - * Close all objects. + /* + * Close all objects. */ H5Gclose(gid_a); - + H5Sclose(sid_b); H5Dclose(did_b); H5Tclose(tid_r); H5Sclose(sid_r); H5Dclose(did_r); - + H5Fclose(fid); - - /* + + /* * Reopen the file. */ fid = H5Fopen(H5FILE_NAME, H5F_ACC_RDWR, H5P_DEFAULT); - /* + /* * Open and read dataset "R". */ did_r = H5Dopen(fid, "R"); status = H5Dread(did_r, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf); - /* + /* * Find the type of referenced objects. */ status = H5Rget_obj_type(did_r, H5R_OBJECT, &rbuf[0]); - if ( status == H5G_GROUP ) + if ( status == H5G_GROUP ) printf("First dereferenced object is a group. \n"); status = H5Rget_obj_type(did_r, H5R_OBJECT, &rbuf[1]); - if ( status == H5G_DATASET ) + if ( status == H5G_DATASET ) printf("Second dereferenced object is a dataset. \n"); - /* + /* * Get datatype of the dataset "B" */ did_b = H5Rdereference(did_r, H5R_OBJECT, &rbuf[1]); @@ -133,7 +133,7 @@ main(void) { printf("Datatype of the dataset is H5T_NATIVE_FLOAT.\n"); printf("\n"); - /* + /* * Close all objects and free memory buffers. */ H5Dclose(did_r); diff --git a/examples/h5_select.c b/examples/h5_select.c index 0c34b1a..c3bdb2a 100644 --- a/examples/h5_select.c +++ b/examples/h5_select.c @@ -12,42 +12,42 @@ * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* +/* * This program shows how the H5Sselect_hyperslab and H5Sselect_elements * functions are used to write selected data from memory to the file. * Program takes 48 elements from the linear buffer and writes them into - * the matrix using 3x2 blocks, (4,3) stride and (2,4) count. - * Then four elements of the matrix are overwritten with the new values and - * file is closed. Program reopens the file and selects the union of two + * the matrix using 3x2 blocks, (4,3) stride and (2,4) count. + * Then four elements of the matrix are overwritten with the new values and + * file is closed. Program reopens the file and selects the union of two * hyperslabs in the dataset in the file. Then it reads the selection into the * memory dataset preserving the shape of the selection. - */ - + */ + #include "hdf5.h" #define H5FILE_NAME "Select.h5" #define MSPACE1_RANK 1 /* Rank of the first dataset in memory */ -#define MSPACE1_DIM 50 /* Dataset size in memory */ +#define MSPACE1_DIM 50 /* Dataset size in memory */ -#define MSPACE2_RANK 1 /* Rank of the second dataset in memory */ -#define MSPACE2_DIM 4 /* Dataset size in memory */ +#define MSPACE2_RANK 1 /* Rank of the second dataset in memory */ +#define MSPACE2_DIM 4 /* Dataset size in memory */ #define FSPACE_RANK 2 /* Dataset rank as it is stored in the file */ #define FSPACE_DIM1 8 /* Dimension sizes of the dataset as it is stored in the file */ -#define FSPACE_DIM2 12 +#define FSPACE_DIM2 12 /* We will read dataset back from the file to the dataset in memory with these - dataspace parameters. */ + dataspace parameters. */ #define MSPACE_RANK 2 -#define MSPACE_DIM1 8 -#define MSPACE_DIM2 9 +#define MSPACE_DIM1 8 +#define MSPACE_DIM2 9 -#define NPOINTS 4 /* Number of points that will be selected - and overwritten */ -int +#define NPOINTS 4 /* Number of points that will be selected + and overwritten */ +int main (void) { @@ -55,13 +55,13 @@ main (void) hid_t mid1, mid2, mid, fid; /* Dataspace identifiers */ hid_t plist; /* Dataset property list identifier */ - hsize_t dim1[] = {MSPACE1_DIM}; /* Dimension size of the first dataset - (in memory) */ + hsize_t dim1[] = {MSPACE1_DIM}; /* Dimension size of the first dataset + (in memory) */ hsize_t dim2[] = {MSPACE2_DIM}; /* Dimension size of the second dataset - (in memory */ - hsize_t fdim[] = {FSPACE_DIM1, FSPACE_DIM2}; + (in memory */ + hsize_t fdim[] = {FSPACE_DIM1, FSPACE_DIM2}; /* Dimension sizes of the dataset (on disk) */ - hsize_t mdim[] = {MSPACE_DIM1, MSPACE_DIM2}; /* Dimension sizes of the + hsize_t mdim[] = {MSPACE_DIM1, MSPACE_DIM2}; /* Dimension sizes of the dataset in memory when we read selection from the dataset on the disk */ @@ -71,13 +71,13 @@ main (void) hsize_t count[2]; /* Block count */ hsize_t block[2]; /* Block sizes */ - hsize_t coord[NPOINTS][FSPACE_RANK]; /* Array to store selected points - from the file dataspace */ + hsize_t coord[NPOINTS][FSPACE_RANK]; /* Array to store selected points + from the file dataspace */ herr_t ret; unsigned i,j; int fillvalue = 0; /* Fill value for the dataset */ - int matrix_out[MSPACE_DIM1][MSPACE_DIM2]; /* Buffer to read from the + int matrix_out[MSPACE_DIM1][MSPACE_DIM2]; /* Buffer to read from the dataset */ int vector[MSPACE1_DIM]; int values[] = {53, 59, 61, 67}; /* New values to be written */ @@ -97,9 +97,9 @@ main (void) * Create property list for a dataset and set up fill values. */ plist = H5Pcreate(H5P_DATASET_CREATE); - ret = H5Pset_fill_value(plist, H5T_NATIVE_INT, &fillvalue); + ret = H5Pset_fill_value(plist, H5T_NATIVE_INT, &fillvalue); - /* + /* * Create dataspace for the dataset in the file. */ fid = H5Screate_simple(FSPACE_RANK, fdim, NULL); @@ -111,12 +111,12 @@ main (void) dataset = H5Dcreate(file, "Matrix in file", H5T_NATIVE_INT, fid, plist); /* - * Select hyperslab for the dataset in the file, using 3x2 blocks, + * Select hyperslab for the dataset in the file, using 3x2 blocks, * (4,3) stride and (2,4) count starting at the position (0,1). */ start[0] = 0; start[1] = 1; stride[0] = 4; stride[1] = 3; - count[0] = 2; count[1] = 4; + count[0] = 2; count[1] = 4; block[0] = 3; block[1] = 2; ret = H5Sselect_hyperslab(fid, H5S_SELECT_SET, start, stride, count, block); @@ -126,7 +126,7 @@ main (void) mid1 = H5Screate_simple(MSPACE1_RANK, dim1, NULL); /* - * Select hyperslab. + * Select hyperslab. * We will use 48 elements of the vector buffer starting at the second element. * Selected elements are 1 2 3 . . . 48 */ @@ -135,12 +135,12 @@ main (void) count[0] = 48; block[0] = 1; ret = H5Sselect_hyperslab(mid1, H5S_SELECT_SET, start, stride, count, block); - + /* * Write selection from the vector buffer to the dataset in the file. * - * File dataset should look like this: - * 0 1 2 0 3 4 0 5 6 0 7 8 + * File dataset should look like this: + * 0 1 2 0 3 4 0 5 6 0 7 8 * 0 9 10 0 11 12 0 13 14 0 15 16 * 0 17 18 0 19 20 0 21 22 0 23 24 * 0 0 0 0 0 0 0 0 0 0 0 0 @@ -169,17 +169,17 @@ main (void) coord[2][0] = 3; coord[2][1] = 5; coord[3][0] = 5; coord[3][1] = 6; - ret = H5Sselect_elements(fid, H5S_SELECT_SET, NPOINTS, + ret = H5Sselect_elements(fid, H5S_SELECT_SET, NPOINTS, (const hsize_t **)coord); /* * Write new selection of points to the dataset. */ - ret = H5Dwrite(dataset, H5T_NATIVE_INT, mid2, fid, H5P_DEFAULT, values); + ret = H5Dwrite(dataset, H5T_NATIVE_INT, mid2, fid, H5P_DEFAULT, values); /* - * File dataset should look like this: - * 53 1 2 0 3 4 0 5 6 0 7 8 + * File dataset should look like this: + * 53 1 2 0 3 4 0 5 6 0 7 8 * 0 9 10 0 11 12 0 13 14 0 15 16 * 0 17 18 0 19 20 0 21 22 0 23 24 * 0 0 0 59 0 61 0 0 0 0 0 0 @@ -187,16 +187,16 @@ main (void) * 0 33 34 0 35 36 67 37 38 0 39 40 * 0 41 42 0 43 44 0 45 46 0 47 48 * 0 0 0 0 0 0 0 0 0 0 0 0 - * + * */ - + /* * Close memory file and memory dataspaces. */ - ret = H5Sclose(mid1); - ret = H5Sclose(mid2); - ret = H5Sclose(fid); - + ret = H5Sclose(mid1); + ret = H5Sclose(mid2); + ret = H5Sclose(fid); + /* * Close dataset. */ @@ -216,8 +216,8 @@ main (void) * Open the dataset. */ dataset = H5Dopen(file,"Matrix in file"); - - /* + + /* * Get dataspace of the open dataset. */ fid = H5Dget_space(dataset); @@ -225,7 +225,7 @@ main (void) /* * Select first hyperslab for the dataset in the file. The following * elements are selected: - * 10 0 11 12 + * 10 0 11 12 * 18 0 19 20 * 0 59 0 61 * @@ -233,50 +233,50 @@ main (void) start[0] = 1; start[1] = 2; block[0] = 1; block[1] = 1; stride[0] = 1; stride[1] = 1; - count[0] = 3; count[1] = 4; + count[0] = 3; count[1] = 4; ret = H5Sselect_hyperslab(fid, H5S_SELECT_SET, start, stride, count, block); - /* - * Add second selected hyperslab to the selection. + /* + * Add second selected hyperslab to the selection. * The following elements are selected: - * 19 20 0 21 22 - * 0 61 0 0 0 - * 27 28 0 29 30 - * 35 36 67 37 38 + * 19 20 0 21 22 + * 0 61 0 0 0 + * 27 28 0 29 30 + * 35 36 67 37 38 * 43 44 0 45 46 * 0 0 0 0 0 - * Note that two hyperslabs overlap. Common elements are: + * Note that two hyperslabs overlap. Common elements are: * 19 20 * 0 61 */ - start[0] = 2; start[1] = 4; - block[0] = 1; block[1] = 1; + start[0] = 2; start[1] = 4; + block[0] = 1; block[1] = 1; stride[0] = 1; stride[1] = 1; - count[0] = 6; count[1] = 5; + count[0] = 6; count[1] = 5; ret = H5Sselect_hyperslab(fid, H5S_SELECT_OR, start, stride, count, block); - + /* * Create memory dataspace. */ mid = H5Screate_simple(MSPACE_RANK, mdim, NULL); - /* + /* * Select two hyperslabs in memory. Hyperslabs has the same * size and shape as the selected hyperslabs for the file dataspace. */ - start[0] = 0; start[1] = 0; - block[0] = 1; block[1] = 1; + start[0] = 0; start[1] = 0; + block[0] = 1; block[1] = 1; stride[0] = 1; stride[1] = 1; - count[0] = 3; count[1] = 4; + count[0] = 3; count[1] = 4; ret = H5Sselect_hyperslab(mid, H5S_SELECT_SET, start, stride, count, block); - start[0] = 1; start[1] = 2; - block[0] = 1; block[1] = 1; + start[0] = 1; start[1] = 2; + block[0] = 1; block[1] = 1; stride[0] = 1; stride[1] = 1; - count[0] = 6; count[1] = 5; + count[0] = 6; count[1] = 5; ret = H5Sselect_hyperslab(mid, H5S_SELECT_OR, start, stride, count, block); - - /* + + /* * Initialize data buffer. */ for (i = 0; i < MSPACE_DIM1; i++) { @@ -290,16 +290,16 @@ main (void) H5P_DEFAULT, matrix_out); /* - * Display the result. Memory dataset is: - * - * 10 0 11 12 0 0 0 0 0 - * 18 0 19 20 0 21 22 0 0 - * 0 59 0 61 0 0 0 0 0 - * 0 0 27 28 0 29 30 0 0 - * 0 0 35 36 67 37 38 0 0 - * 0 0 43 44 0 45 46 0 0 - * 0 0 0 0 0 0 0 0 0 - * 0 0 0 0 0 0 0 0 0 + * Display the result. Memory dataset is: + * + * 10 0 11 12 0 0 0 0 0 + * 18 0 19 20 0 21 22 0 0 + * 0 59 0 61 0 0 0 0 0 + * 0 0 27 28 0 29 30 0 0 + * 0 0 35 36 67 37 38 0 0 + * 0 0 43 44 0 45 46 0 0 + * 0 0 0 0 0 0 0 0 0 + * 0 0 0 0 0 0 0 0 0 */ for (i=0; i < MSPACE_DIM1; i++) { for(j=0; j < MSPACE_DIM2; j++) printf("%3d ", matrix_out[i][j]); @@ -308,23 +308,23 @@ main (void) /* * Close memory file and memory dataspaces. - */ + */ ret = H5Sclose(mid); ret = H5Sclose(fid); - + /* * Close dataset. - */ + */ ret = H5Dclose(dataset); /* * Close property list */ ret = H5Pclose(plist); - + /* * Close the file. - */ + */ ret = H5Fclose(file); return 0; diff --git a/examples/h5_write.c b/examples/h5_write.c index 8cc4b8f..c3a8d35 100644 --- a/examples/h5_write.c +++ b/examples/h5_write.c @@ -12,15 +12,15 @@ * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* +/* * This example writes data to the HDF5 file. - * Data conversion is performed during write operation. + * Data conversion is performed during write operation. */ - + #include "hdf5.h" #define H5FILE_NAME "SDS.h5" -#define DATASETNAME "IntArray" +#define DATASETNAME "IntArray" #define NX 5 /* dataset dimensions */ #define NY 6 #define RANK 2 @@ -31,19 +31,19 @@ main (void) hid_t file, dataset; /* file and dataset handles */ hid_t datatype, dataspace; /* handles */ hsize_t dimsf[2]; /* dataset dimensions */ - herr_t status; + herr_t status; int data[NX][NY]; /* data to write */ int i, j; - /* - * Data and output buffer initialization. + /* + * Data and output buffer initialization. */ for (j = 0; j < NX; j++) { for (i = 0; i < NY; i++) data[j][i] = i + j; - } + } /* - * 0 1 2 3 4 5 + * 0 1 2 3 4 5 * 1 2 3 4 5 6 * 2 3 4 5 6 7 * 3 4 5 6 7 8 @@ -59,13 +59,13 @@ main (void) /* * Describe the size of the array and create the data space for fixed - * size dataset. + * size dataset. */ dimsf[0] = NX; dimsf[1] = NY; - dataspace = H5Screate_simple(RANK, dimsf, NULL); + dataspace = H5Screate_simple(RANK, dimsf, NULL); - /* + /* * Define datatype for the data in the file. * We will store little endian INT numbers. */ @@ -92,6 +92,6 @@ main (void) H5Tclose(datatype); H5Dclose(dataset); H5Fclose(file); - + return 0; -} +} diff --git a/examples/ph5example.c b/examples/ph5example.c index b2929ab..09ad7c2 100644 --- a/examples/ph5example.c +++ b/examples/ph5example.c @@ -26,7 +26,7 @@ * each dataset in an independent mode and prints them out. * All processes collectively close the datasets and the file. * - * The need of requirement of parallel file prefix is that in general + * The need of requirement of parallel file prefix is that in general * the current working directory in which compiling is done, is not suitable * for parallel I/O and there is no standard pathname for parallel file * systems. In some cases, the parallel file name may even needs some @@ -250,7 +250,7 @@ phdf5writeInd(char *filename) hsize_t count[SPACE1_RANK], stride[SPACE1_RANK]; /* for hyperslab setting */ herr_t ret; /* Generic return value */ - + MPI_Comm comm = MPI_COMM_WORLD; MPI_Info info = MPI_INFO_NULL; @@ -258,14 +258,14 @@ phdf5writeInd(char *filename) printf("Independent write test on file %s\n", filename); /* ------------------- - * START AN HDF5 FILE + * START AN HDF5 FILE * -------------------*/ /* setup file access template with parallel IO access. */ acc_tpl1 = H5Pcreate (H5P_FILE_ACCESS); assert(acc_tpl1 != FAIL); MESG("H5Pcreate access succeed"); /* set Parallel access with communicator */ - ret = H5Pset_fapl_mpio(acc_tpl1, comm, info); + ret = H5Pset_fapl_mpio(acc_tpl1, comm, info); assert(ret != FAIL); MESG("H5Pset_fapl_mpio succeed"); @@ -288,7 +288,7 @@ phdf5writeInd(char *filename) assert (sid1 != FAIL); MESG("H5Screate_simple succeed"); - + /* create a dataset collectively */ dataset1 = H5Dcreate(fid1, DATASETNAME1, H5T_NATIVE_INT, sid1, H5P_DEFAULT); @@ -321,8 +321,8 @@ if (verbose) MESG("data_array initialized"); /* create a file dataspace independently */ - file_dataspace = H5Dget_space (dataset1); - assert(file_dataspace != FAIL); + file_dataspace = H5Dget_space (dataset1); + assert(file_dataspace != FAIL); MESG("H5Dget_space succeed"); ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, NULL); @@ -334,21 +334,21 @@ if (verbose) assert (mem_dataspace != FAIL); /* write data independently */ - ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace, - H5P_DEFAULT, data_array1); + ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace, + H5P_DEFAULT, data_array1); assert(ret != FAIL); MESG("H5Dwrite succeed"); /* write data independently */ - ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace, - H5P_DEFAULT, data_array1); + ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace, + H5P_DEFAULT, data_array1); assert(ret != FAIL); MESG("H5Dwrite succeed"); /* release dataspace ID */ H5Sclose(file_dataspace); - /* close dataset collectively */ + /* close dataset collectively */ ret=H5Dclose(dataset1); assert(ret != FAIL); MESG("H5Dclose1 succeed"); @@ -359,8 +359,8 @@ if (verbose) /* release all IDs created */ H5Sclose(sid1); - /* close the file collectively */ - H5Fclose(fid1); + /* close the file collectively */ + H5Fclose(fid1); } /* Example of using the parallel HDF5 library to read a dataset */ @@ -390,7 +390,7 @@ phdf5readInd(char *filename) acc_tpl1 = H5Pcreate (H5P_FILE_ACCESS); assert(acc_tpl1 != FAIL); /* set Parallel access with communicator */ - ret = H5Pset_fapl_mpio(acc_tpl1, comm, info); + ret = H5Pset_fapl_mpio(acc_tpl1, comm, info); assert(ret != FAIL); @@ -497,7 +497,7 @@ phdf5writeAll(char *filename) hsize_t count[SPACE1_RANK], stride[SPACE1_RANK]; /* for hyperslab setting */ herr_t ret; /* Generic return value */ - + MPI_Comm comm = MPI_COMM_WORLD; MPI_Info info = MPI_INFO_NULL; @@ -505,14 +505,14 @@ phdf5writeAll(char *filename) printf("Collective write test on file %s\n", filename); /* ------------------- - * START AN HDF5 FILE + * START AN HDF5 FILE * -------------------*/ /* setup file access template with parallel IO access. */ acc_tpl1 = H5Pcreate (H5P_FILE_ACCESS); assert(acc_tpl1 != FAIL); MESG("H5Pcreate access succeed"); /* set Parallel access with communicator */ - ret = H5Pset_fapl_mpio(acc_tpl1, comm, info); + ret = H5Pset_fapl_mpio(acc_tpl1, comm, info); assert(ret != FAIL); MESG("H5Pset_fapl_mpio succeed"); @@ -535,7 +535,7 @@ phdf5writeAll(char *filename) assert (sid1 != FAIL); MESG("H5Screate_simple succeed"); - + /* create a dataset collectively */ dataset1 = H5Dcreate(fid1, DATASETNAME1, H5T_NATIVE_INT, sid1, H5P_DEFAULT); assert(dataset1 != FAIL); @@ -559,8 +559,8 @@ if (verbose) (unsigned long)(count[0]*count[1])); /* create a file dataspace independently */ - file_dataspace = H5Dget_space (dataset1); - assert(file_dataspace != FAIL); + file_dataspace = H5Dget_space (dataset1); + assert(file_dataspace != FAIL); MESG("H5Dget_space succeed"); ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, NULL); @@ -588,7 +588,7 @@ if (verbose) /* write data collectively */ ret = H5Dwrite(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace, - xfer_plist, data_array1); + xfer_plist, data_array1); assert(ret != FAIL); MESG("H5Dwrite succeed"); @@ -616,8 +616,8 @@ if (verbose) } /* create a file dataspace independently */ - file_dataspace = H5Dget_space (dataset1); - assert(file_dataspace != FAIL); + file_dataspace = H5Dget_space (dataset1); + assert(file_dataspace != FAIL); MESG("H5Dget_space succeed"); ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, NULL); @@ -645,7 +645,7 @@ if (verbose) /* write data independently */ ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace, - xfer_plist, data_array1); + xfer_plist, data_array1); assert(ret != FAIL); MESG("H5Dwrite succeed"); @@ -657,7 +657,7 @@ if (verbose) /* * All writes completed. Close datasets collectively - */ + */ ret=H5Dclose(dataset1); assert(ret != FAIL); MESG("H5Dclose1 succeed"); @@ -668,8 +668,8 @@ if (verbose) /* release all IDs created */ H5Sclose(sid1); - /* close the file collectively */ - H5Fclose(fid1); + /* close the file collectively */ + H5Fclose(fid1); } /* @@ -705,14 +705,14 @@ phdf5readAll(char *filename) printf("Collective read test on file %s\n", filename); /* ------------------- - * OPEN AN HDF5 FILE + * OPEN AN HDF5 FILE * -------------------*/ /* setup file access template with parallel IO access. */ acc_tpl1 = H5Pcreate (H5P_FILE_ACCESS); assert(acc_tpl1 != FAIL); MESG("H5Pcreate access succeed"); /* set Parallel access with communicator */ - ret = H5Pset_fapl_mpio(acc_tpl1, comm, info); + ret = H5Pset_fapl_mpio(acc_tpl1, comm, info); assert(ret != FAIL); MESG("H5Pset_fapl_mpio succeed"); @@ -752,8 +752,8 @@ if (verbose) (unsigned long)(count[0]*count[1])); /* create a file dataspace independently */ - file_dataspace = H5Dget_space (dataset1); - assert(file_dataspace != FAIL); + file_dataspace = H5Dget_space (dataset1); + assert(file_dataspace != FAIL); MESG("H5Dget_space succeed"); ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, NULL); @@ -781,7 +781,7 @@ if (verbose) /* read data collectively */ ret = H5Dread(dataset1, H5T_NATIVE_INT, mem_dataspace, file_dataspace, - xfer_plist, data_array1); + xfer_plist, data_array1); assert(ret != FAIL); MESG("H5Dread succeed"); @@ -805,8 +805,8 @@ if (verbose) (unsigned long)(count[0]*count[1])); /* create a file dataspace independently */ - file_dataspace = H5Dget_space (dataset1); - assert(file_dataspace != FAIL); + file_dataspace = H5Dget_space (dataset1); + assert(file_dataspace != FAIL); MESG("H5Dget_space succeed"); ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, NULL); @@ -834,7 +834,7 @@ if (verbose) /* read data independently */ ret = H5Dread(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace, - xfer_plist, data_array1); + xfer_plist, data_array1); assert(ret != FAIL); MESG("H5Dread succeed"); @@ -850,7 +850,7 @@ if (verbose) /* * All reads completed. Close datasets collectively - */ + */ ret=H5Dclose(dataset1); assert(ret != FAIL); MESG("H5Dclose1 succeed"); @@ -858,8 +858,8 @@ if (verbose) assert(ret != FAIL); MESG("H5Dclose2 succeed"); - /* close the file collectively */ - H5Fclose(fid1); + /* close the file collectively */ + H5Fclose(fid1); } /* @@ -903,9 +903,9 @@ test_split_comm_access(char filenames[][PATH_MAX]) /* setup file access template */ acc_tpl = H5Pcreate (H5P_FILE_ACCESS); assert(acc_tpl != FAIL); - + /* set Parallel access with communicator */ - ret = H5Pset_fapl_mpio(acc_tpl, comm, info); + ret = H5Pset_fapl_mpio(acc_tpl, comm, info); assert(ret != FAIL); /* create the file collectively */ @@ -1055,7 +1055,7 @@ cleanup(void) int main(int argc, char **argv) { - int mpi_namelen; + int mpi_namelen; char mpi_name[MPI_MAX_PROCESSOR_NAME]; int i, n; diff --git a/fortran/src/H5Af.c b/fortran/src/H5Af.c index 7662d8b..74f1718 100644 --- a/fortran/src/H5Af.c +++ b/fortran/src/H5Af.c @@ -19,9 +19,9 @@ /*---------------------------------------------------------------------------- * Name: h5acreate_c - * Purpose: Call H5Acreate to create an attribute - * Inputs: obj_id - object identifier - * name - name of the attribute + * Purpose: Call H5Acreate to create an attribute + * Inputs: obj_id - object identifier + * name - name of the attribute * namelen - name length * type_id - datatype identifier * space_id - dataspace identifier @@ -53,13 +53,13 @@ nh5acreate_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *type_id, h done: if(c_name) HDfree(c_name); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5aopen_name _c - * Purpose: Call H5Aopen_name to open an attribute - * Inputs: obj_id - object identifier - * name - name of the attribute + * Purpose: Call H5Aopen_name to open an attribute + * Inputs: obj_id - object identifier + * name - name of the attribute * namelen - name length * Outputs: attr_id - dataset identifier * Returns: 0 on success, -1 on failure @@ -88,12 +88,12 @@ nh5aopen_name_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *attr_id done: if(c_name) HDfree(c_name); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5awritec_c * Purpose: Call h5awrite_c to write a character attribute - * Inputs: attr_id - dataset identifier + * Inputs: attr_id - dataset identifier * mem_type_id - memory datatype identifier * buf - character data buffer * dims - array to store dimensions sizes of buf; used only @@ -113,8 +113,8 @@ nh5awritec_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) /*---------------------------------------------------------------------------- * Name: h5awrite_c - * Purpose: Call H5Awrite to write a attribute - * Inputs: attr_id - attribute identifier + * Purpose: Call H5Awrite to write a attribute + * Inputs: attr_id - attribute identifier * mem_type_id - memory datatype identifier * buf - data buffer * dims - array to store dimensions sizes of buf; used only @@ -136,12 +136,12 @@ nh5awrite_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dim done: return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5areadc_c * Purpose: Call h5aread_c to read character attribute - * Inputs: dset_id - dataset identifier + * Inputs: dset_id - dataset identifier * mem_type_id - memory datatype identifier * dims - array to store dimensions sizes of buf; used only * by Fortran routine. @@ -161,8 +161,8 @@ nh5areadc_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) /*---------------------------------------------------------------------------- * Name: h5aread_c - * Purpose: Call H5Aread to read an attribute - * Inputs: dset_id - dataset identifier + * Purpose: Call H5Aread to read an attribute + * Inputs: dset_id - dataset identifier * mem_type_id - memory datatype identifier * dims - array to store dimensions sizes of buf; used only * by Fortran routine. @@ -188,7 +188,7 @@ done: /*---------------------------------------------------------------------------- * Name: h5aclose_c - * Purpose: Call H5Aclose to close an attribute + * Purpose: Call H5Aclose to close an attribute * Inputs: attr_id - identifier of an attribute to be closed * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -196,7 +196,7 @@ done: * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5aclose_c ( hid_t_f *attr_id ) { int_f ret_value=0; /* Return value */ @@ -210,9 +210,9 @@ done: /*---------------------------------------------------------------------------- * Name: h5adelete_c - * Purpose: Call H5Adelete to delete an attribute - * Inputs: obj_id - object identifier - * name - name of the attribute + * Purpose: Call H5Adelete to delete an attribute + * Inputs: obj_id - object identifier + * name - name of the attribute * namelen - name length * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -240,13 +240,13 @@ nh5adelete_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen) done: if(c_name) HDfree(c_name); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5aopen_idx_c - * Purpose: Call H5Aopen_idx to open an attribute - * Inputs: obj_id - object identifier + * Purpose: Call H5Aopen_idx to open an attribute + * Inputs: obj_id - object identifier * idx - attribute index ( zero based) * Outputs: attr_id - attribute identifier * Returns: 0 on success, -1 on failure @@ -267,13 +267,13 @@ nh5aopen_idx_c (hid_t_f *obj_id, int_f *idx, hid_t_f *attr_id) done: return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5aget_space_c - * Purpose: Call H5Aget_space to get attribute's dataspace - * Inputs: attr_id - attribute identifier + * Purpose: Call H5Aget_space to get attribute's dataspace + * Inputs: attr_id - attribute identifier * Outputs: space_id - dataspace identifier * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -293,12 +293,12 @@ nh5aget_space_c (hid_t_f *attr_id, hid_t_f *space_id) done: return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5aget_type_c - * Purpose: Call H5Aget_space to get attribute's datatype - * Inputs: attr_id - attribute identifier + * Purpose: Call H5Aget_space to get attribute's datatype + * Inputs: attr_id - attribute identifier * Outputs: type_id - datatype identifier * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -318,14 +318,14 @@ nh5aget_type_c (hid_t_f *attr_id, hid_t_f *type_id) done: return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5aget_num_attrs_c - * Purpose: Call H5Aget_num_attrs to determine number of - * attributes of an object - * Inputs: obj_id - object identifier - * attr_num - number of attributes + * Purpose: Call H5Aget_num_attrs to determine number of + * attributes of an object + * Inputs: obj_id - object identifier + * attr_num - number of attributes * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Thursday, August 12, 1999 @@ -344,13 +344,13 @@ nh5aget_num_attrs_c (hid_t_f *obj_id, int_f *attr_num) done: return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5aget_name_c - * Purpose: Call H5Aget_name to get attribute's name - * Inputs: attr_id - attribute identifier - * bufsize -size of the buffer + * Purpose: Call H5Aget_name to get attribute's name + * Inputs: attr_id - attribute identifier + * bufsize -size of the buffer * Outputs: buf - buffer to hold the name * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -368,7 +368,7 @@ nh5aget_name_c(hid_t_f *attr_id, size_t_f *bufsize, _fcd buf) */ if ((c_buf = HDmalloc((size_t)*bufsize +1)) == NULL) HGOTO_DONE(FAIL); - + /* * Call H5Aget_name function */ diff --git a/fortran/src/H5Df.c b/fortran/src/H5Df.c index ccf9804..70eed40 100644 --- a/fortran/src/H5Df.c +++ b/fortran/src/H5Df.c @@ -18,9 +18,9 @@ /*---------------------------------------------------------------------------- * Name: h5dcreate_c - * Purpose: Call H5Dcreate to create a dataset - * Inputs: loc_id - file or group identifier - * name - name of the dataset + * Purpose: Call H5Dcreate to create a dataset + * Inputs: loc_id - file or group identifier + * name - name of the dataset * namelen - name length * type_id - datatype identifier * space_id - dataspace identifier @@ -42,7 +42,7 @@ nh5dcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_ hid_t c_space_id; hid_t c_dset_id; hid_t c_crt_prp; - + /* * Define creation property */ @@ -52,7 +52,7 @@ nh5dcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_ * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -69,13 +69,13 @@ nh5dcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_ DONE: HDfree(c_name); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5dopen_c - * Purpose: Call H5Dopen to open a dataset - * Inputs: loc_id - file or group identifier - * name - name of the dataset + * Purpose: Call H5Dopen to open a dataset + * Inputs: loc_id - file or group identifier + * name - name of the dataset * namelen - name length * Outputs: dset_id - dataset identifier * Returns: 0 on success, -1 on failure @@ -96,7 +96,7 @@ nh5dopen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *dset_id) * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -112,12 +112,12 @@ nh5dopen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *dset_id) DONE: HDfree(c_name); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5dwritec_c - * Purpose: Call h5dwrite_c to write a dataset of characters - * Inputs: dset_id - dataset identifier + * Purpose: Call h5dwrite_c to write a dataset of characters + * Inputs: dset_id - dataset identifier * mem_type_id - memory datatype identifier * mem_space_id - memory dataspace identifier * file_space_id - memory dataspace identifier @@ -133,7 +133,7 @@ int_f nh5dwritec_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims) { int ret_value = -1; - + /* * Call h5dwrite_c function. */ @@ -144,8 +144,8 @@ nh5dwritec_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid /*---------------------------------------------------------------------------- * Name: h5dwrite_c - * Purpose: Call H5Dwrite to write a dataset - * Inputs: dset_id - dataset identifier + * Purpose: Call H5Dwrite to write a dataset + * Inputs: dset_id - dataset identifier * mem_type_id - memory datatype identifier * mem_space_id - memory dataspace identifier * file_space_id - memory dataspace identifier @@ -172,7 +172,7 @@ nh5dwrite_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_ * Define transfer property */ c_xfer_prp = (hid_t)*xfer_prp; - + /* * Call H5Dwrite function. */ @@ -185,19 +185,19 @@ nh5dwrite_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_ if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5dwrite_ref_obj_c * Purpose: Call H5Dwrite to write a dataset of object references - * Inputs: dset_id - dataset identifier + * Inputs: dset_id - dataset identifier * mem_type_id - memory datatype identifier * mem_space_id - memory dataspace identifier * file_space_id - memory dataspace identifier * xfer_pr - identifier of transfer property list * buf - data buffer with references to the objects. - * n - number of references to be stored. + * n - number of references to be stored. * Returns: 0 on success,e-1 on failure * Programmer: Elena Pourmal * Tuesday, May 14, 2002 @@ -230,9 +230,9 @@ nh5dwrite_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_ if ( buf_c != NULL ) { for (i = 0; i < n; i++) HDmemcpy(&buf_c[i], &buf[i], sizeof(haddr_t)); - } + } else return ret_value; - + /* * Call H5Dwrite function. */ @@ -250,13 +250,13 @@ nh5dwrite_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_ /*---------------------------------------------------------------------------- * Name: h5dwrite_ref_reg_c * Purpose: Call H5Dwrite to write a dataset of dataset region references - * Inputs: dset_id - dataset identifier + * Inputs: dset_id - dataset identifier * mem_type_id - memory datatype identifier * mem_space_id - memory dataspace identifier * file_space_id - memory dataspace identifier * xfer_pr - identifier of transfer property list * buf - data buffer with references to the objects. - * n - number of references to be stored. + * n - number of references to be stored. * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Tuesday, May 14, 2002 @@ -281,7 +281,7 @@ nh5dwrite_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_ * Define transfer property */ c_xfer_prp = (hid_t)*xfer_prp; - + /* * Allocate temporary buffer and copy references from Fortran. */ @@ -291,10 +291,10 @@ nh5dwrite_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_ HDmemcpy(&buf_c[i], buf, H5R_DSET_REG_REF_BUF_SIZE); buf = buf + REF_REG_BUF_LEN_F; } - } + } else return ret_value; - - + + /* * Call H5Dwrite function. */ @@ -307,14 +307,14 @@ nh5dwrite_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_ if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5dreadc_c - * Purpose: Call h5dread_c to read a dataset of characters - * Inputs: dset_id - dataset identifier + * Purpose: Call h5dread_c to read a dataset of characters + * Inputs: dset_id - dataset identifier * mem_type_id - memory datatype identifier * mem_space_id - memory dataspace identifier * file_space_id - memory dataspace identifier @@ -330,7 +330,7 @@ int_f nh5dreadc_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims) { int ret_value = -1; - + /* * Call h5dread_c function. */ @@ -341,8 +341,8 @@ nh5dreadc_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_ /*---------------------------------------------------------------------------- * Name: h5dread_c - * Purpose: Call H5Draed to read a dataset - * Inputs: dset_id - dataset identifier + * Purpose: Call H5Draed to read a dataset + * Inputs: dset_id - dataset identifier * mem_type_id - memory datatype identifier * mem_space_id - memory dataspace identifier * file_space_id - memory dataspace identifier @@ -369,7 +369,7 @@ nh5dread_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t * Define transfer property */ c_xfer_prp = (hid_t)*xfer_prp; - + /* * Call H5Dread function. */ @@ -387,13 +387,13 @@ nh5dread_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t /*---------------------------------------------------------------------------- * Name: h5dread_ref_obj_c * Purpose: Call H5Dread to read a dataset of object references - * Inputs: dset_id - dataset identifier + * Inputs: dset_id - dataset identifier * mem_type_id - memory datatype identifier * mem_space_id - memory dataspace identifier * file_space_id - memory dataspace identifier * xfer_pr - identifier of transfer property list * buf - data buffer to store references to the objects. - * n - number of references to be stored. + * n - number of references to be stored. * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, May 15, 2002 @@ -417,7 +417,7 @@ nh5dread_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i * Define transfer property */ c_xfer_prp = (hid_t)*xfer_prp; - + /* * Allocate temporary buffer. */ @@ -437,7 +437,7 @@ nh5dread_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i HDmemcpy(&buf[i], &buf_c[i], sizeof(haddr_t)); } if ( buf_c != NULL ) HDfree(buf_c); - } + } if (ret < 0) return ret_value; ret_value = 0; return ret_value; @@ -446,13 +446,13 @@ nh5dread_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i /*---------------------------------------------------------------------------- * Name: h5dread_ref_reg_c * Purpose: Call H5Dread to read a dataset of dataset region references - * Inputs: dset_id - dataset identifier + * Inputs: dset_id - dataset identifier * mem_type_id - memory datatype identifier * mem_space_id - memory dataspace identifier * file_space_id - memory dataspace identifier * xfer_pr - identifier of transfer property list * buf - data buffer to store references to the objects. - * n - number of references to be stored. + * n - number of references to be stored. * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, May 15, 2002 @@ -476,7 +476,7 @@ nh5dread_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i * Define transfer property */ c_xfer_prp = (hid_t)*xfer_prp; - + /* * Allocate temporary buffer. */ @@ -494,20 +494,20 @@ nh5dread_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i for (i = 0; i < n; i++) { HDmemcpy(buf, &buf_c[i], H5R_DSET_REG_REF_BUF_SIZE); buf = buf + REF_REG_BUF_LEN_F; - } + } } if ( buf_c != NULL ) HDfree(buf_c); - } + } if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5dclose_c - * Purpose: Call H5Dclose to close a dataset + * Purpose: Call H5Dclose to close a dataset * Inputs: dset_id - identifier of the dataset to be closed * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -527,7 +527,7 @@ nh5dclose_c ( hid_t_f *dset_id ) /*---------------------------------------------------------------------------- * Name: h5dget_space_c - * Purpose: Call H5Dget_space to obtain dataspace of a dataset + * Purpose: Call H5Dget_space to obtain dataspace of a dataset * Inputs: dset_id - identifier of the dataset * Outputs: space_id - identifier of the dataset's dataspace * Returns: 0 on success, -1 on failure @@ -536,14 +536,14 @@ nh5dclose_c ( hid_t_f *dset_id ) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5dget_space_c ( hid_t_f *dset_id , hid_t_f *space_id) { int ret_value = -1; hid_t c_dset_id; hid_t c_space_id; - - c_dset_id = (hid_t)*dset_id; + + c_dset_id = (hid_t)*dset_id; c_space_id = H5Dget_space(c_dset_id); if(c_space_id < 0 ) return ret_value; ret_value = 0; @@ -553,7 +553,7 @@ nh5dget_space_c ( hid_t_f *dset_id , hid_t_f *space_id) /*---------------------------------------------------------------------------- * Name: h5dget_type_c - * Purpose: Call H5Dget_type to obtain datatype of a dataset + * Purpose: Call H5Dget_type to obtain datatype of a dataset * Inputs: dset_id - identifier of the dataset * Outputs: type_id - identifier of the dataset's datatype * Returns: 0 on success, -1 on failure @@ -562,13 +562,13 @@ nh5dget_space_c ( hid_t_f *dset_id , hid_t_f *space_id) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5dget_type_c ( hid_t_f *dset_id , hid_t_f *type_id) { int ret_value = -1; hid_t c_dset_id; hid_t c_type_id; - + c_dset_id = (hid_t)*dset_id; c_type_id = H5Dget_type(c_dset_id); @@ -582,7 +582,7 @@ nh5dget_type_c ( hid_t_f *dset_id , hid_t_f *type_id) /*---------------------------------------------------------------------------- * Name: h5dget_create_plist_c * Purpose: Call H5Dget_create_plist to obtain creation property list - * of a dataset + * of a dataset * Inputs: dset_id - identifier of the dataset * Outputs: plist_id - identifier of he dataset creation property list * Returns: 0 on success, -1 on failure @@ -591,13 +591,13 @@ nh5dget_type_c ( hid_t_f *dset_id , hid_t_f *type_id) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5dget_create_plist_c ( hid_t_f *dset_id , hid_t_f *plist_id) { int ret_value = -1; hid_t c_dset_id; hid_t c_plist_id; - + c_dset_id = (hid_t)*dset_id; c_plist_id = H5Dget_create_plist(c_dset_id); @@ -611,16 +611,16 @@ nh5dget_create_plist_c ( hid_t_f *dset_id , hid_t_f *plist_id) /*---------------------------------------------------------------------------- * Name: h5dextend_c - * Purpose: Call H5Dextend to extend dataset with unlimited dimensions - * Inputs: dset_id - identifier of the dataset - * Outputs: dims - array with the dimension sizes + * Purpose: Call H5Dextend to extend dataset with unlimited dimensions + * Inputs: dset_id - identifier of the dataset + * Outputs: dims - array with the dimension sizes * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Thursday, August 19, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5dextend_c ( hid_t_f *dset_id , hsize_t_f *dims) { int ret_value = -1; @@ -644,9 +644,9 @@ nh5dextend_c ( hid_t_f *dset_id , hsize_t_f *dims) /* * Reverse dimensions due to C-FORTRAN storage order. */ - for (i=0; i < rank; i++) + for (i=0; i < rank; i++) c_dims[i] = dims[rank - i - 1]; - + status = H5Dextend(c_dset_id, c_dims); if ( status >= 0 ) ret_value = 0; @@ -656,9 +656,9 @@ nh5dextend_c ( hid_t_f *dset_id , hsize_t_f *dims) /*---------------------------------------------------------------------------- * Name: nh5dget_storage_size_c - * Purpose: Call H5Dget_storage_size to return the amount of storage + * Purpose: Call H5Dget_storage_size to return the amount of storage * required for a dataset - * Inputs: dset_id - identifier of the dataset + * Inputs: dset_id - identifier of the dataset * Outputs: size - the amount of storage required for a dataset * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -666,7 +666,7 @@ nh5dextend_c ( hid_t_f *dset_id , hsize_t_f *dims) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5dget_storage_size_c ( hid_t_f *dset_id , hsize_t_f *size) { int ret_value = -1; @@ -684,9 +684,9 @@ nh5dget_storage_size_c ( hid_t_f *dset_id , hsize_t_f *size) /*---------------------------------------------------------------------------- * Name: nh5dvlen_get_max_len_c * Purpose: Get the maximum size of the VL dataset element - * Inputs: dset_id - identifier of the dataset + * Inputs: dset_id - identifier of the dataset * type_id - datatype identifier - * space_id - dataspace identifier + * space_id - dataspace identifier * Outputs: len - maximum length of the VL dataset element * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -694,7 +694,7 @@ nh5dget_storage_size_c ( hid_t_f *dset_id , hsize_t_f *size) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5dvlen_get_max_len_c ( hid_t_f *dset_id , hid_t_f *type_id, hid_t_f *space_id, size_t_f *len) { int ret_value = -1; @@ -711,20 +711,20 @@ nh5dvlen_get_max_len_c ( hid_t_f *dset_id , hid_t_f *type_id, hid_t_f *space_id c_type_id = (hid_t)*type_id; c_space_id = (hid_t)*space_id; - num_elem = H5Sget_select_npoints(c_space_id); + num_elem = H5Sget_select_npoints(c_space_id); if( num_elem < 0) return ret_value; - c_buf = (hvl_t *)malloc(sizeof(hvl_t)*(size_t)num_elem); + c_buf = (hvl_t *)malloc(sizeof(hvl_t)*(size_t)num_elem); if (c_buf == NULL) return ret_value; status = H5Dread(c_dset_id, c_type_id, H5S_ALL, c_space_id, H5P_DEFAULT, c_buf); if(status < 0) goto DONE; - + c_len = 0; - for (i=0; i < num_elem; i++) c_len = H5_MAX(c_len, c_buf[i].len); + for (i=0; i < num_elem; i++) c_len = H5_MAX(c_len, c_buf[i].len); *len = (size_t_f)c_len; H5Dvlen_reclaim(c_type_id, c_space_id, H5P_DEFAULT, c_buf); ret_value = 0; - + DONE: free(c_buf); @@ -732,11 +732,11 @@ DONE: } /*---------------------------------------------------------------------------- * Name: nh5dwrite_vl_integer_c - * Purpose: Write variable length dataset - * Inputs: dset_id - identifier of the dataset + * Purpose: Write variable length dataset + * Inputs: dset_id - identifier of the dataset * mem_type_id - datatype identifier - * mem_space_id - dataspace identifier - * file_space_id - file dataspace identifier + * mem_space_id - dataspace identifier + * file_space_id - file dataspace identifier * xfer - file transfer property * buf - data buffer * dims - one-demnsional array of size 2 @@ -749,7 +749,7 @@ DONE: * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5dwrite_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, int_f *buf, hsize_t_f *dims, size_t_f *len) { int ret_value = -1; @@ -765,7 +765,7 @@ nh5dwrite_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_ hvl_t *c_buf; hsize_t i; hsize_t num_elem; - + max_len = (size_t)dims[0]; num_elem = dims[1]; @@ -775,14 +775,14 @@ nh5dwrite_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_ c_file_space_id = (hid_t)*file_space_id; c_xfer_prp = (hid_t)*xfer_prp; - c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t)); + c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t)); if (c_buf == NULL) return ret_value; - tmp = (int *)buf; + tmp = (int *)buf; for (i=0; i < num_elem; i++) { - c_buf[i].len = (size_t)len[i]; + c_buf[i].len = (size_t)len[i]; c_buf[i].p = tmp; tmp = tmp + max_len; - } + } /* * Call H5Dwrite function. */ @@ -797,11 +797,11 @@ DONE: /*---------------------------------------------------------------------------- * Name: nh5dread_vl_integer_c - * Purpose: Read variable length dataset - * Inputs: dset_id - identifier of the dataset + * Purpose: Read variable length dataset + * Inputs: dset_id - identifier of the dataset * mem_type_id - datatype identifier - * mem_space_id - dataspace identifier - * file_space_id - file dataspace identifier + * mem_space_id - dataspace identifier + * file_space_id - file dataspace identifier * xfer - file transfer property * dims - one-demnsional array of size 2 * dims[0] = MAXLENGTH @@ -814,7 +814,7 @@ DONE: * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5dread_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, int_f *buf, hsize_t_f *dims, size_t_f *len) { int ret_value = -1; @@ -829,7 +829,7 @@ nh5dread_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_s hvl_t *c_buf; size_t i; hssize_t num_elem; - + c_dset_id = (hid_t)*dset_id; c_mem_type_id = (hid_t)*mem_type_id; c_mem_space_id = (hid_t)*mem_space_id; @@ -837,10 +837,10 @@ nh5dread_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_s c_xfer_prp = (hid_t)*xfer_prp; max_len = (size_t)dims[0]; - num_elem = H5Sget_select_npoints(c_mem_space_id); + num_elem = H5Sget_select_npoints(c_mem_space_id); if(num_elem != dims[1]) return ret_value; - c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t)); + c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t)); if (c_buf == NULL) return ret_value; /* * Call H5Dread function. @@ -848,7 +848,7 @@ nh5dread_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_s status = H5Dread(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, c_buf); if ( status < 0 ) goto DONE; for (i=0; i < num_elem; i++) { - len[i] = (size_t_f)c_buf[i].len; + len[i] = (size_t_f)c_buf[i].len; memcpy(&buf[i*max_len], c_buf[i].p, c_buf[i].len*sizeof(int)); } H5Dvlen_reclaim(c_mem_type_id, c_mem_space_id, H5P_DEFAULT, c_buf); @@ -861,13 +861,13 @@ DONE: /*---------------------------------------------------------------------------- * Name: nh5dwrite_vl_string_c * Purpose: Write variable length strings from Fortran program - * Inputs: dset_id - identifier of the dataset + * Inputs: dset_id - identifier of the dataset * mem_type_id - datatype identifier - * mem_space_id - dataspace identifier - * file_space_id - file dataspace identifier + * mem_space_id - dataspace identifier + * file_space_id - file dataspace identifier * xfer - file transfer property * buf - data buffer - * dims - one-demnsional array of size 2 + * dims - one-demnsional array of size 2 * dims[0] = number of strings of size max_len * len - array of strings lengths * Returns: 0 on success, -1 on failure @@ -876,7 +876,7 @@ DONE: * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5dwrite_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims, size_t_f *len) { int ret_value = -1; @@ -892,7 +892,7 @@ nh5dwrite_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_sp char **c_buf; hsize_t i; hsize_t num_elem; - + max_len = (size_t)dims[0]; num_elem = dims[1]; @@ -905,7 +905,7 @@ nh5dwrite_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_sp /* * Allocate arra of character pointers */ - c_buf = (char **)malloc((size_t)num_elem * sizeof(char *)); + c_buf = (char **)malloc((size_t)num_elem * sizeof(char *)); if (c_buf == NULL) return ret_value; /* Copy data to long C string */ @@ -920,7 +920,7 @@ nh5dwrite_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_sp for (i=0; i < num_elem; i++) { c_buf[i] = (char *) malloc((size_t)len[i]+1); memcpy(c_buf[i], tmp_p, (size_t)len[i]); - c_buf[i][len[i]] = '\0'; + c_buf[i][len[i]] = '\0'; tmp_p = tmp_p + max_len; } @@ -940,12 +940,12 @@ DONE: /*---------------------------------------------------------------------------- * Name: nh5dread_vl_string_c * Purpose: Read variable length strings from Fortran program - * Inputs: dset_id - identifier of the dataset + * Inputs: dset_id - identifier of the dataset * mem_type_id - datatype identifier - * mem_space_id - dataspace identifier - * file_space_id - file dataspace identifier + * mem_space_id - dataspace identifier + * file_space_id - file dataspace identifier * xfer - file transfer property - * dims - one-demnsional array of size 2 + * dims - one-demnsional array of size 2 * dims[0] = number of strings of size max_len * Output: buf - data buffer * len - array of strings lengths @@ -955,7 +955,7 @@ DONE: * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, _fcd buf, hsize_t_f *dims, size_t_f *len) { int ret_value = -1; @@ -971,7 +971,7 @@ nh5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa char **c_buf; hsize_t i; hsize_t num_elem; - + max_len = (size_t)dims[0]; num_elem = dims[1]; @@ -984,7 +984,7 @@ nh5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa /* * Allocate array of character pointers */ - c_buf = (char **)malloc((size_t)num_elem * sizeof(char *)); + c_buf = (char **)malloc((size_t)num_elem * sizeof(char *)); if (c_buf == NULL) return ret_value; /* @@ -1014,11 +1014,11 @@ nh5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa /*---------------------------------------------------------------------------- * Name: nh5dwrite_vl_real_c - * Purpose: Write variable length dataset - * Inputs: dset_id - identifier of the dataset + * Purpose: Write variable length dataset + * Inputs: dset_id - identifier of the dataset * mem_type_id - datatype identifier - * mem_space_id - dataspace identifier - * file_space_id - file dataspace identifier + * mem_space_id - dataspace identifier + * file_space_id - file dataspace identifier * xfer - file transfer property * buf - data buffer * dims - one-demnsional array of size 2 @@ -1031,7 +1031,7 @@ nh5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5dwrite_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, real_f *buf, hsize_t_f *dims, size_t_f *len) { int ret_value = -1; @@ -1047,7 +1047,7 @@ nh5dwrite_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa hvl_t *c_buf; hsize_t i; hsize_t num_elem; - + max_len = (size_t)dims[0]; num_elem = dims[1]; @@ -1057,14 +1057,14 @@ nh5dwrite_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa c_file_space_id = (hid_t)*file_space_id; c_xfer_prp = (hid_t)*xfer_prp; - c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t)); + c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t)); if (c_buf == NULL) return ret_value; - tmp = (real_f *)buf; + tmp = (real_f *)buf; for (i=0; i < num_elem; i++) { - c_buf[i].len = (size_t)len[i]; + c_buf[i].len = (size_t)len[i]; c_buf[i].p = tmp; tmp = tmp + max_len; - } + } /* * Call H5Dwrite function. */ @@ -1079,11 +1079,11 @@ DONE: /*---------------------------------------------------------------------------- * Name: nh5dread_vl_real_c - * Purpose: Read variable length dataset - * Inputs: dset_id - identifier of the dataset + * Purpose: Read variable length dataset + * Inputs: dset_id - identifier of the dataset * mem_type_id - datatype identifier - * mem_space_id - dataspace identifier - * file_space_id - file dataspace identifier + * mem_space_id - dataspace identifier + * file_space_id - file dataspace identifier * xfer - file transfer property * dims - one-demnsional array of size 2 * dims[0] = MAXLENGTH @@ -1096,7 +1096,7 @@ DONE: * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5dread_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t_f *file_space_id, hid_t_f *xfer_prp, real_f *buf, hsize_t_f *dims, size_t_f *len) { int ret_value = -1; @@ -1111,7 +1111,7 @@ nh5dread_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spac hvl_t *c_buf; size_t i; hssize_t num_elem; - + c_dset_id = (hid_t)*dset_id; c_mem_type_id = (hid_t)*mem_type_id; c_mem_space_id = (hid_t)*mem_space_id; @@ -1119,10 +1119,10 @@ nh5dread_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spac c_xfer_prp = (hid_t)*xfer_prp; max_len = (size_t)dims[0]; - num_elem = H5Sget_select_npoints(c_mem_space_id); + num_elem = H5Sget_select_npoints(c_mem_space_id); if(num_elem != dims[1]) return ret_value; - c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t)); + c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t)); if (c_buf == NULL) return ret_value; /* * Call H5Dread function. @@ -1130,10 +1130,10 @@ nh5dread_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spac status = H5Dread(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, c_buf); if ( status <0 ) goto DONE; for (i=0; i < num_elem; i++) { - len[i] = (size_t_f)c_buf[i].len; + len[i] = (size_t_f)c_buf[i].len; memcpy(&buf[i*max_len], c_buf[i].p, c_buf[i].len*sizeof(real_f)); } - + H5Dvlen_reclaim(c_mem_type_id, c_mem_space_id, H5P_DEFAULT, c_buf); ret_value = 0; DONE: @@ -1158,7 +1158,7 @@ int_f nh5dfillc_c (_fcd fill_value, hid_t_f *fill_type_id, hid_t_f *space_id, _fcd buf, hid_t_f *mem_type_id) { int ret_value = -1; - + /* * Call h5dfill_c function. */ @@ -1192,7 +1192,7 @@ nh5dfill_c (void * fill_value, hid_t_f *fill_type_id, hid_t_f *space_id, void * c_fill_type_id = (hid_t)*fill_type_id; c_mem_type_id = (hid_t)*mem_type_id; c_space_id = (hid_t)*space_id; - + /* * Call H5Dfill function. */ @@ -1201,7 +1201,7 @@ nh5dfill_c (void * fill_value, hid_t_f *fill_type_id, hid_t_f *space_id, void * if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5dget_space_status_c @@ -1223,7 +1223,7 @@ nh5dget_space_status_c ( hid_t_f *dset_id, int_f *flag) H5D_space_status_t c_flag; c_dset_id = (hid_t)*dset_id; - + /* * Call H5Dget_space_status */ @@ -1233,5 +1233,5 @@ nh5dget_space_status_c ( hid_t_f *dset_id, int_f *flag) *flag = (int_f)c_flag; ret_value = 0; return ret_value; -} +} diff --git a/fortran/src/H5Ef.c b/fortran/src/H5Ef.c index cff7486..718623e 100644 --- a/fortran/src/H5Ef.c +++ b/fortran/src/H5Ef.c @@ -20,15 +20,15 @@ /*---------------------------------------------------------------------------- * Name: h5eclear_c * Purpose: Call H5Eclear to clear the error stack for the current thread - * Inputs: - * Outputs: + * Inputs: + * Outputs: * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Wednesday, March 29, 2000 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5eclear_c( ) { int ret_val = -1; @@ -37,18 +37,18 @@ nh5eclear_c( ) /* * Call H5Eclear function. */ - status = H5Eclear(); + status = H5Eclear(); if(status < 0) return ret_val; ret_val = 0; return ret_val; -} +} /*---------------------------------------------------------------------------- * Name: h5eprint_c1 * Purpose: Call H5Eprint to print the error stack in a default manner. * Inputs: name - file name * namelen - length of name - * Outputs: + * Outputs: * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Wednesday, March 29, 2000 @@ -76,17 +76,17 @@ nh5eprint_c1(_fcd name, int_f* namelen) fclose(file); DONE: - HDfree(c_name); + HDfree(c_name); return ret_val; -} +} /*---------------------------------------------------------------------------- * Name: h5eprint_c2 * Purpose: Call H5Eprint to print the error stack to stderr * in a default manner. - * Inputs: - * Outputs: + * Inputs: + * Outputs: * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Wednesday, March 29, 2000 @@ -104,11 +104,11 @@ nh5eprint_c2() status = H5Eprint(NULL); if(status >= 0) ret_val = 0; return ret_val; -} +} /*---------------------------------------------------------------------------- * Name: h5eget_major_c - * Purpose: Call H5Eget_major to get a character string + * Purpose: Call H5Eget_major to get a character string * describing an error specified by a major error number. * Inputs: error_no - Major error number * Outputs: name - character string describing the error @@ -129,16 +129,16 @@ nh5eget_major_c(int_f* error_no, _fcd name) * Call H5Eget_major function. */ c_name = H5Eget_major(c_error_no); - HD5packFstring((char*)c_name, _fcdtocp(name), strlen(c_name)); - + HD5packFstring((char*)c_name, _fcdtocp(name), strlen(c_name)); + if(!strcmp(c_name, "Invalid major error number")) return ret_val; ret_val = 0; return ret_val; -} +} /*---------------------------------------------------------------------------- * Name: h5eget_minor_c - * Purpose: Call H5Eget_minor to get a character string + * Purpose: Call H5Eget_minor to get a character string * describing an error specified by a minor error number. * Inputs: error_no - Major error number * Outputs: name - character string describing the error @@ -159,18 +159,18 @@ nh5eget_minor_c(int_f* error_no, _fcd name) * Call H5Eget_minor function. */ c_name = H5Eget_minor(c_error_no); - HD5packFstring((char*)c_name, _fcdtocp(name), strlen(c_name)); - + HD5packFstring((char*)c_name, _fcdtocp(name), strlen(c_name)); + if(!strcmp(c_name, "Invalid minor error number")) return ret_val; ret_val = 0; return ret_val; -} +} /*---------------------------------------------------------------------------- * Name: h5eset_auto_c * Purpose: Call H5Eset_auto to turn automatic error printing on or off. * Inputs: printflag - flag to turn automatic error printing on or off. - * Outputs: + * Outputs: * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Friday, November 17, 2000 diff --git a/fortran/src/H5FDmpiof.c b/fortran/src/H5FDmpiof.c index 4f056c7..72edc4d 100644 --- a/fortran/src/H5FDmpiof.c +++ b/fortran/src/H5FDmpiof.c @@ -15,12 +15,12 @@ /* This files contains C stubs for Parallel Fortran APIs */ #include "H5f90.h" -#include +#include #include "H5pubconf_fortran.h" /* Support for C to Fortran translation in MPI */ -#ifndef H5_HAVE_MPI_MULTI_LANG_Comm +#ifndef H5_HAVE_MPI_MULTI_LANG_Comm #define MPI_Comm_c2f(comm) (int_f)(comm) #define MPI_Comm_f2c(comm) (MPI_Comm)(comm) #endif /*MPI Comm*/ @@ -31,14 +31,14 @@ /*---------------------------------------------------------------------------- * Name: h5pset_fapl_mpio_c - * Purpose: Call H5Pset_fapl_mpio to set mode for parallel I/O and the user - * supplied communicator and info object + * Purpose: Call H5Pset_fapl_mpio to set mode for parallel I/O and the user + * supplied communicator and info object * Inputs: prp_id - property list identifier - * comm - MPI communicator - * info - MPI info object + * comm - MPI communicator + * info - MPI info object * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Thursday, October 26, 2000 + * Programmer: Elena Pourmal + * Thursday, October 26, 2000 * Modifications: *---------------------------------------------------------------------------*/ int_f @@ -48,8 +48,8 @@ nh5pset_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info) hid_t c_prp_id; herr_t ret; MPI_Comm c_comm; - MPI_Info c_info; - c_comm = MPI_Comm_f2c(*comm); + MPI_Info c_info; + c_comm = MPI_Comm_f2c(*comm); c_info = MPI_Info_f2c(*info); /* @@ -60,17 +60,17 @@ nh5pset_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info) if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_fapl_mpio_c - * Purpose: Call H5Pget_fapl_mpio to retrieve communicator and info object + * Purpose: Call H5Pget_fapl_mpio to retrieve communicator and info object * Inputs: prp_id - property list identifier - * comm - buffer to return MPI communicator - * info - buffer to return MPI info object + * comm - buffer to return MPI communicator + * info - buffer to return MPI info object * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Thursday, October 26, 2000 + * Programmer: Elena Pourmal + * Thursday, October 26, 2000 * Modifications: *---------------------------------------------------------------------------*/ int_f @@ -80,7 +80,7 @@ nh5pget_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info) hid_t c_prp_id; herr_t ret; MPI_Comm c_comm; - MPI_Info c_info; + MPI_Info c_info; /* * Call H5Pget_mpi function. @@ -92,16 +92,16 @@ nh5pget_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info) *info = (int_f) MPI_Info_c2f(c_info); ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pset_dxpl_mpio_c - * Purpose: Call H5Pset_dxpl_mpio to set transfer mode of the dataset - * trasfer property list + * Purpose: Call H5Pset_dxpl_mpio to set transfer mode of the dataset + * trasfer property list * Inputs: prp_id - property list identifier * data_xfer_mode - transfer mode * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Thursday, October 26, 2000 + * Programmer: Elena Pourmal + * Thursday, October 26, 2000 * Modifications: *---------------------------------------------------------------------------*/ int_f @@ -134,17 +134,17 @@ nh5pset_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode) if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_dxpl_mpio_c - * Purpose: Call H5Pget_dxpl_mpio to get transfer mode of the dataset - * trasfer property list + * Purpose: Call H5Pget_dxpl_mpio to get transfer mode of the dataset + * trasfer property list * Inputs: prp_id - property list identifier * data_xfer_mode - buffer to retrieve transfer mode * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Thursday, June 15, 2000 + * Programmer: Elena Pourmal + * Thursday, June 15, 2000 * Modifications: *---------------------------------------------------------------------------*/ int_f @@ -161,7 +161,7 @@ nh5pget_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode) c_prp_id = *prp_id; ret = H5Pget_dxpl_mpio(c_prp_id, &c_data_xfer_mode); if (ret < 0) return ret_value; - *data_xfer_mode = (int_f)c_data_xfer_mode; + *data_xfer_mode = (int_f)c_data_xfer_mode; /* switch (c_data_xfer_mode) { @@ -179,17 +179,17 @@ nh5pget_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode) */ ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pset_fapl_mpiposix_c - * Purpose: Call H5Pset_fapl_mpiposix to set mode for parallel I/O and the user - * supplied communicator + * Purpose: Call H5Pset_fapl_mpiposix to set mode for parallel I/O and the user + * supplied communicator * Inputs: prp_id - property list identifier - * comm - MPI communicator + * comm - MPI communicator * flag - flag to use GPFS hints * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * Programmer: Elena Pourmal * Tuesday, May 6, 2003 * Modifications: *---------------------------------------------------------------------------*/ @@ -201,7 +201,7 @@ nh5pset_fapl_mpiposix_c(hid_t_f *prp_id, int_f* comm, int_f* flag) herr_t ret; hbool_t c_flag; MPI_Comm c_comm; - c_comm = MPI_Comm_f2c(*comm); + c_comm = MPI_Comm_f2c(*comm); c_flag = (hbool_t)*flag; /* * Call H5Pset_fapl_mpiposix function. @@ -211,17 +211,17 @@ nh5pset_fapl_mpiposix_c(hid_t_f *prp_id, int_f* comm, int_f* flag) if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_fapl_mpiposix_c - * Purpose: Call H5Pget_fapl_mpiposix to retrieve communicator and info object + * Purpose: Call H5Pget_fapl_mpiposix to retrieve communicator and info object * Inputs: prp_id - property list identifier - * Outputs: comm - buffer to return MPI communicator + * Outputs: comm - buffer to return MPI communicator * flag - flag to use GPFS hints * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Tuesday, May 6, 2003 + * Programmer: Elena Pourmal + * Tuesday, May 6, 2003 * Modifications: *---------------------------------------------------------------------------*/ int_f @@ -243,4 +243,4 @@ nh5pget_fapl_mpiposix_c(hid_t_f *prp_id, int_f* comm, int_f* flag) *flag = (int_f) c_flag; ret_value = 0; return ret_value; -} +} diff --git a/fortran/src/H5Ff.c b/fortran/src/H5Ff.c index 9ad8de7..3021b5b 100644 --- a/fortran/src/H5Ff.c +++ b/fortran/src/H5Ff.c @@ -20,11 +20,11 @@ /*---------------------------------------------------------------------------- * Name: h5fcreate_c * Purpose: Call H5Fcreate to create the file - * Inputs: name - name of the file + * Inputs: name - name of the file * namelen - name length * access_flags - file access flags * crt_pr - identifier of creation property list - * acc_prp - identifier of access property list + * acc_prp - identifier of access property list * Outputs: file_id - file identifier * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -65,7 +65,7 @@ nh5fcreate_c(_fcd name, int_f *namelen, int_f *access_flags, hid_t_f* crt_prp, h * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -78,15 +78,15 @@ nh5fcreate_c(_fcd name, int_f *namelen, int_f *access_flags, hid_t_f* crt_prp, h HDfree(c_name); ret_value = 0; return ret_value; -} - +} + /*---------------------------------------------------------------------------- * Name: h5fflush_c * Purpose: Call H5Fflush to flush the object * Inputs: object_id - identifier of either a file, a dataset, - * a group, an attribute or a named data type + * a group, an attribute or a named data type * scope - integer to specify the flushing action, either - * H5F_SCOPE_GLOBAL or H5F_SCOPE_LOCAL + * H5F_SCOPE_GLOBAL or H5F_SCOPE_LOCAL * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Friday, November 5, 1999 @@ -112,17 +112,17 @@ nh5fflush_c (hid_t_f *object_id, int_f *scope) if (status >= 0) ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5fmount_c * Purpose: Call H5Fmount to mount the file * Inputs: loc_id - Identifier for file or group - * dsetname - name of dataset + * dsetname - name of dataset * namelen - dsetname length * file_id - file identifier for the file to be mounted - * acc_prp - identifier of access property list + * acc_prp - identifier of access property list * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Monday, October 25, 1999 @@ -153,7 +153,7 @@ nh5fmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen, hid_t_f *file_id, h * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(dsetname, c_namelen); + c_name = (char *)HD5f2cstring(dsetname, c_namelen); if (c_name == NULL) return ret_value; /* @@ -165,13 +165,13 @@ nh5fmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen, hid_t_f *file_id, h HDfree(c_name); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5funmount_c * Purpose: Call H5Funmount to unmount the file * Inputs: loc_id - Identifier for file or group - * dsetname - name of dataset + * dsetname - name of dataset * namelen - dsetname length * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su @@ -193,7 +193,7 @@ nh5funmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen) * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(dsetname, c_namelen); + c_name = (char *)HD5f2cstring(dsetname, c_namelen); if (c_name == NULL) return ret_value; /* @@ -205,17 +205,17 @@ nh5funmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen) HDfree(c_name); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5fopen_c * Purpose: Call H5Fopen to open the file - * Inputs: name - name of the file + * Inputs: name - name of the file * namelen - name length * access_flags - file access flags - * acc_prp - identifier of access property list + * acc_prp - identifier of access property list * Outputs: file_id - file identifier * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -249,7 +249,7 @@ nh5fopen_c (_fcd name, int_f *namelen, int_f *access_flags, hid_t_f *acc_prp, hi * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -263,7 +263,7 @@ nh5fopen_c (_fcd name, int_f *namelen, int_f *access_flags, hid_t_f *acc_prp, hi HDfree(c_name); ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5freopen_c @@ -289,7 +289,7 @@ nh5freopen_c (hid_t_f *file_id1, hid_t_f *file_id2) ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5fget_create_plist_c @@ -315,7 +315,7 @@ nh5fget_create_plist_c (hid_t_f *file_id, hid_t_f *prop_id) ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5fget_access_plist_c @@ -341,15 +341,15 @@ nh5fget_access_plist_c (hid_t_f *file_id, hid_t_f *access_id) ret_value = 0; return ret_value; -} - +} + /*---------------------------------------------------------------------------- * Name: h5fis_hdf5_c * Purpose: Call H5Fis_hdf5 to determone if the file is an HDF5 file - * Inputs: name - name of the file + * Inputs: name - name of the file * namelen - name length * Outputs: flag - 0 if file is not HDF5 file , positive if a file - * is an HDF5 file, and negative on failure. + * is an HDF5 file, and negative on failure. * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Tuesday, August 3, 1999 @@ -367,7 +367,7 @@ nh5fis_hdf5_c (_fcd name, int_f *namelen, int_f *flag) * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -379,7 +379,7 @@ nh5fis_hdf5_c (_fcd name, int_f *namelen, int_f *flag) HDfree(c_name); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5fclose_c * Purpose: Call H5Fclose to close the file @@ -390,7 +390,7 @@ nh5fis_hdf5_c (_fcd name, int_f *namelen, int_f *flag) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5fclose_c ( hid_t_f *file_id ) { int ret_value = 0; @@ -405,21 +405,21 @@ nh5fclose_c ( hid_t_f *file_id ) * Purpose: Call H5Fget_obj_count to get number of open objects within a file * Inputs: file_id - identifier of the file to be closed * obj_type - type of the object - * Returns: obj_count - number of objects + * Returns: obj_count - number of objects * 0 on success, -1 on failure * Programmer: Elena Pourmal * Monday, September 30, 2002 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5fget_obj_count_c ( hid_t_f *file_id , int_f *obj_type, int_f * obj_count) { int ret_value = 0; hid_t c_file_id; unsigned c_obj_type; int c_obj_count; - + c_file_id = (hid_t)*file_id; c_obj_type = (unsigned) *obj_type; @@ -439,7 +439,7 @@ nh5fget_obj_count_c ( hid_t_f *file_id , int_f *obj_type, int_f * obj_count) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5fget_obj_ids_c ( hid_t_f *file_id , int_f *obj_type, int_f *max_objs, hid_t_f *obj_ids) { int ret_value = 0; @@ -464,7 +464,7 @@ nh5fget_obj_ids_c ( hid_t_f *file_id , int_f *obj_type, int_f *max_objs, hid_t_f * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5fget_freespace_c ( hid_t_f *file_id , hssize_t_f *free_space) { int ret_value = 0; @@ -479,9 +479,9 @@ nh5fget_freespace_c ( hid_t_f *file_id , hssize_t_f *free_space) /*---------------------------------------------------------------------------- * Name: h5fget_name_c - * Purpose: Call H5Fget_name to get file's name - * Inputs: obj_id - object identifier - * buflen -size of the buffer + * Purpose: Call H5Fget_name to get file's name + * Inputs: obj_id - object identifier + * buflen -size of the buffer * Outputs: buf - buffer to hold the name * size - size of the file's name * Returns: 0 on success, -1 on failure @@ -501,7 +501,7 @@ nh5fget_name_c(hid_t_f *obj_id, size_t_f *size, _fcd buf, size_t_f *buflen) */ if ((c_buf = HDmalloc((size_t)*buflen +1)) == NULL) HGOTO_DONE(FAIL); - + /* * Call H5Aget_name function */ @@ -522,7 +522,7 @@ done: /*---------------------------------------------------------------------------- * Name: h5fget_filesize_c * Purpose: Call H5Fget_filesize to get file size - * Inputs: file_id - file identifier + * Inputs: file_id - file identifier * Outputs: size - size of the file * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal diff --git a/fortran/src/H5Gf.c b/fortran/src/H5Gf.c index 42f5658..fdce19f 100644 --- a/fortran/src/H5Gf.c +++ b/fortran/src/H5Gf.c @@ -18,9 +18,9 @@ /*---------------------------------------------------------------------------- * Name: h5gcreate_c - * Purpose: Call H5Gcreate to create a group - * Inputs: loc_id - file or group identifier - * name - name of the group + * Purpose: Call H5Gcreate to create a group + * Inputs: loc_id - file or group identifier + * name - name of the group * namelen - name length * size_hint - length of names in the group * Outputs: grp_id - group identifier @@ -43,16 +43,16 @@ nh5gcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint, * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* * Call H5Gcreate function. */ c_loc_id = *loc_id; - if ( *size_hint == OBJECT_NAMELEN_DEFAULT_F ) + if ( *size_hint == OBJECT_NAMELEN_DEFAULT_F ) c_grp_id = H5Gcreate(c_loc_id, c_name, 0); else { - c_size_hint = (size_t)*size_hint; + c_size_hint = (size_t)*size_hint; c_grp_id = H5Gcreate(c_loc_id, c_name, c_size_hint); } if (c_grp_id < 0) goto DONE; @@ -62,13 +62,13 @@ nh5gcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint, DONE: HDfree(c_name); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5gopen_c - * Purpose: Call H5Gopen to open a dataset - * Inputs: loc_id - file or group identifier - * name - name of the group + * Purpose: Call H5Gopen to open a dataset + * Inputs: loc_id - file or group identifier + * name - name of the group * namelen - name length * Outputs: grp_id - group identifier * Returns: 0 on success, -1 on failure @@ -89,7 +89,7 @@ nh5gopen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *grp_id) * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -105,27 +105,27 @@ nh5gopen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *grp_id) DONE: HDfree(c_name); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5gget_obj_info_idx_c * Purpose: Call H5Gget_obj_info to return name and the type of group - * member - * Inputs: loc_id - file or group identifier - * name - name of the group + * member + * Inputs: loc_id - file or group identifier + * name - name of the group * namelen - name length * idx - index of the group member * Outputs: obj_name - buffer to store member's name * obj_namelen - length of the buffer - * obj_type - type of the object + * obj_type - type of the object * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, August 5, 1999 * Modifications: *---------------------------------------------------------------------------*/ int_f -nh5gget_obj_info_idx_c -(hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *idx, _fcd obj_name, int_f *obj_namelen, int_f *obj_type) +nh5gget_obj_info_idx_c +(hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *idx, _fcd obj_name, int_f *obj_namelen, int_f *obj_type) { int ret_value = -1; hid_t c_loc_id = (hid_t)*loc_id; @@ -142,13 +142,13 @@ nh5gget_obj_info_idx_c */ c_namelen = *namelen; c_obj_namelen = *obj_namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* * Allocate buffer to hold name of the object */ - if (c_obj_namelen) c_obj_name = (char *)HDmalloc(c_obj_namelen + 1); + if (c_obj_namelen) c_obj_name = (char *)HDmalloc(c_obj_namelen + 1); if (c_obj_name == NULL) { HDfree(c_name); return ret_value; } @@ -175,15 +175,15 @@ DONE: HDfree(c_obj_name); HDfree(c_name); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5gn_members_c - * Purpose: Call H5Gn_members to find number of objects in the group - * Inputs: loc_id - file or group identifier - * name - name of the group + * Purpose: Call H5Gn_members to find number of objects in the group + * Inputs: loc_id - file or group identifier + * name - name of the group * namelen - name length - * Outputs: nmemebers - number of members + * Outputs: nmemebers - number of members * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, August 5, 1999 @@ -196,14 +196,14 @@ nh5gn_members_c (hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *nmembers) hid_t c_loc_id=(hid_t)*loc_id; char *c_name; int c_namelen; - hsize_t c_nmembers; + hsize_t c_nmembers; hid_t gid = (-1); /* * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* Get a temporary group ID for the group to query */ @@ -221,10 +221,10 @@ DONE: HDfree(c_name); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5gclose_c - * Purpose: Call H5Gclose to close the group + * Purpose: Call H5Gclose to close the group * Inputs: grp_id - identifier of the group to be closed * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -232,12 +232,12 @@ DONE: * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5gclose_c ( hid_t_f *grp_id ) { int ret_value = 0; hid_t c_grp_id; - + c_grp_id = (hid_t)*grp_id; if ( H5Gclose(c_grp_id) < 0 ) ret_value = -1; return ret_value; @@ -246,8 +246,8 @@ nh5gclose_c ( hid_t_f *grp_id ) /*---------------------------------------------------------------------------- * Name: h5glink_c - * Purpose: Call H5Glink to link the specified type - * Inputs: loc_id - identifier of file or group + * Purpose: Call H5Glink to link the specified type + * Inputs: loc_id - identifier of file or group * link_type - link type * current_name - name of the existing object for hard link, * anything for the soft link @@ -278,7 +278,7 @@ nh5glink_c(hid_t_f *loc_id, int_f *link_type, _fcd current_name, int_f *current_ if (c_current_name == NULL) return ret_value; c_new_name = (char *)HD5f2cstring(new_name, c_new_namelen); - if(c_new_name == NULL) { HDfree(c_current_name); + if(c_new_name == NULL) { HDfree(c_current_name); return ret_value; } /* @@ -299,8 +299,8 @@ DONE: /*---------------------------------------------------------------------------- * Name: h5glink2_c - * Purpose: Call H5Glink2 to link the specified type - * Inputs: cur_loc_id - identifier of file or group + * Purpose: Call H5Glink2 to link the specified type + * Inputs: cur_loc_id - identifier of file or group * cur_name - name of the existing object for hard link releative * to cur_loc_id location, * anything for the soft link @@ -313,7 +313,7 @@ DONE: * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, September 25, 2002 - * Modifications: + * Modifications: *---------------------------------------------------------------------------*/ int_f @@ -357,8 +357,8 @@ DONE: /*---------------------------------------------------------------------------- * Name: h5gunlink_c - * Purpose: Call H5Gunlink to remove the specified name - * Inputs: loc_id - identifier of file or group + * Purpose: Call H5Gunlink to remove the specified name + * Inputs: loc_id - identifier of file or group * name - name of the object to unlink * Returns: 0 on success, -1 on failure * Programmer: Mingshi Chen @@ -396,8 +396,8 @@ DONE: /*---------------------------------------------------------------------------- * Name: h5gmove_c * Purpose: Call H5Gmove to rename an object within an HDF5 file - * Inputs: loc_id - identifier of file or group - * src_name - name of the original object + * Inputs: loc_id - identifier of file or group + * src_name - name of the original object * src_namelen - original name lenghth * dst_name - new name for the object * dst_namelen - new name lenghth @@ -424,7 +424,7 @@ nh5gmove_c(hid_t_f *loc_id, _fcd src_name, int_f *src_namelen, _fcd dst_name, in if(c_src_name == NULL) return ret_value; c_dst_name = (char *)HD5f2cstring(dst_name, c_dst_namelen); - if(c_dst_name == NULL) { HDfree(c_src_name); + if(c_dst_name == NULL) { HDfree(c_src_name); return ret_value; } /* @@ -445,7 +445,7 @@ DONE: /*---------------------------------------------------------------------------- * Name: h5gmove2_c * Purpose: Call H5Gmove2 to rename an object within an HDF5 file - * Inputs: src_loc_id - identifier of file or group + * Inputs: src_loc_id - identifier of file or group * src_name - name of the original object relative to src_loc_id * src_namelen - original name lenghth * dst_loc_id - new location identifier @@ -454,7 +454,7 @@ DONE: * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, September 25, 2002 - * Modifications: + * Modifications: *---------------------------------------------------------------------------*/ int_f @@ -475,7 +475,7 @@ nh5gmove2_c(hid_t_f *src_loc_id, _fcd src_name, int_f *src_namelen, hid_t_f *dst if(c_src_name == NULL) return ret_value; c_dst_name = (char *)HD5f2cstring(dst_name, c_dst_namelen); - if(c_dst_name == NULL) { HDfree(c_src_name); + if(c_dst_name == NULL) { HDfree(c_src_name); return ret_value; } /* @@ -497,8 +497,8 @@ DONE: /*---------------------------------------------------------------------------- * Name: h5gget_linkval_c * Purpose: Call H5Gget_linkval to return the name of object - * Inputs: loc_id - identifier of file or group - * name - name of the object that symbolic link points to + * Inputs: loc_id - identifier of file or group + * name - name of the object that symbolic link points to * namelen - the name lenghth * size - lenghth of retrurned value * Outputs: value - name to be returned @@ -530,10 +530,10 @@ nh5gget_linkval_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size, _f */ if(*size) c_value = (char *)HDmalloc((size_t)*size); if(c_value == NULL) { - HDfree(c_name); + HDfree(c_name); return ret_value; } - + /* * Call H5Gget_linkval function */ @@ -542,7 +542,7 @@ nh5gget_linkval_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size, _f c_loc_id = (hid_t)*loc_id; c_ret_value = H5Gget_linkval(c_loc_id, c_name, c_size, c_value); if(c_ret_value < 0) goto DONE; - + /* * Convert C name to FORTRAN and place it in the given buffer @@ -559,8 +559,8 @@ DONE: /*---------------------------------------------------------------------------- * Name: h5gset_comment_c * Purpose: Call H5Gset_comment to set comments for the specified object - * Inputs: loc_id - identifier of file or group - * name - name of object whose comment is to be set or reset + * Inputs: loc_id - identifier of file or group + * name - name of object whose comment is to be set or reset * namelen - the name lenghth * comment - the new comment * commentlen - new comment lenghth @@ -608,8 +608,8 @@ DONE: /*---------------------------------------------------------------------------- * Name: h5gget_comment_c * Purpose: Call H5Gget_comment to retrieve comments for the specified object - * Inputs: loc_id - identifier of file or group - * name - name of object whose comment is to be set or reset + * Inputs: loc_id - identifier of file or group + * name - name of object whose comment is to be set or reset * namelen - the name lenghth * bufsize - at most bufsize characters * comment - the new comment @@ -629,7 +629,7 @@ nh5gget_comment_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *bufsize, char *c_comment = NULL; size_t c_bufsize; herr_t c_ret_value; - + /* * Convert Fortran name to C name */ @@ -646,7 +646,7 @@ nh5gget_comment_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *bufsize, HDfree(c_name); return ret_value; } - + /* * Call H5Gget_comment function */ diff --git a/fortran/src/H5If.c b/fortran/src/H5If.c index e739508..6931066 100644 --- a/fortran/src/H5If.c +++ b/fortran/src/H5If.c @@ -19,9 +19,9 @@ /*---------------------------------------------------------------------------- * Name: h5iget_type_c - * Purpose: Call H5Iget_type to get the type of an object - * Inputs: obj_id - object identifier - * Outputs: type - object type + * Purpose: Call H5Iget_type to get the type of an object + * Inputs: obj_id - object identifier + * Outputs: type - object type * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Thursday, March 24, 2000 @@ -46,9 +46,9 @@ nh5iget_type_c (hid_t_f *obj_id, int_f *type) } /*---------------------------------------------------------------------------- * Name: h5iget_name_c - * Purpose: Call H5Iget_name to get object's name - * Inputs: obj_id - object identifier - * buf_size - size of the buffer + * Purpose: Call H5Iget_name to get object's name + * Inputs: obj_id - object identifier + * buf_size - size of the buffer * Outputs: buf - buffer to hold the name * Returns: length of the name on success, -1 on failure * Programmer: Elena Pourmal @@ -69,8 +69,8 @@ nh5iget_name_c(hid_t_f *obj_id, _fcd buf, size_t_f *buf_size, size_t_f *name_siz */ c_buf_size = (size_t)*buf_size; c_buf = (char *)HDmalloc(c_buf_size +1); - if (c_buf == NULL) return ret_value; - + if (c_buf == NULL) return ret_value; + /* * Call H5IAget_name function */ @@ -93,7 +93,7 @@ DONE: /*---------------------------------------------------------------------------- * Name: h5iinc_ref_c * Purpose: Call H5Iinc_ref to increment object's reference count - * Inputs: obj_id - object identifier + * Inputs: obj_id - object identifier * Outputs: ref_count - Reference count of ID * Returns: current reference count on success, -1 on failure * Programmer: Quincey Koziol @@ -122,7 +122,7 @@ done: /*---------------------------------------------------------------------------- * Name: h5idec_ref_c * Purpose: Call H5Idec_ref to decrement object's reference count - * Inputs: obj_id - object identifier + * Inputs: obj_id - object identifier * Outputs: ref_count - Reference count of ID * Returns: current reference count on success, -1 on failure * Programmer: Quincey Koziol @@ -151,7 +151,7 @@ done: /*---------------------------------------------------------------------------- * Name: h5iget_ref_c * Purpose: Call H5Iget_ref to retrieve object's reference count - * Inputs: obj_id - object identifier + * Inputs: obj_id - object identifier * Outputs: ref_count - Reference count of ID * Returns: current reference count on success, -1 on failure * Programmer: Quincey Koziol @@ -180,7 +180,7 @@ done: /*---------------------------------------------------------------------------- * Name: h5iget_file_id_c * Purpose: Call H5Iget_file_id to obtain file identifier from object identifier - * Inputs: obj_id - object identifier + * Inputs: obj_id - object identifier * Outputs: file_id - file identifier * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c index 84321ff..612a655 100644 --- a/fortran/src/H5Pf.c +++ b/fortran/src/H5Pf.c @@ -19,24 +19,24 @@ /*---------------------------------------------------------------------------- * Name: h5pcreate_c - * Purpose: Call H5Pcreate to create a property list + * Purpose: Call H5Pcreate to create a property list * Inputs: class - property list class identifier - * Outputs: prp_id - identifier of the created property list + * Outputs: prp_id - identifier of the created property list * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, October 9, 2002 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pcreate_c ( hid_t_f *class, hid_t_f *prp_id ) { hid_t c_class; int ret_value = 0; hid_t c_prp_id; - + c_class = (hid_t)*class; - c_prp_id = H5Pcreate(c_class); + c_prp_id = H5Pcreate(c_class); if ( c_prp_id < 0 ) ret_value = -1; *prp_id = (hid_t_f)c_prp_id; @@ -45,7 +45,7 @@ nh5pcreate_c ( hid_t_f *class, hid_t_f *prp_id ) /*---------------------------------------------------------------------------- * Name: h5pclose_c - * Purpose: Call H5Pclose to close property lis + * Purpose: Call H5Pclose to close property lis * Inputs: prp_id - identifier of the property list to be closed * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -53,7 +53,7 @@ nh5pcreate_c ( hid_t_f *class, hid_t_f *prp_id ) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pclose_c ( hid_t_f *prp_id ) { int ret_value = 0; @@ -66,16 +66,16 @@ nh5pclose_c ( hid_t_f *prp_id ) /*---------------------------------------------------------------------------- * Name: h5pcopy_c - * Purpose: Call H5Pcopy to copy property list - * Inputs: prp_id - identifier of the property list to be copied - * Outputs: new_prp_id - identifier of the new property list + * Purpose: Call H5Pcopy to copy property list + * Inputs: prp_id - identifier of the property list to be copied + * Outputs: new_prp_id - identifier of the new property list * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Saturday, August 14, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pcopy_c ( hid_t_f *prp_id , hid_t_f *new_prp_id) { int ret_value = 0; @@ -83,7 +83,7 @@ nh5pcopy_c ( hid_t_f *prp_id , hid_t_f *new_prp_id) hid_t c_new_prp_id; c_prp_id = *prp_id; - c_new_prp_id = H5Pcopy(c_prp_id); + c_new_prp_id = H5Pcopy(c_prp_id); if ( c_new_prp_id < 0 ) ret_value = -1; *new_prp_id = (hid_t_f)c_new_prp_id; return ret_value; @@ -91,7 +91,7 @@ nh5pcopy_c ( hid_t_f *prp_id , hid_t_f *new_prp_id) /*---------------------------------------------------------------------------- * Name: h5pequal_c - * Purpose: Call H5Pequal to check if two property lists are equal + * Purpose: Call H5Pequal to check if two property lists are equal * Inputs: plist1_id - property list identifier * plist2_id - property list identifier * Outputs: c_flag - flag to indicate that lists are eqaul @@ -101,7 +101,7 @@ nh5pcopy_c ( hid_t_f *prp_id , hid_t_f *new_prp_id) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pequal_c ( hid_t_f *plist1_id , hid_t_f *plist2_id, int_f * c_flag) { int ret_value = 0; @@ -111,7 +111,7 @@ nh5pequal_c ( hid_t_f *plist1_id , hid_t_f *plist2_id, int_f * c_flag) c_plist1_id = (hid_t)*plist1_id; c_plist2_id = (hid_t)*plist2_id; - c_c_flag = H5Pequal(c_plist1_id, c_plist2_id); + c_c_flag = H5Pequal(c_plist1_id, c_plist2_id); if ( c_c_flag < 0 ) ret_value = -1; *c_flag = (int_f)c_c_flag; return ret_value; @@ -121,9 +121,9 @@ nh5pequal_c ( hid_t_f *plist1_id , hid_t_f *plist2_id, int_f * c_flag) /*---------------------------------------------------------------------------- * Name: h5pget_class_c * Purpose: Call H5Pget_class to determine property list class - * Inputs: prp_id - identifier of the dataspace + * Inputs: prp_id - identifier of the dataspace * Outputs: classtype - class type; possible values are: - * H5P_NO_CLASS_F -1 + * H5P_NO_CLASS_F -1 * H5P_FILE_CREATE_F 0 * H5P_FILE_ACCESS_F 1 * H5P_DATASET_CREATE_F 2 @@ -135,17 +135,17 @@ nh5pequal_c ( hid_t_f *plist1_id , hid_t_f *plist2_id, int_f * c_flag) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pget_class_c ( hid_t_f *prp_id , int_f *classtype) { int ret_value = 0; hid_t c_prp_id; - hid_t c_classtype; + hid_t c_classtype; c_prp_id = *prp_id; c_classtype = H5Pget_class(c_prp_id); if (c_classtype == H5P_NO_CLASS ) { - *classtype = H5P_NO_CLASS; + *classtype = H5P_NO_CLASS; ret_value = -1; return ret_value; } @@ -156,17 +156,17 @@ nh5pget_class_c ( hid_t_f *prp_id , int_f *classtype) /*---------------------------------------------------------------------------- * Name: h5pset_preserve_c - * Purpose: Call H5Pset_preserve to set transfer property for compound + * Purpose: Call H5Pset_preserve to set transfer property for compound * datatype - * Inputs: prp_id - property list identifier - * flag - TRUE/FALSE flag + * Inputs: prp_id - property list identifier + * flag - TRUE/FALSE flag * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal - * Thursday, February 17, 2000 + * Thursday, February 17, 2000 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_preserve_c ( hid_t_f *prp_id , int_f *flag) { int ret_value = 0; @@ -184,22 +184,22 @@ nh5pset_preserve_c ( hid_t_f *prp_id , int_f *flag) /*---------------------------------------------------------------------------- * Name: h5pget_preserve_c - * Purpose: Call H5Pget_preserve to set transfer property for compound + * Purpose: Call H5Pget_preserve to set transfer property for compound * datatype - * Inputs: prp_id - property list identifier - * Outputs: flag - TRUE/FALSE flag + * Inputs: prp_id - property list identifier + * Outputs: flag - TRUE/FALSE flag * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal - * Thursday, February 17, 2000 + * Thursday, February 17, 2000 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pget_preserve_c ( hid_t_f *prp_id , int_f *flag) { int ret_value = 0; hid_t c_prp_id; - int c_flag; + int c_flag; c_prp_id = (hid_t)*prp_id; c_flag = H5Pget_preserve(c_prp_id); @@ -210,16 +210,16 @@ nh5pget_preserve_c ( hid_t_f *prp_id , int_f *flag) /*---------------------------------------------------------------------------- * Name: h5pset_deflate_c - * Purpose: Call H5Pset_deflate to set deflate level - * Inputs: prp_id - property list identifier - * level - level of deflation + * Purpose: Call H5Pset_deflate to set deflate level + * Inputs: prp_id - property list identifier + * level - level of deflation * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Saturday, August 14, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_deflate_c ( hid_t_f *prp_id , int_f *level) { int ret_value = 0; @@ -239,17 +239,17 @@ nh5pset_deflate_c ( hid_t_f *prp_id , int_f *level) /*---------------------------------------------------------------------------- * Name: h5pset_chunk_c * Purpose: Call H5Pset_chunk to set the sizes of chunks for a chunked - * layout dataset - * Inputs: prp_id - property list identifier - * rank - number of dimensions of each chunk - * dims - array of the size of each chunk + * layout dataset + * Inputs: prp_id - property list identifier + * rank - number of dimensions of each chunk + * dims - array of the size of each chunk * Returns: 0 on success, -1 on failure * Saturday, August 14, 1999 * Programmer: Elena Pourmal * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_chunk_c ( hid_t_f *prp_id, int_f *rank, hsize_t_f *dims ) { int ret_value = -1; @@ -278,23 +278,23 @@ nh5pset_chunk_c ( hid_t_f *prp_id, int_f *rank, hsize_t_f *dims ) DONE: HDfree (c_dims); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_chunk_c * Purpose: Call H5Pget_chunk to get the sizes of chunks for a chunked * layout dataset for at list max_rank number of dimensions - * Inputs: prp_id - property list identifier - * max rank - maximum number of dimensions to return - * dims - array of the size of each chunk + * Inputs: prp_id - property list identifier + * max rank - maximum number of dimensions to return + * dims - array of the size of each chunk * Returns: number of chunk's dimnesion on success, -1 on failure * Saturday, August 14, 1999 * Programmer: Elena Pourmal * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pget_chunk_c ( hid_t_f *prp_id, int_f *max_rank, hsize_t_f *dims ) { int ret_value = -1; @@ -321,16 +321,16 @@ nh5pget_chunk_c ( hid_t_f *prp_id, int_f *max_rank, hsize_t_f *dims ) if (rank < 0) return ret_value; ret_value = (int_f)rank; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pset_fill_valuec_c * Purpose: Call h5pset_fill_value_c to a character fill value - * Inputs: prp_id - property list identifier + * Inputs: prp_id - property list identifier * type_id - datatype identifier (fill value is of type type_id) - * fillvalue - character value + * fillvalue - character value * Returns: 0 on success, -1 on failure * Saturday, August 14, 1999 * Programmer: Elena Pourmal @@ -340,7 +340,7 @@ int_f nh5pset_fill_valuec_c (hid_t_f *prp_id, hid_t_f *type_id, _fcd fillvalue) { int ret_value = -1; - + /* * Call h5pset_fill_value_c function. */ @@ -351,10 +351,10 @@ nh5pset_fill_valuec_c (hid_t_f *prp_id, hid_t_f *type_id, _fcd fillvalue) /*---------------------------------------------------------------------------- * Name: h5pset_fill_value_c - * Purpose: Call H5Pset_fill_value to set a fillvalue for a dataset - * Inputs: prp_id - property list identifier + * Purpose: Call H5Pset_fill_value to set a fillvalue for a dataset + * Inputs: prp_id - property list identifier * type_id - datatype identifier (fill value is of type type_id) - * fillvalue - fillvalue + * fillvalue - fillvalue * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Saturday, August 14, 1999 @@ -378,15 +378,15 @@ nh5pset_fill_value_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue) if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_fill_valuec_c * Purpose: Call h5pget_fill_value_c to a character fill value - * Inputs: prp_id - property list identifier + * Inputs: prp_id - property list identifier * type_id - datatype identifier (fill value is of type type_id) - * fillvalue - character value + * fillvalue - character value * Returns: 0 on success, -1 on failure * Saturday, August 14, 1999 * Programmer: Elena Pourmal @@ -396,7 +396,7 @@ int_f nh5pget_fill_valuec_c (hid_t_f *prp_id, hid_t_f *type_id, _fcd fillvalue) { int ret_value = -1; - + /* * Call h5pget_fill_value_c function. */ @@ -407,10 +407,10 @@ nh5pget_fill_valuec_c (hid_t_f *prp_id, hid_t_f *type_id, _fcd fillvalue) /*---------------------------------------------------------------------------- * Name: h5pget_fill_value_c - * Purpose: Call H5Pget_fill_value to set a fillvalue for a dataset - * Inputs: prp_id - property list identifier + * Purpose: Call H5Pget_fill_value to set a fillvalue for a dataset + * Inputs: prp_id - property list identifier * type_id - datatype identifier (fill value is of type type_id) - * fillvalue - fillvalue + * fillvalue - fillvalue * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Saturday, August 14, 1999 @@ -434,13 +434,13 @@ nh5pget_fill_value_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue) if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_version_c * Purpose: Call H5Pget_version to get the version information - * of various objects for a file creation property list - * Inputs: prp_id - property list identifier + * of various objects for a file creation property list + * Inputs: prp_id - property list identifier * Outputs: boot - array to put boot block version number * freelist - array to put global freelist version number * stab - array to put symbol table version number @@ -475,13 +475,13 @@ nh5pget_version_c (hid_t_f *prp_id, int_f * boot,int_f * freelist, int_f * stab, ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_userblock_c - * Purpose: Call H5Pget_userblock to get the size of a user block in + * Purpose: Call H5Pget_userblock to get the size of a user block in * a file creation property list - * Inputs: prp_id - property list identifier + * Inputs: prp_id - property list identifier * Outputs size - Size of the user-block in bytes * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su @@ -507,13 +507,13 @@ nh5pget_userblock_c (hid_t_f *prp_id, hsize_t_f * size) ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pset_userblock_c - * Purpose: Call H5Pset_userblock to set the size of a user block in + * Purpose: Call H5Pset_userblock to set the size of a user block in * a file creation property list - * Inputs: prp_id - property list identifier + * Inputs: prp_id - property list identifier * size - Size of the user-block in bytes * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su @@ -538,13 +538,13 @@ nh5pset_userblock_c (hid_t_f *prp_id, hsize_t_f * size) if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_sizes_c - * Purpose: Call H5Pget_sizes to get the size of the offsets - * and lengths used in an HDF5 file - * Inputs: prp_id - property list identifier + * Purpose: Call H5Pget_sizes to get the size of the offsets + * and lengths used in an HDF5 file + * Inputs: prp_id - property list identifier * Outputs sizeof_addr - Size of an object offset in bytes * sizeof_size - Size of an object length in bytes * Returns: 0 on success, -1 on failure @@ -573,12 +573,12 @@ nh5pget_sizes_c (hid_t_f *prp_id, size_t_f * sizeof_addr, size_t_f * sizeof_size ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pset_sizes_c * Purpose: Call H5Pset_sizes to set the size of the offsets - * Inputs: prp_id - property list identifier + * Inputs: prp_id - property list identifier * sizeof_addr - Size of an object offset in bytes * sizeof_size - Size of an object length in bytes * Returns: 0 on success, -1 on failure @@ -605,15 +605,15 @@ nh5pset_sizes_c (hid_t_f *prp_id, size_t_f * sizeof_addr, size_t_f * sizeof_size if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pset_sym_k_c - * Purpose: Call H5Pset_sym_k to set the size of parameters used - * to control the symbol table node + * Purpose: Call H5Pset_sym_k to set the size of parameters used + * to control the symbol table node * Inputs: prp_id - property list identifier * ik - Symbol table tree rank - * lk - Symbol table node size + * lk - Symbol table node size * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Friday, February 25, 2000 @@ -639,15 +639,15 @@ nh5pset_sym_k_c (hid_t_f *prp_id, int_f* ik, int_f* lk) if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_sym_k_c - * Purpose: Call H5Pget_sym_k to get the size of parameters used - * to control the symbol table node + * Purpose: Call H5Pget_sym_k to get the size of parameters used + * to control the symbol table node * Inputs: prp_id - property list identifier * Outputs: ik - Symbol table tree rank - * lk - Symbol table node size + * lk - Symbol table node size * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Friday, February 25, 2000 @@ -672,7 +672,7 @@ nh5pget_sym_k_c (hid_t_f *prp_id, int_f* ik, int_f* lk) if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pset_istore_k_c @@ -703,12 +703,12 @@ nh5pset_istore_k_c (hid_t_f *prp_id, int_f* ik) if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_istore_k_c - * Purpose: Call H5Pget_istore_k to get the size of parameters used - * to control the B-trees for indexing chunked datasets + * Purpose: Call H5Pget_istore_k to get the size of parameters used + * to control the B-trees for indexing chunked datasets * Inputs: prp_id - property list identifier * Outputs: ik - Symbol table tree rank * Returns: 0 on success, -1 on failure @@ -733,11 +733,11 @@ nh5pget_istore_k_c (hid_t_f *prp_id, int_f* ik) if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_driver_c - * Purpose: Call H5Pget_driver to get low-level file driver identifier + * Purpose: Call H5Pget_driver to get low-level file driver identifier * Inputs: prp_id - property list identifier * Outputs: driver - low-level file driver identifier * Returns: 0 on success, -1 on failure @@ -762,11 +762,11 @@ nh5pget_driver_c (hid_t_f *prp_id, hid_t_f* driver) DONE: return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pset_fapl_stdio_c - * Purpose: Call H5Pset_stdio to set the low level file driver to + * Purpose: Call H5Pset_stdio to set the low level file driver to * use the functions declared in the stdio.h * Inputs: prp_id - property list identifier * Returns: 0 on success, -1 on failure @@ -784,15 +784,15 @@ nh5pset_fapl_stdio_c (hid_t_f *prp_id) * Call H5Pset_fapl_stdio function. */ c_prp_id = (hid_t)*prp_id; - ret = H5Pset_fapl_stdio(c_prp_id); + ret = H5Pset_fapl_stdio(c_prp_id); if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} #ifdef NO_SUCH_F90_FUNCTION /*---------------------------------------------------------------------------- * Name: h5pget_fapl_stdio_c - * Purpose: Call H5Pget_fapl_stdio to determine whther the low level file driver + * Purpose: Call H5Pget_fapl_stdio to determine whther the low level file driver * uses the functions declared in the stdio.h * Inputs: prp_id - property list identifier * Outputs: io - value indicates whether the file driver uses @@ -812,7 +812,7 @@ nh5pget_fapl_stdio_c (hid_t_f *prp_id, int_f* io) * Call H5Pget_fapl_stdio function. */ c_prp_id = *prp_id; - ret = H5Pget_fapl_stdio(c_prp_id); + ret = H5Pget_fapl_stdio(c_prp_id); if (ret < 0) return ret_value; *io = (int_f)ret; ret_value = 0; @@ -823,7 +823,7 @@ nh5pget_fapl_stdio_c (hid_t_f *prp_id, int_f* io) /*---------------------------------------------------------------------------- * Name: h5pset_fapl_sec2_c - * Purpose: Call H5Pset_fapl_sec2 to set the low level file driver to + * Purpose: Call H5Pset_fapl_sec2 to set the low level file driver to * use the functions declared in the unistd.h * Inputs: prp_id - property list identifier * Returns: 0 on success, -1 on failure @@ -841,16 +841,16 @@ nh5pset_fapl_sec2_c (hid_t_f *prp_id) * Call H5Pset_fapl_sec2 function. */ c_prp_id = (hid_t)*prp_id; - ret = H5Pset_fapl_sec2(c_prp_id); + ret = H5Pset_fapl_sec2(c_prp_id); if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} #ifdef NO_SUCH_F90_FUNCTION /*---------------------------------------------------------------------------- * Name: h5pget_fapl_sec2_c - * Purpose: Call H5Pget_fapl_stdio to determine whther the low level file driver + * Purpose: Call H5Pget_fapl_stdio to determine whther the low level file driver * uses the functions declared in the unistd.h * Inputs: prp_id - property list identifier * Outputs: sec2 - value indicates whether the file driver uses @@ -870,7 +870,7 @@ nh5pget_fapl_sec2_c (hid_t_f *prp_id, int_f* sec2) * Call H5Pget_fapl_sec2 function. */ c_prp_id = (hid_t)*prp_id; - ret = H5Pget_fapl_sec2(c_prp_id); + ret = H5Pget_fapl_sec2(c_prp_id); if (ret < 0) return ret_value; *sec2 = (int_f)ret; ret_value = 0; @@ -907,7 +907,7 @@ nh5pset_alignment_c (hid_t_f *prp_id, hsize_t_f* threshold, hsize_t_f* alignment if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_alignment_c @@ -936,10 +936,10 @@ nh5pget_alignment_c (hid_t_f *prp_id, hsize_t_f* threshold, hsize_t_f* alignment if (ret < 0) return ret_value; *threshold = (hsize_t_f)c_threshold; *alignment = (hsize_t_f)c_alignment; - + ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pset_fapl_core_c @@ -947,8 +947,8 @@ nh5pget_alignment_c (hid_t_f *prp_id, hsize_t_f* threshold, hsize_t_f* alignment * to use malloc() and free() * Inputs: prp_id - property list identifier * increment - File block size in bytes - * flag - Boolean flag indicating whether to write the - * file contents to disk when the file is closed. + * flag - Boolean flag indicating whether to write the + * file contents to disk when the file is closed. * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * March 9, 2001 @@ -964,12 +964,12 @@ nh5pset_fapl_core_c (hid_t_f *prp_id, size_t_f* increment, int_f *flag) hbool_t c_backing_store; c_increment = (size_t)*increment; c_backing_store = (hbool_t)*flag; - + /* * Call H5Pset_fapl_core function. */ c_prp_id = (hid_t)*prp_id; - ret = H5Pset_fapl_core(c_prp_id, c_increment, c_backing_store); + ret = H5Pset_fapl_core(c_prp_id, c_increment, c_backing_store); if (ret < 0) return ret_value; ret_value = 0; return ret_value; @@ -977,7 +977,7 @@ nh5pset_fapl_core_c (hid_t_f *prp_id, size_t_f* increment, int_f *flag) /*---------------------------------------------------------------------------- * Name: h5pget_fapl_core_c - * Purpose: Call H5Pget_fapl_core to determine whether the file access + * Purpose: Call H5Pget_fapl_core to determine whether the file access * property list is set to the core drive * Inputs: prp_id - property list identifier * Outputs increment - File block size in bytes @@ -993,23 +993,23 @@ nh5pget_fapl_core_c (hid_t_f *prp_id, size_t_f* increment, int_f *flag) hid_t c_prp_id; herr_t ret = -1; size_t c_increment = 0; - hbool_t c_backing_store; - *flag = 0; + hbool_t c_backing_store; + *flag = 0; /* * Call H5Pset_fapl_core function. */ c_prp_id = (hid_t)*prp_id; - ret = H5Pget_fapl_core(c_prp_id, &c_increment, &c_backing_store); + ret = H5Pget_fapl_core(c_prp_id, &c_increment, &c_backing_store); if (ret < 0) return ret_value; *increment = (size_t_f)c_increment; if(c_backing_store > 0) *flag = 1; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pset_fapl_family_c - * Purpose: Call H5Pset_fapl_family to set the file access properties list + * Purpose: Call H5Pset_fapl_family to set the file access properties list * to the family driver * Inputs: prp_id - property list identifier * memb_size - Logical size, in bytes, of each family member. @@ -1034,15 +1034,15 @@ nh5pset_fapl_family_c(hid_t_f *prp_id, hsize_t_f* memb_size, hid_t_f* memb_plist * Call H5Pset_fapl_family function. */ c_prp_id = (hid_t)*prp_id; - ret = H5Pset_fapl_family(c_prp_id, c_memb_size, c_memb_plist); + ret = H5Pset_fapl_family(c_prp_id, c_memb_size, c_memb_plist); if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_fapl_family_c - * Purpose: Call H5Pget_fapl_family to determine whether the file access + * Purpose: Call H5Pget_fapl_family to determine whether the file access * property list is set to the family driver * Inputs: prp_id - property list identifier * memb_size - Logical size, in bytes, of each family member. @@ -1065,18 +1065,18 @@ nh5pget_fapl_family_c(hid_t_f *prp_id, hsize_t_f* memb_size, hid_t_f* memb_plist * Call H5Pget_fapl_family function. */ c_prp_id = (hid_t)*prp_id; - ret = H5Pget_fapl_family(c_prp_id, &c_memb_size, &c_memb_plist); + ret = H5Pget_fapl_family(c_prp_id, &c_memb_size, &c_memb_plist); if (ret < 0) return ret_value; *memb_size = (hsize_t_f)c_memb_size; *memb_plist = (hid_t_f)c_memb_plist; - + ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pset_cache_c - * Purpose: Call H5Pset_cache to set he number of elements in + * Purpose: Call H5Pset_cache to set he number of elements in * the meta data cache and the total number of bytes in * the raw data chunk cache * Inputs: prp_id - property list identifier @@ -1113,17 +1113,17 @@ nh5pset_cache_c(hid_t_f *prp_id, int_f* mdc_nelmts, size_t_f* rdcc_nelmts, size if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_cache_c - * Purpose: Call H5Pget_cache to get he number of elements in + * Purpose: Call H5Pget_cache to get he number of elements in * the meta data cache and the total number of bytes in * the raw data chunk cache * Inputs: prp_id - property list identifier * Outputs: mdc_nelmts - Number of elements (objects) in the * meta data cache - * rdcc_nelmts - Number of elements in the raw data chunk + * rdcc_nelmts - Number of elements in the raw data chunk * rdcc_nbytes - Total size of the raw data chunk cache, in bytes * rdcc_w0 - Preemption policy * Returns: 0 on success, -1 on failure @@ -1138,9 +1138,9 @@ nh5pget_cache_c(hid_t_f *prp_id, int_f* mdc_nelmts, size_t_f* rdcc_nelmts, size_ hid_t c_prp_id; herr_t ret; int c_mdc_nelmts; - size_t c_rdcc_nelmts; + size_t c_rdcc_nelmts; size_t c_rdcc_nbytes; - double c_rdcc_w0; + double c_rdcc_w0; /* * Call H5Pget_cache function. */ @@ -1151,21 +1151,21 @@ nh5pget_cache_c(hid_t_f *prp_id, int_f* mdc_nelmts, size_t_f* rdcc_nelmts, size_ *rdcc_nelmts = (size_t_f)c_rdcc_nelmts; *rdcc_nbytes = (size_t_f)c_rdcc_nbytes; *rdcc_w0 = (real_f)c_rdcc_w0; - + ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pset_fapl_split_c - * Purpose: Call H5Pset_fapl_split to set he low-level driver to split meta data + * Purpose: Call H5Pset_fapl_split to set he low-level driver to split meta data * from raw data * Inputs: prp_id - property list identifier * meta_len - Length of meta_ext - * meta_ext - Name of the extension for the metafile filename. + * meta_ext - Name of the extension for the metafile filename. * meta_plist - Identifier of the meta file access property list * raw_len - Length of raw _ext - * raw_ext - Name of the extension for the raw file filename. + * raw_ext - Name of the extension for the raw file filename. * raw_plist - Identifier of the raw file access property list * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -1178,14 +1178,14 @@ nh5pset_fapl_split_c(hid_t_f *prp_id, int_f* meta_len, _fcd meta_ext, hid_t_f* m int ret_value = -1; hid_t c_prp_id; hid_t c_meta_plist; - hid_t c_raw_plist; + hid_t c_raw_plist; herr_t ret = -1; char* c_meta_ext; char* c_raw_ext; - c_meta_ext = (char *)HD5f2cstring(meta_ext, (int)*meta_len); + c_meta_ext = (char *)HD5f2cstring(meta_ext, (int)*meta_len); if (c_meta_ext == NULL) return ret_value; - c_raw_ext = (char *)HD5f2cstring(raw_ext, (int)*raw_len); + c_raw_ext = (char *)HD5f2cstring(raw_ext, (int)*raw_len); if (c_raw_ext == NULL) { HDfree(c_meta_ext); return ret_value; } @@ -1195,7 +1195,7 @@ nh5pset_fapl_split_c(hid_t_f *prp_id, int_f* meta_len, _fcd meta_ext, hid_t_f* m */ c_prp_id = (hid_t)*prp_id; c_meta_plist = (hid_t)*meta_plist; - c_raw_plist = (hid_t)*raw_plist; + c_raw_plist = (hid_t)*raw_plist; ret = H5Pset_fapl_split(c_prp_id, c_meta_ext, c_meta_plist, c_raw_ext, c_raw_plist ); if (ret < 0) goto DONE; @@ -1211,16 +1211,16 @@ DONE: #ifdef NO_SUCH_F90_FUNCTION /*---------------------------------------------------------------------------- * Name: h5pget_fapl_split_c - * Purpose: Call H5Pget_fapl_split to determine whether the file access + * Purpose: Call H5Pget_fapl_split to determine whether the file access * property list is set to the split driver * Inputs: prp_id - property list identifier * meta_ext_size - Number of characters of the meta file extension * to be copied to the meta_ext buffer * raw_ext_size - Number of characters of the raw file extension * to be copied to the raw_ext buffer - *Outputs: meta_ext - Name of the extension for the metafile filename. + *Outputs: meta_ext - Name of the extension for the metafile filename. * meta_plist - Identifier of the meta file access property list - * raw_ext - Name of the extension for the raw file filename. + * raw_ext - Name of the extension for the raw file filename. * raw_plist - Identifier of the raw file access property list * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -1233,9 +1233,9 @@ nh5pget_fapl_split_c(hid_t_f *prp_id, size_t_f* meta_ext_size , _fcd meta_ext, h int ret_value = -1; hid_t c_prp_id; herr_t ret = -1; - size_t c_meta_ext_size, c_raw_ext_size; + size_t c_meta_ext_size, c_raw_ext_size; hid_t c_meta_plist = -1; - hid_t c_raw_plist = -1; + hid_t c_raw_plist = -1; char* c_meta_ext = NULL; char* c_raw_ext = NULL; @@ -1250,25 +1250,25 @@ nh5pget_fapl_split_c(hid_t_f *prp_id, size_t_f* meta_ext_size , _fcd meta_ext, h * Call H5Pget_fapl_split function. */ c_prp_id = *prp_id; - ret = H5Pget_fapl_split(c_prp_id, c_meta_ext_size, c_meta_ext,&c_meta_plist, c_raw_ext_size, c_raw_ext, &c_raw_plist ); + ret = H5Pget_fapl_split(c_prp_id, c_meta_ext_size, c_meta_ext,&c_meta_plist, c_raw_ext_size, c_raw_ext, &c_raw_plist ); if (ret < 0) return ret_value; *meta_plist = c_meta_plist; *raw_plist = c_raw_plist; - HD5packFstring(c_meta_ext, _fcdtocp(meta_ext), strlen(c_meta_ext)); - HD5packFstring(c_raw_ext, _fcdtocp(raw_ext), strlen(c_raw_ext)); - + HD5packFstring(c_meta_ext, _fcdtocp(meta_ext), strlen(c_meta_ext)); + HD5packFstring(c_raw_ext, _fcdtocp(raw_ext), strlen(c_raw_ext)); + ret_value = 0; return ret_value; -} +} #endif /*NO_SUCH_F90_FUNCTION*/ /*---------------------------------------------------------------------------- * Name: h5pset_gc_references_c - * Purpose: Call H5Pset_gc_references to set garbage + * Purpose: Call H5Pset_gc_references to set garbage * collecting references flag * Inputs: prp_id - property list identifier - * gc_reference - flag for garbage collecting references + * gc_reference - flag for garbage collecting references * for the file * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su @@ -1293,14 +1293,14 @@ nh5pset_gc_references_c (hid_t_f *prp_id, int_f* gc_references) if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_gc_references_c - * Purpose: Call H5Pget_gc_references to set garbage + * Purpose: Call H5Pget_gc_references to set garbage * collecting references flag * Inputs: prp_id - property list identifier - * Outputs gc_reference - flag for garbage collecting references + * Outputs gc_reference - flag for garbage collecting references * for the file * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su @@ -1353,7 +1353,7 @@ nh5pset_layout_c (hid_t_f *prp_id, int_f* layout) if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_layout_c @@ -1386,7 +1386,7 @@ nh5pget_layout_c (hid_t_f *prp_id, int_f* layout) /*---------------------------------------------------------------------------- * Name: h5pset_filter_c * Purpose: Call H5Pset_filter to add a filter to the filter pipeline. - * Inputs: prp_id - property list identifier + * Inputs: prp_id - property list identifier * filter - Filter to be added to the pipeline. * flags - Bit vector specifying certain general * properties of the filter. @@ -1408,7 +1408,7 @@ nh5pset_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_nel H5Z_filter_t c_filter; unsigned int * c_cd_values; unsigned i; - + c_filter = (H5Z_filter_t)*filter; c_flags = (unsigned)*flags; c_cd_nelmts = (size_t)*cd_nelmts; @@ -1463,17 +1463,17 @@ nh5pget_nfilters_c (hid_t_f *prp_id, int_f* nfilters) /*---------------------------------------------------------------------------- * Name: h5pget_filter_c - * Purpose: Call H5Pget_filter to get information about a filter + * Purpose: Call H5Pget_filter to get information about a filter * in a pipeline * Inputs: prp_id - property list identifier - * filter_number - Sequence number within the filter - * pipeline of the filter for which + * filter_number - Sequence number within the filter + * pipeline of the filter for which * information is sought. * namelen - Anticipated number of characters in name. - *Outputs: flags - Bit vector specifying certain general + *Outputs: flags - Bit vector specifying certain general * properties of the filter. * cd_nelmts - Number of elements in cd_value - * cd_values - Auxiliary data for the filter. + * cd_values - Auxiliary data for the filter. * name - Name of the filter * filter_id - filter identification number * Returns: 0 on success, -1 on failure @@ -1504,8 +1504,8 @@ nh5pget_filter_c(hid_t_f *prp_id, int_f* filter_number, int_f* flags, size_t_f* if (!c_cd_values) {HDfree(c_name); return ret_value; } - - + + /* * Call H5Pget_filter function. */ @@ -1518,29 +1518,29 @@ nh5pget_filter_c(hid_t_f *prp_id, int_f* filter_number, int_f* flags, size_t_f* *filter_id = (int_f)c_filter; *cd_nelmts = (size_t_f)c_cd_nelmts; *flags = (int_f)c_flags; - HD5packFstring(c_name, _fcdtocp(name), (int)strlen(c_name)); - + HD5packFstring(c_name, _fcdtocp(name), (int)strlen(c_name)); + for (i = 0; i < c_cd_nelmts_in; i++) cd_values[i] = (int_f)c_cd_values[i]; - + ret_value = 0; DONE: HDfree(c_name); HDfree(c_cd_values); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pset_external_c * Purpose: Call H5Pset_external to add an external file to the * list of external files. - * Inputs: prp_id - property list identifier + * Inputs: prp_id - property list identifier * name - Name of an external file * namelen - length of name * offset - Offset, in bytes, from the beginning of the file - * to the location in the file where the data starts. - * bytes - Number of bytes reserved in the file for the data. + * to the location in the file where the data starts. + * bytes - Number of bytes reserved in the file for the data. * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Wednesday, February 23, 2000 @@ -1558,10 +1558,10 @@ nh5pset_external_c (hid_t_f *prp_id, _fcd name, int_f* namelen, int_f* offset, h off_t c_offset; c_bytes = (hsize_t) *bytes; c_offset = (off_t) *offset; - - + + c_namelen = (int)*namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -1608,14 +1608,14 @@ nh5pget_external_count_c (hid_t_f *prp_id, int_f* count) /*---------------------------------------------------------------------------- * Name: h5pget_external_c - * Purpose: Call H5Pget_external to get nformation about an external file. - * Inputs: prp_id - property list identifier + * Purpose: Call H5Pget_external to get nformation about an external file. + * Inputs: prp_id - property list identifier * name_size - length of name - * idx - External file index. + * idx - External file index. *Outputs: name - Name of an external file * offset - Offset, in bytes, from the beginning of the file - * to the location in the file where the data starts. - * bytes - Number of bytes reserved in the file for the data. + * to the location in the file where the data starts. + * bytes - Number of bytes reserved in the file for the data. * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Wednesday, February 23, 2000 @@ -1639,7 +1639,7 @@ nh5pget_external_c(hid_t_f *prp_id, int_f *idx, size_t_f* name_size, _fcd name, */ if(c_namelen) c_name = (char*) HDmalloc(c_namelen + 1); if (c_name == NULL) return ret_value; - + /* * Call H5Pget_external function. */ @@ -1651,20 +1651,20 @@ nh5pget_external_c(hid_t_f *prp_id, int_f *idx, size_t_f* name_size, _fcd name, *offset = (int_f)c_offset; *bytes = (hsize_t_f)size; - HD5packFstring(c_name, _fcdtocp(name), (int)strlen(c_name)); + HD5packFstring(c_name, _fcdtocp(name), (int)strlen(c_name)); ret_value = 0; -DONE: +DONE: HDfree(c_name); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pset_hyper_cache_c - * Purpose: Call H5Pset__hyper_cache to indicate whether to - * cache hyperslab blocks during I/O. + * Purpose: Call H5Pset__hyper_cache to indicate whether to + * cache hyperslab blocks during I/O. * Inputs: prp_id - property list identifier - * cache - + * cache - * limit - Maximum size of the hyperslab block to cache. * 0 (zero) indicates no limit. * Returns: 0 on success, -1 on failure @@ -1693,14 +1693,14 @@ nh5pset_hyper_cache_c(hid_t_f *prp_id, int_f * cache, int_f * limit) #endif /* H5_WANT_H5_V1_4_COMPAT */ ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_hyper_cache_c - * Purpose: Call H5Pget_hyper_cache to get information regarding - * the caching of hyperslab blocks + * Purpose: Call H5Pget_hyper_cache to get information regarding + * the caching of hyperslab blocks * Inputs: prp_id - property list identifier - * cache - + * cache - * limit - Maximum size of the hyperslab block to cache. * 0 (zero) indicates no limit. * Returns: 0 on success, -1 on failure @@ -1723,21 +1723,21 @@ nh5pget_hyper_cache_c(hid_t_f *prp_id, int_f * cache, int_f * limit) ret = H5Pget_hyper_cache(c_prp_id, &c_cache, &c_limit); if (ret < 0) return ret_value; *cache = (int_f)c_cache; - *limit = (int_f)c_limit; + *limit = (int_f)c_limit; ret_value = 0; #endif /* H5_WANT_H5_V1_4_COMPAT */ return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pset_btree_ratios_c - * Purpose: Call H5Pset_btree_ratios to set B-tree split ratios for B-tree split ratios for a dataset transfer property list. a - * dataset transfer property list. + * Purpose: Call H5Pset_btree_ratios to set B-tree split ratios for B-tree split ratios for a dataset transfer property list. a + * dataset transfer property list. * Inputs: prp_id - property list identifier - * left - The B-tree split ratio for left-most nodes. - * middle - The B-tree split ratio for all other nodes - * right - The B-tree split ratio for right-most nodes - * and lone nodes. + * left - The B-tree split ratio for left-most nodes. + * middle - The B-tree split ratio for all other nodes + * right - The B-tree split ratio for right-most nodes + * and lone nodes. * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Friday, February 25, 2000 @@ -1764,17 +1764,17 @@ nh5pset_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* ri if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_btree_ratios_c - * Purpose: Call H5Pget_btree_ratios to Gets B-tree split ratios - * for a dataset transfer property list. + * Purpose: Call H5Pget_btree_ratios to Gets B-tree split ratios + * for a dataset transfer property list. * Inputs: prp_id - property list identifier - * left - The B-tree split ratio for left-most nodes. - * middle - The B-tree split ratio for all other nodes - * right - The B-tree split ratio for right-most nodes - * and lone nodes. + * left - The B-tree split ratio for left-most nodes. + * middle - The B-tree split ratio for all other nodes + * right - The B-tree split ratio for right-most nodes + * and lone nodes. * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Friday, February 25, 2000 @@ -1799,11 +1799,11 @@ nh5pget_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* ri if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pget_fclose_degree_c * Purpose: Call H5Pget_fclose_degree to determine file close behavior - * Inputs: fapl_id - file access identifier + * Inputs: fapl_id - file access identifier * Outputs: * degree - possible values are: * H5F_CLOSE_DEFAULT @@ -1816,16 +1816,16 @@ nh5pget_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* ri * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pget_fclose_degree_c ( hid_t_f *fapl_id , int_f *degree) { int ret_value = -1; hid_t c_fapl_id; - H5F_close_degree_t c_degree; + H5F_close_degree_t c_degree; c_fapl_id = (hid_t)*fapl_id; if( H5Pget_fclose_degree(c_fapl_id, &c_degree) < 0) return ret_value; - + *degree = (int_f)c_degree; ret_value = 0; return ret_value; @@ -1834,7 +1834,7 @@ nh5pget_fclose_degree_c ( hid_t_f *fapl_id , int_f *degree) /*---------------------------------------------------------------------------- * Name: h5pset_fclose_degree_c * Purpose: Call H5Pset_fclose_degree to set file close behavior - * Inputs: fapl_id - file access identifier + * Inputs: fapl_id - file access identifier * degree - possible values are: * H5F_CLOSE_DEFAULT * H5F_CLOSE_WEAK @@ -1846,34 +1846,34 @@ nh5pget_fclose_degree_c ( hid_t_f *fapl_id , int_f *degree) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_fclose_degree_c ( hid_t_f *fapl_id , int_f *degree) { int ret_value = -1; hid_t c_fapl_id; - H5F_close_degree_t c_degree; + H5F_close_degree_t c_degree; c_fapl_id = (hid_t)*fapl_id; c_degree = (H5F_close_degree_t)*degree; if( H5Pset_fclose_degree(c_fapl_id, c_degree) < 0) return ret_value; - + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5pset_buffer_c - * Purpose: Call H5Pset_buffer to set size of conversion buffer + * Purpose: Call H5Pset_buffer to set size of conversion buffer * Inputs: prp_id - t`dataset trasfer property list identifier * size - size of the buffer - * Outputs: NONE + * Outputs: NONE * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, October 2, 2002 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_buffer_c ( hid_t_f *prp_id , hsize_t_f *size) { int ret_value = 0; @@ -1888,16 +1888,16 @@ nh5pset_buffer_c ( hid_t_f *prp_id , hsize_t_f *size) /*---------------------------------------------------------------------------- * Name: h5pget_buffer_c - * Purpose: Call H5Pget_buffer to get size of conversion buffer + * Purpose: Call H5Pget_buffer to get size of conversion buffer * Inputs: prp_id - t`dataset trasfer property list identifier - * Outputs: size - size of conversion buffer + * Outputs: size - size of conversion buffer * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, October 2, 2002 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pget_buffer_c ( hid_t_f *prp_id , hsize_t_f *size) { int ret_value = -1; @@ -1922,7 +1922,7 @@ nh5pget_buffer_c ( hid_t_f *prp_id , hsize_t_f *size) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pfill_value_defined_c ( hid_t_f *prp_id , int_f *flag) { int ret_value = -1; @@ -1937,7 +1937,7 @@ nh5pfill_value_defined_c ( hid_t_f *prp_id , int_f *flag) } /*---------------------------------------------------------------------------- * Name: h5pget_alloc_time_c - * Purpose: Call H5Pget_alloc_time to get space allocation + * Purpose: Call H5Pget_alloc_time to get space allocation * time for dataset during creation * Inputs: prp_id - dataset creation property list identifier * Outputs: flag - allocation time flag @@ -1947,7 +1947,7 @@ nh5pfill_value_defined_c ( hid_t_f *prp_id , int_f *flag) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pget_alloc_time_c ( hid_t_f *prp_id , int_f *flag) { int ret_value = -1; @@ -1962,7 +1962,7 @@ nh5pget_alloc_time_c ( hid_t_f *prp_id , int_f *flag) } /*---------------------------------------------------------------------------- * Name: h5pset_alloc_time_c - * Purpose: Call H5Pset_alloc_time to get space allocation + * Purpose: Call H5Pset_alloc_time to get space allocation * time for dataset during creation * Inputs: prp_id - dataset creation property list identifier * flag - allocation time flag @@ -1972,7 +1972,7 @@ nh5pget_alloc_time_c ( hid_t_f *prp_id , int_f *flag) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_alloc_time_c ( hid_t_f *prp_id , int_f *flag) { int ret_value = -1; @@ -1997,7 +1997,7 @@ nh5pset_alloc_time_c ( hid_t_f *prp_id , int_f *flag) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pget_fill_time_c ( hid_t_f *prp_id , int_f *flag) { int ret_value = -1; @@ -2022,7 +2022,7 @@ nh5pget_fill_time_c ( hid_t_f *prp_id , int_f *flag) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_fill_time_c ( hid_t_f *prp_id , int_f *flag) { int ret_value = -1; @@ -2040,14 +2040,14 @@ nh5pset_fill_time_c ( hid_t_f *prp_id , int_f *flag) * Purpose: Call H5Pset_meta_block_size to set size of metadata block * Inputs: prp_id - file access property list identifier * size - size of the metadata block - * Outputs: NONE + * Outputs: NONE * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Monday, October 7, 2002 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_meta_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) { int ret_value = 0; @@ -2063,7 +2063,7 @@ nh5pset_meta_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) * Name: h5pget_meta_block_size_c * Purpose: Call H5Pget_meta_block_size to get size of metadata block * Inputs: prp_id - file access property list identifier - * Outputs: + * Outputs: * size - size of the metadata block * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -2071,7 +2071,7 @@ nh5pset_meta_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pget_meta_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) { int ret_value = 0; @@ -2088,14 +2088,14 @@ nh5pget_meta_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) * Purpose: Call H5Pset_sieve_buf_size to set size of datasieve buffer * Inputs: prp_id - file access property list identifier * size - size of the buffer - * Outputs: NONE + * Outputs: NONE * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Monday, October 7, 2002 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_sieve_buf_size_c ( hid_t_f *prp_id , size_t_f *size) { int ret_value = 0; @@ -2111,7 +2111,7 @@ nh5pset_sieve_buf_size_c ( hid_t_f *prp_id , size_t_f *size) * Name: h5pget_sieve_buf_size_c * Purpose: Call H5Pget_sieve_buf_size to get size of datasieve buffer * Inputs: prp_id - file access property list identifier - * Outputs: + * Outputs: * size - size of the buffer * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -2119,7 +2119,7 @@ nh5pset_sieve_buf_size_c ( hid_t_f *prp_id , size_t_f *size) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pget_sieve_buf_size_c ( hid_t_f *prp_id , size_t_f *size) { int ret_value = 0; @@ -2136,14 +2136,14 @@ nh5pget_sieve_buf_size_c ( hid_t_f *prp_id , size_t_f *size) * Purpose: Call H5Pset_small_data_block_size to set size of raw small data block * Inputs: prp_id - file access property list identifier * size - size of the block - * Outputs: NONE + * Outputs: NONE * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Monday, October 7, 2002 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_small_data_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) { int ret_value = 0; @@ -2159,7 +2159,7 @@ nh5pset_small_data_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) * Name: h5pget_small_data_block_size_c * Purpose: Call H5Pget_small_data_block_size to get size of raw small data block * Inputs: prp_id - file access property list identifier - * Outputs: + * Outputs: * size - size of the block * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -2167,7 +2167,7 @@ nh5pset_small_data_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pget_small_data_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) { int ret_value = 0; @@ -2184,14 +2184,14 @@ nh5pget_small_data_block_size_c ( hid_t_f *prp_id , hsize_t_f *size) * Purpose: Call H5Pset_hyper_vector_size to set size of the hyper vector * Inputs: prp_id - dataset transfer property list identifier * size - size of the vector - * Outputs: NONE + * Outputs: NONE * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Monday, October 7, 2002 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_hyper_vector_size_c ( hid_t_f *prp_id , size_t_f *size) { int ret_value = 0; @@ -2207,7 +2207,7 @@ nh5pset_hyper_vector_size_c ( hid_t_f *prp_id , size_t_f *size) * Name: h5pget_hyper_vector_size_c * Purpose: Call H5Pget_hyper_vector_size to get size of the hyper vector * Inputs: prp_id - dataset transfer property list identifier - * Outputs: + * Outputs: * size - size of the vector * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -2215,7 +2215,7 @@ nh5pset_hyper_vector_size_c ( hid_t_f *prp_id , size_t_f *size) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pget_hyper_vector_size_c ( hid_t_f *prp_id , size_t_f *size) { int ret_value = 0; @@ -2224,7 +2224,7 @@ nh5pget_hyper_vector_size_c ( hid_t_f *prp_id , size_t_f *size) c_prp_id = (hid_t)*prp_id; if ( H5Pget_hyper_vector_size(c_prp_id, &c_size) < 0 ) ret_value = -1; - *size = (size_t_f)c_size; + *size = (size_t_f)c_size; return ret_value; } /*---------------------------------------------------------------------------- @@ -2247,7 +2247,7 @@ nh5pcreate_class_c(hid_t_f *parent, _fcd name, int_f *name_len, hid_t_f *class) hid_t c_class; char* c_name; - c_name = (char *)HD5f2cstring(name, (int)*name_len); + c_name = (char *)HD5f2cstring(name, (int)*name_len); if (c_name == NULL) goto DONE; c_parent = (hid_t)*parent; @@ -2266,11 +2266,11 @@ DONE: /*---------------------------------------------------------------------------- * Name: h5pregisterc_c - * Purpose: Call h5pregister_c to registers a permanent property + * Purpose: Call h5pregister_c to registers a permanent property * Inputs: class - property list class identifier * name - name of the new property * name_len - length of the "name" buffer - * size - property size + * size - property size * value - property value of character type * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -2281,7 +2281,7 @@ int_f nh5pregisterc_c(hid_t_f *class, _fcd name, int_f *name_len, size_t_f *size, _fcd value, int_f *value_len) { int ret_value = -1; - + /* * Call h5pregister_c function */ @@ -2291,12 +2291,12 @@ nh5pregisterc_c(hid_t_f *class, _fcd name, int_f *name_len, size_t_f *size, _fcd /*---------------------------------------------------------------------------- * Name: h5pregister_c - * Purpose: Call H5Pregister to registers a permanent property + * Purpose: Call H5Pregister to registers a permanent property * Inputs: class - property list class identifier * name - name of the new property * name_len - length of the "name" buffer - * size - property size - * value - property value + * size - property size + * value - property value * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * October 11, 2002 @@ -2310,7 +2310,7 @@ nh5pregister_c(hid_t_f *class, _fcd name, int_f *name_len, size_t_f *size, void char* c_name; size_t c_size; - c_name = (char *)HD5f2cstring(name, (int)*name_len); + c_name = (char *)HD5f2cstring(name, (int)*name_len); if (c_name == NULL) goto DONE; c_size = (size_t)*size; c_class = (hid_t)*class; @@ -2327,11 +2327,11 @@ DONE: } /*---------------------------------------------------------------------------- * Name: h5pinsertc_c - * Purpose: Call h5pinsert_c to register a temporary property + * Purpose: Call h5pinsert_c to register a temporary property * Inputs: plist - property list identifier * name - name of the new property * name_len - length of the "name" buffer - * size - property size + * size - property size * value - property value of character type * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -2342,7 +2342,7 @@ int_f nh5pinsertc_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, _fcd value, int_f *value_len) { int_f ret_value = -1; - + /* * Call h5pinsert_c function */ @@ -2356,8 +2356,8 @@ nh5pinsertc_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, _fcd v * Inputs: plist - property list class identifier * name - name of the new property * name_len - length of the "name" buffer - * size - property size - * value - property value + * size - property size + * value - property value * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * October 11, 2002 @@ -2371,7 +2371,7 @@ nh5pinsert_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, void *v char* c_name; size_t c_size; - c_name = (char *)HD5f2cstring(name, (int)*name_len); + c_name = (char *)HD5f2cstring(name, (int)*name_len); if (c_name == NULL) goto DONE; c_size = (size_t)*size; c_plist = (hid_t)*plist; @@ -2389,7 +2389,7 @@ DONE: /*---------------------------------------------------------------------------- * Name: h5pexist_c - * Purpose: Call H5Pexist to querie whether a property name exists + * Purpose: Call H5Pexist to querie whether a property name exists * in a property list or class * Inputs: plist - property list or property class identifier * name - name of the new property @@ -2407,7 +2407,7 @@ nh5pexist_c(hid_t_f *class, _fcd name, int_f *name_len) char* c_name; htri_t status; - c_name = (char *)HD5f2cstring(name, (int)*name_len); + c_name = (char *)HD5f2cstring(name, (int)*name_len); if (c_name == NULL) goto DONE; c_class = (hid_t)*class; @@ -2423,8 +2423,8 @@ DONE: } /*---------------------------------------------------------------------------- * Name: h5pisa_class_c - * Purpose: Call H5Pisa_class to querie whether a property is a - * member of a class + * Purpose: Call H5Pisa_class to querie whether a property is a + * member of a class * Inputs: plist - property list identifier * class - property class identifier * Returns: nonnegative on success, -1 on failure @@ -2470,7 +2470,7 @@ nh5pget_size_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size) char* c_name; size_t c_size; - c_name = (char *)HD5f2cstring(name, (int)*name_len); + c_name = (char *)HD5f2cstring(name, (int)*name_len); if (c_name == NULL) goto DONE; c_plist = (hid_t)*plist; @@ -2515,7 +2515,7 @@ nh5pget_nprops_c(hid_t_f *plist, size_t_f *nprops) } /*---------------------------------------------------------------------------- * Name: h5pget_class_parent_c - * Purpose: Call H5Pget_class_parent to get the parent class of + * Purpose: Call H5Pget_class_parent to get the parent class of * a genereic property class * Inputs: prp_id - property list to query * Outputs: parent_id - parent classs identifier @@ -2545,7 +2545,7 @@ nh5pget_class_parent_c(hid_t_f *prp_id, hid_t_f *parent_id) } /*---------------------------------------------------------------------------- * Name: h5pcopy_prop_c - * Purpose: Call H5Pcopy_prop to copy a property from one list or + * Purpose: Call H5Pcopy_prop to copy a property from one list or * class to another * Inputs: dst_id - identifier of destination property list * src_id - identifier of source property list @@ -2563,7 +2563,7 @@ nh5pcopy_prop_c(hid_t_f *dst_id, hid_t_f *src_id, _fcd name, int_f *name_len) hid_t c_dst_id, c_src_id; char* c_name; - c_name = (char *)HD5f2cstring(name, (int)*name_len); + c_name = (char *)HD5f2cstring(name, (int)*name_len); if (c_name == NULL) goto DONE; c_dst_id = (hid_t)*dst_id; @@ -2596,7 +2596,7 @@ nh5premove_c(hid_t_f *plid, _fcd name, int_f *name_len) hid_t c_plid; char* c_name; - c_name = (char *)HD5f2cstring(name, (int)*name_len); + c_name = (char *)HD5f2cstring(name, (int)*name_len); if (c_name == NULL) goto DONE; c_plid = (hid_t)*plid; @@ -2628,7 +2628,7 @@ nh5punregister_c(hid_t_f *class, _fcd name, int_f *name_len) hid_t c_class; char* c_name; - c_name = (char *)HD5f2cstring(name, (int)*name_len); + c_name = (char *)HD5f2cstring(name, (int)*name_len); if (c_name == NULL) goto DONE; c_class = (hid_t)*class; @@ -2667,7 +2667,7 @@ nh5pclose_class_c(hid_t_f *class) } /*---------------------------------------------------------------------------- * Name: h5pget_class_name_c - * Purpose: Call H5Pget_class_name to get property class name + * Purpose: Call H5Pget_class_name to get property class name * Inputs: class - identifier of property class * name - ibuffer to retrieve name in * name_len - length of the "name" buffer @@ -2688,7 +2688,7 @@ nh5pget_class_name_c(hid_t_f *class, _fcd name, int_f *name_len) /* * Call H5Pget_class_name function. */ - c_name = H5Pget_class_name(c_class); + c_name = H5Pget_class_name(c_class); if( c_name == NULL) goto DONE; HD5packFstring(c_name, _fcdtocp(name), (int)*name_len); @@ -2714,7 +2714,7 @@ int_f nh5psetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f *value_len) { int_f ret_value = -1; - + /* * Call h5pset_c function */ @@ -2728,7 +2728,7 @@ nh5psetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f *value_ * Inputs: plist - property list class identifier * name - name of the new property * name_len - length of the "name" buffer - * value - property value + * value - property value * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * October 11, 2002 @@ -2741,7 +2741,7 @@ nh5pset_c(hid_t_f *plist, _fcd name, int_f *name_len, void *value) hid_t c_plist; char* c_name; - c_name = (char *)HD5f2cstring(name, (int)*name_len); + c_name = (char *)HD5f2cstring(name, (int)*name_len); if (c_name == NULL) goto DONE; c_plist = (hid_t)*plist; @@ -2771,7 +2771,7 @@ int_f nh5pgetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f *value_len) { int_f ret_value = -1; - + /* * Call h5pget_c function */ @@ -2785,7 +2785,7 @@ nh5pgetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f *value_ * Inputs: plist - property list class identifier * name - name of the new property * name_len - length of the "name" buffer - * Output: value - property value + * Output: value - property value * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * October 11, 2002 @@ -2798,7 +2798,7 @@ nh5pget_c(hid_t_f *plist, _fcd name, int_f *name_len, void *value) hid_t c_plist; char* c_name; - c_name = (char *)HD5f2cstring(name, (int)*name_len); + c_name = (char *)HD5f2cstring(name, (int)*name_len); if (c_name == NULL) goto DONE; c_plist = (hid_t)*plist; @@ -2814,8 +2814,8 @@ DONE: } /*---------------------------------------------------------------------------- * Name: h5pset_shuffle_c - * Purpose: Call H5Pset_shuffle - * Inputs: prp_id - property list identifier + * Purpose: Call H5Pset_shuffle + * Inputs: prp_id - property list identifier * type_size - size of the datatype in bytes * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -2823,7 +2823,7 @@ DONE: * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_shuffle_c ( hid_t_f *prp_id ) { int_f ret_value = 0; @@ -2838,14 +2838,14 @@ nh5pset_shuffle_c ( hid_t_f *prp_id ) /*---------------------------------------------------------------------------- * Name: h5pset_fletcher32_c * Purpose: Call H5Pset_fletcher32 to enable EDC - * Inputs: prp_id - dataset creation property list identifier + * Inputs: prp_id - dataset creation property list identifier * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Thursday, March 13, 2003 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_fletcher32_c ( hid_t_f *prp_id ) { int_f ret_value = 0; @@ -2861,7 +2861,7 @@ nh5pset_fletcher32_c ( hid_t_f *prp_id ) /*---------------------------------------------------------------------------- * Name: h5pset_edc_check_c * Purpose: Call H5Pset_edc_check to enable EDC - * Inputs: prp_id - dataset transfer property list identifier + * Inputs: prp_id - dataset transfer property list identifier * flag - EDC flag * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -2869,7 +2869,7 @@ nh5pset_fletcher32_c ( hid_t_f *prp_id ) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_edc_check_c ( hid_t_f *prp_id, int_f *flag ) { int_f ret_value = 0; @@ -2887,7 +2887,7 @@ nh5pset_edc_check_c ( hid_t_f *prp_id, int_f *flag ) /*---------------------------------------------------------------------------- * Name: h5pget_edc_check_c * Purpose: Call H5Pget_edc_check to query EDC - * Inputs: prp_id - dataset transfer property list identifier + * Inputs: prp_id - dataset transfer property list identifier * Outouts: flag - EDC flag * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -2895,7 +2895,7 @@ nh5pset_edc_check_c ( hid_t_f *prp_id, int_f *flag ) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pget_edc_check_c ( hid_t_f *prp_id, int_f *flag ) { int_f ret_value = 0; @@ -2911,7 +2911,7 @@ nh5pget_edc_check_c ( hid_t_f *prp_id, int_f *flag ) /*---------------------------------------------------------------------------- * Name: h5pset_family_offset_c * Purpose: Call H5Pset_family_offset to set and offset for family driver - * Inputs: prp_id - property list identifier + * Inputs: prp_id - property list identifier * offset - offset in bytes * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -2919,7 +2919,7 @@ nh5pget_edc_check_c ( hid_t_f *prp_id, int_f *flag ) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_family_offset_c ( hid_t_f *prp_id , hsize_t_f *offset) { int_f ret_value = 0; @@ -2937,9 +2937,9 @@ nh5pset_family_offset_c ( hid_t_f *prp_id , hsize_t_f *offset) /*---------------------------------------------------------------------------- * Name: h5pset_fapl_multi_c * Purpose: Call H5Pset_fapl_multi to set multi file dirver - * Inputs: prp_id - file_creation property list identifier + * Inputs: prp_id - file_creation property list identifier * mem_map - memory mapping array - * memb_fapl - property list for each memory usage type + * memb_fapl - property list for each memory usage type * memb_name - array with members names * len - array with the lenght of each name * lenmax - lenght of the name a sdeclared in Fortran @@ -2950,7 +2950,7 @@ nh5pset_family_offset_c ( hid_t_f *prp_id , hsize_t_f *offset) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f /*nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _fcd memb_name, int_f *len, int_f *lenmax, haddr_t_f *memb_addr, int_f *flag) */ nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _fcd memb_name, int_f *len, int_f *lenmax, real_f *memb_addr, int_f *flag) { @@ -2958,9 +2958,9 @@ nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f hid_t c_prp_id; H5FD_mem_t c_memb_map[H5FD_MEM_NTYPES]; hid_t c_memb_fapl[H5FD_MEM_NTYPES]; - char *c_memb_name[H5FD_MEM_NTYPES]; - haddr_t c_memb_addr[H5FD_MEM_NTYPES]; - hbool_t relax; + char *c_memb_name[H5FD_MEM_NTYPES]; + haddr_t c_memb_addr[H5FD_MEM_NTYPES]; + hbool_t relax; herr_t status; char *tmp, *tmp_p, *tmp_pp; int i; @@ -2978,7 +2978,7 @@ nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f */ tmp = (char *)HD5f2cstring(memb_name, c_lenmax*(H5FD_MEM_NTYPES)); - if (tmp ==NULL) return ret_value; + if (tmp ==NULL) return ret_value; tmp_p = tmp; for (i=0; i < H5FD_MEM_NTYPES; i++) { c_memb_name[i] = malloc((size_t)len[i] + 1); @@ -2989,11 +2989,11 @@ nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f /* printf(" %d \n", len[i]); printf("name %s \n", c_memb_name[i]); */ - } + } /* * Take care of othe arguments */ - + c_prp_id = (hid_t)*prp_id; /* @@ -3009,9 +3009,9 @@ nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f c_memb_fapl[i] = (hid_t)memb_fapl[i]; /*printf("fapl %d \n", c_memb_fapl[i]); */ if(memb_addr[i] < 0) c_memb_addr[i] = HADDR_UNDEF; - else c_memb_addr[i] = (haddr_t)(((float)memb_addr[i])*(HADDR_MAX)); + else c_memb_addr[i] = (haddr_t)(((float)memb_addr[i])*(HADDR_MAX)); /*printf("address %Ld \n", c_memb_addr[i]); */ - } + } /* * Call H5Pset_fapl_multi function */ @@ -3029,19 +3029,19 @@ DONE: /*---------------------------------------------------------------------------- * Name: h5pset_fapl_multi_sc * Purpose: Call H5Pset_fapl_multi to set multi file dirver - * Inputs: prp_id - file_creation property list identifier + * Inputs: prp_id - file_creation property list identifier * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * March 31 2003 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_fapl_multi_sc ( hid_t_f *prp_id , int_f *flag) { int_f ret_value = -1; hid_t c_prp_id; - hbool_t relax; + hbool_t relax; herr_t status; relax = (hbool_t)*flag; @@ -3058,10 +3058,10 @@ nh5pset_fapl_multi_sc ( hid_t_f *prp_id , int_f *flag) /*---------------------------------------------------------------------------- * Name: h5pget_fapl_multi_c * Purpose: Call H5Pget_fapl_multi to set multi file dirver - * Inputs: prp_id - file_creation property list identifier + * Inputs: prp_id - file_creation property list identifier * lenmax - lenght of the name a sdeclared in Fortran * Outputs: memb_map - memory mapping array - * memb_fapl - property list for each memory usage type + * memb_fapl - property list for each memory usage type * memb_name - array with members names * len - array with the lenght of each name * flag - flag allowing partila access when one of the files is missing @@ -3071,16 +3071,16 @@ nh5pset_fapl_multi_sc ( hid_t_f *prp_id , int_f *flag) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pget_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _fcd memb_name, int_f *len, int_f *lenmax, real_f *memb_addr, int_f *flag, int_f *maxlen_out) { int_f ret_value = -1; hid_t c_prp_id; H5FD_mem_t c_memb_map[H5FD_MEM_NTYPES]; hid_t c_memb_fapl[H5FD_MEM_NTYPES]; - char *c_memb_name[H5FD_MEM_NTYPES]; + char *c_memb_name[H5FD_MEM_NTYPES]; haddr_t c_memb_addr[H5FD_MEM_NTYPES]; - hbool_t relax; + hbool_t relax; herr_t status; char *tmp, *tmp_p; int i; @@ -3094,7 +3094,7 @@ nh5pget_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f */ status = H5Pget_fapl_multi(c_prp_id, c_memb_map, c_memb_fapl, c_memb_name, c_memb_addr, &relax); - if ( status < 0 ) return ret_value; + if ( status < 0 ) return ret_value; /* * Take care of names array @@ -3108,13 +3108,13 @@ nh5pget_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f len[i] = (int_f)strlen(c_memb_name[i]); length = H5_MAX(length, strlen(c_memb_name[i])); tmp_p = tmp_p + c_lenmax; - } + } HD5packFstring(tmp, _fcdtocp(memb_name), (int)(c_lenmax*H5FD_MEM_NTYPES)); /* * Take care of other arguments */ - + for (i=0; i < H5FD_MEM_NTYPES; i++) { memb_map[i] = (int_f)c_memb_map[i]; memb_fapl[i] = (hid_t_f)c_memb_fapl[i]; @@ -3124,8 +3124,8 @@ HD5packFstring(tmp, _fcdtocp(memb_name), (int)(c_lenmax*H5FD_MEM_NTYPES)); if(c_memb_addr[i] == HADDR_UNDEF) memb_addr[i] = -1; else memb_addr[i] = (real_f) ((long)c_memb_addr[i]/HADDR_MAX); #endif /*WIN32*/ - } - *flag = (int_f)relax; + } + *flag = (int_f)relax; *maxlen_out = (int_f)length; ret_value = 0; free(tmp); @@ -3136,7 +3136,7 @@ HD5packFstring(tmp, _fcdtocp(memb_name), (int)(c_lenmax*H5FD_MEM_NTYPES)); /*---------------------------------------------------------------------------- * Name: h5pset_szip_c * Purpose: Call H5Pset_szip to set szip compression - * Inputs: prp_id - dataset creation property list identifier + * Inputs: prp_id - dataset creation property list identifier * options_mask * pixels_per_block -szip compression parameters * Returns: 0 on success, -1 on failure @@ -3145,7 +3145,7 @@ HD5packFstring(tmp, _fcdtocp(memb_name), (int)(c_lenmax*H5FD_MEM_NTYPES)); * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_szip_c ( hid_t_f *prp_id , int_f *options_mask, int_f *pixels_per_block) { int_f ret_value = -1; @@ -3169,7 +3169,7 @@ nh5pset_szip_c ( hid_t_f *prp_id , int_f *options_mask, int_f *pixels_per_block) /*---------------------------------------------------------------------------- * Name: h5pall_filters_avail_c * Purpose: Call H5Pall_filters_avail - * Inputs: prp_id - dataset creation property list identifier + * Inputs: prp_id - dataset creation property list identifier * Outputs: status - logical flag * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -3177,13 +3177,13 @@ nh5pset_szip_c ( hid_t_f *prp_id , int_f *options_mask, int_f *pixels_per_block) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pall_filters_avail_c ( hid_t_f *prp_id , int_f *status) { int_f ret_value = -1; hid_t c_prp_id; htri_t c_status; - + c_prp_id = (hid_t)*prp_id; /* @@ -3199,15 +3199,15 @@ nh5pall_filters_avail_c ( hid_t_f *prp_id , int_f *status) } /*---------------------------------------------------------------------------- * Name: h5pget_filter_by_id_c - * Purpose: Call H5Pget_filter_by_id to get information about a filter + * Purpose: Call H5Pget_filter_by_id to get information about a filter * in a pipeline * Inputs: prp_id - property list identifier * filter_id - filter id * namelen - Anticipated number of characters in name. - *Outputs: flags - Bit vector specifying certain general + *Outputs: flags - Bit vector specifying certain general * properties of the filter. * cd_nelmts - Number of elements in cd_value - * cd_values - Auxiliary data for the filter. + * cd_values - Auxiliary data for the filter. * name - Name of the filter * Returns: 0 on success, -1 on failure * Programmer: Elena POurmal @@ -3237,8 +3237,8 @@ nh5pget_filter_by_id_c(hid_t_f *prp_id, int_f* filter_id, int_f* flags, size_t_f if (!c_cd_values) {HDfree(c_name); return ret_value; } - - + + /* * Call H5Pget_filter function. */ @@ -3249,23 +3249,23 @@ nh5pget_filter_by_id_c(hid_t_f *prp_id, int_f* filter_id, int_f* flags, size_t_f *cd_nelmts = (size_t_f)c_cd_nelmts; *flags = (int_f)c_flags; - HD5packFstring(c_name, _fcdtocp(name), (int)strlen(c_name)); - + HD5packFstring(c_name, _fcdtocp(name), (int)strlen(c_name)); + for (i = 0; i < c_cd_nelmts_in; i++) cd_values[i] = (int_f)c_cd_values[i]; - + ret_value = 0; DONE: HDfree(c_name); HDfree(c_cd_values); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5pmodify_filter_c * Purpose: Call H5Pmodify_filter to modify a filter - * Inputs: prp_id - property list identifier + * Inputs: prp_id - property list identifier * filter - Filter to be modified * flags - Bit vector specifying certain general * properties of the filter. @@ -3287,7 +3287,7 @@ nh5pmodify_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_ H5Z_filter_t c_filter; unsigned int * c_cd_values; unsigned i; - + c_filter = (H5Z_filter_t)*filter; c_flags = (unsigned)*flags; c_cd_nelmts = (size_t)*cd_nelmts; @@ -3313,7 +3313,7 @@ DONE: /*---------------------------------------------------------------------------- * Name: h5premove_filter_c * Purpose: Call H5Premove_filter to remove a filter - * Inputs: prp_id - dataset creation property list identifier + * Inputs: prp_id - dataset creation property list identifier * filter - filter to be removed * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -3326,7 +3326,7 @@ nh5premove_filter_c (hid_t_f *prp_id, int_f* filter) int_f ret_value = -1; hid_t c_prp_id; H5Z_filter_t c_filter; - + c_filter = (H5Z_filter_t)*filter; c_prp_id = (hid_t)*prp_id; diff --git a/fortran/src/H5Rf.c b/fortran/src/H5Rf.c index 843c2ea..808bb90 100644 --- a/fortran/src/H5Rf.c +++ b/fortran/src/H5Rf.c @@ -19,10 +19,10 @@ /*---------------------------------------------------------------------------- * Name: h5rcreate_object_c * Purpose: Call H5Rcreate to create a reference to an object - * Inputs: loc_id - file or group identifier - * name - name of the dataset + * Inputs: loc_id - file or group identifier + * name - name of the dataset * namelen - name length - * Outputs: ref - reference to the object + * Outputs: ref - reference to the object * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, December 1, 1999 @@ -42,7 +42,7 @@ nh5rcreate_object_c (haddr_t_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen) * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -56,19 +56,19 @@ nh5rcreate_object_c (haddr_t_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen) *ref=(haddr_t_f)ref_c; ret_value = 0; } - + return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5rcreate_region_c * Purpose: Call H5Rcreate to create a reference to dataset region - * region - * Inputs: loc_id - file or group identifier - * name - name of the dataset + * region + * Inputs: loc_id - file or group identifier + * name - name of the dataset * namelen - name length * space_id - dataset space identifier - * Outputs: ref - reference to the dataset region + * Outputs: ref - reference to the dataset region * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, December 1, 1999 @@ -89,7 +89,7 @@ nh5rcreate_region_c (int_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen, hid * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -105,14 +105,14 @@ nh5rcreate_region_c (int_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen, hid ret_value = 0; } return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5rdereference_region_c * Purpose: Call H5Rdereference to dereference to dataset region - * Inputs: dset_id - dataset identifier - * ref - reference to the dataset region - * Outputs: obj_id - dereferenced dataset identifier + * Inputs: dset_id - dataset identifier + * ref - reference to the dataset region + * Outputs: obj_id - dereferenced dataset identifier * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, December 1, 1999 @@ -135,17 +135,17 @@ nh5rdereference_region_c (hid_t_f *dset_id, int_f *ref, hid_t_f *obj_id) c_obj_id = H5Rdereference(c_dset_id, H5R_DATASET_REGION, &ref_c); if(c_obj_id < 0) return ret_value; *obj_id = (hid_t_f)c_obj_id; - ret_value = 0; + ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5rdereference_object_c - * Purpose: Call H5Rdereference to dereference an object - * Inputs: dset_id - dataset identifier - * ref - reference to an object - * Outputs: obj_id - dereferenced object identifier + * Purpose: Call H5Rdereference to dereference an object + * Inputs: dset_id - dataset identifier + * ref - reference to an object + * Outputs: obj_id - dereferenced object identifier * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, December 1, 1999 @@ -168,16 +168,16 @@ nh5rdereference_object_c (hid_t_f *dset_id, haddr_t_f *ref, hid_t_f *obj_id) c_obj_id = H5Rdereference(c_dset_id, H5R_OBJECT, &ref_c); if(c_obj_id < 0) return ret_value; *obj_id = (hid_t_f)c_obj_id; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5rget_region_region_object_c - * Purpose: Call H5Rget_region to dereference dataspace region - * Inputs: dset_id - dataset identifier - * ref - reference to the dataset region - * Outputs: space_id - dereferenced dataset dataspace identifier + * Purpose: Call H5Rget_region to dereference dataspace region + * Inputs: dset_id - dataset identifier + * ref - reference to the dataset region + * Outputs: space_id - dereferenced dataset dataspace identifier * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, December 1, 1999 @@ -200,17 +200,17 @@ nh5rget_region_region_c (hid_t_f *dset_id, int_f *ref, hid_t_f *space_id) c_space_id = H5Rget_region(c_dset_id, H5R_DATASET_REGION, &ref_c); if(c_space_id < 0) return ret_value; *space_id = (hid_t_f)c_space_id; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5rget_object_type_obj_c - * Purpose: Call H5Rget_object_type to retrieve the type of the object reference points - * to - * Inputs: dset_id - dataset identifier - * ref - reference to the dataset region - * Outputs: obj_type - type of dereferenced object + * Purpose: Call H5Rget_object_type to retrieve the type of the object reference points + * to + * Inputs: dset_id - dataset identifier + * ref - reference to the dataset region + * Outputs: obj_type - type of dereferenced object * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, December 1, 1999 @@ -233,6 +233,6 @@ nh5rget_object_type_obj_c (hid_t_f *dset_id, haddr_t_f *ref, int_f *obj_type) c_obj_type = H5Rget_obj_type(c_dset_id, H5R_OBJECT, &ref_c); if(c_obj_type < 0) return ret_value; *obj_type = (int_f)c_obj_type; - ret_value = 0; + ret_value = 0; return ret_value; } diff --git a/fortran/src/H5Sf.c b/fortran/src/H5Sf.c index 32080d4..9a9321a 100644 --- a/fortran/src/H5Sf.c +++ b/fortran/src/H5Sf.c @@ -16,7 +16,7 @@ /*---------------------------------------------------------------------------- * Name: h5screate_simple_c - * Purpose: Call H5Screate_simple to create a dataspace + * Purpose: Call H5Screate_simple to create a dataspace * Inputs: rank - number of dimensions of dataspace * dims - array of the size of each dimension maxdims - an array of the maximum size of each dimension @@ -27,7 +27,7 @@ * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5screate_simple_c ( int_f *rank, hsize_t_f *dims, hsize_t_f *maxdims, hid_t_f *space_id ) { int ret_value = -1; @@ -46,7 +46,7 @@ nh5screate_simple_c ( int_f *rank, hsize_t_f *dims, hsize_t_f *maxdims, hid_t_f */ for (i = 0; i < *rank ; i++) { c_dims[i] = dims[*rank - i - 1]; - c_maxdims[i] = maxdims[*rank - i - 1]; + c_maxdims[i] = maxdims[*rank - i - 1]; } c_space_id = H5Screate_simple(*rank, c_dims, c_maxdims); @@ -57,13 +57,13 @@ nh5screate_simple_c ( int_f *rank, hsize_t_f *dims, hsize_t_f *maxdims, hid_t_f HDfree (c_dims); HDfree (c_maxdims); return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5sclose_c - * Purpose: Call H5Sclose to close the dataspace + * Purpose: Call H5Sclose to close the dataspace * Inputs: space_id - identifier of the dataspace to be closed * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -71,12 +71,12 @@ nh5screate_simple_c ( int_f *rank, hsize_t_f *dims, hsize_t_f *maxdims, hid_t_f * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sclose_c ( hid_t_f *space_id ) { int ret_value = 0; hid_t c_space_id; - + c_space_id = *space_id; if ( H5Sclose(c_space_id) < 0 ) ret_value = -1; return ret_value; @@ -85,7 +85,7 @@ nh5sclose_c ( hid_t_f *space_id ) /*---------------------------------------------------------------------------- * Name: h5screate_c - * Purpose: Call H5Screate to create a dataspace + * Purpose: Call H5Screate to create a dataspace * Inputs: classtype - type of the dataspace class * Outputs: space_id - identifier of the created dataspace * Returns: 0 on success, -1 on failure @@ -94,14 +94,14 @@ nh5sclose_c ( hid_t_f *space_id ) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5screate_c ( int_f *classtype, hid_t_f *space_id ) { H5S_class_t c_classtype; int ret_value = 0; hid_t c_space_id; c_classtype = (H5S_class_t) *classtype; - c_space_id = H5Screate(c_classtype); + c_space_id = H5Screate(c_classtype); if ( c_space_id < 0 ) ret_value = -1; *space_id = (hid_t_f) c_space_id; @@ -110,8 +110,8 @@ nh5screate_c ( int_f *classtype, hid_t_f *space_id ) /*---------------------------------------------------------------------------- * Name: h5scopy_c - * Purpose: Call H5Scopy to copy dataspace - * Inputs: space_id - identifier of the dataspace to be copied + * Purpose: Call H5Scopy to copy dataspace + * Inputs: space_id - identifier of the dataspace to be copied * Outputs: new_space_id - identifier of the new datspace * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -119,7 +119,7 @@ nh5screate_c ( int_f *classtype, hid_t_f *space_id ) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5scopy_c( hid_t_f *space_id , hid_t_f *new_space_id) { int ret_value = 0; @@ -127,7 +127,7 @@ nh5scopy_c( hid_t_f *space_id , hid_t_f *new_space_id) hid_t c_space_id; c_space_id = *space_id; - c_new_space_id = H5Scopy(c_space_id); + c_new_space_id = H5Scopy(c_space_id); if ( c_new_space_id < 0 ) ret_value = -1; *new_space_id = (hid_t_f)c_new_space_id; @@ -136,11 +136,11 @@ nh5scopy_c( hid_t_f *space_id , hid_t_f *new_space_id) /*---------------------------------------------------------------------------- * Name: h5sget_select_hyper_nblocks_c - * Purpose: Call H5SH5Sget_select_hyper_nblocks to - * get the the number of hyperslab blocks in - * the current dataspace selection if successful + * Purpose: Call H5SH5Sget_select_hyper_nblocks to + * get the the number of hyperslab blocks in + * the current dataspace selection if successful * Inputs: space_id - identifier of the dataspace - * Outputs: num_blocks - number of hyperslab blocks in + * Outputs: num_blocks - number of hyperslab blocks in * the current dataspace selection * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su @@ -148,7 +148,7 @@ nh5scopy_c( hid_t_f *space_id , hid_t_f *new_space_id) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sget_select_hyper_nblocks_c( hid_t_f *space_id , hssize_t_f * num_blocks) { int ret_value = 0; @@ -165,11 +165,11 @@ nh5sget_select_hyper_nblocks_c( hid_t_f *space_id , hssize_t_f * num_blocks) /*---------------------------------------------------------------------------- * Name: h5sget_select_elem_npoints_c - * Purpose: Call H5Sget_select_elem_npoints to - * get the the number of element points in - * the current dataspace selection if successful + * Purpose: Call H5Sget_select_elem_npoints to + * get the the number of element points in + * the current dataspace selection if successful * Inputs: space_id - identifier of the dataspace - * Outputs: num_points - number of element points in + * Outputs: num_points - number of element points in * the current dataspace selection * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su @@ -177,7 +177,7 @@ nh5sget_select_hyper_nblocks_c( hid_t_f *space_id , hssize_t_f * num_blocks) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sget_select_elem_npoints_c( hid_t_f *space_id , hssize_t_f * num_points) { int ret_value = 0; @@ -194,26 +194,26 @@ nh5sget_select_elem_npoints_c( hid_t_f *space_id , hssize_t_f * num_points) /*---------------------------------------------------------------------------- * Name: h5sget_select_hyper_blocklist_c - * Purpose: Call H5Sget_select_hyper_blocklist to - * get a list of the hyperslab blocks currently selected + * Purpose: Call H5Sget_select_hyper_blocklist to + * get a list of the hyperslab blocks currently selected * Starting with the startblock-th block in the * list of blocks, num_blocks blocks are put into the user's - * buffer. If the user's buffer fills up before numblocks + * buffer. If the user's buffer fills up before numblocks * blocks are inserted, the buffer - * will contain only as many blocks as fit. + * will contain only as many blocks as fit. * Inputs: space_id - identifier of the dataspace * startblock - Hyperslab block to start with - * num_blocks - number of hyperslab blocks in + * num_blocks - number of hyperslab blocks in * the current dataspace selection - * Outputs: buf - List of hyperslab blocks selected + * Outputs: buf - List of hyperslab blocks selected * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Monday, November 15, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f -nh5sget_select_hyper_blocklist_c( hid_t_f *space_id ,hsize_t_f * startblock, +int_f +nh5sget_select_hyper_blocklist_c( hid_t_f *space_id ,hsize_t_f * startblock, hsize_t_f * num_blocks, hsize_t_f * buf) { int ret_value = -1; @@ -234,7 +234,7 @@ nh5sget_select_hyper_blocklist_c( hid_t_f *space_id ,hsize_t_f * startblock, c_buf = (hsize_t*)malloc(sizeof(hsize_t)*(size_t)(c_num_blocks*2*rank)); if (!c_buf) return ret_value; - ret_value = H5Sget_select_hyper_blocklist(c_space_id, c_startblock, + ret_value = H5Sget_select_hyper_blocklist(c_space_id, c_startblock, c_num_blocks, c_buf); for(i = 0; i < c_num_blocks*2*rank; i++) { @@ -247,20 +247,20 @@ nh5sget_select_hyper_blocklist_c( hid_t_f *space_id ,hsize_t_f * startblock, /*---------------------------------------------------------------------------- * Name: h5sget_select_bounds_c - * Purpose: Call H5Sget_select_bounds to retrieve the coordinates - * of the bounding box containing the current selection + * Purpose: Call H5Sget_select_bounds to retrieve the coordinates + * of the bounding box containing the current selection * and places them into user-supplied buffers * Inputs: space_id - identifier of the dataspace * Outputs: start - Starting coordinates of the bounding box * end - Ending coordinates of the bounding box, - * i.e., the coordinates of the diagonally opposite corne + * i.e., the coordinates of the diagonally opposite corne * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Wednesday, November 17, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sget_select_bounds_c( hid_t_f *space_id , hsize_t_f * start, hsize_t_f * end) { int ret_value = -1; @@ -295,25 +295,25 @@ nh5sget_select_bounds_c( hid_t_f *space_id , hsize_t_f * start, hsize_t_f * end) /*---------------------------------------------------------------------------- * Name: h5sget_select_elem_pointlist_c * Purpose: Call H5Sget_select_elem_pointlist - * get a list of element points in the - * current dataspace selectin. + * get a list of element points in the + * current dataspace selectin. * Starting with the startpoint-th point in the * list of points, numpoints points are put into the user's - * buffer. If the user's buffer fills up before numpoints + * buffer. If the user's buffer fills up before numpoints * points are inserted, the buffer - * will contain only as many points as fit. + * will contain only as many points as fit. * Inputs: space_id - identifier of the dataspace * startpoint - Element point to start with - * numpoints - Number of element points to get - * Outputs: buf - List of element points selected + * numpoints - Number of element points to get + * Outputs: buf - List of element points selected * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Wednesday, November 17, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f -nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint, +int_f +nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint, hsize_t_f * numpoints, hsize_t_f * buf) { int ret_value = -1; @@ -328,17 +328,17 @@ nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint, rank = H5Sget_simple_extent_ndims(c_space_id); if (rank < 0 ) return ret_value; - c_startpoint = (hsize_t)*startpoint; + c_startpoint = (hsize_t)*startpoint; c_buf = (hsize_t*)malloc(sizeof(hsize_t)*(size_t)(c_num_points*rank)); if (!c_buf) return ret_value; - ret_value = H5Sget_select_elem_pointlist(c_space_id, c_startpoint, + ret_value = H5Sget_select_elem_pointlist(c_space_id, c_startpoint, c_num_points, c_buf); for (i = c_num_points*rank-1; i >= 0; i--) { buf[i] = (hsize_t_f)(c_buf[i]+1); } if (ret_value >= 0 ) ret_value = 0; - + HDfree(c_buf); return ret_value; @@ -348,15 +348,15 @@ nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint, /*---------------------------------------------------------------------------- * Name: h5sselect_all_c - * Purpose: Call H5Sselect_all to select entire dataspace - * Inputs: space_id - identifier of the dataspace + * Purpose: Call H5Sselect_all to select entire dataspace + * Inputs: space_id - identifier of the dataspace * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Tuesday, August 10, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sselect_all_c ( hid_t_f *space_id ) { int ret_value = 0; @@ -369,15 +369,15 @@ nh5sselect_all_c ( hid_t_f *space_id ) /*---------------------------------------------------------------------------- * Name: h5sselect_none_c - * Purpose: Call H5Sselect_none to reset the selection region - * Inputs: space_id - identifier of the dataspace + * Purpose: Call H5Sselect_none to reset the selection region + * Inputs: space_id - identifier of the dataspace * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Tuesday, August 10, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sselect_none_c ( hid_t_f *space_id ) { int ret_value = 0; @@ -391,8 +391,8 @@ nh5sselect_none_c ( hid_t_f *space_id ) /*---------------------------------------------------------------------------- * Name: h5sselect_valid_c * Purpose: Call H5Sselect_valid to verify that selection - * is within dataspace extent. - * Inputs: space_id - identifier of the dataspace + * is within dataspace extent. + * Inputs: space_id - identifier of the dataspace * Outputs: flag - 0 if not valid selection, 1 if is valid selection, * and negative on failure. * Returns: 0 on success, -1 on failure @@ -401,7 +401,7 @@ nh5sselect_none_c ( hid_t_f *space_id ) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sselect_valid_c ( hid_t_f *space_id , int_f *flag ) { int ret_value = 0; @@ -418,16 +418,16 @@ nh5sselect_valid_c ( hid_t_f *space_id , int_f *flag ) /*---------------------------------------------------------------------------- * Name: h5sget_simple_extent_npoints_c * Purpose: Call H5Sget_simple_extent_npoints to determine the number - * of elements in a dataspace - * Inputs: space_id - identifier of the dataspace - * Outputs: npoints - number of points in a dataspace + * of elements in a dataspace + * Inputs: space_id - identifier of the dataspace + * Outputs: npoints - number of points in a dataspace * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, August 11, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sget_simple_extent_npoints_c ( hid_t_f *space_id , hsize_t_f *npoints ) { int ret_value = 0; @@ -444,16 +444,16 @@ nh5sget_simple_extent_npoints_c ( hid_t_f *space_id , hsize_t_f *npoints ) /*---------------------------------------------------------------------------- * Name: h5sget_select_npoints_c * Purpose: Call H5Sget_select_npoints to determine the number - * of elements in a dataspace selection - * Inputs: space_id - identifier of the dataspace - * Outputs: npoints - number of points in a dataspace selection + * of elements in a dataspace selection + * Inputs: space_id - identifier of the dataspace + * Outputs: npoints - number of points in a dataspace selection * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, August 11, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sget_select_npoints_c ( hid_t_f *space_id , hssize_t_f *npoints ) { int ret_value = 0; @@ -470,21 +470,21 @@ nh5sget_select_npoints_c ( hid_t_f *space_id , hssize_t_f *npoints ) /*---------------------------------------------------------------------------- * Name: h5sget_simple_extent_ndims_c * Purpose: Call H5Sget_simple_extent_ndims to determine the number - * dimensions - * Inputs: space_id - identifier of the dataspace - * Outputs: rank - number of dataspace dimensions + * dimensions + * Inputs: space_id - identifier of the dataspace + * Outputs: rank - number of dataspace dimensions * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, August 11, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sget_simple_extent_ndims_c ( hid_t_f *space_id , int_f *ndims ) { int ret_value = 0; hid_t c_space_id; - int c_ndims; + int c_ndims; c_space_id = *space_id; c_ndims = H5Sget_simple_extent_ndims(c_space_id); @@ -496,22 +496,22 @@ nh5sget_simple_extent_ndims_c ( hid_t_f *space_id , int_f *ndims ) /*---------------------------------------------------------------------------- * Name: h5sget_simple_extent_type_c * Purpose: Call H5Sget_simple_extent_type to determine the class type - * of a dataspace - * Inputs: space_id - identifier of the dataspace + * of a dataspace + * Inputs: space_id - identifier of the dataspace * Outputs: classtype - class type; possible values are: - * H5S_SCALAR_F (0), H5S_SIMPLE_F (1) + * H5S_SCALAR_F (0), H5S_SIMPLE_F (1) * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, August 11, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sget_simple_extent_type_c ( hid_t_f *space_id , int_f *classtype) { int ret_value = 0; hid_t c_space_id; - H5S_class_t c_classtype; + H5S_class_t c_classtype; c_space_id = *space_id; c_classtype = H5Sget_simple_extent_type(c_space_id); @@ -526,17 +526,17 @@ nh5sget_simple_extent_type_c ( hid_t_f *space_id , int_f *classtype) /*---------------------------------------------------------------------------- * Name: h5soffset_simple_c - * Purpose: Call H5Soffset_simple to set the offset of a simple - * dataspace - * Inputs: space_id - identifier of the dataspace - * offset - offset array + * Purpose: Call H5Soffset_simple to set the offset of a simple + * dataspace + * Inputs: space_id - identifier of the dataspace + * offset - offset array * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, August 11, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5soffset_simple_c ( hid_t_f *space_id , hssize_t_f *offset) { int ret_value = -1; @@ -567,10 +567,10 @@ nh5soffset_simple_c ( hid_t_f *space_id , hssize_t_f *offset) /*---------------------------------------------------------------------------- * Name: h5sset_extent_simple_c * Purpose: Call H5Sset_extent_simple to set or reset size of - * existing dataspace - * Inputs: space_id - identifier of the dataspace + * existing dataspace + * Inputs: space_id - identifier of the dataspace * rank - dataspace rank - * current_size - array with the new dimension sizes + * current_size - array with the new dimension sizes * maximum_size - aray with maximum sizes of dimensions * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -578,7 +578,7 @@ nh5soffset_simple_c ( hid_t_f *space_id , hssize_t_f *offset) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sset_extent_simple_c ( hid_t_f *space_id , int_f *rank, hsize_t_f *current_size, hsize_t_f *maximum_size) { int ret_value = -1; @@ -602,7 +602,7 @@ nh5sset_extent_simple_c ( hid_t_f *space_id , int_f *rank, hsize_t_f *current_si c_current_size[i] = (hsize_t)current_size[*rank - i - 1]; c_maximum_size[i] = (hsize_t)maximum_size[*rank - i - 1]; } - + c_space_id = *space_id; c_rank = *rank; status = H5Sset_extent_simple(c_space_id, c_rank, c_current_size, c_maximum_size); @@ -614,10 +614,10 @@ nh5sset_extent_simple_c ( hid_t_f *space_id , int_f *rank, hsize_t_f *current_si /*---------------------------------------------------------------------------- * Name: h5sget_simple_extent_dims_c - * Purpose: Call H5Sget_simple_extent_dims to retrieve sizes of an - * existing dataspace - * Inputs: space_id - identifier of the dataspace - * Outputs: dims - array with the dimension sizes + * Purpose: Call H5Sget_simple_extent_dims to retrieve sizes of an + * existing dataspace + * Inputs: space_id - identifier of the dataspace + * Outputs: dims - array with the dimension sizes * maxdims - aray with maximum sizes of dimensions * Returns: number of dataspace dimensions (rank) on success, -1 on failure * Programmer: Elena Pourmal @@ -625,7 +625,7 @@ nh5sset_extent_simple_c ( hid_t_f *space_id , int_f *rank, hsize_t_f *current_si * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sget_simple_extent_dims_c ( hid_t_f *space_id , hsize_t_f *dims, hsize_t_f *maxdims) { int ret_value = -1; @@ -663,9 +663,9 @@ nh5sget_simple_extent_dims_c ( hid_t_f *space_id , hsize_t_f *dims, hsize_t_f *m /*---------------------------------------------------------------------------- * Name: h5sis_simple_c - * Purpose: Call H5Sis_simple to detrmine if the dataspace - * is simple. - * Inputs: space_id - identifier of the dataspace + * Purpose: Call H5Sis_simple to detrmine if the dataspace + * is simple. + * Inputs: space_id - identifier of the dataspace * Outputs: flag - 0 if not simple, 1 if is simple, * and negative on failure. * Returns: 0 on success, -1 on failure @@ -674,7 +674,7 @@ nh5sget_simple_extent_dims_c ( hid_t_f *space_id , hsize_t_f *dims, hsize_t_f *m * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sis_simple_c ( hid_t_f *space_id , int_f *flag ) { int ret_value = 0; @@ -691,8 +691,8 @@ nh5sis_simple_c ( hid_t_f *space_id , int_f *flag ) /*---------------------------------------------------------------------------- * Name: h5sextent_copy_c - * Purpose: Call H5Sextent_copy to copy an extent of dataspace - * Inputs: dest_space_id - identifier of the destination dataspace + * Purpose: Call H5Sextent_copy to copy an extent of dataspace + * Inputs: dest_space_id - identifier of the destination dataspace * source_space_id - identifier of the source dataspace * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -700,7 +700,7 @@ nh5sis_simple_c ( hid_t_f *space_id , int_f *flag ) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sextent_copy_c ( hid_t_f *dest_space_id , hid_t_f *source_space_id) { int ret_value = 0; @@ -709,22 +709,22 @@ nh5sextent_copy_c ( hid_t_f *dest_space_id , hid_t_f *source_space_id) c_dest_space_id = *dest_space_id; c_source_space_id = *source_space_id; - status = H5Sextent_copy(c_dest_space_id, c_source_space_id); + status = H5Sextent_copy(c_dest_space_id, c_source_space_id); if ( status < 0 ) ret_value = -1; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5sset_extent_none_c - * Purpose: Call H5Sset_extent_none to remove extent from a dataspace - * Inputs: space_id - dataspace identifier + * Purpose: Call H5Sset_extent_none to remove extent from a dataspace + * Inputs: space_id - dataspace identifier * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, August 11, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sset_extent_none_c ( hid_t_f *space_id ) { int ret_value = 0; @@ -732,19 +732,19 @@ nh5sset_extent_none_c ( hid_t_f *space_id ) herr_t status; c_space_id = *space_id; - status = H5Sset_extent_none(c_space_id); + status = H5Sset_extent_none(c_space_id); if ( status < 0 ) ret_value = -1; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5sselect_hyperslab_c - * Purpose: Call H5Sselect_hyperslab to select a hyperslab - * Inputs: space_id - identifier of the dataspace + * Purpose: Call H5Sselect_hyperslab to select a hyperslab + * Inputs: space_id - identifier of the dataspace * operator - defines how the new selection is combined - * with the previous one; current values are - * H5S_SELECT_SET_F (0) and H5S_SELECT_OR_F (1) - * start - offset of start of hyperslab + * with the previous one; current values are + * H5S_SELECT_SET_F (0) and H5S_SELECT_OR_F (1) + * start - offset of start of hyperslab * count - number of blocks included in the hyperslab * stride - hyperslab stride (interval between blocks) * block - size of block in the hyperslab @@ -754,7 +754,7 @@ nh5sset_extent_none_c ( hid_t_f *space_id ) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sselect_hyperslab_c ( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block) { int ret_value = -1; @@ -762,7 +762,7 @@ nh5sselect_hyperslab_c ( hid_t_f *space_id , int_f *op, hsize_t_f *start, hsize_ hsize_t *c_start = NULL; hsize_t *c_count = NULL; hsize_t *c_stride = NULL; - hsize_t *c_block = NULL; + hsize_t *c_block = NULL; H5S_seloper_t c_op; herr_t status; @@ -815,7 +815,7 @@ DONE: /*---------------------------------------------------------------------------- * Name: h5sget_select_type_c * Purpose: Call H5Sget_select_type - * Inputs: space_id - identifier of the dataspace + * Inputs: space_id - identifier of the dataspace * Outputs: type - type of selection * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -823,7 +823,7 @@ DONE: * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sget_select_type_c ( hid_t_f *space_id , int_f *type) { int ret_value = -1; @@ -841,20 +841,20 @@ nh5sget_select_type_c ( hid_t_f *space_id , int_f *type) /*---------------------------------------------------------------------------- * Name: h5sselect_elements_c - * Purpose: Call H5Sselect_elements to select elements of a dataspace - * Inputs: space_id - identifier of the dataspace + * Purpose: Call H5Sselect_elements to select elements of a dataspace + * Inputs: space_id - identifier of the dataspace * operator - defines how the new selection is combined - * with the previous one; current values are - * H5S_SELECT_SET_F (0) - * nelements - number of elements in the selection - * coord - arrays with the elements coordinates + * with the previous one; current values are + * H5S_SELECT_SET_F (0) + * nelements - number of elements in the selection + * coord - arrays with the elements coordinates * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Wednesday, August 11, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *nelements, hsize_t_f *coord) { int ret_value = -1; @@ -885,7 +885,7 @@ nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *nelements, hsi c_nelements = *nelements; status = H5Sselect_elements(c_space_id, c_op, c_nelements, (const hsize_t **)c_coord); if ( status >= 0 ) ret_value = 0; - HDfree(c_coord); + HDfree(c_coord); return ret_value; } diff --git a/fortran/src/H5Tf.c b/fortran/src/H5Tf.c index 98a062a..1b5f52a 100644 --- a/fortran/src/H5Tf.c +++ b/fortran/src/H5Tf.c @@ -19,9 +19,9 @@ /*---------------------------------------------------------------------------- * Name: h5topen_c - * Purpose: Call H5Topen to open a datatype - * Inputs: loc_id - file or group identifier - * name - name of the datatype within file or group + * Purpose: Call H5Topen to open a datatype + * Inputs: loc_id - file or group identifier + * name - name of the datatype within file or group * namelen - name length * Outputs: type_id - dataset identifier * Returns: 0 on success, -1 on failure @@ -42,7 +42,7 @@ nh5topen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id) * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -56,14 +56,14 @@ nh5topen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id) HDfree(c_name); ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5tcommit_c - * Purpose: Call H5Tcommit to commit a datatype - * Inputs: loc_id - file or group identifier - * name - name of the datatype within file or group + * Purpose: Call H5Tcommit to commit a datatype + * Inputs: loc_id - file or group identifier + * name - name of the datatype within file or group * namelen - name length * type_id - dataset identifier * Returns: 0 on success, -1 on failure @@ -85,7 +85,7 @@ nh5tcommit_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id) * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -98,11 +98,11 @@ nh5tcommit_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id) if (status < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5tclose_c - * Purpose: Call H5Tclose to close the datatype + * Purpose: Call H5Tclose to close the datatype * Inputs: type_id - identifier of the datatype to be closed * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -110,7 +110,7 @@ nh5tcommit_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tclose_c ( hid_t_f *type_id ) { int ret_value = 0; @@ -125,7 +125,7 @@ nh5tclose_c ( hid_t_f *type_id ) /*---------------------------------------------------------------------------- * Name: h5tcopy_c * Purpose: Call H5Tcopy to copy a datatype - * Inputs: type_id - identifier of the datatype to be copied + * Inputs: type_id - identifier of the datatype to be copied * Outputs: new_type_id - identifier of the new datatype * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -133,7 +133,7 @@ nh5tclose_c ( hid_t_f *type_id ) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tcopy_c ( hid_t_f *type_id , hid_t_f *new_type_id) { int ret_value = 0; @@ -141,7 +141,7 @@ nh5tcopy_c ( hid_t_f *type_id , hid_t_f *new_type_id) hid_t c_new_type_id; c_type_id = *type_id; - c_new_type_id = H5Tcopy(c_type_id); + c_new_type_id = H5Tcopy(c_type_id); if ( c_new_type_id < 0 ) ret_value = -1; *new_type_id = (hid_t_f)c_new_type_id; return ret_value; @@ -150,16 +150,16 @@ nh5tcopy_c ( hid_t_f *type_id , hid_t_f *new_type_id) /*---------------------------------------------------------------------------- * Name: h5tequal_c * Purpose: Call H5Tequal to copy a datatype - * Inputs: type1_id - datatype identifier - * type2_id - datatype identifier - * Outputs: c_flag - flag; indicates if two datatypes are equal or not. + * Inputs: type1_id - datatype identifier + * type2_id - datatype identifier + * Outputs: c_flag - flag; indicates if two datatypes are equal or not. * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal - * Tuesday, February 22, 2000 + * Tuesday, February 22, 2000 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tequal_c ( hid_t_f *type1_id , hid_t_f *type2_id, int_f *c_flag) { int ret_value = -1; @@ -168,9 +168,9 @@ nh5tequal_c ( hid_t_f *type1_id , hid_t_f *type2_id, int_f *c_flag) c_type1_id = *type1_id; c_type2_id = *type2_id; - status = H5Tequal(c_type1_id, c_type2_id); - if ( status < 0 ) return ret_value; - *c_flag = (int_f)status; + status = H5Tequal(c_type1_id, c_type2_id); + if ( status < 0 ) return ret_value; + *c_flag = (int_f)status; ret_value = 0; return ret_value; } @@ -179,7 +179,7 @@ nh5tequal_c ( hid_t_f *type1_id , hid_t_f *type2_id, int_f *c_flag) /*---------------------------------------------------------------------------- * Name: h5tget_class_c * Purpose: Call H5Tget_class to determine the datatype class - * Inputs: type_id - identifier of the dataspace + * Inputs: type_id - identifier of the dataspace * Outputs: classtype - class type; possible values are: * H5T_NO_CLASS_F (-1) * H5T_INTEGER_F (0) @@ -197,18 +197,18 @@ nh5tequal_c ( hid_t_f *type1_id , hid_t_f *type2_id, int_f *c_flag) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_class_c ( hid_t_f *type_id , int_f *classtype) { int ret_value = 0; hid_t c_type_id; - H5T_class_t c_classtype; + H5T_class_t c_classtype; c_type_id = *type_id; c_classtype = H5Tget_class(c_type_id); if (c_classtype == H5T_NO_CLASS ) { /* *classtype = H5T_NO_CLASS_F; */ - *classtype = (int_f)H5T_NO_CLASS; + *classtype = (int_f)H5T_NO_CLASS; ret_value = -1; return ret_value; } @@ -229,8 +229,8 @@ nh5tget_class_c ( hid_t_f *type_id , int_f *classtype) /*---------------------------------------------------------------------------- * Name: h5tget_order_c - * Purpose: Call H5Tget_order to determine byte order - * Inputs: type_id - identifier of the dataspace + * Purpose: Call H5Tget_order to determine byte order + * Inputs: type_id - identifier of the dataspace * Outputs: order; possible values are: * H5T_ORDER_LE_F (0) * H5T_ORDER_BE_F (1) @@ -241,12 +241,12 @@ nh5tget_class_c ( hid_t_f *type_id , int_f *classtype) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_order_c ( hid_t_f *type_id , int_f *order) { int ret_value = -1; hid_t c_type_id; - H5T_order_t c_order; + H5T_order_t c_order; c_type_id = *type_id; c_order = H5Tget_order(c_type_id); @@ -264,8 +264,8 @@ nh5tget_order_c ( hid_t_f *type_id , int_f *order) /*---------------------------------------------------------------------------- * Name: h5tset_order_c - * Purpose: Call H5Tset_order to set byte order - * Inputs: type_id - identifier of the dataspace + * Purpose: Call H5Tset_order to set byte order + * Inputs: type_id - identifier of the dataspace * order; possible values are: * H5T_ORDER_LE_F (0) * H5T_ORDER_BE_F (1) @@ -276,12 +276,12 @@ nh5tget_order_c ( hid_t_f *type_id , int_f *order) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tset_order_c ( hid_t_f *type_id , int_f *order) { int ret_value = 0; hid_t c_type_id; - H5T_order_t c_order; + H5T_order_t c_order; herr_t status; c_order = (H5T_order_t)*order; /* @@ -297,47 +297,47 @@ nh5tset_order_c ( hid_t_f *type_id , int_f *order) /*---------------------------------------------------------------------------- * Name: h5tget_size_c - * Purpose: Call H5Tget_size to get size of the datatype - * Inputs: type_id - identifier of the dataspace - * Outputs: size (in bytes) + * Purpose: Call H5Tget_size to get size of the datatype + * Inputs: type_id - identifier of the dataspace + * Outputs: size (in bytes) * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Saturday, August 14, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_size_c ( hid_t_f *type_id , size_t_f *size) { int ret_value = -1; hid_t c_type_id; - size_t c_size; + size_t c_size; c_type_id = *type_id; c_size = H5Tget_size(c_type_id); if ( c_size == 0 ) return ret_value; *size = (size_t_f)c_size ; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tset_size_c - * Purpose: Call H5Tget_size to get size of the datatype - * Inputs: type_id - identifier of the dataspace - * Outputs: size (in bytes) + * Purpose: Call H5Tget_size to get size of the datatype + * Inputs: type_id - identifier of the dataspace + * Outputs: size (in bytes) * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Saturday, August 14, 1999 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tset_size_c ( hid_t_f *type_id , size_t_f *size) { int ret_value = -1; hid_t c_type_id; - size_t c_size; + size_t c_size; herr_t status; c_size = (size_t)*size; @@ -350,134 +350,134 @@ nh5tset_size_c ( hid_t_f *type_id , size_t_f *size) /*---------------------------------------------------------------------------- * Name: h5tget_precision_c - * Purpose: Call H5Tget_precision to get precision of the datatype - * Inputs: type_id - identifier of the dataspace - * Outputs: precision - number of significant bits + * Purpose: Call H5Tget_precision to get precision of the datatype + * Inputs: type_id - identifier of the dataspace + * Outputs: precision - number of significant bits * Returns: 0 on success, -1 on failure * Programmer: XIANGYANG SU * Tuesday, January 25, 2000 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_precision_c ( hid_t_f *type_id , size_t_f *precision) { int ret_value = -1; hid_t c_type_id; - size_t c_precision; + size_t c_precision; c_type_id = *type_id; c_precision = H5Tget_precision(c_type_id); if ( c_precision == 0 ) return ret_value; *precision = (size_t_f)c_precision ; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tset_precision_c - * Purpose: Call H5Tset_precision to set precision of the datatype - * Inputs: type_id - identifier of the dataspace - * precision - number of significant bits + * Purpose: Call H5Tset_precision to set precision of the datatype + * Inputs: type_id - identifier of the dataspace + * precision - number of significant bits * Returns: 0 on success, -1 on failure * Programmer: XIANGYANG SU * Tuesday, January 25, 2000 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tset_precision_c ( hid_t_f *type_id , size_t_f *precision) { int ret_value = -1; hid_t c_type_id; - size_t c_precision; + size_t c_precision; herr_t status; c_type_id = *type_id; c_precision = (size_t)*precision; status = H5Tset_precision(c_type_id, c_precision); if ( status < 0 ) return ret_value; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tget_offset_c - * Purpose: Call H5Tget_offset to get bit offset of the first - * significant bit of the datatype - * Inputs: type_id - identifier of the dataspace - * Outputs: offset - bit offset of the first significant bit + * Purpose: Call H5Tget_offset to get bit offset of the first + * significant bit of the datatype + * Inputs: type_id - identifier of the dataspace + * Outputs: offset - bit offset of the first significant bit * Returns: 0 on success, -1 on failure * Programmer: XIANGYANG SU * Tuesday, January 25, 2000 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_offset_c ( hid_t_f *type_id , size_t_f *offset) { int ret_value = -1; hid_t c_type_id; - size_t c_offset; + size_t c_offset; c_type_id = *type_id; c_offset = H5Tget_offset(c_type_id); if ( c_offset == 0 ) return ret_value; *offset = (size_t_f)c_offset ; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tset_offset_c - * Purpose: Call H5Tset_offset to set bit offset of the first - * significant bit of the datatype - * Inputs: type_id - identifier of the dataspace - * offset - bit offset of the first significant bit + * Purpose: Call H5Tset_offset to set bit offset of the first + * significant bit of the datatype + * Inputs: type_id - identifier of the dataspace + * offset - bit offset of the first significant bit * Returns: 0 on success, -1 on failure * Programmer: XIANGYANG SU * Tuesday, January 25, 2000 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tset_offset_c ( hid_t_f *type_id , size_t_f *offset) { int ret_value = -1; hid_t c_type_id; - size_t c_offset; + size_t c_offset; herr_t status; c_offset = (size_t)*offset; c_type_id = *type_id; status = H5Tset_offset(c_type_id, c_offset); if ( status < 0 ) return ret_value; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tget_pad_c * Purpose: Call H5Tget_pad to get the padding type of the least and - * most-significant bit padding - * - * Inputs: type_id - identifier of the dataspace + * most-significant bit padding + * + * Inputs: type_id - identifier of the dataspace * Outputs: lsbpad - padding type of the least significant bit - * msbpad - padding type of the least significant bit + * msbpad - padding type of the least significant bit * Returns: 0 on success, -1 on failure * Programmer: XIANGYANG SU * Wednesday, January 26, 2000 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_pad_c ( hid_t_f *type_id , int_f * lsbpad, int_f * msbpad) { int ret_value = -1; hid_t c_type_id; herr_t status; - H5T_pad_t c_lsb, c_msb; + H5T_pad_t c_lsb, c_msb; c_type_id = *type_id; status = H5Tget_pad(c_type_id, &c_lsb, &c_msb); @@ -485,85 +485,85 @@ nh5tget_pad_c ( hid_t_f *type_id , int_f * lsbpad, int_f * msbpad) *lsbpad = (int_f) c_lsb; *msbpad = (int_f) c_msb; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tset_pad_c - * Inputs: type_id - identifier of the dataspace + * Inputs: type_id - identifier of the dataspace * Purpose: Call H5Tset_pad to set the padding type of the least and - * most-significant bit padding - * - * Inputs: type_id - identifier of the dataspace + * most-significant bit padding + * + * Inputs: type_id - identifier of the dataspace * lsbpad - padding type of the least significant bit - * msbpad - padding type of the least significant bit + * msbpad - padding type of the least significant bit * Returns: 0 on success, -1 on failure * Programmer: XIANGYANG SU * Wednesday, January 26, 2000 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tset_pad_c ( hid_t_f *type_id, int_f * lsbpad, int_f* msbpad ) { int ret_value = -1; hid_t c_type_id; herr_t status; - H5T_pad_t c_lsb, c_msb; + H5T_pad_t c_lsb, c_msb; c_type_id = *type_id; c_lsb = (H5T_pad_t)*lsbpad; c_msb = (H5T_pad_t)*msbpad; status = H5Tset_pad(c_type_id, c_lsb, c_msb); if ( status < 0 ) return ret_value; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tget_sign_c - * Purpose: Call H5Tget_sign to get sign type for an integer type - * Inputs: type_id - identifier of the dataspace - * Outputs: sign - sign type for an integer type + * Purpose: Call H5Tget_sign to get sign type for an integer type + * Inputs: type_id - identifier of the dataspace + * Outputs: sign - sign type for an integer type * Returns: 0 on success, -1 on failure * Programmer: XIANGYANG SU * Wednesday, January 26, 2000 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_sign_c ( hid_t_f *type_id , int_f *sign) { int ret_value = -1; hid_t c_type_id; - H5T_sign_t c_sign; + H5T_sign_t c_sign; c_type_id = *type_id; c_sign = H5Tget_sign(c_type_id); if ( c_sign == -1 ) return ret_value; *sign = (int_f)c_sign ; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tset_sign_c - * Purpose: Call H5Tset_sign to set sign type for an integer type - * Inputs: type_id - identifier of the dataspace - * sign - sign type for an integer typ + * Purpose: Call H5Tset_sign to set sign type for an integer type + * Inputs: type_id - identifier of the dataspace + * sign - sign type for an integer typ * Returns: 0 on success, -1 on failure * Programmer: XIANGYANG SU * Wednesday, January 26, 2000 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tset_sign_c ( hid_t_f *type_id , int_f* sign) { int ret_value = -1; hid_t c_type_id; - H5T_sign_t c_sign; + H5T_sign_t c_sign; herr_t status; c_type_id = *type_id; @@ -571,15 +571,15 @@ nh5tset_sign_c ( hid_t_f *type_id , int_f* sign) status = H5Tset_sign(c_type_id, c_sign); if ( status < 0 ) return ret_value; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tget_fields_c - * Purpose: Call H5Tget_fields to get floating point datatype + * Purpose: Call H5Tget_fields to get floating point datatype * bit field information - * Inputs: type_id - identifier of the dataspace + * Inputs: type_id - identifier of the dataspace * Outputs: epos - exponent bit-position * esize - size of exponent in bits * mpos - mantissa bit-position @@ -590,13 +590,13 @@ nh5tset_sign_c ( hid_t_f *type_id , int_f* sign) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_fields_c ( hid_t_f *type_id , size_t_f *spos, size_t_f *epos, size_t_f* esize, size_t_f* mpos, size_t_f* msize) { int ret_value = -1; hid_t c_type_id; herr_t status; - size_t c_spos, c_epos, c_esize, c_mpos, c_msize; + size_t c_spos, c_epos, c_esize, c_mpos, c_msize; c_type_id = *type_id; status = H5Tget_fields(c_type_id, &c_spos, &c_epos, &c_esize, &c_mpos, &c_msize); @@ -606,15 +606,15 @@ nh5tget_fields_c ( hid_t_f *type_id , size_t_f *spos, size_t_f *epos, size_t_f* *esize = (size_t_f) c_esize; *mpos = (size_t_f) c_mpos; *msize = (size_t_f) c_msize; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tset_fields_c - * Purpose: Call H5Tset_fields to set floating point datatype + * Purpose: Call H5Tset_fields to set floating point datatype * bit field information - * Inputs: type_id - identifier of the dataspace + * Inputs: type_id - identifier of the dataspace * epos - exponent bit-position * esize - size of exponent in bits * mpos - mantissa bit-position @@ -625,13 +625,13 @@ nh5tget_fields_c ( hid_t_f *type_id , size_t_f *spos, size_t_f *epos, size_t_f* * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tset_fields_c ( hid_t_f *type_id, size_t_f *spos, size_t_f *epos, size_t_f* esize, size_t_f* mpos, size_t_f* msize) { int ret_value = -1; hid_t c_type_id; herr_t status; - size_t c_spos, c_epos, c_esize, c_mpos, c_msize; + size_t c_spos, c_epos, c_esize, c_mpos, c_msize; c_spos = (size_t)*spos; c_epos = (size_t)*epos; @@ -642,15 +642,15 @@ nh5tset_fields_c ( hid_t_f *type_id, size_t_f *spos, size_t_f *epos, size_t_f* e status = H5Tset_fields(c_type_id, c_spos, c_epos, c_esize, c_mpos, c_msize); if ( status < 0 ) return ret_value; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tget_ebias_c - * Purpose: Call H5Tget_ebias to get exponent bias of a - * floating-point type of the datatype - * Inputs: type_id - identifier of the dataspace + * Purpose: Call H5Tget_ebias to get exponent bias of a + * floating-point type of the datatype + * Inputs: type_id - identifier of the dataspace * Outputs: ebias - exponent bias of a floating-point type of the datatype * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su @@ -658,40 +658,40 @@ nh5tset_fields_c ( hid_t_f *type_id, size_t_f *spos, size_t_f *epos, size_t_f* e * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_ebias_c ( hid_t_f *type_id , size_t_f *ebias) { int ret_value = -1; hid_t c_type_id; - size_t c_ebias; + size_t c_ebias; c_type_id = *type_id; c_ebias = H5Tget_ebias(c_type_id); if ( c_ebias == 0 ) return ret_value; *ebias = (size_t_f)c_ebias; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tset_ebias_c * Purpose: Call H5Tset_ebias to set exponent bias of a - * floating-point type of the datatype - * Inputs: type_id - identifier of the dataspace - * ebias - exponent bias of a floating-point type of the datatyp + * floating-point type of the datatype + * Inputs: type_id - identifier of the dataspace + * ebias - exponent bias of a floating-point type of the datatyp * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su * Friday, January 27, 2000 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tset_ebias_c ( hid_t_f *type_id , size_t_f *ebias) { int ret_value = -1; hid_t c_type_id; - size_t c_ebias; + size_t c_ebias; herr_t status; c_type_id = *type_id; @@ -706,8 +706,8 @@ nh5tset_ebias_c ( hid_t_f *type_id , size_t_f *ebias) /*---------------------------------------------------------------------------- * Name: h5tget_norm_c * Purpose: Call H5Tget_norm to get mantissa normalization - * of a floating-point datatype - * Inputs: type_id - identifier of the dataspace + * of a floating-point datatype + * Inputs: type_id - identifier of the dataspace * Outputs: norm - mantissa normalization of a floating-point type * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su @@ -715,27 +715,27 @@ nh5tset_ebias_c ( hid_t_f *type_id , size_t_f *ebias) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_norm_c ( hid_t_f *type_id , int_f *norm) { int ret_value = -1; hid_t c_type_id; - H5T_norm_t c_norm; + H5T_norm_t c_norm; c_type_id = *type_id; c_norm = H5Tget_norm(c_type_id); if ( c_norm == 0 ) return ret_value; *norm = (int_f)c_norm; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tset_norm_c - * Purpose: Call H5Tset_norm to set mantissa normalization of - * floating-point type of the datatype - * Inputs: type_id - identifier of the dataspace + * Purpose: Call H5Tset_norm to set mantissa normalization of + * floating-point type of the datatype + * Inputs: type_id - identifier of the dataspace * norm - mantissa normalization of a floating-point type * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su @@ -743,12 +743,12 @@ nh5tget_norm_c ( hid_t_f *type_id , int_f *norm) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tset_norm_c ( hid_t_f *type_id , int_f *norm) { int ret_value = -1; hid_t c_type_id; - H5T_norm_t c_norm; + H5T_norm_t c_norm; herr_t status; c_type_id = *type_id; @@ -764,8 +764,8 @@ nh5tset_norm_c ( hid_t_f *type_id , int_f *norm) * Name: h5tget_inpad_c * Purpose: Call H5Tget_inpad to get the padding type for * unused bits in floating-point datatypes - * - * Inputs: type_id - identifier of the dataspace + * + * Inputs: type_id - identifier of the dataspace * Outputs: padtype - padding type for * unused bits in floating-point datatype * Returns: 0 on success, -1 on failure @@ -774,29 +774,29 @@ nh5tset_norm_c ( hid_t_f *type_id , int_f *norm) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_inpad_c ( hid_t_f *type_id , int_f * padtype) { int ret_value = -1; hid_t c_type_id; - H5T_pad_t c_padtype; + H5T_pad_t c_padtype; c_type_id = *type_id; c_padtype = H5Tget_inpad(c_type_id); if ( c_padtype == H5T_PAD_ERROR ) return ret_value; *padtype = (int_f) c_padtype; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tset_inpad_c - * Inputs: type_id - identifier of the dataspace - * Purpose: Call H5Tset_inpad to set the padding type + * Inputs: type_id - identifier of the dataspace + * Purpose: Call H5Tset_inpad to set the padding type * unused bits in floating-point datatype - * - * Inputs: type_id - identifier of the dataspace + * + * Inputs: type_id - identifier of the dataspace * padtype - padding type for unused bits * in floating-point datatypes * Returns: 0 on success, -1 on failure @@ -805,29 +805,29 @@ nh5tget_inpad_c ( hid_t_f *type_id , int_f * padtype) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tset_inpad_c ( hid_t_f *type_id, int_f * padtype) { int ret_value = -1; hid_t c_type_id; herr_t status; - H5T_pad_t c_padtype; + H5T_pad_t c_padtype; c_type_id = *type_id; c_padtype = (H5T_pad_t)*padtype; status = H5Tset_inpad(c_type_id, c_padtype); if ( status < 0 ) return ret_value; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tget_cset_c - * Purpose: Call H5Tget_cset to get character set + * Purpose: Call H5Tget_cset to get character set * type of a string datatype - * - * Inputs: type_id - identifier of the dataspace + * + * Inputs: type_id - identifier of the dataspace * Outputs: cset - character set type of a string datatype * Returns: 0 on success, -1 on failure * Programmer: XIANGYANG SU @@ -835,29 +835,29 @@ nh5tset_inpad_c ( hid_t_f *type_id, int_f * padtype) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_cset_c ( hid_t_f *type_id , int_f * cset) { int ret_value = -1; hid_t c_type_id; - H5T_cset_t c_cset; + H5T_cset_t c_cset; c_type_id = *type_id; c_cset = H5Tget_cset(c_type_id); if ( c_cset == H5T_CSET_ERROR ) return ret_value; *cset = (int_f) c_cset; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tset_cset_c - * Inputs: type_id - identifier of the dataspace + * Inputs: type_id - identifier of the dataspace * Purpose: Call H5Tset_cset to set character set * type of a string datatype - * - * Inputs: type_id - identifier of the dataspace + * + * Inputs: type_id - identifier of the dataspace * cset - character set type of a string datatype * Returns: 0 on success, -1 on failure * Programmer: XIANGYANG SU @@ -865,20 +865,20 @@ nh5tget_cset_c ( hid_t_f *type_id , int_f * cset) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tset_cset_c ( hid_t_f *type_id, int_f * cset) { int ret_value = -1; hid_t c_type_id; herr_t status; - H5T_cset_t c_cset; + H5T_cset_t c_cset; c_type_id = *type_id; c_cset = (H5T_cset_t)*cset; status = H5Tset_cset(c_type_id, c_cset); if ( status < 0 ) return ret_value; - ret_value = 0; + ret_value = 0; return ret_value; } @@ -886,7 +886,7 @@ nh5tset_cset_c ( hid_t_f *type_id, int_f * cset) * Name: h5tget_strpad_c * Purpose: Call H5Tget_strpad to get string padding method * for a string datatype - * Inputs: type_id - identifier of the dataspace + * Inputs: type_id - identifier of the dataspace * Outputs: strpad - string padding method for a string datatype * Returns: 0 on success, -1 on failure * Programmer: XIANGYANG SU @@ -894,29 +894,29 @@ nh5tset_cset_c ( hid_t_f *type_id, int_f * cset) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_strpad_c ( hid_t_f *type_id , int_f * strpad) { int ret_value = -1; hid_t c_type_id; - H5T_str_t c_strpad; + H5T_str_t c_strpad; c_type_id = *type_id; c_strpad = H5Tget_strpad(c_type_id); if ( c_strpad == H5T_STR_ERROR ) return ret_value; *strpad = (int_f) c_strpad; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tset_strpad_c - * Inputs: type_id - identifier of the dataspace + * Inputs: type_id - identifier of the dataspace * Purpose: Call H5Tset_strpad to set string padding method * for a string datatype - * - * Inputs: type_id - identifier of the dataspace + * + * Inputs: type_id - identifier of the dataspace * strpad - string padding method for a string datatype * Returns: 0 on success, -1 on failure * Programmer: XIANGYANG SU @@ -924,28 +924,28 @@ nh5tget_strpad_c ( hid_t_f *type_id , int_f * strpad) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tset_strpad_c ( hid_t_f *type_id, int_f * strpad) { int ret_value = -1; hid_t c_type_id; herr_t status; - H5T_str_t c_strpad; + H5T_str_t c_strpad; c_type_id = *type_id; c_strpad = (H5T_str_t)*strpad; status = H5Tset_strpad(c_type_id, c_strpad); if ( status < 0 ) return ret_value; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tget_nmembers_c - * Purpose: Call H5Tget_nmembers to get number of fields + * Purpose: Call H5Tget_nmembers to get number of fields * in a compound datatype - * Inputs: type_id - identifier of the dataspace + * Inputs: type_id - identifier of the dataspace * Outputs: num_members - number of fields in a compound datatype * Returns: 0 on success, -1 on failure * Programmer: XIANGYANG SU @@ -953,7 +953,7 @@ nh5tset_strpad_c ( hid_t_f *type_id, int_f * strpad) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_nmembers_c ( hid_t_f *type_id , int_f * num_members) { int ret_value = -1; @@ -963,16 +963,16 @@ nh5tget_nmembers_c ( hid_t_f *type_id , int_f * num_members) *num_members = (int_f)H5Tget_nmembers(c_type_id); if (*num_members < 0 ) return ret_value; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tget_member_name_c - * Purpose: Call H5Tget_member_name to get name + * Purpose: Call H5Tget_member_name to get name * of a compound datatype - * Inputs: type_id - identifier of the dataspace - * Outputs: member_name - name of a field of a compound datatype + * Inputs: type_id - identifier of the dataspace + * Outputs: member_name - name of a field of a compound datatype * Returns: 0 on success, -1 on failure * Programmer: XIANGYANG SU * Thursday, February 3, 2000 @@ -980,7 +980,7 @@ nh5tget_nmembers_c ( hid_t_f *type_id , int_f * num_members) * Added namelen parameter to return length of the name to Fortran user *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_member_name_c ( hid_t_f *type_id ,int_f* idx, _fcd member_name, int_f *namelen) { int ret_value = -1; @@ -993,18 +993,18 @@ nh5tget_member_name_c ( hid_t_f *type_id ,int_f* idx, _fcd member_name, int_f *n c_name = H5Tget_member_name(c_type_id, c_index); if (c_name == NULL ) return ret_value; - HD5packFstring(c_name, _fcdtocp(member_name), (int)strlen(c_name)); + HD5packFstring(c_name, _fcdtocp(member_name), (int)strlen(c_name)); *namelen = (int_f)strlen(c_name); HDfree(c_name); - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tget_member_index_c * Purpose: Call H5Tget_member_index to get an index of * the specified datatype filed or member. - * Inputs: type_id - datatype identifier - * name - name of the datatype within file or group + * Inputs: type_id - datatype identifier + * name - name of the datatype within file or group * namelen - name length * Outputs: index - 0-based index * Returns: 0 on success, -1 on failure @@ -1025,7 +1025,7 @@ nh5tget_member_index_c (hid_t_f *type_id, _fcd name, int_f *namelen, int_f *idx) * Convert FORTRAN name to C name */ c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; /* @@ -1040,25 +1040,25 @@ DONE: HDfree(c_name); ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5tget_member_offset_c * Purpose: Call H5Tget_member_offset to get byte offset of the - * beginning of a field within a compound datatype with + * beginning of a field within a compound datatype with * respect to the beginning of the compound data type datum - * Inputs: type_id - identifier of the dataspace + * Inputs: type_id - identifier of the dataspace * member_no - Number of the field whose offset is requested * Outputs: offset - byte offset of the the beginning of the field of - * a compound datatype + * a compound datatype * Returns: always 0 * Programmer: XIANGYANG SU * Thursday, February 3, 2000 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_member_offset_c ( hid_t_f *type_id ,int_f* member_no, size_t_f * offset) { int ret_value = -1; @@ -1070,23 +1070,23 @@ nh5tget_member_offset_c ( hid_t_f *type_id ,int_f* member_no, size_t_f * offset) c_member_no = *member_no; c_offset = H5Tget_member_offset(c_type_id, c_member_no); *offset = (size_t_f)c_offset; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tget_array_dims_c - * Purpose: Call H5Tget_array_dims to get + * Purpose: Call H5Tget_array_dims to get * dimensions of array datatype * Inputs: type_id - identifier of the array datatype * Outputs: dims - dimensions(sizes of dimensions) of the array * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Thursday, November 16, 2000 - * Modifications: + * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_array_dims_c ( hid_t_f *type_id , hsize_t_f * dims) { int ret_value = -1; @@ -1112,7 +1112,7 @@ nh5tget_array_dims_c ( hid_t_f *type_id , hsize_t_f * dims) dims[rank-i-1] = (hsize_t_f)c_dims[i]; } - ret_value = 0; + ret_value = 0; HDfree(c_dims); return ret_value; @@ -1120,17 +1120,17 @@ nh5tget_array_dims_c ( hid_t_f *type_id , hsize_t_f * dims) /*---------------------------------------------------------------------------- * Name: h5tget_array_ndims_c - * Purpose: Call H5Tget_array_ndims to get number + * Purpose: Call H5Tget_array_ndims to get number * of dimensions of array datatype * Inputs: type_id - identifier of the array datatype * Outputs: ndims - number of dimensions of the array * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Thursday, November 16, 2000 - * Modifications: + * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_array_ndims_c ( hid_t_f *type_id , int_f * ndims) { int ret_value = -1; @@ -1142,23 +1142,23 @@ nh5tget_array_ndims_c ( hid_t_f *type_id , int_f * ndims) if (c_ndims < 0) return ret_value; *ndims = (int_f)c_ndims; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tget_super_c - * Purpose: Call H5Tget_super to get base datatype from which - * datatype was derived + * Purpose: Call H5Tget_super to get base datatype from which + * datatype was derived * Inputs: type_id - identifier of the array datatype - * Outputs: base_type_id - base datatype identifier + * Outputs: base_type_id - base datatype identifier * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Thursday, November 16, 2000 - * Modifications: + * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_super_c ( hid_t_f *type_id , hid_t_f *base_type_id) { int ret_value = -1; @@ -1170,7 +1170,7 @@ nh5tget_super_c ( hid_t_f *type_id , hid_t_f *base_type_id) if (c_base_type_id < 0) return ret_value; *base_type_id = (hid_t_f)c_base_type_id; - ret_value = 0; + ret_value = 0; return ret_value; } @@ -1179,7 +1179,7 @@ nh5tget_super_c ( hid_t_f *type_id , hid_t_f *base_type_id) * Name: h5tget_member_type_c * Purpose: Call H5Tget_member_type to get the identifier of a copy of * the datatype of the field - * Inputs: type_id - identifier of the datatype + * Inputs: type_id - identifier of the datatype * field_idx - Field index (0-based) of the field type to retrieve * Outputs: datatype - identifier of a copy of the datatype of the field * Returns: 0 on success, -1 on failure @@ -1188,7 +1188,7 @@ nh5tget_super_c ( hid_t_f *type_id , hid_t_f *base_type_id) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_member_type_c ( hid_t_f *type_id ,int_f* field_idx, hid_t_f * datatype) { int ret_value = -1; @@ -1200,23 +1200,23 @@ nh5tget_member_type_c ( hid_t_f *type_id ,int_f* field_idx, hid_t_f * datatype) *datatype = (hid_t_f)H5Tget_member_type(c_type_id, c_field_idx); if(*datatype < 0) return ret_value; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tcreate_c - * Purpose: Call H5Tcreate to create a datatype - * Inputs: class - class type - * size - size of the class memeber + * Purpose: Call H5Tcreate to create a datatype + * Inputs: class - class type + * size - size of the class memeber * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * Programmer: Elena Pourmal * Thursday, February 17, 2000 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tcreate_c(int_f *class, size_t_f *size, hid_t_f *type_id) { int ret_value = -1; @@ -1229,14 +1229,14 @@ nh5tcreate_c(int_f *class, size_t_f *size, hid_t_f *type_id) *type_id = (hid_t_f)H5Tcreate(c_class, c_size); if(*type_id < 0) return ret_value; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tinsert_c * Purpose: Call H5Tinsert to adds another member to the compound datatype - * Inputs: type_id - identifier of the datatype + * Inputs: type_id - identifier of the datatype * name - Name of the field to insert * namelen - length of the name * offset - Offset in memory structure of the field to insert @@ -1247,7 +1247,7 @@ nh5tcreate_c(int_f *class, size_t_f *size, hid_t_f *type_id) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tinsert_c(hid_t_f *type_id, _fcd name, int_f* namelen, size_t_f *offset, hid_t_f * field_id) { int ret_value = -1; @@ -1260,7 +1260,7 @@ nh5tinsert_c(hid_t_f *type_id, _fcd name, int_f* namelen, size_t_f *offset, hid_ c_offset =(size_t) *offset; c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; c_type_id = *type_id; @@ -1268,17 +1268,17 @@ nh5tinsert_c(hid_t_f *type_id, _fcd name, int_f* namelen, size_t_f *offset, hid_ error = H5Tinsert(c_type_id, c_name, c_offset, c_field_id); HDfree(c_name); if(error < 0) return ret_value; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tpack_c - * Purpose: Call H5Tpack tor ecursively remove padding from - * within a compound datatype to make it more efficient + * Purpose: Call H5Tpack tor ecursively remove padding from + * within a compound datatype to make it more efficient * (space-wise) to store that data - * Inputs: type_id - identifier of the datatype + * Inputs: type_id - identifier of the datatype * Returns: 0 on success, -1 on failure * Programmer: XIANGYANG SU * Thursday, February 3, 2000 @@ -1298,7 +1298,7 @@ nh5tpack_c(hid_t_f * type_id) ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5tarray_create_c @@ -1308,9 +1308,9 @@ nh5tpack_c(hid_t_f * type_id) * dims - Size of new member array * type_id - identifier of the array datatype * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * Programmer: Elena Pourmal * Thursday, November 16, 2000 - * Modifications: + * Modifications: *---------------------------------------------------------------------------*/ int_f nh5tarray_create_c(hid_t_f * base_id, int_f *rank, hsize_t_f* dims, hid_t_f* type_id) @@ -1332,7 +1332,7 @@ nh5tarray_create_c(hid_t_f * base_id, int_f *rank, hsize_t_f* dims, hid_t_f* typ for (i = 0; i < *rank ; i++) { c_dims[i] = (hsize_t)dims[*rank - i - 1]; } - + c_base_id = (hid_t)*base_id; c_rank = (int)*rank; c_type_id = H5Tarray_create(c_base_id, c_rank, c_dims, NULL); @@ -1353,8 +1353,8 @@ nh5tarray_create_c(hid_t_f * base_id, int_f *rank, hsize_t_f* dims, hid_t_f* typ /*---------------------------------------------------------------------------- * Name: h5tenum_create_c * Purpose: Call H5Tenum_create to create a new enumeration datatype - * Inputs: parent_id - Datatype identifier for the base datatype - * Outputs: new_type_id - datatype identifier for the new + * Inputs: parent_id - Datatype identifier for the base datatype + * Outputs: new_type_id - datatype identifier for the new * enumeration datatype * Returns: 0 on success, -1 on failure * Programmer: Xiangyang Su @@ -1362,7 +1362,7 @@ nh5tarray_create_c(hid_t_f * base_id, int_f *rank, hsize_t_f* dims, hid_t_f* typ * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tenum_create_c ( hid_t_f *parent_id , hid_t_f *new_type_id) { int ret_value = 0; @@ -1370,7 +1370,7 @@ nh5tenum_create_c ( hid_t_f *parent_id , hid_t_f *new_type_id) hid_t c_new_type_id; c_parent_id = *parent_id; - c_new_type_id = H5Tenum_create(c_parent_id); + c_new_type_id = H5Tenum_create(c_parent_id); if ( c_new_type_id < 0 ) ret_value = -1; *new_type_id = (hid_t_f)c_new_type_id; @@ -1380,7 +1380,7 @@ nh5tenum_create_c ( hid_t_f *parent_id , hid_t_f *new_type_id) /*---------------------------------------------------------------------------- * Name: h5tenum_insert_c * Purpose: Call H5Tenum_insert to insert a new enumeration datatype member. - * Inputs: type_id - identifier of the datatype + * Inputs: type_id - identifier of the datatype * name - Name of the new member * namelen - length of the name * value - value of the new member @@ -1390,7 +1390,7 @@ nh5tenum_create_c ( hid_t_f *parent_id , hid_t_f *new_type_id) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tenum_insert_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) { int ret_value = -1; @@ -1401,16 +1401,16 @@ nh5tenum_insert_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) herr_t error; c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; - + c_type_id = (hid_t)*type_id; c_value = (int)*value; error = H5Tenum_insert(c_type_id, c_name, &c_value); HDfree(c_name); if(error < 0) return ret_value; - ret_value = 0; + ret_value = 0; return ret_value; } @@ -1419,7 +1419,7 @@ nh5tenum_insert_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) * Name: h5tenum_nameof_c * Purpose: Call H5Tenum_nameof to find the symbol name that corresponds to * the specified value of the enumeration datatype type - * Inputs: type_id - identifier of the datatype + * Inputs: type_id - identifier of the datatype * namelen - length of the name * value - value of the enumeration datatype * Output: name - Name of the enumeration datatype @@ -1429,7 +1429,7 @@ nh5tenum_insert_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tenum_nameof_c(hid_t_f *type_id, int_f* value, _fcd name, size_t_f* namelen) { int ret_value = -1; @@ -1443,11 +1443,11 @@ nh5tenum_nameof_c(hid_t_f *type_id, int_f* value, _fcd name, size_t_f* namelen) c_name = (char *)malloc(sizeof(char)*c_namelen); c_type_id = *type_id; error = H5Tenum_nameof(c_type_id, &c_value, c_name, c_namelen); - HD5packFstring(c_name, _fcdtocp(name), (int)strlen(c_name)); + HD5packFstring(c_name, _fcdtocp(name), (int)strlen(c_name)); HDfree(c_name); if(error < 0) return ret_value; - ret_value = 0; + ret_value = 0; return ret_value; } @@ -1455,9 +1455,9 @@ nh5tenum_nameof_c(hid_t_f *type_id, int_f* value, _fcd name, size_t_f* namelen) * Name: h5tenum_valueof_c * Purpose: Call H5Tenum_valueof to find the value of that corresponds to * the specified name of the enumeration datatype type - * Inputs: type_id - identifier of the datatype + * Inputs: type_id - identifier of the datatype * name - Name of the enumeration datatype - * namelen - length of name + * namelen - length of name * Output: value - value of the enumeration datatype * Returns: 0 on success, -1 on failure * Programmer: XIANGYANG SU @@ -1465,7 +1465,7 @@ nh5tenum_nameof_c(hid_t_f *type_id, int_f* value, _fcd name, size_t_f* namelen) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tenum_valueof_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) { int ret_value = -1; @@ -1475,7 +1475,7 @@ nh5tenum_valueof_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) int c_value; herr_t error; c_namelen = *namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return ret_value; c_type_id = *type_id; @@ -1483,16 +1483,16 @@ nh5tenum_valueof_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) HDfree(c_name); if(error < 0) return ret_value; *value = (int_f)c_value; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tget_member_value_c - * Purpose: Call H5Tget_member_value to get the value of an + * Purpose: Call H5Tget_member_value to get the value of an * enumeration datatype member - * Inputs: type_id - identifier of the datatype + * Inputs: type_id - identifier of the datatype * member_no - Number of the enumeration datatype member. * Output: value - value of the enumeration datatype * Returns: 0 on success, -1 on failure @@ -1501,7 +1501,7 @@ nh5tenum_valueof_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_member_value_c(hid_t_f *type_id, int_f* member_no, int_f* value) { int ret_value = -1; @@ -1516,16 +1516,16 @@ nh5tget_member_value_c(hid_t_f *type_id, int_f* member_no, int_f* value) if(error < 0) return ret_value; *value = (int_f)c_value; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tset_tag_c - * Inputs: type_id - identifier of the dataspace + * Inputs: type_id - identifier of the dataspace * Purpose: Call H5Tset_tag to set an opaque datatype tag - * Inputs: type_id - identifier of the dataspace - * tag - Unique ASCII string with which the opaque + * Inputs: type_id - identifier of the dataspace + * tag - Unique ASCII string with which the opaque * datatype is to be tagged * namelen - length of tag * Returns: 0 on success, -1 on failure @@ -1542,23 +1542,23 @@ nh5tset_tag_c(hid_t_f* type_id, _fcd tag, int_f* namelen) char* c_tag; int c_namelen; - c_namelen = *namelen; - c_tag = (char *)HD5f2cstring(tag, c_namelen); + c_namelen = *namelen; + c_tag = (char *)HD5f2cstring(tag, c_namelen); c_type_id = *type_id; status = H5Tset_tag(c_type_id, c_tag); HDfree(c_tag); if ( status < 0 ) return ret_value; - ret_value = 0; + ret_value = 0; return ret_value; -} +} /*---------------------------------------------------------------------------- * Name: h5tget_tag_c * Purpose: Call H5Tset_tag to set an opaque datatype tag * Inputs: type_id - identifier of the datatype - * Outputs: tag - Unique ASCII string with which the opaque + * Outputs: tag - Unique ASCII string with which the opaque * datatype is to be tagged * taglen - length of tag * Returns: 0 on success, -1 on failure @@ -1577,10 +1577,10 @@ nh5tget_tag_c(hid_t_f* type_id, _fcd tag, int_f* taglen) c_tag = H5Tget_tag(c_type_id); if (c_tag == NULL ) return ret_value; - HD5packFstring(c_tag, _fcdtocp(tag), (int)strlen(c_tag)); + HD5packFstring(c_tag, _fcdtocp(tag), (int)strlen(c_tag)); *taglen = (int_f)HDstrlen(c_tag); HDfree(c_tag); - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- @@ -1604,14 +1604,14 @@ nh5tvlen_create_c(hid_t_f* type_id, hid_t_f *vltype_id) c_vltype_id = H5Tvlen_create(c_type_id); if (c_vltype_id < 0 ) return ret_value; *vltype_id = (hid_t_f)c_vltype_id; - ret_value = 0; + ret_value = 0; return ret_value; } /*---------------------------------------------------------------------------- * Name: h5tis_variable_str_c * Purpose: Call H5Tis_variable_str to detrmine if the datatype * is a variable string. - * Inputs: type_id - identifier of the dataspace + * Inputs: type_id - identifier of the dataspace * Outputs: flag - 0 if not VL str, 1 if is not * and negative on failure. * Returns: 0 on success, -1 on failure @@ -1620,7 +1620,7 @@ nh5tvlen_create_c(hid_t_f* type_id, hid_t_f *vltype_id) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag ) { int ret_value = 0; @@ -1638,7 +1638,7 @@ nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag ) * Name: h5tget_member_class_c * Purpose: Call H5Tget_member_class to detrmine ithe class of the compound * datatype member - * Inputs: type_id - identifier of the dataspace + * Inputs: type_id - identifier of the dataspace * member_no - member's index * Outputs: class - member's class * and negative on failure. @@ -1648,7 +1648,7 @@ nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag ) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, int_f *class ) { int ret_value = 0; diff --git a/fortran/src/H5Zf.c b/fortran/src/H5Zf.c index 8c2b6b6..6436de5 100644 --- a/fortran/src/H5Zf.c +++ b/fortran/src/H5Zf.c @@ -54,7 +54,7 @@ nh5zunregister_c (int_f *filter) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5zfilter_avail_c ( int_f *filter , int_f *flag ) { int ret_value = 0; @@ -80,7 +80,7 @@ nh5zfilter_avail_c ( int_f *filter , int_f *flag ) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5zget_filter_info_c ( int_f *filter , int_f *flag ) { int ret_value = 0; diff --git a/fortran/src/H5_f.c b/fortran/src/H5_f.c index e648627..241b344 100644 --- a/fortran/src/H5_f.c +++ b/fortran/src/H5_f.c @@ -19,21 +19,21 @@ /*--------------------------------------------------------------------------- * Name: h5init_types_c * Purpose: Initialize predefined datatypes in Fortran - * Inputs: types - array with the predefined Native Fortran + * Inputs: types - array with the predefined Native Fortran * type, its element and length must be the - * same as the types array defined in the + * same as the types array defined in the * H5f90global.f90 - * floatingtypes - array with the predefined Floating Fortran + * floatingtypes - array with the predefined Floating Fortran * type, its element and length must be the - * same as the floatingtypes array defined in the + * same as the floatingtypes array defined in the * H5f90global.f90 - * integertypes - array with the predefined Integer Fortran + * integertypes - array with the predefined Integer Fortran * type, its element and length must be the - * same as the integertypes array defined in the + * same as the integertypes array defined in the * H5f90global.f90 - * Outputs: None + * Outputs: None * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * Programmer: Elena Pourmal * Tuesday, August 3, 1999 * Modifications: *---------------------------------------------------------------------------*/ @@ -95,49 +95,49 @@ nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertype if ((integertypes[13] = (hid_t_f)H5Tcopy(H5T_STD_U32LE)) < 0) return ret_value; if ((integertypes[14] = (hid_t_f)H5Tcopy(H5T_STD_U64BE)) < 0) return ret_value; if ((integertypes[15] = (hid_t_f)H5Tcopy(H5T_STD_U64LE)) < 0) return ret_value; -/* - * Define Fortran H5T_STRING type to store non-fixed size strings +/* + * Define Fortran H5T_STRING type to store non-fixed size strings */ if ((c_type_id = H5Tcopy(H5T_C_S1)) < 0) return ret_value; - if(H5Tset_size(c_type_id, H5T_VARIABLE) < 0) return ret_value; + if(H5Tset_size(c_type_id, H5T_VARIABLE) < 0) return ret_value; integertypes[16] = c_type_id; - ret_value = 0; + ret_value = 0; return ret_value; } - + /*--------------------------------------------------------------------------- * Name: h5close_types_c * Purpose: Closes predefined datatype in Fortran - * Inputs: types - array with the predefined Native Fortran + * Inputs: types - array with the predefined Native Fortran * type, its element and length must be the - * same as the types array defined in the + * same as the types array defined in the * H5f90global.f90 * lentypes - length of the types array, which must be the - * same as the length of types array defined + * same as the length of types array defined * in the H5f90global.f90 - * floatingtypes - array with the predefined Floating Fortran + * floatingtypes - array with the predefined Floating Fortran * type, its element and length must be the - * same as the floatingtypes array defined in the + * same as the floatingtypes array defined in the * H5f90global.f90 * floatinglen - length of the floatingtypes array, which must be the - * same as the length of floatingtypes array defined + * same as the length of floatingtypes array defined * in the H5f90global.f90 - * integertypes - array with the predefined Integer Fortran + * integertypes - array with the predefined Integer Fortran * type, its element and length must be the - * same as the integertypes array defined in the + * same as the integertypes array defined in the * H5f90global.f90 * integerlen - length of the floatingtypes array, which must be the - * same as the length of floatingtypes array defined + * same as the length of floatingtypes array defined * in the H5f90global.f90 - * Outputs: None + * Outputs: None * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * Programmer: Elena Pourmal * Tuesday, August 3, 1999 * Modifications: *---------------------------------------------------------------------------*/ int_f -nh5close_types_c( hid_t_f * types, int_f *lentypes, +nh5close_types_c( hid_t_f * types, int_f *lentypes, hid_t_f * floatingtypes, int_f* floatinglen, hid_t_f * integertypes, int_f * integerlen ) { @@ -158,13 +158,13 @@ nh5close_types_c( hid_t_f * types, int_f *lentypes, c_type_id = integertypes[i]; if ( H5Tclose(c_type_id) < 0) return ret_value; } - ret_value = 0; + ret_value = 0; return ret_value; -} +} /*--------------------------------------------------------------------------- * Name: h5init_flags_c * Purpose: Initialize Fortran flags - * Inputs: h5d_flags - H5D inteface flags + * Inputs: h5d_flags - H5D inteface flags * h5e_flags - H5E interface flags * h5f_flags - H5F interface flags * h5fd_flags - H5FD interface flags @@ -176,9 +176,9 @@ nh5close_types_c( hid_t_f * types, int_f *lentypes, * h5s_flags - H5S interface flags * h5t_flags - H5T interface flags * h5z_flags - H5Z interface flags - * Outputs: None + * Outputs: None * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * Programmer: Elena Pourmal * Tuesday, August 3, 1999 * Modifications: Added Z flags. EIP, March 12, 2003 * Added more FD flags and new H5LIB flags @@ -219,7 +219,7 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5e_flags, int_f *h5f_flags, /* * H5E flags */ - + h5e_flags[0] = H5E_NONE_MAJOR; h5e_flags[1] = H5E_ARGS; h5e_flags[2] = H5E_RESOURCE; @@ -244,11 +244,11 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5e_flags, int_f *h5f_flags, h5e_flags[21] = H5E_REFERENCE; h5e_flags[22] = H5E_VFL; h5e_flags[23] = H5E_TBBT; - + /* * H5F flags */ - h5f_flags[0] = (int_f)H5F_ACC_RDWR; + h5f_flags[0] = (int_f)H5F_ACC_RDWR; h5f_flags[1] = (int_f)H5F_ACC_RDONLY; h5f_flags[2] = (int_f)H5F_ACC_TRUNC; h5f_flags[3] = (int_f)H5F_ACC_EXCL; @@ -277,7 +277,7 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5e_flags, int_f *h5f_flags, h5fd_flags[6] = H5FD_MEM_DRAW; h5fd_flags[7] = H5FD_MEM_GHEAP; h5fd_flags[8] = H5FD_MEM_LHEAP; - h5fd_flags[9] = H5FD_MEM_OHDR; + h5fd_flags[9] = H5FD_MEM_OHDR; h5fd_flags[10] = H5FD_MEM_NTYPES; @@ -322,8 +322,8 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5e_flags, int_f *h5f_flags, * H5P flags */ - h5p_flags[0] = H5P_FILE_CREATE; - h5p_flags[1] = H5P_FILE_ACCESS; + h5p_flags[0] = H5P_FILE_CREATE; + h5p_flags[1] = H5P_FILE_ACCESS; h5p_flags[2] = H5P_DATASET_CREATE; h5p_flags[3] = H5P_DATASET_XFER; h5p_flags[4] = H5P_MOUNT; @@ -342,8 +342,8 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5e_flags, int_f *h5f_flags, */ - h5s_flags[0] = H5S_SCALAR; - h5s_flags[1] = H5S_SIMPLE; + h5s_flags[0] = H5S_SCALAR; + h5s_flags[1] = H5S_SIMPLE; h5s_flags[2] = H5S_SELECT_SET; h5s_flags[3] = H5S_SELECT_OR; h5s_flags[4] = (int_f)H5S_UNLIMITED; @@ -370,29 +370,29 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5e_flags, int_f *h5f_flags, */ - h5t_flags[0] = H5T_NO_CLASS; - h5t_flags[1] = H5T_INTEGER; - h5t_flags[2] = H5T_FLOAT; - h5t_flags[3] = H5T_TIME; - h5t_flags[4] = H5T_STRING; + h5t_flags[0] = H5T_NO_CLASS; + h5t_flags[1] = H5T_INTEGER; + h5t_flags[2] = H5T_FLOAT; + h5t_flags[3] = H5T_TIME; + h5t_flags[4] = H5T_STRING; h5t_flags[5] = H5T_BITFIELD; h5t_flags[6] = H5T_OPAQUE; - h5t_flags[7] = H5T_COMPOUND; + h5t_flags[7] = H5T_COMPOUND; h5t_flags[8] = H5T_REFERENCE; - h5t_flags[9] = H5T_ENUM; - h5t_flags[10] = H5T_ORDER_LE; + h5t_flags[9] = H5T_ENUM; + h5t_flags[10] = H5T_ORDER_LE; h5t_flags[11] = H5T_ORDER_BE; h5t_flags[12] = H5T_ORDER_VAX; h5t_flags[13] = H5T_PAD_ZERO; h5t_flags[14] = H5T_PAD_ONE; h5t_flags[15] = H5T_PAD_BACKGROUND; - h5t_flags[16] = H5T_PAD_ERROR; - h5t_flags[17] = H5T_SGN_NONE; - h5t_flags[18] = H5T_SGN_2; + h5t_flags[16] = H5T_PAD_ERROR; + h5t_flags[17] = H5T_SGN_NONE; + h5t_flags[18] = H5T_SGN_2; h5t_flags[19] = H5T_SGN_ERROR; h5t_flags[20] = H5T_NORM_IMPLIED; h5t_flags[21] = H5T_NORM_MSBSET; - h5t_flags[22] = H5T_NORM_NONE; + h5t_flags[22] = H5T_NORM_NONE; h5t_flags[23] = H5T_CSET_ASCII; h5t_flags[24] = H5T_STR_NULLTERM; h5t_flags[25] = H5T_STR_NULLPAD; @@ -419,7 +419,7 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5e_flags, int_f *h5f_flags, h5z_flags[12] = H5Z_FILTER_CONFIG_DECODE_ENABLED; h5z_flags[13] = H5Z_FILTER_ALL; - ret_value = 0; + ret_value = 0; return ret_value; } @@ -431,7 +431,7 @@ nh5init1_flags_c(int_f *h5lib_flags) unsigned prm_2 = H5_SZIP_NN_OPTION_MASK; h5lib_flags[0] = (int_f)prm_1; h5lib_flags[1] = (int_f)prm_2; - ret_value = 0; + ret_value = 0; return ret_value; } @@ -439,8 +439,8 @@ nh5init1_flags_c(int_f *h5lib_flags) * Name: h5open_c * Purpose: Calls H5open call to initialize C HDF5 library * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Friday, November 17, 2000 + * Programmer: Elena Pourmal + * Friday, November 17, 2000 * Modifications: *---------------------------------------------------------------------------*/ int_f @@ -448,16 +448,16 @@ nh5open_c() { int ret_value = -1; - if (H5open() < 0) return ret_value; - ret_value = 0; + if (H5open() < 0) return ret_value; + ret_value = 0; return ret_value; -} +} /*--------------------------------------------------------------------------- * Name: h5close_c * Purpose: Calls H5close call to close C HDF5 library * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal - * Friday, November 17, 2000 + * Programmer: Elena Pourmal + * Friday, November 17, 2000 * Modifications: *---------------------------------------------------------------------------*/ int_f @@ -465,24 +465,24 @@ nh5close_c() { int ret_value = -1; - if (H5close() < 0) return ret_value; - ret_value = 0; + if (H5close() < 0) return ret_value; + ret_value = 0; return ret_value; -} +} /*--------------------------------------------------------------------------- * Name: h5get_libversion_c * Purpose: Calls H5get_libversion function - * to retrieve library version info. - * Inputs: + * to retrieve library version info. + * Inputs: * None - * Outputs: + * Outputs: * majnum - the major version of the library * minnum - the minor version of the library * relnum - the release version of the library * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * Programmer: Elena Pourmal * Tuesday, September 24, 2002 * Modifications: *---------------------------------------------------------------------------*/ @@ -491,30 +491,30 @@ nh5get_libversion_c( int_f *majnum, int_f *minnum, int_f *relnum) { int ret_value = -1; - unsigned c_majnum, c_minnum, c_relnum; + unsigned c_majnum, c_minnum, c_relnum; if (H5get_libversion(&c_majnum, &c_minnum, &c_relnum) < 0) return ret_value; *majnum = (int_f)c_majnum; *minnum = (int_f)c_minnum; *relnum = (int_f)c_relnum; - ret_value = 0; + ret_value = 0; return ret_value; -} +} /*--------------------------------------------------------------------------- * Name: h5check_version_c * Purpose: Calls H5check_version function - * to verify library version info. - * Inputs: + * to verify library version info. + * Inputs: * majnum - the major version of the library * minnum - the minor version of the library * relnum - the release version of the library - * Outputs: + * Outputs: * None * Returns: 0 on success, aborts on failure - * Programmer: Elena Pourmal + * Programmer: Elena Pourmal * Tuesday, September 24, 2002 * Modifications: *---------------------------------------------------------------------------*/ @@ -523,22 +523,22 @@ nh5check_version_c( int_f *majnum, int_f *minnum, int_f *relnum) { int ret_value = -1; - unsigned c_majnum, c_minnum, c_relnum; + unsigned c_majnum, c_minnum, c_relnum; c_majnum = (unsigned) *majnum; c_minnum = (unsigned) *minnum; c_relnum = (unsigned) *relnum; H5check_version(c_majnum, c_minnum, c_relnum); - ret_value = 0; + ret_value = 0; return ret_value; -} +} /*--------------------------------------------------------------------------- * Name: h5garbage_collect_c * Purpose: Calls H5garbage_collect to collect on all free-lists of all types * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * Programmer: Elena Pourmal * Tuesday, September 24, 2002 * Modifications: *---------------------------------------------------------------------------*/ @@ -547,16 +547,16 @@ nh5garbage_collect_c() { int ret_value = -1; - if (H5garbage_collect() < 0) return ret_value; - ret_value = 0; + if (H5garbage_collect() < 0) return ret_value; + ret_value = 0; return ret_value; -} +} /*--------------------------------------------------------------------------- * Name: h5dont_atexit_c * Purpose: Calls H5dont_atexit not to install atexit cleanup routine * Returns: 0 on success, -1 on failure - * Programmer: Elena Pourmal + * Programmer: Elena Pourmal * Tuesday, September 24, 2002 * Modifications: *---------------------------------------------------------------------------*/ @@ -565,7 +565,7 @@ nh5dont_atexit_c() { int ret_value = -1; - if (H5dont_atexit() < 0) return ret_value; - ret_value = 0; + if (H5dont_atexit() < 0) return ret_value; + ret_value = 0; return ret_value; -} +} diff --git a/fortran/src/H5f90.h b/fortran/src/H5f90.h index a56cb0c..ad2e9d3 100644 --- a/fortran/src/H5f90.h +++ b/fortran/src/H5f90.h @@ -14,7 +14,7 @@ #ifndef _H5f90_H -#define _H5f90_H +#define _H5f90_H #include "hdf5.h" #include "H5f90i.h" diff --git a/fortran/src/H5f90i.h b/fortran/src/H5f90i.h index a6cb26b..9d9460f 100644 --- a/fortran/src/H5f90i.h +++ b/fortran/src/H5f90i.h @@ -16,8 +16,8 @@ #ifndef _H5f90i_H #define _H5f90i_H -/* - * Standard header files needed all the time +/* + * Standard header files needed all the time */ #include "H5private.h" @@ -34,7 +34,7 @@ typedef long size_t_f; typedef long int_f; typedef long hid_t_f; typedef double real_f; -#define DF_CAPFNAMES +#define DF_CAPFNAMES /*#define _fcdtocp(desc) (desc)*/ #endif /* UNICOS */ @@ -62,7 +62,7 @@ typedef int size_t_f; typedef int int_f; typedef int hid_t_f; typedef float real_f; -#define FNAME(x) x +#define FNAME(x) x #if defined H5_ABSOFT #define DF_CAPFNAMES #endif /*H5_ABSOFT*/ diff --git a/fortran/src/H5f90kit.c b/fortran/src/H5f90kit.c index a25645b..2cd9f7c 100644 --- a/fortran/src/H5f90kit.c +++ b/fortran/src/H5f90kit.c @@ -14,7 +14,7 @@ #include -#include +#include #include "H5f90.h" diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h index ba64057..98eddc6 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -349,14 +349,14 @@ H5_FCDLL int_f nh5awrite_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, v H5_FCDLL int_f nh5areadc_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims); H5_FCDLL int_f nh5aread_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims); H5_FCDLL int_f nh5aclose_c ( hid_t_f *attr_id ); -H5_FCDLL int_f nh5adelete_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen); +H5_FCDLL int_f nh5adelete_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen); H5_FCDLL int_f nh5aopen_idx_c (hid_t_f *obj_id, int_f *idx, hid_t_f *attr_id); H5_FCDLL int_f nh5aget_space_c (hid_t_f *attr_id, hid_t_f *space_id); H5_FCDLL int_f nh5aget_type_c (hid_t_f *attr_id, hid_t_f *type_id); H5_FCDLL int_f nh5aget_num_attrs_c (hid_t_f *obj_id, int_f *attr_num); H5_FCDLL int_f nh5aget_name_c(hid_t_f *attr_id, size_t_f *size, _fcd buf); -/* +/* * Functions form H5Tf.c file */ #ifndef H5Tf90_FNAMES @@ -535,7 +535,7 @@ H5_FCDLL int_f nh5tvlen_create_c ( hid_t_f *type_id , hid_t_f *vltype_id); H5_FCDLL int_f nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag ); H5_FCDLL int_f nh5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, int_f *class ); -/* +/* * Functions from H5Pf.c */ #ifndef H5Pf90_FNAMES @@ -642,7 +642,7 @@ H5_FCDLL int_f nh5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, in # define nh5pset_fletcher32_c FNAME(H5PSET_FLETCHER32_C) # define nh5pset_edc_check_c FNAME(H5PSET_EDC_CHECK_C) # define nh5pget_edc_check_c FNAME(H5PGET_EDC_CHECK_C) -# define nh5pset_family_offset_c FNAME(H5PSET_FAMILY_OFFSET_C) +# define nh5pset_family_offset_c FNAME(H5PSET_FAMILY_OFFSET_C) # define nh5pget_fapl_multi_c FNAME(H5PGET_FAPL_MULTI_C) # define nh5pset_fapl_multi_c FNAME(H5PSET_FAPL_MULTI_C) # define nh5pset_fapl_multi_sc FNAME(H5PSET_FAPL_MULTI_SC) @@ -751,7 +751,7 @@ H5_FCDLL int_f nh5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, in # define nh5pset_fletcher32_c FNAME(h5pset_fletcher32_c) # define nh5pset_edc_check_c FNAME(h5pset_edc_check_c) # define nh5pget_edc_check_c FNAME(h5pget_edc_check_c) -# define nh5pset_family_offset_c FNAME(h5pset_family_offset_c) +# define nh5pset_family_offset_c FNAME(h5pset_family_offset_c) # define nh5pget_fapl_multi_c FNAME(h5pget_fapl_multi_c) # define nh5pset_fapl_multi_c FNAME(h5pset_fapl_multi_c) # define nh5pset_fapl_multi_sc FNAME(h5pset_fapl_multi_sc) @@ -839,23 +839,23 @@ H5_FCDLL int_f nh5pget_small_data_block_size_c(hid_t_f *plist, hsize_t_f *size); H5_FCDLL int_f nh5pset_hyper_vector_size_c(hid_t_f *plist, size_t_f *size); H5_FCDLL int_f nh5pget_hyper_vector_size_c(hid_t_f *plist, size_t_f *size); H5_FCDLL int_f nh5pcreate_class_c(hid_t_f *parent, _fcd name, int_f *name_len, hid_t_f *class); -H5_FCDLL int_f nh5pregister_c(hid_t_f *class, _fcd name, int_f * name_len, size_t_f *size, void *value); -H5_FCDLL int_f nh5pregisterc_c(hid_t_f *class, _fcd name, int_f * name_len, size_t_f *size, _fcd value, int_f *value_len); -H5_FCDLL int_f nh5pinsert_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, void *value); -H5_FCDLL int_f nh5pinsertc_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, _fcd value, int_f *value_len); -H5_FCDLL int_f nh5pset_c(hid_t_f *prp_id, _fcd name, int_f *name_len, void *value); -H5_FCDLL int_f nh5psetc_c(hid_t_f *prp_id, _fcd name, int_f *name_len, _fcd value, int_f *value_len); -H5_FCDLL int_f nh5pget_c(hid_t_f *prp_id, _fcd name, int_f *name_len, void *value); +H5_FCDLL int_f nh5pregister_c(hid_t_f *class, _fcd name, int_f * name_len, size_t_f *size, void *value); +H5_FCDLL int_f nh5pregisterc_c(hid_t_f *class, _fcd name, int_f * name_len, size_t_f *size, _fcd value, int_f *value_len); +H5_FCDLL int_f nh5pinsert_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, void *value); +H5_FCDLL int_f nh5pinsertc_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, _fcd value, int_f *value_len); +H5_FCDLL int_f nh5pset_c(hid_t_f *prp_id, _fcd name, int_f *name_len, void *value); +H5_FCDLL int_f nh5psetc_c(hid_t_f *prp_id, _fcd name, int_f *name_len, _fcd value, int_f *value_len); +H5_FCDLL int_f nh5pget_c(hid_t_f *prp_id, _fcd name, int_f *name_len, void *value); H5_FCDLL int_f nh5pgetc_c(hid_t_f *prp_id, _fcd name, int_f *name_len, _fcd value, int_f *value_len); -H5_FCDLL int_f nh5pexist_c(hid_t_f *prp_id, _fcd name, int_f *name_len); -H5_FCDLL int_f nh5pget_size_c(hid_t_f *prp_id, _fcd name, int_f *name_len, size_t_f *size); -H5_FCDLL int_f nh5pget_nprops_c(hid_t_f *prp_id, size_t_f *nprops); -H5_FCDLL int_f nh5pget_class_parent_c(hid_t_f *prp_id, hid_t_f *parent_id); -H5_FCDLL int_f nh5pisa_class_c(hid_t_f *plist, hid_t_f *pclass); +H5_FCDLL int_f nh5pexist_c(hid_t_f *prp_id, _fcd name, int_f *name_len); +H5_FCDLL int_f nh5pget_size_c(hid_t_f *prp_id, _fcd name, int_f *name_len, size_t_f *size); +H5_FCDLL int_f nh5pget_nprops_c(hid_t_f *prp_id, size_t_f *nprops); +H5_FCDLL int_f nh5pget_class_parent_c(hid_t_f *prp_id, hid_t_f *parent_id); +H5_FCDLL int_f nh5pisa_class_c(hid_t_f *plist, hid_t_f *pclass); H5_FCDLL int_f nh5pcopy_prop_c(hid_t_f *dst_id, hid_t_f *src_id, _fcd name, int_f *name_len); -H5_FCDLL int_f nh5premove_c(hid_t_f *plid, _fcd name, int_f *name_len); +H5_FCDLL int_f nh5premove_c(hid_t_f *plid, _fcd name, int_f *name_len); H5_FCDLL int_f nh5punregister_c(hid_t_f *class, _fcd name, int_f *name_len); -H5_FCDLL int_f nh5pclose_class_c(hid_t_f * class); +H5_FCDLL int_f nh5pclose_class_c(hid_t_f * class); H5_FCDLL int_f nh5pget_class_name_c(hid_t_f *prp_id, _fcd name, int_f *name_len); H5_FCDLL int_f nh5pset_shuffle_c ( hid_t_f *prp_id); H5_FCDLL int_f nh5pset_fletcher32_c ( hid_t_f *prp_id ); @@ -866,11 +866,11 @@ H5_FCDLL int_f nh5pget_fapl_multi_c ( hid_t_f *prp_id , int_f *mem_map, hid_t_f H5_FCDLL int_f nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *mem_map, hid_t_f *memb_fapl, _fcd memb_name, int_f *len, int_f *lenmax, real_f *memb_addr, int_f *flag); H5_FCDLL int_f nh5pset_fapl_multi_sc ( hid_t_f *prp_id , int_f *flag); H5_FCDLL int_f nh5pset_szip_c ( hid_t_f *prp_id , int_f *options_mask, int_f *pixels_per_block); -H5_FCDLL int_f nh5pall_filters_avail_c ( hid_t_f *prp_id , int_f *status); +H5_FCDLL int_f nh5pall_filters_avail_c ( hid_t_f *prp_id , int_f *status); H5_FCDLL int_f nh5pfill_value_defined_c ( hid_t_f *prp_id , int_f *flag); /* - * Functions frome H5Rf.c + * Functions frome H5Rf.c */ #ifndef H5Rf90_FNAMES # define H5Rf90_FNAMES @@ -939,10 +939,10 @@ H5_FCDLL int_f nh5iget_file_id_c(hid_t_f *obj_id, hid_t_f *file_id); #else # define nh5eclear_c FNAME(h5eclear_c) # define nh5eprint_c1 FNAME(h5eprint_c1) -# define nh5eprint_c2 FNAME(h5eprint_c2) +# define nh5eprint_c2 FNAME(h5eprint_c2) # define nh5eget_major_c FNAME(h5eget_major_c) # define nh5eget_minor_c FNAME(h5eget_minor_c) -# define nh5eset_auto_c FNAME(h5eset_auto_c) +# define nh5eset_auto_c FNAME(h5eset_auto_c) #endif #endif @@ -954,11 +954,11 @@ H5_FCDLL int_f nh5eget_minor_c(int_f* error_no, _fcd name); H5_FCDLL int_f nh5eset_auto_c(int_f* printflag); /* - * Functions from H5f.c + * Functions from H5f.c */ #ifndef H5_FNAMES # define H5_FNAMES -#ifdef DF_CAPFNAMES +#ifdef DF_CAPFNAMES # define nh5open_c FNAME(H5OPEN_C) # define nh5close_c FNAME(H5CLOSE_C) # define nh5init_types_c FNAME(H5INIT_TYPES_C) @@ -969,7 +969,7 @@ H5_FCDLL int_f nh5eset_auto_c(int_f* printflag); # define nh5check_version_c FNAME(H5CHECK_VERSION_C) # define nh5garbage_collect_c FNAME(H5GARBAGE_COLLECT_C) # define nh5dont_atexit_c FNAME(H5DONT_ATEXIT_C) -#else +#else # define nh5open_c FNAME(h5open_c) # define nh5close_c FNAME(h5close_c) # define nh5init_types_c FNAME(h5init_types_c) @@ -991,8 +991,8 @@ H5_FCDLL int_f nh5close_types_c(hid_t_f *types, int_f *lentypes, hid_t_f * float int_f *h5fd_flags, hid_t_f *h5fd_hid_flags, int_f *h5g_flags, int_f *h5i_flags, int_f *h5p_flags, int_f *h5r_flags, int_f *h5s_flags, - int_f *h5t_flags, int_f *h5z_flags); -H5_FCDLL int_f nh5init1_flags_c(int_f *h5lib_flags); + int_f *h5t_flags, int_f *h5z_flags); +H5_FCDLL int_f nh5init1_flags_c(int_f *h5lib_flags); H5_FCDLL int_f nh5get_libversion_c(int_f *majnum, int_f *minnum, int_f *relnum); H5_FCDLL int_f nh5check_version_c(int_f *majnum, int_f *minnum, int_f *relnum); H5_FCDLL int_f nh5garbage_collect_c(void); diff --git a/fortran/test/t.c b/fortran/test/t.c index 3b51add..cb71fd2 100644 --- a/fortran/test/t.c +++ b/fortran/test/t.c @@ -17,9 +17,9 @@ /*---------------------------------------------------------------------------- * Name: h5_fixname_c * Purpose: Call h5_fixname to modify file name - * Inputs: base_name - name of the file + * Inputs: base_name - name of the file * base_namelen - name length - * fapl - file access property list + * fapl - file access property list * full_name - buffer to return full name * full_namelen - name length * Returns: 0 on success, -1 on failure @@ -42,7 +42,7 @@ nh5_fixname_c(_fcd base_name, size_t_f *base_namelen, hid_t_f* fapl, _fcd full_n /* * Convert FORTRAN name to C name */ - c_base_name = (char *)HD5f2cstring(base_name, (size_t)*base_namelen); + c_base_name = (char *)HD5f2cstring(base_name, (size_t)*base_namelen); if (c_base_name == NULL) goto DONE; c_full_name = (char *) HDmalloc((size_t)*full_namelen + 1); if (c_full_name == NULL) goto DONE; @@ -51,7 +51,7 @@ nh5_fixname_c(_fcd base_name, size_t_f *base_namelen, hid_t_f* fapl, _fcd full_n * Call h5_fixname function. */ if (NULL != h5_fixname(c_base_name, c_fapl, c_full_name, (size_t)*full_namelen + 1)) { - HD5packFstring(c_full_name, _fcdtocp(full_name), (size_t)*full_namelen); + HD5packFstring(c_full_name, _fcdtocp(full_name), (size_t)*full_namelen); ret_value = 0; goto DONE; } @@ -59,15 +59,15 @@ nh5_fixname_c(_fcd base_name, size_t_f *base_namelen, hid_t_f* fapl, _fcd full_n DONE: if (NULL != c_base_name) HDfree(c_base_name); if (NULL != c_full_name) HDfree(c_full_name); - return ret_value; -} + return ret_value; +} /*---------------------------------------------------------------------------- * Name: h5_cleanup_c * Purpose: Call h5_cleanup to clean temporary files. - * Inputs: base_name - name of the file + * Inputs: base_name - name of the file * base_namelen - name length - * fapl - file access property list + * fapl - file access property list * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Thursday, September 19, 2002 @@ -89,7 +89,7 @@ nh5_cleanup_c(_fcd base_name, size_t_f *base_namelen, hid_t_f* fapl) /* * Convert FORTRAN name to C name */ - c_base_name[0] = (char *)HD5f2cstring(base_name, (size_t)*base_namelen); + c_base_name[0] = (char *)HD5f2cstring(base_name, (size_t)*base_namelen); if (c_base_name[0] == NULL) goto DONE; /* @@ -100,19 +100,19 @@ nh5_cleanup_c(_fcd base_name, size_t_f *base_namelen, hid_t_f* fapl) goto DONE; } */ - h5_fixname(c_base_name[0], c_fapl, filename, sizeof(filename)); + h5_fixname(c_base_name[0], c_fapl, filename, sizeof(filename)); HDremove(filename); ret_value =0; DONE: if (NULL != c_base_name[0]) HDfree(c_base_name[0]); - return ret_value; - -} + return ret_value; + +} /*---------------------------------------------------------------------------- * Name: h5_exit_c - * Purpose: Call 'exit()' to terminate application. Be careful not to + * Purpose: Call 'exit()' to terminate application. Be careful not to * overflow the exit value range since UNIX supports a very * small range such as 1 byte. Therefore, exit(256) may end * up as exit(0). diff --git a/fortran/test/t.h b/fortran/test/t.h index 0286028..25cfa3d 100644 --- a/fortran/test/t.h +++ b/fortran/test/t.h @@ -31,12 +31,12 @@ char *h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) # define nh5_exit_c FNAME(h5_exit_c) #endif /* DF_CAPFNAMES */ -H5_FCTESTDLL int_f nh5_fixname_c +H5_FCTESTDLL int_f nh5_fixname_c (_fcd base_name, size_t_f *base_namelen, hid_t_f *fapl, _fcd full_name, size_t_f *full_namelen); -H5_FCTESTDLL int_f nh5_cleanup_c +H5_FCTESTDLL int_f nh5_cleanup_c (_fcd base_name, size_t_f *base_namelen, hid_t_f *fapl); -H5_FCTESTDLL void nh5_exit_c +H5_FCTESTDLL void nh5_exit_c (int_f *status); diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c index 4d5ce75..fa7611c 100644 --- a/hl/src/H5IM.c +++ b/hl/src/H5IM.c @@ -28,7 +28,7 @@ * Date: June 13, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: @@ -36,18 +36,18 @@ *------------------------------------------------------------------------- */ -herr_t H5IMmake_image_8bit( hid_t loc_id, - const char *dset_name, +herr_t H5IMmake_image_8bit( hid_t loc_id, + const char *dset_name, hsize_t width, hsize_t height, const unsigned char *buffer ) { int rank = 3; hsize_t dims[3]; - + /* Initialize the image dimensions */ - dims[0] = height; - dims[1] = width; + dims[0] = height; + dims[1] = width; dims[2] = 1; /* Make the dataset */ @@ -83,12 +83,12 @@ herr_t H5IMmake_image_8bit( hid_t loc_id, * Date: June 13, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * - * Interlace Mode Dimensions in the Dataspace - * INTERLACE_PIXEL [height][width][pixel components] - * INTERLACE_PLANE [pixel components][height][width] + * Interlace Mode Dimensions in the Dataspace + * INTERLACE_PIXEL [height][width][pixel components] + * INTERLACE_PLANE [pixel components][height][width] * * * Modifications: @@ -96,8 +96,8 @@ herr_t H5IMmake_image_8bit( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5IMmake_image_24bit( hid_t loc_id, - const char *dset_name, +herr_t H5IMmake_image_24bit( hid_t loc_id, + const char *dset_name, hsize_t width, hsize_t height, const char *interlace, @@ -105,26 +105,26 @@ herr_t H5IMmake_image_24bit( hid_t loc_id, { int rank = 3; hsize_t dims[3]; - + /* Initialize the image dimensions */ - if ( strcmp( interlace, "INTERLACE_PIXEL" ) == 0 ) + if ( strcmp( interlace, "INTERLACE_PIXEL" ) == 0 ) { /* Number of color planes is defined as the third dimension */ - dims[0] = height; - dims[1] = width; - dims[2] = 3; + dims[0] = height; + dims[1] = width; + dims[2] = 3; } else - if ( strcmp( interlace, "INTERLACE_PLANE" ) == 0 ) + if ( strcmp( interlace, "INTERLACE_PLANE" ) == 0 ) { /* Number of color planes is defined as the first dimension */ - dims[0] = 3; - dims[1] = height; - dims[2] = width; + dims[0] = 3; + dims[1] = height; + dims[2] = width; } else return -1; - + /* Make the dataset */ if ( H5LTmake_dataset( loc_id, dset_name, rank, dims, H5T_NATIVE_UCHAR, buffer ) < 0 ) return -1; @@ -156,7 +156,7 @@ herr_t H5IMmake_image_24bit( hid_t loc_id, * * Purpose: operator function used by H5LT_find_palette * - * Return: + * Return: * * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * @@ -172,33 +172,33 @@ herr_t H5IMmake_image_24bit( hid_t loc_id, static herr_t find_palette( hid_t loc_id, const char *name, void *op_data ) { - /* Define a default zero value for return. This will cause the iterator to continue if + /* Define a default zero value for return. This will cause the iterator to continue if * the palette attribute is not found yet. */ - int ret = 0; + int ret = 0; /* Shut compiler */ loc_id=loc_id; op_data=op_data; - - /* Define a positive value for return value if the attribute was found. This will - * cause the iterator to immediately return that positive value, - * indicating short-circuit success + + /* Define a positive value for return value if the attribute was found. This will + * cause the iterator to immediately return that positive value, + * indicating short-circuit success */ - - if( strcmp( name, "PALETTE" ) == 0 ) + + if( strcmp( name, "PALETTE" ) == 0 ) ret = 1; return ret; -} +} /*------------------------------------------------------------------------- * Function: H5IM_find_palette * - * Purpose: Private function. Find the attribute "PALETTE" in the image dataset + * Purpose: Private function. Find the attribute "PALETTE" in the image dataset * * Return: Success: 1, Failure: 0 * @@ -214,7 +214,7 @@ static herr_t find_palette( hid_t loc_id, const char *name, void *op_data ) *------------------------------------------------------------------------- */ -static herr_t H5IM_find_palette( hid_t loc_id ) +static herr_t H5IM_find_palette( hid_t loc_id ) { unsigned int attr_num; /* Starting attribute to look up */ @@ -230,7 +230,7 @@ static herr_t H5IM_find_palette( hid_t loc_id ) /*------------------------------------------------------------------------- * Function: H5IMget_image_info * - * Purpose: Gets information about an image dataset (dimensions, interlace mode + * Purpose: Gets information about an image dataset (dimensions, interlace mode * and number of associated palettes). * * Return: Success: 0, Failure: -1 @@ -240,7 +240,7 @@ static herr_t H5IM_find_palette( hid_t loc_id ) * Date: July 25, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: @@ -248,18 +248,18 @@ static herr_t H5IM_find_palette( hid_t loc_id ) *------------------------------------------------------------------------- */ -herr_t H5IMget_image_info( hid_t loc_id, - const char *dset_name, +herr_t H5IMget_image_info( hid_t loc_id, + const char *dset_name, hsize_t *width, hsize_t *height, hsize_t *planes, char *interlace, hssize_t *npals ) { - hid_t did, sid; + hid_t did, sid; hsize_t dims[3]; hid_t attr_id; - hid_t attr_type; + hid_t attr_type; int has_attr; hid_t attr_space_id; hid_t attr_class; @@ -294,7 +294,7 @@ herr_t H5IMget_image_info( hid_t loc_id, if ( H5Aclose( attr_id ) < 0 ) goto out; } - + /* Get the dataspace handle */ if ( (sid = H5Dget_space( did )) < 0 ) goto out; @@ -309,18 +309,18 @@ herr_t H5IMget_image_info( hid_t loc_id, /* This is a 24 bit image */ { - if ( strcmp( interlace, "INTERLACE_PIXEL" ) == 0 ) + if ( strcmp( interlace, "INTERLACE_PIXEL" ) == 0 ) { /* Number of color planes is defined as the third dimension */ - *height = dims[0]; + *height = dims[0]; *width = dims[1]; *planes = dims[2]; } else - if ( strcmp( interlace, "INTERLACE_PLANE" ) == 0 ) + if ( strcmp( interlace, "INTERLACE_PLANE" ) == 0 ) { /* Number of color planes is defined as the first dimension */ - *planes = dims[0]; + *planes = dims[0]; *height = dims[1]; *width = dims[2]; } @@ -329,7 +329,7 @@ herr_t H5IMget_image_info( hid_t loc_id, else /* This is a 8 bit image */ { - *height = dims[0]; + *height = dims[0]; *width = dims[1]; *planes = dims[2]; } @@ -350,7 +350,7 @@ herr_t H5IMget_image_info( hid_t loc_id, if ( (attr_id = H5Aopen_name( did, "PALETTE" )) < 0 ) goto out; - + if ( (attr_type = H5Aget_type( attr_id )) < 0 ) goto out; @@ -371,13 +371,13 @@ herr_t H5IMget_image_info( hid_t loc_id, if ( H5Sclose( attr_space_id ) < 0 ) goto out; - - } /* H5T_REFERENCE */ - - if ( H5Tclose( attr_type ) < 0 ) + + } /* H5T_REFERENCE */ + + if ( H5Tclose( attr_type ) < 0 ) goto out; - /* Close the attribute. */ + /* Close the attribute. */ if ( H5Aclose( attr_id ) < 0 ) goto out; @@ -408,7 +408,7 @@ out: * Date: June 13, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: @@ -416,11 +416,11 @@ out: *------------------------------------------------------------------------- */ -herr_t H5IMread_image( hid_t loc_id, - const char *dset_name, +herr_t H5IMread_image( hid_t loc_id, + const char *dset_name, unsigned char *buffer ) { - hid_t did; + hid_t did; /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) @@ -455,7 +455,7 @@ out: * Date: May 01, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: @@ -463,18 +463,18 @@ out: *------------------------------------------------------------------------- */ -herr_t H5IMmake_palette( hid_t loc_id, +herr_t H5IMmake_palette( hid_t loc_id, const char *pal_name, const hsize_t *pal_dims, - const unsigned char *pal_data ) + const unsigned char *pal_data ) + +{ -{ - int has_pal; - + /* Check if the dataset already exists */ has_pal = H5LTfind_dataset( loc_id, pal_name ); - + /* It exists. Return */ if ( has_pal == 1 ) return 0; @@ -490,7 +490,7 @@ herr_t H5IMmake_palette( hid_t loc_id, /* Attach the attribute "PAL_VERSION" to the >>palette<< dataset*/ if ( H5LTset_attribute_string( loc_id, pal_name, "PAL_VERSION", "1.2" ) < 0 ) return -1; - + return 0; } @@ -508,23 +508,23 @@ herr_t H5IMmake_palette( hid_t loc_id, * Date: May 01, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html - * - * An image (dataset) within an HDF5 file may optionally specify an array of - * palettes to be viewed with. The dataset will have an attribute - * which contains an array of object reference pointers which refer to palettes in the file. + * + * An image (dataset) within an HDF5 file may optionally specify an array of + * palettes to be viewed with. The dataset will have an attribute + * which contains an array of object reference pointers which refer to palettes in the file. * * Modifications: * *------------------------------------------------------------------------- */ -herr_t H5IMlink_palette( hid_t loc_id, - const char *image_name, - const char *pal_name ) +herr_t H5IMlink_palette( hid_t loc_id, + const char *image_name, + const char *pal_name ) -{ +{ hid_t image_id; hid_t attr_type; @@ -537,12 +537,12 @@ herr_t H5IMlink_palette( hid_t loc_id, hsize_t dim_ref; int ok_pal; - /* The image dataset may or not have the attribute "PALETTE" + /* The image dataset may or not have the attribute "PALETTE" * First we try to open to see if it is already there; if not, it is created. - * If it exists, the array of references is extended to hold the reference + * If it exists, the array of references is extended to hold the reference * to the new palette */ - + /* First we get the image id */ if ( (image_id = H5Dopen( loc_id, image_name )) < 0 ) return -1; @@ -556,11 +556,11 @@ herr_t H5IMlink_palette( hid_t loc_id, if ( (attr_space_id = H5Screate( H5S_SCALAR )) < 0 ) goto out; - + /* Create the attribute type for the reference */ if ( (attr_type = H5Tcopy( H5T_STD_REF_OBJ )) < 0 ) goto out; - + /* Create the attribute "PALETTE" to be attached to the image*/ if ( (attr_id = H5Acreate( image_id, "PALETTE", attr_type, attr_space_id, H5P_DEFAULT )) < 0 ) goto out; @@ -586,7 +586,7 @@ herr_t H5IMlink_palette( hid_t loc_id, if ( (attr_id = H5Aopen_name( image_id, "PALETTE" )) < 0 ) goto out; - + if ( (attr_type = H5Aget_type( attr_id )) < 0 ) goto out; @@ -620,7 +620,7 @@ herr_t H5IMlink_palette( hid_t loc_id, goto out; /* Create a new reference for this palette. */ - if ( H5Rcreate( &ref, loc_id, pal_name, H5R_OBJECT, -1 ) < 0 ) + if ( H5Rcreate( &ref, loc_id, pal_name, H5R_OBJECT, -1 ) < 0 ) goto out; refbuf[n_refs] = ref; @@ -641,22 +641,22 @@ herr_t H5IMlink_palette( hid_t loc_id, goto out; free( refbuf ); - - } /* H5T_REFERENCE */ - - if ( H5Tclose( attr_type ) < 0 ) + + } /* H5T_REFERENCE */ + + if ( H5Tclose( attr_type ) < 0 ) goto out; - /* Close the attribute. */ + /* Close the attribute. */ if ( H5Aclose( attr_id ) < 0 ) goto out; } - + /* Close the image dataset. */ if ( H5Dclose( image_id ) < 0 ) return -1; - + return 0; out: @@ -678,7 +678,7 @@ out: * Date: September 10, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: @@ -686,10 +686,10 @@ out: *------------------------------------------------------------------------- */ -herr_t H5IMunlink_palette( hid_t loc_id, - const char *image_name, - const char *pal_name ) -{ +herr_t H5IMunlink_palette( hid_t loc_id, + const char *image_name, + const char *pal_name ) +{ hid_t image_id; hid_t attr_type; hid_t attr_id; @@ -698,17 +698,17 @@ herr_t H5IMunlink_palette( hid_t loc_id, /* Try to find the palette dataset */ has_pal = H5LTfind_dataset( loc_id, pal_name ); - + /* It does not exist. Return */ if ( has_pal == 0 ) return -1; - /* The image dataset may or not have the attribute "PALETTE" + /* The image dataset may or not have the attribute "PALETTE" * First we try to open to see if it is already there; if not, it is created. - * If it exists, the array of references is extended to hold the reference + * If it exists, the array of references is extended to hold the reference * to the new palette */ - + /* First we get the image id */ if ( (image_id = H5Dopen( loc_id, image_name )) < 0 ) return -1; @@ -725,7 +725,7 @@ herr_t H5IMunlink_palette( hid_t loc_id, { if ( (attr_id = H5Aopen_name( image_id, "PALETTE" )) < 0 ) goto out; - + if ( (attr_type = H5Aget_type( attr_id )) < 0 ) goto out; @@ -740,21 +740,21 @@ herr_t H5IMunlink_palette( hid_t loc_id, if ( H5Adelete( image_id, "PALETTE" ) < 0 ) goto out; - } /* H5T_REFERENCE */ + } /* H5T_REFERENCE */ - if ( H5Tclose( attr_type ) < 0 ) + if ( H5Tclose( attr_type ) < 0 ) goto out; - /* Close the attribute. */ + /* Close the attribute. */ if ( H5Aclose( attr_id ) < 0 ) goto out; } /* ok_pal */ - + /* Close the image dataset. */ if ( H5Dclose( image_id ) < 0 ) return -1; - + return 0; out: @@ -781,8 +781,8 @@ out: *------------------------------------------------------------------------- */ -herr_t H5IMget_npalettes( hid_t loc_id, - const char *image_name, +herr_t H5IMget_npalettes( hid_t loc_id, + const char *image_name, hssize_t *npals ) { hid_t image_id; @@ -807,7 +807,7 @@ herr_t H5IMget_npalettes( hid_t loc_id, if ( (attr_id = H5Aopen_name( image_id, "PALETTE" )) < 0 ) goto out; - + if ( (attr_type = H5Aget_type( attr_id )) < 0 ) goto out; @@ -825,13 +825,13 @@ herr_t H5IMget_npalettes( hid_t loc_id, if ( H5Sclose( attr_space_id ) < 0 ) goto out; - - } /* H5T_REFERENCE */ - - if ( H5Tclose( attr_type ) < 0 ) + + } /* H5T_REFERENCE */ + + if ( H5Tclose( attr_type ) < 0 ) goto out; - /* Close the attribute. */ + /* Close the attribute. */ if ( H5Aclose( attr_id ) < 0 ) goto out; @@ -848,7 +848,7 @@ out: return -1; } - + /*------------------------------------------------------------------------- * Function: H5IMget_palette_info @@ -862,7 +862,7 @@ out: * Date: July 22, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: @@ -870,7 +870,7 @@ out: *------------------------------------------------------------------------- */ -herr_t H5IMget_palette_info( hid_t loc_id, +herr_t H5IMget_palette_info( hid_t loc_id, const char *image_name, int pal_number, hsize_t *pal_dims ) @@ -900,7 +900,7 @@ herr_t H5IMget_palette_info( hid_t loc_id, if ( (attr_id = H5Aopen_name( image_id, "PALETTE" )) < 0 ) goto out; - + if ( (attr_type = H5Aget_type( attr_id )) < 0 ) goto out; @@ -936,7 +936,7 @@ herr_t H5IMget_palette_info( hid_t loc_id, 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; @@ -947,18 +947,18 @@ herr_t H5IMget_palette_info( hid_t loc_id, goto out; free( refbuf ); - - } /* H5T_REFERENCE */ - - if ( H5Tclose( attr_type ) < 0 ) + + } /* H5T_REFERENCE */ + + if ( H5Tclose( attr_type ) < 0 ) goto out; - /* Close the attribute. */ + /* Close the attribute. */ if ( H5Aclose( attr_id ) < 0 ) goto out; } - + /* Close the image dataset. */ if ( H5Dclose( image_id ) < 0 ) return -1; @@ -970,7 +970,7 @@ out: return -1; } - + /*------------------------------------------------------------------------- * Function: H5IMget_palette @@ -984,7 +984,7 @@ out: * Date: August 30, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: @@ -992,7 +992,7 @@ out: *------------------------------------------------------------------------- */ -herr_t H5IMget_palette( hid_t loc_id, +herr_t H5IMget_palette( hid_t loc_id, const char *image_name, int pal_number, unsigned char *pal_data ) @@ -1020,7 +1020,7 @@ herr_t H5IMget_palette( hid_t loc_id, if ( (attr_id = H5Aopen_name( image_id, "PALETTE" )) < 0 ) goto out; - + if ( (attr_type = H5Aget_type( attr_id )) < 0 ) goto out; @@ -1058,13 +1058,13 @@ herr_t H5IMget_palette( hid_t loc_id, goto out; free( refbuf ); - - } /* H5T_REFERENCE */ - - if ( H5Tclose( attr_type ) < 0 ) + + } /* H5T_REFERENCE */ + + if ( H5Tclose( attr_type ) < 0 ) goto out; - /* Close the attribute. */ + /* Close the attribute. */ if ( H5Aclose( attr_id ) < 0 ) goto out; @@ -1082,7 +1082,7 @@ out: return -1; } - + /*------------------------------------------------------------------------- * Function: H5IMis_image * @@ -1095,7 +1095,7 @@ out: * Date: August 30, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: @@ -1103,7 +1103,7 @@ out: *------------------------------------------------------------------------- */ -herr_t H5IMis_image( hid_t loc_id, +herr_t H5IMis_image( hid_t loc_id, const char *dset_name ) { hid_t did; @@ -1134,7 +1134,7 @@ herr_t H5IMis_image( hid_t loc_id, if ( (attr_id = H5Aopen_name( did, "CLASS" )) < 0 ) goto out; - + if ( (attr_type = H5Aget_type( attr_id )) < 0 ) goto out; @@ -1144,12 +1144,12 @@ herr_t H5IMis_image( hid_t loc_id, if ( H5Aread( attr_id, attr_type, attr_data ) < 0 ) goto out; - if( strcmp( attr_data, "IMAGE" ) == 0 ) + if( strcmp( attr_data, "IMAGE" ) == 0 ) ret = 1; else ret = 0; - - if ( H5Tclose( attr_type ) < 0 ) + + if ( H5Tclose( attr_type ) < 0 ) goto out; if ( H5Aclose( attr_id ) < 0 ) @@ -1183,7 +1183,7 @@ out: * Date: August 30, 2001 * * Comments: - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: @@ -1191,7 +1191,7 @@ out: *------------------------------------------------------------------------- */ -herr_t H5IMis_palette( hid_t loc_id, +herr_t H5IMis_palette( hid_t loc_id, const char *dset_name ) { hid_t did; @@ -1222,7 +1222,7 @@ herr_t H5IMis_palette( hid_t loc_id, if ( (attr_id = H5Aopen_name( did, "CLASS" )) < 0 ) goto out; - + if ( (attr_type = H5Aget_type( attr_id )) < 0 ) goto out; @@ -1232,12 +1232,12 @@ herr_t H5IMis_palette( hid_t loc_id, if ( H5Aread( attr_id, attr_type, attr_data ) < 0 ) goto out; - if( strcmp( attr_data, "PALETTE" ) == 0 ) + if( strcmp( attr_data, "PALETTE" ) == 0 ) ret = 1; else ret = 0; - - if ( H5Tclose( attr_type ) < 0 ) + + if ( H5Tclose( attr_type ) < 0 ) goto out; if ( H5Aclose( attr_id ) < 0 ) diff --git a/hl/src/H5IM.h b/hl/src/H5IM.h index db79222..5b2150c 100644 --- a/hl/src/H5IM.h +++ b/hl/src/H5IM.h @@ -23,65 +23,65 @@ extern "C" { -herr_t H5IMmake_image_8bit( hid_t loc_id, - const char *dset_name, +herr_t H5IMmake_image_8bit( hid_t loc_id, + const char *dset_name, hsize_t width, hsize_t height, const unsigned char *buffer ); -herr_t H5IMmake_image_24bit( hid_t loc_id, - const char *dset_name, +herr_t H5IMmake_image_24bit( hid_t loc_id, + const char *dset_name, hsize_t width, hsize_t height, const char *interlace, const unsigned char *buffer ); -herr_t H5IMget_image_info( hid_t loc_id, - const char *dset_name, +herr_t H5IMget_image_info( hid_t loc_id, + const char *dset_name, hsize_t *width, hsize_t *height, hsize_t *planes, char *interlace, hssize_t *npals ); -herr_t H5IMread_image( hid_t loc_id, - const char *dset_name, +herr_t H5IMread_image( hid_t loc_id, + const char *dset_name, unsigned char *buffer ); -herr_t H5IMmake_palette( hid_t loc_id, +herr_t H5IMmake_palette( hid_t loc_id, const char *pal_name, const hsize_t *pal_dims, const unsigned char *pal_data ); -herr_t H5IMlink_palette( hid_t loc_id, - const char *image_name, +herr_t H5IMlink_palette( hid_t loc_id, + const char *image_name, const char *pal_name ); -herr_t H5IMunlink_palette( hid_t loc_id, - const char *image_name, +herr_t H5IMunlink_palette( hid_t loc_id, + const char *image_name, const char *pal_name ); -herr_t H5IMget_npalettes( hid_t loc_id, - const char *image_name, +herr_t H5IMget_npalettes( hid_t loc_id, + const char *image_name, hssize_t *npals ); -herr_t H5IMget_palette_info( hid_t loc_id, - const char *image_name, +herr_t H5IMget_palette_info( hid_t loc_id, + const char *image_name, int pal_number, hsize_t *pal_dims ); -herr_t H5IMget_palette( hid_t loc_id, +herr_t H5IMget_palette( hid_t loc_id, const char *image_name, int pal_number, unsigned char *pal_data ); -herr_t H5IMis_image( hid_t loc_id, +herr_t H5IMis_image( hid_t loc_id, const char *dset_name ); -herr_t H5IMis_palette( hid_t loc_id, +herr_t H5IMis_palette( hid_t loc_id, const char *dset_name ); #ifdef __cplusplus diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index c8ac099..fc394d4 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -15,23 +15,23 @@ #include /*------------------------------------------------------------------------- - * + * * Private functions - * + * *------------------------------------------------------------------------- */ -herr_t H5LT_open_id( hid_t loc_id, - const char *obj_name, +herr_t H5LT_open_id( hid_t loc_id, + const char *obj_name, int obj_type ); herr_t H5LT_close_id( hid_t obj_id, int obj_type ); /*------------------------------------------------------------------------- - * + * * Public functions - * + * *------------------------------------------------------------------------- */ @@ -54,16 +54,16 @@ herr_t H5LT_close_id( hid_t obj_id, *------------------------------------------------------------------------- */ -herr_t H5LTmake_dataset( hid_t loc_id, - const char *dset_name, - int rank, +herr_t H5LTmake_dataset( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, hid_t tid, - const void *data ) + const void *data ) { - hid_t did, sid; - + hid_t did, sid; + /* Create the data space for the dataset. */ if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 ) return -1; @@ -74,7 +74,7 @@ herr_t H5LTmake_dataset( hid_t loc_id, /* Write the dataset only if there is data to write */ - if ( data ) + if ( data ) { if ( H5Dwrite( did, tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 ) goto out; @@ -84,7 +84,7 @@ herr_t H5LTmake_dataset( hid_t loc_id, if ( H5Dclose( did ) < 0 ) return -1; - /* Terminate access to the data space. */ + /* Terminate access to the data space. */ if ( H5Sclose( sid ) < 0 ) return -1; @@ -115,15 +115,15 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTmake_dataset_char( hid_t loc_id, - const char *dset_name, - int rank, +herr_t H5LTmake_dataset_char( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, - const char *data ) + const char *data ) { - hid_t did, sid; - + hid_t did, sid; + /* Create the data space for the dataset. */ if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 ) return -1; @@ -134,7 +134,7 @@ herr_t H5LTmake_dataset_char( hid_t loc_id, /* Write the dataset only if there is data to write */ - if ( data ) + if ( data ) { if ( H5Dwrite( did, H5T_NATIVE_CHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 ) goto out; @@ -144,7 +144,7 @@ herr_t H5LTmake_dataset_char( hid_t loc_id, if ( H5Dclose( did ) < 0 ) return -1; - /* Terminate access to the data space. */ + /* Terminate access to the data space. */ if ( H5Sclose( sid ) < 0 ) return -1; @@ -177,15 +177,15 @@ out: */ -herr_t H5LTmake_dataset_short( hid_t loc_id, - const char *dset_name, - int rank, +herr_t H5LTmake_dataset_short( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, - const short *data ) + const short *data ) { - hid_t did, sid; - + hid_t did, sid; + /* Create the data space for the dataset. */ if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 ) return -1; @@ -196,7 +196,7 @@ herr_t H5LTmake_dataset_short( hid_t loc_id, /* Write the dataset only if there is data to write */ - if ( data ) + if ( data ) { if ( H5Dwrite( did, H5T_NATIVE_SHORT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 ) goto out; @@ -206,7 +206,7 @@ herr_t H5LTmake_dataset_short( hid_t loc_id, if ( H5Dclose( did ) < 0 ) return -1; - /* Terminate access to the data space. */ + /* Terminate access to the data space. */ if ( H5Sclose( sid ) < 0 ) return -1; @@ -238,15 +238,15 @@ out: */ -herr_t H5LTmake_dataset_int( hid_t loc_id, - const char *dset_name, - int rank, +herr_t H5LTmake_dataset_int( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, - const int *data ) + const int *data ) { - hid_t did, sid; - + hid_t did, sid; + /* Create the data space for the dataset. */ if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 ) return -1; @@ -257,7 +257,7 @@ herr_t H5LTmake_dataset_int( hid_t loc_id, /* Write the dataset only if there is data to write */ - if ( data ) + if ( data ) { if ( H5Dwrite( did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 ) goto out; @@ -267,7 +267,7 @@ herr_t H5LTmake_dataset_int( hid_t loc_id, if ( H5Dclose( did ) < 0 ) return -1; - /* Terminate access to the data space. */ + /* Terminate access to the data space. */ if ( H5Sclose( sid ) < 0 ) return -1; @@ -301,15 +301,15 @@ out: */ -herr_t H5LTmake_dataset_long( hid_t loc_id, - const char *dset_name, - int rank, +herr_t H5LTmake_dataset_long( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, - const long *data ) + const long *data ) { - hid_t did, sid; - + hid_t did, sid; + /* Create the data space for the dataset. */ if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 ) return -1; @@ -320,7 +320,7 @@ herr_t H5LTmake_dataset_long( hid_t loc_id, /* Write the dataset only if there is data to write */ - if ( data ) + if ( data ) { if ( H5Dwrite( did, H5T_NATIVE_LONG, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 ) goto out; @@ -330,7 +330,7 @@ herr_t H5LTmake_dataset_long( hid_t loc_id, if ( H5Dclose( did ) < 0 ) return -1; - /* Terminate access to the data space. */ + /* Terminate access to the data space. */ if ( H5Sclose( sid ) < 0 ) return -1; @@ -362,15 +362,15 @@ out: */ -herr_t H5LTmake_dataset_float( hid_t loc_id, - const char *dset_name, - int rank, +herr_t H5LTmake_dataset_float( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, - const float *data ) + const float *data ) { - hid_t did, sid; - + hid_t did, sid; + /* Create the data space for the dataset. */ if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 ) return -1; @@ -381,7 +381,7 @@ herr_t H5LTmake_dataset_float( hid_t loc_id, /* Write the dataset only if there is data to write */ - if ( data ) + if ( data ) { if ( H5Dwrite( did, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 ) goto out; @@ -391,7 +391,7 @@ herr_t H5LTmake_dataset_float( hid_t loc_id, if ( H5Dclose( did ) < 0 ) return -1; - /* Terminate access to the data space. */ + /* Terminate access to the data space. */ if ( H5Sclose( sid ) < 0 ) return -1; @@ -425,15 +425,15 @@ out: */ -herr_t H5LTmake_dataset_double( hid_t loc_id, - const char *dset_name, - int rank, +herr_t H5LTmake_dataset_double( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, - const double *data ) + const double *data ) { - hid_t did, sid; - + hid_t did, sid; + /* Create the data space for the dataset. */ if ( (sid = H5Screate_simple( rank, dims, NULL )) < 0 ) return -1; @@ -444,7 +444,7 @@ herr_t H5LTmake_dataset_double( hid_t loc_id, /* Write the dataset only if there is data to write */ - if ( data ) + if ( data ) { if ( H5Dwrite( did, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 ) goto out; @@ -454,7 +454,7 @@ herr_t H5LTmake_dataset_double( hid_t loc_id, if ( H5Dclose( did ) < 0 ) return -1; - /* Terminate access to the data space. */ + /* Terminate access to the data space. */ if ( H5Sclose( sid ) < 0 ) return -1; @@ -487,12 +487,12 @@ out: */ -herr_t H5LTmake_dataset_string(hid_t loc_id, - const char *dset_name, - const char *buf ) +herr_t H5LTmake_dataset_string(hid_t loc_id, + const char *dset_name, + const char *buf ) { - hid_t did=-1; + hid_t did=-1; hid_t sid=-1; hid_t tid; size_t size; @@ -508,7 +508,7 @@ herr_t H5LTmake_dataset_string(hid_t loc_id, if ( H5Tset_strpad(tid,H5T_STR_NULLTERM ) < 0 ) goto out; - + /* Create the data space for the dataset. */ if ( (sid = H5Screate( H5S_SCALAR )) < 0 ) goto out; @@ -519,7 +519,7 @@ herr_t H5LTmake_dataset_string(hid_t loc_id, /* Write the dataset only if there is data to write */ - if (buf) + if (buf) { if ( H5Dwrite(did,tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf) < 0 ) goto out; @@ -557,12 +557,12 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTread_dataset( hid_t loc_id, +herr_t H5LTread_dataset( hid_t loc_id, const char *dset_name, hid_t tid, void *data ) { - hid_t did; + hid_t did; /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) @@ -583,7 +583,7 @@ out: return -1; } - + /*------------------------------------------------------------------------- * Function: H5LTread_dataset_char @@ -599,11 +599,11 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTread_dataset_char( hid_t loc_id, +herr_t H5LTread_dataset_char( hid_t loc_id, const char *dset_name, char *data ) { - hid_t did; + hid_t did; /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) @@ -639,11 +639,11 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTread_dataset_short( hid_t loc_id, +herr_t H5LTread_dataset_short( hid_t loc_id, const char *dset_name, short *data ) { - hid_t did; + hid_t did; /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) @@ -679,11 +679,11 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTread_dataset_int( hid_t loc_id, +herr_t H5LTread_dataset_int( hid_t loc_id, const char *dset_name, int *data ) { - hid_t did; + hid_t did; /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) @@ -719,11 +719,11 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTread_dataset_long( hid_t loc_id, +herr_t H5LTread_dataset_long( hid_t loc_id, const char *dset_name, long *data ) { - hid_t did; + hid_t did; /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) @@ -759,11 +759,11 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTread_dataset_float( hid_t loc_id, +herr_t H5LTread_dataset_float( hid_t loc_id, const char *dset_name, float *data ) { - hid_t did; + hid_t did; /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) @@ -800,11 +800,11 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTread_dataset_double( hid_t loc_id, +herr_t H5LTread_dataset_double( hid_t loc_id, const char *dset_name, double *data ) { - hid_t did; + hid_t did; /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) @@ -841,11 +841,11 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTread_dataset_string( hid_t loc_id, +herr_t H5LTread_dataset_string( hid_t loc_id, const char *dset_name, char *buf ) { - hid_t did; + hid_t did; hid_t tid; /* Open the dataset. */ @@ -889,12 +889,12 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTget_dataset_ndims( hid_t loc_id, +herr_t H5LTget_dataset_ndims( hid_t loc_id, const char *dset_name, int *rank ) { - hid_t did; - hid_t sid; + hid_t did; + hid_t sid; /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) @@ -940,15 +940,15 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTget_dataset_info( hid_t loc_id, +herr_t H5LTget_dataset_info( hid_t loc_id, const char *dset_name, hsize_t *dims, H5T_class_t *type_class, size_t *type_size ) { - hid_t did; + hid_t did; hid_t tid; - hid_t sid; + hid_t sid; /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) @@ -1011,42 +1011,42 @@ out: static herr_t find_dataset( hid_t loc_id, const char *name, void *op_data) { - /* Define a default zero value for return. This will cause the iterator to continue if + /* Define a default zero value for return. This will cause the iterator to continue if * the dataset is not found yet. */ - int ret = 0; + int ret = 0; char *dset_name = (char*)op_data; - + /* Shut the compiler up */ loc_id=loc_id; - /* Define a positive value for return value if the dataset was found. This will - * cause the iterator to immediately return that positive value, - * indicating short-circuit success + /* Define a positive value for return value if the dataset was found. This will + * cause the iterator to immediately return that positive value, + * indicating short-circuit success */ - if( strcmp( name, dset_name ) == 0 ) + if( strcmp( name, dset_name ) == 0 ) ret = 1; return ret; -} +} /*------------------------------------------------------------------------- * Function: H5LTfind_dataset * - * Purpose: Inquires if a dataset named dset_name exists attached + * Purpose: Inquires if a dataset named dset_name exists attached * to the object loc_id. * * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * * Date: July 15, 2001 * - * Return: + * Return: * Success: The return value of the first operator that * returns non-zero, or zero if all members were * processed with no operator returning non-zero. @@ -1058,7 +1058,7 @@ static herr_t find_dataset( hid_t loc_id, const char *name, void *op_data) *------------------------------------------------------------------------- */ -herr_t H5LTfind_dataset( hid_t loc_id, const char *dset_name ) +herr_t H5LTfind_dataset( hid_t loc_id, const char *dset_name ) { herr_t ret; @@ -1070,17 +1070,17 @@ herr_t H5LTfind_dataset( hid_t loc_id, const char *dset_name ) /*------------------------------------------------------------------------- - * + * * Set attribute functions - * + * *------------------------------------------------------------------------- */ - + /*------------------------------------------------------------------------- * Function: H5LTset_attribute_string * - * Purpose: Creates and writes a string attribute named attr_name and attaches + * Purpose: Creates and writes a string attribute named attr_name and attaches * it to the object specified by the name obj_name. * * Return: Success: 0, Failure: -1 @@ -1096,20 +1096,20 @@ herr_t H5LTfind_dataset( hid_t loc_id, const char *dset_name ) *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_string( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_string( hid_t loc_id, + const char *obj_name, const char *attr_name, - const char *attr_data ) + const char *attr_data ) { hid_t attr_type; hid_t attr_space_id; hid_t attr_id; - hid_t obj_id; + hid_t obj_id; int has_attr; H5G_stat_t statbuf; size_t attr_size; - + /* Get the type of object */ if (H5Gget_objinfo( loc_id, obj_name, 1, &statbuf )<0) return -1; @@ -1150,10 +1150,10 @@ herr_t H5LTset_attribute_string( hid_t loc_id, if ( H5Awrite( attr_id, attr_type, attr_data ) < 0 ) goto out; - + if ( H5Aclose( attr_id ) < 0 ) goto out; - + if ( H5Sclose( attr_space_id ) < 0 ) goto out; @@ -1193,23 +1193,23 @@ out: */ -herr_t H5LT_set_attribute_numerical( hid_t loc_id, - const char *obj_name, +herr_t H5LT_set_attribute_numerical( hid_t loc_id, + const char *obj_name, const char *attr_name, size_t size, hid_t tid, - const void *data ) + const void *data ) { - hid_t obj_id, sid, attr_id; + hid_t obj_id, sid, attr_id; hsize_t dim_size=size; int has_attr; H5G_stat_t statbuf; - + /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -1271,17 +1271,17 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LT_open_id( hid_t loc_id, - const char *obj_name, - int obj_type /*basic object type*/ ) +herr_t H5LT_open_id( hid_t loc_id, + const char *obj_name, + int obj_type /*basic object type*/ ) { - hid_t obj_id = -1; - + hid_t obj_id = -1; + switch ( obj_type ) { case H5G_DATASET: - + /* Open the dataset. */ if ( (obj_id = H5Dopen( loc_id, obj_name )) < 0 ) return -1; @@ -1295,10 +1295,10 @@ herr_t H5LT_open_id( hid_t loc_id, break; default: - return -1; + return -1; } - return obj_id; + return obj_id; } @@ -1320,27 +1320,27 @@ herr_t H5LT_open_id( hid_t loc_id, */ herr_t H5LT_close_id( hid_t obj_id, - int obj_type /*basic object type*/ ) + int obj_type /*basic object type*/ ) { switch ( obj_type ) { case H5G_DATASET: /* Close the dataset. */ if ( H5Dclose( obj_id ) < 0 ) - return -1; + return -1; break; case H5G_GROUP: /* Close the group. */ if ( H5Gclose( obj_id ) < 0 ) - return -1; + return -1; break; default: - return -1; + return -1; } - return 0; + return 0; } @@ -1360,14 +1360,14 @@ herr_t H5LT_close_id( hid_t obj_id, *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_char( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_char( hid_t loc_id, + const char *obj_name, const char *attr_name, const char *data, - size_t size ) + size_t size ) { - - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, H5T_NATIVE_CHAR, data ) < 0 ) return -1; @@ -1390,14 +1390,14 @@ herr_t H5LTset_attribute_char( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_uchar( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_uchar( hid_t loc_id, + const char *obj_name, const char *attr_name, const unsigned char *data, - size_t size ) + size_t size ) { - - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, H5T_NATIVE_UCHAR, data ) < 0 ) return -1; @@ -1421,14 +1421,14 @@ herr_t H5LTset_attribute_uchar( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_short( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_short( hid_t loc_id, + const char *obj_name, const char *attr_name, const short *data, - size_t size ) + size_t size ) { - - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, H5T_NATIVE_SHORT, data ) < 0 ) return -1; @@ -1452,14 +1452,14 @@ herr_t H5LTset_attribute_short( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_ushort( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_ushort( hid_t loc_id, + const char *obj_name, const char *attr_name, const unsigned short *data, - size_t size ) + size_t size ) { - - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, H5T_NATIVE_USHORT, data ) < 0 ) return -1; @@ -1483,14 +1483,14 @@ herr_t H5LTset_attribute_ushort( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_int( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_int( hid_t loc_id, + const char *obj_name, const char *attr_name, const int *data, - size_t size ) + size_t size ) { - - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, H5T_NATIVE_INT, data ) < 0 ) return -1; @@ -1514,14 +1514,14 @@ herr_t H5LTset_attribute_int( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_uint( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_uint( hid_t loc_id, + const char *obj_name, const char *attr_name, const unsigned int *data, - size_t size ) + size_t size ) { - - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, H5T_NATIVE_UINT, data ) < 0 ) return -1; @@ -1546,14 +1546,14 @@ herr_t H5LTset_attribute_uint( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_long( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_long( hid_t loc_id, + const char *obj_name, const char *attr_name, const long *data, - size_t size ) + size_t size ) { - - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, H5T_NATIVE_LONG, data ) < 0 ) return -1; @@ -1577,14 +1577,14 @@ herr_t H5LTset_attribute_long( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_ulong( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_ulong( hid_t loc_id, + const char *obj_name, const char *attr_name, const unsigned long *data, - size_t size ) + size_t size ) { - - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, H5T_NATIVE_ULONG, data ) < 0 ) return -1; @@ -1610,14 +1610,14 @@ herr_t H5LTset_attribute_ulong( hid_t loc_id, */ -herr_t H5LTset_attribute_float( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_float( hid_t loc_id, + const char *obj_name, const char *attr_name, const float *data, size_t size ) { - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, H5T_NATIVE_FLOAT, data ) < 0 ) return -1; @@ -1642,14 +1642,14 @@ herr_t H5LTset_attribute_float( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_double( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_double( hid_t loc_id, + const char *obj_name, const char *attr_name, const double *data, - size_t size ) + size_t size ) { - - if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, + + if ( H5LT_set_attribute_numerical( loc_id, obj_name, attr_name, size, H5T_NATIVE_DOUBLE, data ) < 0 ) return -1; @@ -1678,28 +1678,28 @@ herr_t H5LTset_attribute_double( hid_t loc_id, static herr_t find_attr( hid_t loc_id, const char *name, void *op_data) { - /* Define a default zero value for return. This will cause the iterator to continue if + /* Define a default zero value for return. This will cause the iterator to continue if * the palette attribute is not found yet. */ - int ret = 0; + int ret = 0; char *attr_name = (char*)op_data; - + /* Shut the compiler up */ loc_id=loc_id; - /* Define a positive value for return value if the attribute was found. This will - * cause the iterator to immediately return that positive value, - * indicating short-circuit success + /* Define a positive value for return value if the attribute was found. This will + * cause the iterator to immediately return that positive value, + * indicating short-circuit success */ - if( strcmp( name, attr_name ) == 0 ) + if( strcmp( name, attr_name ) == 0 ) ret = 1; return ret; -} +} /*------------------------------------------------------------------------- @@ -1714,7 +1714,7 @@ static herr_t find_attr( hid_t loc_id, const char *name, void *op_data) * Comments: * The function uses H5Aiterate with the operator function find_attr * - * Return: + * Return: * Success: The return value of the first operator that * returns non-zero, or zero if all members were * processed with no operator returning non-zero. @@ -1726,10 +1726,10 @@ static herr_t find_attr( hid_t loc_id, const char *name, void *op_data) *------------------------------------------------------------------------- */ -herr_t H5LT_find_attribute( hid_t loc_id, const char* attr_name ) +herr_t H5LT_find_attribute( hid_t loc_id, const char* attr_name ) { - unsigned int attr_num; + unsigned int attr_num; herr_t ret; attr_num = 0; @@ -1754,16 +1754,16 @@ herr_t H5LT_find_attribute( hid_t loc_id, const char* attr_name ) *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_ndims( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_ndims( hid_t loc_id, + const char *obj_name, const char *attr_name, int *rank ) { - hid_t attr_id; - hid_t sid; + hid_t attr_id; + hid_t sid; H5G_stat_t statbuf; - hid_t obj_id; - + hid_t obj_id; + /* Get the type of object */ if (H5Gget_objinfo( loc_id, obj_name, 1, &statbuf )<0) return -1; @@ -1823,19 +1823,19 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_info( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_info( hid_t loc_id, + const char *obj_name, const char *attr_name, hsize_t *dims, H5T_class_t *type_class, size_t *type_size ) { - hid_t attr_id; + hid_t attr_id; hid_t tid; - hid_t sid; + hid_t sid; H5G_stat_t statbuf; - hid_t obj_id; - + hid_t obj_id; + /* Get the type of object */ if (H5Gget_objinfo( loc_id, obj_name, 1, &statbuf )<0) return -1; @@ -1905,7 +1905,7 @@ out: /*------------------------------------------------------------------------- * Function: H5LTcreate_compound_type * - * Purpose: + * Purpose: * * Return: Success: 0, Failure: -1 * @@ -1921,19 +1921,19 @@ out: *------------------------------------------------------------------------- */ -hid_t H5LTcreate_compound_type( hsize_t nfields, size_t size, const char *field_names[], - const size_t *field_offset, const hid_t *field_types ) +hid_t H5LTcreate_compound_type( hsize_t nfields, size_t size, const char *field_names[], + const size_t *field_offset, const hid_t *field_types ) { - hid_t tid; + hid_t tid; hsize_t i; - + /* Create the memory data type. */ if ((tid = H5Tcreate (H5T_COMPOUND, size )) < 0 ) goto out; /* Insert fields. */ - for ( i = 0; i < nfields; i++) + for ( i = 0; i < nfields; i++) { if ( H5Tinsert(tid, field_names[i], field_offset[i], field_types[i] ) < 0 ) goto out; @@ -1953,7 +1953,7 @@ out: * Function: H5LTrepack * * Purpose: Packs/Unpacks data from buffers. This function transfers data from a packed - * data, src_buf, to a "natural byte aligned" (an n-byte item at an n-byte boundary) + * data, src_buf, to a "natural byte aligned" (an n-byte item at an n-byte boundary) * data, dst_buf, and vice-versa. * * Return: Success: 0, Failure: -1 @@ -1962,7 +1962,7 @@ out: * * Date: January 17, 2002 * - * Comments: + * Comments: * * Modifications: * @@ -1970,16 +1970,16 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LTrepack( hsize_t nfields, - hsize_t nrecords, - size_t src_size, - const size_t *src_offset, - const size_t *src_sizes, - size_t dst_size, - const size_t *dst_offset, +herr_t H5LTrepack( hsize_t nfields, + hsize_t nrecords, + size_t src_size, + const size_t *src_offset, + const size_t *src_sizes, + size_t dst_size, + const size_t *dst_offset, const size_t *dst_sizes, - unsigned char *src_buf, - unsigned char *dst_buf ) + unsigned char *src_buf, + unsigned char *dst_buf ) { hsize_t i, j; /* size of each field of destination data counting with padding */ @@ -2011,12 +2011,12 @@ herr_t H5LTrepack( hsize_t nfields, src_buf += src_sizes[j]; } - + } - + if ( size_pad != NULL ) free( size_pad ); - + return 0; out: @@ -2026,9 +2026,9 @@ out: /*------------------------------------------------------------------------- - * + * * Get attribute functions - * + * *------------------------------------------------------------------------- */ @@ -2052,10 +2052,10 @@ out: */ -herr_t H5LTget_attribute_string( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_string( hid_t loc_id, + const char *obj_name, const char *attr_name, - char *data ) + char *data ) { /* identifiers */ @@ -2065,7 +2065,7 @@ herr_t H5LTget_attribute_string( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2099,10 +2099,10 @@ herr_t H5LTget_attribute_string( hid_t loc_id, * *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_char( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_char( hid_t loc_id, + const char *obj_name, const char *attr_name, - char *data ) + char *data ) { /* identifiers */ @@ -2112,7 +2112,7 @@ herr_t H5LTget_attribute_char( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2146,10 +2146,10 @@ herr_t H5LTget_attribute_char( hid_t loc_id, * *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_uchar( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_uchar( hid_t loc_id, + const char *obj_name, const char *attr_name, - unsigned char *data ) + unsigned char *data ) { /* identifiers */ @@ -2159,7 +2159,7 @@ herr_t H5LTget_attribute_uchar( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2195,10 +2195,10 @@ herr_t H5LTget_attribute_uchar( hid_t loc_id, * *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_short( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_short( hid_t loc_id, + const char *obj_name, const char *attr_name, - short *data ) + short *data ) { /* identifiers */ @@ -2208,7 +2208,7 @@ herr_t H5LTget_attribute_short( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2242,10 +2242,10 @@ herr_t H5LTget_attribute_short( hid_t loc_id, * *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_ushort( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_ushort( hid_t loc_id, + const char *obj_name, const char *attr_name, - unsigned short *data ) + unsigned short *data ) { /* identifiers */ @@ -2255,7 +2255,7 @@ herr_t H5LTget_attribute_ushort( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2291,10 +2291,10 @@ herr_t H5LTget_attribute_ushort( hid_t loc_id, * *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_int( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_int( hid_t loc_id, + const char *obj_name, const char *attr_name, - int *data ) + int *data ) { /* identifiers */ @@ -2304,7 +2304,7 @@ herr_t H5LTget_attribute_int( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2338,10 +2338,10 @@ herr_t H5LTget_attribute_int( hid_t loc_id, * *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_uint( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_uint( hid_t loc_id, + const char *obj_name, const char *attr_name, - unsigned int *data ) + unsigned int *data ) { /* identifiers */ @@ -2351,7 +2351,7 @@ herr_t H5LTget_attribute_uint( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2387,10 +2387,10 @@ herr_t H5LTget_attribute_uint( hid_t loc_id, * *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_long( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_long( hid_t loc_id, + const char *obj_name, const char *attr_name, - long *data ) + long *data ) { /* identifiers */ @@ -2400,7 +2400,7 @@ herr_t H5LTget_attribute_long( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2434,10 +2434,10 @@ herr_t H5LTget_attribute_long( hid_t loc_id, * *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_ulong( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_ulong( hid_t loc_id, + const char *obj_name, const char *attr_name, - unsigned long *data ) + unsigned long *data ) { /* identifiers */ @@ -2447,7 +2447,7 @@ herr_t H5LTget_attribute_ulong( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2484,10 +2484,10 @@ herr_t H5LTget_attribute_ulong( hid_t loc_id, */ -herr_t H5LTget_attribute_float( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_float( hid_t loc_id, + const char *obj_name, const char *attr_name, - float *data ) + float *data ) { /* identifiers */ @@ -2497,7 +2497,7 @@ herr_t H5LTget_attribute_float( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2534,10 +2534,10 @@ herr_t H5LTget_attribute_float( hid_t loc_id, */ -herr_t H5LTget_attribute_double( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_double( hid_t loc_id, + const char *obj_name, const char *attr_name, - double *data ) + double *data ) { /* identifiers */ @@ -2547,7 +2547,7 @@ herr_t H5LTget_attribute_double( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2584,11 +2584,11 @@ herr_t H5LTget_attribute_double( hid_t loc_id, */ -herr_t H5LTget_attribute( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute( hid_t loc_id, + const char *obj_name, const char *attr_name, hid_t mem_type_id, - void *data ) + void *data ) { /* identifiers */ @@ -2598,7 +2598,7 @@ herr_t H5LTget_attribute( hid_t loc_id, /* Get the type of object */ if (H5Gget_objinfo(loc_id, obj_name, 1, &statbuf)<0) return -1; - + /* Open the object */ if ((obj_id = H5LT_open_id( loc_id, obj_name, statbuf.type )) < 0) return -1; @@ -2637,10 +2637,10 @@ herr_t H5LTget_attribute( hid_t loc_id, */ -herr_t H5LT_get_attribute_mem( hid_t obj_id, +herr_t H5LT_get_attribute_mem( hid_t obj_id, const char *attr_name, hid_t mem_type_id, - void *data ) + void *data ) { /* identifiers */ @@ -2680,9 +2680,9 @@ out: *------------------------------------------------------------------------- */ -herr_t H5LT_get_attribute_disk( hid_t loc_id, +herr_t H5LT_get_attribute_disk( hid_t loc_id, const char *attr_name, - void *attr_out ) + void *attr_out ) { /* identifiers */ hid_t attr_id; @@ -2696,7 +2696,7 @@ herr_t H5LT_get_attribute_disk( hid_t loc_id, if ( H5Aread( attr_id, attr_type, attr_out ) < 0 ) goto out; - + if ( H5Tclose( attr_type ) < 0 ) goto out; diff --git a/hl/src/H5LT.h b/hl/src/H5LT.h index aa4b1b1..a0002aa 100644 --- a/hl/src/H5LT.h +++ b/hl/src/H5LT.h @@ -36,51 +36,51 @@ extern "C" { *------------------------------------------------------------------------- */ -herr_t H5LTmake_dataset( hid_t loc_id, - const char *dset_name, - int rank, +herr_t H5LTmake_dataset( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, hid_t type_id, const void *buffer ); -herr_t H5LTmake_dataset_char( hid_t loc_id, - const char *dset_name, - int rank, +herr_t H5LTmake_dataset_char( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, const char *buffer ); -herr_t H5LTmake_dataset_short( hid_t loc_id, - const char *dset_name, - int rank, +herr_t H5LTmake_dataset_short( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, const short *buffer ); -herr_t H5LTmake_dataset_int( hid_t loc_id, - const char *dset_name, - int rank, +herr_t H5LTmake_dataset_int( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, const int *buffer ); -herr_t H5LTmake_dataset_long( hid_t loc_id, - const char *dset_name, - int rank, +herr_t H5LTmake_dataset_long( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, const long *buffer ); -herr_t H5LTmake_dataset_float( hid_t loc_id, - const char *dset_name, - int rank, +herr_t H5LTmake_dataset_float( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, const float *buffer ); -herr_t H5LTmake_dataset_double( hid_t loc_id, - const char *dset_name, - int rank, +herr_t H5LTmake_dataset_double( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, const double *buffer ); -herr_t H5LTmake_dataset_string(hid_t loc_id, - const char *dset_name, +herr_t H5LTmake_dataset_string(hid_t loc_id, + const char *dset_name, const char *buf ); @@ -91,36 +91,36 @@ herr_t H5LTmake_dataset_string(hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5LTread_dataset( hid_t loc_id, +herr_t H5LTread_dataset( hid_t loc_id, const char *dset_name, hid_t type_id, void *buffer ); -herr_t H5LTread_dataset_char( hid_t loc_id, +herr_t H5LTread_dataset_char( hid_t loc_id, const char *dset_name, char *buffer ); -herr_t H5LTread_dataset_short( hid_t loc_id, +herr_t H5LTread_dataset_short( hid_t loc_id, const char *dset_name, short *buffer ); -herr_t H5LTread_dataset_int( hid_t loc_id, +herr_t H5LTread_dataset_int( hid_t loc_id, const char *dset_name, int *buffer ); -herr_t H5LTread_dataset_long( hid_t loc_id, +herr_t H5LTread_dataset_long( hid_t loc_id, const char *dset_name, long *buffer ); -herr_t H5LTread_dataset_float( hid_t loc_id, +herr_t H5LTread_dataset_float( hid_t loc_id, const char *dset_name, float *buffer ); -herr_t H5LTread_dataset_double( hid_t loc_id, +herr_t H5LTread_dataset_double( hid_t loc_id, const char *dset_name, double *buffer ); -herr_t H5LTread_dataset_string( hid_t loc_id, +herr_t H5LTread_dataset_string( hid_t loc_id, const char *dset_name, char *buf ); @@ -132,17 +132,17 @@ herr_t H5LTread_dataset_string( hid_t loc_id, */ -herr_t H5LTget_dataset_ndims( hid_t loc_id, +herr_t H5LTget_dataset_ndims( hid_t loc_id, const char *dset_name, int *rank ); -herr_t H5LTget_dataset_info( hid_t loc_id, +herr_t H5LTget_dataset_info( hid_t loc_id, const char *dset_name, hsize_t *dims, H5T_class_t *type_class, size_t *type_size ); -herr_t H5LTfind_dataset( hid_t loc_id, const char *name ); +herr_t H5LTfind_dataset( hid_t loc_id, const char *name ); @@ -154,67 +154,67 @@ herr_t H5LTfind_dataset( hid_t loc_id, const char *name ); */ -herr_t H5LTset_attribute_string( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_string( hid_t loc_id, + const char *obj_name, const char *attr_name, const char *attr_data ); -herr_t H5LTset_attribute_char( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_char( hid_t loc_id, + const char *obj_name, const char *attr_name, const char *buffer, size_t size ); -herr_t H5LTset_attribute_uchar( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_uchar( hid_t loc_id, + const char *obj_name, const char *attr_name, const unsigned char *buffer, size_t size ); -herr_t H5LTset_attribute_short( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_short( hid_t loc_id, + const char *obj_name, const char *attr_name, const short *buffer, size_t size ); -herr_t H5LTset_attribute_ushort( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_ushort( hid_t loc_id, + const char *obj_name, const char *attr_name, const unsigned short *buffer, size_t size ); -herr_t H5LTset_attribute_int( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_int( hid_t loc_id, + const char *obj_name, const char *attr_name, const int *buffer, size_t size ); -herr_t H5LTset_attribute_uint( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_uint( hid_t loc_id, + const char *obj_name, const char *attr_name, const unsigned int *buffer, size_t size ); -herr_t H5LTset_attribute_long( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_long( hid_t loc_id, + const char *obj_name, const char *attr_name, const long *buffer, size_t size ); -herr_t H5LTset_attribute_ulong( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_ulong( hid_t loc_id, + const char *obj_name, const char *attr_name, const unsigned long *buffer, size_t size ); -herr_t H5LTset_attribute_float( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_float( hid_t loc_id, + const char *obj_name, const char *attr_name, const float *buffer, size_t size ); -herr_t H5LTset_attribute_double( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_double( hid_t loc_id, + const char *obj_name, const char *attr_name, const double *buffer, size_t size ); @@ -226,64 +226,64 @@ herr_t H5LTset_attribute_double( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute( hid_t loc_id, + const char *obj_name, const char *attr_name, hid_t mem_type_id, void *data ); -herr_t H5LTget_attribute_string( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_string( hid_t loc_id, + const char *obj_name, const char *attr_name, char *data ); -herr_t H5LTget_attribute_char( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_char( hid_t loc_id, + const char *obj_name, const char *attr_name, char *data ); -herr_t H5LTget_attribute_uchar( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_uchar( hid_t loc_id, + const char *obj_name, const char *attr_name, unsigned char *data ); -herr_t H5LTget_attribute_short( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_short( hid_t loc_id, + const char *obj_name, const char *attr_name, short *data ); -herr_t H5LTget_attribute_ushort( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_ushort( hid_t loc_id, + const char *obj_name, const char *attr_name, unsigned short *data ); -herr_t H5LTget_attribute_int( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_int( hid_t loc_id, + const char *obj_name, const char *attr_name, int *data ); -herr_t H5LTget_attribute_uint( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_uint( hid_t loc_id, + const char *obj_name, const char *attr_name, unsigned int *data ); -herr_t H5LTget_attribute_long( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_long( hid_t loc_id, + const char *obj_name, const char *attr_name, long *data ); -herr_t H5LTget_attribute_ulong( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_ulong( hid_t loc_id, + const char *obj_name, const char *attr_name, unsigned long *data ); -herr_t H5LTget_attribute_float( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_float( hid_t loc_id, + const char *obj_name, const char *attr_name, float *data ); -herr_t H5LTget_attribute_double( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_double( hid_t loc_id, + const char *obj_name, const char *attr_name, double *data ); @@ -296,13 +296,13 @@ herr_t H5LTget_attribute_double( hid_t loc_id, */ -herr_t H5LTget_attribute_ndims( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_ndims( hid_t loc_id, + const char *obj_name, const char *attr_name, int *rank ); -herr_t H5LTget_attribute_info( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_info( hid_t loc_id, + const char *obj_name, const char *attr_name, hsize_t *dims, H5T_class_t *type_class, @@ -320,45 +320,45 @@ herr_t H5LTget_attribute_info( hid_t loc_id, */ -hid_t H5LTcreate_compound_type( hsize_t nfields, size_t size, const char *field_names[], +hid_t H5LTcreate_compound_type( hsize_t nfields, size_t size, const char *field_names[], const size_t *field_offset, const hid_t *field_types ); -herr_t H5LTrepack( hsize_t nfields, - hsize_t nrecords, - size_t src_size, - const size_t *src_offset, - const size_t *src_sizes, - size_t dst_size, - const size_t *dst_offset, +herr_t H5LTrepack( hsize_t nfields, + hsize_t nrecords, + size_t src_size, + const size_t *src_offset, + const size_t *src_sizes, + size_t dst_size, + const size_t *dst_offset, const size_t *dst_sizes, - unsigned char *src_buf, + unsigned char *src_buf, unsigned char *dst_buf ); /*------------------------------------------------------------------------- - * + * * Private functions - * + * *------------------------------------------------------------------------- */ -herr_t H5LT_get_attribute_mem( hid_t obj_id, +herr_t H5LT_get_attribute_mem( hid_t obj_id, const char *attr_name, hid_t mem_type_id, void *data ); -herr_t H5LT_get_attribute_disk( hid_t obj_id, +herr_t H5LT_get_attribute_disk( hid_t obj_id, const char *attr_name, void *data ); -herr_t H5LT_find_attribute( hid_t loc_id, const char *name ); +herr_t H5LT_find_attribute( hid_t loc_id, const char *name ); -herr_t H5LT_set_attribute_numerical( hid_t loc_id, - const char *obj_name, +herr_t H5LT_set_attribute_numerical( hid_t loc_id, + const char *obj_name, const char *attr_name, size_t size, hid_t type_id, diff --git a/hl/src/H5TA.c b/hl/src/H5TA.c index f90819c..548aa24 100644 --- a/hl/src/H5TA.c +++ b/hl/src/H5TA.c @@ -20,25 +20,25 @@ /*------------------------------------------------------------------------- - * + * * Private functions - * + * *------------------------------------------------------------------------- */ -int H5TB_find_field(const char *field, +int H5TB_find_field(const char *field, const char *field_list); -herr_t H5TB_attach_attributes(const char *table_title, - hid_t loc_id, +herr_t H5TB_attach_attributes(const char *table_title, + hid_t loc_id, const char *dset_name, - hsize_t nfields, + hsize_t nfields, hid_t tid ); -hid_t H5TB_create_type(hid_t loc_id, +hid_t H5TB_create_type(hid_t loc_id, const char *dset_name, - size_t dst_size, - const size_t *dst_offset, + size_t dst_size, + const size_t *dst_offset, const size_t *dst_sizes, hid_t ftype_id); @@ -63,14 +63,14 @@ hid_t H5TB_create_type(hid_t loc_id, * * Comments: The data is packed * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ herr_t H5TBmake_table( const char *table_title, - hid_t loc_id, + hid_t loc_id, const char *dset_name, hsize_t nfields, hsize_t nrecords, @@ -81,12 +81,12 @@ herr_t H5TBmake_table( const char *table_title, hsize_t chunk_size, void *fill_data, int compress, - const void *data ) + const void *data ) { hid_t did; - hid_t sid; - hid_t mem_type_id; + hid_t sid; + hid_t mem_type_id; hid_t plist_id; hsize_t dims[1]; hsize_t dims_chunk[1]; @@ -106,7 +106,7 @@ herr_t H5TBmake_table( const char *table_title, return -1; /* Insert fields. */ - for ( i = 0; i < nfields; i++) + for ( i = 0; i < nfields; i++) { if ( H5Tinsert(mem_type_id, field_names[i], field_offset[i], field_types[i] ) < 0 ) return -1; @@ -124,25 +124,25 @@ herr_t H5TBmake_table( const char *table_title, /* Set the fill value using a struct as the data type. */ if ( fill_data ) { - if ( H5Pset_fill_value( plist_id, mem_type_id, fill_data ) < 0 ) + if ( H5Pset_fill_value( plist_id, mem_type_id, fill_data ) < 0 ) return -1; } - /* - Dataset creation property list is modified to use - GZIP compression with the compression effort set to 6. - Note that compression can be used only when dataset is chunked. + /* + Dataset creation property list is modified to use + GZIP compression with the compression effort set to 6. + Note that compression can be used only when dataset is chunked. */ if ( compress ) { - if ( H5Pset_deflate( plist_id, 6) < 0 ) + if ( H5Pset_deflate( plist_id, 6) < 0 ) return -1; } - + /* Create the dataset. */ if ( (did = H5Dcreate( loc_id, dset_name, mem_type_id, sid, plist_id )) < 0 ) goto out; - + /* Only write if there is something to write */ if ( data ) { @@ -150,8 +150,8 @@ herr_t H5TBmake_table( const char *table_title, if ( H5Dwrite( did, mem_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, data ) < 0 ) goto out; } - - /* Terminate access to the data space. */ + + /* Terminate access to the data space. */ if ( H5Sclose( sid ) < 0 ) goto out; @@ -167,7 +167,7 @@ herr_t H5TBmake_table( const char *table_title, * Set the conforming table attributes *------------------------------------------------------------------------- */ - + /* Attach the CLASS attribute */ if ( H5LTset_attribute_string( loc_id, dset_name, "CLASS", "TABLE" ) < 0 ) goto out; @@ -175,7 +175,7 @@ herr_t H5TBmake_table( const char *table_title, /* Attach the VERSION attribute */ if ( H5LTset_attribute_string( loc_id, dset_name, "VERSION", "2.0" ) < 0 ) goto out; - + /* Attach the TITLE attribute */ if ( H5LTset_attribute_string( loc_id, dset_name, "TITLE", table_title ) < 0 ) goto out; @@ -192,7 +192,7 @@ herr_t H5TBmake_table( const char *table_title, strcat( attr_name, aux ); sprintf( aux, "%s", "_NAME" ); strcat( attr_name, aux ); - + /* Attach the attribute */ if ( H5LTset_attribute_string( loc_id, dset_name, attr_name, member_name ) < 0 ) goto out; @@ -210,7 +210,7 @@ herr_t H5TBmake_table( const char *table_title, /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) return -1; - + if (( sid = H5Screate(H5S_SCALAR)) < 0 ) goto out; @@ -228,28 +228,28 @@ herr_t H5TBmake_table( const char *table_title, if ( (attr_id = H5Acreate( did, attr_name, field_types[i], sid, H5P_DEFAULT )) < 0 ) goto out; - + if ( H5Awrite( attr_id, field_types[i], tmp_buf+field_offset[i] ) < 0 ) goto out; - + if ( H5Aclose( attr_id ) < 0 ) goto out; free( member_name ); } - + /* Close the dataset. */ H5Dclose( did ); - /* Close data space. */ + /* Close data space. */ H5Sclose( sid ); } - + /* Release the datatype. */ if ( H5Tclose( mem_type_id ) < 0 ) return -1; - - + + return 0; /* error zone, gracefully close */ @@ -278,7 +278,7 @@ out: * * Return: Success: 0, Failure: -1 * - * Programmers: + * Programmers: * Pedro Vicente, pvn@ncsa.uiuc.edu * Quincey Koziol * @@ -286,25 +286,25 @@ out: * * Comments: Uses memory offsets * - * Modifications: April 1, 2004 - * the DST_SIZES parameter is used to define the memory type ID - * returned by H5TB_create_type + * Modifications: April 1, 2004 + * the DST_SIZES parameter is used to define the memory type ID + * returned by H5TB_create_type * *------------------------------------------------------------------------- */ -herr_t H5TBappend_records( hid_t loc_id, +herr_t H5TBappend_records( hid_t loc_id, const char *dset_name, hsize_t nrecords, size_t dst_size, const size_t *dst_offset, const size_t *dst_sizes, - const void *data ) + const void *data ) { hid_t did; - hid_t tid=-1; + hid_t tid=-1; hid_t mem_type_id=-1; - hsize_t count[1]; + hsize_t count[1]; hsize_t offset[1]; hid_t sid=-1; hid_t mem_space_id=-1; @@ -356,14 +356,14 @@ herr_t H5TBappend_records( hid_t loc_id, if ( H5Dwrite( did, mem_type_id, mem_space_id, sid, H5P_DEFAULT, data ) < 0 ) goto out; - + /* Terminate access to the dataspace */ if ( H5Sclose( mem_space_id ) < 0 ) goto out; if ( H5Sclose( sid ) < 0 ) goto out; - + /* Release the datatype. */ if ( H5Tclose( tid ) < 0 ) return -1; @@ -376,7 +376,7 @@ herr_t H5TBappend_records( hid_t loc_id, if ( H5Dclose( did ) < 0 ) goto out; - + return 0; /* error zone, gracefully close */ @@ -404,27 +404,27 @@ out: * * Comments: Uses memory offsets * - * Modifications: April 1, 2004 - * the DST_SIZES parameter is used to define the memory type ID - * returned by H5TB_create_type + * Modifications: April 1, 2004 + * the DST_SIZES parameter is used to define the memory type ID + * returned by H5TB_create_type * *------------------------------------------------------------------------- */ -herr_t H5TBwrite_records( hid_t loc_id, +herr_t H5TBwrite_records( hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nrecords, size_t dst_size, const size_t *dst_offset, const size_t *dst_sizes, - const void *data ) + const void *data ) { hid_t did; - hid_t tid; - hsize_t count[1]; + hid_t tid; + hsize_t count[1]; hsize_t offset[1]; hid_t sid=-1; hid_t mem_space_id=-1; @@ -453,7 +453,7 @@ herr_t H5TBwrite_records( hid_t loc_id, if ( start + nrecords > dims[0] ) goto out; - + /* Define a hyperslab in the dataset of the size of the records */ offset[0] = start; count[0] = nrecords; @@ -475,7 +475,7 @@ herr_t H5TBwrite_records( hid_t loc_id, /* Terminate access to the dataspace */ if ( H5Sclose( sid ) < 0 ) goto out; - + /* Release the datatype. */ if ( H5Tclose( tid ) < 0 ) goto out; @@ -488,7 +488,7 @@ herr_t H5TBwrite_records( hid_t loc_id, if ( H5Dclose( did ) < 0 ) return -1; - + return 0; /* error zone, gracefully close */ @@ -516,13 +516,13 @@ out: * * Comments: * - * Modifications: April 1, 2004 - * the DST_SIZES parameter is used to define the memory type ID - * returned by H5TB_create_type + * Modifications: April 1, 2004 + * the DST_SIZES parameter is used to define the memory type ID + * returned by H5TB_create_type * *------------------------------------------------------------------------- */ -herr_t H5TBwrite_fields_name( hid_t loc_id, +herr_t H5TBwrite_fields_name( hid_t loc_id, const char *dset_name, const char *field_names, hsize_t start, @@ -530,15 +530,15 @@ herr_t H5TBwrite_fields_name( hid_t loc_id, size_t type_size, const size_t *field_offset, const size_t *dst_sizes, - const void *data ) + const void *data ) { hid_t did; - hid_t tid=-1; + hid_t tid=-1; hid_t write_type_id=-1; hid_t member_type_id; hid_t nmtype_id; - hsize_t count[1]; + hsize_t count[1]; hsize_t offset[1]; hid_t sid=-1; char *member_name; @@ -548,9 +548,9 @@ herr_t H5TBwrite_fields_name( hid_t loc_id, size_t size_native; /* Create xfer properties to preserve initialized data */ - if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0) + if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0) return -1; - if (H5Pset_preserve (PRESERVE, 1)<0) + if (H5Pset_preserve (PRESERVE, 1)<0) return -1; /* Open the dataset. */ @@ -560,7 +560,7 @@ herr_t H5TBwrite_fields_name( hid_t loc_id, /* Get the datatype */ if ( (tid = H5Dget_type( did )) < 0 ) goto out; - + /* Get the number of fields */ if ( ( nfields = H5Tget_nmembers( tid )) < 0 ) goto out; @@ -587,9 +587,9 @@ herr_t H5TBwrite_fields_name( hid_t loc_id, /* Convert to native type */ if ((nmtype_id=H5Tget_native_type(member_type_id,H5T_DIR_DEFAULT))<0) goto out; - + size_native=H5Tget_size(nmtype_id); - + /* Adjust, if necessary */ if (dst_sizes[j]!=size_native) { @@ -636,7 +636,7 @@ herr_t H5TBwrite_fields_name( hid_t loc_id, /* Write */ if ( H5Dwrite( did, write_type_id, H5S_ALL, sid, PRESERVE, data ) < 0 ) goto out; - + /* End access to the write id */ if ( H5Tclose( write_type_id ) ) goto out; @@ -652,7 +652,7 @@ herr_t H5TBwrite_fields_name( hid_t loc_id, /* End access to the property list */ if ( H5Pclose( PRESERVE ) < 0 ) return -1; - + return 0; /* error zone, gracefully close */ @@ -683,15 +683,15 @@ out: * * Comments: Uses memory offsets * - * Modifications: April 1, 2004 - * the DST_SIZES parameter is used to define the memory type ID - * returned by H5TB_create_type + * Modifications: April 1, 2004 + * the DST_SIZES parameter is used to define the memory type ID + * returned by H5TB_create_type * *------------------------------------------------------------------------- */ -herr_t H5TBwrite_fields_index( hid_t loc_id, +herr_t H5TBwrite_fields_index( hid_t loc_id, const char *dset_name, hsize_t nfields, const int *field_index, @@ -700,15 +700,15 @@ herr_t H5TBwrite_fields_index( hid_t loc_id, size_t type_size, const size_t *field_offset, const size_t *dst_sizes, - const void *data ) + const void *data ) { hid_t did; - hid_t tid=-1; + hid_t tid=-1; hid_t write_type_id=-1; hid_t member_type_id; hid_t nmtype_id; - hsize_t count[1]; + hsize_t count[1]; hsize_t offset[1]; hid_t sid=-1; char *member_name; @@ -717,9 +717,9 @@ herr_t H5TBwrite_fields_index( hid_t loc_id, size_t size_native; /* Create xfer properties to preserve initialized data */ - if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0) + if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0) return -1; - if (H5Pset_preserve (PRESERVE, 1)<0) + if (H5Pset_preserve (PRESERVE, 1)<0) return -1; /* Open the dataset. */ @@ -729,11 +729,11 @@ herr_t H5TBwrite_fields_index( hid_t loc_id, /* Get the datatype */ if ( (tid = H5Dget_type( did )) < 0 ) goto out; - + /* Get the number of fields */ if ( H5Tget_nmembers( tid ) < 0 ) goto out; - + /* Create a write id */ if ( ( write_type_id = H5Tcreate( H5T_COMPOUND, type_size )) < 0 ) goto out; @@ -744,7 +744,7 @@ herr_t H5TBwrite_fields_index( hid_t loc_id, { j = field_index[i]; - + /* Get the member name */ member_name = H5Tget_member_name( tid, (unsigned) j ); @@ -755,9 +755,9 @@ herr_t H5TBwrite_fields_index( hid_t loc_id, /* Convert to native type */ if ((nmtype_id=H5Tget_native_type(member_type_id,H5T_DIR_DEFAULT))<0) goto out; - + size_native=H5Tget_size(nmtype_id); - + if (dst_sizes[i]!=size_native) { if (H5Tset_size(nmtype_id, dst_sizes[i])<0) @@ -783,7 +783,7 @@ herr_t H5TBwrite_fields_index( hid_t loc_id, goto out; free( member_name ); - + } /* Get the dataspace handle */ @@ -799,7 +799,7 @@ herr_t H5TBwrite_fields_index( hid_t loc_id, /* Write */ if ( H5Dwrite( did, write_type_id, H5S_ALL, sid, PRESERVE, data ) < 0 ) goto out; - + /* End access to the write id */ if ( H5Tclose( write_type_id ) ) goto out; @@ -815,7 +815,7 @@ herr_t H5TBwrite_fields_index( hid_t loc_id, /* End access to the property list */ if ( H5Pclose( PRESERVE ) < 0 ) return -1; - + return 0; /* error zone, gracefully close */ @@ -852,25 +852,25 @@ out: * * Comments: * - * Modifications: April 1, 2004 + * Modifications: April 1, 2004 * used a memory type ID returned by H5TB_create_type * *------------------------------------------------------------------------- */ -herr_t H5TBread_table( hid_t loc_id, +herr_t H5TBread_table( hid_t loc_id, const char *dset_name, - size_t dst_size, - const size_t *dst_offset, + size_t dst_size, + const size_t *dst_offset, const size_t *dst_sizes, - void *dst_buf ) + void *dst_buf ) { hid_t did; - hid_t ftype_id=-1; + hid_t ftype_id=-1; hid_t mem_type_id=-1; hid_t sid; hsize_t dims[1]; - + /* open the dataset. */ if ((did=H5Dopen(loc_id,dset_name))<0) return -1; @@ -878,13 +878,13 @@ herr_t H5TBread_table( hid_t loc_id, /* get the dataspace handle */ if ( (sid = H5Dget_space( did )) < 0 ) goto out; - + /* get dimensions */ if ( H5Sget_simple_extent_dims( sid, dims, NULL) < 0 ) goto out; /* get the datatypes */ - if ((ftype_id=H5Dget_type (did))<0) + if ((ftype_id=H5Dget_type (did))<0) goto out; if ((mem_type_id=H5TB_create_type(loc_id,dset_name,dst_size,dst_offset,dst_sizes,ftype_id))<0) @@ -928,30 +928,30 @@ out: * * Date: November 19, 2001 * - * Comments: + * Comments: * - * Modifications: April 1, 2004 - * the DST_SIZES parameter is used to define the memory type ID - * returned by H5TB_create_type + * Modifications: April 1, 2004 + * the DST_SIZES parameter is used to define the memory type ID + * returned by H5TB_create_type * *------------------------------------------------------------------------- */ -herr_t H5TBread_records( hid_t loc_id, +herr_t H5TBread_records( hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nrecords, size_t dst_size, const size_t *dst_offset, const size_t *dst_sizes, - void *data ) + void *data ) { hid_t did; - hid_t ftype_id; + hid_t ftype_id; hid_t mem_type_id=-1; - hsize_t count[1]; + hsize_t count[1]; hsize_t offset[1]; hid_t sid=-1; hsize_t dims[1]; @@ -971,7 +971,7 @@ herr_t H5TBread_records( hid_t loc_id, /* get the datatypes */ if ( (ftype_id = H5Dget_type( did )) < 0 ) goto out; - + if ((mem_type_id=H5TB_create_type(loc_id,dset_name,dst_size,dst_offset,dst_sizes,ftype_id))<0) goto out; @@ -1042,15 +1042,15 @@ out: * * Comments: * - * Modifications: April 1, 2004 - * the DST_SIZES parameter is used to define the memory type ID - * returned by H5TB_create_type + * Modifications: April 1, 2004 + * the DST_SIZES parameter is used to define the memory type ID + * returned by H5TB_create_type * *------------------------------------------------------------------------- */ -herr_t H5TBread_fields_name( hid_t loc_id, +herr_t H5TBread_fields_name( hid_t loc_id, const char *dset_name, const char *field_names, hsize_t start, @@ -1058,24 +1058,24 @@ herr_t H5TBread_fields_name( hid_t loc_id, size_t type_size, const size_t *field_offset, const size_t *dst_sizes, - void *data ) + void *data ) { hid_t did; - hid_t ftype_id=-1; + hid_t ftype_id=-1; hid_t mem_type_id=-1; hid_t mtype_id; hid_t nmtype_id; char *member_name; hssize_t nfields; - hsize_t count[1]; + hsize_t count[1]; hsize_t offset[1]; hid_t sid=-1; hid_t mem_space_id=-1; hsize_t mem_size[1]; size_t size_native; hssize_t i, j; - + /* open the dataset */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) goto out; @@ -1107,9 +1107,9 @@ herr_t H5TBread_fields_name( hid_t loc_id, /* convert to native type */ if ((nmtype_id=H5Tget_native_type(mtype_id,H5T_DIR_DEFAULT))<0) goto out; - + size_native=H5Tget_size(nmtype_id); - + if (dst_sizes[j]!=size_native) { if (H5Tset_size(nmtype_id, dst_sizes[j])<0) @@ -1167,7 +1167,7 @@ herr_t H5TBread_fields_name( hid_t loc_id, goto out; if ( H5Dclose( did ) < 0 ) return -1; - + return 0; /* error zone, gracefully close */ @@ -1197,15 +1197,15 @@ out: * * Comments: * - * Modifications: April 1, 2004 - * the DST_SIZES parameter is used to define the memory type ID - * returned by H5TB_create_type + * Modifications: April 1, 2004 + * the DST_SIZES parameter is used to define the memory type ID + * returned by H5TB_create_type * *------------------------------------------------------------------------- */ -herr_t H5TBread_fields_index( hid_t loc_id, +herr_t H5TBread_fields_index( hid_t loc_id, const char *dset_name, hsize_t nfields, const int *field_index, @@ -1214,16 +1214,16 @@ herr_t H5TBread_fields_index( hid_t loc_id, size_t type_size, const size_t *field_offset, const size_t *dst_sizes, - void *data ) + void *data ) { hid_t did; - hid_t tid=-1; + hid_t tid=-1; hid_t read_type_id=-1; hid_t member_type_id; hid_t nmtype_id; char *member_name; - hsize_t count[1]; + hsize_t count[1]; hsize_t offset[1]; hid_t sid=-1; hid_t mem_space_id=-1; @@ -1247,7 +1247,7 @@ herr_t H5TBread_fields_index( hid_t loc_id, for ( i = 0; i < nfields; i++) { j = field_index[i]; - + /* Get the member name */ member_name = H5Tget_member_name( tid, (unsigned) j ); @@ -1258,13 +1258,13 @@ herr_t H5TBread_fields_index( hid_t loc_id, /* Get the member size */ if ( H5Tget_size( member_type_id ) == 0 ) goto out; - + /* Convert to native type */ if ((nmtype_id=H5Tget_native_type(member_type_id,H5T_DIR_DEFAULT))<0) goto out; - + size_native=H5Tget_size(nmtype_id); - + if (dst_sizes[i]!=size_native) { if (H5Tset_size(nmtype_id, dst_sizes[i])<0) @@ -1282,7 +1282,7 @@ herr_t H5TBread_fields_index( hid_t loc_id, if ( H5Tinsert( read_type_id, member_name, 0, nmtype_id ) < 0 ) goto out; } - + /* Close the member type */ if ( H5Tclose( member_type_id ) < 0 ) goto out; @@ -1301,7 +1301,7 @@ herr_t H5TBread_fields_index( hid_t loc_id, count[0] = nrecords; if ( H5Sselect_hyperslab( sid, H5S_SELECT_SET, offset, NULL, count, NULL) < 0 ) goto out; - + /* Create a memory dataspace handle */ mem_size[0] = count[0]; if ( (mem_space_id = H5Screate_simple( 1, mem_size, NULL )) < 0 ) @@ -1318,7 +1318,7 @@ herr_t H5TBread_fields_index( hid_t loc_id, /* Terminate access to the memory dataspace */ if ( H5Sclose( mem_space_id ) < 0 ) goto out; - + /* End access to the read id */ if ( H5Tclose( read_type_id ) ) goto out; @@ -1330,7 +1330,7 @@ herr_t H5TBread_fields_index( hid_t loc_id, /* End access to the dataset */ if ( H5Dclose( did ) < 0 ) return -1; - + return 0; /* error zone, gracefully close */ @@ -1371,7 +1371,7 @@ out: *------------------------------------------------------------------------- */ -herr_t H5TBdelete_record( hid_t loc_id, +herr_t H5TBdelete_record( hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nrecords ) @@ -1382,8 +1382,8 @@ herr_t H5TBdelete_record( hid_t loc_id, hsize_t read_start; hsize_t read_nrecords; hid_t did; - hid_t tid; - hsize_t count[1]; + hid_t tid; + hsize_t count[1]; hsize_t offset[1]; hid_t sid; hid_t mem_space_id; @@ -1397,7 +1397,7 @@ herr_t H5TBdelete_record( hid_t loc_id, hsize_t dims[1]; #endif - + /*------------------------------------------------------------------------- * First we get information about type size and offsets on disk *------------------------------------------------------------------------- @@ -1412,11 +1412,11 @@ herr_t H5TBdelete_record( hid_t loc_id, if ( src_offset == NULL ) return -1; - + /* Get field info */ if ( H5TBget_field_info( loc_id, dset_name, NULL, src_sizes, src_offset, &src_size ) < 0 ) return -1; - + /*------------------------------------------------------------------------- * Read the records after the deleted one(s) *------------------------------------------------------------------------- @@ -1430,7 +1430,7 @@ herr_t H5TBdelete_record( hid_t loc_id, return -1; /* Read the records after the deleted one(s) */ - if ( H5TBread_records( loc_id, dset_name, read_start, read_nrecords, src_size, + if ( H5TBread_records( loc_id, dset_name, read_start, read_nrecords, src_size, src_offset, src_sizes, tmp_buf ) < 0 ) return -1; @@ -1443,7 +1443,7 @@ herr_t H5TBdelete_record( hid_t loc_id, /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) return -1; - + /* Get the datatype */ if ( (tid = H5Dget_type( did )) < 0 ) goto out; @@ -1492,11 +1492,11 @@ herr_t H5TBdelete_record( hid_t loc_id, /* End access to the dataset */ if ( H5Dclose( did ) < 0 ) return -1; - + free( tmp_buf ); free( src_offset ); free( src_sizes ); - + /*------------------------------------------------------------------------- * Store the new dimension as an attribute @@ -1505,11 +1505,11 @@ herr_t H5TBdelete_record( hid_t loc_id, nrows = ntotal_records - nrecords; /* Set the attribute */ - if (H5LT_set_attribute_numerical(loc_id,dset_name,"NROWS",1, + if (H5LT_set_attribute_numerical(loc_id,dset_name,"NROWS",1, H5T_NATIVE_LLONG,&nrows)<0) return -1; - + return 0; out: @@ -1530,15 +1530,15 @@ out: * * Comments: Uses memory offsets * - * Modifications: April 1, 2004 - * the DST_SIZES parameter is used to define the memory type ID - * returned by H5TB_create_type + * Modifications: April 1, 2004 + * the DST_SIZES parameter is used to define the memory type ID + * returned by H5TB_create_type * *------------------------------------------------------------------------- */ -herr_t H5TBinsert_record( hid_t loc_id, +herr_t H5TBinsert_record( hid_t loc_id, const char *dset_name, hsize_t start, hsize_t nrecords, @@ -1552,18 +1552,18 @@ herr_t H5TBinsert_record( hid_t loc_id, hsize_t ntotal_records; hsize_t read_nrecords; hid_t did; - hid_t tid=-1; + hid_t tid=-1; hid_t mem_type_id=-1; - hsize_t count[1]; + hsize_t count[1]; hsize_t offset[1]; hid_t sid=-1; hid_t mem_space_id=-1; hsize_t dims[1]; hsize_t mem_dims[1]; unsigned char *tmp_buf; - + /*------------------------------------------------------------------------- - * Read the records after the inserted one(s) + * Read the records after the inserted one(s) *------------------------------------------------------------------------- */ @@ -1587,7 +1587,7 @@ herr_t H5TBinsert_record( hid_t loc_id, tmp_buf = (unsigned char *)calloc((size_t) read_nrecords, dst_size ); /* Read the records after the inserted one(s) */ - if ( H5TBread_records( loc_id, dset_name, start, read_nrecords, dst_size, dst_offset, + if ( H5TBread_records( loc_id, dset_name, start, read_nrecords, dst_size, dst_offset, dst_sizes, tmp_buf ) < 0 ) return -1; @@ -1596,7 +1596,7 @@ herr_t H5TBinsert_record( hid_t loc_id, if ( H5Dextend ( did, dims ) < 0 ) goto out; - + /*------------------------------------------------------------------------- * Write the inserted records *------------------------------------------------------------------------- @@ -1619,13 +1619,13 @@ herr_t H5TBinsert_record( hid_t loc_id, if ( H5Dwrite( did, mem_type_id, mem_space_id, sid, H5P_DEFAULT, data ) < 0 ) goto out; - + /* Terminate access to the dataspace */ if ( H5Sclose( mem_space_id ) < 0 ) goto out; if ( H5Sclose( sid ) < 0 ) goto out; - + /*------------------------------------------------------------------------- * Write the "pushed down" records *------------------------------------------------------------------------- @@ -1648,7 +1648,7 @@ herr_t H5TBinsert_record( hid_t loc_id, if ( H5Dwrite( did, mem_type_id, mem_space_id, sid, H5P_DEFAULT, tmp_buf ) < 0 ) goto out; - + /* Terminate access to the dataspace */ if ( H5Sclose( mem_space_id ) < 0 ) goto out; @@ -1695,7 +1695,7 @@ out: * * Date: December 5, 2001 * - * Comments: + * Comments: * * Modifications: * @@ -1703,22 +1703,22 @@ out: *------------------------------------------------------------------------- */ -herr_t H5TBadd_records_from( hid_t loc_id, +herr_t H5TBadd_records_from( hid_t loc_id, const char *dset_name1, hsize_t start1, hsize_t nrecords, const char *dset_name2, - hsize_t start2 ) + hsize_t start2 ) { /* Identifiers for the 1st dataset. */ hid_t dataset_id1; - hid_t type_id1; + hid_t type_id1; hid_t space_id1=-1; hid_t mem_space_id1=-1; size_t type_size1; - hsize_t count[1]; + hsize_t count[1]; hsize_t offset[1]; hsize_t mem_size[1]; hsize_t nfields; @@ -1742,13 +1742,13 @@ herr_t H5TBadd_records_from( hid_t loc_id, if ( src_offset == NULL ) return -1; - + /* Get field info */ if ( H5TBget_field_info( loc_id, dset_name1, NULL, src_sizes, src_offset, &src_size ) < 0 ) return -1; - + /*------------------------------------------------------------------------- - * Get information about the first table and read it + * Get information about the first table and read it *------------------------------------------------------------------------- */ @@ -1785,12 +1785,12 @@ herr_t H5TBadd_records_from( hid_t loc_id, goto out; /*------------------------------------------------------------------------- - * Add to the second table + * Add to the second table *------------------------------------------------------------------------- */ if ( H5TBinsert_record(loc_id,dset_name2,start2,nrecords,src_size,src_offset,src_sizes,tmp_buf ) < 0 ) goto out; - + /*------------------------------------------------------------------------- * Close resources for table 1 *------------------------------------------------------------------------- @@ -1803,7 +1803,7 @@ herr_t H5TBadd_records_from( hid_t loc_id, /* Terminate access to the dataspace */ if ( H5Sclose( space_id1 ) < 0 ) goto out; - + /* Release the datatype. */ if ( H5Tclose( type_id1 ) < 0 ) return -1; @@ -1815,7 +1815,7 @@ herr_t H5TBadd_records_from( hid_t loc_id, free( tmp_buf ); free( src_offset ); free( src_sizes ); - + return 0; /* error zone, gracefully close */ @@ -1841,14 +1841,14 @@ out: * * Date: December 10, 2001 * - * Comments: + * Comments: * * Modifications: * * *------------------------------------------------------------------------- */ -herr_t H5TBcombine_tables( hid_t loc_id1, +herr_t H5TBcombine_tables( hid_t loc_id1, const char *dset_name1, hid_t loc_id2, const char *dset_name2, @@ -1857,23 +1857,23 @@ herr_t H5TBcombine_tables( hid_t loc_id1, /* Identifiers for the 1st dataset. */ hid_t dataset_id1; - hid_t type_id1; + hid_t type_id1; hid_t space_id1; hid_t plist_id1; /* Identifiers for the 2nd dataset. */ hid_t dataset_id2; - hid_t type_id2; + hid_t type_id2; hid_t space_id2; hid_t plist_id2; /* Identifiers for the 3rd dataset. */ hid_t dataset_id3; - hid_t type_id3; + hid_t type_id3; hid_t space_id3; hid_t plist_id3; - hsize_t count[1]; + hsize_t count[1]; hsize_t offset[1]; hid_t mem_space_id; hsize_t mem_size[1]; @@ -1881,7 +1881,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1, hsize_t nrecords; hsize_t dims[1]; hsize_t maxdims[1] = { H5S_UNLIMITED }; - + size_t type_size; hid_t sid; @@ -1913,13 +1913,13 @@ herr_t H5TBcombine_tables( hid_t loc_id1, if ( src_offset == NULL ) return -1; - + /* Get field info */ if ( H5TBget_field_info( loc_id1, dset_name1, NULL, src_sizes, src_offset, &src_size ) < 0 ) return -1; /*------------------------------------------------------------------------- - * Get information about the first table + * Get information about the first table *------------------------------------------------------------------------- */ @@ -1942,7 +1942,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1, /* Get the dimensions */ if ( H5TBget_table_info ( loc_id1, dset_name1, &nfields, &nrecords ) < 0 ) return -1; - + /*------------------------------------------------------------------------- * Make the merged table with no data originally *------------------------------------------------------------------------- @@ -1997,44 +1997,44 @@ herr_t H5TBcombine_tables( hid_t loc_id1, */ if ( has_fill == 1 ) { - + if (( sid = H5Screate(H5S_SCALAR)) < 0 ) goto out; - + for ( i = 0; i < nfields; i++) { - + /* Get the member type */ if ( ( member_type_id = H5Tget_member_type( type_id3, (unsigned) i )) < 0 ) goto out; - + /* Get the member offset */ member_offset = H5Tget_member_offset( type_id3, (unsigned) i ); - + strcpy( attr_name, "FIELD_" ); sprintf( aux, "%d", (int) i ); strcat( attr_name, aux ); sprintf( aux, "%s", "_FILL" ); strcat( attr_name, aux ); - + if ( (attr_id = H5Acreate( dataset_id3, attr_name, member_type_id, sid, H5P_DEFAULT )) < 0 ) goto out; - + if ( H5Awrite( attr_id, member_type_id, tmp_fill_buf+member_offset ) < 0 ) goto out; - + if ( H5Aclose( attr_id ) < 0 ) goto out; if ( H5Tclose( member_type_id ) < 0 ) goto out; } - - /* Close data space. */ + + /* Close data space. */ if ( H5Sclose( sid ) < 0 ) goto out; } - + /*------------------------------------------------------------------------- * Read data from 1st table *------------------------------------------------------------------------- @@ -2055,7 +2055,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1, if ( H5Dread( dataset_id1, type_id1, mem_space_id, space_id1, H5P_DEFAULT, tmp_buf ) < 0 ) goto out; - + /*------------------------------------------------------------------------- * Save data from 1st table into new table *------------------------------------------------------------------------- @@ -2077,7 +2077,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1, /* Terminate access to the dataspace */ if ( H5Sclose( space_id1 ) < 0 ) goto out; - + /* Release the datatype. */ if ( H5Tclose( type_id1 ) < 0 ) goto out; @@ -2094,7 +2094,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1, free( tmp_buf ); /*------------------------------------------------------------------------- - * Get information about the 2nd table + * Get information about the 2nd table *------------------------------------------------------------------------- */ @@ -2139,7 +2139,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1, if ( H5Dread( dataset_id2, type_id2, mem_space_id, space_id2, H5P_DEFAULT, tmp_buf ) < 0 ) goto out; - + /*------------------------------------------------------------------------- * Save data from 2nd table into new table *------------------------------------------------------------------------- @@ -2161,7 +2161,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1, /* Terminate access to the dataspace */ if ( H5Sclose( space_id2 ) < 0 ) goto out; - + /* Release the datatype. */ if ( H5Tclose( type_id2 ) < 0 ) return -1; @@ -2182,7 +2182,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1, /* Terminate access to the dataspace */ if ( H5Sclose( space_id3 ) < 0 ) return -1; - + /* Release the datatype. */ if ( H5Tclose( type_id3 ) < 0 ) return -1; @@ -2222,32 +2222,32 @@ out: * * Date: January 30, 2002 * - * Comments: + * Comments: * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ -herr_t H5TBinsert_field( hid_t loc_id, +herr_t H5TBinsert_field( hid_t loc_id, const char *dset_name, const char *field_name, hid_t field_type, hsize_t position, const void *fill_data, - const void *data ) + const void *data ) { /* Identifiers for the 1st, original dataset */ hid_t dataset_id1; - hid_t type_id1; + hid_t type_id1; hid_t space_id1; hid_t plist_id1; hid_t mem_space_id1; /* Identifiers for the 2nd, new dataset */ hid_t dataset_id2; - hid_t type_id2; + hid_t type_id2; hid_t space_id2; hid_t plist_id2; hid_t mem_space_id2; @@ -2262,7 +2262,7 @@ herr_t H5TBinsert_field( hid_t loc_id, hsize_t dims_chunk[1]; hsize_t dims[1]; hsize_t maxdims[1] = { H5S_UNLIMITED }; - hsize_t count[1]; + hsize_t count[1]; hsize_t offset[1]; hsize_t mem_size[1]; hid_t write_type_id; @@ -2282,16 +2282,16 @@ herr_t H5TBinsert_field( hid_t loc_id, /* Get the number of records and fields */ if ( H5TBget_table_info ( loc_id, dset_name, &nfields, &nrecords ) < 0 ) return -1; - + /*------------------------------------------------------------------------- * Get information about the old data type *------------------------------------------------------------------------- */ - + /* Open the dataset. */ if ( (dataset_id1 = H5Dopen( loc_id, dset_name )) < 0 ) return -1; - + /* Get creation properties list */ if ( (plist_id1 = H5Dget_create_plist( dataset_id1 )) < 0 ) goto out; @@ -2303,7 +2303,7 @@ herr_t H5TBinsert_field( hid_t loc_id, /* Get the size of the datatype */ if ( ( total_size = H5Tget_size( type_id1 )) == 0 ) goto out; - + /* Get the dataspace handle */ if ( (space_id1 = H5Dget_space( dataset_id1 )) < 0 ) goto out; @@ -2344,7 +2344,7 @@ herr_t H5TBinsert_field( hid_t loc_id, inserted = 0; /* Insert the old fields, counting with the new one */ - for ( i = 0; i < nfields + 1; i++) + for ( i = 0; i < nfields + 1; i++) { idx = i; @@ -2368,7 +2368,7 @@ herr_t H5TBinsert_field( hid_t loc_id, continue; } - + /* Get the member name */ member_name = H5Tget_member_name( type_id1, (unsigned)idx ); @@ -2378,7 +2378,7 @@ herr_t H5TBinsert_field( hid_t loc_id, /* Get the member size */ member_size = H5Tget_size( member_type_id ); - + /* Insert it into the new type */ if ( H5Tinsert( type_id2, member_name, curr_offset, member_type_id ) < 0 ) goto out; @@ -2391,9 +2391,9 @@ herr_t H5TBinsert_field( hid_t loc_id, if ( H5Tclose( member_type_id ) < 0 ) goto out; - + } /* i */ - + /*------------------------------------------------------------------------- * Create a new temporary dataset *------------------------------------------------------------------------- @@ -2438,7 +2438,7 @@ herr_t H5TBinsert_field( hid_t loc_id, if ( H5Dread( dataset_id1, type_id1, mem_space_id1, H5S_ALL, H5P_DEFAULT, tmp_buf ) < 0 ) goto out; - + /*------------------------------------------------------------------------- * Save data from 1st table into new table, using the 1st type id *------------------------------------------------------------------------- @@ -2458,15 +2458,15 @@ herr_t H5TBinsert_field( hid_t loc_id, /* Create a write id */ if ( ( write_type_id = H5Tcreate( H5T_COMPOUND, (size_t)new_member_size )) < 0 ) goto out; - + /* The field in the file is found by its name */ if ( H5Tinsert( write_type_id, field_name, 0, field_type ) < 0 ) goto out; /* Create xfer properties to preserve initialized data */ - if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0) + if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0) goto out; - if (H5Pset_preserve (PRESERVE, 1)<0) + if (H5Pset_preserve (PRESERVE, 1)<0) goto out; /* Only write if there is something to write */ @@ -2499,8 +2499,8 @@ herr_t H5TBinsert_field( hid_t loc_id, /* Terminate access to the memory dataspace */ if ( H5Sclose( mem_space_id1 ) < 0 ) - goto out; - + goto out; + /* Release the datatype. */ if ( H5Tclose( type_id1 ) < 0 ) goto out; @@ -2526,7 +2526,7 @@ herr_t H5TBinsert_field( hid_t loc_id, /* Terminate access to the dataspace */ if ( H5Sclose( space_id2 ) < 0 ) goto out; - + /* Release the datatype. */ if ( H5Tclose( type_id2 ) < 0 ) return -1; @@ -2542,7 +2542,7 @@ herr_t H5TBinsert_field( hid_t loc_id, * Delete 1st table *------------------------------------------------------------------------- */ - if ( H5Gunlink( loc_id, dset_name ) < 0 ) + if ( H5Gunlink( loc_id, dset_name ) < 0 ) return -1; /*------------------------------------------------------------------------- @@ -2550,7 +2550,7 @@ herr_t H5TBinsert_field( hid_t loc_id, *------------------------------------------------------------------------- */ - if ( H5Gmove( loc_id, "new", dset_name ) < 0 ) + if ( H5Gmove( loc_id, "new", dset_name ) < 0 ) return -1; /*------------------------------------------------------------------------- @@ -2598,10 +2598,10 @@ herr_t H5TBinsert_field( hid_t loc_id, if ( (attr_id = H5Acreate( dataset_id1, attr_name, member_type_id, space_id1, H5P_DEFAULT )) < 0 ) goto out; - + if ( H5Awrite( attr_id, member_type_id, tmp_fill_buf+member_offset ) < 0 ) goto out; - + if ( H5Aclose( attr_id ) < 0 ) goto out; @@ -2629,19 +2629,19 @@ herr_t H5TBinsert_field( hid_t loc_id, if ( (attr_id = H5Acreate( dataset_id1, attr_name, member_type_id, space_id1, H5P_DEFAULT )) < 0 ) goto out; - + if ( H5Awrite( attr_id, member_type_id, fill_data ) < 0 ) goto out; - + if ( H5Aclose( attr_id ) < 0 ) goto out; if ( H5Tclose( member_type_id ) < 0 ) goto out; - + } - - /* Close data space. */ + + /* Close data space. */ if ( H5Sclose( space_id1 ) < 0 ) goto out; @@ -2652,12 +2652,12 @@ herr_t H5TBinsert_field( hid_t loc_id, /* End access to the dataset */ if ( H5Dclose( dataset_id1 ) < 0 ) goto out; - + /* Release resources. */ free ( tmp_buf ); free ( tmp_fill_buf ); - + return 0; out: @@ -2676,7 +2676,7 @@ out: * * Date: January 30, 2002 * - * Comments: + * Comments: * * Modifications: * @@ -2684,20 +2684,20 @@ out: *------------------------------------------------------------------------- */ -herr_t H5TBdelete_field( hid_t loc_id, +herr_t H5TBdelete_field( hid_t loc_id, const char *dset_name, - const char *field_name ) + const char *field_name ) { /* Identifiers for the 1st original dataset */ hid_t dataset_id1; - hid_t type_id1; + hid_t type_id1; hid_t space_id1; hid_t plist_id1; /* Identifiers for the 2nd new dataset */ hid_t dataset_id2; - hid_t type_id2; + hid_t type_id2; hid_t space_id2; hid_t plist_id2; @@ -2725,11 +2725,11 @@ herr_t H5TBdelete_field( hid_t loc_id, hid_t attr_id; hsize_t i; int has_fill=0; - + /* Get the number of records and fields */ if ( H5TBget_table_info ( loc_id, dset_name, &nfields, &nrecords ) < 0 ) return -1; - + /*------------------------------------------------------------------------- * Get information about the old data type *------------------------------------------------------------------------- @@ -2749,7 +2749,7 @@ herr_t H5TBdelete_field( hid_t loc_id, /* Get the size of the datatype */ type_size1 = H5Tget_size( type_id1 ); - + /* Get the dataspace handle */ if ( (space_id1 = H5Dget_space( dataset_id1 )) < 0 ) goto out; @@ -2764,9 +2764,9 @@ herr_t H5TBdelete_field( hid_t loc_id, */ /* Check out the field */ - 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 ); @@ -2779,7 +2779,7 @@ herr_t H5TBdelete_field( hid_t loc_id, /* Get the member size */ delete_member_size = H5Tget_size( member_type_id ); - + /* Close the member type */ if ( H5Tclose( member_type_id ) < 0 ) goto out; @@ -2791,7 +2791,7 @@ herr_t H5TBdelete_field( hid_t loc_id, } free( member_name ); - + } /* i */ /* No field to delete was found */ @@ -2818,15 +2818,15 @@ herr_t H5TBdelete_field( hid_t loc_id, * Get attributes from previous table in the process *------------------------------------------------------------------------- */ - + /* Get the table title */ if ( (H5TBAget_title( dataset_id1, table_title )) < 0 ) goto out; /* Insert the old fields except the one to delete */ - 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 ); @@ -2843,11 +2843,11 @@ herr_t H5TBdelete_field( hid_t loc_id, /* Get the member size */ member_size = H5Tget_size( member_type_id ); - + /* Insert it into the new type */ if ( H5Tinsert( type_id2, member_name, curr_offset, member_type_id ) < 0 ) goto out; - + /*------------------------------------------------------------------------- * Get the fill value information *------------------------------------------------------------------------- @@ -2876,9 +2876,9 @@ herr_t H5TBdelete_field( hid_t loc_id, /* Close the member type */ if ( H5Tclose( member_type_id ) < 0 ) goto out; - + } /* i */ - + /*------------------------------------------------------------------------- * Create a new temporary dataset *------------------------------------------------------------------------- @@ -2905,9 +2905,9 @@ 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 ); @@ -2934,23 +2934,23 @@ herr_t H5TBdelete_field( hid_t loc_id, goto out; tmp_buf = (unsigned char *)calloc((size_t) nrecords, member_size ); - + /* Read */ if ( H5Dread( dataset_id1, read_type_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp_buf ) < 0 ) goto out; - + /* Create a write id */ if ( ( write_type_id = H5Tcreate( H5T_COMPOUND, member_size )) < 0 ) goto out; - + /* The field in the file is found by its name */ if ( H5Tinsert( write_type_id, member_name, 0, member_type_id ) < 0 ) goto out; /* Create xfer properties to preserve initialized data */ - if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0) + if ((PRESERVE = H5Pcreate (H5P_DATASET_XFER))<0) goto out; - if (H5Pset_preserve (PRESERVE, 1)<0) + if (H5Pset_preserve (PRESERVE, 1)<0) goto out; /* Write */ @@ -2963,7 +2963,7 @@ herr_t H5TBdelete_field( hid_t loc_id, /* Close the member type */ if ( H5Tclose( member_type_id ) < 0 ) - goto out; + goto out; /* Close the read type */ if ( H5Tclose( read_type_id ) < 0 ) @@ -2972,10 +2972,10 @@ herr_t H5TBdelete_field( hid_t loc_id, /* Close the write type */ if ( H5Tclose( write_type_id ) < 0 ) goto out; - + /* Release resources. */ free( member_name ); - free ( tmp_buf ); + free ( tmp_buf ); } /* i */ @@ -2983,7 +2983,7 @@ herr_t H5TBdelete_field( hid_t loc_id, * Release resources from 1st table *------------------------------------------------------------------------- */ - + /* Release the datatype. */ if ( H5Tclose( type_id1 ) < 0 ) goto out; @@ -3009,7 +3009,7 @@ herr_t H5TBdelete_field( hid_t loc_id, /* Terminate access to the dataspace */ if ( H5Sclose( space_id2 ) < 0 ) goto out; - + /* Release the datatype. */ if ( H5Tclose( type_id2 ) < 0 ) return -1; @@ -3027,7 +3027,7 @@ herr_t H5TBdelete_field( hid_t loc_id, *------------------------------------------------------------------------- */ - if ( H5Gunlink( loc_id, dset_name ) < 0 ) + if ( H5Gunlink( loc_id, dset_name ) < 0 ) return -1; /*------------------------------------------------------------------------- @@ -3035,9 +3035,9 @@ herr_t H5TBdelete_field( hid_t loc_id, *------------------------------------------------------------------------- */ - if ( H5Gmove( loc_id, "new", dset_name ) < 0 ) + if ( H5Gmove( loc_id, "new", dset_name ) < 0 ) return -1; - + /*------------------------------------------------------------------------- * Attach the conforming table attributes *------------------------------------------------------------------------- @@ -3066,45 +3066,45 @@ herr_t H5TBdelete_field( hid_t loc_id, if ( has_fill == 1 ) { - + if (( space_id1 = H5Screate(H5S_SCALAR)) < 0 ) goto out; - + for ( i = 0; i < nfields; i++) { - + /* Get the member type */ if ( ( member_type_id = H5Tget_member_type( type_id1, (unsigned)i )) < 0 ) goto out; - + /* Get the member offset */ member_offset = H5Tget_member_offset( type_id1, (unsigned)i ); - + strcpy( attr_name, "FIELD_" ); sprintf( aux, "%d", (int)i ); strcat( attr_name, aux ); sprintf( aux, "%s", "_FILL" ); strcat( attr_name, aux ); - + if ( (attr_id = H5Acreate( dataset_id1, attr_name, member_type_id, space_id1, H5P_DEFAULT )) < 0 ) goto out; - + if ( H5Awrite( attr_id, member_type_id, tmp_fill_buf+member_offset ) < 0 ) goto out; - + if ( H5Aclose( attr_id ) < 0 ) goto out; - + /* Close the member type */ if ( H5Tclose( member_type_id ) < 0 ) goto out; - + } - - /* Close data space. */ + + /* Close data space. */ if ( H5Sclose( space_id1 ) < 0 ) goto out; - + } /*has_fill*/ /* Release the datatype. */ @@ -3114,7 +3114,7 @@ herr_t H5TBdelete_field( hid_t loc_id, /* End access to the dataset */ if ( H5Dclose( dataset_id1 ) < 0 ) goto out; - + /* Release resources. */ free ( tmp_fill_buf ); @@ -3126,9 +3126,9 @@ out: } /*------------------------------------------------------------------------- - * + * * Table attribute functions - * + * *------------------------------------------------------------------------- */ @@ -3143,22 +3143,22 @@ out: * * Date: January 30, 2001 * - * Comments: + * Comments: * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ -herr_t H5TBAget_title( hid_t loc_id, - char *table_title ) +herr_t H5TBAget_title( hid_t loc_id, + char *table_title ) { /* Get the TITLE attribute */ if ( H5LT_get_attribute_disk( loc_id, "TITLE", table_title ) < 0 ) return -1; - + return 0; } @@ -3174,18 +3174,18 @@ herr_t H5TBAget_title( hid_t loc_id, * * Date: January 30, 2002 * - * Comments: + * Comments: * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ -herr_t H5TBAget_fill( hid_t loc_id, +herr_t H5TBAget_fill( hid_t loc_id, const char *dset_name, hid_t dset_id, - unsigned char *dst_buf ) + unsigned char *dst_buf ) { hsize_t nfields; @@ -3199,7 +3199,7 @@ herr_t H5TBAget_fill( hid_t loc_id, /* Get the number of records and fields */ if ( H5TBget_table_info ( loc_id, dset_name, &nfields, &nrecords ) < 0 ) return -1; - + src_offset = (size_t *)malloc((size_t)nfields * sizeof(size_t)); if (src_offset == NULL ) @@ -3248,7 +3248,7 @@ out: */ /*------------------------------------------------------------------------- - * Function: H5TBget_table_info + * Function: H5TBget_table_info * * Purpose: Gets the number of records and fields of a table * @@ -3261,26 +3261,26 @@ out: * Comments: * * Modifications: May 08, 2003 - * In version 2.0 of Table, the number of records is stored as an + * In version 2.0 of Table, the number of records is stored as an * attribute "NROWS" * * *------------------------------------------------------------------------- */ -herr_t H5TBget_table_info ( hid_t loc_id, +herr_t H5TBget_table_info ( hid_t loc_id, const char *dset_name, hsize_t *nfields, hsize_t *nrecords ) { - hid_t tid; + hid_t tid; hid_t sid=-1; hid_t did; int num_members; hsize_t dims[1]; int has_attr; hsize_t n[1]; - + /* Open the dataset. */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) return -1; @@ -3301,19 +3301,19 @@ herr_t H5TBget_table_info ( hid_t loc_id, * Get number of records *------------------------------------------------------------------------- */ - + if (nrecords) { /* Try to find the attribute "NROWS" */ has_attr = H5LT_find_attribute( did, "NROWS" ); - + /* It exists, get it */ if ( has_attr == 1 ) { /* Get the attribute */ if ( H5LTget_attribute(loc_id,dset_name,"NROWS",H5T_NATIVE_LLONG,n)<0) return -1; - + *nrecords = *n; } else @@ -3321,15 +3321,15 @@ herr_t H5TBget_table_info ( hid_t loc_id, /* Get the dataspace handle */ if ( (sid = H5Dget_space( did )) < 0 ) goto out; - + /* Get records */ if ( H5Sget_simple_extent_dims( sid, dims, NULL) < 0 ) goto out; - + /* Terminate access to the dataspace */ if ( H5Sclose( sid ) < 0 ) goto out; - + *nrecords = dims[0]; } }/*nrecords*/ @@ -3371,7 +3371,7 @@ out: * *------------------------------------------------------------------------- */ -herr_t H5TBget_field_info( hid_t loc_id, +herr_t H5TBget_field_info( hid_t loc_id, const char *dset_name, char *field_names[], size_t *field_sizes, @@ -3379,7 +3379,7 @@ herr_t H5TBget_field_info( hid_t loc_id, size_t *type_size ) { hid_t did; - hid_t ftype_id; + hid_t ftype_id; hid_t native_type_id; hssize_t nfields; char *member_name; @@ -3445,7 +3445,7 @@ herr_t H5TBget_field_info( hid_t loc_id, goto out; free( member_name ); - + } /* i */ /* Release the datatype. */ @@ -3490,19 +3490,19 @@ out: int H5TB_find_field( const char *field, const char *field_list ) { - const char *start = field_list; - const char *end; + const char *start = field_list; + const char *end; - while ( (end = strstr( start, "," )) != 0 ) { - if ( strncmp(start,field,(size_t)(end-start)) == 0 ) return 1; - start = end + 1; - } + while ( (end = strstr( start, "," )) != 0 ) { + if ( strncmp(start,field,(size_t)(end-start)) == 0 ) return 1; + start = end + 1; + } - if ( strcmp( start, field ) == 0 ) return 1; + if ( strcmp( start, field ) == 0 ) return 1; - return -1; + return -1; -} +} /*------------------------------------------------------------------------- @@ -3527,17 +3527,17 @@ int H5TB_find_field( const char *field, const char *field_list ) herr_t H5TB_attach_attributes( const char *table_title, - hid_t loc_id, + hid_t loc_id, const char *dset_name, hsize_t nfields, - hid_t tid ) + hid_t tid ) { char attr_name[255]; char *member_name; char aux[255]; hsize_t i; - + /* Attach the CLASS attribute */ if ( H5LTset_attribute_string( loc_id, dset_name, "CLASS", "TABLE" ) < 0 ) goto out; @@ -3545,7 +3545,7 @@ herr_t H5TB_attach_attributes( const char *table_title, /* Attach the VERSION attribute */ if ( H5LTset_attribute_string( loc_id, dset_name, "VERSION", "2.0" ) < 0 ) goto out; - + /* Attach the TITLE attribute */ if ( H5LTset_attribute_string( loc_id, dset_name, "TITLE", table_title ) < 0 ) goto out; @@ -3562,7 +3562,7 @@ herr_t H5TB_attach_attributes( const char *table_title, strcat( attr_name, aux ); sprintf( aux, "%s", "_NAME" ); strcat( attr_name, aux ); - + /* Attach the attribute */ if ( H5LTset_attribute_string( loc_id, dset_name, attr_name, member_name ) < 0 ) goto out; @@ -3596,10 +3596,10 @@ out: *------------------------------------------------------------------------- */ -hid_t H5TB_create_type(hid_t loc_id, +hid_t H5TB_create_type(hid_t loc_id, const char *dset_name, - size_t dst_size, - const size_t *dst_offset, + size_t dst_size, + const size_t *dst_offset, const size_t *dst_sizes, hid_t ftype_id) { @@ -3618,7 +3618,7 @@ hid_t H5TB_create_type(hid_t loc_id, if ((fnames=malloc(sizeof(char*)*(size_t)nfields))==NULL) return -1; - for ( i=0; i=istart && i=istart+irecords && i<10) { j=i-irecords; - if (cmp_par(i,j,rbuf,wbuf)<0) + if (cmp_par(i,j,rbuf,wbuf)<0) goto out; } - else + else { j=i-10; - if (cmp_par(i,j,rbuf,abuf)<0) + if (cmp_par(i,j,rbuf,abuf)<0) goto out; } } @@ -585,151 +585,151 @@ int test_table(hid_t fid, int write) /*------------------------------------------------------------------------- * Create a table - * pos = 0 1 2 3 4 5 6 7 - * data= 0 1 2 3 4 5 6 7 + * pos = 0 1 2 3 4 5 6 7 + * data= 0 1 2 3 4 5 6 7 *------------------------------------------------------------------------- */ - for( i=0; i= 2 && i <= 4 ) { if ( rbuf[i].lati != position_in[i].lati || rbuf[i].longi != position_in[i].longi || - rbuf[i].pressure != pressure_in[i] ) + rbuf[i].pressure != pressure_in[i] ) { fprintf(stderr,"%ld %f %d\n", rbuf[i].longi,rbuf[i].pressure,rbuf[i].lati); @@ -961,7 +961,7 @@ int test_table(hid_t fid, int write) *------------------------------------------------------------------------- */ TESTING2("reading fields by name"); - + /*------------------------------------------------------------------------- * write and read the "Pressure" field *------------------------------------------------------------------------- @@ -970,32 +970,32 @@ int test_table(hid_t fid, int write) { if (H5TBmake_table(TITLE,fid,"table10",NFIELDS,NRECORDS,type_size_mem, field_names,field_offset,field_type, - chunk_size,fill1,compress,0)<0) + chunk_size,fill1,compress,0)<0) goto out; - + /* write the pressure field to all the records */ - start = 0; - nrecords = NRECORDS; - if ( H5TBwrite_fields_name(fid,"table10","Pressure",start,nrecords, + start = 0; + nrecords = NRECORDS; + if ( H5TBwrite_fields_name(fid,"table10","Pressure",start,nrecords, sizeof( float ),0,field_sizes_pre,pressure_in)<0) goto out; } - + /* read the "Pressure" field */ - start = 0; - nrecords = NRECORDS; - if ( H5TBread_fields_name(fid,"table10","Pressure",start,nrecords, + start = 0; + nrecords = NRECORDS; + if ( H5TBread_fields_name(fid,"table10","Pressure",start,nrecords, sizeof(float),0,field_sizes_pre,pressure_out)<0) goto out; - + /* Compare the extracted table with the initial values */ - for( i = 0; i < NRECORDS; i++ ) + for( i = 0; i < NRECORDS; i++ ) { if ( pressure_out[i] != pressure_in[i] ) { goto out; } } - + /*------------------------------------------------------------------------- * Write and read the "Latitude,Longitude" fields *------------------------------------------------------------------------- @@ -1003,28 +1003,28 @@ int test_table(hid_t fid, int write) if (write) { /* Write the new longitude and latitude information to all the records */ - start = 0; - nrecords = NRECORDS; - if ( H5TBwrite_fields_name(fid,"table10", "Latitude,Longitude", start, nrecords, + start = 0; + nrecords = NRECORDS; + if ( H5TBwrite_fields_name(fid,"table10", "Latitude,Longitude", start, nrecords, sizeof( position_t ), field_offset_pos, field_sizes_pos, position_in ) < 0 ) goto out; }/*write*/ - + /* Read the "Latitude,Longitude" fields */ - start = 0; - nrecords = NRECORDS; - if ( H5TBread_fields_name( fid, "table10", "Latitude,Longitude", + start = 0; + nrecords = NRECORDS; + if ( H5TBread_fields_name( fid, "table10", "Latitude,Longitude", start, nrecords, sizeof(position_t), field_offset_pos, field_sizes_pos, position_out ) < 0 ) goto out; - + /* Compare the extracted table with the initial values */ - for( i = 0; i < NRECORDS; i++ ) + for( i = 0; i < NRECORDS; i++ ) { if ( position_out[i].lati != position_in[i].lati || - position_out[i].longi != position_in[i].longi ) + position_out[i].longi != position_in[i].longi ) goto out; } - + /*------------------------------------------------------------------------- * Write and read the "Name,Pressure" fields @@ -1033,23 +1033,23 @@ int test_table(hid_t fid, int write) if (write) { /* Write the new name and pressure information to all the records */ - start = 0; - nrecords = NRECORDS; - if ( H5TBwrite_fields_name( fid, "table10", "Name,Pressure", start, nrecords, + start = 0; + nrecords = NRECORDS; + if ( H5TBwrite_fields_name( fid, "table10", "Name,Pressure", start, nrecords, sizeof( namepressure_t ), field_offset_namepre, field_sizes_namepre, namepre_in ) < 0 ) goto out; }/*write*/ /* Read the "Name,Pressure" fields */ - start = 0; - nrecords = NRECORDS; - if ( H5TBread_fields_name( fid, "table10", "Name,Pressure", + start = 0; + nrecords = NRECORDS; + if ( H5TBread_fields_name( fid, "table10", "Name,Pressure", start, nrecords, sizeof(namepressure_t), field_offset_namepre, field_sizes_namepre, namepre_out ) < 0 ) goto out; /* Compare the extracted table with the initial values */ - for( i = 0; i < NRECORDS; i++ ) + for( i = 0; i < NRECORDS; i++ ) { if ( ( strcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) || namepre_out[i].pressure != namepre_in[i].pressure ) { @@ -1057,7 +1057,7 @@ int test_table(hid_t fid, int write) } } /* reset buffer */ - for( i = 0; i < NRECORDS; i++ ) + for( i = 0; i < NRECORDS; i++ ) { strcpy( namepre_out[i].name, "\0" ); namepre_out[i].pressure = -1; @@ -1067,15 +1067,15 @@ int test_table(hid_t fid, int write) * read only 3 records of the "Name,Pressure" fields, starting at record 2 *------------------------------------------------------------------------- */ - start = 2; - nrecords = 3; - if ( H5TBread_fields_name( fid, "table10", "Name,Pressure", - start, nrecords, sizeof(namepressure_t), field_offset_namepre, + start = 2; + nrecords = 3; + if ( H5TBread_fields_name( fid, "table10", "Name,Pressure", + start, nrecords, sizeof(namepressure_t), field_offset_namepre, field_sizes_namepre, namepre_out ) < 0 ) goto out; /* Compare the extracted table with the initial values */ - for( i = 0; i < 3; i++ ) + for( i = 0; i < 3; i++ ) { if ( ( strcmp( namepre_out[i].name, namepre_in[start+i].name ) != 0 ) || namepre_out[i].pressure != namepre_in[start+i].pressure ) { @@ -1099,42 +1099,42 @@ int test_table(hid_t fid, int write) /* make an empty table */ if (H5TBmake_table(TITLE,fid,"table11",NFIELDS,NRECORDS,type_size_mem, field_names,field_offset,field_type, - chunk_size,fill,compress,NULL)<0) + chunk_size,fill,compress,NULL)<0) goto out; /* write the pressure field starting at record 2 */ nfields = 1; - start = 2; - nrecords = 3; - if ( H5TBwrite_fields_index(fid, "table11", nfields, field_index_pre, start, nrecords, + start = 2; + nrecords = 3; + if ( H5TBwrite_fields_index(fid, "table11", nfields, field_index_pre, start, nrecords, sizeof( float ), 0, field_sizes_pre, pressure_in ) < 0 ) goto out; /* write the new longitude and latitude information starting at record 2 */ nfields = 2; - start = 2; - nrecords = 3; - if ( H5TBwrite_fields_index(fid, "table11", nfields, field_index_pos, start, nrecords, + start = 2; + nrecords = 3; + if ( H5TBwrite_fields_index(fid, "table11", nfields, field_index_pos, start, nrecords, sizeof( position_t ), field_offset_pos, field_sizes_pos, position_in ) < 0 ) goto out; /* read back the all table */ nfields = 5; - start = 0; - nrecords = NRECORDS; - if ( H5TBread_fields_index(fid, "table11", nfields, field_index, + start = 0; + nrecords = NRECORDS; + if ( H5TBread_fields_index(fid, "table11", nfields, field_index, start, nrecords, type_size_mem, field_offset, field_size, rbuf ) < 0 ) goto out; /* Compare the extracted table with the initial values */ - for( i = 0; i < NRECORDS; i++ ) + for( i = 0; i < NRECORDS; i++ ) { if ( i >= 2 && i <= 4 ) { if ( rbuf[i].lati != position_in[i].lati || rbuf[i].longi != position_in[i].longi || - rbuf[i].pressure != pressure_in[i] ) + rbuf[i].pressure != pressure_in[i] ) goto out; } } @@ -1151,7 +1151,7 @@ int test_table(hid_t fid, int write) * *------------------------------------------------------------------------- */ - + TESTING2("reading fields by index"); if (write) @@ -1159,9 +1159,9 @@ int test_table(hid_t fid, int write) /* make an empty table */ if (H5TBmake_table(TITLE,fid,"table12",NFIELDS,NRECORDS,type_size_mem, field_names,field_offset,field_type, - chunk_size,fill,compress,NULL)<0) + chunk_size,fill,compress,NULL)<0) goto out; - + /*------------------------------------------------------------------------- * write and read the "Pressure" field *------------------------------------------------------------------------- @@ -1169,29 +1169,29 @@ int test_table(hid_t fid, int write) /* write the pressure field to all the records */ nfields = 1; - start = 0; - nrecords = NRECORDS; - if ( H5TBwrite_fields_index(fid, "table12", nfields, field_index_pre, start, nrecords, + start = 0; + nrecords = NRECORDS; + if ( H5TBwrite_fields_index(fid, "table12", nfields, field_index_pre, start, nrecords, sizeof( float ), 0, field_sizes_pre, pressure_in ) < 0 ) goto out; } - + /* read the "Pressure" field */ nfields = 1; - start = 0; - nrecords = NRECORDS; - if ( H5TBread_fields_index(fid, "table12", nfields, field_index_pre, + start = 0; + nrecords = NRECORDS; + if ( H5TBread_fields_index(fid, "table12", nfields, field_index_pre, start, nrecords, sizeof(float), 0, field_sizes_pre, pressure_out ) < 0 ) goto out; /* compare the extracted table with the initial values */ - for( i = 0; i < NRECORDS; i++ ) + for( i = 0; i < NRECORDS; i++ ) { if ( pressure_out[i] != pressure_in[i] ) { goto out; } } - + /*------------------------------------------------------------------------- * write and read the "Latitude,Longitude" fields *------------------------------------------------------------------------- @@ -1200,23 +1200,23 @@ int test_table(hid_t fid, int write) { /* write the new longitude and latitude information to all the records */ nfields = 2; - start = 0; - nrecords = NRECORDS; - if ( H5TBwrite_fields_index(fid, "table12", nfields, field_index_pos, start, nrecords, + start = 0; + nrecords = NRECORDS; + if ( H5TBwrite_fields_index(fid, "table12", nfields, field_index_pos, start, nrecords, sizeof( position_t ), field_offset_pos, field_sizes_pos, position_in ) < 0 ) goto out; } /*write*/ /* read the "Latitude,Longitude" fields */ nfields = 2; - start = 0; - nrecords = NRECORDS; - if ( H5TBread_fields_index(fid, "table12", nfields, field_index_pos, + start = 0; + nrecords = NRECORDS; + if ( H5TBread_fields_index(fid, "table12", nfields, field_index_pos, start, nrecords, sizeof(position_t), field_offset_pos, field_sizes_pos, position_out ) < 0 ) goto out; /* compare the extracted table with the initial values */ - for( i = 0; i < NRECORDS; i++ ) + for( i = 0; i < NRECORDS; i++ ) { if ( position_out[i].lati != position_in[i].lati || position_out[i].longi != position_in[i].longi ) { @@ -1233,24 +1233,24 @@ int test_table(hid_t fid, int write) { /* write the new name and pressure information to all the records */ nfields = 2; - start = 0; - nrecords = NRECORDS; - if ( H5TBwrite_fields_index(fid, "table12", nfields, field_index_namepre, start, nrecords, + start = 0; + nrecords = NRECORDS; + if ( H5TBwrite_fields_index(fid, "table12", nfields, field_index_namepre, start, nrecords, sizeof( namepressure_t ), field_offset_namepre, field_sizes_namepre, namepre_in ) < 0 ) goto out; } /* read the "Name,Pressure" fields */ nfields = 2; - start = 0; - nrecords = NRECORDS; - if ( H5TBread_fields_index(fid, "table12", nfields, field_index_namepre, - start, nrecords, sizeof(namepressure_t), field_offset_namepre, + start = 0; + nrecords = NRECORDS; + if ( H5TBread_fields_index(fid, "table12", nfields, field_index_namepre, + start, nrecords, sizeof(namepressure_t), field_offset_namepre, field_sizes_namepre, namepre_out ) < 0 ) goto out; /* compare the extracted table with the initial values */ - for( i = 0; i < NRECORDS; i++ ) + for( i = 0; i < NRECORDS; i++ ) { if ( ( strcmp( namepre_out[i].name, namepre_in[i].name ) != 0 ) || namepre_out[i].pressure != namepre_in[i].pressure ) { @@ -1259,7 +1259,7 @@ int test_table(hid_t fid, int write) } /* reset buffer */ - for( i = 0; i < NRECORDS; i++ ) + for( i = 0; i < NRECORDS; i++ ) { strcpy( namepre_out[i].name, "\0" ); namepre_out[i].pressure = -1; @@ -1269,18 +1269,18 @@ int test_table(hid_t fid, int write) * read only 3 records of the "Name,Pressure" fields, starting at record 2 *------------------------------------------------------------------------- */ - + /* write the new name and pressure information to all the records */ nfields = 2; - start = 2; - nrecords = 3; - if ( H5TBread_fields_index(fid, "table12", nfields, field_index_namepre, - start, nrecords, sizeof(namepressure_t), field_offset_namepre, + start = 2; + nrecords = 3; + if ( H5TBread_fields_index(fid, "table12", nfields, field_index_namepre, + start, nrecords, sizeof(namepressure_t), field_offset_namepre, field_sizes_namepre, namepre_out ) < 0 ) goto out; /* compare the extracted table with the initial values */ - for( i = 0; i < 3; i++ ) + for( i = 0; i < 3; i++ ) { if ( ( strcmp( namepre_out[i].name, wbuf[start+i].name ) != 0 ) || namepre_out[i].pressure != wbuf[start+i].pressure ) { @@ -1299,7 +1299,7 @@ int test_table(hid_t fid, int write) * *------------------------------------------------------------------------- */ - + if (write) { TESTING2("inserting fields"); @@ -1307,12 +1307,12 @@ int test_table(hid_t fid, int write) /* make a table */ if (H5TBmake_table(TITLE,fid,"table13",NFIELDS,NRECORDS,type_size_mem, field_names,field_offset,field_type, - chunk_size,fill1,compress,wbuf)<0) + chunk_size,fill1,compress,wbuf)<0) goto out; - + /* insert the new field at the end of the field list */ position = NFIELDS; - if ( H5TBinsert_field( fid, "table13", "New Field", field_type_new, position, + if ( H5TBinsert_field( fid, "table13", "New Field", field_type_new, position, fill1_new, buf_new ) < 0 ) goto out; @@ -1321,7 +1321,7 @@ int test_table(hid_t fid, int write) goto out; /* compare the extracted table with the original array */ - for( i = 0; i < NRECORDS; i++ ) + for( i = 0; i < NRECORDS; i++ ) { if ( ( strcmp( rbuf2[i].name, wbuf[i].name ) != 0 ) || rbuf2[i].lati != wbuf[i].lati || @@ -1351,7 +1351,7 @@ int test_table(hid_t fid, int write) /* make a table */ if (H5TBmake_table(TITLE,fid,"table14",NFIELDS,NRECORDS,type_size_mem, field_names,field_offset,field_type, - chunk_size,fill,compress,wbuf)<0) + chunk_size,fill,compress,wbuf)<0) goto out; @@ -1362,9 +1362,9 @@ int test_table(hid_t fid, int write) /* read the table */ if ( H5TBread_table(fid, "table14", dst_size3, dst_offset3, dst_sizes3, rbuf3 ) < 0 ) goto out; - + /* compare the extracted table with the original array */ - for( i = 0; i < NRECORDS; i++ ) + for( i = 0; i < NRECORDS; i++ ) { if ( ( strcmp( rbuf3[i].name, wbuf[i].name ) != 0 ) || rbuf3[i].lati != wbuf[i].lati || @@ -1409,10 +1409,10 @@ int test_table(hid_t fid, int write) */ TESTING2("getting field info"); - + /* alocate */ names_out = malloc( sizeof(char*) * (size_t)NFIELDS ); - for ( i = 0; i < NFIELDS; i++) + for ( i = 0; i < NFIELDS; i++) { names_out[i] = malloc( sizeof(char) * 255 ); } @@ -1421,7 +1421,7 @@ int test_table(hid_t fid, int write) if ( H5TBget_field_info(fid, "table1", names_out, sizes_out, offset_out, &size_out ) < 0 ) goto out; - for ( i = 0; i < NFIELDS; i++) + for ( i = 0; i < NFIELDS; i++) { if ( (strcmp( field_names[i], names_out[i] ) != 0)) { goto out; @@ -1429,7 +1429,7 @@ int test_table(hid_t fid, int write) } /* release */ - for ( i = 0; i < NFIELDS; i++) + for ( i = 0; i < NFIELDS; i++) { free ( names_out[i] ); } @@ -1457,11 +1457,11 @@ int main(void) { hid_t fid; /* identifier for the file */ unsigned flags=H5F_ACC_RDONLY; - + /*------------------------------------------------------------------------- * test1: create a file for the write/read test *------------------------------------------------------------------------- - */ + */ /* create a file using default properties */ fid=H5Fcreate("test_table.h5",H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT); @@ -1478,7 +1478,7 @@ int main(void) /*------------------------------------------------------------------------- * test2: open a file written in test1 on a big-endian machine *------------------------------------------------------------------------- - */ + */ puts("Testing table with file open mode (read big-endian data):"); fid=h5file_open(TEST_FILE_BE,flags); @@ -1533,18 +1533,18 @@ out: */ static hid_t h5file_open(const char *fname, unsigned flags) { - + hid_t fid; /* identifier for the file */ char *srcdir = getenv("srcdir"); /* the source directory */ char data_file[512]=""; /* buffer to hold name of existing file */ - + /* compose the name of the file to open, using the srcdir, if appropriate */ if (srcdir){ strcpy(data_file,srcdir); strcat(data_file,"/"); - } + } strcat(data_file,fname); - + /* open */ if((fid=H5Fopen(data_file,flags,H5P_DEFAULT))<0) { fprintf(stderr,"Error: Cannot open file <%s>\n",data_file ); @@ -1579,21 +1579,21 @@ static int cmp_par(hsize_t i, hsize_t j, particle_t *rbuf, particle_t *wbuf ) * function to compare deleted records *------------------------------------------------------------------------- */ -static int compare_deleted(hsize_t rrecords, hsize_t dstart, hsize_t drecords, +static int compare_deleted(hsize_t rrecords, hsize_t dstart, hsize_t drecords, particle_t *rbuf, particle_t *wbuf) { hsize_t i,j; - for( i=0; iPackedField & 0x07) +1)) -1; Raster = GifImageDesc->GIFImage; /* Check for image seperator */ - + /* Now read in values from the image descriptor */ IWidth = GifImageDesc->ImageWidth; IHeight = GifImageDesc->ImageHeight; Interlace = GifImageDesc->PackedField & 0x40; - + /* * Note that I ignore the possible existence of a local color map. I'm * told there aren't many files around that use them, and the spec says * it's defined for future use. This could lead to an error reading some - * files. + * files. */ - + /* * Start reading the raster data. First we get the WORDial code size and * compute decompressor constant values, based on this code size. */ - + CodeSize = GifImageDesc->CodeSize; ClearCode = (1 << CodeSize); EOFCode = ClearCode + 1; FreeCode = FirstFree = ClearCode + 2; - + /* * The GIF spec has it that the code size is the code size used to compute * the above values is the code size given in the file, but the code size @@ -218,19 +218,19 @@ Decompress(GIFIMAGEDESC *GifImageDesc, GIFHEAD *GifHead) */ /* Allocate the Image */ - + if (!(Image = (BYTE *)malloc((size_t)IWidth*(size_t)IHeight))) { printf("Out of memory"); exit(-1); } - + BytesPerScanline = IWidth; - + /* * Decompress the file, continuing until you see the GIF EOF code. One * obvious enhancement is to add checking for corrupt files here. */ - + Code = ReadCode(); while (Code != EOFCode) { @@ -269,7 +269,7 @@ Decompress(GIFIMAGEDESC *GifImageDesc, GIFHEAD *GifHead) */ while (CurCode > DataMask) { if (OutCount > 1024) { - /*return error message*/ + /*return error message*/ } OutCode[OutCount++] = Suffix[CurCode]; @@ -316,5 +316,5 @@ Decompress(GIFIMAGEDESC *GifImageDesc, GIFHEAD *GifHead) Code = ReadCode(); } - return Image; + return Image; } diff --git a/hl/tools/gif2h5/gif.h b/hl/tools/gif2h5/gif.h index 282085f..ad60968 100644 --- a/hl/tools/gif2h5/gif.h +++ b/hl/tools/gif2h5/gif.h @@ -47,8 +47,8 @@ typedef unsigned char boolean; ** Set EndianOrder = 0 if machine is little endian ** EndianOrder = 1 if machine is big endian. */ -extern int EndianOrder; - +extern int EndianOrder; + /* ** The GIF header format. ** @@ -63,9 +63,9 @@ typedef struct _GifHeader { /* Offset Description */ BYTE ApplicationCount; BYTE PlainTextCount; BYTE HDFPalette[256][3]; - BYTE HeaderDump[6]; /* BYTE array to dump header contents */ + BYTE HeaderDump[6]; /* BYTE array to dump header contents */ BYTE LSDDump[7]; /* Logical Screen Descriptor dump */ -} GIFHEAD; +} GIFHEAD; /* @@ -122,9 +122,9 @@ typedef struct _GifCommentExtension { /* ** GIF to HDF Memory Struct -** Purpose : The gif to hdf structure is used to pass all the +** Purpose : The gif to hdf structure is used to pass all the ** gif data to the memory, which gets caught by the hdf driver -** Its the drivers job to put the data in the appropriate places +** Its the drivers job to put the data in the appropriate places ** in the HDF file. ** I have assumed that the ImageDescriptors and GraphicControls follow ** one another, ie. I have not associated them with each other. The driver diff --git a/hl/tools/gif2h5/gif2mem.c b/hl/tools/gif2h5/gif2mem.c index 01aa5a2..0695995 100644 --- a/hl/tools/gif2h5/gif2mem.c +++ b/hl/tools/gif2h5/gif2mem.c @@ -100,7 +100,7 @@ Gif2Mem(BYTE *MemGif) /* Read the GIF image file header information */ ReadGifHeader(gifHead, &MemGif); - + /* Check for FILE stream error */ #if 0 if (ferror(fpGif)) @@ -121,7 +121,7 @@ Gif2Mem(BYTE *MemGif) for (;;) { Identifier = *MemGif++; - + switch (Identifier) { case 0x3B: /* Trailer */ /* @@ -140,16 +140,16 @@ Gif2Mem(BYTE *MemGif) GifMemoryStruct.GifApplicationExtension = gifApplication; GifMemoryStruct.GifCommentExtension = gifComment; GifMemoryStruct.GifGraphicControlExtension = gifGraphicControl; - + /* return the struct */ return GifMemoryStruct; case 0x2C: /* Image Descriptor */ /* * If there was no image descriptor before this increase image - * count. If an imagedescriptor was present, reset GCEflag + * count. If an imagedescriptor was present, reset GCEflag */ - if (GCEflag == 0) + if (GCEflag == 0) ImageCount++; else GCEflag = 0; @@ -180,17 +180,17 @@ Gif2Mem(BYTE *MemGif) printf("Out of memory!"); exit(-1); } - + if (ReadGifImageDesc(gifImageDesc[ImageCount-1], &MemGif) == -1) fputs("Error reading Image Descriptor information\n", stderr); - + /* Decompress the Image */ gifImageDesc[ImageCount-1]->Image = Decompress(gifImageDesc[ImageCount-1], gifHead); free(gifImageDesc[ImageCount-1]->GIFImage); - /* + /* * Convert the local palette into an HDF compatible palette In * case the local color table is present, it is written out as * the HDFPalette If it is absent the global table is written @@ -213,8 +213,8 @@ Gif2Mem(BYTE *MemGif) } break; - - case 0x21: /* Extension Block */ + + case 0x21: /* Extension Block */ Label = *MemGif++; switch (Label) { @@ -240,7 +240,7 @@ Gif2Mem(BYTE *MemGif) "Error reading Plain Text Extension information.\n"); break; - + case 0xFE: /* Comment Extension */ CommentCount++; @@ -251,19 +251,19 @@ Gif2Mem(BYTE *MemGif) printf("Out of memory!"); exit(-1); } - + if(!(gifComment[CommentCount - 1] = (GIFCOMMENT *)malloc(sizeof(GIFCOMMENT)))) { printf("Out of memory!"); exit(-1); } - + if (ReadGifComment(gifComment[CommentCount - 1], &MemGif)) fprintf(stderr, "Error reading Comment Extension information\n"); break; - + case 0xF9: /* Graphic Control Extension */ if (GCEflag == 0 ) ImageCount++; @@ -289,17 +289,17 @@ Gif2Mem(BYTE *MemGif) gifImageDesc[j] = NULL; } } - + if(!(gifGraphicControl[ImageCount-1] = (GIFGRAPHICCONTROL*)malloc(sizeof(GIFGRAPHICCONTROL)))) { printf("Out of memory!"); exit(-1); } - - + + if (ReadGifGraphicControl(gifGraphicControl[ImageCount-1], &MemGif)) fprintf(stderr, "Error reading Graphic Control Extension information\n"); - + if (!*MemGif++ == 0) fprintf(stderr, "Error reading Graphic Control Extension\n"); @@ -311,18 +311,18 @@ Gif2Mem(BYTE *MemGif) if (ApplicationCount > ApplicationArray) ApplicationArray = (ApplicationArray << 1) + 1; - + if (!(gifApplication = (GIFAPPLICATION **)realloc(gifApplication , sizeof(GIFAPPLICATION *) * ApplicationArray))) { printf("Out of memory!"); exit(-1); } - + if(!(gifApplication[ApplicationCount - 1] = (GIFAPPLICATION *)malloc(sizeof(GIFAPPLICATION)))) { printf("Out of memory!"); exit(-1); } - + if (ReadGifApplication(gifApplication[ApplicationCount - 1], &MemGif)) fprintf(stderr, "Error reading Application Extension information\n"); diff --git a/hl/tools/gif2h5/gifread.c b/hl/tools/gif2h5/gifread.c index b135617..5f4aba0 100644 --- a/hl/tools/gif2h5/gifread.c +++ b/hl/tools/gif2h5/gifread.c @@ -11,16 +11,16 @@ * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include +#include +#include -#include "gif.h" +#include "gif.h" int EndianOrder; static BYTE *ReadDataSubBlocks(BYTE **MemGif2, WORD *DSize); -WORD +WORD GetWord(BYTE *MemGif) { WORD w; @@ -39,7 +39,7 @@ GetWord(BYTE *MemGif) BYTE GetByte(BYTE *MemGif) -{ +{ return *MemGif; } @@ -69,7 +69,7 @@ ReadGifHeader(GIFHEAD *GifHead, /* Pointer to GIF header structure */ printf("The file does not appear to be a valid GIF file.\n"); exit(-1); } - + for (i = 0 ; i < 7 ; i++) { GifHead->LSDDump[i] = *(*MemGif2)++; } @@ -84,7 +84,7 @@ ReadGifHeader(GIFHEAD *GifHead, /* Pointer to GIF header structure */ /* Read the Global Color Table */ - /* + /* * There are some changes made here apart from just reading in the * global color table as would seem intuitively obvious. The colors * are stored in the bottom part of the palette as opposed to the top @@ -100,7 +100,7 @@ ReadGifHeader(GIFHEAD *GifHead, /* Pointer to GIF header structure */ /* Check for a FILE stream error */ #if 0 if (ferror(FpGif)) - return -1; + return -1; #endif /* 0 */ return 0; /* No FILE stream error occured */ @@ -136,11 +136,11 @@ ReadGifImageDesc( for (i = 0 ; i < 9 ; i++) { GifImageDesc->GIDDump[i] = *(*MemGif2)++; } - + /* ** Get the relevant fields. I need ImageWidth and Height actively hence I have ** taken information from those fields. I intend to keep the GifImageDesc data - ** structure as it is so that anyone needing the rest of the fields can do so + ** structure as it is so that anyone needing the rest of the fields can do so ** quickly. */ @@ -160,10 +160,10 @@ ReadGifImageDesc( GifImageDesc->ImageHeight = (WORD) (GifImageDesc->GIDDump[6] & 0xFF); GifImageDesc->ImageHeight = ((WORD) (GifImageDesc->GIDDump[7] & 0xFF)) | (GifImageDesc->ImageWidth << 0x08); - + } - + GifImageDesc->PackedField = GifImageDesc->GIDDump[8]; /* Interlace = GifImageDesc->PackedField & 0x20; */ @@ -193,7 +193,7 @@ ReadGifImageDesc( printf("Out of memory"); exit(-1); } - + TempPtr = GifImageDesc->GIFImage; do @@ -258,7 +258,7 @@ ReadGifPlainText( if (!(GifPlainText->PlainTextData = ReadDataSubBlocks(MemGif2 , &(GifPlainText->DataSize)))) return(1); - /* + /* GifPlainText->Terminator = 0; */ @@ -299,7 +299,7 @@ ReadGifApplication( /* GifApplication->Terminator = 0; */ - + /* Check for a FILE stream error */ /* if (ferror(FpGif)) @@ -325,13 +325,13 @@ ReadGifComment( BYTE **MemGif2 /* GIF image file input FILE stream */ ) { - + /* Read in the Plain Text data sub-blocks */ if (!(GifComment->CommentData = ReadDataSubBlocks(MemGif2 , &(GifComment->DataSize)))) return(1); GifComment->Terminator = 0; - + return(0); /* No FILE stream error occured */ } @@ -357,9 +357,9 @@ ReadDataSubBlocks(BYTE **MemGif2, /* GIF image file input FILE stream int tempcount = 0; bufSize = 0; /* The output buffer is empty */ - + dataSize = *(*MemGif2)++; /* Get the size of the first sub-block */ - + /* Allocate initial data buffer */ if (!(ptr1 = ptr2 = (BYTE *) malloc((size_t)dataSize + 1))) { printf("Out of memory. Allocation of memory for data sub-blocks for\neither Comment, Plain Text or Application Extensions failed"); @@ -376,23 +376,23 @@ ReadDataSubBlocks(BYTE **MemGif2, /* GIF image file input FILE stream #endif /* COMMENTED_OUT */ while (dataSize--) /* Read/write the Plain Text data */ *ptr1++ = *(*MemGif2)++; - + /* Check if there is another data sub-block */ if ((dataSize = *(*MemGif2)++) == 0) break; /* Block Terminator encountered */ - + /* Increase the buffer size to accomodate the next sub-block */ if (!(ptr1 = ptr2 = (BYTE *) realloc(ptr2, bufSize + dataSize + 1))) return((BYTE *) NULL); - + ptr1 += bufSize; /* Move pointer to the end of the data */ - - + + } *ptr1++ = '\0'; - + return(ptr2); /* Return a pointer to the sub-block data */ } diff --git a/hl/tools/gif2h5/hdf2gif.c b/hl/tools/gif2h5/hdf2gif.c index 51ec144..52e57f7 100644 --- a/hl/tools/gif2h5/hdf2gif.c +++ b/hl/tools/gif2h5/hdf2gif.c @@ -64,7 +64,7 @@ usage(void) FILE *fpGif = NULL; int main(int argc , char **argv) { - + hsize_t dim_sizes[2]; BYTE *Image; @@ -180,7 +180,7 @@ int main(int argc , char **argv) return -1; } - + /* we shall always have a palette - read hdf will see to that */ has_local_palette = true; @@ -188,12 +188,12 @@ int main(int argc , char **argv) idx = 0x0001; b = (BYTE *) &idx; EndianOrder = (b[0] ? 1:0); - + if (!(fpGif = fopen(GIFName , "wb"))) { printf("Error opening gif file for output. Aborting.\n"); return -1; } - + /* hardwire n_images to 1 for now. */ n_images = number_of_images; @@ -249,7 +249,7 @@ int main(int argc , char **argv) Blue[i] = GlobalPalette[i][2]; } } - + for (i = 0; i < 256; i++) { pc2nc[i] = r1[i] = g1[i] = b1[i] = 0; } @@ -288,7 +288,7 @@ int main(int argc , char **argv) #ifdef UNUSED CountDown = w * h; /* # of pixels we'll be doing */ #endif /* UNUSED */ - + if (BitsPerPixel <= 1) InitCodeSize = 2; else @@ -305,7 +305,7 @@ int main(int argc , char **argv) /* * If it is the first image we do all the header stuff that isn't - * required for the rest of the images. + * required for the rest of the images. */ if (idx == 0) { /* Write out the GIF header and logical screen descriptor */ @@ -379,7 +379,7 @@ int main(int argc , char **argv) i = hdfWriteGIF(fpGif , Image , 0 , (int)dim_sizes[0] , (int)dim_sizes[1] , r1, g1 , b1 , pc2nc , 256 , 8 , BitsPerPixel); - fputc(0x00, fpGif); + fputc(0x00, fpGif); free(Image); } diff --git a/hl/tools/gif2h5/hdfgifwr.c b/hl/tools/gif2h5/hdfgifwr.c index a18b81f..b1b5be5 100644 --- a/hl/tools/gif2h5/hdfgifwr.c +++ b/hl/tools/gif2h5/hdfgifwr.c @@ -13,13 +13,13 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * hdfgifwr.c - handles writing of GIF files. - * - * Contains: + * hdfgifwr.c - handles writing of GIF files. + * + * Contains: * hdfWriteGIF(fp, pic, ptype, w, h, rmap, gmap, bmap, numcols, colorstyle, * comment) * - * Note: slightly brain-damaged, in that it'll only write non-interlaced + * Note: slightly brain-damaged, in that it'll only write non-interlaced * GIF files (in the interests of speed, or something) */ @@ -44,7 +44,7 @@ * James A. Woods (decvax!ihnp4!ames!jaw) * Joe Orost (decvax!vax135!petsd!joe) *****************************************************************/ - + #include #include @@ -125,7 +125,7 @@ int hdfWriteGIF(FILE *fp, byte *pic, int ptype, int w, int h, byte *rmap, Background = 0; #endif /* UNUSED */ - for (i = 0; i < 256; i++) { + for (i = 0; i < 256; i++) { pc2nc[i] = pc2ncmap[i]; #ifdef UNUSED r1[i] = rmap[i]; @@ -325,7 +325,7 @@ probe: continue; } - if ((long)HashTabOf (i) >= 0) + if ((long)HashTabOf (i) >= 0) goto probe; nomatch: @@ -380,7 +380,7 @@ output(int code) cur_accum |= ((long)code << cur_bits); else cur_accum = code; - + cur_bits += n_bits; while( cur_bits >= 8 ) { @@ -406,7 +406,7 @@ output(int code) maxcode = MAXCODE(n_bits); } } - + if (code == EOFCode) { /* At EOF, write the rest of the buffer */ while( cur_bits > 0 ) { diff --git a/hl/tools/gif2h5/readhdf.c b/hl/tools/gif2h5/readhdf.c index 2720d4d..3fc454c 100644 --- a/hl/tools/gif2h5/readhdf.c +++ b/hl/tools/gif2h5/readhdf.c @@ -30,17 +30,17 @@ cleanup(BYTE *ptr) ** BYTE palette[256][3] - the corresponding palette ** hsize_t* image_size - the size of each dimension of the image ** -** Future Notes: -** The way readHDF works right now is that it expects the user +** Future Notes: +** The way readHDF works right now is that it expects the user ** to know the exact path to the HDF image. Thus it does not ** parse the HDF file looking for image datasets and corresponding -** palettes. Also it takes in the default palette for the image +** palettes. Also it takes in the default palette for the image ** specified, if the palette is missing, it makes a default greyscale ** palette and throws it in. ** */ int ReadHDF(BYTE** data, BYTE palette[256][3], hsize_t *image_size, - CHAR *h5_file, CHAR *dset_name, CHAR *pal_name) + CHAR *h5_file, CHAR *dset_name, CHAR *pal_name) { hid_t fHfile; /* H5 file to open */ hid_t dspace; /* dataspace identifier for the the dataset */ @@ -130,7 +130,7 @@ int ReadHDF(BYTE** data, BYTE palette[256][3], hsize_t *image_size, pal_exist = 0; return -1; } - + pal_dtype = H5Dget_type(pal_set); if (dtype < 0) { fprintf(stderr , "Unable to open palette datatype\n"); @@ -151,7 +151,7 @@ int ReadHDF(BYTE** data, BYTE palette[256][3], hsize_t *image_size, pal_exist = 0; return -1; } - + /* get the dimension size of the palette. */ if (H5Sget_simple_extent_dims(pal_space , loc_pal_size , NULL) !=2 ) { fprintf(stderr , "Unable to get dimension info\n"); diff --git a/hl/tools/gif2h5/writehdf.c b/hl/tools/gif2h5/writehdf.c index d343aae..8d7405e 100644 --- a/hl/tools/gif2h5/writehdf.c +++ b/hl/tools/gif2h5/writehdf.c @@ -49,11 +49,11 @@ static int write_text_attribute(hid_t dataset_id , const char *attr_name, attr_dataspace_id , H5P_DEFAULT); /* write out the attribute data */ - if (H5Awrite(attr_attr_id , attr_type_id , attr_value) < 0) + if (H5Awrite(attr_attr_id , attr_type_id , attr_value) < 0) return -1; /* close the attribute */ - if (H5Aclose(attr_attr_id) < 0) + if (H5Aclose(attr_attr_id) < 0) return -1; /* close the dataspace */ @@ -192,12 +192,12 @@ WriteHDF(GIFTOMEM GifMemoryStruct, char *HDFName , char *GIFFileName) return -1; } - /* write the reference out */ + /* write the reference out */ if (H5Dwrite(ref_dataset_id , H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL , H5P_DEFAULT, &pal_ref) < 0) { fprintf(stderr , "Unable to write Palette Reference"); return -1; } - + /* close dataset */ if (H5Dclose(ref_dataset_id) < 0) { fprintf(stderr , "Unable to close palette dataset.\n"); @@ -271,7 +271,7 @@ WriteHDF(GIFTOMEM GifMemoryStruct, char *HDFName , char *GIFFileName) /* This info is available at http://hdf.ncsa.uiuc.edu/HDF5/doc/ImageSpec.html */ /* The following attributes must be set for each image: ** --------------------------------------- - ** Attribute Name Value + ** Attribute Name Value ** CLASS IMAGE ** IMAGE_VERSION 1.0 ** IMAGE_SUBCLASS IMAGE_BITMAP @@ -324,7 +324,7 @@ WriteHDF(GIFTOMEM GifMemoryStruct, char *HDFName , char *GIFFileName) ** Attribute: PALETTE ** Value : Reference to Palette *****************************************/ - + /**** MAKE SURE PALETTE EXISTS!!! ****/ if (gifHead.PackedField & 0x80) { /* global palette exists */ diff --git a/perform/benchpar.c b/perform/benchpar.c index 12dd8e0..8d8c1b5 100644 --- a/perform/benchpar.c +++ b/perform/benchpar.c @@ -88,7 +88,7 @@ static hid_t create_fapl(MPI_Comm comm, MPI_Info info, int acc_type ) /* set parallel access with communicator, using MPI-I/O driver */ if (acc_type == FACC_MPIO) { - ret = H5Pset_fapl_mpio(fapl, comm, info); + ret = H5Pset_fapl_mpio(fapl, comm, info); assert(ret>=0); } /* end if */ @@ -279,7 +279,7 @@ int main(int argc, char *argv[]) printf("rank=%d, error, slice dim larger than rank: slice_dim=%d, rank=%d\n",mpi_rank,slice_dim,rank); goto done; } /* end if */ - + /* Set rest of defaults */ if(file_name==NULL) { char *login; /* Pointer to login name */ diff --git a/perform/chunk.c b/perform/chunk.c index 3600bdb..ccb1bf7 100644 --- a/perform/chunk.c +++ b/perform/chunk.c @@ -158,7 +158,7 @@ create_dataset (void) H5Zregister (H5Z_COUNTER); #endif /* H5_WANT_H5_V1_4_COMPAT */ H5Pset_filter (dcpl, FILTER_COUNTER, 0, 0, NULL); - + /* The dataset */ dset = H5Dcreate (file, "dset", H5T_NATIVE_SCHAR, space, dcpl); assert (dset>=0); @@ -244,8 +244,8 @@ test_rowmaj (int op, size_t cache_size, size_t io_size) H5Sclose (mem_space); } } - - free (buf); + + free (buf); H5Sclose (file_space); H5Dclose (dset); H5Fclose (file); @@ -300,7 +300,7 @@ test_diag (int op, size_t cache_size, size_t io_size, size_t offset) dset = H5Dopen (file, "dset"); file_space = H5Dget_space (dset); nio_g = 0; - + for (i=0, hs_size[0]=io_size; hs_size[0]==io_size; i+=offset) { hs_offset[0] = hs_offset[1] = i; hs_size[0] = hs_size[1] = MIN (io_size, CH_SIZE*DS_SIZE-i); @@ -338,9 +338,9 @@ test_diag (int op, size_t cache_size, size_t io_size, size_t offset) * * Purpose: See file prologue. * - * Return: Success: + * Return: Success: * - * Failure: + * Failure: * * Programmer: Robb Matzke * Thursday, May 14, 1998 @@ -416,7 +416,7 @@ main (void) fclose (d); fprintf (f, "pause -1\n"); #endif - + #if 1 /* * Test row-major writing of the dataset with various sizes of request diff --git a/perform/iopipe.c b/perform/iopipe.c index 200ee7e..84a0a69 100644 --- a/perform/iopipe.c +++ b/perform/iopipe.c @@ -22,23 +22,23 @@ #ifdef H5_HAVE_WINSOCK_H #include -#endif +#endif /*Winsock.h includes windows.h, due to the different value of WINVER, windows.h should be put before H5private.h. Kent yang 6/21/2001*/ #if defined (__MWERKS__) -#ifdef H5_HAVE_SYS_TIMEB +#ifdef H5_HAVE_SYS_TIMEB #undef H5_HAVE_SYS_TIMEB #endif -#ifdef H5_HAVE_SYSTEM +#ifdef H5_HAVE_SYSTEM #undef H5_HAVE_SYSTEM #endif #endif /* __MWERKS__*/ #include "H5private.h" -#ifdef H5_HAVE_SYS_TIMEB +#ifdef H5_HAVE_SYS_TIMEB #include #endif @@ -117,12 +117,12 @@ print_stats (const char *prefix, (double)(t_start->tv_usec)/1000.0); #endif bw = (double)nbytes / e_time; - + #ifdef H5_HAVE_GETRUSAGE - printf (HEADING "%1.2fuser %1.2fsystem %1.2felapsed %1.2fMB/s\n", + printf (HEADING "%1.2fuser %1.2fsystem %1.2felapsed %1.2fMB/s\n", prefix, u_time, s_time, e_time, bw/(1024*1024)); #else - printf (HEADING "%1.2felapsed %1.2fMB/s\n", + printf (HEADING "%1.2felapsed %1.2fMB/s\n", prefix, e_time, bw/(1024*1024)); #endif @@ -132,7 +132,7 @@ print_stats (const char *prefix, /*------------------------------------------------------------------------- * Function: synchronize * - * Purpose: + * Purpose: * * Return: void * @@ -168,11 +168,11 @@ synchronize (void) /*------------------------------------------------------------------------- * Function: main * - * Purpose: + * Purpose: * - * Return: Success: + * Return: Success: * - * Failure: + * Failure: * * Programmer: Robb Matzke * Thursday, March 12, 1998 @@ -192,9 +192,9 @@ main (void) herr_t status; #ifdef H5_HAVE_GETRUSAGE struct rusage r_start, r_stop; -#else +#else struct timeval r_start, r_stop; -#endif +#endif struct timeval t_start, t_stop; int i, fd; hssize_t n; @@ -214,13 +214,13 @@ main (void) */ printf ("I/O request size is %1.1fMB\n", (double)(hssize_t)(size[0]*size[1])/1024.0*1024); - + /* Open the files */ file = H5Fcreate (HDF5_FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); assert (file>=0); fd = HDopen (RAW_FILE_NAME, O_RDWR|O_CREAT|O_TRUNC, 0666); assert (fd>=0); - + /* Create the dataset */ file_space = H5Screate_simple (2, size, size); assert (file_space>=0); @@ -238,11 +238,11 @@ printf("Before getrusage() call\n"); #endif #ifdef H5_HAVE_GETTIMEOFDAY gettimeofday (&t_start, NULL); -#else +#else #ifdef H5_HAVE_SYS_TIMEB _ftime(tbstart); #endif -#endif +#endif fprintf (stderr, HEADING, "fill raw"); for (i=0; imillitm; t_stop.tv_sec = tbstop->time; t_stop.tv_usec = tbstop->millitm; -#endif -#endif +#endif +#endif putc ('\n', stderr); print_stats ("fill raw", &r_start, &r_stop, &t_start, &t_stop, (size_t)(nread*size[0]*size[1])); - + /* Fill hdf5 */ synchronize (); @@ -280,7 +280,7 @@ printf("Before getrusage() call\n"); #ifdef H5_HAVE_SYS_TIMEB _ftime(tbstart); #endif -#endif +#endif fprintf (stderr, HEADING, "fill hdf5"); for (i=0; imillitm; t_stop.tv_sec = tbstop->time; t_stop.tv_usec = tbstop->millitm; -#endif -#endif +#endif +#endif putc ('\n', stderr); print_stats ("fill hdf5", &r_start, &r_stop, &t_start, &t_stop, (size_t)(nread*size[0]*size[1])); - + /* Write the raw dataset */ synchronize (); #ifdef H5_HAVE_GETRUSAGE @@ -319,7 +319,7 @@ printf("Before getrusage() call\n"); #ifdef H5_HAVE_SYS_TIMEB _ftime(tbstart); #endif -#endif +#endif fprintf (stderr, HEADING, "out raw"); for (i=0; imillitm; t_stop.tv_sec = tbstop->time; t_stop.tv_usec = tbstop->millitm; -#endif -#endif +#endif +#endif putc ('\n', stderr); print_stats ("out raw", &r_start, &r_stop, &t_start, &t_stop, @@ -359,7 +359,7 @@ printf("Before getrusage() call\n"); #ifdef H5_HAVE_SYS_TIMEB _ftime(tbstart); #endif -#endif +#endif fprintf (stderr, HEADING, "out hdf5"); for (i=0; imillitm; t_stop.tv_sec = tbstop->time; t_stop.tv_usec = tbstop->millitm; -#endif -#endif +#endif +#endif putc ('\n', stderr); print_stats ("out hdf5", &r_start, &r_stop, &t_start, &t_stop, @@ -398,7 +398,7 @@ printf("Before getrusage() call\n"); #ifdef H5_HAVE_SYS_TIMEB _ftime(tbstart); #endif -#endif +#endif fprintf (stderr, HEADING, "in raw"); for (i=0; imillitm; t_stop.tv_sec = tbstop->time; t_stop.tv_usec = tbstop->millitm; -#endif -#endif +#endif +#endif putc ('\n', stderr); print_stats ("in raw", &r_start, &r_stop, &t_start, &t_stop, (size_t)(nread*size[0]*size[1])); - + /* Read the hdf5 dataset */ synchronize (); @@ -438,8 +438,8 @@ printf("Before getrusage() call\n"); #else #ifdef H5_HAVE_SYS_TIMEB _ftime(tbstart); -#endif -#endif +#endif +#endif fprintf (stderr, HEADING, "in hdf5"); for (i=0; itime; t_stop.tv_usec = tbstop->millitm; #endif -#endif +#endif putc ('\n', stderr); print_stats ("in hdf5", &r_start, &r_stop, &t_start, &t_stop, @@ -482,8 +482,8 @@ printf("Before getrusage() call\n"); #else #ifdef H5_HAVE_SYS_TIMEB _ftime(tbstart); -#endif -#endif +#endif +#endif fprintf (stderr, HEADING, "in hdf5 partial"); for (i=0; imillitm; t_stop.tv_sec = tbstop->time; t_stop.tv_usec = tbstop->millitm; -#endif -#endif +#endif +#endif putc ('\n', stderr); print_stats ("in hdf5 partial", &r_start, &r_stop, &t_start, &t_stop, (size_t)(nread*count[0]*count[1])); - - + + /* Close everything */ HDclose (fd); H5Dclose (dset); H5Sclose (file_space); H5Fclose (file); - + return 0; } diff --git a/perform/mpi-perf.c b/perform/mpi-perf.c index b17ed4b..06cb499 100644 --- a/perform/mpi-perf.c +++ b/perform/mpi-perf.c @@ -99,11 +99,11 @@ int main(int argc, char **argv) if (mynod == 0) printf("# Using mpi-io calls.\n"); - - /* kindof a weird hack- if the location of the pvfstab file was + + /* kindof a weird hack- if the location of the pvfstab file was * specified on the command line, then spit out this location into * the appropriate environment variable: */ - + #if H5_HAVE_SETENV /* no setenv or unsetenv */ if (opt_pvfstab_set) { @@ -113,12 +113,12 @@ int main(int argc, char **argv) } } #endif - + /* this is how much of the file data is covered on each iteration of * the test. used to help determine the seek offset on each * iteration */ iter_jump = nprocs * opt_block; - + /* setup a buffer of data to write */ if (!(tmp = (char *) malloc(opt_block + 256))) { perror("malloc"); @@ -136,7 +136,7 @@ int main(int argc, char **argv) } /* open the file for writing */ - err = MPI_File_open(MPI_COMM_WORLD, opt_file, + err = MPI_File_open(MPI_COMM_WORLD, opt_file, MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh); if (err < 0) { fprintf(stderr, "node %d, open error: %s\n", mynod, strerror(errno)); @@ -163,7 +163,7 @@ int main(int argc, char **argv) nchars = opt_block/sizeof(char); err = MPI_File_write_at(fh, seek_position, buf, nchars, MPI_CHAR, &status); if(err){ - fprintf(stderr, "node %d, write error: %s\n", mynod, + fprintf(stderr, "node %d, write error: %s\n", mynod, strerror(errno)); } @@ -171,7 +171,7 @@ int main(int argc, char **argv) etim = MPI_Wtime(); write_tim += (etim - stim); - + /* we are done with this "write" iteration */ } @@ -179,12 +179,12 @@ int main(int argc, char **argv) if(err){ fprintf(stderr, "node %d, close error after write\n", mynod); } - + /* wait for everyone to synchronize at this point */ MPI_Barrier(MPI_COMM_WORLD); /* reopen the file to read the data back out */ - err = MPI_File_open(MPI_COMM_WORLD, opt_file, + err = MPI_File_open(MPI_COMM_WORLD, opt_file, MPI_MODE_CREATE | MPI_MODE_RDWR, MPI_INFO_NULL, &fh); if (err < 0) { fprintf(stderr, "node %d, open error: %s\n", mynod, strerror(errno)); @@ -246,7 +246,7 @@ int main(int argc, char **argv) MPI_COMM_WORLD); /* calculate the average from the sum */ - ave_read_tim = ave_read_tim / nprocs; + ave_read_tim = ave_read_tim / nprocs; MPI_Allreduce(&write_tim, &max_write_tim, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); @@ -256,33 +256,33 @@ int main(int argc, char **argv) MPI_COMM_WORLD); /* calculate the average from the sum */ - ave_write_tim = ave_write_tim / nprocs; - + ave_write_tim = ave_write_tim / nprocs; + /* print out the results on one node */ if (mynod == 0) { read_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_read_tim*1000000.0); write_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_write_tim*1000000.0); - + printf("nr_procs = %d, nr_iter = %d, blk_sz = %ld\n", nprocs, opt_iter, (long)opt_block); - + printf("# total_size = %ld\n", (long)(opt_block*nprocs*opt_iter)); - - printf("# Write: min_time = %f, max_time = %f, mean_time = %f\n", + + printf("# Write: min_time = %f, max_time = %f, mean_time = %f\n", min_write_tim, max_write_tim, ave_write_tim); - printf("# Read: min_time = %f, max_time = %f, mean_time = %f\n", + printf("# Read: min_time = %f, max_time = %f, mean_time = %f\n", min_read_tim, max_read_tim, ave_read_tim); - + printf("Write bandwidth = %f Mbytes/sec\n", write_bw); printf("Read bandwidth = %f Mbytes/sec\n", read_bw); - + if (opt_correct) { printf("Correctness test %s.\n", correct ? "passed" : "failed"); } } -die_jar_jar_die: +die_jar_jar_die: #if H5_HAVE_SETENV /* no setenv or unsetenv */ @@ -291,7 +291,7 @@ die_jar_jar_die: unsetenv("PVFSTAB_FILE"); } #endif - + free(tmp); if (opt_correct) free(tmp2); MPI_Finalize(); @@ -301,7 +301,7 @@ die_jar_jar_die: int parse_args(int argc, char **argv) { int c; - + while ((c = getopt(argc, argv, "s:b:i:f:p:c")) != EOF) { switch (c) { case 's': /* stripe */ @@ -335,7 +335,7 @@ int parse_args(int argc, char **argv) double Wtime() { struct timeval t; - + gettimeofday(&t, NULL); return((double)t.tv_sec + (double)t.tv_usec / 1000000); } diff --git a/perform/overhead.c b/perform/overhead.c index 31211cb..7fab565 100644 --- a/perform/overhead.c +++ b/perform/overhead.c @@ -60,7 +60,7 @@ #ifndef TRUE #define TRUE 1 #endif /* TRUE */ - + typedef enum fill_t { FILL_ALL, FILL_FORWARD, @@ -224,13 +224,13 @@ test(fill_t fill_style, const double splits[], if ((dset=H5Dcreate(file, "chunked", H5T_NATIVE_INT, fspace, dcpl))<0) goto error; -#if !defined( __MWERKS__) +#if !defined( __MWERKS__) - /* + /* workaround for a bug in the Metrowerks version 6.0 open function - */ + */ if ((fd=HDopen(FILE_NAME_1, O_RDONLY, 0666))<0) goto error; -#endif +#endif for (i=1; i<=cur_size[0]; i++) { @@ -266,7 +266,7 @@ test(fill_t fill_style, const double splits[], } -#if !defined( __MWERKS__) +#if !defined( __MWERKS__) /* Determine overhead */ if (verbose) { @@ -281,9 +281,9 @@ test(fill_t fill_style, const double splits[], (unsigned long)i, (double)(hssize_t)(sb.st_size-i*sizeof(int))/(hssize_t)i); } -#endif - - +#endif + + } H5Dclose(dset); @@ -313,15 +313,15 @@ test(fill_t fill_style, const double splits[], case FILL_ALL: abort(); } - + #if !defined( __MWERKS__) - + if (HDfstat(fd, &sb)<0) goto error; printf("%-7s %8.3f\n", sname, (double)(hssize_t)(sb.st_size-cur_size[0]*sizeof(int))/ (hssize_t)cur_size[0]); #endif - + } @@ -347,7 +347,7 @@ test(fill_t fill_style, const double splits[], /*------------------------------------------------------------------------- * Function: main * - * Purpose: + * Purpose: * * Return: Success: zero * @@ -376,7 +376,7 @@ main(int argc, char *argv[]) goto error; } if (H5Pclose(xfer)<0) goto error; - + /* Parse command-line options */ for (i=1, j=0; i= 0), "", H5FATAL); - ret = H5Pset_fapl_mpio(mpio_pl, MPI_COMM_WORLD, MPI_INFO_NULL); + ret = H5Pset_fapl_mpio(mpio_pl, MPI_COMM_WORLD, MPI_INFO_NULL); VRFY((ret >= 0), "", H5FATAL); /* set optional allocation alignment */ @@ -179,7 +179,7 @@ int main(int argc, char **argv) /* setup file access template */ acc_tpl = H5Pcreate (H5P_FILE_ACCESS); VRFY((acc_tpl >= 0), "", H5FATAL); - ret = H5Pset_fapl_mpio(acc_tpl, MPI_COMM_WORLD, MPI_INFO_NULL); + ret = H5Pset_fapl_mpio(acc_tpl, MPI_COMM_WORLD, MPI_INFO_NULL); VRFY((ret >= 0), "", H5FATAL); /* set optional allocation alignment */ @@ -216,7 +216,7 @@ int main(int argc, char **argv) start[0] = (j*iter_jump)+(mynod*opt_block); stride[0] = block[0] = opt_block; count[0]= 1; - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded", H5FATAL); if (opt_correct) /* fill in buffer for iteration */ { @@ -229,21 +229,21 @@ int main(int argc, char **argv) /* write data */ ret = H5Dwrite(dataset, H5T_NATIVE_CHAR, mem_dataspace, file_dataspace, - H5P_DEFAULT, buf); + H5P_DEFAULT, buf); VRFY((ret >= 0), "H5Dwrite dataset1 succeeded", !H5FATAL); /* discover the ending time of the operation */ etim = MPI_Wtime(); write_tim += (etim - stim); - + /* we are done with this "write" iteration */ } - /* close dataset and file */ + /* close dataset and file */ ret=H5Dclose(dataset); VRFY((ret >= 0), "H5Dclose succeeded", H5FATAL); - ret=H5Fclose(fid); + ret=H5Fclose(fid); VRFY((ret >= 0), "H5Fclose succeeded", H5FATAL); @@ -269,7 +269,7 @@ int main(int argc, char **argv) start[0] = (j*iter_jump)+(mynod*opt_block); stride[0] = block[0] = opt_block; count[0]= 1; - ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); + ret=H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0), "H5Sset_hyperslab succeeded", H5FATAL); /* seek to the appropriate spot give the current iteration and * rank within the MPI processes */ @@ -282,11 +282,11 @@ int main(int argc, char **argv) /* read in the file data */ if (!opt_correct){ ret = H5Dread(dataset, H5T_NATIVE_CHAR, mem_dataspace, file_dataspace, - H5P_DEFAULT, buf); + H5P_DEFAULT, buf); } else{ ret = H5Dread(dataset, H5T_NATIVE_CHAR, mem_dataspace, file_dataspace, - H5P_DEFAULT, buf2); + H5P_DEFAULT, buf2); } myerrno = errno; /* discover the end time */ @@ -310,10 +310,10 @@ int main(int argc, char **argv) /* we are done with this read iteration */ } - /* close dataset and file */ + /* close dataset and file */ ret=H5Dclose(dataset); VRFY((ret >= 0), "H5Dclose succeeded", H5FATAL); - ret=H5Fclose(fid); + ret=H5Fclose(fid); VRFY((ret >= 0), "H5Fclose succeeded", H5FATAL); /* compute the read and write times */ @@ -325,7 +325,7 @@ int main(int argc, char **argv) MPI_COMM_WORLD); /* calculate the average from the sum */ - ave_read_tim = ave_read_tim / nprocs; + ave_read_tim = ave_read_tim / nprocs; MPI_Allreduce(&write_tim, &max_write_tim, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD); @@ -335,33 +335,33 @@ int main(int argc, char **argv) MPI_COMM_WORLD); /* calculate the average from the sum */ - ave_write_tim = ave_write_tim / nprocs; - + ave_write_tim = ave_write_tim / nprocs; + /* print out the results on one node */ if (mynod == 0) { read_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_read_tim*1000000.0); write_bw = ((int64_t)(opt_block*nprocs*opt_iter))/(max_write_tim*1000000.0); - + printf("nr_procs = %d, nr_iter = %d, blk_sz = %ld\n", nprocs, opt_iter, (long)opt_block); - + printf("# total_size = %ld\n", (long)(opt_block*nprocs*opt_iter)); - - printf("# Write: min_time = %f, max_time = %f, mean_time = %f\n", + + printf("# Write: min_time = %f, max_time = %f, mean_time = %f\n", min_write_tim, max_write_tim, ave_write_tim); - printf("# Read: min_time = %f, max_time = %f, mean_time = %f\n", + printf("# Read: min_time = %f, max_time = %f, mean_time = %f\n", min_read_tim, max_read_tim, ave_read_tim); - + printf("Write bandwidth = %f Mbytes/sec\n", write_bw); printf("Read bandwidth = %f Mbytes/sec\n", read_bw); - + if (opt_correct) { printf("Correctness test %s.\n", correct ? "passed" : "failed"); } } -die_jar_jar_die: +die_jar_jar_die: #if H5_HAVE_SETENV /* no setenv or unsetenv */ @@ -370,7 +370,7 @@ die_jar_jar_die: unsetenv("PVFSTAB_FILE"); } #endif - + free(tmp); if (opt_correct) free(tmp2); MPI_Finalize(); @@ -380,7 +380,7 @@ die_jar_jar_die: int parse_args(int argc, char **argv) { int c; - + while ((c = getopt(argc, argv, "s:b:i:f:p:a:2:c")) != EOF) { switch (c) { case 's': /* stripe */ @@ -444,7 +444,7 @@ int parse_args(int argc, char **argv) double Wtime() { struct timeval t; - + gettimeofday(&t, NULL); return((double)t.tv_sec + (double)t.tv_usec / 1000000); } diff --git a/perform/perf_meta.c b/perform/perf_meta.c index 97775a8..48a13ca 100644 --- a/perform/perf_meta.c +++ b/perform/perf_meta.c @@ -82,13 +82,13 @@ void print_perf(p_time, p_time, p_time); Purpose: Parse command line options * * Programmer: Raymond Lu - * Friday, Oct 3, 2003 + * Friday, Oct 3, 2003 * * Modifications: * *------------------------------------------------------------------------- */ -static int +static int parse_options(int argc, char **argv) { int t; @@ -104,7 +104,7 @@ parse_options(int argc, char **argv) switch(*(*argv+1)){ case 'h': /* Help page */ return(1); - + case 'd': /* Number of datasets */ NUM_DSETS = atoi((*argv+1)+1); if (NUM_DSETS < 0){ @@ -112,7 +112,7 @@ parse_options(int argc, char **argv) return(1); } break; - + case 'a': /* Number of attributes per dataset */ NUM_ATTRS = atoi((*argv+1)+1); if (NUM_ATTRS < 0){ @@ -155,11 +155,11 @@ parse_options(int argc, char **argv) return(1); } if(t == 1) - RUN_TEST |= TEST_1; + RUN_TEST |= TEST_1; else if(t == 2) - RUN_TEST |= TEST_2; + RUN_TEST |= TEST_2; else - RUN_TEST |= TEST_3; + RUN_TEST |= TEST_3; break; @@ -178,12 +178,12 @@ parse_options(int argc, char **argv) } #endif /*H5_HAVE_PARALLEL*/ - if(NUM_ATTRS && !BATCH_ATTRS) + if(NUM_ATTRS && !BATCH_ATTRS) NUM_ATTRS = 0; - - if(!NUM_ATTRS && BATCH_ATTRS) - BATCH_ATTRS = 0; - + + if(!NUM_ATTRS && BATCH_ATTRS) + BATCH_ATTRS = 0; + if(!NUM_DSETS) { nerrors++; return(1); @@ -195,7 +195,7 @@ parse_options(int argc, char **argv) return(1); } } - + return(0); } @@ -206,7 +206,7 @@ parse_options(int argc, char **argv) Purpose: Prints help page * * Programmer: Raymond Lu - * Friday, Oct 3, 2003 + * Friday, Oct 3, 2003 * * Modifications: * @@ -277,7 +277,7 @@ create_dspace(void) { hsize_t dims[2]; hsize_t small_dims[2]; - + /* Create the data space */ dims[0] = 256; dims[1] = 512; @@ -294,7 +294,7 @@ create_dspace(void) error: return -1; -} +} /*------------------------------------------------------------------------- @@ -324,8 +324,8 @@ create_dsets(hid_t file) * Create a dataset using the default dataset creation properties. */ for(i=0; i= 0), "H5Sselect_hyperslab"); } /* end if */ else { @@ -1097,7 +1097,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, h5count[0] = buf_size/blk_size; } /* end else */ hrc = H5Sselect_hyperslab(h5dset_space_id, H5S_SELECT_SET, - h5start, h5stride, h5count, h5block); + h5start, h5stride, h5count, h5block); VRFY((hrc >= 0), "H5Sselect_hyperslab"); } /* end if */ else { @@ -1462,7 +1462,7 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags) GOTOERROR(FAIL); } - + /* The perils of POSIX I/O in a parallel environment. The problem is: * * - Process n opens a file with truncation and then starts @@ -1528,7 +1528,7 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags) } /* end if */ else { /* Set the file driver to the MPI-I/O driver */ - hrc = H5Pset_fapl_mpio(acc_tpl, pio_comm_g, h5_io_info_g); + hrc = H5Pset_fapl_mpio(acc_tpl, pio_comm_g, h5_io_info_g); if (hrc < 0) { fprintf(stderr, "HDF5 Property List Set failed\n"); GOTOERROR(FAIL); @@ -1563,7 +1563,7 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags) } break; - } + } done: return ret_code; @@ -1636,10 +1636,10 @@ do_cleanupfile(iotype iot, char *fname) { if (pio_mpi_rank_g != 0) return; - + if (clean_file_g == -1) clean_file_g = (getenv("HDF5_NOCLEANUP")==NULL) ? 1 : 0; - + if (clean_file_g){ switch (iot){ case POSIXIO: diff --git a/perform/pio_perf.c b/perform/pio_perf.c index 2389b54..0475329 100644 --- a/perform/pio_perf.c +++ b/perform/pio_perf.c @@ -609,7 +609,7 @@ run_test(iotype iot, parameters parms, struct options *opts) pio_time_destroy(res.timers); } - /* + /* * Show various statistics */ /* Write statistics */ @@ -722,7 +722,7 @@ run_test(iotype iot, parameters parms, struct options *opts) /* * Function: output_all_info - * Purpose: + * Purpose: * Return: Nothing * Programmer: Bill Wendling, 29. January 2002 * Modifications: @@ -777,7 +777,7 @@ accumulate_minmax_stuff(minmax *mm, int count) { int i; minmax total_mm; - + total_mm.sum = 0.0; total_mm.max = -DBL_MAX; total_mm.min = DBL_MAX; diff --git a/src/H5.c b/src/H5.c index e563e46..0a92df5 100644 --- a/src/H5.c +++ b/src/H5.c @@ -60,7 +60,7 @@ static void H5_debug_mask(const char*); * H5_init_library -- Initialize library-global information * USAGE * herr_t H5_init_library() - * + * * RETURNS * Non-negative on success/Negative on failure * @@ -69,7 +69,7 @@ static void H5_debug_mask(const char*); * *-------------------------------------------------------------------------- */ -herr_t +herr_t H5_init_library(void) { herr_t ret_value=SUCCEED; @@ -131,7 +131,7 @@ H5_init_library(void) * Initialize interfaces that might not be able to initialize themselves * soon enough. The file & dataset interfaces must be initialized because * calling H5P_create() might require the file/dataset property classes to be - * initialized. The property interface must be initialized before the file + * initialized. The property interface must be initialized before the file * & dataset interfaces though, in order to provide them with the proper * property classes. */ @@ -178,7 +178,7 @@ H5_term_library(void) unsigned at=0; char loop[1024]; H5E_auto_t func; - + #ifdef H5_HAVE_THREADSAFE /* explicit locking of the API */ H5_FIRST_THREAD_INIT @@ -206,7 +206,7 @@ H5_term_library(void) (sprintf(loop+at, "..."), \ at += HDstrlen(loop+at), \ n):n)) - + do { pending = 0; /* Try to organize these so the "higher" level components get shut @@ -268,7 +268,7 @@ H5_term_library(void) H5_MPEinit_g = FALSE; /* turn it off no matter what */ } #endif - + /* Mark library as closed */ H5_INIT_GLOBAL = FALSE; done: @@ -442,7 +442,7 @@ H5_debug_mask(const char *s) char pkg_name[32], *rest; size_t i; int clear; - + while (s && *s) { if (HDisalpha(*s) || '-'==*s || '+'==*s) { /* Enable or Disable debugging? */ @@ -495,7 +495,7 @@ H5_debug_mask(const char *s) } } } - + /*------------------------------------------------------------------------- * Function: H5get_libversion @@ -571,11 +571,11 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum) FUNC_ENTER_API_NOINIT(H5check_version) H5TRACE3("e","IuIuIu",majnum,minnum,relnum); - + /* Don't check again, if we already have */ if (checked) HGOTO_DONE(SUCCEED) - + { const char *s; /* Environment string for disabling version check */ /* Allow different versions of the header files and library? */ @@ -600,7 +600,7 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum) stderr); /* Mention the versions we are referring to */ HDfprintf (stderr, "Headers are %u.%u.%u, library is %u.%u.%u\n", - majnum, minnum, relnum, + majnum, minnum, relnum, (unsigned)H5_VERS_MAJOR, (unsigned)H5_VERS_MINOR, (unsigned)H5_VERS_RELEASE); /* Bail out now. */ @@ -620,7 +620,7 @@ H5check_version(unsigned majnum, unsigned minnum, unsigned relnum) "continue.\n", stderr); /* Mention the versions we are referring to */ HDfprintf (stderr, "Headers are %u.%u.%u, library is %u.%u.%u\n", - majnum, minnum, relnum, + majnum, minnum, relnum, (unsigned)H5_VERS_MAJOR, (unsigned)H5_VERS_MINOR, (unsigned)H5_VERS_RELEASE); break; } /* end switch */ @@ -844,7 +844,7 @@ HDfprintf(FILE *stream, const char *fmt, ...) char *rest, format_templ[128]; const char *s; va_list ap; - + assert (stream); assert (fmt); @@ -883,7 +883,7 @@ HDfprintf(FILE *stream, const char *fmt, ...) } /*lint !e744 Switch statement doesn't _need_ default */ s++; } - + /* Field width */ if (HDisdigit (*s)) { zerofill = ('0'==*s); @@ -975,7 +975,7 @@ HDfprintf(FILE *stream, const char *fmt, ...) if (*modifier) sprintf (format_templ+HDstrlen(format_templ), "%s", modifier); sprintf (format_templ+HDstrlen(format_templ), "%c", conv); - + /* Conversion */ switch (conv) { @@ -1162,13 +1162,13 @@ HDstrtoll(const char *s, const char **rest, int base) { int64_t sign=1, acc=0; hbool_t overflow = FALSE; - + errno = 0; if (!s || (base && (base<2 || base>36))) { if (rest) *rest = s; return 0; } - + /* Skip white space */ while (HDisspace (*s)) s++; @@ -1177,7 +1177,7 @@ HDstrtoll(const char *s, const char **rest, int base) s++; } else if ('-'==*s) { sign = -1; - s++; + s++; } /* Zero base prefix */ @@ -1190,7 +1190,7 @@ HDstrtoll(const char *s, const char **rest, int base) } else if (0==base) { base = 10; } - + /* Digits */ while ((base<=10 && *s>='0' && *s<'0'+base) || (base>10 && ((*s>='0' && *s<='9') || @@ -1317,7 +1317,7 @@ void H5_timer_end (H5_timer_t *sum/*in,out*/, H5_timer_t *timer/*in,out*/) { H5_timer_t now; - + assert (timer); H5_timer_begin (&now); @@ -1350,7 +1350,7 @@ H5_timer_end (H5_timer_t *sum/*in,out*/, H5_timer_t *timer/*in,out*/) * 1.2345e-10 For bandwidth less than 1 * 6.7893e+94 For exceptionally large values * 6.678e+106 For really big values - * + * * Return: void * * Programmer: Robb Matzke @@ -1493,7 +1493,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } else { HDmemset(&event_time, 0, sizeof event_time); } - + /* Print the first part of the line. This is the indication of the * nesting depth followed by the function name and either start of * argument list or start of return value. If this call is for a @@ -1526,7 +1526,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) fputc('+', out); fprintf(out, "%*s%s(", 2*current_depth, "", func); } - + /* Clear array sizes */ for (i=0; i<(hssize_t)NELMTS(asize); i++) asize[i] = -1; @@ -1548,7 +1548,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } else { asize_idx = -1; } - + /* * The argument name. Leave off the `_id' part. If the argument * name is the null pointer then don't print the argument or the @@ -1725,7 +1725,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } } break; - + case 's': if (ptr) { if (vp) { @@ -1754,7 +1754,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } } break; - + case 't': if (ptr) { if (vp) { @@ -1777,7 +1777,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } } break; - + default: fprintf (out, "BADTYPE(D%c)", type[1]); goto error; @@ -1797,7 +1797,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) else fprintf (out, "FAIL"); } break; - + case 'E': switch (type[1]) { case 'd': @@ -1822,7 +1822,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } } break; - + case 'e': if (ptr) { if (vp) { @@ -1861,7 +1861,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) fprintf(out, "%d", (int)emin); } break; - + default: fprintf (out, "BADTYPE(E%c)", type[1]); goto error; @@ -2026,7 +2026,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) asize[argno] = (hssize_t)hssize; } break; - + default: fprintf (out, "BADTYPE(H%c)", type[1]); goto error; @@ -2211,7 +2211,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) asize[argno] = is; } break; - + case 'u': if (ptr) { if (vp) { @@ -2456,7 +2456,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } } break; - + default: fprintf(out, "BADTYPE(S%c)", type[1]); goto error; @@ -2493,7 +2493,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } } break; - + case 's': if (ptr) { if (vp) { diff --git a/src/H5A.c b/src/H5A.c index 57badd5..b2be6d2 100644 --- a/src/H5A.c +++ b/src/H5A.c @@ -60,7 +60,7 @@ NAME H5A_init_interface -- Initialize interface-specific information USAGE herr_t H5A_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -79,7 +79,7 @@ H5A_init_interface(void) */ if (H5I_init_group(H5I_ATTR, H5I_ATTRID_HASHSIZE, H5A_RESERVED_ATOMS, (H5I_free_t)H5A_close)<0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTINIT, FAIL, "unable to initialize interface") - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -107,7 +107,7 @@ H5A_term_interface(void) int n=0; FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5A_term_interface) - + if (H5_interface_initialize_g) { if ((n=H5I_nmembers(H5I_ATTR))>0) { (void)H5I_clear_group(H5I_ATTR, FALSE); @@ -135,7 +135,7 @@ H5A_term_interface(void) hid_t plist_id; IN: ID of creation property list (currently not used) RETURNS Non-negative on success/Negative on failure - + ERRORS DESCRIPTION @@ -158,7 +158,7 @@ H5A_term_interface(void) * Modifications: * Robb Matzke, 5 Jun 1998 * The LOC_ID can also be a committed datatype. - * + * --------------------------------------------------------------------------*/ /* ARGSUSED */ hid_t @@ -197,7 +197,7 @@ done: /*------------------------------------------------------------------------- * Function: H5A_create * - * Purpose: + * Purpose: * This is the guts of the H5Acreate function. * Usage: * hid_t H5A_create (ent, name, type, space) @@ -297,7 +297,7 @@ H5A_create(const H5G_entry_t *ent, const char *name, const H5T_t *type, attr->ent_opened=1; /* Create the attribute message and save the attribute index */ - if (H5O_modify(&(attr->ent), H5O_ATTR_ID, H5O_NEW_MESG, 0, H5O_UPDATE_TIME, attr, dxpl_id) < 0) + if (H5O_modify(&(attr->ent), H5O_ATTR_ID, H5O_NEW_MESG, 0, H5O_UPDATE_TIME, attr, dxpl_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to update attribute header messages") /* Register the new attribute and get an ID for it */ @@ -329,7 +329,7 @@ done: void *op_data; IN: Op data passed in RETURNS Non-negative on success, negative on failure - + ERRORS DESCRIPTION @@ -374,7 +374,7 @@ H5A_find_idx_by_name(const void *_mesg, unsigned idx, void *_op_data) const char *name; IN: Name of dataset to find RETURNS non-negative on success, negative on failure - + ERRORS DESCRIPTION @@ -419,7 +419,7 @@ done: const char *name; IN: Name of attribute to locate and open RETURNS ID of attribute on success, negative on failure - + ERRORS DESCRIPTION @@ -459,7 +459,7 @@ H5Aopen_name(hid_t loc_id, const char *name) /* Go do the real work for opening the attribute */ if ((ret_value=H5A_open(ent, (unsigned)idx, H5AC_dxpl_id))<0) HGOTO_ERROR (H5E_ATTR, H5E_CANTINIT, FAIL, "unable to open attribute") - + done: FUNC_LEAVE_API(ret_value) } /* H5Aopen_name() */ @@ -476,7 +476,7 @@ done: unsigned idx; IN: Index (0-based) attribute to open RETURNS ID of attribute on success, negative on failure - + ERRORS DESCRIPTION @@ -490,7 +490,7 @@ done: * Modifications: * Robb Matzke, 5 Jun 1998 * The LOC_ID can also be a named (committed) datatype. - * + * --------------------------------------------------------------------------*/ hid_t H5Aopen_idx(hid_t loc_id, unsigned idx) @@ -510,7 +510,7 @@ H5Aopen_idx(hid_t loc_id, unsigned idx) /* Go do the real work for opening the attribute */ if ((ret_value=H5A_open(ent, idx, H5AC_dxpl_id))<0) HGOTO_ERROR (H5E_ATTR, H5E_CANTINIT, FAIL, "unable to open attribute") - + done: FUNC_LEAVE_API(ret_value) } /* H5Aopen_idx() */ @@ -519,7 +519,7 @@ done: /*------------------------------------------------------------------------- * Function: H5A_open * - * Purpose: + * Purpose: * This is the guts of the H5Aopen_xxx functions * Usage: * herr_t H5A_open (ent, idx) @@ -554,7 +554,7 @@ H5A_open(H5G_entry_t *ent, unsigned idx, hid_t dxpl_id) if (NULL==(attr=H5O_read(ent, H5O_ATTR_ID, (int)idx, NULL, dxpl_id))) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to load attribute info from dataset header") attr->initialized=1; - + /* Deep copy of the symbol table entry */ if (H5G_ent_copy(&(attr->ent),ent,H5G_COPY_DEEP)<0) HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to copy entry") @@ -590,7 +590,7 @@ done: const void *buf; IN: Buffer of data to write RETURNS Non-negative on success/Negative on failure - + ERRORS DESCRIPTION @@ -635,7 +635,7 @@ done: const void *buf; IN: Buffer of data to write RETURNS Non-negative on success/Negative on failure - + ERRORS DESCRIPTION @@ -720,7 +720,7 @@ H5A_write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id) HGOTO_ERROR(H5E_ATTR, H5E_BADVALUE, FAIL, "attribute not found") /* Modify the attribute data */ - if (H5O_modify(&(attr->ent), H5O_ATTR_ID, idx, 0, H5O_UPDATE_DATA_ONLY|H5O_UPDATE_TIME, attr, dxpl_id) < 0) + if (H5O_modify(&(attr->ent), H5O_ATTR_ID, idx, 0, H5O_UPDATE_DATA_ONLY|H5O_UPDATE_TIME, attr, dxpl_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to update attribute header messages") } /* end if */ @@ -729,9 +729,9 @@ H5A_write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id) done: /* Release resources */ - if (src_id >= 0) + if (src_id >= 0) (void)H5I_dec_ref(src_id); - if (dst_id >= 0) + if (dst_id >= 0) (void)H5I_dec_ref(dst_id); if (bkg_buf) H5FL_BLK_FREE(attr_buf, bkg_buf); @@ -752,7 +752,7 @@ done: void *buf; IN: Buffer for data to read RETURNS Non-negative on success/Negative on failure - + ERRORS DESCRIPTION @@ -797,7 +797,7 @@ done: void *buf; IN: Buffer for data to read RETURNS Non-negative on success/Negative on failure - + ERRORS DESCRIPTION @@ -876,9 +876,9 @@ H5A_read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id) done: /* Release resources */ - if (src_id >= 0) + if (src_id >= 0) (void)H5I_dec_ref(src_id); - if (dst_id >= 0) + if (dst_id >= 0) (void)H5I_dec_ref(dst_id); if (tconv_buf) H5FL_BLK_FREE(attr_buf, tconv_buf); @@ -899,7 +899,7 @@ done: hid_t attr_id; IN: Attribute to get dataspace of RETURNS A dataspace ID on success, negative on failure - + ERRORS DESCRIPTION @@ -944,7 +944,7 @@ done: hid_t attr_id; IN: Attribute to get datatype of RETURNS A datatype ID on success, negative on failure - + ERRORS DESCRIPTION @@ -986,7 +986,7 @@ H5Aget_type(hid_t attr_id) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "invalid VL location") if (H5T_lock(dst, FALSE)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to lock transient datatype") - + /* Atomize */ if ((ret_value=H5I_register(H5I_DATATYPE, dst))<0) HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register datatype atom") @@ -1014,7 +1014,7 @@ done: RETURNS This function returns the length of the attribute's name (which may be longer than 'buf_size') on success or negative for failure. - + ERRORS DESCRIPTION @@ -1067,10 +1067,10 @@ done: * Function: H5Aget_storage_size * * Purpose: Returns the amount of storage size that is required for this - * attribute. + * attribute. * * Return: Success: The amount of storage size allocated for the - * attribute. The return value may be zero + * attribute. The return value may be zero * if no data has been stored. * * Failure: Zero @@ -1087,7 +1087,7 @@ H5Aget_storage_size(hid_t attr_id) { H5A_t *attr=NULL; hsize_t ret_value; /* Return value */ - + FUNC_ENTER_API(H5Aget_storage_size, 0) H5TRACE1("h","i",attr_id); @@ -1106,12 +1106,12 @@ done: /*------------------------------------------------------------------------- * Function: H5A_get_storage_size * - * Purpose: Private function for H5Aget_storage_size. Returns the + * Purpose: Private function for H5Aget_storage_size. Returns the * amount of storage size that is required for this - * attribute. + * attribute. * * Return: Success: The amount of storage size allocated for the - * attribute. The return value may be zero + * attribute. The return value may be zero * if no data has been stored. * * Failure: Zero @@ -1127,7 +1127,7 @@ static hsize_t H5A_get_storage_size(const H5A_t *attr) { hsize_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5A_get_storage_size) /* Set return value */ @@ -1135,7 +1135,7 @@ H5A_get_storage_size(const H5A_t *attr) FUNC_LEAVE_NOAPI(ret_value) } - + /*-------------------------------------------------------------------------- NAME @@ -1147,7 +1147,7 @@ H5A_get_storage_size(const H5A_t *attr) hid_t loc_id; IN: Object (dataset or group) to be queried RETURNS Number of attributes on success, negative on failure - + ERRORS DESCRIPTION @@ -1199,9 +1199,9 @@ done: /*------------------------------------------------------------------------- * Function: H5Arename * - * Purpose: Rename an attribute + * Purpose: Rename an attribute * - * Return: Success: Non-negative + * Return: Success: Non-negative * * Failure: Negative * @@ -1217,7 +1217,7 @@ H5Arename(hid_t loc_id, const char *old_name, const char *new_name) { H5G_entry_t *ent = NULL; /*symtab ent of object to attribute */ herr_t ret_value; /* Return value */ - + FUNC_ENTER_API(H5Arename, FAIL) H5TRACE3("e","iss",loc_id,old_name,new_name); @@ -1240,9 +1240,9 @@ done: /*------------------------------------------------------------------------- * Function: H5A_rename * - * Purpose: Private function for H5Arename. Rename an attribute + * Purpose: Private function for H5Arename. Rename an attribute * - * Return: Success: Non-negative + * Return: Success: Non-negative * * Failure: Negative * @@ -1259,14 +1259,14 @@ H5A_rename(H5G_entry_t *ent, const char *old_name, const char *new_name, hid_t d int seq, idx=FAIL; /* Index of attribute being querried */ H5A_t found_attr; /* Attribute with OLD_NAME */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5A_rename) /* Check arguments */ assert(ent); assert(old_name); assert(new_name); - + /* Read in the existing attributes to check for duplicates */ seq=0; while(H5O_read(ent, H5O_ATTR_ID, seq, &found_attr, dxpl_id)!=NULL) { @@ -1284,12 +1284,12 @@ H5A_rename(H5G_entry_t *ent, const char *old_name, const char *new_name, hid_t d H5E_clear (); if(idx<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "attribute cannot be found") - + /* Copy the attribute name. */ if(found_attr.name) HDfree(found_attr.name); - found_attr.name = HDstrdup(new_name); - if(!found_attr.name) + found_attr.name = HDstrdup(new_name); + if(!found_attr.name) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "String copy failed") /* Indicate entry is not opened and the attribute doesn't need fill-values. */ @@ -1297,9 +1297,9 @@ H5A_rename(H5G_entry_t *ent, const char *old_name, const char *new_name, hid_t d found_attr.initialized=TRUE; /* Modify the attribute message */ - if (H5O_modify(ent, H5O_ATTR_ID, idx, 0, H5O_UPDATE_TIME, &found_attr, dxpl_id) < 0) + if (H5O_modify(ent, H5O_ATTR_ID, idx, 0, H5O_UPDATE_TIME, &found_attr, dxpl_id) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to update attribute header messages") - + /* Close the attribute */ if(H5A_free(&found_attr)<0) HGOTO_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "unable to close renamed attribute") @@ -1323,7 +1323,7 @@ done: RETURNS Returns a negative value if something is wrong, the return value of the last operator if it was non-zero, or zero if all attributes were processed. - + ERRORS DESCRIPTION @@ -1337,7 +1337,7 @@ done: over ('loc_id'), the name of the current attribute about the object ('attr_name') and the pointer to the operator data passed in to H5Aiterate ('op_data'). The return values from an operator are: - A. Zero causes the iterator to continue, returning zero when all + A. Zero causes the iterator to continue, returning zero when all attributes have been processed. B. Positive causes the iterator to immediately return that positive value, indicating short-circuit success. The iterator can be @@ -1353,7 +1353,7 @@ done: * Robb Matzke, 5 Jun 1998 * Like the group iterator, if ATTR_NUM is the null pointer then all * attributes are processed. - * + * --------------------------------------------------------------------------*/ herr_t H5Aiterate(hid_t loc_id, unsigned *attr_num, H5A_operator_t op, void *op_data) @@ -1418,19 +1418,19 @@ done: const char *name; IN: Name of attribute to delete RETURNS Non-negative on success/Negative on failure - + ERRORS DESCRIPTION This function removes the named attribute from a dataset or group. This function should not be used when attribute IDs are open on 'loc_id' - as it may cause the internal indexes of the attributes to change and future + as it may cause the internal indexes of the attributes to change and future writes to the open attributes to produce incorrect results. * * Modifications: * Robb Matzke, 5 Jun 1998 * The LOC_ID can also be a named (committed) datatype. - * + * --------------------------------------------------------------------------*/ herr_t H5Adelete(hid_t loc_id, const char *name) @@ -1457,7 +1457,7 @@ H5Adelete(hid_t loc_id, const char *name) /* Delete the attribute from the location */ if ((ret_value=H5O_remove(ent, H5O_ATTR_ID, found, H5AC_dxpl_id)) < 0) HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute header message") - + done: FUNC_LEAVE_API(ret_value) } /* H5Adelete() */ @@ -1473,7 +1473,7 @@ done: hid_t attr_id; IN: Attribute to release access to RETURNS Non-negative on success/Negative on failure - + ERRORS DESCRIPTION @@ -1563,7 +1563,7 @@ H5A_copy(H5A_t *_new_attr, const H5A_t *old_attr, unsigned update_flags) /* Set the return value */ ret_value=new_attr; - + done: if(ret_value==NULL) { if(new_attr!=NULL && allocated_attr) @@ -1618,7 +1618,7 @@ done: /*------------------------------------------------------------------------- * Function: H5A_close * - * Purpose: Frees an attribute and all associated memory. + * Purpose: Frees an attribute and all associated memory. * * Return: Non-negative on success/Negative on failure * @@ -1662,7 +1662,7 @@ H5A_close(H5A_t *attr) HGOTO_ERROR(H5E_ATTR, H5E_CANTRELEASE, FAIL, "can't release object header info") H5FL_FREE(H5A_t, attr); - + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5A_close() */ diff --git a/src/H5AC.c b/src/H5AC.c index 7415385..c6bb622 100644 --- a/src/H5AC.c +++ b/src/H5AC.c @@ -32,7 +32,7 @@ * Turned on "H5AC_SORT_BY_ADDR" * * John Mainzer, 5/19/04 - * Complete redesign and rewrite. See the header comments for + * Complete redesign and rewrite. See the header comments for * H5AC_t for an overview of what is going on. * * John Mainzer, 6/4/04 @@ -81,7 +81,7 @@ hid_t H5AC_ind_dxpl_id=(-1); * Private file-scope function declarations: */ -static herr_t H5AC_check_if_write_permitted(const H5F_t *f, +static herr_t H5AC_check_if_write_permitted(const H5F_t *f, hid_t dxpl_id, hbool_t * write_permitted_ptr); @@ -313,10 +313,10 @@ H5AC_term_interface(void) * Modifications: * * Complete re-design and re-write to support the re-designed - * metadata cache. + * metadata cache. * - * At present, the size_hint is ignored, and the - * max_cache_size and min_clean_size fields are hard + * At present, the size_hint is ignored, and the + * max_cache_size and min_clean_size fields are hard * coded. This should be fixed, but a parameter * list change will be required, so I will leave it * for now. @@ -326,7 +326,7 @@ H5AC_term_interface(void) * JRM - 4/28/04 * * Reworked the function again after abstracting its guts to - * the similar function in H5C.c. The function is now a + * the similar function in H5C.c. The function is now a * wrapper for H5C_create(). * JRM - 6/4/04 *------------------------------------------------------------------------- @@ -390,14 +390,14 @@ done: * Modifications: * * Complete re-design and re-write to support the re-designed - * metadata cache. + * metadata cache. * JRM - 5/12/04 * * Abstracted the guts of the function to H5C_dest() in H5C.c, * and then re-wrote the function as a wrapper for H5C_dest(). * * JRM - 6/7/04 - * + * *------------------------------------------------------------------------- */ herr_t @@ -430,34 +430,34 @@ done: * Function: H5AC_flush * * Purpose: Flush (and possibly destroy) the metadata cache associated - * with the specified file. + * with the specified file. * * This is a re-write of an earlier version of the function * which was reputedly capable of flushing (and destroying - * if requested) individual entries, individual entries if - * they match the supplied type, all entries of a given type, - * as well as all entries in the cache. + * if requested) individual entries, individual entries if + * they match the supplied type, all entries of a given type, + * as well as all entries in the cache. * * As only this last capability is actually used at present, - * I have not implemented the other capabilities in this - * version of the function. + * I have not implemented the other capabilities in this + * version of the function. * - * The type and addr parameters are retained to avoid source - * code changed, but values other than NULL and HADDR_UNDEF - * respectively are errors. If all goes well, they should + * The type and addr parameters are retained to avoid source + * code changed, but values other than NULL and HADDR_UNDEF + * respectively are errors. If all goes well, they should * be removed, and the function renamed to something more * descriptive -- perhaps H5AC_flush_cache. * * If the cache contains protected entries, the function will - * fail, as protected entries cannot be flushed. However - * all unprotected entries should be flushed before the + * fail, as protected entries cannot be flushed. However + * all unprotected entries should be flushed before the * function returns failure. - * - * For historical purposes, the original version of the + * + * For historical purposes, the original version of the * purpose section is reproduced below: * * ============ Original Version of "Purpose:" ============ - * + * * Flushes (and destroys if DESTROY is non-zero) the specified * entry from the cache. If the entry TYPE is CACHE_FREE and * ADDR is HADDR_UNDEF then all types of entries are @@ -500,10 +500,10 @@ H5AC_flush(H5F_t *f, hid_t dxpl_id, unsigned flags) HDassert(f); HDassert(f->shared->cache); - status = H5C_flush_cache(f, - dxpl_id, - H5AC_noblock_dxpl_id, - f->shared->cache, + status = H5C_flush_cache(f, + dxpl_id, + H5AC_noblock_dxpl_id, + f->shared->cache, flags); if ( status < 0 ) { @@ -550,8 +550,8 @@ done: * at the beginning of the function. * * JRM - 6/7/04 - * Abstracted the guts of the function to H5C_insert_entry() - * in H5C.c, and then re-wrote the function as a wrapper for + * Abstracted the guts of the function to H5C_insert_entry() + * in H5C.c, and then re-wrote the function as a wrapper for * H5C_insert_entry(). * *------------------------------------------------------------------------- @@ -584,7 +584,7 @@ H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void * result = H5C_insert_entry(f, dxpl_id, - H5AC_noblock_dxpl_id, + H5AC_noblock_dxpl_id, cache, type, addr, @@ -626,8 +626,8 @@ done: * Complete rewrite for the new meta-data cache. * * JRM - 6/7/04 - * Abstracted the guts of the function to H5C_rename_entry() - * in H5C.c, and then re-wrote the function as a wrapper for + * Abstracted the guts of the function to H5C_rename_entry() + * in H5C.c, and then re-wrote the function as a wrapper for * H5C_rename_entry(). * *------------------------------------------------------------------------- @@ -668,7 +668,7 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_protect * - * Purpose: If the target entry is not in the cache, load it. If + * Purpose: If the target entry is not in the cache, load it. If * necessary, attempt to evict one or more entries to keep * the cache within its maximum size. * @@ -676,8 +676,8 @@ done: * to the caller. The caller must call H5AC_unprotect() when * finished with the entry. * - * While it is protected, the entry may not be either evicted - * or flushed -- nor may it be accessed by another call to + * While it is protected, the entry may not be either evicted + * or flushed -- nor may it be accessed by another call to * H5AC_protect. Any attempt to do so will result in a failure. * * This comment is a re-write of the original Purpose: section. @@ -718,19 +718,19 @@ done: * Purpose section above. * * JRM - 6/7/04 - * Abstracted the guts of the function to H5C_protect() - * in H5C.c, and then re-wrote the function as a wrapper for + * Abstracted the guts of the function to H5C_protect() + * in H5C.c, and then re-wrote the function as a wrapper for * H5C_protect(). * *------------------------------------------------------------------------- */ void * -H5AC_protect(H5F_t *f, - hid_t dxpl_id, - const H5AC_class_t *type, +H5AC_protect(H5F_t *f, + hid_t dxpl_id, + const H5AC_class_t *type, haddr_t addr, - const void *udata1, - void *udata2, + const void *udata1, + void *udata2, H5AC_protect_t UNUSED rw) @@ -751,7 +751,7 @@ H5AC_protect(H5F_t *f, thing = H5C_protect(f, dxpl_id, - H5AC_noblock_dxpl_id, + H5AC_noblock_dxpl_id, f->shared->cache, type, addr, @@ -781,15 +781,15 @@ done: * and give it back to the replacement policy. * * The TYPE and ADDR arguments must be the same as those in - * the corresponding call to H5AC_protect() and the THING - * argument must be the value returned by that call to + * the corresponding call to H5AC_protect() and the THING + * argument must be the value returned by that call to * H5AC_protect(). * * If the deleted flag is TRUE, simply remove the target entry - * from the cache, clear it, and free it without writing it to + * from the cache, clear it, and free it without writing it to * disk. * - * This verion of the function is a complete re-write to + * This verion of the function is a complete re-write to * use the new metadata cache. While there isn't all that * much difference between the old and new Purpose sections, * the original version is given below. @@ -828,8 +828,8 @@ done: * Complete re-write for the new metadata cache. * * JRM - 6/7/04 - * Abstracted the guts of the function to H5C_unprotect() - * in H5C.c, and then re-wrote the function as a wrapper for + * Abstracted the guts of the function to H5C_unprotect() + * in H5C.c, and then re-wrote the function as a wrapper for * H5C_unprotect(). * *------------------------------------------------------------------------- @@ -854,7 +854,7 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, result = H5C_unprotect(f, dxpl_id, - H5AC_noblock_dxpl_id, + H5AC_noblock_dxpl_id, f->shared->cache, type, addr, @@ -889,8 +889,8 @@ done: * Re-write to support the new metadata cache. * * JRM - 6/7/04 - * Abstracted the guts of the function to H5C_stats() - * in H5C.c, and then re-wrote the function as a wrapper for + * Abstracted the guts of the function to H5C_stats() + * in H5C.c, and then re-wrote the function as a wrapper for * H5C_stats(). * *------------------------------------------------------------------------- @@ -921,10 +921,10 @@ done: * * Function: H5AC_check_if_write_permitted * - * Purpose: Determine if a write is permitted under the current - * circumstances, and set *write_permitted_ptr accordingly. - * As a general rule it is, but when we are running in parallel - * mode with collective I/O, we must ensure that a read cannot + * Purpose: Determine if a write is permitted under the current + * circumstances, and set *write_permitted_ptr accordingly. + * As a general rule it is, but when we are running in parallel + * mode with collective I/O, we must ensure that a read cannot * cause a write. * * In the event of failure, the value of *write_permitted_ptr diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h index 8c34d92..7b18ccc 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -44,10 +44,10 @@ #define H5AC_LHEAP_ID 2 /*local heap */ #define H5AC_GHEAP_ID 3 /*global heap */ #define H5AC_OHDR_ID 4 /*object header */ -#define H5AC_NTYPES 5 +#define H5AC_NTYPES 5 -/* H5AC_DUMP_STATS_ON_CLOSE should always be FALSE when - * H5C_COLLECT_CACHE_STATS is FALSE. +/* H5AC_DUMP_STATS_ON_CLOSE should always be FALSE when + * H5C_COLLECT_CACHE_STATS is FALSE. * * When H5C_COLLECT_CACHE_STATS is TRUE, H5AC_DUMP_STATS_ON_CLOSE must * be FALSE for "make check" to succeed, but may be set to TRUE at other diff --git a/src/H5B.c b/src/H5B.c index 55f4b73..adc3196 100644 --- a/src/H5B.c +++ b/src/H5B.c @@ -47,7 +47,7 @@ * e. left[x] is a pointer to the node's left sibling * or the null pointer if this is the left-most * node at this level in the tree. - * + * * f. right[x] is a pointer to the node's right * sibling or the null pointer if this is the * right-most node at this level in the tree. @@ -242,7 +242,7 @@ H5B_create(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, void *udata, #ifdef H5B_DEBUG H5B_assert(f, dxpl_id, *addr_p, shared->type, udata); #endif - + done: if (ret_value<0) { if(shared && shared->sizeof_rnode>0) { @@ -252,7 +252,7 @@ done: if (bt) (void)H5B_dest(f,bt); } - + FUNC_LEAVE_NOAPI(ret_value) } /*lint !e818 Can't make udata a pointer to const */ @@ -571,7 +571,7 @@ H5B_clear(H5F_t *f, H5B_t *bt, hbool_t destroy) /* Reset the dirty flag. */ bt->cache_info.is_dirty = FALSE; - + if (destroy) if (H5B_dest(f, bt) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree node") @@ -584,8 +584,8 @@ done: /*------------------------------------------------------------------------- * Function: H5B_compute_size * - * Purpose: Compute the size in bytes of the specified instance of - * H5B_t on disk, and return it in *len_ptr. On failure, + * Purpose: Compute the size in bytes of the specified instance of + * H5B_t on disk, and return it in *len_ptr. On failure, * the value of *len_ptr is undefined. * * Return: Non-negative on success/Negative on failure @@ -704,7 +704,7 @@ H5B_find(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void *u #else /* OLD_WAY */ HGOTO_DONE(FAIL) #endif /* OLD_WAY */ - + /* * Follow the link to the subtree or to the data node. */ @@ -848,7 +848,7 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_t *old_bt, haddr_t old_addr, if (H5DEBUG(B)) fprintf(H5DEBUG(B), " split %3d/%-3d\n", nleft, nright); #endif - + /* * Create the new B-tree node. */ @@ -875,7 +875,7 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_t *old_bt, haddr_t old_addr, */ old_bt->cache_info.is_dirty = TRUE; old_bt->nchildren = nleft; - + /* * Update sibling pointers. */ @@ -982,14 +982,14 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release new child") bt = NULL; - + /* the new node */ if (NULL == (bt = H5AC_protect(f, dxpl_id, H5AC_BT, child, type, udata, H5AC_READ))) HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, FAIL, "unable to load new node") if (!rt_key_changed) HDmemcpy(rt_key, H5B_NKEY(bt,shared,bt->nchildren), type->sizeof_nkey); - + if (H5AC_unprotect(f, dxpl_id, H5AC_BT, child, bt, FALSE) != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release new child") @@ -1071,11 +1071,11 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, #ifdef H5B_DEBUG H5B_assert(f, dxpl_id, addr, type, udata); #endif - + done: FUNC_LEAVE_NOAPI(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5B_insert_child @@ -1422,7 +1422,7 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type if (H5B_insert_child(tmp_bt, idx, child_addr, my_ins, md_key) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert child") } - + /* * If this node split, return the mid key (the one that is shared * by the left and right node). @@ -1492,7 +1492,7 @@ H5B_iterate (H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, H5B_operator_t op unsigned level; haddr_t left_child; herr_t ret_value; - + FUNC_ENTER_NOAPI(H5B_iterate, FAIL) /* @@ -1610,7 +1610,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type unsigned idx=0, lt=0, rt; /* Final, left & right indices */ int cmp=1; /* Key comparison value */ H5B_ins_t ret_value = H5B_INS_ERROR; - + FUNC_ENTER_NOAPI(H5B_remove_helper, H5B_INS_ERROR) assert(f); @@ -1785,7 +1785,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type */ bt->cache_info.is_dirty = TRUE; bt->nchildren -= 1; - + HDmemmove(bt->native, bt->native + type->sizeof_nkey, (bt->nchildren+1) * type->sizeof_nkey); @@ -1839,7 +1839,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type */ bt->cache_info.is_dirty = TRUE; bt->nchildren -= 1; - + HDmemmove(bt->native + idx * type->sizeof_nkey, bt->native + (idx+1) * type->sizeof_nkey, (bt->nchildren+1-idx) * type->sizeof_nkey); @@ -1847,7 +1847,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type bt->child+idx+1, (bt->nchildren-idx) * sizeof(haddr_t)); ret_value = H5B_INS_NOOP; - + } else { ret_value = H5B_INS_NOOP; } @@ -1890,7 +1890,7 @@ H5B_remove(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void hbool_t rt_key_changed = FALSE; /*right key changed?*/ H5B_t *bt = NULL; /*btree node */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5B_remove, FAIL) /* Check args */ @@ -1915,7 +1915,7 @@ H5B_remove(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void bt->level = 0; bt->cache_info.is_dirty = TRUE; } - + if (H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, FALSE) != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release node") @@ -1951,7 +1951,7 @@ H5B_delete(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void H5B_shared_t *shared; /* Pointer to shared B-tree info */ unsigned u; /* Local index variable */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5B_delete, FAIL) /* Check args */ @@ -1991,7 +1991,7 @@ H5B_delete(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void /* Delete this node from disk */ if (H5MF_xfree(f, H5FD_MEM_BTREE, dxpl_id, addr, (hsize_t)shared->sizeof_rnode)<0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free B-tree node") - + done: if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, TRUE)<0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree node in cache") @@ -2207,7 +2207,7 @@ H5B_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int f HDfprintf(stream, "%*sChild %d...\n", indent, "", u); HDfprintf(stream, "%*s%-*s %a\n", indent + 3, "", MAX(0, fwidth - 3), "Address:", bt->child[u]); - + /* If there is a key debugging routine, use it to display the left & right keys */ if (type->debug_key) { /* Decode the 'left' key & print it */ diff --git a/src/H5Bprivate.h b/src/H5Bprivate.h index b4b1a97..28494f7 100644 --- a/src/H5Bprivate.h +++ b/src/H5Bprivate.h @@ -47,7 +47,7 @@ #endif #define H5B_MAGIC "TREE" /*tree node magic number */ #define H5B_SIZEOF_MAGIC 4 /*size of magic number */ - + typedef enum H5B_ins_t { H5B_INS_ERROR = -1, /*error return value */ H5B_INS_NOOP = 0, /*insert made no changes */ @@ -103,7 +103,7 @@ typedef struct H5B_class_t { int (*cmp2)(H5F_t*, hid_t, void*, void*, void*); /*compare 2 keys */ int (*cmp3)(H5F_t*, hid_t, void*, void*, void*); /*compare 3 keys */ herr_t (*found)(H5F_t*, hid_t, haddr_t, const void*, void*); - + /* insert new data */ H5B_ins_t (*insert)(H5F_t*, hid_t, haddr_t, void*, hbool_t*, void*, void*, void*, hbool_t*, haddr_t*); @@ -111,7 +111,7 @@ typedef struct H5B_class_t { /* min insert uses min leaf, not new(), similarily for max insert */ hbool_t follow_min; hbool_t follow_max; - + /* remove existing data */ H5B_ins_t (*remove)(H5F_t*, hid_t, haddr_t, void*, hbool_t*, void*, void*, hbool_t*); diff --git a/src/H5C.c b/src/H5C.c index fbac5fa..b73db52 100644 --- a/src/H5C.c +++ b/src/H5C.c @@ -19,13 +19,13 @@ * John Mainzer * * Purpose: Functions in this file implement a generic cache for - * things which exist on disk, and which may be + * things which exist on disk, and which may be * unambiguously referenced by their disk addresses. * - * The code in this module was initially written in + * The code in this module was initially written in * support of a complete re-write of the metadata cache * in H5AC.c However, other uses for the cache code - * suggested themselves, and thus this file was created + * suggested themselves, and thus this file was created * in an attempt to support re-use. * * For a detailed overview of the cache, please see the @@ -57,7 +57,7 @@ * unprotect -- or some other way should be found to advise the * cache of changes in entry size. * - * - Flush entries in increasing address order in + * - Flush entries in increasing address order in * H5C_make_space_in_cache(). * * - Also in H5C_make_space_in_cache(), use high and low water marks @@ -98,11 +98,11 @@ /**************************************************************************** * - * We maintain doubly linked lists of instances of H5C_cache_entry_t for a - * variety of reasons -- protected list, LRU list, and the clean and dirty - * LRU lists at present. The following macros support linking and unlinking - * of instances of H5C_cache_entry_t by both their regular and auxilary next - * and previous pointers. + * We maintain doubly linked lists of instances of H5C_cache_entry_t for a + * variety of reasons -- protected list, LRU list, and the clean and dirty + * LRU lists at present. The following macros support linking and unlinking + * of instances of H5C_cache_entry_t by both their regular and auxilary next + * and previous pointers. * * The size and length fields are also maintained. * @@ -436,7 +436,7 @@ if ( ( (entry_ptr) == NULL ) || \ if ( (cache_ptr)->slist_len > (cache_ptr)->max_slist_len ) \ (cache_ptr)->max_slist_len = (cache_ptr)->slist_len; \ if ( (cache_ptr)->slist_size > (cache_ptr)->max_slist_size ) \ - (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; + (cache_ptr)->max_slist_size = (cache_ptr)->slist_size; #define H5C__UPDATE_STATS_FOR_RENAME(cache_ptr, entry_ptr) \ (((cache_ptr)->renames)[(entry_ptr)->type->id])++; @@ -521,16 +521,16 @@ if ( ( (entry_ptr) == NULL ) || \ #else /* H5C_COLLECT_CACHE_ENTRY_STATS */ -#define H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) +#define H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) #define H5C__UPDATE_STATS_FOR_CLEAR(cache_ptr, entry_ptr) \ - (((cache_ptr)->clears)[(entry_ptr)->type->id])++; + (((cache_ptr)->clears)[(entry_ptr)->type->id])++; #define H5C__UPDATE_STATS_FOR_FLUSH(cache_ptr, entry_ptr) \ - (((cache_ptr)->flushes)[(entry_ptr)->type->id])++; + (((cache_ptr)->flushes)[(entry_ptr)->type->id])++; #define H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr) \ - (((cache_ptr)->evictions)[(entry_ptr)->type->id])++; + (((cache_ptr)->evictions)[(entry_ptr)->type->id])++; #define H5C__UPDATE_STATS_FOR_PROTECT(cache_ptr, entry_ptr, hit) \ if ( hit ) \ @@ -550,7 +550,7 @@ if ( ( (entry_ptr) == NULL ) || \ #else /* H5C_COLLECT_CACHE_STATS */ -#define H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) +#define H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) #define H5C__UPDATE_STATS_FOR_UNPROTECT(cache_ptr) #define H5C__UPDATE_STATS_FOR_RENAME(cache_ptr, entry_ptr) #define H5C__UPDATE_STATS_FOR_HT_INSERTION(cache_ptr) @@ -745,12 +745,12 @@ if ( ( (cache_ptr) == NULL ) || \ } \ } \ H5C__UPDATE_STATS_FOR_HT_SEARCH(cache_ptr, (entry_ptr != NULL), depth) \ -} +} /************************************************************************** * - * Skip list insertion and deletion macros: + * Skip list insertion and deletion macros: * * These used to be functions, but I converted them to macros to avoid some * function call overhead. @@ -761,7 +761,7 @@ if ( ( (cache_ptr) == NULL ) || \ * * Macro: H5C__INSERT_ENTRY_IN_SLIST * - * Purpose: Insert the specified instance of H5C_cache_entry_t into + * Purpose: Insert the specified instance of H5C_cache_entry_t into * the skip list in the specified instance of H5C_t. Update * the associated length and size fields. * @@ -773,8 +773,8 @@ if ( ( (cache_ptr) == NULL ) || \ * * JRM -- 7/21/04 * Updated function to set the in_tree flag when inserting - * an entry into the tree. Also modified the function to - * update the tree size and len fields instead of the similar + * an entry into the tree. Also modified the function to + * update the tree size and len fields instead of the similar * index fields. * * All of this is part of the modifications to support the @@ -782,7 +782,7 @@ if ( ( (cache_ptr) == NULL ) || \ * * JRM -- 7/27/04 * Converted the function H5C_insert_entry_in_tree() into - * the macro H5C__INSERT_ENTRY_IN_TREE in the hopes of + * the macro H5C__INSERT_ENTRY_IN_TREE in the hopes of * wringing a little more speed out of the cache. * * Note that we don't bother to check if the entry is already @@ -820,7 +820,7 @@ if ( ( (cache_ptr) == NULL ) || \ * * Function: H5C__REMOVE_ENTRY_FROM_SLIST * - * Purpose: Remove the specified instance of H5C_cache_entry_t from the + * Purpose: Remove the specified instance of H5C_cache_entry_t from the * index skip list in the specified instance of H5C_t. Update * the associated length and size fields. * @@ -870,7 +870,7 @@ if ( ( (cache_ptr) == NULL ) || \ /************************************************************************** * - * Replacement policy update macros: + * Replacement policy update macros: * * These used to be functions, but I converted them to macros to avoid some * function call overhead. @@ -881,10 +881,10 @@ if ( ( (cache_ptr) == NULL ) || \ * * Macro: H5C__UPDATE_RP_FOR_EVICTION * - * Purpose: Update the replacement policy data structures for an + * Purpose: Update the replacement policy data structures for an * eviction of the specified cache entry. * - * At present, we only support the modified LRU policy, so + * At present, we only support the modified LRU policy, so * this function deals with that case unconditionally. If * we ever support other replacement policies, the function * should switch on the current policy and act accordingly. @@ -978,10 +978,10 @@ if ( ( (cache_ptr) == NULL ) || \ * * Macro: H5C__UPDATE_RP_FOR_FLUSH * - * Purpose: Update the replacement policy data structures for a flush + * Purpose: Update the replacement policy data structures for a flush * of the specified cache entry. * - * At present, we only support the modified LRU policy, so + * At present, we only support the modified LRU policy, so * this function deals with that case unconditionally. If * we ever support other replacement policies, the function * should switch on the current policy and act accordingly. @@ -1098,7 +1098,7 @@ if ( ( (cache_ptr) == NULL ) || \ * Purpose: Update the replacement policy data structures for an * insertion of the specified cache entry. * - * At present, we only support the modified LRU policy, so + * At present, we only support the modified LRU policy, so * this function deals with that case unconditionally. If * we ever support other replacement policies, the function * should switch on the current policy and act accordingly. @@ -1193,14 +1193,14 @@ if ( ( (cache_ptr) == NULL ) || \ * * Macro: H5C__UPDATE_RP_FOR_PROTECT * - * Purpose: Update the replacement policy data structures for a + * Purpose: Update the replacement policy data structures for a * protect of the specified cache entry. * - * To do this, unlink the specified entry from any data + * To do this, unlink the specified entry from any data * structures used by the replacement policy, and add the * entry to the protected list. * - * At present, we only support the modified LRU policy, so + * At present, we only support the modified LRU policy, so * this function deals with that case unconditionally. If * we ever support other replacement policies, the function * should switch on the current policy and act accordingly. @@ -1314,10 +1314,10 @@ if ( ( (cache_ptr) == NULL ) || \ * * Macro: H5C__UPDATE_RP_FOR_RENAME * - * Purpose: Update the replacement policy data structures for a + * Purpose: Update the replacement policy data structures for a * rename of the specified cache entry. * - * At present, we only support the modified LRU policy, so + * At present, we only support the modified LRU policy, so * this function deals with that case unconditionally. If * we ever support other replacement policies, the function * should switch on the current policy and act accordingly. @@ -1440,7 +1440,7 @@ if ( ( (cache_ptr) == NULL ) || \ * list, and re-insert it in the data structures used by the * current replacement policy. * - * At present, we only support the modified LRU policy, so + * At present, we only support the modified LRU policy, so * this function deals with that case unconditionally. If * we ever support other replacement policies, the function * should switch on the current policy and act accordingly. @@ -1452,8 +1452,8 @@ if ( ( (cache_ptr) == NULL ) || \ * Modifications: * * JRM - 7/27/04 - * Converted the function H5C_update_rp_for_unprotect() to - * the macro H5C__UPDATE_RP_FOR_UNPROTECT in an effort to + * Converted the function H5C_update_rp_for_unprotect() to + * the macro H5C__UPDATE_RP_FOR_UNPROTECT in an effort to * squeeze a bit more performance out of the cache. * * At least for the first cut, I am leaving the comments and @@ -1554,27 +1554,27 @@ if ( ( (cache_ptr) == NULL ) || \ * * structure H5C_t * - * Catchall structure for all variables specific to an instance of the cache. + * Catchall structure for all variables specific to an instance of the cache. * - * While the individual fields of the structure are discussed below, the + * While the individual fields of the structure are discussed below, the * following overview may be helpful. * * Entries in the cache are stored in an instance of H5TB_TREE, indexed on - * the entry's disk address. While the H5TB_TREE is less efficient than + * the entry's disk address. While the H5TB_TREE is less efficient than * hash table, it keeps the entries in address sorted order. As flushes - * in parallel mode are more efficient if they are issued in increasing + * in parallel mode are more efficient if they are issued in increasing * address order, this is a significant benefit. Also the H5TB_TREE code * was readily available, which reduced development time. * * While the cache was designed with multiple replacement policies in mind, - * at present only a modified form of LRU is supported. + * at present only a modified form of LRU is supported. * * JRM - 4/26/04 * * Profiling has indicated that searches in the instance of H5TB_TREE are - * too expensive. To deal with this issue, I have augmented the cache - * with a hash table in which all entries will be stored. Given the - * advantages of flushing entries in increasing address order, the TBBT + * too expensive. To deal with this issue, I have augmented the cache + * with a hash table in which all entries will be stored. Given the + * advantages of flushing entries in increasing address order, the TBBT * is retained, but only dirty entries are stored in it. At least for * now, we will leave entries in the TBBT after they are flushed. * @@ -1591,7 +1591,7 @@ if ( ( (cache_ptr) == NULL ) || \ * ********************************************* * * WARNING: A copy of H5C_t is in tst/cache.c (under the name "local_H5C_t" - * to allow the test code to access the internal fields of the + * to allow the test code to access the internal fields of the * cache. If you modify H5C_t, be sure to update local_H5C_t * in cache.c as well. * @@ -1601,12 +1601,12 @@ if ( ( (cache_ptr) == NULL ) || \ * field is used to validate pointers to instances of H5C_t. * * max_type_id: Integer field containing the maximum type id number assigned - * to a type of entry in the cache. All type ids from 0 to - * max_type_id inclusive must be defined. The names of the + * to a type of entry in the cache. All type ids from 0 to + * max_type_id inclusive must be defined. The names of the * types are stored in the type_name_table discussed below, and * indexed by the ids. * - * type_name_table_ptr: Pointer to an array of pointer to char of length + * type_name_table_ptr: Pointer to an array of pointer to char of length * max_type_id + 1. The strings pointed to by the entries * in the array are the names of the entry types associated * with the indexing type IDs. @@ -1621,11 +1621,11 @@ if ( ( (cache_ptr) == NULL ) || \ * max_cache_size, it will do so. The cache will attempt * to reduce its size as entries are unprotected. * - * b) When running in parallel mode, the cache may not be - * permitted to flush a dirty entry in response to a read. - * If there are no clean entries available to evict, the - * cache will exceed its maximum size. Again the cache - * will attempt to reduce its size to the max_cache_size + * b) When running in parallel mode, the cache may not be + * permitted to flush a dirty entry in response to a read. + * If there are no clean entries available to evict, the + * cache will exceed its maximum size. Again the cache + * will attempt to reduce its size to the max_cache_size * limit on the next cache write. * * min_clean_size: Nominal minimum number of clean bytes in the cache. @@ -1634,11 +1634,11 @@ if ( ( (cache_ptr) == NULL ) || \ * a soft limit. * * - * In addition to the call back functions required for each entry, the + * In addition to the call back functions required for each entry, the * cache requires the following call back functions for this instance of * the cache as a whole: - * - * check_write_permitted: In certain applications, the cache may not + * + * check_write_permitted: In certain applications, the cache may not * be allowed to write to disk at certain time. If specified, * the check_write_permitted function is used to determine if * a write is permissible at any given point in time. @@ -1650,7 +1650,7 @@ if ( ( (cache_ptr) == NULL ) || \ * The cache requires an index to facilitate searching for entries. The * following fields support that index. * - * index_len: Number of entries currently in the hash table used to index + * index_len: Number of entries currently in the hash table used to index * the cache. * * index_size: Number of bytes of cache entries currently stored in the @@ -1664,16 +1664,16 @@ if ( ( (cache_ptr) == NULL ) || \ * * index: Array of pointer to H5C_cache_entry_t of size * H5C__HASH_TABLE_LEN. At present, this value is a power - * of two, not the usual prime number. + * of two, not the usual prime number. * - * I hope that the variable size of cache elements, the large + * I hope that the variable size of cache elements, the large * hash table size, and the way in which HDF5 allocates space - * will combine to avoid problems with periodicity. If so, we - * can use a trivial hash function (a bit-and and a 3 bit left - * shift) with some small savings. + * will combine to avoid problems with periodicity. If so, we + * can use a trivial hash function (a bit-and and a 3 bit left + * shift) with some small savings. * * If not, it will become evident in the statistics. Changing - * to the usual prime number length hash table will require + * to the usual prime number length hash table will require * changing the H5C__HASH_FCN macro and the deletion of the * H5C__HASH_MASK #define. No other changes should be required. * @@ -1688,7 +1688,7 @@ if ( ( (cache_ptr) == NULL ) || \ * are flushed. * * slist_len: Number of entries currently in the skip list - * used to maintain a sorted list of dirty entries in the + * used to maintain a sorted list of dirty entries in the * cache. * * slist_size: Number of bytes of cache entries currently stored in the @@ -1851,39 +1851,39 @@ if ( ( (cache_ptr) == NULL ) || \ * below. The first set are collected only when H5C_COLLECT_CACHE_STATS * is true. * - * hits: Array of int64 of length H5C__MAX_NUM_TYPE_IDS. The cells - * are used to record the number of times an entry with type id - * equal to the array index has been in cache when requested in + * hits: Array of int64 of length H5C__MAX_NUM_TYPE_IDS. The cells + * are used to record the number of times an entry with type id + * equal to the array index has been in cache when requested in * the current epoch. * - * misses: Array of int64 of length H5C__MAX_NUM_TYPE_IDS. The cells - * are used to record the number of times an entry with type id - * equal to the array index has not been in cache when + * misses: Array of int64 of length H5C__MAX_NUM_TYPE_IDS. The cells + * are used to record the number of times an entry with type id + * equal to the array index has not been in cache when * requested in the current epoch. * - * insertions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS. The cells - * are used to record the number of times an entry with type - * id equal to the array index has been inserted into the + * insertions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS. The cells + * are used to record the number of times an entry with type + * id equal to the array index has been inserted into the * cache in the current epoch. * - * clears: Array of int64 of length H5C__MAX_NUM_TYPE_IDS. The cells - * are used to record the number of times an entry with type - * id equal to the array index has been cleared in the current + * clears: Array of int64 of length H5C__MAX_NUM_TYPE_IDS. The cells + * are used to record the number of times an entry with type + * id equal to the array index has been cleared in the current * epoch. * - * flushes: Array of int64 of length H5C__MAX_NUM_TYPE_IDS. The cells - * are used to record the number of times an entry with type id + * flushes: Array of int64 of length H5C__MAX_NUM_TYPE_IDS. The cells + * are used to record the number of times an entry with type id * equal to the array index has been written to disk in the * current epoch. * - * evictions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS. The cells - * are used to record the number of times an entry with type id - * equal to the array index has been evicted from the cache in + * evictions: Array of int64 of length H5C__MAX_NUM_TYPE_IDS. The cells + * are used to record the number of times an entry with type id + * equal to the array index has been evicted from the cache in * the current epoch. * - * renames: Array of int64 of length H5C__MAX_NUM_TYPE_IDS. The cells - * are used to record the number of times an entry with type - * id equal to the array index has been renamed in the current + * renames: Array of int64 of length H5C__MAX_NUM_TYPE_IDS. The cells + * are used to record the number of times an entry with type + * id equal to the array index has been renamed in the current * epoch. * * total_ht_insertions: Number of times entries have been inserted into the @@ -1892,10 +1892,10 @@ if ( ( (cache_ptr) == NULL ) || \ * total_ht_deletions: Number of times entries have been deleted from the * hash table in the current epoch. * - * successful_ht_searches: int64 containing the total number of successful + * successful_ht_searches: int64 containing the total number of successful * searches of the hash table in the current epoch. * - * total_successful_ht_search_depth: int64 containing the total number of + * total_successful_ht_search_depth: int64 containing the total number of * entries other than the targets examined in successful * searches of the hash table in the current epoch. * @@ -1903,7 +1903,7 @@ if ( ( (cache_ptr) == NULL ) || \ * searches of the hash table in the current epoch. * * total_failed_ht_search_depth: int64 containing the total number of - * entries examined in unsuccessful searches of the hash + * entries examined in unsuccessful searches of the hash * table in the current epoch. * * max_index_len: Largest value attained by the index_len field in the @@ -1927,28 +1927,28 @@ if ( ( (cache_ptr) == NULL ) || \ * The remaining stats are collected only when both H5C_COLLECT_CACHE_STATS * and H5C_COLLECT_CACHE_ENTRY_STATS are true. * - * max_accesses: Array of int32 of length H5C__MAX_NUM_TYPE_IDS. The cells - * are used to record the maximum number of times any single - * entry with type id equal to the array index has been + * max_accesses: Array of int32 of length H5C__MAX_NUM_TYPE_IDS. The cells + * are used to record the maximum number of times any single + * entry with type id equal to the array index has been * accessed in the current epoch. * - * min_accesses: Array of int32 of length H5C__MAX_NUM_TYPE_IDS. The cells - * are used to record the minimum number of times any single - * entry with type id equal to the array index has been + * min_accesses: Array of int32 of length H5C__MAX_NUM_TYPE_IDS. The cells + * are used to record the minimum number of times any single + * entry with type id equal to the array index has been * accessed in the current epoch. * - * max_clears: Array of int32 of length H5C__MAX_NUM_TYPE_IDS. The cells - * are used to record the maximum number of times any single - * entry with type id equal to the array index has been cleared + * max_clears: Array of int32 of length H5C__MAX_NUM_TYPE_IDS. The cells + * are used to record the maximum number of times any single + * entry with type id equal to the array index has been cleared * in the current epoch. * - * max_flushes: Array of int32 of length H5C__MAX_NUM_TYPE_IDS. The cells - * are used to record the maximum number of times any single - * entry with type id equal to the array index has been + * max_flushes: Array of int32 of length H5C__MAX_NUM_TYPE_IDS. The cells + * are used to record the maximum number of times any single + * entry with type id equal to the array index has been * flushed in the current epoch. * * max_size: Array of size_t of length H5C__MAX_NUM_TYPE_IDS. The cells - * are used to record the maximum size of any single entry + * are used to record the maximum size of any single entry * with type id equal to the array index that has resided in * the cache in the current epoch. * @@ -1966,9 +1966,9 @@ if ( ( (cache_ptr) == NULL ) || \ * When this flag is set, all sanity checks on the file * parameters are skipped. The field defaults to FALSE. * - * skip_dxpl_id_checks: Boolean flag used to skip sanity checks on the + * skip_dxpl_id_checks: Boolean flag used to skip sanity checks on the * dxpl_id parameters passed to the cache. These are not - * used directly by the cache, so skipping the checks + * used directly by the cache, so skipping the checks * simplifies the test bed. * * When this flag is set, all sanity checks on the dxpl_id @@ -2105,16 +2105,16 @@ static herr_t H5C_make_space_in_cache(H5F_t * f, /*------------------------------------------------------------------------- * Function: H5C_create * - * Purpose: Allocate, initialize, and return the address of a new + * Purpose: Allocate, initialize, and return the address of a new * instance of H5C_t. * - * In general, the max_cache_size parameter must be positive, - * and the min_clean_size parameter must lie in the closed - * interval [0, max_cache_size]. + * In general, the max_cache_size parameter must be positive, + * and the min_clean_size parameter must lie in the closed + * interval [0, max_cache_size]. * * The check_write_permitted parameter must either be NULL, * or point to a function of type H5C_write_permitted_func_t. - * If it is NULL, the cache will presume that writes are + * If it is NULL, the cache will presume that writes are * always permitted. * * Return: Success: Pointer to the new instance. @@ -2165,7 +2165,7 @@ H5C_create(size_t max_cache_size, "memory allocation failed") } - if ( (cache_ptr->slist_ptr = H5SL_create(H5SL_TYPE_HADDR,0.5,16)) + if ( (cache_ptr->slist_ptr = H5SL_create(H5SL_TYPE_HADDR,0.5,16)) == NULL ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, NULL, "can't create skip list.") @@ -2254,11 +2254,11 @@ done: * This function fails if any object are protected since the * resulting file might not be consistent. * - * The primary_dxpl_id and secondary_dxpl_id parameters + * The primary_dxpl_id and secondary_dxpl_id parameters * specify the dxpl_ids used on the first write occasioned - * by the destroy (primary_dxpl_id), and on all subsequent - * writes (secondary_dxpl_id). This is useful in the metadata - * cache, but may not be needed elsewhere. If so, just use the + * by the destroy (primary_dxpl_id), and on all subsequent + * writes (secondary_dxpl_id). This is useful in the metadata + * cache, but may not be needed elsewhere. If so, just use the * same dxpl_id for both parameters. * * Note that *cache_ptr has been freed upon successful return. @@ -2273,9 +2273,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_dest(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, +H5C_dest(H5F_t * f, + hid_t primary_dxpl_id, + hid_t secondary_dxpl_id, H5C_t * cache_ptr) { herr_t ret_value=SUCCEED; /* Return value */ @@ -2286,7 +2286,7 @@ H5C_dest(H5F_t * f, HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); HDassert( cache_ptr->skip_file_checks || f ); - if ( H5C_flush_cache(f, primary_dxpl_id, secondary_dxpl_id, + if ( H5C_flush_cache(f, primary_dxpl_id, secondary_dxpl_id, cache_ptr, H5F_FLUSH_INVALIDATE) < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache") @@ -2336,8 +2336,8 @@ H5C_dest_empty(H5C_t * cache_ptr) /* This would normally be an assert, but we need to use an HGOTO_ERROR * call to shut up the compiler. */ - if ( ( ! cache_ptr ) || - ( cache_ptr->magic != H5C__H5C_T_MAGIC ) || + if ( ( ! cache_ptr ) || + ( cache_ptr->magic != H5C__H5C_T_MAGIC ) || ( cache_ptr->index_len != 0 ) ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ @@ -2368,18 +2368,18 @@ done: * specified cache. * * If the cache contains protected entries, the function will - * fail, as protected entries cannot be flushed. However - * all unprotected entries should be flushed before the + * fail, as protected entries cannot be flushed. However + * all unprotected entries should be flushed before the * function returns failure. * - * The primary_dxpl_id and secondary_dxpl_id parameters + * The primary_dxpl_id and secondary_dxpl_id parameters * specify the dxpl_ids used on the first write occasioned - * by the flush (primary_dxpl_id), and on all subsequent - * writes (secondary_dxpl_id). This is useful in the metadata - * cache, but may not be needed elsewhere. If so, just use the + * by the flush (primary_dxpl_id), and on all subsequent + * writes (secondary_dxpl_id). This is useful in the metadata + * cache, but may not be needed elsewhere. If so, just use the * same dxpl_id for both parameters. - * - * Return: Non-negative on success/Negative on failure or if there was + * + * Return: Non-negative on success/Negative on failure or if there was * a request to flush all items and something was protected. * * Programmer: John Mainzer @@ -2393,9 +2393,9 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_flush_cache(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, +H5C_flush_cache(H5F_t * f, + hid_t primary_dxpl_id, + hid_t secondary_dxpl_id, H5C_t * cache_ptr, unsigned flags) { @@ -2443,24 +2443,24 @@ H5C_flush_cache(H5F_t * f, if ( entry_ptr->is_protected ) { - /* we have major problems -- but lets flush everything + /* we have major problems -- but lets flush everything * we can before we flag an error. */ protected_entries++; - } else { + } else { - status = H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, + status = H5C_flush_single_entry(f, + primary_dxpl_id, + secondary_dxpl_id, cache_ptr, - NULL, - entry_ptr->addr, - flags, - &first_flush, + NULL, + entry_ptr->addr, + flags, + &first_flush, FALSE); if ( status < 0 ) { - + /* This shouldn't happen -- if it does, we are toast so * just scream and die. */ @@ -2505,7 +2505,7 @@ H5C_flush_cache(H5F_t * f, /* we have major problems -- but lets flush and destroy * everything we can before we flag an error. */ - + H5C__DELETE_FROM_INDEX(cache_ptr, entry_ptr) if ( !entry_ptr->in_slist ) { @@ -2518,17 +2518,17 @@ H5C_flush_cache(H5F_t * f, HDassert( !(entry_ptr->is_dirty) ); HDassert( !(entry_ptr->in_slist) ); - status = H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, + status = H5C_flush_single_entry(f, + primary_dxpl_id, + secondary_dxpl_id, cache_ptr, - NULL, - entry_ptr->addr, - flags, - &first_flush, + NULL, + entry_ptr->addr, + flags, + &first_flush, FALSE); if ( status < 0 ) { - + /* This shouldn't happen -- if it does, we are toast so * just scream and die. */ @@ -2543,10 +2543,10 @@ H5C_flush_cache(H5F_t * f, if ( protected_entries > 0 ) { - /* the caller asked us to flush and destroy a cache that + /* the caller asked us to flush and destroy a cache that * contains one or more protected entries. Since we can't * flush protected entries, we haven't destroyed them either. - * Since they are all on the protected list, just re-insert + * Since they are all on the protected list, just re-insert * them into the cache before we flag an error. */ entry_ptr = cache_ptr->pl_head_ptr; @@ -2587,15 +2587,15 @@ done: * exist on disk yet, but it must have an address and disk * space reserved. * - * The primary_dxpl_id and secondary_dxpl_id parameters + * The primary_dxpl_id and secondary_dxpl_id parameters * specify the dxpl_ids used on the first write occasioned - * by the insertion (primary_dxpl_id), and on all subsequent - * writes (secondary_dxpl_id). This is useful in the - * metadata cache, but may not be needed elsewhere. If so, + * by the insertion (primary_dxpl_id), and on all subsequent + * writes (secondary_dxpl_id). This is useful in the + * metadata cache, but may not be needed elsewhere. If so, * just use the same dxpl_id for both parameters. * - * The primary_dxpl_id is the dxpl_id passed to the - * check_write_permitted function if such a function has been + * The primary_dxpl_id is the dxpl_id passed to the + * check_write_permitted function if such a function has been * provided. * * Observe that this function cannot occasion a read. @@ -2614,12 +2614,12 @@ done: */ herr_t -H5C_insert_entry(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, +H5C_insert_entry(H5F_t * f, + hid_t primary_dxpl_id, + hid_t secondary_dxpl_id, H5C_t * cache_ptr, - const H5C_class_t * type, - haddr_t addr, + const H5C_class_t * type, + haddr_t addr, void * thing) { herr_t result; @@ -2650,7 +2650,7 @@ H5C_insert_entry(H5F_t * f, "Can't get size of thing") } - HDassert( entry_ptr->size < H5C_MAX_ENTRY_SIZE ); + HDassert( entry_ptr->size < H5C_MAX_ENTRY_SIZE ); entry_ptr->in_slist = FALSE; @@ -2658,12 +2658,12 @@ H5C_insert_entry(H5F_t * f, entry_ptr->ht_prev = NULL; entry_ptr->next = NULL; - entry_ptr->prev = NULL; + entry_ptr->prev = NULL; entry_ptr->aux_next = NULL; entry_ptr->aux_prev = NULL; - H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) + H5C__RESET_CACHE_ENTRY_STATS(entry_ptr) if ((cache_ptr->index_size + entry_ptr->size) > cache_ptr->max_cache_size) { @@ -2671,8 +2671,8 @@ H5C_insert_entry(H5F_t * f, if ( cache_ptr->check_write_permitted != NULL ) { - result = (cache_ptr->check_write_permitted)(f, - primary_dxpl_id, + result = (cache_ptr->check_write_permitted)(f, + primary_dxpl_id, &write_permitted); if ( result < 0 ) { @@ -2711,11 +2711,11 @@ H5C_insert_entry(H5F_t * f, * check on space_needed here. */ - result = H5C_make_space_in_cache(f, - primary_dxpl_id, + result = H5C_make_space_in_cache(f, + primary_dxpl_id, secondary_dxpl_id, - cache_ptr, - space_needed, + cache_ptr, + space_needed, write_permitted); if ( result < 0 ) { @@ -2746,7 +2746,7 @@ H5C_insert_entry(H5F_t * f, } /* we don't initialize the protected field until here as it is - * possible that the entry is already in the cache, and already + * possible that the entry is already in the cache, and already * protected. If it is, we don't want to make things worse by * marking it unprotected. */ @@ -2793,7 +2793,7 @@ done: herr_t H5C_rename_entry(H5C_t * cache_ptr, - const H5C_class_t * type, + const H5C_class_t * type, haddr_t old_addr, haddr_t new_addr) { @@ -2824,7 +2824,7 @@ H5C_rename_entry(H5C_t * cache_ptr, H5C__SEARCH_INDEX(cache_ptr, new_addr, test_entry_ptr, FAIL) if ( test_entry_ptr != NULL ) { /* we are hosed */ - + if ( test_entry_ptr->type == type ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTRENAME, FAIL, \ @@ -2838,7 +2838,7 @@ H5C_rename_entry(H5C_t * cache_ptr, } /* If we get this far, we have work to do. Remove *entry_ptr from - * the hash table (and skip list if necessary), change its address to the + * the hash table (and skip list if necessary), change its address to the * new address, and then re-insert. * * Update the replacement policy for a hit to avoid an eviction before @@ -2879,7 +2879,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C_protect * - * Purpose: If the target entry is not in the cache, load it. If + * Purpose: If the target entry is not in the cache, load it. If * necessary, attempt to evict one or more entries to keep * the cache within its maximum size. * @@ -2887,20 +2887,20 @@ done: * to the caller. The caller must call H5C_unprotect() when * finished with the entry. * - * While it is protected, the entry may not be either evicted - * or flushed -- nor may it be accessed by another call to + * While it is protected, the entry may not be either evicted + * or flushed -- nor may it be accessed by another call to * H5C_protect. Any attempt to do so will result in a failure. * - * The primary_dxpl_id and secondary_dxpl_id parameters + * The primary_dxpl_id and secondary_dxpl_id parameters * specify the dxpl_ids used on the first write occasioned - * by the insertion (primary_dxpl_id), and on all subsequent - * writes (secondary_dxpl_id). This is useful in the - * metadata cache, but may not be needed elsewhere. If so, + * by the insertion (primary_dxpl_id), and on all subsequent + * writes (secondary_dxpl_id). This is useful in the + * metadata cache, but may not be needed elsewhere. If so, * just use the same dxpl_id for both parameters. * * All reads are performed with the primary_dxpl_id. * - * Similarly, the primary_dxpl_id is passed to the + * Similarly, the primary_dxpl_id is passed to the * check_write_permitted function if it is called. * * Return: Success: Ptr to the desired entry @@ -2918,13 +2918,13 @@ done: */ void * -H5C_protect(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, +H5C_protect(H5F_t * f, + hid_t primary_dxpl_id, + hid_t secondary_dxpl_id, H5C_t * cache_ptr, - const H5C_class_t * type, + const H5C_class_t * type, haddr_t addr, - const void * udata1, + const void * udata1, void * udata2) { hbool_t hit = FALSE; @@ -2965,7 +2965,7 @@ H5C_protect(H5F_t * f, entry_ptr = (H5C_cache_entry_t *)thing; /* try to free up some space if necessay */ - if ( (cache_ptr->index_size + entry_ptr->size) > + if ( (cache_ptr->index_size + entry_ptr->size) > cache_ptr->max_cache_size ) { hbool_t write_permitted = TRUE; @@ -2974,8 +2974,8 @@ H5C_protect(H5F_t * f, if ( cache_ptr->check_write_permitted != NULL ) { - result = (cache_ptr->check_write_permitted)(f, - primary_dxpl_id, + result = (cache_ptr->check_write_permitted)(f, + primary_dxpl_id, &write_permitted); if ( result < 0 ) { @@ -2990,8 +2990,8 @@ H5C_protect(H5F_t * f, space_needed = (cache_ptr->index_size + entry_ptr->size) - cache_ptr->max_cache_size; - /* It would be nice to be able to do a tight sanity check on - * space_needed here, but it is hard to assign an upper bound on + /* It would be nice to be able to do a tight sanity check on + * space_needed here, but it is hard to assign an upper bound on * its value other than then value assigned to it. * * This fact springs from several features of the cache: @@ -3002,8 +3002,8 @@ H5C_protect(H5F_t * f, * Second, when writes are not permitted it is also possible * for the cache to grow without bound. * - * Finally, we don't check to see if the cache is oversized - * at the end of an unprotect. As a result, it is possible + * Finally, we don't check to see if the cache is oversized + * at the end of an unprotect. As a result, it is possible * to have a vastly oversized cache with no protected entries * as long as all the protects preceed the unprotects. * @@ -3014,8 +3014,8 @@ H5C_protect(H5F_t * f, * check on space_needed here. */ - result = H5C_make_space_in_cache(f, primary_dxpl_id, - secondary_dxpl_id, cache_ptr, + result = H5C_make_space_in_cache(f, primary_dxpl_id, + secondary_dxpl_id, cache_ptr, space_needed, write_permitted); if ( result < 0 ) { @@ -3025,7 +3025,7 @@ H5C_protect(H5F_t * f, } } - /* Insert the entry in the hash table. It can't be dirty yet, so + /* Insert the entry in the hash table. It can't be dirty yet, so * we don't even check to see if it should go in the skip list. */ H5C__INSERT_IN_INDEX(cache_ptr, entry_ptr, NULL) @@ -3070,17 +3070,17 @@ done: * and give it back to the replacement policy. * * The TYPE and ADDR arguments must be the same as those in - * the corresponding call to H5C_protect() and the THING - * argument must be the value returned by that call to + * the corresponding call to H5C_protect() and the THING + * argument must be the value returned by that call to * H5C_protect(). * - * The primary_dxpl_id and secondary_dxpl_id parameters + * The primary_dxpl_id and secondary_dxpl_id parameters * specify the dxpl_ids used on the first write occasioned - * by the unprotect (primary_dxpl_id), and on all subsequent - * writes (secondary_dxpl_id). Since an uprotect cannot - * occasion a write at present, all this is moot for now. - * However, things change, and in any case, - * H5C_flush_single_entry() needs primary_dxpl_id and + * by the unprotect (primary_dxpl_id), and on all subsequent + * writes (secondary_dxpl_id). Since an uprotect cannot + * occasion a write at present, all this is moot for now. + * However, things change, and in any case, + * H5C_flush_single_entry() needs primary_dxpl_id and * secondary_dxpl_id in its parameter list. * * The function can't cause a read either, so the dxpl_id @@ -3089,7 +3089,7 @@ done: * Return: Non-negative on success/Negative on failure * * If the deleted flag is TRUE, simply remove the target entry - * from the cache, clear it, and free it without writing it to + * from the cache, clear it, and free it without writing it to * disk. * * Return: Non-negative on success/Negative on failure @@ -3107,13 +3107,13 @@ done: *------------------------------------------------------------------------- */ herr_t -H5C_unprotect(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, +H5C_unprotect(H5F_t * f, + hid_t primary_dxpl_id, + hid_t secondary_dxpl_id, H5C_t * cache_ptr, - const H5C_class_t * type, + const H5C_class_t * type, haddr_t addr, - void * thing, + void * thing, hbool_t deleted) { herr_t ret_value = SUCCEED; /* Return value */ @@ -3144,7 +3144,7 @@ H5C_unprotect(H5F_t * f, H5C__UPDATE_RP_FOR_UNPROTECT(cache_ptr, entry_ptr, FAIL) - entry_ptr->is_protected = FALSE; + entry_ptr->is_protected = FALSE; /* add the entry to the skip list if it is dirty, and it isn't already in * the list. @@ -3158,9 +3158,9 @@ H5C_unprotect(H5F_t * f, /* this implementation of the "deleted" option is a bit inefficient, as * we re-insert the entry to be deleted into the replacement policy * data structures, only to remove them again. Depending on how often - * we do this, we may want to optimize a bit. + * we do this, we may want to optimize a bit. * - * On the other hand, this implementation is reasonably clean, and + * On the other hand, this implementation is reasonably clean, and * makes good use of existing code. * JRM - 5/19/04 */ @@ -3188,14 +3188,14 @@ H5C_unprotect(H5F_t * f, "hash table contains multiple entries for addr?!?.") } - if ( H5C_flush_single_entry(f, - primary_dxpl_id, - secondary_dxpl_id, + if ( H5C_flush_single_entry(f, + primary_dxpl_id, + secondary_dxpl_id, cache_ptr, - type, - addr, + type, + addr, (H5F_FLUSH_CLEAR_ONLY|H5F_FLUSH_INVALIDATE), - &dummy_first_flush, + &dummy_first_flush, TRUE) < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Can't flush.") @@ -3264,8 +3264,8 @@ H5C_stats(H5C_t * cache_ptr, /* This would normally be an assert, but we need to use an HGOTO_ERROR * call to shut up the compiler. */ - if ( ( ! cache_ptr ) || - ( cache_ptr->magic != H5C__H5C_T_MAGIC ) || + if ( ( ! cache_ptr ) || + ( cache_ptr->magic != H5C__H5C_T_MAGIC ) || ( !cache_name ) ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "Bad cache_ptr or cache_name") @@ -3288,7 +3288,7 @@ H5C_stats(H5C_t * cache_ptr, if ( aggregate_min_accesses > aggregate_max_accesses ) aggregate_min_accesses = aggregate_max_accesses; if ( aggregate_min_accesses > cache_ptr->min_accesses[i] ) - aggregate_min_accesses = cache_ptr->min_accesses[i]; + aggregate_min_accesses = cache_ptr->min_accesses[i]; if ( aggregate_max_clears < cache_ptr->max_clears[i] ) aggregate_max_clears = cache_ptr->max_clears[i]; if ( aggregate_max_flushes < cache_ptr->max_flushes[i] ) @@ -3308,54 +3308,54 @@ H5C_stats(H5C_t * cache_ptr, if ( cache_ptr->successful_ht_searches > 0 ) { - average_successful_search_depth = + average_successful_search_depth = ((double)(cache_ptr->total_successful_ht_search_depth)) / ((double)(cache_ptr->successful_ht_searches)); } if ( cache_ptr->failed_ht_searches > 0 ) { - average_failed_search_depth = + average_failed_search_depth = ((double)(cache_ptr->total_failed_ht_search_depth)) / ((double)(cache_ptr->failed_ht_searches)); } - + HDfprintf(stdout, "\nH5C: cache statistics for %s\n", cache_name); HDfprintf(stdout, "\n"); - HDfprintf(stdout, + HDfprintf(stdout, " hash table insertion / deletions = %ld / %ld\n", (long)(cache_ptr->total_ht_insertions), (long)(cache_ptr->total_ht_deletions)); - HDfprintf(stdout, + HDfprintf(stdout, " HT successful / failed searches = %ld / %ld\n", (long)(cache_ptr->successful_ht_searches), (long)(cache_ptr->failed_ht_searches)); - HDfprintf(stdout, + HDfprintf(stdout, " Av. HT suc / failed search depth = %f / %f\n", average_successful_search_depth, average_failed_search_depth); - HDfprintf(stdout, + HDfprintf(stdout, " current (max) index size / length = %ld (%ld) / %ld (%ld)\n", (long)(cache_ptr->index_size), (long)(cache_ptr->max_index_size), (long)(cache_ptr->index_len), (long)(cache_ptr->max_index_len)); - HDfprintf(stdout, + HDfprintf(stdout, " current (max) skip list size / length = %ld (%ld) / %ld (%ld)\n", (long)(cache_ptr->slist_size), (long)(cache_ptr->max_slist_size), (long)(cache_ptr->slist_len), (long)(cache_ptr->max_slist_len)); - HDfprintf(stdout, + HDfprintf(stdout, " current (max) PL size / length = %ld (%ld) / %ld (%ld)\n", (long)(cache_ptr->pl_size), (long)(cache_ptr->max_pl_size), @@ -3377,13 +3377,13 @@ H5C_stats(H5C_t * cache_ptr, (long)(cache_ptr->dLRU_list_size), (long)(cache_ptr->dLRU_list_len)); - HDfprintf(stdout, + HDfprintf(stdout, " Total hits / misses / hit_rate = %ld / %ld / %f\n", - (long)total_hits, - (long)total_misses, + (long)total_hits, + (long)total_misses, hit_rate); - HDfprintf(stdout, + HDfprintf(stdout, " Total clears / flushes / evictions = %ld / %ld / %ld\n", (long)total_clears, (long)total_flushes, @@ -3416,7 +3416,7 @@ H5C_stats(H5C_t * cache_ptr, HDfprintf(stdout, "\n"); - HDfprintf(stdout, " Stats on %s:\n", + HDfprintf(stdout, " Stats on %s:\n", ((cache_ptr->type_name_table_ptr))[i]); if ( ( cache_ptr->hits[i] > 0 ) || ( cache_ptr->misses[i] > 0 ) ) { @@ -3427,36 +3427,36 @@ H5C_stats(H5C_t * cache_ptr, hit_rate = 0.0; } - HDfprintf(stdout, - " hits / misses / hit_rate = %ld / %ld / %f\n", + HDfprintf(stdout, + " hits / misses / hit_rate = %ld / %ld / %f\n", (long)(cache_ptr->hits[i]), (long)(cache_ptr->misses[i]), hit_rate); - HDfprintf(stdout, + HDfprintf(stdout, " clears / flushes / evictions = %ld / %ld / %ld\n", (long)(cache_ptr->clears[i]), (long)(cache_ptr->flushes[i]), (long)(cache_ptr->evictions[i])); - HDfprintf(stdout, + HDfprintf(stdout, " insertions / renames = %ld / %ld\n", (long)(cache_ptr->insertions[i]), (long)(cache_ptr->renames[i])); #if H5C_COLLECT_CACHE_ENTRY_STATS - HDfprintf(stdout, + HDfprintf(stdout, " entry max / min accesses = %d / %d\n", cache_ptr->max_accesses[i], cache_ptr->min_accesses[i]); - HDfprintf(stdout, + HDfprintf(stdout, " entry max_clears / max_flushes = %d / %d\n", cache_ptr->max_clears[i], cache_ptr->max_flushes[i]); - HDfprintf(stdout, + HDfprintf(stdout, " entry max_size = %d\n", (int)(cache_ptr->max_size[i])); @@ -3537,7 +3537,7 @@ H5C_stats__reset(H5C_t * cache_ptr) for ( i = 0; i <= cache_ptr->max_type_id; i++ ) { cache_ptr->max_accesses[i] = 0; - cache_ptr->min_accesses[i] = 1000000; + cache_ptr->min_accesses[i] = 1000000; cache_ptr->max_clears[i] = 0; cache_ptr->max_flushes[i] = 0; cache_ptr->max_size[i] = (size_t)0; @@ -3555,9 +3555,9 @@ H5C_stats__reset(H5C_t * cache_ptr) * Function: H5C_set_skip_flags * * Purpose: Set the values of the skip sanity check flags. - * + * * This function and the skip sanity check flags were created - * for the convenience of the test bed. However it is + * for the convenience of the test bed. However it is * possible that there may be other uses for the flags. * * Return: Non-negative on success/Negative on failure @@ -3604,24 +3604,24 @@ done: * * Function: H5C_flush_single_entry * - * Purpose: Flush or clear (and evict if requested) the cache entry + * Purpose: Flush or clear (and evict if requested) the cache entry * with the specified address and type. If the type is NULL, - * any unprotected entry at the specified address will be + * any unprotected entry at the specified address will be * flushed (and possibly evicted). * - * Attempts to flush a protected entry will result in an + * Attempts to flush a protected entry will result in an * error. * - * *first_flush_ptr should be true if only one + * *first_flush_ptr should be true if only one * flush is contemplated before the next load, or if this - * is the first of a sequence of flushes that will be + * is the first of a sequence of flushes that will be * completed before the next load. *first_flush_ptr is set - * to false if a flush actually takes place, and should be + * to false if a flush actually takes place, and should be * left false until the end of the sequence. * * The primary_dxpl_id is used if *first_flush_ptr is TRUE - * on entry, and a flush actually takes place. The - * secondary_dxpl_id is used in any subsequent flush where + * on entry, and a flush actually takes place. The + * secondary_dxpl_id is used in any subsequent flush where * *first_flush_ptr is FALSE on entry. * * If the H5F_FLUSH_CLEAR_ONLY flag is set, the entry will @@ -3629,17 +3629,17 @@ done: * primary_dxpl_id, and secondary_dxpl_id are all irrelevent, * and the call can't be part of a sequence of flushes. * - * If the caller knows the address of the TBBT node at - * which the target entry resides, it can avoid a lookup + * If the caller knows the address of the TBBT node at + * which the target entry resides, it can avoid a lookup * by supplying that address in the tgt_node_ptr parameter. * If this parameter is NULL, the function will do a TBBT * search for the entry instead. * * The function does nothing silently if there is no entry - * at the supplied address, or if the entry found has the + * at the supplied address, or if the entry found has the * wrong type. * - * Return: Non-negative on success/Negative on failure or if there was + * Return: Non-negative on success/Negative on failure or if there was * an attempt to flush a protected item. * * Programmer: John Mainzer, 5/5/04 @@ -3655,18 +3655,18 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5C_flush_single_entry(H5F_t * f, - hid_t primary_dxpl_id, - hid_t secondary_dxpl_id, +H5C_flush_single_entry(H5F_t * f, + hid_t primary_dxpl_id, + hid_t secondary_dxpl_id, H5C_t * cache_ptr, - const H5C_class_t * type_ptr, - haddr_t addr, + const H5C_class_t * type_ptr, + haddr_t addr, unsigned flags, hbool_t * first_flush_ptr, hbool_t del_entry_from_slist_on_destroy) { hbool_t destroy = ( (flags & H5F_FLUSH_INVALIDATE) != 0 ); - hbool_t clear_only = ( (flags & H5F_FLUSH_CLEAR_ONLY) != 0); + hbool_t clear_only = ( (flags & H5F_FLUSH_CLEAR_ONLY) != 0); herr_t ret_value = SUCCEED; /* Return value */ herr_t status; H5C_cache_entry_t * entry_ptr = NULL; @@ -3714,12 +3714,12 @@ H5C_flush_single_entry(H5F_t * f, { /* we have work to do */ -#ifdef H5_HAVE_PARALLEL +#ifdef H5_HAVE_PARALLEL #ifndef NDEBUG /* If MPI based VFD is used, do special parallel I/O sanity checks. * Note that we only do these sanity checks when the clear_only flag - * is not set, and the entry to be flushed is dirty. Don't bother + * is not set, and the entry to be flushed is dirty. Don't bother * otherwise as no file I/O can result. * * There are also cases (testing for instance) where it is convenient @@ -3727,9 +3727,9 @@ H5C_flush_single_entry(H5F_t * f, * this isn't a problem -- but we do have to turn off sanity checks * involving them. We use cache_ptr->skip_dxpl_id_checks to do this. */ - if ( ( ! cache_ptr->skip_dxpl_id_checks ) && - ( ! clear_only ) && - ( entry_ptr->is_dirty ) && + if ( ( ! cache_ptr->skip_dxpl_id_checks ) && + ( ! clear_only ) && + ( entry_ptr->is_dirty ) && ( IS_H5FD_MPI(f) ) ) { H5P_genplist_t *dxpl; /* Dataset transfer property list */ @@ -3766,12 +3766,12 @@ H5C_flush_single_entry(H5F_t * f, H5C__UPDATE_STATS_FOR_EVICTION(cache_ptr, entry_ptr) } - /* Always remove the entry from the hash table on a destroy. On a + /* Always remove the entry from the hash table on a destroy. On a * flush with destroy, it is cheaper to discard the skip list all at once * rather than remove the entries one by one, so we only delete from * the list if requested. * - * We must do deletions now as the callback routines will free the + * We must do deletions now as the callback routines will free the * entry if destroy is true. */ if ( destroy ) { @@ -3785,7 +3785,7 @@ H5C_flush_single_entry(H5F_t * f, } /* Update the replacement policy for the flush or eviction. - * Again, do this now so we don't have to reference freed + * Again, do this now so we don't have to reference freed * memory in the destroy case. */ if ( destroy ) { /* AKA eviction */ @@ -3805,16 +3805,16 @@ H5C_flush_single_entry(H5F_t * f, } } else { - /* Only block for all the processes on the first piece of metadata + /* Only block for all the processes on the first piece of metadata */ if ( *first_flush_ptr && entry_ptr->is_dirty ) { - status = (entry_ptr->type->flush)(f, primary_dxpl_id, destroy, + status = (entry_ptr->type->flush)(f, primary_dxpl_id, destroy, entry_ptr->addr, entry_ptr); *first_flush_ptr = FALSE; } else { - status = (entry_ptr->type->flush)(f, secondary_dxpl_id, - destroy, entry_ptr->addr, + status = (entry_ptr->type->flush)(f, secondary_dxpl_id, + destroy, entry_ptr->addr, entry_ptr); } @@ -3825,7 +3825,7 @@ H5C_flush_single_entry(H5F_t * f, } if ( ! destroy ) { - + HDassert( !(entry_ptr->is_dirty) ); } } @@ -3846,7 +3846,7 @@ done: * return the in memory address of the entry. Return NULL * on failure. * - * Note that this function simply loads the entry into + * Note that this function simply loads the entry into * core. It does not insert it into the cache. * * Return: Non-NULL on success / NULL on failure. @@ -3862,11 +3862,11 @@ done: */ static void * -H5C_load_entry(H5F_t * f, - hid_t dxpl_id, - const H5C_class_t * type, +H5C_load_entry(H5F_t * f, + hid_t dxpl_id, + const H5C_class_t * type, haddr_t addr, - const void * udata1, + const void * udata1, void * udata2, hbool_t skip_file_checks) { @@ -3903,7 +3903,7 @@ H5C_load_entry(H5F_t * f, "Can't get size of thing") } - HDassert( entry_ptr->size < H5C_MAX_ENTRY_SIZE ); + HDassert( entry_ptr->size < H5C_MAX_ENTRY_SIZE ); entry_ptr->ht_next = NULL; entry_ptr->ht_prev = NULL; @@ -3932,24 +3932,24 @@ done: * Purpose: Attempt to evict cache entries until the index_size * is at least needed_space below max_cache_size. * - * In passing, also attempt to bring cLRU_list_size to a + * In passing, also attempt to bring cLRU_list_size to a * value greater than min_clean_size. * * Depending on circumstances, both of these goals may * be impossible, as in parallel mode, we must avoid generating * a write as part of a read (to avoid deadlock in collective * I/O), and in all cases, it is possible (though hopefully - * highly unlikely) that the protected list may exceed the + * highly unlikely) that the protected list may exceed the * maximum size of the cache. - * + * * Thus the function simply does its best, returning success * unless an error is encountered. * - * The primary_dxpl_id and secondary_dxpl_id parameters + * The primary_dxpl_id and secondary_dxpl_id parameters * specify the dxpl_ids used on the first write occasioned - * by the call (primary_dxpl_id), and on all subsequent - * writes (secondary_dxpl_id). This is useful in the metadata - * cache, but may not be needed elsewhere. If so, just use the + * by the call (primary_dxpl_id), and on all subsequent + * writes (secondary_dxpl_id). This is useful in the metadata + * cache, but may not be needed elsewhere. If so, just use the * same dxpl_id for both parameters. * * Observe that this function cannot occasion a read. @@ -3993,8 +3993,8 @@ H5C_make_space_in_cache(H5F_t * f, initial_list_len = cache_ptr->LRU_list_len; entry_ptr = cache_ptr->LRU_tail_ptr; - while ( ( (cache_ptr->index_size + space_needed) - > + while ( ( (cache_ptr->index_size + space_needed) + > cache_ptr->max_cache_size ) && @@ -4009,25 +4009,25 @@ H5C_make_space_in_cache(H5F_t * f, if ( entry_ptr->is_dirty ) { - result = H5C_flush_single_entry(f, - primary_dxpl_id, + result = H5C_flush_single_entry(f, + primary_dxpl_id, secondary_dxpl_id, cache_ptr, - entry_ptr->type, - entry_ptr->addr, - (unsigned)0, - &first_flush, + entry_ptr->type, + entry_ptr->addr, + (unsigned)0, + &first_flush, FALSE); } else { - result = H5C_flush_single_entry(f, - primary_dxpl_id, + result = H5C_flush_single_entry(f, + primary_dxpl_id, secondary_dxpl_id, cache_ptr, - entry_ptr->type, - entry_ptr->addr, + entry_ptr->type, + entry_ptr->addr, H5F_FLUSH_INVALIDATE, - &first_flush, + &first_flush, TRUE); } @@ -4056,14 +4056,14 @@ H5C_make_space_in_cache(H5F_t * f, prev_ptr = entry_ptr->aux_prev; - result = H5C_flush_single_entry(f, - primary_dxpl_id, + result = H5C_flush_single_entry(f, + primary_dxpl_id, secondary_dxpl_id, cache_ptr, - entry_ptr->type, - entry_ptr->addr, - (unsigned)0, - &first_flush, + entry_ptr->type, + entry_ptr->addr, + (unsigned)0, + &first_flush, FALSE); if ( result < 0 ) { @@ -4084,12 +4084,12 @@ H5C_make_space_in_cache(H5F_t * f, initial_list_len = cache_ptr->cLRU_list_len; entry_ptr = cache_ptr->cLRU_tail_ptr; - while ( ( (cache_ptr->index_size + space_needed) - > + while ( ( (cache_ptr->index_size + space_needed) + > cache_ptr->max_cache_size ) && - ( entries_examined <= initial_list_len ) + ( entries_examined <= initial_list_len ) && ( entry_ptr != NULL ) ) @@ -4099,14 +4099,14 @@ H5C_make_space_in_cache(H5F_t * f, prev_ptr = entry_ptr->aux_prev; - result = H5C_flush_single_entry(f, - primary_dxpl_id, + result = H5C_flush_single_entry(f, + primary_dxpl_id, secondary_dxpl_id, cache_ptr, - entry_ptr->type, - entry_ptr->addr, + entry_ptr->type, + entry_ptr->addr, H5F_FLUSH_INVALIDATE, - &first_flush, + &first_flush, TRUE); if ( result < 0 ) { diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index affd433..f161c01 100644 --- a/src/H5Cprivate.h +++ b/src/H5Cprivate.h @@ -51,10 +51,10 @@ #define H5C_COLLECT_CACHE_STATS 0 /* H5C_COLLECT_CACHE_ENTRY_STATS controls collection of statistics - * in individual cache entries. - * - * H5C_COLLECT_CACHE_ENTRY_STATS should only be defined to true if - * H5C_COLLECT_CACHE_STATS is also defined to true. + * in individual cache entries. + * + * H5C_COLLECT_CACHE_ENTRY_STATS should only be defined to true if + * H5C_COLLECT_CACHE_STATS is also defined to true. */ #if H5C_COLLECT_CACHE_STATS @@ -109,23 +109,23 @@ * Note that the space allocated on disk may not be contiguous. */ -typedef void *(*H5C_load_func_t)(H5F_t *f, - hid_t dxpl_id, - haddr_t addr, - const void *udata1, +typedef void *(*H5C_load_func_t)(H5F_t *f, + hid_t dxpl_id, + haddr_t addr, + const void *udata1, void *udata2); -typedef herr_t (*H5C_flush_func_t)(H5F_t *f, - hid_t dxpl_id, - hbool_t dest, - haddr_t addr, +typedef herr_t (*H5C_flush_func_t)(H5F_t *f, + hid_t dxpl_id, + hbool_t dest, + haddr_t addr, void *thing); -typedef herr_t (*H5C_dest_func_t)(H5F_t *f, +typedef herr_t (*H5C_dest_func_t)(H5F_t *f, void *thing); -typedef herr_t (*H5C_clear_func_t)(H5F_t *f, - void *thing, +typedef herr_t (*H5C_clear_func_t)(H5F_t *f, + void *thing, hbool_t dest); -typedef herr_t (*H5C_size_func_t)(const H5F_t *f, - const void *thing, +typedef herr_t (*H5C_size_func_t)(const H5F_t *f, + const void *thing, size_t *size_ptr); typedef struct H5C_class_t { @@ -157,11 +157,11 @@ typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f, * * structure H5C_cache_entry_t * - * Instances of the H5C_cache_entry_t structure are used to store cache - * entries in a hash table and sometimes in a skip list. + * Instances of the H5C_cache_entry_t structure are used to store cache + * entries in a hash table and sometimes in a skip list. * See H5SL.c for the particulars of the skip list. * - * In typical application, this structure is the first field in a + * In typical application, this structure is the first field in a * structure to be cached. For historical reasons, the external module * is responsible for managing the is_dirty field. All other fields are * managed by the cache. @@ -191,12 +191,12 @@ typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f, * * NOTE: For historical reasons, this field is not maintained * by the cache. Instead, the module using the cache - * sets this flag when it modifies the entry, and the + * sets this flag when it modifies the entry, and the * flush and clear functions supplied by that module * reset the dirty when appropriate. * * This is a bit quirky, so we may want to change this - * someday. However it will require a change in the + * someday. However it will require a change in the * cache interface. * * is_protected: Boolean flag indicating whether this entry is protected @@ -222,63 +222,63 @@ typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f, * * ht_next: Next pointer used by the hash table to store multiple * entries in a single hash bin. This field points to the - * next entry in the doubly linked list of entries in the + * next entry in the doubly linked list of entries in the * hash bin, or NULL if there is no next entry. * * ht_prev: Prev pointer used by the hash table to store multiple * entries in a single hash bin. This field points to the - * previous entry in the doubly linked list of entries in + * previous entry in the doubly linked list of entries in * the hash bin, or NULL if there is no previuos entry. * * * Fields supporting replacement policies: * - * The cache must have a replacement policy, and it will usually be + * The cache must have a replacement policy, and it will usually be * necessary for this structure to contain fields supporting that policy. * - * While there has been interest in several replacement policies for + * While there has been interest in several replacement policies for * this cache, the initial development schedule is tight. Thus I have * elected to support only a modified LRU policy for the first cut. * * When additional replacement policies are added, the fields in this - * section will be used in different ways or not at all. Thus the + * section will be used in different ways or not at all. Thus the * documentation of these fields is repeated for each replacement policy. - * + * * Modified LRU: - * + * * When operating in parallel mode, we must ensure that a read does not * cause a write. If it does, the process will hang, as the write will * be collective and the other processes will not know to participate. * * To deal with this issue, I have modified the usual LRU policy by adding - * clean and dirty LRU lists to the usual LRU list. When reading in + * clean and dirty LRU lists to the usual LRU list. When reading in * parallel mode, we evict from the clean LRU list only. This implies - * that we must try to ensure that the clean LRU list is reasonably well + * that we must try to ensure that the clean LRU list is reasonably well * stocked. See the comments on H5C_t in H5C.c for more details. - * + * * Note that even if we start with a completely clean cache, a sequence * of protects without unprotects can empty the clean LRU list. In this - * case, the cache must grow temporarily. At the next write, we will + * case, the cache must grow temporarily. At the next write, we will * attempt to evict enough entries to get the cache down to its nominal * maximum size. * * The use of the replacement policy fields under the Modified LRU policy * is discussed below: * - * next: Next pointer in either the LRU or the protected list, - * depending on the current value of protected. If there - * is no next entry on the list, this field should be set + * next: Next pointer in either the LRU or the protected list, + * depending on the current value of protected. If there + * is no next entry on the list, this field should be set * to NULL. * - * prev: Prev pointer in either the LRU or the protected list, - * depending on the current value of protected. If there - * is no previous entry on the list, this field should be + * prev: Prev pointer in either the LRU or the protected list, + * depending on the current value of protected. If there + * is no previous entry on the list, this field should be * set to NULL. * * aux_next: Next pointer on either the clean or dirty LRU lists. * This entry should be NULL when protected is true. When * protected is false, and dirty is true, it should point - * to the next item on the dirty LRU list. When protected + * to the next item on the dirty LRU list. When protected * is false, and dirty is false, it should point to the * next item on the clean LRU list. In either case, when * there is no next item, it should be NULL. @@ -286,7 +286,7 @@ typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f, * aux_prev: Previous pointer on either the clean or dirty LRU lists. * This entry should be NULL when protected is true. When * protected is false, and dirty is true, it should point - * to the previous item on the dirty LRU list. When protected + * to the previous item on the dirty LRU list. When protected * is false, and dirty is false, it should point to the * previous item on the clean LRU list. In either case, when * there is no previous item, it should be NULL. @@ -296,7 +296,7 @@ typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f, * * These fields should only be compiled in when both H5C_COLLECT_CACHE_STATS * and H5C_COLLECT_CACHE_ENTRY_STATS are true. When present, they allow - * collection of statistics on individual cache entries. + * collection of statistics on individual cache entries. * * accesses: int32_t containing the number of times this cache entry has * been referenced in its lifetime. @@ -305,8 +305,8 @@ typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f, * been cleared in its life time. * * flushes: int32_t containing the number of times this cache entry has - * been flushed to file in its life time. - * + * been flushed to file in its life time. + * ****************************************************************************/ typedef struct H5C_cache_entry_t @@ -340,7 +340,7 @@ typedef struct H5C_cache_entry_t #endif /* H5C_COLLECT_CACHE_ENTRY_STATS */ -} H5C_cache_entry_t; +} H5C_cache_entry_t; /* Typedef for the main structure for the cache (defined in H5C.c) */ diff --git a/src/H5D.c b/src/H5D.c index cd63c53..b0dbaec 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -33,7 +33,7 @@ /* Local functions */ static herr_t H5D_init_storage(H5D_t *dataset, hbool_t full_overwrite, hid_t dxpl_id); static H5D_shared_t * H5D_new(hid_t dcpl_id, hbool_t creating, hbool_t vl_type); -static H5D_t * H5D_create(H5G_entry_t *loc, const char *name, hid_t type_id, +static H5D_t * H5D_create(H5G_entry_t *loc, const char *name, hid_t type_id, const H5S_t *space, hid_t dcpl_id, hid_t dxpl_id); static H5D_t * H5D_open_oid(const H5G_entry_t *ent, hid_t dxpl_id); static herr_t H5D_get_space_status(H5D_t *dset, H5D_space_status_t *allocation, hid_t dxpl_id); @@ -111,7 +111,7 @@ NAME H5D_init_interface -- Initialize interface-specific information USAGE herr_t H5D_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -144,23 +144,23 @@ H5D_init_interface(void) * - Default value for EDC property * - Default value for filter callback */ - H5P_genclass_t *xfer_pclass; + H5P_genclass_t *xfer_pclass; size_t def_max_temp_buf = H5D_XFER_MAX_TEMP_BUF_DEF; void *def_tconv_buf = H5D_XFER_TCONV_BUF_DEF; - void *def_bkgr_buf = H5D_XFER_BKGR_BUF_DEF; - H5T_bkg_t def_bkgr_buf_type = H5D_XFER_BKGR_BUF_TYPE_DEF; + void *def_bkgr_buf = H5D_XFER_BKGR_BUF_DEF; + H5T_bkg_t def_bkgr_buf_type = H5D_XFER_BKGR_BUF_TYPE_DEF; double def_btree_split_ratio[3] = H5D_XFER_BTREE_SPLIT_RATIO_DEF; #ifdef H5_WANT_H5_V1_4_COMPAT - unsigned def_hyper_cache = H5D_XFER_HYPER_CACHE_DEF; - unsigned def_hyper_cache_lim = H5D_XFER_HYPER_CACHE_LIM_DEF; + unsigned def_hyper_cache = H5D_XFER_HYPER_CACHE_DEF; + unsigned def_hyper_cache_lim = H5D_XFER_HYPER_CACHE_LIM_DEF; #endif /* H5_WANT_H5_V1_4_COMPAT */ - H5MM_allocate_t def_vlen_alloc = H5D_XFER_VLEN_ALLOC_DEF; + H5MM_allocate_t def_vlen_alloc = H5D_XFER_VLEN_ALLOC_DEF; void *def_vlen_alloc_info = H5D_XFER_VLEN_ALLOC_INFO_DEF; - H5MM_free_t def_vlen_free = H5D_XFER_VLEN_FREE_DEF; + H5MM_free_t def_vlen_free = H5D_XFER_VLEN_FREE_DEF; void *def_vlen_free_info = H5D_XFER_VLEN_FREE_INFO_DEF; - hid_t def_vfl_id = H5D_XFER_VFL_ID_DEF; - void *def_vfl_info = H5D_XFER_VFL_INFO_DEF; - size_t def_hyp_vec_size = H5D_XFER_HYPER_VECTOR_SIZE_DEF; + hid_t def_vfl_id = H5D_XFER_VFL_ID_DEF; + void *def_vfl_info = H5D_XFER_VFL_INFO_DEF; + size_t def_hyp_vec_size = H5D_XFER_HYPER_VECTOR_SIZE_DEF; #ifdef H5_HAVE_PARALLEL H5FD_mpio_xfer_t def_io_xfer_mode = H5D_XFER_IO_XFER_MODE_DEF; #endif /* H5_HAVE_PARALLEL */ @@ -183,7 +183,7 @@ H5D_init_interface(void) H5O_fill_t fill = H5D_CRT_FILL_VALUE_DEF; H5D_alloc_time_t alloc_time = H5D_CRT_ALLOC_TIME_DEF; unsigned alloc_time_state = H5D_CRT_ALLOC_TIME_STATE_DEF; - H5D_fill_time_t fill_time = H5D_CRT_FILL_TIME_DEF; + H5D_fill_time_t fill_time = H5D_CRT_FILL_TIME_DEF; H5O_efl_t efl = H5D_CRT_EXT_FILE_LIST_DEF; H5O_pline_t pline = H5D_CRT_DATA_PIPELINE_DEF; @@ -197,7 +197,7 @@ H5D_init_interface(void) if (H5I_init_group(H5I_DATASET, H5I_DATASETID_HASHSIZE, H5D_RESERVED_ATOMS, (H5I_free_t)H5D_close)<0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize interface") - /* =========Dataset Transfer Property Class Initialization========= */ + /* =========Dataset Transfer Property Class Initialization========= */ /* Register the default dataset transfer properties */ assert(H5P_CLS_DATASET_XFER_g!=(-1)); @@ -278,7 +278,7 @@ H5D_init_interface(void) /* Register the EDC property */ if(H5P_register(xfer_pclass,H5D_XFER_EDC_NAME,H5D_XFER_EDC_SIZE,&enable_edc,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - + /* Register the filter callback property */ if(H5P_register(xfer_pclass,H5D_XFER_FILTER_CB_NAME,H5D_XFER_FILTER_CB_SIZE,&filter_cb,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -294,29 +294,29 @@ H5D_init_interface(void) /* =========Dataset Creation Property Class Initialization========== */ /* Register the default dataset creation properties */ assert(H5P_CLS_DATASET_CREATE_g != -1); - + /* Get the pointer to the dataset creation class */ if(NULL == (crt_pclass = H5I_object(H5P_CLS_DATASET_CREATE_g))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list class") - + /* Get the number of properties in the class */ if(H5P_get_nprops_pclass(crt_pclass,&nprops)<0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't query number of properties") /* Assume that if there are properties in the class, they are the default ones */ if(nprops==0) { - /* Register the storage layout property */ + /* Register the storage layout property */ if(H5P_register(crt_pclass, H5D_CRT_LAYOUT_NAME, H5D_CRT_LAYOUT_SIZE, &layout, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - + /* Register the chunking dimensionality property */ if(H5P_register(crt_pclass, H5D_CRT_CHUNK_DIM_NAME, H5D_CRT_CHUNK_DIM_SIZE, &chunk_ndims, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - /* Register the chunking size property */ + /* Register the chunking size property */ if(H5P_register(crt_pclass, H5D_CRT_CHUNK_SIZE_NAME, H5D_CRT_CHUNK_SIZE_SIZE, chunk_size, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - + /* Register the fill value property */ if(H5P_register(crt_pclass, H5D_CRT_FILL_VALUE_NAME, H5D_CRT_FILL_VALUE_SIZE, &fill, NULL, NULL, NULL, NULL, NULL, H5D_CRT_FILL_VALUE_CMP, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -336,7 +336,7 @@ H5D_init_interface(void) /* Register the external file list property */ if(H5P_register(crt_pclass, H5D_CRT_EXT_FILE_LIST_NAME, H5D_CRT_EXT_FILE_LIST_SIZE, &efl, NULL, NULL, NULL, NULL, NULL, H5D_CRT_EXT_FILE_LIST_CMP, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") - + /* Register the data pipeline property */ if(H5P_register(crt_pclass, H5D_CRT_DATA_PIPELINE_NAME, H5D_CRT_DATA_PIPELINE_SIZE, &pline, NULL, NULL, NULL, NULL, NULL, H5D_CRT_DATA_PIPELINE_CMP, NULL) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") @@ -452,7 +452,7 @@ H5D_term_interface(void) /*------------------------------------------------------------------------- * Function: H5D_crt_copy * - * Purpose: Callback routine which is called whenever any dataset + * Purpose: Callback routine which is called whenever any dataset * creation property list is copied. This routine copies * the properties from the old list to the new list. * @@ -463,7 +463,7 @@ H5D_term_interface(void) * Programmer: Raymond Lu * Tuesday, October 2, 2001 * - * Modification: + * Modification: * *------------------------------------------------------------------------- */ @@ -488,7 +488,7 @@ H5D_crt_copy(hid_t new_plist_id, hid_t old_plist_id, void UNUSED *copy_data) /* Get the fill value, external file list, and data pipeline properties * from the old property list */ - if(H5P_get(old_plist, H5D_CRT_FILL_VALUE_NAME, &src_fill) < 0) + if(H5P_get(old_plist, H5D_CRT_FILL_VALUE_NAME, &src_fill) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fill value") if(H5P_get(old_plist, H5D_CRT_EXT_FILE_LIST_NAME, &src_efl) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external file list") @@ -505,12 +505,12 @@ H5D_crt_copy(hid_t new_plist_id, hid_t old_plist_id, void UNUSED *copy_data) dst_fill.size = src_fill.size; } HDmemset(&dst_efl,0,sizeof(H5O_efl_t)); - if(NULL==H5O_copy(H5O_EFL_ID, &src_efl, &dst_efl)) + if(NULL==H5O_copy(H5O_EFL_ID, &src_efl, &dst_efl)) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "can't copy external file list") - if(NULL==H5O_copy(H5O_PLINE_ID, &src_pline, &dst_pline)) + if(NULL==H5O_copy(H5O_PLINE_ID, &src_pline, &dst_pline)) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "can't copy data pipeline") - /* Set the fill value, external file list, and data pipeline property + /* Set the fill value, external file list, and data pipeline property * for the new property list */ if(H5P_set(new_plist, H5D_CRT_FILL_VALUE_NAME, &dst_fill) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set fill value") @@ -560,7 +560,7 @@ H5D_crt_close(hid_t dcpl_id, void UNUSED *close_data) /* Get the fill value, external file list, and data pipeline properties * from the old property list */ - if(H5P_get(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) + if(H5P_get(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fill value") if(H5P_get(plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external file list") @@ -594,7 +594,7 @@ done: * Programmer: Quincey Koziol * Wednesday, January 7, 2004 * - * Modification: + * Modification: * *------------------------------------------------------------------------- */ @@ -650,7 +650,7 @@ done: * Programmer: Quincey Koziol * Wednesday, January 7, 2004 * - * Modification: + * Modification: * *------------------------------------------------------------------------- */ @@ -732,7 +732,7 @@ done: * Programmer: Quincey Koziol * Wednesday, January 7, 2004 * - * Modification: + * Modification: * *------------------------------------------------------------------------- */ @@ -865,7 +865,7 @@ done: /*------------------------------------------------------------------------- * Function: H5D_xfer_copy * - * Purpose: Callback routine which is called whenever any dataset + * Purpose: Callback routine which is called whenever any dataset * transfer property list is copied. This routine copies * the properties from the old list to the new list. * @@ -876,7 +876,7 @@ done: * Programmer: Raymond Lu * Tuesday, October 2, 2001 * - * Modification: + * Modification: * *------------------------------------------------------------------------- */ @@ -902,7 +902,7 @@ H5D_xfer_copy(hid_t new_dxpl_id, hid_t old_dxpl_id, void UNUSED *copy_data) HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve VFL driver ID") if(H5P_get(old_plist, H5D_XFER_VFL_INFO_NAME, &driver_info)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get drver info") - + if(driver_id > 0) { /* Set the driver for the property list */ if(H5FD_dxpl_open(new_plist, driver_id, driver_info)<0) @@ -1040,13 +1040,13 @@ done: * Failure: FAIL * * Errors: - * ARGS BADTYPE Not a data space. - * ARGS BADTYPE Not a dataset creation plist. - * ARGS BADTYPE Not a file. - * ARGS BADTYPE Not a type. - * ARGS BADVALUE No name. - * DATASET CANTINIT Can't create dataset. - * DATASET CANTREGISTER Can't register dataset. + * ARGS BADTYPE Not a data space. + * ARGS BADTYPE Not a dataset creation plist. + * ARGS BADTYPE Not a file. + * ARGS BADTYPE Not a type. + * ARGS BADVALUE No name. + * DATASET CANTINIT Can't create dataset. + * DATASET CANTREGISTER Can't register dataset. * * Programmer: Robb Matzke * Wednesday, December 3, 1997 @@ -1140,7 +1140,7 @@ H5Dopen(hid_t loc_id, const char *name) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") if (!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name") - + /* Find the dataset object */ if (H5G_find(loc, name, NULL, &ent, dxpl_id) < 0) HGOTO_ERROR(H5E_DATASET, H5E_NOTFOUND, FAIL, "not found") @@ -1183,8 +1183,8 @@ done: * Return: Non-negative on success/Negative on failure * * Errors: - * ARGS BADTYPE Not a dataset. - * DATASET CANTINIT Can't free. + * ARGS BADTYPE Not a dataset. + * DATASET CANTINIT Can't free. * * Programmer: Robb Matzke * Thursday, December 4, 1997 @@ -1221,7 +1221,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5Dget_space + * Function: H5Dget_space * * Purpose: Returns a copy of the file data space for a dataset. * @@ -1246,7 +1246,7 @@ H5Dget_space(hid_t dset_id) H5D_t *dset = NULL; H5S_t *space = NULL; hid_t ret_value; - + FUNC_ENTER_API(H5Dget_space, FAIL) H5TRACE1("i","i",dset_id); @@ -1279,9 +1279,9 @@ done: * * Purpose: Returns the status of data space allocation. * - * Return: + * Return: * Success: Non-negative - * + * * Failture: Negative * * Programmer: Raymond Lu @@ -1404,11 +1404,11 @@ done: hid_t H5Dget_type(hid_t dset_id) { - + H5D_t *dset = NULL; H5T_t *copied_type = NULL; hid_t ret_value = FAIL; - + FUNC_ENTER_API(H5Dget_type, FAIL) H5TRACE1("i","i",dset_id); @@ -1427,7 +1427,7 @@ H5Dget_type(hid_t dset_id) /* Unlock copied type */ if (H5T_lock (copied_type, FALSE)<0) HGOTO_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to lock transient data type") - + /* Create an atom */ if ((ret_value=H5I_register (H5I_DATATYPE, copied_type))<0) HGOTO_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register data type") @@ -1459,10 +1459,10 @@ done: * Tuesday, February 3, 1998 * * Modifications: - * + * * Raymond Lu * Tuesday, October 2, 2001 - * The way to retrieve and set property is changed for the + * The way to retrieve and set property is changed for the * generic property list. * *------------------------------------------------------------------------- @@ -1476,7 +1476,7 @@ H5Dget_create_plist(hid_t dset_id) H5P_genplist_t *new_plist; hid_t new_dcpl_id = FAIL; hid_t ret_value = FAIL; - + FUNC_ENTER_API(H5Dget_create_plist, FAIL) H5TRACE1("i","i",dset_id); @@ -1539,7 +1539,7 @@ H5Dextend(hid_t dset_id, const hsize_t *size) { H5D_t *dset = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Dextend, FAIL) H5TRACE2("e","i*h",dset_id,size); @@ -1587,7 +1587,7 @@ H5D_new(hid_t dcpl_id, hbool_t creating, hbool_t vl_type) H5P_genplist_t *plist; /* Property list created */ H5D_shared_t *new_dset = NULL; /* New dataset object */ H5D_shared_t *ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5D_new) if (NULL==(new_dset = H5FL_MALLOC(H5D_shared_t))) @@ -1646,7 +1646,7 @@ done: * Thursday, June 24, 2004 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1718,7 +1718,7 @@ done: * Thursday, October 31, 2002 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1825,7 +1825,7 @@ H5D_update_entry_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, H5P_genplist_t *p fill.alloc_time = alloc_time; fill.fill_time = fill_time; - + if (fill.fill_defined == FALSE && fill_time == H5D_FILL_TIME_ALLOC) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT,FAIL, "unable to create dataset") @@ -1918,7 +1918,7 @@ H5D_update_entry_info(H5F_t *file, hid_t dxpl_id, H5D_t *dset, H5P_genplist_t *p if (H5O_bogus_oh(file, dxpl_id, oh))<0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to update 'bogus' message") #endif /* H5O_ENABLE_BOGUS */ - + /* Add a modification time message. */ if (H5O_touch_oh(file, oh, TRUE) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update modification time message") @@ -1953,8 +1953,8 @@ done: * Failure: NULL * * Errors: - * DATASET CANTINIT Can't update dataset header. - * DATASET CANTINIT Problem with the dataset name. + * DATASET CANTINIT Can't update dataset header. + * DATASET CANTINIT Problem with the dataset name. * DATASET CANTINIT Fail in file space allocation for * chunks * @@ -1975,13 +1975,13 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to retrieve and set property for generic property + * Changed the way to retrieve and set property for generic property * list. * * Raymond Lu, 26 Feb 2002 * A new fill value message is added. Two properties, space allocation * time and fill value writing time, govern space allocation and fill - * value writing. + * value writing. * * Bill Wendling, 1. November 2002 * Removed the cache updating mechanism. This was done so that it @@ -1995,7 +1995,7 @@ done: * Nat Furrer and James Laird * June 7, 2004 * Added checked_filters flag - * + * *------------------------------------------------------------------------- */ static H5D_t * @@ -2107,13 +2107,13 @@ H5D_create(H5G_entry_t *loc, const char *name, hid_t type_id, const H5S_t *space new_dset->shared->alloc_time=alloc_time; /* If MPI VFD is used, no filter support yet. */ - if(IS_H5FD_MPI(file) && dcpl_pline.nused > 0) + if(IS_H5FD_MPI(file) && dcpl_pline.nused > 0) HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, NULL, "Parallel I/O does not support filters yet") /* Chunked datasets are non-default, so retrieve their info here */ if(H5P_get(dc_plist, H5D_CRT_CHUNK_DIM_NAME, &chunk_ndims) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't retrieve chunk dimensions") - + /* Get the dataset's external file list information */ if(H5P_get(dc_plist, H5D_CRT_EXT_FILE_LIST_NAME, &new_dset->shared->efl) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't retrieve external file list") @@ -2125,7 +2125,7 @@ H5D_create(H5G_entry_t *loc, const char *name, hid_t type_id, const H5S_t *space /* Check if this dataset is going into a parallel file and set space allocation time */ if(IS_H5FD_MPI(file)) new_dset->shared->alloc_time=H5D_ALLOC_TIME_EARLY; - + /* Set up layout information */ new_dset->shared->layout.unused.ndims = H5S_GET_EXTENT_NDIMS(new_dset->shared->space) + 1; assert((unsigned)(new_dset->shared->layout.unused.ndims) <= NELMTS(new_dset->shared->layout.unused.dim)); @@ -2210,7 +2210,7 @@ H5D_create(H5G_entry_t *loc, const char *name, hid_t type_id, const H5S_t *space /* * The chunk size of a dimension with a fixed size cannot exceed - * the maximum dimension size + * the maximum dimension size */ if(H5P_get(dc_plist, H5D_CRT_CHUNK_SIZE_NAME, new_dset->shared->layout.u.chunk.dim) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't retrieve chunk size") @@ -2245,7 +2245,7 @@ H5D_create(H5G_entry_t *loc, const char *name, hid_t type_id, const H5S_t *space hsize_t comp_data_size; /* - * Compact dataset is stored in dataset object header message of + * Compact dataset is stored in dataset object header message of * layout. */ tmp_size = H5S_GET_EXTENT_NPOINTS(space) * @@ -2277,7 +2277,7 @@ H5D_create(H5G_entry_t *loc, const char *name, hid_t type_id, const H5S_t *space if (H5D_get_dcpl_cache(new_dset->shared->dcpl_id,&new_dset->shared->dcpl_cache)<0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, NULL, "can't fill DCPL cache") - /* + /* * Give the dataset a name. That is, create and add a new * "H5G_entry_t" object to the group this dataset is being initially * created in. @@ -2355,7 +2355,7 @@ H5D_isa(H5G_entry_t *ent, hid_t dxpl_id) { htri_t exists; htri_t ret_value=TRUE; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_isa, FAIL) assert(ent); @@ -2373,7 +2373,7 @@ H5D_isa(H5G_entry_t *ent, hid_t dxpl_id) } else if (!exists) { HGOTO_DONE(FALSE) } - + done: FUNC_LEAVE_NOAPI(ret_value) @@ -2381,7 +2381,7 @@ done: /* - *------------------------------------------------------------------------- + *------------------------------------------------------------------------- * Function: H5D_open * * Purpose: Checks if dataset is already open, or opens a dataset for @@ -2405,7 +2405,7 @@ H5D_open(const H5G_entry_t *ent, hid_t dxpl_id) H5D_shared_t *shared_fo=NULL; H5D_t *dataset=NULL; H5D_t *ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_open, NULL) /* check args */ @@ -2487,18 +2487,18 @@ static H5D_t * H5D_open_oid(const H5G_entry_t *ent, hid_t dxpl_id) { H5D_t *dataset = NULL; /*new dataset struct */ - H5O_fill_new_t fill = {NULL, 0, NULL, H5D_ALLOC_TIME_LATE, H5D_CRT_FILL_TIME_DEF, TRUE}; + H5O_fill_new_t fill = {NULL, 0, NULL, H5D_ALLOC_TIME_LATE, H5D_CRT_FILL_TIME_DEF, TRUE}; unsigned alloc_time_state; /* Allocation time state */ H5O_fill_t *fill_prop; /* Pointer to dataset's fill value area */ H5O_pline_t pline; /* I/O pipeline information */ H5P_genplist_t *plist; /* Property list */ H5D_t *ret_value = NULL; /*return value */ - + FUNC_ENTER_NOAPI(H5D_open_oid, NULL) /* check args */ assert (ent); - + /* Allocate the dataset structure */ if(NULL==(dataset=H5FL_CALLOC(H5D_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") @@ -2514,7 +2514,7 @@ H5D_open_oid(const H5G_entry_t *ent, hid_t dxpl_id) /* Find the dataset object */ if (H5O_open(&(dataset->ent)) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTOPENOBJ, NULL, "unable to open") - + /* Get the type and space */ if (NULL==(dataset->shared->type=H5O_read(&(dataset->ent), H5O_DTYPE_ID, 0, NULL, dxpl_id))) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, NULL, "unable to load type info from dataset header") @@ -2579,7 +2579,7 @@ H5D_open_oid(const H5G_entry_t *ent, hid_t dxpl_id) unsigned chunk_ndims; /* Dimensionality of chunk */ chunk_ndims = dataset->shared->layout.u.chunk.ndims - 1; - + if(H5P_set(plist, H5D_CRT_CHUNK_DIM_NAME, &chunk_ndims) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set chunk dimensions") if(H5P_set(plist, H5D_CRT_CHUNK_SIZE_NAME, dataset->shared->layout.u.chunk.dim) < 0) @@ -2594,7 +2594,7 @@ H5D_open_oid(const H5G_entry_t *ent, hid_t dxpl_id) dataset->shared->io_ops.readvv=H5D_istore_readvv; dataset->shared->io_ops.writevv=H5D_istore_writevv; break; - + case H5D_COMPACT: /* Set the I/O functions for this layout type */ dataset->shared->io_ops.readvv=H5D_compact_readvv; @@ -2632,7 +2632,7 @@ H5D_open_oid(const H5G_entry_t *ent, hid_t dxpl_id) case H5D_CHUNKED: fill.alloc_time=H5D_ALLOC_TIME_INCR; break; - + default: HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, NULL, "not implemented yet") } /* end switch */ /*lint !e788 All appropriate cases are covered */ @@ -2660,8 +2660,8 @@ H5D_open_oid(const H5G_entry_t *ent, hid_t dxpl_id) || (dataset->shared->layout.type==H5D_CONTIGUOUS && fill.alloc_time==H5D_ALLOC_TIME_LATE) || (dataset->shared->layout.type==H5D_CHUNKED && fill.alloc_time==H5D_ALLOC_TIME_INCR)) alloc_time_state=1; - - /* Set revised fill value properties */ + + /* Set revised fill value properties */ if(H5P_set(plist, H5D_CRT_FILL_VALUE_NAME, fill_prop) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTSET, NULL, "can't set fill value") dataset->shared->alloc_time=fill.alloc_time; /* Cache this for later */ @@ -2744,7 +2744,7 @@ done: * * Errors: * DATASET CANTINIT Couldn't free the type or space, - * but the dataset was freed anyway. + * but the dataset was freed anyway. * * Programmer: Robb Matzke * Thursday, December 4, 1997 @@ -2804,7 +2804,7 @@ H5D_close(H5D_t *dataset) HGOTO_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "unable to destroy chunk cache") break; - case H5D_COMPACT: + case H5D_COMPACT: /* Update header message of layout for compact dataset. */ if(dataset->shared->layout.u.compact.dirty) { if(H5O_modify(&(dataset->ent), H5O_LAYOUT_ID, 0, 0, H5O_UPDATE_TIME, &(dataset->shared->layout), H5AC_dxpl_id)<0) @@ -2879,7 +2879,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to retrieve property for generic property + * Changed the way to retrieve property for generic property * list. * * Nat Furrer and James Laird @@ -2923,7 +2923,7 @@ H5D_extend (H5D_t *dataset, const hsize_t *size, hid_t dxpl_id) if(H5Z_can_apply(dataset->shared->dcpl_id, dataset->shared->type_id) <0) HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "can't apply filters") - dataset->shared->checked_filters = TRUE; + dataset->shared->checked_filters = TRUE; } } } @@ -3071,7 +3071,7 @@ H5D_alloc_storage (H5F_t *f, hid_t dxpl_id, H5D_t *dset/*in,out*/, H5D_time_allo unsigned init_space=0; /* Flag to indicate that space should be initialized */ unsigned addr_set=0; /* Flag to indicate that the dataset's storage address was set */ herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5D_alloc_storage) /* check args */ @@ -3123,7 +3123,7 @@ H5D_alloc_storage (H5F_t *f, hid_t dxpl_id, H5D_t *dset/*in,out*/, H5D_time_allo break; - case H5D_COMPACT: + case H5D_COMPACT: /* Check if space is already allocated */ if(layout->u.compact.buf==NULL) { /* Reserve space in layout header message for the entire array. */ @@ -3139,7 +3139,7 @@ H5D_alloc_storage (H5F_t *f, hid_t dxpl_id, H5D_t *dset/*in,out*/, H5D_time_allo init_space=1; } /* end if */ break; - + default: assert ("not implemented yet" && 0); #ifdef NDEBUG @@ -3210,7 +3210,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to retrieve property for generic property + * Changed the way to retrieve property for generic property * list. * *------------------------------------------------------------------------- @@ -3257,9 +3257,9 @@ H5D_init_storage(H5D_t *dset, hbool_t full_overwrite, hid_t dxpl_id) break; case H5D_CHUNKED: - /* - * Allocate file space - * for all chunks now and initialize each chunk with the fill value. + /* + * Allocate file space + * for all chunks now and initialize each chunk with the fill value. */ if (H5D_istore_allocate(dset, dxpl_id, full_overwrite)<0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to allocate all chunks of dataset") @@ -3271,7 +3271,7 @@ H5D_init_storage(H5D_t *dset, hbool_t full_overwrite, hid_t dxpl_id) HGOTO_ERROR (H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout") #endif /* NDEBUG */ } /* end switch */ /*lint !e788 All appropriate cases are covered */ - + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_init_storage() */ @@ -3302,7 +3302,7 @@ H5Dget_storage_size(hid_t dset_id) { H5D_t *dset=NULL; hsize_t ret_value; /* Return value */ - + FUNC_ENTER_API(H5Dget_storage_size, 0) H5TRACE1("h","i",dset_id); @@ -3339,7 +3339,7 @@ static hsize_t H5D_get_storage_size(H5D_t *dset, hid_t dxpl_id) { hsize_t ret_value; - + FUNC_ENTER_NOAPI(H5D_get_storage_size, 0) switch(dset->shared->layout.type) { @@ -3365,7 +3365,7 @@ H5D_get_storage_size(H5D_t *dset, hid_t dxpl_id) default: HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a dataset type") } /*lint !e788 All appropriate cases are covered */ - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -3376,12 +3376,12 @@ done: * * Purpose: Returns the address of dataset in file. * - * Return: Success: the address of dataset + * Return: Success: the address of dataset * * Failure: HADDR_UNDEF * - * Programmer: Raymond Lu - * November 6, 2002 + * Programmer: Raymond Lu + * November 6, 2002 * * Modifications: * @@ -3392,7 +3392,7 @@ H5Dget_offset(hid_t dset_id) { H5D_t *dset=NULL; haddr_t ret_value; /* Return value */ - + FUNC_ENTER_API(H5Dget_offset, HADDR_UNDEF) H5TRACE1("a","i",dset_id); @@ -3411,15 +3411,15 @@ done: /*------------------------------------------------------------------------- * Function: H5D_get_offset * - * Purpose: Private function for H5D_get_offset. Returns the address + * Purpose: Private function for H5D_get_offset. Returns the address * of dataset in file. * - * Return: Success: the address of dataset + * Return: Success: the address of dataset * * Failure: HADDR_UNDEF * - * Programmer: Raymond Lu - * November 6, 2002 + * Programmer: Raymond Lu + * November 6, 2002 * * Modifications: * @@ -3431,7 +3431,7 @@ H5D_get_offset(const H5D_t *dset) haddr_t ret_value=HADDR_UNDEF; haddr_t base_addr; H5F_t *f; - + FUNC_ENTER_NOAPI(H5D_get_offset, HADDR_UNDEF) assert(dset); @@ -3442,11 +3442,11 @@ H5D_get_offset(const H5D_t *dset) break; case H5D_CONTIGUOUS: - /* If dataspace hasn't been allocated or dataset is stored in + /* If dataspace hasn't been allocated or dataset is stored in * an external file, the value will be HADDR_UNDEF. */ f = H5D_get_file(dset); base_addr = H5F_get_base_addr(f); - + /* If there's user block in file, returns the absolute dataset offset * from the beginning of file. */ if(base_addr!=HADDR_UNDEF) @@ -3461,7 +3461,7 @@ H5D_get_offset(const H5D_t *dset) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, HADDR_UNDEF, "unknown dataset layout type") #endif /* NDEBUG */ } /*lint !e788 All appropriate cases are covered */ - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -3507,12 +3507,12 @@ done: * void *operator_data; IN/OUT: Pointer to any user-defined data * associated with the operation. * - * The return values from an operator are: + * The return values from an operator are: * Zero causes the iterator to continue, returning zero when all - * elements have been processed. + * elements have been processed. * Positive causes the iterator to immediately return that positive * value, indicating short-circuit success. The iterator can be - * restarted at the next element. + * restarted at the next element. * Negative causes the iterator to immediately return that value, * indicating failure. The iterator can be restarted at the next * element. @@ -3757,7 +3757,7 @@ H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, /* Get a copy of the dataspace ID */ if((vlen_bufsize.fspace_id=H5Dget_space(dataset_id))<0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "can't copy dataspace") - + /* Create a scalar for the memory dataspace */ if((vlen_bufsize.mspace_id=H5Screate(H5S_SCALAR))<0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "can't create dataspace") @@ -3819,7 +3819,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Dset_extent * - * Purpose: Modifies the dimensions of a dataset, based on H5Dextend. + * Purpose: Modifies the dimensions of a dataset, based on H5Dextend. * Can change to a lower dimension. * * Return: Success: SUCCEED, Failure: FAIL @@ -3862,7 +3862,7 @@ done: /*------------------------------------------------------------------------- * Function: H5D_set_extent * - * Purpose: Based in H5D_extend, allows change to a lower dimension, + * Purpose: Based in H5D_extend, allows change to a lower dimension, * calls H5S_set_extent and H5D_istore_prune_by_extent instead * * Return: Success: SUCCEED, Failure: FAIL @@ -3953,7 +3953,7 @@ H5D_set_extent(H5D_t *dset, const hsize_t *size, hid_t dxpl_id) H5D_io_info_t io_info; /* Dataset I/O info */ H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */ H5D_dxpl_cache_t *dxpl_cache=&_dxpl_cache; /* Data transfer property cache */ - + /* Fill the DXPL cache values for later use */ if (H5D_get_dxpl_cache(dxpl_id,&dxpl_cache)<0) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't fill dxpl cache") @@ -4045,14 +4045,14 @@ H5D_flush(const H5F_t *f, hid_t dxpl_id, unsigned flags) HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush raw data cache") break; - case H5D_COMPACT: + case H5D_COMPACT: if(dataset->shared->layout.u.compact.dirty) { if(H5O_modify(&(dataset->ent), H5O_LAYOUT_ID, 0, 0, H5O_UPDATE_TIME, &(dataset->shared->layout), dxpl_id)<0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to update layout message") dataset->shared->layout.u.compact.dirty = FALSE; } /* end if */ break; - + default: assert ("not implemented yet" && 0); #ifdef NDEBUG @@ -4106,7 +4106,7 @@ H5Ddebug(hid_t dset_id) } else if (H5D_CONTIGUOUS==dset->shared->layout.type) { HDfprintf(stdout, " %-10s %a\n", "Address:", dset->shared->layout.u.contig.addr); } - + done: FUNC_LEAVE_API(ret_value) } diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c index a3048b3..9c272f0 100644 --- a/src/H5Dcompact.c +++ b/src/H5Dcompact.c @@ -13,8 +13,8 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * Programmer: Raymond Lu - * August 5, 2002 + * Programmer: Raymond Lu + * August 5, 2002 * * Purpose: Compact dataset I/O functions. These routines are similar * H5D_contig_* and H5D_istore_*. @@ -34,32 +34,32 @@ /*------------------------------------------------------------------------- * Function: H5D_compact_readvv - * + * * Purpose: Reads some data vectors from a dataset into a buffer. - * The data is in compact dataset. The address is relative + * The data is in compact dataset. The address is relative * to the beginning address of the dataset. The offsets and * sequence lengths are in bytes. - * + * * Return: Non-negative on success/Negative on failure - * + * * Programmer: Quincey Koziol * May 7, 2003 - * - * Notes: + * + * Notes: * Offsets in the sequences must be monotonically increasing - * + * * Modifications: - * + * *------------------------------------------------------------------------- */ ssize_t H5D_compact_readvv(const H5D_io_info_t *io_info, - size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[], + size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[], + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[], void *buf) { ssize_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_compact_readvv, FAIL) assert(io_info->dset); @@ -68,42 +68,42 @@ H5D_compact_readvv(const H5D_io_info_t *io_info, if((ret_value=H5V_memcpyvv(buf,mem_max_nseq,mem_curr_seq,mem_size_arr,mem_offset_arr,io_info->dset->shared->layout.u.compact.buf,dset_max_nseq,dset_curr_seq,dset_size_arr,dset_offset_arr))<0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "vectorized memcpy failed") -done: +done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_compact_readvv() */ /*------------------------------------------------------------------------- * Function: H5D_compact_writevv - * + * * Purpose: Writes some data vectors from a dataset into a buffer. - * The data is in compact dataset. The address is relative + * The data is in compact dataset. The address is relative * to the beginning address for the file. The offsets and * sequence lengths are in bytes. This function only copies - * data into the buffer in the LAYOUT struct and mark it - * as DIRTY. Later in H5D_close, the data is copied into - * header message in memory. - * + * data into the buffer in the LAYOUT struct and mark it + * as DIRTY. Later in H5D_close, the data is copied into + * header message in memory. + * * Return: Non-negative on success/Negative on failure - * + * * Programmer: Quincey Koziol * May 2, 2003 - * - * Notes: + * + * Notes: * Offsets in the sequences must be monotonically increasing - * + * * Modifications: - * + * *------------------------------------------------------------------------- */ ssize_t H5D_compact_writevv(const H5D_io_info_t *io_info, - size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[], + size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[], + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[], const void *buf) { ssize_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_compact_writevv, FAIL) assert(io_info->dset); @@ -114,6 +114,6 @@ H5D_compact_writevv(const H5D_io_info_t *io_info, io_info->dset->shared->layout.u.compact.dirty = TRUE; -done: +done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_compact_writevv() */ diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c index d03c597..2c2539f 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -124,7 +124,7 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id) #endif /* H5_HAVE_PARALLEL */ int non_zero_fill_f=(-1); /* Indicate that a non-zero fill-value was used */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_contig_fill, FAIL) /* Check args */ @@ -215,7 +215,7 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id) /* Indicate that a zero fill buffer was used */ non_zero_fill_f=0; } /* end else */ - + /* Start at the beginning of the dataset */ offset = 0; @@ -248,7 +248,7 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id) npoints -= MIN(ptsperbuf, npoints); offset += size; } /* end while */ - + #ifdef H5_HAVE_PARALLEL /* Only need to block at the barrier if we actually wrote fill values */ /* And if we are using an MPI-capable file driver */ @@ -421,7 +421,7 @@ H5D_contig_readvv(const H5D_io_info_t *io_info, size_t u; /* Counting variable */ size_t v; /* Counting variable */ ssize_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_contig_readvv, FAIL) /* Check args */ @@ -688,7 +688,7 @@ H5D_contig_writevv(const H5D_io_info_t *io_info, size_t u; /* Counting variable */ size_t v; /* Counting variable */ ssize_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_contig_writevv, FAIL) /* Check args */ @@ -716,7 +716,7 @@ H5D_contig_writevv(const H5D_io_info_t *io_info, sieve_size=dset_contig->sieve_size; sieve_end=sieve_start+sieve_size; } /* end if */ - + /* Works through sequences as fast as possible */ for(; usieve_loc=addr; - + } /* end if */ /* Append to existing sieve buffer */ else { @@ -844,7 +844,7 @@ H5D_contig_writevv(const H5D_io_info_t *io_info, /* Adjust sieve size */ dset_contig->sieve_size += size; - + /* Update local copies of sieve information */ sieve_start=dset_contig->sieve_loc; sieve_size=dset_contig->sieve_size; diff --git a/src/H5Defl.c b/src/H5Defl.c index 4e1c601..1356950 100644 --- a/src/H5Defl.c +++ b/src/H5Defl.c @@ -62,7 +62,7 @@ H5D_efl_read (const H5O_efl_t *efl, haddr_t addr, size_t size, uint8_t *buf) ssize_t n; size_t u; /* Local index variable */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5D_efl_read) /* Check args */ @@ -79,7 +79,7 @@ H5D_efl_read (const H5O_efl_t *efl, haddr_t addr, size_t size, uint8_t *buf) } cur += efl->slot[u].size; } - + /* Read the data */ while (size) { assert(buf); @@ -110,14 +110,14 @@ H5D_efl_read (const H5O_efl_t *efl, haddr_t addr, size_t size, uint8_t *buf) skip = 0; u++; } - + done: if (fd>=0) HDclose (fd); FUNC_LEAVE_NOAPI(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5D_efl_write @@ -149,7 +149,7 @@ H5D_efl_write (const H5O_efl_t *efl, haddr_t addr, size_t size, const uint8_t *b hsize_t skip=0; size_t u; /* Local index variable */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5D_efl_write) /* Check args */ @@ -166,7 +166,7 @@ H5D_efl_write (const H5O_efl_t *efl, haddr_t addr, size_t size, const uint8_t *b } cur += efl->slot[u].size; } - + /* Write the data */ while (size) { assert(buf); @@ -199,14 +199,14 @@ H5D_efl_write (const H5O_efl_t *efl, haddr_t addr, size_t size, const uint8_t *b skip = 0; u++; } - + done: if (fd>=0) HDclose (fd); FUNC_LEAVE_NOAPI(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5D_efl_readvv @@ -239,7 +239,7 @@ H5D_efl_readvv(const H5D_io_info_t *io_info, size_t u; /* Counting variable */ size_t v; /* Counting variable */ ssize_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_efl_readvv, FAIL) /* Check args */ @@ -290,7 +290,7 @@ H5D_efl_readvv(const H5D_io_info_t *io_info, done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_efl_readvv() */ - + /*------------------------------------------------------------------------- * Function: H5D_efl_writevv @@ -323,7 +323,7 @@ H5D_efl_writevv(const H5D_io_info_t *io_info, size_t u; /* Counting variable */ size_t v; /* Counting variable */ ssize_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_efl_writevv, FAIL) /* Check args */ @@ -374,4 +374,4 @@ H5D_efl_writevv(const H5D_io_info_t *io_info, done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_efl_writevv() */ - + diff --git a/src/H5Dio.c b/src/H5Dio.c index fd9b6c9..495467a 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -77,7 +77,7 @@ static herr_t H5D_read(H5D_t *dataset, hid_t mem_type_id, static herr_t H5D_write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, const H5S_t *file_space, hid_t dset_xfer_plist, const void *buf); -static herr_t +static herr_t H5D_contig_read(H5D_io_info_t *io_info, hsize_t nelmts, const H5T_t *mem_type, const H5S_t *mem_space, const H5S_t *file_space, H5T_path_t *tpath, @@ -88,20 +88,20 @@ H5D_contig_write(H5D_io_info_t *io_info, hsize_t nelmts, const H5S_t *file_space, H5T_path_t *tpath, hid_t src_id, hid_t dst_id, const void *buf); static herr_t -H5D_chunk_read(H5D_io_info_t *io_info, hsize_t nelmts, +H5D_chunk_read(H5D_io_info_t *io_info, hsize_t nelmts, const H5T_t *mem_type, const H5S_t *mem_space, const H5S_t *file_space, H5T_path_t *tpath, hid_t src_id, hid_t dst_id, void *buf/*out*/); static herr_t -H5D_chunk_write(H5D_io_info_t *io_info, hsize_t nelmts, +H5D_chunk_write(H5D_io_info_t *io_info, hsize_t nelmts, const H5T_t *mem_type, const H5S_t *mem_space, const H5S_t *file_space, H5T_path_t *tpath, hid_t src_id, hid_t dst_id, const void *buf); #ifdef H5_HAVE_PARALLEL -static herr_t -H5D_io_assist_mpio(hid_t dxpl_id, H5D_dxpl_cache_t *dxpl_cache, +static herr_t +H5D_io_assist_mpio(hid_t dxpl_id, H5D_dxpl_cache_t *dxpl_cache, hbool_t *xfer_mode_changed); -static herr_t +static herr_t H5D_io_restore_mpio(hid_t dxpl_id); static htri_t H5D_get_collective_io_consensus(const H5F_t *file, @@ -110,7 +110,7 @@ H5D_get_collective_io_consensus(const H5F_t *file, #endif /* H5_HAVE_PARALLEL */ /* I/O info operations */ -static herr_t +static herr_t H5D_ioinfo_init(H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, const H5S_t *mem_space, const H5S_t *file_space, unsigned flags, hbool_t *use_par_opt_io, H5D_io_info_t *io_info); @@ -411,7 +411,7 @@ done: * Purpose: Reads (part of) a DSET from the file into application * memory BUF. The part of the dataset to read is defined with * MEM_SPACE_ID and FILE_SPACE_ID. The data points are - * converted from their file type to the MEM_TYPE_ID specified. + * converted from their file type to the MEM_TYPE_ID specified. * Additional miscellaneous data transfer properties can be * passed to this function with the PLIST_ID argument. * @@ -431,12 +431,12 @@ done: * Return: Non-negative on success/Negative on failure * * Errors: - * ARGS BADTYPE Not a data space. - * ARGS BADTYPE Not a data type. - * ARGS BADTYPE Not a dataset. - * ARGS BADTYPE Not xfer parms. - * ARGS BADVALUE No output buffer. - * DATASET READERROR Can't read data. + * ARGS BADTYPE Not a data space. + * ARGS BADTYPE Not a data type. + * ARGS BADTYPE Not a dataset. + * ARGS BADTYPE Not xfer parms. + * ARGS BADVALUE No output buffer. + * DATASET READERROR Can't read data. * * Programmer: Robb Matzke * Thursday, December 4, 1997 @@ -623,7 +623,7 @@ done: * Changed the way to retrieve property for generic property list. * * Raymond Lu, 2002-2-26 - * For the new fill value design, data space can either be allocated + * For the new fill value design, data space can either be allocated * or not allocated at this stage. Fill value or data from space is * returned to outgoing buffer. * @@ -700,12 +700,12 @@ H5D_read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, /* Retrieve dataset properties */ /* */ - /* If space hasn't been allocated and not using external storage, + /* If space hasn't been allocated and not using external storage, * return fill value to buffer if fill time is upon allocation, or - * do nothing if fill time is never. If the dataset is compact and + * do nothing if fill time is never. If the dataset is compact and * fill time is NEVER, there is no way to tell whether part of data - * has been overwritten. So just proceed in reading. - */ + * has been overwritten. So just proceed in reading. + */ if(nelmts > 0 && dataset->shared->efl.nused==0 && ((dataset->shared->layout.type==H5D_CONTIGUOUS && !H5F_addr_defined(dataset->shared->layout.u.contig.addr)) || (dataset->shared->layout.type==H5D_CHUNKED && !H5F_addr_defined(dataset->shared->layout.u.chunk.addr)))) { @@ -767,17 +767,17 @@ H5D_read(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, #ifdef H5_HAVE_PARALLEL #ifdef H5_HAVE_INSTRUMENTED_LIBRARY /**** Test for collective chunk IO - notice the following code should be removed after + notice the following code should be removed after a more general collective chunk IO algorithm is applied. */ if(dataset->shared->layout.type == H5D_CHUNKED) { /*only check for chunking storage */ check_prop = H5Pexist(dxpl_id,H5D_XFER_COLL_CHUNK_NAME); - if(check_prop < 0) + if(check_prop < 0) HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to check property list"); if(check_prop > 0) { - if(H5Pget(dxpl_id,H5D_XFER_COLL_CHUNK_NAME,&prop_value)<0) - HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to get property value"); + if(H5Pget(dxpl_id,H5D_XFER_COLL_CHUNK_NAME,&prop_value)<0) + HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to get property value"); if(!use_par_opt_io) { new_value = 0; if(H5Pset(dxpl_id,H5D_XFER_COLL_CHUNK_NAME,&new_value)<0) @@ -842,7 +842,7 @@ done: * Added the code that when it detects it is not safe to process a * COLLECTIVE write request without hanging, it changes it to * INDEPENDENT calls. - * + * * Albert Cheng, 2000-11-27 * Changed to use the optimized MPIO transfer for Collective calls only. * @@ -850,8 +850,8 @@ done: * Changed the way to retrieve property for generic property list. * * Raymond Lu, 2002-2-26 - * For the new fill value design, space may not be allocated until - * this function is called. Allocate and initialize space if it + * For the new fill value design, space may not be allocated until + * this function is called. Allocate and initialize space if it * hasn't been. * * QAK - 2002/04/02 @@ -928,8 +928,8 @@ H5D_write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, if (!file_space) file_space = dataset->shared->space; - if (!mem_space) - mem_space = file_space; + if (!mem_space) + mem_space = file_space; if((snelmts = H5S_GET_SELECT_NPOINTS(mem_space))<0) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "src dataspace has invalid selection") H5_ASSIGN_OVERFLOW(nelmts,snelmts,hssize_t,hsize_t); @@ -959,7 +959,7 @@ H5D_write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, /* */ /* Allocate data space and initialize it if it hasn't been. */ - if(nelmts > 0 && dataset->shared->efl.nused==0 && + if(nelmts > 0 && dataset->shared->efl.nused==0 && ((dataset->shared->layout.type==H5D_CONTIGUOUS && !H5F_addr_defined(dataset->shared->layout.u.contig.addr)) || (dataset->shared->layout.type==H5D_CHUNKED && !H5F_addr_defined(dataset->shared->layout.u.chunk.addr)))) { hssize_t file_nelmts; /* Number of elements in file dataset's dataspace */ @@ -1012,22 +1012,22 @@ H5D_write(H5D_t *dataset, hid_t mem_type_id, const H5S_t *mem_space, /* Set up I/O operation */ if(H5D_ioinfo_init(dataset,dxpl_cache,dxpl_id,mem_space,file_space,sconv_flags,&use_par_opt_io,&io_info)<0) HGOTO_ERROR (H5E_DATASET, H5E_UNSUPPORTED, FAIL, "unable to set up I/O operation") - + #ifdef H5_HAVE_PARALLEL #ifdef H5_HAVE_INSTRUMENTED_LIBRARY /**** Test for collective chunk IO - notice the following code should be removed after + notice the following code should be removed after a more general collective chunk IO algorithm is applied. */ if(dataset->shared->layout.type == H5D_CHUNKED) { /*only check for chunking storage */ - + check_prop = H5Pexist(dxpl_id,H5D_XFER_COLL_CHUNK_NAME); - if(check_prop < 0) + if(check_prop < 0) HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to check property list"); if(check_prop > 0) { - if(H5Pget(dxpl_id,H5D_XFER_COLL_CHUNK_NAME,&prop_value)<0) - HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to get property value"); + if(H5Pget(dxpl_id,H5D_XFER_COLL_CHUNK_NAME,&prop_value)<0) + HGOTO_ERROR(H5E_PLIST, H5E_UNSUPPORTED, FAIL, "unable to get property value"); if(!use_par_opt_io) { new_value = 0; if(H5Pset(dxpl_id,H5D_XFER_COLL_CHUNK_NAME,&new_value)<0) @@ -1096,7 +1096,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5D_contig_read(H5D_io_info_t *io_info, hsize_t nelmts, const H5T_t *mem_type, const H5S_t *mem_space, const H5S_t *file_space, H5T_path_t *tpath, @@ -1104,7 +1104,7 @@ H5D_contig_read(H5D_io_info_t *io_info, hsize_t nelmts, { H5D_t *dataset=io_info->dset; /* Local pointer to dataset info */ const H5D_dxpl_cache_t *dxpl_cache=io_info->dxpl_cache; /* Local pointer to dataset transfer info */ - herr_t status; /*function return status*/ + herr_t status; /*function return status*/ #ifdef H5S_DEBUG H5_timer_t timer; #endif @@ -1155,7 +1155,7 @@ H5D_contig_read(H5D_io_info_t *io_info, hsize_t nelmts, || dataset->shared->layout.type==H5D_COMPACT); H5_CHECK_OVERFLOW(nelmts,hsize_t,size_t); status = (io_info->ops.read)(io_info, - (size_t)nelmts, H5T_get_size(dataset->shared->type), + (size_t)nelmts, H5T_get_size(dataset->shared->type), file_space, mem_space, buf/*out*/); #ifdef H5S_DEBUG @@ -1196,7 +1196,7 @@ H5D_contig_read(H5D_io_info_t *io_info, hsize_t nelmts, target_size=(size_t)(nelmts*max_type_size); } /* end if */ request_nelmts = target_size / max_type_size; - + /* Sanity check elements in temporary buffer */ if (request_nelmts==0) HGOTO_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL, "temporary buffer max size is too small") @@ -1246,7 +1246,7 @@ H5D_contig_read(H5D_io_info_t *io_info, hsize_t nelmts, /* Go figure out how many elements to read from the file */ assert(H5S_SELECT_ITER_NELMTS(&file_iter)==(nelmts-smine_start)); smine_nelmts = (size_t)MIN(request_nelmts, (nelmts-smine_start)); - + /* * Gather the data from disk into the data type conversion * buffer. Also gather data from application to background buffer @@ -1255,10 +1255,10 @@ H5D_contig_read(H5D_io_info_t *io_info, hsize_t nelmts, #ifdef H5S_DEBUG H5_timer_begin(&timer); #endif - /* Sanity check that space is allocated, then read data from it */ + /* Sanity check that space is allocated, then read data from it */ assert(((dataset->shared->layout.type==H5D_CONTIGUOUS && H5F_addr_defined(dataset->shared->layout.u.contig.addr)) || (dataset->shared->layout.type==H5D_CHUNKED && H5F_addr_defined(dataset->shared->layout.u.chunk.addr))) - || dataset->shared->efl.nused>0 || + || dataset->shared->efl.nused>0 || dataset->shared->layout.type==H5D_COMPACT); n = H5D_select_fgath(io_info, file_space, &file_iter, smine_nelmts, @@ -1271,7 +1271,7 @@ H5D_contig_read(H5D_io_info_t *io_info, hsize_t nelmts, #endif if (n!=smine_nelmts) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "file gather failed") - + if (H5T_BKG_YES==need_bkg) { #ifdef H5S_DEBUG H5_timer_begin(&timer); @@ -1286,7 +1286,7 @@ H5D_contig_read(H5D_io_info_t *io_info, hsize_t nelmts, if (n!=smine_nelmts) HGOTO_ERROR (H5E_IO, H5E_READERROR, FAIL, "mem gather failed") } /* end if */ - + /* * Perform data type conversion. */ @@ -1308,7 +1308,7 @@ H5D_contig_read(H5D_io_info_t *io_info, hsize_t nelmts, #endif if (status<0) HGOTO_ERROR (H5E_DATASET, H5E_READERROR, FAIL, "scatter failed") - + } /* end for */ done: @@ -1330,7 +1330,7 @@ done: H5FL_BLK_FREE(type_conv,tconv_buf); if (bkg_buf && NULL==dxpl_cache->bkgr_buf) H5FL_BLK_FREE(type_conv,bkg_buf); - + FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_contig_read() */ @@ -1359,7 +1359,7 @@ H5D_contig_write(H5D_io_info_t *io_info, hsize_t nelmts, { H5D_t *dataset=io_info->dset; /* Local pointer to dataset info */ const H5D_dxpl_cache_t *dxpl_cache=io_info->dxpl_cache; /* Local pointer to dataset transfer info */ - herr_t status; /*function return status*/ + herr_t status; /*function return status*/ #ifdef H5S_DEBUG H5_timer_t timer; #endif @@ -1421,7 +1421,7 @@ H5D_contig_write(H5D_io_info_t *io_info, hsize_t nelmts, /* direct xfer accomplished successfully */ HGOTO_DONE(SUCCEED) } /* end if */ - + /* * This is the general case. */ @@ -1461,7 +1461,7 @@ H5D_contig_write(H5D_io_info_t *io_info, hsize_t nelmts, if (H5S_select_iter_init(&bkg_iter, file_space, dst_type_size)<0) HGOTO_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize background selection information") bkg_iter_init=1; /*file selection iteration info has been initialized */ - + /* * Get a temporary buffer for type conversion unless the app has already * supplied one through the xfer properties. Instead of allocating a @@ -1470,7 +1470,7 @@ H5D_contig_write(H5D_io_info_t *io_info, hsize_t nelmts, * same size over and over. */ if(H5T_detect_class(dataset->shared->type, H5T_VLEN)) { - /* Old data is retrieved into background buffer for VL datatype. The + /* Old data is retrieved into background buffer for VL datatype. The * data is used later for freeing heap objects. */ need_bkg = H5T_BKG_YES; } else if (H5T_path_bkg(tpath)) { @@ -1500,7 +1500,7 @@ H5D_contig_write(H5D_io_info_t *io_info, hsize_t nelmts, /* Go figure out how many elements to read from the file */ assert(H5S_SELECT_ITER_NELMTS(&file_iter)==(nelmts-smine_start)); smine_nelmts = (size_t)MIN(request_nelmts, (nelmts-smine_start)); - + /* * Gather data from application buffer into the data type conversion * buffer. Also gather data from the file into the background buffer @@ -1525,7 +1525,7 @@ H5D_contig_write(H5D_io_info_t *io_info, hsize_t nelmts, #endif n = H5D_select_fgath(io_info, file_space, &bkg_iter, smine_nelmts, - bkg_buf/*out*/); + bkg_buf/*out*/); #ifdef H5S_DEBUG H5_timer_end(&(io_info->stats->stats[0].bkg_timer), &timer); @@ -1535,7 +1535,7 @@ H5D_contig_write(H5D_io_info_t *io_info, hsize_t nelmts, if (n!=smine_nelmts) HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "file gather failed") } /* end if */ - + /* * Perform data type conversion. */ @@ -1610,7 +1610,7 @@ H5D_chunk_read(H5D_io_info_t *io_info, hsize_t nelmts, const H5D_dxpl_cache_t *dxpl_cache=io_info->dxpl_cache; /* Local pointer to dataset transfer info */ fm_map fm; /* File<->memory mapping */ H5SL_node_t *chunk_node; /* Current node in chunk skip list */ - herr_t status; /*function return status*/ + herr_t status; /*function return status*/ #ifdef H5S_DEBUG H5_timer_t timer; #endif @@ -1620,7 +1620,7 @@ H5D_chunk_read(H5D_io_info_t *io_info, hsize_t nelmts, size_t target_size; /*desired buffer size */ size_t request_nelmts; /*requested strip mine */ hsize_t smine_start; /*strip mine start loc */ - size_t n, smine_nelmts; /*elements per strip */ + size_t n, smine_nelmts; /*elements per strip */ H5S_sel_iter_t mem_iter; /*memory selection iteration info*/ hbool_t mem_iter_init=0; /*memory selection iteration info has been initialized */ H5S_sel_iter_t bkg_iter; /*background iteration info*/ @@ -1634,7 +1634,7 @@ H5D_chunk_read(H5D_io_info_t *io_info, hsize_t nelmts, herr_t ret_value = SUCCEED; /*return value */ FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_read) - + /* Map elements between file and memory for each chunk*/ if(H5D_create_chunk_map(dataset, mem_type, file_space, mem_space, &fm)<0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't build chunk mapping") @@ -1675,7 +1675,7 @@ H5D_chunk_read(H5D_io_info_t *io_info, hsize_t nelmts, chunk_info->chunk_points, H5T_get_size(dataset->shared->type), chunk_info->fspace, chunk_info->mspace, buf); - + /* Check return value from optimized read */ if (status<0) HGOTO_ERROR(H5E_DATASET, H5E_READERROR, FAIL, "optimized read failed") @@ -1683,7 +1683,7 @@ H5D_chunk_read(H5D_io_info_t *io_info, hsize_t nelmts, /* Get the next chunk node in the skip list */ chunk_node=H5SL_next(chunk_node); } /* end while */ - + #ifdef H5S_DEBUG H5_timer_end(&(io_info->stats->stats[1].read_timer), &timer); io_info->stats->stats[1].read_nbytes += nelmts * H5T_get_size(dataset->shared->type); @@ -1718,7 +1718,7 @@ H5D_chunk_read(H5D_io_info_t *io_info, hsize_t nelmts, target_size=(size_t)(nelmts*max_type_size); } /* end if */ request_nelmts = target_size / max_type_size; - + /* Sanity check elements in temporary buffer */ if (request_nelmts==0) HGOTO_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL, "temporary buffer max size is too small") @@ -1751,7 +1751,7 @@ H5D_chunk_read(H5D_io_info_t *io_info, hsize_t nelmts, if((bkg_buf=H5FL_BLK_CALLOC(type_conv,(request_nelmts*dst_type_size)))==NULL) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for background conversion") } /* end if */ - + /* Loop over all the chunks, performing I/O on each */ /* Get first node in chunk skip list */ @@ -1774,16 +1774,16 @@ H5D_chunk_read(H5D_io_info_t *io_info, hsize_t nelmts, if (H5S_select_iter_init(&bkg_iter, chunk_info->mspace, dst_type_size)<0) HGOTO_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize background selection information") bkg_iter_init=1; /*file selection iteration info has been initialized */ - + /* Pass in chunk's coordinates in a union*/ store.chunk.offset = chunk_info->coords; store.chunk.index = chunk_info->index; - + for (smine_start=0; smine_startchunk_points; smine_start+=smine_nelmts) { /* Go figure out how many elements to read from the file */ assert(H5S_SELECT_ITER_NELMTS(&file_iter)==(chunk_info->chunk_points-smine_start)); smine_nelmts = (size_t)MIN(request_nelmts, (chunk_info->chunk_points-smine_start)); - + /* * Gather the data from disk into the data type conversion * buffer. Also gather data from application to background buffer @@ -1792,11 +1792,11 @@ H5D_chunk_read(H5D_io_info_t *io_info, hsize_t nelmts, #ifdef H5S_DEBUG H5_timer_begin(&timer); #endif - /* Sanity check that space is allocated, then read data from it */ + /* Sanity check that space is allocated, then read data from it */ assert(((dataset->shared->layout.type==H5D_CONTIGUOUS && H5F_addr_defined(dataset->shared->layout.u.contig.addr)) || (dataset->shared->layout.type==H5D_CHUNKED && H5F_addr_defined(dataset->shared->layout.u.chunk.addr))) || dataset->shared->efl.nused>0 || dataset->shared->layout.type==H5D_COMPACT); - n = H5D_select_fgath(io_info, + n = H5D_select_fgath(io_info, chunk_info->fspace, &file_iter, smine_nelmts, tconv_buf/*out*/); @@ -1822,11 +1822,11 @@ H5D_chunk_read(H5D_io_info_t *io_info, hsize_t nelmts, if (n!=smine_nelmts) HGOTO_ERROR (H5E_IO, H5E_READERROR, FAIL, "mem gather failed") } /* end if */ - + /* * Perform data type conversion. */ - if (H5T_convert(tpath, src_id, dst_id, smine_nelmts, 0, 0, + if (H5T_convert(tpath, src_id, dst_id, smine_nelmts, 0, 0, tconv_buf, bkg_buf, io_info->dxpl_id)<0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "data type conversion failed") @@ -1867,7 +1867,7 @@ H5D_chunk_read(H5D_io_info_t *io_info, hsize_t nelmts, /* Get the next chunk node in the skip list */ chunk_node=H5SL_next(chunk_node); } /* end while */ - + done: /* Release selection iterators, if necessary */ if(file_iter_init) { @@ -1887,11 +1887,11 @@ done: H5FL_BLK_FREE(type_conv,tconv_buf); if (bkg_buf && NULL==dxpl_cache->bkgr_buf) H5FL_BLK_FREE(type_conv,bkg_buf); - + /* Release chunk mapping information */ if(H5D_destroy_chunk_map(&fm) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "can't release chunk mapping") - + FUNC_LEAVE_NOAPI(ret_value) } /* H5D_chunk_read() */ @@ -1922,7 +1922,7 @@ H5D_chunk_write(H5D_io_info_t *io_info, hsize_t nelmts, const H5D_dxpl_cache_t *dxpl_cache=io_info->dxpl_cache; /* Local pointer to dataset transfer info */ fm_map fm; /* File<->memory mapping */ H5SL_node_t *chunk_node; /* Current node in chunk skip list */ - herr_t status; /*function return status*/ + herr_t status; /*function return status*/ #ifdef H5S_DEBUG H5_timer_t timer; #endif @@ -1932,7 +1932,7 @@ H5D_chunk_write(H5D_io_info_t *io_info, hsize_t nelmts, size_t target_size; /*desired buffer size */ size_t request_nelmts; /*requested strip mine */ hsize_t smine_start; /*strip mine start loc */ - size_t n, smine_nelmts; /*elements per strip */ + size_t n, smine_nelmts; /*elements per strip */ H5S_sel_iter_t mem_iter; /*memory selection iteration info*/ hbool_t mem_iter_init=0; /*memory selection iteration info has been initialized */ H5S_sel_iter_t bkg_iter; /*background iteration info*/ @@ -1946,11 +1946,11 @@ H5D_chunk_write(H5D_io_info_t *io_info, hsize_t nelmts, herr_t ret_value = SUCCEED; /*return value */ FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_write) - + /* Map elements between file and memory for each chunk*/ if(H5D_create_chunk_map(dataset, mem_type, file_space, mem_space, &fm)<0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "can't build chunk mapping") - + /* Set dataset storage for I/O info */ io_info->store=&store; @@ -1977,11 +1977,11 @@ H5D_chunk_write(H5D_io_info_t *io_info, hsize_t nelmts, store.chunk.index = chunk_info->index; /* Perform the actual write operation */ - status = (io_info->ops.write)(io_info, + status = (io_info->ops.write)(io_info, chunk_info->chunk_points, H5T_get_size(dataset->shared->type), chunk_info->fspace, chunk_info->mspace, buf); - + /* Check return value from optimized write */ if (status<0) HGOTO_ERROR(H5E_DATASET, H5E_WRITEERROR, FAIL, "optimized write failed") @@ -1989,7 +1989,7 @@ H5D_chunk_write(H5D_io_info_t *io_info, hsize_t nelmts, /* Get the next chunk node in the skip list */ chunk_node=H5SL_next(chunk_node); } /* end while */ - + #ifdef H5S_DEBUG H5_timer_end(&(io_info->stats->stats[0].write_timer), &timer); io_info->stats->stats[0].write_nbytes += nelmts * H5T_get_size(mem_type); @@ -1999,13 +1999,13 @@ H5D_chunk_write(H5D_io_info_t *io_info, hsize_t nelmts, /* direct xfer accomplished successfully */ HGOTO_DONE(SUCCEED) } /* end if */ - + /* * This is the general case (type conversion, usually). */ if(nelmts==0) HGOTO_DONE(SUCCEED) - + /* Compute element sizes and other parameters */ src_type_size = H5T_get_size(mem_type); dst_type_size = H5T_get_size(dataset->shared->type); @@ -2037,7 +2037,7 @@ H5D_chunk_write(H5D_io_info_t *io_info, hsize_t nelmts, * same size over and over. */ if(H5T_detect_class(dataset->shared->type, H5T_VLEN)) { - /* Old data is retrieved into background buffer for VL datatype. The + /* Old data is retrieved into background buffer for VL datatype. The * data is used later for freeing heap objects. */ need_bkg = H5T_BKG_YES; } else if (H5T_path_bkg(tpath)) { @@ -2084,16 +2084,16 @@ H5D_chunk_write(H5D_io_info_t *io_info, hsize_t nelmts, if (H5S_select_iter_init(&bkg_iter, chunk_info->fspace, dst_type_size)<0) HGOTO_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL, "unable to initialize background selection information") bkg_iter_init=1; /*file selection iteration info has been initialized */ - + /*pass in chunk's coordinates in a union*/ store.chunk.offset = chunk_info->coords; store.chunk.index = chunk_info->index; - + for (smine_start=0; smine_startchunk_points; smine_start+=smine_nelmts) { /* Go figure out how many elements to read from the file */ assert(H5S_SELECT_ITER_NELMTS(&file_iter)==(chunk_info->chunk_points-smine_start)); smine_nelmts = (size_t)MIN(request_nelmts, (chunk_info->chunk_points-smine_start)); - + /* * Gather the data from disk into the data type conversion * buffer. Also gather data from application to background buffer @@ -2104,7 +2104,7 @@ H5D_chunk_write(H5D_io_info_t *io_info, hsize_t nelmts, #endif n = H5D_select_mgath(buf, chunk_info->mspace, &mem_iter, smine_nelmts, dxpl_cache, tconv_buf/*out*/); - + #ifdef H5S_DEBUG H5_timer_end(&(io_info->stats->stats[1].gath_timer), &timer); io_info->stats->stats[1].gath_nbytes += n * src_type_size; @@ -2119,7 +2119,7 @@ H5D_chunk_write(H5D_io_info_t *io_info, hsize_t nelmts, #endif n = H5D_select_fgath(io_info, chunk_info->fspace, &bkg_iter, smine_nelmts, - bkg_buf/*out*/); + bkg_buf/*out*/); #ifdef H5S_DEBUG H5_timer_end(&(io_info->stats->stats[0].bkg_timer), &timer); @@ -2133,7 +2133,7 @@ H5D_chunk_write(H5D_io_info_t *io_info, hsize_t nelmts, /* * Perform data type conversion. */ - if (H5T_convert(tpath, src_id, dst_id, smine_nelmts, 0, 0, + if (H5T_convert(tpath, src_id, dst_id, smine_nelmts, 0, 0, tconv_buf, bkg_buf, io_info->dxpl_id)<0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "data type conversion failed") @@ -2191,12 +2191,12 @@ done: if(H5S_SELECT_ITER_RELEASE(&bkg_iter)<0) HDONE_ERROR (H5E_DATASET, H5E_CANTFREE, FAIL, "Can't release selection iterator") } /* end if */ - + if (tconv_buf && NULL==dxpl_cache->tconv_buf) H5FL_BLK_FREE(type_conv,tconv_buf); if (bkg_buf && NULL==dxpl_cache->bkgr_buf) H5FL_BLK_FREE(type_conv,bkg_buf); - + /* Release chunk mapping information */ if(H5D_destroy_chunk_map(&fm) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTRELEASE, FAIL, "can't release chunk mapping") @@ -2223,14 +2223,14 @@ done: * *------------------------------------------------------------------------- */ -static herr_t -H5D_io_assist_mpio(hid_t dxpl_id, H5D_dxpl_cache_t *dxpl_cache, +static herr_t +H5D_io_assist_mpio(hid_t dxpl_id, H5D_dxpl_cache_t *dxpl_cache, hbool_t *xfer_mode_changed) -{ +{ herr_t ret_value = SUCCEED; /*return value */ FUNC_ENTER_NOAPI_NOINIT(H5D_io_assist_mpio) - + /* The following may not handle a collective call correctly * since it does not ensure all processes can handle the write * request according to the MPI collective specification. @@ -2262,7 +2262,7 @@ done: /*------------------------------------------------------------------------- * Function: H5D_io_restore_mpio * - * Purpose: Common logic for restoring MPI transfer mode + * Purpose: Common logic for restoring MPI transfer mode * * Return: Non-negative on success/Negative on failure * @@ -2273,15 +2273,15 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5D_io_restore_mpio(hid_t dxpl_id) -{ +{ H5P_genplist_t *dx_plist; /* Data transer property list */ H5FD_mpio_xfer_t xfer_mode; /*xfer_mode for this request */ herr_t ret_value = SUCCEED; /*return value */ FUNC_ENTER_NOAPI_NOINIT(H5D_io_restore_mpio) - + /* Get the dataset transfer property list */ if (NULL == (dx_plist = H5I_object(dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list") @@ -2319,7 +2319,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5D_create_chunk_map(const H5D_t *dataset, const H5T_t *mem_type, const H5S_t *file_space, +H5D_create_chunk_map(const H5D_t *dataset, const H5T_t *mem_type, const H5S_t *file_space, const H5S_t *mem_space, fm_map *fm) { H5S_t *tmp_mspace=NULL; /* Temporary memory dataspace */ @@ -2336,12 +2336,12 @@ H5D_create_chunk_map(const H5D_t *dataset, const H5T_t *mem_type, const H5S_t *f char bogus; /* "bogus" buffer to pass to selection iterator */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5D_create_chunk_map) /* Get layout for dataset */ fm->layout = &(dataset->shared->layout); - + /* Check if the memory space is scalar & make equivalent memory space */ if((sm_ndims = H5S_GET_EXTENT_NDIMS(mem_space))<0) HGOTO_ERROR (H5E_DATASPACE, H5E_CANTGET, FAIL, "unable to get dimension number") @@ -2366,7 +2366,7 @@ H5D_create_chunk_map(const H5D_t *dataset, const H5T_t *mem_type, const H5S_t *f /* Set the number of dimensions for the memory dataspace */ H5_ASSIGN_OVERFLOW(fm->m_ndims,sm_ndims,int,unsigned); } /* end else */ - + /* Get dim number and dimensionality for each dataspace */ fm->f_ndims=f_ndims=dataset->shared->layout.u.chunk.ndims-1; @@ -2391,7 +2391,7 @@ H5D_create_chunk_map(const H5D_t *dataset, const H5T_t *mem_type, const H5S_t *f /* Round up to the next integer # of chunks, to accomodate partial chunks */ fm->chunks[u] = ((fm->f_dims[u]+dataset->shared->layout.u.chunk.dim[u])-1) / dataset->shared->layout.u.chunk.dim[u]; } /* end for */ - + /* Compute the "down" size of 'chunks' information */ if(H5V_array_down(f_ndims,fm->chunks,fm->down_chunks)<0) HGOTO_ERROR (H5E_INTERNAL, H5E_BADVALUE, FAIL, "can't compute 'down' sizes") @@ -2420,7 +2420,7 @@ H5D_create_chunk_map(const H5D_t *dataset, const H5T_t *mem_type, const H5S_t *f /* Create temporary datatypes for selection iteration */ if((f_tid = H5I_register(H5I_DATATYPE, H5T_copy(dataset->shared->type, H5T_COPY_ALL)))<0) HGOTO_ERROR (H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register file datatype") - + /* Spaces aren't the same shape, iterate over the memory selection directly */ if(H5S_select_iterate(&bogus, f_tid, file_space, H5D_chunk_file_cb, fm)<0) HGOTO_ERROR (H5E_DATASET, H5E_CANTINIT, FAIL, "unable to create file chunk selections") @@ -2469,7 +2469,7 @@ H5D_create_chunk_map(const H5D_t *dataset, const H5T_t *mem_type, const H5S_t *f /* Make a copy of equivalent memory space */ if((tmp_mspace = H5S_copy(equiv_mspace,TRUE))==NULL) HGOTO_ERROR (H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy memory space") - + /* De-select the mem space copy */ if(H5S_select_none(tmp_mspace)<0) HGOTO_ERROR (H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to de-select memory space") @@ -2482,7 +2482,7 @@ H5D_create_chunk_map(const H5D_t *dataset, const H5T_t *mem_type, const H5S_t *f if((f_tid = H5I_register(H5I_DATATYPE, H5T_copy(dataset->shared->type, H5T_COPY_ALL)))<0) HGOTO_ERROR (H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register file datatype") } /* end if */ - + /* Create selection iterator for memory selection */ if((elmt_size=H5T_get_size(mem_type))==0) HGOTO_ERROR(H5E_DATATYPE, H5E_BADSIZE, FAIL, "datatype size invalid") @@ -2547,7 +2547,7 @@ done: if(H5S_hyper_denormalize_offset(file_space, old_offset)<0) HGOTO_ERROR (H5E_DATASET, H5E_BADSELECT, FAIL, "unable to normalize dataspace by offset") } /* end if */ - + FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_create_chunk_map() */ @@ -2610,7 +2610,7 @@ static herr_t H5D_destroy_chunk_map(const fm_map *fm) { herr_t ret_value = SUCCEED; /*return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5D_destroy_chunk_map) /* Free the chunk info skip list */ @@ -2646,7 +2646,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5D_create_chunk_file_map_hyper(const fm_map *fm) { hssize_t ssel_points; /* Number of elements in file selection */ @@ -2660,7 +2660,7 @@ H5D_create_chunk_file_map_hyper(const fm_map *fm) int curr_dim; /* Current dimension to increment */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5D_create_chunk_file_map_hyper) /* Sanity check */ @@ -2710,7 +2710,7 @@ H5D_create_chunk_file_map_hyper(const fm_map *fm) (void)H5S_close(tmp_fchunk); HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSELECT, FAIL, "can't create chunk selection") } /* end if */ - + /* Resize chunk's dataspace dimensions to size of chunk */ if(H5S_set_extent_real(tmp_fchunk,fm->chunk_dim)<0) { (void)H5S_close(tmp_fchunk); @@ -2823,7 +2823,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5D_create_chunk_mem_map_hyper(const fm_map *fm) { H5SL_node_t *curr_node; /* Current node in skip list */ @@ -2835,7 +2835,7 @@ H5D_create_chunk_mem_map_hyper(const fm_map *fm) hssize_t chunk_adjust[H5O_LAYOUT_NDIMS]; /* Adjustment to make to a particular chunk */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5D_create_chunk_mem_map_hyper) /* Sanity check */ @@ -2942,7 +2942,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5D_chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const hsize_t *coords, void *_fm) { fm_map *fm = (fm_map*)_fm; /* File<->memory chunk mapping info */ @@ -2951,7 +2951,7 @@ H5D_chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const hsize_t chunk_index; /* Chunk index */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_file_cb) /* Calculate the index of this chunk */ @@ -3058,7 +3058,7 @@ done: *------------------------------------------------------------------------- */ /* ARGSUSED */ -static herr_t +static herr_t H5D_chunk_mem_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const hsize_t *coords, void *_fm) { fm_map *fm = (fm_map*)_fm; /* File<->memory chunk mapping info */ @@ -3066,7 +3066,7 @@ H5D_chunk_mem_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const hsize_t coords_in_mem[H5O_LAYOUT_NDIMS]; /* Coordinates of element in memory */ hsize_t chunk_index; /* Chunk index */ herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_mem_cb) /* Calculate the index of this chunk */ @@ -3235,13 +3235,13 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5D_ioinfo_init(H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, - const H5S_t + const H5S_t #if !(defined H5_HAVE_PARALLEL || defined H5S_DEBUG) UNUSED #endif /* H5_HAVE_PARALLEL */ - *mem_space, const H5S_t + *mem_space, const H5S_t #if !(defined H5_HAVE_PARALLEL || defined H5S_DEBUG) UNUSED #endif /* H5_HAVE_PARALLEL */ @@ -3249,7 +3249,7 @@ H5D_ioinfo_init(H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id, #ifndef H5_HAVE_PARALLEL UNUSED #endif /* H5_HAVE_PARALLEL */ - flags, hbool_t + flags, hbool_t #ifndef H5_HAVE_PARALLEL UNUSED #endif /* H5_HAVE_PARALLEL */ diff --git a/src/H5Distore.c b/src/H5Distore.c index dfb1214..a28174b 100644 --- a/src/H5Distore.c +++ b/src/H5Distore.c @@ -348,7 +348,7 @@ H5D_istore_decode_key(const H5F_t UNUSED *f, const H5B_t *bt, const uint8_t *raw * Friday, October 10, 1997 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -403,7 +403,7 @@ H5D_istore_debug_key (FILE *stream, H5F_t UNUSED *f, hid_t UNUSED dxpl_id, int i const H5D_istore_key_t *key = (const H5D_istore_key_t *)_key; const H5D_istore_ud1_t *udata = (const H5D_istore_ud1_t *)_udata; unsigned u; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_debug_key) assert (key); @@ -486,7 +486,7 @@ H5D_istore_cmp2(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_lt_key, void *_uda * would describe the UDATA min_corner address * would fall lexicographically between LT_KEY * and RT_KEY. - * + * * Failure: FAIL (same as UDATA < LT_KEY) * * Programmer: Robb Matzke @@ -746,7 +746,7 @@ H5D_istore_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key, if (cmp < 0) { /* Negative indices not supported yet */ HGOTO_ERROR(H5E_STORAGE, H5E_UNSUPPORTED, H5B_INS_ERROR, "internal error") - + } else if (H5V_vector_eq_u (udata->mesg->u.chunk.ndims, udata->key.offset, lt_key->offset) && lt_key->nbytes>0) { @@ -758,7 +758,7 @@ H5D_istore_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key, /* Currently, the old chunk data is "thrown away" after the space is reallocated, * so avoid data copy in H5MF_realloc() call by just free'ing the space and * allocating new space. - * + * * This should keep the file smaller also, by freeing the space and then * allocating new space, instead of vice versa (in H5MF_realloc). * @@ -842,7 +842,7 @@ done: *------------------------------------------------------------------------- */ /* ARGSUSED */ -static int +static int H5D_istore_iter_allocated (H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_lt_key, haddr_t UNUSED addr, const void UNUSED *_rt_key, void *_udata) { @@ -931,7 +931,7 @@ H5D_istore_init (const H5F_t *f, const H5D_t *dset) { H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_istore_init, FAIL) if (H5F_RDCC_NBYTES(f)>0 && H5F_RDCC_NELMTS(f)>0) { @@ -975,7 +975,7 @@ H5D_istore_flush_entry(const H5D_io_info_t *io_info, H5D_rdcc_ent_t *ent, hbool_ void *buf=NULL; /*temporary buffer */ size_t alloc; /*bytes allocated for BUF */ hbool_t point_of_no_return = FALSE; - + FUNC_ENTER_NOAPI_NOINIT(H5D_istore_flush_entry) assert(io_info); @@ -1018,7 +1018,7 @@ H5D_istore_flush_entry(const H5D_io_info_t *io_info, H5D_rdcc_ent_t *ent, hbool_ point_of_no_return = TRUE; ent->chunk = NULL; } - if (H5Z_pipeline(&(io_info->dset->shared->dcpl_cache.pline), 0, &(udata.key.filter_mask), io_info->dxpl_cache->err_detect, + if (H5Z_pipeline(&(io_info->dset->shared->dcpl_cache.pline), 0, &(udata.key.filter_mask), io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, &(udata.key.nbytes), &alloc, &buf)<0) HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "output pipeline failed") } @@ -1038,7 +1038,7 @@ H5D_istore_flush_entry(const H5D_io_info_t *io_info, H5D_rdcc_ent_t *ent, hbool_ io_info->dset->shared->cache.chunk.nflushes++; #endif /* H5D_ISTORE_DEBUG */ } /* end if */ - + /* Reset, but do not free or removed from list */ if (reset) { point_of_no_return = FALSE; @@ -1047,12 +1047,12 @@ H5D_istore_flush_entry(const H5D_io_info_t *io_info, H5D_rdcc_ent_t *ent, hbool_ if(ent->chunk!=NULL) ent->chunk = H5D_istore_chunk_xfree(ent->chunk,&(io_info->dset->shared->dcpl_cache.pline)); } /* end if */ - + done: /* Free the temp buffer only if it's different than the entry chunk */ if (buf!=ent->chunk) H5MM_xfree(buf); - + /* * If we reached the point of no return then we have no choice but to * reset the entry. This can only happen if RESET is true but the @@ -1081,7 +1081,7 @@ done: * * Modifications: * Pedro Vicente, March 28, 2002 - * Added flush parameter that switches the call to H5F_istore_flush_entry + * Added flush parameter that switches the call to H5F_istore_flush_entry * The call with FALSE is used by the H5F_istore_prune_by_extent function * *------------------------------------------------------------------------- @@ -1162,7 +1162,7 @@ H5D_istore_flush (H5D_t *dset, hid_t dxpl_id, unsigned flags) int nerrors=0; H5D_rdcc_ent_t *ent=NULL, *next=NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_istore_flush, FAIL) /* Fill the DXPL cache values for later use */ @@ -1186,7 +1186,7 @@ H5D_istore_flush (H5D_t *dset, hid_t dxpl_id, unsigned flags) nerrors++; } } /* end for */ - + if (nerrors) HGOTO_ERROR (H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks") @@ -1222,7 +1222,7 @@ H5D_istore_dest (H5D_t *dset, hid_t dxpl_id) int nerrors=0; H5D_rdcc_ent_t *ent=NULL, *next=NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_istore_dest, FAIL) assert(dset); @@ -1407,7 +1407,7 @@ H5D_istore_prune (const H5D_io_info_t *io_info, size_t size) for (i=0; ihead; - + /* Compute next value for each pointer */ for (i=0; inext : NULL; @@ -1428,7 +1428,7 @@ H5D_istore_prune (const H5D_io_info_t *io_info, size_t size) HDputc('.', stderr); HDfflush(stderr); #endif - + } else if (1==i && p[1] && !p[1]->locked) { /* * Method 1: Preempt the entry without regard to @@ -1440,7 +1440,7 @@ H5D_istore_prune (const H5D_io_info_t *io_info, size_t size) HDputc(':', stderr); HDfflush(stderr); #endif - + } else { /* Nothing to preempt at this point */ cur= NULL; @@ -1457,7 +1457,7 @@ H5D_istore_prune (const H5D_io_info_t *io_info, size_t size) nerrors++; } } - + /* Advance pointers */ for (i=0; idxpl_cache); @@ -1541,7 +1541,7 @@ H5D_istore_lock(const H5D_io_info_t *io_info, if (rdcc->nslots>0) { idx=H5D_HASH(dset->shared,io_info->store->chunk.index); ent = rdcc->slot[idx]; - + if (ent) { for (u=0, found=TRUE; uu.chunk.ndims; u++) { if (io_info->store->chunk.offset[u]!=ent->offset[u]) { @@ -1574,7 +1574,7 @@ H5D_istore_lock(const H5D_io_info_t *io_info, #endif if (NULL==(chunk=H5D_istore_chunk_alloc (chunk_size,pline))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for raw data chunk") - + } else { H5D_istore_ud1_t tmp_udata; /*B-tree pass-through */ haddr_t chunk_addr; /* Address of chunk on disk */ @@ -1607,7 +1607,7 @@ H5D_istore_lock(const H5D_io_info_t *io_info, HGOTO_ERROR (H5E_IO, H5E_READERROR, NULL, "unable to read raw data chunk") if (pline->nused) - if (H5Z_pipeline(pline, H5Z_FLAG_REVERSE, &(udata->key.filter_mask), io_info->dxpl_cache->err_detect, + if (H5Z_pipeline(pline, H5Z_FLAG_REVERSE, &(udata->key.filter_mask), io_info->dxpl_cache->err_detect, io_info->dxpl_cache->filter_cb, &(udata->key.nbytes), &chunk_alloc, &chunk)<0) { HGOTO_ERROR(H5E_PLINE, H5E_READERROR, NULL, "data pipeline read failed") } @@ -1657,7 +1657,7 @@ else } /* end else */ } assert (found || chunk_size>0); - + if (!found && rdcc->nslots>0 && chunk_size<=rdcc->nbytes && (!ent || !ent->locked)) { /* @@ -1686,7 +1686,7 @@ else ent->rd_count = chunk_size; ent->wr_count = chunk_size; ent->chunk = chunk; - + /* Add it to the cache */ assert(NULL==rdcc->slot[idx]); rdcc->slot[idx] = ent; @@ -1749,7 +1749,7 @@ else /* Set return value */ ret_value = chunk; - + done: if (!ret_value) if(chunk) @@ -1793,7 +1793,7 @@ H5D_istore_unlock(const H5D_io_info_t *io_info, H5D_rdcc_ent_t *ent = NULL; unsigned u; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5D_istore_unlock) assert(io_info); @@ -1842,7 +1842,7 @@ H5D_istore_unlock(const H5D_io_info_t *io_info, } ent->locked = FALSE; } - + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_istore_unlock() */ @@ -1874,7 +1874,7 @@ H5D_istore_readvv(const H5D_io_info_t *io_info, haddr_t chunk_addr; /* Chunk address on disk */ size_t u; /* Local index variables */ ssize_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_istore_readvv, FAIL) /* Check args */ @@ -1956,7 +1956,7 @@ HDfprintf(stderr,"%s: buf=%p\n",FUNC,buf); if (rdcc->nslots>0) { unsigned idx=H5D_HASH(dset->shared,io_info->store->chunk.index); /* Cache entry index */ H5D_rdcc_ent_t *ent = rdcc->slot[idx]; /* Cache entry */ - + /* Potential match... */ if (ent) { for (u=0, found=TRUE; ushared->layout.u.chunk.ndims; u++) { @@ -2035,7 +2035,7 @@ HDfprintf(stderr,"%s: buf=%p\n",FUNC,buf); /* Set return value */ ret_value=naccessed; } /* end else */ - + done: FUNC_LEAVE_NOAPI(ret_value) } /* H5D_istore_readvv() */ @@ -2067,7 +2067,7 @@ H5D_istore_writevv(const H5D_io_info_t *io_info, haddr_t chunk_addr; /* Chunk address on disk */ size_t u; /* Local index variables */ ssize_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_istore_writevv, FAIL) /* Check args */ @@ -2185,7 +2185,7 @@ HDfprintf(stderr,"%s: mem_offset_arr[%Zu]=%Hu\n",FUNC,*mem_curr_seq,mem_offset_a /* Set return value */ ret_value=naccessed; } /* end else */ - + done: FUNC_LEAVE_NOAPI(ret_value) } /* H5D_istore_writevv() */ @@ -2236,7 +2236,7 @@ H5D_istore_create(H5F_t *f, hid_t dxpl_id, H5O_layout_t *layout /*out */ ) if (H5B_create(f, dxpl_id, H5B_ISTORE, &udata, &(layout->u.chunk.addr)/*out*/) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "can't create B-tree") - + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5D_istore_create() */ @@ -2328,7 +2328,7 @@ H5D_istore_get_addr(const H5D_io_info_t *io_info, H5D_istore_ud1_t *_udata) H5D_istore_ud1_t *udata; /* Pointer to information about a chunk */ unsigned u; haddr_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_get_addr) assert(io_info); @@ -2388,7 +2388,7 @@ static void * H5D_istore_chunk_alloc(size_t size, const H5O_pline_t *pline) { void *ret_value=NULL; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_chunk_alloc) assert(size); @@ -2513,7 +2513,7 @@ H5D_istore_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite) int space_ndims; /* Dataset's space rank */ hsize_t space_dim[H5O_LAYOUT_NDIMS]; /* Dataset's dataspace dimensions */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_istore_allocate, FAIL) /* Check args */ @@ -2682,7 +2682,7 @@ H5D_istore_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite) #endif /* H5_HAVE_PARALLEL */ } /* end if */ } /* end if */ - + /* Increment indices */ for (i=(int)dset->shared->layout.u.chunk.ndims-1, carry=1; i>=0 && carry; --i) { chunk_offset[i] += dset->shared->layout.u.chunk.dim[i]; @@ -2719,7 +2719,7 @@ done: * Function: H5D_istore_prune_by_extent * * Purpose: This function searches for chunks that are no longer necessary both in the - * raw data cache and in the B-tree. + * raw data cache and in the B-tree. * * Return: Success: 0, Failure: -1 * @@ -2732,12 +2732,12 @@ done: * * For chunks that are no longer necessary: * - * 1. Search in the raw data cache for each chunk + * 1. Search in the raw data cache for each chunk * 2. If found then preempt it from the cache - * 3. Search in the B-tree for each chunk + * 3. Search in the B-tree for each chunk * 4. If found then remove it from the B-tree and deallocate file storage for the chunk * - * This example shows a 2d dataset of 90x90 with a chunk size of 20x20. + * This example shows a 2d dataset of 90x90 with a chunk size of 20x20. * * * 0 20 40 60 80 90 100 @@ -2763,7 +2763,7 @@ done: * | : ::::::::::: : | : * 80+.........:.........:::::::::::.........:.....+...: O Fill Val * | : : ::::::::::: | : Explicitly - * | : : ::::::X:::: | : Written + * | : : ::::::X:::: | : Written * 90+---------+---------+---------+---------+-----+ : * : : : ::::::::::: : * 100:.........:.........:.........:::::::::::.........: @@ -2780,27 +2780,27 @@ done: * 0 20 40 60 70 80 90 100 * 0 +---------+---------+---------+----+----+-----+...+ * |:::::X:::::::::::::: : | : | : - * |:::::::X:::::::::::: : | : | : Key - * |::::::::::X::::::::: : | : | : -------- - * |::::::::::::X::::::: : | : | : +-+ Dataset - * 20+::::::::::::::::::::.........:....+....:.....|...: | | Extent - * | :::::X::::: : | : | : +-+ - * | ::::::::::: : | : | : - * | ::::::::::: : | : | : ... Chunk - * | :::::::X::: : | : | : : : Boundary - * 40+.........:::::::::::.........:....+....:.....|...: :.: - * | : : : | : | : - * | : : : | : | : ... Allocated - * | : : : | : | : ::: & Filled - * | : : : | : | : ::: Chunk - * 60+.........:.........:.........:....+....:.....|...: - * | : :::::::X::: | : | : X Element - * | : ::::::::::: | : | : Written - * +---------+---------+---------+----+ : | : - * | : ::::::::::: : | : - * 80+.........:.........:::::::::X:.........:.....|...: O Fill Val - * | : : ::::::::::: | : Explicitly - * | : : ::::::X:::: | : Written + * |:::::::X:::::::::::: : | : | : Key + * |::::::::::X::::::::: : | : | : -------- + * |::::::::::::X::::::: : | : | : +-+ Dataset + * 20+::::::::::::::::::::.........:....+....:.....|...: | | Extent + * | :::::X::::: : | : | : +-+ + * | ::::::::::: : | : | : + * | ::::::::::: : | : | : ... Chunk + * | :::::::X::: : | : | : : : Boundary + * 40+.........:::::::::::.........:....+....:.....|...: :.: + * | : : : | : | : + * | : : : | : | : ... Allocated + * | : : : | : | : ::: & Filled + * | : : : | : | : ::: Chunk + * 60+.........:.........:.........:....+....:.....|...: + * | : :::::::X::: | : | : X Element + * | : ::::::::::: | : | : Written + * +---------+---------+---------+----+ : | : + * | : ::::::::::: : | : + * 80+.........:.........:::::::::X:.........:.....|...: O Fill Val + * | : : ::::::::::: | : Explicitly + * | : : ::::::X:::: | : Written * 90+---------+---------+---------+---------+-----+ : * : : : ::::::::::: : * 100:.........:.........:.........:::::::::::.........: @@ -2808,7 +2808,7 @@ done: * * That means that the nine chunks along the bottom and right side should * no longer exist. Of those nine chunks, (0,80), (20,80), (40,80), - * (60,80), (80,80), (80,60), (80,40), (80,20), and (80,0), one is actually allocated + * (60,80), (80,80), (80,60), (80,40), (80,20), and (80,0), one is actually allocated * that needs to be released. * To release the chunks, we traverse the B-tree to obtain a list of unused * allocated chunks, and then call H5B_remove() for each chunk. @@ -2840,7 +2840,7 @@ H5D_istore_prune_by_extent(const H5D_io_info_t *io_info) HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataset dimensions") /*------------------------------------------------------------------------- - * Figure out what chunks are no longer in use for the specified extent + * Figure out what chunks are no longer in use for the specified extent * and release them from the linked list raw data cache *------------------------------------------------------------------------- */ @@ -2892,7 +2892,7 @@ done: /*------------------------------------------------------------------------- * Function: H5D_istore_prune_extent * - * Purpose: Search for chunks that are no longer necessary in the B-tree. + * Purpose: Search for chunks that are no longer necessary in the B-tree. * * Return: Success: 0, Failure: -1 * @@ -2917,7 +2917,7 @@ H5D_istore_prune_extent(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t UN H5D_istore_ud1_t udata; int ret_value=H5B_ITER_CONT; /* Return value */ - /* The LT_KEY is the left key (the one that describes the chunk). It points to a chunk of + /* The LT_KEY is the left key (the one that describes the chunk). It points to a chunk of * storage that contains the beginning of the logical address space represented by UDATA. */ @@ -2951,7 +2951,7 @@ done: /*------------------------------------------------------------------------- * Function: H5D_istore_remove * - * Purpose: Removes chunks that are no longer necessary in the B-tree. + * Purpose: Removes chunks that are no longer necessary in the B-tree. * * Return: Success: 0, Failure: -1 * @@ -2996,7 +2996,7 @@ done: * Function: H5D_istore_initialize_by_extent * * Purpose: This function searches for chunks that have to be initialized with the fill - * value both in the raw data cache and in the B-tree. + * value both in the raw data cache and in the B-tree. * * Return: Success: 0, Failure: -1 * @@ -3004,12 +3004,12 @@ done: * * Date: April 4, 2002 * - * Comments: + * Comments: * * (See the example of H5D_istore_prune_by_extent) * Next, there are seven chunks where the database extent boundary is * within the chunk. We find those seven just like we did with the previous nine. - * Fot the ones that are allocated we initialize the part that lies outside the boundary + * Fot the ones that are allocated we initialize the part that lies outside the boundary * with the fill value. * * Modifications: @@ -3121,8 +3121,8 @@ H5D_istore_initialize_by_extent(H5D_io_info_t *io_info) naccessed *= sub_size[u]; } /* end for */ - /* - * Figure out what chunks have to be initialized. These are the chunks where the dataspace + /* + * Figure out what chunks have to be initialized. These are the chunks where the dataspace * extent boundary is within the chunk */ for(u = 0, found = 0; u < rank; u++) { @@ -3410,7 +3410,7 @@ H5D_istore_stats (H5D_t *dset, hbool_t headers) double miss_rate; char ascii[32]; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_istore_stats, FAIL) if (!H5DEBUG(AC)) @@ -3474,7 +3474,7 @@ H5D_istore_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int inden H5O_layout_t layout; H5D_istore_ud1_t udata; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5D_istore_debug,FAIL) layout.u.chunk.ndims = ndims; diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index fde5544..a309b8d 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -40,14 +40,14 @@ static herr_t H5D_mpio_spaces_xfer(H5D_io_info_t *io_info, size_t elmt_size, const H5S_t *file_space, const H5S_t *mem_space, - void *buf/*out*/, + void *buf/*out*/, hbool_t do_write); /* For irregular hyperslab selection. */ static herr_t H5D_mpio_spaces_span_xfer(H5D_io_info_t *io_info, size_t elmt_size, const H5S_t *file_space, const H5S_t *mem_space, - void *buf/*out*/, + void *buf/*out*/, hbool_t do_write); /*------------------------------------------------------------------------- @@ -102,7 +102,7 @@ H5D_mpio_opt_possible( const H5D_t *dset, const H5S_t *mem_space, const H5S_t *f HGOTO_DONE(FALSE); /* Dataset storage must be contiguous or chunked */ - if ((flags&H5S_CONV_STORAGE_MASK)!=H5S_CONV_STORAGE_CONTIGUOUS && + if ((flags&H5S_CONV_STORAGE_MASK)!=H5S_CONV_STORAGE_CONTIGUOUS && (flags&H5S_CONV_STORAGE_MASK)!=H5S_CONV_STORAGE_CHUNKED) HGOTO_DONE(FALSE); @@ -132,11 +132,11 @@ H5D_mpio_opt_possible( const H5D_t *dset, const H5S_t *mem_space, const H5S_t *f if((mpi_rank = H5F_mpi_get_rank(dset->ent.file))<0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't retrieve MPI rank") - /* Currently collective chunking storage + /* Currently collective chunking storage inside HDF5 is supported for either one of the following two cases: 1. All the hyperslabs for one process is inside one chunk. - 2. For single hyperslab selection, the number of chunks that covered - the single selection for all processes should be equal. + 2. For single hyperslab selection, the number of chunks that covered + the single selection for all processes should be equal. KY, 2004/7/14 */ @@ -145,7 +145,7 @@ H5D_mpio_opt_possible( const H5D_t *dset, const H5S_t *mem_space, const H5S_t *f space, the collective IO can work. Otherwise, SELECT_POINT will be reached,collective IO shouldn't work. Please clarify and correct the code on the following, - Quincey said that it was probably okay if only one data space is SCALAR, + Quincey said that it was probably okay if only one data space is SCALAR, Still keep the code here until we added more tests later. Kent */ if(H5S_SCALAR==H5S_GET_EXTENT_TYPE(mem_space) || H5S_SCALAR ==H5S_GET_EXTENT_TYPE(file_space)) { @@ -160,7 +160,7 @@ H5D_mpio_opt_possible( const H5D_t *dset, const H5S_t *mem_space, const H5S_t *f if(H5S_SELECT_BOUNDS(file_space,startf,endf)==FAIL) HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE,FAIL, "invalid check for single selection blocks"); - for(u=0; u < dset->shared->layout.u.chunk.ndims; u++) + for(u=0; u < dset->shared->layout.u.chunk.ndims; u++) chunk_dim[u] = dset->shared->layout.u.chunk.dim[u]; /* Case 1: check whether all hyperslab in this process is inside one chunk. @@ -174,7 +174,7 @@ H5D_mpio_opt_possible( const H5D_t *dset, const H5S_t *mem_space, const H5S_t *f pcheck_hyper = 0; break; } - + if (MPI_SUCCESS != (mpi_code= MPI_Reduce(&pcheck_hyper,&check_hyper,1,MPI_INT,MPI_LAND,0,comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Reduce failed", mpi_code) if (MPI_SUCCESS != (mpi_code= MPI_Bcast(&check_hyper,1,MPI_INT,0,comm))) @@ -183,13 +183,13 @@ H5D_mpio_opt_possible( const H5D_t *dset, const H5S_t *mem_space, const H5S_t *f /*if check_hyper is true, condition for collective IO case is fulfilled, no need to do further test. */ if(check_hyper) - HGOTO_DONE(TRUE); - + HGOTO_DONE(TRUE); + /* Case 2:Check whether the number of chunks that covered the single hyperslab is the same. - If not,no collective chunk IO. + If not,no collective chunk IO. KY, 2004/7/14 */ - + c1 = H5S_SELECT_IS_SINGLE(file_space); c2 = H5S_SELECT_IS_SINGLE(mem_space); @@ -210,11 +210,11 @@ H5D_mpio_opt_possible( const H5D_t *dset, const H5S_t *mem_space, const H5S_t *f HMPI_GOTO_ERROR(FAIL, "MPI_Reduce failed", mpi_code) if (MPI_SUCCESS != (mpi_code= MPI_Reduce(&tnum_chunkf,&min_chunkf,1,MPI_INT,MPI_MIN,0,comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Reduce failed", mpi_code) - + /* Let the rank==0 process determine if the same number of chunks will be operated on by all processes */ if(mpi_rank == 0) num_chunks_same = (max_chunkf==min_chunkf); - + /* Broadcast the flag indicating the number of chunks are the same */ if (MPI_SUCCESS != (mpi_code= MPI_Bcast(&num_chunks_same,1,MPI_INT,0,comm))) HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed", mpi_code) @@ -324,7 +324,7 @@ H5D_mpio_spaces_xfer(H5D_io_info_t *io_info, size_t elmt_size, else { haddr_t chunk_addr; /* for collective chunk IO */ - assert(io_info->dset->shared->layout.type == H5D_CHUNKED); + assert(io_info->dset->shared->layout.type == H5D_CHUNKED); chunk_addr=H5D_istore_get_addr(io_info,NULL); addr = H5F_BASE_ADDR(io_info->dset->ent.file) + chunk_addr + mpi_file_offset; } @@ -374,11 +374,11 @@ done: function until you don't see this line. Nov. 11,2004, KY**/ static herr_t -H5D_mpio_spaces_span_xfer(H5D_io_info_t *io_info, +H5D_mpio_spaces_span_xfer(H5D_io_info_t *io_info, size_t elmt_size, - const H5S_t *file_space, + const H5S_t *file_space, const H5S_t *mem_space, - void *_buf /*out*/, + void *_buf /*out*/, hbool_t do_write ) { haddr_t addr; /* Address of dataset (or selection) within file */ @@ -427,7 +427,7 @@ H5D_mpio_spaces_span_xfer(H5D_io_info_t *io_info, printf("mpi_buf_count %d\n",mpi_buf_count); /* create the MPI file type */ - if(H5S_SELECT_IS_REGULAR(file_space)== TRUE){ + if(H5S_SELECT_IS_REGULAR(file_space)== TRUE){ if ( H5S_mpio_space_type( file_space, elmt_size, /* out: */ &mpi_file_type, @@ -452,7 +452,7 @@ H5D_mpio_spaces_span_xfer(H5D_io_info_t *io_info, else { haddr_t chunk_addr; /* for collective chunk IO */ - assert(io_info->dset->shared->layout.type == H5D_CHUNKED); + assert(io_info->dset->shared->layout.type == H5D_CHUNKED); chunk_addr=H5D_istore_get_addr(io_info,NULL); addr = H5F_BASE_ADDR(io_info->dset->ent.file) + chunk_addr + mpi_file_offset; } @@ -472,7 +472,7 @@ H5D_mpio_spaces_span_xfer(H5D_io_info_t *io_info, if (do_write) { if (H5F_block_write(io_info->dset->ent.file, H5FD_MEM_DRAW, addr, mpi_buf_count, io_info->dxpl_id, buf) <0) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,"MPI write failed"); - } + } else { if (H5F_block_read (io_info->dset->ent.file, H5FD_MEM_DRAW, addr, mpi_buf_count, io_info->dxpl_id, buf) <0) HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL,"MPI read failed"); @@ -600,9 +600,9 @@ H5D_mpio_spaces_write(H5D_io_info_t *io_info, */ herr_t H5D_mpio_spaces_span_read(H5D_io_info_t *io_info, - size_t UNUSED nelmts, + size_t UNUSED nelmts, size_t elmt_size, - const H5S_t *file_space, + const H5S_t *file_space, const H5S_t *mem_space, void *buf/*out*/) { @@ -627,7 +627,7 @@ H5D_mpio_spaces_span_read(H5D_io_info_t *io_info, * Programmer: KY * Note: Don't call this funtion until you don't see this line. * KY, 11/11/04 - + * * Modifications: * @@ -642,9 +642,9 @@ H5D_mpio_spaces_span_read(H5D_io_info_t *io_info, */ herr_t H5D_mpio_spaces_span_write(H5D_io_info_t *io_info, - size_t UNUSED nelmts, + size_t UNUSED nelmts, size_t elmt_size, - const H5S_t *file_space, + const H5S_t *file_space, const H5S_t *mem_space, const void *buf) { diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h index a4b4574..14b97c9 100644 --- a/src/H5Dpkg.h +++ b/src/H5Dpkg.h @@ -228,12 +228,12 @@ H5_DLL ssize_t H5D_contig_writevv(const H5D_io_info_t *io_info, /* Functions that operate on compact dataset storage */ H5_DLL ssize_t H5D_compact_readvv(const H5D_io_info_t *io_info, - size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[], + size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[], + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[], void *buf); H5_DLL ssize_t H5D_compact_writevv(const H5D_io_info_t *io_info, - size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[], - size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[], + size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[], + size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[], const void *buf); /* Functions that operate on indexed storage */ diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index 1f32c5d..0e92641 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -38,7 +38,7 @@ /* Definitions for storage layout property */ #define H5D_CRT_LAYOUT_NAME "layout" #define H5D_CRT_LAYOUT_SIZE sizeof(H5D_layout_t) -#define H5D_CRT_LAYOUT_DEF H5D_CONTIGUOUS +#define H5D_CRT_LAYOUT_DEF H5D_CONTIGUOUS /* Definitions for chunk dimensionality property */ #define H5D_CRT_CHUNK_DIM_NAME "chunk_ndims" #define H5D_CRT_CHUNK_DIM_SIZE sizeof(unsigned) @@ -48,7 +48,7 @@ #define H5D_CRT_CHUNK_SIZE_SIZE sizeof(size_t[H5O_LAYOUT_NDIMS]) #define H5D_CRT_CHUNK_SIZE_DEF {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,\ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1} -/* Definitions for fill value. size=0 means fill value will be 0 as +/* Definitions for fill value. size=0 means fill value will be 0 as * library default; size=-1 means fill value is undefined. */ #define H5D_CRT_FILL_VALUE_NAME "fill_value" #define H5D_CRT_FILL_VALUE_SIZE sizeof(H5O_fill_t) @@ -64,7 +64,7 @@ /* Definitions for time of fill value writing */ #define H5D_CRT_FILL_TIME_NAME "fill_time" #define H5D_CRT_FILL_TIME_SIZE sizeof(H5D_fill_time_t) -#define H5D_CRT_FILL_TIME_DEF H5D_FILL_TIME_IFSET +#define H5D_CRT_FILL_TIME_DEF H5D_FILL_TIME_IFSET /* Definitions for external file list */ #define H5D_CRT_EXT_FILE_LIST_NAME "efl" #define H5D_CRT_EXT_FILE_LIST_SIZE sizeof(H5O_efl_t) @@ -73,7 +73,7 @@ /* Definitions for data filter pipeline */ #define H5D_CRT_DATA_PIPELINE_NAME "pline" #define H5D_CRT_DATA_PIPELINE_SIZE sizeof(H5O_pline_t) -#define H5D_CRT_DATA_PIPELINE_DEF {0, 0, NULL} +#define H5D_CRT_DATA_PIPELINE_DEF {0, 0, NULL} #define H5D_CRT_DATA_PIPELINE_CMP H5D_crt_data_pipeline_cmp /* ======== Data transfer properties ======== */ @@ -217,11 +217,11 @@ H5_DLL herr_t H5D_close(H5D_t *dataset); H5_DLL htri_t H5D_isa(H5G_entry_t *ent, hid_t dxpl_id); H5_DLL H5G_entry_t *H5D_entof(H5D_t *dataset); H5_DLL H5T_t *H5D_typeof(const H5D_t *dset); -H5_DLL herr_t H5D_crt_copy(hid_t new_plist_t, hid_t old_plist_t, +H5_DLL herr_t H5D_crt_copy(hid_t new_plist_t, hid_t old_plist_t, void *copy_data); H5_DLL herr_t H5D_crt_close(hid_t dxpl_id, void *close_data); H5_DLL herr_t H5D_xfer_create(hid_t dxpl_id, void *create_data); -H5_DLL herr_t H5D_xfer_copy(hid_t new_plist_id, hid_t old_plist_id, +H5_DLL herr_t H5D_xfer_copy(hid_t new_plist_id, hid_t old_plist_id, void *copy_data); H5_DLL herr_t H5D_xfer_close(hid_t dxpl_id, void *close_data); H5_DLL herr_t H5D_flush(const H5F_t *f, hid_t dxpl_id, unsigned flags); diff --git a/src/H5Dpublic.h b/src/H5Dpublic.h index 09556c2..3595bf2 100644 --- a/src/H5Dpublic.h +++ b/src/H5Dpublic.h @@ -39,7 +39,7 @@ typedef enum H5D_alloc_time_t { H5D_ALLOC_TIME_EARLY =1, H5D_ALLOC_TIME_LATE =2, H5D_ALLOC_TIME_INCR =3 -} H5D_alloc_time_t; +} H5D_alloc_time_t; /* Values for the status of space allocation */ typedef enum H5D_space_status_t { @@ -78,7 +78,7 @@ H5_DLL hid_t H5Dcreate (hid_t file_id, const char *name, hid_t type_id, H5_DLL hid_t H5Dopen (hid_t file_id, const char *name); H5_DLL herr_t H5Dclose (hid_t dset_id); H5_DLL hid_t H5Dget_space (hid_t dset_id); -H5_DLL herr_t H5Dget_space_status(hid_t dset_id, +H5_DLL herr_t H5Dget_space_status(hid_t dset_id, H5D_space_status_t *allocation); H5_DLL hid_t H5Dget_type (hid_t dset_id); H5_DLL hid_t H5Dget_create_plist (hid_t dset_id); diff --git a/src/H5Dselect.c b/src/H5Dselect.c index 125d22f..596937f 100644 --- a/src/H5Dselect.c +++ b/src/H5Dselect.c @@ -314,7 +314,7 @@ done: * Purpose: Gathers dataset elements from application memory BUF and * copies them into the gather buffer TGATH_BUF. * Each element is ELMT_SIZE bytes and arranged in application - * memory according to SPACE. + * memory according to SPACE. * The caller is requesting that at most NELMTS be gathered. * * Return: Success: Number of elements copied. @@ -447,7 +447,7 @@ H5D_select_read(H5D_io_info_t *io_info, assert(io_info->store); assert(buf); assert(TRUE==H5P_isa_class(io_info->dxpl_id,H5P_DATASET_XFER)); - + /* Initialize file iterator */ if (H5S_select_iter_init(&file_iter, file_space, elmt_size)<0) HGOTO_ERROR (H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator"); @@ -591,7 +591,7 @@ H5D_select_write(H5D_io_info_t *io_info, assert(io_info->store); assert(TRUE==H5P_isa_class(io_info->dxpl_id,H5P_DATASET_XFER)); assert(buf); - + /* Allocate the vector I/O arrays */ if(io_info->dxpl_cache->vec_size!=H5D_XFER_HYPER_VECTOR_SIZE_DEF) { if((mem_len = H5FL_SEQ_MALLOC(size_t,io_info->dxpl_cache->vec_size))==NULL) @@ -619,7 +619,7 @@ H5D_select_write(H5D_io_info_t *io_info, if (H5S_select_iter_init(&mem_iter, mem_space, elmt_size)<0) HGOTO_ERROR (H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to initialize selection iterator"); mem_iter_init=1; /* Memory selection iteration info has been initialized */ - + /* Initialize sequence counts */ curr_mem_seq=curr_file_seq=0; mem_nseq=file_nseq=0; diff --git a/src/H5E.c b/src/H5E.c index 36f09a1..450b7dd 100644 --- a/src/H5E.c +++ b/src/H5E.c @@ -336,7 +336,7 @@ H5E_get_stack(void) * * Automatic stack traversal is always in the H5E_WALK_DOWNWARD * direction. - * + * * See Also: H5Ewalk() * * Return: Non-negative on success/Negative on failure @@ -360,7 +360,7 @@ H5Eset_auto(H5E_auto_t func, void *client_data) /* Get the thread-specific error stack */ if((estack = H5E_get_my_stack())==NULL) /*lint !e506 !e774 Make lint 'constant value Boolean' in non-threaded case */ HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack") - + /* Set the automatic error reporting info */ estack->auto_func = func; estack->auto_data = client_data; @@ -398,7 +398,7 @@ H5Eget_auto(H5E_auto_t *func, void **client_data) /* Get the thread-specific error stack */ if((estack = H5E_get_my_stack())==NULL) /*lint !e506 !e774 Make lint 'constant value Boolean' in non-threaded case */ HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get current error stack") - + /* Set the automatic error reporting info */ if (func) *func = estack->auto_func; if (client_data) *client_data = estack->auto_data; @@ -463,11 +463,11 @@ H5Eprint(FILE *stream) { H5E_t *estack = H5E_get_my_stack (); herr_t ret_value = FAIL; - + /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(H5Eprint, FAIL) /*NO TRACE*/ - + if (!stream) stream = stderr; fprintf (stream, "HDF5-DIAG: Error detected in %s ", H5_lib_vers_info_g); /* try show the process or thread id in multiple processes cases*/ @@ -489,7 +489,7 @@ H5Eprint(FILE *stream) HDfputc ('\n', stream); ret_value = H5E_walk (H5E_WALK_DOWNWARD, H5E_walk_cb, (void*)stream); - + done: FUNC_LEAVE_API(ret_value) } @@ -613,7 +613,7 @@ H5Eget_major (H5E_major_t n) { unsigned i; const char *ret_value="Invalid major error number"; - + /* * WARNING: Do not call the FUNC_ENTER() or FUNC_LEAVE() macros since * they might interact badly with the error stack. We are @@ -654,7 +654,7 @@ H5Eget_minor (H5E_minor_t n) { unsigned i; const char *ret_value="Invalid minor error number"; - + /* * WARNING: Do not call the FUNC_ENTER() or FUNC_LEAVE() macros since * they might interact badly with the error stack. We are @@ -700,7 +700,7 @@ H5E_push(H5E_major_t maj_num, H5E_minor_t min_num, const char *function_name, const char *file_name, unsigned line, const char *desc) { H5E_t *estack = H5E_get_my_stack (); - + /* * WARNING: We cannot call HERROR() from within this function or else we * could enter infinite recursion. Furthermore, we also cannot @@ -731,7 +731,7 @@ H5E_push(H5E_major_t maj_num, H5E_minor_t min_num, const char *function_name, estack->slot[estack->nused].desc = desc; estack->nused++; } - + FUNC_LEAVE_NOAPI(SUCCEED) } @@ -763,7 +763,7 @@ H5Epush(const char *file, const char *func, unsigned line, H5E_major_t maj, H5E_minor_t min, const char *str) { herr_t ret_value; - + FUNC_ENTER_API(H5Epush, FAIL) H5TRACE6("e","ssIuEjEns",file,func,line,maj,min,str); @@ -855,7 +855,7 @@ H5E_walk (H5E_direction_t direction, H5E_walk_t func, void *client_data) status = (func)(estack->nused-(i+1), estack->slot+i, client_data); } } - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -863,23 +863,23 @@ done: /*------------------------------------------------------------------------- * Function: H5E_dump_api_stack - * + * * Purpose: Private function to dump the error stack during an error in * an API function if a callback function is defined for the - * current error stack. - * + * current error stack. + * * Return: Non-negative on success/Negative on failure - * + * * Programmer: Quincey Koziol * Thursday, January 20, 2005 * * Modifications: - * + * *------------------------------------------------------------------------- - */ -herr_t + */ +herr_t H5E_dump_api_stack(int is_api) -{ +{ herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5E_dump_api_stack, FAIL) diff --git a/src/H5F.c b/src/H5F.c index e320fea..91ca9ca 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -59,7 +59,7 @@ typedef struct H5F_olist_t { } file_info; unsigned list_index; /* Current index in open ID array */ int max_index; /* Maximum # of IDs to put into array */ -} H5F_olist_t; +} H5F_olist_t; /* PRIVATE PROTOTYPES */ #ifdef NOT_YET @@ -70,7 +70,7 @@ static int H5F_get_objects_cb(void *obj_ptr, hid_t obj_id, void *key); static herr_t H5F_get_vfd_handle(const H5F_t *file, hid_t fapl, void** file_handle); static H5F_t *H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id); static herr_t H5F_dest(H5F_t *f, hid_t dxpl_id); -static H5F_t *H5F_open(const char *name, unsigned flags, hid_t fcpl_id, +static H5F_t *H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t dxpl_id); static herr_t H5F_flush(H5F_t *f, hid_t dxpl_id, H5F_scope_t scope, unsigned flags); static herr_t H5F_close(H5F_t *f); @@ -144,7 +144,7 @@ done: * Change File creation property list to generic property list mechanism. *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5F_init_interface(void) { size_t nprops; /* Number of properties */ @@ -152,7 +152,7 @@ H5F_init_interface(void) /* File creation property class variables. In sequence, they are * - File create property list class to modify - * - Default value for size of file user block + * - Default value for size of file user block * - Default value for 1/2 rank for symbol table leaf nodes * - Default value for 1/2 rank for btree internal nodes * - Default value for byte number in an address @@ -160,7 +160,7 @@ H5F_init_interface(void) * - Default value for version number of superblock * - Default value for free-space version number * - Default value for object directory version number - * - Default value for share-header format version + * - Default value for share-header format version */ H5P_genclass_t *crt_pclass; hsize_t userblock_size = H5F_CRT_USER_BLOCK_DEF; @@ -172,7 +172,7 @@ H5F_init_interface(void) unsigned freespace_ver = H5F_CRT_FREESPACE_VERS_DEF; unsigned objectdir_ver = H5F_CRT_OBJ_DIR_VERS_DEF; unsigned sharedheader_ver = H5F_CRT_SHARE_HEAD_VERS_DEF; - /* File access property class variables. In sequence, they are + /* File access property class variables. In sequence, they are * - File access property class to modify * - Size of meta data cache(elements) * - Size of raw data chunk cache(elements) @@ -184,7 +184,7 @@ H5F_init_interface(void) * - Maximum sieve buffer size * - Garbage-collect reference * - File driver ID - * - File driver info + * - File driver info */ H5P_genclass_t *acs_pclass; int mdc_nelmts = H5F_ACS_META_CACHE_SIZE_DEF; @@ -203,13 +203,13 @@ H5F_init_interface(void) hsize_t family_offset = H5F_ACS_FAMILY_OFFSET_DEF; H5FD_mem_t mem_type = H5F_ACS_MULTI_TYPE_DEF; - /* File mount property class variable. + /* File mount property class variable. * - Mount property class to modify - * - whether absolute symlinks is local to file + * - whether absolute symlinks is local to file */ H5P_genclass_t *mnt_pclass; hbool_t local = H5F_MNT_SYM_LOCAL_DEF; - + FUNC_ENTER_NOAPI_NOINIT(H5F_init_interface) /* @@ -222,8 +222,8 @@ H5F_init_interface(void) */ if (H5I_init_group(H5I_FILE, (size_t)H5I_FILEID_HASHSIZE, 0, (H5I_free_t)H5F_close)<0) HGOTO_ERROR (H5E_FILE, H5E_CANTINIT, FAIL, "unable to initialize interface") - - /* ========== File Creation Property Class Initialization ============*/ + + /* ========== File Creation Property Class Initialization ============*/ assert(H5P_CLS_FILE_CREATE_g!=-1); /* Get the pointer to file creation class */ @@ -237,39 +237,39 @@ H5F_init_interface(void) /* Assume that if there are properties in the class, they are the default ones */ if(nprops==0) { /* Register the user block size */ - if(H5P_register(crt_pclass,H5F_CRT_USER_BLOCK_NAME,H5F_CRT_USER_BLOCK_SIZE, &userblock_size,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(crt_pclass,H5F_CRT_USER_BLOCK_NAME,H5F_CRT_USER_BLOCK_SIZE, &userblock_size,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the 1/2 rank for symbol table leaf nodes */ - if(H5P_register(crt_pclass,H5F_CRT_SYM_LEAF_NAME,H5F_CRT_SYM_LEAF_SIZE, &sym_leaf_k,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(crt_pclass,H5F_CRT_SYM_LEAF_NAME,H5F_CRT_SYM_LEAF_SIZE, &sym_leaf_k,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the 1/2 rank for btree internal nodes */ - if(H5P_register(crt_pclass,H5F_CRT_BTREE_RANK_NAME,H5F_CRT_BTREE_RANK_SIZE, btree_k,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(crt_pclass,H5F_CRT_BTREE_RANK_NAME,H5F_CRT_BTREE_RANK_SIZE, btree_k,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the byte number for an address */ - if(H5P_register(crt_pclass,H5F_CRT_ADDR_BYTE_NUM_NAME, H5F_CRT_ADDR_BYTE_NUM_SIZE, &sizeof_addr,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(crt_pclass,H5F_CRT_ADDR_BYTE_NUM_NAME, H5F_CRT_ADDR_BYTE_NUM_SIZE, &sizeof_addr,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the byte number for object size */ - if(H5P_register(crt_pclass,H5F_CRT_OBJ_BYTE_NUM_NAME, H5F_CRT_OBJ_BYTE_NUM_SIZE,&sizeof_size,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(crt_pclass,H5F_CRT_OBJ_BYTE_NUM_NAME, H5F_CRT_OBJ_BYTE_NUM_SIZE,&sizeof_size,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the superblock version number */ - if(H5P_register(crt_pclass,H5F_CRT_SUPER_VERS_NAME,H5F_CRT_SUPER_VERS_SIZE, &superblock_ver,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(crt_pclass,H5F_CRT_SUPER_VERS_NAME,H5F_CRT_SUPER_VERS_SIZE, &superblock_ver,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the free-space version number */ - if(H5P_register(crt_pclass,H5F_CRT_FREESPACE_VERS_NAME, H5F_CRT_FREESPACE_VERS_SIZE,&freespace_ver,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(crt_pclass,H5F_CRT_FREESPACE_VERS_NAME, H5F_CRT_FREESPACE_VERS_SIZE,&freespace_ver,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the object directory version number */ - if(H5P_register(crt_pclass,H5F_CRT_OBJ_DIR_VERS_NAME, H5F_CRT_OBJ_DIR_VERS_SIZE,&objectdir_ver,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(crt_pclass,H5F_CRT_OBJ_DIR_VERS_NAME, H5F_CRT_OBJ_DIR_VERS_SIZE,&objectdir_ver,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the shared-header version number */ - if(H5P_register(crt_pclass,H5F_CRT_SHARE_HEAD_VERS_NAME, H5F_CRT_SHARE_HEAD_VERS_SIZE, &sharedheader_ver,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(crt_pclass,H5F_CRT_SHARE_HEAD_VERS_NAME, H5F_CRT_SHARE_HEAD_VERS_SIZE, &sharedheader_ver,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") } /* end if */ @@ -294,51 +294,51 @@ H5F_init_interface(void) /* Assume that if there are properties in the class, they are the default ones */ if(nprops==0) { /* Register the size of meta data cache(elements) */ - if(H5P_register(acs_pclass,H5F_ACS_META_CACHE_SIZE_NAME,H5F_ACS_META_CACHE_SIZE_SIZE, &mdc_nelmts,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(acs_pclass,H5F_ACS_META_CACHE_SIZE_NAME,H5F_ACS_META_CACHE_SIZE_SIZE, &mdc_nelmts,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of raw data chunk cache (elements) */ - if(H5P_register(acs_pclass,H5F_ACS_DATA_CACHE_ELMT_SIZE_NAME,H5F_ACS_DATA_CACHE_ELMT_SIZE_SIZE, &rdcc_nelmts,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(acs_pclass,H5F_ACS_DATA_CACHE_ELMT_SIZE_NAME,H5F_ACS_DATA_CACHE_ELMT_SIZE_SIZE, &rdcc_nelmts,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the size of raw data chunk cache(bytes) */ - if(H5P_register(acs_pclass,H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME,H5F_ACS_DATA_CACHE_BYTE_SIZE_SIZE, &rdcc_nbytes,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(acs_pclass,H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME,H5F_ACS_DATA_CACHE_BYTE_SIZE_SIZE, &rdcc_nbytes,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the preemption for reading chunks */ - if(H5P_register(acs_pclass,H5F_ACS_PREEMPT_READ_CHUNKS_NAME,H5F_ACS_PREEMPT_READ_CHUNKS_SIZE, &rdcc_w0,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(acs_pclass,H5F_ACS_PREEMPT_READ_CHUNKS_NAME,H5F_ACS_PREEMPT_READ_CHUNKS_SIZE, &rdcc_w0,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the threshold for alignment */ - if(H5P_register(acs_pclass,H5F_ACS_ALIGN_THRHD_NAME,H5F_ACS_ALIGN_THRHD_SIZE, &threshold,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(acs_pclass,H5F_ACS_ALIGN_THRHD_NAME,H5F_ACS_ALIGN_THRHD_SIZE, &threshold,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the alignment */ - if(H5P_register(acs_pclass,H5F_ACS_ALIGN_NAME,H5F_ACS_ALIGN_SIZE, &alignment,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(acs_pclass,H5F_ACS_ALIGN_NAME,H5F_ACS_ALIGN_SIZE, &alignment,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the minimum metadata allocation block size */ - if(H5P_register(acs_pclass,H5F_ACS_META_BLOCK_SIZE_NAME,H5F_ACS_META_BLOCK_SIZE_SIZE, &meta_block_size,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(acs_pclass,H5F_ACS_META_BLOCK_SIZE_NAME,H5F_ACS_META_BLOCK_SIZE_SIZE, &meta_block_size,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the maximum sieve buffer size */ - if(H5P_register(acs_pclass,H5F_ACS_SIEVE_BUF_SIZE_NAME,H5F_ACS_SIEVE_BUF_SIZE_SIZE, &sieve_buf_size,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(acs_pclass,H5F_ACS_SIEVE_BUF_SIZE_NAME,H5F_ACS_SIEVE_BUF_SIZE_SIZE, &sieve_buf_size,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the minimum "small data" allocation block size */ - if(H5P_register(acs_pclass,H5F_ACS_SDATA_BLOCK_SIZE_NAME,H5F_ACS_SDATA_BLOCK_SIZE_SIZE, &sdata_block_size,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(acs_pclass,H5F_ACS_SDATA_BLOCK_SIZE_NAME,H5F_ACS_SDATA_BLOCK_SIZE_SIZE, &sdata_block_size,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the garbage collection reference */ - if(H5P_register(acs_pclass,H5F_ACS_GARBG_COLCT_REF_NAME,H5F_ACS_GARBG_COLCT_REF_SIZE, &gc_ref,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(acs_pclass,H5F_ACS_GARBG_COLCT_REF_NAME,H5F_ACS_GARBG_COLCT_REF_SIZE, &gc_ref,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the file driver ID */ - if(H5P_register(acs_pclass,H5F_ACS_FILE_DRV_ID_NAME,H5F_ACS_FILE_DRV_ID_SIZE, &driver_id,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(acs_pclass,H5F_ACS_FILE_DRV_ID_NAME,H5F_ACS_FILE_DRV_ID_SIZE, &driver_id,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the file driver info */ - if(H5P_register(acs_pclass,H5F_ACS_FILE_DRV_INFO_NAME,H5F_ACS_FILE_DRV_INFO_SIZE, &driver_info,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(acs_pclass,H5F_ACS_FILE_DRV_INFO_NAME,H5F_ACS_FILE_DRV_INFO_SIZE, &driver_info,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") /* Register the file close degree */ @@ -375,7 +375,7 @@ H5F_init_interface(void) /* Assume that if there are properties in the class, they are the default ones */ if(nprops==0) { /* Register property of whether symlinks is local to file */ - if(H5P_register(mnt_pclass,H5F_MNT_SYM_LOCAL_NAME,H5F_MNT_SYM_LOCAL_SIZE, &local,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) + if(H5P_register(mnt_pclass,H5F_MNT_SYM_LOCAL_NAME,H5F_MNT_SYM_LOCAL_SIZE, &local,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") } /* end if */ @@ -436,15 +436,15 @@ H5F_term_interface(void) /*---------------------------------------------------------------------------- * Function: H5F_acs_create - * - * Purpose: Callback routine which is called whenever a file access + * + * Purpose: Callback routine which is called whenever a file access * property list is closed. This routine performs any generic * initialization needed on the properties the library put into * the list. - * + * * Return: Success: Non-negative * Failure: Negative - * + * * Programmer: Raymond Lu * Tuesday, Oct 23, 2001 * @@ -453,7 +453,7 @@ H5F_term_interface(void) *---------------------------------------------------------------------------- */ /* ARGSUSED */ -herr_t +herr_t H5F_acs_create(hid_t fapl_id, void UNUSED *copy_data) { hid_t driver_id; @@ -472,7 +472,7 @@ H5F_acs_create(hid_t fapl_id, void UNUSED *copy_data) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get drver ID") if(H5P_get(plist, H5F_ACS_FILE_DRV_INFO_NAME, &driver_info) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get drver info") - + if(driver_id > 0) { /* Set the driver for the property list */ if(H5FD_fapl_open(plist, driver_id, driver_info)<0) @@ -487,7 +487,7 @@ done: /*-------------------------------------------------------------------------- * Function: H5F_acs_copy * - * Purpose: Callback routine which is called whenever a file access + * Purpose: Callback routine which is called whenever a file access * property list is copied. This routine performs any generic * copy needed on the properties. * @@ -496,12 +496,12 @@ done: * Programmer: Raymond Lu * Tuesday, Oct 23, 2001 * - * Modifications: + * Modifications: * *-------------------------------------------------------------------------- - */ + */ /* ARGSUSED */ -herr_t +herr_t H5F_acs_copy(hid_t new_fapl_id, hid_t old_fapl_id, void UNUSED *copy_data) { hid_t driver_id; @@ -522,7 +522,7 @@ H5F_acs_copy(hid_t new_fapl_id, hid_t old_fapl_id, void UNUSED *copy_data) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get drver ID") if(H5P_get(old_plist, H5F_ACS_FILE_DRV_INFO_NAME, &driver_info) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get drver info") - + if(driver_id > 0) { /* Set the driver for the property list */ if(H5FD_fapl_open(new_plist, driver_id, driver_info)<0) @@ -536,24 +536,24 @@ done: /*-------------------------------------------------------------------------- * Function: H5F_acs_close - * - * Purpose: Callback routine which is called whenever a file access - * property list is closed. This routine performs any generic + * + * Purpose: Callback routine which is called whenever a file access + * property list is closed. This routine performs any generic * cleanup needed on the properties. * * Return: Success: Non-negative - * + * * Failure: Negative * * Programmer: Raymond Lu * Tuesday, Oct 23, 2001 - * + * * Modifications: * *--------------------------------------------------------------------------- - */ + */ /* ARGSUSED */ -herr_t +herr_t H5F_acs_close(hid_t fapl_id, void UNUSED *close_data) { hid_t driver_id; @@ -664,7 +664,7 @@ done: DESCRIPTION Encode non-standard (i.e. not 2, 4 or 8-byte) lengths in file meta-data. --------------------------------------------------------------------------*/ -void +void H5F_encode_length_unusual(const H5F_t *f, uint8_t **p, uint8_t *l) { int i = (int)H5F_SIZEOF_SIZE(f)-1; @@ -723,11 +723,11 @@ H5Fget_create_plist(hid_t file_id) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file") if(NULL == (plist = H5I_object(file->shared->fcpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") - + /* Create the property list object to return */ if((ret_value=H5P_copy_plist(plist)) < 0) HGOTO_ERROR(H5E_INTERNAL, H5E_CANTINIT, FAIL, "unable to copy file creation properties") - + done: FUNC_LEAVE_API(ret_value) } @@ -754,14 +754,14 @@ done: * * Modifications: * Raymond Lu, Oct 23, 2001 - * Changed file access property list to the new generic + * Changed file access property list to the new generic * property list. * * Bill Wendling, Apr 21, 2003 * Fixed bug where the driver ID and info in the property * list were being overwritten but the original ID and info * weren't being close. - * + * *------------------------------------------------------------------------- */ hid_t @@ -771,8 +771,8 @@ H5Fget_access_plist(hid_t file_id) H5P_genplist_t *new_plist; /* New property list */ H5P_genplist_t *old_plist; /* Old property list */ hid_t ret_value = SUCCEED; - void *driver_info=NULL; - + void *driver_info=NULL; + FUNC_ENTER_API(H5Fget_access_plist, FAIL) H5TRACE1("i","i",file_id); @@ -835,7 +835,7 @@ H5Fget_access_plist(hid_t file_id) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set file close degree") } else if(f->shared->fc_degree != H5F_CLOSE_DEFAULT && H5P_set(new_plist, H5F_CLOSE_DEGREE_NAME, &(f->shared->fc_degree)) < 0) { HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set file close degree") - } + } done: FUNC_LEAVE_API(ret_value) @@ -845,11 +845,11 @@ done: /*------------------------------------------------------------------------- * Function: H5Fget_obj_count * - * Purpose: Public function returning the number of opened object IDs - * (files, datasets, groups and datatypes) in the same file. + * Purpose: Public function returning the number of opened object IDs + * (files, datasets, groups and datatypes) in the same file. * * Return: Non-negative on success; negative on failure. - * + * * Programmer: Raymond Lu * Wednesday, Dec 5, 2001 * @@ -948,20 +948,20 @@ done: * * Purpose: Private function to return a list of opened object IDs. * - * Return: Non-negative on success; negative on failure. - * - * Programmer: Raymond Lu - * Wednesday, Dec 5, 2001 - * - * Modification: - * + * Return: Non-negative on success; negative on failure. + * + * Programmer: Raymond Lu + * Wednesday, Dec 5, 2001 + * + * Modification: + * *------------------------------------------------------------------------- */ unsigned H5F_get_obj_ids(const H5F_t *f, unsigned types, int max_objs, hid_t *oid_list) { unsigned ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_get_obj_ids) ret_value = H5F_get_objects(f, types, max_objs, oid_list); @@ -973,10 +973,10 @@ H5F_get_obj_ids(const H5F_t *f, unsigned types, int max_objs, hid_t *oid_list) /*--------------------------------------------------------------------------- * Function: H5F_get_objects * - * Purpose: This function is called by H5F_get_obj_count or - * H5F_get_obj_ids to get number of object IDs and/or a + * Purpose: This function is called by H5F_get_obj_count or + * H5F_get_obj_ids to get number of object IDs and/or a * list of opened object IDs (in return value). - * Return: Non-negative on success; negative on failure. + * Return: Non-negative on success; negative on failure. * * Programmer: Raymond Lu * Wednesday, Dec 5, 2001 @@ -1017,28 +1017,28 @@ H5F_get_objects(const H5F_t *f, unsigned types, int max_index, hid_t *obj_id_lis (void)H5I_search(H5I_FILE, H5F_get_objects_cb, &olist); } /* end if */ - /* Search through dataset IDs to count number of datasets, and put their + /* Search through dataset IDs to count number of datasets, and put their * IDs on the object list */ if( (max_index < 0 || (int)olist.list_index < max_index) && (types & H5F_OBJ_DATASET) ) { olist.obj_type = H5I_DATASET; (void)H5I_search(H5I_DATASET, H5F_get_objects_cb, &olist); } - /* Search through group IDs to count number of groups, and put their + /* Search through group IDs to count number of groups, and put their * IDs on the object list */ if( (max_index < 0 || (int)olist.list_index < max_index) && (types & H5F_OBJ_GROUP) ) { olist.obj_type = H5I_GROUP; (void)H5I_search(H5I_GROUP, H5F_get_objects_cb, &olist); } - /* Search through datatype IDs to count number of named datatypes, and put their + /* Search through datatype IDs to count number of named datatypes, and put their * IDs on the object list */ if( (max_index < 0 || (int)olist.list_index < max_index) && (types & H5F_OBJ_DATATYPE) ) { olist.obj_type = H5I_DATATYPE; (void)H5I_search(H5I_DATATYPE, H5F_get_objects_cb, &olist); } - /* Search through attribute IDs to count number of attributes, and put their + /* Search through attribute IDs to count number of attributes, and put their * IDs on the object list */ if( (max_index < 0 || (int)olist.list_index < max_index) && (types & H5F_OBJ_ATTR) ) { olist.obj_type = H5I_ATTR; @@ -1053,9 +1053,9 @@ H5F_get_objects(const H5F_t *f, unsigned types, int max_index, hid_t *obj_id_lis /*------------------------------------------------------------------------- - * Function: H5F_get_objects_cb + * Function: H5F_get_objects_cb * - * Purpose: H5F_get_objects' callback function. It verifies if an + * Purpose: H5F_get_objects' callback function. It verifies if an * object is in the file, and either count it or put its ID * on the list. * @@ -1071,13 +1071,13 @@ H5F_get_objects_cb(void *obj_ptr, hid_t obj_id, void *key) { H5F_olist_t *olist = (H5F_olist_t *)key; /* Alias for search info */ int ret_value = FALSE; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5F_get_objects_cb) assert(obj_ptr); assert(olist); - /* Count file IDs */ + /* Count file IDs */ if(olist->obj_type == H5I_FILE) { if((olist->file_info.local && (!olist->file_info.ptr.file || (olist->file_info.ptr.file && (H5F_t*)obj_ptr == olist->file_info.ptr.file) )) @@ -1121,12 +1121,12 @@ H5F_get_objects_cb(void *obj_ptr, hid_t obj_id, void *key) } if((olist->file_info.local && - ( (!olist->file_info.ptr.file && olist->obj_type==H5I_DATATYPE && H5T_is_immutable((H5T_t*)obj_ptr)==FALSE) - || (!olist->file_info.ptr.file && olist->obj_type!=H5I_DATATYPE) + ( (!olist->file_info.ptr.file && olist->obj_type==H5I_DATATYPE && H5T_is_immutable((H5T_t*)obj_ptr)==FALSE) + || (!olist->file_info.ptr.file && olist->obj_type!=H5I_DATATYPE) || (ent && ent->file == olist->file_info.ptr.file) )) || (!olist->file_info.local && - ((!olist->file_info.ptr.shared && olist->obj_type==H5I_DATATYPE && H5T_is_immutable((H5T_t*)obj_ptr)==FALSE) - || (!olist->file_info.ptr.shared && olist->obj_type!=H5I_DATATYPE) + ((!olist->file_info.ptr.shared && olist->obj_type==H5I_DATATYPE && H5T_is_immutable((H5T_t*)obj_ptr)==FALSE) + || (!olist->file_info.ptr.shared && olist->obj_type!=H5I_DATATYPE) || (ent && ent->file && ent->file->shared == olist->file_info.ptr.shared) ))) { /* Add the object's ID to the ID list, if appropriate */ if(olist->obj_id_list) { @@ -1155,10 +1155,10 @@ done: * Purpose: Returns a pointer to the file handle of the low-level file * driver. * - * Return: Success: non-negative value. + * Return: Success: non-negative value. + * + * Failture: negative. * - * Failture: negative. - * * Programmer: Raymond Lu * Sep. 16, 2002 * @@ -1171,7 +1171,7 @@ H5Fget_vfd_handle(hid_t file_id, hid_t fapl, void **file_handle) { H5F_t *file=NULL; herr_t ret_value; - + FUNC_ENTER_API(H5Fget_vfd_handle, FAIL) H5TRACE3("e","iix",file_id,fapl,file_handle); @@ -1205,7 +1205,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5F_get_vfd_handle(const H5F_t *file, hid_t fapl, void**file_handle) +H5F_get_vfd_handle(const H5F_t *file, hid_t fapl, void**file_handle) { herr_t ret_value; @@ -1361,7 +1361,7 @@ done: * Modifications: * * Raymond Lu, Oct 14, 2001 - * Changed the file creation and access property list to the + * Changed the file creation and access property list to the * new generic property list. * *------------------------------------------------------------------------- @@ -1371,7 +1371,7 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id) { H5F_t *f=NULL, *ret_value; H5P_genplist_t *plist; /* Property list */ - + FUNC_ENTER_NOAPI_NOINIT(H5F_new) if (NULL==(f=H5FL_CALLOC(H5F_t))) @@ -1388,7 +1388,7 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id) f->shared->base_addr = HADDR_UNDEF; f->shared->freespace_addr = HADDR_UNDEF; f->shared->driver_addr = HADDR_UNDEF; - + /* * Copy the file creation and file access property lists into the * new file handle. We do this early because some values might need @@ -1433,7 +1433,7 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get data cache cache size") if(H5P_get(plist, H5F_ACS_PREEMPT_READ_CHUNKS_NAME, &(f->shared->rdcc_w0)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get preempt read chunk") - + if(H5P_get(plist, H5F_ACS_ALIGN_THRHD_NAME, &(f->shared->threshold))<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get alignment threshold") if(H5P_get(plist, H5F_ACS_ALIGN_NAME, &(f->shared->alignment)) < 0) @@ -1461,7 +1461,7 @@ H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id) if(H5F_sfile_add(f->shared) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to append to list of open files") } /* end else */ - + f->shared->nrefs++; /* Set return value */ @@ -1473,7 +1473,7 @@ done: H5FL_FREE(H5F_file_t,f->shared); H5FL_FREE(H5F_t,f); } - + FUNC_LEAVE_NOAPI(ret_value) } @@ -1516,7 +1516,7 @@ static herr_t H5F_dest(H5F_t *f, hid_t dxpl_id) { herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI_NOINIT(H5F_dest) /* Sanity check */ @@ -1570,7 +1570,7 @@ H5F_dest(H5F_t *f, hid_t dxpl_id) /* Destroy shared file struct */ f->shared = H5FL_FREE(H5F_file_t,f->shared); - + } else if (f->shared->nrefs>0) { /* * There are other references to the shared part of the file. @@ -1660,7 +1660,7 @@ H5F_dest(H5F_t *f, hid_t dxpl_id) * arguments would be the same. * * Raymond Lu, 2001-10-14 - * Changed the file creation and access property lists to the + * Changed the file creation and access property lists to the * new generic property list. * * Bill Wendling, 2003-03-18 @@ -1828,7 +1828,7 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d /* * Decide the file close degree. If it's the first time to open the - * file, set the degree to access property list value; if it's the + * file, set the degree to access property list value; if it's the * second time or later, verify the access property list value matches * the degree in shared file structure. */ @@ -1891,10 +1891,10 @@ done: * File struct creation and destruction is through H5F_new() and * H5F_dest(). Writing the root symbol table entry is done with * H5G_encode(). - * + * * Robb Matzke, 1997-08-29 * Moved creation of the boot block to H5F_flush(). - * + * * Robb Matzke, 1997-09-23 * Most of the work is now done by H5F_open() since H5Fcreate() * and H5Fopen() originally contained almost identical code. @@ -1908,9 +1908,9 @@ done: * Robb Matzke, 1999-08-02 * The file creation and file access property lists are passed * to the H5F_open() as object IDs. - * + * * Raymond Lu, 2001-10-14 - * Changed the file creation and access property list to the + * Changed the file creation and access property list to the * new generic property list. * *------------------------------------------------------------------------- @@ -2000,7 +2000,7 @@ done: * File struct creation and destruction is through H5F_new() and * H5F_dest(). Reading the root symbol table entry is done with * H5G_decode(). - * + * * Robb Matzke, 1997-09-23 * Most of the work is now done by H5F_open() since H5Fcreate() * and H5Fopen() originally contained almost identical code. @@ -2088,7 +2088,7 @@ H5Fflush(hid_t object_id, H5F_scope_t scope) H5A_t *attr = NULL; H5G_entry_t *ent = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Fflush, FAIL) H5TRACE2("e","iFs",object_id,scope); @@ -2176,10 +2176,10 @@ done: * Robb Matzke, 1999-08-16 * The driver information block is encoded and either allocated * or written to disk. - * + * * Raymond Lu, 2001-10-14 * Changed to new generic property list. - * + * * Quincey Koziol, 2002-05-20 * Added 'closing' parameter * @@ -2190,7 +2190,7 @@ done: * Quincey Koziol, 2002-06-06 * Return the remainders of the metadata & "small data" blocks to * the free list of blocks for the file. - * + * * Bill Wendling, 2003-03-18 * Modified the flags being passed in to be one flag instead * of several. @@ -2412,16 +2412,16 @@ H5F_try_close(H5F_t *f) * H5F_CLOSE_SEMI: if there are still objects open, return fail; * otherwise, close file. * H5F_CLOSE_STRONG: if there are still objects open, close them - * first, then close file. - */ + * first, then close file. + */ switch(f->shared->fc_degree) { case H5F_CLOSE_WEAK: /* - * If file or object IDS are still open then delay deletion of - * resources until they have all been closed. Flush all + * If file or object IDS are still open then delay deletion of + * resources until they have all been closed. Flush all * caches and update the object header anyway so that failing to * close all objects isn't a major problem. - */ + */ if ((nopen_files + nopen_objs) > 0) HGOTO_DONE(SUCCEED) break; @@ -2465,7 +2465,7 @@ H5F_try_close(H5F_t *f) /* Get the list of IDs of open dataset, group, named datatype & attribute objects */ while((obj_count = H5F_get_obj_ids(f, H5F_OBJ_LOCAL|H5F_OBJ_DATASET|H5F_OBJ_GROUP|H5F_OBJ_DATATYPE|H5F_OBJ_ATTR, (int)(sizeof(objs)/sizeof(objs[0])), objs)) != 0) { - + /* Try to close all the open objects in this file */ for(u = 0; u < obj_count; u++) if(H5I_dec_ref(objs[u]) < 0) @@ -2584,7 +2584,7 @@ H5Freopen(hid_t file_id) H5F_t *old_file=NULL; H5F_t *new_file=NULL; hid_t ret_value; - + FUNC_ENTER_API(H5Freopen, FAIL) H5TRACE1("i","i",file_id); @@ -2989,7 +2989,7 @@ hid_t H5F_get_id(H5F_t *file) { hid_t ret_value; - + FUNC_ENTER_NOAPI_NOINIT(H5F_get_id) assert(file); @@ -3003,7 +3003,7 @@ H5F_get_id(H5F_t *file) if (H5I_inc_ref(file->file_id)<0) HGOTO_ERROR (H5E_ATOM, H5E_CANTSET, FAIL, "incrementing file ID failed") } - + ret_value = file->file_id; done: @@ -3027,7 +3027,7 @@ done: * *------------------------------------------------------------------------- */ -haddr_t +haddr_t H5F_get_base_addr(const H5F_t *f) { /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ @@ -3054,7 +3054,7 @@ H5F_get_base_addr(const H5F_t *f) * *------------------------------------------------------------------------- */ -haddr_t +haddr_t H5F_get_eoa(const H5F_t *f) { haddr_t ret_value; @@ -3098,7 +3098,7 @@ H5F_mpi_get_rank(const H5F_t *f) FUNC_ENTER_NOAPI(H5F_mpi_get_rank, FAIL) assert(f && f->shared); - + /* Dispatch to driver */ if ((ret_value=H5FD_mpi_get_rank(f->shared->lf))<0) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "driver get_rank request failed") @@ -3132,7 +3132,7 @@ H5F_mpi_get_comm(const H5F_t *f) FUNC_ENTER_NOAPI(H5F_mpi_get_comm, MPI_COMM_NULL) assert(f && f->shared); - + /* Dispatch to driver */ if ((ret_value=H5FD_mpi_get_comm(f->shared->lf))==MPI_COMM_NULL) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, MPI_COMM_NULL, "driver get_comm request failed") @@ -3217,7 +3217,7 @@ H5F_sieve_buf_size(const H5F_t *f) * address for the file. * * Errors: - * IO READERROR Low-level read failed. + * IO READERROR Low-level read failed. * * Return: Non-negative on success/Negative on failure * @@ -3272,8 +3272,8 @@ done: * address. * * Errors: - * IO WRITEERROR Low-level write failed. - * IO WRITEERROR No write intent. + * IO WRITEERROR Low-level write failed. + * IO WRITEERROR No write intent. * * Return: Non-negative on success/Negative on failure * @@ -3445,7 +3445,7 @@ H5F_addr_pack(H5F_t UNUSED *f, haddr_t *addr_p/*out*/, #if H5_SIZEOF_LONGcls); @@ -507,7 +507,7 @@ H5FD_sb_encode(H5FD_t *file, char *name/*out*/, uint8_t *buf) if (file->cls->sb_encode && (file->cls->sb_encode)(file, name/*out*/, buf/*out*/)<0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver sb_encode request failed") - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -569,7 +569,7 @@ H5FD_pl_copy(void *(*copy_func)(const void *), size_t pl_size, const void *old_p { void *new_pl = NULL; /* Copy of property list */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5FD_pl_copy) /* Copy old pl, if one exists */ @@ -663,7 +663,7 @@ void * H5FD_fapl_get(H5FD_t *file) { void *ret_value=NULL; - + FUNC_ENTER_NOAPI(H5FD_fapl_get, NULL) assert(file); @@ -697,7 +697,7 @@ H5FD_fapl_open(H5P_genplist_t *plist, hid_t driver_id, const void *driver_info) { void *copied_driver_info; /* Temporary VFL driver info */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_fapl_open, FAIL) /* Increment the reference count on driver and copy driver info */ @@ -739,7 +739,7 @@ H5FD_fapl_copy(hid_t driver_id, const void *old_fapl, void **copied_fapl) { H5FD_class_t *driver=NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_fapl_copy, FAIL) /* Check args */ @@ -782,7 +782,7 @@ H5FD_fapl_close(hid_t driver_id, void *fapl) if(driver_id>0) { if (NULL==(driver=H5I_object(driver_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a driver ID") - + /* Close the driver for the property list */ if(H5FD_pl_close(driver_id,driver->fapl_free,fapl)<0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver fapl_free request failed") @@ -814,7 +814,7 @@ H5FD_dxpl_open(H5P_genplist_t *plist, hid_t driver_id, const void *driver_info) { void *copied_driver_info; /* Temporary VFL driver info */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_dxpl_open, FAIL) /* Increment the reference count on the driver and copy the driver info */ @@ -822,7 +822,7 @@ H5FD_dxpl_open(H5P_genplist_t *plist, hid_t driver_id, const void *driver_info) HGOTO_ERROR (H5E_DATASET, H5E_CANTINC, FAIL, "can't increment VFL driver ID") if(H5FD_dxpl_copy(driver_id, driver_info, &copied_driver_info)<0) HGOTO_ERROR (H5E_DATASET, H5E_CANTCOPY, FAIL, "can't copy VFL driver") - + /* Set the driver information for the new property list */ if(H5P_set(plist, H5D_XFER_VFL_ID_NAME, &driver_id)<0) HGOTO_ERROR (H5E_PLIST, H5E_CANTSET, FAIL, "can't set VFL driver ID") @@ -856,7 +856,7 @@ H5FD_dxpl_copy(hid_t driver_id, const void *old_dxpl, void **copied_dxpl) { H5FD_class_t *driver=NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_dxpl_copy, FAIL) /* Check args */ @@ -899,7 +899,7 @@ H5FD_dxpl_close(hid_t driver_id, void *dxpl) if(driver_id>0) { if (NULL==(driver=H5I_object(driver_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a driver ID") - + /* Close the driver for the property list */ if(H5FD_pl_close(driver_id,driver->dxpl_free,dxpl)<0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver fapl_free request failed") @@ -1001,9 +1001,9 @@ done: * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. * *------------------------------------------------------------------------- @@ -1014,17 +1014,17 @@ H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) H5FD_class_t *driver; H5FD_t *file=NULL; hid_t driver_id = -1; - hsize_t meta_block_size=0; - hsize_t sdata_block_size=0; + hsize_t meta_block_size=0; + hsize_t sdata_block_size=0; H5P_genplist_t *plist; /* Property list pointer */ H5FD_t *ret_value; - + FUNC_ENTER_NOAPI(H5FD_open, NULL) /* Get file access property list */ if(NULL == (plist = H5I_object(fapl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list") - + if (0==maxaddr) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "zero format address range") @@ -1036,7 +1036,7 @@ H5FD_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) HGOTO_ERROR(H5E_VFL, H5E_BADVALUE, NULL, "invalid driver ID in file access property list") if (NULL==driver->open) HGOTO_ERROR(H5E_VFL, H5E_UNSUPPORTED, NULL, "file driver has no `open' method") - + /* Dispatch to file driver */ if (HADDR_UNDEF==maxaddr) maxaddr = driver->maxaddr; @@ -1155,7 +1155,7 @@ H5FD_close(H5FD_t *file) { const H5FD_class_t *driver; herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5FD_close, FAIL) /* check args */ @@ -1281,10 +1281,10 @@ int H5FDcmp(const H5FD_t *f1, const H5FD_t *f2) { int ret_value; - + FUNC_ENTER_API(H5FDcmp, -1) /*return value is arbitrary*/ H5TRACE2("Is","xx",f1,f2); - + ret_value = H5FD_cmp(f1, f2); done: @@ -1365,10 +1365,10 @@ H5FDquery(const H5FD_t *f, unsigned long *flags/*out*/) FUNC_ENTER_API(H5FDquery, FAIL) H5TRACE2("Is","xx",f,flags); - + assert(f); assert(flags); - + ret_value = H5FD_query(f, flags); done: @@ -1401,7 +1401,7 @@ H5FD_query(const H5FD_t *f, unsigned long *flags/*out*/) assert(f); assert(flags); - + /* Check for query driver and call it */ if (f->cls->query) ret_value = (f->cls->query)(f, flags); @@ -1458,7 +1458,7 @@ haddr_t H5FDalloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) { haddr_t ret_value = HADDR_UNDEF; - + FUNC_ENTER_API(H5FDalloc, HADDR_UNDEF) H5TRACE4("a","xMtih",file,type,dxpl_id,size); @@ -1532,7 +1532,7 @@ H5FD_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) if ((ret_value = H5FD_alloc_from_free_list(file, type, mapped_type, size)) != HADDR_UNDEF) HGOTO_DONE(ret_value) - + #ifdef H5F_DEBUG if (H5DEBUG(F)) HDfprintf(H5DEBUG(F), "%s: Could not allocate from freelists\n", FUNC); @@ -1749,7 +1749,7 @@ H5FD_alloc_from_free_list(H5FD_t *file, H5FD_mem_t type, H5F_addr_overlap(ret_value, size, file->accum_loc, file->accum_size)) { ret_value = HADDR_UNDEF; } else { - /* Attempt to allocate memory for temporary node */ + /* Attempt to allocate memory for temporary node */ if((tmp = H5FL_MALLOC(H5FD_free_t))==NULL) HGOTO_ERROR(H5E_VFL, H5E_NOSPACE, HADDR_UNDEF, "free block allocation failed") @@ -2031,7 +2031,7 @@ H5FD_real_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) assert(file->cls); assert(type >= H5FD_MEM_DEFAULT && type < H5FD_MEM_NTYPES); assert(size > 0); - + /* * Dispatch to driver `alloc' callback or extend the end-of-address * marker @@ -2163,7 +2163,7 @@ H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t siz FUNC_ENTER_API(H5FDfree, FAIL) H5TRACE5("e","xMtiah",file,type,dxpl_id,addr,size); - + /* Check args */ if (!file || !file->cls) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer") @@ -2209,7 +2209,7 @@ H5FD_free(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t si { H5FD_mem_t mapped_type; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_free, FAIL) /* Check args */ @@ -2398,7 +2398,7 @@ H5FD_free(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t si /* Check if we increased the size of the largest block on the list */ file->maxsize = MAX(file->maxsize, last->size); - /* Check if this free block is at the end of file allocated space. + /* Check if this free block is at the end of file allocated space. * Truncate it if this is true. */ if(file->cls->get_eoa) { haddr_t eoa; @@ -2414,7 +2414,7 @@ H5FD_free(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t si file->maxsize=0; /*unknown*/ H5FL_FREE(H5FD_free_t, last); } - } + } } else if (file->cls->free) { if ((file->cls->free)(file, type, dxpl_id, addr, size)<0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver free request failed") @@ -2497,12 +2497,12 @@ H5FD_realloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t old_addr, hsi uint8_t _buf[8192]; uint8_t *buf=_buf; haddr_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_realloc, HADDR_UNDEF) if (new_size==old_size) { /*nothing to do*/ - + } else if (0==old_size) { /* allocate memory */ assert(!H5F_addr_defined(old_addr)); @@ -2514,7 +2514,7 @@ H5FD_realloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t old_addr, hsi if(H5FD_free(file, type, dxpl_id, old_addr, old_size)<0) HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, HADDR_UNDEF, "file deallocation request failed") new_addr = HADDR_UNDEF; - + } else if (new_sizecls); - + /* Dispatch to driver */ if (HADDR_UNDEF==(ret_value=(file->cls->get_eoa)(file))) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, HADDR_UNDEF, "driver get_eoa request failed") @@ -2860,7 +2860,7 @@ H5FD_set_eoa(H5FD_t *file, haddr_t addr) assert(file && file->cls); assert(H5F_addr_defined(addr) && addr<=file->maxaddr); - + /* Dispatch to driver */ if ((file->cls->set_eoa)(file, addr)<0) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, FAIL, "driver set_eoa request failed") @@ -2900,7 +2900,7 @@ haddr_t H5FDget_eof(H5FD_t *file) { haddr_t ret_value; - + FUNC_ENTER_API(H5FDget_eof, HADDR_UNDEF) H5TRACE1("a","x",file); @@ -2941,7 +2941,7 @@ H5FD_get_eof(H5FD_t *file) FUNC_ENTER_NOAPI(H5FD_get_eof, HADDR_UNDEF) assert(file && file->cls); - + /* Dispatch to driver */ if (file->cls->get_eof) { if (HADDR_UNDEF==(ret_value=(file->cls->get_eof)(file))) @@ -3269,7 +3269,7 @@ H5FD_write(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, size_t si assert(H5I_GENPROP_LST==H5I_get_type(dxpl_id)); assert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER)); assert(buf); - + #ifndef H5_HAVE_PARALLEL /* Do not return early for Parallel mode since the I/O could be a */ /* collective transfer. */ @@ -3619,7 +3619,7 @@ done: /*-------------------------------------------------------------------------- * Function: H5FDget_vfd_handle * - * Purpose: Returns a pointer to the file handle of low-level virtual + * Purpose: Returns a pointer to the file handle of low-level virtual * file driver. * * Return: Non-negative if succeed; negative otherwise. @@ -3636,7 +3636,7 @@ herr_t H5FDget_vfd_handle(H5FD_t *file, hid_t fapl, void** file_handle) herr_t ret_value; FUNC_ENTER_API(H5FDget_vfd_handle, FAIL) - + /* Check arguments */ assert(file); assert(file_handle); @@ -3653,7 +3653,7 @@ done: * Purpose: Retrieve the file handle for file driver. * * Return: Non-negative if succeed; negative if fails. - * + * * Programmer: Raymond Lu * Sep. 16, 2002 * @@ -3664,7 +3664,7 @@ done: herr_t H5FD_get_vfd_handle(H5FD_t *file, hid_t fapl, void** file_handle) { herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5FD_get_vfd_handle, FAIL) assert(file_handle); @@ -3673,7 +3673,7 @@ herr_t H5FD_get_vfd_handle(H5FD_t *file, hid_t fapl, void** file_handle) done: FUNC_LEAVE_NOAPI(ret_value) -} +} /*------------------------------------------------------------------------- diff --git a/src/H5FDcore.c b/src/H5FDcore.c index 11d5cd3..91406e3 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -65,7 +65,7 @@ typedef struct H5FD_core_fapl_t { /* * These macros check for overflow of various quantities. These macros * assume that file_offset_t is signed and haddr_t and size_t are unsigned. - * + * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' * is too large to be represented by the second argument * of the file seek function. @@ -137,7 +137,7 @@ NAME H5FD_core_init_interface -- Initialize interface-specific information USAGE herr_t H5FD_core_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -221,7 +221,7 @@ H5FD_core_term(void) * Purpose: Modify the file access property list to use the H5FD_CORE * driver defined in this source file. The INCREMENT specifies * how much to grow the memory each time we need more. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke @@ -277,7 +277,7 @@ done: * Modifications: * Robb Matzke, 1999-10-19 * Added the BACKING_STORE argument. - * + * * Raymond Lu * 2001-10-25 * Changed file access list to the new generic property list. @@ -301,12 +301,12 @@ H5Pget_fapl_core(hid_t fapl_id, size_t *increment/*out*/, HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "incorrect VFL driver") if (NULL==(fa=H5P_get_driver_info(plist))) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "bad VFL driver info") - + if (increment) *increment = fa->increment; if (backing_store) *backing_store = fa->backing_store; - + done: FUNC_LEAVE_API(ret_value) } @@ -381,7 +381,7 @@ H5FD_core_open(const char *name, unsigned UNUSED flags, hid_t fapl_id, H5FD_t *ret_value; FUNC_ENTER_NOAPI(H5FD_core_open, NULL) - + /* Check arguments */ if (!(H5F_ACC_CREAT & flags)) HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, NULL, "must create core files, not open them") @@ -499,7 +499,7 @@ H5FD_core_cmp(const H5FD_t *_f1, const H5FD_t *_f2) HGOTO_DONE(1) HGOTO_DONE(0) } - + if (NULL==f1->name) HGOTO_DONE(-1) if (NULL==f2->name) @@ -536,7 +536,7 @@ H5FD_core_get_eoa(H5FD_t *_file) haddr_t ret_value; /* Return value */ H5FD_core_t *file = (H5FD_core_t*)_file; - + FUNC_ENTER_NOAPI(H5FD_core_get_eoa, HADDR_UNDEF) /* Set return value */ @@ -622,25 +622,25 @@ done: /*------------------------------------------------------------------------- * Function: H5FD_core_get_handle - * + * * Purpose: Returns the file handle of CORE file driver. - * + * * Returns: Non-negative if succeed or negative if fails. - * + * * Programmer: Raymond Lu * Sept. 16, 2002 - * - * Modifications: - * + * + * Modifications: + * *------------------------------------------------------------------------- */ /* ARGSUSED */ static herr_t H5FD_core_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) -{ +{ H5FD_core_t *file = (H5FD_core_t *)_file; herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5FD_core_get_handle, FAIL) if(!file_handle) @@ -648,9 +648,9 @@ H5FD_core_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) *file_handle = &(file->mem); -done: +done: FUNC_LEAVE_NOAPI(ret_value) -} +} /*------------------------------------------------------------------------- @@ -679,7 +679,7 @@ H5FD_core_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, hadd { H5FD_core_t *file = (H5FD_core_t*)_file; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_core_read, FAIL) assert(file && file->pub.cls); @@ -746,7 +746,7 @@ H5FD_core_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, had { H5FD_core_t *file = (H5FD_core_t*)_file; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_core_write, FAIL) assert(file && file->pub.cls); @@ -814,7 +814,7 @@ H5FD_core_flush(H5FD_t *_file, hid_t UNUSED dxpl_id, unsigned UNUSED closing) { H5FD_core_t *file = (H5FD_core_t*)_file; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_core_flush, FAIL) /* Write to backing store */ diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index 83fe5a2..90f7697 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -30,7 +30,7 @@ * (actually, this happens when the file family is flushed, and * can be quite time consuming on file systems that don't * implement holes, like nfs). - * + * */ /* Interface initialization */ @@ -138,7 +138,7 @@ NAME H5FD_family_init_interface -- Initialize interface-specific information USAGE herr_t H5FD_family_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -234,9 +234,9 @@ H5FD_family_term(void) * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. * *------------------------------------------------------------------------- @@ -247,10 +247,10 @@ H5Pset_fapl_family(hid_t fapl_id, hsize_t memb_size, hid_t memb_fapl_id) herr_t ret_value; H5FD_family_fapl_t fa; H5P_genplist_t *plist; /* Property list pointer */ - + FUNC_ENTER_API(H5Pset_fapl_family, FAIL) H5TRACE3("e","ihi",fapl_id,memb_size,memb_fapl_id); - + /* Check arguments */ if(TRUE != H5P_isa_class(fapl_id, H5P_FILE_ACCESS)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") @@ -291,9 +291,9 @@ done: * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. * *------------------------------------------------------------------------- @@ -305,7 +305,7 @@ H5Pget_fapl_family(hid_t fapl_id, hsize_t *memb_size/*out*/, H5FD_family_fapl_t *fa; H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Pget_fapl_family, FAIL) H5TRACE3("e","ixx",fapl_id,memb_size,memb_fapl_id); @@ -567,9 +567,9 @@ done: * Raymond Lu * Thursday, November 18, 2004 * When file is re-opened, member size passed in from access property - * is checked to see if it's reasonable. If there is only 1 member - * file, member size can't be smaller than current member size. - * If there are at least 2 member files, member size can only be equal + * is checked to see if it's reasonable. If there is only 1 member + * file, member size can't be smaller than current member size. + * If there are at least 2 member files, member size can only be equal * the 1st member size. * *------------------------------------------------------------------------- @@ -621,7 +621,7 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, } file->name = H5MM_strdup(name); file->flags = flags; - + /* Check that names are unique */ sprintf(memb_name, name, 0); sprintf(temp, name, 1); @@ -642,7 +642,7 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, file->amembs = n; file->memb = x; } - + /* * Attempt to open file. If the first file cannot be opened then fail; * otherwise an open failure means that we've reached the last member. @@ -661,23 +661,23 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, file->nmembs++; } - /* - * Get file size of the first 2 member files if exist. Check if user sets - * reasonable member size. + /* + * Get file size of the first 2 member files if exist. Check if user sets + * reasonable member size. */ if(HADDR_UNDEF==(eof1 = H5FD_get_eof(file->memb[0]))) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, NULL, "file get eof1 request failed") if(file->memb[1] && (HADDR_UNDEF==(eof2 = H5FD_get_eof(file->memb[1])))) HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, NULL, "file get eof2 request failed") - - if(eof1 && (eof2==HADDR_UNDEF || !eof2)) { - /* If there is only 1 member file, new member size can't be smaller than - * current member size. + + if(eof1 && (eof2==HADDR_UNDEF || !eof2)) { + /* If there is only 1 member file, new member size can't be smaller than + * current member size. */ if(file->memb_sizememb_size = eof1; - } else if(eof1 && eof2) { - /* If there are at least 2 member files, new member size can only be equal + } else if(eof1 && eof2) { + /* If there are at least 2 member files, new member size can only be equal * to the 1st member size */ file->memb_size = eof1; @@ -793,7 +793,7 @@ H5FD_family_cmp(const H5FD_t *_f1, const H5FD_t *_f2) assert(f1->nmembs>=1 && f1->memb[0]); assert(f2->nmembs>=1 && f2->memb[0]); - + ret_value= H5FDcmp(f1->memb[0], f2->memb[0]); done: @@ -830,7 +830,7 @@ H5FD_family_query(const H5FD_t UNUSED * _f, unsigned long *flags /* out */) if(flags) { *flags=0; *flags|=H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */ - /**flags|=H5FD_FEAT_ACCUMULATE_METADATA;*/ /* OK to accumulate metadata for faster writes. + /**flags|=H5FD_FEAT_ACCUMULATE_METADATA;*/ /* OK to accumulate metadata for faster writes. * - Turn it off temporarily because there's a bug * when trying to flush metadata during closing. */ *flags|=H5FD_FEAT_DATA_SIEVE; /* OK to perform data sieving for faster raw data reads & writes */ @@ -928,7 +928,7 @@ H5FD_family_set_eoa(H5FD_t *_file, haddr_t eoa) if (NULL==file->memb[u]) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to open member file") } - + /* Set the EOA marker for the member */ H5_CHECK_OVERFLOW(file->memb_size,hsize_t,haddr_t); if (addr>(haddr_t)file->memb_size) { @@ -1007,27 +1007,27 @@ done: /*------------------------------------------------------------------------- * Function: H5FD_family_get_handle - * + * * Purpose: Returns the file handle of FAMILY file driver. - * + * * Returns: Non-negative if succeed or negative if fails. - * + * * Programmer: Raymond Lu * Sept. 16, 2002 - * + * * Modifications: - * + * *------------------------------------------------------------------------- - */ -static herr_t + */ +static herr_t H5FD_family_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) -{ +{ H5FD_family_t *file = (H5FD_family_t *)_file; H5P_genplist_t *plist; hsize_t offset; int memb; herr_t ret_value; - + FUNC_ENTER_NOAPI(H5FD_family_get_handle, FAIL) /* Get the plist structure and family offset */ @@ -1103,7 +1103,7 @@ H5FD_family_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, si sub = addr % file->memb_size; /* This check is for mainly for IA32 architecture whose size_t's size - * is 4 bytes, to prevent overflow when user application is trying to + * is 4 bytes, to prevent overflow when user application is trying to * write files bigger than 4GB. */ tempreq = file->memb_size-sub; if(tempreq > SIZET_MAX) @@ -1180,7 +1180,7 @@ H5FD_family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, s sub = addr % file->memb_size; /* This check is for mainly for IA32 architecture whose size_t's size - * is 4 bytes, to prevent overflow when user application is trying to + * is 4 bytes, to prevent overflow when user application is trying to * write files bigger than 4GB. */ tempreq = file->memb_size-sub; if(tempreq > SIZET_MAX) diff --git a/src/H5FDgass.c b/src/H5FDgass.c index e0e2a42..4414291 100644 --- a/src/H5FDgass.c +++ b/src/H5FDgass.c @@ -63,8 +63,8 @@ typedef struct H5FD_gass_t { haddr_t eof; /*end of file; current file size*/ haddr_t pos; /*current file I/O position */ int op; /*last operation */ - - + + } H5FD_gass_t; /* @@ -101,7 +101,7 @@ typedef struct H5FD_gass_t { /* * These macros check for overflow of various quantities. These macros * assume that file_offset_t is signed and haddr_t and size_t are unsigned. - * + * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' * is too large to be represented by the second argument * of the file seek function. @@ -180,7 +180,7 @@ NAME H5FD_gass_init_interface -- Initialize interface-specific information USAGE herr_t H5FD_gass_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -266,7 +266,7 @@ H5FD_gass_term(void) * * Purpose: Store the user supplied GASS INFO in * the file access property list FAPL_ID which can then be used - * to create and/or open the file. + * to create and/or open the file. * * GASS info object to be used for file open using GASS. * Any modification to info after @@ -295,10 +295,10 @@ H5Pset_fapl_gass(hid_t fapl_id, GASS_Info info) H5FD_gass_fapl_t fa; H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value; - + FUNC_ENTER_API(H5Pset_fapl_gass, FAIL) /*NO TRACE*/ - + /* Check arguments */ if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list") @@ -324,8 +324,8 @@ done: * driver then this function returns the GASS info object * through the INFO pointer. * - * Return: Success: Non-negative with the info object returned - * through the INFO arguments if non-null. + * Return: Success: Non-negative with the info object returned + * through the INFO arguments if non-null. * The information is copied and it is therefore * valid only until the file access property * list is modified or closed. @@ -348,7 +348,7 @@ H5Pget_fapl_gass(hid_t fapl_id, GASS_Info *info/*out*/) H5FD_gass_fapl_t *fa; H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Pget_fapl_gass, FAIL) H5TRACE2("e","ix",fapl_id,info); @@ -402,7 +402,7 @@ H5FD_gass_open(const char *name, unsigned flags, hid_t fapl_id, H5P_genplist_t *plist; /* Property list pointer */ h5_stat_t sb; H5FD_t *ret_value; - + FUNC_ENTER_NOAPI(H5FD_gass_open, NULL) /* fprintf(stdout, "Entering H5FD_gass_open name=%s flags=0x%x\n", name, flags); */ @@ -416,7 +416,7 @@ H5FD_gass_open(const char *name, unsigned flags, hid_t fapl_id, HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, NULL, "bogus maxaddr") strcpy (filename, name); - + /* Obtain a pointer to gass-specific file access properties */ if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list") @@ -429,18 +429,18 @@ H5FD_gass_open(const char *name, unsigned flags, hid_t fapl_id, fa = H5P_get_driver_info(plist); assert(fa); } - + /* When I come down here, the possible flag values and the correct responses are given here :- - 1. H5F_ACC_CREAT | H5F_ACC_RDWR | H5F_ACC_EXCL : The file is - a new one. Go ahead and open it in O_RDWR. + 1. H5F_ACC_CREAT | H5F_ACC_RDWR | H5F_ACC_EXCL : The file is + a new one. Go ahead and open it in O_RDWR. 2. H5F_ACC_CREAT | H5F_ACC_RDWR | H5F_ACC_TRUNC : Use O_RDWR | O_TRUNC with gass_open. 3. H5F_ACC_RDWR | H5F_ACC_TRUNC : File already exists. Truncate it. - + 4. H5F_ACC_RDWR : Use O_RDWR with gass_open 5. H5F_ACC_RDWR is not set : Use O_RDONLY with gass_open @@ -449,7 +449,7 @@ H5FD_gass_open(const char *name, unsigned flags, hid_t fapl_id, is that gass_open does not support many of them (e.g., O_CREAT) */ - + if ((flags & H5F_ACC_CREAT) && (flags & H5F_ACC_RDWR) && (flags & H5F_ACC_EXCL)) { if ((fd = globus_gass_open (filename, O_RDWR|O_TRUNC)) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTOPENFILE, NULL, "open failed") @@ -457,24 +457,24 @@ H5FD_gass_open(const char *name, unsigned flags, hid_t fapl_id, else if ((flags & H5F_ACC_CREAT) && (flags & H5F_ACC_RDWR) && (flags & H5F_ACC_TRUNC)) { if ((fd = globus_gass_open (filename, O_RDWR|O_TRUNC)) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTOPENFILE, NULL, "open failed") - + } else if ((flags & H5F_ACC_RDWR) && (flags & H5F_ACC_TRUNC)) { if ((fd = globus_gass_open (filename, O_RDWR|O_TRUNC)) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTOPENFILE, NULL, "open failed") - + } else if (flags & H5F_ACC_RDWR) { if ((fd = globus_gass_open (filename, O_RDWR)) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTOPENFILE, NULL, "open failed") - + } else { /* This is case where H5F_ACC_RDWR is not set */ if ((fd = globus_gass_open (filename, O_RDONLY)) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTOPENFILE, NULL, "open failed") - + } - + if (HDfstat(fd, &sb)<0) { close(fd); HGOTO_ERROR(H5E_IO, H5E_BADFILE, NULL, "fstat failed") @@ -491,7 +491,7 @@ H5FD_gass_open(const char *name, unsigned flags, hid_t fapl_id, /* Set return value */ ret_value=(H5FD_t*)file; - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -523,7 +523,7 @@ H5FD_gass_close (H5FD_t *_file) if (file == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file handle") - + if (globus_gass_close (file->fd) < 0) HGOTO_ERROR(H5E_IO, H5E_CANTCLOSEFILE, FAIL, "can't close GASS file") @@ -673,24 +673,24 @@ done: /*------------------------------------------------------------------------- * Function: H5FD_gass_get_handle - * + * * Purpose: Returns the file handle of GASS file driver. - * + * * Returns: Non-negative if succeed or negative if fails. - * + * * Programmer: Raymond Lu * Sept. 16, 2002 - * - * Modifications: - * + * + * Modifications: + * *------------------------------------------------------------------------- */ static herr_t H5FD_gass_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) -{ +{ H5FD_gass_t *file = (H5FD_gass_t *)_file; herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5FD_gass_get_handle, FAIL) if(!file_handle) @@ -698,10 +698,10 @@ H5FD_gass_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) *file_handle = &(file->fd); -done: +done: FUNC_LEAVE_NOAPI(ret_value) -} - +} + /*------------------------------------------------------------------------- * Function: H5FD_gass_read @@ -755,7 +755,7 @@ H5FD_gass_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id/*unused*/, h * and the end of the file. */ while (size>0) { - do + do nbytes = read(file->fd, buf, size); while (-1==nbytes && EINTR==errno); diff --git a/src/H5FDgass.h b/src/H5FDgass.h index 1d599a0..1950048 100644 --- a/src/H5FDgass.h +++ b/src/H5FDgass.h @@ -26,11 +26,11 @@ #include -#ifdef H5_HAVE_GASS +#ifdef H5_HAVE_GASS #define H5FD_GASS (H5FD_gass_init()) #else #define H5FD_GASS (-1) -#endif +#endif #ifdef H5_HAVE_GASS /* Define the GASS info object. (Will be added to later as more GASS diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 91914ee..03796f3 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -150,7 +150,7 @@ typedef struct H5FD_log_t { /* * These macros check for overflow of various quantities. These macros * assume that file_offset_t is signed and haddr_t and size_t are unsigned. - * + * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' * is too large to be represented by the second argument * of the file seek function. @@ -242,7 +242,7 @@ NAME H5FD_log_init_interface -- Initialize interface-specific information USAGE herr_t H5FD_log_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -327,7 +327,7 @@ H5FD_log_term(void) * Purpose: Modify the file access property list to use the H5FD_LOG * driver defined in this source file. There are no driver * specific properties. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke @@ -338,7 +338,7 @@ H5FD_log_term(void) * * Raymond Lu, 2001-10-25 * Changed the file access list to the new generic property list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -350,7 +350,7 @@ H5Pset_fapl_log(hid_t fapl_id, const char *logfile, int verbosity) FUNC_ENTER_API(H5Pset_fapl_log, FAIL) H5TRACE3("e","isIs",fapl_id,logfile,verbosity); - + if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") @@ -374,7 +374,7 @@ done: * Purpose: Modify the file access property list to use the H5FD_LOG * driver defined in this source file. There are no driver * specific properties. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke @@ -385,7 +385,7 @@ done: * * Raymond Lu, 2001-10-25 * Changed the file access list to the new generic property list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -397,10 +397,10 @@ H5Pset_fapl_log(hid_t fapl_id, const char *logfile, unsigned flags, size_t buf_s FUNC_ENTER_API(H5Pset_fapl_log, FAIL) H5TRACE4("e","isIuz",fapl_id,logfile,flags,buf_size); - + if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - + fa.logfile=(char*)logfile; fa.flags=flags; fa.buf_size=buf_size; @@ -469,7 +469,7 @@ H5FD_log_fapl_copy(const void *_old_fa) const H5FD_log_fapl_t *old_fa = (const H5FD_log_fapl_t*)_old_fa; H5FD_log_fapl_t *new_fa = H5MM_malloc(sizeof(H5FD_log_fapl_t)); void *ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_log_fapl_copy, NULL) assert(new_fa); @@ -1025,36 +1025,36 @@ done: /*------------------------------------------------------------------------- * Function: H5FD_log_get_handle - * + * * Purpose: Returns the file handle of LOG file driver. - * + * * Returns: Non-negative if succeed or negative if fails. - * + * * Programmer: Raymond Lu * Sept. 16, 2002 - * - * Modifications: - * + * + * Modifications: + * *------------------------------------------------------------------------- */ /* ARGSUSED */ static herr_t H5FD_log_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) -{ +{ H5FD_log_t *file = (H5FD_log_t *)_file; herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5FD_log_get_handle, FAIL) if(!file_handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid") *file_handle = &(file->fd); - -done: + +done: FUNC_LEAVE_NOAPI(ret_value) -} - +} + /*------------------------------------------------------------------------- * Function: H5FD_log_read @@ -1083,7 +1083,7 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr H5FD_log_t *file = (H5FD_log_t*)_file; ssize_t nbytes; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_log_read, FAIL) assert(file && file->pub.cls); @@ -1160,7 +1160,7 @@ H5FD_log_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr addr += (haddr_t)nbytes; buf = (char*)buf + nbytes; } - + /* Update current position */ file->pos = addr; file->op = OP_READ; @@ -1202,7 +1202,7 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t add struct timeval timeval_diff; #endif /* H5_HAVE_GETTIMEOFDAY */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_log_write, FAIL) assert(file && file->pub.cls); @@ -1214,13 +1214,13 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t add assert(type==H5FD_MEM_DEFAULT || type==(H5FD_mem_t)file->flavor[(addr+size)-1] || (H5FD_mem_t)file->flavor[(addr+size)-1]==H5FD_MEM_DEFAULT); /* Check for overflow conditions */ - if (HADDR_UNDEF==addr) + if (HADDR_UNDEF==addr) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "addr undefined") if (REGION_OVERFLOW(addr, size)) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow") if (addr+size>file->eoa) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow") - + /* Log the I/O information about the write */ if(file->fa.flags&H5FD_LOG_FILE_WRITE) { size_t tmp_size=size; @@ -1261,7 +1261,7 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t add } /* end if */ HDfprintf(file->logfp," (%f s)\n",(double)timeval_diff.tv_sec+((double)timeval_diff.tv_usec/(double)1000000.0)); } /* end if */ - else + else HDfprintf(file->logfp,"\n"); #else /* H5_HAVE_GETTIMEOFDAY */ HDfprintf(file->logfp,"Seek: From %10a To %10a\n",file->pos,addr); @@ -1301,7 +1301,7 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t add if(file->fa.flags&H5FD_LOG_TIME_WRITE) HDgettimeofday(&timeval_stop,NULL); #endif /* H5_HAVE_GETTIMEOFDAY */ - + /* Log information about the write */ if(file->fa.flags&H5FD_LOG_LOC_WRITE) { /* Output the flavor information, if desired */ diff --git a/src/H5FDmpi.c b/src/H5FDmpi.c index 671eccb..2c1e526 100644 --- a/src/H5FDmpi.c +++ b/src/H5FDmpi.c @@ -62,7 +62,7 @@ H5FD_mpi_get_rank(const H5FD_t *file) assert(file && cls); assert(cls->get_rank); /* All MPI drivers must implement this */ - + /* Dispatch to driver */ if ((ret_value=(cls->get_rank)(file))<0) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "driver get_rank request failed") @@ -98,7 +98,7 @@ H5FD_mpi_get_size(const H5FD_t *file) assert(file && cls); assert(cls->get_size); /* All MPI drivers must implement this */ - + /* Dispatch to driver */ if ((ret_value=(cls->get_size)(file))<0) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, FAIL, "driver get_size request failed") @@ -134,7 +134,7 @@ H5FD_mpi_get_comm(const H5FD_t *file) assert(file && cls); assert(cls->get_comm); /* All MPI drivers must implement this */ - + /* Dispatch to driver */ if ((ret_value=(cls->get_comm)(file))==MPI_COMM_NULL) HGOTO_ERROR(H5E_VFL, H5E_CANTGET, MPI_COMM_NULL, "driver get_comm request failed") @@ -151,7 +151,7 @@ done: * * Return: Success: The haddr_t equivalent of the MPI_OFF * argument. - * + * * Failure: HADDR_UNDEF * * Programmer: Unknown @@ -164,7 +164,7 @@ done: * * Robb Matzke, 1999-08-06 * Modified to work with the virtual file layer. - *------------------------------------------------------------------------- + *------------------------------------------------------------------------- */ haddr_t H5FD_mpi_MPIOff_to_haddr(MPI_Offset mpi_off) @@ -255,7 +255,7 @@ H5FD_mpi_comm_info_dup(MPI_Comm comm, MPI_Info info, MPI_Comm *comm_new, MPI_Inf MPI_Comm comm_dup=MPI_COMM_NULL; MPI_Info info_dup=MPI_INFO_NULL; int mpi_code; - + FUNC_ENTER_NOAPI(H5FD_mpi_comm_info_dup, FAIL) /* Check arguments */ @@ -297,7 +297,7 @@ done: * * Purpose: Free the communicator and Info object. * If comm or info is in fact MPI_COMM_NULL or MPI_INFO_NULL - * respectively, no action occurs to it. + * respectively, no action occurs to it. * * Return: Success: Non-negative. The values the pointers refer * to will be set to the corresponding NULL @@ -381,7 +381,7 @@ H5FD_mpio_wait_for_left_neighbor(H5FD_t *_file) file->mpi_rank-1, MPI_ANY_TAG, file->comm, &rcvstat ))) HMPI_GOTO_ERROR(FAIL, "MPI_Recv failed", mpi_code) } - + done: FUNC_LEAVE_NOAPI(ret_value) } diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index f46bf9e..c8da1a6 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -155,7 +155,7 @@ NAME H5FD_mpio_init_interface -- Initialize interface-specific information USAGE herr_t H5FD_mpio_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -217,7 +217,7 @@ H5FD_mpio_init(void) H5FD_mpio_Debug_inited++; } #endif /* H5FDmpio_DEBUG */ - + /* Set return value */ ret_value=H5FD_MPIO_g; @@ -300,7 +300,7 @@ H5FD_mpio_term(void) * Modified to work with the virtual file layer. * * Raymond Lu, 2001-10-23 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. * * Albert Cheng, 2003-04-17 @@ -317,7 +317,7 @@ H5Pset_fapl_mpio(hid_t fapl_id, MPI_Comm comm, MPI_Info info) H5FD_mpio_fapl_t fa; H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value; - + FUNC_ENTER_API(H5Pset_fapl_mpio, FAIL) H5TRACE3("e","iMcMi",fapl_id,comm,info); @@ -372,7 +372,7 @@ done: * read/write calls. * * Raymond Lu, 2001-10-23 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. * * Albert Cheng, 2003-04-17 @@ -388,7 +388,7 @@ H5Pget_fapl_mpio(hid_t fapl_id, MPI_Comm *comm/*out*/, MPI_Info *info/*out*/) MPI_Comm comm_tmp=MPI_COMM_NULL; int mpi_code; /* mpi return code */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Pget_fapl_mpio, FAIL) H5TRACE3("e","ixx",fapl_id,comm,info); @@ -407,7 +407,7 @@ H5Pget_fapl_mpio(hid_t fapl_id, MPI_Comm *comm/*out*/, MPI_Info *info/*out*/) if (MPI_SUCCESS != (mpi_code=MPI_Comm_dup(fa->comm, &comm_tmp))) HMPI_GOTO_ERROR(FAIL, "MPI_Comm_dup failed", mpi_code) } - + if (info){ if (MPI_INFO_NULL != fa->info){ if (MPI_SUCCESS != (mpi_code=MPI_Info_dup(fa->info, info))) @@ -444,7 +444,7 @@ done: * * H5FD_MPIO_COLLECTIVE: * Use collective I/O access. - * + * * Return: Success: Non-negative * * Failure: Negative @@ -465,7 +465,7 @@ H5Pset_dxpl_mpio(hid_t dxpl_id, H5FD_mpio_xfer_t xfer_mode) FUNC_ENTER_API(H5Pset_dxpl_mpio, FAIL) H5TRACE2("e","iDt",dxpl_id,xfer_mode); - + if(dxpl_id==H5P_DEFAULT) HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't set values in default property list") @@ -601,7 +601,7 @@ H5FD_mpio_fapl_copy(const void *_old_fa) void *ret_value = NULL; const H5FD_mpio_fapl_t *old_fa = (const H5FD_mpio_fapl_t*)_old_fa; H5FD_mpio_fapl_t *new_fa = NULL; - + FUNC_ENTER_NOAPI(H5FD_mpio_fapl_copy, NULL) #ifdef H5FDmpio_DEBUG if (H5FD_mpio_Debug[(int)'t']) @@ -692,7 +692,7 @@ fprintf(stderr, "leaving H5FD_mpio_fapl_free\n"); * * Failure: NULL * - * Programmer: + * Programmer: * January 30, 1998 * * Modifications: @@ -710,7 +710,7 @@ fprintf(stderr, "leaving H5FD_mpio_fapl_free\n"); * Added barrier after MPI_File_set_size to prevent race * condition -- subsequent writes were being truncated, causing * holes in file. - * + * * Robb Matzke, 1999-08-06 * Modified to work with the virtual file layer. * @@ -1087,26 +1087,26 @@ done: /*------------------------------------------------------------------------- * Function: H5FD_mpio_get_handle - * + * * Purpose: Returns the file handle of MPIO file driver. - * + * * Returns: Non-negative if succeed or negative if fails. - * + * * Programmer: Raymond Lu * Sept. 16, 2002 - * + * * Modifications: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5FD_mpio_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) -{ +{ H5FD_mpio_t *file = (H5FD_mpio_t *)_file; herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5FD_mpio_get_handle, FAIL) - + if(!file_handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid") @@ -1115,7 +1115,7 @@ H5FD_mpio_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) done: FUNC_LEAVE_NOAPI(ret_value) } - + /*------------------------------------------------------------------------- * Function: H5FD_mpio_read @@ -1159,7 +1159,7 @@ done: * * Robb Matzke, 1999-07-28 * The ADDR argument is passed by value. - * + * * Robb Matzke, 1999-08-06 * Modified to work with the virtual file layer. * @@ -1240,7 +1240,7 @@ H5FD_mpio_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id, haddr_t add if(NULL == (plist = H5I_object(dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") xfer_mode=(H5FD_mpio_xfer_t)H5P_peek_unsigned(plist, H5D_XFER_IO_XFER_MODE_NAME); - + /* * Set up for a fancy xfer using complex types, or single byte block. We * wouldn't need to rely on the use_view field if MPI semantics allowed @@ -1412,7 +1412,7 @@ done: * * Kim Yates, Pat Weidhaas, 2000-09-26 * Move block of coding where only p0 writes after the - * MPI_File_set_view call. + * MPI_File_set_view call. * * Quincey Koziol, 2002-05-10 * Instead of always writing metadata from process 0, spread the @@ -1498,7 +1498,7 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, /* Obtain the data transfer properties */ if(NULL == (plist = H5I_object(dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") - + if(type==H5FD_MEM_DRAW) { H5FD_mpio_xfer_t xfer_mode; /* I/O tranfer mode */ @@ -1614,7 +1614,7 @@ H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, /* Forget the EOF value (see H5FD_mpio_get_eof()) --rpm 1999-08-06 */ file->eof = HADDR_UNDEF; - + done: /* if only one process writes, need to broadcast the ret_value to other processes */ if (type!=H5FD_MEM_DRAW) { @@ -1655,7 +1655,7 @@ done: * allocated byte. * * Quincey Koziol, 2002-06-?? - * Changed file extension method to use MPI_File_set_size instead + * Changed file extension method to use MPI_File_set_size instead * read->write method. * *------------------------------------------------------------------------- diff --git a/src/H5FDmpiposix.c b/src/H5FDmpiposix.c index 294b13e..6ab8912 100644 --- a/src/H5FDmpiposix.c +++ b/src/H5FDmpiposix.c @@ -150,7 +150,7 @@ typedef struct H5FD_mpiposix_t { /* * These macros check for overflow of various quantities. These macros * assume that file_offset_t is signed and haddr_t and size_t are unsigned. - * + * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' * is too large to be represented by the second argument * of the file seek function. @@ -243,7 +243,7 @@ NAME H5FD_mpiposix_init_interface -- Initialize interface-specific information USAGE herr_t H5FD_mpiposix_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -358,7 +358,7 @@ H5Pset_fapl_mpiposix(hid_t fapl_id, MPI_Comm comm) H5FD_mpiposix_fapl_t fa; H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value; - + FUNC_ENTER_API(H5Pset_fapl_mpiposix, FAIL) H5TRACE2("e","iMc",fapl_id,comm); @@ -389,7 +389,7 @@ done: * of the application to free the returned communicator. * * Return: Success: Non-negative with the communicator and - * information returned through the COMM + * information returned through the COMM * argument if non-null. Since it is a duplicate * of the stored object, future modifications to * the access property list do not affect it and @@ -417,7 +417,7 @@ H5Pget_fapl_mpiposix(hid_t fapl_id, MPI_Comm *comm/*out*/) H5P_genplist_t *plist; /* Property list pointer */ int mpi_code; /* mpi return code */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Pget_fapl_mpiposix, FAIL) H5TRACE2("e","ix",fapl_id,comm); @@ -479,7 +479,7 @@ H5Pset_fapl_mpiposix(hid_t fapl_id, MPI_Comm comm, hbool_t use_gpfs) H5FD_mpiposix_fapl_t fa; H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value; - + FUNC_ENTER_API(H5Pset_fapl_mpiposix, FAIL) H5TRACE3("e","iMcb",fapl_id,comm,use_gpfs); @@ -510,7 +510,7 @@ done: * of the application to free the returned communicator. * * Return: Success: Non-negative with the communicator and - * information returned through the COMM + * information returned through the COMM * argument if non-null. Since it is a duplicate * of the stored object, future modifications to * the access property list do not affect it and @@ -538,7 +538,7 @@ H5Pget_fapl_mpiposix(hid_t fapl_id, MPI_Comm *comm/*out*/, hbool_t *use_gpfs/*ou H5P_genplist_t *plist; /* Property list pointer */ int mpi_code; /* mpi return code */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Pget_fapl_mpiposix, FAIL) H5TRACE3("e","ixx",fapl_id,comm,use_gpfs); @@ -604,7 +604,7 @@ H5FD_mpiposix_fapl_get(H5FD_t *_file) /* Duplicate the communicator. */ if (MPI_SUCCESS != (mpi_code=MPI_Comm_dup(file->comm, &fa->comm))) HMPI_GOTO_ERROR(NULL, "MPI_Comm_dup failed", mpi_code) - + fa->use_gpfs = file->use_gpfs; /* Set return value */ @@ -638,7 +638,7 @@ H5FD_mpiposix_fapl_copy(const void *_old_fa) const H5FD_mpiposix_fapl_t *old_fa = (const H5FD_mpiposix_fapl_t*)_old_fa; H5FD_mpiposix_fapl_t *new_fa = NULL; int mpi_code; /* MPI return code */ - + FUNC_ENTER_NOAPI(H5FD_mpiposix_fapl_copy, NULL) if (NULL==(new_fa=H5MM_malloc(sizeof(H5FD_mpiposix_fapl_t)))) @@ -740,7 +740,7 @@ H5FD_mpiposix_open(const char *name, unsigned flags, hid_t fapl_id, #ifdef WIN32 HFILE filehandle; struct _BY_HANDLE_FILE_INFORMATION fileinfo; - int results; + int results; #endif H5FD_t *ret_value=NULL; /* Return value */ MPI_Comm comm_dup=MPI_COMM_NULL; @@ -853,7 +853,7 @@ H5FD_mpiposix_open(const char *name, unsigned flags, hid_t fapl_id, hint.fr.structType = GPFS_FREE_RANGE; hint.fr.start = 0; hint.fr.length = 0; - + if (gpfs_fcntl(fd, &hint)<0) HGOTO_ERROR(H5E_FILE, H5E_FCNTL, NULL, "failed to send hints to GPFS") } @@ -1167,26 +1167,26 @@ done: /*------------------------------------------------------------------------- * Function: H5FD_mpiposix_get_handle - * + * * Purpose: Returns the file handle of MPI-POSIX file driver. - * + * * Returns: Non-negative if succeed or negative if fails. - * + * * Programmer: Raymond Lu * Sept. 16, 2002 - * + * * Modifications: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5FD_mpiposix_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) -{ +{ H5FD_mpiposix_t *file = (H5FD_mpiposix_t *)_file; herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5FD_mpiposix_get_handle, FAIL) - + if(!file_handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid") @@ -1276,7 +1276,7 @@ H5FD_mpiposix_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, addr += (haddr_t)nbytes; buf = (char*)buf + nbytes; } - + /* Update current position */ file->pos = addr; file->op = OP_READ; @@ -1336,13 +1336,13 @@ H5FD_mpiposix_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, assert(buf); /* Check for overflow conditions */ - if (HADDR_UNDEF==addr) + if (HADDR_UNDEF==addr) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "addr undefined") if (REGION_OVERFLOW(addr, size)) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow") if (addr+size>file->eoa) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow") - + /* Obtain the data transfer properties */ if(NULL == (plist = H5I_object(dxpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") @@ -1407,7 +1407,7 @@ H5FD_mpiposix_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, } #endif /* H5_HAVE_GPFS */ } - + /* Seek to the correct location */ if ((addr!=file->pos || OP_WRITE!=file->op) && file_seek(file->fd, (file_offset_t)addr, SEEK_SET)<0) diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index 0289096..b6c94d9 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -77,10 +77,10 @@ #define ALL_MEMBERS(LOOPVAR) { \ H5FD_mem_t LOOPVAR; \ for (LOOPVAR=H5FD_MEM_DEFAULT; LOOPVARmemb_addr, H5FD_MEM_NTYPES*sizeof(haddr_t)); if (relax) *relax = fa->relax; - + return 0; } @@ -717,7 +717,7 @@ H5FD_multi_sb_size(H5FD_t *_file) UNIQUE_MEMBERS(file->fa.memb_map, mt) { nseen++; } END_MEMBERS; - + /* Addresses and EOA markers */ nbytes += nseen * 2 * 8; @@ -866,7 +866,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) memb_eoa[mt] = HADDR_UNDEF; memb_name[mt] = NULL; } END_MEMBERS; - + /* * Read the map and count the unique members. */ @@ -924,7 +924,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf) ALL_MEMBERS(mt) { file->fa.memb_map[mt] = map[mt]; } END_MEMBERS; - + /* Close files which are unused now */ memset(in_use, 0, sizeof in_use); UNIQUE_MEMBERS(map, mt) { @@ -1026,7 +1026,7 @@ H5FD_multi_fapl_copy(const void *_old_fa) H5FD_mem_t mt; int nerrors = 0; static const char *func="H5FD_multi_fapl_copy"; /* Function Name for error reporting */ - + assert(new_fa); /* Clear the error stack */ @@ -1120,7 +1120,7 @@ H5FD_multi_dxpl_copy(const void *_old_dx) H5FD_mem_t mt; int nerrors = 0; static const char *func="H5FD_multi_dxpl_copy"; /* Function Name for error reporting */ - + assert(new_dx); /* Clear the error stack */ @@ -1206,7 +1206,7 @@ H5FD_multi_open(const char *name, unsigned flags, hid_t fapl_id, H5FD_multi_fapl_t *fa; H5FD_mem_t m; static const char *func="H5FD_multi_open"; /* Function Name for error reporting */ - + /* Clear the error stack */ H5Eclear(); @@ -1499,7 +1499,7 @@ H5FD_multi_set_eoa(H5FD_t *_file, haddr_t eoa) if (status<0) H5Epush_ret(func, H5E_FILE, H5E_BADVALUE, "member H5FDset_eoa failed", -1) } - + /* Save new eoa for return later */ file->eoa = eoa; return 0; @@ -1543,7 +1543,7 @@ H5FD_multi_get_eof(H5FD_t *_file) if (HADDR_UNDEF==tmp) H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eof", HADDR_UNDEF) if (tmp>0) tmp += file->fa.memb_addr[mt]; - + } else if (file->fa.relax) { /* * The member is not open yet (maybe it doesn't exist). Make the @@ -1551,27 +1551,27 @@ H5FD_multi_get_eof(H5FD_t *_file) */ tmp = file->memb_next[mt]; assert(HADDR_UNDEF!=tmp); - + } else { H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "bad eof", HADDR_UNDEF) } if (tmp>eof) eof = tmp; } END_MEMBERS; - + return MAX(file->eoa, eof); } /*------------------------------------------------------------------------- * Function: H5FD_multi_get_handle - * + * * Purpose: Returns the file handle of MULTI file driver. - * + * * Returns: Non-negative if succeed or negative if fails. - * - * Programmer: Raymond Lu - * Sept. 16, 2002 + * + * Programmer: Raymond Lu + * Sept. 16, 2002 * * Modifications: * @@ -1579,7 +1579,7 @@ H5FD_multi_get_eof(H5FD_t *_file) */ static herr_t H5FD_multi_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) -{ +{ H5FD_multi_t *file = (H5FD_multi_t *)_file; H5FD_mem_t type, mmt; static const char *func="H5FD_multi_get_handle"; /* Function Name for error reporting */ @@ -1591,7 +1591,7 @@ H5FD_multi_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "data type is out of range", -1) mmt = file->fa.memb_map[type]; if(H5FD_MEM_DEFAULT==mmt) mmt = type; - + return (H5FDget_vfd_handle(file->memb[mmt], fapl, file_handle)); } @@ -1622,7 +1622,7 @@ H5FD_multi_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) mmt = file->fa.memb_map[type]; if (H5FD_MEM_DEFAULT==mmt) mmt = type; - + if (HADDR_UNDEF==(addr=H5FDalloc(file->memb[mmt], type, dxpl_id, size))) H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "member file can't alloc", HADDR_UNDEF) addr += file->fa.memb_addr[mmt]; @@ -1658,7 +1658,7 @@ H5FD_multi_free(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsi mmt = file->fa.memb_map[type]; if (H5FD_MEM_DEFAULT==mmt) mmt = type; - + assert(addr>=file->fa.memb_addr[mmt]); assert(addr+size<=file->memb_next[mmt]); return H5FDfree(file->memb[mmt], type, dxpl_id, addr-file->fa.memb_addr[mmt], size); @@ -1700,7 +1700,7 @@ H5FD_multi_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz if (H5P_FILE_ACCESS_DEFAULT!=dxpl_id && H5FD_MULTI==H5Pget_driver(dxpl_id)) { dx = H5Pget_driver_info(dxpl_id); } - + /* Find the file to which this address belongs */ for (mt=H5FD_MEM_SUPER; mtfa.memb_map[mt]; @@ -1755,7 +1755,7 @@ H5FD_multi_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, si if (H5P_FILE_ACCESS_DEFAULT!=dxpl_id && H5FD_MULTI==H5Pget_driver(dxpl_id)) { dx = H5Pget_driver_info(dxpl_id); } - + /* Find the file to which this address belongs */ for (mt=H5FD_MEM_SUPER; mtfa.memb_map[mt]; @@ -1802,7 +1802,7 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing) #if 0 H5FD_mem_t mmt; - + /* Debugging stuff... */ fprintf(stderr, "multifile access information:\n"); @@ -1819,7 +1819,7 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing) fprintf(stderr, " File Starting Allocated Next Member\n"); fprintf(stderr, " Number Address Size Address Name\n"); fprintf(stderr, " ------ -------------------- -------------------- -------------------- ------------------------------\n"); - + for (mt=1; mtmemb_addr[mt]) { haddr_t eoa = H5FDget_eoa(file->memb[mt]); @@ -1845,7 +1845,7 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing) } if (nerrors) H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "error flushing member files", -1) - + return 0; } @@ -1876,7 +1876,7 @@ compute_next(H5FD_multi_t *file) ALL_MEMBERS(mt) { file->memb_next[mt] = HADDR_UNDEF; } END_MEMBERS; - + UNIQUE_MEMBERS(file->fa.memb_map, mt1) { UNIQUE_MEMBERS(file->fa.memb_map, mt2) { if (file->fa.memb_addr[mt1]fa.memb_addr[mt2] && @@ -1889,7 +1889,7 @@ compute_next(H5FD_multi_t *file) file->memb_next[mt1] = HADDR_MAX; /*last member*/ } } END_MEMBERS; - + return 0; } @@ -1916,7 +1916,7 @@ open_members(H5FD_multi_t *file) char tmp[1024]; int nerrors=0; static const char *func="(H5FD_multi)open_members"; /* Function Name for error reporting */ - + /* Clear the error stack */ H5Eclear(); diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h index ba762db..938a4b7 100644 --- a/src/H5FDpublic.h +++ b/src/H5FDpublic.h @@ -102,7 +102,7 @@ typedef enum H5FD_mem_t { * the library will attempt to cache metadata as it is written to the file * and build up a larger block of metadata to eventually pass to the VFL * 'write' routine. - * + * * Distinguish between updating the metadata accumulator on writes and * reads. This is particularly (perhaps only, even) important for MPI-I/O * where we guarantee that writes are collective, but reads may not be. @@ -126,7 +126,7 @@ typedef enum H5FD_mem_t { * and then sub-allocate "small" raw data requests from that larger block. */ #define H5FD_FEAT_AGGREGATE_SMALLDATA 0x00000010 - + /* Forward declaration */ typedef struct H5FD_t H5FD_t; diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index cadc459..e74a593 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -119,7 +119,7 @@ typedef struct H5FD_sec2_t { /* * These macros check for overflow of various quantities. These macros * assume that file_offset_t is signed and haddr_t and size_t are unsigned. - * + * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' * is too large to be represented by the second argument * of the file seek function. @@ -196,7 +196,7 @@ NAME H5FD_sec2_init_interface -- Initialize interface-specific information USAGE herr_t H5FD_sec2_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -280,7 +280,7 @@ H5FD_sec2_term(void) * Purpose: Modify the file access property list to use the H5FD_SEC2 * driver defined in this source file. There are no driver * specific properties. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke @@ -298,7 +298,7 @@ H5Pset_fapl_sec2(hid_t fapl_id) FUNC_ENTER_API(H5Pset_fapl_sec2, FAIL) H5TRACE1("e","i",fapl_id); - + if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list") @@ -632,27 +632,27 @@ done: /*------------------------------------------------------------------------- * Function: H5FD_sec2_get_handle - * + * * Purpose: Returns the file handle of sec2 file driver. - * + * * Returns: Non-negative if succeed or negative if fails. - * + * * Programmer: Raymond Lu * Sept. 16, 2002 - * + * * Modifications: * *------------------------------------------------------------------------- */ /* ARGSUSED */ -static herr_t +static herr_t H5FD_sec2_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) -{ +{ H5FD_sec2_t *file = (H5FD_sec2_t *)_file; herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5FD_sec2_get_handle, FAIL) - + if(!file_handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid") *file_handle = &(file->fd); @@ -689,7 +689,7 @@ H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, hadd H5FD_sec2_t *file = (H5FD_sec2_t*)_file; ssize_t nbytes; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_sec2_read, FAIL) assert(file && file->pub.cls); @@ -731,7 +731,7 @@ H5FD_sec2_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, hadd addr += (haddr_t)nbytes; buf = (char*)buf + nbytes; } - + /* Update current position */ file->pos = addr; file->op = OP_READ; @@ -773,20 +773,20 @@ H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, had H5FD_sec2_t *file = (H5FD_sec2_t*)_file; ssize_t nbytes; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_sec2_write, FAIL) assert(file && file->pub.cls); assert(buf); /* Check for overflow conditions */ - if (HADDR_UNDEF==addr) + if (HADDR_UNDEF==addr) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "addr undefined") if (REGION_OVERFLOW(addr, size)) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow") if (addr+size>file->eoa) HGOTO_ERROR(H5E_ARGS, H5E_OVERFLOW, FAIL, "addr overflow") - + /* Seek to the correct location */ if ((addr!=file->pos || OP_WRITE!=file->op) && file_seek(file->fd, (file_offset_t)addr, SEEK_SET)<0) @@ -810,7 +810,7 @@ H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, had addr += (haddr_t)nbytes; buf = (const char*)buf + nbytes; } - + /* Update current position and eof */ file->pos = addr; file->op = OP_WRITE; diff --git a/src/H5FDsrb.c b/src/H5FDsrb.c index 15faa15..8c16884 100644 --- a/src/H5FDsrb.c +++ b/src/H5FDsrb.c @@ -71,7 +71,7 @@ static hid_t H5FD_SRB_g = 0; /* * These macros check for overflow of various quantities. These macros * assume that file_offset_t is signed and haddr_t and size_t are unsigned. - * + * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' * is too large to be represented by the second argument * of the file seek function. @@ -107,7 +107,7 @@ static herr_t H5FD_srb_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, had size_t size, const void *buf); static herr_t H5FD_srb_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing); -/* The description of a file belonging to this driver. */ +/* The description of a file belonging to this driver. */ typedef struct H5FD_srb_t { H5FD_t pub; /*public stuff, must be first */ int fd; /*file descriptor */ @@ -115,7 +115,7 @@ typedef struct H5FD_srb_t { SRB_Info info; /*file information */ haddr_t eoa; /*end of allocated region */ haddr_t eof; /*end of file; current file size*/ - haddr_t pos; /*current file I/O position */ + haddr_t pos; /*current file I/O position */ } H5FD_srb_t; /* SRB-specific file access properties */ @@ -163,7 +163,7 @@ NAME H5FD_srb_init_interface -- Initialize interface-specific information USAGE herr_t H5FD_srb_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -196,7 +196,7 @@ H5FD_srb_init_interface(void) * *------------------------------------------------------------------------- */ -hid_t +hid_t H5FD_srb_init(void) { hid_t ret_value=H5FD_SRB_g; /* Return value */ @@ -243,10 +243,10 @@ H5FD_srb_term(void) /*------------------------------------------------------------------------- * Function: H5Pset_fapl_srb * - * Purpose: Store srb connection(client to server) handler SRB_CONN - * after connected and user supplied INFO in the file access + * Purpose: Store srb connection(client to server) handler SRB_CONN + * after connected and user supplied INFO in the file access * property list FAPL_ID, which can be used to create or open - * file. + * file. * * Return: Success: Non-negative * @@ -259,14 +259,14 @@ H5FD_srb_term(void) * * Raymond Lu, 2001-10-25 * Use the new generic property list for argument checking. - * + * *------------------------------------------------------------------------- */ herr_t H5Pset_fapl_srb(hid_t fapl_id, SRB_Info info) { H5FD_srb_fapl_t fa; - int srb_status; + int srb_status; H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value; @@ -288,7 +288,7 @@ H5Pset_fapl_srb(hid_t fapl_id, SRB_Info info) fa.info = info; ret_value = H5P_set_driver(plist, H5FD_SRB, &fa); - + done: FUNC_LEAVE_API(ret_value) } @@ -298,8 +298,8 @@ done: * Function: H5Pget_fapl_srb * * Purpose: If the file access property list is set to the H5FD_SRB - * driver then this function returns the srb file INFO. - * + * driver then this function returns the srb file INFO. + * * Return: Success: File INFO is returned. * Failure: Negative * @@ -311,7 +311,7 @@ done: * Raymond Lu, 2001-10-25 * Use the new generic property list for checking property list * ID. - * + * *------------------------------------------------------------------------- */ herr_t @@ -382,7 +382,7 @@ H5FD_srb_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) if(NULL == (plist = H5P_object_verify(fapl_id,H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list") if(H5P_FILE_ACCESS_DEFAULT==fapl_id || H5FD_SRB!=H5P_get_driver(plist)) { - HDmemset((void*)&_fa, 0, sizeof(H5FD_srb_fapl_t)); + HDmemset((void*)&_fa, 0, sizeof(H5FD_srb_fapl_t)); fa = &_fa; } else { @@ -393,39 +393,39 @@ H5FD_srb_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) /* When I come down here, the possible flag values and the correct * responses are given here :- * - * 1. H5F_ACC_CREAT | H5F_ACC_RDWR | H5F_ACC_EXCL : The file is - * a new one. Go ahead and open it with srbObjCreate. + * 1. H5F_ACC_CREAT | H5F_ACC_RDWR | H5F_ACC_EXCL : The file is + * a new one. Go ahead and open it with srbObjCreate. * 2. H5F_ACC_CREAT | H5F_ACC_RDWR | H5F_ACC_TRUNC : how do I handle this? - * srbObjCreate doesn't support truncate while srbObjOpen doesn't + * srbObjCreate doesn't support truncate while srbObjOpen doesn't * support create. Try to call both srbFileCreate and srbFileOpen! * 3. H5F_ACC_RDWR | H5F_ACC_TRUNC : Use O_RDWR | O_TRUNC with srbObjOpen. * 4. H5F_ACC_RDWR : Use O_RDWR with srbObjOpen. - * 5. Flag is not set : Use O_RDONLY with srbObjOpen. + * 5. Flag is not set : Use O_RDONLY with srbObjOpen. * - * (In srbObjOpen, O_CREATE is not supported. For file creation, use + * (In srbObjOpen, O_CREATE is not supported. For file creation, use * srbObjCreate.) - */ + */ - if((flags & H5F_ACC_CREAT) && (flags & H5F_ACC_RDWR) && + if((flags & H5F_ACC_CREAT) && (flags & H5F_ACC_RDWR) && (flags & H5F_ACC_EXCL)) - srb_fid = srbFileCreate(fa->srb_conn, fa->info.storSysType, - fa->info.srbHost, name, fa->info.mode, fa->info.size); - else if((flags & H5F_ACC_CREAT) && (flags & H5F_ACC_RDWR) && + srb_fid = srbFileCreate(fa->srb_conn, fa->info.storSysType, + fa->info.srbHost, name, fa->info.mode, fa->info.size); + else if((flags & H5F_ACC_CREAT) && (flags & H5F_ACC_RDWR) && (flags & H5F_ACC_TRUNC)) { - if( (srb_fid = srbFileCreate(fa->srb_conn, fa->info.storSysType, + if( (srb_fid = srbFileCreate(fa->srb_conn, fa->info.storSysType, fa->info.srbHost, name, fa->info.mode, fa->info.size)) < 0 ) { - srb_fid = srbFileOpen(fa->srb_conn, fa->info.storSysType, + srb_fid = srbFileOpen(fa->srb_conn, fa->info.storSysType, fa->info.srbHost, name, O_RDWR|O_TRUNC, fa->info.mode); - } + } } else if((flags & H5F_ACC_RDWR) && (flags & H5F_ACC_TRUNC)) - srb_fid = srbFileOpen(fa->srb_conn, fa->info.storSysType, + srb_fid = srbFileOpen(fa->srb_conn, fa->info.storSysType, fa->info.srbHost, name, O_RDWR|O_TRUNC, fa->info.mode); else if(flags & H5F_ACC_RDWR) - srb_fid = srbFileOpen(fa->srb_conn, fa->info.storSysType, + srb_fid = srbFileOpen(fa->srb_conn, fa->info.storSysType, fa->info.srbHost, name, O_RDWR, fa->info.mode); else - srb_fid = srbFileOpen(fa->srb_conn, fa->info.storSysType, + srb_fid = srbFileOpen(fa->srb_conn, fa->info.storSysType, fa->info.srbHost, name, O_RDONLY, fa->info.mode); @@ -433,7 +433,7 @@ H5FD_srb_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) #ifdef OLD_WAY fprintf(stderr, "cannot open file %s\n", name); fprintf(stderr,"%s",clErrorMessage(fa->srb_conn)); - clFinish(fa->srb_conn); + clFinish(fa->srb_conn); HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, NULL, "cannot open file") #else /* OLD_WAY */ HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, NULL, clErrorMessage(fa->srb_conn)) @@ -444,7 +444,7 @@ H5FD_srb_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) &srb_stat)!=0) { #ifdef OLD_WAY srbFileClose(fa->srb_conn, srb_fid); - clFinish(fa->srb_conn); + clFinish(fa->srb_conn); HGOTO_ERROR(H5E_IO, H5E_BADFILE, NULL, "SRB file stat failed") #else /* OLD_WAY */ HGOTO_ERROR(H5E_IO, H5E_BADFILE, NULL, "SRB file stat failed") @@ -466,7 +466,7 @@ H5FD_srb_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr) done: if(ret_value==NULL) { if(fa!=NULL) - clFinish(fa->srb_conn); + clFinish(fa->srb_conn); if(srb_fid>=0) srbFileClose(fa->srb_conn, srb_fid); } /* end if */ @@ -567,7 +567,7 @@ H5FD_srb_get_eoa(H5FD_t *_file) FUNC_ENTER_NOAPI(H5FD_srb_get_eoa, HADDR_UNDEF) /* Set return value */ - ret_value=file->eoa; + ret_value=file->eoa; done: FUNC_LEAVE_NOAPI(ret_value) @@ -632,7 +632,7 @@ H5FD_srb_get_eof(H5FD_t *_file) FUNC_ENTER_NOAPI(H5FD_srb_get_eof, HADDR_UNDEF) /* Set return value */ - ret_value=file->eof; + ret_value=file->eof; done: FUNC_LEAVE_NOAPI(ret_value) @@ -641,24 +641,24 @@ done: /*------------------------------------------------------------------------- * Function: H5FD_srb_get_handle - * + * * Purpose: Returns the file handle of SRB file driver. - * + * * Returns: Non-negative if succeed or negative if fails. - * + * * Programmer: Raymond Lu * Sept. 16, 2002 - * + * * Modifications: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5FD_srb_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) -{ +{ H5FD_srb_t *file = (H5FD_srb_t *)_file; herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5FD_srb_get_eof, FAIL) if(!file_handle) @@ -686,7 +686,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_srb_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr_t addr, +H5FD_srb_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr_t addr, size_t size, void *buf) { H5FD_srb_t *file = (H5FD_srb_t*)_file; @@ -727,7 +727,7 @@ H5FD_srb_read(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr /* Update current position */ file->pos = addr; - + done: if(ret_value<0) { /* Reset file position */ @@ -735,7 +735,7 @@ done: /* Close connection, etc. */ srbFileClose(file->srb_conn, file->fd); - clFinish(file->srb_conn); + clFinish(file->srb_conn); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -758,7 +758,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5FD_srb_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr_t addr, +H5FD_srb_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr_t addr, size_t size, const void *buf) { H5FD_srb_t *file = (H5FD_srb_t*)_file; @@ -782,8 +782,8 @@ H5FD_srb_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, hadd while(size>0) { if( (nbytes=srbFileWrite(file->srb_conn, (int)file->fd, (char*)buf, size)) < 0 ) HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "srb file write failed") - - size -= nbytes; + + size -= nbytes; addr += (haddr_t)nbytes; buf = (const char*)buf + nbytes; } @@ -800,7 +800,7 @@ done: /* Close connection, etc. */ srbFileClose(file->srb_conn, file->fd); - clFinish(file->srb_conn); + clFinish(file->srb_conn); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) @@ -834,7 +834,7 @@ H5FD_srb_flush(H5FD_t *_file, hid_t dxpl_id, unsigned UNUSED closing) done: if(ret_value<0) { srbFileClose(file->srb_conn, file->fd); - clFinish(file->srb_conn); + clFinish(file->srb_conn); } /* end if */ FUNC_LEAVE_NOAPI(ret_value) diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index c144476..00966c8 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -114,7 +114,7 @@ typedef struct H5FD_stdio_t { /* * These macros check for overflow of various quantities. These macros * assume that file_offset_t is signed and haddr_t and size_t are unsigned. - * + * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' * is too large to be represented by the second argument * of the file seek function. @@ -253,7 +253,7 @@ H5FD_stdio_term(void) * Purpose: Modify the file access property list to use the H5FD_STDIO * driver defined in this source file. There are no driver * specific properties. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke @@ -276,7 +276,7 @@ H5Pset_fapl_stdio(hid_t fapl_id) if(0 == H5Pisa_class(fapl_id, H5P_FILE_ACCESS)) H5Epush_ret(func, H5E_PLIST, H5E_BADTYPE, "not a file access property list", -1) - + return H5Pset_driver(fapl_id, H5FD_STDIO, NULL); } @@ -290,10 +290,10 @@ H5Pset_fapl_stdio(hid_t fapl_id) * * Errors: * IO CANTOPENFILE File doesn't exist and CREAT wasn't - * specified. - * IO CANTOPENFILE Fopen failed. + * specified. + * IO CANTOPENFILE Fopen failed. * IO FILEEXISTS File exists but CREAT and EXCL were - * specified. + * specified. * * Return: Success: A pointer to a new file data structure. The * public fields will be initialized by the @@ -401,7 +401,7 @@ H5FD_stdio_open( const char *name, unsigned flags, hid_t fapl_id, * Purpose: Closes a file. * * Errors: - * IO CLOSEERROR Fclose failed. + * IO CLOSEERROR Fclose failed. * * Return: Non-negative on success/Negative on failure * @@ -621,34 +621,34 @@ H5FD_stdio_get_eof(H5FD_t *_file) /*------------------------------------------------------------------------- * Function: H5FD_stdio_get_handle - * + * * Purpose: Returns the file handle of stdio file driver. - * + * * Returns: Non-negative if succeed or negative if fails. - * + * * Programmer: Raymond Lu * Sept. 16, 2002 - * + * * Modifications: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5FD_stdio_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) -{ +{ H5FD_stdio_t *file = (H5FD_stdio_t *)_file; static const char *func="H5FD_stdio_get_handle"; /* Function Name for error reporting */ /* Shut compiler up */ fapl=fapl; - + /* Clear the error stack */ H5Eclear(); *file_handle = &(file->fp); if(*file_handle==NULL) H5Epush_ret(func, H5E_IO, H5E_WRITEERROR, "get handle failed", -1) - return(0); + return(0); } @@ -660,8 +660,8 @@ H5FD_stdio_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) * physical end of file returns zeros instead of failing. * * Errors: - * IO READERROR Fread failed. - * IO SEEKERROR Fseek failed. + * IO READERROR Fread failed. + * IO SEEKERROR Fseek failed. * * Return: Non-negative on success/Negative on failure * @@ -692,7 +692,7 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz H5Eclear(); /* Check for overflow */ - if (HADDR_UNDEF==addr) + if (HADDR_UNDEF==addr) H5Epush_ret (func, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1) if (REGION_OVERFLOW(addr, size)) H5Epush_ret (func, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1) @@ -728,7 +728,7 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz memset((unsigned char *)buf + size - nbytes, 0, nbytes); size -= nbytes; } - + /* * Read the data. Since we're reading single-byte values, a partial read * will advance the file position by N. If N is zero or an error @@ -742,7 +742,7 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz } else if (n < size) { memset((unsigned char *)buf + n, 0, (size - n)); } - + /* * Update the file position data. */ @@ -759,8 +759,8 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz * file address ADDR. * * Errors: - * IO SEEKERROR Fseek failed. - * IO WRITEERROR Fwrite failed. + * IO SEEKERROR Fseek failed. + * IO WRITEERROR Fwrite failed. * * Return: Non-negative on success/Negative on failure * @@ -796,7 +796,7 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, H5Epush_ret (func, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1) if (addr+size>file->eoa) H5Epush_ret (func, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1) - + /* * Seek to the correct file position. */ @@ -809,7 +809,7 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, } file->pos = addr; } - + /* * Write the buffer. On successful return, the file position will be * advanced by the number of bytes read. Otherwise nobody knows where it @@ -820,7 +820,7 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, file->pos = HADDR_UNDEF; H5Epush_ret(func, H5E_IO, H5E_WRITEERROR, "fwrite failed", -1) } - + /* * Update seek optimizing data. */ @@ -841,8 +841,8 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, * Purpose: Makes sure that all data is on disk. * * Errors: - * IO SEEKERROR fseek failed. - * IO WRITEERROR fflush or fwrite failed. + * IO SEEKERROR fseek failed. + * IO WRITEERROR fflush or fwrite failed. * * Return: Non-negative on success/Negative on failure * diff --git a/src/H5FDstream.c b/src/H5FDstream.c index 455b3ff..560d472 100644 --- a/src/H5FDstream.c +++ b/src/H5FDstream.c @@ -1,7 +1,7 @@ /* * Copyright © 2000 The author. * The author prefers this code not be used for military purposes. - * + * * * Author: Thomas Radke * Tuesday, September 12, 2000 @@ -126,7 +126,7 @@ static const H5FD_stream_fapl_t default_fapl = /* * These macros check for overflow of various quantities. These macros * assume that file_offset_t is signed and haddr_t and size_t are unsigned. - * + * * ADDR_OVERFLOW: Checks whether a file address of type `haddr_t' * is too large to be represented by the second argument * of the file seek function. @@ -207,7 +207,7 @@ NAME H5FD_stream_init_interface -- Initialize interface-specific information USAGE herr_t H5FD_stream_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -300,7 +300,7 @@ H5FD_stream_term(void) * If a valid socket argument is given this will be used * by the driver instead of parsing the 'hostname:port' filename * and opening a socket internally. - * + * * Return: Success: Non-negative * Failure: Negative * @@ -426,7 +426,7 @@ H5FD_stream_open_socket (const char *filename, int o_flags, H5FD_STREAM_SOCKET_TYPE sock=H5FD_STREAM_INVALID_SOCKET; char *hostname=NULL; unsigned short int first_port; - const char *separator, *tmp; + const char *separator, *tmp; int on = 1; H5FD_STREAM_SOCKET_TYPE ret_value=H5FD_STREAM_INVALID_SOCKET; @@ -446,7 +446,7 @@ H5FD_stream_open_socket (const char *filename, int o_flags, HGOTO_ERROR(H5E_ARGS,H5E_BADVALUE,H5FD_STREAM_INVALID_SOCKET,"invalid port number") } } - + hostname = (char *) H5MM_malloc ((size_t)(separator - filename + 1)); /* Return if out of memory */ @@ -986,7 +986,7 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5FD_stream_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) { H5FD_stream_t *file = (H5FD_stream_t *)_file; diff --git a/src/H5FDstream.h b/src/H5FDstream.h index f8aa5a3..0c4b387 100644 --- a/src/H5FDstream.h +++ b/src/H5FDstream.h @@ -20,7 +20,7 @@ # define H5FD_STREAM (H5FD_stream_init()) #else # define H5FD_STREAM (-1) -#endif /*H5_HAVE_STREAM */ +#endif /*H5_HAVE_STREAM */ #ifdef H5_HAVE_STREAM diff --git a/src/H5FL.c b/src/H5FL.c index ff9392a..904e761 100644 --- a/src/H5FL.c +++ b/src/H5FL.c @@ -114,7 +114,7 @@ NAME H5FL_init_interface -- Initialize interface-specific information USAGE herr_t H5FL_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -147,7 +147,7 @@ H5FL_init_interface(void) * Tuesday, August 1, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static void * @@ -186,7 +186,7 @@ done: * Friday, March 24, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -232,7 +232,7 @@ done: * Friday, March 24, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -298,7 +298,7 @@ done: * Friday, March 24, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -358,7 +358,7 @@ done: * Monday, December 23, 2002 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -395,7 +395,7 @@ done: * Tuesday, July 25, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -404,7 +404,7 @@ H5FL_reg_gc_list(H5FL_reg_head_t *head) H5FL_reg_node_t *free_list; /* Pointer to nodes in free list being garbage collected */ void *tmp; /* Temporary node pointer */ size_t total_mem; /* Total memory used on list */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_reg_gc_list) /* Calculate the total memory used on this list */ @@ -454,7 +454,7 @@ H5FL_reg_gc_list(H5FL_reg_head_t *head) * Modifications: * Broke into two parts, one for looping over all the free lists and * another for freeing each list - QAK 7/25/00 - * + * *------------------------------------------------------------------------- */ static herr_t @@ -462,7 +462,7 @@ H5FL_reg_gc(void) { H5FL_reg_gc_node_t *gc_node; /* Pointer into the list of things to garbage collect */ herr_t ret_value=SUCCEED; /* return value*/ - + FUNC_ENTER_NOAPI_NOINIT(H5FL_reg_gc) /* Walk through all the free lists, free()'ing the nodes */ @@ -614,7 +614,7 @@ H5FL_blk_find_list(H5FL_blk_node_t **head, size_t size) temp=temp->next; } /* end while */ } /* end if */ - + FUNC_LEAVE_NOAPI(temp) } /* end H5FL_blk_find_list() */ @@ -647,7 +647,7 @@ H5FL_blk_create_list(H5FL_blk_node_t **head, size_t size) /* Allocate room for the new free list node */ if(NULL==(temp=H5FL_MALLOC(H5FL_blk_node_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for chunk info") - + /* Set the correct values for the new free list */ temp->size=size; temp->list=NULL; @@ -684,7 +684,7 @@ done: * Saturday, March 25, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -810,7 +810,7 @@ H5FL_blk_malloc(H5FL_blk_head_t *head, size_t size) } /* end if */ /* No free list available, or there are no nodes on the list, allocate a new node to give to the user */ - else { + else { /* Allocate new node, with room for the page info header and the actual page data */ if(NULL==(temp=H5FL_malloc(sizeof(H5FL_blk_list_t)+size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for chunk") @@ -1014,7 +1014,7 @@ done: * Thursday, March 23, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1023,7 +1023,7 @@ H5FL_blk_gc_list(H5FL_blk_head_t *head) H5FL_blk_list_t *list; /* The free list of native nodes of a particular size */ void *next; /* Temp. ptr to the free list list node */ void *temp; /* Temp. ptr to the free list page node */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_blk_gc_list) /* Loop through all the nodes in the block free list queue */ @@ -1078,7 +1078,7 @@ H5FL_blk_gc_list(H5FL_blk_head_t *head) * Saturday, March 25, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1086,7 +1086,7 @@ H5FL_blk_gc(void) { H5FL_blk_gc_node_t *gc_node; /* Pointer into the list of things to garbage collect */ herr_t ret_value=SUCCEED; /* return value*/ - + FUNC_ENTER_NOAPI_NOINIT(H5FL_blk_gc) /* Walk through all the free lists, free()'ing the nodes */ @@ -1134,7 +1134,7 @@ H5FL_blk_term(void) H5FL_blk_gc_node_t *tmp; /* Temporary pointer to a garbage collection node */ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_blk_term) - + /* Free the nodes on the garbage collection list, keeping nodes with allocations outstanding */ left=NULL; while(H5FL_blk_gc_head.first!=NULL) { @@ -1164,7 +1164,7 @@ printf("H5FL_blk_term: head->name=%s, head->allocated=%d\n", H5FL_blk_gc_head.fi /* Point to the list of nodes left with allocations open, if any */ H5FL_blk_gc_head.first=left; - + FUNC_LEAVE_NOAPI(H5FL_blk_gc_head.first!=NULL ? 1 : 0) } /* end H5FL_blk_term() */ @@ -1182,7 +1182,7 @@ printf("H5FL_blk_term: head->name=%s, head->allocated=%d\n", H5FL_blk_gc_head.fi * Saturday, March 25, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1212,7 +1212,7 @@ H5FL_arr_init(H5FL_arr_head_t *head) /* Initialize the size of each array */ for(u = 0; u<(size_t)head->maxelem; u++) head->list_arr[u].size = head->base_size + (head->elem_size * u); - + /* Indicate that the free list is initialized */ head->init=1; @@ -1233,7 +1233,7 @@ done: * Friday, March 24, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1309,7 +1309,7 @@ done: * Saturday, March 25, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1384,7 +1384,7 @@ done: * Monday, December 23, 2002 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1422,7 +1422,7 @@ done: * Saturday, March 25, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1483,7 +1483,7 @@ done: * Tuesday, July 25, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1493,7 +1493,7 @@ H5FL_arr_gc_list(H5FL_arr_head_t *head) void *tmp; /* Temporary node pointer */ unsigned u; /* Counter for array of free lists */ size_t total_mem; /* Total memory used on list */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_arr_gc_list) /* Walk through the array of free lists */ @@ -1545,7 +1545,7 @@ H5FL_arr_gc_list(H5FL_arr_head_t *head) * Saturday, March 25, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1553,7 +1553,7 @@ H5FL_arr_gc(void) { H5FL_gc_arr_node_t *gc_arr_node; /* Pointer into the list of things to garbage collect */ herr_t ret_value=SUCCEED; /* return value*/ - + FUNC_ENTER_NOAPI_NOINIT(H5FL_arr_gc) /* Walk through all the free lists, free()'ing the nodes */ @@ -1599,7 +1599,7 @@ H5FL_arr_term(void) { H5FL_gc_arr_node_t *left; /* pointer to garbage collection lists with work left */ H5FL_gc_arr_node_t *tmp; /* Temporary pointer to a garbage collection node */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_arr_term) /* Free the nodes on the garbage collection list, keeping nodes with allocations outstanding */ @@ -1633,7 +1633,7 @@ printf("H5FL_arr_term: head->name=%s, head->allocated=%d\n", H5FL_arr_gc_head.fi /* Point to the list of nodes left with allocations open, if any */ H5FL_arr_gc_head.first=left; - + FUNC_LEAVE_NOAPI(H5FL_arr_gc_head.first!=NULL ? 1 : 0) } /* end H5FL_arr_term() */ @@ -1650,7 +1650,7 @@ printf("H5FL_arr_term: head->name=%s, head->allocated=%d\n", H5FL_arr_gc_head.fi * Saturday, April 3, 2004 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1684,7 +1684,7 @@ H5FL_seq_free(H5FL_seq_head_t *head, void *obj) * Saturday, April 3, 2004 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1718,7 +1718,7 @@ done: * Saturday, April 3, 2004 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1752,7 +1752,7 @@ done: * Saturday, April 3, 2004 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1786,7 +1786,7 @@ done: * Friday, March 24, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ herr_t @@ -1842,7 +1842,7 @@ done: * *------------------------------------------------------------------------- */ -herr_t +herr_t H5FL_set_free_list_limits(int reg_global_lim, int reg_list_lim, int arr_global_lim, int arr_list_lim, int blk_global_lim, int blk_list_lim) { @@ -1892,7 +1892,7 @@ int H5FL_term_interface(void) { int ret_value=0; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_term_interface) /* Garbage collect any nodes on the free lists */ diff --git a/src/H5FLprivate.h b/src/H5FLprivate.h index d04325c..0f22c8a 100644 --- a/src/H5FLprivate.h +++ b/src/H5FLprivate.h @@ -133,7 +133,7 @@ typedef struct H5FL_blk_head_t { } H5FL_blk_head_t; /* - * Macros for defining & using priority queues + * Macros for defining & using priority queues */ #define H5FL_BLK_NAME(t) H5_##t##_blk_free_list #ifndef H5_NO_BLK_FREE_LISTS diff --git a/src/H5FS.c b/src/H5FS.c index 58817b8..63928dd 100644 --- a/src/H5FS.c +++ b/src/H5FS.c @@ -16,7 +16,7 @@ * Purpose: Provides internal function tracing in the form of a stack. * The FUNC_ENTER() macro adds the function name to the function * stack whenever a function is entered. - * As the functions return with FUNC_LEAVE, + * As the functions return with FUNC_LEAVE, * entries are removed from the stack. * * A function stack has a fixed maximum size. If this size is @@ -112,10 +112,10 @@ H5FS_print(FILE *stream) H5FS_t *fstack = H5FS_get_my_stack (); /* Get the correct function stack */ const int indent = 2; /* Indention level */ int i; /* Local index ariable */ - + /* Don't push this function on the function stack... :-) */ FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5FS_print); - + /* Sanity check */ assert(fstack); @@ -136,7 +136,7 @@ H5FS_print(FILE *stream) for (i=fstack->nused-1; i>=0; --i) HDfprintf(stream, "%*s#%03d: Routine: %s\n", indent, "", i, fstack->slot[i]); - + FUNC_LEAVE_NOAPI_NOFS(SUCCEED); } /* end H5FS_print() */ @@ -160,7 +160,7 @@ herr_t H5FS_push(const char *func_name) { H5FS_t *fstack = H5FS_get_my_stack (); - + /* Don't push this function on the function stack... :-) */ FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5FS_push); @@ -174,7 +174,7 @@ H5FS_push(const char *func_name) if (fstack->nusedslot[fstack->nused] = func_name; fstack->nused++; - + FUNC_LEAVE_NOAPI_NOFS(SUCCEED); } /* end H5FS_push() */ @@ -197,7 +197,7 @@ herr_t H5FS_pop(void) { H5FS_t *fstack = H5FS_get_my_stack (); - + /* Don't push this function on the function stack... :-) */ FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5FS_pop); @@ -207,7 +207,7 @@ H5FS_pop(void) /* Pop the function. */ fstack->nused--; - + FUNC_LEAVE_NOAPI_NOFS(SUCCEED); } /* end H5FS_pop() */ diff --git a/src/H5Fdbg.c b/src/H5Fdbg.c index ee42963..4048ba0 100644 --- a/src/H5Fdbg.c +++ b/src/H5Fdbg.c @@ -46,7 +46,7 @@ * Modifications: * Robb Matzke, 1999-07-28 * The ADDR argument is passed by value. - * + * * Raymond Lu, 2001-10-14 * Changed to the new generic property list. * diff --git a/src/H5Fmount.c b/src/H5Fmount.c index 18feb9c..0bff83b 100644 --- a/src/H5Fmount.c +++ b/src/H5Fmount.c @@ -35,7 +35,7 @@ NAME H5F_init_mount_interface -- Initialize interface-specific information USAGE herr_t H5F_init_mount_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -71,7 +71,7 @@ H5F_close_mounts(H5F_t *f) { unsigned u; /* Local index */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5F_close_mounts, FAIL) HDassert(f); @@ -132,7 +132,7 @@ H5F_mount(H5G_entry_t *loc, const char *name, H5F_t *child, H5G_entry_t mp_open_ent; /* entry of moint point to be opened */ H5RS_str_t *name_r; /* Ref-counted version of name */ herr_t ret_value = SUCCEED; /*return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5F_mount) assert(loc); @@ -161,7 +161,7 @@ H5F_mount(H5G_entry_t *loc, const char *name, H5F_t *child, if(parent->shared->fc_degree != child->shared->fc_degree) HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "mounted file has different file close degree than parent") - + /* * Use a binary search to locate the position that the child should be * inserted into the parent mount table. At the end of this paragraph @@ -184,7 +184,7 @@ H5F_mount(H5G_entry_t *loc, const char *name, H5F_t *child, md++; if (!cmp) HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "mount point is already in use") - + /* Make room in the table */ if (parent->mtab.nmounts>=parent->mtab.nalloc) { unsigned n = MAX(16, 2*parent->mtab.nalloc); @@ -249,7 +249,7 @@ done: * * Pedro Vicente, 22 Aug 2002 * Added `id to name' support. - * + * *------------------------------------------------------------------------- */ static herr_t @@ -265,7 +265,7 @@ H5F_unmount(H5G_entry_t *loc, const char *name, hid_t dxpl_id) H5G_entry_t mnt_open_ent; /* entry used to open mount point*/ int child_idx; /* Index of child in parent's mtab */ herr_t ret_value = SUCCEED; /*return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5F_unmount) assert(loc); @@ -391,7 +391,7 @@ H5F_mountpoint(H5G_entry_t *find/*in,out*/) int cmp; H5G_entry_t *ent = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5F_mountpoint, FAIL) assert(find); @@ -432,7 +432,7 @@ H5F_mountpoint(H5G_entry_t *find/*in,out*/) parent = ent->file; } } while (!cmp); - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -457,7 +457,7 @@ htri_t H5F_has_mount(const H5F_t *file) { htri_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5F_has_mount, FAIL) assert(file); @@ -466,7 +466,7 @@ H5F_has_mount(const H5F_t *file) ret_value=TRUE; else ret_value=FALSE; - + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_has_mount() */ @@ -491,7 +491,7 @@ htri_t H5F_is_mount(const H5F_t *file) { htri_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5F_is_mount, FAIL) assert(file); @@ -500,7 +500,7 @@ H5F_is_mount(const H5F_t *file) ret_value=TRUE; else ret_value=FALSE; - + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5F_is_mount() */ @@ -527,7 +527,7 @@ H5Fmount(hid_t loc_id, const char *name, hid_t child_id, hid_t plist_id) H5G_entry_t *loc = NULL; H5F_t *child = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Fmount, FAIL) H5TRACE4("e","isii",loc_id,name,child_id,plist_id); @@ -579,7 +579,7 @@ H5Funmount(hid_t loc_id, const char *name) { H5G_entry_t *loc = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Funmount, FAIL) H5TRACE2("e","is",loc_id,name); @@ -629,7 +629,7 @@ H5F_mount_count_ids_recurse(H5F_t *f, unsigned *nopen_files, unsigned *nopen_obj if(f->file_id > 0) *nopen_files += 1; - /* Increment number of open objects in file + /* Increment number of open objects in file * (Reduced by number of mounted files, we'll add back in the mount point's * groups later, if they are open) */ @@ -666,7 +666,7 @@ herr_t H5F_mount_count_ids(H5F_t *f, unsigned *nopen_files, unsigned *nopen_objs) { herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5F_mount_count_ids, FAIL) /* Sanity check */ diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h index 23d0cc2..dd58228 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -118,7 +118,7 @@ typedef struct H5F_mount_t { struct H5G_t *group; /* Mount point group held open */ struct H5F_t *file; /* File mounted at that point */ } H5F_mount_t; - + /* * The mount table describes what files are attached to (mounted on) the file * to which this table belongs. diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h index 16edaa0..c819275 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -279,7 +279,7 @@ typedef struct H5F_t H5F_t; #else # define H5F_OVERFLOW_HSIZET2OFFT(X) 0 #endif - + /* ========= File Creation properties ============ */ /* Definitions for the size of the file user block in bytes */ #define H5F_CRT_USER_BLOCK_NAME "block_size" @@ -314,7 +314,7 @@ typedef struct H5F_t H5F_t; #define H5F_CRT_OBJ_DIR_VERS_SIZE sizeof(unsigned) #define H5F_CRT_OBJ_DIR_VERS_DEF HDF5_OBJECTDIR_VERSION /* Definitions for shared-header format version */ -#define H5F_CRT_SHARE_HEAD_VERS_NAME "share_head_version" +#define H5F_CRT_SHARE_HEAD_VERS_NAME "share_head_version" #define H5F_CRT_SHARE_HEAD_VERS_SIZE sizeof(unsigned) #define H5F_CRT_SHARE_HEAD_VERS_DEF HDF5_SHAREDHEADER_VERSION @@ -337,7 +337,7 @@ typedef struct H5F_t H5F_t; /* Definition for preemption read chunks first */ #define H5F_ACS_PREEMPT_READ_CHUNKS_NAME "rdcc_w0" #define H5F_ACS_PREEMPT_READ_CHUNKS_SIZE sizeof(double) -#define H5F_ACS_PREEMPT_READ_CHUNKS_DEF 0.75 +#define H5F_ACS_PREEMPT_READ_CHUNKS_DEF 0.75 /* Definition for threshold for alignment */ #define H5F_ACS_ALIGN_THRHD_NAME "threshold" @@ -355,7 +355,7 @@ typedef struct H5F_t H5F_t; #define H5F_ACS_META_BLOCK_SIZE_SIZE sizeof(hsize_t) #define H5F_ACS_META_BLOCK_SIZE_DEF 2048 -/* Definition for maximum sieve buffer size (when data sieving +/* Definition for maximum sieve buffer size (when data sieving is allowed by file driver */ #define H5F_ACS_SIEVE_BUF_SIZE_NAME "sieve_buf_size" #define H5F_ACS_SIEVE_BUF_SIZE_SIZE sizeof(size_t) @@ -400,8 +400,8 @@ typedef struct H5F_t H5F_t; /* ======================== File Mount properties ====================*/ /* Definition for whether absolute symlinks local to file. */ #define H5F_MNT_SYM_LOCAL_NAME "local" -#define H5F_MNT_SYM_LOCAL_SIZE sizeof(hbool_t) -#define H5F_MNT_SYM_LOCAL_DEF FALSE +#define H5F_MNT_SYM_LOCAL_SIZE sizeof(hbool_t) +#define H5F_MNT_SYM_LOCAL_DEF FALSE #ifdef H5_HAVE_PARALLEL /* Which process writes metadata */ @@ -462,7 +462,7 @@ H5_DLL herr_t H5F_addr_pack(H5F_t *f, haddr_t *addr_p /*out*/, /* Callback functions for file access class */ H5_DLL herr_t H5F_acs_create(hid_t fapl_id, void *close_data); H5_DLL herr_t H5F_acs_close(hid_t fapl_id, void *close_data); -H5_DLL herr_t H5F_acs_copy(hid_t new_fapl_id, hid_t old_fapl_id, +H5_DLL herr_t H5F_acs_copy(hid_t new_fapl_id, hid_t old_fapl_id, void *close_data); /* Shared file list related routines */ diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h index 0b4204d..b3f6faa 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -82,7 +82,7 @@ typedef enum H5F_scope_t { /* How does file close behave? * H5F_CLOSE_DEFAULT - Use the degree pre-defined by underlining VFL - * H5F_CLOSE_WEAK - file closes only after all opened objects are closed + * H5F_CLOSE_WEAK - file closes only after all opened objects are closed * H5F_CLOSE_SEMI - if no opened objects, file is close; otherwise, file close fails * H5F_CLOSE_STRONG - if there are opened objects, close them first, then diff --git a/src/H5Fsfile.c b/src/H5Fsfile.c index 70eb420..e269776 100644 --- a/src/H5Fsfile.c +++ b/src/H5Fsfile.c @@ -105,7 +105,7 @@ H5F_sfile_add(H5F_file_t *shared) { H5F_sfile_node_t *new_shared; /* New shared file node */ herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5F_sfile_add) /* Sanity check */ @@ -147,7 +147,7 @@ H5F_sfile_search(H5FD_t *lf) { H5F_sfile_node_t *curr; /* Current shared file node */ H5F_file_t *ret_value = NULL; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_sfile_search) /* Sanity check */ @@ -189,7 +189,7 @@ H5F_sfile_remove(H5F_file_t *shared) H5F_sfile_node_t *curr; /* Current shared file node */ H5F_sfile_node_t *last; /* Last shared file node */ herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5F_sfile_remove) /* Sanity check */ diff --git a/src/H5Fsuper.c b/src/H5Fsuper.c index b4a57ef..1854aac 100644 --- a/src/H5Fsuper.c +++ b/src/H5Fsuper.c @@ -34,7 +34,7 @@ NAME H5F_init_super_interface -- Initialize interface-specific information USAGE herr_t H5T_init_super_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -120,21 +120,21 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent) /* Superblock version */ super_vers = *p++; - if (super_vers > HDF5_SUPERBLOCK_VERSION_MAX) + if (super_vers > HDF5_SUPERBLOCK_VERSION_MAX) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "bad superblock version number") if (H5P_set(c_plist, H5F_CRT_SUPER_VERS_NAME, &super_vers) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set superblock version") /* Freespace version */ freespace_vers = *p++; - if (HDF5_FREESPACE_VERSION != freespace_vers) + if (HDF5_FREESPACE_VERSION != freespace_vers) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "bad free space version number") if (H5P_set(c_plist, H5F_CRT_FREESPACE_VERS_NAME, &freespace_vers) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to free space version") /* Root group version number */ obj_dir_vers = *p++; - if (HDF5_OBJECTDIR_VERSION != obj_dir_vers) + if (HDF5_OBJECTDIR_VERSION != obj_dir_vers) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "bad object directory version number") if (H5P_set(c_plist, H5F_CRT_OBJ_DIR_VERS_NAME, &obj_dir_vers) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set object directory version") @@ -144,7 +144,7 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent) /* Shared header version number */ share_head_vers = *p++; - if (HDF5_SHAREDHEADER_VERSION != share_head_vers) + if (HDF5_SHAREDHEADER_VERSION != share_head_vers) HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "bad shared-header format version number") if (H5P_set(c_plist, H5F_CRT_SHARE_HEAD_VERS_NAME, &share_head_vers) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set shared-header format version") @@ -166,7 +166,7 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent) if (H5P_set(c_plist, H5F_CRT_OBJ_BYTE_NUM_NAME, &sizeof_size) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set byte number for object size") shared->sizeof_size = sizeof_size; /* Keep a local copy also */ - + /* Skip over reserved byte */ p++; @@ -292,7 +292,7 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent) /* Set the driver info block checksum */ shared->drvr_chksum = chksum; } /* end if */ - + /* * The user-defined data is the area of the file before the base * address. @@ -309,7 +309,7 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to determine file size") if (eof < stored_eoa) HGOTO_ERROR(H5E_FILE, H5E_TRUNCATED, FAIL, "truncated file") - + /* * Tell the file driver how much address space has already been * allocated so that it knows how to allocate additional memory. @@ -488,7 +488,7 @@ H5F_write_superblock(H5F_t *f, hid_t dxpl_id) *p++ = 0; /* reserved */ UINT16ENCODE(p, f->shared->sym_leaf_k); UINT16ENCODE(p, f->shared->btree_k[H5B_SNODE_ID]); - UINT32ENCODE(p, f->shared->consist_flags); + UINT32ENCODE(p, f->shared->consist_flags); /* * Versions of the superblock >0 have the indexed storage B-tree diff --git a/src/H5G.c b/src/H5G.c index a4957ce..51d179f 100644 --- a/src/H5G.c +++ b/src/H5G.c @@ -24,7 +24,7 @@ * * The functions that begin with `H5G_node_' operate on the leaf * nodes of a symbol table B-tree. They should be defined in - * the H5Gnode.c file. + * the H5Gnode.c file. * * The remaining functions know how to traverse the group * directed graph. @@ -130,7 +130,7 @@ typedef struct H5G_names_t { H5RS_str_t *dst_name; H5G_entry_t *dst_loc; H5G_names_op_t op; -} H5G_names_t; +} H5G_names_t; /* Enum for H5G_namei actions */ typedef enum { @@ -180,8 +180,8 @@ static htri_t H5G_isa(H5G_entry_t *ent, hid_t dxpl_id); static htri_t H5G_link_isa(H5G_entry_t *ent, hid_t dxpl_id); static H5G_t * H5G_open_oid(H5G_entry_t *ent, hid_t dxpl_id); static H5G_t *H5G_rootof(H5F_t *f); -static herr_t H5G_link(H5G_entry_t *cur_loc, const char *cur_name, - H5G_entry_t *new_loc, const char *new_name, +static herr_t H5G_link(H5G_entry_t *cur_loc, const char *cur_name, + H5G_entry_t *new_loc, const char *new_name, H5G_link_t type, unsigned namei_flags, hid_t dxpl_id); static herr_t H5G_get_num_objs(H5G_entry_t *grp, hsize_t *num_objs, hid_t dxpl_id); static ssize_t H5G_get_objname_by_idx(H5G_entry_t *loc, hsize_t idx, char* name, size_t size, hid_t dxpl_id); @@ -244,7 +244,7 @@ H5Gcreate(hid_t loc_id, const char *name, size_t size_hint) HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a location"); if (!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name given"); - + /* Create the group */ if (NULL == (grp = H5G_create(loc, name, size_hint, H5AC_dxpl_id))) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to create group"); @@ -394,7 +394,7 @@ H5Giterate(hid_t loc_id, const char *name, int *idx_p, H5G_bt_ud2_t udata; H5G_t *grp = NULL; herr_t ret_value; - + FUNC_ENTER_API(H5Giterate, FAIL); H5TRACE5("e","is*Isxx",loc_id,name,idx_p,op,op_data); @@ -456,15 +456,15 @@ done: /*------------------------------------------------------------------------- * Function: H5Gget_num_objs * - * Purpose: Returns the number of objects in the group. It iterates + * Purpose: Returns the number of objects in the group. It iterates * all B-tree leaves and sum up total number of group members. * - * Return: Success: Non-negative + * Return: Success: Non-negative * - * Failure: Negative + * Failure: Negative * * Programmer: Raymond Lu - * Nov 20, 2002 + * Nov 20, 2002 * * Modifications: * @@ -475,7 +475,7 @@ H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs) { H5G_entry_t *loc = NULL; /* Pointer to symbol table entry */ herr_t ret_value; - + FUNC_ENTER_API(H5Gget_num_objs, FAIL); H5TRACE2("e","i*h",loc_id,num_objs); @@ -508,12 +508,12 @@ done: * If a zero is returned for the name's length, then there is no name * associated with the ID. * - * Return: Success: Non-negative + * Return: Success: Non-negative * - * Failure: Negative + * Failure: Negative * * Programmer: Raymond Lu - * Nov 20, 2002 + * Nov 20, 2002 * * Modifications: * @@ -546,14 +546,14 @@ done: * Function: H5Gget_objtype_by_idx * * Purpose: Returns the type of objects in the group by giving index. - * * - * Return: Success: H5G_GROUP(1), H5G_DATASET(2), H5G_TYPE(3) * - * Failure: H5G_UNKNOWN + * Return: Success: H5G_GROUP(1), H5G_DATASET(2), H5G_TYPE(3) + * + * Failure: H5G_UNKNOWN * * Programmer: Raymond Lu - * Nov 20, 2002 + * Nov 20, 2002 * * Modifications: * @@ -589,7 +589,7 @@ H5Gget_objtype_by_idx(hid_t loc_id, hsize_t idx) { H5G_entry_t *loc = NULL; /* Pointer to symbol table entry */ H5G_obj_t ret_value; - + FUNC_ENTER_API(H5Gget_objtype_by_idx, H5G_UNKNOWN); H5TRACE2("Go","ih",loc_id,idx); @@ -615,7 +615,7 @@ done: * Purpose: Renames an object within an HDF5 file. The original name SRC * is unlinked from the group graph and the new name DST is * inserted as an atomic operation. Both names are interpreted - * relative to SRC_LOC_ID and DST_LOC_ID, which are either a file + * relative to SRC_LOC_ID and DST_LOC_ID, which are either a file * ID or a group ID. * * Return: Non-negative on success/Negative on failure @@ -631,7 +631,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Gmove2(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, +H5Gmove2(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *dst_name) { H5G_entry_t *src_loc=NULL; @@ -660,7 +660,7 @@ H5Gmove2(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, } else if(src_loc->file != dst_loc->file) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "source and destination should be in the same file."); - + if (H5G_move(src_loc, src_name, dst_loc, dst_name, H5AC_dxpl_id)<0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to change object name"); @@ -676,8 +676,8 @@ done: * CUR_NAME. * * If TYPE is H5G_LINK_HARD then CUR_NAME must name an existing - * object. CUR_NAME and NEW_NAME are interpreted relative to - * CUR_LOC_ID and NEW_LOC_ID, which is either a file ID or a + * object. CUR_NAME and NEW_NAME are interpreted relative to + * CUR_LOC_ID and NEW_LOC_ID, which is either a file ID or a * group ID. * * If TYPE is H5G_LINK_SOFT then CUR_NAME can be anything and is @@ -697,7 +697,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Glink2(hid_t cur_loc_id, const char *cur_name, H5G_link_t type, +H5Glink2(hid_t cur_loc_id, const char *cur_name, H5G_link_t type, hid_t new_loc_id, const char *new_name) { H5G_entry_t *cur_loc = NULL; @@ -763,7 +763,7 @@ H5Gunlink(hid_t loc_id, const char *name) { H5G_entry_t *loc = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Gunlink, FAIL); H5TRACE2("e","is",loc_id,name); @@ -805,7 +805,7 @@ H5Gget_objinfo(hid_t loc_id, const char *name, hbool_t follow_link, { H5G_entry_t *loc = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Gget_objinfo, FAIL); H5TRACE4("e","isbx",loc_id,name,follow_link,statbuf); @@ -847,7 +847,7 @@ H5Gget_linkval(hid_t loc_id, const char *name, size_t size, char *buf/*out*/) { H5G_entry_t *loc = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Gget_linkval, FAIL); H5TRACE4("e","iszx",loc_id,name,size,buf); @@ -888,7 +888,7 @@ H5Gset_comment(hid_t loc_id, const char *name, const char *comment) { H5G_entry_t *loc = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Gset_comment, FAIL); H5TRACE3("e","iss",loc_id,name,comment); @@ -933,7 +933,7 @@ H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize, char *buf) { H5G_entry_t *loc = NULL; int ret_value; - + FUNC_ENTER_API(H5Gget_comment, FAIL); H5TRACE4("Is","iszs",loc_id,name,bufsize,buf); @@ -956,7 +956,7 @@ done: *------------------------------------------------------------------------- * N O A P I F U N C T I O N S B E Y O N D T H I S P O I N T *------------------------------------------------------------------------- - *------------------------------------------------------------------------- + *------------------------------------------------------------------------- */ /*------------------------------------------------------------------------- @@ -1025,7 +1025,7 @@ H5G_term_interface(void) int n=0; FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_term_interface); - + if (H5_interface_initialize_g) { if ((n=H5I_nmembers(H5I_GROUP))) { H5I_clear_group(H5I_GROUP, FALSE); @@ -1035,7 +1035,7 @@ H5G_term_interface(void) H5MM_xfree(H5G_type_g[i].desc); H5G_ntypes_g = H5G_atypes_g = 0; H5G_type_g = H5MM_xfree(H5G_type_g); - + /* Destroy the group object id group */ H5I_destroy_group(H5I_GROUP); @@ -1048,7 +1048,7 @@ H5G_term_interface(void) n = 1; /*H5I*/ } } - + FUNC_LEAVE_NOAPI(n); } @@ -1079,7 +1079,7 @@ H5G_register_type(int type, htri_t(*isa)(H5G_entry_t*, hid_t), const char *_desc char *desc = NULL; size_t i; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_register_type); assert(type>=0); @@ -1113,7 +1113,7 @@ H5G_register_type(int type, htri_t(*isa)(H5G_entry_t*, hid_t), const char *_desc H5G_atypes_g = n; H5G_type_g = x; } - + /* Add a new entry */ H5G_type_g[H5G_ntypes_g].type = type; H5G_type_g[H5G_ntypes_g].isa = isa; @@ -1192,7 +1192,7 @@ static const char * H5G_basename(const char *name, size_t *size_p) { size_t i; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_basename); /* Find the end of the base name */ @@ -1235,7 +1235,7 @@ H5G_normalize(const char *name) size_t s,d; /* Positions within the strings */ unsigned last_slash; /* Flag to indicate last character was a slash */ char *ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_normalize); /* Sanity check */ @@ -1331,7 +1331,7 @@ done: * component of the name is a mount point then H5F_mountpoint() * is not called and information about the mount point itself is * returned. - * + * * Errors: * * Return: Success: Non-negative if name can be fully resolved. @@ -1387,7 +1387,7 @@ H5G_namei(const H5G_entry_t *loc_ent, const char *name, const char **rest/*out*/ unsigned last_comp = 0; /* Flag to indicate that a component is the last component in the name */ unsigned did_insert = 0; /* Flag to indicate that H5G_stab_insert was called */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_namei); /* Set up "out" parameters */ @@ -1407,7 +1407,7 @@ H5G_namei(const H5G_entry_t *loc_ent, const char *name, const char **rest/*out*/ null_obj = 0; if (!nlinks) nlinks = &_nlinks; - + /* Check args */ if (!name || !*name) HGOTO_ERROR (H5E_SYM, H5E_NOTFOUND, FAIL, "no name given"); @@ -1421,7 +1421,7 @@ H5G_namei(const H5G_entry_t *loc_ent, const char *name, const char **rest/*out*/ /* Check if we need to get the root group's entry */ if ('/' == *name) { H5G_t *tmp_grp; /* Temporary pointer to root group of file */ - + tmp_grp=H5G_rootof(loc_ent->file); assert(tmp_grp); @@ -1432,7 +1432,7 @@ H5G_namei(const H5G_entry_t *loc_ent, const char *name, const char **rest/*out*/ /* Deep copy of the symbol table entry */ if (H5G_ent_copy(obj_ent, loc_ent,H5G_COPY_DEEP)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to copy entry"); - + HDmemset(grp_ent, 0, sizeof(H5G_entry_t)); grp_ent->header = HADDR_UNDEF; @@ -1536,11 +1536,11 @@ H5G_namei(const H5G_entry_t *loc_ent, const char *name, const char **rest/*out*/ */ if (0==(target & H5G_TARGET_MOUNT) || !last_comp) H5F_mountpoint(obj_ent/*in,out*/); - + /* next component */ name += nchars; } /* end while */ - + /* Update the "rest of name" pointer */ if (rest) *rest = name; /*final null */ @@ -1597,7 +1597,7 @@ H5G_traverse_slink (H5G_entry_t *grp_ent/*in,out*/, H5RS_str_t *tmp_user_path_r=NULL, *tmp_canon_path_r=NULL; /* Temporary pointer to object's user path & canonical path */ const H5HL_t *heap; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_traverse_slink); /* Portably initialize the temporary group entry */ @@ -1617,7 +1617,7 @@ H5G_traverse_slink (H5G_entry_t *grp_ent/*in,out*/, if (H5HL_unprotect(grp_ent->file, dxpl_id, heap, stab_mesg.heap_addr) < 0) HGOTO_ERROR (H5E_SYM, H5E_NOTFOUND, FAIL, "unable to read unprotect link value") - + /* Hold the entry's name (& old_name) to restore later */ tmp_user_path_r=obj_ent->user_path_r; obj_ent->user_path_r=NULL; @@ -1804,7 +1804,7 @@ H5G_create(H5G_entry_t *loc, const char *name, size_t size_hint, hid_t dxpl_id) if (H5G_stab_create(file, dxpl_id, size_hint, &(grp->ent)/*out*/) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, NULL, "can't create grp"); stab_init=1; /* Indicate that the symbol table information is valid */ - + /* insert child name into parent */ if(H5G_insert(loc,name,&(grp->ent), dxpl_id)<0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, NULL, "can't insert group"); @@ -1861,7 +1861,7 @@ static htri_t H5G_isa(H5G_entry_t *ent, hid_t dxpl_id) { htri_t ret_value; - + FUNC_ENTER_NOAPI_NOINIT(H5G_isa); assert(ent); @@ -1896,7 +1896,7 @@ static htri_t H5G_link_isa(H5G_entry_t *ent, hid_t UNUSED dxpl_id) { htri_t ret_value; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_link_isa); assert(ent); @@ -2101,7 +2101,7 @@ H5G_close(H5G_t *grp) if(H5G_free_ent_name(&(grp->ent))<0) { H5FL_FREE (H5G_t,grp); - HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't free group entry name"); + HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "can't free group entry name"); } } @@ -2406,7 +2406,7 @@ H5G_loc (hid_t loc_id) if (NULL==(ret_value=H5A_entof(attr))) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "unable to get symbol table entry of attribute"); break; - + case H5I_REFERENCE: HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "unable to get symbol table entry of reference"); @@ -2451,7 +2451,7 @@ H5G_link (H5G_entry_t *cur_loc, const char *cur_name, H5G_entry_t *new_loc, size_t nchars; /*characters in component */ size_t offset; /*offset to sym-link value */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_link); /* Check args */ @@ -2472,7 +2472,7 @@ H5G_link (H5G_entry_t *cur_loc, const char *cur_name, H5G_entry_t *new_loc, * Lookup the the new_name so we can get the group which will contain * the new entry. The entry shouldn't exist yet. */ - if (H5G_namei(new_loc, norm_new_name, &rest, &grp_ent, NULL, + if (H5G_namei(new_loc, norm_new_name, &rest, &grp_ent, NULL, H5G_TARGET_NORMAL, NULL, H5G_NAMEI_TRAVERSE, NULL, dxpl_id)>=0) HGOTO_ERROR (H5E_SYM, H5E_EXISTS, FAIL, "already exists"); H5E_clear (); /*it's okay that we didn't find it*/ @@ -2533,7 +2533,7 @@ done: /* Free the group's ID to name buffer, if creating a soft link */ if(type == H5G_LINK_SOFT) H5G_free_ent_name(&grp_ent); - + /* Free the ID to name buffer */ if(cur_obj_init) H5G_free_ent_name(&cur_obj); @@ -2570,7 +2570,7 @@ H5G_get_type(H5G_entry_t *ent, hid_t dxpl_id) htri_t isa; size_t i; int ret_value=H5G_UNKNOWN; /* Return value */ - + FUNC_ENTER_NOAPI(H5G_get_type, H5G_UNKNOWN); for (i=H5G_ntypes_g; i>0; --i) { @@ -2616,7 +2616,7 @@ H5G_get_objinfo (H5G_entry_t *loc, const char *name, hbool_t follow_link, { H5G_entry_t grp_ent, obj_ent; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5G_get_objinfo, FAIL); assert (loc); @@ -2702,27 +2702,27 @@ done: /*------------------------------------------------------------------------- * Function: H5G_get_num_objs * - * Purpose: Private function for H5Gget_num_objs. Returns the number - * of objects in the group. It iterates all B-tree leaves + * Purpose: Private function for H5Gget_num_objs. Returns the number + * of objects in the group. It iterates all B-tree leaves * and sum up total number of group members. * - * Return: Success: Non-negative + * Return: Success: Non-negative * - * Failure: Negative + * Failure: Negative * * Programmer: Raymond Lu - * Nov 20, 2002 + * Nov 20, 2002 * * Modifications: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5G_get_num_objs(H5G_entry_t *loc, hsize_t *num_objs, hid_t dxpl_id) { H5O_stab_t stab_mesg; /*info about B-tree */ herr_t ret_value; - + FUNC_ENTER_NOAPI_NOINIT(H5G_get_num_objs); /* Sanity check */ @@ -2740,9 +2740,9 @@ H5G_get_num_objs(H5G_entry_t *loc, hsize_t *num_objs, hid_t dxpl_id) if ((ret_value = H5B_iterate (loc->file, dxpl_id, H5B_SNODE, H5G_node_sumup, stab_mesg.btree_addr, num_objs))<0) HERROR (H5E_SYM, H5E_CANTINIT, "iteration operator failed"); - + done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value); } @@ -2752,24 +2752,24 @@ done: * Purpose: Private function for H5Gget_objname_by_idx. * Returns the name of objects in the group by giving index. * - * Return: Success: Non-negative + * Return: Success: Non-negative * - * Failure: Negative + * Failure: Negative * * Programmer: Raymond Lu - * Nov 20, 2002 + * Nov 20, 2002 * * Modifications: * *------------------------------------------------------------------------- */ -static ssize_t +static ssize_t H5G_get_objname_by_idx(H5G_entry_t *loc, hsize_t idx, char* name, size_t size, hid_t dxpl_id) { H5O_stab_t stab_mesg; /*info about local heap & B-tree */ H5G_bt_ud3_t udata; /* Iteration information */ ssize_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_get_objname_by_idx); /* Sanity check */ @@ -2789,7 +2789,7 @@ H5G_get_objname_by_idx(H5G_entry_t *loc, hsize_t idx, char* name, size_t size, h if ((ret_value = H5B_iterate (loc->file, dxpl_id, H5B_SNODE, H5G_node_name, stab_mesg.btree_addr, &udata))<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "iteration operator failed"); - + /* If we don't know the name now, we almost certainly went out of bounds */ if(udata.name==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "index out of bound"); @@ -2818,26 +2818,26 @@ done: * Purpose: Private function for H5Gget_objtype_by_idx. * Returns the type of objects in the group by giving index. * - * Return: Success: H5G_GROUP(1), H5G_DATASET(2), H5G_TYPE(3) + * Return: Success: H5G_GROUP(1), H5G_DATASET(2), H5G_TYPE(3) * - * Failure: UNKNOWN + * Failure: UNKNOWN * * Programmer: Raymond Lu - * Nov 20, 2002 + * Nov 20, 2002 * * Modifications: * *------------------------------------------------------------------------- */ -static int +static int H5G_get_objtype_by_idx(H5G_entry_t *loc, hsize_t idx, hid_t dxpl_id) { H5O_stab_t stab_mesg; /*info about local heap & B-tree */ H5G_bt_ud3_t udata; /* User data for B-tree callback */ int ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_get_objtype_by_idx); - + /* Sanity check */ assert(loc); @@ -2850,12 +2850,12 @@ H5G_get_objtype_by_idx(H5G_entry_t *loc, hsize_t idx, hid_t dxpl_id) udata.num_objs = 0; udata.mesg = &stab_mesg; udata.type = H5G_UNKNOWN; - + /* Iterate over the group members */ if (H5B_iterate (loc->file, dxpl_id, H5B_SNODE, H5G_node_type, stab_mesg.btree_addr, &udata)<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5G_UNKNOWN, "iteration operator failed"); - + /* If we don't know the type now, we almost certainly went out of bounds */ if(udata.type==H5G_UNKNOWN) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5G_UNKNOWN, "index out of bound"); @@ -2898,7 +2898,7 @@ H5G_linkval (H5G_entry_t *loc, const char *name, size_t size, char *buf/*out*/, H5O_stab_t stab_mesg; const H5HL_t *heap; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_linkval); /* @@ -2920,7 +2920,7 @@ H5G_linkval (H5G_entry_t *loc, const char *name, size_t size, char *buf/*out*/, if (NULL == (heap = H5HL_protect(grp_ent.file, dxpl_id, stab_mesg.heap_addr))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "unable to read protect link value") - + s = H5HL_offset_into(grp_ent.file, heap, obj_ent.cache.slink.lval_offset); /* Copy to output buffer */ @@ -2962,7 +2962,7 @@ H5G_set_comment(H5G_entry_t *loc, const char *name, const char *buf, hid_t dxpl_ H5G_entry_t obj_ent; H5O_name_t comment; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_set_comment); /* Get the symbol table entry for the object */ @@ -3017,7 +3017,7 @@ H5G_get_comment(H5G_entry_t *loc, const char *name, size_t bufsize, char *buf, h H5O_name_t comment; H5G_entry_t obj_ent; int ret_value; - + FUNC_ENTER_NOAPI_NOINIT(H5G_get_comment); /* Get the symbol table entry for the object */ @@ -3044,7 +3044,7 @@ done: FUNC_LEAVE_NOAPI(ret_value); } - + /*------------------------------------------------------------------------- * Function: H5G_unlink @@ -3073,7 +3073,7 @@ H5G_unlink(H5G_entry_t *loc, const char *name, hid_t dxpl_id) H5G_stat_t statbuf; /* Info about object to unlink */ H5RS_str_t *name_r; /* Ref-counted version of name */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_unlink); /* Sanity check */ @@ -3100,7 +3100,7 @@ H5G_unlink(H5G_entry_t *loc, const char *name, hid_t dxpl_id) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "no containing group specified"); if (NULL==(base=H5G_basename(norm_name, &len)) || '/'==*base) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "problems obtaining object base name"); - + /* Remove the name from the symbol table */ if (H5G_stab_remove(&grp_ent, base, dxpl_id)<0) HGOTO_ERROR(H5E_SYM, H5E_CANTDELETE, FAIL, "unable to unlink name from symbol table"); @@ -3146,7 +3146,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5G_move(H5G_entry_t *src_loc, const char *src_name, H5G_entry_t *dst_loc, +H5G_move(H5G_entry_t *src_loc, const char *src_name, H5G_entry_t *dst_loc, const char *dst_name, hid_t dxpl_id) { H5G_stat_t sb; @@ -3156,7 +3156,7 @@ H5G_move(H5G_entry_t *src_loc, const char *src_name, H5G_entry_t *dst_loc, H5RS_str_t *src_name_r; /* Ref-counted version of src name */ H5RS_str_t *dst_name_r; /* Ref-counted version of dest name */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_move); /* Sanity check */ @@ -3183,7 +3183,7 @@ H5G_move(H5G_entry_t *src_loc, const char *src_name, H5G_entry_t *dst_loc, H5G_TARGET_NORMAL, dxpl_id)<0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to rename symbolic link"); H5MM_xfree(linkval); - + } else { /* * Rename the object. @@ -3194,7 +3194,7 @@ H5G_move(H5G_entry_t *src_loc, const char *src_name, H5G_entry_t *dst_loc, } /* Search the open ID list and replace names for the move operation - * This has to be done here because H5G_link and H5G_unlink have + * This has to be done here because H5G_link and H5G_unlink have * internal object entries, and do not modify the entries list */ if (H5G_namei(src_loc, src_name, NULL, NULL, &obj_ent, H5G_TARGET_NORMAL|H5G_TARGET_SLINK, NULL, H5G_NAMEI_TRAVERSE, NULL, dxpl_id)) @@ -3315,9 +3315,9 @@ H5G_free_grp_name(H5G_t *grp) { H5G_entry_t *ent; /* Group object's entry */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5G_free_grp_name, FAIL); - + /* Check args */ assert(grp && grp->shared); assert(grp->shared->fo_count > 0); @@ -3345,7 +3345,7 @@ done: * * Date: August 22, 2002 * - * Comments: + * Comments: * * Modifications: * @@ -3355,9 +3355,9 @@ herr_t H5G_free_ent_name(H5G_entry_t *ent) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5G_free_ent_name, FAIL); - + /* Check args */ assert(ent); @@ -3369,7 +3369,7 @@ H5G_free_ent_name(H5G_entry_t *ent) H5RS_decr(ent->canon_path_r); ent->canon_path_r=NULL; } /* end if */ - + done: FUNC_LEAVE_NOAPI(ret_value); } @@ -3391,7 +3391,7 @@ done: * * Date: June 11, 2002 * - * Comments: + * Comments: * * Modifications: * @@ -3406,7 +3406,7 @@ H5G_replace_name(int type, H5G_entry_t *loc, unsigned search_group=0; /* Flag to indicate that groups are to be searched */ unsigned search_dataset=0; /* Flag to indicate that datasets are to be searched */ unsigned search_datatype=0; /* Flag to indicate that datatypes are to be searched */ - herr_t ret_value = SUCCEED; + herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(H5G_replace_name, FAIL); @@ -3469,7 +3469,7 @@ H5G_replace_name(int type, H5G_entry_t *loc, if(search_datatype) H5I_search(H5I_DATATYPE, H5G_replace_ent, &names); -done: +done: FUNC_LEAVE_NOAPI(ret_value); } @@ -3486,7 +3486,7 @@ done: * * Date: September 24, 2002 * - * Comments: + * Comments: * * Modifications: * @@ -3499,9 +3499,9 @@ H5G_common_path(const H5RS_str_t *fullpath_r, const H5RS_str_t *prefix_r) const char *prefix; /* Pointer to actual prefix string */ size_t nchars1,nchars2; /* Number of characters in components */ htri_t ret_value=FALSE; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_common_path); - + /* Get component of each name */ fullpath=H5RS_get_str(fullpath_r); assert(fullpath); @@ -3555,7 +3555,7 @@ done: * * Date: June 5, 2002 * - * Comments: + * Comments: * * Modifications: * @@ -3569,11 +3569,11 @@ H5G_replace_ent(void *obj_ptr, hid_t obj_id, void *key) H5F_t *top_ent_file; /* Top file in entry's mounted file chain */ H5F_t *top_loc_file; /* Top file in location's mounted file chain */ herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_replace_ent); - + assert(obj_ptr); - + /* Get the symbol table entry */ switch(H5I_get_type(obj_id)) { case H5I_GROUP: @@ -3588,7 +3588,7 @@ H5G_replace_ent(void *obj_ptr, hid_t obj_id, void *key) /* Avoid non-named datatypes */ if(!H5T_is_named((H5T_t*)obj_ptr)) HGOTO_DONE(SUCCEED); /* Do not exit search over IDs */ - + ent = H5T_entof((H5T_t*)obj_ptr); break; @@ -3596,7 +3596,7 @@ H5G_replace_ent(void *obj_ptr, hid_t obj_id, void *key) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "unknown data object"); } /* end switch */ assert(ent); - + switch(names->op) { /*------------------------------------------------------------------------- * OP_MOUNT @@ -3875,11 +3875,11 @@ H5G_replace_ent(void *obj_ptr, hid_t obj_id, void *key) /* Allocate space for the new user path */ if(NULL==(new_user_path = H5FL_BLK_MALLOC(str_buf,user_dst_len+1))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); - + /* Allocate space for the new canonical path */ if(NULL==(new_canon_path = H5FL_BLK_MALLOC(str_buf,canon_dst_len+1))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); - + /* Create the new names */ HDstrcpy(new_user_path,user_prefix); HDstrcat(new_user_path,dst_canon_prefix); @@ -3923,9 +3923,9 @@ H5G_replace_ent(void *obj_ptr, hid_t obj_id, void *key) default: HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid call"); } /* end switch */ - + done: - FUNC_LEAVE_NOAPI(ret_value); + FUNC_LEAVE_NOAPI(ret_value); } diff --git a/src/H5Gent.c b/src/H5Gent.c index 5800aed..2be75de 100644 --- a/src/H5Gent.c +++ b/src/H5Gent.c @@ -117,7 +117,7 @@ done: * symbol table entries. * * Errors: - * SYM CANTDECODE Can't decode. + * SYM CANTDECODE Can't decode. * * Return: Success: Non-negative, with *pp pointing to the first byte * after the last symbol. @@ -233,7 +233,7 @@ H5G_ent_decode(H5F_t *f, const uint8_t **pp, H5G_entry_t *ent) * symbol table entries. * * Errors: - * SYM CANTENCODE Can't encode. + * SYM CANTENCODE Can't encode. * * Return: Success: Non-negative, with *pp pointing to the first byte * after the last symbol. @@ -344,7 +344,7 @@ H5G_ent_encode(H5F_t *f, uint8_t **pp, const H5G_entry_t *ent) /* fill with zero */ while (*pp < p_ret) *(*pp)++ = 0; *pp = p_ret; - + FUNC_LEAVE_NOAPI(SUCCEED); } @@ -360,7 +360,7 @@ H5G_ent_encode(H5F_t *f, uint8_t **pp, const H5G_entry_t *ent) * * Date: August 2002 * - * Comments: + * Comments: * * Modifications: * Quincey Koziol, Sept. 25, 2002: @@ -448,7 +448,7 @@ H5G_ent_debug(H5F_t UNUSED *f, hid_t dxpl_id, const H5G_entry_t *ent, FILE * str { const char *lval = NULL; int nested_indent, nested_fwidth; - + FUNC_ENTER_NOAPI_NOFUNC(H5G_ent_debug); /* Calculate the indent & field width values for nested information */ @@ -504,7 +504,7 @@ H5G_ent_debug(H5F_t UNUSED *f, hid_t dxpl_id, const H5G_entry_t *ent, FILE * str else HDfprintf(stream, "%*s%-*s\n", nested_indent, "", nested_fwidth, "Warning: Invalid heap address given, name not displayed!"); break; - + default: HDfprintf(stream, "*** Unknown symbol type %d\n", ent->type); break; diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 14453ee..f865906 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -300,7 +300,7 @@ H5G_node_debug_key (FILE *stream, H5F_t *f, hid_t dxpl_id, int indent, int fwidt const H5HL_t *heap = NULL; const char *s; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_node_debug_key); assert (key); @@ -462,7 +462,7 @@ done: * * Pedro Vicente, 18 Sep 2002 * Added `id to name' support. - * + * *------------------------------------------------------------------------- */ static herr_t @@ -679,7 +679,7 @@ done: * 5/13/04 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1316,7 +1316,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, if (H5O_link(sn->entry+idx, -1, dxpl_id)<0) HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5B_INS_ERROR, "unable to decrement object link count"); } - + /* Remove the name from the local heap */ if (NULL == (heap = H5HL_protect(f, dxpl_id, bt_udata->heap_addr))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5B_INS_ERROR, "unable to protect symbol name"); @@ -1359,7 +1359,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, } sn = NULL; ret_value = H5B_INS_REMOVE; - + } else if (0==idx) { /* * We are about to remove the left-most entry from the symbol table @@ -1371,7 +1371,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, HDmemmove(sn->entry+idx, sn->entry+idx+1, (sn->nsyms-idx)*sizeof(H5G_entry_t)); ret_value = H5B_INS_NOOP; - + } else if (idx+1==sn->nsyms) { /* * We are about to remove the right-most entry from the symbol table @@ -1383,7 +1383,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, rt_key->offset = sn->entry[sn->nsyms-1].name_off; *rt_key_changed = TRUE; ret_value = H5B_INS_NOOP; - + } else { /* * We are about to remove an entry from the middle of a symbol table @@ -1426,7 +1426,7 @@ H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key/*in,out*/, sn = NULL; ret_value = H5B_INS_REMOVE; } /* end else */ - + done: if (sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, FALSE)<0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5B_INS_ERROR, "unable to release symbol table node"); @@ -1551,7 +1551,7 @@ done: * Function: H5G_node_sumup * * Purpose: This function gets called during a group iterate operation - * to return total number of members in the group. + * to return total number of members in the group. * * Return: Non-negative on success/Negative on failure * @@ -1599,10 +1599,10 @@ done: * Purpose: This function gets called during a group iterate operation * to return object name by giving idx. * - * Return: 0 if object isn't found in this node; 1 if object is found; + * Return: 0 if object isn't found in this node; 1 if object is found; * Negative on failure * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Nov 20, 2002 * * Modifications: @@ -1617,7 +1617,7 @@ H5G_node_name(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, const H5HL_t *heap = NULL; size_t name_off; hsize_t loc_idx; - const char *name; + const char *name; H5G_node_t *sn = NULL; int ret_value = H5B_ITER_CONT; @@ -1632,11 +1632,11 @@ H5G_node_name(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, if (NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, NULL, NULL, H5AC_READ))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_ITER_ERROR, "unable to load symbol table node"); - - /* Find the node, locate the object symbol table entry and retrieve the name */ + + /* Find the node, locate the object symbol table entry and retrieve the name */ if(bt_udata->idx >= bt_udata->num_objs && bt_udata->idx < (bt_udata->num_objs+sn->nsyms)) { - loc_idx = bt_udata->idx - bt_udata->num_objs; - name_off = sn->entry[loc_idx].name_off; + loc_idx = bt_udata->idx - bt_udata->num_objs; + name_off = sn->entry[loc_idx].name_off; if (NULL == (heap = H5HL_protect(f, dxpl_id, bt_udata->mesg->heap_addr))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, H5B_ITER_ERROR, "unable to protect symbol name"); @@ -1672,7 +1672,7 @@ done: * Return: 0 if object isn't found in this node; 1 if found; * Negative on failure * - * Programmer: Raymond Lu + * Programmer: Raymond Lu * Nov 20, 2002 * * @@ -1694,13 +1694,13 @@ H5G_node_type(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, assert(H5F_addr_defined(addr)); assert(bt_udata); - /* Find the node, locate the object symbol table entry and retrieve the type */ + /* Find the node, locate the object symbol table entry and retrieve the type */ if (NULL == (sn = H5AC_protect(f, dxpl_id, H5AC_SNODE, addr, NULL, NULL, H5AC_READ))) HGOTO_ERROR(H5E_SYM, H5E_CANTLOAD, H5B_ITER_ERROR, "unable to load symbol table node"); if(bt_udata->idx >= bt_udata->num_objs && bt_udata->idx < (bt_udata->num_objs+sn->nsyms)) { - loc_idx = bt_udata->idx - bt_udata->num_objs; - bt_udata->type = H5G_get_type(&(sn->entry[loc_idx]), dxpl_id); + loc_idx = bt_udata->idx - bt_udata->num_objs; + bt_udata->type = H5G_get_type(&(sn->entry[loc_idx]), dxpl_id); ret_value = H5B_ITER_STOP; } else { bt_udata->num_objs += sn->nsyms; @@ -1709,7 +1709,7 @@ H5G_node_type(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr, done: if (sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, FALSE) != SUCCEED) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5B_ITER_ERROR, "unable to release object header"); - + FUNC_LEAVE_NOAPI(ret_value); } diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h index 41ae858..2753a64 100644 --- a/src/H5Gpkg.h +++ b/src/H5Gpkg.h @@ -105,7 +105,7 @@ typedef struct H5G_bt_ud2_t { /* upward */ int final_ent; /*final entry looked at */ - + } H5G_bt_ud2_t; /* diff --git a/src/H5Gpublic.h b/src/H5Gpublic.h index 3d74704..611ff08 100644 --- a/src/H5Gpublic.h +++ b/src/H5Gpublic.h @@ -74,7 +74,7 @@ typedef enum H5G_obj_t { H5G_RESERVED_5, /* Reserved for future use */ H5G_RESERVED_6, /* Reserved for future use */ H5G_RESERVED_7 /* Reserved for future use */ -} H5G_obj_t; +} H5G_obj_t; #endif /*H5_WANT_H5_V1_4_COMPAT*/ #define H5G_NTYPES 256 /* Max possible number of types */ @@ -96,7 +96,7 @@ typedef struct H5G_stat_t { size_t linklen; /*symbolic link value length */ H5O_stat_t ohdr; /* Object header information */ } H5G_stat_t; - + #define H5G_SAME_LOC 0 #define H5Glink(cur_loc_id, type, cur_name, new_name) \ H5Glink2(cur_loc_id, cur_name, type, H5G_SAME_LOC, new_name) @@ -118,7 +118,7 @@ H5_DLL int H5Gget_objtype_by_idx(hid_t loc_id, hsize_t idx); #else /*H5_WANT_H5_V1_4_COMPAT*/ H5_DLL H5G_obj_t H5Gget_objtype_by_idx(hid_t loc_id, hsize_t idx); #endif /*H5_WANT_H5_V1_4_COMPAT*/ -H5_DLL herr_t H5Gmove2(hid_t src_loc, const char *src, hid_t dst_loc, +H5_DLL herr_t H5Gmove2(hid_t src_loc, const char *src, hid_t dst_loc, const char *dst); H5_DLL herr_t H5Glink2(hid_t src_loc, const char *cur_name, H5G_link_t type, hid_t dst_loc, const char *new_name); diff --git a/src/H5Gstab.c b/src/H5Gstab.c index 36e2119..66d9356 100644 --- a/src/H5Gstab.c +++ b/src/H5Gstab.c @@ -240,7 +240,7 @@ H5G_stab_insert(H5G_entry_t *grp_ent, const char *name, H5G_entry_t *obj_ent, hi /* insert */ if (H5B_insert(grp_ent->file, dxpl_id, H5B_SNODE, stab.btree_addr, &udata) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTINSERT, FAIL, "unable to insert entry"); - + /* update the name offset in the entry */ obj_ent->name_off = udata.ent.name_off; @@ -269,7 +269,7 @@ H5G_stab_remove(H5G_entry_t *grp_ent, const char *name, hid_t dxpl_id) H5O_stab_t stab; /*symbol table message */ H5G_bt_ud1_t udata; /*data to pass through B-tree */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5G_stab_remove, FAIL); assert(grp_ent && grp_ent->file); @@ -309,18 +309,18 @@ done: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5G_insert_name(H5G_entry_t *loc, H5G_entry_t *obj, const char *name) { size_t name_len; /* Length of name to append */ - herr_t ret_value = SUCCEED; - + herr_t ret_value = SUCCEED; + FUNC_ENTER_NOAPI_NOINIT(H5G_insert_name); assert(loc); assert(obj); assert(name); - + /* Reset the object's previous names, if they exist */ if(obj->user_path_r) { H5RS_decr(obj->user_path_r); @@ -432,8 +432,8 @@ herr_t H5G_stab_delete(H5F_t *f, hid_t dxpl_id, haddr_t btree_addr, haddr_t heap_addr) { H5G_bt_ud1_t udata; /*data to pass through B-tree */ - herr_t ret_value = SUCCEED; - + herr_t ret_value = SUCCEED; + FUNC_ENTER_NOAPI(H5G_stab_delete, FAIL); assert(f); diff --git a/src/H5HG.c b/src/H5HG.c index 0c19ebd..8acb789 100644 --- a/src/H5HG.c +++ b/src/H5HG.c @@ -176,14 +176,14 @@ H5FL_BLK_DEFINE_STATIC(heap_chunk); * Modified function to return the disk address of the new * global heap collection, or HADDR_UNDEF on failure. This * is necessary, as in some cases (i.e. flexible parallel) - * H5AC_set() will imediately flush and destroy the in memory - * version of the new collection. For the same reason, I + * H5AC_set() will imediately flush and destroy the in memory + * version of the new collection. For the same reason, I * moved the code which places the new collection on the cwfs * list to just before the call to H5AC_set(). * *------------------------------------------------------------------------- */ -static haddr_t +static haddr_t H5HG_create (H5F_t *f, hid_t dxpl_id, size_t size) { H5HG_heap_t *heap = NULL; @@ -191,7 +191,7 @@ H5HG_create (H5F_t *f, hid_t dxpl_id, size_t size) uint8_t *p = NULL; haddr_t addr; size_t n; - + FUNC_ENTER_NOAPI(H5HG_create, HADDR_UNDEF); /* Check args */ @@ -268,7 +268,7 @@ HDmemset(heap->chunk,0,size); f->shared->cwfs[0] = heap; f->shared->ncwfs = 1; } else { - HDmemmove (f->shared->cwfs+1, f->shared->cwfs, + HDmemmove (f->shared->cwfs+1, f->shared->cwfs, MIN (f->shared->ncwfs, H5HG_NCWFS-1)*sizeof(H5HG_heap_t*)); f->shared->cwfs[0] = heap; f->shared->ncwfs = MIN (H5HG_NCWFS, f->shared->ncwfs+1); @@ -323,7 +323,7 @@ H5HG_load (H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * udata1, size_t nalloc, need; size_t max_idx=0; /* The maximum index seen */ H5HG_heap_t *ret_value = NULL; /* Return value */ - + FUNC_ENTER_NOAPI(H5HG_load, NULL); /* check arguments */ @@ -469,9 +469,9 @@ H5HG_load (H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * udata1, f->shared->cwfs[0] = heap; } } - + ret_value = heap; - + done: if (!ret_value && heap) { if(H5HG_dest(f,heap)<0) @@ -505,7 +505,7 @@ static herr_t H5HG_flush (H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HG_heap_t *heap) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5HG_flush, FAIL); /* Check arguments */ @@ -548,7 +548,7 @@ static herr_t H5HG_dest (H5F_t *f, H5HG_heap_t *heap) { int i; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HG_dest); /* Check arguments */ @@ -721,7 +721,7 @@ H5HG_alloc (H5F_t *f, H5HG_heap_t *heap, size_t size) */ heap->obj[0].size = 0; heap->obj[0].begin = NULL; - + } else if (heap->obj[0].size-need >= H5HG_SIZEOF_OBJHDR (f)) { /* * Some free space remains and it's larger than a heap object header, @@ -735,7 +735,7 @@ H5HG_alloc (H5F_t *f, H5HG_heap_t *heap, size_t size) UINT32ENCODE(p, 0); /*reserved*/ H5F_ENCODE_LENGTH (f, p, heap->obj[0].size); assert(H5HG_ISALIGNED(heap->obj[0].size)); - + } else { /* * Some free space remains but it's smaller than a heap object header, @@ -881,7 +881,7 @@ done: * * John Mainzer - 5/26/04 * Modified H5HG_create() to return the disk address of the - * new collection, instead of the address of its + * new collection, instead of the address of its * representation in core. This was necessary as in FP * mode, the cache will immediately flush and destroy any * entry inserted in it via H5AC_set(). I then modified @@ -899,7 +899,7 @@ H5HG_insert (H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out* H5HG_heap_t *heap = NULL; hbool_t found=0; /* Flag to indicate a heap with enough space was found */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5HG_insert, FAIL); /* Check args */ @@ -913,24 +913,24 @@ H5HG_insert (H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out* /* Find a large enough collection on the CWFS list */ need = H5HG_SIZEOF_OBJHDR(f) + H5HG_ALIGN(size); - /* Note that we don't have metadata cache locks on the entries in - * f->shared->cwfs. + /* Note that we don't have metadata cache locks on the entries in + * f->shared->cwfs. * * In the current situation, this doesn't matter, as we are single - * threaded, and as best I can tell, entries are added to and deleted - * from f->shared->cwfs as they are added to and deleted from the + * threaded, and as best I can tell, entries are added to and deleted + * from f->shared->cwfs as they are added to and deleted from the * metadata cache. * * To be proper, we should either lock each entry in f->shared->cwfs - * as we examine it, or lock the whole array. However, at present + * as we examine it, or lock the whole array. However, at present * I don't see the point as there will be significant overhead, - * and protecting and unprotecting all the collections in the global + * and protecting and unprotecting all the collections in the global * heap on a regular basis will skew the replacement policy. * - * However, there is a bigger issue -- as best I can tell, we only look - * for free space in global heap chunks that are in cache. If we can't + * However, there is a bigger issue -- as best I can tell, we only look + * for free space in global heap chunks that are in cache. If we can't * find any, we allocate a new chunk. This may be a problem in FP mode, - * as the metadata cache is disabled. Do we allocate a new heap + * as the metadata cache is disabled. Do we allocate a new heap * collection for every entry in this case? * * Note that all this comes from a cursory read of the source. Don't @@ -983,8 +983,8 @@ H5HG_insert (H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out* } /* end if */ else { - /* Move the collection forward in the CWFS list, if it's not - * already at the front + /* Move the collection forward in the CWFS list, if it's not + * already at the front */ if (cwfsno>0) { H5HG_heap_t *tmp = f->shared->cwfs[cwfsno]; @@ -995,13 +995,13 @@ H5HG_insert (H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out* } /* end else */ HDassert(H5F_addr_defined(addr)); - + if ( NULL == (heap = H5AC_protect(f, dxpl_id, H5AC_GHEAP, addr, NULL, NULL, H5AC_WRITE)) ) HGOTO_ERROR (H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load heap"); /* Split the free space to make room for the new object */ idx = H5HG_alloc (f, heap, size); - + /* Copy data into the heap */ if(size>0) { HDmemcpy(heap->obj[idx].begin+H5HG_SIZEOF_OBJHDR(f), obj, size); @@ -1052,7 +1052,7 @@ H5HG_read (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj, void *object/*out*/) size_t size; uint8_t *p = NULL; void *ret_value; - + FUNC_ENTER_NOAPI(H5HG_read, NULL); /* Check args */ @@ -1123,9 +1123,9 @@ H5HG_link (H5F_t *f, hid_t dxpl_id, const H5HG_t *hobj, int adjust) { H5HG_heap_t *heap = NULL; int ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5HG_link, FAIL); - + /* Check args */ assert (f); assert (hobj); @@ -1182,7 +1182,7 @@ H5HG_remove (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj) unsigned u; hbool_t deleted=FALSE; /* Whether the heap gets deleted */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5HG_remove, FAIL); /* Check args */ @@ -1200,7 +1200,7 @@ H5HG_remove (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj) obj_start = heap->obj[hobj->idx].begin; /* Include object header size */ need = H5HG_ALIGN(heap->obj[hobj->idx].size)+H5HG_SIZEOF_OBJHDR(f); - + /* Move the new free space to the end of the heap */ for (u=0; unused; u++) { if (heap->obj[u].begin > heap->obj[hobj->idx].begin) @@ -1254,7 +1254,7 @@ H5HG_remove (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj) f->shared->cwfs[f->shared->ncwfs-1] = heap; } } - + done: if (heap && H5AC_unprotect(f, dxpl_id, H5AC_GHEAP, hobj->addr, heap, deleted) != SUCCEED) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release object header"); diff --git a/src/H5HL.c b/src/H5HL.c index 293dfb6..080b90d 100644 --- a/src/H5HL.c +++ b/src/H5HL.c @@ -1083,7 +1083,7 @@ H5HL_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t buf_size, const void * (sizeof_hdr + heap->mem_alloc)); if (NULL==heap->chunk) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, (size_t)(-1), "memory allocation failed"); - + /* clear new section so junk doesn't appear in the file */ HDmemset(heap->chunk + sizeof_hdr + old_size, 0, need_more); } diff --git a/src/H5I.c b/src/H5I.c index 04c88f4..23fbc97 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -14,16 +14,16 @@ /* * FILE: H5I.c - Internal storage routines for handling "IDs" - * + * * REMARKS: ID's which allow objects (void *'s currently) to be bundled * into "groups" for more general storage. - * + * * DESIGN: The groups are stored in an array of pointers to store each * group in an element. Each "group" node contains a link to a * hash table to manage the IDs in each group. The allowed * "groups" are stored in an enum (called group_t) in * H5Ipublic.h. - * + * * AUTHOR: Quincey Koziol * * MODIFICATIONS: @@ -128,13 +128,13 @@ static herr_t H5I_debug(H5I_type_t grp); * * Failure: Negative * - * Programmer: + * Programmer: * * Modifications: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5I_init_interface(void) { FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5I_init_interface); @@ -161,7 +161,7 @@ H5I_init_interface(void) * * Failure: Negative. * - * Programmer: + * Programmer: * * Modifications: * @@ -233,7 +233,7 @@ H5I_term_interface(void) * *------------------------------------------------------------------------- */ -int +int H5I_init_group(H5I_type_t grp, size_t hash_size, unsigned reserved, H5I_free_t free_func) { @@ -272,7 +272,7 @@ H5I_init_group(H5I_type_t grp, size_t hash_size, unsigned reserved, if (NULL==grp_ptr->id_list) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); } - + /* Increment the count of the times this group has been initialized */ grp_ptr->count++; @@ -371,7 +371,7 @@ H5I_clear_group(H5I_type_t grp, hbool_t force) if (grp <= H5I_BADID || grp >= H5I_NGROUPS) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid group number"); - + grp_ptr = H5I_id_group_list_g[grp]; if (grp_ptr == NULL || grp_ptr->count <= 0) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid group"); @@ -458,7 +458,7 @@ H5I_clear_group(H5I_type_t grp, hbool_t force) } /* end else */ } /* end for */ } /* end for */ - + done: FUNC_LEAVE_NOAPI(ret_value); } @@ -473,7 +473,7 @@ done: * their reference counts. Destroying IDs involves calling * the free-func for each ID's object and then adding the ID * struct to the ID free list. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Unknown @@ -495,7 +495,7 @@ H5I_destroy_group(H5I_type_t grp) if (grp <= H5I_BADID || grp >= H5I_NGROUPS) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid group number"); - + grp_ptr = H5I_id_group_list_g[grp]; if (grp_ptr == NULL || grp_ptr->count <= 0) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid group"); @@ -513,7 +513,7 @@ H5I_destroy_group(H5I_type_t grp) } else { --(grp_ptr->count); } - + done: FUNC_LEAVE_NOAPI(ret_value); } @@ -540,7 +540,7 @@ H5I_destroy_group(H5I_type_t grp) * *------------------------------------------------------------------------- */ -hid_t +hid_t H5I_register(H5I_type_t grp, void *object) { H5I_id_group_t *grp_ptr=NULL; /*ptr to the group */ @@ -551,7 +551,7 @@ H5I_register(H5I_type_t grp, void *object) hid_t ret_value=SUCCEED; /*return value */ H5I_id_info_t *curr_id; /*ptr to the current atom */ unsigned i; /*counter */ - + FUNC_ENTER_NOAPI(H5I_register, FAIL); /* Check arguments */ @@ -644,13 +644,13 @@ H5I_register(H5I_type_t grp, void *object) * * Failure: NULL * - * Programmer: + * Programmer: * * Modifications: * *------------------------------------------------------------------------- */ -void * +void * H5I_object(hid_t id) { H5I_id_info_t *id_ptr = NULL; /*ptr to the new atom */ @@ -687,7 +687,7 @@ done: * *------------------------------------------------------------------------- */ -void * +void * H5I_object_verify(hid_t id, H5I_type_t id_type) { H5I_id_info_t *id_ptr = NULL; /*ptr to the new atom */ @@ -727,7 +727,7 @@ done: * *------------------------------------------------------------------------- */ -H5I_type_t +H5I_type_t H5I_get_type(hid_t id) { H5I_type_t ret_value = H5I_BADID; @@ -756,7 +756,7 @@ done: * * Failure: H5I_BADID, a negative value * - * Programmer: + * Programmer: * * Modifications: * Robb Matzke, 1999-08-23 @@ -793,13 +793,13 @@ done: * * Failure: NULL * - * Programmer: + * Programmer: * * Modifications: * *------------------------------------------------------------------------- */ -void * +void * H5I_remove(hid_t id) { H5I_id_group_t *grp_ptr = NULL;/*ptr to the atomic group */ @@ -951,7 +951,7 @@ H5I_dec_ref(hid_t id) grp_ptr = H5I_id_group_list_g[grp]; if (grp_ptr == NULL || grp_ptr->count <= 0) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid group number"); - + /* General lookup of the ID */ if ((id_ptr=H5I_find_id(id))==NULL) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't locate ID"); @@ -1224,7 +1224,7 @@ done: * * Failure: NULL * - * Programmer: + * Programmer: * * Modifications: * @@ -1283,10 +1283,10 @@ done: /*------------------------------------------------------------------------- * Function: H5Iget_name * - * Purpose: Gets a name of an object from its ID. + * Purpose: Gets a name of an object from its ID. * * Return: Success: The length of name. - * + * * Failure: -1 * * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu @@ -1433,14 +1433,14 @@ done: * Function: H5Iget_file_id * * Purpose: The public version of H5I_get_file_id(), obtains the file - * ID given an object ID. User has to close this ID. + * ID given an object ID. User has to close this ID. * * Return: Success: file ID * * Failure: a negative value * * Programmer: Raymond Lu - * Oct 27, 2003 + * Oct 27, 2003 * * Modifications: * @@ -1466,14 +1466,14 @@ done: * Function: H5I_get_file_id * * Purpose: The private version of H5Iget_file_id(), obtains the file - * ID given an object ID. + * ID given an object ID. * * Return: Success: file ID * * Failure: a negative value * * Programmer: Raymond Lu - * Oct 27, 2003 + * Oct 27, 2003 * * Modifications: * @@ -1491,7 +1491,7 @@ H5I_get_file_id(hid_t obj_id) switch(H5I_GROUP(obj_id)) { case H5I_FILE: ret_value = obj_id; - + /* Increment reference count on atom. */ if (H5I_inc_ref(ret_value)<0) HGOTO_ERROR (H5E_ATOM, H5E_CANTSET, FAIL, "incrementing file ID failed"); @@ -1514,7 +1514,7 @@ H5I_get_file_id(hid_t obj_id) default: HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid object ID"); - } + } done: FUNC_LEAVE_NOAPI(ret_value); diff --git a/src/H5Ipublic.h b/src/H5Ipublic.h index 33ad2ad..fccdc2d 100644 --- a/src/H5Ipublic.h +++ b/src/H5Ipublic.h @@ -44,7 +44,7 @@ typedef enum { H5I_VFL, /*group ID for virtual file layer */ H5I_GENPROP_CLS, /*group ID for generic property list classes */ H5I_GENPROP_LST, /*group ID for generic property lists */ - + H5I_NGROUPS /*number of valid groups, MUST BE LAST! */ } H5I_type_t; diff --git a/src/H5MF.c b/src/H5MF.c index b055e38..7ed3ec1 100644 --- a/src/H5MF.c +++ b/src/H5MF.c @@ -65,20 +65,20 @@ haddr_t H5MF_alloc(H5F_t *f, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) { haddr_t ret_value; - + FUNC_ENTER_NOAPI(H5MF_alloc, HADDR_UNDEF); /* check arguments */ assert(f); assert(size > 0); - + /* Fail if we don't have write access */ if (0==(f->intent & H5F_ACC_RDWR)) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTINIT, HADDR_UNDEF, "file is read-only"); /* Check that the file can address the new space */ if( H5MF_alloc_overflow(f, size) ) - HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "not enough address space in file"); + HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, HADDR_UNDEF, "not enough address space in file"); /* Allocate space from the virtual file layer */ if (HADDR_UNDEF==(ret_value=H5FD_alloc(f->shared->lf, type, dxpl_id, size))) @@ -187,7 +187,7 @@ H5MF_realloc(H5F_t *f, H5FD_mem_t type, hid_t dxpl_id, haddr_t old_addr, hsize_t hsize_t new_size) { haddr_t ret_value; - + FUNC_ENTER_NOAPI(H5MF_realloc, HADDR_UNDEF); /* Convert old relative address to absolute address */ @@ -331,7 +331,7 @@ H5MF_alloc_overflow(H5F_t *f, hsize_t size) /* Also add space that is "reserved" for data to be flushed * to disk (e.g., for object headers and the heap). - * This is the total amount of file space that will be + * This is the total amount of file space that will be * allocated. */ space_needed += f->shared->lf->reserved_alloc; diff --git a/src/H5MM.c b/src/H5MM.c index b08cd7d..415b2e2 100644 --- a/src/H5MM.c +++ b/src/H5MM.c @@ -20,7 +20,7 @@ * * Purpose: Memory management functions. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ diff --git a/src/H5MPprivate.h b/src/H5MPprivate.h index 7d5fda7..c0683a6 100644 --- a/src/H5MPprivate.h +++ b/src/H5MPprivate.h @@ -22,7 +22,7 @@ /*------------------------------------------------------------------------ * Purpose: Begin to collect MPE log information for a function. It should * be ahead of the actual function's process. - * + * * Programmer: Long Wang * *------------------------------------------------------------------------ @@ -34,7 +34,7 @@ */ #define eventa(func_name) h5_mpe_eventa #define eventb(func_name) h5_mpe_eventb -#define COLOR(func_name) color_ ## func_name +#define COLOR(func_name) color_ ## func_name #define MPE_LOG_VARS(func_name) \ static int eventa(func_name) = -1; \ static int eventb(func_name) = -1; \ @@ -54,7 +54,7 @@ /*------------------------------------------------------------------------ - * Purpose: Finish the collection of MPE log information for a function. + * Purpose: Finish the collection of MPE log information for a function. * It should be after the actual function's process. * * Programmer: Long Wang @@ -394,9 +394,9 @@ #define color_H5Zget_filter_info "red" #else -#define MPE_LOG_VARS(func_name) /* void */ -#define BEGIN_MPE_LOG(func_name) /* void */ -#define FINISH_MPE_LOG /* void */ +#define MPE_LOG_VARS(func_name) /* void */ +#define BEGIN_MPE_LOG(func_name) /* void */ +#define FINISH_MPE_LOG /* void */ #endif diff --git a/src/H5O.c b/src/H5O.c index 3f3ca8a..c58497a 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -20,7 +20,7 @@ * * Purpose: Object header virtual functions. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ @@ -299,7 +299,7 @@ H5O_init(H5F_t *f, hid_t dxpl_id, size_t size_hint, H5G_entry_t *ent/*out*/, had if (NULL == (oh->chunk[0].image = H5FL_BLK_CALLOC(chunk_image, size_hint))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed"); - + /* create the message list and initialize the first message */ oh->nmesgs = 1; oh->alloc_nmesgs = H5O_NMESGS; @@ -414,7 +414,7 @@ H5O_close(H5G_entry_t *obj_ent) } } #endif - + /* * If the file open object count has reached the number of open mount points * (each of which has a group open in the file) attempt to close the file. @@ -502,10 +502,10 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * _udata1, oh->version = *p++; if (H5O_VERSION != oh->version) HGOTO_ERROR(H5E_OHDR, H5E_VERSION, NULL, "bad object header version number"); - + /* reserved */ p++; - + /* decode number of messages */ UINT16DECODE(p, nmesgs); @@ -533,7 +533,7 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * _udata1, oh->alloc_nchunks = na; oh->chunk = x; } - + /* read the chunk raw data */ chunkno = oh->nchunks++; oh->chunk[chunkno].dirty = FALSE; @@ -544,7 +544,7 @@ H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED * _udata1, if (H5F_block_read(f, H5FD_MEM_OHDR, chunk_addr, chunk_size, dxpl_id, oh->chunk[chunkno].image) < 0) HGOTO_ERROR(H5E_OHDR, H5E_READERROR, NULL, "unable to read object header data"); - + /* load messages from this chunk */ for (p = oh->chunk[chunkno].image; p < oh->chunk[chunkno].image + chunk_size; p += mesg_size) { UINT16DECODE(p, id); @@ -687,11 +687,11 @@ H5O_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5O_t *oh) combine=1; } /* end if */ else { - if (H5F_block_write(f, H5FD_MEM_OHDR, addr, (size_t)H5O_SIZEOF_HDR(f), + if (H5F_block_write(f, H5FD_MEM_OHDR, addr, (size_t)H5O_SIZEOF_HDR(f), dxpl_id, buf) < 0) HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to write object header hdr to disk"); } /* end else */ - + /* encode messages */ for (u = 0, curr_msg=&oh->mesg[0]; u < oh->nmesgs; u++,curr_msg++) { if (curr_msg->dirty) { @@ -705,7 +705,7 @@ H5O_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5O_t *oh) *p++ = 0; /*reserved*/ *p++ = 0; /*reserved*/ *p++ = 0; /*reserved*/ - + if (curr_msg->native) { assert(curr_msg->type->encode); @@ -724,7 +724,7 @@ H5O_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5O_t *oh) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate space for object header data"); oh->chunk[cont->chunkno].addr = cont->addr; } - + /* * Encode the message. If the message is shared then we * encode a Shared Object message instead of the object @@ -910,7 +910,7 @@ done: * The value returned will probably be low unless the object * has just been flushed, as we simply total up the size of * the header with the sizes of the chunks. Thus any message - * that has been added since the last flush will not be + * that has been added since the last flush will not be * reflected in the total. * * Return: Non-negative on success/Negative on failure @@ -937,7 +937,7 @@ H5O_compute_size(const H5F_t *f, const H5O_t *oh, size_t *size_ptr) size = H5O_SIZEOF_HDR(f); - for (u = 0; u < oh->nchunks; u++) + for (u = 0; u < oh->nchunks; u++) size += oh->chunk[u].size; HDassert(size >= H5O_SIZEOF_HDR(f)); @@ -1061,7 +1061,7 @@ H5O_free (unsigned type_id, void *mesg) assert(type_idmesg[idx].flags & H5O_FLAG_CONSTANT) { HGOTO_ERROR(H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to modify constant message"); } else if (oh->mesg[idx].flags & H5O_FLAG_SHARED) { HGOTO_ERROR (H5E_OHDR, H5E_WRITEERROR, FAIL, "unable to modify shared (constant) message"); } - + /* Write the information to the message */ if(H5O_write_mesg(oh,idx,type,mesg,flags,update_flags)<0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to write message"); @@ -1897,14 +1897,14 @@ H5O_modify_real(H5G_entry_t *ent, const H5O_class_t *type, int overwrite, /* Update the modification time message if any */ if(update_flags&H5O_UPDATE_TIME) H5O_touch_oh(ent->file, oh, FALSE); - + /* Set return value */ ret_value = sequence; done: if (oh && H5AC_unprotect(ent->file, dxpl_id, H5AC_OHDR, ent->header, oh, FALSE) < 0) HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header"); - + FUNC_LEAVE_NOAPI(ret_value); } /* end H5O_modify_real() */ @@ -2062,7 +2062,7 @@ done: *------------------------------------------------------------------------- */ static int -H5O_append_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_class_t *type, +H5O_append_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, const H5O_class_t *type, unsigned flags, const void *mesg) { unsigned idx; /* Index of message to modify */ @@ -2244,7 +2244,7 @@ H5O_touch_oh(H5F_t *f, H5O_t *oh, hbool_t force) time_t now; size_t size; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5O_touch_oh); assert(oh); @@ -2307,7 +2307,7 @@ H5O_touch(H5G_entry_t *ent, hbool_t force, hid_t dxpl_id) { H5O_t *oh = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5O_touch, FAIL); /* check args */ @@ -2355,7 +2355,7 @@ H5O_bogus_oh(H5F_t *f, H5O_t *oh) int idx; size_t size; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER(H5O_bogus_oh, FAIL); assert(f); @@ -2409,7 +2409,7 @@ H5O_bogus(H5G_entry_t *ent, hid_t dxpl_id) { H5O_t *oh = NULL; herr_t ret_value = SUCCEED; - + FUNC_ENTER(H5O_bogus, FAIL); /* check args */ @@ -2541,7 +2541,7 @@ H5O_remove_real(H5G_entry_t *ent, const H5O_class_t *type, int sequence, hid_t d /* load the object header */ if (NULL == (oh = H5AC_protect(ent->file, dxpl_id, H5AC_OHDR, ent->header, NULL, NULL, H5AC_WRITE))) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, FAIL, "unable to load object header"); - + for (u = seq = 0, curr_msg=&oh->mesg[0]; u < oh->nmesgs; u++,curr_msg++) { if (type->id != curr_msg->type->id) continue; @@ -2714,7 +2714,7 @@ H5O_alloc_extend_chunk(H5F_t *f, H5O_t *oh, unsigned chunkno, size_t size) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, UFAIL, "memory allocation failed"); HDmemset(oh->chunk[chunkno].image+old_size, 0, oh->chunk[chunkno].size - old_size); - + /* adjust raw addresses for messages of this chunk */ if (old_addr != oh->chunk[chunkno].image) { for (u = 0; u < oh->nmesgs; u++) { @@ -2845,7 +2845,7 @@ H5O_alloc_new_chunk(H5F_t *f, H5O_t *oh, size_t size) oh->chunk[chunkno].size = size; if (NULL==(oh->chunk[chunkno].image = p = H5FL_BLK_CALLOC(chunk_image,size))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, UFAIL, "memory allocation failed"); - + /* * Make sure we have enough space for all possible new messages * that could be generated below. @@ -3083,7 +3083,7 @@ H5O_share (H5F_t *f, hid_t dxpl_id, const H5O_class_t *type, const void *mesg, size_t size; void *buf = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5O_share); /* Check args */ @@ -3132,7 +3132,7 @@ H5O_raw_size(unsigned type_id, const H5F_t *f, const void *mesg) { const H5O_class_t *type; /* Actual H5O class type for the ID */ size_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5O_raw_size,0); /* Check args */ @@ -3176,7 +3176,7 @@ H5O_get_share(unsigned type_id, H5F_t *f, const void *mesg, H5O_shared_t *share) { const H5O_class_t *type; /* Actual H5O class type for the ID */ herr_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5O_get_share,FAIL); /* Check args */ @@ -3220,7 +3220,7 @@ H5O_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) { H5O_t *oh=NULL; /* Object header information */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5O_delete,FAIL); /* Check args */ @@ -3269,7 +3269,7 @@ H5O_delete_oh(H5F_t *f, hid_t dxpl_id, H5O_t *oh) H5O_chunk_t *curr_chk; /* Pointer to current chunk being operated on */ unsigned u; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5O_delete_oh); /* Check args */ @@ -3331,7 +3331,7 @@ H5O_delete_mesg(H5F_t *f, hid_t dxpl_id, H5O_mesg_t *mesg) { const H5O_class_t *type; /* Type of object to free */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5O_delete_mesg); /* Check args */ @@ -3389,7 +3389,7 @@ H5O_get_info(H5G_entry_t *ent, H5O_stat_t *ostat, hid_t dxpl_id) hsize_t free_space; /* Free space in object header */ unsigned u; /* Local index variable */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5O_get_info,FAIL); /* Check args */ @@ -3448,7 +3448,7 @@ done: * object being iterated over ('mesg'), and the pointer to the operator data * passed in to H5O_iterate ('op_data'). The return values from an operator * are: - * A. Zero causes the iterator to continue, returning zero when all + * A. Zero causes the iterator to continue, returning zero when all * object headers of that type have been processed. * B. Positive causes the iterator to immediately return that positive * value, indicating short-circuit success. @@ -3543,7 +3543,7 @@ H5O_debug_id(hid_t type_id, H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *str { const H5O_class_t *type; /* Actual H5O class type for the ID */ herr_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5O_debug_id,FAIL); /* Check args */ @@ -3677,7 +3677,7 @@ H5O_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int f "Constant:", (oh->mesg[i].flags & H5O_FLAG_CONSTANT) ? "Yes" : "No"); if (oh->mesg[i].flags & ~H5O_FLAG_BITS) { - HDfprintf (stream, "%*s%-*s 0x%02x\n", indent+3,"",MAX(0,fwidth-3), + HDfprintf (stream, "%*s%-*s 0x%02x\n", indent+3,"",MAX(0,fwidth-3), "*** ADDITIONAL UNKNOWN FLAGS --->", oh->mesg[i].flags & ~H5O_FLAG_BITS); } @@ -3690,14 +3690,14 @@ H5O_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int f chunkno = oh->mesg[i].chunkno; if (chunkno >= oh->nchunks) HDfprintf(stream, "*** BAD CHUNK NUMBER\n"); - + /* check the size */ if ((oh->mesg[i].raw + oh->mesg[i].raw_size > oh->chunk[chunkno].image + oh->chunk[chunkno].size) || (oh->mesg[i].raw < oh->chunk[chunkno].image)) { HDfprintf(stream, "*** BAD MESSAGE RAW ADDRESS\n"); } - + /* decode the message */ if (oh->mesg[i].flags & H5O_FLAG_SHARED) { decode = H5O_SHARED->decode; @@ -3710,7 +3710,7 @@ H5O_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE *stream, int indent, int f oh->mesg[i].native = (decode)(f, dxpl_id, oh->mesg[i].raw, NULL); if (NULL==oh->mesg[i].native) debug = NULL; - + /* print the message */ HDfprintf(stream, "%*s%-*s\n", indent + 3, "", MAX(0, fwidth - 3), "Message Information:"); diff --git a/src/H5Oattr.c b/src/H5Oattr.c index be48782..d0ed251 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -143,7 +143,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t UNUSED * UINT16DECODE(p, name_len); /*including null*/ UINT16DECODE(p, attr->dt_size); UINT16DECODE(p, attr->ds_size); - + /* Decode and store the name */ if (NULL==(attr->name=H5MM_strdup((const char *)p))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); @@ -179,7 +179,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t UNUSED * /* decode the attribute dataspace */ if (NULL==(attr->ds = H5FL_CALLOC(H5S_t))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); - + if((extent=(H5O_SDSPACE->decode)(f,dxpl_id,p,NULL))==NULL) HGOTO_ERROR(H5E_ATTR, H5E_CANTDECODE, NULL, "can't decode attribute dataspace"); @@ -188,7 +188,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t UNUSED * /* Release temporary extent information */ H5FL_FREE(H5S_extent_t,extent); - + /* Default to entire dataspace being selected */ if(H5S_select_all(attr->ds,0)<0) HGOTO_ERROR (H5E_DATASPACE, H5E_CANTSET, NULL, "unable to set all selection"); @@ -210,7 +210,7 @@ H5O_attr_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t UNUSED * /* Indicate that the fill values aren't to be written out */ attr->initialized=1; - + /* Set return value */ ret_value=attr; @@ -223,7 +223,7 @@ done: NAME H5O_attr_encode PURPOSE - Encode a simple attribute message + Encode a simple attribute message USAGE herr_t H5O_attr_encode(f, raw_size, p, mesg) H5F_t *f; IN: pointer to the HDF5 file struct @@ -243,7 +243,7 @@ done: * Added a version number at the beginning. * * Raymond Lu, 8 April 2004 - * For data space, changed the operation on H5S_simple_t to + * For data space, changed the operation on H5S_simple_t to * H5S_extent_t * --------------------------------------------------------------------------*/ @@ -341,7 +341,7 @@ H5O_attr_encode(H5F_t *f, uint8_t *p, const void *mesg) } /* end if */ else p += attr->ds_size; - + /* Store attribute data */ if(attr->data) HDmemcpy(p,attr->data,attr->data_size); @@ -360,8 +360,8 @@ done: Copies a message from MESG to DEST, allocating DEST if necessary. USAGE void *H5O_attr_copy(mesg, dest) - const void *mesg; IN: Pointer to the source attribute struct - const void *dest; IN: Pointer to the destination attribute struct + const void *mesg; IN: Pointer to the source attribute struct + const void *dest; IN: Pointer to the destination attribute struct RETURNS Pointer to DEST on success, NULL on failure DESCRIPTION @@ -609,7 +609,7 @@ done: RETURNS Non-negative on success/Negative on failure DESCRIPTION - This function prints debugging output to the stream passed as a + This function prints debugging output to the stream passed as a parameter. --------------------------------------------------------------------------*/ static herr_t @@ -642,7 +642,7 @@ H5O_attr_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream, int in fprintf(stream, "%*sSymbol table entry...\n", indent, ""); H5G_ent_debug(f, dxpl_id, &(mesg->ent), stream, indent+3, MAX(0, fwidth-3), HADDR_UNDEF); - + fprintf(stream, "%*sData type...\n", indent, ""); fprintf(stream, "%*s%-*s %lu\n", indent+3, "", MAX(0,fwidth-3), "Size:", diff --git a/src/H5Obogus.c b/src/H5Obogus.c index 4da3f89..54a52b2 100644 --- a/src/H5Obogus.c +++ b/src/H5Obogus.c @@ -24,7 +24,7 @@ * correct operation when parsing unknown object header * messages. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ diff --git a/src/H5Ocont.c b/src/H5Ocont.c index 23c501e..b28186c 100644 --- a/src/H5Ocont.c +++ b/src/H5Ocont.c @@ -23,7 +23,7 @@ * the H5O package. Therefore, do not change * any definitions in this file! * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ diff --git a/src/H5Odtype.c b/src/H5Odtype.c index bf3cd1e..e358c18 100644 --- a/src/H5Odtype.c +++ b/src/H5Odtype.c @@ -207,7 +207,7 @@ H5O_dtype_decode_helper(H5F_t *f, const uint8_t **pp, H5T_t *dt) UINT32DECODE(*pp, dt->shared->u.compnd.memb[i].offset); /* Older versions of the library allowed a field to have - * intrinsic 'arrayness'. Newer versions of the library + * intrinsic 'arrayness'. Newer versions of the library * use the separate array datatypes. */ if(version==H5O_DTYPE_VERSION_COMPAT) { /* Decode the number of dimensions */ @@ -220,7 +220,7 @@ H5O_dtype_decode_helper(H5F_t *f, const uint8_t **pp, H5T_t *dt) /* Skip reserved bytes */ *pp += 4; - + /* Decode array dimension sizes */ for (j=0; j<4; j++) UINT32DECODE(*pp, dim[j]); @@ -261,7 +261,7 @@ H5O_dtype_decode_helper(H5F_t *f, const uint8_t **pp, H5T_t *dt) /* Close the base type for the array */ H5T_close(temp_type); - + /* Make the array type the type that is set for the field */ temp_type=array_dt; } /* end if */ @@ -714,7 +714,7 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt) /* Parent type */ if (H5O_dtype_encode_helper(pp, dt->shared->parent)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTENCODE, FAIL, "unable to encode parent data type"); - + /* Names, each a multiple of eight bytes */ for (i=0; ishared->u.enumer.nmembs; i++) { HDstrcpy((char*)(*pp), dt->shared->u.enumer.name[i]); @@ -728,11 +728,11 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt) HDmemcpy(*pp, dt->shared->u.enumer.value, dt->shared->u.enumer.nmembs * dt->shared->parent->shared->size); *pp += dt->shared->u.enumer.nmembs * dt->shared->parent->shared->size; break; - + case H5T_REFERENCE: flags |= (dt->shared->u.atomic.u.r.rtype & 0x0f); break; - + case H5T_STRING: /* * Character string types... (not fully implemented) @@ -871,7 +871,7 @@ done: NAME H5O_dtype_encode PURPOSE - Encode a simple datatype message + Encode a simple datatype message USAGE herr_t H5O_dtype_encode(f, raw_size, p, mesg) H5F_t *f; IN: pointer to the HDF5 file struct @@ -914,9 +914,9 @@ done: USAGE void *H5O_dtype_copy(mesg, dest) const void *mesg; IN: Pointer to the source simple datatype - struct + struct const void *dest; IN: Pointer to the destination simple - datatype struct + datatype struct RETURNS Pointer to DEST on success, NULL on failure DESCRIPTION @@ -1124,7 +1124,7 @@ H5O_dtype_get_share(H5F_t UNUSED *f, const void *_mesg, { const H5T_t *dt = (const H5T_t *)_mesg; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5O_dtype_get_share); assert (dt); @@ -1166,7 +1166,7 @@ H5O_dtype_set_share (H5F_t UNUSED *f, void *_mesg/*in,out*/, const H5O_shared_t *sh) { H5T_t *dt = (H5T_t *)_mesg; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_dtype_set_share); assert (dt); @@ -1199,7 +1199,7 @@ H5O_dtype_set_share (H5F_t UNUSED *f, void *_mesg/*in,out*/, RETURNS Non-negative on success/Negative on failure DESCRIPTION - This function prints debugging output to the stream passed as a + This function prints debugging output to the stream passed as a parameter. --------------------------------------------------------------------------*/ static herr_t @@ -1211,7 +1211,7 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, char buf[256]; unsigned i; size_t k; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_dtype_debug); /* check args */ @@ -1302,7 +1302,7 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream, } fprintf(stream, "\n"); } - + } else if (H5T_OPAQUE==dt->shared->type) { fprintf(stream, "%*s%-*s \"%s\"\n", indent, "", fwidth, "Tag:", dt->shared->u.opaque.tag); diff --git a/src/H5Oefl.c b/src/H5Oefl.c index 974b86f..52b63dd 100644 --- a/src/H5Oefl.c +++ b/src/H5Oefl.c @@ -73,7 +73,7 @@ const H5O_class_t H5O_EFL[1] = {{ * Modifications: * Robb Matzke, 1998-07-20 * Rearranged the message to add a version number near the beginning. - * + * *------------------------------------------------------------------------- */ static void * @@ -118,7 +118,7 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t UNUSED *s if (NULL == (heap = H5HL_protect(f, dxpl_id, mesg->heap_addr))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "unable to read protect link value") - + s = H5HL_offset_into(f, heap, 0); assert (s && !*s); @@ -137,7 +137,7 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t UNUSED *s if (NULL == (heap = H5HL_protect(f, dxpl_id, mesg->heap_addr))) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "unable to read protect link value") - + s = H5HL_offset_into(f, heap, mesg->slot[u].name_offset); assert (s && *s); mesg->slot[u].name = H5MM_xstrdup (s); @@ -145,7 +145,7 @@ H5O_efl_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t UNUSED *s if (H5HL_unprotect(f, dxpl_id, heap, mesg->heap_addr) < 0) HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, NULL, "unable to read unprotect link value") - + /* File offset */ H5F_DECODE_LENGTH (f, p, mesg->slot[u].offset); @@ -184,7 +184,7 @@ done: * Entering the name into the local heap happens when the dataset is * created. Otherwise we could end up in infinite recursion if the heap * happens to hash to the same cache slot as the object header. - * + * *------------------------------------------------------------------------- */ static herr_t @@ -267,7 +267,7 @@ H5O_efl_copy(const void *_mesg, void *_dest, unsigned UNUSED update_flags) if (NULL==(dest = H5MM_calloc(sizeof(H5O_efl_t))) || NULL==(dest->slot=H5MM_malloc(mesg->nalloc* sizeof(H5O_efl_entry_t)))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); - + } else if (dest->nallocnalloc) { H5MM_xfree(dest->slot); if (NULL==(dest->slot = H5MM_malloc(mesg->nalloc* @@ -354,7 +354,7 @@ H5O_efl_reset(void *_mesg) { H5O_efl_t *mesg = (H5O_efl_t *) _mesg; size_t u; /* Local index variable */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_efl_reset); /* check args */ @@ -393,7 +393,7 @@ hsize_t H5O_efl_total_size (H5O_efl_t *efl) { hsize_t ret_value = 0, tmp; - + FUNC_ENTER_NOAPI_NOINIT(H5O_efl_total_size); if (efl->nused>0 && @@ -455,11 +455,11 @@ H5O_efl_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * s for (u = 0; u < mesg->nused; u++) { sprintf (buf, "File %u", (unsigned)u); HDfprintf (stream, "%*s%s:\n", indent, "", buf); - + HDfprintf(stream, "%*s%-*s \"%s\"\n", indent+3, "", MAX (fwidth-3, 0), "Name:", mesg->slot[u].name); - + HDfprintf(stream, "%*s%-*s %lu\n", indent+3, "", MAX (fwidth-3, 0), "Name offset:", (unsigned long)(mesg->slot[u].name_offset)); diff --git a/src/H5Ofill.c b/src/H5Ofill.c index a437105..002666f 100644 --- a/src/H5Ofill.c +++ b/src/H5Ofill.c @@ -87,8 +87,8 @@ const H5O_class_t H5O_FILL_NEW[1] = {{ /* Initial version of the "old" fill value information */ #define H5O_FILL_VERSION 1 /* Revised version of the "new" fill value information */ -#define H5O_FILL_VERSION_2 2 - +#define H5O_FILL_VERSION_2 2 + /* Declare a free list to manage the H5O_fill_new_t struct */ H5FL_DEFINE(H5O_fill_new_t); @@ -99,16 +99,16 @@ H5FL_DEFINE(H5O_fill_t); /*------------------------------------------------------------------------- * Function: H5O_fill_new_decode * - * Purpose: Decode a new fill value message. The new fill value - * message is fill value plus space allocation time and + * Purpose: Decode a new fill value message. The new fill value + * message is fill value plus space allocation time and * fill value writing time and whether fill value is defined. * * Return: Success: Ptr to new message in native struct. * * Failure: NULL * - * Programmer: Raymond Lu - * Feb 26, 2002 + * Programmer: Raymond Lu + * Feb 26, 2002 * * Modifications: * @@ -121,7 +121,7 @@ H5O_fill_new_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p, H5O_fill_new_t *mesg=NULL; int version; void *ret_value; - + FUNC_ENTER_NOAPI_NOINIT(H5O_fill_new_decode); assert(f); @@ -130,12 +130,12 @@ H5O_fill_new_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p, if (NULL==(mesg=H5FL_CALLOC(H5O_fill_new_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for fill value message"); - + /* Version */ version = *p++; if( version != H5O_FILL_VERSION && version !=H5O_FILL_VERSION_2) HGOTO_ERROR(H5E_OHDR, H5E_CANTLOAD, NULL, "bad version number for fill value message"); - + /* Space allocation time */ mesg->alloc_time = (H5D_alloc_time_t)*p++; @@ -160,7 +160,7 @@ H5O_fill_new_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p, /* Set return value */ ret_value = (void*)mesg; - + done: if (!ret_value && mesg) { if(mesg->buf) @@ -194,7 +194,7 @@ H5O_fill_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p, { H5O_fill_t *mesg=NULL; void *ret_value; - + FUNC_ENTER_NOAPI_NOINIT(H5O_fill_decode); assert(f); @@ -209,10 +209,10 @@ H5O_fill_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p, HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for fill value"); HDmemcpy(mesg->buf, p, mesg->size); } - + /* Set return value */ ret_value = (void*)mesg; - + done: if (!ret_value && mesg) { if(mesg->buf) @@ -233,8 +233,8 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: Raymond Lu - * Feb 26, 2002 + * Programmer: Raymond Lu + * Feb 26, 2002 * * Modifications: * @@ -244,7 +244,7 @@ static herr_t H5O_fill_new_encode(H5F_t UNUSED *f, uint8_t *p, const void *_mesg) { const H5O_fill_new_t *mesg = (const H5O_fill_new_t *)_mesg; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fill_new_encode); assert(f); @@ -309,16 +309,16 @@ H5O_fill_encode(H5F_t UNUSED *f, uint8_t *p, const void *_mesg) * Function: H5O_fill_new_copy * * Purpose: Copies a message from _MESG to _DEST, allocating _DEST if - * necessary. The new fill value message is fill value plus - * space allocation time and fill value writing time and + * necessary. The new fill value message is fill value plus + * space allocation time and fill value writing time and * whether fill value is defined. * * Return: Success: Ptr to _DEST * * Failure: NULL * - * Programmer: Raymond Lu - * Feb 26, 2002 + * Programmer: Raymond Lu + * Feb 26, 2002 * * Modifications: * @@ -448,7 +448,7 @@ done: * * Purpose: Returns the size of the raw message in bytes not counting the * message type or size fields, but only the data fields. This - * function doesn't take into account alignment. The new fill + * function doesn't take into account alignment. The new fill * value message is fill value plus space allocation time and * fill value writing time and whether fill value is defined. * @@ -468,7 +468,7 @@ H5O_fill_new_size(const H5F_t UNUSED *f, const void *_mesg) { const H5O_fill_new_t *mesg = (const H5O_fill_new_t *)_mesg; size_t ret_value; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fill_new_size); assert(f); @@ -507,7 +507,7 @@ static size_t H5O_fill_size(const H5F_t UNUSED *f, const void *_mesg) { const H5O_fill_t *mesg = (const H5O_fill_t *)_mesg; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fill_size); assert(f); @@ -541,8 +541,8 @@ H5O_fill_new_reset(void *_mesg) FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fill_new_reset); assert(mesg); - - if(mesg->buf) + + if(mesg->buf) mesg->buf = H5MM_xfree(mesg->buf); mesg->size = -1; if (mesg->type) { @@ -579,15 +579,15 @@ H5O_fill_reset(void *_mesg) FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fill_reset); assert(mesg); - - if(mesg->buf) + + if(mesg->buf) mesg->buf = H5MM_xfree(mesg->buf); mesg->size = 0; if (mesg->type) { H5T_close(mesg->type); mesg->type = NULL; } - + FUNC_LEAVE_NOAPI(SUCCEED); } @@ -666,7 +666,7 @@ H5O_fill_new_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FIL { const H5O_fill_new_t *mesg = (const H5O_fill_new_t *)_mesg; H5D_fill_value_t fill_status; /* Whether the fill value is defined */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fill_new_debug); assert(f); @@ -744,7 +744,7 @@ H5O_fill_new_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FIL } else { fprintf(stream, "\n"); } - + FUNC_LEAVE_NOAPI(SUCCEED); } @@ -768,7 +768,7 @@ H5O_fill_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE *s int indent, int fwidth) { const H5O_fill_t *mesg = (const H5O_fill_t *)_mesg; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fill_debug); assert(f); @@ -786,7 +786,7 @@ H5O_fill_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE *s } else { fprintf(stream, "\n"); } - + FUNC_LEAVE_NOAPI(SUCCEED); } diff --git a/src/H5Olayout.c b/src/H5Olayout.c index 11ef9f4..aed52e9 100644 --- a/src/H5Olayout.c +++ b/src/H5Olayout.c @@ -58,7 +58,7 @@ const H5O_class_t H5O_LAYOUT[1] = {{ H5O_layout_debug, /*debug the message */ }}; -/* For forward and backward compatibility. Version is 1 when space is +/* For forward and backward compatibility. Version is 1 when space is * allocated; 2 when space is delayed for allocation; 3 * is revised to just store information needed for each storage type. */ #define H5O_LAYOUT_VERSION_1 1 @@ -344,7 +344,7 @@ H5O_layout_encode(H5F_t *f, uint8_t *p, const void *_mesg) HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, FAIL, "Invalid layout class"); } /* end switch */ } /* end else */ - + done: FUNC_LEAVE_NOAPI(ret_value); } @@ -380,7 +380,7 @@ H5O_layout_copy(const void *_mesg, void *_dest, unsigned UNUSED update_flags) assert(mesg); if (!dest && NULL==(dest=H5FL_MALLOC(H5O_layout_t))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); - + /* copy */ *dest = *mesg; @@ -404,20 +404,20 @@ done: /*------------------------------------------------------------------------- * Function: H5O_layout_meta_size - * + * * Purpose: Returns the size of the raw message in bytes except raw data - * part for compact dataset. This function doesn't take into + * part for compact dataset. This function doesn't take into * account message alignment. - * + * * Return: Success: Message data size in bytes(except raw data * for compact dataset) * Failure: 0 - * + * * Programmer: Raymond Lu - * August 14, 2002 - * + * August 14, 2002 + * * Modifications: - * + * *------------------------------------------------------------------------- */ size_t @@ -426,17 +426,17 @@ H5O_layout_meta_size(const H5F_t *f, const void *_mesg) /* Casting away const OK - QAK */ H5O_layout_t *mesg = (H5O_layout_t *) _mesg; size_t ret_value; - + FUNC_ENTER_NOAPI_NOINIT(H5O_layout_meta_size); - + /* check args */ assert(f); assert(mesg); - + /* Check version information for new datasets */ if(mesg->version==0) { unsigned u; - + /* Check for dimension that would be truncated */ assert(mesg->unused.ndims > 0 && mesg->unused.ndims <= H5O_LAYOUT_NDIMS); for (u = 0; u < mesg->unused.ndims; u++) @@ -452,11 +452,11 @@ H5O_layout_meta_size(const H5F_t *f, const void *_mesg) if(mesg->type==H5D_CONTIGUOUS) { if(mesg->u.contig.addr==HADDR_UNDEF) mesg->version = H5O_LAYOUT_VERSION_2; - else + else mesg->version = H5O_LAYOUT_VERSION_1; } else if(mesg->type==H5D_COMPACT) { mesg->version = H5O_LAYOUT_VERSION_2; - } else + } else mesg->version = H5O_LAYOUT_VERSION_1; } /* end if */ } /* end if */ @@ -472,7 +472,7 @@ H5O_layout_meta_size(const H5F_t *f, const void *_mesg) if(mesg->type==H5D_COMPACT) ret_value += 4; /* size field for compact dataset */ else - ret_value += H5F_SIZEOF_ADDR(f); /* file address of data or B-tree for chunked dataset */ + ret_value += H5F_SIZEOF_ADDR(f); /* file address of data or B-tree for chunked dataset */ } /* end if */ else { ret_value = 1 + /* Version number */ @@ -480,8 +480,8 @@ H5O_layout_meta_size(const H5F_t *f, const void *_mesg) switch(mesg->type) { case H5D_CONTIGUOUS: - ret_value += H5F_SIZEOF_ADDR(f); /* Address of data */ - ret_value += H5F_SIZEOF_SIZE(f); /* Length of data */ + ret_value += H5F_SIZEOF_ADDR(f); /* Address of data */ + ret_value += H5F_SIZEOF_SIZE(f); /* Length of data */ break; case H5D_CHUNKED: @@ -490,7 +490,7 @@ H5O_layout_meta_size(const H5F_t *f, const void *_mesg) ret_value++; /* B-tree address */ - ret_value += H5F_SIZEOF_ADDR(f); /* Address of data */ + ret_value += H5F_SIZEOF_ADDR(f); /* Address of data */ /* Dimension sizes */ ret_value += mesg->u.chunk.ndims*4; @@ -506,15 +506,15 @@ H5O_layout_meta_size(const H5F_t *f, const void *_mesg) } /* end switch */ } /* end else */ -done: +done: FUNC_LEAVE_NOAPI(ret_value); -} - +} + /*------------------------------------------------------------------------- * Function: H5O_layout_size * - * Purpose: Returns the size of the raw message in bytes. If it's + * Purpose: Returns the size of the raw message in bytes. If it's * compact dataset, the data part is also included. * This function doesn't take into account message alignment. * diff --git a/src/H5Omtime.c b/src/H5Omtime.c index ad398ae..c113676 100644 --- a/src/H5Omtime.c +++ b/src/H5Omtime.c @@ -26,7 +26,7 @@ #include "H5MMprivate.h" #include "H5Opkg.h" /* Object header functions */ -#if defined (WIN32) && !defined (__MWERKS__) +#if defined (WIN32) && !defined (__MWERKS__) #include #include #endif @@ -83,8 +83,8 @@ const H5O_class_t H5O_MTIME_NEW[1] = {{ }}; /* Current version of new mtime information */ -#define H5O_MTIME_VERSION 1 - +#define H5O_MTIME_VERSION 1 + /* Track whether tzset routine was called */ static int ntzset=0; @@ -243,12 +243,12 @@ H5O_mtime_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p, the_time -= tz.tz_minuteswest * 60 - (tm.tm_isdst ? 3600 : 0); } -#elif defined (WIN32) +#elif defined (WIN32) #if !defined (__MWERKS__) /* MSVC */ { struct timeb timebuffer; long tz; - + ftime(&timebuffer); tz = timebuffer.timezone; /* daylight is not handled properly. Currently we just hard-code @@ -272,7 +272,7 @@ H5O_mtime_decode(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const uint8_t *p, /* Irix64 */ HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to obtain local timezone information"); #endif - + /* The return value */ if (NULL==(mesg = H5FL_MALLOC(time_t))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); @@ -305,7 +305,7 @@ static herr_t H5O_mtime_new_encode(H5F_t UNUSED *f, uint8_t *p, const void *_mesg) { const time_t *mesg = (const time_t *) _mesg; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_mtime_new_encode); /* check args */ @@ -348,7 +348,7 @@ H5O_mtime_encode(H5F_t UNUSED *f, uint8_t *p, const void *_mesg) { const time_t *mesg = (const time_t *) _mesg; struct tm *tm; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_mtime_encode); /* check args */ @@ -397,7 +397,7 @@ H5O_mtime_copy(const void *_mesg, void *_dest, unsigned UNUSED update_flags) assert(mesg); if (!dest && NULL==(dest = H5FL_MALLOC(time_t))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); - + /* copy */ *dest = *mesg; @@ -548,7 +548,7 @@ H5O_mtime_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * const time_t *mesg = (const time_t *)_mesg; struct tm *tm; char buf[128]; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_mtime_debug); /* check args */ @@ -560,7 +560,7 @@ H5O_mtime_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_mesg, FILE * /* debug */ tm = HDlocaltime(mesg); - + HDstrftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S %Z", tm); fprintf(stream, "%*s%-*s %s\n", indent, "", fwidth, "Time:", buf); diff --git a/src/H5Oname.c b/src/H5Oname.c index e76e3a8..3934830 100644 --- a/src/H5Oname.c +++ b/src/H5Oname.c @@ -20,7 +20,7 @@ * * Purpose: Object name message. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ @@ -176,7 +176,7 @@ H5O_name_copy(const void *_mesg, void *_dest, unsigned UNUSED update_flags) assert(mesg); if (!dest && NULL==(dest = H5MM_calloc(sizeof(H5O_name_t)))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); - + /* copy */ *dest = *mesg; if((dest->s = H5MM_xstrdup(mesg->s))==NULL) diff --git a/src/H5Onull.c b/src/H5Onull.c index 69bee7d..1d81da8 100644 --- a/src/H5Onull.c +++ b/src/H5Onull.c @@ -20,7 +20,7 @@ * * Purpose: The null message. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ diff --git a/src/H5Opkg.h b/src/H5Opkg.h index bec95d7..7217e53 100644 --- a/src/H5Opkg.h +++ b/src/H5Opkg.h @@ -124,8 +124,8 @@ H5_DLLVAR const H5O_class_t H5O_DTYPE[1]; H5_DLLVAR const H5O_class_t H5O_FILL[1]; /* - * New Fill Value Message. The new fill value message is fill value plus - * space allocation time and fill value writing time and whether fill + * New Fill Value Message. The new fill value message is fill value plus + * space allocation time and fill value writing time and whether fill * value is defined. */ H5_DLLVAR const H5O_class_t H5O_FILL_NEW[1]; diff --git a/src/H5Opline.c b/src/H5Opline.c index 7c1dba6f..280c8db 100644 --- a/src/H5Opline.c +++ b/src/H5Opline.c @@ -178,7 +178,7 @@ H5O_pline_encode (H5F_t UNUSED *f, uint8_t *p/*out*/, const void *mesg) size_t i, j, name_length; const char *name=NULL; H5Z_class_t *cls=NULL; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_pline_encode); /* Check args */ @@ -251,7 +251,7 @@ H5O_pline_copy (const void *_src, void *_dst/*out*/, unsigned UNUSED update_flag H5O_pline_t *dst = (H5O_pline_t *)_dst; size_t i; H5O_pline_t *ret_value; - + FUNC_ENTER_NOAPI_NOINIT(H5O_pline_copy); if (!dst && NULL==(dst = H5FL_MALLOC (H5O_pline_t))) @@ -266,7 +266,7 @@ H5O_pline_copy (const void *_src, void *_dst/*out*/, unsigned UNUSED update_flag } else { dst->filter = NULL; } - + for (i=0; inused; i++) { dst->filter[i] = src->filter[i]; if (src->filter[i].name) { @@ -326,7 +326,7 @@ H5O_pline_size (const H5F_t UNUSED *f, const void *mesg) const char *name = NULL; H5Z_class_t *cls = NULL; size_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_pline_size); /* Message header */ @@ -340,14 +340,14 @@ H5O_pline_size (const H5F_t UNUSED *f, const void *mesg) (cls=H5Z_find(pline->filter[i].id))) name = cls->name; name_len = name ? HDstrlen(name)+1 : 0; - + ret_value += 2 + /*filter identification number */ 2 + /*name length */ 2 + /*flags */ 2 + /*number of client data values */ H5O_ALIGN(name_len); /*length of the filter name */ - + ret_value += pline->filter[i].cd_nelmts * 4; if (pline->filter[i].cd_nelmts % 2) ret_value += 4; @@ -377,7 +377,7 @@ H5O_pline_reset (void *mesg) { H5O_pline_t *pline = (H5O_pline_t*)mesg; size_t i; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_pline_reset); assert (pline); @@ -487,6 +487,6 @@ H5O_pline_debug (H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *mesg, FILE * (unsigned long)(pline->filter[i].cd_values[j])); } } - + FUNC_LEAVE_NOAPI(SUCCEED); } diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h index aae2695..c6d6726 100644 --- a/src/H5Oprivate.h +++ b/src/H5Oprivate.h @@ -85,8 +85,8 @@ typedef struct H5O_fill_t { } H5O_fill_t; /* - * New Fill Value Message. The new fill value message is fill value plus - * space allocation time and fill value writing time and whether fill + * New Fill Value Message. The new fill value message is fill value plus + * space allocation time and fill value writing time and whether fill * value is defined. */ @@ -95,8 +95,8 @@ typedef struct H5O_fill_new_t { ssize_t size; /*number of bytes in the fill value */ void *buf; /*the fill value */ H5D_alloc_time_t alloc_time; /* time to allocate space */ - H5D_fill_time_t fill_time; /* time to write fill value */ - hbool_t fill_defined; /* whether fill value is defined */ + H5D_fill_time_t fill_time; /* time to write fill value */ + hbool_t fill_defined; /* whether fill value is defined */ } H5O_fill_new_t; /* @@ -127,12 +127,12 @@ typedef struct H5O_efl_t { #define H5O_LAYOUT_NDIMS (H5S_MAX_RANK+1) typedef struct H5O_layout_contig_t { - haddr_t addr; /* File address of data */ + haddr_t addr; /* File address of data */ hsize_t size; /* Size of data in bytes */ } H5O_layout_contig_t; typedef struct H5O_layout_chunk_t { - haddr_t addr; /* File address of B-tree */ + haddr_t addr; /* File address of B-tree */ unsigned ndims; /* Num dimensions in chunk */ size_t dim[H5O_LAYOUT_NDIMS]; /* Size of chunk in elements */ size_t size; /* Size of chunk in bytes */ @@ -140,7 +140,7 @@ typedef struct H5O_layout_chunk_t { } H5O_layout_chunk_t; typedef struct H5O_layout_compact_t { - hbool_t dirty; /* Dirty flag for compact dataset */ + hbool_t dirty; /* Dirty flag for compact dataset */ size_t size; /* Size of buffer in bytes */ void *buf; /* Buffer for compact dataset */ } H5O_layout_compact_t; @@ -248,7 +248,7 @@ H5_DLL int H5O_modify(H5G_entry_t *ent, unsigned type_id, int overwrite, unsigned flags, unsigned update_flags, const void *mesg, hid_t dxpl_id); H5_DLL struct H5O_t * H5O_protect(H5G_entry_t *ent, hid_t dxpl_id); H5_DLL herr_t H5O_unprotect(H5G_entry_t *ent, struct H5O_t *oh, hid_t dxpl_id); -H5_DLL int H5O_append(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh, unsigned type_id, +H5_DLL int H5O_append(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh, unsigned type_id, unsigned flags, const void *mesg); H5_DLL herr_t H5O_touch(H5G_entry_t *ent, hbool_t force, hid_t dxpl_id); H5_DLL herr_t H5O_touch_oh(H5F_t *f, struct H5O_t *oh, hbool_t force); diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index acf177e..9f1ba67 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -83,7 +83,7 @@ H5FL_ARR_EXTERN(hsize_t); Robb Matzke, 1998-04-09 The current and maximum dimensions are now H5F_SIZEOF_SIZET bytes instead of just four bytes. - + Robb Matzke, 1998-07-20 Added a version number and reformatted the message for aligment. --------------------------------------------------------------------------*/ @@ -94,7 +94,7 @@ H5O_sdspace_decode(H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *p, H5O_shared_ void *ret_value; unsigned i; /* local counting variable */ unsigned flags, version; - + FUNC_ENTER_NOAPI_NOINIT(H5O_sdspace_decode); /* check args */ @@ -145,7 +145,7 @@ H5O_sdspace_decode(H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *p, H5O_shared_ /* Set return value */ ret_value = (void*)sdim; /*success*/ - + done: if (!ret_value && sdim) { H5S_extent_release(sdim); @@ -160,7 +160,7 @@ done: NAME H5O_sdspace_encode PURPOSE - Encode a simple dimensionality message + Encode a simple dimensionality message USAGE herr_t H5O_sdspace_encode(f, raw_size, p, mesg) H5F_t *f; IN: pointer to the HDF5 file struct @@ -177,7 +177,7 @@ done: Robb Matzke, 1998-04-09 The current and maximum dimensions are now H5F_SIZEOF_SIZET bytes instead of just four bytes. - + Robb Matzke, 1998-07-20 Added a version number and reformatted the message for aligment. --------------------------------------------------------------------------*/ @@ -213,7 +213,7 @@ H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *mesg) for (u = 0; u < sdim->rank; u++) H5F_ENCODE_LENGTH (f, p, sdim->size[u]); if (flags & H5S_VALID_MAX) { - for (u = 0; u < sdim->rank; u++) + for (u = 0; u < sdim->rank; u++) H5F_ENCODE_LENGTH (f, p, sdim->max[u]); } } @@ -293,7 +293,7 @@ static size_t H5O_sdspace_size(const H5F_t *f, const void *mesg) { const H5S_extent_t *space = (const H5S_extent_t *) mesg; - + /* * All dimensionality messages are at least 8 bytes long. */ @@ -330,7 +330,7 @@ static herr_t H5O_sdspace_reset(void *_mesg) { H5S_extent_t *mesg = (H5S_extent_t*)_mesg; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_sdspace_reset); H5S_extent_release(mesg); @@ -381,7 +381,7 @@ H5O_sdspace_free (void *mesg) RETURNS Non-negative on success/Negative on failure DESCRIPTION - This function prints debugging output to the stream passed as a + This function prints debugging output to the stream passed as a parameter. --------------------------------------------------------------------------*/ static herr_t @@ -403,13 +403,13 @@ H5O_sdspace_debug(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *mesg, HDfprintf(stream, "%*s%-*s %lu\n", indent, "", fwidth, "Rank:", (unsigned long) (sdim->rank)); - + if(sdim->rank>0) { HDfprintf(stream, "%*s%-*s {", indent, "", fwidth, "Dim Size:"); for (u = 0; u < sdim->rank; u++) HDfprintf (stream, "%s%Hu", u?", ":"", sdim->size[u]); HDfprintf (stream, "}\n"); - + HDfprintf(stream, "%*s%-*s ", indent, "", fwidth, "Dim Max:"); if (sdim->max) { HDfprintf (stream, "{"); diff --git a/src/H5Oshared.c b/src/H5Oshared.c index 8f4f558..c898a10 100644 --- a/src/H5Oshared.c +++ b/src/H5Oshared.c @@ -209,7 +209,7 @@ H5O_shared_decode (H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *buf, H5O_share H5O_shared_t *mesg=NULL; unsigned flags, version; void *ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5O_shared_decode); /* Check args */ @@ -283,7 +283,7 @@ H5O_shared_encode (H5F_t *f, uint8_t *buf/*out*/, const void *_mesg) { const H5O_shared_t *mesg = (const H5O_shared_t *)_mesg; unsigned flags; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_shared_encode); /* Check args */ @@ -353,7 +353,7 @@ H5O_shared_copy(const void *_mesg, void *_dest, unsigned UNUSED update_flags) assert(mesg); if (!dest && NULL==(dest = H5MM_malloc (sizeof(H5O_shared_t)))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); - + /* copy */ *dest = *mesg; @@ -386,12 +386,12 @@ H5O_shared_size (const H5F_t *f, const void *_mesg) { const H5O_shared_t *shared = (const H5O_shared_t *) _mesg; size_t ret_value; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_shared_size); ret_value = 1 + /*version */ 1 + /*the flags field */ - (shared->in_gh ? + (shared->in_gh ? (H5F_SIZEOF_ADDR(f)+4) : /*sharing via global heap */ H5F_SIZEOF_ADDR(f)); /*sharing by another obj hdr */ @@ -516,6 +516,6 @@ H5O_shared_debug (H5F_t UNUSED *f, hid_t dxpl_id, const void *_mesg, H5G_ent_debug (f, dxpl_id, &(mesg->u.ent), stream, indent, fwidth, HADDR_UNDEF); } - + FUNC_LEAVE_NOAPI(SUCCEED); } diff --git a/src/H5Ostab.c b/src/H5Ostab.c index b3a3fd5..7bb06d5 100644 --- a/src/H5Ostab.c +++ b/src/H5Ostab.c @@ -20,7 +20,7 @@ * * Purpose: Symbol table messages. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ @@ -231,7 +231,7 @@ H5O_stab_copy(const void *_mesg, void *_dest, unsigned UNUSED update_flags) assert(stab); if (!dest && NULL==(dest = H5FL_MALLOC(H5O_stab_t))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); - + /* copy */ *dest = *stab; diff --git a/src/H5P.c b/src/H5P.c index 5720de7..e82b275 100644 --- a/src/H5P.c +++ b/src/H5P.c @@ -39,7 +39,7 @@ /* Local variables */ /* - * Predefined property list classes. These are initialized at runtime by + * Predefined property list classes. These are initialized at runtime by * H5P_init_interface() in this source file. */ hid_t H5P_CLS_NO_CLASS_g = FAIL; @@ -195,7 +195,7 @@ NAME H5P_init_interface -- Initialize interface-specific information USAGE herr_t H5P_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -393,7 +393,7 @@ H5P_copy_pclass(H5P_genclass_t *pclass) assert(pclass); - /* + /* * Create new property class object */ @@ -469,12 +469,12 @@ H5P_copy_plist(H5P_genplist_t *old_plist) size_t nseen; /* Number of items 'seen' */ hbool_t has_parent_class; /* Flag to indicate that this property list's class has a parent */ hid_t ret_value=FAIL; /* return value */ - + FUNC_ENTER_NOAPI(H5P_copy_plist, FAIL); assert(old_plist); - /* + /* * Create new property list object */ @@ -1428,7 +1428,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ hid_t -H5Pcreate_class(hid_t parent, const char *name, +H5Pcreate_class(hid_t parent, const char *name, H5P_cls_create_func_t cls_create, void *create_data, H5P_cls_copy_func_t cls_copy, void *copy_data, H5P_cls_close_func_t cls_close, void *close_data @@ -1451,7 +1451,7 @@ H5Pcreate_class(hid_t parent, const char *name, || (copy_data!=NULL && cls_copy==NULL) || (close_data!=NULL && cls_close==NULL)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "data specified, but no callback provided"); - + /* Get the pointer to the parent class */ if(parent==H5P_DEFAULT) par_class=NULL; @@ -1512,7 +1512,7 @@ H5P_create(H5P_genclass_t *pclass) assert(pclass); - /* + /* * Create new property list object */ @@ -2262,7 +2262,7 @@ done: transformation, etc. A single 'get' or 'set' callback could handle multiple properties by performing different actions based on the property name or other properties in the property list. - + There is no 'create' callback routine for temporary property list objects, the initial value is assumed to have any necessary setup already performed on it. @@ -2280,7 +2280,7 @@ done: herr_t H5P_insert(H5P_genplist_t *plist, const char *name, size_t size, void *value, H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, - H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, + H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, H5P_prp_compare_func_t prp_cmp, H5P_prp_close_func_t prp_close) { H5P_genprop_t *new_prop=NULL; /* Temporary property pointer */ @@ -2460,7 +2460,7 @@ done: transformation, etc. A single 'get' or 'set' callback could handle multiple properties by performing different actions based on the property name or other properties in the property list. - + There is no 'create' callback routine for temporary property list objects, the initial value is assumed to have any necessary setup already performed on it. @@ -2478,7 +2478,7 @@ done: herr_t H5Pinsert(hid_t plist_id, const char *name, size_t size, void *value, H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, - H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, + H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, H5P_prp_close_func_t prp_close) { H5P_genplist_t *plist; /* Property list to modify */ @@ -2869,7 +2869,7 @@ H5Pexist(hid_t id, const char *name) if ((ret_value=H5P_exist_plist(plist,name))<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "property does not exist in list"); } /* end if */ - else + else if(H5I_GENPROP_CLS == H5I_get_type(id)) { if (NULL == (pclass = H5I_object(id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property class"); @@ -3025,7 +3025,7 @@ H5Pget_size(hid_t id, const char *name, size_t *size) if ((ret_value=H5P_get_size_plist(plist,name,size))<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to query size in plist"); } /* end if */ - else + else if (H5I_GENPROP_CLS == H5I_get_type(id)) { if (NULL == (pclass = H5I_object(id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list"); @@ -3034,7 +3034,7 @@ H5Pget_size(hid_t id, const char *name, size_t *size) if ((ret_value=H5P_get_size_pclass(pclass,name,size))<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to query size in plist"); } /* end if */ - else + else HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property object"); done: @@ -3249,7 +3249,7 @@ H5Pget_nprops(hid_t id, size_t *nprops) if (H5P_get_nprops_plist(plist,nprops)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to query # of properties in plist"); } /* end if */ - else + else if(H5I_GENPROP_CLS == H5I_get_type(id)) { if (NULL == (pclass = H5I_object(id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property class"); @@ -3358,7 +3358,7 @@ done: NAME H5P_cmp_class PURPOSE - Internal routine to compare two generic property classes + Internal routine to compare two generic property classes USAGE int H5P_cmp_class(pclass1, pclass2) H5P_genclass_t *pclass1; IN: 1st property class to compare @@ -3464,7 +3464,7 @@ done: NAME H5P_cmp_plist PURPOSE - Internal routine to compare two generic property lists + Internal routine to compare two generic property lists USAGE int H5P_cmp_plist(plist1, plist2) H5P_genplist_t *plist1; IN: 1st property list to compare @@ -3837,27 +3837,27 @@ The iteration begins with the IDX property in the object and the next element to be processed by the operator is returned in IDX. If IDX is NULL, then the iterator starts at the first property; since no stopping point is returned in this case, the iterator cannot be restarted if one of the calls to its operator -returns non-zero. +returns non-zero. -The prototype for H5P_iterate_t is: - typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data); +The prototype for H5P_iterate_t is: + typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data); The operation receives the property list or class identifier for the object being iterated over, ID, the name of the current property within the object, -NAME, and the pointer to the operator data passed in to H5Piterate, ITER_DATA. +NAME, and the pointer to the operator data passed in to H5Piterate, ITER_DATA. -The return values from an operator are: +The return values from an operator are: Zero causes the iterator to continue, returning zero when all properties - have been processed. + have been processed. Positive causes the iterator to immediately return that positive value, indicating short-circuit success. The iterator can be restarted at the - index of the next property. + index of the next property. Negative causes the iterator to immediately return that value, indicating failure. The iterator can be restarted at the index of the next property. H5Piterate assumes that the properties in the object identified by ID remains unchanged through the iteration. If the membership changes during the -iteration, the function's behavior is undefined. +iteration, the function's behavior is undefined. GLOBAL VARIABLES COMMENTS, BUGS, ASSUMPTIONS @@ -3995,27 +3995,27 @@ The iteration begins with the IDX property in the object and the next element to be processed by the operator is returned in IDX. If IDX is NULL, then the iterator starts at the first property; since no stopping point is returned in this case, the iterator cannot be restarted if one of the calls to its operator -returns non-zero. +returns non-zero. -The prototype for H5P_iterate_t is: - typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data); +The prototype for H5P_iterate_t is: + typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data); The operation receives the property list or class identifier for the object being iterated over, ID, the name of the current property within the object, -NAME, and the pointer to the operator data passed in to H5Piterate, ITER_DATA. +NAME, and the pointer to the operator data passed in to H5Piterate, ITER_DATA. -The return values from an operator are: +The return values from an operator are: Zero causes the iterator to continue, returning zero when all properties - have been processed. + have been processed. Positive causes the iterator to immediately return that positive value, indicating short-circuit success. The iterator can be restarted at the - index of the next property. + index of the next property. Negative causes the iterator to immediately return that value, indicating failure. The iterator can be restarted at the index of the next property. H5Piterate assumes that the properties in the object identified by ID remains unchanged through the iteration. If the membership changes during the -iteration, the function's behavior is undefined. +iteration, the function's behavior is undefined. GLOBAL VARIABLES COMMENTS, BUGS, ASSUMPTIONS @@ -4099,25 +4099,25 @@ is returned in this case, the iterator cannot be restarted if one of the calls to its operator returns non-zero. The IDX value is 0-based (ie. to start at the "first" property, the IDX value should be 0). -The prototype for H5P_iterate_t is: - typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data); +The prototype for H5P_iterate_t is: + typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data); The operation receives the property list or class identifier for the object being iterated over, ID, the name of the current property within the object, -NAME, and the pointer to the operator data passed in to H5Piterate, ITER_DATA. +NAME, and the pointer to the operator data passed in to H5Piterate, ITER_DATA. -The return values from an operator are: +The return values from an operator are: Zero causes the iterator to continue, returning zero when all properties - have been processed. + have been processed. Positive causes the iterator to immediately return that positive value, indicating short-circuit success. The iterator can be restarted at the - index of the next property. + index of the next property. Negative causes the iterator to immediately return that value, indicating failure. The iterator can be restarted at the index of the next property. H5Piterate assumes that the properties in the object identified by ID remains unchanged through the iteration. If the membership changes during the -iteration, the function's behavior is undefined. +iteration, the function's behavior is undefined. GLOBAL VARIABLES COMMENTS, BUGS, ASSUMPTIONS @@ -4144,13 +4144,13 @@ H5Piterate(hid_t id, int *idx, H5P_iterate_t iter_func, void *iter_data) if ((ret_value=H5P_iterate_plist(id,(idx ? idx : &fake_idx),iter_func,iter_data))<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to iterate over list"); } /* end if */ - else + else if (H5I_GENPROP_CLS == H5I_get_type(id)) { /* Iterate over a property class */ if ((ret_value=H5P_iterate_pclass(id,(idx ? idx : &fake_idx),iter_func,iter_data))<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTREGISTER, FAIL, "unable to iterate over class"); } /* end if */ - else + else HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property object"); done: @@ -4736,7 +4736,7 @@ done: Failure: negative value. DESCRIPTION Copies a property from one property list to another. - + If a property is copied from one list to another, the property will be first deleted from the destination list (generating a call to the 'close' callback for the property, if one exists) and then the property is copied @@ -4845,12 +4845,12 @@ done: Failure: negative value. DESCRIPTION Copies a property from one property class to another. - + If a property is copied from one class to another, all the property information will be first deleted from the destination class and then the property information will be copied from the source class into the destination class. - + If the property does not exist in the destination class or list, this call is equivalent to calling H5Pregister. @@ -4908,12 +4908,12 @@ done: Failure: negative value. DESCRIPTION Copies a property from one property list or class to another. - + If a property is copied from one class to another, all the property information will be first deleted from the destination class and then the property information will be copied from the source class into the destination class. - + If a property is copied from one list to another, the property will be first deleted from the destination list (generating a call to the 'close' callback for the property, if one exists) and then the property is copied diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c index 00fef64..ac1367e 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -112,7 +112,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for + * Changed the way to check parameter and set property for * generic property list. * *------------------------------------------------------------------------- @@ -159,7 +159,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and get property for + * Changed the way to check parameter and get property for * generic property list. * *------------------------------------------------------------------------- @@ -205,7 +205,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for + * Changed the way to check parameter and set property for * generic property list. * *------------------------------------------------------------------------- @@ -274,7 +274,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for + * Changed the way to check parameter and set property for * generic property list. * *------------------------------------------------------------------------- @@ -295,10 +295,10 @@ H5Pget_chunk(hid_t plist_id, int max_ndims, hsize_t dim[]/*out*/) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); if(H5P_get(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't get layout"); - if(H5D_CHUNKED != layout) + HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't get layout"); + if(H5D_CHUNKED != layout) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a chunked storage layout"); - + if(H5P_get(plist, H5D_CRT_CHUNK_DIM_NAME, &ndims) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get chunk dimensionality"); @@ -347,7 +347,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for + * Changed the way to check parameter and set property for * generic property list. * *------------------------------------------------------------------------- @@ -388,7 +388,7 @@ H5Pset_external(hid_t plist_id, const char *name, off_t offset, hsize_t size) HGOTO_ERROR (H5E_EFL, H5E_OVERFLOW, FAIL, "total external data size overflowed"); } /* end for */ } /* end if */ - + /* Add to the list */ if (efl.nused >= efl.nalloc) { @@ -406,7 +406,7 @@ H5Pset_external(hid_t plist_id, const char *name, off_t offset, hsize_t size) efl.slot[idx].offset = offset; efl.slot[idx].size = size; efl.nused++; - + if(H5P_set(plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINIT, FAIL, "can't set external file list"); @@ -431,7 +431,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for + * Changed the way to check parameter and set property for * generic property list. * *------------------------------------------------------------------------- @@ -445,7 +445,7 @@ H5Pget_external_count(hid_t plist_id) FUNC_ENTER_API(H5Pget_external_count, FAIL); H5TRACE1("Is","i",plist_id); - + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); @@ -453,10 +453,10 @@ H5Pget_external_count(hid_t plist_id) /* Get value */ if(H5P_get(plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external file list"); - + /* Set return value */ ret_value=(int)efl.nused; - + done: FUNC_LEAVE_API(ret_value); } @@ -488,7 +488,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and get property for + * Changed the way to check parameter and get property for * generic property list. * *------------------------------------------------------------------------- @@ -503,7 +503,7 @@ H5Pget_external(hid_t plist_id, unsigned idx, size_t name_size, char *name/*out* FUNC_ENTER_API(H5Pget_external, FAIL); H5TRACE6("e","iIuzxxx",plist_id,idx,name_size,name,offset,size); - + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); @@ -511,7 +511,7 @@ H5Pget_external(hid_t plist_id, unsigned idx, size_t name_size, char *name/*out* /* Get value */ if(H5P_get(plist, H5D_CRT_EXT_FILE_LIST_NAME, &efl) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get external file list"); - + if (idx>=efl.nused) HGOTO_ERROR (H5E_ARGS, H5E_BADRANGE, FAIL, "external file index is out of range"); @@ -644,7 +644,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for + * Changed the way to check parameter and set property for * generic property list. * *------------------------------------------------------------------------- @@ -752,7 +752,7 @@ done: * value between zero and N-1 as described for H5Pget_nfilters() * and the function will return failure if the filter number is * out or range. - * + * * Return: Success: Filter identification number. * * Failure: H5Z_FILTER_ERROR (Negative) @@ -764,8 +764,8 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check paramter and set property for - * generic property list. + * Changed the way to check paramter and set property for + * generic property list. * *------------------------------------------------------------------------- */ @@ -779,7 +779,7 @@ H5Pget_filter(hid_t plist_id, unsigned idx, unsigned int *flags/*out*/, H5P_genplist_t *plist; /* Property list pointer */ size_t i; /* Local index variable */ H5Z_filter_t ret_value; /* return value */ - + FUNC_ENTER_API(H5Pget_filter, H5Z_FILTER_ERROR); H5TRACE7("Zf","iIux*zxzx",plist_id,idx,flags,cd_nelmts,cd_values,namelen, name); @@ -843,7 +843,7 @@ H5Pget_filter(hid_t plist_id, unsigned idx, unsigned int *flags/*out*/, else name[0] = '\0'; } - + /* Set return value */ ret_value=filter->id; @@ -864,7 +864,7 @@ done: * number of values defined by the filter. The ID should be the * filter ID to retrieve the parameters for. If the filter is not * set for the property list, an error will be returned. - * + * * Return: Success: Non-negative * Failure: Negative * @@ -885,11 +885,11 @@ H5Pget_filter_by_id(hid_t plist_id, H5Z_filter_t id, unsigned int *flags/*out*/, H5P_genplist_t *plist; /* Property list pointer */ size_t i; /* Local index variable */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Pget_filter_by_id, FAIL); H5TRACE7("e","iZfx*zxzx",plist_id,id,flags,cd_nelmts,cd_values,namelen, name); - + /* Check args */ if (cd_nelmts || cd_values) { if (cd_nelmts && *cd_nelmts>256) @@ -957,7 +957,7 @@ done: * * Purpose: This is a query routine to verify that all the filters set * in the dataset creation property list are available currently. - * + * * Return: Success: TRUE if all filters available, FALSE if one or * more filters not currently available. * Failure: FAIL on error @@ -975,10 +975,10 @@ H5Pall_filters_avail(hid_t plist_id) H5O_pline_t pline; /* Filter pipeline */ H5P_genplist_t *plist; /* Property list pointer */ hbool_t ret_value=TRUE; /* return value */ - + FUNC_ENTER_API(H5Pall_filters_avail, UFAIL); H5TRACE1("t","i",plist_id); - + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, UFAIL, "can't find object for ID"); @@ -1016,8 +1016,8 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for - * generic property list. + * Changed the way to check parameter and set property for + * generic property list. * *------------------------------------------------------------------------- */ @@ -1027,14 +1027,14 @@ H5Pset_deflate(hid_t plist_id, unsigned level) H5O_pline_t pline; H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_deflate, FAIL); H5TRACE2("e","iIu",plist_id,level); /* Check arguments */ if (level>9) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "invalid deflate level"); - + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); @@ -1081,7 +1081,7 @@ H5Pset_szip(hid_t plist_id, unsigned options_mask, unsigned pixels_per_block) H5P_genplist_t *plist; /* Property list pointer */ unsigned cd_values[2]; /* Filter parameters */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_szip, FAIL); H5TRACE3("e","iIuIu",plist_id,options_mask,pixels_per_block); @@ -1095,7 +1095,7 @@ H5Pset_szip(hid_t plist_id, unsigned options_mask, unsigned pixels_per_block) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "pixels_per_block is not even"); if (pixels_per_block>H5_SZIP_MAX_PIXELS_PER_BLOCK) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "pixels_per_block is too large"); - + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); @@ -1131,10 +1131,10 @@ done: /*------------------------------------------------------------------------- * Function: H5Pset_shuffle * - * Purpose: Sets the shuffling method for a permanent + * Purpose: Sets the shuffling method for a permanent * filter to H5Z_FILTER_SHUFFLE - * and bytes of the datatype of the array to be shuffled - * + * and bytes of the datatype of the array to be shuffled + * * Return: Non-negative on success/Negative on failure * * Programmer: Kent Yang @@ -1150,14 +1150,14 @@ H5Pset_shuffle(hid_t plist_id) H5O_pline_t pline; H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_shuffle, FAIL); H5TRACE1("e","i",plist_id); /* Check arguments */ if(TRUE != H5P_isa_class(plist_id, H5P_DATASET_CREATE)) HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset creation property list"); - + /* Get the plist structure */ if(NULL == (plist = H5I_object(plist_id))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); @@ -1178,7 +1178,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Pset_fletcher32 * - * Purpose: Sets Fletcher32 checksum of EDC for a dataset creation + * Purpose: Sets Fletcher32 checksum of EDC for a dataset creation * property list. * * Return: Non-negative on success/Negative on failure @@ -1196,10 +1196,10 @@ H5Pset_fletcher32(hid_t plist_id) H5O_pline_t pline; H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_fletcher32, FAIL); H5TRACE1("e","i",plist_id); - + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); @@ -1224,7 +1224,7 @@ done: * VALUE is interpretted as being of type TYPE, which need not * be the same type as the dataset but the library must be able * to convert VALUE to the dataset type when the dataset is - * created. If VALUE is NULL, it will be interpreted as + * created. If VALUE is NULL, it will be interpreted as * undefining fill value. * * Return: Non-negative on success/Negative on failure @@ -1236,8 +1236,8 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and set property for - * generic property list. + * Changed the way to check parameter and set property for + * generic property list. * *------------------------------------------------------------------------- */ @@ -1248,7 +1248,7 @@ H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value) H5T_t *type = NULL; H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_fill_value, FAIL); H5TRACE3("e","iix",plist_id,type_id,value); @@ -1282,7 +1282,7 @@ H5Pset_fill_value(hid_t plist_id, hid_t type_id, const void *value) if(H5P_set(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set fill value"); - + done: FUNC_LEAVE_API(ret_value); } @@ -1306,7 +1306,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check parameter and get property for + * Changed the way to check parameter and get property for * generic property list. * *------------------------------------------------------------------------- @@ -1322,7 +1322,7 @@ H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/) hid_t src_id = -1; /*source data type id */ herr_t ret_value=SUCCEED; /* Return value */ H5P_genplist_t *plist; /* Property list pointer */ - + FUNC_ENTER_API(H5Pget_fill_value, FAIL); H5TRACE3("e","iix",plist_id,type_id,value); @@ -1331,7 +1331,7 @@ H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); if (!value) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL,"no fill value output buffer"); - + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); @@ -1343,14 +1343,14 @@ H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/) * is undefined, also return error. */ if(H5P_get(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fill value"); + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fill value"); if(fill.size == (size_t)-1) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "fill value is undefined"); if(fill.size == 0) { HDmemset(value, 0, H5T_get_size(type)); HGOTO_DONE(SUCCEED); - } + } /* * Can we convert between the source and destination data types? */ @@ -1365,7 +1365,7 @@ H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/) * other than the fill value buffer that is large enough for both source * and destination. The app-supplied buffer might do okay. */ - if (H5T_get_size(type)>=H5T_get_size(fill.type)) { + if (H5T_get_size(type)>=H5T_get_size(fill.type)) { buf = value; if (H5T_path_bkg(tpath) && NULL==(bkg=H5MM_malloc(H5T_get_size(type)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion"); @@ -1376,7 +1376,7 @@ H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/) bkg = value; } HDmemcpy(buf, fill.buf, H5T_get_size(fill.type)); - + /* Do the conversion */ if (H5T_convert(tpath, src_id, type_id, 1, 0, 0, buf, bkg, H5AC_dxpl_id)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "data type conversion failed"); @@ -1398,7 +1398,7 @@ done: * Function: H5P_is_fill_value_defined * * Purpose: Check if fill value is defined. Internal version of function - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Raymond Lu @@ -1430,7 +1430,7 @@ H5P_is_fill_value_defined(const struct H5O_fill_t *fill, H5D_fill_value_t *statu *status = H5D_FILL_VALUE_USER_DEFINED; else { *status = H5D_FILL_VALUE_ERROR; - HGOTO_ERROR(H5E_PLIST, H5E_BADRANGE, FAIL, "invalid combination of fill-value info"); + HGOTO_ERROR(H5E_PLIST, H5E_BADRANGE, FAIL, "invalid combination of fill-value info"); } done: @@ -1442,14 +1442,14 @@ done: * Function: H5Pfill_value_defined * * Purpose: Check if fill value is defined. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Raymond Lu * Wednesday, January 16, 2002 * * Modifications: - * + * * *------------------------------------------------------------------------- */ @@ -1471,11 +1471,11 @@ H5Pfill_value_defined(hid_t plist_id, H5D_fill_value_t *status) /* Get the fill value struct */ if(H5P_get(plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fill value"); + HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fill value"); /* Get the fill-value status */ if(H5P_is_fill_value_defined(&fill, status) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't check fill value status"); + HGOTO_ERROR(H5E_PLIST, H5E_BADVALUE, FAIL, "can't check fill value status"); done: FUNC_LEAVE_API(ret_value); @@ -1488,14 +1488,14 @@ done: * Purpose: Set space allocation time for dataset during creation. * Valid values are H5D_ALLOC_TIME_DEFAULT, H5D_ALLOC_TIME_EARLY, * H5D_ALLOC_TIME_LATE, H5D_ALLOC_TIME_INCR - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Raymond Lu * Wednesday, January 16, 2002 * * Modifications: - * + * * *------------------------------------------------------------------------- */ @@ -1516,7 +1516,7 @@ H5Pset_alloc_time(hid_t plist_id, H5D_alloc_time_t alloc_time) /* Check for resetting to default for layout type */ if(alloc_time==H5D_ALLOC_TIME_DEFAULT) { H5D_layout_t layout; /* Type of storage layout */ - + /* Retrieve the storage layout */ if(H5P_get(plist, H5D_CRT_LAYOUT_NAME, &layout) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get layout"); @@ -1553,7 +1553,7 @@ H5Pset_alloc_time(hid_t plist_id, H5D_alloc_time_t alloc_time) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set space allocation time"); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value); } @@ -1563,14 +1563,14 @@ done: * Purpose: Get space allocation time for dataset creation. * Valid values are H5D_ALLOC_TIME_DEFAULT, H5D_ALLOC_TIME_EARLY, * H5D_ALLOC_TIME_LATE, H5D_ALLOC_TIME_INCR - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Raymond Lu * Wednesday, January 16, 2002 * * Modifications: - * + * * *------------------------------------------------------------------------- */ @@ -1678,8 +1678,8 @@ done: * Function: H5Premove_filter * * Purpose: Deletes a filter from the dataset creation property list; - * deletes all filters if FILTER is H5Z_FILTER_NONE - * + * deletes all filters if FILTER is H5Z_FILTER_NONE + * * Return: Non-negative on success/Negative on failure * * Programmer: Pedro Vicente diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c index 6d09a9e..c147b77 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -352,7 +352,7 @@ H5Pset_preserve(hid_t plist_id, hbool_t status) H5T_bkg_t need_bkg; /* Value for background buffer type */ H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_preserve, FAIL); H5TRACE2("e","ib",plist_id,status); @@ -392,7 +392,7 @@ H5Pget_preserve(hid_t plist_id) H5T_bkg_t need_bkg; /* Background value */ H5P_genplist_t *plist; /* Property list pointer */ int ret_value; /* return value */ - + FUNC_ENTER_API(H5Pget_preserve, FAIL); H5TRACE1("Is","i",plist_id); @@ -415,9 +415,9 @@ done: /*------------------------------------------------------------------------- * Function: H5Pset_edc_check * - * Purpose: Enable or disable error-detecting for a dataset reading - * process. This error-detecting algorithm is whichever - * user chooses earlier. This function cannot control + * Purpose: Enable or disable error-detecting for a dataset reading + * process. This error-detecting algorithm is whichever + * user chooses earlier. This function cannot control * writing process. * * Return: Non-negative on success/Negative on failure @@ -434,14 +434,14 @@ H5Pset_edc_check(hid_t plist_id, H5Z_EDC_t check) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_edc_check, FAIL); H5TRACE2("e","iZe",plist_id,check); /* Check argument */ if (check != H5Z_ENABLE_EDC && check != H5Z_DISABLE_EDC) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a valid value"); - + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); @@ -449,7 +449,7 @@ H5Pset_edc_check(hid_t plist_id, H5Z_EDC_t check) /* Update property list */ if (H5P_set(plist,H5D_XFER_EDC_NAME,&check)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value"); - + done: FUNC_LEAVE_API(ret_value); } @@ -458,9 +458,9 @@ done: /*------------------------------------------------------------------------- * Function: H5Pget_edc_check * - * Purpose: Enable or disable error-detecting for a dataset reading - * process. This error-detecting algorithm is whichever - * user chooses earlier. This function cannot control + * Purpose: Enable or disable error-detecting for a dataset reading + * process. This error-detecting algorithm is whichever + * user chooses earlier. This function cannot control * writing process. * * Return: Non-negative on success/Negative on failure @@ -477,7 +477,7 @@ H5Pget_edc_check(hid_t plist_id) { H5P_genplist_t *plist; /* Property list pointer */ H5Z_EDC_t ret_value; /* return value */ - + FUNC_ENTER_API(H5Pget_edc_check, H5Z_ERROR_EDC); H5TRACE1("Ze","i",plist_id); @@ -496,7 +496,7 @@ H5Pget_edc_check(hid_t plist_id) done: FUNC_LEAVE_API(ret_value); } - + /*------------------------------------------------------------------------- * Function: H5Pset_filter_callback @@ -520,7 +520,7 @@ H5Pset_filter_callback(hid_t plist_id, H5Z_filter_func_t func, void *op_data) H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ H5Z_cb_t cb_struct; - + FUNC_ENTER_API(H5Pset_filter_callback, FAIL); H5TRACE3("e","ixx",plist_id,func,op_data); @@ -531,7 +531,7 @@ H5Pset_filter_callback(hid_t plist_id, H5Z_filter_func_t func, void *op_data) /* Update property list */ cb_struct.func = func; cb_struct.op_data = op_data; - + if (H5P_set(plist,H5D_XFER_FILTER_CB_NAME,&cb_struct)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value"); @@ -626,7 +626,7 @@ H5Pset_btree_ratios(hid_t plist_id, double left, double middle, if (left<0.0 || left>1.0 || middle<0.0 || middle>1.0 || right<0.0 || right>1.0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "split ratio must satisfy 0.0<=X<=1.0"); - + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c index cf7a964..ffbc844 100644 --- a/src/H5Pfapl.c +++ b/src/H5Pfapl.c @@ -62,7 +62,7 @@ static herr_t H5P_get_multi_type(H5P_genplist_t *plist, H5FD_mem_t *type); * * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed file access property list mechanism to the new + * Changed file access property list mechanism to the new * generic property list. *------------------------------------------------------------------------- */ @@ -71,7 +71,7 @@ H5Pset_alignment(hid_t fapl_id, hsize_t threshold, hsize_t alignment) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_alignment, FAIL); H5TRACE3("e","ihh",fapl_id,threshold,alignment); @@ -108,9 +108,9 @@ done: * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list design to the new generic + * Changed the file access list design to the new generic * property list. * *------------------------------------------------------------------------- @@ -164,7 +164,7 @@ done: * * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list design to the new generic + * Changed the file access list design to the new generic * property list. * *------------------------------------------------------------------------- @@ -175,7 +175,7 @@ H5P_set_driver(H5P_genplist_t *plist, hid_t new_driver_id, const void *new_drive hid_t driver_id; /* VFL driver ID */ void *driver_info; /* VFL driver info */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5P_set_driver, FAIL); if (NULL==H5I_object_verify(new_driver_id, H5I_VFL)) @@ -240,7 +240,7 @@ done: * * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list design to the new generic + * Changed the file access list design to the new generic * property list. * *------------------------------------------------------------------------- @@ -250,7 +250,7 @@ H5Pset_driver(hid_t plist_id, hid_t new_driver_id, const void *new_driver_info) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Pset_driver, FAIL); H5TRACE3("e","iix",plist_id,new_driver_id,new_driver_info); @@ -290,15 +290,15 @@ done: * Rewritten to use the virtual file layer. * * Robb Matzke, 1999-08-05 - * If the driver ID is H5FD_VFD_DEFAULT then substitute the + * If the driver ID is H5FD_VFD_DEFAULT then substitute the * current value of H5FD_SEC2. * * Quincey Koziol 2000-11-28 * Added internal function.. * * Raymond Lu, 2001-10-23 - * Changed the file access list design to the new generic - * property list. + * Changed the file access list design to the new generic + * property list. * *------------------------------------------------------------------------- */ @@ -396,9 +396,9 @@ done: * * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list design to the new generic + * Changed the file access list design to the new generic * property list. - * + * *------------------------------------------------------------------------- */ void * @@ -418,7 +418,7 @@ H5P_get_driver_info(H5P_genplist_t *plist) } else { HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access or data transfer property list"); } - + done: FUNC_LEAVE_NOAPI(ret_value); } /* end H5P_get_driver_info() */ @@ -445,9 +445,9 @@ done: * * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list design to the new generic + * Changed the file access list design to the new generic * property list. - * + * *------------------------------------------------------------------------- */ void * @@ -463,7 +463,7 @@ H5Pget_driver_info(hid_t plist_id) if((ret_value=H5P_get_driver_info(plist))==NULL) HGOTO_ERROR(H5E_PLIST,H5E_CANTGET,NULL,"can't get driver info"); - + done: FUNC_LEAVE_API(ret_value); } /* end H5Pget_driver_info() */ @@ -471,20 +471,20 @@ done: /*------------------------------------------------------------------------- * Function: H5Pset_family_offset - * + * * Purpose: Set offset for family driver. This file access property * list will be passed to H5Fget_vfd_handle or H5FDget_vfd_handle * to retrieve VFD file handle. - * - * Return: Success: Non-negative value. - * - * Failure: Negative value. - * - * Programmer: Raymond Lu - * Sep 17, 2002 - * + * + * Return: Success: Non-negative value. + * + * Failure: Negative value. + * + * Programmer: Raymond Lu + * Sep 17, 2002 + * * Modifications: - * + * *------------------------------------------------------------------------- */ herr_t @@ -504,7 +504,7 @@ H5Pset_family_offset(hid_t fapl_id, hsize_t offset) /* Set values */ if((ret_value=H5P_set_family_offset(plist, offset)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set family offset"); - + done: FUNC_LEAVE_API(ret_value); } @@ -512,19 +512,19 @@ done: /*------------------------------------------------------------------------- * Function: H5P_set_family_offset - * - * Purpose: Set offset for family driver. Private function for + * + * Purpose: Set offset for family driver. Private function for * H5Pset_family_offset - * + * * Return: Success: Non-negative value. - * + * * Failure: Negative value. - * - * Programmer: Raymond Lu + * + * Programmer: Raymond Lu * Sep 17, 2002 - * + * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -544,24 +544,24 @@ H5P_set_family_offset(H5P_genplist_t *plist, hsize_t offset) done: FUNC_LEAVE_NOAPI(ret_value); } - + /*------------------------------------------------------------------------- * Function: H5Pget_family_offset - * + * * Purpose: Get offset for family driver. This file access property * list will be passed to H5Fget_vfd_handle or H5FDget_vfd_handle * to retrieve VFD file handle. - * + * * Return: Success: Non-negative value. - * + * * Failure: Negative value. - * - * Programmer: Raymond Lu - * Sep 17, 2002 - * + * + * Programmer: Raymond Lu + * Sep 17, 2002 + * * Modifications: - * + * *------------------------------------------------------------------------- */ herr_t @@ -569,10 +569,10 @@ H5Pget_family_offset(hid_t fapl_id, hsize_t *offset) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pget_family_offset, FAIL); H5TRACE2("e","i*h",fapl_id,offset); - + /* Get the plist structure */ if(H5P_DEFAULT == fapl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list"); @@ -581,64 +581,64 @@ H5Pget_family_offset(hid_t fapl_id, hsize_t *offset) /* Set values */ if((ret_value=H5P_get_family_offset(plist, offset)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't get family offset"); - -done: + +done: FUNC_LEAVE_API(ret_value); -} +} /*------------------------------------------------------------------------- * Function: H5P_get_family_offset - * + * * Purpose: Get offset for family driver. Private function for * H5Pget_family_offset - * + * * Return: Success: Non-negative value. - * + * * Failure: Negative value. - * - * Programmer: Raymond Lu - * Sep 17, 2002 - * + * + * Programmer: Raymond Lu + * Sep 17, 2002 + * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t H5P_get_family_offset(H5P_genplist_t *plist, hsize_t *offset) { herr_t ret_value=SUCCEED; - + FUNC_ENTER_NOAPI(H5P_get_family_offset, FAIL); - + if( TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS) ) { if(H5P_get(plist, H5F_ACS_FAMILY_OFFSET_NAME, offset) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL,"can't set offset for family file"); - } else { + } else { HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access or data transfer property list"); - } - + } + done: FUNC_LEAVE_NOAPI(ret_value); -} - +} + /*------------------------------------------------------------------------- * Function: H5Pset_multi_type - * + * * Purpose: Set data type for multi driver. This file access property * list will be passed to H5Fget_vfd_handle or H5FDget_vfd_handle * to retrieve VFD file handle. - * + * * Return: Success: Non-negative value. - * + * * Failure: Negative value. - * - * Programmer: Raymond Lu + * + * Programmer: Raymond Lu * Sep 17, 2002 - * + * * Modifications: - * + * *------------------------------------------------------------------------- */ herr_t @@ -658,7 +658,7 @@ H5Pset_multi_type(hid_t fapl_id, H5FD_mem_t type) /* Set values */ if((ret_value=H5P_set_multi_type(plist, type)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set data type for multi driver"); - + done: FUNC_LEAVE_API(ret_value); } @@ -666,19 +666,19 @@ done: /*------------------------------------------------------------------------- * Function: H5P_set_multi_type - * + * * Purpose: Set data type for multi file driver. Private function for * H5Pset_multi_type. - * + * * Return: Success: Non-negative value. - * + * * Failure: Negative value. - * - * Programmer: Raymond Lu + * + * Programmer: Raymond Lu * Sep 17, 2002 - * + * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -697,25 +697,25 @@ H5P_set_multi_type(H5P_genplist_t *plist, H5FD_mem_t type) done: FUNC_LEAVE_NOAPI(ret_value); -} +} /*------------------------------------------------------------------------- * Function: H5Pget_multi_type - * + * * Purpose: Get data type for multi driver. This file access property * list will be passed to H5Fget_vfd_handle or H5FDget_vfd_handle * to retrieve VFD file handle. - * + * * Return: Success: Non-negative value. - * + * * Failure: Negative value. - * - * Programmer: Raymond Lu - * Sep 17, 2002 - * + * + * Programmer: Raymond Lu + * Sep 17, 2002 + * * Modifications: - * + * *------------------------------------------------------------------------- */ herr_t @@ -723,10 +723,10 @@ H5Pget_multi_type(hid_t fapl_id, H5FD_mem_t *type) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pget_multi_type, FAIL); H5TRACE2("e","i*Mt",fapl_id,type); - + /* Get the plist structure */ if(H5P_DEFAULT == fapl_id) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "can't modify default property list"); @@ -735,46 +735,46 @@ H5Pget_multi_type(hid_t fapl_id, H5FD_mem_t *type) /* Set values */ if((ret_value=H5P_get_multi_type(plist, type)) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't get data type for multi driver"); - -done: - FUNC_LEAVE_API(ret_value); -} + +done: + FUNC_LEAVE_API(ret_value); +} /*------------------------------------------------------------------------- * Function: H5P_get_multi_type - * + * * Purpose: Get data type for multi file driver. Private function for * H5Pget_multi_type. - * + * * Return: Success: Non-negative value. - * + * * Failure: Negative value. - * - * Programmer: Raymond Lu - * Sep 17, 2002 - * + * + * Programmer: Raymond Lu + * Sep 17, 2002 + * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t H5P_get_multi_type(H5P_genplist_t *plist, H5FD_mem_t *type) { herr_t ret_value=SUCCEED; - + FUNC_ENTER_NOAPI(H5P_get_multi_type, FAIL); - + if( TRUE == H5P_isa_class(plist->plist_id, H5P_FILE_ACCESS) ) { - if(H5P_get(plist, H5F_ACS_MULTI_TYPE_NAME, type) < 0) - HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL,"can't get type for multi driver"); - } else { - HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); - } - + if(H5P_get(plist, H5F_ACS_MULTI_TYPE_NAME, type) < 0) + HGOTO_ERROR(H5E_PLIST, H5E_CANTSET,FAIL,"can't get type for multi driver"); + } else { + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a file access property list"); + } + done: FUNC_LEAVE_NOAPI(ret_value); -} +} #ifdef H5_WANT_H5_V1_4_COMPAT @@ -800,10 +800,10 @@ done: * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 * Changed the file access list to the new generic property list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -813,7 +813,7 @@ H5Pset_cache(hid_t plist_id, int mdc_nelmts, H5P_genplist_t *plist; /* Property list pointer */ size_t rdcc_nelmts=(size_t)_rdcc_nelmts; /* Work around variable changing size */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_cache, FAIL); H5TRACE5("e","iIsIszd",plist_id,mdc_nelmts,_rdcc_nelmts,rdcc_nbytes, rdcc_w0); @@ -861,9 +861,9 @@ done: * * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -873,7 +873,7 @@ H5Pget_cache(hid_t plist_id, int *mdc_nelmts, H5P_genplist_t *plist; /* Property list pointer */ size_t rdcc_nelmts; /* Work around variable changing size */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pget_cache, FAIL); H5TRACE5("e","i*Is*Is*z*d",plist_id,mdc_nelmts,_rdcc_nelmts,rdcc_nbytes, rdcc_w0); @@ -926,10 +926,10 @@ done: * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 * Changed the file access list to the new generic property list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -938,7 +938,7 @@ H5Pset_cache(hid_t plist_id, int mdc_nelmts, { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_cache, FAIL); H5TRACE5("e","iIszzd",plist_id,mdc_nelmts,rdcc_nelmts,rdcc_nbytes,rdcc_w0); @@ -985,9 +985,9 @@ done: * * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -996,7 +996,7 @@ H5Pget_cache(hid_t plist_id, int *mdc_nelmts, { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pget_cache, FAIL); H5TRACE5("e","i*Is*z*z*d",plist_id,mdc_nelmts,rdcc_nelmts,rdcc_nbytes, rdcc_w0); @@ -1049,11 +1049,11 @@ done: * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -1093,9 +1093,9 @@ done: * * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -1128,8 +1128,8 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: Raymond Lu - * November, 2001 + * Programmer: Raymond Lu + * November, 2001 * * Modifications: * @@ -1160,12 +1160,12 @@ done: /*------------------------------------------------------------------------- * Function: H5Pget_fclose_degree * - * Purpose: Returns the degree for the file close behavior. + * Purpose: Returns the degree for the file close behavior. * * Return: Non-negative on success/Negative on failure * - * Programmer: Raymond Lu - * November, 2001 + * Programmer: Raymond Lu + * November, 2001 * * Modifications: * @@ -1182,12 +1182,12 @@ herr_t H5Pget_fclose_degree(hid_t plist_id, H5F_close_degree_t *degree) if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_ACCESS))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); - if( degree && (H5P_get(plist, H5F_CLOSE_DEGREE_NAME, degree) < 0) ) + if( degree && (H5P_get(plist, H5F_CLOSE_DEGREE_NAME, degree) < 0) ) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get file close degree"); done: FUNC_LEAVE_API(ret_value); -} +} /*------------------------------------------------------------------------- @@ -1198,7 +1198,7 @@ done: * Each "raw" metadata block is allocated to be this size and then * specific pieces of metadata (object headers, local heaps, B-trees, etc) * are sub-allocated from this block. - * + * * The default value is set to 2048 (bytes), indicating that metadata * will be attempted to be bunched together in (at least) 2K blocks in * the file. Setting the value to 0 with this API function will @@ -1214,8 +1214,8 @@ done: * * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property - * list. + * Changed the file access list to the new generic property + * list. * *------------------------------------------------------------------------- */ @@ -1254,9 +1254,9 @@ done: * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. * *------------------------------------------------------------------------- @@ -1295,7 +1295,7 @@ done: * buffer which is large anough to hold several pieces of the dataset * being read in for hyperslab selections boosts performance by quite a * bit. - * + * * The default value is set to 64KB, indicating that file I/O for raw data * reads and writes will occur in at least 64KB blocks. * Setting the value to 0 with this API function will turn off the @@ -1308,9 +1308,9 @@ done: * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. * *------------------------------------------------------------------------- @@ -1321,7 +1321,7 @@ H5Pset_sieve_buf_size(hid_t plist_id, hsize_t _size) H5P_genplist_t *plist; /* Property list pointer */ size_t size=(size_t)_size; /* Work around size difference */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_sieve_buf_size, FAIL); H5TRACE2("e","ih",plist_id,_size); @@ -1351,9 +1351,9 @@ done: * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. * *------------------------------------------------------------------------- @@ -1393,7 +1393,7 @@ done: * buffer which is large anough to hold several pieces of the dataset * being read in for hyperslab selections boosts performance by quite a * bit. - * + * * The default value is set to 64KB, indicating that file I/O for raw data * reads and writes will occur in at least 64KB blocks. * Setting the value to 0 with this API function will turn off the @@ -1406,9 +1406,9 @@ done: * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. * *------------------------------------------------------------------------- @@ -1418,7 +1418,7 @@ H5Pset_sieve_buf_size(hid_t plist_id, size_t size) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_sieve_buf_size, FAIL); H5TRACE2("e","iz",plist_id,size); @@ -1448,9 +1448,9 @@ done: * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 - * Changed the file access list to the new generic property + * Changed the file access list to the new generic property * list. * *------------------------------------------------------------------------- @@ -1487,7 +1487,7 @@ done: * Each "small" raw data block is allocated to be this size and then * pieces of raw data which are small enough to fit are sub-allocated from * this block. - * + * * The default value is set to 2048 (bytes), indicating that raw data * smaller than this value will be attempted to be bunched together in (at * least) 2K blocks in the file. Setting the value to 0 with this API diff --git a/src/H5Pfcpl.c b/src/H5Pfcpl.c index 90ed7f7..4f159e3 100644 --- a/src/H5Pfcpl.c +++ b/src/H5Pfcpl.c @@ -53,7 +53,7 @@ * * Raymond Lu, Oct 14, 2001 * Change to the new generic property list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -104,7 +104,7 @@ done: * * Raymond Lu, Oct 14, 2001 * Changed to the new generic property list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -157,7 +157,7 @@ done: * * Raymond Lu, Oct 14, 2001 * Changed to the new generic property list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -309,7 +309,7 @@ done: * Modifications: * * Raymond Lu, Oct 14, 2001 - * Changed to the new generic property list. + * Changed to the new generic property list. * *------------------------------------------------------------------------- */ @@ -326,7 +326,7 @@ H5Pset_sym_k(hid_t plist_id, int ik, int lk) /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); - + /* Set values */ if (ik > 0) { if(H5P_get(plist, H5F_CRT_BTREE_RANK_NAME, btree_k) < 0) @@ -361,7 +361,7 @@ done: * * Raymond Lu * Changed to the new generic property list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -419,7 +419,7 @@ done: * Modifications: * * Raymond Lu, Oct 14, 2001 - * Changed to the new generic property list. + * Changed to the new generic property list. * *------------------------------------------------------------------------- */ @@ -436,7 +436,7 @@ H5Pset_sym_k(hid_t plist_id, unsigned ik, unsigned lk) /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_CREATE))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); - + /* Set values */ if (ik > 0) { if(H5P_get(plist, H5F_CRT_BTREE_RANK_NAME, btree_k) < 0) @@ -471,7 +471,7 @@ done: * * Raymond Lu * Changed to the new generic property list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -520,7 +520,7 @@ done: * * Raymond Lu, Oct 14, 2001 * Changed to the new generic property list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -571,7 +571,7 @@ done: * * Raymond Lu, Oct 14, 2001 * Changed to the new generic property list. - * + * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Pprivate.h b/src/H5Pprivate.h index 69990e3..0285564 100644 --- a/src/H5Pprivate.h +++ b/src/H5Pprivate.h @@ -40,7 +40,7 @@ H5_DLL herr_t H5P_get(H5P_genplist_t *plist, const char *name, void *value); H5_DLL herr_t H5P_set(H5P_genplist_t *plist, const char *name, const void *value); H5_DLL herr_t H5P_insert(H5P_genplist_t *plist, const char *name, size_t size, void *value, H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, - H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, + H5P_prp_delete_func_t prp_delete, H5P_prp_copy_func_t prp_copy, H5P_prp_compare_func_t prp_cmp, H5P_prp_close_func_t prp_close); H5_DLL herr_t H5P_remove(hid_t plist_id, H5P_genplist_t *plist, const char *name); H5_DLL htri_t H5P_exist_plist(H5P_genplist_t *plist, const char *name); diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index c13d8f8..ac7f5e7 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -58,7 +58,7 @@ extern "C" { /* Define property list class callback function pointer types */ typedef herr_t (*H5P_cls_create_func_t)(hid_t prop_id, void *create_data); -typedef herr_t (*H5P_cls_copy_func_t)(hid_t new_prop_id, hid_t old_prop_id, +typedef herr_t (*H5P_cls_copy_func_t)(hid_t new_prop_id, hid_t old_prop_id, void *copy_data); typedef herr_t (*H5P_cls_close_func_t)(hid_t prop_id, void *close_data); @@ -74,7 +74,7 @@ typedef int (*H5P_prp_compare_func_t)(const void *value1, const void *value2, si typedef H5P_prp_cb1_t H5P_prp_close_func_t; /* Define property list iteration function type */ -typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data); +typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data); /* * The library created property list classes @@ -124,7 +124,7 @@ H5_DLLVAR hid_t H5P_LST_DATASET_XFER_g; H5_DLLVAR hid_t H5P_LST_MOUNT_g; /* Public functions */ -H5_DLL hid_t H5Pcreate_class(hid_t parent, const char *name, +H5_DLL hid_t H5Pcreate_class(hid_t parent, const char *name, H5P_cls_create_func_t cls_create, void *create_data, H5P_cls_copy_func_t cls_copy, void *copy_data, H5P_cls_close_func_t cls_close, void *close_data); @@ -133,7 +133,7 @@ H5_DLL hid_t H5Pcreate(hid_t cls_id); H5_DLL herr_t H5Pregister(hid_t cls_id, const char *name, size_t size, void *def_value, H5P_prp_create_func_t prp_create, H5P_prp_set_func_t prp_set, H5P_prp_get_func_t prp_get, - H5P_prp_delete_func_t prp_del, + H5P_prp_delete_func_t prp_del, H5P_prp_copy_func_t prp_copy, H5P_prp_close_func_t prp_close); H5_DLL herr_t H5Pinsert(hid_t plist_id, const char *name, size_t size, @@ -236,7 +236,7 @@ H5_DLL herr_t H5Pset_shuffle(hid_t plist_id); H5_DLL herr_t H5Pset_fletcher32(hid_t plist_id); H5_DLL herr_t H5Pset_edc_check(hid_t plist_id, H5Z_EDC_t check); H5_DLL H5Z_EDC_t H5Pget_edc_check(hid_t plist_id); -H5_DLL herr_t H5Pset_filter_callback(hid_t plist_id, H5Z_filter_func_t func, +H5_DLL herr_t H5Pset_filter_callback(hid_t plist_id, H5Z_filter_func_t func, void* op_data); #ifdef H5_WANT_H5_V1_4_COMPAT H5_DLL herr_t H5Pset_cache(hid_t plist_id, int mdc_nelmts, int rdcc_nelmts, @@ -267,12 +267,12 @@ H5_DLL herr_t H5Pset_fill_value(hid_t plist_id, hid_t type_id, H5_DLL herr_t H5Pget_fill_value(hid_t plist_id, hid_t type_id, void *value/*out*/); H5_DLL herr_t H5Pfill_value_defined(hid_t plist, H5D_fill_value_t *status); -H5_DLL herr_t H5Pset_alloc_time(hid_t plist_id, H5D_alloc_time_t +H5_DLL herr_t H5Pset_alloc_time(hid_t plist_id, H5D_alloc_time_t alloc_time); -H5_DLL herr_t H5Pget_alloc_time(hid_t plist_id, H5D_alloc_time_t +H5_DLL herr_t H5Pget_alloc_time(hid_t plist_id, H5D_alloc_time_t *alloc_time/*out*/); H5_DLL herr_t H5Pset_fill_time(hid_t plist_id, H5D_fill_time_t fill_time); -H5_DLL herr_t H5Pget_fill_time(hid_t plist_id, H5D_fill_time_t +H5_DLL herr_t H5Pget_fill_time(hid_t plist_id, H5D_fill_time_t *fill_time/*out*/); H5_DLL herr_t H5Pset_gc_references(hid_t fapl_id, unsigned gc_ref); H5_DLL herr_t H5Pget_gc_references(hid_t fapl_id, unsigned *gc_ref/*out*/); diff --git a/src/H5R.c b/src/H5R.c index b37267c..74133e1 100644 --- a/src/H5R.c +++ b/src/H5R.c @@ -43,7 +43,7 @@ NAME H5R_init_interface -- Initialize interface-specific information USAGE herr_t H5R_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -90,7 +90,7 @@ H5R_term_interface(void) int n=0; FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5R_term_interface); - + if (H5_interface_initialize_g) { if ((n=H5I_nmembers(H5I_REFERENCE))) { H5I_clear_group(H5I_REFERENCE, FALSE); @@ -100,7 +100,7 @@ H5R_term_interface(void) n = 1; /*H5I*/ } } - + FUNC_LEAVE_NOAPI(n); } @@ -119,7 +119,7 @@ H5R_term_interface(void) H5R_type_t ref_type; IN: Type of reference to create H5S_t *space; IN: Dataspace ID with selection, used for Dataset Region references. - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -183,7 +183,7 @@ H5R_create(void *_ref, H5G_entry_t *loc, const char *name, H5R_type_t ref_type, heapid_found=1; break; } /* end if */ - + if(heapid_found!=0) { /* Return heap block to free list */ } /* end if */ @@ -257,7 +257,7 @@ done: H5R_type_t ref_type; IN: Type of reference to create hid_t space_id; IN: Dataspace ID with selection, used for Dataset Region references. - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -313,7 +313,7 @@ done: H5F_t *file; IN: File the object being dereferenced is within H5R_type_t ref_type; IN: Type of reference void *ref; IN: Reference to open. - + RETURNS Valid ID on success, Negative on failure DESCRIPTION @@ -456,7 +456,7 @@ done: object that the dataset is located within. H5R_type_t ref_type; IN: Type of reference to create void *ref; IN: Reference to open. - + RETURNS Valid ID on success, Negative on failure DESCRIPTION @@ -507,7 +507,7 @@ done: H5F_t *file; IN: File the object being dereferenced is within H5R_type_t ref_type; UNUSED void *ref; IN: Reference to open. - + RETURNS Pointer to the dataspace on success, NULL on failure DESCRIPTION @@ -580,7 +580,7 @@ done: object that the dataset is located within. H5R_type_t ref_type; IN: Type of reference to get region of void *ref; IN: Reference to open. - + RETURNS Valid ID on success, Negative on failure DESCRIPTION @@ -637,7 +637,7 @@ done: int H5R_get_object_type(file, ref) H5F_t *file; IN: File the object being dereferenced is within void *ref; IN: Reference to query. - + RETURNS Success: An object type defined in H5Gpublic.h Failure: H5G_UNKNOWN @@ -691,7 +691,7 @@ done: hid_t id; IN: Dataset reference object is in or location ID of object that the dataset is located within. void *ref; IN: Reference to query. - + RETURNS Success: An object type defined in H5Gpublic.h Failure: H5G_UNKNOWN @@ -725,7 +725,7 @@ H5Rget_object_type(hid_t id, void *_ref) /* Get the object information */ if ((ret_value=H5R_get_object_type(file,H5AC_ind_dxpl_id,_ref))<0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, H5G_UNKNOWN, "unable to determine object type"); - + done: FUNC_LEAVE_API(ret_value); } /* end H5Rget_object_type() */ @@ -742,7 +742,7 @@ done: H5F_t *file; IN: File the object being dereferenced is within H5R_type_t ref_type; IN: Type of reference to query void *ref; IN: Reference to query. - + RETURNS Success: An object type defined in H5Gpublic.h Failure: H5G_UNKNOWN @@ -839,7 +839,7 @@ done: object that the dataset is located within. H5R_type_t ref_type; IN: Type of reference to query void *ref; IN: Reference to query. - + RETURNS Success: An object type defined in H5Gpublic.h Failure: H5G_UNKNOWN @@ -888,7 +888,7 @@ H5Rget_obj_type(hid_t id, H5R_type_t ref_type, void *_ref) #endif /* H5_WANT_H5_V1_4_COMPAT */ H5R_get_obj_type(file,H5AC_ind_dxpl_id,ref_type,_ref))<0) HGOTO_ERROR(H5E_REFERENCE, H5E_CANTINIT, H5G_UNKNOWN, "unable to determine object type"); - + done: FUNC_LEAVE_API(ret_value); } /* end H5Rget_obj_type() */ diff --git a/src/H5S.c b/src/H5S.c index 035d7a5..48705b5 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -65,7 +65,7 @@ NAME H5S_init_interface -- Initialize interface-specific information USAGE herr_t H5S_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -175,8 +175,8 @@ H5S_term_interface(void) "%10s\n", "gather", path->stats[j].gath_nbytes, path->stats[j].gath_ncalls, - path->stats[j].gath_timer.utime, - path->stats[j].gath_timer.stime, + path->stats[j].gath_timer.utime, + path->stats[j].gath_timer.stime, path->stats[j].gath_timer.etime, buf); } @@ -191,8 +191,8 @@ H5S_term_interface(void) "%10s\n", "scatter", path->stats[j].scat_nbytes, path->stats[j].scat_ncalls, - path->stats[j].scat_timer.utime, - path->stats[j].scat_timer.stime, + path->stats[j].scat_timer.utime, + path->stats[j].scat_timer.stime, path->stats[j].scat_timer.etime, buf); } @@ -207,8 +207,8 @@ H5S_term_interface(void) "%10s\n", "background", path->stats[j].bkg_nbytes, path->stats[j].bkg_ncalls, - path->stats[j].bkg_timer.utime, - path->stats[j].bkg_timer.stime, + path->stats[j].bkg_timer.utime, + path->stats[j].bkg_timer.stime, path->stats[j].bkg_timer.etime, buf); } @@ -228,7 +228,7 @@ H5S_term_interface(void) path->stats[j].read_timer.etime, buf); } - + /* Write */ if (path->stats[j].write_ncalls) { H5_bandwidth(buf, @@ -265,7 +265,7 @@ H5S_term_interface(void) n = 1; /*H5I*/ } } - + FUNC_LEAVE_NOAPI(n); } @@ -506,7 +506,7 @@ H5Scopy(hid_t space_id) H5S_t *src = NULL; H5S_t *dst = NULL; hid_t ret_value; - + FUNC_ENTER_API(H5Scopy, FAIL); H5TRACE1("i","i",space_id); @@ -552,7 +552,7 @@ H5Sextent_copy(hid_t dst_id,hid_t src_id) H5S_t *src = NULL; H5S_t *dst = NULL; hid_t ret_value = SUCCEED; - + FUNC_ENTER_API(H5Sextent_copy, FAIL); H5TRACE2("e","ii",dst_id,src_id); @@ -1375,7 +1375,7 @@ done: * Purpose: Given two data spaces (MEM_SPACE and FILE_SPACE) this * function returns a pointer to the conversion path information, * creating a new conversion path entry if necessary. - * + * * Return: Success: Ptr to a conversion path entry * * Failure: NULL @@ -1398,7 +1398,7 @@ done: * statistics). * * John Mainzer, 8/30/04 - * Modified code to check with all other processes that have the + * Modified code to check with all other processes that have the * file open before OKing collective I/O. * *------------------------------------------------------------------------- @@ -1409,7 +1409,7 @@ H5S_find (const H5S_t *mem_space, const H5S_t *file_space) H5S_iostats_t *path=NULL; /* Space conversion path */ size_t u; /* Index variable */ H5S_iostats_t *ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5S_find, NULL); /* Check args */ @@ -1426,7 +1426,7 @@ H5S_find (const H5S_t *mem_space, const H5S_t *file_space) if (H5S_iostats_g[u]->ftype==H5S_GET_SELECT_TYPE(file_space) && H5S_iostats_g[u]->mtype==H5S_GET_SELECT_TYPE(mem_space)) HGOTO_DONE(H5S_iostats_g[u]); - + /* * The path wasn't found. Create a new path. */ @@ -1486,7 +1486,7 @@ H5S_extend (H5S_t *space, const hsize_t *size) { int ret_value=0; unsigned u; - + FUNC_ENTER_NOAPI(H5S_extend, FAIL); /* Check args */ @@ -1588,11 +1588,11 @@ H5Screate_simple(int rank, const hsize_t dims[/*rank*/], /* Create the space and set the extent */ if(NULL==(space=H5S_create_simple((unsigned)rank,dims,maxdims))) HGOTO_ERROR (H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace"); - + /* Atomize */ if ((ret_value=H5I_register (H5I_DATASPACE, space))<0) HGOTO_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID"); - + done: if (ret_value<0) { if (space!=NULL) @@ -1638,7 +1638,7 @@ H5S_create_simple(unsigned rank, const hsize_t dims[/*rank*/], HGOTO_ERROR (H5E_DATASPACE, H5E_CANTCREATE, NULL, "can't create simple dataspace"); if(H5S_set_extent_simple(ret_value,rank,dims,maxdims)<0) HGOTO_ERROR (H5E_DATASPACE, H5E_CANTINIT, NULL, "can't set dimensions"); - + done: FUNC_LEAVE_NOAPI(ret_value); } /* end H5S_create_simple() */ @@ -1707,7 +1707,7 @@ H5S_get_simple_extent_type(const H5S_t *space) assert(space); ret_value=H5S_GET_EXTENT_TYPE(space); - + done: FUNC_LEAVE_NOAPI(ret_value); } @@ -1745,7 +1745,7 @@ H5Sget_simple_extent_type(hid_t sid) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5S_NO_CLASS, "not a dataspace"); ret_value=H5S_GET_EXTENT_TYPE(space); - + done: FUNC_LEAVE_API(ret_value); } @@ -1851,7 +1851,7 @@ H5S_set_extent( H5S_t *space, const hsize_t *size ) { unsigned u; herr_t ret_value=0; - + FUNC_ENTER_NOAPI( H5S_set_extent, FAIL ); /* Check args */ @@ -1928,7 +1928,7 @@ H5S_set_extent_real( H5S_t *space, const hsize_t *size ) hsize_t nelem; /* Number of elements in extent */ unsigned u; /* Local index variable */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5S_set_extent_real, FAIL ); /* Check args */ @@ -1971,22 +1971,22 @@ H5S_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, int indent, { const H5S_t *mesg = (const H5S_t*)_mesg; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5S_debug, FAIL); - + switch (H5S_GET_EXTENT_TYPE(mesg)) { case H5S_SCALAR: fprintf(stream, "%*s%-*s H5S_SCALAR\n", indent, "", fwidth, "Space class:"); break; - + case H5S_SIMPLE: fprintf(stream, "%*s%-*s H5S_SIMPLE\n", indent, "", fwidth, "Space class:"); H5O_debug_id(H5O_SDSPACE_ID, f, dxpl_id, &(mesg->extent), stream, indent+3, MAX(0, fwidth-3)); break; - + default: fprintf(stream, "%*s%-*s **UNKNOWN-%ld**\n", indent, "", fwidth, "Space class:", (long)(H5S_GET_EXTENT_TYPE(mesg))); diff --git a/src/H5SL.c b/src/H5SL.c index 582bd1a..0491aa4 100644 --- a/src/H5SL.c +++ b/src/H5SL.c @@ -1231,7 +1231,7 @@ H5SL_item(H5SL_node_t *slist_node) The operator callback receives a pointer to the item and key for the list being iterated over ('mesg'), and the pointer to the operator data passed in to H5SL_iterate ('op_data'). The return values from an operator are: - A. Zero causes the iterator to continue, returning zero when all + A. Zero causes the iterator to continue, returning zero when all nodes of that type have been processed. B. Positive causes the iterator to immediately return that positive value, indicating short-circuit success. diff --git a/src/H5ST.c b/src/H5ST.c index 39adc14..65126ef 100644 --- a/src/H5ST.c +++ b/src/H5ST.c @@ -402,7 +402,7 @@ done: --------------------------------------------------------------------------*/ static H5ST_ptr_t H5ST_findfirst_internal(H5ST_ptr_t p) -{ +{ H5ST_ptr_t ret_value=NULL; /* Return value */ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5ST_findfirst_internal); @@ -422,7 +422,7 @@ H5ST_findfirst_internal(H5ST_ptr_t p) p=p->eqkid; } /* end else */ } /* end while */ - + done: FUNC_LEAVE_NOAPI(ret_value); } /* end H5ST_findfirst_internal() */ @@ -448,14 +448,14 @@ done: --------------------------------------------------------------------------*/ H5ST_ptr_t H5ST_findfirst(H5ST_tree_t *tree) -{ +{ H5ST_ptr_t ret_value; /* Return value */ FUNC_ENTER_NOAPI(H5ST_findfirst,NULL); if((ret_value=H5ST_findfirst_internal(tree->root))==NULL) HGOTO_ERROR(H5E_TST,H5E_NOTFOUND,NULL,"no nodes in TST"); - + done: FUNC_LEAVE_NOAPI(ret_value); } /* end H5ST_findfirst() */ @@ -539,7 +539,7 @@ done: --------------------------------------------------------------------------*/ H5ST_ptr_t H5ST_findnext(H5ST_ptr_t p) -{ +{ H5ST_ptr_t q; /* Temporary pointer to TST node */ H5ST_ptr_t ret_value=NULL; /* Return value */ @@ -582,7 +582,7 @@ done: --------------------------------------------------------------------------*/ static herr_t H5ST_delete_internal(H5ST_ptr_t *root, H5ST_ptr_t p) -{ +{ H5ST_ptr_t q, /* Temporary pointer to TST node */ newp; /* Pointer to node which will replace deleted node in tree */ @@ -658,7 +658,7 @@ H5ST_delete_internal(H5ST_ptr_t *root, H5ST_ptr_t p) --------------------------------------------------------------------------*/ herr_t H5ST_delete(H5ST_tree_t *tree, H5ST_ptr_t p) -{ +{ herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5ST_delete,FAIL); diff --git a/src/H5Sall.c b/src/H5Sall.c index eb4c4c8..e6d9644 100644 --- a/src/H5Sall.c +++ b/src/H5Sall.c @@ -377,7 +377,7 @@ H5S_all_release (H5S_t UNUSED * space) /* Reset the number of elements in the selection */ space->select.num_elem=0; - + FUNC_LEAVE_NOAPI(SUCCEED); } /* H5S_all_release() */ @@ -474,7 +474,7 @@ H5S_all_serial_size (const H5S_t UNUSED *space) assert(space); /* Basic number of bytes required to serialize point selection: - * + + + + * + + + * = 16 bytes */ FUNC_LEAVE_NOAPI(16); diff --git a/src/H5Shyper.c b/src/H5Shyper.c index e881f53..407f564 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -1043,7 +1043,7 @@ H5S_hyper_new_span (hsize_t low, hsize_t high, H5S_hyper_span_info_t *down, H5S_ /* Allocate a new span node */ if((ret_value = H5FL_MALLOC(H5S_hyper_span_t))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span"); - + /* Copy the span's basic information */ ret_value->low=low; ret_value->high=high; @@ -1254,7 +1254,7 @@ H5S_hyper_copy_span_helper (H5S_hyper_span_info_t *spans) /* Allocate a new span_info node */ if((ret_value = H5FL_MALLOC(H5S_hyper_span_info_t))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "can't allocate hyperslab span"); - + /* Copy the span_info information */ ret_value->count=1; ret_value->scratch=NULL; @@ -1370,7 +1370,7 @@ H5S_hyper_cmp_spans (H5S_hyper_span_info_t *span_info1, H5S_hyper_span_info_t *s FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_cmp_spans); /* Check for redundant comparison */ - if(span_info1==span_info2) + if(span_info1==span_info2) ret_value=TRUE; else { /* Check for both spans being NULL */ @@ -1779,7 +1779,7 @@ H5S_hyper_span_nblocks (H5S_hyper_span_info_t *spans) /* If there are no down spans, just count the block in this span */ else ret_value++; - + /* Advance to next span */ span=span->next; } /* end while */ @@ -1899,7 +1899,7 @@ H5S_hyper_serial_size (const H5S_t *space) assert(space); /* Basic number of bytes required to serialize hyperslab selection: - * + + + + * + + + * + + <# of blocks (4 bytes)> = 24 bytes */ ret_value=24; @@ -2120,7 +2120,7 @@ H5S_hyper_serialize (const H5S_t *space, uint8_t *buf) /* Reset the block count in this dimension */ tmp_count[temp_dim]=diminfo[temp_dim].count; - + /* Wrapped a dimension, go up to next dimension */ temp_dim--; } /* end while */ @@ -2153,7 +2153,7 @@ H5S_hyper_serialize (const H5S_t *space, uint8_t *buf) /* Encode length */ UINT32ENCODE(lenp, (uint32_t)len); /* Store the length of the extra information */ - + FUNC_LEAVE_NOAPI(SUCCEED); } /* H5S_hyper_serialize() */ @@ -2473,7 +2473,7 @@ H5S_get_select_hyper_blocklist(H5S_t *space, hbool_t internal, hsize_t startbloc /* Reset the block count in this dimension */ tmp_count[temp_dim]=diminfo[temp_dim].count; - + /* Wrapped a dimension, go up to next dimension */ temp_dim--; } /* end while */ @@ -2486,7 +2486,7 @@ H5S_get_select_hyper_blocklist(H5S_t *space, hbool_t internal, hsize_t startbloc } /* end for */ } /* end while */ } /* end if */ - else + else ret_value=H5S_hyper_span_blocklist(space->select.sel_info.hslab->span_lst,start,end,(hsize_t)0,&startblock,&numblocks,&buf); FUNC_LEAVE_NOAPI(ret_value); @@ -2923,7 +2923,7 @@ H5S_hyper_is_single(const H5S_t *space) } /* end if */ else { /* - * For a region to be single, it must have only one block + * For a region to be single, it must have only one block */ /* Get information for slowest changing information */ spans=space->select.sel_info.hslab->span_lst; @@ -3213,7 +3213,7 @@ H5S_hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ran /* Before we create another span at this level in the tree, check if * the last span's "down tree" was equal to any other spans in this * list of spans in the span tree. - * + * * If so, release last span information and make last span merge into * previous span (if possible), or at least share their "down tree" * information. @@ -3279,7 +3279,7 @@ H5S_hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned ran /* Before we create another span at this level in the tree, check if * the last span's "down tree" was equal to any other spans in this * list of spans in the span tree. - * + * * If so, release last span information and make last span merge into * previous span (if possible), or at least share their "down tree" * information. @@ -3616,7 +3616,7 @@ done: EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ -htri_t +htri_t H5S_hyper_intersect (H5S_t *space1, H5S_t *space2) { htri_t ret_value=FAIL; /* Return value */ @@ -3735,7 +3735,7 @@ done: EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ -htri_t +htri_t H5S_hyper_intersect_block (H5S_t *space, hsize_t *start, hsize_t *end) { htri_t ret_value=FAIL; /* Return value */ @@ -4231,7 +4231,7 @@ H5S_hyper_append_span (H5S_hyper_span_t **prev_span, H5S_hyper_span_info_t ** sp /* Allocate new span node to append to list */ if((new_span = H5S_hyper_new_span(low,high,down,next))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); - + /* Make first node in span list */ /* Check that we haven't already allocated a span tree */ @@ -4240,7 +4240,7 @@ H5S_hyper_append_span (H5S_hyper_span_t **prev_span, H5S_hyper_span_info_t ** sp /* Allocate a new span_info node */ if((*span_tree = H5FL_MALLOC(H5S_hyper_span_info_t))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); - + /* Set the span tree's basic information */ (*span_tree)->count=1; (*span_tree)->scratch=NULL; @@ -4252,7 +4252,7 @@ H5S_hyper_append_span (H5S_hyper_span_t **prev_span, H5S_hyper_span_info_t ** sp /* Merge or append to existing merged spans list */ else { /* Check if span can just extend the previous merged span */ - if((((*prev_span)->high+1)==low) && + if((((*prev_span)->high+1)==low) && H5S_hyper_cmp_spans(down,(*prev_span)->down)==TRUE) { /* Extend previous merged span to include new high bound */ (*prev_span)->high=high; @@ -4262,7 +4262,7 @@ H5S_hyper_append_span (H5S_hyper_span_t **prev_span, H5S_hyper_span_info_t ** sp /* Allocate new span node to append to list */ if((new_span = H5S_hyper_new_span(low,high,down,next))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate hyperslab span"); - + /* Check if there is actually a down span */ if(new_span->down) { /* Check if the down spans for the new span node are the same as the previous span node */ @@ -4439,7 +4439,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for overlaps in the 'down spans' of span 'a' & 'b' */ if(H5S_hyper_clip_spans(span_a->down,span_b->down,&down_a_not_b,&down_a_and_b,&down_b_not_a)<0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information"); - + /* Check for additions to the a_not_b list */ if(down_a_not_b!=NULL) { /* Merge/add overlapped part with/to a_not_b list */ @@ -4526,7 +4526,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for overlaps in the 'down spans' of span 'a' & 'b' */ if(H5S_hyper_clip_spans(span_a->down,span_b->down,&down_a_not_b,&down_a_and_b,&down_b_not_a)<0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information"); - + /* Check for additions to the a_not_b list */ if(down_a_not_b!=NULL) { /* Merge/add overlapped part with/to a_not_b list */ @@ -4609,7 +4609,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for overlaps in the 'down spans' of span 'a' & 'b' */ if(H5S_hyper_clip_spans(span_a->down,span_b->down,&down_a_not_b,&down_a_and_b,&down_b_not_a)<0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information"); - + /* Check for additions to the a_not_b list */ if(down_a_not_b!=NULL) { /* Merge/add overlapped part with/to a_not_b list */ @@ -4701,7 +4701,7 @@ H5S_hyper_clip_spans (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_info_t *b_s /* Check for overlaps in the 'down spans' of span 'a' & 'b' */ if(H5S_hyper_clip_spans(span_a->down,span_b->down,&down_a_not_b,&down_a_and_b,&down_b_not_a)<0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCLIP, FAIL, "can't clip hyperslab information"); - + /* Check for additions to the a_not_b list */ if(down_a_not_b!=NULL) { /* Merge/add overlapped part with/to a_not_b list */ @@ -5085,7 +5085,7 @@ H5S_hyper_merge_spans_helper (H5S_hyper_span_info_t *a_spans, H5S_hyper_span_inf H5S_hyper_recover_span(&recover_a,&span_a,span_a->next); } /* end while */ } /* end if */ - + /* Clean up 'b' spans which haven't been added to the list of merged spans */ if(span_a==NULL && span_b!=NULL) { while(span_b!=NULL) { @@ -5206,7 +5206,7 @@ H5S_hyper_spans_nelem (H5S_hyper_span_info_t *spans) /* If there are no down spans, just count the elements in this span */ else ret_value+=span->nelem; - + /* Advance to next span */ span=span->next; } /* end while */ @@ -5288,7 +5288,7 @@ H5S_hyper_make_spans (unsigned rank, const hsize_t *start, const hsize_t *stride head=span; else last_span->next=span; - + /* Move current pointer */ last_span=span; @@ -5536,7 +5536,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op, assert(stride); assert(count); assert(block); - + /* Generate span tree for new hyperslab information */ if((new_spans=H5S_hyper_make_spans(space->extent.rank,start,stride,count,block))==NULL) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't create hyperslab information"); @@ -5782,7 +5782,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op, assert(start); assert(count); assert(op>H5S_SELECT_NOOP && op= sizeof(elmt_size));?? */ - /* Only for simple extent + /* Only for simple extent rank = space->extent.u.simple.rank; */ rank = space->extent.rank; - /* size = HDcalloc((size_t)rank,sizeof(hsize_t)); */ + /* size = HDcalloc((size_t)rank,sizeof(hsize_t)); */ if (0==elmt_size) goto empty; size = space->extent.size; - + odown = space->select.sel_info.hslab->span_lst; - if(odown == NULL) + if(odown == NULL) goto empty; ospan = odown->head; if(ospan == NULL) goto empty; - + obtain_datatype(space->extent.size,ospan,&span_type,elmt_size,rank); MPI_Type_commit(&span_type); @@ -696,7 +696,7 @@ H5S_mpio_span_hyper_type( const H5S_t *space, size_t elmt_size, printf("extent %d\n",extent); *new_type = span_type; /* fill in the remaining return values */ - *count = 1; + *count = 1; *extra_offset = 0; *is_derived_type = 1; printf("before freeing size\n"); @@ -718,7 +718,7 @@ done: static herr_t obtain_datatype(const hsize_t size[], H5S_hyper_span_t* span,MPI_Datatype *span_type, size_t elmt_size,int dimindex) { - + int innercount,outercount; MPI_Datatype bas_type; MPI_Datatype temp_type; @@ -749,7 +749,7 @@ static herr_t obtain_datatype(const hsize_t size[], H5S_hyper_span_t* span,MPI_D while(tspan) { if(tspan) { HDfprintf(stdout, " span->low %Hd\n",tspan->low); - HDfprintf(stdout, " span->high %Hd\n",tspan->high); + HDfprintf(stdout, " span->high %Hd\n",tspan->high); HDfprintf(stdout, " span->nelm %Hu\n",tspan->nelem); } tspan = tspan->next; @@ -780,8 +780,8 @@ static herr_t obtain_datatype(const hsize_t size[], H5S_hyper_span_t* span,MPI_D inner_type = (MPI_Datatype *)HDcalloc((size_t)outercount,sizeof(int)); printf("end of calloc \n"); #endif - - + + tspan = span; outercount = 0; @@ -803,7 +803,7 @@ static herr_t obtain_datatype(const hsize_t size[], H5S_hyper_span_t* span,MPI_D if(ret < 0) printf("type hindexed doesn't work\n"); printf("after hindexed \n"); - + } else {/* dimindex is the rank of the dimension */ @@ -817,10 +817,10 @@ static herr_t obtain_datatype(const hsize_t size[], H5S_hyper_span_t* span,MPI_D for ( i = dimindex-1; i > 1; i--) total_lowd1 = total_lowd1 * size[i]; - + HDfprintf(stdout, " one dimension down size %Hu\n",total_lowd); - HDfprintf(stdout, " two dimension down size %Hu\n",total_lowd1); - + HDfprintf(stdout, " two dimension down size %Hu\n",total_lowd1); + while(tspan){ /* Displacement should be in byte and should have dimension information */ /* First using MPI Type vector to build derived data type for this span only */ @@ -866,18 +866,18 @@ static herr_t obtain_datatype(const hsize_t size[], H5S_hyper_span_t* span,MPI_D outercount ++; tspan = tspan->next; } - + /* building the whole vector datatype */ MPI_Type_struct(outercount,blocklen,disp,inner_type,span_type); printf("after type struct \n"); } - + if(inner_type != NULL){ if(down != NULL) { for(i=0;i + + + + * + + + * = 16 bytes */ FUNC_LEAVE_NOAPI(16); diff --git a/src/H5Spkg.h b/src/H5Spkg.h index ce858a2..c32032d 100644 --- a/src/H5Spkg.h +++ b/src/H5Spkg.h @@ -36,7 +36,7 @@ #define H5S_VALID_MAX 0x01 #define H5S_VALID_PERM 0x02 -/* +/* * Dataspace extent information */ /* Extent container */ @@ -49,7 +49,7 @@ typedef struct { hsize_t *max; /* Maximum size of the dimensions */ } H5S_extent_t; -/* +/* * Dataspace selection information */ /* Node in point selection list (typedef'd in H5Sprivate.h) */ @@ -79,7 +79,7 @@ struct H5S_hyper_span_info_t { unsigned count; /* Ref. count of number of spans which share this span */ struct H5S_hyper_span_info_t *scratch; /* Scratch pointer * (used during copies, as mark - * during precomputes for I/O & + * during precomputes for I/O & * to point to the last span in a * list during single element adds) */ diff --git a/src/H5Spoint.c b/src/H5Spoint.c index 7a260a5..2c5396a 100644 --- a/src/H5Spoint.c +++ b/src/H5Spoint.c @@ -125,7 +125,7 @@ H5S_point_iter_init(H5S_sel_iter_t *iter, const H5S_t *space) /* Start at the head of the list of points */ iter->u.pnt.curr=space->select.sel_info.pnt_lst->head; - + /* Initialize type of selection iterator */ iter->type=H5S_sel_iter_point; @@ -430,7 +430,7 @@ H5S_point_add (H5S_t *space, H5S_seloper_t op, size_t num_elem, const hsize_t ** /* Append new list to point selection */ new_node->next=top; } /* end if */ - else + else space->select.sel_info.pnt_lst->head=top; } /* end else */ @@ -480,14 +480,14 @@ H5S_point_release (H5S_t *space) H5FL_FREE(H5S_pnt_node_t,curr); curr=next; } /* end while */ - + /* Free & reset the point list header */ H5FL_FREE(H5S_pnt_list_t,space->select.sel_info.pnt_lst); space->select.sel_info.pnt_lst=NULL; /* Reset the number of elements in the selection */ space->select.num_elem=0; - + FUNC_LEAVE_NOAPI(SUCCEED); } /* H5S_point_release() */ @@ -741,7 +741,7 @@ H5S_point_serial_size (const H5S_t *space) assert(space); /* Basic number of bytes required to serialize point selection: - * + + + + * + + + * + + <# of points (4 bytes)> = 24 bytes */ ret_value=24; @@ -819,7 +819,7 @@ H5S_point_serialize (const H5S_t *space, uint8_t *buf) /* Encode length */ UINT32ENCODE(lenp, (uint32_t)len); /* Store the length of the extra information */ - + FUNC_LEAVE_NOAPI(SUCCEED); } /* H5S_point_serialize() */ @@ -869,7 +869,7 @@ H5S_point_deserialize (H5S_t *space, const uint8_t *buf) /* Allocate space for the coordinates */ if((coord = H5MM_malloc(num_elem*rank*sizeof(hsize_t)))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate coordinate information"); - + /* Retrieve the coordinates from the buffer */ for(tcoord=coord,i=0; ishared->type; } else { if(H5T_IS_VL_STRING(dt->shared)) @@ -1743,7 +1743,7 @@ H5Tdetect_class(hid_t type, H5T_class_t cls) FUNC_ENTER_API(H5Tdetect_class, FAIL); H5TRACE2("t","iTt",type,cls); - + /* Check args */ if (NULL == (dt = H5I_object_verify(type,H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_NO_CLASS, "not a data type"); @@ -1784,7 +1784,7 @@ H5T_detect_class (const H5T_t *dt, H5T_class_t cls) htri_t ret_value=FALSE; /* Return value */ FUNC_ENTER_NOAPI(H5T_detect_class, FAIL); - + assert(dt); assert(cls>H5T_NO_CLASS && clsshared); done: - FUNC_LEAVE_API(ret_value); + FUNC_LEAVE_API(ret_value); } - + /*------------------------------------------------------------------------- * Function: H5Tget_size @@ -1888,7 +1888,7 @@ H5Tget_size(hid_t type_id) /* Check args */ if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a datatype"); - + /* size */ ret_value = H5T_get_size(dt); @@ -1981,7 +1981,7 @@ H5Tget_super(hid_t type) { H5T_t *dt=NULL, *super=NULL; hid_t ret_value; - + FUNC_ENTER_API(H5Tget_super, FAIL); H5TRACE1("i","i",type); @@ -2005,16 +2005,16 @@ done: /*------------------------------------------------------------------------- * Function: H5T_get_super * - * Purpose: Private function for H5Tget_super. Returns the type from - * which TYPE is derived. In the case of an enumeration type + * Purpose: Private function for H5Tget_super. Returns the type from + * which TYPE is derived. In the case of an enumeration type * the return value is an integer type. * * Return: Success: Data type for base data type. * - * Failure: NULL + * Failure: NULL * * Programmer: Raymond Lu - * October 9, 2002 + * October 9, 2002 * * Modifications: * @@ -2024,7 +2024,7 @@ H5T_t * H5T_get_super(H5T_t *dt) { H5T_t *ret_value=NULL; - + FUNC_ENTER_NOAPI(H5T_get_super, NULL); assert(dt); @@ -2087,7 +2087,7 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, /* Locate or create a new conversion path */ if (NULL==(new_path=H5T_path_find(src, dst, name, func, dxpl_id))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to locate/allocate conversion path"); - + /* * Notify all other functions to recalculate private data since some * functions might cache a list of conversion functions. For @@ -2166,7 +2166,7 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, /* Free old path */ H5T_print_stats(old_path, &nprint); old_path->cdata.command = H5T_CONV_FREE; - if ((old_path->func)(tmp_sid, tmp_did, &(old_path->cdata), + if ((old_path->func)(tmp_sid, tmp_did, &(old_path->cdata), (size_t)0, (size_t)0, (size_t)0, NULL, NULL, dxpl_id)<0) { #ifdef H5T_DEBUG if (H5DEBUG(T)) { @@ -2189,7 +2189,7 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5E_clear(); } /* end for */ } /* end else */ - + done: if (ret_value<0) { if (new_path) { @@ -2440,7 +2440,7 @@ H5Tfind(hid_t src_id, hid_t dst_id, H5T_cdata_t **pcdata) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type"); if (!pcdata) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, NULL, "no address to receive cdata pointer"); - + /* Find it */ if (NULL==(path=H5T_path_find(src, dst, NULL, NULL, H5AC_ind_dxpl_id))) HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, NULL, "conversion function not found"); @@ -2450,7 +2450,7 @@ H5Tfind(hid_t src_id, hid_t dst_id, H5T_cdata_t **pcdata) /* Set return value */ ret_value = path->func; - + done: FUNC_LEAVE_API(ret_value); } @@ -2490,7 +2490,7 @@ H5Tconvert(hid_t src_id, hid_t dst_id, size_t nelmts, void *buf, H5T_path_t *tpath=NULL; /*type conversion info */ H5T_t *src=NULL, *dst=NULL; /*unatomized types */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Tconvert, FAIL); H5TRACE6("e","iizxxi",src_id,dst_id,nelmts,buf,background,dxpl_id); @@ -2588,7 +2588,7 @@ done: /*------------------------------------------------------------------------- * API functions are above; library-private functions are below... - *------------------------------------------------------------------------- + *------------------------------------------------------------------------- */ @@ -2639,7 +2639,7 @@ H5T_create(H5T_class_t type, size_t size) if(type==H5T_COMPOUND) dt->shared->u.compnd.packed=TRUE; /* Start out packed */ else if(type==H5T_OPAQUE) - /* Initialize the tag in case it's not set later. A null tag will + /* Initialize the tag in case it's not set later. A null tag will * cause problems for later operations. */ dt->shared->u.opaque.tag = H5MM_strdup(""); break; @@ -2719,7 +2719,7 @@ htri_t H5T_isa(H5G_entry_t *ent, hid_t dxpl_id) { htri_t ret_value; - + FUNC_ENTER_NOAPI(H5T_isa, FAIL); assert(ent); @@ -2754,7 +2754,7 @@ H5T_open (H5G_entry_t *ent, hid_t dxpl_id) H5T_shared_t *shared_fo=NULL; H5T_t *dt=NULL; H5T_t *ret_value; - + FUNC_ENTER_NOAPI(H5T_open, NULL); assert (ent); @@ -2829,7 +2829,7 @@ H5T_open_oid (H5G_entry_t *ent, hid_t dxpl_id) { H5T_t *dt=NULL; H5T_t *ret_value; - + FUNC_ENTER_NOAPI(H5T_open_oid, NULL); assert (ent); @@ -2929,7 +2929,7 @@ H5T_copy(const H5T_t *old_dt, H5T_copy_t method) */ new_dt->shared->state = H5T_STATE_TRANSIENT; break; - + case H5T_COPY_ALL: /* * Return a transient type (locked or unlocked) or an unopened named @@ -2976,7 +2976,7 @@ H5T_copy(const H5T_t *old_dt, H5T_copy_t method) } break; } /* end switch */ - + switch(new_dt->shared->type) { case H5T_COMPOUND: { @@ -3055,7 +3055,7 @@ H5T_copy(const H5T_t *old_dt, H5T_copy_t method) for (i=0; ishared->u.enumer.nmembs; i++) { s = old_dt->shared->u.enumer.name[i]; new_dt->shared->u.enumer.name[i] = H5MM_xstrdup(s); - } + } break; case H5T_VLEN: @@ -3096,7 +3096,7 @@ H5T_copy(const H5T_t *old_dt, H5T_copy_t method) /* Set return value */ ret_value=new_dt; - + done: if(ret_value==NULL) { if(new_dt->shared != NULL) @@ -3232,7 +3232,7 @@ H5T_free(H5T_t *dt) /* Close the parent */ if (dt->shared->parent && H5T_close(dt->shared->parent)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "unable to close parent data type"); - + done: FUNC_LEAVE_NOAPI(ret_value); } /* end H5T_free() */ @@ -3275,7 +3275,7 @@ H5T_close(H5T_t *dt) if(dt->shared->state != H5T_STATE_OPEN || dt->shared->fo_count == 1) { - if(H5T_free(dt)<0) + if(H5T_free(dt)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTFREE, FAIL, "unable to free datatype"); H5FL_FREE(H5T_shared_t, dt->shared); @@ -3380,7 +3380,7 @@ H5T_set_size(H5T_t *dt, size_t size) size_t memb_offset, max_offset=0; size_t max_size; - if((num_membs = H5T_get_nmembers(dt))<0) + if((num_membs = H5T_get_nmembers(dt))<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to get number of members"); for(i=0; i<(unsigned)num_membs; i++) { @@ -3390,7 +3390,7 @@ H5T_set_size(H5T_t *dt, size_t size) max_index = i; } } - + max_size = H5T_get_member_size(dt, max_index); if(size<(max_offset+max_size)) @@ -3414,12 +3414,12 @@ H5T_set_size(H5T_t *dt, size_t size) dt->shared->type = H5T_VLEN; /* - * Force conversions (i.e. memory to memory conversions + * Force conversions (i.e. memory to memory conversions * should duplicate data, not point to the same VL strings) */ dt->shared->force_conv = TRUE; - /* Before we mess with the info in the union, extract the + /* Before we mess with the info in the union, extract the * values we need */ tmp_cset=dt->shared->u.atomic.u.s.cset; tmp_strpad=dt->shared->u.atomic.u.s.pad; @@ -3472,7 +3472,7 @@ H5T_set_size(H5T_t *dt, size_t size) } } /* end if */ } - + done: FUNC_LEAVE_NOAPI(ret_value); } @@ -4016,7 +4016,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, lt = md = 1; rt = H5T_g.npaths; cmp = -1; - + while (cmp && ltfunc = func; path->is_hard = TRUE; } - + /* * If the path doesn't have a function by now (because it's a new path * and the caller didn't supply a hard function) then scan the soft list @@ -4124,7 +4124,7 @@ H5T_path_find(const H5T_t *src, const H5T_t *dst, const char *name, lt = md = 1; rt = H5T_g.npaths; cmp = -1; - + while (cmp && lt=0) H5I_dec_ref(src_id); if (dst_id>=0) H5I_dec_ref(dst_id); - + FUNC_LEAVE_NOAPI(ret_value); } @@ -4342,7 +4342,7 @@ H5G_entry_t * H5T_entof (H5T_t *dt) { H5G_entry_t *ret_value = NULL; - + FUNC_ENTER_NOAPI(H5T_entof, NULL); assert (dt); @@ -4366,14 +4366,14 @@ done: /*------------------------------------------------------------------------- * Function: H5T_is_immutable * - * Purpose: Check if a datatype is immutable. + * Purpose: Check if a datatype is immutable. * - * Return: TRUE + * Return: TRUE * - * FALSE + * FALSE * - * Programmer: Raymond Lu - * Friday, Dec 7, 2001 + * Programmer: Raymond Lu + * Friday, Dec 7, 2001 * * Modifications: * @@ -4399,13 +4399,13 @@ done: /*------------------------------------------------------------------------- * Function: H5T_is_named * - * Purpose: Check if a datatype is named. + * Purpose: Check if a datatype is named. * - * Return: TRUE + * Return: TRUE * - * FALSE + * FALSE * - * Programmer: Pedro Vicente + * Programmer: Pedro Vicente * Tuesday, Sep 3, 2002 * * Modifications: @@ -4437,7 +4437,7 @@ done: USAGE H5R_type_t H5Tget_ref_type(dt) H5T_t *dt; IN: datatype pointer for the reference datatype - + RETURNS Success: A reference type defined in H5Rpublic.h Failure: H5R_BADTYPE @@ -4487,7 +4487,7 @@ htri_t H5T_is_sensible(const H5T_t *dt) { htri_t ret_value; - + FUNC_ENTER_NOAPI(H5T_is_sensible, FAIL); assert(dt); @@ -4594,7 +4594,7 @@ H5T_print_stats(H5T_path_t UNUSED * path, int UNUSED * nprint/*in,out*/) #endif FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_print_stats); - + #ifdef H5T_DEBUG if (H5DEBUG(T) && path->stats.ncalls>0) { if (nprint && 0==(*nprint)++) { @@ -4622,8 +4622,8 @@ H5T_print_stats(H5T_path_t UNUSED * path, int UNUSED * nprint/*in,out*/) path->name, path->stats.nelmts, path->stats.ncalls, - path->stats.timer.utime, - path->stats.timer.stime, + path->stats.timer.utime, + path->stats.timer.stime, path->stats.timer.etime, bandwidth); } @@ -4793,7 +4793,7 @@ H5T_debug(const H5T_t *dt, FILE *stream) /* No additional info */ break; } - + } else if (H5T_COMPOUND==dt->shared->type) { /* Compound data type */ for (i=0; ishared->u.compnd.nmembs; i++) { @@ -4814,7 +4814,7 @@ H5T_debug(const H5T_t *dt, FILE *stream) H5T_debug(dt->shared->u.compnd.memb[i].type, stream); } fprintf(stream, "\n"); - + } else if (H5T_ENUM==dt->shared->type) { /* Enumeration data type */ fprintf(stream, " "); @@ -4828,7 +4828,7 @@ H5T_debug(const H5T_t *dt, FILE *stream) } } fprintf(stream, "\n"); - + } else if (H5T_OPAQUE==dt->shared->type) { fprintf(stream, ", tag=\"%s\"", dt->shared->u.opaque.tag); diff --git a/src/H5TS.c b/src/H5TS.c index 27ce315..73502bb 100644 --- a/src/H5TS.c +++ b/src/H5TS.c @@ -46,7 +46,7 @@ static void H5TS_mutex_init(H5TS_mutex_t *mutex); * * USAGE * H5TS_key_destructor() - * + * * RETURNS * * DESCRIPTION @@ -75,7 +75,7 @@ H5TS_key_destructor(void *key_val) * * USAGE * H5TS_first_thread_init() - * + * * RETURNS * * DESCRIPTION @@ -119,7 +119,7 @@ H5TS_first_thread_init(void) * * USAGE * H5TS_mutex_lock(&mutex_var) - * + * * RETURNS * 0 on success and non-zero on error. * @@ -193,7 +193,7 @@ H5TS_mutex_lock(H5TS_mutex_t *mutex) * * USAGE * H5TS_mutex_unlock(&mutex_var) - * + * * RETURNS * 0 on success and non-zero on error. * @@ -245,7 +245,7 @@ H5TS_mutex_unlock(H5TS_mutex_t *mutex) * * USAGE * H5TS_cancel_count_inc() - * + * * RETURNS * 0 on success non-zero error code on error. * @@ -309,7 +309,7 @@ H5TS_cancel_count_inc(void) * * USAGE * H5TS_cancel_count_dec() - * + * * RETURNS * 0 on success and a non-zero error code on error. * diff --git a/src/H5Tarray.c b/src/H5Tarray.c index b33d3bf..cb78a6f 100644 --- a/src/H5Tarray.c +++ b/src/H5Tarray.c @@ -39,7 +39,7 @@ NAME H5T_init_array_interface -- Initialize interface-specific information USAGE herr_t H5T_init_array_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -88,7 +88,7 @@ H5Tarray_create(hid_t base_id, int ndims, const hsize_t dim[/* ndims */], H5T_t *dt = NULL; /* new array data type */ int i; /* local index variable */ hid_t ret_value; /* return value */ - + FUNC_ENTER_API(H5Tarray_create, FAIL); H5TRACE4("i","iIs*h*Is",base_id,ndims,dim,perm); @@ -210,7 +210,7 @@ H5Tget_array_ndims(hid_t type_id) { H5T_t *dt = NULL; /* pointer to array data type */ int ret_value; /* return value */ - + FUNC_ENTER_API(H5Tget_array_ndims, FAIL); H5TRACE1("Is","i",type_id); @@ -231,7 +231,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_get_array_ndims * - * Purpose: Private function for H5T_get_array_ndims. Query the number + * Purpose: Private function for H5T_get_array_ndims. Query the number * of dimensions for an array datatype. * * Return: Success: Number of dimensions of the array datatype @@ -248,7 +248,7 @@ int H5T_get_array_ndims(H5T_t *dt) { int ret_value; /* return value */ - + FUNC_ENTER_NOAPI(H5T_get_array_ndims, FAIL); assert(dt); @@ -282,7 +282,7 @@ H5Tget_array_dims(hid_t type_id, hsize_t dims[], int perm[]) { H5T_t *dt = NULL; /* pointer to array data type */ int ret_value; /* return value */ - + FUNC_ENTER_API(H5Tget_array_dims, FAIL); H5TRACE3("Is","i*h*Is",type_id,dims,perm); @@ -303,7 +303,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_get_array_dims * - * Purpose: Private function for H5T_get_array_dims. Query the sizes + * Purpose: Private function for H5T_get_array_dims. Query the sizes * of dimensions for an array datatype. * * Return: Success: Number of dimensions of the array type @@ -321,19 +321,19 @@ H5T_get_array_dims(H5T_t *dt, hsize_t dims[], int perm[]) { int ret_value; /* return value */ int i; /* Local index variable */ - + FUNC_ENTER_NOAPI(H5T_get_array_dims, FAIL); assert(dt); assert(dt->shared->type==H5T_ARRAY); /* Retrieve the sizes of the dimensions */ - if(dims) + if(dims) for(i=0; ishared->u.array.ndims; i++) dims[i]=dt->shared->u.array.dim[i]; /* Retrieve the dimension permutations */ - if(perm) + if(perm) for(i=0; ishared->u.array.ndims; i++) perm[i]=dt->shared->u.array.perm[i]; diff --git a/src/H5Tbit.c b/src/H5Tbit.c index 087a927..02bb694 100644 --- a/src/H5Tbit.c +++ b/src/H5Tbit.c @@ -57,7 +57,7 @@ H5T_bit_copy (uint8_t *dst, size_t dst_offset, const uint8_t *src, d_idx = (int)dst_offset / 8; src_offset %= 8; dst_offset %= 8; - + /* * Get things rolling. This means copying bits until we're aligned on a * source byte. This the following example, five bits are copied to the @@ -93,7 +93,7 @@ H5T_bit_copy (uint8_t *dst, size_t dst_offset, const uint8_t *src, } size -= nbits; } - + /* * The middle bits. We are aligned on a source byte which needs to be * copied to two (or one in the degenerate case) destination bytes. @@ -109,7 +109,7 @@ H5T_bit_copy (uint8_t *dst, size_t dst_offset, const uint8_t *src, * +---------------+---------------+ * dst[d_idx+1] dst[d_idx] * - * + * * Calculate shifts and masks. See diagrams below. MASK_LO in this * example is 0x1f (the low five bits) and MASK_HI is 0xe0 (the high three * bits). SHIFT is three since the source must be shifted right three bits @@ -118,7 +118,7 @@ H5T_bit_copy (uint8_t *dst, size_t dst_offset, const uint8_t *src, shift = (int)dst_offset; mask_lo = (1<<(8-shift))-1; mask_hi = (~mask_lo) & 0xff; - + for (/*void*/; size>8; size-=8, d_idx++, s_idx++) { if (shift) { dst[d_idx+0] &= ~(mask_lo<=size); @@ -224,7 +224,7 @@ void H5T_bit_set_d (uint8_t *buf, size_t offset, size_t size, hsize_t val) { size_t i, hs; - + assert (8*sizeof(val)>=size); switch (H5T_native_order_g) { @@ -282,7 +282,7 @@ H5T_bit_set (uint8_t *buf, size_t offset, size_t size, hbool_t value) } size -= nbits; } - + /* The middle bytes */ while (size>=8) { buf[idx++] = value ? 0xff : 0x00; @@ -307,7 +307,7 @@ H5T_bit_set (uint8_t *buf, size_t offset, size_t size, hbool_t value) * of a bit vector. The region begins at OFFSET and continues * for SIZE bits, but the region can be searched from the least * significat end toward the most significant end(H5T_BIT_LSB - * as DIRECTION), or from the most significant end to the least + * as DIRECTION), or from the most significant end to the least * significant end(H5T_BIT_MSB as DIRECTION). * * Return: Success: The position of the bit found, relative to @@ -342,7 +342,7 @@ H5T_bit_find (uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, /* Calculate index */ idx = (ssize_t)(offset / 8); offset %= 8; - + /* Beginning */ if (offset) { for (iu=offset; iu<8 && size>0; iu++, size--) { @@ -374,7 +374,7 @@ H5T_bit_find (uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, /* Calculate index */ idx = (ssize_t)((offset+size-1) / 8); offset %= 8; - + /* Beginning */ if (size>8-offset && (offset+size)%8) { for (iu=(offset+size)%8; iu>0; --iu, --size) { @@ -403,7 +403,7 @@ H5T_bit_find (uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, } break; } - + done: FUNC_LEAVE_NOAPI(ret_value); } @@ -412,10 +412,10 @@ done: /*------------------------------------------------------------------------- * Function: H5T_bit_inc * - * Purpose: Increment part of a bit field by adding 1. The bit field + * Purpose: Increment part of a bit field by adding 1. The bit field * starts with bit position START and is SIZE bits long. * - * Return: Success: The carry-out value. One if overflows, + * Return: Success: The carry-out value. One if overflows, * zero otherwise. * * Failure: Negative diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index 22b8b50..eebaf6f 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -39,7 +39,7 @@ NAME H5T_init_commit_interface -- Initialize interface-specific information USAGE herr_t H5T_init_commit_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -77,7 +77,7 @@ H5Tcommit(hid_t loc_id, const char *name, hid_t type_id) H5G_entry_t *loc = NULL; H5T_t *type = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Tcommit, FAIL) H5TRACE3("e","isi",loc_id,name,type_id); @@ -118,7 +118,7 @@ H5T_commit (H5G_entry_t *loc, const char *name, H5T_t *type, hid_t dxpl_id) { H5F_t *file = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5T_commit) HDassert (loc); @@ -164,7 +164,7 @@ H5T_commit (H5G_entry_t *loc, const char *name, H5T_t *type, hid_t dxpl_id) if(H5FO_insert(type->ent.file, type->ent.header, type->shared)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINSERT, FAIL, "can't insert datatype into list of open objects") - /* Mark datatype as being on memory now because this datatype may be still used in + /* Mark datatype as being on memory now because this datatype may be still used in * memory after committed to disk. So we need to change its size back. */ if (H5T_vlen_mark(type, NULL, H5T_VLEN_MEMORY)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "cannot mark datatype in memory") @@ -205,7 +205,7 @@ H5Tcommitted(hid_t type_id) { H5T_t *type = NULL; htri_t ret_value; /* Return value */ - + FUNC_ENTER_API(H5Tcommitted, FAIL) H5TRACE1("t","i",type_id); diff --git a/src/H5Tcompound.c b/src/H5Tcompound.c index 37c79ed..62681ce 100644 --- a/src/H5Tcompound.c +++ b/src/H5Tcompound.c @@ -41,7 +41,7 @@ NAME H5T_init_compound_interface -- Initialize interface-specific information USAGE herr_t H5T_init_compound_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -104,7 +104,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_get_member_offset * - * Purpose: Private function for H5Tget_member_offset. Returns the byte + * Purpose: Private function for H5Tget_member_offset. Returns the byte * offset of the beginning of a member with respect to the * beginning of the compound datatype datum. * @@ -221,7 +221,7 @@ H5Tget_member_type(hid_t type_id, unsigned membno) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to retrieve member type") if ((ret_value = H5I_register(H5I_DATATYPE, memb_dt)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable register datatype atom") - + done: if(ret_value<0) { if(memb_dt!=NULL) @@ -236,17 +236,17 @@ done: /*------------------------------------------------------------------------- * Function: H5T_get_member_type * - * Purpose: Private function for H5Tget_member_type. Returns the data + * Purpose: Private function for H5Tget_member_type. Returns the data * type of the specified member. * * Return: Success: A copy of the member datatype; * modifying the returned datatype does not * modify the member type. * - * Failure: NULL + * Failure: NULL * * Programmer: Raymond Lu - * October 8, 2002 + * October 8, 2002 * * Modifications: * @@ -261,11 +261,11 @@ H5T_get_member_type(const H5T_t *dt, unsigned membno) assert(dt); assert(membno < dt->shared->u.compnd.nmembs); - + /* Copy datatype into an atom */ if (NULL == (ret_value = H5T_copy(dt->shared->u.compnd.memb[membno].type, H5T_COPY_REOPEN))) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "unable to copy member datatype") - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -296,7 +296,7 @@ H5T_get_member_size(const H5T_t *dt, unsigned membno) assert(dt); assert(membno < dt->shared->u.compnd.nmembs); - + /* Value */ ret_value = dt->shared->u.compnd.memb[membno].type->shared->size; @@ -390,7 +390,7 @@ H5Tpack(hid_t type_id) /* Pack */ if (H5T_pack(dt) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to pack compound datatype") - + done: FUNC_LEAVE_API(ret_value) } @@ -420,7 +420,7 @@ H5T_insert(const H5T_t *parent, const char *name, size_t offset, const H5T_t *me unsigned idx, i; size_t total_size; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_insert, FAIL) /* check args */ @@ -572,7 +572,7 @@ H5T_pack(const H5T_t *dt) dt->shared->u.compnd.packed=TRUE; } /* end if */ } /* end if */ - + done: FUNC_LEAVE_NOAPI(ret_value) } diff --git a/src/H5Tconv.c b/src/H5Tconv.c index 0317bbd..f08c510 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -147,15 +147,15 @@ H5FL_BLK_DEFINE_STATIC(array_seq); * * D_MAX: The maximum possible destination value. Source values which * are larger than D_MAX generate overflows. - * + * * The macros are implemented with a generic programming technique, similar * to templates in C++. The macro which defines the "core" part of the * conversion (which actually moves the data from the source to the destination) * is invoked inside the H5T_CONV "template" macro by "gluing" it together, * which allows the core conversion macro to be invoked as necessary. - * + * * The generic "core" macros are: (others are specific to particular conversion) - * + * * Suffix Description * ------ ----------- * xX: Generic Conversion where the destination is at least as @@ -578,7 +578,7 @@ H5T_conv_noop(hid_t UNUSED src_id, hid_t UNUSED dst_id, H5T_cdata_t *cdata, case H5T_CONV_FREE: break; - + default: HGOTO_ERROR (H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unknown conversion command"); } @@ -675,43 +675,43 @@ H5T_conv_order_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, case 2: for (/*void*/; nelmts>=20; nelmts-=20) { H5_SWAP_BYTES(buf, 0, 1); /* 0 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 1 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 2 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 3 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 4 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 5 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 6 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 7 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 8 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 9 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 10 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 11 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 12 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 13 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 14 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 15 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 16 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 17 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 18 */ - buf += buf_stride; + buf += buf_stride; H5_SWAP_BYTES(buf, 0, 1); /* 19 */ buf += buf_stride; } @@ -1142,7 +1142,7 @@ H5T_conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else if (src->shared->size>=dst->shared->size) { double olap_d = HDceil((double)(dst->shared->size)/ (double)(src->shared->size-dst->shared->size)); - + olap = (size_t)olap_d; sp = dp = (uint8_t*)buf; direction = 1; @@ -1179,7 +1179,7 @@ H5T_conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, (spshared->size<=dp)); } #endif - + /* * Put the data in little endian order so our loops aren't so * complicated. We'll do all the conversion stuff assuming @@ -1266,7 +1266,7 @@ H5T_conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, dp += direction * dst->shared->size; } } - + break; default: @@ -1276,7 +1276,7 @@ H5T_conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, done: FUNC_LEAVE_NOAPI(ret_value); } - + /*------------------------------------------------------------------------- * Function: H5T_conv_struct_init @@ -1314,9 +1314,9 @@ H5T_conv_struct_init (H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, hid_t dxpl_id) H5T_t *type = NULL; hid_t tid; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5T_conv_struct_init); - + if (!priv) { /* * Allocate private data structure and arrays. @@ -1411,7 +1411,7 @@ done: } -/*------------------------------------------------------------------------- +/*------------------------------------------------------------------------- * Function: H5T_conv_struct * * Purpose: Converts between compound data types. This is a soft @@ -1422,7 +1422,7 @@ done: * If sizeof detination type <= sizeof source type then * Convert member to destination type; * Move member as far left as possible; - * + * * For I=NELMTS..1 do * If not destination type then * Convert member to destination type; @@ -1625,7 +1625,7 @@ H5T_conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* Some other command we don't know about yet.*/ HGOTO_ERROR (H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unknown conversion command"); } - + done: FUNC_LEAVE_NOAPI(ret_value); } @@ -1646,7 +1646,7 @@ done: * Move memb to BKG buffer for all elements * Else * Move member as far left as possible for all elements - * + * * For each member of the struct (in reverse order) * If not destination type then * Convert member to destination type for all elements @@ -1674,7 +1674,7 @@ done: * all of the field1's, then all field2's, etc. This can * drastically reduce the number of calls to H5T_convert() and * thereby eliminate most of the conversion constant overhead. - * + * * Robb Matzke, 2000-05-17 * Added the BKG_STRIDE argument to fix a design bug. If * BUF_STRIDE and BKG_STRIDE are both non-zero then each @@ -1726,7 +1726,7 @@ H5T_conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, HGOTO_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to initialize conversion data"); priv = (H5T_conv_struct_t *)(cdata->priv); src2dst = priv->src2dst; - + /* * If the destination type is not larger than the source type then * this conversion function is guaranteed to work (provided all @@ -1800,7 +1800,7 @@ H5T_conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, H5T_sort_value(src, NULL); H5T_sort_value(dst, NULL); - /* + /* * Calculate strides. If BUF_STRIDE is non-zero then convert one * data element at every BUF_STRIDE bytes through the main buffer * (BUF), leaving the result of each conversion at the same @@ -1892,7 +1892,7 @@ H5T_conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /* Some other command we don't know about yet.*/ HGOTO_ERROR (H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unknown conversion command"); } - + done: FUNC_LEAVE_NOAPI(ret_value); } @@ -1924,7 +1924,7 @@ H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) unsigned length; /*nelmts in map array */ unsigned i, j; /*counters */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5T_conv_enum_init); cdata->need_bkg = H5T_BKG_NO; @@ -1960,7 +1960,7 @@ H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata) * * A: The source data type size matches one of our native data type * sizes. - * + * * B: After casting the source value bit pattern to a native type * the size of the range of values is less than 20% larger than * the number of values. @@ -2067,7 +2067,7 @@ H5T_conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t i; /*counters */ H5T_enum_struct_t *priv = (H5T_enum_struct_t*)(cdata->priv); herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_enum, FAIL); switch (cdata->command) { @@ -2115,7 +2115,7 @@ H5T_conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * conversion algorithm, which is turned on by non-zero priv->length */ H5T_sort_name(dst, NULL); if (!priv->length) H5T_sort_value(src, NULL); - + /* * Direction of conversion. */ @@ -2204,7 +2204,7 @@ done: * * For every VL struct in the main buffer: * 1. Allocate space for temporary dst VL data (reuse buffer - * if possible) + * if possible) * 2. Copy VL data from src buffer into dst buffer * 3. Convert VL data into dst representation * 4. Allocate buffer in dst heap @@ -2226,9 +2226,9 @@ done: * destination values are packed. * * Raymond Lu, 26 June, 2002 - * Background buffer is used for freeing heap objects storing - * old data. At this moment, it only frees the first level of - * VL datatype. It doesn't handle nested VL datatypes. + * Background buffer is used for freeing heap objects storing + * old data. At this moment, it only frees the first level of + * VL datatype. It doesn't handle nested VL datatypes. * *------------------------------------------------------------------------- */ @@ -2343,7 +2343,7 @@ H5T_conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if ((tmp_buf=H5FL_BLK_MALLOC(vlen_seq,tmp_buf_size))==NULL) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for type conversion"); } /* end if */ - + /* Get the allocation info */ if(H5T_vlen_get_alloc_info(dxpl_id,&vl_alloc_info)<0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTGET, FAIL, "unable to retrieve VL allocation info"); @@ -2416,7 +2416,7 @@ H5T_conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, dst_size=seq_len*dst_base_size; /* Check if conversion buffer is large enough, resize if - * necessary */ + * necessary */ if(conv_buf_sizecommand) { @@ -2742,7 +2742,7 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HGOTO_ERROR (H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "destination size is too large"); cdata->need_bkg = H5T_BKG_NO; break; - + case H5T_CONV_FREE: break; @@ -2764,7 +2764,7 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else if (src->shared->size>=dst->shared->size) { double olap_d = HDceil((double)(dst->shared->size)/ (double)(src->shared->size-dst->shared->size)); - + olap = (size_t)olap_d; sp = dp = (uint8_t*)buf; direction = 1; @@ -2799,7 +2799,7 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, assert ((dpshared->size<=sp) || (spshared->size<=dp)); } #endif - + /* * Put the data in little endian order so our loops aren't so * complicated. We'll do all the conversion stuff assuming @@ -2828,7 +2828,7 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * Set the destination to zero. */ H5T_bit_set (d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec, FALSE); - + } else if (H5T_SGN_NONE==src->shared->u.atomic.u.i.sign && H5T_SGN_NONE==dst->shared->u.atomic.u.i.sign) { /* @@ -2851,7 +2851,7 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_bit_copy (d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, dst->shared->u.atomic.prec); } - + } else if (H5T_SGN_2==src->shared->u.atomic.u.i.sign && H5T_SGN_NONE==dst->shared->u.atomic.u.i.sign) { /* @@ -2880,7 +2880,7 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_bit_copy (d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, dst->shared->u.atomic.prec); } - + } else if (H5T_SGN_NONE==src->shared->u.atomic.u.i.sign && H5T_SGN_2==dst->shared->u.atomic.u.i.sign) { /* @@ -2914,7 +2914,7 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, ssize_t sfz = H5T_bit_find (s, src->shared->u.atomic.offset, src->shared->u.atomic.prec-1, H5T_BIT_MSB, FALSE); size_t fz = (size_t)sfz; - + if (sfz>=0 && fz+1>=dst->shared->u.atomic.prec) { /*overflow*/ if (!H5T_overflow_g || (H5T_overflow_g)(src_id, dst_id, s, d)<0) { @@ -2927,7 +2927,7 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else { H5T_bit_copy (d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, dst->shared->u.atomic.prec); } - + } else { /* * Source and destination are both signed but the source @@ -2993,7 +2993,7 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, dp += direction * dst->shared->size; } } - + break; default: @@ -3062,7 +3062,7 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t i; /*miscellaneous counters */ size_t implied; /*destination implied bits */ herr_t ret_value=SUCCEED; /*return value */ - + FUNC_ENTER_NOAPI(H5T_conv_f_f, FAIL); switch (cdata->command) { @@ -3142,7 +3142,7 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, (spshared->size<=dp)); } #endif - + /* * Put the data in little endian order so our loops aren't so * complicated. We'll do all the conversion stuff assuming @@ -3175,9 +3175,9 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_bit_copy (d, dst.u.f.sign, s, src.u.f.sign, 1); H5T_bit_set (d, dst.u.f.epos, dst.u.f.esize, TRUE); H5T_bit_set (d, dst.u.f.mpos, dst.u.f.msize, FALSE); - /*If the destination no implied mantissa bit, we'll need to set + /*If the destination no implied mantissa bit, we'll need to set *the 1st bit of mantissa to 1. The Intel-Linux long double is - *this case.*/ + *this case.*/ if (H5T_NORM_NONE==dst.u.f.norm) H5T_bit_set (d, dst.u.f.mpos+dst.u.f.msize-1, 1, TRUE); goto padding; @@ -3186,14 +3186,14 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_BIT_LSB, TRUE)<0 && H5T_bit_find (s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, FALSE)<0) { /*This is a special case for the source of no implied mantissa bit. - *If the exponent bits are all 1s and only the 1st bit of mantissa + *If the exponent bits are all 1s and only the 1st bit of mantissa *is set to 1. It's infinity. The Intel-Linux "long double" is this case.*/ /* +Inf or -Inf */ H5T_bit_copy (d, dst.u.f.sign, s, src.u.f.sign, 1); H5T_bit_set (d, dst.u.f.epos, dst.u.f.esize, TRUE); H5T_bit_set (d, dst.u.f.mpos, dst.u.f.msize, FALSE); - /*If the destination no implied mantissa bit, we'll need to set - *the 1st bit of mantissa to 1.*/ + /*If the destination no implied mantissa bit, we'll need to set + *the 1st bit of mantissa to 1.*/ if (H5T_NORM_NONE==dst.u.f.norm) H5T_bit_set (d, dst.u.f.mpos+dst.u.f.msize-1, 1, TRUE); goto padding; @@ -3218,7 +3218,7 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(expo==0) denormalized=TRUE; - + /* * Set markers for the source mantissa, excluding the leading `1' * (might be implied). @@ -3240,7 +3240,7 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, assert("normalization method not implemented yet" && 0); HDabort(); } - + /* * The sign for the destination is the same as the sign for the * source in all cases. @@ -3339,7 +3339,7 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, implied = 2; } } else if(H5T_bit_get_d(s, mpos+bitno-1, 1) && denormalized) - /*For either source or destination, denormalized value doesn't increment carry.*/ + /*For either source or destination, denormalized value doesn't increment carry.*/ H5T_bit_inc(s, mpos+bitno-1, 1+msize-bitno); } else @@ -3365,7 +3365,7 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } if (mrsh+msize>=dst.u.f.msize) { H5T_bit_copy(d, dst.u.f.mpos, - s, (mpos+msize+mrsh-dst.u.f.msize), + s, (mpos+msize+mrsh-dst.u.f.msize), dst.u.f.msize-mrsh); } else { H5T_bit_copy(d, dst.u.f.mpos+dst.u.f.msize-(mrsh+msize), @@ -3374,7 +3374,7 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, FALSE); } } - + /* Write the exponent */ if (carry) { expo++; @@ -3452,9 +3452,9 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, dp += direction * dst_p->shared->size; } } - + break; - + default: HGOTO_ERROR (H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unknown conversion command"); } @@ -3496,7 +3496,7 @@ H5T_conv_s_s (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, uint8_t *s, *sp, *d, *dp; /*src and dst traversal pointers*/ uint8_t *dbuf=NULL; /*temp buf for overlap convers. */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_s_s, FAIL); switch (cdata->command) { @@ -3556,7 +3556,7 @@ H5T_conv_s_s (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* Allocate the overlap buffer */ if (NULL==(dbuf=H5MM_malloc(dst->shared->size))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for string conversion"); - + /* The conversion loop. */ for (elmtno=0; elmtnoshared->size<=dp)); } #endif - + /* Copy characters from source to destination */ switch (src->shared->u.atomic.u.s.pad) { case H5T_STR_NULLTERM: @@ -3634,12 +3634,12 @@ H5T_conv_s_s (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, d[nchars++] = '\0'; d[dst->shared->size-1] = '\0'; break; - + case H5T_STR_NULLPAD: while (ncharsshared->size) d[nchars++] = '\0'; break; - + case H5T_STR_SPACEPAD: while (ncharsshared->size) d[nchars++] = ' '; @@ -4367,7 +4367,7 @@ H5T_conv_ushort_schar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5T_conv_ushort_schar, FAIL); - + H5T_CONV_Us(USHORT, SCHAR, unsigned short, signed char, -, SCHAR_MAX); done: @@ -4433,7 +4433,7 @@ H5T_conv_short_ushort(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5T_conv_short_ushort, FAIL); - + H5T_CONV_su(SHORT, USHORT, short, unsigned short, -, -); done: @@ -4994,7 +4994,7 @@ H5T_conv_uint_uchar(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_NOAPI(H5T_conv_uint_uchar, FAIL); - + H5T_CONV_Uu(UINT, UCHAR, unsigned, unsigned char, -, UCHAR_MAX); done: @@ -6757,7 +6757,7 @@ H5T_conv_i32le_f64le (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, if (NULL==(src=H5I_object(src_id)) || NULL==H5I_object(dst_id)) HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type"); - + s = (uint8_t*)buf + (buf_stride?buf_stride:4)*(nelmts-1); d = (uint8_t*)buf + (buf_stride?buf_stride:8)*(nelmts-1); for (elmtno=0; elmtno>4) & 0x7f); d[6] = (exponent & 0x0f) << 4; - + /* * The mantissa. */ @@ -6997,7 +6997,7 @@ H5T_conv_i32le_f64le (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, d[5] = s[0]; d[4] = d[3] = d[2] = d[1] = d[0] = 0; break; - + case 12: d[6] |= ((s[1]<<1) | (s[0]>>7)) & 0x0f; d[5] = (s[0]<<1); @@ -7088,7 +7088,7 @@ H5T_conv_i32le_f64le (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, /* Some other command we don't know about yet.*/ HGOTO_ERROR (H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unknown conversion command"); } - + done: FUNC_LEAVE_NOAPI(ret_value); } diff --git a/src/H5Tcset.c b/src/H5Tcset.c index 1c86b96..bc687ac 100644 --- a/src/H5Tcset.c +++ b/src/H5Tcset.c @@ -34,7 +34,7 @@ NAME H5T_init_cset_interface -- Initialize interface-specific information USAGE herr_t H5T_init_cset_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -57,7 +57,7 @@ H5T_init_cset_interface(void) * Purpose: HDF5 is able to distinguish between character sets of * different nationalities and to convert between them to the * extent possible. - * + * * Return: Success: The character set of a string type. * * Failure: H5T_CSET_ERROR (Negative) @@ -87,11 +87,11 @@ H5Tget_cset(hid_t type_id) dt = dt->shared->parent; /*defer to parent*/ if (!H5T_IS_STRING(dt->shared)) HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, H5T_CSET_ERROR, "operation not defined for data type class") - + /* result */ if(H5T_IS_FIXED_STRING(dt->shared)) ret_value = dt->shared->u.atomic.u.s.cset; - else + else ret_value = dt->shared->u.vlen.cset; done: @@ -137,11 +137,11 @@ H5Tset_cset(hid_t type_id, H5T_cset_t cset) dt = dt->shared->parent; /*defer to parent*/ if (!H5T_IS_STRING(dt->shared)) HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for data type class") - + /* Commit */ if(H5T_IS_FIXED_STRING(dt->shared)) dt->shared->u.atomic.u.s.cset = cset; - else + else dt->shared->u.vlen.cset = cset; done: diff --git a/src/H5Tenum.c b/src/H5Tenum.c index 4f36578..f99258a 100644 --- a/src/H5Tenum.c +++ b/src/H5Tenum.c @@ -46,7 +46,7 @@ NAME H5T_init_enum_interface -- Initialize interface-specific information USAGE herr_t H5T_init_enum_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -86,7 +86,7 @@ H5Tenum_create(hid_t parent_id) H5T_t *parent = NULL; /*base integer data type */ H5T_t *dt = NULL; /*new enumeration data type */ hid_t ret_value; /*return value */ - + FUNC_ENTER_API(H5Tenum_create, FAIL) H5TRACE1("i","i",parent_id); @@ -109,16 +109,16 @@ done: /*------------------------------------------------------------------------- * Function: H5T_enum_create * - * Purpose: Private function for H5Tenum_create. Create a new + * Purpose: Private function for H5Tenum_create. Create a new * enumeration data type based on the specified * TYPE, which must be an integer type. * * Return: Success: new enumeration data type * - * Failure: NULL + * Failure: NULL * * Programmer: Raymond Lu - * October 9, 2002 + * October 9, 2002 * * Modifications: * @@ -128,7 +128,7 @@ H5T_t * H5T_enum_create(const H5T_t *parent) { H5T_t *ret_value; /*new enumeration data type */ - + FUNC_ENTER_NOAPI(H5T_enum_create, NULL) assert(parent); @@ -177,7 +177,7 @@ H5Tenum_insert(hid_t type, const char *name, const void *value) { H5T_t *dt=NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Tenum_insert, FAIL) H5TRACE3("e","isx",type,name,value); @@ -226,7 +226,7 @@ H5T_enum_insert(const H5T_t *dt, const char *name, const void *value) char **names=NULL; uint8_t *values=NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_enum_insert, FAIL) assert(dt); @@ -287,7 +287,7 @@ H5Tget_member_value(hid_t type, unsigned membno, void *value/*out*/) { H5T_t *dt=NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Tget_member_value, FAIL) H5TRACE3("e","iIux",type,membno,value); @@ -310,7 +310,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_get_member_value * - * Purpose: Private function for H5T_get_member_value. Return the + * Purpose: Private function for H5T_get_member_value. Return the * value for an enumeration data type member. * * Return: Success: non-negative with the member value copied @@ -319,7 +319,7 @@ done: * Failure: negative, VALUE memory is undefined. * * Programmer: Raymond Lu - * October 9, 2002 + * October 9, 2002 * * Modifications: * @@ -329,7 +329,7 @@ herr_t H5T_get_member_value(const H5T_t *dt, unsigned membno, void *value/*out*/) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_get_member_value, FAIL) assert(dt); @@ -427,7 +427,7 @@ H5T_enum_nameof(const H5T_t *dt, const void *value, char *name/*out*/, size_t si int cmp=(-1); /*comparison result */ H5T_t *copied_dt = NULL; /*do sorting in copied datatype */ char *ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_enum_nameof, NULL) /* Check args */ @@ -557,7 +557,7 @@ H5T_enum_valueof(const H5T_t *dt, const char *name, void *value/*out*/) int cmp=(-1); /*comparison result */ H5T_t *copied_dt = NULL; /*do sorting in copied datatype */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_enum_valueof, FAIL) /* Check args */ diff --git a/src/H5Tfields.c b/src/H5Tfields.c index 813690c..a453e57 100644 --- a/src/H5Tfields.c +++ b/src/H5Tfields.c @@ -35,7 +35,7 @@ NAME H5T_init_fields_interface -- Initialize interface-specific information USAGE herr_t H5T_init_fields_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -87,7 +87,7 @@ H5Tget_nmembers(hid_t type_id) if((ret_value = H5T_get_nmembers(dt))<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "cannot return member number") - + done: FUNC_LEAVE_API(ret_value) } @@ -96,7 +96,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_get_nmembers * - * Purpose: Private function for H5Tget_nmembers. Determines how many + * Purpose: Private function for H5Tget_nmembers. Determines how many * members DTYPE has. The type must be either a compound data * type or an enumeration datatype. * @@ -106,8 +106,8 @@ done: * * Errors: * - * Programmer: Raymond Lu - * October 8, 2002 + * Programmer: Raymond Lu + * October 8, 2002 * * Modifications: * @@ -128,7 +128,7 @@ H5T_get_nmembers(const H5T_t *dt) ret_value = (int)dt->shared->u.enumer.nmembs; else HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "operation not supported for type class") - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -178,9 +178,9 @@ done: /*------------------------------------------------------------------------- * Function: H5T_get_member_name * - * Purpose: Private function for H5Tget_member_name. Returns the name + * Purpose: Private function for H5Tget_member_name. Returns the name * of a member of a compound or enumeration datatype. Members - * are stored in no particular order with numbers 0 through + * are stored in no particular order with numbers 0 through * N-1 where N is the value returned by H5Tget_nmembers(). * * Return: Success: Ptr to a string allocated with malloc(). The @@ -189,7 +189,7 @@ done: * Failure: NULL * * Programmer: Raymond Lu - * October 9, 2002 + * October 9, 2002 * * Modifications: *------------------------------------------------------------------------- @@ -215,7 +215,7 @@ H5T_get_member_name(H5T_t const *dt, unsigned membno) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid member number") ret_value = H5MM_xstrdup(dt->shared->u.enumer.name[membno]); break; - + default: HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "operation not supported for type class") } /*lint !e788 All appropriate cases are covered */ @@ -229,10 +229,10 @@ done: * Function: H5Tget_member_index * * Purpose: Returns the index of a member in a compound or enumeration - * datatype by given name.Members are stored in no particular - * order with numbers 0 through N-1 where N is the value + * datatype by given name.Members are stored in no particular + * order with numbers 0 through N-1 where N is the value * returned by H5Tget_nmembers(). - * + * * Return: Success: index of the member if exists. * Failure: -1. * @@ -265,7 +265,7 @@ H5Tget_member_index(hid_t type_id, const char *name) if(!HDstrcmp(dt->shared->u.compnd.memb[i].name, name)) HGOTO_DONE((int)i) } - break; + break; case H5T_ENUM: for(i=0; i< dt->shared->u.enumer.nmembs; i++) { if(!HDstrcmp(dt->shared->u.enumer.name[i], name)) @@ -364,7 +364,7 @@ H5T_sort_value(const H5T_t *dt, int *map) HDmemcpy(dt->shared->u.enumer.value+j*size, dt->shared->u.enumer.value+(j+1)*size, size); HDmemcpy(dt->shared->u.enumer.value+(j+1)*size, tbuf, size); - + /* Swap map */ if (map) { int x = map[j]; @@ -386,7 +386,7 @@ H5T_sort_value(const H5T_t *dt, int *map) #endif } } - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -449,7 +449,7 @@ H5T_sort_name(const H5T_t *dt, int *map) #ifndef NDEBUG /* I never trust a sort :-) -RPM */ for (i=0; ishared->u.compnd.memb[i].name, + assert(HDstrcmp(dt->shared->u.compnd.memb[i].name, dt->shared->u.compnd.memb[i+1].name)<0); } #endif @@ -493,7 +493,7 @@ H5T_sort_name(const H5T_t *dt, int *map) #endif } } - + done: FUNC_LEAVE_NOAPI(ret_value) } diff --git a/src/H5Tfixed.c b/src/H5Tfixed.c index 4219377..1d0817e 100644 --- a/src/H5Tfixed.c +++ b/src/H5Tfixed.c @@ -34,7 +34,7 @@ NAME H5T_init_fixed_interface -- Initialize interface-specific information USAGE herr_t H5T_init_fixed_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -80,7 +80,7 @@ H5Tget_sign(hid_t type_id) /* Check args */ if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_SGN_ERROR, "not an integer datatype") - + ret_value = H5T_get_sign(dt); done: @@ -91,7 +91,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_get_sign * - * Purpose: Private function for H5Tget_sign. Retrieves the sign type + * Purpose: Private function for H5Tget_sign. Retrieves the sign type * for an integer type. * * Return: Success: The sign type. @@ -121,7 +121,7 @@ H5T_get_sign(H5T_t const *dt) /* Check args */ if (H5T_INTEGER!=dt->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5T_SGN_ERROR, "operation not defined for datatype class") - + /* Sign */ ret_value = dt->shared->u.atomic.u.i.sign; @@ -169,7 +169,7 @@ H5Tset_sign(hid_t type_id, H5T_sign_t sign) dt = dt->shared->parent; /*defer to parent*/ if (H5T_INTEGER!=dt->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for datatype class") - + /* Commit */ dt->shared->u.atomic.u.i.sign = sign; diff --git a/src/H5Tfloat.c b/src/H5Tfloat.c index dbf0cb0..e216606 100644 --- a/src/H5Tfloat.c +++ b/src/H5Tfloat.c @@ -34,7 +34,7 @@ NAME H5T_init_float_interface -- Initialize interface-specific information USAGE herr_t H5T_init_float_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -92,7 +92,7 @@ H5Tget_fields(hid_t type_id, size_t *spos/*out*/, dt = dt->shared->parent; /*defer to parent*/ if (H5T_FLOAT != dt->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for datatype class") - + /* Get values */ if (spos) *spos = dt->shared->u.atomic.u.f.sign; if (epos) *epos = dt->shared->u.atomic.u.f.epos; @@ -115,7 +115,7 @@ done: * * Fields are not allowed to extend beyond the number of bits of * precision, nor are they allowed to overlap with one another. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke @@ -124,7 +124,7 @@ done: * Modifications: * Robb Matzke, 22 Dec 1998 * Also works for derived datatypes. - * + * *------------------------------------------------------------------------- */ herr_t @@ -152,7 +152,7 @@ H5Tset_fields(hid_t type_id, size_t spos, size_t epos, size_t esize, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "mantissa bit field size/location is invalid") if (spos >= dt->shared->u.atomic.prec) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "sign location is not valid") - + /* Check for overlap */ if (spos >= epos && spos < epos + esize) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "sign bit appears within exponent field") @@ -161,7 +161,7 @@ H5Tset_fields(hid_t type_id, size_t spos, size_t epos, size_t esize, if ((mpos < epos && mpos + msize > epos) || (epos < mpos && epos + esize > mpos)) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "exponent and mantissa fields overlap") - + /* Commit */ dt->shared->u.atomic.u.f.sign = spos; dt->shared->u.atomic.u.f.epos = epos; @@ -207,7 +207,7 @@ H5Tget_ebias(hid_t type_id) dt = dt->shared->parent; /*defer to parent*/ if (H5T_FLOAT != dt->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, 0, "operation not defined for datatype class") - + /* bias */ H5_ASSIGN_OVERFLOW(ret_value,dt->shared->u.atomic.u.f.ebias,uint64_t,size_t); @@ -294,7 +294,7 @@ H5Tget_norm(hid_t type_id) dt = dt->shared->parent; /*defer to parent*/ if (H5T_FLOAT != dt->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5T_NORM_ERROR, "operation not defined for datatype class") - + /* norm */ ret_value = dt->shared->u.atomic.u.f.norm; @@ -340,7 +340,7 @@ H5Tset_norm(hid_t type_id, H5T_norm_t norm) dt = dt->shared->parent; /*defer to parent*/ if (H5T_FLOAT != dt->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for datatype class") - + /* Commit */ dt->shared->u.atomic.u.f.norm = norm; @@ -386,7 +386,7 @@ H5Tget_inpad(hid_t type_id) dt = dt->shared->parent; /*defer to parent*/ if (H5T_FLOAT != dt->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5T_PAD_ERROR, "operation not defined for datatype class") - + /* pad */ ret_value = dt->shared->u.atomic.u.f.pad; @@ -434,7 +434,7 @@ H5Tset_inpad(hid_t type_id, H5T_pad_t pad) dt = dt->shared->parent; /*defer to parent*/ if (H5T_FLOAT != dt->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for datatype class") - + /* Commit */ dt->shared->u.atomic.u.f.pad = pad; diff --git a/src/H5Tnative.c b/src/H5Tnative.c index ecae777..09a80af 100644 --- a/src/H5Tnative.c +++ b/src/H5Tnative.c @@ -31,11 +31,11 @@ #include "H5Tpkg.h" /* Datatypes */ /* Static local functions */ -static H5T_t *H5T_get_native_type(H5T_t *dt, H5T_direction_t direction, +static H5T_t *H5T_get_native_type(H5T_t *dt, H5T_direction_t direction, size_t *struct_align, size_t *offset, size_t *comp_size); -static H5T_t *H5T_get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction, +static H5T_t *H5T_get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction, size_t *struct_align, size_t *offset, size_t *comp_size); -static H5T_t *H5T_get_native_float(size_t size, H5T_direction_t direction, +static H5T_t *H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_align, size_t *offset, size_t *comp_size); static herr_t H5T_cmp_offset(size_t *comp_size, size_t *offset, size_t elem_size, size_t nelems, size_t align, size_t *struct_align); @@ -46,7 +46,7 @@ NAME H5T_init_native_interface -- Initialize interface-specific information USAGE herr_t H5T_init_native_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -66,9 +66,9 @@ H5T_init_native_interface(void) /*------------------------------------------------------------------------- * Function: H5Tget_native_type * - * Purpose: High-level API to return the native type of a datatype. - * The native type is chosen by matching the size and class of - * querried datatype from the following native premitive + * Purpose: High-level API to return the native type of a datatype. + * The native type is chosen by matching the size and class of + * querried datatype from the following native premitive * datatypes: * H5T_NATIVE_CHAR H5T_NATIVE_UCHAR * H5T_NATIVE_SHORT H5T_NATIVE_USHORT @@ -80,16 +80,16 @@ H5T_init_native_interface(void) * H5T_NATIVE_DOUBLE * H5T_NATIVE_LDOUBLE * - * Compound, array, enum, and VL types all choose among these + * Compound, array, enum, and VL types all choose among these * types for theire members. Time, Bifield, Opaque, Reference * types are only copy out. - * + * * Return: Success: Returns the native data type if successful. * * Failure: negative * * Programmer: Raymond Lu - * Oct 3, 2002 + * Oct 3, 2002 * * Modifications: * @@ -110,7 +110,7 @@ H5Tget_native_type(hid_t type_id, H5T_direction_t direction) if(NULL==(dt=H5I_object_verify(type_id, H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type") - if(direction!=H5T_DIR_DEFAULT && direction!=H5T_DIR_ASCEND + if(direction!=H5T_DIR_DEFAULT && direction!=H5T_DIR_ASCEND && direction!=H5T_DIR_DESCEND) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not valid direction value") @@ -119,7 +119,7 @@ H5Tget_native_type(hid_t type_id, H5T_direction_t direction) if((ret_value=H5I_register(H5I_DATATYPE, new_dt)) < 0) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register data type") - + done: /* Error cleanup */ if(ret_value<0) { @@ -127,30 +127,30 @@ done: if(H5T_close(new_dt)<0) HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to release datatype") } /* end if */ - + FUNC_LEAVE_API(ret_value) } /*------------------------------------------------------------------------- * Function: H5T_get_native_type - * + * * Purpose: Returns the native type of a datatype. - * + * * Return: Success: Returns the native data type if successful. - * + * * Failure: negative - * + * * Programmer: Raymond Lu * Oct 3, 2002 - * + * * Modifications: - * + * *------------------------------------------------------------------------- */ static H5T_t* H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_align, size_t *offset, size_t *comp_size) -{ +{ H5T_t *dt; /* Datatype to make native */ H5T_class_t h5_class; /* Class of datatype to make native */ size_t size; /* Size of datatype to make native */ @@ -164,15 +164,15 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig H5T_t *ret_value; /* Return value */ FUNC_ENTER_NOAPI(H5T_get_native_type, NULL) - - assert(dtype); + + assert(dtype); if((h5_class = H5T_get_class(dtype, FALSE))==H5T_NO_CLASS) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a valid class") - + if((size = H5T_get_size(dtype))==0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a valid size") - + switch(h5_class) { case H5T_INTEGER: { @@ -182,12 +182,12 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a valid signess") prec = dtype->shared->u.atomic.prec; - + if((ret_value = H5T_get_native_integer(prec, sign, direction, struct_align, offset, comp_size))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot retrieve integer type") } break; - + case H5T_FLOAT: if((ret_value = H5T_get_native_float(size, direction, struct_align, offset, comp_size))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot retrieve float type") @@ -202,14 +202,14 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig /* Update size, offset and compound alignment for parent. */ if(H5T_cmp_offset(comp_size, offset, sizeof(char *), 1, H5T_POINTER_COMP_ALIGN_g, struct_align)<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") - } else { + } else { /* Update size, offset and compound alignment for parent. */ if(H5T_cmp_offset(comp_size, offset, sizeof(char), size, H5T_NATIVE_SCHAR_COMP_ALIGN_g, struct_align)<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") } break; - /* These 2 types will be supported in the future. Simply return "not supported" + /* These 2 types will be supported in the future. Simply return "not supported" * message for now.*/ case H5T_TIME: HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "time type is not supported yet") @@ -234,21 +234,21 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig if((ret_value=H5T_copy(dtype, H5T_COPY_TRANSIENT))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot retrieve float type") - + /* Decide if the data type is object or dataset region reference. */ if(NULL==(dt=H5I_object(H5T_STD_REF_OBJ_g))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type") not_equal = H5T_cmp(ret_value, dt, FALSE); /* Update size, offset and compound alignment for parent. */ - if(!not_equal) { + if(!not_equal) { align = H5T_HOBJREF_COMP_ALIGN_g; ref_size = sizeof(hobj_ref_t); } else { align = H5T_HDSETREGREF_COMP_ALIGN_g; ref_size = sizeof(hdset_reg_ref_t); } - + if(H5T_cmp_offset(comp_size, offset, ref_size, 1, align, struct_align)<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") } @@ -259,14 +259,14 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig H5T_t *memb_type; /* Datatype of member */ H5T_t **memb_list; /* List of compound member IDs */ size_t *memb_offset; /* List of member offsets in compound type, including member size and alignment */ - size_t children_size=0;/* Total size of compound members */ + size_t children_size=0;/* Total size of compound members */ size_t children_st_align=0; /* The max alignment among compound members. This'll be the compound alignment */ char **comp_mname; /* List of member names in compound type */ if((snmemb = H5T_get_nmembers(dtype))<=0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "compound data type doesn't have any member") H5_ASSIGN_OVERFLOW(nmemb,snmemb,int,unsigned); - + if((memb_list = (H5T_t**)H5MM_malloc(nmemb*sizeof(H5T_t*)))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot allocate memory") if((memb_offset = (size_t*)H5MM_calloc(nmemb*sizeof(size_t)))==NULL) @@ -274,43 +274,43 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig if((comp_mname = (char**)H5MM_malloc(nmemb*sizeof(char*)))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot allocate memory") - /* Construct child compound type and retrieve a list of their IDs, offsets, total size, and alignment for compound type. */ + /* Construct child compound type and retrieve a list of their IDs, offsets, total size, and alignment for compound type. */ for(i=0; i=H5Tget_precision(H5T_NATIVE_LLONG)) { + if(prec>=H5Tget_precision(H5T_NATIVE_LLONG)) { match=H5T_NATIVE_INT_MATCH_LLONG; - native_size = sizeof(long_long); + native_size = sizeof(long_long); } else if(prec>=H5Tget_precision(H5T_NATIVE_LONG)) { if(prec==H5Tget_precision(H5T_NATIVE_LONG)) { match=H5T_NATIVE_INT_MATCH_LONG; - native_size = sizeof(long); + native_size = sizeof(long); } else { match=H5T_NATIVE_INT_MATCH_LLONG; - native_size = sizeof(long_long); + native_size = sizeof(long_long); } } else if(prec>=H5Tget_precision(H5T_NATIVE_INT)) { if(prec==H5Tget_precision(H5T_NATIVE_INT)) { match=H5T_NATIVE_INT_MATCH_INT; - native_size = sizeof(int); + native_size = sizeof(int); } else { match=H5T_NATIVE_INT_MATCH_LONG; - native_size = sizeof(long); + native_size = sizeof(long); } } else if(prec>=H5Tget_precision(H5T_NATIVE_SHORT)) { if(prec==H5Tget_precision(H5T_NATIVE_SHORT)) { match=H5T_NATIVE_INT_MATCH_SHORT; - native_size = sizeof(short); + native_size = sizeof(short); } else { match=H5T_NATIVE_INT_MATCH_INT; - native_size = sizeof(int); + native_size = sizeof(int); } } else if(prec>=H5Tget_precision(H5T_NATIVE_SCHAR)) { if(prec==H5Tget_precision(H5T_NATIVE_SCHAR)) { match=H5T_NATIVE_INT_MATCH_CHAR; - native_size = sizeof(char); + native_size = sizeof(char); } else { match=H5T_NATIVE_INT_MATCH_SHORT; - native_size = sizeof(short); + native_size = sizeof(short); } } else { /* If no native type matches the queried datatype, simply choose the type of smallest size. */ match=H5T_NATIVE_INT_MATCH_CHAR; - native_size = sizeof(char); + native_size = sizeof(char); } } @@ -607,50 +607,50 @@ H5T_get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction, tid = H5T_NATIVE_SCHAR; else tid = H5T_NATIVE_UCHAR; - - align = H5T_NATIVE_SCHAR_COMP_ALIGN_g; + + align = H5T_NATIVE_SCHAR_COMP_ALIGN_g; break; - + case H5T_NATIVE_INT_MATCH_SHORT: if(sign==H5T_SGN_2) tid = H5T_NATIVE_SHORT; - else + else tid = H5T_NATIVE_USHORT; - align = H5T_NATIVE_SHORT_COMP_ALIGN_g; + align = H5T_NATIVE_SHORT_COMP_ALIGN_g; break; - + case H5T_NATIVE_INT_MATCH_INT: if(sign==H5T_SGN_2) tid = H5T_NATIVE_INT; - else + else tid = H5T_NATIVE_UINT; - align = H5T_NATIVE_INT_COMP_ALIGN_g; + align = H5T_NATIVE_INT_COMP_ALIGN_g; break; - + case H5T_NATIVE_INT_MATCH_LONG: if(sign==H5T_SGN_2) tid = H5T_NATIVE_LONG; - else + else tid = H5T_NATIVE_ULONG; - align = H5T_NATIVE_LONG_COMP_ALIGN_g; + align = H5T_NATIVE_LONG_COMP_ALIGN_g; break; - + case H5T_NATIVE_INT_MATCH_LLONG: if(sign==H5T_SGN_2) tid = H5T_NATIVE_LLONG; - else + else tid = H5T_NATIVE_ULLONG; - align = H5T_NATIVE_LLONG_COMP_ALIGN_g; + align = H5T_NATIVE_LLONG_COMP_ALIGN_g; break; - + case H5T_NATIVE_INT_MATCH_UNKNOWN: default: HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "Unknown native integer match") } /* end switch */ - + /* Create new native type */ assert(tid>=0); if(NULL==(dt=H5I_object(tid))) @@ -658,11 +658,11 @@ H5T_get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction, if((ret_value=H5T_copy(dt, H5T_COPY_TRANSIENT))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot copy type") - + /* compute size and offset of compound type member. */ if(H5T_cmp_offset(comp_size, offset, native_size, 1, align, struct_align)<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -671,23 +671,23 @@ done: /*------------------------------------------------------------------------- * Function: H5T_get_native_float - * + * * Purpose: Returns the native floatt type of a datatype. - * + * * Return: Success: Returns the native data type if successful. - * + * * Failure: negative - * + * * Programmer: Raymond Lu * Oct 3, 2002 - * + * * Modifications: - * + * *------------------------------------------------------------------------- */ static H5T_t* H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_align, size_t *offset, size_t *comp_size) -{ +{ H5T_t *dt=NULL; /* Appropriate native datatype to copy */ hid_t tid=(-1); /* Datatype ID of appropriate native datatype */ size_t align=0; /* Alignment necessary for native datatype */ @@ -703,47 +703,47 @@ H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_alig FUNC_ENTER_NOAPI(H5T_get_native_float, NULL) assert(size>0); - - if(direction == H5T_DIR_DEFAULT || direction == H5T_DIR_ASCEND) { + + if(direction == H5T_DIR_DEFAULT || direction == H5T_DIR_ASCEND) { if(size<=sizeof(float)) { match=H5T_NATIVE_FLOAT_MATCH_FLOAT; - native_size = sizeof(float); + native_size = sizeof(float); } else if(size<=sizeof(double)) { match=H5T_NATIVE_FLOAT_MATCH_DOUBLE; - native_size = sizeof(double); + native_size = sizeof(double); } else if(size<=sizeof(long double)) { match=H5T_NATIVE_FLOAT_MATCH_LDOUBLE; - native_size = sizeof(long double); + native_size = sizeof(long double); } else { /* If not match, return the biggest datatype */ match=H5T_NATIVE_FLOAT_MATCH_LDOUBLE; native_size = sizeof(long double); - } + } } else { if(size>=sizeof(long double)) { match=H5T_NATIVE_FLOAT_MATCH_LDOUBLE; - native_size = sizeof(long double); + native_size = sizeof(long double); } else if(size>=sizeof(double)) { if(size==sizeof(double)) { match=H5T_NATIVE_FLOAT_MATCH_DOUBLE; - native_size = sizeof(double); + native_size = sizeof(double); } else { match=H5T_NATIVE_FLOAT_MATCH_LDOUBLE; native_size = sizeof(long double); - } + } } else if(size>=sizeof(float)) { if(size==sizeof(float)) { match=H5T_NATIVE_FLOAT_MATCH_FLOAT; - native_size = sizeof(float); + native_size = sizeof(float); } else { match=H5T_NATIVE_FLOAT_MATCH_DOUBLE; native_size = sizeof(double); - } - } + } + } else { match=H5T_NATIVE_FLOAT_MATCH_FLOAT; native_size = sizeof(float); - } + } } /* Set the appropriate native floating point information */ @@ -767,18 +767,18 @@ H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_alig default: HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "Unknown native floating-point match") } /* end switch */ - + /* Create new native type */ assert(tid>=0); if(NULL==(dt=H5I_object(tid))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type") if((ret_value=H5T_copy(dt, H5T_COPY_TRANSIENT))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot retrieve float type") - + /* compute offset of compound type member. */ if(H5T_cmp_offset(comp_size, offset, native_size, 1, align, struct_align)<0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset") - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -787,23 +787,23 @@ done: /*------------------------------------------------------------------------- * Function: H5T_cmp_offset * - * Purpose: This function is only for convenience. It computes the + * Purpose: This function is only for convenience. It computes the * compound type size, offset of the member being considered * and the alignment for the whole compound type. * - * Return: Success: Non-negative value. + * Return: Success: Non-negative value. * - * Failure: Negative value. + * Failure: Negative value. * * Programmer: Raymond Lu - * December 10, 2002 + * December 10, 2002 * * Modifications: * *------------------------------------------------------------------------- */ static herr_t -H5T_cmp_offset(size_t *comp_size, size_t *offset, size_t elem_size, +H5T_cmp_offset(size_t *comp_size, size_t *offset, size_t elem_size, size_t nelems, size_t align, size_t *struct_align) { herr_t ret_value = SUCCEED; @@ -818,7 +818,7 @@ H5T_cmp_offset(size_t *comp_size, size_t *offset, size_t elem_size, } else *offset = *comp_size; - /* compute size of compound type member. */ + /* compute size of compound type member. */ *comp_size += nelems*elem_size; } diff --git a/src/H5Toffset.c b/src/H5Toffset.c index 6090851..8cf278f 100644 --- a/src/H5Toffset.c +++ b/src/H5Toffset.c @@ -37,7 +37,7 @@ NAME H5T_init_offset_interface -- Initialize interface-specific information USAGE herr_t H5T_init_offset_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -104,7 +104,7 @@ H5Tget_offset(hid_t type_id) dt = dt->shared->parent; /*defer to parent*/ if (!H5T_IS_ATOMIC(dt->shared)) HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for specified data type") - + /* Offset */ ret_value = (int)dt->shared->u.atomic.offset; @@ -139,7 +139,7 @@ done: * the value from hanging over the edge of the data type. * * The offset of an H5T_STRING cannot be set to anything but - * zero. + * zero. * * Return: Non-negative on success/Negative on failure * @@ -208,7 +208,7 @@ done: * the value from hanging over the edge of the data type. * * The offset of an H5T_STRING cannot be set to anything but - * zero. + * zero. * * Return: Non-negative on success/Negative on failure * @@ -250,7 +250,7 @@ H5T_set_offset(const H5T_t *dt, size_t offset) dt->shared->size = (offset + dt->shared->u.atomic.prec + 7) / 8; dt->shared->u.atomic.offset = offset; } - + done: FUNC_LEAVE_NOAPI(ret_value) } diff --git a/src/H5Topaque.c b/src/H5Topaque.c index 0121957..eb14d58 100644 --- a/src/H5Topaque.c +++ b/src/H5Topaque.c @@ -35,7 +35,7 @@ NAME H5T_init_opaque_interface -- Initialize interface-specific information USAGE herr_t H5T_init_opaque_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -128,7 +128,7 @@ H5Tget_tag(hid_t type_id) dt = dt->shared->parent; /*defer to parent*/ if (H5T_OPAQUE != dt->shared->type) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "operation not defined for data type class") - + /* result */ if (NULL==(ret_value=H5MM_strdup(dt->shared->u.opaque.tag))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") diff --git a/src/H5Torder.c b/src/H5Torder.c index 6d9a713..0628609 100644 --- a/src/H5Torder.c +++ b/src/H5Torder.c @@ -34,7 +34,7 @@ NAME H5T_init_order_interface -- Initialize interface-specific information USAGE herr_t H5T_init_order_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION diff --git a/src/H5Tpad.c b/src/H5Tpad.c index 3a59bca..96d456a 100644 --- a/src/H5Tpad.c +++ b/src/H5Tpad.c @@ -34,7 +34,7 @@ NAME H5T_init_pad_interface -- Initialize interface-specific information USAGE herr_t H5T_init_pad_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -85,7 +85,7 @@ H5Tget_pad(hid_t type_id, H5T_pad_t *lsb/*out*/, H5T_pad_t *msb/*out*/) dt = dt->shared->parent; /*defer to parent*/ if (!H5T_IS_ATOMIC(dt->shared)) HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for specified data type") - + /* Get values */ if (lsb) *lsb = dt->shared->u.atomic.lsb_pad; @@ -110,7 +110,7 @@ done: * Modifications: * Robb Matzke, 22 Dec 1998 * Also works with derived data types. - * + * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h index 3c19277..d655a5c 100644 --- a/src/H5Tpkg.h +++ b/src/H5Tpkg.h @@ -162,8 +162,8 @@ typedef struct H5T_vlen_t { H5T_vlen_type_t type; /* Type of VL data in buffer */ H5T_vlen_loc_t loc; /* Location of VL data in buffer */ H5T_cset_t cset; /* For VL string. character set */ - H5T_str_t pad; /* For VL string. space or null padding of - * extra bytes */ + H5T_str_t pad; /* For VL string. space or null padding of + * extra bytes */ H5F_t *f; /* File ID (if VL data is on disk) */ H5T_vlen_getptrfunc_t getptr; /* Function to get VL sequence pointer */ H5T_vlen_getlenfunc_t getlen; /* Function to get VL sequence size (in element units, not bytes) */ diff --git a/src/H5Tprecis.c b/src/H5Tprecis.c index 9b2a0b4..2a68915 100644 --- a/src/H5Tprecis.c +++ b/src/H5Tprecis.c @@ -37,7 +37,7 @@ NAME H5T_init_precis_interface -- Initialize interface-specific information USAGE herr_t H5T_init_precis_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -92,7 +92,7 @@ H5Tget_precision(hid_t type_id) dt = dt->shared->parent; /*defer to parent*/ if (!H5T_IS_ATOMIC(dt->shared)) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, 0, "operation not defined for specified datatype") - + /* Precision */ ret_value = dt->shared->u.atomic.prec; @@ -260,7 +260,7 @@ H5T_set_precision(const H5T_t *dt, size_t prec) else HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for specified datatype") } /* end else */ - + done: FUNC_LEAVE_NOAPI(ret_value) } diff --git a/src/H5Tpublic.h b/src/H5Tpublic.h index 4d7136f..b2137c6 100644 --- a/src/H5Tpublic.h +++ b/src/H5Tpublic.h @@ -535,7 +535,7 @@ H5_DLL hid_t H5Tget_member_type(hid_t type_id, unsigned membno); H5_DLL herr_t H5Tget_member_value(hid_t type_id, unsigned membno, void *value/*out*/); H5_DLL H5T_cset_t H5Tget_cset(hid_t type_id); H5_DLL htri_t H5Tis_variable_str(hid_t type_id); -H5_DLL hid_t H5Tget_native_type(hid_t type_id, H5T_direction_t direction); +H5_DLL hid_t H5Tget_native_type(hid_t type_id, H5T_direction_t direction); /* Setting property values */ H5_DLL herr_t H5Tset_size(hid_t type_id, size_t size); diff --git a/src/H5Tstrpad.c b/src/H5Tstrpad.c index 1c8ce2f..2c9b7d6 100644 --- a/src/H5Tstrpad.c +++ b/src/H5Tstrpad.c @@ -34,7 +34,7 @@ NAME H5T_init_strpad_interface -- Initialize interface-specific information USAGE herr_t H5T_init_strpad_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -58,7 +58,7 @@ H5T_init_strpad_interface(void) * programming language: C usually null terminates strings while * Fortran left-justifies and space-pads strings. This property * defines the storage mechanism for the string. - * + * * Return: Success: The character set of a string type. * * Failure: H5T_STR_ERROR (Negative) @@ -88,7 +88,7 @@ H5Tget_strpad(hid_t type_id) dt = dt->shared->parent; /*defer to parent*/ if (!H5T_IS_STRING(dt->shared)) HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, H5T_STR_ERROR, "operation not defined for datatype class") - + /* result */ if(H5T_IS_FIXED_STRING(dt->shared)) ret_value = dt->shared->u.atomic.u.s.pad; @@ -149,7 +149,7 @@ H5Tset_strpad(hid_t type_id, H5T_str_t strpad) dt = dt->shared->parent; /*defer to parent*/ if (!H5T_IS_STRING(dt->shared)) HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for datatype class") - + /* Commit */ if(H5T_IS_FIXED_STRING(dt->shared)) dt->shared->u.atomic.u.s.pad = strpad; diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c index 081ba68..9a11e9c 100644 --- a/src/H5Tvlen.c +++ b/src/H5Tvlen.c @@ -75,7 +75,7 @@ NAME H5T_init_vlen_interface -- Initialize interface-specific information USAGE herr_t H5T_init_vlen_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -115,7 +115,7 @@ H5Tvlen_create(hid_t base_id) H5T_t *base = NULL; /*base datatype */ H5T_t *dt = NULL; /*new datatype */ hid_t ret_value; /*return value */ - + FUNC_ENTER_API(H5Tvlen_create, FAIL) H5TRACE1("i","i",base_id); @@ -158,7 +158,7 @@ H5T_vlen_create(const H5T_t *base) { H5T_t *dt = NULL; /*new VL datatype */ H5T_t *ret_value; /*return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5T_vlen_create) /* Check args */ @@ -201,7 +201,7 @@ done: * * Purpose: Sets the location of a VL datatype to be either on disk or in memory * - * Return: + * Return: * One of two values on success: * TRUE - If the location of any vlen types changed * FALSE - If the location of any vlen types is the same @@ -273,7 +273,7 @@ H5T_vlen_set_loc(const H5T_t *dt, H5F_t *f, H5T_vlen_loc_t loc) /* Mark this type as being stored on disk */ dt->shared->u.vlen.loc=H5T_VLEN_DISK; - /* + /* * Size of element on disk is 4 bytes for the length, plus the size * of an address in this file, plus 4 bytes for the size of a heap * ID. Memory size is different @@ -833,7 +833,7 @@ H5T_vlen_disk_read(H5F_t *f, hid_t dxpl_id, void *_vl, void *buf, size_t UNUSED /* Skip the length of the sequence */ vl += 4; - + /* Get the heap information */ H5F_addr_decode(f,(const uint8_t **)&vl,&(hobjid.addr)); INT32DECODE(vl,hobjid.idx); @@ -884,7 +884,7 @@ H5T_vlen_disk_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t UNUSED assert(vl); assert(seq_len==0 || buf); assert(f); - + /* Free heap object for old data. */ if(bg!=NULL) { H5HG_t bg_hobjid; /* "Background" VL info sequence's ID info */ @@ -906,7 +906,7 @@ H5T_vlen_disk_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t UNUSED /* Set the length of the sequence */ UINT32ENCODE(vl, seq_len); - + /* Write the VL information to disk (allocates space also) */ len=(seq_len*base_size); if(H5HG_insert(f,dxpl_id,len,buf,&hobjid)<0) @@ -948,7 +948,7 @@ H5T_vlen_disk_setnull(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg) /* check parameters */ assert(f); assert(vl); - + /* Free heap object for old data. */ if(bg!=NULL) { H5HG_t bg_hobjid; /* "Background" VL info sequence's ID info */ @@ -970,7 +970,7 @@ H5T_vlen_disk_setnull(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg) /* Set the length of the sequence */ UINT32ENCODE(vl, seq_len); - + /* Encode the "nil" heap pointer information */ H5F_addr_encode(f,&vl,(haddr_t)0); INT32ENCODE(vl,0); @@ -989,7 +989,7 @@ done: herr_t H5T_vlen_reclaim(elem,dt) void *elem; IN/OUT: Pointer to the dataset element H5T_t *dt; IN: Datatype of dataset element - + RETURNS SUCCEED/FAIL DESCRIPTION @@ -1001,7 +1001,7 @@ done: EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ -static herr_t +static herr_t H5T_vlen_reclaim_recurse(void *elem, const H5T_t *dt, H5MM_free_t free_func, void *free_info) { unsigned i; /* local index variable */ @@ -1101,7 +1101,7 @@ done: unsigned ndim; IN: Number of dimensions in dataspace hsize_t *point; IN: Coordinate location of element in dataspace void *op_data IN: Operator data - + RETURNS SUCCEED/FAIL DESCRIPTION @@ -1114,7 +1114,7 @@ done: REVISION LOG --------------------------------------------------------------------------*/ /* ARGSUSED */ -herr_t +herr_t H5T_vlen_reclaim(void *elem, hid_t type_id, unsigned UNUSED ndim, const hsize_t UNUSED *point, void *op_data) { H5T_vlen_alloc_info_t *vl_alloc_info = (H5T_vlen_alloc_info_t *)op_data; /* VL allocation info from iterator */ @@ -1147,8 +1147,8 @@ done: USAGE herr_t H5T_vlen_get_alloc_info(dxpl_id,vl_alloc_info) hid_t dxpl_id; IN: Data transfer property list to query - H5T_vlen_alloc_info_t *vl_alloc_info; IN/OUT: Pointer to VL allocation information to fill - + H5T_vlen_alloc_info_t *vl_alloc_info; IN/OUT: Pointer to VL allocation information to fill + RETURNS SUCCEED/FAIL DESCRIPTION @@ -1162,7 +1162,7 @@ done: EXAMPLES REVISION LOG --------------------------------------------------------------------------*/ -herr_t +herr_t H5T_vlen_get_alloc_info(hid_t dxpl_id, H5T_vlen_alloc_info_t **vl_alloc_info) { H5P_genplist_t *plist; /* DX property list */ @@ -1207,7 +1207,7 @@ done: H5T_t *dt; IN/OUT: Pointer to the datatype to mark H5F_t *dt; IN: Pointer to the file the datatype is in H5T_vlen_type_t loc IN: location of VL type - + RETURNS One of two values on success: TRUE - If the location of any vlen types changed @@ -1249,7 +1249,7 @@ H5T_vlen_mark(H5T_t *dt, H5F_t *f, H5T_vlen_loc_t loc) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "Unable to set VL location"); if(vlen_changed>0) ret_value=vlen_changed; - + /* Check if the field changed size */ if(old_size != dt->shared->parent->shared->size) { /* Adjust the size of the array */ @@ -1263,7 +1263,7 @@ H5T_vlen_mark(H5T_t *dt, H5F_t *f, H5T_vlen_loc_t loc) if(dt->shared->force_conv) { /* Sort the fields based on offsets */ H5T_sort_value(dt,NULL); - + for (i=0; ishared->u.compnd.nmembs; i++) { /* Apply the accumulated size change to the offset of the field */ dt->shared->u.compnd.memb[i].offset += accum_change; @@ -1279,7 +1279,7 @@ H5T_vlen_mark(H5T_t *dt, H5F_t *f, H5T_vlen_loc_t loc) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "Unable to set VL location"); if(vlen_changed>0) ret_value=vlen_changed; - + /* Check if the field changed size */ if(old_size != dt->shared->u.compnd.memb[i].type->shared->size) { /* Adjust the size of the member */ diff --git a/src/H5V.c b/src/H5V.c index 7b2c33f..4e46573 100644 --- a/src/H5V.c +++ b/src/H5V.c @@ -438,7 +438,7 @@ done: * will be filled with VAL begins at byte offset OFFSET[] from * the minimum corner of BUF and continues for SIZE[] bytes in * each dimension. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Robb Matzke @@ -545,7 +545,7 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size, hsize_t dst_start, src_start; /*offset to start at */ hsize_t elmt_size = 1; /*element size in bytes */ herr_t ret_value; /*return status */ -#ifndef NDEBUG +#ifndef NDEBUG unsigned u; #endif @@ -1190,7 +1190,7 @@ H5V_array_calc(hsize_t offset, unsigned n, const hsize_t *total_size, hsize_t *c * a "chunk index" for the chunk that the coordinate offset is * located in. * - * The chunk index starts at 0 and increases according to the + * The chunk index starts at 0 and increases according to the * fastest changing dimension, then the next fastest, etc. * * For example, with a 3x5 chunk size and 6 chunks in the fastest diff --git a/src/H5Z.c b/src/H5Z.c index 3bcb2d3..cc653b8 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -167,7 +167,7 @@ H5Z_term_interface (void) /* Print the statistics */ HDfprintf (H5DEBUG(Z), " %s%-15s %10Hd %10Hd %8.2f %8.2f %8.2f " - "%10s\n", dir?"<":">", comment, + "%10s\n", dir?"<":">", comment, H5Z_stat_table_g[i].stats[dir].total, H5Z_stat_table_g[i].stats[dir].errors, H5Z_stat_table_g[i].stats[dir].timer.utime, @@ -304,7 +304,7 @@ H5Z_register (const H5Z_class_t *cls) { size_t i; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5Z_register, FAIL) assert (cls); @@ -411,7 +411,7 @@ H5Z_unregister (H5Z_filter_t id) { size_t i; /* Local index variable */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5Z_unregister,FAIL) assert (id>=0 && id<=H5Z_FILTER_MAX); @@ -420,7 +420,7 @@ H5Z_unregister (H5Z_filter_t id) for (i=0; i=H5Z_table_used_g) HGOTO_ERROR(H5E_PLINE, H5E_NOTFOUND, FAIL, "filter is not registered") @@ -471,7 +471,7 @@ H5Zfilter_avail(H5Z_filter_t id) ret_value=TRUE; break; } /* end if */ - + done: FUNC_LEAVE_API(ret_value) } /* end H5Zfilter_avail() */ @@ -501,7 +501,7 @@ static herr_t H5Z_prelude_callback(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_type) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5Z_prelude_callback) assert (H5I_GENPROP_LST==H5I_get_type(dcpl_id)); @@ -554,7 +554,7 @@ H5Z_prelude_callback(hid_t dcpl_id, hid_t type_id, H5Z_prelude_type_t prelude_ty (void)H5S_close(space); HGOTO_ERROR (H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register dataspace ID") } /* end if */ - + /* Iterate over filters */ for (u=0; unalloc = x.nalloc; pline->filter = x.filter; } - + /* Add the new filter to the pipeline */ idx = pline->nused; pline->filter[idx].id = filter; @@ -941,7 +941,7 @@ done: herr_t H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned *filter_mask/*in,out*/, H5Z_EDC_t edc_read, - H5Z_cb_t cb_struct, size_t *nbytes/*in,out*/, + H5Z_cb_t cb_struct, size_t *nbytes/*in,out*/, size_t *buf_size/*in,out*/, void **buf/*in,out*/) { size_t i, idx, new_nbytes; @@ -954,9 +954,9 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, unsigned failed = 0; unsigned tmp_flags; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5Z_pipeline, FAIL) - + assert(0==(flags & ~((unsigned)H5Z_FLAG_INVMASK))); assert(filter_mask); assert(nbytes && *nbytes>0); @@ -967,7 +967,7 @@ H5Z_pipeline(const H5O_pline_t *pline, unsigned flags, if (pline && (flags & H5Z_FLAG_REVERSE)) { /* Read */ for (i=pline->nused; i>0; --i) { idx = i-1; - + if (*filter_mask & ((unsigned)1<filter[idx].flags); tmp_flags|=(edc_read== H5Z_DISABLE_EDC) ? H5Z_FLAG_SKIP_EDC : 0; - new_nbytes = (fclass->filter)(tmp_flags, pline->filter[idx].cd_nelmts, + new_nbytes = (fclass->filter)(tmp_flags, pline->filter[idx].cd_nelmts, pline->filter[idx].cd_values, *nbytes, buf_size, buf); #ifdef H5Z_DEBUG @@ -1073,7 +1073,7 @@ H5Z_filter_info(const H5O_pline_t *pline, H5Z_filter_t filter) { size_t idx; /* Index of filter in pipeline */ H5Z_filter_info_t *ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5Z_filter_info, NULL) assert(pline); @@ -1134,7 +1134,7 @@ H5Z_all_filters_avail(const H5O_pline_t *pline) if(j==H5Z_table_used_g) HGOTO_DONE(FALSE) } /* end for */ - + done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z_all_filters_avail() */ @@ -1144,8 +1144,8 @@ done: /*------------------------------------------------------------------------- * Function: H5Z_delete * - * Purpose: Delete filter FILTER from pipeline PLINE; - * deletes all filters if FILTER is H5Z_FILTER_NONE + * Purpose: Delete filter FILTER from pipeline PLINE; + * deletes all filters if FILTER is H5Z_FILTER_NONE * * Return: Non-negative on success/Negative on failure * @@ -1210,7 +1210,7 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) done: FUNC_LEAVE_NOAPI(ret_value) -} +} /*------------------------------------------------------------------------- * Function: H5Zget_filter_info @@ -1246,8 +1246,8 @@ herr_t H5Zget_filter_info(H5Z_filter_t filter, unsigned int *filter_config_flags } else *filter_config_flags = H5Z_FILTER_CONFIG_DECODE_ENABLED | H5Z_FILTER_CONFIG_ENCODE_ENABLED; - - /* Make sure the filter exists */ + + /* Make sure the filter exists */ if (H5Z_find(filter) == NULL) *filter_config_flags = 0; } diff --git a/src/H5Zdeflate.c b/src/H5Zdeflate.c index dd752ae..8a0e54e 100644 --- a/src/H5Zdeflate.c +++ b/src/H5Zdeflate.c @@ -54,7 +54,7 @@ const H5Z_class_t H5Z_DEFLATE[1] = {{ * libz * * Return: Success: Size of buffer filtered - * Failure: 0 + * Failure: 0 * * Programmer: Robb Matzke * Thursday, April 16, 1998 @@ -71,7 +71,7 @@ H5Z_filter_deflate (unsigned flags, size_t cd_nelmts, void *outbuf = NULL; /* Pointer to new buffer */ int status; /* Status from zlib operation */ size_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5Z_filter_deflate, 0) /* Check arguments */ @@ -128,7 +128,7 @@ H5Z_filter_deflate (unsigned flags, size_t cd_nelmts, } } /* end else */ } while(status==Z_OK); - + /* Free the input buffer */ H5MM_xfree(*buf); @@ -152,7 +152,7 @@ H5Z_filter_deflate (unsigned flags, size_t cd_nelmts, uLongf z_dst_nbytes = (uLongf)H5Z_DEFLATE_SIZE_ADJUST(nbytes); uLong z_src_nbytes = (uLong)nbytes; int aggression; /* Compression aggression setting */ - + /* Set the compression aggression level */ H5_ASSIGN_OVERFLOW(aggression,cd_values[0],unsigned,int); diff --git a/src/H5Zfletcher32.c b/src/H5Zfletcher32.c index 541e4af..35873a3 100644 --- a/src/H5Zfletcher32.c +++ b/src/H5Zfletcher32.c @@ -49,7 +49,7 @@ const H5Z_class_t H5Z_FLETCHER32[1] = {{ * * Purpose: Implement an Fletcher32 Checksum using 1's complement. * - * Return: Success: Fletcher32 value + * Return: Success: Fletcher32 value * * Failure: Can't fail * @@ -117,7 +117,7 @@ H5Z_filter_fletcher32_compute(void *_src, size_t len) * Purpose: Implement an I/O filter of Fletcher32 Checksum * * Return: Success: Size of buffer filtered - * Failure: 0 + * Failure: 0 * * Programmer: Raymond Lu * Jan 3, 2003 @@ -125,20 +125,20 @@ H5Z_filter_fletcher32_compute(void *_src, size_t len) * Modifications: * Raymond Lu * July 8, 2005 - * There was a bug in the calculating code of the Fletcher32 - * checksum in the library before v1.6.3. The checksum + * There was a bug in the calculating code of the Fletcher32 + * checksum in the library before v1.6.3. The checksum * value wasn't consistent between big-endian and little-endian - * systems. This bug was fixed in Release 1.6.3. However, - * after fixing the bug, the checksum value is no longer the - * same as before on little-endian system. We'll check both - * the correct checksum and the wrong checksum to be consistent - * with Release 1.6.2 and before. + * systems. This bug was fixed in Release 1.6.3. However, + * after fixing the bug, the checksum value is no longer the + * same as before on little-endian system. We'll check both + * the correct checksum and the wrong checksum to be consistent + * with Release 1.6.2 and before. * *------------------------------------------------------------------------- */ /* ARGSUSED */ static size_t -H5Z_filter_fletcher32 (unsigned flags, size_t UNUSED cd_nelmts, const unsigned UNUSED cd_values[], +H5Z_filter_fletcher32 (unsigned flags, size_t UNUSED cd_nelmts, const unsigned UNUSED cd_values[], size_t nbytes, size_t *buf_size, void **buf) { void *outbuf = NULL; /* Pointer to new buffer */ @@ -148,11 +148,11 @@ H5Z_filter_fletcher32 (unsigned flags, size_t UNUSED cd_nelmts, const unsigned U uint8_t c[4]; uint8_t tmp; size_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5Z_filter_fletcher32, 0) assert(sizeof(uint32_t)>=4); - + if (flags & H5Z_FLAG_REVERSE) { /* Read */ /* Do checksum if it's enabled for read; otherwise skip it * to save performance. */ @@ -169,20 +169,20 @@ H5Z_filter_fletcher32 (unsigned flags, size_t UNUSED cd_nelmts, const unsigned U /* Compute checksum (can't fail) */ fletcher = H5Z_filter_fletcher32_compute(src,src_nbytes); - /* The reversed checksum. There was a bug in the calculating code of - * the Fletcher32 checksum in the library before v1.6.3. The checksum - * value wasn't consistent between big-endian and little-endian systems. - * This bug was fixed in Release 1.6.3. However, after fixing the bug, - * the checksum value is no longer the same as before on little-endian - * system. We'll check both the correct checksum and the wrong - * checksum to be consistent with Release 1.6.2 and before. - */ + /* The reversed checksum. There was a bug in the calculating code of + * the Fletcher32 checksum in the library before v1.6.3. The checksum + * value wasn't consistent between big-endian and little-endian systems. + * This bug was fixed in Release 1.6.3. However, after fixing the bug, + * the checksum value is no longer the same as before on little-endian + * system. We'll check both the correct checksum and the wrong + * checksum to be consistent with Release 1.6.2 and before. + */ HDmemcpy(c, &fletcher, 4); tmp = c[1]; c[1] = c[0]; c[0] = tmp; - + tmp = c[3]; c[3] = c[2]; c[2] = tmp; @@ -193,7 +193,7 @@ H5Z_filter_fletcher32 (unsigned flags, size_t UNUSED cd_nelmts, const unsigned U if(stored_fletcher != fletcher && stored_fletcher != reversed_fletcher) HGOTO_ERROR(H5E_STORAGE, H5E_READERROR, 0, "data error detected by Fletcher32 checksum") } - + /* Set return values */ /* (Re-use the input buffer, just note that the size is smaller by the size of the checksum) */ ret_value = nbytes-FLETCHER_LEN; @@ -202,10 +202,10 @@ H5Z_filter_fletcher32 (unsigned flags, size_t UNUSED cd_nelmts, const unsigned U /* Compute checksum (can't fail) */ fletcher = H5Z_filter_fletcher32_compute(src,nbytes); - + if (NULL==(dst=outbuf=H5MM_malloc(nbytes+FLETCHER_LEN))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "unable to allocate Fletcher32 checksum destination buffer") - + /* Copy raw data */ HDmemcpy((void*)dst, (void*)(*buf), nbytes); @@ -220,7 +220,7 @@ H5Z_filter_fletcher32 (unsigned flags, size_t UNUSED cd_nelmts, const unsigned U *buf_size = nbytes + FLETCHER_LEN; *buf = outbuf; outbuf = NULL; - ret_value = *buf_size; + ret_value = *buf_size; } done: diff --git a/src/H5Zprivate.h b/src/H5Zprivate.h index 5ee02ec..f4530f2 100644 --- a/src/H5Zprivate.h +++ b/src/H5Zprivate.h @@ -51,7 +51,7 @@ H5_DLL herr_t H5Z_modify(const struct H5O_pline_t *pline, H5Z_filter_t filter, H5_DLL herr_t H5Z_pipeline(const struct H5O_pline_t *pline, unsigned flags, unsigned *filter_mask/*in,out*/, H5Z_EDC_t edc_read, H5Z_cb_t cb_struct, - size_t *nbytes/*in,out*/, size_t *buf_size/*in,out*/, + size_t *nbytes/*in,out*/, size_t *buf_size/*in,out*/, void **buf/*in,out*/); H5_DLL H5Z_class_t *H5Z_find(H5Z_filter_t id); H5_DLL herr_t H5Z_can_apply(hid_t dcpl_id, hid_t type_id); diff --git a/src/H5Zpublic.h b/src/H5Zpublic.h index f8189b2..7443a90 100644 --- a/src/H5Zpublic.h +++ b/src/H5Zpublic.h @@ -53,7 +53,7 @@ typedef int H5Z_filter_t; * include directly due to the duplication of various symbols with the zlib.h * header file] */ #define H5_SZIP_ALLOW_K13_OPTION_MASK 1 -#define H5_SZIP_CHIP_OPTION_MASK 2 +#define H5_SZIP_CHIP_OPTION_MASK 2 #define H5_SZIP_EC_OPTION_MASK 4 #define H5_SZIP_NN_OPTION_MASK 32 #define H5_SZIP_MAX_PIXELS_PER_BLOCK 32 @@ -64,7 +64,7 @@ typedef enum H5Z_EDC_t { H5Z_DISABLE_EDC = 0, H5Z_ENABLE_EDC = 1, H5Z_NO_EDC = 2 /* must be the last */ -} H5Z_EDC_t; +} H5Z_EDC_t; /* Bit flags for H5Zget_filter_info */ #define H5Z_FILTER_CONFIG_ENCODE_ENABLED (0x0001) @@ -97,18 +97,18 @@ extern "C" { * in the dataset creation property list are called * with the dataset's dataset creation property list, the dataset's datatype and * a dataspace describing a chunk (for chunked dataset storage). - * + * * The "can_apply" callback must determine if the combination of the dataset * creation property list setting, the datatype and the dataspace represent a * valid combination to apply this filter to. For example, some cases of * invalid combinations may involve the filter not operating correctly on * certain datatypes (or certain datatype sizes), or certain sizes of the chunk * dataspace. - * + * * The "can_apply" callback can be the NULL pointer, in which case, the library * will assume that it can apply to any combination of dataset creation * property list values, datatypes and dataspaces. - * + * * The "can_apply" callback returns positive a valid combination, zero for an * invalid combination and negative for an error. */ @@ -122,16 +122,16 @@ typedef herr_t (*H5Z_can_apply_func_t)(hid_t dcpl_id, hid_t type_id, hid_t space * list passed in to H5Dcreate) and the datatype ID passed in to H5Dcreate * (which is not copied and should not be modified) and a dataspace describing * the chunk (for chunked dataset storage) (which should also not be modified). - * + * * The "set_local" callback must set any parameters that are specific to this * dataset, based on the combination of the dataset creation property list * values, the datatype and the dataspace. For example, some filters perform * different actions based on different datatypes (or datatype sizes) or * different number of dimensions or dataspace sizes. - * + * * The "set_local" callback can be the NULL pointer, in which case, the library * will assume that there are no dataset-specific settings for this filter. - * + * * The "set_local" callback must return non-negative on success and negative * for an error. */ diff --git a/src/H5Zshuffle.c b/src/H5Zshuffle.c index 5556283..baee603 100644 --- a/src/H5Zshuffle.c +++ b/src/H5Zshuffle.c @@ -99,7 +99,7 @@ done: * each other and putting them together will increase compression. * * Return: Success: Size of buffer filtered - * Failure: 0 + * Failure: 0 * * Programmer: Kent Yang * Wednesday, November 13, 2002 @@ -111,7 +111,7 @@ done: *------------------------------------------------------------------------- */ static size_t -H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], +H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf) { void *dest = NULL; /* Buffer to deposit [un]shuffled bytes into */ @@ -195,7 +195,7 @@ H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], #undef DUFF_GUTS } /* end for */ - /* Add leftover to the end of data */ + /* Add leftover to the end of data */ if(leftover>0) { /* Adjust back to end of shuffled bytes */ _dest -= (bytesoftype - 1); /*lint !e794 _dest is initialized */ @@ -250,7 +250,7 @@ H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], #undef DUFF_GUTS } /* end for */ - /* Add leftover to the end of data */ + /* Add leftover to the end of data */ if(leftover>0) { /* Adjust back to end of shuffled bytes */ _src -= (bytesoftype - 1); /*lint !e794 _src is initialized */ diff --git a/src/H5Zszip.c b/src/H5Zszip.c index 662429b..878e5f8 100644 --- a/src/H5Zszip.c +++ b/src/H5Zszip.c @@ -128,7 +128,7 @@ done: * of any shape and size with only one restriction: the number * of elements in the chunk has to be not less than number * of elements (pixels) in the block (cd_values[H5Z_SZIP_PARM_PPB] - * parameter). + * parameter). * Elena Pourmal, July 20, 2004 * *------------------------------------------------------------------------- @@ -187,8 +187,8 @@ H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) /* (Use the chunk's fastest changing dimension size) */ assert(ndims>0); scanline=dims[ndims-1]; - - /* Adjust scanline if it is smaller than number of pixels per block or + + /* Adjust scanline if it is smaller than number of pixels per block or if it is bigger than maximum pixels per scanline, or there are more than SZ_MAX_BLOCKS_PER_SCANLINE blocks per scanline */ @@ -196,12 +196,12 @@ H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) if(scanline0 DETECT_I(uint_fast64_t, UINT_FAST64, d_g[nd_g]); nd_g++; #endif - + #if H5_SIZEOF_LONG_LONG>0 DETECT_I(long_long, LLONG, d_g[nd_g]); nd_g++; DETECT_I(unsigned long_long, ULLONG, d_g[nd_g]); nd_g++; @@ -1437,7 +1437,7 @@ detect_alignments(void) int main(void) { - + #if defined(H5_HAVE_SETSYSINFO) && defined(SSI_NVPAIRS) #if defined(UAC_NOPRINT) && defined(UAC_SIGBUS) /* @@ -1453,7 +1453,7 @@ main(void) } #endif #endif - + print_header(); /* C89 integer types */ @@ -1470,8 +1470,8 @@ main(void) /* Detect structure alignment */ detect_alignments(); - + print_results (nd_g, d_g, na_g, m_g); - + return 0; } diff --git a/src/H5private.h b/src/H5private.h index 2b0e9e7..f7c2050 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -175,11 +175,11 @@ #endif /* H5_HAVE_DMALLOC_H */ /* - * NT doesn't define SIGBUS, but since NT only runs on processors - * that do not have alignment constraints a SIGBUS would never be - * raised, so we just replace it with SIGILL (which also should - * never be raised by the hdf5 library). - */ + * NT doesn't define SIGBUS, but since NT only runs on processors + * that do not have alignment constraints a SIGBUS would never be + * raised, so we just replace it with SIGILL (which also should + * never be raised by the hdf5 library). + */ #ifndef SIGBUS # define SIGBUS SIGILL #endif @@ -669,7 +669,7 @@ typedef off_t h5_stat_size_t; #define HDlog10(X) log10(X) #define HDlongjmp(J,N) longjmp(J,N) #ifdef WIN32 - #ifdef __MWERKS__ + #ifdef __MWERKS__ #define HDlseek(F,O,W) lseek(F,O,W) #else /*MSVS */ #define HDlseek(F,O,W) _lseeki64(F,O,W) @@ -866,7 +866,7 @@ H5_DLL int64_t HDstrtoll (const char *s, const char **rest, int base); #define HDstrdup(S) _strdup(S) #else /* WIN32 */ -#if !defined strdup && !defined H5_HAVE_STRDUP +#if !defined strdup && !defined H5_HAVE_STRDUP extern char *strdup(const char *s); #endif @@ -941,7 +941,7 @@ extern H5_debug_t H5_debug_g; * Programmer: Robb Matzke * * Modifications: - *------------------------------------------------------------------------- + *------------------------------------------------------------------------- */ #ifdef H5_DEBUG_API #define H5TRACE_DECL const char *RTYPE=NULL; \ @@ -1227,10 +1227,10 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); * initialized. * - functions which are called during library shutdown, since we don't * want to re-initialize the library. - * + * * This macro is used for functions which fit the above categories _and_ * also don't use the 'FUNC' variable (i.e. don't push errors on the error stack) - * + * */ #define FUNC_ENTER_NOAPI_NOINIT_NOFUNC(func_name) { \ FUNC_ENTER_COMMON_NOFUNC(func_name,!H5_IS_API(#func_name)); \ @@ -1241,10 +1241,10 @@ static herr_t H5_INTERFACE_INIT_FUNC(void); * Use this macro for non-API functions which fall into these categories: * - functions which shouldn't push their name on the function stack * (so far, just the H5FS routines themselves) - * + * * This macro is used for functions which fit the above categories _and_ * also don't use the 'FUNC' variable (i.e. don't push errors on the error stack) - * + * */ #define FUNC_ENTER_NOAPI_NOFUNC_NOFS(func_name) { \ FUNC_ENTER_COMMON_NOFUNC(func_name,!H5_IS_API(#func_name)); \ diff --git a/src/H5public.h b/src/H5public.h index 3c7f8de..e57e7f5 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -43,8 +43,8 @@ # include /*for C9x types */ #endif #endif -#ifdef H5_HAVE_INTTYPES_H -# include /* For uint64_t on some platforms */ +#ifdef H5_HAVE_INTTYPES_H +# include /* For uint64_t on some platforms */ #endif #ifdef H5_HAVE_STDDEF_H # include @@ -203,7 +203,7 @@ typedef ssize_t hssize_t; # define H5_PRINTF_HADDR_FMT "%lu" #elif H5_SIZEOF_HADDR_T ==H5_SIZEOF_LONG_LONG # define H5_PRINTF_HADDR_FMT "%"H5_PRINTF_LL_WIDTH"u" -#elif H5_SIZEOF_HADDR_T ==H5_SIZEOF___INT64 +#elif H5_SIZEOF_HADDR_T ==H5_SIZEOF___INT64 # define H5_PRINTF_HADDR_FMT "%"H5_PRINTF_LL_WIDTH"u" #else # error "nothing appropriate for H5_PRINTF_HADDR_FMT" diff --git a/test/big.c b/test/big.c index 537f42e..cab1f55 100644 --- a/test/big.c +++ b/test/big.c @@ -78,16 +78,16 @@ randll(hsize_t limit, int current_index) for(i = 0; i < current_index; i++) { if((acc >= values_used[i]) && (acc < values_used[i]+WRT_SIZE)) - overlap = 1; + overlap = 1; if((acc+WRT_SIZE >= values_used[i]) && (acc+WRT_SIZE < values_used[i ]+WRT_SIZE)) - overlap = 1; + overlap = 1; } tries++; } values_used[current_index]=acc; - + return acc; } @@ -115,7 +115,7 @@ is_sparse(void) { int fd; h5_stat_t sb; - + if ((fd=HDopen("x.h5", O_RDWR|O_TRUNC|O_CREAT, 0666))<0) return 0; if (HDlseek(fd, (off_t)(1024*1024), SEEK_SET)!=1024*1024) return 0; if (5!=HDwrite(fd, "hello", 5)) return 0; @@ -185,7 +185,7 @@ enough_room(hid_t fapl) ret_value=0; HDunlink(name); } - + return ret_value; } @@ -223,7 +223,7 @@ writer (hid_t fapl, int wrt_n) hid_t dcpl; TESTING("large dataset write"); - + /* * We might be on a machine that has 32-bit files, so create an HDF5 file * which is a family of files. Each member of the family will be 1GB @@ -232,15 +232,15 @@ writer (hid_t fapl, int wrt_n) if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) { goto error; } - + /* Create simple data spaces according to the size specified above. */ if ((space1 = H5Screate_simple (4, size1, size1))<0 || (space2 = H5Screate_simple (1, size2, size2))<0) { goto error; } - + /* Create the datasets */ -/* +/* * The fix below is provided for bug#921 * H5Dcreate with H5P_DEFAULT creation properties * will create a set of solid 1GB files; test will crash if quotas are enforced @@ -260,7 +260,7 @@ writer (hid_t fapl, int wrt_n) (d2=H5Dcreate (file, "d2", H5T_NATIVE_INT, space2, dcpl))<0) { goto error; } - + /* Write some things to them randomly */ hs_size[0] = WRT_SIZE; @@ -276,7 +276,7 @@ writer (hid_t fapl, int wrt_n) if (H5Dwrite (d2, H5T_NATIVE_INT, mem_space, space2, H5P_DEFAULT, buf)<0) goto error; } - + if (H5Dclose (d1)<0) goto error; if (H5Dclose (d2)<0) goto error; if (H5Sclose (mem_space)<0) goto error; @@ -434,11 +434,11 @@ usage(void) /*------------------------------------------------------------------------- * Function: main * - * Purpose: + * Purpose: * - * Return: Success: + * Return: Success: * - * Failure: + * Failure: * * Programmer: Robb Matzke * Friday, April 10, 1998 @@ -459,7 +459,7 @@ main (int ac, char **av) hsize_t family_size_def; /* default family file size */ double family_size_def_dbl; /* default family file size */ int cflag=1; /* check file system before test */ - + /* parameters setup */ family_size_def = FAMILY_SIZE; @@ -541,7 +541,7 @@ main (int ac, char **av) goto quit; } } - + /* Do the test */ if (writer(fapl, WRT_N)) goto error; if (reader(fapl)) goto error; diff --git a/test/bittests.c b/test/bittests.c index 6e5f7da..a329bd5 100644 --- a/test/bittests.c +++ b/test/bittests.c @@ -50,7 +50,7 @@ test_find (void) uint8_t v1[8]; int i; ssize_t n; - + TESTING("bit search operations"); /* The zero length buffer */ @@ -67,7 +67,7 @@ test_find (void) puts (" Zero length test failed (msb)!"); goto failed; } - + /* The zero buffer */ memset (v1, 0, sizeof v1); @@ -101,7 +101,7 @@ test_find (void) goto failed; } } - + /* The one buffer */ memset (v1, 0xff, sizeof v1); n = H5T_bit_find (v1, 0, 8*sizeof(v1), H5T_BIT_LSB, FALSE); @@ -134,7 +134,7 @@ test_find (void) goto failed; } } - + PASSED(); return 0; @@ -170,7 +170,7 @@ test_copy (void) size_t s_offset, d_offset, size; int i, j; ssize_t n; - + TESTING("bit copy operations"); for (i=0; itype == PICO_ENTRY_TYPE ); return(clear(f, thing, dest)); -} +} -herr_t +herr_t nano_clear(H5F_t * f, void * thing, hbool_t dest) { HDassert ( ((test_entry_t *)thing)->type == NANO_ENTRY_TYPE ); return(clear(f, thing, dest)); -} +} -herr_t +herr_t micro_clear(H5F_t * f, void * thing, hbool_t dest) { HDassert ( ((test_entry_t *)thing)->type == MICRO_ENTRY_TYPE ); return(clear(f, thing, dest)); -} +} -herr_t +herr_t tiny_clear(H5F_t * f, void * thing, hbool_t dest) { HDassert ( ((test_entry_t *)thing)->type == TINY_ENTRY_TYPE ); return(clear(f, thing, dest)); -} +} -herr_t +herr_t small_clear(H5F_t * f, void * thing, hbool_t dest) { HDassert ( ((test_entry_t *)thing)->type == SMALL_ENTRY_TYPE ); return(clear(f, thing, dest)); -} +} -herr_t +herr_t medium_clear(H5F_t * f, void * thing, hbool_t dest) { HDassert ( ((test_entry_t *)thing)->type == MEDIUM_ENTRY_TYPE ); return(clear(f, thing, dest)); -} +} -herr_t +herr_t large_clear(H5F_t * f, void * thing, hbool_t dest) { HDassert ( ((test_entry_t *)thing)->type == LARGE_ENTRY_TYPE ); return(clear(f, thing, dest)); -} +} -herr_t +herr_t huge_clear(H5F_t * f, void * thing, hbool_t dest) { HDassert ( ((test_entry_t *)thing)->type == HUGE_ENTRY_TYPE ); return(clear(f, thing, dest)); -} +} -herr_t +herr_t monster_clear(H5F_t * f, void * thing, hbool_t dest) { HDassert ( ((test_entry_t *)thing)->type == MONSTER_ENTRY_TYPE ); return(clear(f, thing, dest)); -} +} /*------------------------------------------------------------------------- * Function: dest & friends * - * Purpose: Destroy the entry. The helper functions verify that the + * Purpose: Destroy the entry. The helper functions verify that the * correct version of dest is being called, and then call * dest proper. * @@ -987,7 +987,7 @@ monster_clear(H5F_t * f, void * thing, hbool_t dest) *------------------------------------------------------------------------- */ -static herr_t +static herr_t destroy(H5F_t UNUSED * f, void * thing) { @@ -1014,75 +1014,75 @@ destroy(H5F_t UNUSED * f, } /* dest() */ -herr_t +herr_t pico_dest(H5F_t * f, void * thing) { HDassert ( ((test_entry_t *)thing)->type == PICO_ENTRY_TYPE ); return(destroy(f, thing)); -} +} -herr_t +herr_t nano_dest(H5F_t * f, void * thing) { HDassert ( ((test_entry_t *)thing)->type == NANO_ENTRY_TYPE ); return(destroy(f, thing)); -} +} -herr_t +herr_t micro_dest(H5F_t * f, void * thing) { HDassert ( ((test_entry_t *)thing)->type == MICRO_ENTRY_TYPE ); return(destroy(f, thing)); -} +} -herr_t +herr_t tiny_dest(H5F_t * f, void * thing) { HDassert ( ((test_entry_t *)thing)->type == TINY_ENTRY_TYPE ); return(destroy(f, thing)); -} +} -herr_t +herr_t small_dest(H5F_t * f, void * thing) { HDassert ( ((test_entry_t *)thing)->type == SMALL_ENTRY_TYPE ); return(destroy(f, thing)); -} +} -herr_t +herr_t medium_dest(H5F_t * f, void * thing) { HDassert ( ((test_entry_t *)thing)->type == MEDIUM_ENTRY_TYPE ); return(destroy(f, thing)); -} +} -herr_t +herr_t large_dest(H5F_t * f, void * thing) { HDassert ( ((test_entry_t *)thing)->type == LARGE_ENTRY_TYPE ); return(destroy(f, thing)); -} +} -herr_t +herr_t huge_dest(H5F_t * f, void * thing) { HDassert ( ((test_entry_t *)thing)->type == HUGE_ENTRY_TYPE ); return(destroy(f, thing)); -} +} -herr_t +herr_t monster_dest(H5F_t * f, void * thing) { HDassert ( ((test_entry_t *)thing)->type == MONSTER_ENTRY_TYPE ); return(destroy(f, thing)); -} +} /*------------------------------------------------------------------------- * Function: flush & friends * - * Purpose: flush the entry and mark it as clean. The helper functions - * verify that the correct version of flush is being called, + * Purpose: flush the entry and mark it as clean. The helper functions + * verify that the correct version of flush is being called, * and then call flush proper. * * Return: SUCCEED @@ -1095,7 +1095,7 @@ monster_dest(H5F_t * f, void * thing) *------------------------------------------------------------------------- */ -static herr_t +static herr_t flush(H5F_t *f, hid_t UNUSED dxpl_id, hbool_t dest, @@ -1142,74 +1142,74 @@ flush(H5F_t *f, } /* flush() */ -herr_t +herr_t pico_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, void *thing) { HDassert ( ((test_entry_t *)thing)->type == PICO_ENTRY_TYPE ); return(flush(f, dxpl_id, dest, addr, thing)); -} +} -herr_t +herr_t nano_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, void *thing) { HDassert ( ((test_entry_t *)thing)->type == NANO_ENTRY_TYPE ); return(flush(f, dxpl_id, dest, addr, thing)); -} +} -herr_t +herr_t micro_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, void *thing) { HDassert ( ((test_entry_t *)thing)->type == MICRO_ENTRY_TYPE ); return(flush(f, dxpl_id, dest, addr, thing)); -} +} -herr_t +herr_t tiny_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, void *thing) { HDassert ( ((test_entry_t *)thing)->type == TINY_ENTRY_TYPE ); return(flush(f, dxpl_id, dest, addr, thing)); -} +} -herr_t +herr_t small_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, void *thing) { HDassert ( ((test_entry_t *)thing)->type == SMALL_ENTRY_TYPE ); return(flush(f, dxpl_id, dest, addr, thing)); -} +} -herr_t +herr_t medium_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, void *thing) { HDassert ( ((test_entry_t *)thing)->type == MEDIUM_ENTRY_TYPE ); return(flush(f, dxpl_id, dest, addr, thing)); -} +} -herr_t +herr_t large_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, void *thing) { HDassert ( ((test_entry_t *)thing)->type == LARGE_ENTRY_TYPE ); return(flush(f, dxpl_id, dest, addr, thing)); -} +} -herr_t +herr_t huge_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, void *thing) { HDassert ( ((test_entry_t *)thing)->type == HUGE_ENTRY_TYPE ); return(flush(f, dxpl_id, dest, addr, thing)); -} +} -herr_t +herr_t monster_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, void *thing) { HDassert ( ((test_entry_t *)thing)->type == MONSTER_ENTRY_TYPE ); return(flush(f, dxpl_id, dest, addr, thing)); -} +} /*------------------------------------------------------------------------- * Function: load & friends * - * Purpose: "load" the requested entry and mark it as clean. The + * Purpose: "load" the requested entry and mark it as clean. The * helper functions verify that the correct version of load * is being called, and then call load proper. * @@ -1258,75 +1258,75 @@ load(H5F_t UNUSED *f, } /* load() */ -void * -pico_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, +void * +pico_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *udata1, void *udata2) { return(load(f, dxpl_id, addr, udata1, udata2)); -} +} void * -nano_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, +nano_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *udata1, void *udata2) { return(load(f, dxpl_id, addr, udata1, udata2)); -} +} void * -micro_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, +micro_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *udata1, void *udata2) { return(load(f, dxpl_id, addr, udata1, udata2)); -} +} void * -tiny_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, +tiny_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *udata1, void *udata2) { return(load(f, dxpl_id, addr, udata1, udata2)); -} +} void * -small_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, +small_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *udata1, void *udata2) { return(load(f, dxpl_id, addr, udata1, udata2)); -} +} void * -medium_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, +medium_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *udata1, void *udata2) { return(load(f, dxpl_id, addr, udata1, udata2)); -} +} void * -large_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, +large_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *udata1, void *udata2) { return(load(f, dxpl_id, addr, udata1, udata2)); -} +} void * -huge_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, +huge_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *udata1, void *udata2) { return(load(f, dxpl_id, addr, udata1, udata2)); -} +} void * -monster_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, +monster_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *udata1, void *udata2) { return(load(f, dxpl_id, addr, udata1, udata2)); -} +} /*------------------------------------------------------------------------- * Function: size & friends * - * Purpose: Get the size of the specified entry. The helper functions - * verify that the correct version of size is being called, + * Purpose: Get the size of the specified entry. The helper functions + * verify that the correct version of size is being called, * and then call size proper. * * Return: SUCCEED @@ -1339,7 +1339,7 @@ monster_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, *------------------------------------------------------------------------- */ -static herr_t +static herr_t size(H5F_t UNUSED * f, void * thing, size_t * size_ptr) @@ -1366,68 +1366,68 @@ size(H5F_t UNUSED * f, } /* size() */ -herr_t +herr_t pico_size(H5F_t * f, void * thing, size_t * size_ptr) { HDassert ( ((test_entry_t *)thing)->type == PICO_ENTRY_TYPE ); return(size(f, thing, size_ptr)); -} +} -herr_t +herr_t nano_size(H5F_t * f, void * thing, size_t * size_ptr) { HDassert ( ((test_entry_t *)thing)->type == NANO_ENTRY_TYPE ); return(size(f, thing, size_ptr)); -} +} -herr_t +herr_t micro_size(H5F_t * f, void * thing, size_t * size_ptr) { HDassert ( ((test_entry_t *)thing)->type == MICRO_ENTRY_TYPE ); return(size(f, thing, size_ptr)); -} +} -herr_t +herr_t tiny_size(H5F_t * f, void * thing, size_t * size_ptr) { HDassert ( ((test_entry_t *)thing)->type == TINY_ENTRY_TYPE ); return(size(f, thing, size_ptr)); -} +} -herr_t +herr_t small_size(H5F_t * f, void * thing, size_t * size_ptr) { HDassert ( ((test_entry_t *)thing)->type == SMALL_ENTRY_TYPE ); return(size(f, thing, size_ptr)); -} +} -herr_t +herr_t medium_size(H5F_t * f, void * thing, size_t * size_ptr) { HDassert ( ((test_entry_t *)thing)->type == MEDIUM_ENTRY_TYPE ); return(size(f, thing, size_ptr)); -} +} -herr_t +herr_t large_size(H5F_t * f, void * thing, size_t * size_ptr) { HDassert ( ((test_entry_t *)thing)->type == LARGE_ENTRY_TYPE ); return(size(f, thing, size_ptr)); -} +} -herr_t +herr_t huge_size(H5F_t * f, void * thing, size_t * size_ptr) { HDassert ( ((test_entry_t *)thing)->type == HUGE_ENTRY_TYPE ); return(size(f, thing, size_ptr)); -} +} -herr_t +herr_t monster_size(H5F_t * f, void * thing, size_t * size_ptr) { HDassert ( ((test_entry_t *)thing)->type == MONSTER_ENTRY_TYPE ); return(size(f, thing, size_ptr)); -} +} /**************************************************************************/ @@ -1439,7 +1439,7 @@ monster_size(H5F_t * f, void * thing, size_t * size_ptr) /*------------------------------------------------------------------------- * Function: entry_in_cache * - * Purpose: Given a pointer to a cache, an entry type, and an index, + * Purpose: Given a pointer to a cache, an entry type, and an index, * determine if the entry is currently in the cache. * * Return: TRUE if the entry is in the cache, and FALSE otherwise. @@ -1603,7 +1603,7 @@ verify_clean(void) for ( j = 0; j <= max_index; j++ ) { if ( ( base_addr[j].header.is_dirty ) || ( base_addr[j].is_dirty ) ) { - + dirty_count++; } } @@ -1624,7 +1624,7 @@ verify_clean(void) /*------------------------------------------------------------------------- * Function: verify_unprotected * - * Purpose: Verify that no cache entries are marked as protected. If + * Purpose: Verify that no cache entries are marked as protected. If * any are, set pass to FALSE. * * Do nothing if pass is FALSE on entry. @@ -1660,12 +1660,12 @@ verify_unprotected(void) for ( j = 0; j <= max_index; j++ ) { - HDassert( base_addr[j].header.is_protected == + HDassert( base_addr[j].header.is_protected == base_addr[j].is_protected ); - if ( ( base_addr[j].header.is_protected ) || + if ( ( base_addr[j].header.is_protected ) || ( base_addr[j].is_protected ) ) { - + protected_count++; } } @@ -1706,7 +1706,7 @@ setup_cache(size_t max_cache_size, { H5C_t * cache_ptr = NULL; - cache_ptr = H5C_create(max_cache_size, + cache_ptr = H5C_create(max_cache_size, min_clean_size, (NUMBER_OF_ENTRY_TYPES - 1), (const char **)entry_type_names, @@ -1768,7 +1768,7 @@ takedown_cache(H5C_t * cache_ptr, /*------------------------------------------------------------------------- * Function: flush_cache() * - * Purpose: Flush the specified cache, destroying all entries if + * Purpose: Flush the specified cache, destroying all entries if requested. If requested, dump stats first. * * Return: void @@ -1797,7 +1797,7 @@ flush_cache(H5C_t * cache_ptr, if ( destroy_entries ) { - result = H5C_flush_cache(NULL, -1, -1, cache_ptr, + result = H5C_flush_cache(NULL, -1, -1, cache_ptr, H5F_FLUSH_INVALIDATE); } else { @@ -1938,7 +1938,7 @@ rename_entry(H5C_t * cache_ptr, HDassert( !(entry_ptr->is_protected) ); HDassert( !(entry_ptr->header.is_protected) ); - if ( entry_ptr->at_main_addr && !main_addr ) { + if ( entry_ptr->at_main_addr && !main_addr ) { /* rename to alt addr */ @@ -1948,7 +1948,7 @@ rename_entry(H5C_t * cache_ptr, old_addr = entry_ptr->addr; new_addr = entry_ptr->alt_addr; - } else if ( !(entry_ptr->at_main_addr) && main_addr ) { + } else if ( !(entry_ptr->at_main_addr) && main_addr ) { /* rename to main addr */ @@ -2212,7 +2212,7 @@ row_major_scan_forward(H5C_t * cache_ptr, ( ( (idx + lag - 2) % 3 ) == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag - 2)); + HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag - 2)); unprotect_entry(cache_ptr, type, idx+lag-2, NO_CHANGE, FALSE); } @@ -2222,7 +2222,7 @@ row_major_scan_forward(H5C_t * cache_ptr, ( (idx + lag - 2) <= max_indices[type] ) && ( ( (idx + lag - 2) % 3 ) == 0 ) ) { - rename_entry(cache_ptr, type, (idx + lag - 2), + rename_entry(cache_ptr, type, (idx + lag - 2), rename_to_main_addr); } @@ -2250,7 +2250,7 @@ row_major_scan_forward(H5C_t * cache_ptr, if ( ( pass ) && ( idx >= 0 ) && ( idx <= max_indices[type] ) ) { if ( verbose ) - HDfprintf(stdout, "(p, %d, %d) ", type, idx); + HDfprintf(stdout, "(p, %d, %d) ", type, idx); protect_entry(cache_ptr, type, idx); } @@ -2332,11 +2332,11 @@ row_major_scan_forward(H5C_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag)); - unprotect_entry(cache_ptr, type, idx - lag, + unprotect_entry(cache_ptr, type, idx - lag, dirty_unprotects, FALSE); } } - + if ( verbose ) HDfprintf(stdout, "\n"); @@ -2359,7 +2359,7 @@ row_major_scan_forward(H5C_t * cache_ptr, * Function: row_major_scan_backward() * * Purpose: Do a sequence of inserts, protects, unprotects, renames, - * destroys while scanning backwards through the set of + * destroys while scanning backwards through the set of * entries. If pass is false on entry, do nothing. * * Return: void @@ -2387,7 +2387,7 @@ row_major_scan_backward(H5C_t * cache_ptr, int dirty_destroys, int dirty_unprotects) { - const char * fcn_name = "row_major_scan_backward"; + const char * fcn_name = "row_major_scan_backward"; int32_t type; int32_t idx; @@ -2436,7 +2436,7 @@ row_major_scan_backward(H5C_t * cache_ptr, ( ( (idx - lag + 2) % 3 ) == 0 ) ) { if ( verbose ) - HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag + 2)); + HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag + 2)); unprotect_entry(cache_ptr, type, idx-lag+2, NO_CHANGE, FALSE); } @@ -2446,7 +2446,7 @@ row_major_scan_backward(H5C_t * cache_ptr, ( (idx - lag + 2) <= max_indices[type] ) && ( ( (idx - lag + 2) % 3 ) == 0 ) ) { - rename_entry(cache_ptr, type, (idx - lag + 2), + rename_entry(cache_ptr, type, (idx - lag + 2), rename_to_main_addr); } @@ -2474,7 +2474,7 @@ row_major_scan_backward(H5C_t * cache_ptr, if ( ( pass ) && ( idx >= 0 ) && ( idx <= max_indices[type] ) ) { if ( verbose ) - HDfprintf(stdout, "(p, %d, %d) ", type, idx); + HDfprintf(stdout, "(p, %d, %d) ", type, idx); protect_entry(cache_ptr, type, idx); } @@ -2555,11 +2555,11 @@ row_major_scan_backward(H5C_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag)); - unprotect_entry(cache_ptr, type, idx + lag, + unprotect_entry(cache_ptr, type, idx + lag, dirty_unprotects, FALSE); } } - + if ( verbose ) HDfprintf(stdout, "\n"); @@ -2655,10 +2655,10 @@ col_major_scan_forward(H5C_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag)); - unprotect_entry(cache_ptr, type, idx - lag, + unprotect_entry(cache_ptr, type, idx - lag, dirty_unprotects, FALSE); } - + if ( verbose ) HDfprintf(stdout, "\n"); @@ -2682,7 +2682,7 @@ col_major_scan_forward(H5C_t * cache_ptr, * Function: col_major_scan_backward() * * Purpose: Do a sequence of inserts, protects, and unprotects - * while scanning backwards through the set of + * while scanning backwards through the set of * entries. If pass is false on entry, do nothing. * * Return: void @@ -2758,10 +2758,10 @@ col_major_scan_backward(H5C_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag)); - unprotect_entry(cache_ptr, type, idx + lag, + unprotect_entry(cache_ptr, type, idx + lag, dirty_unprotects, FALSE); } - + if ( verbose ) HDfprintf(stdout, "\n"); @@ -2796,8 +2796,8 @@ col_major_scan_backward(H5C_t * cache_ptr, /*------------------------------------------------------------------------- * Function: smoke_check_1() * - * Purpose: A basic functional test, inserts, destroys, and renames in - * the mix, along with repeated protects and unprotects. + * Purpose: A basic functional test, inserts, destroys, and renames in + * the mix, along with repeated protects and unprotects. * All entries are marked as clean. * * Return: void @@ -2828,20 +2828,20 @@ smoke_check_1(void) pass = TRUE; if ( show_progress ) /* 1 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); reset_entries(); if ( show_progress ) /* 2 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); cache_ptr = setup_cache((size_t)(4 * 1024 * 1024), (size_t)(2 * 1024 * 1024)); if ( show_progress ) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); row_major_scan_forward(/* cache_ptr */ cache_ptr, @@ -2859,7 +2859,7 @@ smoke_check_1(void) /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); row_major_scan_backward(/* cache_ptr */ cache_ptr, @@ -2877,7 +2877,7 @@ smoke_check_1(void) /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); row_major_scan_forward(/* cache_ptr */ cache_ptr, @@ -2895,18 +2895,18 @@ smoke_check_1(void) /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ - flush_cache(/* cache_ptr */ cache_ptr, + flush_cache(/* cache_ptr */ cache_ptr, /* destroy_entries */ TRUE, /* dump_stats */ FALSE, /* dump_detailed_stats */ FALSE); if ( show_progress ) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); col_major_scan_forward(/* cache_ptr */ cache_ptr, @@ -2920,18 +2920,18 @@ smoke_check_1(void) /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); /* flush all entries in the cache: */ - flush_cache(/* cache_ptr */ cache_ptr, + flush_cache(/* cache_ptr */ cache_ptr, /* destroy_entries */ FALSE, /* dump_stats */ FALSE, /* dump_detailed_stats */ FALSE); if ( show_progress ) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); col_major_scan_backward(/* cache_ptr */ cache_ptr, @@ -2945,13 +2945,13 @@ smoke_check_1(void) /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 10 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); takedown_cache(cache_ptr, display_stats, TRUE); if ( show_progress ) /* 11 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); verify_clean(); @@ -2960,7 +2960,7 @@ smoke_check_1(void) if ( pass ) { PASSED(); } else { H5_FAILED(); } if ( ! pass ) - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", fcn_name, failure_mssg); } /* smoke_check_1() */ @@ -2969,9 +2969,9 @@ smoke_check_1(void) /*------------------------------------------------------------------------- * Function: smoke_check_2() * - * Purpose: A basic functional test, with inserts, destroys, and - * renames in the mix, along with some repeated protects - * and unprotects. About half the entries are marked as + * Purpose: A basic functional test, with inserts, destroys, and + * renames in the mix, along with some repeated protects + * and unprotects. About half the entries are marked as * dirty. * * Return: void @@ -3002,20 +3002,20 @@ smoke_check_2(void) pass = TRUE; if ( show_progress ) /* 1 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); reset_entries(); if ( show_progress ) /* 2 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); cache_ptr = setup_cache((size_t)(4 * 1024 * 1024), (size_t)(2 * 1024 * 1024)); if ( show_progress ) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); row_major_scan_forward(/* cache_ptr */ cache_ptr, @@ -3033,7 +3033,7 @@ smoke_check_2(void) /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); row_major_scan_backward(/* cache_ptr */ cache_ptr, @@ -3051,7 +3051,7 @@ smoke_check_2(void) /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); row_major_scan_forward(/* cache_ptr */ cache_ptr, @@ -3069,18 +3069,18 @@ smoke_check_2(void) /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ - flush_cache(/* cache_ptr */ cache_ptr, + flush_cache(/* cache_ptr */ cache_ptr, /* destroy_entries */ TRUE, /* dump_stats */ FALSE, /* dump_detailed_stats */ FALSE); if ( show_progress ) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); col_major_scan_forward(/* cache_ptr */ cache_ptr, @@ -3094,18 +3094,18 @@ smoke_check_2(void) /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); /* flush all entries in the cache: */ - flush_cache(/* cache_ptr */ cache_ptr, + flush_cache(/* cache_ptr */ cache_ptr, /* destroy_entries */ FALSE, /* dump_stats */ FALSE, /* dump_detailed_stats */ FALSE); if ( show_progress ) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); col_major_scan_backward(/* cache_ptr */ cache_ptr, @@ -3119,13 +3119,13 @@ smoke_check_2(void) /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 10 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); takedown_cache(cache_ptr, display_stats, TRUE); if ( show_progress ) /* 11 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); verify_clean(); @@ -3134,7 +3134,7 @@ smoke_check_2(void) if ( pass ) { PASSED(); } else { H5_FAILED(); } if ( ! pass ) - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", fcn_name, failure_mssg); } /* smoke_check_2() */ @@ -3143,9 +3143,9 @@ smoke_check_2(void) /*------------------------------------------------------------------------- * Function: smoke_check_3() * - * Purpose: A basic functional test on a tiny cache, with inserts, - * destroys, and renames in the mix, along with repeated - * protects and unprotects. All entries are marked as clean. + * Purpose: A basic functional test on a tiny cache, with inserts, + * destroys, and renames in the mix, along with repeated + * protects and unprotects. All entries are marked as clean. * * Return: void * @@ -3175,20 +3175,20 @@ smoke_check_3(void) pass = TRUE; if ( show_progress ) /* 1 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); reset_entries(); if ( show_progress ) /* 2 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); cache_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024)); if ( show_progress ) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); row_major_scan_forward(/* cache_ptr */ cache_ptr, @@ -3206,7 +3206,7 @@ smoke_check_3(void) /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); row_major_scan_backward(/* cache_ptr */ cache_ptr, @@ -3224,7 +3224,7 @@ smoke_check_3(void) /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); row_major_scan_forward(/* cache_ptr */ cache_ptr, @@ -3242,18 +3242,18 @@ smoke_check_3(void) /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ - flush_cache(/* cache_ptr */ cache_ptr, + flush_cache(/* cache_ptr */ cache_ptr, /* destroy_entries */ TRUE, /* dump_stats */ FALSE, /* dump_detailed_stats */ FALSE); if ( show_progress ) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); col_major_scan_forward(/* cache_ptr */ cache_ptr, @@ -3267,18 +3267,18 @@ smoke_check_3(void) /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); /* flush all entries in the cache: */ - flush_cache(/* cache_ptr */ cache_ptr, + flush_cache(/* cache_ptr */ cache_ptr, /* destroy_entries */ FALSE, /* dump_stats */ FALSE, /* dump_detailed_stats */ FALSE); if ( show_progress ) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); col_major_scan_backward(/* cache_ptr */ cache_ptr, @@ -3292,13 +3292,13 @@ smoke_check_3(void) /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 10 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); takedown_cache(cache_ptr, display_stats, TRUE); if ( show_progress ) /* 11 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); verify_clean(); @@ -3307,7 +3307,7 @@ smoke_check_3(void) if ( pass ) { PASSED(); } else { H5_FAILED(); } if ( ! pass ) - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", fcn_name, failure_mssg); } /* smoke_check_3() */ @@ -3317,8 +3317,8 @@ smoke_check_3(void) * Function: smoke_check_4() * * Purpose: A basic functional test on a tiny cache, with inserts, - * destroys, and renames in the mix, along with repeated - * protects and unprotects. About half the entries are + * destroys, and renames in the mix, along with repeated + * protects and unprotects. About half the entries are * marked as dirty. * * Return: void @@ -3349,20 +3349,20 @@ smoke_check_4(void) pass = TRUE; if ( show_progress ) /* 1 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); reset_entries(); if ( show_progress ) /* 2 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); cache_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024)); if ( show_progress ) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); row_major_scan_forward(/* cache_ptr */ cache_ptr, @@ -3380,7 +3380,7 @@ smoke_check_4(void) /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); row_major_scan_backward(/* cache_ptr */ cache_ptr, @@ -3398,7 +3398,7 @@ smoke_check_4(void) /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); row_major_scan_forward(/* cache_ptr */ cache_ptr, @@ -3416,18 +3416,18 @@ smoke_check_4(void) /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ - flush_cache(/* cache_ptr */ cache_ptr, + flush_cache(/* cache_ptr */ cache_ptr, /* destroy_entries */ TRUE, /* dump_stats */ FALSE, /* dump_detailed_stats */ FALSE); if ( show_progress ) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); col_major_scan_forward(/* cache_ptr */ cache_ptr, @@ -3441,18 +3441,18 @@ smoke_check_4(void) /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); /* flush all entries in the cache: */ - flush_cache(/* cache_ptr */ cache_ptr, + flush_cache(/* cache_ptr */ cache_ptr, /* destroy_entries */ FALSE, /* dump_stats */ FALSE, /* dump_detailed_stats */ FALSE); if ( show_progress ) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); col_major_scan_backward(/* cache_ptr */ cache_ptr, @@ -3466,13 +3466,13 @@ smoke_check_4(void) /* dirty_unprotects */ dirty_unprotects); if ( show_progress ) /* 10 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); takedown_cache(cache_ptr, display_stats, TRUE); if ( show_progress ) /* 11 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); verify_clean(); @@ -3481,7 +3481,7 @@ smoke_check_4(void) if ( pass ) { PASSED(); } else { H5_FAILED(); } if ( ! pass ) - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", fcn_name, failure_mssg); } /* smoke_check_4() */ @@ -3491,8 +3491,8 @@ smoke_check_4(void) * Function: write_permitted_check() * * Purpose: A basic test of the write permitted function. In essence, - * we load the cache up with dirty entryies, set - * write_permitted to FALSE, and then protect a bunch of + * we load the cache up with dirty entryies, set + * write_permitted to FALSE, and then protect a bunch of * entries. If there are any writes while write_permitted is * FALSE, the test will fail. * @@ -3528,20 +3528,20 @@ write_permitted_check(void) pass = TRUE; if ( show_progress ) /* 1 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); reset_entries(); if ( show_progress ) /* 2 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); cache_ptr = setup_cache((size_t)(1 * 1024 * 1024), (size_t)(0)); if ( show_progress ) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); row_major_scan_forward(/* cache_ptr */ cache_ptr, @@ -3559,7 +3559,7 @@ write_permitted_check(void) /* dirty_unprotects */ TRUE); if ( show_progress ) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); write_permitted = FALSE; @@ -3579,7 +3579,7 @@ write_permitted_check(void) /* dirty_unprotects */ NO_CHANGE); if ( show_progress ) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); write_permitted = TRUE; @@ -3599,18 +3599,18 @@ write_permitted_check(void) /* dirty_unprotects */ TRUE); if ( show_progress ) /* 6 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); /* flush and destroy all entries in the cache: */ - flush_cache(/* cache_ptr */ cache_ptr, + flush_cache(/* cache_ptr */ cache_ptr, /* destroy_entries */ TRUE, /* dump_stats */ FALSE, /* dump_detailed_stats */ FALSE); if ( show_progress ) /* 7 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); col_major_scan_forward(/* cache_ptr */ cache_ptr, @@ -3624,7 +3624,7 @@ write_permitted_check(void) /* dirty_unprotects */ TRUE); if ( show_progress ) /* 8 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); write_permitted = FALSE; @@ -3642,13 +3642,13 @@ write_permitted_check(void) write_permitted = TRUE; if ( show_progress ) /* 9 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); takedown_cache(cache_ptr, display_stats, TRUE); if ( show_progress ) /* 10 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); verify_clean(); @@ -3657,7 +3657,7 @@ write_permitted_check(void) if ( pass ) { PASSED(); } else { H5_FAILED(); } if ( ! pass ) - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", fcn_name, failure_mssg); #else /* H5C_MAINTAIN_CLEAN_AND_DIRTY_LRU_LISTS */ @@ -3735,7 +3735,7 @@ check_flush_protected_err(void) if ( pass ) { PASSED(); } else { H5_FAILED(); } if ( ! pass ) - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", fcn_name, failure_mssg); } /* check_flush_protected_err() */ @@ -3795,14 +3795,14 @@ check_destroy_protected_err(void) pass = FALSE; failure_mssg = "destroy failed after unprotect.\n"; - } + } } } if ( pass ) { PASSED(); } else { H5_FAILED(); } if ( ! pass ) - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", fcn_name, failure_mssg); } /* check_destroy_protected_err() */ @@ -3811,7 +3811,7 @@ check_destroy_protected_err(void) /*------------------------------------------------------------------------- * Function: check_duplicate_insert_err() * - * Purpose: Verify that an attempt to insert and entry that is + * Purpose: Verify that an attempt to insert and entry that is * alread in the cache will generate an error. * * Return: void @@ -3838,7 +3838,7 @@ check_duplicate_insert_err(void) pass = TRUE; /* allocate a cache, protect an entry, and then try to insert - * the entry again. This should fail. Unprotect the entry and + * the entry again. This should fail. Unprotect the entry and * destroy the cache -- should succeed. */ @@ -3856,7 +3856,7 @@ check_duplicate_insert_err(void) base_addr = entries[0]; entry_ptr = &(base_addr[0]); - result = H5C_insert_entry(NULL, -1, -1, cache_ptr, + result = H5C_insert_entry(NULL, -1, -1, cache_ptr, &(types[0]), entry_ptr->addr, (void *)entry_ptr); @@ -3877,7 +3877,7 @@ check_duplicate_insert_err(void) if ( pass ) { PASSED(); } else { H5_FAILED(); } if ( ! pass ) - HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", + HDfprintf(stdout, "%s(): failure_mssg = \"%s\".\n", fcn_name, failure_mssg); } /* check_duplicate_insert_err() */ @@ -3966,7 +3966,7 @@ check_rename_err(void) if ( pass ) { PASSED(); } else { H5_FAILED(); } if ( ! pass ) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", fcn_name, failure_mssg); } /* check_rename_err() */ @@ -4001,7 +4001,7 @@ check_double_protect_err(void) pass = TRUE; /* allocate a cache, protect an entry, and then try to protect - * the entry again. This should fail. Unprotect the entry and + * the entry again. This should fail. Unprotect the entry and * destroy the cache -- should succeed. */ @@ -4042,7 +4042,7 @@ check_double_protect_err(void) if ( pass ) { PASSED(); } else { H5_FAILED(); } if ( ! pass ) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", fcn_name, failure_mssg); } /* check_double_protect_err() */ @@ -4076,8 +4076,8 @@ check_double_unprotect_err(void) pass = TRUE; - /* allocate a cache, protect an entry, unprotect it, and then try to - * unprotect the entry again. This should fail. Destroy the cache + /* allocate a cache, protect an entry, unprotect it, and then try to + * unprotect the entry again. This should fail. Destroy the cache * -- should succeed. */ @@ -4103,7 +4103,7 @@ check_double_unprotect_err(void) if ( result > 0 ) { pass = FALSE; - failure_mssg = + failure_mssg = "attempt to unprotect an unprotected entry succeeded.\n"; } } @@ -4116,7 +4116,7 @@ check_double_unprotect_err(void) if ( pass ) { PASSED(); } else { H5_FAILED(); } if ( ! pass ) - HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", + HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", fcn_name, failure_mssg); } /* check_double_unprotect_err() */ @@ -4127,9 +4127,9 @@ check_double_unprotect_err(void) * * Purpose: Run tests on the cache code contained in H5C.c * - * Return: Success: + * Return: Success: * - * Failure: + * Failure: * * Programmer: John Mainzer * 6/24/04 diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index c258b96..993ab55 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -114,11 +114,11 @@ main (int argc, char *argv[]) /* Third dataset */ static s3_t s3[NX*NY]; hid_t s3_tid; - + /* Fourth dataset */ static s4_t s4[NX*NY]; hid_t s4_tid; - + /* Fifth dataset */ static s5_t s5[NX*NY]; hid_t s5_tid; @@ -160,14 +160,14 @@ main (int argc, char *argv[]) } H5Tunregister(H5T_PERS_DONTCARE, NULL, -1, -1, H5T_conv_struct_opt); } - + /* Create the file */ fapl = h5_fileaccess(); h5_fixname(FILENAME[0], fapl, filename, sizeof(filename)); if ((file = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) { goto error; } - + /* Create the data space */ if ((space = H5Screate_simple (2, dim, NULL))<0) goto error; @@ -180,7 +180,7 @@ main (int argc, char *argv[]) * STEP 1: Save the original dataset natively. */ TESTING("basic compound write"); - + /* Initialize the dataset */ for (i=0; ia != 8*(i*NY+j)+0 || ps1->c[0] != 8*(i*NY+j)+2 || ps1->c[1] != 8*(i*NY+j)+3 || @@ -691,7 +691,7 @@ main (int argc, char *argv[]) puts(" Write clobbered values"); goto error; } - + if (i>=f_offset[0] && i=f_offset[1] && @@ -714,7 +714,7 @@ main (int argc, char *argv[]) } PASSED(); - + /* * Release resources. */ diff --git a/test/dangle.c b/test/dangle.c index 5e6919b..c80d1a9 100644 --- a/test/dangle.c +++ b/test/dangle.c @@ -123,10 +123,10 @@ test_dangle_dataset(H5F_close_degree_t degree) /* Clean up temporary file */ HDremove(filename); - PASSED(); - return 0; - -error: + PASSED(); + return 0; + +error: return 1; } @@ -216,10 +216,10 @@ test_dangle_group(H5F_close_degree_t degree) /* Clean up temporary file */ HDremove(filename); - PASSED(); - return 0; - -error: + PASSED(); + return 0; + +error: return 1; } @@ -313,10 +313,10 @@ test_dangle_datatype(H5F_close_degree_t degree) /* Clean up temporary file */ HDremove(filename); - PASSED(); - return 0; - -error: + PASSED(); + return 0; + +error: return 1; } @@ -421,10 +421,10 @@ test_dangle_attribute(H5F_close_degree_t degree) /* Clean up temporary file */ HDremove(filename); - PASSED(); - return 0; - -error: + PASSED(); + return 0; + +error: return 1; } diff --git a/test/dsets.c b/test/dsets.c index c979b4a..1810148 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -78,7 +78,7 @@ const char *FILENAME[] = { #define DSET_COMPARE_DCPL_NAME_2 "compare_dcpl_2" #define USER_BLOCK 1024 -#define SIXTY_FOUR_KB 65536 +#define SIXTY_FOUR_KB 65536 /* Temporary filter IDs used for testing */ #define H5Z_FILTER_BOGUS 305 @@ -89,7 +89,7 @@ const char *FILENAME[] = { #define DISABLE_FLETCHER32 0 #define ENABLE_FLETCHER32 1 #define DATA_CORRUPTED 1 -#define DATA_NOT_CORRUPTED 0 +#define DATA_NOT_CORRUPTED 0 /* Parameters for the "set local" test */ #define BOGUS2_PERM_NPARMS 2 /* Number of "permanent" parameters */ @@ -130,15 +130,15 @@ int points[DSET_DIM1][DSET_DIM2], check[DSET_DIM1][DSET_DIM2]; double points_dbl[DSET_DIM1][DSET_DIM2], check_dbl[DSET_DIM1][DSET_DIM2]; /* Local prototypes for filter functions */ -static size_t filter_bogus(unsigned int flags, size_t cd_nelmts, +static size_t filter_bogus(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); #ifndef H5_WANT_H5_V1_4_COMPAT static herr_t can_apply_bogus(hid_t dcpl_id, hid_t type_id, hid_t space_id); static herr_t set_local_bogus2(hid_t dcpl_id, hid_t type_id, hid_t space_id); -static size_t filter_bogus2(unsigned int flags, size_t cd_nelmts, +static size_t filter_bogus2(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); #endif /* H5_WANT_H5_V1_4_COMPAT */ -static size_t filter_corrupt(unsigned int flags, size_t cd_nelmts, +static size_t filter_corrupt(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf); @@ -182,7 +182,7 @@ test_create(hid_t file) small_dims[1] = 8; small_space = H5Screate_simple(2, small_dims, NULL); assert(space>=0); - + /* * Create a dataset using the default dataset creation properties. We're * not sure what they are, so we won't check. @@ -212,7 +212,7 @@ test_create(hid_t file) puts(" Library allowed overwrite of existing dataset."); goto error; } - + /* * Open the dataset we created above and then close it. This is how * existing datasets are accessed. @@ -220,7 +220,7 @@ test_create(hid_t file) if (H5Fflush(file, H5F_SCOPE_GLOBAL) < 0) goto error; if ((dataset = H5Dopen(file, DSET_DEFAULT_NAME))<0) goto error; if (H5Dclose(dataset) < 0) goto error; - + /* * Try opening a non-existent dataset. This should fail since new datasets * cannot be created with this function. Temporarily turn off error @@ -269,23 +269,23 @@ test_create(hid_t file) /* Test dataset address. Should be undefined. */ if(H5Dget_offset(dataset)!=HADDR_UNDEF) goto error; - + /* * Close the chunked dataset. */ if (H5Dclose(dataset) < 0) goto error; /* - * Create a compact dataset, then close it. + * Create a compact dataset, then close it. */ create_parms = H5Pcreate(H5P_DATASET_CREATE); assert(create_parms >= 0); status = H5Pset_layout(create_parms, H5D_COMPACT); assert(status >= 0); status = H5Pset_alloc_time(create_parms, H5D_ALLOC_TIME_EARLY); - assert(status >= 0); + assert(status >= 0); - dataset = H5Dcreate(file, DSET_COMPACT_NAME, H5T_NATIVE_DOUBLE, + dataset = H5Dcreate(file, DSET_COMPACT_NAME, H5T_NATIVE_DOUBLE, small_space, create_parms); if(dataset < 0) goto error; H5Pclose(create_parms); @@ -328,11 +328,11 @@ test_simple_io(hid_t fapl) int f; haddr_t offset; int rdata[DSET_DIM1][DSET_DIM2]; - + TESTING("simple I/O"); h5_fixname(FILENAME[4], fapl, filename, sizeof filename); - + /* Initialize the dataset */ for (i = n = 0; i < DSET_DIM1; i++) for (j = 0; j < DSET_DIM2; j++) @@ -340,7 +340,7 @@ test_simple_io(hid_t fapl) if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) goto error; - + /* Create the data space */ dims[0] = DSET_DIM1; dims[1] = DSET_DIM2; @@ -362,7 +362,7 @@ test_simple_io(hid_t fapl) /* Test dataset address. Should be undefined. */ if(H5Dget_offset(dataset)!=HADDR_UNDEF) goto error; - + /* Write the data to the dataset */ if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, xfer, points)<0) goto error; @@ -395,7 +395,7 @@ test_simple_io(hid_t fapl) f = HDopen(filename, O_RDONLY, 0); HDlseek(f, (off_t)offset, SEEK_SET); HDread(f, rdata, sizeof(int)*DSET_DIM1*DSET_DIM2); - + /* Check that the values read are the same as the values written */ for (i = 0; i < DSET_DIM1; i++) { for (j = 0; j < DSET_DIM2; j++) { @@ -406,7 +406,7 @@ test_simple_io(hid_t fapl) goto error; } } - } + } HDclose(f); @@ -422,7 +422,7 @@ error: /*------------------------------------------------------------------------- * Function: test_userblock_offset * - * Purpose: Tests H5Dget_offset when user block exists. + * Purpose: Tests H5Dget_offset when user block exists. * * Return: Success: 0 * @@ -445,17 +445,17 @@ test_userblock_offset(hid_t fapl) int f; haddr_t offset; int rdata[DSET_DIM1][DSET_DIM2]; - + TESTING("dataset offset with user block"); - + h5_fixname(FILENAME[2], fapl, filename, sizeof filename); - + if((fcpl=H5Pcreate(H5P_FILE_CREATE))<0) goto error; if(H5Pset_userblock(fcpl, (hsize_t)USER_BLOCK)<0) goto error; - + if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl))<0) goto error; - + /* Create the data space */ dims[0] = DSET_DIM1; dims[1] = DSET_DIM2; @@ -480,7 +480,7 @@ test_userblock_offset(hid_t fapl) f = HDopen(filename, O_RDONLY, 0); HDlseek(f, (off_t)offset, SEEK_SET); HDread(f, rdata, sizeof(int)*DSET_DIM1*DSET_DIM2); - + /* Check that the values read are the same as the values written */ for (i = 0; i < DSET_DIM1; i++) { for (j = 0; j < DSET_DIM2; j++) { @@ -491,7 +491,7 @@ test_userblock_offset(hid_t fapl) goto error; } } - } + } HDclose(f); @@ -506,17 +506,17 @@ error: /*------------------------------------------------------------------------- * Function: test_compact_io * - * Purpose: Tests compact dataset I/O. That is, reading and writing a - * complete multi-dimensional array without data type or data - * space conversions, without compression, and store in + * Purpose: Tests compact dataset I/O. That is, reading and writing a + * complete multi-dimensional array without data type or data + * space conversions, without compression, and store in * compact dataset. * * Return: Success: 0 * * Failure: -1 * - * Programmer: Raymond Lu - * August 8, 2002 + * Programmer: Raymond Lu + * August 8, 2002 * * Modifications: * @@ -541,7 +541,7 @@ test_compact_io(hid_t fapl) wbuf[i][j] = n++; } } - + /* Create a small data space for compact dataset */ dims[0] = 16; dims[1] = 8; @@ -558,23 +558,23 @@ test_compact_io(hid_t fapl) assert(plist >= 0); status = H5Pset_layout(plist, H5D_COMPACT); assert(status >= 0); - status = H5Pset_alloc_time(plist, H5D_ALLOC_TIME_EARLY); + status = H5Pset_alloc_time(plist, H5D_ALLOC_TIME_EARLY); assert(status >= 0); /* Create and write to a compact dataset */ - if((dataset = H5Dcreate(file, DSET_COMPACT_IO_NAME, H5T_NATIVE_INT, space, + if((dataset = H5Dcreate(file, DSET_COMPACT_IO_NAME, H5T_NATIVE_INT, space, plist))<0) goto error; /* Test dataset address. Should be undefined. */ if(H5Dget_offset(dataset)!=HADDR_UNDEF) goto error; - + if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf)<0) goto error; /* Test dataset address. Should be undefined. */ if(H5Dget_offset(dataset)!=HADDR_UNDEF) goto error; - + /* Close file */ H5Sclose(space); H5Pclose(plist); @@ -582,7 +582,7 @@ test_compact_io(hid_t fapl) H5Fclose(file); /* - * Open the file and check data + * Open the file and check data */ if((file=H5Fopen(filename, H5F_ACC_RDONLY, fapl))<0) goto error; @@ -613,7 +613,7 @@ test_compact_io(hid_t fapl) error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_max_compact @@ -624,8 +624,8 @@ test_compact_io(hid_t fapl) * * Failure: -1 * - * Programmer: Raymond Lu - * August 8, 2002 + * Programmer: Raymond Lu + * August 8, 2002 * * Modifications: * @@ -648,14 +648,14 @@ test_max_compact(hid_t fapl) /* Initialize data */ compact_size = (SIXTY_FOUR_KB-64)/sizeof(int); - + wbuf = (int*)HDmalloc(sizeof(int)*(size_t)compact_size); rbuf = (int*)HDmalloc(sizeof(int)*(size_t)compact_size); n=0; for(i=0; i<(int)compact_size; i++) wbuf[i] = n++; - + /* Create a small data space for compact dataset */ dims[0] = compact_size; space = H5Screate_simple(1, dims, NULL); @@ -673,7 +673,7 @@ test_max_compact(hid_t fapl) assert(status >= 0); /* Create and write to a compact dataset */ - if((dataset = H5Dcreate(file, DSET_COMPACT_MAX_NAME, H5T_NATIVE_INT, space, + if((dataset = H5Dcreate(file, DSET_COMPACT_MAX_NAME, H5T_NATIVE_INT, space, plist))<0) goto error; @@ -687,7 +687,7 @@ test_max_compact(hid_t fapl) H5Fclose(file); /* - * Open the file and check data + * Open the file and check data */ if((file=H5Fopen(filename, H5F_ACC_RDONLY, fapl))<0) goto error; @@ -713,7 +713,7 @@ test_max_compact(hid_t fapl) /* Test compact dataset of size 64KB */ - + /* Create a data space for compact dataset */ compact_size = SIXTY_FOUR_KB/sizeof(int); dims[0] = compact_size; @@ -734,7 +734,7 @@ test_max_compact(hid_t fapl) H5E_BEGIN_TRY { H5Dcreate(file, DSET_COMPACT_MAX2_NAME, H5T_NATIVE_INT, space, plist); } H5E_END_TRY; - + /* Close file */ H5Sclose(space); H5Pclose(plist); @@ -775,13 +775,13 @@ test_conv_buffer(hid_t fid) } CmpField; typedef struct - { + { float b[DIM2]; double c[DIM3]; } CmpFieldR; herr_t status = -1; - int j, k, l; + int j, k, l; CmpField *cf; CmpFieldR *cfrR; @@ -801,21 +801,21 @@ test_conv_buffer(hid_t fid) #endif /* H5_WANT_H5_V1_4_COMPAT */ TESTING("data type conversion buffer size"); - + cf = (CmpField *)calloc(1, sizeof(CmpField)); - /* Populate the data members */ - for (j = 0; j < DIM1; j++) - for (k = 0; k < DIM2; k++) + /* Populate the data members */ + for (j = 0; j < DIM1; j++) + for (k = 0; k < DIM2; k++) for (l = 0; l < DIM3; l++) cf->a[j][k][l] = 10*(j+1) + l + k; for (j = 0; j < DIM2; j++) cf->b[j] = (float)(100.*(j+1) + 0.01*j); - + for (j = 0; j < DIM3; j++) cf->c[j] = 100.*(j+1) + 0.02*j; - + /* Create data space */ if((space=H5Screate(H5S_SCALAR))<0) goto error; @@ -826,7 +826,7 @@ test_conv_buffer(hid_t fid) dimsa[2] = DIM3; dimsb[0] = DIM2; dimsc[0] = DIM3; - + /* Create the memory data type */ if((ctype1 = H5Tcreate(H5T_COMPOUND, sizeof (CmpField)))<0) goto error; @@ -841,12 +841,12 @@ test_conv_buffer(hid_t fid) /* Create the dataset */ if((dataset = H5Dcreate(fid, DSET_CONV_BUF_NAME, ctype1, space, H5P_DEFAULT))<0) goto error; if(H5Dwrite(dataset, ctype1, H5S_ALL, H5S_ALL, H5P_DEFAULT, cf)<0) goto error; - + if((ctype2 = H5Tcreate(H5T_COMPOUND, sizeof (CmpFieldR)))<0) goto error; if((arr_type4 = H5Tarray_create(H5T_NATIVE_FLOAT, 1, dimsb, NULL))<0) goto error; if((arr_type5 = H5Tarray_create(H5T_NATIVE_DOUBLE, 1, dimsc, NULL))<0) goto error; - + if(H5Tinsert (ctype2, "B", HOFFSET(CmpFieldR, b), arr_type4)<0) goto error; if(H5Tinsert (ctype2, "C", HOFFSET(CmpFieldR, c), arr_type5)<0) goto error; @@ -854,7 +854,7 @@ test_conv_buffer(hid_t fid) cfrR = (CmpFieldR *)calloc(1, sizeof(CmpFieldR)); if(H5Dread(dataset, ctype2, H5S_ALL, H5S_ALL, H5P_DEFAULT, cfrR)<0) goto error; - /* Read should fail since conversion buffer isn't big enough */ + /* Read should fail since conversion buffer isn't big enough */ xfer_list = H5Pcreate (H5P_DATASET_XFER); size = (DIM2*DIM3*(sizeof(int))+ DIM2*(sizeof(float))+ DIM3*(sizeof(double))); @@ -891,14 +891,14 @@ test_conv_buffer(hid_t fid) if(cf) HDfree(cf); if(cfrR) - HDfree(cfrR); + HDfree(cfrR); puts(" PASSED"); return(0); error: - return -1; + return -1; } - + /*------------------------------------------------------------------------- * Function: test_tconv @@ -930,7 +930,7 @@ test_tconv(hid_t file) assert (in); TESTING("data type conversion"); - + /* Initialize the dataset */ for (i = 0; i < 1000000; i++) { out[i*4+0] = 0x11; @@ -1032,7 +1032,7 @@ can_apply_bogus(hid_t UNUSED dcpl_id, hid_t type_id, hid_t UNUSED space_id) *------------------------------------------------------------------------- */ static size_t -filter_bogus(unsigned int UNUSED flags, size_t UNUSED cd_nelmts, +filter_bogus(unsigned int UNUSED flags, size_t UNUSED cd_nelmts, const unsigned int UNUSED *cd_values, size_t nbytes, size_t UNUSED *buf_size, void UNUSED **buf) { @@ -1113,7 +1113,7 @@ set_local_bogus2(hid_t dcpl_id, hid_t type_id, hid_t UNUSED space_id) *------------------------------------------------------------------------- */ static size_t -filter_bogus2(unsigned int flags, size_t cd_nelmts, +filter_bogus2(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf) { @@ -1165,11 +1165,11 @@ const H5Z_class_t H5Z_CORRUPT[1] = {{ /*------------------------------------------------------------------------- - * Function: filter_corrupt + * Function: filter_corrupt * - * Purpose: For testing Fletcher32 checksum. modify data slightly during - * writing so that when data is read back, the checksum should - * fail. + * Purpose: For testing Fletcher32 checksum. modify data slightly during + * writing so that when data is read back, the checksum should + * fail. * * Return: Success: Data chunk size * @@ -1183,7 +1183,7 @@ const H5Z_class_t H5Z_CORRUPT[1] = {{ *------------------------------------------------------------------------- */ static size_t -filter_corrupt(unsigned int flags, size_t cd_nelmts, +filter_corrupt(unsigned int flags, size_t cd_nelmts, const unsigned int *cd_values, size_t nbytes, size_t *buf_size, void **buf) { @@ -1193,7 +1193,7 @@ filter_corrupt(unsigned int flags, size_t cd_nelmts, unsigned int length; unsigned int value; void *data; - + if (cd_nelmts!=3 || !cd_values) return 0; offset = cd_values[0]; @@ -1207,14 +1207,14 @@ filter_corrupt(unsigned int flags, size_t cd_nelmts, if (flags & H5Z_FLAG_REVERSE) { /* Varify data is actually corrupted during read */ dst += offset; - if(HDmemcmp(data, dst, length)!=0) return 0; + if(HDmemcmp(data, dst, length)!=0) return 0; *buf_size = nbytes; ret_value = nbytes; } else { /* Write corrupted data */ dst += offset; HDmemcpy(dst, data, length); *buf_size = nbytes; - ret_value = *buf_size; + ret_value = *buf_size; } if(data) @@ -1227,9 +1227,9 @@ filter_corrupt(unsigned int flags, size_t cd_nelmts, /*------------------------------------------------------------------------- * Function: filter_cb_cont * - * Purpose: Callback function to handle checksum failure. Let it continue. + * Purpose: Callback function to handle checksum failure. Let it continue. * - * Return: continue + * Return: continue * * Programmer: Raymond Lu * Jan 14, 2003 @@ -1238,23 +1238,23 @@ filter_corrupt(unsigned int flags, size_t cd_nelmts, * *------------------------------------------------------------------------- */ -static H5Z_cb_return_t -filter_cb_cont(H5Z_filter_t filter, void UNUSED *buf, size_t UNUSED buf_size, +static H5Z_cb_return_t +filter_cb_cont(H5Z_filter_t filter, void UNUSED *buf, size_t UNUSED buf_size, void UNUSED *op_data) { if(H5Z_FILTER_FLETCHER32==filter) - return H5Z_CB_CONT; + return H5Z_CB_CONT; else - return H5Z_CB_FAIL; + return H5Z_CB_FAIL; } /*------------------------------------------------------------------------- * Function: filter_cb_fail * - * Purpose: Callback function to handle checksum failure. Let it fail. + * Purpose: Callback function to handle checksum failure. Let it fail. * - * Return: fail + * Return: fail * * Programmer: Raymond Lu * Jan 14, 2003 @@ -1263,14 +1263,14 @@ filter_cb_cont(H5Z_filter_t filter, void UNUSED *buf, size_t UNUSED buf_size, * *------------------------------------------------------------------------- */ -static H5Z_cb_return_t -filter_cb_fail(H5Z_filter_t filter, void UNUSED *buf, size_t UNUSED buf_size, +static H5Z_cb_return_t +filter_cb_fail(H5Z_filter_t filter, void UNUSED *buf, size_t UNUSED buf_size, void UNUSED *op_data) { if(H5Z_FILTER_FLETCHER32==filter) - return H5Z_CB_FAIL; + return H5Z_CB_FAIL; else - return H5Z_CB_CONT; + return H5Z_CB_CONT; } @@ -1295,7 +1295,7 @@ filter_cb_fail(H5Z_filter_t filter, void UNUSED *buf, size_t UNUSED buf_size, *------------------------------------------------------------------------- */ static herr_t -test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, +test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, int corrupted, hsize_t *dset_size) { hid_t dataset; /* Dataset ID */ @@ -1333,7 +1333,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, } TESTING(" filters (setup)"); - + /* Check if all the filters are available */ if(H5Pall_filters_avail(dcpl)!=TRUE) { H5_FAILED(); @@ -1343,18 +1343,18 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, /* Create the dataset */ if ((dataset = H5Dcreate(fid, name, H5T_NATIVE_INT, sid, - dcpl))<0) goto error; + dcpl))<0) goto error; PASSED(); /*---------------------------------------------------------------------- * STEP 1: Read uninitialized data. It should be zero. - *---------------------------------------------------------------------- + *---------------------------------------------------------------------- */ TESTING(" filters (uninitialized read)"); if (H5Dread (dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check)<0) goto error; - + for (i=0; i=0) TEST_ERROR; - /* Callback decides to continue inspite data is corrupted. */ + /* Callback decides to continue inspite data is corrupted. */ if(H5Pset_filter_callback(dxpl, filter_cb_cont, NULL)<0) TEST_ERROR; if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check)<0) TEST_ERROR; - - /* Callback decides to fail when data is corrupted. */ + + /* Callback decides to fail when data is corrupted. */ if(H5Pset_filter_callback(write_dxpl, filter_cb_fail, NULL)<0) TEST_ERROR; /* (Use the "write" DXPL in order to make certain corruption is seen) */ H5E_BEGIN_TRY { @@ -1433,7 +1433,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, } } } - + PASSED(); /*---------------------------------------------------------------------- @@ -1441,10 +1441,10 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, * random thus not very compressible, and will cause the chunks to move * around as they grow. We only change values for the left half of the * dataset although we rewrite the whole thing. - *---------------------------------------------------------------------- + *---------------------------------------------------------------------- */ TESTING(" filters (modify)"); - + for (i=0; i=0) TEST_ERROR; - /* Callback decides to continue inspite data is corrupted. */ + /* Callback decides to continue inspite data is corrupted. */ if(H5Pset_filter_callback(dxpl, filter_cb_cont, NULL)<0) TEST_ERROR; if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check)<0) TEST_ERROR; - - /* Callback decides to fail when data is corrupted. */ + + /* Callback decides to fail when data is corrupted. */ if(H5Pset_filter_callback(write_dxpl, filter_cb_fail, NULL)<0) TEST_ERROR; /* (Use the "write" DXPL in order to make certain corruption is seen) */ H5E_BEGIN_TRY { @@ -1491,7 +1491,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, } } } - + if((*dset_size=H5Dget_storage_size(dataset))==0) TEST_ERROR; PASSED(); @@ -1499,27 +1499,27 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, * STEP 5: Close the dataset and then open it and read it again. This * insures that the filters message is picked up properly from the * object header. - *---------------------------------------------------------------------- + *---------------------------------------------------------------------- */ TESTING(" filters (re-open)"); - + if (H5Dclose (dataset)<0) TEST_ERROR; if ((dataset = H5Dopen (fid, name))<0) TEST_ERROR; - + if(corrupted) { - /* Default behavior is failure when data is corrupted. */ + /* Default behavior is failure when data is corrupted. */ /* (Use the "write" DXPL in order to make certain corruption is seen) */ H5E_BEGIN_TRY { status=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check); } H5E_END_TRY; if(status>=0) TEST_ERROR; - /* Callback decides to continue inspite data is corrupted. */ + /* Callback decides to continue inspite data is corrupted. */ if(H5Pset_filter_callback(dxpl, filter_cb_cont, NULL)<0) TEST_ERROR; if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check)<0) TEST_ERROR; - - /* Callback decides to fail when data is corrupted. */ + + /* Callback decides to fail when data is corrupted. */ if(H5Pset_filter_callback(write_dxpl, filter_cb_fail, NULL)<0) TEST_ERROR; /* (Use the "write" DXPL in order to make certain corruption is seen) */ H5E_BEGIN_TRY { @@ -1543,15 +1543,15 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, } } } - + PASSED(); - + /*---------------------------------------------------------------------- * STEP 6: Test partial I/O by writing to and then reading from a * hyperslab of the dataset. The hyperslab does not line up on chunk * boundaries (we know that case already works from above tests). - *---------------------------------------------------------------------- + *---------------------------------------------------------------------- */ TESTING(" filters (partial I/O)"); @@ -1565,21 +1565,21 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, /* (Use the "read" DXPL because partial I/O on corrupted data test needs to ignore errors during writing) */ if (H5Dwrite (dataset, H5T_NATIVE_INT, sid, sid, dxpl, points)<0) TEST_ERROR; - + if(corrupted) { - /* Default behavior is failure when data is corrupted. */ + /* Default behavior is failure when data is corrupted. */ /* (Use the "write" DXPL in order to make certain corruption is seen) */ H5E_BEGIN_TRY { status=H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, write_dxpl, check); } H5E_END_TRY; if(status>=0) TEST_ERROR; - /* Callback decides to continue inspite data is corrupted. */ + /* Callback decides to continue inspite data is corrupted. */ if(H5Pset_filter_callback(dxpl, filter_cb_cont, NULL)<0) TEST_ERROR; if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, dxpl, check)<0) TEST_ERROR; - - /* Callback decides to fail when data is corrupted. */ + + /* Callback decides to fail when data is corrupted. */ if(H5Pset_filter_callback(write_dxpl, filter_cb_fail, NULL)<0) TEST_ERROR; /* (Use the "write" DXPL in order to make certain corruption is seen) */ H5E_BEGIN_TRY { @@ -1589,7 +1589,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, } else { if (H5Dread (dataset, H5T_NATIVE_INT, sid, sid, dxpl, check)<0) TEST_ERROR; - + /* Check that the values read are the same as the values written */ for (i=0; i=0) { H5_FAILED(); puts(" Tries to cut off the last member. Should have failed."); @@ -2235,12 +2235,12 @@ test_compound_12(void) * Purpose: Tests query functions of compound and enumeration types. * * Return: Success: 0 - * + * * Failure: number of errors * * Programmer: Raymond Lu * Thursday, April 4, 2002 - * + * * Modifications: * Raymond Lu * Wednesday, Febuary 9, 2005 @@ -2248,7 +2248,7 @@ test_compound_12(void) * H5Tget_member_value. *------------------------------------------------------------------------- */ -static int +static int test_query(void) { struct s1 { @@ -2271,7 +2271,7 @@ test_query(void) goto error; /* Create a compound datatype */ - if((tid1=H5Tcreate(H5T_COMPOUND, sizeof(struct s1)))<0) { + if((tid1=H5Tcreate(H5T_COMPOUND, sizeof(struct s1)))<0) { H5_FAILED(); printf("Can't create datatype!\n"); goto error; @@ -2424,7 +2424,7 @@ test_query(void) printf("Incorrect value for enum member\n"); goto error; } /* end if */ - + /* Query member value by member index, for enumeration type */ if(H5Tget_member_value (tid2, 2, &enum_val)<0) { H5_FAILED(); @@ -2436,7 +2436,7 @@ test_query(void) printf("Incorrect value for enum member\n"); goto error; } /* end if */ - + /* Query member name by member value, for enumeration type */ enum_val = 14; if(H5Tenum_nameof(tid2, &enum_val, enum_name, 16)<0) { @@ -2487,17 +2487,17 @@ test_query(void) * Purpose: Tests user-define and query functions of floating-point types. * * Return: Success: 0 - * + * * Failure: number of errors * * Programmer: Raymond Lu * Thursday, Jan 6, 2005 - * + * * Modifications: * *------------------------------------------------------------------------- */ -static int +static int test_derived_flt(void) { hid_t file=-1, tid1=-1, tid2=-1; @@ -2522,50 +2522,50 @@ test_derived_flt(void) if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT))<0) { H5_FAILED(); printf("Can't create file\n"); - goto error; + goto error; } if((dxpl_id = H5Pcreate(H5P_DATASET_XFER))<0) { H5_FAILED(); printf("Can't create data transfer property list\n"); - goto error; + goto error; } if((tid1 = H5Tcopy(H5T_IEEE_F64LE))<0) { H5_FAILED(); printf("Can't copy data type\n"); - goto error; + goto error; } if((tid2 = H5Tcopy(H5T_IEEE_F32LE))<0) { H5_FAILED(); printf("Can't copy data type\n"); - goto error; + goto error; } /*------------------------------------------------------------------------ * 1st floating-point type - * size=7 byte, precision=42 bits, offset=3 bits, mantissa size=31 bits, - * mantissa position=3, exponent size=10 bits, exponent position=34, - * exponent bias=511. It can be illustrated in little-endian order as + * size=7 byte, precision=42 bits, offset=3 bits, mantissa size=31 bits, + * mantissa position=3, exponent size=10 bits, exponent position=34, + * exponent bias=511. It can be illustrated in little-endian order as * * 6 5 4 3 2 1 0 * ???????? ???SEEEE EEEEEEMM MMMMMMMM MMMMMMMM MMMMMMMM MMMMM??? * - * To create a new floating-point type, the following properties must be - * set in the order of - * set fields -> set offset -> set precision -> set size. - * All these properties must be set before the type can function. Other - * properties can be set anytime. Derived type size cannot be expanded - * bigger than original size but can be decreased. There should be no - * holes among the significant bits. Exponent bias usually is set + * To create a new floating-point type, the following properties must be + * set in the order of + * set fields -> set offset -> set precision -> set size. + * All these properties must be set before the type can function. Other + * properties can be set anytime. Derived type size cannot be expanded + * bigger than original size but can be decreased. There should be no + * holes among the significant bits. Exponent bias usually is set * 2^(n-1)-1, where n is the exponent size. - *-----------------------------------------------------------------------*/ + *-----------------------------------------------------------------------*/ if(H5Tset_fields(tid1, 44, 34, 10, 3, 31)<0) { H5_FAILED(); printf("Can't set fields\n"); goto error; - } + } if(H5Tset_offset(tid1, 3)<0) { H5_FAILED(); printf("Can't set offset\n"); @@ -2622,12 +2622,12 @@ test_derived_flt(void) if((precision = H5Tget_precision(tid1))!=42) { H5_FAILED(); printf("Can't get precision or wrong precision\n"); - goto error; + goto error; } if((offset = H5Tget_offset(tid1))!=3) { H5_FAILED(); printf("Can't get offset or wrong offset\n"); - goto error; + goto error; } if((size = H5Tget_size(tid1))!=7) { H5_FAILED(); @@ -2637,15 +2637,15 @@ test_derived_flt(void) if((ebias = H5Tget_ebias(tid1))!=511) { H5_FAILED(); printf("Can't get exponent bias or wrong bias\n"); - goto error; + goto error; } /*-------------------------------------------------------------------------- * 2nd floating-point type - * size=3 byte, precision=24 bits, offset=0 bits, mantissa size=16 bits, - * mantissa position=0, exponent size=7 bits, exponent position=16, exponent + * size=3 byte, precision=24 bits, offset=0 bits, mantissa size=16 bits, + * mantissa position=0, exponent size=7 bits, exponent position=16, exponent * bias=63. It can be illustrated in little-endian order as - * + * * 2 1 0 * SEEEEEEE MMMMMMMM MMMMMMMM *--------------------------------------------------------------------------*/ @@ -2653,7 +2653,7 @@ test_derived_flt(void) H5_FAILED(); printf("Can't set fields\n"); goto error; - } + } if(H5Tset_offset(tid2, 0)<0) { H5_FAILED(); printf("Can't set offset\n"); @@ -2710,12 +2710,12 @@ test_derived_flt(void) if((precision = H5Tget_precision(tid2))!=24) { H5_FAILED(); printf("Can't get precision or wrong precision\n"); - goto error; + goto error; } if((offset = H5Tget_offset(tid2))!=0) { H5_FAILED(); printf("Can't get offset or wrong offset\n"); - goto error; + goto error; } if((size = H5Tget_size(tid2))!=3) { H5_FAILED(); @@ -2725,7 +2725,7 @@ test_derived_flt(void) if((ebias = H5Tget_ebias(tid2))!=63) { H5_FAILED(); printf("Can't get exponent bias or wrong bias\n"); - goto error; + goto error; } /* Convert data from the 2nd to the 1st derived floating-point type. @@ -2742,18 +2742,18 @@ test_derived_flt(void) buf[i] = saved_buf[i] = HDrand(); /* Convert data from the 2nd to the 1st derived floating-point type. - * The mantissa and exponent of the 2nd type are big enough to retain + * The mantissa and exponent of the 2nd type are big enough to retain * the precision and exponent power. */ - if(H5Tconvert(tid2, tid1, nelmts, buf, NULL, dxpl_id)<0) { + if(H5Tconvert(tid2, tid1, nelmts, buf, NULL, dxpl_id)<0) { H5_FAILED(); printf("Can't convert data\n"); - goto error; + goto error; } /* Convert data from the 1st back to the 2nd derived floating-point type. */ - if(H5Tconvert(tid1, tid2, nelmts, buf, NULL, dxpl_id)<0) { + if(H5Tconvert(tid1, tid2, nelmts, buf, NULL, dxpl_id)<0) { H5_FAILED(); printf("Can't convert data\n"); - goto error; + goto error; } /* Are the values still the same?*/ @@ -2762,10 +2762,10 @@ test_derived_flt(void) if(buf[i*src_size+j]!=saved_buf[i*src_size+j]) break; if(j==src_size) - continue; /*no error*/ + continue; /*no error*/ - /* If original value is NaN(exponent bits are all ones, 11..11), - * the library simply sets all mantissa bits to ones. So don't + /* If original value is NaN(exponent bits are all ones, 11..11), + * the library simply sets all mantissa bits to ones. So don't * compare values in this case. */ if((buf[i*src_size+2]==0x7f && saved_buf[i*src_size+2]==0x7f) || @@ -2826,7 +2826,7 @@ test_derived_flt(void) PASSED(); reset_hdf5(); /*print statistics*/ - + return 0; error: @@ -2851,17 +2851,17 @@ test_derived_flt(void) * Purpose: Tests user-define and query functions of integer types. * * Return: Success: 0 - * + * * Failure: number of errors * * Programmer: Raymond Lu * Saturday, Jan 29, 2005 - * + * * Modifications: * *------------------------------------------------------------------------- */ -static int +static int test_derived_integer(void) { hid_t file=-1, tid1=-1, tid2=-1; @@ -2888,43 +2888,43 @@ test_derived_integer(void) if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT))<0) { H5_FAILED(); printf("Can't create file\n"); - goto error; + goto error; } if((dxpl_id = H5Pcreate(H5P_DATASET_XFER))<0) { H5_FAILED(); printf("Can't create data transfer property list\n"); - goto error; + goto error; } if((tid1 = H5Tcopy(H5T_STD_I32LE))<0) { H5_FAILED(); printf("Can't copy data type\n"); - goto error; + goto error; } if((tid2 = H5Tcopy(H5T_STD_U64LE))<0) { H5_FAILED(); printf("Can't copy data type\n"); - goto error; + goto error; } - + /*-------------------------------------------------------------------------- * 1st integer type * size=3 byte, precision=24 bits, offset=0 bits, order=big endian. * It can be illustrated in big-endian order as - * + * * 0 1 2 * SIIIIIII IIIIIIII IIIIIIII * - * There's no specific order for these functions to define the attributes - * of a new integer type, H5Tset_precision, H5Tset_offset, H5Tset_size, + * There's no specific order for these functions to define the attributes + * of a new integer type, H5Tset_precision, H5Tset_offset, H5Tset_size, * H5Tset_order, H5Tset_pad, H5Tset_sign. *--------------------------------------------------------------------------*/ if(H5Tset_offset(tid1,0)<0) { H5_FAILED(); printf("Can't set offset\n"); - goto error; + goto error; } if(H5Tset_size(tid1, 3)<0) { @@ -2936,13 +2936,13 @@ test_derived_integer(void) if(H5Tset_precision(tid1,24)<0) { H5_FAILED(); printf("Can't set precision\n"); - goto error; + goto error; } if(H5Tset_order(tid1, H5T_ORDER_BE)<0) { H5_FAILED(); printf("Can't set order\n"); - goto error; + goto error; } if(H5Tcommit(file, "new integer type 1", tid1)<0) { @@ -2950,7 +2950,7 @@ test_derived_integer(void) printf("Can't commit data type\n"); goto error; } - + if(H5Tclose(tid1)<0) { H5_FAILED(); printf("Can't close datatype\n"); @@ -2966,12 +2966,12 @@ test_derived_integer(void) if((precision = H5Tget_precision(tid1))!=24) { H5_FAILED(); printf("Can't get precision or wrong precision\n"); - goto error; + goto error; } if((offset = H5Tget_offset(tid1))!=0) { H5_FAILED(); printf("Can't get offset or wrong offset\n"); - goto error; + goto error; } if((size = H5Tget_size(tid1))!=3) { H5_FAILED(); @@ -2988,34 +2988,34 @@ test_derived_integer(void) * 2nd integer type * size=8 byte, precision=48 bits, offset=10 bits, order=little endian. * It can be illustrated in little-endian order as - * - * 7 6 5 4 3 2 1 0 + * + * 7 6 5 4 3 2 1 0 * ??????SI IIIIIIII IIIIIIII IIIIIIII IIIIIIII IIIIIIII IIIIII?? ???????? *--------------------------------------------------------------------------*/ if(H5Tset_precision(tid2,48)<0) { H5_FAILED(); printf("Can't set precision\n"); - goto error; + goto error; } if(H5Tset_offset(tid2,10)<0) { H5_FAILED(); printf("Can't set offset\n"); - goto error; + goto error; } - + if(H5Tset_sign(tid2,H5T_SGN_2)<0) { H5_FAILED(); printf("Can't set offset\n"); - goto error; + goto error; } - + if(H5Tcommit(file, "new integer type 2", tid2)<0) { H5_FAILED(); printf("Can't commit data type\n"); goto error; } - + if(H5Tclose(tid2)<0) { H5_FAILED(); printf("Can't close datatype\n"); @@ -3027,16 +3027,16 @@ test_derived_integer(void) printf("Can't open datatype\n"); goto error; } - + if((precision = H5Tget_precision(tid2))!=48) { H5_FAILED(); printf("Can't get precision or wrong precision\n"); - goto error; + goto error; } if((offset = H5Tget_offset(tid2))!=10) { H5_FAILED(); printf("Can't get offset or wrong offset\n"); - goto error; + goto error; } if((size = H5Tget_size(tid2))!=8) { H5_FAILED(); @@ -3063,18 +3063,18 @@ test_derived_integer(void) buf[i] = saved_buf[i] = HDrand(); /* Convert data from the 1st to the 2nd derived integer type. - * The precision of the 2nd type are big enough to retain + * The precision of the 2nd type are big enough to retain * the 1st type's precision. */ - if(H5Tconvert(tid1, tid2, nelmts, buf, NULL, dxpl_id)<0) { + if(H5Tconvert(tid1, tid2, nelmts, buf, NULL, dxpl_id)<0) { H5_FAILED(); printf("Can't convert data\n"); - goto error; + goto error; } /* Convert data from the 2nd back to the 1st derived integer type. */ - if(H5Tconvert(tid2, tid1, nelmts, buf, NULL, dxpl_id)<0) { + if(H5Tconvert(tid2, tid1, nelmts, buf, NULL, dxpl_id)<0) { H5_FAILED(); printf("Can't convert data\n"); - goto error; + goto error; } /* Are the values still the same?*/ @@ -3083,7 +3083,7 @@ test_derived_integer(void) if(buf[i*src_size+j]!=saved_buf[i*src_size+j]) break; if(j==src_size) - continue; /*no error*/ + continue; /*no error*/ /* Print errors */ if (0==fails_this_test++) { @@ -3136,7 +3136,7 @@ test_derived_integer(void) PASSED(); reset_hdf5(); /*print statistics*/ - + return 0; error: @@ -3178,7 +3178,7 @@ test_transient (hid_t fapl) hid_t file=-1, type=-1, space=-1, dset=-1, t2=-1; char filename[1024]; herr_t status; - + TESTING("transient data types"); h5_fixname(FILENAME[0], fapl, filename, sizeof filename); @@ -3261,7 +3261,7 @@ test_transient (hid_t fapl) if ((t2=H5Tcopy (dset))<0) goto error; if (H5Tset_precision (t2, 256)<0) goto error; if (H5Tclose (t2)<0) goto error; - + H5Dclose (dset); H5Fclose (file); @@ -3307,7 +3307,7 @@ test_named (hid_t fapl) hsize_t i,j; unsigned attr_data[10][20]; char filename[1024]; - + TESTING("named data types"); h5_fixname(FILENAME[1], fapl, filename, sizeof filename); @@ -3391,7 +3391,7 @@ test_named (hid_t fapl) HDputs (" Opened named types should be named types!"); goto error; } - + /* Create a dataset that uses the named type */ if ((dset = H5Dcreate (file, "dset1", type, space, H5P_DEFAULT))<0) { goto error; @@ -3439,7 +3439,7 @@ test_named (hid_t fapl) goto error; } if (H5Tclose (t2)<0) goto error; - + /* * Get the dataset data type by applying H5Tcopy() to the dataset. The * result should be modifiable. @@ -3647,7 +3647,7 @@ test_conv_str_1(void) HDfree(buf); if (H5Tclose(src_type)<0) goto error; if (H5Tclose(dst_type)<0) goto error; - + /* * Test C string to Fortran and vice versa. */ @@ -3702,7 +3702,7 @@ test_conv_str_1(void) HDfree(buf); if (H5Tclose(src_type)<0) goto error; if (H5Tclose(dst_type)<0) goto error; - + /* * Test C buffer to Fortran and vice versa. */ @@ -3916,11 +3916,11 @@ test_conv_enum_1(void) * Purpose: Tests enumeration conversions where source isn't a native type. * * Return: Success: 0 - * + * * Failure: number of errors * * Programmer: Robb Matzke, LLNL, 2003-06-09 - * + * * Modifications: *------------------------------------------------------------------------- */ @@ -3991,7 +3991,7 @@ test_conv_enum_2(void) nerrors, NTESTELEM); return 1; } - + PASSED(); return 0; } @@ -4132,7 +4132,7 @@ static int test_opaque(void) { int num_errors = 0; - + TESTING("opaque datatypes"); /* Test opaque types with tags */ @@ -4187,10 +4187,10 @@ opaque_check(int tag_it) /* Build source and destination types */ if ((st=H5Tcreate(H5T_OPAQUE, 4))<0) goto error; if (H5Tset_tag(st, "opaque source type")<0) goto error; - + if ((dt=H5Tcreate(H5T_OPAQUE, 4))<0) goto error; if (tag_it) { - if (H5Tset_tag(dt, "opaque destination type")<0) + if (H5Tset_tag(dt, "opaque destination type")<0) goto error; } @@ -4215,7 +4215,7 @@ opaque_check(int tag_it) printf(" unexpected number of opaque conversions\n"); goto error; } - + /* Unregister conversion function */ if (H5Tunregister(H5T_PERS_HARD, "o_test", st, dt, convert_opaque)<0) goto error; @@ -4268,7 +4268,7 @@ opaque_long(void) ret = H5Tset_tag(dt, long_tag); } H5E_END_TRY; if(ret!=FAIL) TEST_ERROR - + /* Close datatype */ if(H5Tclose(dt) < 0) TEST_ERROR @@ -4308,7 +4308,7 @@ test_conv_int (void) /*--------------------------------------------------------------------- * Test some specific overflow/underflow cases. - *--------------------------------------------------------------------- + *--------------------------------------------------------------------- */ TESTING("integer overflow conversions"); @@ -4462,9 +4462,9 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) unsigned long hw_ulong; long_long hw_llong; unsigned long_long hw_ullong; - - - + + + /* What are the names of the source and destination types */ if (H5Tequal(src, H5T_NATIVE_SCHAR)) { src_type_name = "signed char"; @@ -4500,7 +4500,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) src_type_name = "UNKNOWN"; src_type = INT_OTHER; } - + if (H5Tequal(dst, H5T_NATIVE_SCHAR)) { dst_type_name = "signed char"; dst_type = INT_CHAR; @@ -5068,7 +5068,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) */ for (k=0; k= 0) goto error; + /* These calls should fail, since no memebrs exist yet */ + if (H5Tenum_valueof(datatype_id, "SAX", &val) >= 0) goto error; val = 3; - if (H5Tenum_nameof(datatype_id, &val, nam, size) >= 0) goto error; + if (H5Tenum_nameof(datatype_id, &val, nam, size) >= 0) goto error; val = 2; if (H5Tenum_insert(datatype_id, "TWO", (int *)&val) < 0) goto error; @@ -390,32 +390,32 @@ test_value_dsnt_exist(void) if (H5Tenum_insert(datatype_id, "SIX", (int *)&val) < 0) goto error; val = 10; if (H5Tenum_insert(datatype_id, "TEN", (int *)&val) < 0) goto error; - + /* This call should fail since we did not create a member with value = 3*/ val = 3; - if (H5Tenum_nameof(datatype_id, &val, nam, size) >= 0) goto error; + if (H5Tenum_nameof(datatype_id, &val, nam, size) >= 0) goto error; /* This call should fail since we did not create a member with value = 11*/ val = 11; - if (H5Tenum_nameof(datatype_id, &val, nam, size) >= 0) goto error; + if (H5Tenum_nameof(datatype_id, &val, nam, size) >= 0) goto error; /* This call should fail since we did not create a member with value = 0*/ val = 0; - if (H5Tenum_nameof(datatype_id, &val, nam, size) >= 0) goto error; + if (H5Tenum_nameof(datatype_id, &val, nam, size) >= 0) goto error; /* This call should fail since we do not have SAX name in the type */ - if (H5Tenum_valueof(datatype_id, "SAX", &val) >= 0) goto error; + if (H5Tenum_valueof(datatype_id, "SAX", &val) >= 0) goto error; /* This call should fail since we do not have TEEN name in the type */ - if (H5Tenum_valueof(datatype_id, "TEEN", &val) >= 0) goto error; + if (H5Tenum_valueof(datatype_id, "TEEN", &val) >= 0) goto error; /* This call should fail since we do not have A name in the type */ - if (H5Tenum_valueof(datatype_id, "A", &val) >= 0) goto error; + if (H5Tenum_valueof(datatype_id, "A", &val) >= 0) goto error; if (H5Tclose(datatype_id) < 0) goto error; PASSED(); return 0; - + error: H5E_BEGIN_TRY { H5Tclose(datatype_id); @@ -427,11 +427,11 @@ test_value_dsnt_exist(void) /*------------------------------------------------------------------------- * Function: main * - * Purpose: + * Purpose: * - * Return: Success: + * Return: Success: * - * Failure: + * Failure: * * Programmer: Robb Matzke * Tuesday, December 22, 1998 @@ -446,7 +446,7 @@ main(void) hid_t fapl=-1, file=-1; char name[1024]; int nerrors=0; - + h5_reset(); fapl = h5_fileaccess(); @@ -460,9 +460,9 @@ main(void) nerrors += test_tr1(file); nerrors += test_tr2(file); nerrors += test_value_dsnt_exist(); - + H5Fclose(file); - + if (nerrors) goto error; puts("All enum tests passed."); h5_cleanup(FILENAME, fapl); diff --git a/test/extend.c b/test/extend.c index aaac754..871446a 100644 --- a/test/extend.c +++ b/test/extend.c @@ -96,7 +96,7 @@ write_data(const char *msg, hid_t file, const char *name, hid_t cparms, hid_t me offset[1] = j * NY/2; if (H5Sselect_hyperslab (file_space, H5S_SELECT_SET, offset, NULL, half_dims, NULL)<0) TEST_ERROR; - + /* Read */ if (H5Dread (dataset, H5T_NATIVE_INT, half_space, file_space, H5P_DEFAULT, buf2)<0) TEST_ERROR; @@ -114,7 +114,7 @@ write_data(const char *msg, hid_t file, const char *name, hid_t cparms, hid_t me } } } - + /* Cleanup */ if (H5Dclose (dataset)<0) TEST_ERROR; @@ -175,7 +175,7 @@ main (void) /* Create the file */ h5_fixname(FILENAME[0], fapl, filename, sizeof filename); if ((file = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Create the dataset which is originally NX by NY */ if((cparms = H5Pcreate(H5P_DATASET_CREATE))<0) TEST_ERROR; if (H5Pset_chunk (cparms, 2, chunk_dims)<0) TEST_ERROR; diff --git a/test/external.c b/test/external.c index 5921572..e5e57af 100644 --- a/test/external.c +++ b/test/external.c @@ -61,7 +61,7 @@ same_contents (const char *name1, const char *name2) assert (n1>=0 && (size_t)n1<=sizeof(buf1)); assert (n2>=0 && (size_t)n2<=sizeof(buf2)); assert (n1==n2); - + if (n1<=0 && n2<=0) break; if (memcmp (buf1, buf2, (size_t)n1)) { close (fd1); @@ -103,7 +103,7 @@ test_1a(hid_t file) char name[256]; /*external file name */ off_t file_offset; /*external file offset */ hsize_t file_size; /*sizeof external file segment */ - + TESTING("fixed-size data space, exact storage"); /* Create the dataset */ @@ -123,7 +123,7 @@ test_1a(hid_t file) /* Test dataset address. Should be undefined. */ if (H5Dget_offset(dset)!=HADDR_UNDEF) goto error; - + if ((dcpl = H5Dget_create_plist (dset))<0) goto error; if ((n=H5Pget_external_count (dcpl))<0) goto error; if (1!=n) { @@ -369,7 +369,7 @@ test_1e(hid_t file) if (H5Dclose (dset)<0) goto error; if (H5Sclose (space)<0) goto error; if (H5Pclose (dcpl)<0) goto error; - + /* Read dataset creation information */ if ((dset = H5Dopen (file, "dset5"))<0) goto error; if ((dcpl = H5Dget_create_plist (dset))<0) goto error; @@ -540,7 +540,7 @@ test_1h(void) { hid_t dcpl=-1; /*dataset creation properties */ herr_t status; /*return status */ - + TESTING("address overflow in external files"); if((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error; if (H5Pset_external(dcpl, "ext1.data", (off_t)0, H5F_UNLIMITED-1)<0) goto error; @@ -617,7 +617,7 @@ test_2 (hid_t fapl) assert (n==sizeof(part)); close (fd); } - + /* * Create the file and an initial group. This causes messages about * debugging to be emitted before we start playing games with what the @@ -640,7 +640,7 @@ test_2 (hid_t fapl) cur_size = 100; if ((space=H5Screate_simple (1, &cur_size, NULL))<0) goto error; if ((dset=H5Dcreate(file, "dset1", H5T_NATIVE_INT, space, dcpl))<0) - goto error; + goto error; /* * Read the entire dataset and compare with the original @@ -673,7 +673,7 @@ test_2 (hid_t fapl) goto error; } } - + if (H5Dclose(dset)<0) goto error; if (H5Pclose(dcpl)<0) goto error; if (H5Sclose(space)<0) goto error; @@ -750,7 +750,7 @@ test_3 (hid_t fapl) printf(" cannot open %s: %s\n", filename, strerror(errno)); goto error; } - + write(fd, temparray, (i-1)*10); close (fd); } @@ -833,7 +833,7 @@ main (void) char filename[1024]; /*file name for test_1* funcs */ hid_t grp=-1; /*group to emit diagnostics */ int nerrors=0; /*number of errors */ - + h5_reset(); fapl = h5_fileaccess(); h5_fixname(FILENAME[0], fapl, filename, sizeof filename); diff --git a/test/file_handle.c b/test/file_handle.c index a18c8e6..76364c5 100644 --- a/test/file_handle.c +++ b/test/file_handle.c @@ -12,35 +12,35 @@ * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* - * Programmer: Raymond Lu - * Tuesday, Sept 24, 2002 - * +/* + * Programmer: Raymond Lu + * Tuesday, Sept 24, 2002 + * * Purpose: Tests the file handle interface */ - + #include "h5test.h" #define KB 1024 #define FAMILY_NUMBER 4 #define FAMILY_SIZE (1*KB) #define FAMILY_SIZE2 (5*KB) -#define MULTI_SIZE 128 +#define MULTI_SIZE 128 #define CORE_INCREMENT (4*KB) -const char *FILENAME[] = { +const char *FILENAME[] = { "sec2_file", "core_file", "family_file", "multi_file", - NULL + NULL }; #define COMPAT_BASENAME "family_v1.7_" - + /*------------------------------------------------------------------------- - * Function: test_sec2 + * Function: test_sec2 * * Purpose: Tests the file handle interface for SEC2 driver * @@ -59,16 +59,16 @@ const char *FILENAME[] = { * *------------------------------------------------------------------------- */ -static herr_t +static herr_t test_sec2(void) { hid_t file=(-1), fapl, access_fapl = -1; char filename[1024]; int *fhandle=NULL; hsize_t file_size; - + TESTING("SEC2 file driver"); - + /* Set property list and file name for SEC2 driver. */ fapl = h5_fileaccess(); if(H5Pset_fapl_sec2(fapl)<0) @@ -96,9 +96,9 @@ test_sec2(void) if(H5Fget_filesize(file, &file_size) < 0) goto error; - /* There is no garantee the size of metadata in file is constant. + /* There is no garantee the size of metadata in file is constant. * Just try to check if it's reasonable. It's 2KB right now. - */ + */ if(file_size<1*KB || file_size>4*KB) goto error; @@ -107,7 +107,7 @@ test_sec2(void) h5_cleanup(FILENAME, fapl); PASSED(); return 0; - + error: H5E_BEGIN_TRY { H5Pclose (fapl); @@ -118,23 +118,23 @@ error: /*------------------------------------------------------------------------- - * Function: test_core - * + * Function: test_core + * * Purpose: Tests the file handle interface for CORE driver - * + * * Return: Success: exit(0) - * + * * Failure: exit(1) - * + * * Programmer: Raymond Lu * Tuesday, Sept 24, 2002 - * + * * Modifications: * * Raymond Lu * Wednesday, June 23, 2004 * Added test for H5Fget_filesize. - * + * *------------------------------------------------------------------------- */ static herr_t @@ -152,7 +152,7 @@ test_core(void) if(H5Pset_fapl_core(fapl, CORE_INCREMENT, TRUE)<0) goto error; h5_fixname(FILENAME[1], fapl, filename, sizeof filename); - + if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) goto error; @@ -176,9 +176,9 @@ test_core(void) if(H5Fget_filesize(file, &file_size) < 0) goto error; - /* There is no garantee the size of metadata in file is constant. - * Just try to check if it's reasonable. Why is this 4KB? - */ + /* There is no garantee the size of metadata in file is constant. + * Just try to check if it's reasonable. Why is this 4KB? + */ if(file_size<2*KB || file_size>6*KB) goto error; @@ -187,7 +187,7 @@ test_core(void) h5_cleanup(FILENAME, fapl); PASSED(); return 0; - + error: H5E_BEGIN_TRY { H5Pclose (fapl); @@ -195,7 +195,7 @@ error: } H5E_END_TRY; return -1; } - + /*------------------------------------------------------------------------- * Function: test_family @@ -243,9 +243,9 @@ test_family(void) if(H5Fclose(file)<0) goto error; - - /* Tries to reopen the file with member file size smaller than - * actual 1st member file size(976 bytes). The library is + + /* Tries to reopen the file with member file size smaller than + * actual 1st member file size(976 bytes). The library is * supposed to adjust the member size to 976 bytes. */ if(H5Pset_fapl_family(fapl, (hsize_t)512, H5P_DEFAULT)<0) goto error; @@ -279,7 +279,7 @@ test_family(void) for(i=0; i20*KB) goto error; @@ -312,7 +312,7 @@ test_family(void) if(file_size<32*KB || file_size>40*KB) goto error; } - + if(H5Sclose(space)<0) goto error; if(H5Dclose(dset)<0) @@ -340,7 +340,7 @@ error: /*------------------------------------------------------------------------- * Function: test_family_compat * - * Purpose: Tests the forward compatibility for FAMILY driver. + * Purpose: Tests the forward compatibility for FAMILY driver. * See if we can open files created with v1.7 library. * The source file was created by the test/file_handle.c * of the v1.7 library. Then tools/misc/h5repart.c was @@ -357,13 +357,13 @@ error: * Modifications: *------------------------------------------------------------------------- */ -static herr_t +static herr_t test_family_compat(void) { hid_t file=(-1), fapl; char filename[1024]; char pathname[1024]; - char *srcdir = getenv("srcdir"); /*where the src code is located*/ + char *srcdir = getenv("srcdir"); /*where the src code is located*/ TESTING("FAMILY file driver forward compatibility"); @@ -379,7 +379,7 @@ test_family_compat(void) if(srcdir && ((strlen(srcdir) + strlen(filename) + 1) < sizeof(pathname))) { strcpy(pathname, srcdir); strcat(pathname, "/"); - } + } strcat(pathname, filename); if((file=H5Fopen(pathname, H5F_ACC_RDONLY, fapl))<0) @@ -388,7 +388,7 @@ test_family_compat(void) if(H5Fclose(file)<0) goto error; - h5_cleanup(FILENAME, fapl); + h5_cleanup(FILENAME, fapl); PASSED(); return 0; @@ -417,7 +417,7 @@ error: * Raymond Lu * Wednesday, June 23, 2004 * Added test for H5Fget_filesize. - * + * *------------------------------------------------------------------------- */ static herr_t @@ -457,7 +457,7 @@ test_multi(void) memb_name[H5FD_MEM_SUPER] = sv[H5FD_MEM_SUPER]; memb_addr[H5FD_MEM_SUPER] = 0; - memb_fapl[H5FD_MEM_DRAW] = H5P_DEFAULT; + memb_fapl[H5FD_MEM_DRAW] = H5P_DEFAULT; sprintf(sv[H5FD_MEM_DRAW], "%%s-%c.h5", 'r'); memb_name[H5FD_MEM_DRAW] = sv[H5FD_MEM_DRAW]; memb_addr[H5FD_MEM_DRAW] = HADDR_MAX/2; @@ -488,13 +488,13 @@ test_multi(void) /* Before any data is written, the raw data file is empty. So * the file size is only the size of metadata file. It's supposed * to be 2KB. - */ + */ if(file_size<1*KB || file_size>4*KB) goto error; if((dset=H5Dcreate(file, dname, H5T_NATIVE_INT, space, H5P_DEFAULT))<0) goto error; - + for(i=0; i HADDR_MAX) goto error; @@ -534,49 +534,49 @@ test_multi(void) goto error; if(H5Pclose(fapl2)<0) goto error; - if(H5Fclose(file)<0) - goto error; + if(H5Fclose(file)<0) + goto error; - h5_cleanup(FILENAME, fapl); - PASSED(); + h5_cleanup(FILENAME, fapl); + PASSED(); + + return 0; - return 0; - -error: - H5E_BEGIN_TRY { +error: + H5E_BEGIN_TRY { H5Sclose(space); H5Dclose(dset); H5Pclose(fapl); H5Pclose(fapl2); - H5Fclose(file); - } H5E_END_TRY; - return -1; -} + H5Fclose(file); + } H5E_END_TRY; + return -1; +} /*------------------------------------------------------------------------- * Function: main - * - * Purpose: Tests the file handle interface(H5Fget_vfd_handle and + * + * Purpose: Tests the file handle interface(H5Fget_vfd_handle and * H5FDget_vfd_handle) - * + * * Return: Success: exit(0) - * + * * Failure: exit(1) - * + * * Programmer: Raymond Lu * Tuesday, Sept 24, 2002 - * + * * Modifications: * *------------------------------------------------------------------------- */ int main(void) -{ +{ int nerrors=0; - - h5_reset(); + + h5_reset(); nerrors += test_sec2()<0 ?1:0; nerrors += test_core()<0 ?1:0; diff --git a/test/fillval.c b/test/fillval.c index a5a2886..07da951 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -45,7 +45,7 @@ typedef struct { char z; } comp_datatype; -/* The fill_old.h5 is generated from gen_old_fill.c in HDF5 'test' directory +/* The fill_old.h5 is generated from gen_old_fill.c in HDF5 'test' directory * for version 1.4(after 1.4.3). To get this data file, simply compile * gen_old_fill.c with HDF5 library (before v1.5) and run it. */ #define FILE_COMPATIBLE "fill_old.h5" @@ -53,16 +53,16 @@ typedef struct { /*------------------------------------------------------------------------- - * Function: create_compound_type + * Function: create_compound_type * - * Purpose: create a compound datatype + * Purpose: create a compound datatype * - * Return: Success: datatype ID + * Return: Success: datatype ID * - * Failure: -1 + * Failure: -1 * - * Programmer: Raymond Lu - * Monday, Jan 26, 2001 + * Programmer: Raymond Lu + * Monday, Jan 26, 2001 * * Modifications: * @@ -71,7 +71,7 @@ typedef struct { static hid_t create_compound_type(void) { hid_t ret_value=-1; - + if((ret_value = H5Tcreate(H5T_COMPOUND, sizeof(comp_datatype)))<0) goto error; if(H5Tinsert(ret_value, "a", HOFFSET(comp_datatype,a), H5T_NATIVE_FLOAT)<0) @@ -80,7 +80,7 @@ static hid_t create_compound_type(void) goto error; if(H5Tinsert(ret_value, "y", HOFFSET(comp_datatype,y), H5T_NATIVE_DOUBLE)<0) goto error; - if(H5Tinsert(ret_value, "z", HOFFSET(comp_datatype,z), H5T_NATIVE_CHAR)<0) + if(H5Tinsert(ret_value, "z", HOFFSET(comp_datatype,z), H5T_NATIVE_CHAR)<0) goto error; return ret_value; @@ -122,7 +122,7 @@ test_getset(void) struct fill_ss { short v1, v2; } fill_ss, fill_ss_rd; - + TESTING("property lists"); /* @@ -144,7 +144,7 @@ test_getset(void) H5T_NATIVE_INT)<0) { goto error; } - + /* * Reading the fill value from a dataset creation property list that has * no fill value should result in a failure. @@ -230,14 +230,14 @@ test_getset(void) * Modifications: * Many new cases have been added to this test since * the fill value design has been modified. - * + * *------------------------------------------------------------------------- */ static int test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) { hid_t file=-1, space=-1, dcpl=-1, comp_type_id=-1; - hid_t dset1=-1, dset2=-1, dset3=-1, dset4=-1, dset5=-1, + hid_t dset1=-1, dset2=-1, dset3=-1, dset4=-1, dset5=-1, dset6=-1, /* dset7=-1, */ dset8=-1, dset9=-1; hsize_t cur_size[5] = {2, 8, 8, 4, 2}; hsize_t ch_size[5] = {1, 1, 1, 4, 1}; @@ -248,7 +248,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) H5D_alloc_time_t alloc_time; H5D_fill_time_t fill_time; comp_datatype rd_c, fill_ctype; - + if (H5D_CHUNKED==layout) { TESTING("chunked dataset creation"); } else if (H5D_COMPACT==layout) { @@ -317,16 +317,16 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) if ((dset4=H5Dcreate(file, "dset4", H5T_NATIVE_LONG, space, dcpl))<0) goto error; - /* 6. fill value is undefined while fill write time is H5D_FILL_TIME_ALLOC. + /* 6. fill value is undefined while fill write time is H5D_FILL_TIME_ALLOC. * Supposed to fail. */ if(H5Pset_fill_value(dcpl, -1, NULL)<0) goto error; - if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error; + if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error; H5E_BEGIN_TRY { if(H5Dcreate(file, "dset7", H5T_NATIVE_LONG, space, dcpl)!=FAIL) goto error; } H5E_END_TRY; } - + /* II. Test early space allocation cases */ if (H5Pclose(dcpl)<0) goto error; @@ -356,13 +356,13 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) /* 3. Write fill value at space allocation time */ if(H5Pset_fill_time(dcpl, H5D_FILL_TIME_ALLOC) < 0) goto error; if((dset6 = H5Dcreate(file, "dset6", H5T_NATIVE_LONG, space, dcpl))<0) - goto error; + goto error; - /* 4. fill value is undefined while fill write time is H5D_FILL_TIME_ALLOC. + /* 4. fill value is undefined while fill write time is H5D_FILL_TIME_ALLOC. * Supposed to fail. */ if(H5Pset_fill_value(dcpl, -1, NULL)<0) goto error; H5E_BEGIN_TRY { - if(H5Dcreate(file, "dset7", H5T_NATIVE_LONG, space, dcpl)!=FAIL) + if(H5Dcreate(file, "dset7", H5T_NATIVE_LONG, space, dcpl)!=FAIL) goto error; } H5E_END_TRY; @@ -416,7 +416,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) #endif if (H5Dclose(dset2)<0) goto error; if (H5Pclose(dcpl)<0) goto error; - + /* 3. No conversion */ if ((dset3=H5Dopen(file, "dset3"))<0) goto error; if ((dcpl=H5Dget_create_plist(dset3))<0) goto error; @@ -494,7 +494,7 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) printf(" %d: Got unallocated space instead of allocated.\n",__LINE__); printf(" Got %d\n", allocation); goto error; - } + } if(H5Pget_alloc_time(dcpl, &alloc_time)<0) goto error; if(alloc_time != H5D_ALLOC_TIME_EARLY) { H5_FAILED(); @@ -542,14 +542,14 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) if (H5Dclose(dset6)<0) goto error; if (H5Pclose(dcpl)<0) goto error; - /* 3. Compound datatype test */ + /* 3. Compound datatype test */ if ((dset8=H5Dopen(file, "dset8"))<0) goto error; if ((dcpl=H5Dget_create_plist(dset8))<0) goto error; if (H5Pget_fill_value(dcpl, comp_type_id, &rd_c)<0) goto error; if( rd_c.a != 0 || rd_c.y != fill_ctype.y || rd_c.x != 0 || rd_c.z!='\0') { H5_FAILED(); puts(" Got wrong fill value"); - printf(" Got rd_c.a=%f, rd_c.y=%f and rd_c.x=%d, rd_c.z=%c\n", + printf(" Got rd_c.a=%f, rd_c.y=%f and rd_c.x=%d, rd_c.z=%c\n", rd_c.a, rd_c.y, rd_c.x, rd_c.z); } if (H5Dclose(dset8)<0) goto error; @@ -591,14 +591,14 @@ test_create(hid_t fapl, const char *base_name, H5D_layout_t layout) * Thursday, October 1, 1998 * * Modifications: - * This function is called by test_rdwr to write and read + * This function is called by test_rdwr to write and read * dataset for different cases. * *------------------------------------------------------------------------- */ static int -test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, - H5D_fill_time_t fill_time, H5D_layout_t layout, +test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, + H5D_fill_time_t fill_time, H5D_layout_t layout, H5T_class_t datatype, hid_t ctype_id) { hid_t fspace=-1, mspace=-1, dset1=-1, dset2=-1; @@ -613,7 +613,7 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, comp_datatype *buf_c=NULL; H5D_space_status_t allocation; - if (datatype==H5T_INTEGER) + if (datatype==H5T_INTEGER) fillval = *(int*)_fillval; else if(datatype==H5T_COMPOUND) { fill_c.a=((comp_datatype*)_fillval)->a; @@ -624,10 +624,10 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, puts("Invalid type for test"); goto error; } - + /* Create dataset */ if ((fspace=H5Screate_simple(5, cur_size, cur_size))<0) goto error; - if (datatype==H5T_INTEGER && (dset1=H5Dcreate(file, dname, H5T_NATIVE_INT, + if (datatype==H5T_INTEGER && (dset1=H5Dcreate(file, dname, H5T_NATIVE_INT, fspace, dcpl))<0) goto error; if (datatype==H5T_COMPOUND && (dset2=H5Dcreate(file, dname, ctype_id, fspace, dcpl))<0) goto error; @@ -642,7 +642,7 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, one, NULL)<0) goto error; /* case for atomic datatype */ if (datatype==H5T_INTEGER) { - if(H5Dread(dset1, H5T_NATIVE_INT, mspace, fspace, H5P_DEFAULT, + if(H5Dread(dset1, H5T_NATIVE_INT, mspace, fspace, H5P_DEFAULT, &val_rd)<0) goto error; if (fill_time!=H5D_FILL_TIME_NEVER && val_rd!=fillval) { H5_FAILED(); @@ -659,7 +659,7 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, if(H5Dread(dset2, ctype_id, mspace, fspace, H5P_DEFAULT, &rd_c)<0) goto error; if (fill_time!=H5D_FILL_TIME_NEVER && (rd_c.a!=fill_c.a || - rd_c.x!=fill_c.x || rd_c.y!=fill_c.y || + rd_c.x!=fill_c.x || rd_c.y!=fill_c.y || rd_c.z!=fill_c.z)) { H5_FAILED(); puts(" Value read was not a fill value."); @@ -667,7 +667,7 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, "Fill value: %f, %d, %f, %c\n", hs_offset[0], hs_offset[1], hs_offset[2], hs_offset[3], - hs_offset[4], rd_c.a, rd_c.x, rd_c.y, rd_c.z, + hs_offset[4], rd_c.a, rd_c.x, rd_c.y, rd_c.z, fill_c.a, fill_c.x, fill_c.y, fill_c.z); goto error; } @@ -694,8 +694,8 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval, for (u=0; u 2) { printf ("Incorrect command line. \n"); printf ("Correct command line: %s [DATASET NAME] \n", argv[0]); @@ -82,40 +82,40 @@ main (int argc, char **argv) "\"Int1Array\"\n"); exit(1); } - + printf ("Correct command line: %s [DATASET NAME] \n", argv[0]); printf ("The two datasets present in the file are: \"IntArray\" and " "\"Int1Array\"\n"); printf ("Default dataset is IntArray. \n"); - - if (argc == 1) + + if (argc == 1) strcpy (DATASETNAME, "IntArray"); else if (!strcmp(argv[1],"IntArray") || !strcmp(argv[1],"Int1Array")) strcpy (DATASETNAME, argv[1]); else strcpy (DATASETNAME, "IntArray"); printf ("\n Reading dataset %s \n\n", DATASETNAME); - + for (j = 0; j < NX; j++) { for (i = 0; i < NY; i++) { for (k = 0; k < NZ ; k++) data_out[j][i][k] = 0; } - } - + } + /* Create access property list and set the driver to GASS */ fapl = H5Pcreate (H5P_FILE_ACCESS); if (fapl < 0) { printf (" H5Pcreate failed. \n"); return -1; } - - + + ginf.block_size = 0; ginf.max_length =0; - + /* ginf = GASS_INFO_NULL; */ - + status = H5Pset_fapl_gass (fapl, ginf); if (status < 0) { printf ("H5Pset_fapl_gass failed. \n"); @@ -132,7 +132,7 @@ main (int argc, char **argv) * Get datatype and dataspace handles and then query * dataset class, order, size, rank and dimensions. */ - datatype = H5Dget_type(dataset); /* datatype handle */ + datatype = H5Dget_type(dataset); /* datatype handle */ class = H5Tget_class(datatype); if (class == H5T_INTEGER) printf("Data set has INTEGER type \n"); order = H5Tget_order(datatype); @@ -147,14 +147,14 @@ main (int argc, char **argv) printf("rank %d, dimensions %lu x %lu \n", rank, (unsigned long)(dims_out[0]), (unsigned long)(dims_out[1])); - /* - * Define hyperslab in the dataset. + /* + * Define hyperslab in the dataset. */ offset[0] = 1; offset[1] = 2; count[0] = NX_SUB; count[1] = NY_SUB; - status = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, NULL, + status = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, NULL, count, NULL); /* @@ -163,10 +163,10 @@ main (int argc, char **argv) dimsm[0] = NX; dimsm[1] = NY; dimsm[2] = NZ ; - memspace = H5Screate_simple(RANK_OUT,dimsm,NULL); + memspace = H5Screate_simple(RANK_OUT,dimsm,NULL); - /* - * Define memory hyperslab. + /* + * Define memory hyperslab. */ offset_out[0] = 3; offset_out[1] = 0; @@ -174,11 +174,11 @@ main (int argc, char **argv) count_out[0] = NX_SUB; count_out[1] = NY_SUB; count_out[2] = 1; - status = H5Sselect_hyperslab(memspace, H5S_SELECT_SET, offset_out, NULL, + status = H5Sselect_hyperslab(memspace, H5S_SELECT_SET, offset_out, NULL, count_out, NULL); /* - * Read data from hyperslab in the file into the hyperslab in + * Read data from hyperslab in the file into the hyperslab in * memory and display. */ status = H5Dread(dataset, H5T_NATIVE_INT, memspace, dataspace, @@ -191,7 +191,7 @@ main (int argc, char **argv) * 0 0 0 0 0 0 0 * 0 0 0 0 0 0 0 * 0 0 0 0 0 0 0 - * 3 4 5 6 0 0 0 + * 3 4 5 6 0 0 0 * 4 5 6 7 0 0 0 * 5 6 7 8 0 0 0 * 0 0 0 0 0 0 0 @@ -206,7 +206,7 @@ main (int argc, char **argv) H5Sclose(memspace); H5Fclose(file); H5Pclose(fapl); - + return 0; -} +} #endif diff --git a/test/gass_write.c b/test/gass_write.c index 6017224..c5974a7 100644 --- a/test/gass_write.c +++ b/test/gass_write.c @@ -17,10 +17,10 @@ * Friday, August 6, 1999. * * Modifications: Saurabh Bagchi (Aug 17, 1999) - * Modified to work with VFL (HDF51.3). + * Modified to work with VFL (HDF51.3). */ -/* Test the following functionality of the GASS driver. +/* Test the following functionality of the GASS driver. 1. Open a remote file for write. 2. Create a new dataset within the file. 3. Create a local memory buffer to hold the data. @@ -38,7 +38,7 @@ int main(void) #ifdef hide -/*#define URL "ftp://gass:gass12@which/tmp/gass/junk.w"*/ +/*#define URL "ftp://gass:gass12@which/tmp/gass/junk.w"*/ #define URL "http://paz.ncsa.uiuc.edu:8080/test/put/test/b.h5" #define DATASETNAME "IntArray" @@ -52,44 +52,44 @@ int main (void) hid_t fapl =-1, file; hid_t dataspace, datatype, dataset; hsize_t dimsf[2]; - + herr_t status = 0; int data[NX][NY]; /* data to write */ int i, j; GASS_Info ginf; - - /* - * Data and output buffer initialization. + + /* + * Data and output buffer initialization. */ for (j = 0; j < NX; j++) { for (i = 0; i < NY; i++) data[j][i] = i + j; - } + } /* - * 0 1 2 3 4 5 + * 0 1 2 3 4 5 * 1 2 3 4 5 6 * 2 3 4 5 6 7 * 3 4 5 6 7 8 * 4 5 6 7 8 9 */ - + /* Create access property list and set the driver to GASS */ fapl = H5Pcreate (H5P_FILE_ACCESS); if (fapl < 0) { printf (" H5Pcreate failed. \n"); return -1; } - + ginf.block_size = 0; ginf.max_length =0; /* ginf = GASS_INFO_NULL;*/ - + status = H5Pset_fapl_gass (fapl, ginf); if (status < 0) { printf ("H5Pset_fapl_gass failed. \n"); return -1; } - + /* * Create a new file using H5F_ACC_TRUNC access, * default file creation properties, and gass file @@ -108,20 +108,20 @@ int main (void) printf ("H5Fcreate failed. \n"); return -1; } - + /* * Describe the size of the array and create the data space for fixed - * size dataset. + * size dataset. */ dimsf[0] = NX; dimsf[1] = NY; - dataspace = H5Screate_simple(RANK, dimsf, NULL); + dataspace = H5Screate_simple(RANK, dimsf, NULL); if (dataspace < 0) { printf ("H5Screate failed. \n"); return -1; } - /* + /* * Define datatype for the data in the file. * We will store little endian INT numbers. */ @@ -130,7 +130,7 @@ int main (void) printf ("H5Tcopy failed. \n"); return -1; } - + status = H5Tset_order(datatype, H5T_ORDER_LE); if (status < 0) { printf ("H5Tset_order failed. \n"); @@ -166,14 +166,14 @@ int main (void) H5Dclose(dataset); H5Fclose(file); H5Pclose(fapl); - + return 0; } -#else +#else int main(void) { printf("Test skipped because writing depends on web server!\n"); return 0; } -#endif +#endif #endif diff --git a/test/gen_deflate.c b/test/gen_deflate.c index 519e907..7154c84 100644 --- a/test/gen_deflate.c +++ b/test/gen_deflate.c @@ -40,11 +40,11 @@ int data[SPACE_DIM1][SPACE_DIM2]; /*------------------------------------------------------------------------- * Function: main * - * Purpose: + * Purpose: * - * Return: Success: + * Return: Success: * - * Failure: + * Failure: * * Programmer: Quincey Koziol * Thursday, November 14, 2002 diff --git a/test/gen_new_array.c b/test/gen_new_array.c index af310cb..82237e4 100644 --- a/test/gen_new_array.c +++ b/test/gen_new_array.c @@ -44,11 +44,11 @@ /*------------------------------------------------------------------------- * Function: main * - * Purpose: + * Purpose: * - * Return: Success: + * Return: Success: * - * Failure: + * Failure: * * Programmer: Robb Matzke * Monday, October 26, 1998 diff --git a/test/gen_new_fill.c b/test/gen_new_fill.c index 08c0882..0615504 100644 --- a/test/gen_new_fill.c +++ b/test/gen_new_fill.c @@ -14,15 +14,15 @@ /* * Programmer: Raymond Lu - * Feb 27, 2002 + * Feb 27, 2002 * * Purpose: This program is run to generate a HDF5 data file with fill * value property. A new fill value design has been put into * library v1.5. To test compatibility between v1.4 and v1.5, * compile and run this program, it will generate a file called - * fill_new.h5. You need to move it to the /test directory + * fill_new.h5. You need to move it to the /test directory * in HDF5 v1.4 source codes. The fillval.c program will read it. - * + * */ #include "h5test.h" @@ -46,16 +46,16 @@ int main() if(H5Pset_fill_time(dcpl, H5D_ALLOC) < 0) goto error; if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill_val1)<0) goto error; if((dset1 = H5Dcreate(file, "dset1", H5T_NATIVE_INT, space, dcpl))<0) - goto error; + goto error; if (H5Dget_space_status(dset1, &allocation)<0) goto error; if (allocation == H5D_SPACE_STATUS_NOT_ALLOCATED) { puts(" Got unallocated space instead of allocated."); printf(" Got %d\n", allocation); goto error; } - if(H5Dclose(dset1)<0) goto error; + if(H5Dclose(dset1)<0) goto error; - /* Create a dataset with space allocation being delayed */ + /* Create a dataset with space allocation being delayed */ if(H5Pset_space_time(dcpl, H5D_LATE) < 0) goto error; if(H5Pset_fill_time(dcpl, H5D_ALLOC) < 0) goto error; if(H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fill_val2)<0) goto error; diff --git a/test/gen_new_mtime.c b/test/gen_new_mtime.c index 3e1a891..4445834 100644 --- a/test/gen_new_mtime.c +++ b/test/gen_new_mtime.c @@ -33,11 +33,11 @@ /*------------------------------------------------------------------------- * Function: main * - * Purpose: + * Purpose: * - * Return: Success: + * Return: Success: * - * Failure: + * Failure: * * Programmer: Quincey Koziol * Friday, January 3, 2003 diff --git a/test/gen_new_super.c b/test/gen_new_super.c index b8de65c..4115e9b 100644 --- a/test/gen_new_super.c +++ b/test/gen_new_super.c @@ -36,8 +36,8 @@ * * Purpose: Create a file with a new version (>0) of the superblock * - * Return: Success: - * Failure: + * Return: Success: + * Failure: * * Programmer: Quincey Koziol * Tuesday, July 15, 2003 diff --git a/test/gen_nullspace.c b/test/gen_nullspace.c index 5892443..fd73f24 100644 --- a/test/gen_nullspace.c +++ b/test/gen_nullspace.c @@ -41,18 +41,18 @@ main(void) hid_t did; /* Dataset ID */ hid_t attr; /* Attribute ID */ herr_t ret; /* Generic return value */ - + /* Create the file */ fid = H5Fcreate(NULLFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); assert(fid>0); sid = H5Screate(H5S_NULL); assert(sid>0); - + /* Create dataset */ did = H5Dcreate(fid, NULLDATASET, H5T_NATIVE_UINT, sid, H5P_DEFAULT); assert(did>0); - + /* Close the dataset */ ret = H5Dclose(did); assert(ret>=0); @@ -64,23 +64,23 @@ main(void) /* Create an attribute for the group */ attr=H5Acreate(gid,NULLATTR,H5T_NATIVE_INT,sid,H5P_DEFAULT); assert(attr>0); - + /* Close attribute */ ret=H5Aclose(attr); assert(ret>=0); - + /* Close the group */ ret = H5Gclose(gid); assert(ret>=0); - + /* Close the dataspace */ ret = H5Sclose(sid); assert(ret>=0); - + /* Close the file */ ret = H5Fclose(fid); assert(ret>=0); - + return 0; } diff --git a/test/gen_old_array.c b/test/gen_old_array.c index 69206b1..0879c13 100644 --- a/test/gen_old_array.c +++ b/test/gen_old_array.c @@ -43,11 +43,11 @@ /*------------------------------------------------------------------------- * Function: main * - * Purpose: + * Purpose: * - * Return: Success: + * Return: Success: * - * Failure: + * Failure: * * Programmer: Robb Matzke * Monday, October 26, 1998 diff --git a/test/gen_old_layout.c b/test/gen_old_layout.c index 46bbdaf..ddc3d35 100644 --- a/test/gen_old_layout.c +++ b/test/gen_old_layout.c @@ -39,11 +39,11 @@ /*------------------------------------------------------------------------- * Function: main * - * Purpose: + * Purpose: * - * Return: Success: + * Return: Success: * - * Failure: + * Failure: * * Programmer: Quincey Koziol * Friday, January 3, 2003 diff --git a/test/gen_old_mtime.c b/test/gen_old_mtime.c index 9a52693..daaf78f 100644 --- a/test/gen_old_mtime.c +++ b/test/gen_old_mtime.c @@ -33,11 +33,11 @@ /*------------------------------------------------------------------------- * Function: main * - * Purpose: + * Purpose: * - * Return: Success: + * Return: Success: * - * Failure: + * Failure: * * Programmer: Quincey Koziol * Friday, January 3, 2003 diff --git a/test/getname.c b/test/getname.c index 4371018..5ee2139 100644 --- a/test/getname.c +++ b/test/getname.c @@ -48,7 +48,7 @@ static int check_name( char *name, const char* check ) int ret = HDstrcmp( name, check ); HDstrcpy( name, "" ); return ret; - + } #define NAME_BUF_SIZE 40 @@ -64,7 +64,7 @@ int main( void ) hid_t file_id, file1_id, file2_id, file3_id; hid_t group_id, group2_id, group3_id, group4_id, group5_id, group6_id, group7_id; hid_t dataset_id, dataset2_id; - hid_t space_id; + hid_t space_id; hid_t type_id, type2_id; hsize_t dims[1] = { 5 }; @@ -89,7 +89,7 @@ int main( void ) h5_fixname(FILENAME[1], fapl, filename1, sizeof filename1); h5_fixname(FILENAME[2], fapl, filename2, sizeof filename2); h5_fixname(FILENAME[3], fapl, filename3, sizeof filename3); - + /* Create a new file_id using default properties. */ if ((file_id = H5Fcreate( filename0, H5F_ACC_TRUNC, H5P_DEFAULT, fapl ))<0) goto out; @@ -106,7 +106,7 @@ int main( void ) /* Get name */ if (H5Iget_name( group_id, name, size )<0) goto out; - + /* Verify */ if (check_name( name, "/g0" )!=0) goto out; @@ -132,18 +132,18 @@ int main( void ) /* Get name */ if (H5Iget_name( group_id, name, size )<0) goto out; - + /* Verify */ if (check_name( name, "/g1" )!=0) goto out; /* Get name */ if (H5Iget_name( group2_id, name, size )<0) goto out; - + /* Verify */ if (check_name( name, "/g1/g2" )!=0) goto out; - + /* Close */ H5Gclose( group_id ); H5Gclose( group2_id ); @@ -154,7 +154,7 @@ int main( void ) /*------------------------------------------------------------------------- * Test H5Iget_name with H5Gopen *------------------------------------------------------------------------- - */ + */ TESTING("H5Iget_name with H5Gopen"); @@ -170,14 +170,14 @@ int main( void ) /* Verify */ if (check_name( name, "/g1" )!=0) goto out; - + /* Get name */ if (H5Iget_name( group2_id, name, size )<0) goto out; /* Verify */ if (check_name( name, "/g1/g2" )!=0) goto out; - + /* Close */ H5Gclose( group_id ); H5Gclose( group2_id ); @@ -193,12 +193,12 @@ int main( void ) */ TESTING("H5Iget_name with H5Dcreate"); - + /* Create the data space */ if ((space_id = H5Screate_simple( 1, dims, NULL ))<0) goto out; /* Create a new dataset */ - if ((dataset_id = H5Dcreate( file_id , "d1", H5T_NATIVE_INT, space_id, + if ((dataset_id = H5Dcreate( file_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT ))<0) goto out; /* Get name */ @@ -207,27 +207,27 @@ int main( void ) /* Verify */ if (check_name( name, "/d1" )!=0) goto out; - + /* Close */ - H5Dclose( dataset_id ); + H5Dclose( dataset_id ); /* Reopen the group */ if ((group_id = H5Gopen( file_id, "g1" ))<0) goto out; /* Create a new dataset inside "g1" */ - if ((dataset_id = H5Dcreate( group_id , "d1", H5T_NATIVE_INT, space_id, + if ((dataset_id = H5Dcreate( group_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT ))<0) goto out; - + /* Get name */ if (H5Iget_name( dataset_id, name, size )<0) goto out; /* Verify */ if (check_name( name, "/g1/d1" )!=0) goto out; - + /* Close */ H5Gclose( group_id ); - H5Dclose( dataset_id ); + H5Dclose( dataset_id ); H5Sclose( space_id ); PASSED(); @@ -252,7 +252,7 @@ int main( void ) goto out; /* Close */ - H5Dclose( dataset_id ); + H5Dclose( dataset_id ); /* Reopen the group */ @@ -269,7 +269,7 @@ int main( void ) goto out; /* Close */ - H5Dclose( dataset_id ); + H5Dclose( dataset_id ); H5Gclose( group_id ); PASSED(); @@ -287,14 +287,14 @@ int main( void ) if ((group_id = H5Gcreate( file_id, "g2", 0 ))<0) goto out; if ((group2_id = H5Gcreate( file_id, "g2/bar", 0 ))<0) goto out; if ((group3_id = H5Gcreate( file_id, "g2/bar/baz", 0 ))<0) goto out; - + /* Create a dataset */ if ((space_id = H5Screate_simple( 1, dims, NULL ))<0) goto out; - if ((dataset_id = H5Dcreate( group3_id , "d1", H5T_NATIVE_INT, space_id, + if ((dataset_id = H5Dcreate( group3_id , "d1", H5T_NATIVE_INT, space_id, H5P_DEFAULT ))<0) goto out; - + /* Close */ - H5Dclose( dataset_id ); + H5Dclose( dataset_id ); H5Sclose( space_id ); H5Gclose( group_id ); H5Gclose( group2_id ); @@ -330,10 +330,10 @@ int main( void ) if (H5Tinsert (type_id, "a", HOFFSET(s1_t,a), H5T_NATIVE_INT)<0) goto out; if (H5Tinsert (type_id, "b", HOFFSET(s1_t,b), H5T_NATIVE_INT)<0) goto out; if (H5Tinsert (type_id, "c", HOFFSET(s1_t,c), H5T_NATIVE_FLOAT)<0) goto out; - + /* Save datatype for later */ if (H5Tcommit (file_id, "t1", type_id)<0) goto out; - + /* Get name */ if (H5Iget_name( type_id, name, size )<0) goto out; @@ -347,7 +347,7 @@ int main( void ) PASSED(); /*------------------------------------------------------------------------- - * Test H5Iget_name with H5Topen + * Test H5Iget_name with H5Topen *------------------------------------------------------------------------- */ @@ -355,7 +355,7 @@ int main( void ) /* Open the named datatype */ if((type_id=H5Topen(file_id, "t1"))<0) goto out; - + /* Get name */ if (H5Iget_name( type_id, name, size )<0) goto out; @@ -389,7 +389,7 @@ int main( void ) /* Verify */ if (check_name( name, "/g1a" )!=0) goto out; - + /* Close */ H5Gclose( group_id ); @@ -419,7 +419,7 @@ int main( void ) goto out; /* Close */ - H5Dclose( dataset_id ); + H5Dclose( dataset_id ); PASSED(); @@ -438,7 +438,7 @@ int main( void ) /* Rename datatype */ if (H5Gmove( file_id, "/t1", "/t1a" )<0) goto out; - + /* Get name */ if (H5Iget_name( type_id, name, size )<0) goto out; @@ -460,7 +460,7 @@ int main( void ) TESTING("H5Iget_name with H5Gmove and relative names"); /* Create group "/g3" */ - if ((group_id = H5Gcreate( file_id, "/g3", 0 ))<0) goto out; + if ((group_id = H5Gcreate( file_id, "/g3", 0 ))<0) goto out; /* Create group "/g3/foo" using absolute name */ if ((group2_id = H5Gcreate( file_id, "/g3/foo1", 0 ))<0) goto out; @@ -473,7 +473,7 @@ int main( void ) /* Get name */ if (H5Iget_name( group_id, name, size )<0) goto out; - + /* Verify */ if (check_name( name, "/g3" )!=0) goto out; @@ -494,7 +494,7 @@ int main( void ) /* Get name */ if (H5Iget_name( group_id, name, size )<0) goto out; - + /* Verify */ if (check_name( name, "/g3" )!=0) goto out; @@ -515,7 +515,7 @@ int main( void ) H5Gclose( group2_id ); H5Gclose( group3_id ); - + PASSED(); @@ -548,7 +548,7 @@ int main( void ) /* Get name */ if (H5Iget_name( group3_id, name, size )<0) goto out; - + /* Verify */ if (check_name( name, "/g5/C/D" )!=0) goto out; @@ -611,16 +611,16 @@ int main( void ) /* Get name */ if (H5Iget_name( group2_id, name, size )<0) goto out; - + /* Verify */ if (check_name( name, "/g7/C" )!=0) goto out; - + /* Get name */ if (H5Iget_name( group3_id, name, size )<0) goto out; - + /* Verify */ if (check_name( name, "/g7/C/B" )!=0) goto out; - + /* Close */ H5Gclose( group_id ); H5Gclose( group2_id ); @@ -630,7 +630,7 @@ int main( void ) PASSED(); /*------------------------------------------------------------------------- - * Test H5Iget_name with H5Gunlink + * Test H5Iget_name with H5Gunlink *------------------------------------------------------------------------- */ @@ -641,7 +641,7 @@ int main( void ) /* Delete */ if (H5Gunlink( file_id, "/g8")<0) goto out; - + /* Get name */ if (H5Iget_name( group_id, name, size )<0) goto out; @@ -759,7 +759,7 @@ int main( void ) /* Create group "g11/g" */ if ((group_id = H5Gcreate( file_id, "g11", 0 ))<0) goto out; if ((group2_id = H5Gcreate( file_id, "g11/g", 0 ))<0) goto out; - + /* Create two datasets "g11/d" and "g11/g/d"*/ if ((space_id = H5Screate_simple( 1, dims, NULL ))<0) goto out; if ((dataset_id = H5Dcreate( group_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT ))<0) goto out; @@ -779,9 +779,9 @@ int main( void ) /* Verify */ if (check_name( name, "/g11/g/d" )!=0) goto out; - + /* Close */ - H5Dclose( dataset_id ); + H5Dclose( dataset_id ); H5Dclose( dataset2_id ); H5Sclose( space_id ); H5Gclose( group_id ); @@ -799,7 +799,7 @@ int main( void ) /* Create a group "g12" in the first file */ if ((group_id = H5Gcreate( file_id, "/g12", 0 ))<0) goto out; - + /* Close */ H5Gclose( group_id ); @@ -808,7 +808,7 @@ int main( void ) /* Create a data space */ if ((space_id = H5Screate_simple( 1, dims, NULL ))<0) goto out; - + /* Create the dataset */ if ((dataset_id = H5Dcreate( file1_id , "d", H5T_NATIVE_INT, space_id, H5P_DEFAULT ))<0) goto out; @@ -826,7 +826,7 @@ int main( void ) /* Verify */ if (check_name( name, "/g12/d" )!=0) goto out; - + if (H5Funmount(file_id, "/g12")<0) goto out; /* Close */ @@ -849,7 +849,7 @@ int main( void ) if ((group_id = H5Gcreate( file_id, "/g13", 0 ))<0) goto out; if ((group2_id = H5Gcreate( file_id, "/g13/g1", 0 ))<0) goto out; if ((group3_id = H5Gcreate( file_id, "/g13/g1/g2", 0 ))<0) goto out; - + /* Close */ H5Gclose( group_id ); H5Gclose( group2_id ); @@ -1066,7 +1066,7 @@ int main( void ) /*------------------------------------------------------------------------- - * Test H5Iget_name with H5Funmount + * Test H5Iget_name with H5Funmount *------------------------------------------------------------------------- */ @@ -1077,7 +1077,7 @@ int main( void ) if ((group2_id = H5Gcreate( file_id, "/g15/g1", 0 ))<0) goto out; if ((group3_id = H5Gcreate( file_id, "/g15/g1/g2", 0 ))<0) goto out; if ((group4_id = H5Gcreate( file_id, "/g15/g1/g2/g3", 0 ))<0) goto out; - + /* Close */ H5Gclose( group_id ); H5Gclose( group2_id ); @@ -1098,13 +1098,13 @@ int main( void ) /* Access group in the first file */ if ((group_id = H5Gopen( file_id, "/g15/g1/g2/g3"))<0) goto out; - + /* Mount second file under "/g13/g1" in the first file */ if (H5Fmount(file_id, "/g15/g1", file1_id, H5P_DEFAULT)<0) goto out; /* Access group in the second file */ if ((group2_id = H5Gopen( file_id, "/g15/g1/g16/g4/g5"))<0) goto out; - + /* Get name */ if (H5Iget_name( group_id, name, size )< 0) goto out; @@ -1161,7 +1161,7 @@ int main( void ) /* Create group "g17" */ if ((group_id = H5Gcreate( file_id, "g17", 0 ))<0) goto out; - + /* Save datatype for later */ if (H5Tcommit (group_id, "t", type_id)<0) goto out; @@ -1169,18 +1169,18 @@ int main( void ) if ((space_id = H5Screate_simple( 1, dims, NULL ))<0) goto out; /* Create a new dataset */ - if ((dataset_id = H5Dcreate( group_id , "d", type_id, space_id, + if ((dataset_id = H5Dcreate( group_id , "d", type_id, space_id, H5P_DEFAULT ))<0) goto out; - + /* Close */ - H5Dclose( dataset_id ); + H5Dclose( dataset_id ); H5Tclose( type_id ); H5Sclose( space_id ); H5Gclose( group_id ); /* Open the named datatype */ if((type_id=H5Topen(file_id, "/g17/t"))<0) goto out; - + /* Get name */ if (H5Iget_name( type_id, name, size )<0) goto out; @@ -1243,7 +1243,7 @@ PASSED(); */ TESTING("H5Iget_name with different files"); - + /* Create a new file using default properties. */ if ((file2_id = H5Fcreate( filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl ))<0) goto out; @@ -1261,7 +1261,7 @@ PASSED(); /* Delete */ if (H5Gunlink( file2_id, "/d")<0) goto out; - + /* Get name */ if (H5Iget_name( dataset_id, name, size )<0) goto out; @@ -1273,14 +1273,14 @@ PASSED(); /* Verify */ if (check_name( name, "/d" )!=0) goto out; - + /* Close */ - H5Dclose( dataset_id ); - H5Dclose( dataset2_id ); + H5Dclose( dataset_id ); + H5Dclose( dataset2_id ); H5Sclose( space_id ); H5Fclose( file2_id ); H5Fclose( file3_id ); - + PASSED(); @@ -1290,7 +1290,7 @@ PASSED(); */ TESTING("H5Iget_name with different files #2"); - + /* Create a new file using default properties. */ if ((file2_id = H5Fcreate( filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl ))<0) goto out; @@ -1308,7 +1308,7 @@ PASSED(); /* Delete */ if (H5Gunlink( file3_id, "/d")<0) goto out; - + /* Get name */ if (H5Iget_name( dataset_id, name, size )<0) goto out; @@ -1320,20 +1320,20 @@ PASSED(); /* Verify */ if (check_name( name, "" )!=0) goto out; - + /* Close */ - H5Dclose( dataset_id ); - H5Dclose( dataset2_id ); + H5Dclose( dataset_id ); + H5Dclose( dataset2_id ); H5Sclose( space_id ); H5Fclose( file2_id ); H5Fclose( file3_id ); - + PASSED(); /*------------------------------------------------------------------------- * Test H5Iget_name with a small buffer for name *------------------------------------------------------------------------- - */ + */ TESTING("H5Iget_name with a small buffer for name"); @@ -1349,7 +1349,7 @@ PASSED(); /* Verify */ if (check_name( name, "/g17" )!=0) goto out; - + /* Close */ H5Gclose( group_id ); @@ -1359,7 +1359,7 @@ PASSED(); /*------------------------------------------------------------------------- * Test H5Iget_name with a dynamic buffer for name *------------------------------------------------------------------------- - */ + */ TESTING("H5Iget_name with a dynamic buffer for name"); @@ -1371,7 +1371,7 @@ PASSED(); /* Include the extra null character */ name3 = malloc(name_len+1); - + /* Get name */ if (H5Iget_name( group_id, name3, name_len+1 )<0) goto out; @@ -1388,7 +1388,7 @@ PASSED(); if ( name3 ) free(name3); - + /* Close */ H5Gclose( group_id ); @@ -1402,7 +1402,7 @@ PASSED(); TESTING("H5Iget_name with invalid IDs"); - + /* Create a data space */ if ((space_id = H5Screate_simple( 1, dims, NULL ))<0) goto out; @@ -1410,7 +1410,7 @@ PASSED(); if ((type_id = H5Tcopy(H5T_NATIVE_INT))<0) goto out; /* Create a new dataset */ - if ((dataset_id = H5Dcreate( file_id , "d2", type_id, space_id, + if ((dataset_id = H5Dcreate( file_id , "d2", type_id, space_id, H5P_DEFAULT ))<0) goto out; /* Get name for non commited datatype, it should fail */ @@ -1420,7 +1420,7 @@ PASSED(); if (H5Iget_name( space_id, name, size ) >0) goto out; /* Close */ - H5Dclose( dataset_id ); + H5Dclose( dataset_id ); H5Sclose( space_id ); H5Tclose( type_id ); @@ -1437,11 +1437,11 @@ PASSED(); /* Create a group "g18/g2" in the first file */ if ((group_id = H5Gcreate( file_id, "/g18", 0 ))<0) goto out; if ((group2_id = H5Gcreate( file_id, "/g18/g2", 0 ))<0) goto out; - + /* Also create a dataset and a datatype */ if ((space_id = H5Screate_simple( 1, dims, NULL ))<0) goto out; if ((type_id = H5Tcopy(H5T_NATIVE_INT))<0) goto out; - if ((dataset_id = H5Dcreate( file_id, "g18/d2", type_id, space_id, + if ((dataset_id = H5Dcreate( file_id, "g18/d2", type_id, space_id, H5P_DEFAULT ))<0) goto out; if (H5Tcommit(file_id, "g18/t2", type_id) <0) goto out; @@ -1528,7 +1528,7 @@ PASSED(); H5Fclose( file1_id ); PASSED(); - + /*------------------------------------------------------------------------- * Test H5Iget_name with H5Fclose @@ -1536,7 +1536,7 @@ PASSED(); */ TESTING("H5Iget_name with H5Fclose"); - + /* Create a file and group "/g1/g2" in it */ file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); if ((group_id = H5Gcreate( file1_id, "/g1", 0 ))<0) goto out; @@ -1562,7 +1562,7 @@ PASSED(); /* Close */ H5Gclose( group_id ); H5Gclose( group2_id ); - + PASSED(); @@ -1577,7 +1577,7 @@ PASSED(); file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); if ((group_id = H5Gcreate( file1_id, "/g1", 0 ))<0) goto out; if ((group2_id = H5Gcreate( file1_id, "/g1/g2", 0 ))<0) goto out; - + /* Create a new file and group "/g3/g4" in it */ if ((file2_id = H5Fcreate( filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl ))<0) goto out; if ((group3_id = H5Gcreate( file2_id, "/g3", 0 ))<0) goto out; @@ -1585,7 +1585,7 @@ PASSED(); /* Mount first file at "/g3/g4" in the second file */ if(H5Fmount(file2_id, "/g3/g4", file1_id, H5P_DEFAULT)<0) goto out; - + /* Open the mounted group */ if ((group5_id = H5Gopen( file2_id, "/g3/g4/g1/g2" ))<0) goto out; @@ -1597,7 +1597,7 @@ PASSED(); /* Delete */ if (H5Gunlink( file1_id, "/g3/g4/g1/g2")<0) goto out; - + /* Get name */ if (H5Iget_name( group5_id, name, size )<0) goto out; @@ -1609,7 +1609,7 @@ PASSED(); /* Verify */ if (check_name( name, "" )!=0) goto out; - + /* Close */ H5Gclose( group_id ); H5Gclose( group2_id ); @@ -1618,7 +1618,7 @@ PASSED(); H5Gclose( group5_id ); H5Fclose( file1_id ); H5Fclose( file2_id ); - + PASSED(); @@ -1634,7 +1634,7 @@ PASSED(); file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); if ((group_id = H5Gcreate( file1_id, "/g1", 0 ))<0) goto out; if ((group2_id = H5Gcreate( file1_id, "/g1/g2", 0 ))<0) goto out; - + /* Create a new file and group "/g3/g4" in it */ if ((file2_id = H5Fcreate( filename2, H5F_ACC_TRUNC, H5P_DEFAULT, fapl ))<0) goto out; if ((group3_id = H5Gcreate( file2_id, "/g3", 0 ))<0) goto out; @@ -1642,7 +1642,7 @@ PASSED(); /* Mount first file at "g3/g4" in the second file */ if(H5Fmount(file2_id, "/g3/g4", file1_id, H5P_DEFAULT)<0) goto out; - + /* Get name */ if (H5Iget_name( group4_id, name, size )<0) goto out; @@ -1669,7 +1669,7 @@ PASSED(); /* Rename group */ if (H5Gmove( file2_id, "/g3/g4/g1/g2", "/g3/g4/g1/g5" )<0) goto out; - + /* Get name */ if (H5Iget_name( group5_id, name, size )<0) goto out; @@ -1681,10 +1681,10 @@ PASSED(); /* Verify */ if (check_name( name, "/g1/g5" )!=0) goto out; - + /* Rename group */ if (H5Gmove( file2_id, "/g3/g4/g1", "/g3/g4/g1a" )<0) goto out; - + /* Get name */ if (H5Iget_name( group5_id, name, size )<0) goto out; @@ -1696,22 +1696,22 @@ PASSED(); /* Verify */ if (check_name( name, "/g1a/g5" )!=0) goto out; - + /* Get name */ if (H5Iget_name( group6_id, name, size )<0) goto out; /* Verify */ if (check_name( name, "/g3/g4/g1a" )!=0) goto out; - + /* Get name */ if (H5Iget_name( group_id, name, size )<0) goto out; /* Verify */ if (check_name( name, "/g1a" )!=0) goto out; - + /* Rename middle group back, using relative path */ if (H5Gmove( group3_id, "g4/g1a", "g4/g1" )<0) goto out; - + /* Get name */ if (H5Iget_name( group5_id, name, size )<0) goto out; @@ -1723,22 +1723,22 @@ PASSED(); /* Verify */ if (check_name( name, "/g1/g5" )!=0) goto out; - + /* Get name */ if (H5Iget_name( group6_id, name, size )<0) goto out; /* Verify */ if (check_name( name, "/g3/g4/g1" )!=0) goto out; - + /* Get name */ if (H5Iget_name( group_id, name, size )<0) goto out; /* Verify */ if (check_name( name, "/g1" )!=0) goto out; - + /* Rename end group back, using relative path */ if (H5Gmove( group3_id, "g4/g1/g5", "g4/g1/g2" )<0) goto out; - + /* Get name */ if (H5Iget_name( group5_id, name, size )<0) goto out; @@ -1750,19 +1750,19 @@ PASSED(); /* Verify */ if (check_name( name, "/g1/g2" )!=0) goto out; - + /* Get name */ if (H5Iget_name( group6_id, name, size )<0) goto out; /* Verify */ if (check_name( name, "/g3/g4/g1" )!=0) goto out; - + /* Get name */ if (H5Iget_name( group_id, name, size )<0) goto out; /* Verify */ if (check_name( name, "/g1" )!=0) goto out; - + /* Close */ H5Gclose( group_id ); H5Gclose( group2_id ); @@ -1772,9 +1772,9 @@ PASSED(); H5Gclose( group6_id ); H5Fclose( file1_id ); H5Fclose( file2_id ); - + PASSED(); - + /*------------------------------------------------------------------------- * Test H5Iget_name with H5Glink hard *------------------------------------------------------------------------- @@ -1910,7 +1910,7 @@ PASSED(); H5Gclose( group_id ); H5Gclose( group2_id ); H5Gclose( group3_id ); - + PASSED(); @@ -1948,7 +1948,7 @@ PASSED(); H5Gclose( group_id ); H5Gclose( group2_id ); H5Gclose( group3_id ); - + PASSED(); @@ -1994,7 +1994,7 @@ PASSED(); H5Gclose( group_id ); H5Gclose( group2_id ); H5Gclose( group3_id ); - + PASSED(); @@ -2055,7 +2055,7 @@ PASSED(); H5Gclose( group_id ); H5Gclose( group2_id ); H5Gclose( group3_id ); - + PASSED(); @@ -2096,7 +2096,7 @@ PASSED(); H5Gclose( group_id ); H5Gclose( group2_id ); H5Gclose( group3_id ); - + PASSED(); /*------------------------------------------------------------------------- @@ -2135,9 +2135,9 @@ PASSED(); H5Gclose( group_id ); H5Gclose( group2_id ); H5Gclose( group3_id ); - + PASSED(); - + /*------------------------------------------------------------------------- * Test H5Iget_name with several nested mounted files *------------------------------------------------------------------------- @@ -2149,7 +2149,7 @@ PASSED(); if ((group_id = H5Gcreate( file_id, "/g25", 0 ))<0) goto out; if ((group2_id = H5Gcreate( file_id, "/g25/g1", 0 ))<0) goto out; if ((group3_id = H5Gcreate( file_id, "/g25/g1/g2", 0 ))<0) goto out; - + /* Close */ H5Gclose( group_id ); H5Gclose( group2_id ); @@ -2344,7 +2344,7 @@ PASSED(); if ((group3_id = H5Gcreate( file_id, "/g29/g1/g2", 0 ))<0) goto out; if ((group4_id = H5Gcreate( file_id, "/g29/g1/g2/g1", 0 ))<0) goto out; if ((group5_id = H5Gcreate( file_id, "/g29/g1/g2/g1/g2", 0 ))<0) goto out; - + /* Rename group */ if (H5Gmove( file_id, "/g29/g1/g2/g1/g2", "/g29/g1/g2/g1/g3" )<0) goto out; @@ -2405,7 +2405,7 @@ PASSED(); if ((group_id = H5Gcreate( file_id, "/g30", 0 ))<0) goto out; if ((group2_id = H5Gcreate( file_id, "/g30/g1", 0 ))<0) goto out; if ((group3_id = H5Gcreate( file_id, "/g30/g1/g2", 0 ))<0) goto out; - + /* Close */ H5Gclose( group_id ); H5Gclose( group2_id ); @@ -2683,7 +2683,7 @@ PASSED(); H5Gclose( group3_id ); H5Gclose( group4_id ); H5Fclose( file1_id ); - + PASSED(); @@ -2803,14 +2803,14 @@ PASSED(); H5Gclose( group5_id ); if (H5Funmount(file_id, "/g36/g1")<0) goto out; - + /* Close */ H5Gclose( group_id ); H5Gclose( group2_id ); H5Gclose( group3_id ); H5Gclose( group4_id ); H5Fclose( file1_id ); - + PASSED(); @@ -2916,7 +2916,7 @@ PASSED(); H5Fclose( file1_id ); H5Fclose( file2_id ); H5Fclose( file3_id ); - + PASSED(); /*------------------------------------------------------------------------- @@ -2977,15 +2977,15 @@ PASSED(); H5Gclose( group2_id ); H5Fclose( file1_id ); H5Fclose( file2_id ); - + PASSED(); /*------------------------------------------------------------------------- - * end tests + * end tests *------------------------------------------------------------------------- */ - + /* Close file */ H5Fclose( file_id ); puts("All getname tests passed."); diff --git a/test/gheap.c b/test/gheap.c index f3db661..75b8fe1 100644 --- a/test/gheap.c +++ b/test/gheap.c @@ -80,7 +80,7 @@ test_1 (hid_t fapl) puts(" Unable to create file"); goto error; } - + /* * Write the objects, monotonically increasing in length. Since this is * a clean file, the addresses allocated for the collections should also @@ -119,7 +119,7 @@ test_1 (hid_t fapl) nerrors++; } } - + if (H5Fclose(file)<0) goto error; if (nerrors) goto error; PASSED(); @@ -174,7 +174,7 @@ test_2 (hid_t fapl) puts(" Unable to create file"); goto error; } - + /* * Write the objects, monotonically decreasing in length. */ @@ -206,7 +206,7 @@ test_2 (hid_t fapl) nerrors++; } } - + if (H5Fclose(file)<0) goto error; if (nerrors) goto error; PASSED(); @@ -284,7 +284,7 @@ test_3 (hid_t fapl) nerrors++; } } - + if (H5Fclose(file)<0) goto error; if (nerrors) goto error; PASSED(); @@ -357,7 +357,7 @@ test_4 (hid_t fapl) * Remove every third one beginning with the second, but after the * next one has already been inserted. That is, insert A, B, C; * remove B, insert D, E, F; remove E; etc. - */ + */ if (1==i%3) { H5Eclear (); status = H5HG_remove (f, H5P_DATASET_XFER_DEFAULT, obj+i-1); @@ -381,7 +381,7 @@ test_4 (hid_t fapl) } H5E_END_TRY; return MAX(1, nerrors); } - + /*------------------------------------------------------------------------- * Function: main @@ -407,7 +407,7 @@ main (void) h5_reset(); fapl = h5_fileaccess(); - + nerrors += test_1(fapl); nerrors += test_2(fapl); nerrors += test_3(fapl); diff --git a/test/h5test.c b/test/h5test.c index 3b14d0e..fe07f53 100644 --- a/test/h5test.c +++ b/test/h5test.c @@ -17,7 +17,7 @@ * Thursday, November 19, 1998 * * Purpose: Provides support functions for most of the hdf5 tests cases. - * + * */ #undef NDEBUG /*override -DNDEBUG */ @@ -208,7 +208,7 @@ void h5_reset(void) { char filename[1024]; - + HDfflush(stdout); HDfflush(stderr); H5close(); @@ -270,7 +270,7 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) char *ptr, last = '\0'; size_t i, j; hid_t driver = -1; - + if (!base_name || !fullname || size < 1) return NULL; @@ -286,7 +286,7 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) else if (H5FD_CORE == driver || H5FD_MULTI == driver) suffix = NULL; } - + /* Use different ones depending on parallel or serial driver used. */ if (H5P_DEFAULT != fapl && H5FD_MPIO == driver){ #ifdef H5_HAVE_PARALLEL @@ -297,7 +297,7 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) */ static int explained = 0; - prefix = (paraprefix ? paraprefix : getenv_all(MPI_COMM_WORLD, 0, "HDF5_PARAPREFIX")); + prefix = (paraprefix ? paraprefix : getenv_all(MPI_COMM_WORLD, 0, "HDF5_PARAPREFIX")); if (!prefix && !explained) { /* print hint by process 0 once. */ @@ -446,7 +446,7 @@ h5_fileaccess(void) const char *name; char s[1024]; hid_t fapl = -1; - + /* First use the environment variable, then the constant */ val = HDgetenv("HDF5_DRIVER"); #ifdef HDF5_DRIVER @@ -455,7 +455,7 @@ h5_fileaccess(void) if ((fapl=H5Pcreate(H5P_FILE_ACCESS))<0) return -1; if (!val || !*val) return fapl; /*use default*/ - + HDstrncpy(s, val, sizeof s); s[sizeof(s)-1] = '\0'; if (NULL==(name=HDstrtok(s, " \t\n\r"))) return fapl; @@ -584,7 +584,7 @@ h5_show_hostname(void) /* try show the process or thread id in multiple processes cases*/ #ifdef H5_HAVE_PARALLEL - { + { int mpi_rank, mpi_initialized; MPI_Initialized(&mpi_initialized); @@ -606,18 +606,18 @@ h5_show_hostname(void) /* could not find a usable WinSock DLL */ return; } - + /* Confirm that the WinSock DLL supports 2.2.*/ /* Note that if the DLL supports versions greater */ /* than 2.2 in addition to 2.2, it will still return */ /* 2.2 in wVersion since that is the version we */ /* requested. */ - + if ( LOBYTE( wsaData.wVersion ) != 2 || HIBYTE( wsaData.wVersion ) != 2 ) { /* could not find a usable WinSock DLL */ WSACleanup( ); - return; + return; } #endif @@ -794,7 +794,7 @@ h5_get_file_size(const char *filename) * and allow easy replacement for environments which don't have stdin/stdout * available. (i.e. Windows & the Mac) */ -int +int print_func(const char *format, ...) { va_list arglist; @@ -806,7 +806,7 @@ print_func(const char *format, ...) return ret_value; } -#ifdef H5_HAVE_FILTER_SZIP +#ifdef H5_HAVE_FILTER_SZIP /*------------------------------------------------------------------------- @@ -819,36 +819,36 @@ print_func(const char *format, ...) * 0: only decode is enabled * -1: other * - * Programmer: + * Programmer: * * Modifications: * *------------------------------------------------------------------------- */ -int h5_szip_can_encode(void ) +int h5_szip_can_encode(void ) { herr_t status; unsigned int filter_config_flags; status =H5Zget_filter_info(H5Z_FILTER_SZIP, &filter_config_flags); - if ((filter_config_flags & + if ((filter_config_flags & (H5Z_FILTER_CONFIG_ENCODE_ENABLED|H5Z_FILTER_CONFIG_DECODE_ENABLED)) == 0) { /* filter present but neither encode nor decode is supported (???) */ return -1; - } else if ((filter_config_flags & - (H5Z_FILTER_CONFIG_ENCODE_ENABLED|H5Z_FILTER_CONFIG_DECODE_ENABLED)) == + } else if ((filter_config_flags & + (H5Z_FILTER_CONFIG_ENCODE_ENABLED|H5Z_FILTER_CONFIG_DECODE_ENABLED)) == H5Z_FILTER_CONFIG_DECODE_ENABLED) { /* decoder only: read but not write */ return 0; - } else if ((filter_config_flags & - (H5Z_FILTER_CONFIG_ENCODE_ENABLED|H5Z_FILTER_CONFIG_DECODE_ENABLED)) == + } else if ((filter_config_flags & + (H5Z_FILTER_CONFIG_ENCODE_ENABLED|H5Z_FILTER_CONFIG_DECODE_ENABLED)) == H5Z_FILTER_CONFIG_ENCODE_ENABLED) { /* encoder only: write but not read (???) */ return -1; - } else if ((filter_config_flags & - (H5Z_FILTER_CONFIG_ENCODE_ENABLED|H5Z_FILTER_CONFIG_DECODE_ENABLED)) == - (H5Z_FILTER_CONFIG_ENCODE_ENABLED|H5Z_FILTER_CONFIG_DECODE_ENABLED)) { + } else if ((filter_config_flags & + (H5Z_FILTER_CONFIG_ENCODE_ENABLED|H5Z_FILTER_CONFIG_DECODE_ENABLED)) == + (H5Z_FILTER_CONFIG_ENCODE_ENABLED|H5Z_FILTER_CONFIG_DECODE_ENABLED)) { return 1; } return(-1); @@ -886,12 +886,12 @@ char* getenv_all(MPI_Comm comm, int root, const char* name) int len = -1; static char* env = NULL; MPI_Status Status; - + assert(name); - - MPI_Comm_rank(comm, &nID); - /* The root task does the getenv call + MPI_Comm_rank(comm, &nID); + + /* The root task does the getenv call * and sends the result to the other tasks */ if(nID == root) { diff --git a/test/h5test.h b/test/h5test.h index a0e5ea1..e17fc7f 100644 --- a/test/h5test.h +++ b/test/h5test.h @@ -33,17 +33,17 @@ * Predefined test verbosity levels. * * Convention: - * + * * The higher the verbosity value, the more information printed. * So, output for higher verbosity also include output of all lower * verbosity. - * + * * Value Description * 0 None: No informational message. * 1 "All tests passed" * 2 Header of overall test * 3 Default: header and results of individual test - * 4 + * 4 * 5 Low: Major category of tests. * 6 * 7 Medium: Minor category of tests such as functions called. @@ -75,7 +75,7 @@ /* * This contains the filename prefix specificied as command line option for - * the parallel test files. + * the parallel test files. */ extern char *paraprefix; #ifdef H5_HAVE_PARALLEL @@ -121,7 +121,7 @@ H5TEST_DLL int print_func(const char *format, ...); /* Routines for operating on the list of tests (for the "all in one" tests) */ H5TEST_DLL void TestUsage(void); H5TEST_DLL void AddTest(const char *TheName, void (*TheCall) (void), - void (*Cleanup) (void), const char *TheDescr, + void (*Cleanup) (void), const char *TheDescr, const void *Parameters); H5TEST_DLL void TestInfo(const char *ProgName); H5TEST_DLL void TestParseCmdLine(int argc, char *argv[]); @@ -141,7 +141,7 @@ H5TEST_DLL int TestErrPrintf(const char *format, ...); H5TEST_DLL void SetTest(const char *testname, int action); -#ifdef H5_HAVE_FILTER_SZIP +#ifdef H5_HAVE_FILTER_SZIP H5TEST_DLL int h5_szip_can_encode(void); #endif /* H5_HAVE_FILTER_SZIP */ diff --git a/test/hyperslab.c b/test/hyperslab.c index 75118d3..b954ace 100644 --- a/test/hyperslab.c +++ b/test/hyperslab.c @@ -115,7 +115,7 @@ print_array(uint8_t *array, size_t nx, size_t ny, size_t nz) * * Return: Success: 0 * - * Failure: + * Failure: * * Programmer: Robb Matzke * Friday, October 10, 1997 @@ -611,7 +611,7 @@ test_multifill(size_t nx) hsize_t src_stride; hsize_t dst_stride; char s[64]; - + struct a_struct { int left; double mid; @@ -686,7 +686,7 @@ test_multifill(size_t nx) goto error; } } - + puts(" PASSED"); HDfree(src); HDfree(dst); @@ -1238,9 +1238,9 @@ main(int argc, char *argv[]) #endif /* H5_HAVE_THREADSAFE */ /* - *------------------------------ + *------------------------------ * TEST HYPERSLAB FILL OPERATION - *------------------------------ + *------------------------------ */ if (size_of_test & TEST_SMALL) { status = test_fill(11, 0, 0, 1, 1, 1, 1, 1, 1); @@ -1260,7 +1260,7 @@ main(int argc, char *argv[]) } /*------------------------------ * TEST HYPERSLAB COPY OPERATION - *------------------------------ + *------------------------------ */ /* exhaustive, one-dimensional test */ @@ -1325,7 +1325,7 @@ main(int argc, char *argv[]) } /*--------------------- * TEST MULTI-BYTE FILL - *--------------------- + *--------------------- */ if (size_of_test & TEST_SMALL) { @@ -1359,7 +1359,7 @@ main(int argc, char *argv[]) } /*------------------------- * TEST SAMPLING OPERATIONS - *------------------------- + *------------------------- */ if (size_of_test & TEST_SMALL) { @@ -1372,7 +1372,7 @@ main(int argc, char *argv[]) } /*------------------------- * TEST ARRAY FILL OPERATIONS - *------------------------- + *------------------------- */ if (size_of_test & TEST_SMALL) { @@ -1385,7 +1385,7 @@ main(int argc, char *argv[]) } /*------------------------- * TEST ARRAY OFFSET OPERATIONS - *------------------------- + *------------------------- */ if (size_of_test & TEST_SMALL) { diff --git a/test/istore.c b/test/istore.c index 2f3f907..f9e19d0 100644 --- a/test/istore.c +++ b/test/istore.c @@ -614,7 +614,7 @@ main(int argc, char *argv[]) printf("Cannot create file %s; test aborted\n", filename); exit(1); } - + /* * For testing file families, fool the library into thinking it already * allocated a whole bunch of data. @@ -682,7 +682,7 @@ main(int argc, char *argv[]) /* Close the test file and exit */ H5Pclose(fcpl); H5Fclose(file); - + if (nerrors) { printf("***** %d I-STORE TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); diff --git a/test/lheap.c b/test/lheap.c index 4aee352..8c7be99 100644 --- a/test/lheap.c +++ b/test/lheap.c @@ -121,7 +121,7 @@ main(void) H5Eprint(stdout); goto error; } - + if (NULL == (s = H5HL_offset_into(f, heap, obj[i]))) { H5_FAILED(); H5Eprint(stdout); diff --git a/test/links.c b/test/links.c index 4d072b5..8a53184 100644 --- a/test/links.c +++ b/test/links.c @@ -86,7 +86,7 @@ mklinks(hid_t fapl) "/grp1/recursive")<0) { goto error; } - + /* Close */ if (H5Sclose (scalar)<0) goto error; if (H5Fclose (file)<0) goto error; @@ -108,8 +108,8 @@ mklinks(hid_t fapl) * * Failure: -1 * - * Programmer: Raymond Lu - * Friday, April 19, 2002 + * Programmer: Raymond Lu + * Friday, April 19, 2002 * * Modifications: * @@ -122,7 +122,7 @@ new_links(hid_t fapl) hid_t grp1_a=(-1), grp1_b=(-1), grp2_a=(-1), grp2_b=(-1); hid_t scalar=(-1); hid_t dset1=(-1), dset2=(-1); - char filename[1024]; + char filename[1024]; hsize_t size[1] = {1}; TESTING("H5Glink2 function"); @@ -145,7 +145,7 @@ new_links(hid_t fapl) if ((grp2_b=H5Gcreate (file_b, "grp2", (size_t)0))<0) goto error; /* Create datasets */ - if((dset1=H5Dcreate(file_a, "dataset1", H5T_NATIVE_INT, scalar, + if((dset1=H5Dcreate(file_a, "dataset1", H5T_NATIVE_INT, scalar, H5P_DEFAULT))<0) { goto error; } @@ -154,27 +154,27 @@ new_links(hid_t fapl) goto error; } - /* Create links within a file. Both of source and destination use + /* Create links within a file. Both of source and destination use * H5G_SAME_LOC. Both hard and soft links should fail. */ H5E_BEGIN_TRY { - if(H5Glink2(H5G_SAME_LOC, "dataset1", H5G_LINK_HARD , H5G_SAME_LOC, + if(H5Glink2(H5G_SAME_LOC, "dataset1", H5G_LINK_HARD , H5G_SAME_LOC, "hard")!=FAIL) goto error; } H5E_END_TRY; H5E_BEGIN_TRY { - if(H5Glink2(H5G_SAME_LOC, "dataset1", H5G_LINK_SOFT , H5G_SAME_LOC, + if(H5Glink2(H5G_SAME_LOC, "dataset1", H5G_LINK_SOFT , H5G_SAME_LOC, "soft")!=FAIL) goto error; } H5E_END_TRY; /* Create links across files. Both hard and soft links should fail. */ H5E_BEGIN_TRY { - if(H5Glink2(file_a, "dataset1", H5G_LINK_HARD , file_b, + if(H5Glink2(file_a, "dataset1", H5G_LINK_HARD , file_b, "hard")!=FAIL) goto error; } H5E_END_TRY; H5E_BEGIN_TRY { if(H5Glink2(file_a, "dataset1", H5G_LINK_SOFT, file_b, "soft")!=FAIL) goto error; } H5E_END_TRY; - + /* Create links to test H5G_SAME_LOC, H5G_LINK_HARD, H5G_LINK_SOFT. */ if(H5Glink2(grp1_a, "dataset2", H5G_LINK_HARD , H5G_SAME_LOC, "hard1")<0) { @@ -185,7 +185,7 @@ new_links(hid_t fapl) goto error; } - /* Create links to test H5G_LINK_HARD, H5G_LINK_SOFT across different + /* Create links to test H5G_LINK_HARD, H5G_LINK_SOFT across different * locations. */ if(H5Glink2(grp1_a, "dataset2", H5G_LINK_HARD, grp2_a, "hard2")<0) { goto error; @@ -364,7 +364,7 @@ cklinks(hid_t fapl) * Failure: -1 * * Programmer: Raymond Lu - * Thursday, April 25, 2002 + * Thursday, April 25, 2002 * * Modifications: * @@ -386,8 +386,8 @@ ck_new_links(hid_t fapl) goto error; } - /* Get hard link info */ - if(H5Gget_objinfo(file, "/grp1/dataset2", TRUE, &sb_dset)<0) + /* Get hard link info */ + if(H5Gget_objinfo(file, "/grp1/dataset2", TRUE, &sb_dset)<0) goto error; if(H5Gget_objinfo(file, "/grp1/hard1", TRUE, &sb_hard1)<0) goto error; @@ -400,7 +400,7 @@ ck_new_links(hid_t fapl) puts(" Unexpected object type, should have been a dataset"); goto error; } - if( sb_dset.objno[0]!=sb_hard1.objno[0] || + if( sb_dset.objno[0]!=sb_hard1.objno[0] || sb_dset.objno[1]!=sb_hard1.objno[1] || sb_dset.objno[0]!=sb_hard2.objno[0] || sb_dset.objno[1]!=sb_hard2.objno[1] ) { @@ -474,7 +474,7 @@ long_links(hid_t fapl) hid_t gid2 = (-1); /* Datatype ID */ char *objname = NULL; /* Name of object [Long] */ size_t u; /* Local index variable */ - char filename[1024]; + char filename[1024]; TESTING("long names for objects & links"); diff --git a/test/mount.c b/test/mount.c index 6851bca..3153e86 100644 --- a/test/mount.c +++ b/test/mount.c @@ -92,7 +92,7 @@ setup(hid_t fapl) if (H5Fclose(file)<0) goto error; return 0; - + error: H5E_BEGIN_TRY { H5Fclose(file); @@ -146,7 +146,7 @@ test_basic(hid_t fapl) PASSED(); return 0; - + error: H5E_BEGIN_TRY { H5Fclose(file1); @@ -184,7 +184,7 @@ test_illegal(hid_t fapl) h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1); h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); h5_fixname(FILENAME[2], fapl, filename3, sizeof filename3); - + /* Open the files */ if ((file1=H5Fopen(filename1, H5F_ACC_RDONLY, fapl))<0 || @@ -219,7 +219,7 @@ test_illegal(hid_t fapl) } if (H5Funmount(mnt, ".")<0) goto error; if (H5Gclose(mnt)<0) goto error; - + /* Close everything and return */ if (H5Fclose(file1)<0) goto error; @@ -267,14 +267,14 @@ test_hide(hid_t fapl) TESTING("name hiding under mount point"); h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1); h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); - + if ((file1=H5Fopen(filename1, H5F_ACC_RDONLY, fapl))<0 || (file2=H5Fopen(filename2, H5F_ACC_RDONLY, fapl))<0) goto error; /* Get information about file1:/mnt1/file1 for later */ if (H5Gget_objinfo(file1, "/mnt1/file1", TRUE, &sb1)<0) goto error; - + /* Build the virtual file */ if (H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT)<0) goto error; @@ -340,11 +340,11 @@ test_assoc(hid_t fapl) hid_t file1=-1, file2=-1; H5G_stat_t sb1, sb2; char filename1[1024], filename2[1024]; - + TESTING("mount point open"); h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1); h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); - + /* Open the files */ if ((file1=H5Fopen(filename1, H5F_ACC_RDONLY, fapl))<0 || (file2=H5Fopen(filename2, H5F_ACC_RDONLY, fapl))<0) @@ -367,7 +367,7 @@ test_assoc(hid_t fapl) puts(" Association failed."); goto error; } - + /* Shut down */ if (H5Funmount(file1, "/mnt1_link")<0) goto error; if (H5Fclose(file1)<0) goto error; @@ -412,7 +412,7 @@ test_mntlnk(hid_t fapl) h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1); h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); - + /* Build the virtual file */ if ((file1=H5Fopen(filename1, H5F_ACC_RDONLY, fapl))<0 || (file2=H5Fopen(filename2, H5F_ACC_RDONLY, fapl))<0) @@ -469,11 +469,11 @@ test_move(hid_t fapl) hid_t file1=-1, file2=-1; herr_t status; char filename1[1024], filename2[1024]; - + TESTING("object renaming"); h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1); h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); - + /* Build the virtual file */ if ((file1=H5Fopen(filename1, H5F_ACC_RDWR, fapl))<0 || (file2=H5Fopen(filename2, H5F_ACC_RDWR, fapl))<0) @@ -533,14 +533,14 @@ test_preopen(hid_t fapl) TESTING("preopening objects under the mount point"); h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1); h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); - + if ((file1=H5Fopen(filename1, H5F_ACC_RDONLY, fapl))<0 || (file2=H5Fopen(filename2, H5F_ACC_RDONLY, fapl))<0) goto error; /* Open something under the mount point */ if ((grp=H5Gopen(file1, "/mnt1/file1"))<0) goto error; - + /* Build the virtual file */ if (H5Fmount(file1, "/mnt1", file2, H5P_DEFAULT)<0) goto error; @@ -586,7 +586,7 @@ test_preopen(hid_t fapl) static int test_postopen(hid_t fapl) { - + hid_t file1=-1, file2=-1, grp=-1; char filename1[1024], filename2[1024]; @@ -605,7 +605,7 @@ test_postopen(hid_t fapl) /* Unmount the file */ if (H5Funmount(file1, "/mnt1")<0) goto error; - + /* Now access the thing we previously opened */ if (H5Gget_objinfo(grp, ".", TRUE, NULL)<0) goto error; @@ -690,7 +690,7 @@ test_unlink(hid_t fapl) puts(" Incorrect traversal from mount point!"); goto error; } - + /* Unlink the mount point */ if (H5Gunlink(file1, "/mnt_unlink")<0) goto error; @@ -738,7 +738,7 @@ test_unlink(hid_t fapl) goto error; } if (H5Funmount(mnt, ".")<0) goto error; - + /* Close files */ if (H5Gclose(mnt)<0) goto error; if (H5Gclose(root)<0) goto error; @@ -779,11 +779,11 @@ test_mvmpt(hid_t fapl) { hid_t file1=-1, file2=-1; char filename1[1024], filename2[1024]; - + TESTING("mount point renaming"); h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1); h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); - + /* Build the virtual file */ if ((file1=H5Fopen(filename1, H5F_ACC_RDWR, fapl))<0 || (file2=H5Fopen(filename2, H5F_ACC_RDWR, fapl))<0) @@ -835,11 +835,11 @@ test_interlink(hid_t fapl) char filename1[1024], filename2[1024]; herr_t status; hsize_t cur_dims[1] = {2}; - + TESTING("interfile hard links"); h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1); h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); - + /* Build the virtual file */ if ((file1=H5Fopen(filename1, H5F_ACC_RDWR, fapl))<0 || (file2=H5Fopen(filename2, H5F_ACC_RDWR, fapl))<0) @@ -878,7 +878,7 @@ test_interlink(hid_t fapl) puts(" Dataset and shared type must be in the same file!"); goto error; } - + /* Shut down */ if (H5Sclose(space)<0) goto error; if (H5Tclose(type)<0) goto error; @@ -922,11 +922,11 @@ test_uniformity(hid_t fapl) { hid_t file1=-1, file2=-1; char filename1[1024], filename2[1024]; - + TESTING("file handle uniformity"); h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1); h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); - + /* Build the virtual file */ if ((file1=H5Fopen(filename1, H5F_ACC_RDWR, fapl))<0 || (file2=H5Fopen(filename2, H5F_ACC_RDWR, fapl))<0) @@ -939,7 +939,7 @@ test_uniformity(hid_t fapl) if (H5Gget_objinfo(file1, "mnt1", TRUE, NULL)<0) TEST_ERROR; if (H5Gget_objinfo(file1, "/mnt1/file2", TRUE, NULL)<0) TEST_ERROR; if (H5Gget_objinfo(file1, "mnt1/file2", TRUE, NULL)<0) TEST_ERROR; - + /* Access the same things from the file2 handle */ if (H5Gget_objinfo(file2, "/", TRUE, NULL)<0) TEST_ERROR; if (H5Gget_objinfo(file2, "/mnt1", TRUE, NULL)<0) TEST_ERROR; @@ -984,11 +984,11 @@ test_close(hid_t fapl) { hid_t file1=-1, file2=-1; char filename1[1024], filename2[1024]; - + TESTING("file handle close"); h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1); h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); - + /* Build the virtual file */ if ((file1=H5Fopen(filename1, H5F_ACC_RDWR, fapl))<0 || (file2=H5Fopen(filename2, H5F_ACC_RDWR, fapl))<0) @@ -1021,11 +1021,11 @@ test_close(hid_t fapl) /* * Close file2. It is not actually closed because it's a child of file1. - */ + */ if (H5Fclose(file2)<0) goto error; if (H5Gget_objinfo(file1, "/mnt1/file2", TRUE, NULL)<0) goto error; if (H5Fclose(file1)<0) goto error; - + /* Check that all file IDs have been closed */ if(H5I_nmembers(H5I_FILE) != 0) TEST_ERROR @@ -1043,7 +1043,7 @@ test_close(hid_t fapl) } H5E_END_TRY; return 1; } - + /*------------------------------------------------------------------------- * Function: test_mount_after_close @@ -1074,11 +1074,11 @@ test_mount_after_close(hid_t fapl) char objname[NAME_BUF_SIZE]; /* Name of object opened */ hsize_t dims[] = {NX,NY}; /* Dataset dimensions */ int i, j; /* Local index variable */ - + TESTING("mounting on group after file is closed"); h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1); h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); - + /* * Initialization of buffer matrix "bm" */ @@ -1245,7 +1245,7 @@ test_mount_after_close(hid_t fapl) TEST_ERROR if(H5Fclose(fid2) < 0) TEST_ERROR - + /* Shut down */ PASSED(); return 0; @@ -1268,7 +1268,7 @@ error: } H5E_END_TRY; return 1; } - + /*------------------------------------------------------------------------- * Function: test_mount_after_unmount @@ -1305,13 +1305,13 @@ test_mount_after_unmount(hid_t fapl) filename3[1024], filename4[1024]; /* Name of files to mount */ char objname[NAME_BUF_SIZE]; /* Name of object opened */ - + TESTING("mounting after file is unmounted"); h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1); h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); h5_fixname(FILENAME[2], fapl, filename3, sizeof filename3); h5_fixname(FILENAME[3], fapl, filename4, sizeof filename4); - + /* Create first file and some groups in it. */ if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) TEST_ERROR @@ -1510,7 +1510,7 @@ test_mount_after_unmount(hid_t fapl) TEST_ERROR if(H5Fclose(fid1) < 0) TEST_ERROR - + /* Shut down */ PASSED(); return 0; @@ -1537,7 +1537,7 @@ error: } H5E_END_TRY; return 1; } - + /*------------------------------------------------------------------------- * Function: test_missing_unmount @@ -1565,13 +1565,13 @@ test_missing_unmount(hid_t fapl) char filename1[1024], filename2[1024], filename3[1024]; /* Name of files to mount */ - + TESTING("missing unmount"); h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1); h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); h5_fixname(FILENAME[2], fapl, filename3, sizeof filename3); - + /* Create file #1 */ if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -1694,7 +1694,7 @@ error: } H5E_END_TRY; return 1; } /* end test_missing_unmount() */ - + /*------------------------------------------------------------------------- * Function: test_hold_open_file @@ -1720,12 +1720,12 @@ test_hold_open_file(hid_t fapl) hid_t gidA = -1, gidM = -1, gidAM = -1; /* Group IDs */ char filename1[1024], filename2[1024]; /* Name of files to mount */ - + TESTING("hold open w/file"); h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1); h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); - + /* Create file #1 */ if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -1827,7 +1827,7 @@ error: } H5E_END_TRY; return 1; } /* end test_hold_open_file() */ - + /*------------------------------------------------------------------------- * Function: test_hold_open_group @@ -1853,12 +1853,12 @@ test_hold_open_group(hid_t fapl) hid_t gid = -1, gidA = -1, gidM = -1, gidAM = -1, gidAM2 = -1; /* Group IDs */ char filename1[1024], filename2[1024]; /* Name of files to mount */ - + TESTING("hold open w/group"); h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1); h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); - + /* Create file #1 */ if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -1986,7 +1986,7 @@ error: } H5E_END_TRY; return 1; } /* end test_hold_open_group() */ - + /*------------------------------------------------------------------------- * Function: test_fcdegree_same @@ -2014,12 +2014,12 @@ test_fcdegree_same(hid_t fapl) herr_t ret; /* Generic return value */ char filename1[1024], filename2[1024]; /* Name of files to mount */ - + TESTING("file close degrees must be same"); h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1); h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); - + /* Create file #1 */ if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -2131,7 +2131,7 @@ error: } H5E_END_TRY; return 1; } /* end test_fcdegree_same() */ - + /*------------------------------------------------------------------------- * Function: test_fcdegree_semi @@ -2159,12 +2159,12 @@ test_fcdegree_semi(hid_t fapl) herr_t ret; /* Generic return value */ char filename1[1024], filename2[1024]; /* Name of files to mount */ - + TESTING("'semi' file close degree"); h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1); h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); - + /* Create file #1 */ if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -2273,7 +2273,7 @@ error: } H5E_END_TRY; return 1; } /* end test_fcdegree_semi() */ - + /*------------------------------------------------------------------------- * Function: test_fcdegree_strong @@ -2301,12 +2301,12 @@ test_fcdegree_strong(hid_t fapl) herr_t ret; /* Generic return value */ char filename1[1024], filename2[1024]; /* Name of files to mount */ - + TESTING("'strong' file close degree"); h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1); h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); - + /* Create file #1 */ if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -2411,7 +2411,7 @@ error: } H5E_END_TRY; return 1; } /* end test_fcdegree_strong() */ - + /*------------------------------------------------------------------------- * Function: test_acc_perm @@ -2443,13 +2443,13 @@ test_acc_perm(hid_t fapl) char filename1[1024], filename2[1024], filename3[1024]; /* Name of files to mount */ - + TESTING("access permissions"); h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1); h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); h5_fixname(FILENAME[2], fapl, filename3, sizeof filename3); - + /* Create file #1 */ if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -2648,13 +2648,13 @@ test_mult_mount(hid_t fapl) char filename1[1024], filename2[1024], filename3[1024]; /* Name of files to mount */ - + TESTING("multiple mounts"); h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1); h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); h5_fixname(FILENAME[2], fapl, filename3, sizeof filename3); - + /* Create file #1 */ if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -2876,7 +2876,7 @@ test_nested_survive(hid_t fapl) char filename1[1024], filename2[1024], filename3[1024]; /* Name of files to mount */ - + TESTING("nested mounts survive"); h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1); @@ -3087,12 +3087,12 @@ test_close_parent(hid_t fapl) ssize_t name_len; /* Filename length */ char filename1[1024], filename2[1024]; /* Name of files to mount */ - + TESTING("close parent"); h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1); h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); - + /* Create file #1 */ if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -3273,7 +3273,7 @@ test_cut_graph(hid_t fapl) filename5[NAME_BUF_SIZE], filename6[NAME_BUF_SIZE], filename7[NAME_BUF_SIZE]; /* Name of files to mount */ - + TESTING("cutting mount graph"); h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1); @@ -3283,7 +3283,7 @@ test_cut_graph(hid_t fapl) h5_fixname(FILENAME[4], fapl, filename5, sizeof filename3); h5_fixname(FILENAME[5], fapl, filename6, sizeof filename3); h5_fixname(FILENAME[6], fapl, filename7, sizeof filename3); - + /* Create file #1 & it's groups */ if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -3658,13 +3658,13 @@ test_symlink(hid_t fapl) char filename1[NAME_BUF_SIZE], filename2[NAME_BUF_SIZE], filename3[NAME_BUF_SIZE]; /* Name of files to mount */ - + TESTING("symlinks"); h5_fixname(FILENAME[0], fapl, filename1, sizeof filename1); h5_fixname(FILENAME[1], fapl, filename2, sizeof filename2); h5_fixname(FILENAME[2], fapl, filename3, sizeof filename3); - + /* Create file #1 & it's groups */ if((fid1 = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) TEST_ERROR @@ -3849,12 +3849,12 @@ main(void) nerrors += test_close_parent(fapl); nerrors += test_cut_graph(fapl); nerrors += test_symlink(fapl); - + if (nerrors) goto error; puts("All mount tests passed."); h5_cleanup(FILENAME, fapl); return 0; - + error: puts("***** MOUNT ERRORS *****"); return 1; diff --git a/test/mtime.c b/test/mtime.c index a3a3652..ac52c2b 100644 --- a/test/mtime.c +++ b/test/mtime.c @@ -39,9 +39,9 @@ const char *FILENAME[] = { * * Purpose: H5O_mtime_decode() test. * - * Return: Success: + * Return: Success: * - * Failure: + * Failure: * * Programmer: Robb Matzke * Thursday, July 30, 1998 @@ -68,9 +68,9 @@ main(void) h5_reset(); fapl = h5_fileaccess(); - + TESTING("modification time messages"); - + /* Create the file, create a dataset, then close the file */ h5_fixname(FILENAME[0], fapl, filename, sizeof filename); if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) @@ -105,7 +105,7 @@ main(void) puts(" name."); goto error; } - + /* Compare times -- they must be within 60 seconds of one another */ if (0==sb1.mtime) { SKIPPED(); @@ -123,12 +123,12 @@ main(void) goto error; } PASSED(); - + /* Check opening existing file with old-style modification time information * and make certain that the time is correct */ TESTING("accessing old modification time messages"); - + { char testfile[512]=""; char *srcdir = HDgetenv("srcdir"); @@ -163,7 +163,7 @@ main(void) * and make certain that the time is correct */ TESTING("accessing new modification time messages"); - + { char testfile[512]=""; char *srcdir = HDgetenv("srcdir"); @@ -203,4 +203,4 @@ main(void) } - + diff --git a/test/ntypes.c b/test/ntypes.c index bcbbcf8..d3be489 100644 --- a/test/ntypes.c +++ b/test/ntypes.c @@ -14,7 +14,7 @@ /* * Programmer: Raymond Lu - * October 14, 2001 + * October 14, 2001 * * Purpose: Tests the H5Tget_native_type function. */ @@ -115,33 +115,33 @@ test_atomic_dtype(hid_t file) if((dataset=H5Dopen(file, DSET_ATOMIC_NAME_1))<0) TEST_ERROR; if((dtype=H5Dget_type(dataset))<0) TEST_ERROR; - + if((native_type=H5Tget_native_type(dtype, H5T_DIR_DEFAULT))<0) TEST_ERROR; /* Verify the datatype retrieved and converted */ - if(H5Tget_order(native_type) != H5Tget_order(H5T_NATIVE_INT)) + if(H5Tget_order(native_type) != H5Tget_order(H5T_NATIVE_INT)) TEST_ERROR; if(H5Tget_size(native_type) < H5Tget_size(H5T_STD_I32BE)) TEST_ERROR; if(H5T_INTEGER!=H5Tget_class(native_type)) TEST_ERROR; - /* Read the dataset back. The temporary buffer is for special platforms + /* Read the dataset back. The temporary buffer is for special platforms * like Cray. */ tmp = malloc((size_t)(DIM0*DIM1*H5Tget_size(native_type))); - + if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp)<0) TEST_ERROR; - + /* Copy data from temporary buffer to destination buffer */ - memcpy(icheck2, tmp, (size_t)(DIM0*DIM1*H5Tget_size(native_type))); + memcpy(icheck2, tmp, (size_t)(DIM0*DIM1*H5Tget_size(native_type))); free(tmp); - + /* Convert to the integer type */ if(H5Tconvert(native_type, H5T_NATIVE_INT, (DIM0*DIM1), icheck2, NULL, H5P_DEFAULT)<0) TEST_ERROR; - + /* Check that the values read are the same as the values written */ for (i = 0; i < DIM0; i++) { for (j = 0; j < DIM1; j++) { @@ -165,18 +165,18 @@ test_atomic_dtype(hid_t file) H5P_DEFAULT))<0) TEST_ERROR; if((dtype=H5Dget_type(dataset))<0) TEST_ERROR; - + if((native_type=H5Tget_native_type(dtype, H5T_DIR_DEFAULT))<0) TEST_ERROR; - + /* Verify the datatype retrieved and converted */ - if(H5Tget_order(native_type) != H5Tget_order(H5T_NATIVE_LLONG)) + if(H5Tget_order(native_type) != H5Tget_order(H5T_NATIVE_LLONG)) TEST_ERROR; if(H5Tget_size(native_type) < H5Tget_size(H5T_STD_I64LE)) TEST_ERROR; if(H5T_INTEGER!=H5Tget_class(native_type)) TEST_ERROR; - + if(H5Dclose(dataset)<0) TEST_ERROR; if(H5Tclose(native_type)<0) TEST_ERROR; if(H5Tclose(dtype)<0) TEST_ERROR; @@ -187,70 +187,70 @@ test_atomic_dtype(hid_t file) H5P_DEFAULT))<0) TEST_ERROR; if((dtype=H5Dget_type(dataset))<0) TEST_ERROR; - + if((native_type=H5Tget_native_type(dtype, H5T_DIR_ASCEND))<0) TEST_ERROR; - + /* Verify the datatype retrieved and converted */ - if(H5Tget_order(native_type) != H5Tget_order(H5T_NATIVE_CHAR)) + if(H5Tget_order(native_type) != H5Tget_order(H5T_NATIVE_CHAR)) TEST_ERROR; if(H5Tget_size(native_type) < H5Tget_size(H5T_STD_I8LE)) TEST_ERROR; if(H5T_INTEGER!=H5Tget_class(native_type)) TEST_ERROR; - + if(H5Dclose(dataset)<0) TEST_ERROR; if(H5Tclose(native_type)<0) TEST_ERROR; if(H5Tclose(dtype)<0) TEST_ERROR; - - + + /* Create the dataset of H5T_IEEE_F32BE */ if ((dataset = H5Dcreate(file, DSET_ATOMIC_NAME_4, H5T_IEEE_F32BE, space, H5P_DEFAULT))<0) TEST_ERROR; if((dtype=H5Dget_type(dataset))<0) TEST_ERROR; - + if((native_type=H5Tget_native_type(dtype, H5T_DIR_DESCEND))<0) TEST_ERROR; - + /* Verify the datatype retrieved and converted */ - if(H5Tget_order(native_type) != H5Tget_order(H5T_NATIVE_FLOAT)) + if(H5Tget_order(native_type) != H5Tget_order(H5T_NATIVE_FLOAT)) TEST_ERROR; if(H5Tget_size(native_type) < H5Tget_size(H5T_IEEE_F32BE)) TEST_ERROR; if(H5T_FLOAT!=H5Tget_class(native_type)) TEST_ERROR; - + if(H5Dclose(dataset)<0) TEST_ERROR; if(H5Tclose(native_type)<0) TEST_ERROR; if(H5Tclose(dtype)<0) TEST_ERROR; - - + + /* Create the dataset of H5T_IEEE_F64BE */ if ((dataset = H5Dcreate(file, DSET_ATOMIC_NAME_5, H5T_IEEE_F64BE, space, H5P_DEFAULT))<0) TEST_ERROR; if((dtype=H5Dget_type(dataset))<0) TEST_ERROR; - + if((native_type=H5Tget_native_type(dtype, H5T_DIR_DESCEND))<0) TEST_ERROR; - + /* Verify the datatype retrieved and converted */ - if(H5Tget_order(native_type) != H5Tget_order(H5T_NATIVE_DOUBLE)) + if(H5Tget_order(native_type) != H5Tget_order(H5T_NATIVE_DOUBLE)) TEST_ERROR; if(H5Tget_size(native_type) < H5Tget_size(H5T_IEEE_F64BE)) TEST_ERROR; if(H5T_FLOAT!=H5Tget_class(native_type)) TEST_ERROR; - + if(H5Dclose(dataset)<0) TEST_ERROR; if(H5Tclose(native_type)<0) TEST_ERROR; if(H5Tclose(dtype)<0) TEST_ERROR; - - + + /* Close dataspace */ if(H5Sclose(space)<0) TEST_ERROR; - + PASSED(); return 0; @@ -377,9 +377,9 @@ test_compound_dtype2(hid_t file) if(H5Dclose(dataset)<0) TEST_ERROR; /* Close dataspace */ - if(H5Sclose(space)<0) TEST_ERROR; + if(H5Sclose(space)<0) TEST_ERROR; + - /* Open dataset again to check H5Tget_native_type */ if((dataset=H5Dopen(file, DSET_COMPOUND_NAME_2))<0) TEST_ERROR; @@ -387,34 +387,34 @@ test_compound_dtype2(hid_t file) if((native_type=H5Tget_native_type(dtype, H5T_DIR_DEFAULT))<0) TEST_ERROR; - + /* Verify the datatype of each field retrieved and converted */ /* check the char member */ if((mem_id = H5Tget_member_type(native_type, 0))<0) TEST_ERROR; - if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_UCHAR)) + if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_UCHAR)) TEST_ERROR; if(H5Tget_size(mem_id) < H5Tget_size(H5T_STD_U8LE)) TEST_ERROR; if(H5T_INTEGER!=H5Tget_class(mem_id)) TEST_ERROR; H5Tclose(mem_id); - - /* check the integer member */ + + /* check the integer member */ if((mem_id = H5Tget_member_type(native_type, 1))<0) TEST_ERROR; - if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_INT)) + if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_INT)) TEST_ERROR; if(H5Tget_size(mem_id) < H5Tget_size(H5T_STD_I32LE)) TEST_ERROR; if(H5T_INTEGER!=H5Tget_class(mem_id)) TEST_ERROR; H5Tclose(mem_id); - + /* check the long long member */ if((mem_id = H5Tget_member_type(native_type, 3))<0) TEST_ERROR; - if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_ULLONG)) + if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_ULLONG)) TEST_ERROR; if(H5Tget_size(mem_id) < H5Tget_size(H5T_STD_U64BE)) TEST_ERROR; @@ -425,10 +425,10 @@ test_compound_dtype2(hid_t file) /* check the nested compound member */ if((nest_mem_id = H5Tget_member_type(native_type, 2))<0) TEST_ERROR; - + if((mem_id = H5Tget_member_type(nest_mem_id, 0))<0) TEST_ERROR; - if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_SHORT)) + if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_SHORT)) TEST_ERROR; if(H5Tget_size(mem_id) < H5Tget_size(H5T_STD_I16BE)) TEST_ERROR; @@ -438,7 +438,7 @@ test_compound_dtype2(hid_t file) if((mem_id = H5Tget_member_type(nest_mem_id, 1))<0) TEST_ERROR; - if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_LONG)) + if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_LONG)) TEST_ERROR; #if H5_SIZEOF_LONG==4 if(H5Tget_size(mem_id) < H5Tget_size(H5T_STD_I32LE)) TEST_ERROR; @@ -450,13 +450,13 @@ test_compound_dtype2(hid_t file) if(H5T_INTEGER!=H5Tget_class(mem_id)) TEST_ERROR; H5Tclose(mem_id); - + /* Read the dataset back. Temporary buffer is for special platforms like * Cray */ tmp = malloc(DIM0*DIM1*H5Tget_size(native_type)); if((bkg=calloc(sizeof(s1),DIM0*DIM1))==NULL) TEST_ERROR; - + if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp)<0) TEST_ERROR; @@ -573,7 +573,7 @@ test_compound_dtype(hid_t file) if(H5Tinsert(tid, "c", 0, H5T_STD_U8LE)<0) TEST_ERROR; if(H5Tinsert(tid, "i", 1, H5T_STD_U32LE)<0) TEST_ERROR; if(H5Tinsert(tid, "l", 5, H5T_STD_I64BE)<0) TEST_ERROR; - + /* Create the dataset */ if ((dataset = H5Dcreate(file, DSET_COMPOUND_NAME, tid, space, H5P_DEFAULT))<0) TEST_ERROR; @@ -583,7 +583,7 @@ test_compound_dtype(hid_t file) if(H5Tinsert(tid2, "c", HOFFSET(s1, c), H5T_NATIVE_UCHAR)<0) TEST_ERROR; if(H5Tinsert(tid2, "i", HOFFSET(s1, i), H5T_NATIVE_UINT)<0) TEST_ERROR; if(H5Tinsert(tid2, "l", HOFFSET(s1, l), H5T_NATIVE_LLONG)<0) TEST_ERROR; - + /* Write the data to the dataset */ if (H5Dwrite(dataset, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, points)<0) TEST_ERROR; @@ -592,9 +592,9 @@ test_compound_dtype(hid_t file) if(H5Dclose(dataset)<0) TEST_ERROR; /* Close dataspace */ - if(H5Sclose(space)<0) TEST_ERROR; + if(H5Sclose(space)<0) TEST_ERROR; + - /* Open dataset again to check H5Tget_native_type */ if((dataset=H5Dopen(file, DSET_COMPOUND_NAME))<0) TEST_ERROR; @@ -602,54 +602,54 @@ test_compound_dtype(hid_t file) if((native_type=H5Tget_native_type(dtype, H5T_DIR_DEFAULT))<0) TEST_ERROR; - + /* Verify the datatype of each field retrieved and converted */ if((mem_id = H5Tget_member_type(native_type, 0))<0) TEST_ERROR; - if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_UCHAR)) + if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_UCHAR)) TEST_ERROR; if(H5Tget_size(mem_id) < H5Tget_size(H5T_STD_U8LE)) TEST_ERROR; if(H5T_INTEGER!=H5Tget_class(mem_id)) TEST_ERROR; H5Tclose(mem_id); - + if((mem_id = H5Tget_member_type(native_type, 1))<0) TEST_ERROR; - if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_UINT)) + if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_UINT)) TEST_ERROR; if(H5Tget_size(mem_id) < H5Tget_size(H5T_STD_U32LE)) TEST_ERROR; if(H5T_INTEGER!=H5Tget_class(mem_id)) TEST_ERROR; H5Tclose(mem_id); - + if((mem_id = H5Tget_member_type(native_type, 2))<0) TEST_ERROR; - if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_LLONG)) + if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_LLONG)) TEST_ERROR; if(H5Tget_size(mem_id) < H5Tget_size(H5T_STD_I64BE)) TEST_ERROR; if(H5T_INTEGER!=H5Tget_class(mem_id)) TEST_ERROR; H5Tclose(mem_id); - + /* Read the dataset back. Temporary buffer is for special platforms like * Cray */ tmp = malloc(DIM0*DIM1*H5Tget_size(native_type)); bkg = calloc(sizeof(s1),DIM0*DIM1); - + if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp)<0) TEST_ERROR; memcpy(check, tmp, DIM0*DIM1*H5Tget_size(native_type)); free(tmp); - + if (H5Tconvert(native_type, tid2, (DIM0*DIM1), check, bkg, H5P_DEFAULT)<0) TEST_ERROR; - + free(bkg); - + /* Check that the values read are the same as the values written */ for (i = 0, temp_point=points, temp_check=check; i < DIM0; i++) { for (j = 0; j < DIM1; j++, temp_point++,temp_check++) { @@ -709,7 +709,7 @@ test_compound_dtype3(hid_t file) long_long l; } s1; hid_t dataset, space; - hid_t dtype, native_type, tid, tid2, tid_m, tid_m2, + hid_t dtype, native_type, tid, tid2, tid_m, tid_m2, mem_id, nest_mem_id; hsize_t array_dims[1]={5}; int i, j, k, n; @@ -717,7 +717,7 @@ test_compound_dtype3(hid_t file) s1 *temp_point, *temp_check; s1 *points=NULL, *check=NULL; void *tmp, *bkg; - + TESTING("compound datatype with array as field"); /* Allocate space for the points & check arrays */ @@ -740,10 +740,10 @@ test_compound_dtype3(hid_t file) dims[0] = DIM0; dims[1] = DIM1; if ((space = H5Screate_simple(2, dims, NULL))<0) TEST_ERROR; - + /* Create array datatype */ if((tid2=H5Tarray_create(H5T_STD_I32LE, 1, array_dims, NULL))<0) TEST_ERROR; - + /* Create compound datatype for disk storage */ if((tid=H5Tcreate(H5T_COMPOUND, 29))<0) TEST_ERROR; @@ -751,14 +751,14 @@ test_compound_dtype3(hid_t file) if(H5Tinsert(tid, "c", 0, H5T_STD_U8LE)<0) TEST_ERROR; if(H5Tinsert(tid, "a", 1, tid2)<0) TEST_ERROR; if(H5Tinsert(tid, "l", 21, H5T_STD_I64BE)<0) TEST_ERROR; - + /* Create the dataset */ if ((dataset = H5Dcreate(file, DSET_COMPOUND_NAME_3, tid, space, H5P_DEFAULT))<0) TEST_ERROR; /* Create array datatype */ if((tid_m2=H5Tarray_create(H5T_NATIVE_INT, 1, array_dims, NULL))<0) TEST_ERROR; - + /* Create compound datatype for datatype in memory */ if((tid_m=H5Tcreate(H5T_COMPOUND, sizeof(s1)))<0) TEST_ERROR; if(H5Tinsert(tid_m, "c", HOFFSET(s1, c), H5T_NATIVE_UCHAR)<0) TEST_ERROR; @@ -777,9 +777,9 @@ test_compound_dtype3(hid_t file) if(H5Tclose(tid2)<0) TEST_ERROR; /* Close dataspace */ - if(H5Sclose(space)<0) TEST_ERROR; + if(H5Sclose(space)<0) TEST_ERROR; + - /* Open dataset again to check H5Tget_native_type */ if((dataset=H5Dopen(file, DSET_COMPOUND_NAME_3))<0) TEST_ERROR; @@ -787,19 +787,19 @@ test_compound_dtype3(hid_t file) if((native_type=H5Tget_native_type(dtype, H5T_DIR_DEFAULT))<0) TEST_ERROR; - + /* Verify the datatype of each field retrieved and converted */ /* check the char member */ if((mem_id = H5Tget_member_type(native_type, 0))<0) TEST_ERROR; - if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_UCHAR)) + if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_UCHAR)) TEST_ERROR; if(H5Tget_size(mem_id) < H5Tget_size(H5T_STD_U8LE)) TEST_ERROR; if(H5T_INTEGER!=H5Tget_class(mem_id)) TEST_ERROR; H5Tclose(mem_id); - + /* check the array member */ if((mem_id = H5Tget_member_type(native_type, 1))<0) TEST_ERROR; @@ -807,7 +807,7 @@ test_compound_dtype3(hid_t file) TEST_ERROR; if((nest_mem_id = H5Tget_super(mem_id))<0) TEST_ERROR; - if(H5Tget_order(nest_mem_id) != H5Tget_order(H5T_NATIVE_INT)) + if(H5Tget_order(nest_mem_id) != H5Tget_order(H5T_NATIVE_INT)) TEST_ERROR; if(H5Tget_size(nest_mem_id) < H5Tget_size(H5T_STD_I32LE)) TEST_ERROR; @@ -815,24 +815,24 @@ test_compound_dtype3(hid_t file) TEST_ERROR; H5Tclose(nest_mem_id); H5Tclose(mem_id); - + /* check the long long member */ if((mem_id = H5Tget_member_type(native_type, 2))<0) TEST_ERROR; - if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_LLONG)) + if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_LLONG)) TEST_ERROR; if(H5Tget_size(mem_id) < H5Tget_size(H5T_STD_I64BE)) TEST_ERROR; if(H5T_INTEGER!=H5Tget_class(mem_id)) TEST_ERROR; H5Tclose(mem_id); - + /* Read the dataset back. Temporary buffer is for special platforms like * Cray */ tmp = malloc(DIM0*DIM1*H5Tget_size(native_type)); if((bkg=calloc(sizeof(s1),DIM0*DIM1))==NULL) TEST_ERROR; - + if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp)<0) TEST_ERROR; @@ -916,7 +916,7 @@ test_compound_opaque(hid_t file) s1 *temp_point, *temp_check; s1 *points=NULL, *check=NULL; void *tmp, *bkg; - + TESTING("compound datatype with opaque field"); /* Allocate space for the points & check arrays */ @@ -939,11 +939,11 @@ test_compound_opaque(hid_t file) dims[0] = DIM0; dims[1] = DIM1; if ((space = H5Screate_simple(2, dims, NULL))<0) TEST_ERROR; - + /* Create opaque datatype */ if((tid2=H5Tcreate(H5T_OPAQUE, sizeof(temp_point->o)))<0) TEST_ERROR; if(H5Tset_tag(tid2, "testing opaque field")<0) TEST_ERROR; - + /* Create compound datatype for disk storage */ if((tid=H5Tcreate(H5T_COMPOUND, 14))<0) TEST_ERROR; @@ -951,7 +951,7 @@ test_compound_opaque(hid_t file) if(H5Tinsert(tid, "c", 0, H5T_STD_U8LE)<0) TEST_ERROR; if(H5Tinsert(tid, "o", 1, tid2)<0) TEST_ERROR; if(H5Tinsert(tid, "l", 6, H5T_STD_I64BE)<0) TEST_ERROR; - + /* Create the dataset */ if ((dataset = H5Dcreate(file, DSET_COMPOUND_NAME_4, tid, space, H5P_DEFAULT))<0) TEST_ERROR; @@ -974,9 +974,9 @@ test_compound_opaque(hid_t file) if(H5Tclose(tid2)<0) TEST_ERROR; /* Close dataspace */ - if(H5Sclose(space)<0) TEST_ERROR; + if(H5Sclose(space)<0) TEST_ERROR; + - /* Open dataset again to check H5Tget_native_type */ if((dataset=H5Dopen(file, DSET_COMPOUND_NAME_4))<0) TEST_ERROR; @@ -984,19 +984,19 @@ test_compound_opaque(hid_t file) if((native_type=H5Tget_native_type(dtype, H5T_DIR_DEFAULT))<0) TEST_ERROR; - + /* Verify the datatype of each field retrieved and converted */ /* check the char member */ if((mem_id = H5Tget_member_type(native_type, 0))<0) TEST_ERROR; - if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_UCHAR)) + if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_UCHAR)) TEST_ERROR; if(H5Tget_size(mem_id) < H5Tget_size(H5T_STD_U8LE)) TEST_ERROR; if(H5T_INTEGER!=H5Tget_class(mem_id)) TEST_ERROR; H5Tclose(mem_id); - + /* check the array member */ if((mem_id = H5Tget_member_type(native_type, 1))<0) TEST_ERROR; @@ -1005,24 +1005,24 @@ test_compound_opaque(hid_t file) if(H5Tget_size(mem_id) != sizeof(temp_point->o)) TEST_ERROR; H5Tclose(mem_id); - + /* check the long long member */ if((mem_id = H5Tget_member_type(native_type, 2))<0) TEST_ERROR; - if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_LLONG)) + if(H5Tget_order(mem_id) != H5Tget_order(H5T_NATIVE_LLONG)) TEST_ERROR; if(H5Tget_size(mem_id) < H5Tget_size(H5T_STD_I64BE)) TEST_ERROR; if(H5T_INTEGER!=H5Tget_class(mem_id)) TEST_ERROR; H5Tclose(mem_id); - + /* Read the dataset back. Temporary buffer is for special platforms like * Cray */ tmp = HDmalloc(DIM0*DIM1*H5Tget_size(native_type)); if((bkg=HDcalloc(sizeof(s1),DIM0*DIM1))==NULL) TEST_ERROR; - + if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp)<0) TEST_ERROR; @@ -1121,7 +1121,7 @@ test_enum_dtype(hid_t file) dims[1] = DIM1; if ((space = H5Screate_simple(2, dims, NULL))<0) TEST_ERROR; - /* Construct enum type based on native type */ + /* Construct enum type based on native type */ if((tid=H5Tenum_create(H5T_STD_I16LE))<0) TEST_ERROR; for (i = 0; i < 8; i++) { @@ -1129,19 +1129,19 @@ test_enum_dtype(hid_t file) sub_colors[i*2+1]=0; if(H5Tenum_insert(tid, mname[i], &(sub_colors[i*2]))<0) TEST_ERROR; } - + /* Create the dataset */ if ((dataset = H5Dcreate(file, DSET_ENUM_NAME, tid, space, H5P_DEFAULT))<0) TEST_ERROR; - /* Construct enum type based on native type in memory */ + /* Construct enum type based on native type in memory */ if((tid_m=H5Tenum_create(H5T_NATIVE_SHORT))<0) TEST_ERROR; for (i = 0; i < 8; i++) { colors[i] = i; if(H5Tenum_insert(tid_m, mname[i], &(colors[i]))<0) TEST_ERROR; } - + /* Write the data to the dataset */ if (H5Dwrite(dataset, tid_m, H5S_ALL, H5S_ALL, H5P_DEFAULT, spoints2)<0) TEST_ERROR; @@ -1151,28 +1151,28 @@ test_enum_dtype(hid_t file) /* Close datatype */ if(H5Tclose(tid)<0) TEST_ERROR; - + /* Close dataspace */ - if(H5Sclose(space)<0) TEST_ERROR; + if(H5Sclose(space)<0) TEST_ERROR; /* Open dataset again to check H5Tget_native_type */ if((dataset=H5Dopen(file, DSET_ENUM_NAME))<0) TEST_ERROR; if((dtype=H5Dget_type(dataset))<0) TEST_ERROR; - + if((native_type=H5Tget_native_type(dtype, H5T_DIR_DEFAULT))<0) TEST_ERROR; - + /* Read the dataset back. Temporary buffer is for special platforms like * Cray */ tmp = malloc(DIM0*DIM1*H5Tget_size(native_type)); - + if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp)<0) TEST_ERROR; memcpy(scheck2, tmp, DIM0*DIM1*H5Tget_size(native_type)); free(tmp); - + if (H5Tconvert(native_type, tid_m, (DIM0*DIM1), scheck2, NULL, H5P_DEFAULT)<0) TEST_ERROR; @@ -1183,7 +1183,7 @@ test_enum_dtype(hid_t file) H5_FAILED(); printf(" Read different values than written.\n"); printf(" At index %d,%d\n", i, j); - printf(" spoints2[i][j]=%hd, scheck2[i][j]=%hd\n", spoints2[i][j], + printf(" spoints2[i][j]=%hd, scheck2[i][j]=%hd\n", spoints2[i][j], scheck2[i][j]); goto error; } @@ -1233,7 +1233,7 @@ test_array_dtype(hid_t file) s1 *temp_point, *temp_check; s1 *points=NULL, *check=NULL; void *tmp; - + TESTING("array of compound datatype"); /* Allocate space for the points & check arrays */ @@ -1263,10 +1263,10 @@ test_array_dtype(hid_t file) if(H5Tinsert(tid2, "c", 0, H5T_STD_U8BE)<0) TEST_ERROR; if(H5Tinsert(tid2, "i", 1, H5T_STD_U32LE)<0) TEST_ERROR; if(H5Tinsert(tid2, "l", 5, H5T_STD_I64BE)<0) TEST_ERROR; - + /* Create array datatype for disk storage */ if((tid=H5Tarray_create(tid2, 1, array_dims, NULL))<0) TEST_ERROR; - + /* Create the dataset */ if ((dataset = H5Dcreate(file, DSET_ARRAY_NAME, tid, space, H5P_DEFAULT))<0) TEST_ERROR; @@ -1276,33 +1276,33 @@ test_array_dtype(hid_t file) if(H5Tinsert(tid3, "c", HOFFSET(s1, c), H5T_NATIVE_UCHAR)<0) TEST_ERROR; if(H5Tinsert(tid3, "i", HOFFSET(s1, i), H5T_NATIVE_UINT)<0) TEST_ERROR; if(H5Tinsert(tid3, "l", HOFFSET(s1, l), H5T_NATIVE_LLONG)<0) TEST_ERROR; - + /* Create array datatype for memory */ if((tid_m=H5Tarray_create(tid3, 1, array_dims, NULL))<0) TEST_ERROR; - + /* Write the data to the dataset */ if (H5Dwrite(dataset, tid_m, H5S_ALL, H5S_ALL, H5P_DEFAULT, points)<0) TEST_ERROR; /* Close dataset */ if(H5Dclose(dataset)<0) TEST_ERROR; - + /* Close datatype */ if(H5Tclose(tid)<0) TEST_ERROR; if(H5Tclose(tid2)<0) TEST_ERROR; /* Close dataspace */ - if(H5Sclose(space)<0) TEST_ERROR; + if(H5Sclose(space)<0) TEST_ERROR; /* Open dataset again to check H5Tget_native_type */ if((dataset=H5Dopen(file, DSET_ARRAY_NAME))<0) TEST_ERROR; if((dtype=H5Dget_type(dataset))<0) TEST_ERROR; - + if((native_type=H5Tget_native_type(dtype, H5T_DIR_DEFAULT))<0) TEST_ERROR; - /* Read the dataset back. Temporary buffer is for special platforms like + /* Read the dataset back. Temporary buffer is for special platforms like * Cray */ tmp = malloc(DIM0*DIM1*H5Tget_size(native_type)); @@ -1311,7 +1311,7 @@ test_array_dtype(hid_t file) memcpy(check, tmp, DIM0*DIM1*H5Tget_size(native_type)); free(tmp); - + if (H5Tconvert(native_type, tid_m, (DIM0*DIM1), check, NULL, H5P_DEFAULT)<0) TEST_ERROR; @@ -1384,7 +1384,7 @@ test_array_dtype2(hid_t file) /* Initialize the dataset */ for(i = n = 0;i < DIM0; i++) for(j = 0; j < DIM1; j++) - for(k = 0; k < 5; k++) + for(k = 0; k < 5; k++) ipoints3[i][j][k] = n++; /* Create the data space */ @@ -1394,40 +1394,40 @@ test_array_dtype2(hid_t file) /* Create array datatype for disk storage */ if((tid=H5Tarray_create(H5T_STD_I32LE, 1, array_dims, NULL))<0) TEST_ERROR; - + /* Create the dataset */ if ((dataset = H5Dcreate(file, DSET_ARRAY2_NAME, tid, space, H5P_DEFAULT))<0) TEST_ERROR; /* Create array datatype for memory */ if((tid_m=H5Tarray_create(H5T_NATIVE_INT, 1, array_dims, NULL))<0) TEST_ERROR; - + /* Write the data to the dataset */ if (H5Dwrite(dataset, tid_m, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints3)<0) TEST_ERROR; /* Close dataset */ if(H5Dclose(dataset)<0) TEST_ERROR; - + /* Close datatype */ if(H5Tclose(tid)<0) TEST_ERROR; /* Close dataspace */ - if(H5Sclose(space)<0) TEST_ERROR; + if(H5Sclose(space)<0) TEST_ERROR; /* Open dataset again to check H5Tget_native_type */ if((dataset=H5Dopen(file, DSET_ARRAY2_NAME))<0) TEST_ERROR; if((dtype=H5Dget_type(dataset))<0) TEST_ERROR; - + if((native_type=H5Tget_native_type(dtype, H5T_DIR_DEFAULT))<0) TEST_ERROR; /* Read the dataset back. Temporary buffer is for special platforms like * Cray */ tmp = malloc(DIM0*DIM1*H5Tget_size(native_type)); - + if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp)<0) TEST_ERROR; @@ -1481,7 +1481,7 @@ error: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t test_vl_dtype(hid_t file) { hvl_t wdata[SPACE1_DIM1]; /* Information to write */ @@ -1492,7 +1492,7 @@ test_vl_dtype(hid_t file) hid_t dtype, native_type, nat_super_type, tid, tid2, tid_m, tid_m2; size_t i, j, k; void* *tmp; - + TESTING("variable length datatype"); /* Allocate and initialize VL data to write */ @@ -1517,7 +1517,7 @@ test_vl_dtype(hid_t file) } } /* end for */ } /* end for */ - + /* Create dataspace for datasets */ if((space = H5Screate_simple(SPACE1_RANK, dims1, NULL))<0) TEST_ERROR; @@ -1526,17 +1526,17 @@ test_vl_dtype(hid_t file) /* Create a VL datatype for disk storage */ tid = H5Tvlen_create (tid2); - + /* Create a dataset */ if((dataset=H5Dcreate(file, DSET_VL_NAME, tid, space, H5P_DEFAULT))<0) TEST_ERROR; /* Create a base VL datatype for memory */ if((tid_m2 = H5Tvlen_create (H5T_NATIVE_UINT))<0) TEST_ERROR; - + /* Create a VL datatype for memory */ if((tid_m = H5Tvlen_create (tid_m2))<0) TEST_ERROR; - + /* Write dataset to disk */ if(H5Dwrite(dataset,tid_m,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata)<0) TEST_ERROR; @@ -1552,11 +1552,11 @@ test_vl_dtype(hid_t file) /* Get native datatype for dataset */ if((dtype = H5Dget_type(dataset))<0) TEST_ERROR; - + if((native_type=H5Tget_native_type(dtype, H5T_DIR_DEFAULT))<0) TEST_ERROR; - - /* Also get native base type for this nested VL type. Should be an integer type. */ + + /* Also get native base type for this nested VL type. Should be an integer type. */ if((nat_super_type=H5Tget_super(native_type))<0) TEST_ERROR; if((nat_super_type=H5Tget_super(nat_super_type))<0) @@ -1564,7 +1564,7 @@ test_vl_dtype(hid_t file) /* Read dataset from disk */ if(H5Dread(dataset,native_type,H5S_ALL,H5S_ALL,H5P_DEFAULT,rdata)<0) TEST_ERROR; - + /* Compare data read in */ for(i=0; ilen*sizeof(unsigned int)); memcpy(tmp, t2->p, t2->len*H5Tget_size(nat_super_type)); @@ -1595,7 +1595,7 @@ test_vl_dtype(hid_t file) goto error; } } /* end for */ - + free(tmp); } /* end for */ } /* end for */ @@ -1614,11 +1614,11 @@ test_vl_dtype(hid_t file) if(H5Tclose(dtype)<0) TEST_ERROR; if(H5Tclose(tid_m)<0) TEST_ERROR; if(H5Tclose(tid_m2)<0) TEST_ERROR; - + /* Close disk dataspace */ if(H5Sclose(space)<0) TEST_ERROR; - + PASSED(); return 0; @@ -1643,7 +1643,7 @@ test_vl_dtype(hid_t file) * *------------------------------------------------------------------------- */ -static herr_t +static herr_t test_vlstr_dtype(hid_t file) { const char *wdata[SPACE1_DIM1]= { @@ -1671,7 +1671,7 @@ test_vlstr_dtype(hid_t file) if(H5Tset_size (tid1,H5T_VARIABLE)<0) TEST_ERROR; if(H5T_STRING!=H5Tget_class(tid1) || !H5Tis_variable_str(tid1)) TEST_ERROR; - + /* Create a dataset */ if((dataset=H5Dcreate(file,DSET_VLSTR_NAME,tid1,sid1,H5P_DEFAULT))<0) TEST_ERROR; @@ -1692,7 +1692,7 @@ test_vlstr_dtype(hid_t file) TEST_ERROR; /* Check if the data type is equal */ - if(!H5Tequal(native_type, tid1)) + if(!H5Tequal(native_type, tid1)) TEST_ERROR; /* Read dataset from disk */ @@ -1723,16 +1723,16 @@ test_vlstr_dtype(hid_t file) /* Close disk dataspace */ if(H5Sclose(sid1)<0) TEST_ERROR; - + /* Free memory for rdata */ for(i=0; i * April 14, 2000 * - * Purpose: Test HDF-SRB if it is configured and compiled. Append an - * integer dataset to an existent HDF5 file with an integer array - * on SRB server. + * Purpose: Test HDF-SRB if it is configured and compiled. Append an + * integer dataset to an existent HDF5 file with an integer array + * on SRB server. * - * Usage: The HDF5 is built on the top of SRB. So you just need to + * Usage: The HDF5 is built on the top of SRB. So you just need to * activate a connection to SRB server by calling function - * H5Pset_fapl_srb()(after creating file property list by calling + * H5Pset_fapl_srb()(after creating file property list by calling * H5Pcreate()). All server information is passed in through its - * parameter SRB_Info(a structure). Its fields are + * parameter SRB_Info(a structure). Its fields are * char *srbHost: SRB host address of server. If the input is - * NULL, it will use the environment varible "srbHost" if - * it is defined. If it is not defined, the - * ~/.srb/.MdasEnd file will be checked next. If not, it - * will use the hostname of the client machine. - * char *srbPort: SRB host port number of server. If the - * input value is NULL, it will use the env variable - * "srbPort" if it is defined. If not, it defaults to - * 5558. + * NULL, it will use the environment varible "srbHost" if + * it is defined. If it is not defined, the + * ~/.srb/.MdasEnd file will be checked next. If not, it + * will use the hostname of the client machine. + * char *srbPort: SRB host port number of server. If the + * input value is NULL, it will use the env variable + * "srbPort" if it is defined. If not, it defaults to + * 5558. * char *srbAuth: SRB Authentication-password. It is used to - * define password for MDAS or SEA authentication. - * For SEA authentication, this is the password used by - * the SEA library to decrypt the encrypted private key - * stored in the file ~/.SEAuuuuu@ddddd(where uuuuu is - * the user ID and ddddd is the user domain name). This - * input is not needed if an unencrypted private key is - * available in the /tmp directory(generated using the - * 'seaauth auto' command). To provide additional - * flexibility, a client may also use the environment - * variable "srbAuth" to specify the password. A client - * may also supply the password in the ~/.srb/.MdasAuth - * file. If a client uses more than one method to specfy - * the password, the value given in this function call - * will take precedent, then the environment variable - * "srbAuth", and lastly, the ~/.srb/.MdasAuth file. - * int storSysType: Storage system type on SRB server. - * 0=Unix, 1=UniTree, 2=HPSS, 3=FTP, 4=HTTP + * define password for MDAS or SEA authentication. + * For SEA authentication, this is the password used by + * the SEA library to decrypt the encrypted private key + * stored in the file ~/.SEAuuuuu@ddddd(where uuuuu is + * the user ID and ddddd is the user domain name). This + * input is not needed if an unencrypted private key is + * available in the /tmp directory(generated using the + * 'seaauth auto' command). To provide additional + * flexibility, a client may also use the environment + * variable "srbAuth" to specify the password. A client + * may also supply the password in the ~/.srb/.MdasAuth + * file. If a client uses more than one method to specfy + * the password, the value given in this function call + * will take precedent, then the environment variable + * "srbAuth", and lastly, the ~/.srb/.MdasAuth file. + * int storSysType: Storage system type on SRB server. + * 0=Unix, 1=UniTree, 2=HPSS, 3=FTP, 4=HTTP * int mode: File access mode, same definition with Unix. * int size: File Size, only valid for HPSS, -1 is default * * Then you can open an HDF5 file by calling H5Fopen(). When - * you pass in the file name, it has to be file name with an - * absolute path. It you use SDSC server(ghidorah.sdsc.edu), your - * home directory is possibly in /projects/mdas/srb/SRBVault/. + * you pass in the file name, it has to be file name with an + * absolute path. It you use SDSC server(ghidorah.sdsc.edu), your + * home directory is possibly in /projects/mdas/srb/SRBVault/. */ #include "h5test.h" @@ -79,7 +79,7 @@ int main(void) int main(void) { SRB_Info srb_info={ NULL, /* Use the server name in ~/.srb/MdasEnv */ - NULL, /* Use the server port number in + NULL, /* Use the server port number in * ~/.srb/MdasEnv */ NULL, /* Use the password in ~/.srb/MdasAuth */ 0, /* Using Unix storage system. */ @@ -89,26 +89,26 @@ int main(void) hid_t fapl =-1, file; hid_t dataspace, datatype, dataset; hsize_t dimsf[2]; - + herr_t status = 0; int data[NX][NY]; /* data to write */ int i, j; - /* - * Data and output buffer initialization. + /* + * Data and output buffer initialization. */ for (j = 0; j < NX; j++) { for (i = 0; i < NY; i++) data[j][i] = i*i + j*j; - } + } /* - * 0 1 4 9 16 25 + * 0 1 4 9 16 25 * 1 2 5 10 17 26 * 4 5 8 13 20 29 * 9 10 13 18 25 34 * 16 17 20 25 32 41 */ - + /* Create access property list and set the driver to GASS */ fapl = H5Pcreate (H5P_FILE_ACCESS); if (fapl < 0) { @@ -130,20 +130,20 @@ int main(void) printf ("H5Fopen failed. \n"); return -1; } - + /* * Describe the size of the array and create the data space for fixed - * size dataset. + * size dataset. */ dimsf[0] = NX; dimsf[1] = NY; - dataspace = H5Screate_simple(RANK, dimsf, NULL); + dataspace = H5Screate_simple(RANK, dimsf, NULL); if (dataspace < 0) { printf ("H5Screate failed. \n"); return -1; } - /* + /* * Define datatype for the data in the file. * We will store little endian INT numbers. */ @@ -152,7 +152,7 @@ int main(void) printf ("H5Tcopy failed. \n"); return -1; } - + status = H5Tset_order(datatype, H5T_ORDER_LE); if (status < 0) { printf ("H5Tset_order failed. \n"); @@ -188,7 +188,7 @@ int main(void) H5Dclose(dataset); H5Fclose(file); H5Pclose(fapl); - + printf("Test finished!\n"); return 0; } diff --git a/test/srb_read.c b/test/srb_read.c index 767812c..7e0bd66 100644 --- a/test/srb_read.c +++ b/test/srb_read.c @@ -17,47 +17,47 @@ * April 14, 2000 * * Purpose: Test HDF-SRB if it is configured and compiled. Read a chunk of - * dataset of an HDF5 file with an integer array on SRB server, + * dataset of an HDF5 file with an integer array on SRB server, * using hyperslab. - * Usage: The HDF5 is built on the top of SRB. So you just need to + * Usage: The HDF5 is built on the top of SRB. So you just need to * activate a connection to SRB server by calling function - * H5Pset_fapl_srb()(after creating file property list by calling + * H5Pset_fapl_srb()(after creating file property list by calling * H5Pcreate()). All server information is passed in through its - * parameter SRB_Info(a structure). Its fields are + * parameter SRB_Info(a structure). Its fields are * char *srbHost: SRB host address of server. If the input is - * NULL, it will use the environment varible "srbHost" if - * it is defined. If it is not defined, the - * ~/.srb/.MdasEnd file will be checked next. If not, it - * will use the hostname of the client machine. - * char *srbPort: SRB host port number of server. If the - * input value is NULL, it will use the env variable - * "srbPort" if it is defined. If not, it defaults to - * 5558. + * NULL, it will use the environment varible "srbHost" if + * it is defined. If it is not defined, the + * ~/.srb/.MdasEnd file will be checked next. If not, it + * will use the hostname of the client machine. + * char *srbPort: SRB host port number of server. If the + * input value is NULL, it will use the env variable + * "srbPort" if it is defined. If not, it defaults to + * 5558. * char *srbAuth: SRB Authentication-password. It is used to - * define password for MDAS or SEA authentication. - * For SEA authentication, this is the password used by - * the SEA library to decrypt the encrypted private key - * stored in the file ~/.SEAuuuuu@ddddd(where uuuuu is - * the user ID and ddddd is the user domain name). This - * input is not needed if an unencrypted private key is - * available in the /tmp directory(generated using the - * 'seaauth auto' command). To provide additional - * flexibility, a client may also use the environment - * variable "srbAuth" to specify the password. A client - * may also supply the password in the ~/.srb/.MdasAuth - * file. If a client uses more than one method to specfy - * the password, the value given in this function call - * will take precedent, then the environment variable - * "srbAuth", and lastly, the ~/.srb/.MdasAuth file. - * int storSysType: Storage system type on SRB server. - * 0=Unix, 1=UniTree, 2=HPSS, 3=FTP, 4=HTTP + * define password for MDAS or SEA authentication. + * For SEA authentication, this is the password used by + * the SEA library to decrypt the encrypted private key + * stored in the file ~/.SEAuuuuu@ddddd(where uuuuu is + * the user ID and ddddd is the user domain name). This + * input is not needed if an unencrypted private key is + * available in the /tmp directory(generated using the + * 'seaauth auto' command). To provide additional + * flexibility, a client may also use the environment + * variable "srbAuth" to specify the password. A client + * may also supply the password in the ~/.srb/.MdasAuth + * file. If a client uses more than one method to specfy + * the password, the value given in this function call + * will take precedent, then the environment variable + * "srbAuth", and lastly, the ~/.srb/.MdasAuth file. + * int storSysType: Storage system type on SRB server. + * 0=Unix, 1=UniTree, 2=HPSS, 3=FTP, 4=HTTP * int mode: File access mode, same definition with Unix. * int size: File Size, only valid for HPSS, -1 is default * * Then you can open an HDF5 file by calling H5Fopen(). When - * you pass in the file name, it has to be file name with an - * absolute path. It you use SDSC server(ghidorah.sdsc.edu), your - * home directory is possibly in /projects/mdas/srb/SRBVault/. + * you pass in the file name, it has to be file name with an + * absolute path. It you use SDSC server(ghidorah.sdsc.edu), your + * home directory is possibly in /projects/mdas/srb/SRBVault/. */ #include "h5test.h" @@ -70,32 +70,32 @@ int main(void) #else #define fileName "/projects/mdas/srb/SRBVault/slu.ncsa/a.h5" -#define DATASETNAME "IntArray" -#define NX_SUB 3 /* hyperslab dimensions */ -#define NY_SUB 4 -#define NX 7 /* output buffer dimensions */ -#define NY 7 -#define NZ 3 +#define DATASETNAME "IntArray" +#define NX_SUB 3 /* hyperslab dimensions */ +#define NY_SUB 4 +#define NX 7 /* output buffer dimensions */ +#define NY 7 +#define NZ 3 #define RANK 2 #define RANK_OUT 3 int main(void) { - hid_t fapl=-1, fid = -1, dataset; - hid_t datatype, dataspace; - hid_t memspace; + hid_t fapl=-1, fid = -1, dataset; + hid_t datatype, dataspace; + hid_t memspace; H5T_class_t class; /* data type class */ H5T_order_t order; /* data order */ size_t size; /* - * size of the data element + * size of the data element * stored in file */ hsize_t dimsm[3]; /* memory space dimensions */ - hsize_t dims_out[2]; /* dataset dimensions */ - herr_t status; + hsize_t dims_out[2]; /* dataset dimensions */ + herr_t status; int data_out[NX][NY][NZ ]; /* output buffer */ - + hsize_t count[2]; /* size of the hyperslab in the file */ hssize_t offset[2]; /* hyperslab offset in the file */ hsize_t count_out[3]; /* size of the hyperslab in memory */ @@ -105,7 +105,7 @@ int main(void) NULL, /* Use environment variable "srbPort" */ NULL, /* Use password in ~/.srb/.MdasEnv */ 0, /* Use Unix storage system. */ - 0600, /* File was created for read and write for + 0600, /* File was created for read and write for * owner */ -1 /* default */ }; @@ -115,21 +115,21 @@ int main(void) for (k = 0; k < NZ ; k++) data_out[j][i][k] = 0; } - } - + } + fapl = H5Pcreate(H5P_FILE_ACCESS); if (fapl < 0) { printf (" H5Pcreate failed. \n"); return -1; } - + status = H5Pset_fapl_srb(fapl, srb_info); if (status < 0) { printf ("H5Pset_fapl_srb failed. \n"); return -1; } - fid = H5Fopen(fileName, H5F_ACC_RDONLY, fapl); + fid = H5Fopen(fileName, H5F_ACC_RDONLY, fapl); if (fid < 0) { printf ("H5Fopen failed. \n"); return -1; @@ -138,12 +138,12 @@ int main(void) if(dataset<0) { printf ("H5Dopen failed. \n"); return -1; - } + } /* * Get datatype and dataspace handles and then query * dataset class, order, size, rank and dimensions. */ - datatype = H5Dget_type(dataset); /* datatype handle */ + datatype = H5Dget_type(dataset); /* datatype handle */ class = H5Tget_class(datatype); if (class == H5T_INTEGER) printf("Data set has INTEGER type \n"); order = H5Tget_order(datatype); @@ -158,14 +158,14 @@ int main(void) printf("rank %d, dimensions %lu x %lu \n", rank, (unsigned long)(dims_out[0]), (unsigned long)(dims_out[1])); - /* - * Define hyperslab in the dataset. + /* + * Define hyperslab in the dataset. */ offset[0] = 1; offset[1] = 2; count[0] = NX_SUB; count[1] = NY_SUB; - status = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, NULL, + status = H5Sselect_hyperslab(dataspace, H5S_SELECT_SET, offset, NULL, count, NULL); /* @@ -174,10 +174,10 @@ int main(void) dimsm[0] = NX; dimsm[1] = NY; dimsm[2] = NZ ; - memspace = H5Screate_simple(RANK_OUT,dimsm,NULL); + memspace = H5Screate_simple(RANK_OUT,dimsm,NULL); - /* - * Define memory hyperslab. + /* + * Define memory hyperslab. */ offset_out[0] = 3; offset_out[1] = 0; @@ -185,11 +185,11 @@ int main(void) count_out[0] = NX_SUB; count_out[1] = NY_SUB; count_out[2] = 1; - status = H5Sselect_hyperslab(memspace, H5S_SELECT_SET, offset_out, NULL, + status = H5Sselect_hyperslab(memspace, H5S_SELECT_SET, offset_out, NULL, count_out, NULL); /* - * Read data from hyperslab in the file into the hyperslab in + * Read data from hyperslab in the file into the hyperslab in * memory and display. */ status = H5Dread(dataset, H5T_NATIVE_INT, memspace, dataspace, @@ -202,7 +202,7 @@ int main(void) * 0 0 0 0 0 0 0 * 0 0 0 0 0 0 0 * 0 0 0 0 0 0 0 - * 3 4 5 6 0 0 0 + * 3 4 5 6 0 0 0 * 4 5 6 7 0 0 0 * 5 6 7 8 0 0 0 * 0 0 0 0 0 0 0 diff --git a/test/srb_write.c b/test/srb_write.c index b0629a8..9c6d952 100644 --- a/test/srb_write.c +++ b/test/srb_write.c @@ -16,48 +16,48 @@ * Programmer: Raymond Lu * April 14, 2000 * - * Purpose: Test HDF-SRB if it is configured and compiled. Write an HDF5 - * file with an integer array to SRB server. + * Purpose: Test HDF-SRB if it is configured and compiled. Write an HDF5 + * file with an integer array to SRB server. * - * Usage: The HDF5 is built on the top of SRB. So you just need to + * Usage: The HDF5 is built on the top of SRB. So you just need to * activate a connection to SRB server by calling function - * H5Pset_fapl_srb()(after creating file property list by calling + * H5Pset_fapl_srb()(after creating file property list by calling * H5Pcreate()). All server information is passed in through its - * parameter SRB_Info(a structure). Its fields are + * parameter SRB_Info(a structure). Its fields are * char *srbHost: SRB host address of server. If the input is - * NULL, it will use the environment varible "srbHost" if - * it is defined. If it is not defined, the - * ~/.srb/.MdasEnd file will be checked next. If not, it - * will use the hostname of the client machine. - * char *srbPort: SRB host port number of server. If the - * input value is NULL, it will use the env variable - * "srbPort" if it is defined. If not, it defaults to - * 5558. + * NULL, it will use the environment varible "srbHost" if + * it is defined. If it is not defined, the + * ~/.srb/.MdasEnd file will be checked next. If not, it + * will use the hostname of the client machine. + * char *srbPort: SRB host port number of server. If the + * input value is NULL, it will use the env variable + * "srbPort" if it is defined. If not, it defaults to + * 5558. * char *srbAuth: SRB Authentication-password. It is used to - * define password for MDAS or SEA authentication. - * For SEA authentication, this is the password used by - * the SEA library to decrypt the encrypted private key - * stored in the file ~/.SEAuuuuu@ddddd(where uuuuu is - * the user ID and ddddd is the user domain name). This - * input is not needed if an unencrypted private key is - * available in the /tmp directory(generated using the - * 'seaauth auto' command). To provide additional - * flexibility, a client may also use the environment - * variable "srbAuth" to specify the password. A client - * may also supply the password in the ~/.srb/.MdasAuth - * file. If a client uses more than one method to specfy - * the password, the value given in this function call - * will take precedent, then the environment variable - * "srbAuth", and lastly, the ~/.srb/.MdasAuth file. - * int storSysType: Storage system type on SRB server. - * 0=Unix, 1=UniTree, 2=HPSS, 3=FTP, 4=HTTP + * define password for MDAS or SEA authentication. + * For SEA authentication, this is the password used by + * the SEA library to decrypt the encrypted private key + * stored in the file ~/.SEAuuuuu@ddddd(where uuuuu is + * the user ID and ddddd is the user domain name). This + * input is not needed if an unencrypted private key is + * available in the /tmp directory(generated using the + * 'seaauth auto' command). To provide additional + * flexibility, a client may also use the environment + * variable "srbAuth" to specify the password. A client + * may also supply the password in the ~/.srb/.MdasAuth + * file. If a client uses more than one method to specfy + * the password, the value given in this function call + * will take precedent, then the environment variable + * "srbAuth", and lastly, the ~/.srb/.MdasAuth file. + * int storSysType: Storage system type on SRB server. + * 0=Unix, 1=UniTree, 2=HPSS, 3=FTP, 4=HTTP * int mode: File access mode, same definition with Unix. * int size: File Size, only valid for HPSS, -1 is default * * Then you can create an HDF5 file by calling H5Fcreate(). When - * you pass in the file name, it has to be file name with an - * absolute path. It you use SDSC server(ghidorah.sdsc.edu), your - * home directory is possibly in /projects/mdas/srb/SRBVault/. + * you pass in the file name, it has to be file name with an + * absolute path. It you use SDSC server(ghidorah.sdsc.edu), your + * home directory is possibly in /projects/mdas/srb/SRBVault/. */ #include "h5test.h" @@ -70,7 +70,7 @@ int main(void) } #else -#define fileName "/projects/mdas/srb/SRBVault/slu.ncsa/a.h5" +#define fileName "/projects/mdas/srb/SRBVault/slu.ncsa/a.h5" #define DATASETNAME "IntArray" #define NX 5 /* dataset dimensions */ #define NY 6 @@ -79,7 +79,7 @@ int main(void) int main(void) { - hid_t fapl=-1, fid = -1; + hid_t fapl=-1, fid = -1; hid_t dataspace, datatype, dataset; hsize_t dimsf[2]; herr_t status = 0; @@ -89,41 +89,41 @@ int main(void) * don't append port number. */ NULL, /* SRB host default port number*/ NULL, /* SRB Authentication-password, - * using the one in + * using the one in * ~/.srb/.MdasAuth */ 0, /* Unix storage system. */ - 0600, /* Read and write only for + 0600, /* Read and write only for * owner */ -1 /* -1 is default. */ }; - /* - * Data and output buffer initialization. + /* + * Data and output buffer initialization. */ for (j = 0; j < NX; j++) { for (i = 0; i < NY; i++) data[j][i] = i + j; - } + } /* - * 0 1 2 3 4 5 + * 0 1 2 3 4 5 * 1 2 3 4 5 6 * 2 3 4 5 6 7 * 3 4 5 6 7 8 * 4 5 6 7 8 9 */ - + fapl = H5Pcreate(H5P_FILE_ACCESS); if (fapl < 0) { printf (" H5Pcreate failed. \n"); return -1; } - + status = H5Pset_fapl_srb(fapl, srb_info); if (status < 0) { printf ("H5Pset_fapl_srb failed. \n"); return -1; } - + fid = H5Fcreate(fileName, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); /*fid = H5Fcreate(fileName, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);*/ if (fid < 0) { @@ -133,17 +133,17 @@ int main(void) /* * Describe the size of the array and create the data space for fixed - * size dataset. + * size dataset. */ dimsf[0] = NX; dimsf[1] = NY; - dataspace = H5Screate_simple(RANK, dimsf, NULL); + dataspace = H5Screate_simple(RANK, dimsf, NULL); if (dataspace < 0) { printf ("H5Screate failed. \n"); return -1; } - /* + /* * Define datatype for the data in the file. * We will store little endian INT numbers. */ diff --git a/test/stab.c b/test/stab.c index 68c7630..947825c 100644 --- a/test/stab.c +++ b/test/stab.c @@ -53,7 +53,7 @@ test_misc(hid_t file) { hid_t g1=-1, g2=-1, g3=-1; char comment[64]; - + /* Test current working groups */ TESTING("miscellaneous group tests"); @@ -65,7 +65,7 @@ test_misc(hid_t file) if (H5Gclose(g1)<0) goto error; if (H5Gclose(g2)<0) goto error; if (H5Gclose(g3)<0) goto error; - + /* Open all groups with absolute names to check for exsistence */ if ((g1=H5Gopen(file, "/test_1a"))<0) goto error; if ((g2=H5Gopen(file, "/test_1a/sub_1"))<0) goto error; @@ -123,7 +123,7 @@ test_long(hid_t file) hid_t g1=-1, g2=-1; char *name1=NULL, *name2=NULL; size_t namesize=40960, i; - + TESTING("long names"); /* Group names */ @@ -145,7 +145,7 @@ test_long(hid_t file) if ((g2=H5Gopen(file, name2))<0) goto error; H5Gclose(g1); H5Gclose(g2); - + PASSED(); return 0; @@ -248,7 +248,7 @@ main(void) #if 0 H5Pset_sym_k(fcpl, 16, 16); #endif - + /* Open the file */ h5_fixname(FILENAME[0], fapl, filename, sizeof filename); if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl))<0) diff --git a/test/tarray.c b/test/tarray.c index 871ff9c..7c025f6 100644 --- a/test/tarray.c +++ b/test/tarray.c @@ -57,9 +57,9 @@ ** ** test_array_atomic_1d(): Test basic array datatype code. ** Tests 1-D array of atomic datatypes -** +** ****************************************************************/ -static void +static void test_array_atomic_1d(void) { int wdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information to write */ @@ -114,7 +114,7 @@ test_array_atomic_1d(void) /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); @@ -179,9 +179,9 @@ test_array_atomic_1d(void) ** ** test_array_atomic_3d(): Test basic array datatype code. ** Tests 3-D array of atomic datatypes -** +** ****************************************************************/ -static void +static void test_array_atomic_3d(void) { int wdata[SPACE1_DIM1][ARRAY2_DIM1][ARRAY2_DIM2][ARRAY2_DIM3]; /* Information to write */ @@ -238,7 +238,7 @@ test_array_atomic_3d(void) /* Close disk dataspace */ ret = H5Sclose(sid); CHECK(ret, FAIL, "H5Sclose"); - + /* Close file */ ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); @@ -307,9 +307,9 @@ test_array_atomic_3d(void) ** ** test_array_array_atomic(): Test basic array datatype code. ** Tests 1-D array 2-D arrays of atomic datatypes -** +** ****************************************************************/ -static void +static void test_array_array_atomic(void) { int wdata[SPACE1_DIM1][ARRAY1_DIM1][ARRAY3_DIM1][ARRAY3_DIM2]; /* Information to write */ @@ -376,7 +376,7 @@ test_array_array_atomic(void) /* Close disk dataspace */ ret = H5Sclose(sid); CHECK(ret, FAIL, "H5Sclose"); - + /* Close file */ ret = H5Fclose(fid); CHECK(ret, FAIL, "H5Fclose"); @@ -466,9 +466,9 @@ test_array_array_atomic(void) ** ** test_array_compound_atomic(): Test basic array datatype code. ** Tests 1-D array of compound datatypes (with no array fields) -** +** ****************************************************************/ -static void +static void test_array_compound_atomic(void) { typedef struct { /* Typedef for compound datatype */ @@ -550,7 +550,7 @@ test_array_compound_atomic(void) /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); @@ -669,9 +669,9 @@ test_array_compound_atomic(void) ** ** test_array_compound_array(): Test basic array datatype code. ** Tests 1-D array of compound datatypes (with array fields) -** +** ****************************************************************/ -static void +static void test_array_compound_array(void) { typedef struct { /* Typedef for compound datatype */ @@ -764,7 +764,7 @@ test_array_compound_array(void) /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); @@ -919,7 +919,7 @@ void test_array_free_custom(void *mem, void *info); ** allocation routines. This routine just uses malloc to ** allocate the memory and increments the amount of memory ** allocated. -** +** ****************************************************************/ void *test_array_alloc_custom(size_t size, void *info) { @@ -947,7 +947,7 @@ void *test_array_alloc_custom(size_t size, void *info) ** allocation routines. This routine just uses free to ** release the memory and decrements the amount of memory ** allocated. -** +** ****************************************************************/ void test_array_free_custom(void *_mem, void *info) { @@ -972,9 +972,9 @@ void test_array_free_custom(void *_mem, void *info) ** ** test_array_vlen_atomic(): Test basic array datatype code. ** Tests 1-D array of atomic VL datatypes -** +** ****************************************************************/ -static void +static void test_array_vlen_atomic(void) { hvl_t wdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information to write */ @@ -1047,7 +1047,7 @@ test_array_vlen_atomic(void) /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); @@ -1163,7 +1163,7 @@ test_array_vlen_atomic(void) /* Close dataset transfer property list */ ret = H5Pclose(xfer_pid); CHECK(ret, FAIL, "H5Pclose"); - + /* Close Datatype */ ret = H5Tclose(tid1); CHECK(ret, FAIL, "H5Tclose"); @@ -1182,9 +1182,9 @@ test_array_vlen_atomic(void) ** ** test_array_vlen_array(): Test basic array datatype code. ** Tests 1-D array of 1-D array VL datatypes -** +** ****************************************************************/ -static void +static void test_array_vlen_array(void) { hvl_t wdata[SPACE1_DIM1][ARRAY1_DIM1]; /* Information to write */ @@ -1267,7 +1267,7 @@ test_array_vlen_array(void) /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); @@ -1413,7 +1413,7 @@ test_array_vlen_array(void) /* Close dataset transfer property list */ ret = H5Pclose(xfer_pid); CHECK(ret, FAIL, "H5Pclose"); - + /* Close Datatype */ ret = H5Tclose(tid1); CHECK(ret, FAIL, "H5Tclose"); @@ -1429,7 +1429,7 @@ test_array_vlen_array(void) } /* end test_array_vlen_array() */ #define FIELDNAME "ArrayofStructures" -#define LENGTH 5 +#define LENGTH 5 #define ALEN 10 #define RANK 1 #define NMAX 100 @@ -1448,50 +1448,50 @@ typedef struct ** test_array_bkg(): Test basic array datatype code. ** Tests reading compound datatype with array fields and ** writing partial fields. -** +** ****************************************************************/ -static void +static void test_array_bkg(void) { herr_t status = -1; - + hid_t fid, array_dt; hid_t space; hid_t type; hid_t dataset; - + hsize_t dim[] = {LENGTH}; hsize_t dima[] = {ALEN}; - int i, j; + int i, j; int ndims[3] = {1,1,1}; - + typedef struct { int a[ALEN]; float b[ALEN]; double c[ALEN]; } CmpField; - + CmpField cf[LENGTH]; CmpField cfr[LENGTH]; CmpDTSinfo dtsinfo; - + typedef struct { float b[ALEN]; } fld_t; - - fld_t fld[LENGTH]; - fld_t fldr[LENGTH]; - + + fld_t fld[LENGTH]; + fld_t fldr[LENGTH]; + /* Output message about test being performed */ MESSAGE(5, ("Testing Partial I/O of Array Fields in Compound Datatype Functionality\n")); - /* Initialize the data */ + /* Initialize the data */ /* ------------------- */ for (i = 0; i < LENGTH; i++) - { + { for (j = 0; j < ALEN; j++) { cf[i].a[j] = 100*(i+1) + j; @@ -1500,7 +1500,7 @@ test_array_bkg(void) } } - + /* Set the number of data members */ /* ------------------------------ */ dtsinfo.nsubfields = 3; @@ -1512,21 +1512,21 @@ test_array_bkg(void) dtsinfo.offset[2] = HOFFSET(CmpField, c); /* Initialize the data type IDs */ - /* ---------------------------- */ + /* ---------------------------- */ dtsinfo.datatype[0] = H5T_NATIVE_INT; dtsinfo.datatype[1] = H5T_NATIVE_FLOAT; dtsinfo.datatype[2] = H5T_NATIVE_DOUBLE; - + /* Initialize the names of data members */ - /* ------------------------------------ */ + /* ------------------------------------ */ for (i = 0; i < dtsinfo.nsubfields; i++) - dtsinfo.name[i] = (char *)calloc(20, sizeof(char)); - + dtsinfo.name[i] = (char *)calloc(20, sizeof(char)); + strcpy(dtsinfo.name[0], "One"); strcpy(dtsinfo.name[1], "Two"); strcpy(dtsinfo.name[2], "Three"); - + /* Create file */ /* ----------- */ @@ -1543,11 +1543,11 @@ test_array_bkg(void) type = H5Tcreate(H5T_COMPOUND, sizeof(CmpField)); CHECK(type, FAIL, "H5Tcreate"); - + /* Add members to the compound data type */ /* -------------------------------------- */ for ( i = 0; i < dtsinfo.nsubfields; i++) - { + { array_dt = H5Tarray_create (dtsinfo.datatype[i], ndims[i], dima, NULL); CHECK(array_dt, FAIL, "H5Tarray_create"); @@ -1557,7 +1557,7 @@ test_array_bkg(void) status = H5Tclose(array_dt); CHECK(status, FAIL, "H5Tclose"); } - + /* Create the dataset */ /* ------------------ */ dataset = H5Dcreate(fid, FIELDNAME, type, space, H5P_DEFAULT); @@ -1567,13 +1567,13 @@ test_array_bkg(void) /* ------------------------- */ status = H5Dwrite(dataset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, cf); CHECK(status, FAIL, "H5Dwrite"); - + status = H5Dread(dataset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, cfr); CHECK(status, FAIL, "H5Dread"); - /* Verify correct data */ + /* Verify correct data */ /* ------------------- */ - for (i = 0; i < LENGTH; i++) { + for (i = 0; i < LENGTH; i++) { for (j = 0; j < ALEN; j++) { if(cf[i].a[j]!=cfr[i].a[j]) { TestErrPrintf("Field a data doesn't match, cf[%d].a[%d]=%d, cfr[%d].a[%d]=%d\n",(int)i,(int)j,(int)cf[i].a[j],(int)i,(int)j,(int)cfr[i].a[j]); @@ -1601,7 +1601,7 @@ test_array_bkg(void) /* ----------- */ status = H5Tclose(type); CHECK(status, FAIL, "H5Tclose"); - + status = H5Sclose(space); CHECK(status, FAIL, "H5Sclose"); @@ -1610,7 +1610,7 @@ test_array_bkg(void) status = H5Fclose(fid); CHECK(status, FAIL, "H5Fclose"); - + /******************************/ /* Reopen the file and update */ @@ -1621,7 +1621,7 @@ test_array_bkg(void) dataset = H5Dopen(fid, FIELDNAME ); CHECK(dataset, FAIL, "H5Dopen"); - + type = H5Tcreate(H5T_COMPOUND, sizeof(fld_t)); CHECK(type, FAIL, "H5Tcreate"); @@ -1631,7 +1631,7 @@ test_array_bkg(void) status = H5Tinsert (type, "Two", HOFFSET(fld_t, b), array_dt); CHECK(status, FAIL, "H5Tinsert"); - /* Initialize the data to overwrite */ + /* Initialize the data to overwrite */ /* -------------------------------- */ for (i=0; i< LENGTH; i++) for (j = 0; j < ALEN; j++) @@ -1643,17 +1643,17 @@ test_array_bkg(void) /* Read just the field changed */ status = H5Dread (dataset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, fldr); CHECK(status, FAIL, "H5Dread"); - - for (i=0; i< LENGTH; i++) + + for (i=0; i< LENGTH; i++) for (j = 0; j < ALEN; j++) if(fld[i].b[j]!=fldr[i].b[j]) { TestErrPrintf("Field data doesn't match, fld[%d].b[%d]=%f, fldr[%d].b[%d]=%f\n",(int)i,(int)j,(float)fld[i].b[j],(int)i,(int)j,(float)fldr[i].b[j]); continue; } - + status = H5Tclose (type); CHECK(status, FAIL, "H5Tclose"); - + status = H5Tclose (array_dt); CHECK(status, FAIL, "H5Tclose"); @@ -1664,9 +1664,9 @@ test_array_bkg(void) status = H5Dread(dataset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, cfr); CHECK(status, FAIL, "H5Dread"); - /* Verify correct data */ + /* Verify correct data */ /* ------------------- */ - for (i = 0; i < LENGTH; i++) { + for (i = 0; i < LENGTH; i++) { for (j = 0; j < ALEN; j++) { if(cf[i].a[j]!=cfr[i].a[j]) { TestErrPrintf("Field a data doesn't match, cf[%d].a[%d]=%d, cfr[%d].a[%d]=%d\n",(int)i,(int)j,(int)cf[i].a[j],(int)i,(int)j,(int)cfr[i].a[j]); @@ -1688,7 +1688,7 @@ test_array_bkg(void) status = H5Tclose (type); CHECK(status, FAIL, "H5Tclose"); - + status = H5Fclose(fid); CHECK(status, FAIL, "H5Fclose"); @@ -1701,21 +1701,21 @@ test_array_bkg(void) dataset = H5Dopen(fid, FIELDNAME ); CHECK(dataset, FAIL, "H5Dopen"); - + type = H5Dget_type(dataset); CHECK(type, FAIL, "H5Dget_type"); - /* Reset the data to read in */ + /* Reset the data to read in */ /* ------------------------- */ memset(cfr, 0, sizeof(CmpField)*LENGTH); status = H5Dread(dataset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, cfr); CHECK(status, FAIL, "H5Dread"); - /* Verify correct data */ + /* Verify correct data */ /* ------------------- */ - for (i = 0; i < LENGTH; i++) { + for (i = 0; i < LENGTH; i++) { for (j = 0; j < ALEN; j++) { if(cf[i].a[j]!=cfr[i].a[j]) { TestErrPrintf("Field a data doesn't match, cf[%d].a[%d]=%d, cfr[%d].a[%d]=%d\n",(int)i,(int)j,(int)cf[i].a[j],(int)i,(int)j,(int)cfr[i].a[j]); @@ -1737,7 +1737,7 @@ test_array_bkg(void) status = H5Tclose (type); CHECK(status, FAIL, "H5Tclose"); - + status = H5Fclose(fid); CHECK(status, FAIL, "H5Fclose"); } /* end test_array_bkg() */ @@ -1748,9 +1748,9 @@ test_array_bkg(void) ** Reads file containing old version of datatype object header ** messages for compound datatypes and verifies reading the older ** version of the is working correctly. -** +** ****************************************************************/ -static void +static void test_compat(void) { typedef struct { /* Typedef for compound datatype */ @@ -1785,7 +1785,7 @@ test_compat(void) MESSAGE(5, ("Testing Array Datatypes Compatibility Functionality\n")); /* - * Try reading a file that has been prepared that has datasets with + * Try reading a file that has been prepared that has datasets with * compound datatypes which use an older version (version 1) of the * datatype object header message for describing the datatype. * @@ -2052,9 +2052,9 @@ test_compat(void) /**************************************************************** ** ** test_array(): Main array datatype testing routine. -** +** ****************************************************************/ -void +void test_array(void) { /* Output message about test being performed */ diff --git a/test/tattr.c b/test/tattr.c index 6727442..4297316 100644 --- a/test/tattr.c +++ b/test/tattr.c @@ -54,7 +54,7 @@ int attr_data1[ATTR1_DIM1]={512,-234,98123}; /* Test data for 1st attribute */ /* rank & dimensions for another attribute */ #define ATTR1A_NAME "Attr1_a" -int attr_data1a[ATTR1_DIM1]={256,11945,-22107}; +int attr_data1a[ATTR1_DIM1]={256,11945,-22107}; #define ATTR2_NAME "Attr2" #define ATTR2_RANK 2 @@ -96,9 +96,9 @@ herr_t attr_op1(hid_t loc_id, const char *name, void *op_data); ** ** test_attr_basic_write(): Test basic H5A (attribute) code. ** Tests integer attributes on both datasets and groups -** +** ****************************************************************/ -static void +static void test_attr_basic_write(void) { hid_t fid1; /* HDF5 File IDs */ @@ -154,11 +154,11 @@ test_attr_basic_write(void) /* Create an another attribute for the dataset */ attr2=H5Acreate(dataset,ATTR1A_NAME,H5T_NATIVE_INT,sid2,H5P_DEFAULT); CHECK(attr, FAIL, "H5Acreate"); - + /* Write attribute information */ ret=H5Awrite(attr2,H5T_NATIVE_INT,attr_data1a); CHECK(ret, FAIL, "H5Awrite"); - + /* Check storage size for attribute */ attr_size=H5Aget_storage_size(attr); VERIFY(attr_size, (ATTR1_DIM1*sizeof(int)), "H5A_get_storage_size"); @@ -191,10 +191,10 @@ test_attr_basic_write(void) /* Verify new attribute name */ attr_name_size = H5Aget_name(attr, 0, NULL); CHECK(attr_name_size, FAIL, "H5Aget_name"); - + if(attr_name_size>0) attr_name = (char*)HDcalloc((size_t)(attr_name_size+1), sizeof(char)); - + ret=(herr_t)H5Aget_name(attr, (size_t)(attr_name_size+1), attr_name); CHECK(ret, FAIL, "H5Aget_name"); ret=HDstrcmp(attr_name, ATTR_TMP_NAME); @@ -218,16 +218,16 @@ test_attr_basic_write(void) /* Open the second attribute again */ - attr2=H5Aopen_name(dataset, ATTR1A_NAME); + attr2=H5Aopen_name(dataset, ATTR1A_NAME); CHECK(attr, FAIL, "H5Aopen_name"); /* Verify new attribute name */ attr_name_size = H5Aget_name(attr2, 0, NULL); CHECK(attr_name_size, FAIL, "H5Aget_name"); - + if(attr_name_size>0) attr_name = (char*)HDcalloc((size_t)(attr_name_size+1), sizeof(char)); - + ret=(herr_t)H5Aget_name(attr2, (size_t)(attr_name_size+1), attr_name); CHECK(ret, FAIL, "H5Aget_name"); ret=HDstrcmp(attr_name, ATTR1A_NAME); @@ -248,7 +248,7 @@ test_attr_basic_write(void) /* Close attribute */ ret=H5Aclose(attr2); CHECK(ret, FAIL, "H5Aclose"); - + /* change first attribute back to the original name */ ret=H5Arename(dataset, ATTR_TMP_NAME, ATTR1_NAME); CHECK(ret, FAIL, "H5Arename"); @@ -277,7 +277,7 @@ test_attr_basic_write(void) /* Check storage size for attribute */ attr_size=H5Aget_storage_size(attr); VERIFY(attr_size, (ATTR2_DIM1*ATTR2_DIM2*sizeof(int)), "H5Aget_storage_size"); - + /* Try to create the same attribute again (should fail) */ ret=H5Acreate(group,ATTR2_NAME,H5T_NATIVE_INT,sid2,H5P_DEFAULT); VERIFY(ret, FAIL, "H5Acreate"); @@ -289,7 +289,7 @@ test_attr_basic_write(void) /* Check storage size for attribute */ attr_size=H5Aget_storage_size(attr); VERIFY(attr_size, (ATTR2_DIM1*ATTR2_DIM2*sizeof(int)), "H5A_get_storage_size"); - + /* Close attribute */ ret=H5Aclose(attr); CHECK(ret, FAIL, "H5Aclose"); @@ -310,9 +310,9 @@ test_attr_basic_write(void) /**************************************************************** ** ** test_attr_basic_read(): Test basic H5A (attribute) code. -** +** ****************************************************************/ -static void +static void test_attr_basic_read(void) { hid_t fid1; /* HDF5 File IDs */ @@ -397,9 +397,9 @@ test_attr_basic_read(void) ** ** test_attr_flush(): Test H5A (attribute) code for performing ** I/O when H5Fflush is used. -** +** ****************************************************************/ -static void +static void test_attr_flush(void) { hid_t fil, /* File ID */ @@ -463,9 +463,9 @@ test_attr_flush(void) ** ** test_attr_compound_write(): Test H5A (attribute) code. ** Tests compound datatype attributes -** +** ****************************************************************/ -static void +static void test_attr_compound_write(void) { hid_t fid1; /* HDF5 File IDs */ @@ -550,9 +550,9 @@ test_attr_compound_write(void) /**************************************************************** ** ** test_attr_compound_read(): Test basic H5A (attribute) code. -** +** ****************************************************************/ -static void +static void test_attr_compound_read(void) { hid_t fid1; /* HDF5 File IDs */ @@ -565,7 +565,7 @@ test_attr_compound_read(void) hsize_t dims[ATTR_MAX_DIMS]; /* Attribute dimensions */ H5T_class_t t_class; /* Attribute datatype class */ H5T_order_t order; /* Attribute datatype order */ - size_t size; /* Attribute datatype size as stored in file */ + size_t size; /* Attribute datatype size as stored in file */ int fields; /* # of Attribute datatype fields */ char *fieldname; /* Name of a field */ size_t offset; /* Attribute datatype field offset */ @@ -616,7 +616,7 @@ test_attr_compound_read(void) VERIFY(fields, 3, "H5Tget_nmembers"); for(i=0; ist3_el1=MISC5_DBGELVAL3; @@ -777,7 +777,7 @@ create_struct1(void) static void delete_struct1(misc5_struct1_hndl *str1hndl) -{ +{ herr_t ret; /* For error checking */ ret=H5Tclose(str1hndl->st1h_id); @@ -793,7 +793,7 @@ delete_struct1(misc5_struct1_hndl *str1hndl) static void set_struct1(misc5_struct1 *buf) -{ +{ unsigned i; /* Local index variable */ buf->st1_el1=MISC5_DBGELVAL1; @@ -1195,7 +1195,7 @@ test_misc8(void) /* Create a file acccess property list */ fapl = H5Pcreate(H5P_FILE_ACCESS); - CHECK(fapl, FAIL, "H5Pcreate"); + CHECK(fapl, FAIL, "H5Pcreate"); /* Get the default file access properties for caching */ ret=H5Pget_cache(fapl,&mdc_nelmts,&rdcc_nelmts,&rdcc_nbytes,&rdcc_w0); @@ -1229,16 +1229,16 @@ test_misc8(void) /* Create a dataset creation property list */ dcpl = H5Pcreate(H5P_DATASET_CREATE); - CHECK(dcpl, FAIL, "H5Pcreate"); + CHECK(dcpl, FAIL, "H5Pcreate"); /* I. contiguous dataset tests */ ret = H5Pset_layout(dcpl, H5D_CONTIGUOUS); - CHECK(ret, FAIL, "H5Pset_layout"); + CHECK(ret, FAIL, "H5Pset_layout"); /* Set the space allocation time to early */ ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_EARLY); - CHECK(ret, FAIL, "H5Pset_alloc_time"); + CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create a contiguous dataset, with space allocation early */ did = H5Dcreate(fid, MISC8_DSETNAME1, H5T_NATIVE_INT, sid, dcpl); @@ -1256,7 +1256,7 @@ test_misc8(void) #ifndef H5_HAVE_PARALLEL /* Set the space allocation time to late */ ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_LATE); - CHECK(ret, FAIL, "H5Pset_alloc_time"); + CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create a contiguous dataset, with space allocation late */ did = H5Dcreate(fid, MISC8_DSETNAME2, H5T_NATIVE_INT, sid, dcpl); @@ -1281,7 +1281,7 @@ test_misc8(void) /* Set the space allocation time to incremental */ ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_INCR); - CHECK(ret, FAIL, "H5Pset_alloc_time"); + CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create a contiguous dataset, with space allocation late */ did = H5Dcreate(fid, MISC8_DSETNAME3, H5T_NATIVE_INT, sid, dcpl); @@ -1307,11 +1307,11 @@ test_misc8(void) /* II. compact dataset tests */ ret = H5Pset_layout(dcpl, H5D_COMPACT); - CHECK(ret, FAIL, "H5Pset_layout"); + CHECK(ret, FAIL, "H5Pset_layout"); /* Set the space allocation time to late */ ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_LATE); - CHECK(ret, FAIL, "H5Pset_alloc_time"); + CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create a contiguous dataset, with space allocation late */ /* Should fail */ @@ -1320,7 +1320,7 @@ test_misc8(void) /* Set the space allocation time to incremental */ ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_INCR); - CHECK(ret, FAIL, "H5Pset_alloc_time"); + CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create a contiguous dataset, with space allocation incremental */ /* Should fail */ @@ -1329,11 +1329,11 @@ test_misc8(void) /* Set the space allocation time to early */ ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_EARLY); - CHECK(ret, FAIL, "H5Pset_alloc_time"); + CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Set the fill time to allocation */ ret = H5Pset_fill_time(dcpl,H5D_FILL_TIME_ALLOC); - CHECK(ret, FAIL, "H5Pset_alloc_time"); + CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create a contiguous dataset, with space allocation early */ did = H5Dcreate(fid, MISC8_DSETNAME4, H5T_NATIVE_INT, sid, dcpl); @@ -1352,15 +1352,15 @@ test_misc8(void) /* III. chunked dataset tests */ ret = H5Pset_layout(dcpl, H5D_CHUNKED); - CHECK(ret, FAIL, "H5Pset_layout"); + CHECK(ret, FAIL, "H5Pset_layout"); /* Set the space allocation time to early */ ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_EARLY); - CHECK(ret, FAIL, "H5Pset_alloc_time"); + CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Use chunked storage for this dataset */ ret = H5Pset_chunk(dcpl,rank,chunk_dims); - CHECK(ret, FAIL, "H5Pset_chunk"); + CHECK(ret, FAIL, "H5Pset_chunk"); /* Create a chunked dataset, with space allocation early */ did = H5Dcreate(fid, MISC8_DSETNAME5, H5T_NATIVE_INT, sid, dcpl); @@ -1378,11 +1378,11 @@ test_misc8(void) #ifndef H5_HAVE_PARALLEL /* Set the space allocation time to late */ ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_LATE); - CHECK(ret, FAIL, "H5Pset_alloc_time"); + CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Use chunked storage for this dataset */ ret = H5Pset_chunk(dcpl,rank,chunk_dims); - CHECK(ret, FAIL, "H5Pset_chunk"); + CHECK(ret, FAIL, "H5Pset_chunk"); /* Create a chunked dataset, with space allocation late */ did = H5Dcreate(fid, MISC8_DSETNAME6, H5T_NATIVE_INT, sid, dcpl); @@ -1407,7 +1407,7 @@ test_misc8(void) /* Set the space allocation time to incremental */ ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_INCR); - CHECK(ret, FAIL, "H5Pset_alloc_time"); + CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create a chunked dataset, with space allocation incremental */ did = H5Dcreate(fid, MISC8_DSETNAME7, H5T_NATIVE_INT, sid, dcpl); @@ -1455,12 +1455,12 @@ test_misc8(void) /* Set the space allocation time to early */ ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_EARLY); - CHECK(ret, FAIL, "H5Pset_alloc_time"); + CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Use compression as well as chunking for these datasets */ #ifdef H5_HAVE_FILTER_DEFLATE ret = H5Pset_deflate(dcpl,9); - CHECK(ret, FAIL, "H5Pset_deflate"); + CHECK(ret, FAIL, "H5Pset_deflate"); #endif /* end H5_HAVE_FILTER_DEFLATE */ /* Create a chunked dataset, with space allocation early */ @@ -1489,7 +1489,7 @@ test_misc8(void) #ifndef H5_HAVE_PARALLEL /* Set the space allocation time to late */ ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_LATE); - CHECK(ret, FAIL, "H5Pset_alloc_time"); + CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create a chunked dataset, with space allocation late */ did = H5Dcreate(fid, MISC8_DSETNAME9, H5T_NATIVE_INT, sid, dcpl); @@ -1549,7 +1549,7 @@ test_misc8(void) /* Set the space allocation time to incremental */ ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_INCR); - CHECK(ret, FAIL, "H5Pset_alloc_time"); + CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create a chunked dataset, with space allocation incremental */ did = H5Dcreate(fid, MISC8_DSETNAME10, H5T_NATIVE_INT, sid, dcpl); @@ -1675,7 +1675,7 @@ test_misc10(void) hid_t space, type; /* Old dataset's dataspace & datatype */ char testfile[512]=""; /* Character buffer for corrected test file name */ char *srcdir = getenv("srcdir"); /* Pointer to the directory the source code is located within */ - herr_t ret; + herr_t ret; /* Output message about test being performed */ MESSAGE(5, ("Testing using old dataset creation property list\n")); @@ -1796,20 +1796,20 @@ test_misc11(void) /* Create a file creation property list */ fcpl = H5Pcreate(H5P_FILE_CREATE); - CHECK(fcpl, FAIL, "H5Pcreate"); + CHECK(fcpl, FAIL, "H5Pcreate"); /* Set all the properties in the FCPL */ ret=H5Pset_userblock(fcpl,(hsize_t)MISC11_USERBLOCK); - CHECK(ret, FAIL, "H5Pset_userblock"); + CHECK(ret, FAIL, "H5Pset_userblock"); ret=H5Pset_sizes(fcpl,MISC11_SIZEOF_OFF,MISC11_SIZEOF_LEN); - CHECK(ret, FAIL, "H5Pset_sizes"); + CHECK(ret, FAIL, "H5Pset_sizes"); ret=H5Pset_sym_k(fcpl,MISC11_SYM_IK,MISC11_SYM_LK); - CHECK(ret, FAIL, "H5Pset_sym_k"); + CHECK(ret, FAIL, "H5Pset_sym_k"); ret=H5Pset_istore_k(fcpl,MISC11_ISTORE_IK); - CHECK(ret, FAIL, "H5Pset_istore_k"); + CHECK(ret, FAIL, "H5Pset_istore_k"); /* Creating a file with the non-default file creation property list should * create a version 1 superblock @@ -1861,22 +1861,22 @@ test_misc11(void) /* Retrieve all the property values & check them */ ret=H5Pget_userblock(fcpl,&userblock); - CHECK(ret, FAIL, "H5Pget_userblock"); - VERIFY(userblock, MISC11_USERBLOCK, "H5Pget_userblock"); + CHECK(ret, FAIL, "H5Pget_userblock"); + VERIFY(userblock, MISC11_USERBLOCK, "H5Pget_userblock"); ret=H5Pget_sizes(fcpl,&off_size,&len_size); - CHECK(ret, FAIL, "H5Pget_sizes"); - VERIFY(off_size, MISC11_SIZEOF_OFF, "H5Pget_sizes"); - VERIFY(len_size, MISC11_SIZEOF_LEN, "H5Pget_sizes"); + CHECK(ret, FAIL, "H5Pget_sizes"); + VERIFY(off_size, MISC11_SIZEOF_OFF, "H5Pget_sizes"); + VERIFY(len_size, MISC11_SIZEOF_LEN, "H5Pget_sizes"); ret=H5Pget_sym_k(fcpl,&sym_ik,&sym_lk); - CHECK(ret, FAIL, "H5Pget_sym_k"); - VERIFY(sym_ik, MISC11_SYM_IK, "H5Pget_sym_k"); - VERIFY(sym_lk, MISC11_SYM_LK, "H5Pget_sym_k"); + CHECK(ret, FAIL, "H5Pget_sym_k"); + VERIFY(sym_ik, MISC11_SYM_IK, "H5Pget_sym_k"); + VERIFY(sym_lk, MISC11_SYM_LK, "H5Pget_sym_k"); ret=H5Pget_istore_k(fcpl,&istore_ik); - CHECK(ret, FAIL, "H5Pget_istore_k"); - VERIFY(istore_ik, MISC11_ISTORE_IK, "H5Pget_istore_k"); + CHECK(ret, FAIL, "H5Pget_istore_k"); + VERIFY(istore_ik, MISC11_ISTORE_IK, "H5Pget_istore_k"); /* Close file */ ret=H5Fclose(file); @@ -1901,19 +1901,19 @@ test_misc12(void) "conceived in liberty and dedicated to the proposition that all men are created equal.", "Now we are engaged in a great civil war,", "testing whether that nation or any nation so conceived and so dedicated can long endure." - }; + }; const char *wdata1 [MISC12_APPEND_SIZE]= { "O Gloria inmarcesible! O Jubilo inmortal! En surcos de dolores, el", "bien germina ya! Ceso la horrible noche, La libertad sublime", "derrama las auroras de su invencible luz.", - "La humanidad entera, que entre cadenas gime, comprende", + "La humanidad entera, que entre cadenas gime, comprende", "las palabras del que murio en la cruz." }; char *rdata [MISC12_SPACE1_DIM1+MISC12_APPEND_SIZE]; /* Information read in */ - hid_t fid1; - hid_t dataset; + hid_t fid1; + hid_t dataset; hid_t sid1, space, memspace; - hid_t tid1, cparms; + hid_t tid1, cparms; hsize_t dims1[] = {MISC12_SPACE1_DIM1}; hsize_t dimsn[] = {MISC12_APPEND_SIZE}; hsize_t maxdims1[1] = {H5S_UNLIMITED}; @@ -1959,7 +1959,7 @@ test_misc12(void) /* Write dataset to disk */ ret = H5Dwrite (dataset, tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); CHECK(ret, FAIL, "H5Dwrite"); - + /* Extend dataset */ ret = H5Dextend (dataset, newsize); CHECK(ret, FAIL, "H5Dextend"); @@ -2631,8 +2631,8 @@ test_misc15(void) /**************************************************************** ** -** test_misc16(): Test array of NULL-terminated -** fixed-length string. It creates a dataset of fixed-length +** test_misc16(): Test array of NULL-terminated +** fixed-length string. It creates a dataset of fixed-length ** strings. Each string is MISC16_STR_SIZE long. There are ** totally MISC16_SPACE_DIM by MISC16_SPACE_RANK strings. ** @@ -2642,7 +2642,7 @@ test_misc16(void) { hid_t file; /* File ID */ herr_t ret; /* Generic return value */ - const char wdata[MISC16_SPACE_DIM][MISC16_STR_SIZE] = + const char wdata[MISC16_SPACE_DIM][MISC16_STR_SIZE] = {"1234567", "1234567\0", "12345678", {NULL}}; char rdata[MISC16_SPACE_DIM][MISC16_STR_SIZE]; /* Information read in */ hid_t dataset; /* Dataset ID */ @@ -2665,7 +2665,7 @@ test_misc16(void) ret = H5Tset_size (tid,MISC16_STR_SIZE); CHECK(ret, FAIL, "H5Tset_size"); - + /*ret = H5Tset_strpad (tid,H5T_STR_NULLPAD); CHECK(ret, FAIL, "H5Tset_strpad");*/ @@ -2711,8 +2711,8 @@ test_misc16(void) /**************************************************************** ** -** test_misc17(): Test array of characters. It creates a dataset -** of ASCII characters, with dimensionality of MISC17_SPACE_DIM1 +** test_misc17(): Test array of characters. It creates a dataset +** of ASCII characters, with dimensionality of MISC17_SPACE_DIM1 ** by MISC17_SPACE_DIM2. ** ****************************************************************/ @@ -2721,7 +2721,7 @@ test_misc17(void) { hid_t file; /* File ID */ herr_t ret; /* Generic return value */ - const char wdata[MISC17_SPACE_DIM1][MISC17_SPACE_DIM2] = + const char wdata[MISC17_SPACE_DIM1][MISC17_SPACE_DIM2] = {"1234567", "1234567\0", "12345678", {NULL}}; char rdata[MISC17_SPACE_DIM1][MISC17_SPACE_DIM2]; /* Information read in */ hid_t dataset; /* Dataset ID */ @@ -3245,11 +3245,11 @@ test_misc20(void) /* Create a dataset creation property list */ dcpl = H5Pcreate(H5P_DATASET_CREATE); - CHECK(dcpl, FAIL, "H5Pcreate"); + CHECK(dcpl, FAIL, "H5Pcreate"); /* Use chunked storage for this dataset */ ret = H5Pset_chunk(dcpl,rank,big_dims); - VERIFY(ret, FAIL, "H5Pset_chunk"); + VERIFY(ret, FAIL, "H5Pset_chunk"); /* Verify that the storage for the dataset is the correct size and hasn't * been truncated. @@ -3265,7 +3265,7 @@ test_misc20(void) /* Make certain that the dataset's storage doesn't get allocated :-) */ ret = H5Pset_alloc_time(dcpl,H5D_ALLOC_TIME_LATE); - CHECK(ret, FAIL, "H5Pset_alloc_time"); + CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create dataset with big dataspace */ did = H5Dcreate(fid, MISC20_DSET_NAME, H5T_NATIVE_INT, sid, dcpl); @@ -3386,12 +3386,12 @@ test_misc20(void) } /* end test_misc20() */ -/* - test_misc21 and test_misc22 should be executed when SZIP is present +/* + test_misc21 and test_misc22 should be executed when SZIP is present and encoder is available. EIP 2004/8/04 -*/ -#if defined H5_HAVE_FILTER_SZIP +*/ +#if defined H5_HAVE_FILTER_SZIP /**************************************************************** ** @@ -3429,9 +3429,9 @@ test_misc21(void) /* Set custom DCPL properties */ ret = H5Pset_chunk (dcpl, MISC21_SPACE_RANK, chunk_size); CHECK(ret, FAIL, "H5Pset_chunk"); - ret = H5Pset_szip (dcpl, H5_SZIP_NN_OPTION_MASK, 8); + ret = H5Pset_szip (dcpl, H5_SZIP_NN_OPTION_MASK, 8); CHECK(ret, FAIL, "H5Pset_deflate"); - ret = H5Pset_alloc_time (dcpl, H5D_ALLOC_TIME_LATE); + ret = H5Pset_alloc_time (dcpl, H5D_ALLOC_TIME_LATE); CHECK(ret, FAIL, "H5Pset_alloc_time"); /* Create the dataspace for the dataset */ @@ -3458,11 +3458,11 @@ test_misc21(void) HDfree(buf); } /* end test_misc21() */ - + /**************************************************************** ** ** test_misc22(): Test SZIP bits-per-pixel paramter. -** This should be set according to the datatype. +** This should be set according to the datatype. ** Tests for precision and offset combo's. ** ****************************************************************/ @@ -3478,8 +3478,8 @@ test_misc22(void) /* should extend test to signed ints */ hid_t idts[4]; /* do the same for floats - hid_t fdts[2]={H5T_NATIVE_FLOAT32, - H5T_NATIVE_FLOAT64} + hid_t fdts[2]={H5T_NATIVE_FLOAT32, + H5T_NATIVE_FLOAT64} */ int prec[4] = {3,11,19,27}; int offsets[5] = {0,3,11,19,27}; @@ -3522,14 +3522,14 @@ test_misc22(void) /* Create the DCPL */ dcpl = H5Pcreate (H5P_DATASET_CREATE); CHECK(dcpl, FAIL, "H5Pcreate"); - + /* Set DCPL properties */ ret = H5Pset_chunk (dcpl, MISC22_SPACE_RANK, chunk_size); CHECK(ret, FAIL, "H5Pset_chunk"); /* Set custom DCPL properties */ ret = H5Pset_szip (dcpl, H5_SZIP_NN_OPTION_MASK, 32); /* vary the PPB */ CHECK(ret, FAIL, "H5Pset_szip"); - + /* set up the datatype according to the loop */ dtype = H5Tcopy(idts[i]); CHECK(dtype, FAIL, "H5Tcopy"); @@ -3540,7 +3540,7 @@ test_misc22(void) /* compute the correct PPB that should be set by SZIP */ if (offsets[k] == 0) { - correct=prec[j]; + correct=prec[j]; } else { correct=H5Tget_size(idts[i])*8; } @@ -3548,15 +3548,15 @@ test_misc22(void) if (correct <= 32) correct=32; else if (correct <= 64) correct=64; } - + /* Create the dataset */ dsid = H5Dcreate (fid, MISC22_DSET_NAME, dtype, sid, dcpl); CHECK(dsid, FAIL, "H5Dwrite"); - + /* Write out the whole dataset */ ret = H5Dwrite (dsid, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf); CHECK(ret, FAIL, "H5Dwrite"); - + /* Close everything */ ret = H5Dclose (dsid); CHECK(ret, FAIL, "H5Dclose"); @@ -3564,25 +3564,25 @@ test_misc22(void) CHECK(ret, FAIL, "H5Tclose"); ret = H5Pclose (dcpl); CHECK(ret, FAIL, "H5Pclose"); - + dsid = H5Dopen (fid, MISC22_DSET_NAME); CHECK(dsid, FAIL, "H5Topen"); - + dcpl2 = H5Dget_create_plist(dsid); CHECK(dcpl2, FAIL, "H5Dget_create_plist"); - - ret= H5Pget_filter_by_id( dcpl2, H5Z_FILTER_SZIP, &flags, + + ret= H5Pget_filter_by_id( dcpl2, H5Z_FILTER_SZIP, &flags, &cd_nelmts, cd_values, 0, NULL ); CHECK(ret, FAIL, "H5Pget_filter_by_id"); - + VERIFY(cd_values[2], correct, "SZIP filter returned value for precision"); - + ret = H5Dclose (dsid); CHECK(ret, FAIL, "H5Dclose"); ret = H5Gunlink (fid, MISC22_DSET_NAME ); CHECK(ret, FAIL, "H5Dunlink"); - + ret = H5Pclose (dcpl2); CHECK(ret, FAIL, "H5Pclose"); } @@ -3608,9 +3608,9 @@ test_misc22(void) /**************************************************************** ** ** test_misc(): Main misc. test routine. -** +** ****************************************************************/ -void +void test_misc(void) { /* Output message about test being performed */ @@ -3636,7 +3636,7 @@ test_misc(void) test_misc18(); /* Test new object header information in H5G_stat_t struct */ test_misc19(); /* Test incrementing & decrementing ref count on IDs */ test_misc20(); /* Test problems with truncated dimensions in version 2 of storage layout message */ -#if defined H5_HAVE_FILTER_SZIP +#if defined H5_HAVE_FILTER_SZIP test_misc21(); /* Test that "late" allocation time is treated the same as "incremental", for chunked datasets w/a filters */ test_misc22(); /* check szip bits per pixel */ #endif /* H5_HAVE_FILTER_SZIP */ @@ -3684,7 +3684,7 @@ cleanup_misc(void) HDremove(MISC18_FILE); HDremove(MISC19_FILE); HDremove(MISC20_FILE); -#if defined H5_HAVE_FILTER_SZIP +#if defined H5_HAVE_FILTER_SZIP HDremove(MISC21_FILE); HDremove(MISC22_FILE); #endif /* H5_HAVE_FILTER_SZIP */ diff --git a/test/trefer.c b/test/trefer.c index 65b09fd..71da28e 100644 --- a/test/trefer.c +++ b/test/trefer.c @@ -65,9 +65,9 @@ typedef struct s1_t { ** ** test_reference_obj(): Test basic H5R (reference) object reference code. ** Tests references to various kinds of objects -** +** ****************************************************************/ -static void +static void test_reference_obj(void) { hid_t fid1; /* HDF5 File IDs */ @@ -214,7 +214,7 @@ test_reference_obj(void) /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -242,7 +242,7 @@ test_reference_obj(void) /* Check information in referenced dataset */ sid1 = H5Dget_space(dset2); CHECK(sid1, FAIL, "H5Dget_space"); - + ret=(int)H5Sget_simple_extent_npoints(sid1); VERIFY(ret, 4, "H5Sget_simple_extent_npoints"); @@ -310,9 +310,9 @@ test_reference_obj(void) ** ** test_reference_region(): Test basic H5R (reference) object reference code. ** Tests references to various kinds of objects -** +** ****************************************************************/ -static void +static void test_reference_region(void) { hid_t fid1; /* HDF5 File IDs */ @@ -425,7 +425,7 @@ test_reference_region(void) /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close Dataset */ ret = H5Dclose(dset1); CHECK(ret, FAIL, "H5Dclose"); @@ -433,7 +433,7 @@ test_reference_region(void) /* Close uint8 dataset dataspace */ ret = H5Sclose(sid2); CHECK(ret, FAIL, "H5Sclose"); - + /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); @@ -571,9 +571,9 @@ test_reference_region(void) ** ** test_reference_region_1D(): Test H5R (reference) object reference code. ** Tests 1-D references to various kinds of objects -** +** ****************************************************************/ -static void +static void test_reference_region_1D(void) { hid_t fid1; /* HDF5 File IDs */ @@ -686,7 +686,7 @@ test_reference_region_1D(void) /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close Dataset */ ret = H5Dclose(dset1); CHECK(ret, FAIL, "H5Dclose"); @@ -694,7 +694,7 @@ test_reference_region_1D(void) /* Close uint8 dataset dataspace */ ret = H5Sclose(sid3); CHECK(ret, FAIL, "H5Sclose"); - + /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); @@ -844,9 +844,9 @@ test_reference_region_1D(void) ** ** test_reference_obj_deleted(): Test H5R (reference) object reference code. ** Tests for correct failures for deleted and non-existent objects -** +** ****************************************************************/ -static void +static void test_reference_obj_deleted(void) { hid_t fid1; /* HDF5 File IDs */ @@ -902,7 +902,7 @@ test_reference_obj_deleted(void) /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); @@ -943,9 +943,9 @@ test_reference_obj_deleted(void) ** ** test_deref_iter_op(): Iterator callback for test_reference_group_iterate() ** test. -** +** ****************************************************************/ -static herr_t +static herr_t test_deref_iter_op(hid_t UNUSED group, const char *name, void *op_data) { int *count = (int *)op_data; /* Pointer to name counter */ @@ -976,9 +976,9 @@ test_deref_iter_op(hid_t UNUSED group, const char *name, void *op_data) ** ** test_reference_group(): Test H5R (reference) object reference code. ** Tests for correct behavior of various routines on dereferenced group -** +** ****************************************************************/ -static void +static void test_reference_group(void) { hid_t fid = -1; /* File ID */ @@ -992,7 +992,7 @@ test_reference_group(void) H5G_obj_t objtype; /* Object type */ int count = 0; /* Count within iterated group */ herr_t ret; - + /* Create file with a group and a dataset containing an object reference to the group */ fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fcreate"); @@ -1090,9 +1090,9 @@ test_reference_group(void) /**************************************************************** ** ** test_reference(): Main H5R reference testing routine. -** +** ****************************************************************/ -void +void test_reference(void) { /* Output message about test being performed */ diff --git a/test/trefstr.c b/test/trefstr.c index a278ebc..8073c3f 100644 --- a/test/trefstr.c +++ b/test/trefstr.c @@ -43,9 +43,9 @@ H5FL_BLK_EXTERN(str_buf); ** ** test_refstr_init(): Test basic H5RS (ref-counted strings) code. ** Initialize data for RS testing -** +** ****************************************************************/ -static void +static void test_refstr_init(void) { } /* end test_refstr_init() */ @@ -54,9 +54,9 @@ test_refstr_init(void) ** ** test_refstr_create(): Test basic H5RS (ref-counted strings) code. ** Tests creating and closing ref-counted strings. -** +** ****************************************************************/ -static void +static void test_refstr_create(void) { H5RS_str_t *rs; /* Ref-counted string created */ @@ -84,9 +84,9 @@ test_refstr_create(void) ** ** test_refstr_count(): Test basic H5RS (ref-counted strings) code. ** Tests reference counting on ref-counted strings. -** +** ****************************************************************/ -static void +static void test_refstr_count(void) { H5RS_str_t *rs; /* Ref-counted string created */ @@ -130,9 +130,9 @@ test_refstr_count(void) ** ** test_refstr_dup(): Test basic H5RS (ref-counted strings) code. ** Tests duplicating ref-counted strings. -** +** ****************************************************************/ -static void +static void test_refstr_dup(void) { H5RS_str_t *rs1; /* Ref-counted string created */ @@ -179,9 +179,9 @@ test_refstr_dup(void) ** ** test_refstr_cmp(): Test basic H5RS (ref-counted strings) code. ** Tests comparing ref-counted strings. -** +** ****************************************************************/ -static void +static void test_refstr_cmp(void) { H5RS_str_t *rs1; /* Ref-counted string created */ @@ -228,9 +228,9 @@ test_refstr_cmp(void) ** ** test_refstr_wrap(): Test basic H5RS (ref-counted strings) code. ** Tests wrapping ref-counted strings around existing strings. -** +** ****************************************************************/ -static void +static void test_refstr_wrap(void) { H5RS_str_t *rs; /* Ref-counted string created */ @@ -284,9 +284,9 @@ test_refstr_wrap(void) ** test_refstr_own(): Test basic H5RS (ref-counted strings) code. ** Tests transferring ownership of dynamically allocated strings ** to ref-counted strings. -** +** ****************************************************************/ -static void +static void test_refstr_own(void) { H5RS_str_t *rs; /* Ref-counted string created */ @@ -339,9 +339,9 @@ test_refstr_own(void) ** ** test_refstr_finalize(): Test basic H5RS (ref-counted strings) code. ** Wrap up data for ref-counted string testing -** +** ****************************************************************/ -static void +static void test_refstr_finalize(void) { } /* end test_refstr_finalize() */ @@ -349,7 +349,7 @@ test_refstr_finalize(void) /**************************************************************** ** ** test_refstr(): Main H5RS testing routine. -** +** ****************************************************************/ void test_refstr(void) diff --git a/test/tselect.c b/test/tselect.c index b6a1ee8..58552eb 100644 --- a/test/tselect.c +++ b/test/tselect.c @@ -107,21 +107,21 @@ #define POINT1_NPOINTS 10 /* Chunked dataset information */ -#define DATASETNAME "ChunkArray" -#define NX_SUB 87 /* hyperslab dimensions */ -#define NY_SUB 61 -#define NZ_SUB 181 -#define NX 87 /* output buffer dimensions */ -#define NY 61 -#define NZ 181 +#define DATASETNAME "ChunkArray" +#define NX_SUB 87 /* hyperslab dimensions */ +#define NY_SUB 61 +#define NZ_SUB 181 +#define NX 87 /* output buffer dimensions */ +#define NY 61 +#define NZ 181 #define RANK_F 3 /* File dataspace rank */ #define RANK_M 3 /* Memory dataspace rank */ #define X 87 /* dataset dimensions */ -#define Y 61 -#define Z 181 +#define Y 61 +#define Z 181 #define CHUNK_X 87 /* chunk dimensions */ -#define CHUNK_Y 61 -#define CHUNK_Z 181 +#define CHUNK_Y 61 +#define CHUNK_Z 181 /* Basic chunk size */ #define SPACE10_DIM1 180 @@ -151,9 +151,9 @@ herr_t test_select_hyper_iter3(void *elem,hid_t type_id, unsigned ndim, const hs /**************************************************************** ** ** test_select_hyper_iter1(): Iterator for checking hyperslab iteration -** +** ****************************************************************/ -herr_t +herr_t test_select_hyper_iter1(void *_elem, hid_t UNUSED type_id, unsigned UNUSED ndim, const hsize_t UNUSED *point, void *_operator_data) { uint8_t *tbuf=(uint8_t *)_elem, /* temporary buffer pointer */ @@ -171,9 +171,9 @@ test_select_hyper_iter1(void *_elem, hid_t UNUSED type_id, unsigned UNUSED ndim, ** ** test_select_hyper(): Test basic H5S (dataspace) selection code. ** Tests hyperslabs of various sizes and dimensionalities. -** +** ****************************************************************/ -static void +static void test_select_hyper(hid_t xfer_plist) { hid_t fid1; /* HDF5 File IDs */ @@ -312,11 +312,11 @@ test_select_hyper(hid_t xfer_plist) /* Close memory dataspace */ ret = H5Sclose(sid2); CHECK(ret, FAIL, "H5Sclose"); - + /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -340,15 +340,15 @@ struct pnt_iter { ** ** test_select_point_iter1(): Iterator for checking point iteration ** (This is really ugly code, not a very good example of correct usage - QAK) -** +** ****************************************************************/ -herr_t +herr_t test_select_point_iter1(void *_elem, hid_t UNUSED type_id, unsigned UNUSED ndim, const hsize_t UNUSED *point, void *_operator_data) { uint8_t *elem=(uint8_t *)_elem; /* Pointer to the element to examine */ uint8_t *tmp; /* temporary ptr to element in operator data */ struct pnt_iter *pnt_info=(struct pnt_iter *)_operator_data; - + tmp=pnt_info->buf+(pnt_info->coord[pnt_info->offset][0]*SPACE2_DIM2)+pnt_info->coord[pnt_info->offset][1]; if(*elem!=*tmp) return(-1); @@ -363,9 +363,9 @@ test_select_point_iter1(void *_elem, hid_t UNUSED type_id, unsigned UNUSED ndim, ** test_select_point(): Test basic H5S (dataspace) selection code. ** Tests element selections between dataspaces of various sizes ** and dimensionalities. -** +** ****************************************************************/ -static void +static void test_select_point(hid_t xfer_plist) { hid_t fid1; /* HDF5 File IDs */ @@ -592,11 +592,11 @@ test_select_point(hid_t xfer_plist) /* Close memory dataspace */ ret = H5Sclose(sid2); CHECK(ret, FAIL, "H5Sclose"); - + /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -613,10 +613,10 @@ test_select_point(hid_t xfer_plist) /**************************************************************** ** ** test_select_all_iter1(): Iterator for checking all iteration -** -** +** +** ****************************************************************/ -herr_t +herr_t test_select_all_iter1(void *_elem, hid_t UNUSED type_id, unsigned UNUSED ndim, const hsize_t UNUSED *point, void *_operator_data) { uint8_t *tbuf=(uint8_t *)_elem, /* temporary buffer pointer */ @@ -634,9 +634,9 @@ test_select_all_iter1(void *_elem, hid_t UNUSED type_id, unsigned UNUSED ndim, c ** ** test_select_none_iter1(): Iterator for checking none iteration ** (This is never supposed to be called, so it always returns -1) -** +** ****************************************************************/ -herr_t +herr_t test_select_none_iter1(void UNUSED *_elem, hid_t UNUSED type_id, unsigned UNUSED ndim, const hsize_t UNUSED *point, void UNUSED *_operator_data) { return(-1); @@ -646,9 +646,9 @@ test_select_none_iter1(void UNUSED *_elem, hid_t UNUSED type_id, unsigned UNUSED ** ** test_select_all(): Test basic H5S (dataspace) selection code. ** Tests "all" selections. -** +** ****************************************************************/ -static void +static void test_select_all(hid_t xfer_plist) { hid_t fid1; /* HDF5 File IDs */ @@ -706,7 +706,7 @@ test_select_all(hid_t xfer_plist) /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -724,9 +724,9 @@ test_select_all(hid_t xfer_plist) ** ** test_select_all_hyper(): Test basic H5S (dataspace) selection code. ** Tests "all" and hyperslab selections. -** +** ****************************************************************/ -static void +static void test_select_all_hyper(hid_t xfer_plist) { hid_t fid1; /* HDF5 File IDs */ @@ -839,11 +839,11 @@ test_select_all_hyper(hid_t xfer_plist) /* Close memory dataspace */ ret = H5Sclose(sid2); CHECK(ret, FAIL, "H5Sclose"); - + /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -862,9 +862,9 @@ test_select_all_hyper(hid_t xfer_plist) ** test_select_combo(): Test basic H5S (dataspace) selection code. ** Tests combinations of element and hyperslab selections between ** dataspaces of various sizes and dimensionalities. -** +** ****************************************************************/ -static void +static void test_select_combo(void) { hid_t fid1; /* HDF5 File IDs */ @@ -969,11 +969,11 @@ test_select_combo(void) /* Close memory dataspace */ ret = H5Sclose(sid2); CHECK(ret, FAIL, "H5Sclose"); - + /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -987,7 +987,7 @@ test_select_combo(void) HDfree(rbuf); } /* test_select_combo() */ -int +int compare_size_t(const void *s1, const void *s2) { if(*(const size_t *)s1<*(const size_t *)s2) @@ -1003,9 +1003,9 @@ compare_size_t(const void *s1, const void *s2) ** ** test_select_hyper_stride(): Test H5S (dataspace) selection code. ** Tests strided hyperslabs of various sizes and dimensionalities. -** +** ****************************************************************/ -static void +static void test_select_hyper_stride(hid_t xfer_plist) { hid_t fid1; /* HDF5 File IDs */ @@ -1133,11 +1133,11 @@ test_select_hyper_stride(hid_t xfer_plist) /* Close memory dataspace */ ret = H5Sclose(sid2); CHECK(ret, FAIL, "H5Sclose"); - + /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -1155,9 +1155,9 @@ test_select_hyper_stride(hid_t xfer_plist) ** ** test_select_hyper_contig(): Test H5S (dataspace) selection code. ** Tests contiguous hyperslabs of various sizes and dimensionalities. -** +** ****************************************************************/ -static void +static void test_select_hyper_contig(hid_t dset_type, hid_t xfer_plist) { hid_t fid1; /* HDF5 File IDs */ @@ -1262,11 +1262,11 @@ test_select_hyper_contig(hid_t dset_type, hid_t xfer_plist) /* Close memory dataspace */ ret = H5Sclose(sid2); CHECK(ret, FAIL, "H5Sclose"); - + /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -1284,9 +1284,9 @@ test_select_hyper_contig(hid_t dset_type, hid_t xfer_plist) ** ** test_select_hyper_contig2(): Test H5S (dataspace) selection code. ** Tests more contiguous hyperslabs of various sizes and dimensionalities. -** +** ****************************************************************/ -static void +static void test_select_hyper_contig2(hid_t dset_type, hid_t xfer_plist) { hid_t fid1; /* HDF5 File IDs */ @@ -1383,11 +1383,11 @@ test_select_hyper_contig2(hid_t dset_type, hid_t xfer_plist) /* Close memory dataspace */ ret = H5Sclose(sid2); CHECK(ret, FAIL, "H5Sclose"); - + /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -1408,9 +1408,9 @@ test_select_hyper_contig2(hid_t dset_type, hid_t xfer_plist) ** This test uses a hyperslab that is contiguous in the lowest dimension, ** not contiguous in a dimension, then has a selection across the entire next ** dimension (which should be "flattened" out also). -** +** ****************************************************************/ -static void +static void test_select_hyper_contig3(hid_t dset_type, hid_t xfer_plist) { hid_t fid1; /* HDF5 File IDs */ @@ -1518,11 +1518,11 @@ test_select_hyper_contig3(hid_t dset_type, hid_t xfer_plist) /* Close memory dataspace */ ret = H5Sclose(sid2); CHECK(ret, FAIL, "H5Sclose"); - + /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -1540,9 +1540,9 @@ test_select_hyper_contig3(hid_t dset_type, hid_t xfer_plist) ** ** test_select_hyper_copy(): Test H5S (dataspace) selection code. ** Tests copying hyperslab selections -** +** ****************************************************************/ -static void +static void test_select_hyper_copy(void) { hid_t fid1; /* HDF5 File IDs */ @@ -1667,15 +1667,15 @@ test_select_hyper_copy(void) /* Close memory dataspace */ ret = H5Sclose(sid2); CHECK(ret, FAIL, "H5Sclose"); - + /* Close 2nd memory dataspace */ ret = H5Sclose(sid3); CHECK(ret, FAIL, "H5Sclose"); - + /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close Dataset */ ret = H5Dclose(data1); CHECK(ret, FAIL, "H5Dclose"); @@ -1698,9 +1698,9 @@ test_select_hyper_copy(void) ** ** test_select_point_copy(): Test H5S (dataspace) selection code. ** Tests copying point selections -** +** ****************************************************************/ -static void +static void test_select_point_copy(void) { hid_t fid1; /* HDF5 File IDs */ @@ -1835,15 +1835,15 @@ test_select_point_copy(void) /* Close memory dataspace */ ret = H5Sclose(sid2); CHECK(ret, FAIL, "H5Sclose"); - + /* Close 2nd memory dataspace */ ret = H5Sclose(sid3); CHECK(ret, FAIL, "H5Sclose"); - + /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close Dataset */ ret = H5Dclose(data1); CHECK(ret, FAIL, "H5Dclose"); @@ -1867,9 +1867,9 @@ test_select_point_copy(void) ** test_select_hyper_offset(): Test basic H5S (dataspace) selection code. ** Tests hyperslabs of various sizes and dimensionalities with selection ** offsets. -** +** ****************************************************************/ -static void +static void test_select_hyper_offset(void) { hid_t fid1; /* HDF5 File IDs */ @@ -2004,11 +2004,11 @@ test_select_hyper_offset(void) /* Close memory dataspace */ ret = H5Sclose(sid2); CHECK(ret, FAIL, "H5Sclose"); - + /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -2026,9 +2026,9 @@ test_select_hyper_offset(void) ** ** test_select_hyper_offset2(): Test basic H5S (dataspace) selection code. ** Tests optimized hyperslab I/O with selection offsets. -** +** ****************************************************************/ -static void +static void test_select_hyper_offset2(void) { hid_t fid1; /* HDF5 File IDs */ @@ -2121,11 +2121,11 @@ test_select_hyper_offset2(void) /* Close memory dataspace */ ret = H5Sclose(sid2); CHECK(ret, FAIL, "H5Sclose"); - + /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -2144,9 +2144,9 @@ test_select_hyper_offset2(void) ** test_select_point_offset(): Test basic H5S (dataspace) selection code. ** Tests element selections between dataspaces of various sizes ** and dimensionalities with selection offsets. -** +** ****************************************************************/ -static void +static void test_select_point_offset(void) { hid_t fid1; /* HDF5 File IDs */ @@ -2291,11 +2291,11 @@ test_select_point_offset(void) /* Close memory dataspace */ ret = H5Sclose(sid2); CHECK(ret, FAIL, "H5Sclose"); - + /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -2313,9 +2313,9 @@ test_select_point_offset(void) ** ** test_select_hyper_union(): Test basic H5S (dataspace) selection code. ** Tests unions of hyperslabs of various sizes and dimensionalities. -** +** ****************************************************************/ -static void +static void test_select_hyper_union(void) { hid_t fid1; /* HDF5 File IDs */ @@ -2439,11 +2439,11 @@ test_select_hyper_union(void) /* Close memory dataspace */ ret = H5Sclose(sid2); CHECK(ret, FAIL, "H5Sclose"); - + /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -2532,11 +2532,11 @@ test_select_hyper_union(void) /* Close memory dataspace */ ret = H5Sclose(sid2); CHECK(ret, FAIL, "H5Sclose"); - + /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -2621,11 +2621,11 @@ test_select_hyper_union(void) /* Close memory dataspace */ ret = H5Sclose(sid2); CHECK(ret, FAIL, "H5Sclose"); - + /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -2723,11 +2723,11 @@ test_select_hyper_union(void) /* Close memory dataspace */ ret = H5Sclose(sid2); CHECK(ret, FAIL, "H5Sclose"); - + /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -2807,11 +2807,11 @@ test_select_hyper_union(void) /* Close memory dataspace */ ret = H5Sclose(sid2); CHECK(ret, FAIL, "H5Sclose"); - + /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -2829,9 +2829,9 @@ test_select_hyper_union(void) ** ** test_select_hyper_and_2d(): Test basic H5S (dataspace) selection code. ** Tests 'and' of hyperslabs in 2-D -** +** ****************************************************************/ -static void +static void test_select_hyper_and_2d(void) { hid_t fid1; /* HDF5 File IDs */ @@ -2933,11 +2933,11 @@ test_select_hyper_and_2d(void) /* Close memory dataspace */ ret = H5Sclose(sid2); CHECK(ret, FAIL, "H5Sclose"); - + /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -2955,9 +2955,9 @@ test_select_hyper_and_2d(void) ** ** test_select_hyper_xor_2d(): Test basic H5S (dataspace) selection code. ** Tests 'xor' of hyperslabs in 2-D -** +** ****************************************************************/ -static void +static void test_select_hyper_xor_2d(void) { hid_t fid1; /* HDF5 File IDs */ @@ -3061,11 +3061,11 @@ test_select_hyper_xor_2d(void) /* Close memory dataspace */ ret = H5Sclose(sid2); CHECK(ret, FAIL, "H5Sclose"); - + /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -3083,9 +3083,9 @@ test_select_hyper_xor_2d(void) ** ** test_select_hyper_notb_2d(): Test basic H5S (dataspace) selection code. ** Tests 'notb' of hyperslabs in 2-D -** +** ****************************************************************/ -static void +static void test_select_hyper_notb_2d(void) { hid_t fid1; /* HDF5 File IDs */ @@ -3188,11 +3188,11 @@ test_select_hyper_notb_2d(void) /* Close memory dataspace */ ret = H5Sclose(sid2); CHECK(ret, FAIL, "H5Sclose"); - + /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -3210,9 +3210,9 @@ test_select_hyper_notb_2d(void) ** ** test_select_hyper_nota_2d(): Test basic H5S (dataspace) selection code. ** Tests 'nota' of hyperslabs in 2-D -** +** ****************************************************************/ -static void +static void test_select_hyper_nota_2d(void) { hid_t fid1; /* HDF5 File IDs */ @@ -3315,11 +3315,11 @@ test_select_hyper_nota_2d(void) /* Close memory dataspace */ ret = H5Sclose(sid2); CHECK(ret, FAIL, "H5Sclose"); - + /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -3336,9 +3336,9 @@ test_select_hyper_nota_2d(void) /**************************************************************** ** ** test_select_hyper_iter2(): Iterator for checking hyperslab iteration -** +** ****************************************************************/ -herr_t +herr_t test_select_hyper_iter2(void *_elem, hid_t UNUSED type_id, unsigned ndim, const hsize_t *point, void *_operator_data) { int *tbuf=(int *)_elem, /* temporary buffer pointer */ @@ -3367,9 +3367,9 @@ test_select_hyper_iter2(void *_elem, hid_t UNUSED type_id, unsigned ndim, const ** ** test_select_hyper_union_random_5d(): Test basic H5S (dataspace) selection code. ** Tests random unions of 5-D hyperslabs -** +** ****************************************************************/ -static void +static void test_select_hyper_union_random_5d(hid_t read_plist) { hid_t fid1; /* HDF5 File IDs */ @@ -3531,7 +3531,7 @@ printf("random I/O, after H5Dread()\n"); /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -3549,9 +3549,9 @@ printf("random I/O, after H5Dread()\n"); ** ** test_select_hyper_chunk(): Test basic H5S (dataspace) selection code. ** Tests large hyperslab selection in chunked dataset -** +** ****************************************************************/ -static void +static void test_select_hyper_chunk(hid_t fapl_plist, hid_t xfer_plist) { hsize_t dimsf[3]; /* dataset dimensions */ @@ -3559,20 +3559,20 @@ test_select_hyper_chunk(hid_t fapl_plist, hid_t xfer_plist) short *data; /* data to write */ short *tmpdata; /* data to write */ - /* - * Data and output buffer initialization. + /* + * Data and output buffer initialization. */ hid_t file, dataset; /* handles */ - hid_t dataspace; - hid_t memspace; - hid_t plist; + hid_t dataspace; + hid_t memspace; + hid_t plist; hsize_t dimsm[3]; /* memory space dimensions */ - hsize_t dims_out[3]; /* dataset dimensions */ - herr_t status; + hsize_t dims_out[3]; /* dataset dimensions */ + herr_t status; short *data_out; /* output buffer */ short *tmpdata_out; /* output buffer */ - + hsize_t count[3]; /* size of the hyperslab in the file */ hsize_t offset[3]; /* hyperslab offset in the file */ hsize_t count_out[3]; /* size of the hyperslab in memory */ @@ -3585,9 +3585,9 @@ test_select_hyper_chunk(hid_t fapl_plist, hid_t xfer_plist) /* Allocate the transfer buffers */ data = HDmalloc(sizeof(short)*X*Y*Z); data_out = HDcalloc(NX*NY*NZ,sizeof(short)); - - /* - * Data buffer initialization. + + /* + * Data buffer initialization. */ tmpdata = data; for (j = 0; j < X; j++) @@ -3605,12 +3605,12 @@ test_select_hyper_chunk(hid_t fapl_plist, hid_t xfer_plist) /* * Describe the size of the array and create the data space for fixed - * size dataset. + * size dataset. */ dimsf[0] = X; dimsf[1] = Y; dimsf[2] = Z; - dataspace = H5Screate_simple (RANK_F, dimsf, NULL); + dataspace = H5Screate_simple (RANK_F, dimsf, NULL); CHECK(dataspace, FAIL, "H5Screate_simple"); /* @@ -3621,11 +3621,11 @@ test_select_hyper_chunk(hid_t fapl_plist, hid_t xfer_plist) CHECK(plist, FAIL, "H5Pcreate"); status = H5Pset_chunk (plist, RANK_F, chunk_dimsf); CHECK(status, FAIL, "H5Pset_chunk"); - dataset = H5Dcreate (file, DATASETNAME, H5T_NATIVE_UCHAR, dataspace, plist); + dataset = H5Dcreate (file, DATASETNAME, H5T_NATIVE_UCHAR, dataspace, plist); CHECK(dataset, FAIL, "H5Dcreate"); - /* - * Define hyperslab in the dataset. + /* + * Define hyperslab in the dataset. */ offset[0] = 0; offset[1] = 0; @@ -3633,7 +3633,7 @@ test_select_hyper_chunk(hid_t fapl_plist, hid_t xfer_plist) count[0] = NX_SUB; count[1] = NY_SUB; count[2] = NZ_SUB; - status = H5Sselect_hyperslab (dataspace, H5S_SELECT_SET, offset, NULL, + status = H5Sselect_hyperslab (dataspace, H5S_SELECT_SET, offset, NULL, count, NULL); CHECK(status, FAIL, "H5Sselect_hyperslab"); @@ -3643,11 +3643,11 @@ test_select_hyper_chunk(hid_t fapl_plist, hid_t xfer_plist) dimsm[0] = NX; dimsm[1] = NY; dimsm[2] = NZ; - memspace = H5Screate_simple (RANK_M, dimsm, NULL); + memspace = H5Screate_simple (RANK_M, dimsm, NULL); CHECK(memspace, FAIL, "H5Screate_simple"); - /* - * Define memory hyperslab. + /* + * Define memory hyperslab. */ offset_out[0] = 0; offset_out[1] = 0; @@ -3655,7 +3655,7 @@ test_select_hyper_chunk(hid_t fapl_plist, hid_t xfer_plist) count_out[0] = NX_SUB; count_out[1] = NY_SUB; count_out[2] = NZ_SUB; - status = H5Sselect_hyperslab (memspace, H5S_SELECT_SET, offset_out, NULL, + status = H5Sselect_hyperslab (memspace, H5S_SELECT_SET, offset_out, NULL, count_out, NULL); CHECK(status, FAIL, "H5Sselect_hyperslab"); @@ -3679,16 +3679,16 @@ test_select_hyper_chunk(hid_t fapl_plist, hid_t xfer_plist) CHECK(status, FAIL, "H5Dclose"); status=H5Fclose (file); CHECK(status, FAIL, "H5Fclose"); - -/************************************************************* - This reads the hyperslab from the test.h5 file just - created, into a 3-dimensional plane of the 3-dimensional +/************************************************************* + + This reads the hyperslab from the test.h5 file just + created, into a 3-dimensional plane of the 3-dimensional array. - ************************************************************/ - + ************************************************************/ + /* * Open the file and the dataset. */ @@ -3707,8 +3707,8 @@ test_select_hyper_chunk(hid_t fapl_plist, hid_t xfer_plist) VERIFY(dims_out[1], dimsf[1], "Dataset dimensions"); VERIFY(dims_out[2], dimsf[2], "Dataset dimensions"); - /* - * Define hyperslab in the dataset. + /* + * Define hyperslab in the dataset. */ offset[0] = 0; offset[1] = 0; @@ -3716,7 +3716,7 @@ test_select_hyper_chunk(hid_t fapl_plist, hid_t xfer_plist) count[0] = NX_SUB; count[1] = NY_SUB; count[2] = NZ_SUB; - status = H5Sselect_hyperslab (dataspace, H5S_SELECT_SET, offset, NULL, + status = H5Sselect_hyperslab (dataspace, H5S_SELECT_SET, offset, NULL, count, NULL); CHECK(status, FAIL, "H5Sselect_hyperslab"); @@ -3726,11 +3726,11 @@ test_select_hyper_chunk(hid_t fapl_plist, hid_t xfer_plist) dimsm[0] = NX; dimsm[1] = NY; dimsm[2] = NZ; - memspace = H5Screate_simple (RANK_M, dimsm, NULL); + memspace = H5Screate_simple (RANK_M, dimsm, NULL); CHECK(memspace, FAIL, "H5Screate_simple"); - /* - * Define memory hyperslab. + /* + * Define memory hyperslab. */ offset_out[0] = 0; offset_out[1] = 0; @@ -3738,12 +3738,12 @@ test_select_hyper_chunk(hid_t fapl_plist, hid_t xfer_plist) count_out[0] = NX_SUB; count_out[1] = NY_SUB; count_out[2] = NZ_SUB; - status = H5Sselect_hyperslab (memspace, H5S_SELECT_SET, offset_out, NULL, + status = H5Sselect_hyperslab (memspace, H5S_SELECT_SET, offset_out, NULL, count_out, NULL); CHECK(status, FAIL, "H5Sselect_hyperslab"); /* - * Read data from hyperslab in the file into the hyperslab in + * Read data from hyperslab in the file into the hyperslab in * memory and display. */ status = H5Dread (dataset, H5T_NATIVE_SHORT, memspace, dataspace, @@ -3780,9 +3780,9 @@ test_select_hyper_chunk(hid_t fapl_plist, hid_t xfer_plist) ** test_select_point_chunk(): Test basic H5S (dataspace) selection code. ** Tests combinations of hyperslab and point selections on ** chunked datasets. -** +** ****************************************************************/ -static void +static void test_select_point_chunk(void) { hsize_t dimsf[SPACE7_RANK]; /* dataset dimensions */ @@ -3790,23 +3790,23 @@ test_select_point_chunk(void) unsigned *data; /* data to write */ unsigned *tmpdata; /* data to write */ - /* - * Data and output buffer initialization. + /* + * Data and output buffer initialization. */ hid_t file, dataset; /* handles */ - hid_t dataspace; + hid_t dataspace; hid_t pnt1_space; /* Dataspace to hold 1st point selection */ hid_t pnt2_space; /* Dataspace to hold 2nd point selection */ hid_t hyp1_space; /* Dataspace to hold 1st hyperslab selection */ hid_t hyp2_space; /* Dataspace to hold 2nd hyperslab selection */ - hid_t dcpl; + hid_t dcpl; herr_t ret; /* Generic return value */ unsigned *data_out; /* output buffer */ #ifdef LATER unsigned *tmpdata_out; /* output buffer */ #endif /* LATER */ - + hsize_t start[SPACE7_RANK]; /* hyperslab offset */ hsize_t count[SPACE7_RANK]; /* size of the hyperslab */ hsize_t points[SPACE7_NPOINTS][SPACE7_RANK]; /* points for selection */ @@ -3818,9 +3818,9 @@ test_select_point_chunk(void) /* Allocate the transfer buffers */ data = (unsigned*)HDmalloc(sizeof(unsigned)*SPACE7_DIM1*SPACE7_DIM2); data_out = (unsigned*)HDcalloc(SPACE7_DIM1*SPACE7_DIM2,sizeof(unsigned)); - - /* - * Data buffer initialization. + + /* + * Data buffer initialization. */ tmpdata = data; for (i = 0; i < SPACE7_DIM1; i++) @@ -3838,7 +3838,7 @@ test_select_point_chunk(void) /* Create file dataspace */ dimsf[0] = SPACE7_DIM1; dimsf[1] = SPACE7_DIM2; - dataspace = H5Screate_simple (SPACE7_RANK, dimsf, NULL); + dataspace = H5Screate_simple (SPACE7_RANK, dimsf, NULL); CHECK(dataspace, FAIL, "H5Screate_simple"); /* @@ -3849,7 +3849,7 @@ test_select_point_chunk(void) CHECK(dcpl, FAIL, "H5Pcreate"); ret = H5Pset_chunk (dcpl, SPACE7_RANK, chunk_dimsf); CHECK(ret, FAIL, "H5Pset_chunk"); - dataset = H5Dcreate (file, DATASETNAME, H5T_NATIVE_UCHAR, dataspace, dcpl); + dataset = H5Dcreate (file, DATASETNAME, H5T_NATIVE_UCHAR, dataspace, dcpl); CHECK(dataset, FAIL, "H5Dcreate"); /* Create 1st point selection */ @@ -3974,9 +3974,9 @@ test_select_point_chunk(void) ** ** test_select_sclar_chunk(): Test basic H5S (dataspace) selection code. ** Tests using a scalar dataspace (in memory) to access chunked datasets. -** +** ****************************************************************/ -static void +static void test_select_scalar_chunk(void) { hid_t file_id; /* File ID */ @@ -4040,9 +4040,9 @@ test_select_scalar_chunk(void) ** ** test_select_valid(): Test basic H5S (dataspace) selection code. ** Tests selection validity -** +** ****************************************************************/ -static void +static void test_select_valid(void) { herr_t error; @@ -4136,9 +4136,9 @@ test_select_valid(void) ** test_select_combine(): Test basic H5S (dataspace) selection code. ** Tests combining "all" and "none" selections with hyperslab ** operations. -** +** ****************************************************************/ -static void +static void test_select_combine(void) { hid_t base_id; /* Base dataspace for test */ @@ -4502,9 +4502,9 @@ typedef struct { /**************************************************************** ** ** test_select_hyper_iter3(): Iterator for checking hyperslab iteration -** +** ****************************************************************/ -herr_t +herr_t test_select_hyper_iter3(void *_elem, hid_t UNUSED type_id, unsigned ndim, const hsize_t *point, void *_operator_data) { unsigned short *tbuf=(unsigned short *)_elem; /* temporary buffer pointer */ @@ -4536,9 +4536,9 @@ test_select_hyper_iter3(void *_elem, hid_t UNUSED type_id, unsigned ndim, const ** ** test_select_fill_all(): Test basic H5S (dataspace) selection code. ** Tests filling "all" selections -** +** ****************************************************************/ -static void +static void test_select_fill_all(void) { hid_t sid1; /* Dataspace ID */ @@ -4600,7 +4600,7 @@ test_select_fill_all(void) /* Close dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Free memory buffers */ HDfree(wbuf); } /* test_select_fill_all() */ @@ -4609,9 +4609,9 @@ test_select_fill_all(void) ** ** test_select_fill_point(): Test basic H5S (dataspace) selection code. ** Tests filling "point" selections -** +** ****************************************************************/ -static void +static void test_select_fill_point(hssize_t *offset) { hid_t sid1; /* Dataspace ID */ @@ -4694,7 +4694,7 @@ test_select_fill_point(hssize_t *offset) /* Close dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Free memory buffers */ HDfree(wbuf); } /* test_select_fill_point() */ @@ -4703,9 +4703,9 @@ test_select_fill_point(hssize_t *offset) ** ** test_select_fill_hyper_simple(): Test basic H5S (dataspace) selection code. ** Tests filling "simple" (i.e. one block) hyperslab selections -** +** ****************************************************************/ -static void +static void test_select_fill_hyper_simple(hssize_t *offset) { hid_t sid1; /* Dataspace ID */ @@ -4793,7 +4793,7 @@ test_select_fill_hyper_simple(hssize_t *offset) /* Close dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Free memory buffers */ HDfree(wbuf); } /* test_select_fill_hyper_simple() */ @@ -4802,9 +4802,9 @@ test_select_fill_hyper_simple(hssize_t *offset) ** ** test_select_fill_hyper_regular(): Test basic H5S (dataspace) selection code. ** Tests filling "regular" (i.e. strided block) hyperslab selections -** +** ****************************************************************/ -static void +static void test_select_fill_hyper_regular(hssize_t *offset) { hid_t sid1; /* Dataspace ID */ @@ -4900,7 +4900,7 @@ test_select_fill_hyper_regular(hssize_t *offset) /* Close dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Free memory buffers */ HDfree(wbuf); } /* test_select_fill_hyper_regular() */ @@ -4909,9 +4909,9 @@ test_select_fill_hyper_regular(hssize_t *offset) ** ** test_select_fill_hyper_irregular(): Test basic H5S (dataspace) selection code. ** Tests filling "irregular" (i.e. combined blocks) hyperslab selections -** +** ****************************************************************/ -static void +static void test_select_fill_hyper_irregular(hssize_t *offset) { hid_t sid1; /* Dataspace ID */ @@ -5031,9 +5031,9 @@ test_select_fill_hyper_irregular(hssize_t *offset) ** ** test_select_none(): Test basic H5S (dataspace) selection code. ** Tests I/O on 0-sized point selections -** +** ****************************************************************/ -static void +static void test_select_none(void) { hid_t fid1; /* HDF5 File IDs */ @@ -5105,11 +5105,11 @@ test_select_none(void) /* Close memory dataspace */ ret = H5Sclose(sid2); CHECK(ret, FAIL, "H5Sclose"); - + /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -5127,9 +5127,9 @@ test_select_none(void) ** ** test_scalar_select(): Test basic H5S (dataspace) selection code. ** Tests selections on scalar dataspaces -** +** ****************************************************************/ -static void +static void test_scalar_select(void) { hid_t fid1; /* HDF5 File IDs */ @@ -5255,11 +5255,11 @@ test_scalar_select(void) /* Close memory dataspace */ ret = H5Sclose(sid2); CHECK(ret, FAIL, "H5Sclose"); - + /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -5276,11 +5276,11 @@ test_scalar_select(void) /**************************************************************** ** ** test_scalar_select2(): Tests selections on scalar dataspace, -** verify H5Shyperslab and H5Sselect_elements fails for +** verify H5Shyperslab and H5Sselect_elements fails for ** scalar dataspace. -** +** ****************************************************************/ -static void +static void test_scalar_select2(void) { hid_t sid; /* Dataspace ID */ @@ -5314,7 +5314,7 @@ test_scalar_select2(void) /* Select no elements in memory & file with "none" selection */ ret = H5Sselect_none(sid); CHECK(ret, FAIL, "H5Sselect_none"); - + /* Select all elements in memory & file with "all" selection */ ret = H5Sselect_all(sid); CHECK(ret, FAIL, "H5Sselect_none"); @@ -5328,9 +5328,9 @@ test_scalar_select2(void) ** ** test_shape_same(): Tests selections on dataspace, verify that ** "shape same" routine is working correctly. -** +** ****************************************************************/ -static void +static void test_shape_same(void) { hid_t all_sid; /* Dataspace ID with "all" selection */ @@ -6183,9 +6183,9 @@ test_shape_same(void) ** test_select_hyper_chunk_offset(): Tests selections on dataspace, ** verify that offsets for hyperslab selections are working in ** chunked datasets. -** +** ****************************************************************/ -static void +static void test_select_hyper_chunk_offset(void) { hid_t fid; /* File ID */ @@ -6232,7 +6232,7 @@ test_select_hyper_chunk_offset(void) /* Set the chunk size */ ret=H5Pset_chunk (dcpl, 1, chunks); CHECK(ret, FAIL, "H5Pset_chunk"); - + /* Create dataspace for memory */ msid = H5Screate_simple (1, mem_dims, NULL); CHECK(msid, FAIL, "H5Screate_simple"); @@ -6398,16 +6398,16 @@ test_select_hyper_chunk_offset(void) ** test_select_hyper_chunk_offset2(): Tests selections on dataspace, ** another test to verify that offsets for hyperslab selections are ** working in chunked datasets. -** +** ****************************************************************/ -static void +static void test_select_hyper_chunk_offset2(void) { hid_t file, dataset; /* handles */ - hid_t dataspace; - hid_t memspace; + hid_t dataspace; + hid_t memspace; hid_t dcpl; /* Dataset creation property list */ - herr_t status; + herr_t status; unsigned data_out[SPACE12_DIM0]; /* output buffer */ unsigned data_in[SPACE12_CHUNK_DIM0]; /* input buffer */ hsize_t dims[SPACE12_RANK]={SPACE12_DIM0}; /* Dimension size */ @@ -6456,8 +6456,8 @@ test_select_hyper_chunk_offset2(void) memspace = H5Screate_simple(SPACE12_RANK, chunk_dims, NULL); CHECK(dataspace, FAIL, "H5Screate_simple"); - /* - * Define hyperslab in the file dataspace. + /* + * Define hyperslab in the file dataspace. */ start[0] = 0; count[0] = SPACE12_CHUNK_DIM0; @@ -6470,7 +6470,7 @@ test_select_hyper_chunk_offset2(void) offset[0] = u; status = H5Soffset_simple(dataspace, offset); CHECK(status, FAIL, "H5Soffset_simple"); - + /* Read in buffer of data */ status = H5Dread(dataset, H5T_NATIVE_UINT, memspace, dataspace, H5P_DEFAULT, data_in); @@ -6499,9 +6499,9 @@ test_select_hyper_chunk_offset2(void) ** ** test_select_bounds(): Tests selection bounds on dataspaces, ** both with and without offsets. -** +** ****************************************************************/ -static void +static void test_select_bounds(void) { hid_t sid; /* Dataspace ID */ @@ -6702,9 +6702,9 @@ test_select_bounds(void) /**************************************************************** ** ** test_select(): Main H5S selection testing routine. -** +** ****************************************************************/ -void +void test_select(void) { hid_t plist_id; /* Property list for reading random hyperslabs */ diff --git a/test/tskiplist.c b/test/tskiplist.c index e1a1f43..9a29c95 100644 --- a/test/tskiplist.c +++ b/test/tskiplist.c @@ -58,9 +58,9 @@ static int tst_rev_sort(const void *i1, const void *i2) ** ** test_skiplist_init(): Test H5SL (skiplist) code. ** Initialize data for skip list testing -** +** ****************************************************************/ -static void +static void test_skiplist_init(void) { time_t curr_time; /* Current time, for seeding random number generator */ @@ -108,9 +108,9 @@ test_skiplist_init(void) ** ** test_skiplist_create(): Test basic H5SL (skiplist) code. ** Tests creating and closing skip lists. -** +** ****************************************************************/ -static void +static void test_skiplist_create(void) { H5SL_t *slist; /* Skip list created */ @@ -133,9 +133,9 @@ test_skiplist_create(void) ** ** test_skiplist_insert(): Test H5SL (skip list) code. ** Tests inserting single object into skip list. -** +** ****************************************************************/ -static void +static void test_skiplist_insert(void) { H5SL_t *slist; /* Skip list created */ @@ -196,9 +196,9 @@ test_skiplist_insert(void) ** ** test_skiplist_insert_many(): Test H5SL (skip list) code. ** Tests inserting many objects into skip list. -** +** ****************************************************************/ -static void +static void test_skiplist_insert_many(void) { H5SL_t *slist; /* Skip list created */ @@ -267,9 +267,9 @@ test_skiplist_insert_many(void) ** ** test_skiplist_remove(): Test H5SL (skip list) code. ** Tests basic object removal from skip list. -** +** ****************************************************************/ -static void +static void test_skiplist_remove(void) { H5SL_t *slist; /* Skip list created */ @@ -298,15 +298,15 @@ test_skiplist_remove(void) VERIFY(found_item, NULL, "H5SL_remove"); /* Insert three objects into the skip list */ - key1=15; + key1=15; ret=H5SL_insert(slist,&key1,&key1); CHECK(ret, FAIL, "H5SL_insert"); - key2=10; + key2=10; ret=H5SL_insert(slist,&key2,&key2); CHECK(ret, FAIL, "H5SL_insert"); - key3=20; + key3=20; ret=H5SL_insert(slist,&key3,&key3); CHECK(ret, FAIL, "H5SL_insert"); @@ -349,9 +349,9 @@ test_skiplist_remove(void) ** ** test_skiplist_remove_many(): Test H5SL (skip list) code. ** Tests removing many objects from skip list. -** +** ****************************************************************/ -static void +static void test_skiplist_remove_many(void) { H5SL_t *slist; /* Skip list created */ @@ -448,9 +448,9 @@ test_skiplist_remove_many(void) ** ** test_skiplist_firstnext(): Test H5SL (skip list) code. ** Tests iterating over nodes in skip list with first/next calls. -** +** ****************************************************************/ -static void +static void test_skiplist_firstnext(void) { H5SL_t *slist; /* Skip list created */ @@ -514,9 +514,9 @@ test_skiplist_firstnext(void) ** ** test_skiplist_string(): Test H5SL (skip list) code. ** Tests using strings for keys in skip lists. -** +** ****************************************************************/ -static void +static void test_skiplist_string(void) { H5SL_t *slist; /* Skip list created */ @@ -604,9 +604,9 @@ test_skiplist_iter(void *item, void UNUSED *key, void *op_data) ** ** test_skiplist_iterate(): Test H5SL (skip list) code. ** Tests iterating over nodes in skip list with callbacks. -** +** ****************************************************************/ -static void +static void test_skiplist_iterate(void) { H5SL_t *slist; /* Skip list created */ @@ -650,9 +650,9 @@ test_skiplist_iterate(void) ** ** test_skiplist_hsize(): Test H5SL (skip list) code. ** Tests using hsize_t for keys in skip lists. -** +** ****************************************************************/ -static void +static void test_skiplist_hsize(void) { H5SL_t *slist; /* Skip list created */ @@ -705,9 +705,9 @@ test_skiplist_hsize(void) ** ** test_skiplist_unsigned(): Test H5SL (skip list) code. ** Tests using unsigned for keys in skip lists. -** +** ****************************************************************/ -static void +static void test_skiplist_unsigned(void) { H5SL_t *slist; /* Skip list created */ @@ -760,9 +760,9 @@ test_skiplist_unsigned(void) ** ** test_skiplist_lastprev(): Test H5SL (skip list) code. ** Tests iterating over nodes in skip list with last/prev calls. -** +** ****************************************************************/ -static void +static void test_skiplist_lastprev(void) { H5SL_t *slist; /* Skip list created */ @@ -826,9 +826,9 @@ test_skiplist_lastprev(void) ** ** test_skiplist_find(): Test H5SL (skip list) code. ** Tests 'find' operation in skip lists. -** +** ****************************************************************/ -static void +static void test_skiplist_find(void) { H5SL_t *slist; /* Skip list created */ @@ -882,9 +882,9 @@ test_skiplist_find(void) ** ** test_skiplist_add(): Test H5SL (skip list) code. ** Tests 'add' operation in skip lists. -** +** ****************************************************************/ -static void +static void test_skiplist_add(void) { H5SL_t *slist; /* Skip list created */ @@ -948,9 +948,9 @@ test_skiplist_destroy_free(void *item, void UNUSED *key, void *op_data) ** ** test_skiplist_destroy(): Test H5SL (skip list) code. ** Tests 'destroy' operation in skip lists. -** +** ****************************************************************/ -static void +static void test_skiplist_destroy(void) { H5SL_t *slist; /* Skip list created */ @@ -983,9 +983,9 @@ test_skiplist_destroy(void) ** ** test_skiplist_free(): Test H5SL (skip list) code. ** Tests 'free' operation in skip lists. -** +** ****************************************************************/ -static void +static void test_skiplist_free(void) { H5SL_t *slist; /* Skip list created */ @@ -1037,9 +1037,9 @@ test_skiplist_free(void) ** ** test_skiplist_less(): Test H5SL (skip list) code. ** Tests 'less' operation in skip lists. -** +** ****************************************************************/ -static void +static void test_skiplist_less(void) { H5SL_t *slist; /* Skip list created */ @@ -1100,7 +1100,7 @@ test_skiplist_less(void) /**************************************************************** ** ** test_skiplist(): Main H5SL testing routine. -** +** ****************************************************************/ void test_skiplist(void) diff --git a/test/ttime.c b/test/ttime.c index 5f9b5e7..2578d6b 100644 --- a/test/ttime.c +++ b/test/ttime.c @@ -44,7 +44,7 @@ test_time_commit(void) /* Create a new file using default properties. */ file_id = H5Fcreate(DATAFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); CHECK(file_id, FAIL, "H5Fcreate"); - + tid = H5Tcopy (H5T_UNIX_D32LE); CHECK(tid, FAIL, "H5Tcopy"); status = H5Tcommit(file_id, "Committed D32LE type", tid); @@ -72,53 +72,53 @@ test_time_commit(void) CHECK(status, FAIL, "H5Tcommit"); status = H5Tclose (tid); CHECK(status, FAIL, "H5Tclose"); - + /* Close the file. */ status = H5Fclose(file_id); CHECK(status, FAIL, "H5Fclose"); - + file_id = H5Fopen(DATAFILE, H5F_ACC_RDWR, H5P_DEFAULT); CHECK(file_id, FAIL, "H5Fopen"); - + tid = H5Topen(file_id, "Committed D32LE type"); CHECK(tid, FAIL, "H5Topen"); - + if(!H5Tequal(tid, H5T_UNIX_D32LE)) TestErrPrintf("H5T_UNIX_D32LE datatype not found\n"); - + status = H5Tclose (tid); CHECK(status, FAIL, "H5Tclose"); tid = H5Topen(file_id, "Committed D32BE type"); CHECK(tid, FAIL, "H5Topen"); - + if(!H5Tequal(tid, H5T_UNIX_D32BE)) TestErrPrintf("H5T_UNIX_D32BE datatype not found\n"); - + status = H5Tclose (tid); CHECK(status, FAIL, "H5Tclose"); tid = H5Topen(file_id, "Committed D64LE type"); CHECK(tid, FAIL, "H5Topen"); - + if(!H5Tequal(tid, H5T_UNIX_D64LE)) TestErrPrintf("H5T_UNIX_D64LE datatype not found"); - + status = H5Tclose (tid); CHECK(status, FAIL, "H5Tclose"); tid = H5Topen(file_id, "Committed D64BE type"); CHECK(tid, FAIL, "H5Topen"); - + if(!H5Tequal(tid, H5T_UNIX_D64BE)) TestErrPrintf("H5T_UNIX_D64BE datatype not found"); - + status = H5Tclose (tid); CHECK(status, FAIL, "H5Tclose"); status = H5Fclose(file_id); CHECK(status, FAIL, "H5Fclose"); - + } #ifdef NOT_YET @@ -143,7 +143,7 @@ test_time_io(void) /* Create a new file using default properties. */ fid = H5Fcreate(DATAFILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); CHECK(fid, FAIL, "H5Fcreate"); - + /* Create a scalar dataspace */ sid = H5Screate(H5S_SCALAR); CHECK(sid, FAIL, "H5Screate"); @@ -192,16 +192,16 @@ fprintf(stderr,"time written was: %s\n", HDctime(&timethen)); status = H5Fclose(fid); CHECK(status, FAIL, "H5Fclose"); - + } #endif /* NOT_YET */ /**************************************************************** ** ** test_time(): Main time datatype testing routine. -** +** ****************************************************************/ -void +void test_time(void) { /* Output message about test being performed */ @@ -211,7 +211,7 @@ test_time(void) #ifdef NOT_YET test_time_io(); /* Test writing time data to a dataset */ #endif /* NOT_YET */ - + } /* test_time() */ diff --git a/test/ttsafe.c b/test/ttsafe.c index 0e24bf3..3f66e4a 100644 --- a/test/ttsafe.c +++ b/test/ttsafe.c @@ -31,7 +31,7 @@ * BUGS/LIMITATIONS * * EXPORTED ROUTINES/VARIABLES: - * + * */ #include "h5test.h" diff --git a/test/ttsafe_acreate.c b/test/ttsafe_acreate.c index f535541..311eec7 100644 --- a/test/ttsafe_acreate.c +++ b/test/ttsafe_acreate.c @@ -80,7 +80,7 @@ void tts_acreate(void) int data; /* data to write */ int buffer, ret, i; - ttsafe_name_data_t *attrib_data; + ttsafe_name_data_t *attrib_data; /* * Create an HDF5 file using H5F_ACC_TRUNC access, default file diff --git a/test/ttsafe_cancel.c b/test/ttsafe_cancel.c index 052e970..87d4771 100644 --- a/test/ttsafe_cancel.c +++ b/test/ttsafe_cancel.c @@ -24,7 +24,7 @@ * * The cancellation should only work after the child thread has safely * left the H5Diterate call. - * + * * Temporary files generated: * ttsafe_cancel.h5 * diff --git a/test/ttsafe_dcreate.c b/test/ttsafe_dcreate.c index 8a4b38c..a3bc763 100644 --- a/test/ttsafe_dcreate.c +++ b/test/ttsafe_dcreate.c @@ -53,7 +53,7 @@ typedef struct thread_info { int id; hid_t file; const char *dsetname; -} thread_info; +} thread_info; /* * Set individual dataset names (rather than generated the names diff --git a/test/ttsafe_error.c b/test/ttsafe_error.c index 07d9e7d..73c4c88 100644 --- a/test/ttsafe_error.c +++ b/test/ttsafe_error.c @@ -186,7 +186,7 @@ herr_t walk_error_callback(int n, H5E_error_t *err_desc, void UNUSED *client_dat if (err_desc) { maj_num = err_desc->maj_num; min_num = err_desc->min_num; - + if (n < EXPECTED_ERROR_DEPTH && maj_num == expected[n].maj_num && min_num == expected[n].min_num) return SUCCEED; diff --git a/test/ttst.c b/test/ttst.c index 5663050..2898681 100644 --- a/test/ttst.c +++ b/test/ttst.c @@ -67,9 +67,9 @@ static int tst_strcmp(const void *_s1, const void *_s2) ** ** test_tst_init(): Test basic H5ST (ternary search tree) selection code. ** Initialize data for TST testing -** +** ****************************************************************/ -static void +static void test_tst_init(void) { time_t curr_time; /* Current time, for seeding random number generator */ @@ -143,9 +143,9 @@ test_tst_init(void) ** ** test_tst_create(): Test basic H5ST (ternary search tree) selection code. ** Tests creating and closing TSTs. -** +** ****************************************************************/ -static void +static void test_tst_create(void) { H5ST_tree_t *tree; /* TST created */ @@ -173,9 +173,9 @@ test_tst_create(void) ** ** test_tst_insert(): Test basic H5ST (ternary search tree) selection code. ** Tests inserting key/value pairs into TST -** +** ****************************************************************/ -static void +static void test_tst_insert(void) { H5ST_tree_t *tree; /* TST created */ @@ -235,9 +235,9 @@ test_tst_insert(void) ** ** test_tst_iterate(): Test basic H5ST (ternary search tree) code. ** Tests iterating through key/value pairs in TST -** +** ****************************************************************/ -static void +static void test_tst_iterate(void) { H5ST_tree_t *tree; /* TST created */ @@ -281,9 +281,9 @@ test_tst_iterate(void) ** ** test_tst_remove(): Test basic H5ST (ternary search tree) code. ** Tests removing key/value pairs by string value in TST -** +** ****************************************************************/ -static void +static void test_tst_remove(void) { H5ST_tree_t *tree; /* TST created */ @@ -354,9 +354,9 @@ test_tst_remove(void) ** ** test_tst_finalize(): Test basic H5ST (ternary search tree) selection code. ** Wrap up data for TST testing -** +** ****************************************************************/ -static void +static void test_tst_finalize(void) { /* Release memory for unordered, randomized and sorted order unique words */ @@ -368,7 +368,7 @@ test_tst_finalize(void) /**************************************************************** ** ** test_tst(): Main H5ST selection testing routine. -** +** ****************************************************************/ void test_tst(void) diff --git a/test/tvlstr.c b/test/tvlstr.c index 52d883b..8a8f5cb 100644 --- a/test/tvlstr.c +++ b/test/tvlstr.c @@ -60,7 +60,7 @@ void test_vlstr_free_custom(void *mem, void *info); ** allocation routines. This routine just uses malloc to ** allocate the memory and increments the amount of memory ** allocated. -** +** ****************************************************************/ void *test_vlstr_alloc_custom(size_t size, void *info) { @@ -88,7 +88,7 @@ void *test_vlstr_alloc_custom(size_t size, void *info) ** allocation routines. This routine just uses free to ** release the memory and decrements the amount of memory ** allocated. -** +** ****************************************************************/ void test_vlstr_free_custom(void *_mem, void *info) { @@ -113,7 +113,7 @@ void test_vlstr_free_custom(void *_mem, void *info) ** ** test_vlstrings_basic(): Test basic VL string code. ** Tests simple VL string I/O -** +** ****************************************************************/ static void test_vlstrings_basic(void) @@ -166,7 +166,7 @@ test_vlstrings_basic(void) CHECK(ret, FAIL, "H5Dwrite"); dataspace = H5Screate(H5S_SCALAR); - + dataset2=H5Dcreate(fid1,"Dataset2",tid1,dataspace,H5P_DEFAULT); CHECK(dataset, FAIL, "H5Dcreate"); @@ -175,7 +175,7 @@ test_vlstrings_basic(void) ret=H5Dwrite(dataset2,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,&wdata2); CHECK(ret, FAIL, "H5Dwrite"); - + H5Sclose(dataspace); H5Dclose(dataset2); HDfree(wdata2); @@ -235,11 +235,11 @@ test_vlstrings_basic(void) /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close dataset transfer property list */ ret = H5Pclose(xfer_pid); CHECK(ret, FAIL, "H5Pclose"); - + /* Close file */ ret = H5Fclose(fid1); CHECK(ret, FAIL, "H5Fclose"); @@ -248,9 +248,9 @@ test_vlstrings_basic(void) /**************************************************************** ** -** test_vlstrings_special(): Test VL string code for special +** test_vlstrings_special(): Test VL string code for special ** string cases, nil and zero-sized. -** +** ****************************************************************/ static void test_vlstrings_special(void) @@ -298,7 +298,7 @@ test_vlstrings_special(void) for(i=0; ilen; k++) { - if( ((unsigned int *)t1->p)[k] != ((unsigned int *)t2->p)[k] ) { + if( ((unsigned int *)t1->p)[k] != ((unsigned int *)t2->p)[k] ) { TestErrPrintf("VL data values don't match!, t1->p[%d]=%d, t2->p[%d]=%d\n",(int)k, (int)((unsigned int *)t1->p)[k], (int)k, (int)((unsigned int *)t2->p)[k]); continue; } /* end if */ @@ -2031,9 +2031,9 @@ rewrite_shorter_vltypes_vlen_vlen_atomic(void) /**************************************************************** ** ** test_vltypes(): Main VL datatype testing routine. -** +** ****************************************************************/ -void +void test_vltypes(void) { /* Output message about test being performed */ diff --git a/test/unlink.c b/test/unlink.c index 4888521..f031e0c 100644 --- a/test/unlink.c +++ b/test/unlink.c @@ -92,7 +92,7 @@ test_one(hid_t file) { hid_t work=-1, grp=-1; herr_t status; - + /* Create a test group */ if ((work=H5Gcreate(file, "/test_one", 0))<0) goto error; @@ -160,7 +160,7 @@ test_many(hid_t file) int i; const int how_many=500; char name[32]; - + /* Create a test group */ if ((work=H5Gcreate(file, "/test_many", 0))<0) goto error; if ((grp = H5Gcreate(work, "/test_many_foo", 0))<0) goto error; @@ -205,7 +205,7 @@ test_many(hid_t file) if (H5Gunlink(work, name)<0) goto error; } PASSED(); - + /* Create a bunch of names and unlink them from the midle */ TESTING("outward unlink"); for (i=0; i= 0),"MPIO creation property list succeeded"); - + file = H5Fcreate(filename,H5F_ACC_TRUNC,H5P_DEFAULT,acc_plist); VRFY((file >= 0),"H5Fcreate succeeded"); @@ -136,11 +136,11 @@ coll_chunktest(const char* filename,int chunk_factor,int select_factor) { VRFY((status >= 0),""); /* setup dimensionality object */ - + dims[0] = SPACE_DIM1; dims[1] = SPACE_DIM2; - /* each process takes a slab of rows + /* each process takes a slab of rows stride[0] = 1; stride[1] = 1; count[0] = SPACE_DIM1/mpi_size; @@ -163,15 +163,15 @@ coll_chunktest(const char* filename,int chunk_factor,int select_factor) { crp_plist = H5Pcreate(H5P_DATASET_CREATE); VRFY((crp_plist >= 0),""); - + /* test1: chunk size is equal to dataset size */ chunk_dims[0] = SPACE_DIM1/chunk_factor; chunk_dims[1] = SPACE_DIM2/chunk_factor; status = H5Pset_chunk(crp_plist, 2, chunk_dims); VRFY((status >= 0),"chunk creation property list succeeded"); - + dataset = H5Dcreate(file,DSET_COLLECTIVE_CHUNK_NAME,H5T_NATIVE_INT, - file_dataspace,crp_plist); + file_dataspace,crp_plist); VRFY((dataset >= 0),"dataset created succeeded"); /* H5Sclose(file_dataspace); */ @@ -216,19 +216,19 @@ coll_chunktest(const char* filename,int chunk_factor,int select_factor) { } #endif /* H5_HAVE_INSTRUMENTED_LIBRARY */ status = H5Dclose(dataset); - VRFY((status >= 0),""); + VRFY((status >= 0),""); /* check whether using collective IO */ /* Should use H5Pget and H5Pinsert to handle this test. */ status = H5Pclose(xfer_plist); - VRFY((status >= 0),"property list closed"); + VRFY((status >= 0),"property list closed"); status = H5Sclose(file_dataspace); - VRFY((status >= 0),""); + VRFY((status >= 0),""); status = H5Fclose(file); - VRFY((status >= 0),""); + VRFY((status >= 0),""); if (data_array1) free(data_array1); @@ -248,7 +248,7 @@ coll_chunktest(const char* filename,int chunk_factor,int select_factor) { status = H5Pset_fapl_mpio(acc_plist,comm,info); VRFY((acc_plist >= 0),"MPIO creation property list succeeded"); - + file = H5Fopen(filename,H5F_ACC_RDONLY,acc_plist); VRFY((file >= 0),"H5Fcreate succeeded"); @@ -270,8 +270,8 @@ coll_chunktest(const char* filename,int chunk_factor,int select_factor) { /* fill dataset with test data */ ccdataset_fill(start, stride,count,block, data_origin1); - xfer_plist = H5Pcreate (H5P_DATASET_XFER); - VRFY((xfer_plist >= 0),""); + xfer_plist = H5Pcreate (H5P_DATASET_XFER); + VRFY((xfer_plist >= 0),""); status = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); VRFY((status>= 0),"MPIO collective transfer property succeeded"); #ifdef H5_HAVE_INSTRUMENTED_LIBRARY @@ -315,7 +315,7 @@ coll_chunktest(const char* filename,int chunk_factor,int select_factor) { /* release data buffers */ if (data_array1) free(data_array1); if (data_origin1) free(data_origin1); - + } @@ -395,11 +395,11 @@ ccdataset_fill(hsize_t start[], hsize_t stride[], hsize_t count[], hsize_t block dataptr = tmptr + ((start[0]+k1*stride[0]+i)*SPACE_DIM2+ start[1]+k2*stride[1]+j); - + *dataptr = (DATATYPE)(k1+k2+i+j); } } - } + } } } @@ -455,7 +455,7 @@ ccdataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block } vrfyerrs = 0; - + for (k1 = 0; k1 < count[0];k1++) { for(i = 0;i < block[0];i++) { for(k2 = 0; k2 0), "H5Screate_simple succeeded"); /* Create dataset */ - dataset = H5Dcreate(fid, "compressed_data", H5T_NATIVE_INT, dataspace, dcpl); + dataset = H5Dcreate(fid, "compressed_data", H5T_NATIVE_INT, dataspace, dcpl); VRFY((dataset > 0), "H5Screate_simple succeeded"); /* Write compressed data */ diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c index d99cbc3..96f0f55 100644 --- a/testpar/t_mdset.c +++ b/testpar/t_mdset.c @@ -19,7 +19,7 @@ #define NDATASET 4 #define GROUP_DEPTH 128 enum obj_type { is_group, is_dset }; - + int get_size(void); void write_dataset(hid_t, hid_t, hid_t); @@ -34,10 +34,10 @@ void get_slab(hsize_t[], hsize_t[], hsize_t[], hsize_t[], int); /* - * The size value computed by this function is used extensively in - * configuring tests for the current number of processes. + * The size value computed by this function is used extensively in + * configuring tests for the current number of processes. * - * This function was created as part of an effort to allow the + * This function was created as part of an effort to allow the * test functions in this file to run on an arbitrary number of * processors. * JRM - 8/11/04 @@ -48,7 +48,7 @@ int get_size(void) int mpi_rank; int mpi_size; int size = SIZE; - + MPI_Comm_rank (MPI_COMM_WORLD, &mpi_rank); /* needed for VRFY */ MPI_Comm_size (MPI_COMM_WORLD, &mpi_size); @@ -118,7 +118,7 @@ void multiple_dset_write(void) VRFY((ret>=0), "H5Pclose succeeded"); /* decide the hyperslab according to process number. */ - get_slab(chunk_origin, chunk_dims, count, file_dims, size); + get_slab(chunk_origin, chunk_dims, count, file_dims, size); memspace = H5Screate_simple (DIM, chunk_dims, NULL); filespace = H5Screate_simple (DIM, file_dims, NULL); @@ -135,7 +135,7 @@ void multiple_dset_write(void) for (n = 0; n < ndatasets; n++) { sprintf (dname, "dataset %d", n); dataset = H5Dcreate (iof, dname, H5T_NATIVE_DOUBLE, filespace, dcpl); - VRFY((dataset > 0), dname); + VRFY((dataset > 0), dname); /* calculate data to write */ for (i = 0; i < size; i++) @@ -162,7 +162,7 @@ void multiple_dset_write(void) } -/* Example of using PHDF5 to create, write, and read compact dataset. +/* Example of using PHDF5 to create, write, and read compact dataset. * * Changes: Updated function to use a dynamically calculated size, * instead of the old SIZE #define. This should allow it @@ -188,7 +188,7 @@ void compact_dataset(void) { file_dims[i] = size; } - + MPI_Comm_rank (MPI_COMM_WORLD, &mpi_rank); MPI_Comm_size (MPI_COMM_WORLD, &mpi_size); @@ -216,7 +216,7 @@ void compact_dataset(void) VRFY((ret >= 0), "set space allocation time for compact dataset"); dataset = H5Dcreate (iof, dname, H5T_NATIVE_DOUBLE, filespace, dcpl); - VRFY((dataset >= 0), "H5Dcreate succeeded"); + VRFY((dataset >= 0), "H5Dcreate succeeded"); /* set up the collective transfer properties list */ dxpl = H5Pcreate (H5P_DATASET_XFER); @@ -260,8 +260,8 @@ void compact_dataset(void) for (j = 0; j < size; j++) if ( inme[(i * size) + j] != outme[(i * size) + j]) if(err_num++ < MAX_ERR_REPORT || VERBOSE_MED) - printf("Dataset Verify failed at [%d][%d]: expect %f, got %f\n", i, j, outme[(i * size) + j], inme[(i * size) + j]); - + printf("Dataset Verify failed at [%d][%d]: expect %f, got %f\n", i, j, outme[(i * size) + j], inme[(i * size) + j]); + H5Pclose(plist); H5Pclose(dxpl); H5Dclose(dataset); @@ -277,7 +277,7 @@ void compact_dataset(void) * * Changes: Removed the assert that mpi_size <= the SIZE #define. * As best I can tell, this assert isn't needed here, - * and in any case, the SIZE #define is being removed + * and in any case, the SIZE #define is being removed * in an update of the functions in this file to run * with an arbitrary number of processes. * @@ -296,7 +296,7 @@ void big_dataset(void) MPI_Offset file_size; /* Size of file on disk */ herr_t ret; /* Generic return value */ const char *filename; - + MPI_Comm_rank (MPI_COMM_WORLD, &mpi_rank); MPI_Comm_size (MPI_COMM_WORLD, &mpi_size); @@ -306,13 +306,13 @@ void big_dataset(void) filename = GetTestParameters(); fapl = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs); - VRFY((fapl >= 0), "create_faccess_plist succeeded"); + VRFY((fapl >= 0), "create_faccess_plist succeeded"); /* * Create >2GB HDF5 file */ iof = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); - VRFY((iof >= 0), "H5Fcreate succeeded"); + VRFY((iof >= 0), "H5Fcreate succeeded"); /* Define dataspace for 2GB dataspace */ file_dims[0]= 2; @@ -320,28 +320,28 @@ void big_dataset(void) file_dims[2]= 1024; file_dims[3]= 1024; filespace = H5Screate_simple (4, file_dims, NULL); - VRFY((filespace >= 0), "H5Screate_simple succeeded"); + VRFY((filespace >= 0), "H5Screate_simple succeeded"); dataset = H5Dcreate (iof, dname, H5T_NATIVE_UCHAR, filespace, H5P_DEFAULT); - VRFY((dataset >= 0), "H5Dcreate succeeded"); + VRFY((dataset >= 0), "H5Dcreate succeeded"); /* Close all file objects */ ret=H5Dclose (dataset); - VRFY((ret >= 0), "H5Dclose succeeded"); + VRFY((ret >= 0), "H5Dclose succeeded"); ret=H5Sclose (filespace); - VRFY((ret >= 0), "H5Sclose succeeded"); + VRFY((ret >= 0), "H5Sclose succeeded"); ret=H5Fclose (iof); - VRFY((ret >= 0), "H5Fclose succeeded"); + VRFY((ret >= 0), "H5Fclose succeeded"); /* Check that file of the correct size was created */ file_size=h5_mpi_get_file_size(filename, MPI_COMM_WORLD, MPI_INFO_NULL); - VRFY((file_size == 2147485696ULL), "File is correct size"); + VRFY((file_size == 2147485696ULL), "File is correct size"); /* * Create >4GB HDF5 file */ iof = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); - VRFY((iof >= 0), "H5Fcreate succeeded"); + VRFY((iof >= 0), "H5Fcreate succeeded"); /* Define dataspace for 4GB dataspace */ file_dims[0]= 4; @@ -349,28 +349,28 @@ void big_dataset(void) file_dims[2]= 1024; file_dims[3]= 1024; filespace = H5Screate_simple (4, file_dims, NULL); - VRFY((filespace >= 0), "H5Screate_simple succeeded"); + VRFY((filespace >= 0), "H5Screate_simple succeeded"); dataset = H5Dcreate (iof, dname, H5T_NATIVE_UCHAR, filespace, H5P_DEFAULT); - VRFY((dataset >= 0), "H5Dcreate succeeded"); + VRFY((dataset >= 0), "H5Dcreate succeeded"); /* Close all file objects */ ret=H5Dclose (dataset); - VRFY((ret >= 0), "H5Dclose succeeded"); + VRFY((ret >= 0), "H5Dclose succeeded"); ret=H5Sclose (filespace); - VRFY((ret >= 0), "H5Sclose succeeded"); + VRFY((ret >= 0), "H5Sclose succeeded"); ret=H5Fclose (iof); - VRFY((ret >= 0), "H5Fclose succeeded"); + VRFY((ret >= 0), "H5Fclose succeeded"); /* Check that file of the correct size was created */ file_size=h5_mpi_get_file_size(filename, MPI_COMM_WORLD, MPI_INFO_NULL); - VRFY((file_size == 4294969344ULL), "File is correct size"); + VRFY((file_size == 4294969344ULL), "File is correct size"); /* * Create >8GB HDF5 file */ iof = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); - VRFY((iof >= 0), "H5Fcreate succeeded"); + VRFY((iof >= 0), "H5Fcreate succeeded"); /* Define dataspace for 8GB dataspace */ file_dims[0]= 8; @@ -378,26 +378,26 @@ void big_dataset(void) file_dims[2]= 1024; file_dims[3]= 1024; filespace = H5Screate_simple (4, file_dims, NULL); - VRFY((filespace >= 0), "H5Screate_simple succeeded"); + VRFY((filespace >= 0), "H5Screate_simple succeeded"); dataset = H5Dcreate (iof, dname, H5T_NATIVE_UCHAR, filespace, H5P_DEFAULT); - VRFY((dataset >= 0), "H5Dcreate succeeded"); + VRFY((dataset >= 0), "H5Dcreate succeeded"); /* Close all file objects */ ret=H5Dclose (dataset); - VRFY((ret >= 0), "H5Dclose succeeded"); + VRFY((ret >= 0), "H5Dclose succeeded"); ret=H5Sclose (filespace); - VRFY((ret >= 0), "H5Sclose succeeded"); + VRFY((ret >= 0), "H5Sclose succeeded"); ret=H5Fclose (iof); - VRFY((ret >= 0), "H5Fclose succeeded"); + VRFY((ret >= 0), "H5Fclose succeeded"); /* Check that file of the correct size was created */ file_size=h5_mpi_get_file_size(filename, MPI_COMM_WORLD, MPI_INFO_NULL); - VRFY((file_size == 8589936640ULL), "File is correct size"); + VRFY((file_size == 8589936640ULL), "File is correct size"); /* Close fapl */ ret=H5Pclose (fapl); - VRFY((ret >= 0), "H5Pclose succeeded"); + VRFY((ret >= 0), "H5Pclose succeeded"); } /* Example of using PHDF5 to read a partial written dataset. The dataset does @@ -406,10 +406,10 @@ void big_dataset(void) * * Changes: Removed the assert that mpi_size <= the SIZE #define. * As best I can tell, this assert isn't needed here, - * and in any case, the SIZE #define is being removed + * and in any case, the SIZE #define is being removed * in an update of the functions in this file to run * with an arbitrary number of processes. - * + * * Also added code to free dynamically allocated buffers. * * JRM - 8/11/04 @@ -435,7 +435,7 @@ void dataset_fillvalue(void) int acc, i, j, k, l; /* Local index variables */ herr_t ret; /* Generic return value */ const char *filename; - + MPI_Comm_rank (MPI_COMM_WORLD, &mpi_rank); MPI_Comm_size (MPI_COMM_WORLD, &mpi_size); @@ -551,7 +551,7 @@ void dataset_fillvalue(void) if(i= 0), "H5Dclose succeeded"); + VRFY((ret >= 0), "H5Dclose succeeded"); ret=H5Sclose (filespace); - VRFY((ret >= 0), "H5Sclose succeeded"); + VRFY((ret >= 0), "H5Sclose succeeded"); ret=H5Fclose (iof); - VRFY((ret >= 0), "H5Fclose succeeded"); + VRFY((ret >= 0), "H5Fclose succeeded"); /* Close memory dataspace */ ret=H5Sclose (memspace); @@ -590,7 +590,7 @@ void dataset_fillvalue(void) HDfree(wdata); } -/* Write multiple groups with a chunked dataset in each group collectively. +/* Write multiple groups with a chunked dataset in each group collectively. * These groups and datasets are for testing independent read later. * * Changes: Updated function to use a dynamically calculated size, @@ -635,27 +635,27 @@ void collective_group_write(void) H5Pclose(plist); /* decide the hyperslab according to process number. */ - get_slab(chunk_origin, chunk_dims, count, file_dims, size); + get_slab(chunk_origin, chunk_dims, count, file_dims, size); /* select hyperslab in memory and file spaces. These two operations are * identical since the datasets are the same. */ memspace = H5Screate_simple(DIM, file_dims, NULL); - ret1 = H5Sselect_hyperslab(memspace, H5S_SELECT_SET, chunk_origin, + ret1 = H5Sselect_hyperslab(memspace, H5S_SELECT_SET, chunk_origin, chunk_dims, count, chunk_dims); filespace = H5Screate_simple(DIM, file_dims, NULL); - ret2 = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, chunk_origin, + ret2 = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, chunk_origin, chunk_dims, count, chunk_dims); VRFY((memspace>=0), "memspace"); VRFY((filespace>=0), "filespace"); VRFY((ret1>=0), "mgroup memspace selection"); - VRFY((ret2>=0), "mgroup filespace selection"); - + VRFY((ret2>=0), "mgroup filespace selection"); + dcpl = H5Pcreate(H5P_DATASET_CREATE); ret1 = H5Pset_chunk (dcpl, 2, chunk_size); VRFY((dcpl>=0), "dataset creation property"); VRFY((ret1>=0), "set chunk for dataset creation property"); - - /* creates ngroups groups under the root group, writes chunked + + /* creates ngroups groups under the root group, writes chunked * datasets in parallel. */ for(m = 0; m < ngroups; m++) { sprintf(gname, "group%d", m); @@ -670,7 +670,7 @@ void collective_group_write(void) for(j=0; j < size; j++) outme[(i * size) + j] = (i+j)*1000 + mpi_rank; - H5Dwrite(did, H5T_NATIVE_INT, memspace, filespace, H5P_DEFAULT, + H5Dwrite(did, H5T_NATIVE_INT, memspace, filespace, H5P_DEFAULT, outme); H5Dclose(did); @@ -683,7 +683,7 @@ void collective_group_write(void) } #endif /* BARRIER_CHECKS */ } - + H5Pclose(dcpl); H5Sclose(filespace); H5Sclose(memspace); @@ -692,8 +692,8 @@ void collective_group_write(void) HDfree(outme); } -/* Let two sets of processes open and read different groups and chunked - * datasets independently. +/* Let two sets of processes open and read different groups and chunked + * datasets independently. */ void independent_group_read(void) { @@ -709,16 +709,16 @@ void independent_group_read(void) ngroups = pt->count; MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); - + plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs); fid = H5Fopen(filename, H5F_ACC_RDONLY, plist); H5Pclose(plist); - /* open groups and read datasets. Odd number processes read even number - * groups from the end; even number processes read odd number groups + /* open groups and read datasets. Odd number processes read even number + * groups from the end; even number processes read odd number groups * from the beginning. */ if(mpi_rank%2==0) { - for(m=ngroups-1; m==0; m-=2) + for(m=ngroups-1; m==0; m-=2) group_dataset_read(fid, mpi_rank, m); } else { for(m=0; m=0), "memspace"); - ret = H5Sselect_hyperslab(memspace, H5S_SELECT_SET, chunk_origin, + ret = H5Sselect_hyperslab(memspace, H5S_SELECT_SET, chunk_origin, chunk_dims, count, chunk_dims); VRFY((ret>=0), "mgroup memspace selection"); filespace = H5Screate_simple(DIM, file_dims, NULL); VRFY((filespace>=0), "filespace"); - ret = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, chunk_origin, + ret = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, chunk_origin, chunk_dims, count, chunk_dims); - VRFY((ret>=0), "mgroup filespace selection"); + VRFY((ret>=0), "mgroup filespace selection"); - /* creates ngroups groups under the root group, writes datasets in + /* creates ngroups groups under the root group, writes datasets in * parallel. */ for(m = 0; m < ngroups; m++) { sprintf(gname, "group%d", m); gid = H5Gcreate(fid, gname, 0); VRFY((gid > 0), gname); - /* create attribute for these groups. */ + /* create attribute for these groups. */ write_attribute(gid, is_group, m); - + if(m != 0) write_dataset(memspace, filespace, gid); @@ -883,13 +883,13 @@ void multiple_group_write(void) } #endif /* BARRIER_CHECKS */ } - + /* recursively creates subgroups under the first group. */ gid = H5Gopen(fid, "group0"); create_group_recursive(memspace, filespace, gid, 0); ret = H5Gclose(gid); VRFY((ret>=0), "H5Gclose"); - + ret = H5Sclose(filespace); VRFY((ret>=0), "H5Sclose"); ret = H5Sclose(memspace); @@ -898,7 +898,7 @@ void multiple_group_write(void) VRFY((ret>=0), "H5Fclose"); } -/* +/* * In a group, creates NDATASETS datasets. Each process writes a hyperslab * of a data array to the file. * @@ -907,7 +907,7 @@ void multiple_group_write(void) * to function with an arbitrary number of processors. * * JRM - 8/16/04 - */ + */ void write_dataset(hid_t memspace, hid_t filespace, hid_t gid) { int i, j, n, size; @@ -915,7 +915,7 @@ void write_dataset(hid_t memspace, hid_t filespace, hid_t gid) char dname[32]; DATATYPE * outme = NULL; hid_t did; - + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); @@ -926,7 +926,7 @@ void write_dataset(hid_t memspace, hid_t filespace, hid_t gid) for(n=0; n < NDATASET; n++) { sprintf(dname, "dataset%d", n); - did = H5Dcreate(gid, dname, H5T_NATIVE_INT, filespace, + did = H5Dcreate(gid, dname, H5T_NATIVE_INT, filespace, H5P_DEFAULT); VRFY((did > 0), dname); @@ -934,28 +934,28 @@ void write_dataset(hid_t memspace, hid_t filespace, hid_t gid) for(j=0; j < size; j++) outme[(i * size) + j] = n*1000 + mpi_rank; - H5Dwrite(did, H5T_NATIVE_INT, memspace, filespace, H5P_DEFAULT, + H5Dwrite(did, H5T_NATIVE_INT, memspace, filespace, H5P_DEFAULT, outme); /* create attribute for these datasets.*/ write_attribute(did, is_dset, n); - + H5Dclose(did); } HDfree(outme); } -/* +/* * Creates subgroups of depth GROUP_DEPTH recursively. Also writes datasets * in parallel in each group. */ -void create_group_recursive(hid_t memspace, hid_t filespace, hid_t gid, +void create_group_recursive(hid_t memspace, hid_t filespace, hid_t gid, int counter) -{ +{ hid_t child_gid; int mpi_rank; char gname[64]; - + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); #ifdef BARRIER_CHECKS @@ -964,23 +964,23 @@ void create_group_recursive(hid_t memspace, hid_t filespace, hid_t gid, MPI_Barrier(MPI_COMM_WORLD); } #endif /* BARRIER_CHECKS */ - - sprintf(gname, "%dth_child_group", counter+1); + + sprintf(gname, "%dth_child_group", counter+1); child_gid = H5Gcreate(gid, gname, 0); VRFY((child_gid > 0), gname); /* write datasets in parallel. */ - write_dataset(memspace, filespace, gid); + write_dataset(memspace, filespace, gid); - if( counter < GROUP_DEPTH ) + if( counter < GROUP_DEPTH ) create_group_recursive(memspace, filespace, child_gid, counter+1); H5Gclose(child_gid); } -/* +/* * This function is to verify the data from multiple group testing. It opens - * every dataset in every group and check their correctness. + * every dataset in every group and check their correctness. * * Changes: Updated function to use a dynamically calculated size, * instead of the old SIZE #define. This should allow it @@ -1022,22 +1022,22 @@ void multiple_group_read(void) H5Sselect_hyperslab(memspace, H5S_SELECT_SET, chunk_origin, chunk_dims, count, chunk_dims); filespace = H5Screate_simple(DIM, file_dims, NULL); - H5Sselect_hyperslab(filespace, H5S_SELECT_SET, chunk_origin, chunk_dims, + H5Sselect_hyperslab(filespace, H5S_SELECT_SET, chunk_origin, chunk_dims, count, chunk_dims); - + /* open every group under root group. */ for(m=0; m 0), gname); - + /* check the data. */ if(m != 0) if( (error_num = read_dataset(memspace, filespace, gid))>0) nerrors += error_num; - - /* check attribute.*/ - error_num = 0; + + /* check attribute.*/ + error_num = 0; if( (error_num = read_attribute(gid, is_group, m))>0 ) nerrors += error_num; @@ -1061,8 +1061,8 @@ void multiple_group_read(void) } -/* - * This function opens all the datasets in a certain, checks the data using +/* + * This function opens all the datasets in a certain, checks the data using * dataset_vrfy function. * * Changes: Updated function to use a dynamically calculated size, @@ -1094,12 +1094,12 @@ int read_dataset(hid_t memspace, hid_t filespace, hid_t gid) did = H5Dopen(gid, dname); VRFY((did>0), dname); - H5Dread(did, H5T_NATIVE_INT, memspace, filespace, H5P_DEFAULT, + H5Dread(did, H5T_NATIVE_INT, memspace, filespace, H5P_DEFAULT, indata); /* this is the original value */ for(i=0; i0 ) - vrfy_errors += attr_errors; - + vrfy_errors += attr_errors; + H5Dclose(did); } @@ -1121,11 +1121,11 @@ int read_dataset(hid_t memspace, hid_t filespace, hid_t gid) return vrfy_errors; } -/* - * This recursive function opens all the groups in vertical direction and +/* + * This recursive function opens all the groups in vertical direction and * checks the data. */ -void recursive_read_group(hid_t memspace, hid_t filespace, hid_t gid, +void recursive_read_group(hid_t memspace, hid_t filespace, hid_t gid, int counter) { hid_t child_gid; @@ -1134,7 +1134,7 @@ void recursive_read_group(hid_t memspace, hid_t filespace, hid_t gid, MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); #ifdef BARRIER_CHECKS - if((counter+1) % 10) + if((counter+1) % 10) MPI_Barrier(MPI_COMM_WORLD); #endif /* BARRIER_CHECKS */ @@ -1152,7 +1152,7 @@ void recursive_read_group(hid_t memspace, hid_t filespace, hid_t gid, /* Create and write attribute for a group or a dataset. For groups, attribute * is a scalar datum; for dataset, it is a one-dimensional array. - */ + */ void write_attribute(hid_t obj_id, int this_type, int num) { hid_t sid, aid; @@ -1161,7 +1161,7 @@ void write_attribute(hid_t obj_id, int this_type, int num) char attr_name[32]; MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); - + if(this_type == is_group) { sprintf(attr_name, "Group Attribute %d", num); sid = H5Screate(H5S_SCALAR); @@ -1176,7 +1176,7 @@ void write_attribute(hid_t obj_id, int this_type, int num) attr_data[i] = i; sid = H5Screate_simple(dspace_rank, dspace_dims, NULL); aid = H5Acreate(obj_id, attr_name, H5T_NATIVE_INT, sid, H5P_DEFAULT); - H5Awrite(aid, H5T_NATIVE_INT, attr_data); + H5Awrite(aid, H5T_NATIVE_INT, attr_data); H5Aclose(aid); H5Sclose(sid); } @@ -1190,21 +1190,21 @@ int read_attribute(hid_t obj_id, int this_type, int num) hsize_t group_block[2]={1,1}, dset_block[2]={1, 8}; int i, mpi_rank, in_num, in_data[8], out_data[8], vrfy_errors = 0; char attr_name[32]; - + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); - + if(this_type == is_group) { sprintf(attr_name, "Group Attribute %d", num); aid = H5Aopen_name(obj_id, attr_name); if(MAINPROCESS) { H5Aread(aid, H5T_NATIVE_INT, &in_num); - vrfy_errors = dataset_vrfy(NULL, NULL, NULL, group_block, + vrfy_errors = dataset_vrfy(NULL, NULL, NULL, group_block, &in_num, &num); } H5Aclose(aid); } else if(this_type == is_dset) { - sprintf(attr_name, "Dataset Attribute %d", num); + sprintf(attr_name, "Dataset Attribute %d", num); for(i=0; i<8; i++) out_data[i] = i; aid = H5Aopen_name(obj_id, attr_name); @@ -1214,12 +1214,12 @@ int read_attribute(hid_t obj_id, int this_type, int num) out_data); } H5Aclose(aid); - } - + } + return vrfy_errors; } -/* This functions compares the original data with the read-in data for its +/* This functions compares the original data with the read-in data for its * hyperslab part only by process ID. * * Changes: Modified function to use a passed in size parameter @@ -1228,7 +1228,7 @@ int read_attribute(hid_t obj_id, int this_type, int num) * * JRM - 8/16/04 */ -int check_value(DATATYPE *indata, DATATYPE *outdata, int size) +int check_value(DATATYPE *indata, DATATYPE *outdata, int size) { int mpi_rank, mpi_size, err_num=0; hsize_t i, j; @@ -1246,7 +1246,7 @@ int check_value(DATATYPE *indata, DATATYPE *outdata, int size) for(j=chunk_origin[1]; j<(chunk_origin[1]+chunk_dims[1]); j++) { if( *indata != *outdata ) if(err_num++ < MAX_ERR_REPORT || VERBOSE_MED) - printf("Dataset Verify failed at [%lu][%lu](row %lu, col%lu): expect %d, got %d\n", (unsigned long)i, (unsigned long)j, (unsigned long)i, (unsigned long)j, *outdata, *indata); + printf("Dataset Verify failed at [%lu][%lu](row %lu, col%lu): expect %d, got %d\n", (unsigned long)i, (unsigned long)j, (unsigned long)i, (unsigned long)j, *outdata, *indata); } if(err_num > MAX_ERR_REPORT && !VERBOSE_MED) printf("[more errors ...]\n"); @@ -1264,14 +1264,14 @@ int check_value(DATATYPE *indata, DATATYPE *outdata, int size) * JRM - 8/11/04 */ -void get_slab(hsize_t chunk_origin[], - hsize_t chunk_dims[], +void get_slab(hsize_t chunk_origin[], + hsize_t chunk_dims[], hsize_t count[], hsize_t file_dims[], int size) { int mpi_rank, mpi_size; - + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); @@ -1283,23 +1283,23 @@ void get_slab(hsize_t chunk_origin[], chunk_dims[0] = size/mpi_size; chunk_dims[1] = size; } - if(file_dims != NULL) + if(file_dims != NULL) file_dims[0] = file_dims[1] = size; - if(count != NULL) + if(count != NULL) count[0] = count[1] = 1; } -/* +/* * This function is based on bug demonstration code provided by Thomas - * Guignon (thomas.guignon@ifp.fr), and is intended to verify the + * Guignon (thomas.guignon@ifp.fr), and is intended to verify the * correctness of my fix for that bug. * - * In essence, the bug appeared when at least one process attempted to - * write a point selection -- for which collective I/O is not supported, - * and at least one other attempted to write some other type of selection - * for which collective I/O is supported. + * In essence, the bug appeared when at least one process attempted to + * write a point selection -- for which collective I/O is not supported, + * and at least one other attempted to write some other type of selection + * for which collective I/O is supported. * - * Since the processes did not compare notes before performing the I/O, + * Since the processes did not compare notes before performing the I/O, * some would attempt collective I/O while others performed independent * I/O. A hang resulted. * @@ -1317,7 +1317,7 @@ void io_mode_confusion(void) /* * HDF5 APIs definitions */ - + const int rank = 1; const char *dataset_name = "IntArray"; @@ -1325,7 +1325,7 @@ void io_mode_confusion(void) hid_t filespace, memspace; /* file and memory dataspace */ /* identifiers */ hsize_t dimsf[1]; /* dataset dimensions */ - int data[N] = {1}; /* pointer to data buffer to write */ + int data[N] = {1}; /* pointer to data buffer to write */ hsize_t coord[N] = {0L,1L,2L,3L}; hsize_t start[1]; hsize_t stride[1]; @@ -1363,7 +1363,7 @@ void io_mode_confusion(void) */ if ( verbose ) - HDfprintf(stdout, "%0d:%s: Setting up property list.\n", + HDfprintf(stdout, "%0d:%s: Setting up property list.\n", mpi_rank, fcn_name); plist_id = H5Pcreate(H5P_FILE_ACCESS); @@ -1426,7 +1426,7 @@ void io_mode_confusion(void) if ( verbose ) - HDfprintf(stdout, "%0d:%s: Calling H5Screate_simple().\n", + HDfprintf(stdout, "%0d:%s: Calling H5Screate_simple().\n", mpi_rank, fcn_name); memspace = H5Screate_simple(rank, dimsf, NULL); @@ -1435,7 +1435,7 @@ void io_mode_confusion(void) if( mpi_rank == 0 ) { - + if ( verbose ) HDfprintf(stdout, "%0d:%s: Calling H5Sselect_all(memspace).\n", mpi_rank, fcn_name); @@ -1453,19 +1453,19 @@ void io_mode_confusion(void) status = H5Sselect_none(memspace); VRFY(( status >= 0 ), "H5Sselect_none() failed"); - + } if ( verbose ) - HDfprintf(stdout, "%0d:%s: Calling MPI_Barrier().\n", + HDfprintf(stdout, "%0d:%s: Calling MPI_Barrier().\n", mpi_rank, fcn_name); MPI_Barrier(MPI_COMM_WORLD); if ( verbose ) - HDfprintf(stdout, "%0d:%s: Calling H5Dget_space().\n", + HDfprintf(stdout, "%0d:%s: Calling H5Dget_space().\n", mpi_rank, fcn_name); filespace = H5Dget_space(dset_id); @@ -1487,7 +1487,7 @@ void io_mode_confusion(void) "%0d:%s: Calling H5Sselect_elements() -- set up hang?\n", mpi_rank, fcn_name); - status = H5Sselect_elements(filespace, H5S_SELECT_SET, N, + status = H5Sselect_elements(filespace, H5S_SELECT_SET, N, (const hsize_t **)&coord); VRFY(( status >= 0 ), "H5Sselect_elements() failed"); @@ -1508,7 +1508,7 @@ void io_mode_confusion(void) if ( verbose ) - HDfprintf(stdout, "%0d:%s: Calling MPI_Barrier().\n", + HDfprintf(stdout, "%0d:%s: Calling MPI_Barrier().\n", mpi_rank, fcn_name); MPI_Barrier(MPI_COMM_WORLD); @@ -1523,7 +1523,7 @@ void io_mode_confusion(void) if ( verbose ) - HDfprintf(stdout, "%0d:%s: Calling H5Pset_dxpl_mpio().\n", + HDfprintf(stdout, "%0d:%s: Calling H5Pset_dxpl_mpio().\n", mpi_rank, fcn_name); status = H5Pset_dxpl_mpio(plist_id, H5FD_MPIO_COLLECTIVE); @@ -1539,7 +1539,7 @@ void io_mode_confusion(void) plist_id, data); if ( verbose ) - HDfprintf(stdout, "%0d:%s: Returned from H5Dwrite(), status=%d.\n", + HDfprintf(stdout, "%0d:%s: Returned from H5Dwrite(), status=%d.\n", mpi_rank, fcn_name, status); VRFY(( status >= 0 ), "H5Dwrite() failed"); @@ -1549,7 +1549,7 @@ void io_mode_confusion(void) */ if ( verbose ) - HDfprintf(stdout, "%0d:%s: Cleaning up from test.\n", + HDfprintf(stdout, "%0d:%s: Cleaning up from test.\n", mpi_rank, fcn_name); status = H5Dclose(dset_id); diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c index 7b7a96b..b98b3f0 100644 --- a/testpar/t_mpi.c +++ b/testpar/t_mpi.c @@ -99,7 +99,7 @@ test_mpio_overlap_writes(char *filename) mrc = MPI_File_write_at(fh, mpi_off, buf, (int)stride, MPI_BYTE, &mpi_stat); VRFY((mrc==MPI_SUCCESS), ""); - + /* move the offset pointer to last byte written by all processes */ mpi_off += (mpi_size - 1 - mpi_rank) * stride; @@ -116,7 +116,7 @@ test_mpio_overlap_writes(char *filename) VRFY((mrc==MPI_SUCCESS), "MPI_FILE_CLOSE"); mrc = MPI_Comm_free(&comm); VRFY((mrc==MPI_SUCCESS), "MPI_Comm_free"); - + /* sync with the other waiting processes */ mrc = MPI_Barrier(MPI_COMM_WORLD); VRFY((mrc==MPI_SUCCESS), "Sync after writes"); @@ -181,10 +181,10 @@ test_mpio_overlap_writes(char *filename) * Print any failure as information only, not as an error so that this * won't abort the remaining test or other separated tests. * - * Test if MPIO can write file from under 2GB to over 2GB and then + * Test if MPIO can write file from under 2GB to over 2GB and then * from under 4GB to over 4GB. * Each process writes 1MB in round robin fashion. - * Then reads the file back in by reverse order, that is process 0 + * Then reads the file back in by reverse order, that is process 0 * reads the data of process n-1 and vice versa. */ static int @@ -321,7 +321,7 @@ test_mpio_gb_file(char *filename) /* close file and free the communicator */ mrc = MPI_File_close(&fh); VRFY((mrc==MPI_SUCCESS), "MPI_FILE_CLOSE"); - + mrc = MPI_Barrier(MPI_COMM_WORLD); VRFY((mrc==MPI_SUCCESS), "Sync after writes"); @@ -419,7 +419,7 @@ test_mpio_1wMr(char *filename, int special_request) int mpi_err; unsigned char writedata[DIMSIZE], readdata[DIMSIZE]; unsigned char expect_val; - int i, irank; + int i, irank; int nerrs = 0; /* number of errors */ int atomicity; MPI_Offset mpi_off; diff --git a/testpar/t_ph5basic.c b/testpar/t_ph5basic.c index 0c92c46..187ef06 100644 --- a/testpar/t_ph5basic.c +++ b/testpar/t_ph5basic.c @@ -88,7 +88,7 @@ test_fapl_mpio_dup(void) VRFY((ret >= 0), ""); /* Case 1: - * Free the created communicator and INFO object. + * Free the created communicator and INFO object. * Check if the access property list is still valid and can return * valid communicator and INFO object. */ @@ -253,7 +253,7 @@ test_fapl_mpiposix_dup(void) VRFY((ret >= 0), ""); /* Case 1: - * Free the created communicator object. + * Free the created communicator object. * Check if the access property list is still valid and can return * valid communicator object. */ @@ -308,7 +308,7 @@ test_fapl_mpiposix_dup(void) VRFY((mpi_rank_tmp==mpi_rank), "MPI_Comm_rank"); /* Case 3: - * Close the property list and verify the retrieved communicator + * Close the property list and verify the retrieved communicator * object is still valid. */ H5Pclose(acc_pl); diff --git a/testpar/t_span_tree.c b/testpar/t_span_tree.c index 26f25bf..a632823 100644 --- a/testpar/t_span_tree.c +++ b/testpar/t_span_tree.c @@ -13,7 +13,7 @@ * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* +/* This program will test irregular hyperslab selections with collective write and read. The way to test whether collective write and read works is to use independent IO output to verify the collective output. @@ -24,15 +24,15 @@ 2) We will read two datasets with the same hyperslab selection settings, 1. independent read to read independent output, independent read to read collecive output, - Compare the result, + Compare the result, If the result is the same, then collective write succeeds. 2. collective read to read independent output, independent read to read independent output, Compare the result, If the result is the same, then collective read succeeds. - */ - + */ + #include "hdf5.h" #include "H5private.h" #include "testphdf5.h" @@ -45,7 +45,7 @@ static void coll_read_test(int chunk_factor); /*------------------------------------------------------------------------- * Function: coll_irregular_cont_write * - * Purpose: Test the collectively irregular hyperslab write in contiguous + * Purpose: Test the collectively irregular hyperslab write in contiguous storage * * Return: Success: 0 @@ -72,7 +72,7 @@ coll_irregular_cont_write(void) /*------------------------------------------------------------------------- * Function: coll_irregular_cont_read * - * Purpose: Test the collectively irregular hyperslab read in contiguous + * Purpose: Test the collectively irregular hyperslab read in contiguous storage * * Return: Success: 0 @@ -98,7 +98,7 @@ coll_irregular_cont_read(void) /*------------------------------------------------------------------------- * Function: coll_irregular_simple_chunk_write * - * Purpose: Test the collectively irregular hyperslab write in chunk + * Purpose: Test the collectively irregular hyperslab write in chunk storage(1 chunk) * * Return: Success: 0 @@ -125,7 +125,7 @@ coll_irregular_simple_chunk_write(void) /*------------------------------------------------------------------------- * Function: coll_irregular_simple_chunk_read * - * Purpose: Test the collectively irregular hyperslab read in chunk + * Purpose: Test the collectively irregular hyperslab read in chunk storage(1 chunk) * * Return: Success: 0 @@ -150,7 +150,7 @@ coll_irregular_simple_chunk_read(void) /*------------------------------------------------------------------------- * Function: coll_irregular_complex_chunk_write * - * Purpose: Test the collectively irregular hyperslab write in chunk + * Purpose: Test the collectively irregular hyperslab write in chunk storage(4 chunks) * * Return: Success: 0 @@ -177,7 +177,7 @@ coll_irregular_complex_chunk_write(void) /*------------------------------------------------------------------------- * Function: coll_irregular_complex_chunk_read * - * Purpose: Test the collectively irregular hyperslab read in chunk + * Purpose: Test the collectively irregular hyperslab read in chunk storage(1 chunk) * * Return: Success: 0 @@ -209,12 +209,12 @@ void coll_write_test(int chunk_factor) hid_t mspaceid1, mspaceid, fspaceid,fspaceid1; /* Dataspace identifiers */ hid_t plist; /* Dataset property list identifier */ - hsize_t mdim1[] = {MSPACE1_DIM}; /* Dimension size of the first dataset - (in memory) */ - - hsize_t fsdim[] = {FSPACE_DIM1, FSPACE_DIM2}; + hsize_t mdim1[] = {MSPACE1_DIM}; /* Dimension size of the first dataset + (in memory) */ + + hsize_t fsdim[] = {FSPACE_DIM1, FSPACE_DIM2}; /* Dimension sizes of the dataset (on disk) */ - hsize_t mdim[] = {MSPACE_DIM1, MSPACE_DIM2}; /* Dimension sizes of the + hsize_t mdim[] = {MSPACE_DIM1, MSPACE_DIM2}; /* Dimension sizes of the dataset in memory when we read selection from the dataset on the disk */ @@ -229,8 +229,8 @@ void coll_write_test(int chunk_factor) unsigned i,j; int fillvalue = 0; /* Fill value for the dataset */ - int matrix_out[MSPACE_DIM1][MSPACE_DIM2]; - int matrix_out1[MSPACE_DIM1][MSPACE_DIM2]; /* Buffer to read from the + int matrix_out[MSPACE_DIM1][MSPACE_DIM2]; + int matrix_out1[MSPACE_DIM1][MSPACE_DIM2]; /* Buffer to read from the dataset */ int vector[MSPACE1_DIM]; @@ -245,7 +245,7 @@ void coll_write_test(int chunk_factor) /* Obtain file name */ - filename = GetTestParameters(); + filename = GetTestParameters(); /* * Buffers' initialization. @@ -254,11 +254,11 @@ void coll_write_test(int chunk_factor) for (i = 1; i < MSPACE1_DIM - 1; i++) vector[i] = i; acc_plist = H5Pcreate(H5P_FILE_ACCESS); - VRFY((acc_plist >= 0),""); + VRFY((acc_plist >= 0),""); ret = H5Pset_fapl_mpio(acc_plist,comm,info); VRFY((ret >= 0),"MPIO creation property list succeeded"); - + /* * Create a file. */ @@ -271,7 +271,7 @@ void coll_write_test(int chunk_factor) plist = H5Pcreate(H5P_DATASET_CREATE); VRFY((acc_plist >= 0),""); - ret = H5Pset_fill_value(plist, H5T_NATIVE_INT, &fillvalue); + ret = H5Pset_fill_value(plist, H5T_NATIVE_INT, &fillvalue); VRFY((ret >= 0),"Fill value creation property list succeeded"); if(chunk_factor != 0) { @@ -281,7 +281,7 @@ void coll_write_test(int chunk_factor) ret = H5Pset_chunk(plist, 2, chunk_dims); VRFY((ret >= 0),"chunk creation property list succeeded"); } - /* + /* * Create dataspace for the dataset in the file. */ fspaceid = H5Screate_simple(FSPACE_RANK, fsdim, NULL); @@ -297,35 +297,35 @@ void coll_write_test(int chunk_factor) dataseti = H5Dcreate(file, "independ_write", H5T_NATIVE_INT, fspaceid, plist); VRFY((dataseti >= 0),"dataset created succeeded"); /* - * Select hyperslab for the dataset in the file, using 3x2 blocks, + * Select hyperslab for the dataset in the file, using 3x2 blocks, * (4,3) stride and (1,4) count starting at the position (0,1) for the first selection */ - start[0] = FHSTART0; + start[0] = FHSTART0; start[1] = FHSTART1+mpi_rank*FHSTRIDE1*FHCOUNT1/mpi_size; - stride[0] = FHSTRIDE0; + stride[0] = FHSTRIDE0; stride[1] = FHSTRIDE1; - count[0] = FHCOUNT0; - count[1] = FHCOUNT1/mpi_size; - block[0] = FHBLOCK0; + count[0] = FHCOUNT0; + count[1] = FHCOUNT1/mpi_size; + block[0] = FHBLOCK0; block[1] = FHBLOCK1; ret = H5Sselect_hyperslab(fspaceid, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0),"hyperslab selection succeeded"); /* - * Select hyperslab for the dataset in the file, using 3x2*4 blocks, + * Select hyperslab for the dataset in the file, using 3x2*4 blocks, * stride 1 and (1,1) count starting at the position (4,0). */ - start[0] = SHSTART0; + start[0] = SHSTART0; start[1] = SHSTART1+SHCOUNT1*SHBLOCK1*mpi_rank/mpi_size; - stride[0] = SHSTRIDE0; + stride[0] = SHSTRIDE0; stride[1] = SHSTRIDE1; - count[0] = SHCOUNT0; - count[1] = SHCOUNT1; - block[0] = SHBLOCK0; + count[0] = SHCOUNT0; + count[1] = SHCOUNT1; + block[0] = SHBLOCK0; block[1] = SHBLOCK1/mpi_size; ret = H5Sselect_hyperslab(fspaceid, H5S_SELECT_OR, start, stride, count, block); @@ -338,7 +338,7 @@ void coll_write_test(int chunk_factor) VRFY((mspaceid1 >= 0),"memory dataspace created succeeded"); /* - * Select hyperslab. + * Select hyperslab. * We will use 48 elements of the vector buffer starting at the second element. * Selected elements are 1 2 3 . . . 48 */ @@ -350,26 +350,26 @@ void coll_write_test(int chunk_factor) ret = H5Sselect_hyperslab(mspaceid1, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0),"hyperslab selection succeeded"); - + ret = H5Dwrite(dataseti, H5T_NATIVE_INT, mspaceid1, fspaceid, H5P_DEFAULT, vector); VRFY((ret >= 0),"dataset independent write succeed"); xfer_plist = H5Pcreate(H5P_DATASET_XFER); - VRFY((xfer_plist >= 0),""); + VRFY((xfer_plist >= 0),""); ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); - VRFY((ret >= 0),"MPIO data transfer property list succeed"); + VRFY((ret >= 0),"MPIO data transfer property list succeed"); ret = H5Dwrite(datasetc, H5T_NATIVE_INT, mspaceid1, fspaceid, xfer_plist, vector); /*ret = H5Dwrite(datasetc, H5T_NATIVE_INT, mspaceid1, fspaceid, H5P_DEFAULT, vector);*/ - VRFY((ret >= 0),"dataset collective write succeed"); + VRFY((ret >= 0),"dataset collective write succeed"); ret = H5Sclose(mspaceid1); VRFY((ret >= 0),""); - ret = H5Sclose(fspaceid); + ret = H5Sclose(fspaceid); VRFY((ret >= 0),""); - + /* * Close dataset. */ @@ -377,7 +377,7 @@ void coll_write_test(int chunk_factor) VRFY((ret >= 0),""); ret = H5Dclose(dataseti); VRFY((ret >= 0),""); - + /* * Close the file. */ @@ -401,11 +401,11 @@ void coll_write_test(int chunk_factor) /*** For testing collective hyperslab selection write ***/ acc_plist = H5Pcreate(H5P_FILE_ACCESS); - VRFY((acc_plist >= 0),""); + VRFY((acc_plist >= 0),""); ret = H5Pset_fapl_mpio(acc_plist,comm,info); VRFY((ret >= 0),"MPIO creation property list succeeded"); - + file = H5Fopen(filename, H5F_ACC_RDONLY, acc_plist); VRFY((file >= 0),"H5Fopen succeeded"); @@ -416,8 +416,8 @@ void coll_write_test(int chunk_factor) VRFY((datasetc >= 0),"H5Dopen succeeded"); dataseti = H5Dopen(file,"independ_write"); VRFY((dataseti >= 0),"H5Dopen succeeded"); - - /* + + /* * Get dataspace of the open dataset. */ fspaceid = H5Dget_space(datasetc); @@ -427,16 +427,16 @@ void coll_write_test(int chunk_factor) VRFY((fspaceid1 >= 0),"file dataspace obtained succeeded"); - - start[0] = RFFHSTART0; + + start[0] = RFFHSTART0; start[1] = RFFHSTART1+mpi_rank*RFFHCOUNT1/mpi_size; - block[0] = RFFHBLOCK0; + block[0] = RFFHBLOCK0; block[1] = RFFHBLOCK1; - stride[0] = RFFHSTRIDE0; + stride[0] = RFFHSTRIDE0; stride[1] = RFFHSTRIDE1; - count[0] = RFFHCOUNT0; - count[1] = RFFHCOUNT1/mpi_size; - + count[0] = RFFHCOUNT0; + count[1] = RFFHCOUNT1/mpi_size; + ret = H5Sselect_hyperslab(fspaceid, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0),"hyperslab selection succeeded"); @@ -445,13 +445,13 @@ void coll_write_test(int chunk_factor) /*start[0] = RFSHSTART0+mpi_rank*RFSHCOUNT1/mpi_size; */ start[0] = RFSHSTART0; - start[1] = RFSHSTART1+RFSHCOUNT1*mpi_rank/mpi_size; - block[0] = RFSHBLOCK0; - block[1] = RFSHBLOCK1; - stride[0] = RFSHSTRIDE0; + start[1] = RFSHSTART1+RFSHCOUNT1*mpi_rank/mpi_size; + block[0] = RFSHBLOCK0; + block[1] = RFSHBLOCK1; + stride[0] = RFSHSTRIDE0; stride[1] = RFSHSTRIDE0; - count[0] = RFSHCOUNT0; - count[1] = RFSHCOUNT1/mpi_size; + count[0] = RFSHCOUNT0; + count[1] = RFSHCOUNT1/mpi_size; ret = H5Sselect_hyperslab(fspaceid, H5S_SELECT_OR, start, stride, count, block); VRFY((ret >= 0),"hyperslab selection succeeded"); ret = H5Sselect_hyperslab(fspaceid1, H5S_SELECT_OR, start, stride, count, block); @@ -463,60 +463,60 @@ void coll_write_test(int chunk_factor) */ mspaceid = H5Screate_simple(MSPACE_RANK, mdim, NULL); - /* + /* * Select two hyperslabs in memory. Hyperslabs has the same * size and shape as the selected hyperslabs for the file dataspace. */ - start[0] = RMFHSTART0; + start[0] = RMFHSTART0; start[1] = RMFHSTART1+mpi_rank*RMFHCOUNT1/mpi_size; - block[0] = RMFHBLOCK0; + block[0] = RMFHBLOCK0; block[1] = RMFHBLOCK1; - stride[0] = RMFHSTRIDE0; + stride[0] = RMFHSTRIDE0; stride[1] = RMFHSTRIDE1; - count[0] = RMFHCOUNT0; - count[1] = RMFHCOUNT1/mpi_size; + count[0] = RMFHCOUNT0; + count[1] = RMFHCOUNT1/mpi_size; ret = H5Sselect_hyperslab(mspaceid, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0),"hyperslab selection succeeded"); - start[0] = RMSHSTART0; + start[0] = RMSHSTART0; start[1] = RMSHSTART1+mpi_rank*RMSHCOUNT1/mpi_size; - block[0] = RMSHBLOCK0; + block[0] = RMSHBLOCK0; block[1] = RMSHBLOCK1; - stride[0] = RMSHSTRIDE0; + stride[0] = RMSHSTRIDE0; stride[1] = RMSHSTRIDE1; - count[0] = RMSHCOUNT0; - count[1] = RMSHCOUNT1/mpi_size; + count[0] = RMSHCOUNT0; + count[1] = RMSHCOUNT1/mpi_size; + - ret = H5Sselect_hyperslab(mspaceid, H5S_SELECT_OR, start, stride, count, block); - VRFY((ret >= 0),"hyperslab selection succeeded"); + VRFY((ret >= 0),"hyperslab selection succeeded"); - /* + /* * Initialize data buffer. */ for (i = 0; i < MSPACE_DIM1; i++) { for (j = 0; j < MSPACE_DIM2; j++) matrix_out[i][j] = 0; } - + /* * Read data back to the buffer matrix_out. */ ret = H5Dread(datasetc, H5T_NATIVE_INT, mspaceid, fspaceid, H5P_DEFAULT, matrix_out); - VRFY((ret >= 0),"H5D independent read succeed"); + VRFY((ret >= 0),"H5D independent read succeed"); + - for (i = 0; i < MSPACE_DIM1; i++) { for (j = 0; j < MSPACE_DIM2; j++) matrix_out1[i][j] = 0; } ret = H5Dread(dataseti, H5T_NATIVE_INT, mspaceid, fspaceid, H5P_DEFAULT, matrix_out1); - VRFY((ret >= 0),"H5D independent read succeed"); + VRFY((ret >= 0),"H5D independent read succeed"); ret = 0; for (i = 0; i < MSPACE_DIM1; i++){ @@ -525,37 +525,37 @@ void coll_write_test(int chunk_factor) if(ret < 0) break; } } - VRFY((ret >= 0),"H5D contiguous irregular collective write succeed"); - + VRFY((ret >= 0),"H5D contiguous irregular collective write succeed"); + /* * Close memory file and memory dataspaces. - */ + */ ret = H5Sclose(mspaceid); - VRFY((ret >= 0),""); + VRFY((ret >= 0),""); ret = H5Sclose(fspaceid); - VRFY((ret >= 0),""); - + VRFY((ret >= 0),""); + /* * Close dataset. - */ + */ ret = H5Dclose(dataseti); - VRFY((ret >= 0),""); + VRFY((ret >= 0),""); ret = H5Dclose(datasetc); - VRFY((ret >= 0),""); + VRFY((ret >= 0),""); /* * Close property list */ ret = H5Pclose(acc_plist); - VRFY((ret >= 0),""); + VRFY((ret >= 0),""); + - /* * Close the file. - */ + */ ret = H5Fclose(file); - VRFY((ret >= 0),""); + VRFY((ret >= 0),""); return ; } @@ -568,9 +568,9 @@ void coll_read_test(int chunk_factor) hid_t acc_plist,xfer_plist; hid_t file, dataseti; /* File and dataset identifiers */ hid_t mspaceid, fspaceid1; /* Dataspace identifiers */ - + /* Dimension sizes of the dataset (on disk) */ - hsize_t mdim[] = {MSPACE_DIM1, MSPACE_DIM2}; /* Dimension sizes of the + hsize_t mdim[] = {MSPACE_DIM1, MSPACE_DIM2}; /* Dimension sizes of the dataset in memory when we read selection from the dataset on the disk */ @@ -583,8 +583,8 @@ void coll_read_test(int chunk_factor) herr_t ret; unsigned i,j; - int matrix_out[MSPACE_DIM1][MSPACE_DIM2]; - int matrix_out1[MSPACE_DIM1][MSPACE_DIM2]; /* Buffer to read from the + int matrix_out[MSPACE_DIM1][MSPACE_DIM2]; + int matrix_out1[MSPACE_DIM1][MSPACE_DIM2]; /* Buffer to read from the dataset */ int mpi_size,mpi_rank; @@ -598,7 +598,7 @@ void coll_read_test(int chunk_factor) /* Obtain file name */ - filename = GetTestParameters(); + filename = GetTestParameters(); /* * Buffers' initialization. @@ -611,11 +611,11 @@ void coll_read_test(int chunk_factor) /*** For testing collective hyperslab selection read ***/ acc_plist = H5Pcreate(H5P_FILE_ACCESS); - VRFY((acc_plist >= 0),""); + VRFY((acc_plist >= 0),""); ret = H5Pset_fapl_mpio(acc_plist,comm,info); VRFY((ret >= 0),"MPIO creation property list succeeded"); - + file = H5Fopen(filename, H5F_ACC_RDONLY, acc_plist); VRFY((file >= 0),"H5Fopen succeeded"); @@ -624,34 +624,34 @@ void coll_read_test(int chunk_factor) */ dataseti = H5Dopen(file,"independ_write"); VRFY((dataseti >= 0),"H5Dopen succeeded"); - - /* + + /* * Get dataspace of the open dataset. */ fspaceid1 = H5Dget_space(dataseti); VRFY((fspaceid1 >= 0),"file dataspace obtained succeeded"); - start[0] = RFFHSTART0; + start[0] = RFFHSTART0; start[1] = RFFHSTART1+mpi_rank*RFFHCOUNT1/mpi_size; - block[0] = RFFHBLOCK0; + block[0] = RFFHBLOCK0; block[1] = RFFHBLOCK1; - stride[0] = RFFHSTRIDE0; + stride[0] = RFFHSTRIDE0; stride[1] = RFFHSTRIDE1; - count[0] = RFFHCOUNT0; - count[1] = RFFHCOUNT1/mpi_size; - + count[0] = RFFHCOUNT0; + count[1] = RFFHCOUNT1/mpi_size; + ret = H5Sselect_hyperslab(fspaceid1, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0),"hyperslab selection succeeded"); start[0] = RFSHSTART0; - start[1] = RFSHSTART1+RFSHCOUNT1*mpi_rank/mpi_size; - block[0] = RFSHBLOCK0; - block[1] = RFSHBLOCK1; - stride[0] = RFSHSTRIDE0; + start[1] = RFSHSTART1+RFSHCOUNT1*mpi_rank/mpi_size; + block[0] = RFSHBLOCK0; + block[1] = RFSHBLOCK1; + stride[0] = RFSHSTRIDE0; stride[1] = RFSHSTRIDE0; - count[0] = RFSHCOUNT0; + count[0] = RFSHCOUNT0; count[1] = RFSHCOUNT1/mpi_size; ret = H5Sselect_hyperslab(fspaceid1, H5S_SELECT_OR, start, stride, count, block); @@ -663,58 +663,58 @@ void coll_read_test(int chunk_factor) */ mspaceid = H5Screate_simple(MSPACE_RANK, mdim, NULL); - /* + /* * Select two hyperslabs in memory. Hyperslabs has the same * size and shape as the selected hyperslabs for the file dataspace. */ - start[0] = RMFHSTART0; + start[0] = RMFHSTART0; start[1] = RMFHSTART1+mpi_rank*RMFHCOUNT1/mpi_size; - block[0] = RMFHBLOCK0; + block[0] = RMFHBLOCK0; block[1] = RMFHBLOCK1; - stride[0] = RMFHSTRIDE0; + stride[0] = RMFHSTRIDE0; stride[1] = RMFHSTRIDE1; - count[0] = RMFHCOUNT0; - count[1] = RMFHCOUNT1/mpi_size; + count[0] = RMFHCOUNT0; + count[1] = RMFHCOUNT1/mpi_size; ret = H5Sselect_hyperslab(mspaceid, H5S_SELECT_SET, start, stride, count, block); VRFY((ret >= 0),"hyperslab selection succeeded"); - start[0] = RMSHSTART0; + start[0] = RMSHSTART0; start[1] = RMSHSTART1+mpi_rank*RMSHCOUNT1/mpi_size; - block[0] = RMSHBLOCK0; + block[0] = RMSHBLOCK0; block[1] = RMSHBLOCK1; - stride[0] = RMSHSTRIDE0; + stride[0] = RMSHSTRIDE0; stride[1] = RMSHSTRIDE1; - count[0] = RMSHCOUNT0; - count[1] = RMSHCOUNT1/mpi_size; + count[0] = RMSHCOUNT0; + count[1] = RMSHCOUNT1/mpi_size; ret = H5Sselect_hyperslab(mspaceid, H5S_SELECT_OR, start, stride, count, block); - VRFY((ret >= 0),"hyperslab selection succeeded"); + VRFY((ret >= 0),"hyperslab selection succeeded"); - /* + /* * Initialize data buffer. */ for (i = 0; i < MSPACE_DIM1; i++) { for (j = 0; j < MSPACE_DIM2; j++) matrix_out[i][j] = 0; } - + /* * Read data back to the buffer matrix_out. */ xfer_plist = H5Pcreate(H5P_DATASET_XFER); - VRFY((xfer_plist >= 0),""); + VRFY((xfer_plist >= 0),""); ret = H5Pset_dxpl_mpio(xfer_plist, H5FD_MPIO_COLLECTIVE); - VRFY((ret >= 0),"MPIO data transfer property list succeed"); + VRFY((ret >= 0),"MPIO data transfer property list succeed"); ret = H5Dread(dataseti, H5T_NATIVE_INT, mspaceid, fspaceid1, xfer_plist, matrix_out); - VRFY((ret >= 0),"H5D collecive read succeed"); + VRFY((ret >= 0),"H5D collecive read succeed"); ret = H5Pclose(xfer_plist); - VRFY((ret >= 0),""); - + VRFY((ret >= 0),""); + for (i = 0; i < MSPACE_DIM1; i++) { for (j = 0; j < MSPACE_DIM2; j++) matrix_out1[i][j] = 0; @@ -722,7 +722,7 @@ void coll_read_test(int chunk_factor) ret = H5Dread(dataseti, H5T_NATIVE_INT, mspaceid, fspaceid1, H5P_DEFAULT, matrix_out1); - VRFY((ret >= 0),"H5D independent read succeed"); + VRFY((ret >= 0),"H5D independent read succeed"); ret = 0; for (i = 0; i < MSPACE_DIM1; i++){ for (j = 0; j < MSPACE_DIM2; j++){ @@ -730,33 +730,33 @@ void coll_read_test(int chunk_factor) if(ret < 0) break; } } - VRFY((ret >= 0),"H5D contiguous irregular collective read succeed"); + VRFY((ret >= 0),"H5D contiguous irregular collective read succeed"); /* * Close memory file and memory dataspaces. - */ + */ ret = H5Sclose(mspaceid); - VRFY((ret >= 0),""); + VRFY((ret >= 0),""); ret = H5Sclose(fspaceid1); - VRFY((ret >= 0),""); - + VRFY((ret >= 0),""); + /* * Close dataset. - */ + */ ret = H5Dclose(dataseti); - VRFY((ret >= 0),""); + VRFY((ret >= 0),""); /* * Close property list */ ret = H5Pclose(acc_plist); - VRFY((ret >= 0),""); + VRFY((ret >= 0),""); + - /* * Close the file. - */ + */ ret = H5Fclose(file); - VRFY((ret >= 0),""); + VRFY((ret >= 0),""); return ; } diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c index e3d2b24..6786032 100644 --- a/testpar/testphdf5.c +++ b/testpar/testphdf5.c @@ -70,7 +70,7 @@ void pause_proc(void) /* mpi variables */ int mpi_size, mpi_rank; - int mpi_namelen; + int mpi_namelen; char mpi_name[MPI_MAX_PROCESSOR_NAME]; pid = getpid(); @@ -113,7 +113,7 @@ usage(void) printf("\t-m" "\tset number of datasets for the multiple dataset test\n"); printf("\t-n" - "\tset number of groups for the multiple group test\n"); + "\tset number of groups for the multiple group test\n"); printf("\t-f \tfilename prefix\n"); printf("\t-2\t\tuse Split-file together with MPIO\n"); printf("\t-p\t\tuse combo MPI-POSIX driver\n"); @@ -269,7 +269,7 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type, if (l_facc_type == FACC_MPIO){ /* set Parallel access with communicator */ - ret = H5Pset_fapl_mpio(ret_pl, comm, info); + ret = H5Pset_fapl_mpio(ret_pl, comm, info); VRFY((ret >= 0), ""); return(ret_pl); } @@ -280,7 +280,7 @@ create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type, mpio_pl = H5Pcreate (H5P_FILE_ACCESS); VRFY((mpio_pl >= 0), ""); /* set Parallel access with communicator */ - ret = H5Pset_fapl_mpio(mpio_pl, comm, info); + ret = H5Pset_fapl_mpio(mpio_pl, comm, info); VRFY((ret >= 0), ""); /* setup file access template */ @@ -357,66 +357,66 @@ int main(int argc, char **argv) TestInit(argv[0], usage, parse_options); /* Tests are generally arranged from least to most complexity... */ - AddTest("mpiodup", test_fapl_mpio_dup, NULL, + AddTest("mpiodup", test_fapl_mpio_dup, NULL, "fapl_mpio duplicate", NULL); - AddTest("posixdup", test_fapl_mpiposix_dup, NULL, + AddTest("posixdup", test_fapl_mpiposix_dup, NULL, "fapl_mpiposix duplicate", NULL); - AddTest("split", test_split_comm_access, NULL, + AddTest("split", test_split_comm_access, NULL, "dataset using split communicators", PARATESTFILE); - AddTest("idsetw", dataset_writeInd, NULL, + AddTest("idsetw", dataset_writeInd, NULL, "dataset independent write", PARATESTFILE); - AddTest("idsetr", dataset_readInd, NULL, + AddTest("idsetr", dataset_readInd, NULL, "dataset independent read", PARATESTFILE); - AddTest("cdsetw", dataset_writeAll, NULL, + AddTest("cdsetw", dataset_writeAll, NULL, "dataset collective write", PARATESTFILE); - AddTest("cdsetr", dataset_readAll, NULL, + AddTest("cdsetr", dataset_readAll, NULL, "dataset collective read", PARATESTFILE); - AddTest("eidsetw", extend_writeInd, NULL, + AddTest("eidsetw", extend_writeInd, NULL, "extendible dataset independent write", PARATESTFILE); - AddTest("eidsetr", extend_readInd, NULL, + AddTest("eidsetr", extend_readInd, NULL, "extendible dataset independent read", PARATESTFILE); - AddTest("ecdsetw", extend_writeAll, NULL, + AddTest("ecdsetw", extend_writeAll, NULL, "extendible dataset collective write", PARATESTFILE); - AddTest("ecdsetr", extend_readAll, NULL, + AddTest("ecdsetr", extend_readAll, NULL, "extendible dataset collective read", PARATESTFILE); - AddTest("eidsetw2", extend_writeInd2, NULL, + AddTest("eidsetw2", extend_writeInd2, NULL, "extendible dataset independent write #2", PARATESTFILE); #ifdef H5_HAVE_FILTER_DEFLATE - AddTest("cmpdsetr", compress_readAll, NULL, + AddTest("cmpdsetr", compress_readAll, NULL, "compressed dataset collective read", PARATESTFILE); #endif /* H5_HAVE_FILTER_DEFLATE */ ndsets_params.name = PARATESTFILE; ndsets_params.count = ndatasets; - AddTest("ndsetw", multiple_dset_write, NULL, + AddTest("ndsetw", multiple_dset_write, NULL, "multiple datasets write", &ndsets_params); ngroups_params.name = PARATESTFILE; ngroups_params.count = ngroups; - AddTest("ngrpw", multiple_group_write, NULL, + AddTest("ngrpw", multiple_group_write, NULL, "multiple groups write", &ngroups_params); - AddTest("ngrpr", multiple_group_read, NULL, + AddTest("ngrpr", multiple_group_read, NULL, "multiple groups read", &ngroups_params); - AddTest("compact", compact_dataset, NULL, + AddTest("compact", compact_dataset, NULL, "compact dataset test", PARATESTFILE); collngroups_params.name = PARATESTFILE; collngroups_params.count = ngroups; - AddTest("cngrpw", collective_group_write, NULL, + AddTest("cngrpw", collective_group_write, NULL, "collective group and dataset write", &collngroups_params); - AddTest("ingrpr", independent_group_read, NULL, + AddTest("ingrpr", independent_group_read, NULL, "independent group and dataset read", &collngroups_params); /* By default, do not run big dataset. */ - AddTest("-bigdset", big_dataset, NULL, + AddTest("-bigdset", big_dataset, NULL, "big dataset test", PARATESTFILE); - AddTest("fill", dataset_fillvalue, NULL, + AddTest("fill", dataset_fillvalue, NULL, "dataset fill value", PARATESTFILE); if(mpi_size > 64) { @@ -439,7 +439,7 @@ int main(int argc, char **argv) "collective to independent chunk io",PARATESTFILE); } -#ifdef KYANG +#ifdef KYANG AddTest("ccontw",coll_irregular_cont_write,NULL, "collective irregular contiguous write",PARATESTFILE); AddTest("ccontr",coll_irregular_cont_read,NULL, @@ -460,8 +460,8 @@ int main(int argc, char **argv) io_mode_confusion_params.name = PARATESTFILE; io_mode_confusion_params.count = 0; /* value not used */ - AddTest("I/Omodeconf", io_mode_confusion, NULL, - "I/O mode confusion test -- hangs quickly on failure", + AddTest("I/Omodeconf", io_mode_confusion, NULL, + "I/O mode confusion test -- hangs quickly on failure", &io_mode_confusion_params); /* Display testing information */ diff --git a/testpar/testphdf5.h b/testpar/testphdf5.h index 9121ef3..a71e37d 100644 --- a/testpar/testphdf5.h +++ b/testpar/testphdf5.h @@ -122,94 +122,94 @@ /*Constants for MPI derived data type generated from span tree */ -#define MSPACE1_RANK 1 /* Rank of the first dataset in memory */ -#define MSPACE1_DIM 19000 /* Dataset size in memory */ -#define FSPACE_RANK 2 /* Dataset rank as it is stored in the file */ -#define FSPACE_DIM1 9 /* Dimension sizes of the dataset as it is stored in the file */ -#define FSPACE_DIM2 2400 /* We will read dataset back from the file to the dataset in memory with these dataspace parameters. */ -#define MSPACE_RANK 2 -#define MSPACE_DIM1 9 -#define MSPACE_DIM2 2400 -#define FHCOUNT0 1 /* Count of the first dimension of the first hyperslab selection*/ -#define FHCOUNT1 512 /* Count of the second dimension of the first hyperslab selection*/ -#define FHSTRIDE0 4 /* Stride of the first dimension of the first hyperslab selection*/ -#define FHSTRIDE1 3 /* Stride of the second dimension of the first hyperslab selection*/ -#define FHBLOCK0 3 /* Block of the first dimension of the first hyperslab selection*/ -#define FHBLOCK1 2 /* Block of the second dimension of the first hyperslab selection*/ -#define FHSTART0 0 /* start of the first dimension of the first hyperslab selection*/ -#define FHSTART1 1 /* start of the second dimension of the first hyperslab selection*/ - -#define SHCOUNT0 1 /* Count of the first dimension of the first hyperslab selection*/ -#define SHCOUNT1 1 /* Count of the second dimension of the first hyperslab selection*/ -#define SHSTRIDE0 1 /* Stride of the first dimension of the first hyperslab selection*/ -#define SHSTRIDE1 1 /* Stride of the second dimension of the first hyperslab selection*/ -#define SHBLOCK0 3 /* Block of the first dimension of the first hyperslab selection*/ -#define SHBLOCK1 512 /* Block of the second dimension of the first hyperslab selection*/ -#define SHSTART0 4 /* start of the first dimension of the first hyperslab selection*/ -#define SHSTART1 0 /* start of the second dimension of the first hyperslab selection*/ - -#define MHCOUNT0 4608 /* Count of the first dimension of the first hyperslab selection*/ -#define MHSTRIDE0 1 /* Stride of the first dimension of the first hyperslab selection*/ -#define MHBLOCK0 1 /* Block of the first dimension of the first hyperslab selection*/ -#define MHSTART0 1 /* start of the first dimension of the first hyperslab selection*/ - - - -#define RFFHCOUNT0 3 /* Count of the first dimension of the first hyperslab selection*/ -#define RFFHCOUNT1 512 /* Count of the second dimension of the first hyperslab selection*/ -#define RFFHSTRIDE0 1 /* Stride of the first dimension of the first hyperslab selection*/ -#define RFFHSTRIDE1 1 /* Stride of the second dimension of the first hyperslab selection*/ -#define RFFHBLOCK0 1 /* Block of the first dimension of the first hyperslab selection*/ -#define RFFHBLOCK1 1 /* Block of the second dimension of the first hyperslab selection*/ -#define RFFHSTART0 1 /* start of the first dimension of the first hyperslab selection*/ -#define RFFHSTART1 2 /* start of the second dimension of the first hyperslab selection*/ - - -#define RFSHCOUNT0 3 /* Count of the first dimension of the first hyperslab selection*/ -#define RFSHCOUNT1 1024 /* Count of the second dimension of the first hyperslab selection*/ -#define RFSHSTRIDE0 1 /* Stride of the first dimension of the first hyperslab selection*/ -#define RFSHSTRIDE1 1 /* Stride of the second dimension of the first hyperslab selection*/ -#define RFSHBLOCK0 1 /* Block of the first dimension of the first hyperslab selection*/ -#define RFSHBLOCK1 1 /* Block of the second dimension of the first hyperslab selection*/ -#define RFSHSTART0 2 /* start of the first dimension of the first hyperslab selection*/ -#define RFSHSTART1 4 /* start of the second dimension of the first hyperslab selection*/ - - -#define RMFHCOUNT0 3 /* Count of the first dimension of the first hyperslab selection*/ -#define RMFHCOUNT1 512 /* Count of the second dimension of the first hyperslab selection*/ -#define RMFHSTRIDE0 1 /* Stride of the first dimension of the first hyperslab selection*/ -#define RMFHSTRIDE1 1 /* Stride of the second dimension of the first hyperslab selection*/ -#define RMFHBLOCK0 1 /* Block of the first dimension of the first hyperslab selection*/ -#define RMFHBLOCK1 1 /* Block of the second dimension of the first hyperslab selection*/ -#define RMFHSTART0 0 /* start of the first dimension of the first hyperslab selection*/ -#define RMFHSTART1 0 /* start of the second dimension of the first hyperslab selection*/ - -#define RMSHCOUNT0 3 /* Count of the first dimension of the first hyperslab selection*/ -#define RMSHCOUNT1 1024 /* Count of the second dimension of the first hyperslab selection*/ -#define RMSHSTRIDE0 1 /* Stride of the first dimension of the first hyperslab selection*/ -#define RMSHSTRIDE1 1 /* Stride of the second dimension of the first hyperslab selection*/ -#define RMSHBLOCK0 1 /* Block of the first dimension of the first hyperslab selection*/ -#define RMSHBLOCK1 1 /* Block of the second dimension of the first hyperslab selection*/ -#define RMSHSTART0 1 /* start of the first dimension of the first hyperslab selection*/ -#define RMSHSTART1 2 /* start of the second dimension of the first hyperslab selection*/ - - -#define NPOINTS 4 /* Number of points that will be selected - and overwritten */ +#define MSPACE1_RANK 1 /* Rank of the first dataset in memory */ +#define MSPACE1_DIM 19000 /* Dataset size in memory */ +#define FSPACE_RANK 2 /* Dataset rank as it is stored in the file */ +#define FSPACE_DIM1 9 /* Dimension sizes of the dataset as it is stored in the file */ +#define FSPACE_DIM2 2400 /* We will read dataset back from the file to the dataset in memory with these dataspace parameters. */ +#define MSPACE_RANK 2 +#define MSPACE_DIM1 9 +#define MSPACE_DIM2 2400 +#define FHCOUNT0 1 /* Count of the first dimension of the first hyperslab selection*/ +#define FHCOUNT1 512 /* Count of the second dimension of the first hyperslab selection*/ +#define FHSTRIDE0 4 /* Stride of the first dimension of the first hyperslab selection*/ +#define FHSTRIDE1 3 /* Stride of the second dimension of the first hyperslab selection*/ +#define FHBLOCK0 3 /* Block of the first dimension of the first hyperslab selection*/ +#define FHBLOCK1 2 /* Block of the second dimension of the first hyperslab selection*/ +#define FHSTART0 0 /* start of the first dimension of the first hyperslab selection*/ +#define FHSTART1 1 /* start of the second dimension of the first hyperslab selection*/ + +#define SHCOUNT0 1 /* Count of the first dimension of the first hyperslab selection*/ +#define SHCOUNT1 1 /* Count of the second dimension of the first hyperslab selection*/ +#define SHSTRIDE0 1 /* Stride of the first dimension of the first hyperslab selection*/ +#define SHSTRIDE1 1 /* Stride of the second dimension of the first hyperslab selection*/ +#define SHBLOCK0 3 /* Block of the first dimension of the first hyperslab selection*/ +#define SHBLOCK1 512 /* Block of the second dimension of the first hyperslab selection*/ +#define SHSTART0 4 /* start of the first dimension of the first hyperslab selection*/ +#define SHSTART1 0 /* start of the second dimension of the first hyperslab selection*/ + +#define MHCOUNT0 4608 /* Count of the first dimension of the first hyperslab selection*/ +#define MHSTRIDE0 1 /* Stride of the first dimension of the first hyperslab selection*/ +#define MHBLOCK0 1 /* Block of the first dimension of the first hyperslab selection*/ +#define MHSTART0 1 /* start of the first dimension of the first hyperslab selection*/ + + + +#define RFFHCOUNT0 3 /* Count of the first dimension of the first hyperslab selection*/ +#define RFFHCOUNT1 512 /* Count of the second dimension of the first hyperslab selection*/ +#define RFFHSTRIDE0 1 /* Stride of the first dimension of the first hyperslab selection*/ +#define RFFHSTRIDE1 1 /* Stride of the second dimension of the first hyperslab selection*/ +#define RFFHBLOCK0 1 /* Block of the first dimension of the first hyperslab selection*/ +#define RFFHBLOCK1 1 /* Block of the second dimension of the first hyperslab selection*/ +#define RFFHSTART0 1 /* start of the first dimension of the first hyperslab selection*/ +#define RFFHSTART1 2 /* start of the second dimension of the first hyperslab selection*/ + + +#define RFSHCOUNT0 3 /* Count of the first dimension of the first hyperslab selection*/ +#define RFSHCOUNT1 1024 /* Count of the second dimension of the first hyperslab selection*/ +#define RFSHSTRIDE0 1 /* Stride of the first dimension of the first hyperslab selection*/ +#define RFSHSTRIDE1 1 /* Stride of the second dimension of the first hyperslab selection*/ +#define RFSHBLOCK0 1 /* Block of the first dimension of the first hyperslab selection*/ +#define RFSHBLOCK1 1 /* Block of the second dimension of the first hyperslab selection*/ +#define RFSHSTART0 2 /* start of the first dimension of the first hyperslab selection*/ +#define RFSHSTART1 4 /* start of the second dimension of the first hyperslab selection*/ + + +#define RMFHCOUNT0 3 /* Count of the first dimension of the first hyperslab selection*/ +#define RMFHCOUNT1 512 /* Count of the second dimension of the first hyperslab selection*/ +#define RMFHSTRIDE0 1 /* Stride of the first dimension of the first hyperslab selection*/ +#define RMFHSTRIDE1 1 /* Stride of the second dimension of the first hyperslab selection*/ +#define RMFHBLOCK0 1 /* Block of the first dimension of the first hyperslab selection*/ +#define RMFHBLOCK1 1 /* Block of the second dimension of the first hyperslab selection*/ +#define RMFHSTART0 0 /* start of the first dimension of the first hyperslab selection*/ +#define RMFHSTART1 0 /* start of the second dimension of the first hyperslab selection*/ + +#define RMSHCOUNT0 3 /* Count of the first dimension of the first hyperslab selection*/ +#define RMSHCOUNT1 1024 /* Count of the second dimension of the first hyperslab selection*/ +#define RMSHSTRIDE0 1 /* Stride of the first dimension of the first hyperslab selection*/ +#define RMSHSTRIDE1 1 /* Stride of the second dimension of the first hyperslab selection*/ +#define RMSHBLOCK0 1 /* Block of the first dimension of the first hyperslab selection*/ +#define RMSHBLOCK1 1 /* Block of the second dimension of the first hyperslab selection*/ +#define RMSHSTART0 1 /* start of the first dimension of the first hyperslab selection*/ +#define RMSHSTART1 2 /* start of the second dimension of the first hyperslab selection*/ + + +#define NPOINTS 4 /* Number of points that will be selected + and overwritten */ /* Don't erase these lines, they are put here for debugging purposes */ /* -#define MSPACE1_RANK 1 -#define MSPACE1_DIM 50 -#define MSPACE2_RANK 1 -#define MSPACE2_DIM 4 -#define FSPACE_RANK 2 -#define FSPACE_DIM1 8 -#define FSPACE_DIM2 12 -#define MSPACE_RANK 2 -#define MSPACE_DIM1 8 -#define MSPACE_DIM2 9 -#define NPOINTS 4 +#define MSPACE1_RANK 1 +#define MSPACE1_DIM 50 +#define MSPACE2_RANK 1 +#define MSPACE2_DIM 4 +#define FSPACE_RANK 2 +#define FSPACE_DIM1 8 +#define FSPACE_DIM2 12 +#define MSPACE_RANK 2 +#define MSPACE_DIM1 8 +#define MSPACE_DIM2 9 +#define NPOINTS 4 */ /* end of debugging macro */ diff --git a/tools/gifconv/decompress.c b/tools/gifconv/decompress.c index 410778f..2ebf28d 100644 --- a/tools/gifconv/decompress.c +++ b/tools/gifconv/decompress.c @@ -81,7 +81,7 @@ int numused; * our location in the Raster array as a BIT Offset. We compute the BYTE * Offset WORDo the raster array by dividing this by 8, pick up three BYTEs, * compute the bit Offset WORDo our 24-bit chunk, shift to bring the desired - * code to the bottom, then mask it off and return it. + * code to the bottom, then mask it off and return it. */ static int ReadCode(void) @@ -166,39 +166,39 @@ Decompress(GIFIMAGEDESC *GifImageDesc, GIFHEAD *GifHead) { int i; - XC = 0; + XC = 0; YC = 0; Pass = 0; OutCount = 0; BitOffset = 0; - + DataMask = (1 << ((GifHead->PackedField & 0x07) +1)) -1; Raster = GifImageDesc->GIFImage; /* Check for image seperator */ - + /* Now read in values from the image descriptor */ IWidth = GifImageDesc->ImageWidth; IHeight = GifImageDesc->ImageHeight; Interlace = GifImageDesc->PackedField & 0x40; - + /* * Note that I ignore the possible existence of a local color map. I'm * told there aren't many files around that use them, and the spec says * it's defined for future use. This could lead to an error reading some - * files. + * files. */ - + /* * Start reading the raster data. First we get the WORDial code size and * compute decompressor constant values, based on this code size. */ - + CodeSize = GifImageDesc->CodeSize; ClearCode = (1 << CodeSize); EOFCode = ClearCode + 1; FreeCode = FirstFree = ClearCode + 2; - + /* * The GIF spec has it that the code size is the code size used to compute * the above values is the code size given in the file, but the code size @@ -218,19 +218,19 @@ Decompress(GIFIMAGEDESC *GifImageDesc, GIFHEAD *GifHead) */ /* Allocate the Image */ - + if (!(Image = (BYTE *)malloc((size_t)IWidth*(size_t)IHeight))) { printf("Out of memory"); exit(-1); } - + BytesPerScanline = IWidth; - + /* * Decompress the file, continuing until you see the GIF EOF code. One * obvious enhancement is to add checking for corrupt files here. */ - + Code = ReadCode(); while (Code != EOFCode) { @@ -269,7 +269,7 @@ Decompress(GIFIMAGEDESC *GifImageDesc, GIFHEAD *GifHead) */ while (CurCode > DataMask) { if (OutCount > 1024) { - /*return error message*/ + /*return error message*/ } OutCode[OutCount++] = Suffix[CurCode]; @@ -316,5 +316,5 @@ Decompress(GIFIMAGEDESC *GifImageDesc, GIFHEAD *GifHead) Code = ReadCode(); } - return Image; + return Image; } diff --git a/tools/gifconv/gif.h b/tools/gifconv/gif.h index 282085f..ad60968 100644 --- a/tools/gifconv/gif.h +++ b/tools/gifconv/gif.h @@ -47,8 +47,8 @@ typedef unsigned char boolean; ** Set EndianOrder = 0 if machine is little endian ** EndianOrder = 1 if machine is big endian. */ -extern int EndianOrder; - +extern int EndianOrder; + /* ** The GIF header format. ** @@ -63,9 +63,9 @@ typedef struct _GifHeader { /* Offset Description */ BYTE ApplicationCount; BYTE PlainTextCount; BYTE HDFPalette[256][3]; - BYTE HeaderDump[6]; /* BYTE array to dump header contents */ + BYTE HeaderDump[6]; /* BYTE array to dump header contents */ BYTE LSDDump[7]; /* Logical Screen Descriptor dump */ -} GIFHEAD; +} GIFHEAD; /* @@ -122,9 +122,9 @@ typedef struct _GifCommentExtension { /* ** GIF to HDF Memory Struct -** Purpose : The gif to hdf structure is used to pass all the +** Purpose : The gif to hdf structure is used to pass all the ** gif data to the memory, which gets caught by the hdf driver -** Its the drivers job to put the data in the appropriate places +** Its the drivers job to put the data in the appropriate places ** in the HDF file. ** I have assumed that the ImageDescriptors and GraphicControls follow ** one another, ie. I have not associated them with each other. The driver diff --git a/tools/gifconv/gif2mem.c b/tools/gifconv/gif2mem.c index 01aa5a2..0695995 100644 --- a/tools/gifconv/gif2mem.c +++ b/tools/gifconv/gif2mem.c @@ -100,7 +100,7 @@ Gif2Mem(BYTE *MemGif) /* Read the GIF image file header information */ ReadGifHeader(gifHead, &MemGif); - + /* Check for FILE stream error */ #if 0 if (ferror(fpGif)) @@ -121,7 +121,7 @@ Gif2Mem(BYTE *MemGif) for (;;) { Identifier = *MemGif++; - + switch (Identifier) { case 0x3B: /* Trailer */ /* @@ -140,16 +140,16 @@ Gif2Mem(BYTE *MemGif) GifMemoryStruct.GifApplicationExtension = gifApplication; GifMemoryStruct.GifCommentExtension = gifComment; GifMemoryStruct.GifGraphicControlExtension = gifGraphicControl; - + /* return the struct */ return GifMemoryStruct; case 0x2C: /* Image Descriptor */ /* * If there was no image descriptor before this increase image - * count. If an imagedescriptor was present, reset GCEflag + * count. If an imagedescriptor was present, reset GCEflag */ - if (GCEflag == 0) + if (GCEflag == 0) ImageCount++; else GCEflag = 0; @@ -180,17 +180,17 @@ Gif2Mem(BYTE *MemGif) printf("Out of memory!"); exit(-1); } - + if (ReadGifImageDesc(gifImageDesc[ImageCount-1], &MemGif) == -1) fputs("Error reading Image Descriptor information\n", stderr); - + /* Decompress the Image */ gifImageDesc[ImageCount-1]->Image = Decompress(gifImageDesc[ImageCount-1], gifHead); free(gifImageDesc[ImageCount-1]->GIFImage); - /* + /* * Convert the local palette into an HDF compatible palette In * case the local color table is present, it is written out as * the HDFPalette If it is absent the global table is written @@ -213,8 +213,8 @@ Gif2Mem(BYTE *MemGif) } break; - - case 0x21: /* Extension Block */ + + case 0x21: /* Extension Block */ Label = *MemGif++; switch (Label) { @@ -240,7 +240,7 @@ Gif2Mem(BYTE *MemGif) "Error reading Plain Text Extension information.\n"); break; - + case 0xFE: /* Comment Extension */ CommentCount++; @@ -251,19 +251,19 @@ Gif2Mem(BYTE *MemGif) printf("Out of memory!"); exit(-1); } - + if(!(gifComment[CommentCount - 1] = (GIFCOMMENT *)malloc(sizeof(GIFCOMMENT)))) { printf("Out of memory!"); exit(-1); } - + if (ReadGifComment(gifComment[CommentCount - 1], &MemGif)) fprintf(stderr, "Error reading Comment Extension information\n"); break; - + case 0xF9: /* Graphic Control Extension */ if (GCEflag == 0 ) ImageCount++; @@ -289,17 +289,17 @@ Gif2Mem(BYTE *MemGif) gifImageDesc[j] = NULL; } } - + if(!(gifGraphicControl[ImageCount-1] = (GIFGRAPHICCONTROL*)malloc(sizeof(GIFGRAPHICCONTROL)))) { printf("Out of memory!"); exit(-1); } - - + + if (ReadGifGraphicControl(gifGraphicControl[ImageCount-1], &MemGif)) fprintf(stderr, "Error reading Graphic Control Extension information\n"); - + if (!*MemGif++ == 0) fprintf(stderr, "Error reading Graphic Control Extension\n"); @@ -311,18 +311,18 @@ Gif2Mem(BYTE *MemGif) if (ApplicationCount > ApplicationArray) ApplicationArray = (ApplicationArray << 1) + 1; - + if (!(gifApplication = (GIFAPPLICATION **)realloc(gifApplication , sizeof(GIFAPPLICATION *) * ApplicationArray))) { printf("Out of memory!"); exit(-1); } - + if(!(gifApplication[ApplicationCount - 1] = (GIFAPPLICATION *)malloc(sizeof(GIFAPPLICATION)))) { printf("Out of memory!"); exit(-1); } - + if (ReadGifApplication(gifApplication[ApplicationCount - 1], &MemGif)) fprintf(stderr, "Error reading Application Extension information\n"); diff --git a/tools/gifconv/gifread.c b/tools/gifconv/gifread.c index b135617..5f4aba0 100644 --- a/tools/gifconv/gifread.c +++ b/tools/gifconv/gifread.c @@ -11,16 +11,16 @@ * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -#include -#include +#include +#include -#include "gif.h" +#include "gif.h" int EndianOrder; static BYTE *ReadDataSubBlocks(BYTE **MemGif2, WORD *DSize); -WORD +WORD GetWord(BYTE *MemGif) { WORD w; @@ -39,7 +39,7 @@ GetWord(BYTE *MemGif) BYTE GetByte(BYTE *MemGif) -{ +{ return *MemGif; } @@ -69,7 +69,7 @@ ReadGifHeader(GIFHEAD *GifHead, /* Pointer to GIF header structure */ printf("The file does not appear to be a valid GIF file.\n"); exit(-1); } - + for (i = 0 ; i < 7 ; i++) { GifHead->LSDDump[i] = *(*MemGif2)++; } @@ -84,7 +84,7 @@ ReadGifHeader(GIFHEAD *GifHead, /* Pointer to GIF header structure */ /* Read the Global Color Table */ - /* + /* * There are some changes made here apart from just reading in the * global color table as would seem intuitively obvious. The colors * are stored in the bottom part of the palette as opposed to the top @@ -100,7 +100,7 @@ ReadGifHeader(GIFHEAD *GifHead, /* Pointer to GIF header structure */ /* Check for a FILE stream error */ #if 0 if (ferror(FpGif)) - return -1; + return -1; #endif /* 0 */ return 0; /* No FILE stream error occured */ @@ -136,11 +136,11 @@ ReadGifImageDesc( for (i = 0 ; i < 9 ; i++) { GifImageDesc->GIDDump[i] = *(*MemGif2)++; } - + /* ** Get the relevant fields. I need ImageWidth and Height actively hence I have ** taken information from those fields. I intend to keep the GifImageDesc data - ** structure as it is so that anyone needing the rest of the fields can do so + ** structure as it is so that anyone needing the rest of the fields can do so ** quickly. */ @@ -160,10 +160,10 @@ ReadGifImageDesc( GifImageDesc->ImageHeight = (WORD) (GifImageDesc->GIDDump[6] & 0xFF); GifImageDesc->ImageHeight = ((WORD) (GifImageDesc->GIDDump[7] & 0xFF)) | (GifImageDesc->ImageWidth << 0x08); - + } - + GifImageDesc->PackedField = GifImageDesc->GIDDump[8]; /* Interlace = GifImageDesc->PackedField & 0x20; */ @@ -193,7 +193,7 @@ ReadGifImageDesc( printf("Out of memory"); exit(-1); } - + TempPtr = GifImageDesc->GIFImage; do @@ -258,7 +258,7 @@ ReadGifPlainText( if (!(GifPlainText->PlainTextData = ReadDataSubBlocks(MemGif2 , &(GifPlainText->DataSize)))) return(1); - /* + /* GifPlainText->Terminator = 0; */ @@ -299,7 +299,7 @@ ReadGifApplication( /* GifApplication->Terminator = 0; */ - + /* Check for a FILE stream error */ /* if (ferror(FpGif)) @@ -325,13 +325,13 @@ ReadGifComment( BYTE **MemGif2 /* GIF image file input FILE stream */ ) { - + /* Read in the Plain Text data sub-blocks */ if (!(GifComment->CommentData = ReadDataSubBlocks(MemGif2 , &(GifComment->DataSize)))) return(1); GifComment->Terminator = 0; - + return(0); /* No FILE stream error occured */ } @@ -357,9 +357,9 @@ ReadDataSubBlocks(BYTE **MemGif2, /* GIF image file input FILE stream int tempcount = 0; bufSize = 0; /* The output buffer is empty */ - + dataSize = *(*MemGif2)++; /* Get the size of the first sub-block */ - + /* Allocate initial data buffer */ if (!(ptr1 = ptr2 = (BYTE *) malloc((size_t)dataSize + 1))) { printf("Out of memory. Allocation of memory for data sub-blocks for\neither Comment, Plain Text or Application Extensions failed"); @@ -376,23 +376,23 @@ ReadDataSubBlocks(BYTE **MemGif2, /* GIF image file input FILE stream #endif /* COMMENTED_OUT */ while (dataSize--) /* Read/write the Plain Text data */ *ptr1++ = *(*MemGif2)++; - + /* Check if there is another data sub-block */ if ((dataSize = *(*MemGif2)++) == 0) break; /* Block Terminator encountered */ - + /* Increase the buffer size to accomodate the next sub-block */ if (!(ptr1 = ptr2 = (BYTE *) realloc(ptr2, bufSize + dataSize + 1))) return((BYTE *) NULL); - + ptr1 += bufSize; /* Move pointer to the end of the data */ - - + + } *ptr1++ = '\0'; - + return(ptr2); /* Return a pointer to the sub-block data */ } diff --git a/tools/gifconv/hdf2gif.c b/tools/gifconv/hdf2gif.c index 51ec144..52e57f7 100644 --- a/tools/gifconv/hdf2gif.c +++ b/tools/gifconv/hdf2gif.c @@ -64,7 +64,7 @@ usage(void) FILE *fpGif = NULL; int main(int argc , char **argv) { - + hsize_t dim_sizes[2]; BYTE *Image; @@ -180,7 +180,7 @@ int main(int argc , char **argv) return -1; } - + /* we shall always have a palette - read hdf will see to that */ has_local_palette = true; @@ -188,12 +188,12 @@ int main(int argc , char **argv) idx = 0x0001; b = (BYTE *) &idx; EndianOrder = (b[0] ? 1:0); - + if (!(fpGif = fopen(GIFName , "wb"))) { printf("Error opening gif file for output. Aborting.\n"); return -1; } - + /* hardwire n_images to 1 for now. */ n_images = number_of_images; @@ -249,7 +249,7 @@ int main(int argc , char **argv) Blue[i] = GlobalPalette[i][2]; } } - + for (i = 0; i < 256; i++) { pc2nc[i] = r1[i] = g1[i] = b1[i] = 0; } @@ -288,7 +288,7 @@ int main(int argc , char **argv) #ifdef UNUSED CountDown = w * h; /* # of pixels we'll be doing */ #endif /* UNUSED */ - + if (BitsPerPixel <= 1) InitCodeSize = 2; else @@ -305,7 +305,7 @@ int main(int argc , char **argv) /* * If it is the first image we do all the header stuff that isn't - * required for the rest of the images. + * required for the rest of the images. */ if (idx == 0) { /* Write out the GIF header and logical screen descriptor */ @@ -379,7 +379,7 @@ int main(int argc , char **argv) i = hdfWriteGIF(fpGif , Image , 0 , (int)dim_sizes[0] , (int)dim_sizes[1] , r1, g1 , b1 , pc2nc , 256 , 8 , BitsPerPixel); - fputc(0x00, fpGif); + fputc(0x00, fpGif); free(Image); } diff --git a/tools/gifconv/hdfgifwr.c b/tools/gifconv/hdfgifwr.c index a18b81f..b1b5be5 100644 --- a/tools/gifconv/hdfgifwr.c +++ b/tools/gifconv/hdfgifwr.c @@ -13,13 +13,13 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * hdfgifwr.c - handles writing of GIF files. - * - * Contains: + * hdfgifwr.c - handles writing of GIF files. + * + * Contains: * hdfWriteGIF(fp, pic, ptype, w, h, rmap, gmap, bmap, numcols, colorstyle, * comment) * - * Note: slightly brain-damaged, in that it'll only write non-interlaced + * Note: slightly brain-damaged, in that it'll only write non-interlaced * GIF files (in the interests of speed, or something) */ @@ -44,7 +44,7 @@ * James A. Woods (decvax!ihnp4!ames!jaw) * Joe Orost (decvax!vax135!petsd!joe) *****************************************************************/ - + #include #include @@ -125,7 +125,7 @@ int hdfWriteGIF(FILE *fp, byte *pic, int ptype, int w, int h, byte *rmap, Background = 0; #endif /* UNUSED */ - for (i = 0; i < 256; i++) { + for (i = 0; i < 256; i++) { pc2nc[i] = pc2ncmap[i]; #ifdef UNUSED r1[i] = rmap[i]; @@ -325,7 +325,7 @@ probe: continue; } - if ((long)HashTabOf (i) >= 0) + if ((long)HashTabOf (i) >= 0) goto probe; nomatch: @@ -380,7 +380,7 @@ output(int code) cur_accum |= ((long)code << cur_bits); else cur_accum = code; - + cur_bits += n_bits; while( cur_bits >= 8 ) { @@ -406,7 +406,7 @@ output(int code) maxcode = MAXCODE(n_bits); } } - + if (code == EOFCode) { /* At EOF, write the rest of the buffer */ while( cur_bits > 0 ) { diff --git a/tools/gifconv/readhdf.c b/tools/gifconv/readhdf.c index 2720d4d..3fc454c 100644 --- a/tools/gifconv/readhdf.c +++ b/tools/gifconv/readhdf.c @@ -30,17 +30,17 @@ cleanup(BYTE *ptr) ** BYTE palette[256][3] - the corresponding palette ** hsize_t* image_size - the size of each dimension of the image ** -** Future Notes: -** The way readHDF works right now is that it expects the user +** Future Notes: +** The way readHDF works right now is that it expects the user ** to know the exact path to the HDF image. Thus it does not ** parse the HDF file looking for image datasets and corresponding -** palettes. Also it takes in the default palette for the image +** palettes. Also it takes in the default palette for the image ** specified, if the palette is missing, it makes a default greyscale ** palette and throws it in. ** */ int ReadHDF(BYTE** data, BYTE palette[256][3], hsize_t *image_size, - CHAR *h5_file, CHAR *dset_name, CHAR *pal_name) + CHAR *h5_file, CHAR *dset_name, CHAR *pal_name) { hid_t fHfile; /* H5 file to open */ hid_t dspace; /* dataspace identifier for the the dataset */ @@ -130,7 +130,7 @@ int ReadHDF(BYTE** data, BYTE palette[256][3], hsize_t *image_size, pal_exist = 0; return -1; } - + pal_dtype = H5Dget_type(pal_set); if (dtype < 0) { fprintf(stderr , "Unable to open palette datatype\n"); @@ -151,7 +151,7 @@ int ReadHDF(BYTE** data, BYTE palette[256][3], hsize_t *image_size, pal_exist = 0; return -1; } - + /* get the dimension size of the palette. */ if (H5Sget_simple_extent_dims(pal_space , loc_pal_size , NULL) !=2 ) { fprintf(stderr , "Unable to get dimension info\n"); diff --git a/tools/gifconv/writehdf.c b/tools/gifconv/writehdf.c index d343aae..8d7405e 100644 --- a/tools/gifconv/writehdf.c +++ b/tools/gifconv/writehdf.c @@ -49,11 +49,11 @@ static int write_text_attribute(hid_t dataset_id , const char *attr_name, attr_dataspace_id , H5P_DEFAULT); /* write out the attribute data */ - if (H5Awrite(attr_attr_id , attr_type_id , attr_value) < 0) + if (H5Awrite(attr_attr_id , attr_type_id , attr_value) < 0) return -1; /* close the attribute */ - if (H5Aclose(attr_attr_id) < 0) + if (H5Aclose(attr_attr_id) < 0) return -1; /* close the dataspace */ @@ -192,12 +192,12 @@ WriteHDF(GIFTOMEM GifMemoryStruct, char *HDFName , char *GIFFileName) return -1; } - /* write the reference out */ + /* write the reference out */ if (H5Dwrite(ref_dataset_id , H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL , H5P_DEFAULT, &pal_ref) < 0) { fprintf(stderr , "Unable to write Palette Reference"); return -1; } - + /* close dataset */ if (H5Dclose(ref_dataset_id) < 0) { fprintf(stderr , "Unable to close palette dataset.\n"); @@ -271,7 +271,7 @@ WriteHDF(GIFTOMEM GifMemoryStruct, char *HDFName , char *GIFFileName) /* This info is available at http://hdf.ncsa.uiuc.edu/HDF5/doc/ImageSpec.html */ /* The following attributes must be set for each image: ** --------------------------------------- - ** Attribute Name Value + ** Attribute Name Value ** CLASS IMAGE ** IMAGE_VERSION 1.0 ** IMAGE_SUBCLASS IMAGE_BITMAP @@ -324,7 +324,7 @@ WriteHDF(GIFTOMEM GifMemoryStruct, char *HDFName , char *GIFFileName) ** Attribute: PALETTE ** Value : Reference to Palette *****************************************/ - + /**** MAKE SURE PALETTE EXISTS!!! ****/ if (gifHead.PackedField & 0x80) { /* global palette exists */ diff --git a/tools/h5diff/h5diff_main.c b/tools/h5diff/h5diff_main.c index 83f8c47..fcc5a6b 100644 --- a/tools/h5diff/h5diff_main.c +++ b/tools/h5diff/h5diff_main.c @@ -26,7 +26,7 @@ static int check_f_input( const char* ); * * Purpose: h5diff main program * - * Return: An exit status of 0 means no differences were found, 1 means some + * Return: An exit status of 0 means no differences were found, 1 means some * differences were found. * * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu @@ -40,7 +40,7 @@ static int check_f_input( const char* ); * Normal mode: print the number of differences found and where they occured * Report mode: print the above plus the differences * Verbose mode: print the above plus a list of objects and warnings - * Quiet mode: do not print output + * Quiet mode: do not print output * *------------------------------------------------------------------------- */ @@ -64,10 +64,10 @@ int main(int argc, const char *argv[]) *------------------------------------------------------------------------- */ - if ( argc==2 && (strcmp("-h",argv[1])==0) ) + if ( argc==2 && (strcmp("-h",argv[1])==0) ) usage(); - - if ( argc<3 ) + + if ( argc<3 ) { printf("Number of arguments is only %d\n", argc ); usage(); @@ -86,32 +86,32 @@ int main(int argc, const char *argv[]) * parse command line options *------------------------------------------------------------------------- */ - for (i=3; i0 if differences, 0 if no differences, <0 if error *------------------------------------------------------------------------- */ @@ -228,7 +228,7 @@ int main(int argc, const char *argv[]) if (options.err_stat) ret=-1; return ret; - + } /*------------------------------------------------------------------------- @@ -248,7 +248,7 @@ int main(int argc, const char *argv[]) * *------------------------------------------------------------------------- */ -static +static int check_n_input( const char *str ) { unsigned i; @@ -284,18 +284,18 @@ int check_n_input( const char *str ) * *------------------------------------------------------------------------- */ -static +static int check_f_input( const char *str ) { double x; - /* - the atof return value on a hexadecimal input is different + /* + the atof return value on a hexadecimal input is different on some systems; we do a character check for this */ if (strlen(str)>2 && str[0]=='0' && str[1]=='x') return -1; - + x=atof(str); if (x==0) return -1; @@ -306,13 +306,13 @@ int check_f_input( const char *str ) /*------------------------------------------------------------------------- * Function: usage * - * Purpose: print a usage message + * Purpose: print a usage message * * Return: void * *------------------------------------------------------------------------- */ -static +static void usage(void) { printf("Usage: h5diff file1 file2 [OPTIONS] [obj1[obj2]] \n"); diff --git a/tools/h5diff/testh5diff.h b/tools/h5diff/testh5diff.h index 13c02ea..c450e3e 100644 --- a/tools/h5diff/testh5diff.h +++ b/tools/h5diff/testh5diff.h @@ -15,16 +15,16 @@ #include #include #include "hdf5.h" -#include "H5private.h" +#include "H5private.h" -int test_basic(const char *file1, +int test_basic(const char *file1, const char *file2); -int test_types(const char *file1, +int test_types(const char *file1, const char *file2); -int test_native(const char *file1, +int test_native(const char *file1, const char *file2); @@ -35,19 +35,19 @@ int test_attr(const char *file, int make_diffs /* flag to modify data buffers */); -int write_attr(hid_t loc_id, - int rank, - hsize_t *dims, +int write_attr(hid_t loc_id, + int rank, + hsize_t *dims, const char *attr_name, - hid_t type_id, + hid_t type_id, void *buf); -int write_dset( hid_t loc_id, - int rank, - hsize_t *dims, +int write_dset( hid_t loc_id, + int rank, + hsize_t *dims, const char *dset_name, - hid_t type_id, + hid_t type_id, void *buf ); diff --git a/tools/h5diff/testh5diff_attr.c b/tools/h5diff/testh5diff_attr.c index fb6dc39..3a962de 100644 --- a/tools/h5diff/testh5diff_attr.c +++ b/tools/h5diff/testh5diff_attr.c @@ -19,7 +19,7 @@ /*------------------------------------------------------------------------- * Function: write_attr_in * - * Purpose: write attributes in LOC_ID (dataset, group, named datatype) + * Purpose: write attributes in LOC_ID (dataset, group, named datatype) * * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * @@ -28,28 +28,28 @@ *------------------------------------------------------------------------- */ - -static void write_attr_in(hid_t loc_id, + +static void write_attr_in(hid_t loc_id, const char* dset_name, /* for saving reference to dataset*/ hid_t file_id, int make_diffs /* flag to modify data buffers */) { /* Compound datatype */ - typedef struct s_t + typedef struct s_t { char a; double b; } s_t; - typedef enum + typedef enum { RED, GREEN } e_t; hid_t attr_id; - hid_t space_id; - hid_t type_id; + hid_t space_id; + hid_t type_id; herr_t status; int val, i, j, k, n; float f; @@ -98,7 +98,7 @@ static void write_attr_in(hid_t loc_id, * 1D attributes *------------------------------------------------------------------------- */ - + /*------------------------------------------------------------------------- * H5T_STRING *------------------------------------------------------------------------- @@ -109,11 +109,11 @@ static void write_attr_in(hid_t loc_id, for (i=0; i<2; i++) for (j=0; j<2; j++) { - buf1[i][j]='z'; + buf1[i][j]='z'; } } - /* - buf1[2][2]= {"ab","de"}; + /* + buf1[2][2]= {"ab","de"}; $h5diff file7.h5 file6.h5 g1 g1 -v Group: and Attribute: and @@ -139,8 +139,8 @@ static void write_attr_in(hid_t loc_id, for (i=0; i<2; i++) buf2[i]=buf2[1]=0; } - /* - buf2[2]= {1,2}; + /* + buf2[2]= {1,2}; $h5diff file7.h5 file6.h5 g1 g1 -v Group: and Attribute: and @@ -160,8 +160,8 @@ static void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ - /* - buf2[2]= {1,2}; + /* + buf2[2]= {1,2}; $h5diff file7.h5 file6.h5 g1 g1 -v Group: and Attribute: and @@ -181,7 +181,7 @@ static void write_attr_in(hid_t loc_id, * H5T_COMPOUND *------------------------------------------------------------------------- */ - + if (make_diffs) { for (i=0; i<2; i++) @@ -189,9 +189,9 @@ static void write_attr_in(hid_t loc_id, buf3[i].a=0; buf3[i].b=0; } } - - /* - buf3[2]= {{1,2},{3,4}}; + + /* + buf3[2]= {{1,2},{3,4}}; $h5diff file7.h5 file6.h5 g1 g1 -v Group: and Attribute: and @@ -208,7 +208,7 @@ static void write_attr_in(hid_t loc_id, H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); write_attr(loc_id,1,dims,"compound",type_id,buf3); status = H5Tclose(type_id); - + /*------------------------------------------------------------------------- * H5T_REFERENCE *------------------------------------------------------------------------- @@ -229,10 +229,10 @@ static void write_attr_in(hid_t loc_id, { for (i=0; i<2; i++) { - buf45[i]=GREEN; + buf45[i]=GREEN; } } - /* + /* buf45[2]= {RED,RED}; $h5diff file7.h5 file6.h5 g1 g1 -v Group: and @@ -252,7 +252,7 @@ static void write_attr_in(hid_t loc_id, * H5T_VLEN *------------------------------------------------------------------------- */ - + /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; @@ -269,7 +269,7 @@ static void write_attr_in(hid_t loc_id, ((int *)buf5[1].p)[0]=0; ((int *)buf5[1].p)[1]=0; } - /* + /* $h5diff file7.h5 file6.h5 g1 g1 -v Group: and position vlen of vlen of difference @@ -300,10 +300,10 @@ static void write_attr_in(hid_t loc_id, for (i=0; i<2; i++) for (j=0; j<3; j++) { - buf6[i][j]=0; + buf6[i][j]=0; } } - /* + /* buf6[2][3]= {{1,2,3},{4,5,6}}; $h5diff file7.h5 file6.h5 g1 g1 -v Group: and @@ -330,12 +330,12 @@ position array of array of difference { for (i=0; i<2; i++) { - buf7[i]=0; - buf8[i]=0; + buf7[i]=0; + buf8[i]=0; } } - /* - buf7[2]= {1,2}; + /* + buf7[2]= {1,2}; buf8[2]= {1,2}; $h5diff file7.h5 file6.h5 g1 g1 -v Group: and @@ -366,7 +366,7 @@ position array of array of difference memset(buf12, 'z', sizeof buf12); } - /* + /* buf12[6][2]= {"ab","cd","ef","gh","ij","kl"}; $h5diff file7.h5 file6.h5 g1 g1 -v Attribute: and @@ -401,8 +401,8 @@ position array of array of difference memset(buf22,0,sizeof buf22); } - /* - buf22[3][2]= {{1,2},{3,4},{5,6}}; + /* + buf22[3][2]= {{1,2},{3,4},{5,6}}; $h5diff file7.h5 file6.h5 g1 g1 -v Attribute: and position bitfield2D of bitfield2D of difference @@ -425,8 +425,8 @@ position array of array of difference *------------------------------------------------------------------------- */ - /* - buf22[3][2]= {{1,2},{3,4},{5,6}}; + /* + buf22[3][2]= {{1,2},{3,4},{5,6}}; $h5diff file7.h5 file6.h5 g1 g1 -v Attribute: and position opaque2D of opaque2D of difference @@ -452,7 +452,7 @@ position array of array of difference memset(buf32,0,sizeof buf32); } - /* + /* buf32[6]= {{1,2},{3,4},{5,6},{7,8},{9,10},{11,12}}; $h5diff file7.h5 file6.h5 g1 g1 -v Attribute: and @@ -472,7 +472,7 @@ position array of array of difference H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); write_attr(loc_id,2,dims2,"compound2D",type_id,buf32); status = H5Tclose(type_id); - + /*------------------------------------------------------------------------- * H5T_REFERENCE *------------------------------------------------------------------------- @@ -495,7 +495,7 @@ position array of array of difference for (i=0; i<3; i++) for (j=0; j<2; j++) { - if (make_diffs) buf452[i][j]=GREEN; else buf452[i][j]=RED; + if (make_diffs) buf452[i][j]=GREEN; else buf452[i][j]=RED; } /* @@ -549,7 +549,7 @@ position enum2D of enum2D of difference [ 2 1 ] 10 0 10 [ 2 1 ] 11 0 11 */ - + space_id = H5Screate_simple(2,dims2,NULL); type_id = H5Tvlen_create(H5T_NATIVE_INT); attr_id = H5Acreate(loc_id,"vlen2D",type_id,space_id,H5P_DEFAULT); @@ -570,8 +570,8 @@ position enum2D of enum2D of difference { memset(buf62,0,sizeof buf62); } - /* - buf62[6][3]= {{1,2,3},{4,5,6},{7,8,9},{10,11,12},{13,14,15},{16,17,18}}; + /* + buf62[6][3]= {{1,2,3},{4,5,6},{7,8,9},{10,11,12},{13,14,15},{16,17,18}}; $h5diff file7.h5 file6.h5 g1 g1 -v Group: and Attribute: and @@ -635,7 +635,7 @@ position float2D of float2D of difference write_attr(loc_id,2,dims2,"integer2D",H5T_NATIVE_INT,buf72); write_attr(loc_id,2,dims2,"float2D",H5T_NATIVE_FLOAT,buf82); - + /*------------------------------------------------------------------------- * 3D attributes *------------------------------------------------------------------------- @@ -849,7 +849,7 @@ position bitfield3D of bitfield3D of difference H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); write_attr(loc_id,3,dims3,"compound3D",type_id,buf33); status = H5Tclose(type_id); - + /*------------------------------------------------------------------------- * H5T_REFERENCE *------------------------------------------------------------------------- @@ -919,7 +919,7 @@ position enum3D of enum3D of difference * H5T_VLEN *------------------------------------------------------------------------- */ - + /* Allocate and initialize VL dataset to write */ n=0; for (i = 0; i < 4; i++) { @@ -948,7 +948,7 @@ position vlen3D of vlen3D of difference [ 1 0 1 ] 9 0 9 [ 1 1 0 ] 10 0 10 etc -*/ +*/ space_id = H5Screate_simple(3,dims3,NULL); type_id = H5Tvlen_create(H5T_NATIVE_INT); attr_id = H5Acreate(loc_id,"vlen3D",type_id,space_id,H5P_DEFAULT); @@ -1022,7 +1022,7 @@ etc [ 1 1 0 ] 9 0 9 [ 1 1 1 ] 10 0 10 etc -*/ +*/ write_attr(loc_id,3,dims3,"integer3D",H5T_NATIVE_INT,buf73); write_attr(loc_id,3,dims3,"float3D",H5T_NATIVE_FLOAT,buf83); } @@ -1037,11 +1037,11 @@ etc *------------------------------------------------------------------------- */ - + int test_attr(const char *file, int make_diffs /* flag to modify data buffers */) { - hid_t file_id; + hid_t file_id; hid_t dset_id; hid_t group_id; hid_t root_id; diff --git a/tools/h5diff/testh5diff_basic.c b/tools/h5diff/testh5diff_basic.c index fe0282d..bebb70d 100644 --- a/tools/h5diff/testh5diff_basic.c +++ b/tools/h5diff/testh5diff_basic.c @@ -46,7 +46,7 @@ file1.h5 file2.h5 -r g1/dset1 g1/dset2 # 1.6 - file1.h5 file2.h5 + file1.h5 file2.h5 # ############################################################################## # # basic types @@ -122,13 +122,13 @@ # 6.0: Check if the command line number of arguments is less than 3 - h5diff_test1.h5 + h5diff_test1.h5 # 6.1: Check for invalid options - h5diff_test1.h5 h5diff_test2.h5 -x + h5diff_test1.h5 h5diff_test2.h5 -x # ############################################################################## -# # -d +# # -d # ############################################################################## # 6.2: no value @@ -238,11 +238,11 @@ * Basic review tests *------------------------------------------------------------------------- */ - + int test_basic(const char *file1, const char *file2) { - hid_t file1_id, file2_id; + hid_t file1_id, file2_id; hid_t group1_id, group2_id, group3_id; herr_t status; hsize_t dims[2] = { 3,2 }; @@ -257,9 +257,9 @@ int test_basic(const char *file1, const char *file2) * Create two files *------------------------------------------------------------------------- */ - - file1_id = H5Fcreate (file1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - file2_id = H5Fcreate (file2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + + file1_id = H5Fcreate (file1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + file2_id = H5Fcreate (file2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); /* Create groups */ group1_id = H5Gcreate(file1_id, "g1", 0); @@ -273,7 +273,7 @@ int test_basic(const char *file1, const char *file2) write_dset(group2_id,2,dims,"dset1",H5T_NATIVE_DOUBLE,data2); /*------------------------------------------------------------------------- - * Close + * Close *------------------------------------------------------------------------- */ status = H5Gclose(group1_id); @@ -288,28 +288,28 @@ int test_basic(const char *file1, const char *file2) * Compare different types: H5G_DATASET, H5G_TYPE, H5G_GROUP, H5G_LINK *------------------------------------------------------------------------- */ - + int test_types(const char *file1, const char UNUSED *file2) { - hid_t file1_id; + hid_t file1_id; hid_t group_id; - hid_t type_id; + hid_t type_id; herr_t status; hsize_t dims[1]={1}; /* Compound datatype */ - typedef struct s_t + typedef struct s_t { int a; float b; } s_t; - + /*------------------------------------------------------------------------- * Create one file *------------------------------------------------------------------------- */ - file1_id = H5Fcreate (file1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + file1_id = H5Fcreate (file1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); /*------------------------------------------------------------------------- * H5G_DATASET @@ -336,16 +336,16 @@ int test_types(const char *file1, const char UNUSED *file2) /* Commit compound datatype and close it */ H5Tcommit(file1_id, "type", type_id); H5Tclose(type_id); - + /*------------------------------------------------------------------------- * H5G_LINK *------------------------------------------------------------------------- */ - + status = H5Glink(file1_id, H5G_LINK_SOFT, "dset", "link"); /*------------------------------------------------------------------------- - * Close + * Close *------------------------------------------------------------------------- */ status = H5Fclose(file1_id); @@ -357,14 +357,14 @@ int test_types(const char *file1, const char UNUSED *file2) /*------------------------------------------------------------------------- - * Datasets datatypes + * Datasets datatypes *------------------------------------------------------------------------- */ - + int test_native(const char *file1, const char UNUSED *file2) { - hid_t file1_id; + hid_t file1_id; hsize_t dims[2]={3,2}; herr_t status; char buf1a[3][2] = {{1,1},{1,1},{1,1}}; @@ -381,12 +381,12 @@ int test_native(const char *file1, const char UNUSED *file2) double buf6b[3][2] = {{1,1},{3,4},{5,6}}; /*unsigned/signed test - signed char -128 to 127 - unsigned char 0 to 255 + signed char -128 to 127 + unsigned char 0 to 255 */ char buf7a[3][2] = {{-1,-128},{-1,-1},{-1,-1}}; unsigned char buf7b[3][2] = {{1,128},{1,1},{1,1}}; - + /* long_long test */ long_long buf8a[3][2] = {{1,1},{1,1},{1,1}}; long_long buf8b[3][2] = {{1,1},{3,4},{5,6}}; @@ -395,8 +395,8 @@ int test_native(const char *file1, const char UNUSED *file2) unsigned int buf10a[3][2] = {{UIMAX,1},{1,1},{1,1}}; unsigned int buf10b[3][2] = {{UIMAX-1,1},{3,4},{5,6}}; - - + + /*------------------------------------------------------------------------- * Create a file *------------------------------------------------------------------------- @@ -410,16 +410,16 @@ int test_native(const char *file1, const char UNUSED *file2) write_dset(file1_id,2,dims,"dset0a",H5T_STD_I16LE,buf2a); write_dset(file1_id,2,dims,"dset0b",H5T_STD_I32LE,buf3b); - + /*------------------------------------------------------------------------- - * Check H5T_NATIVE_CHAR + * Check H5T_NATIVE_CHAR *------------------------------------------------------------------------- */ write_dset(file1_id,2,dims,"dset1a",H5T_NATIVE_CHAR,buf1a); write_dset(file1_id,2,dims,"dset1b",H5T_NATIVE_CHAR,buf1b); /*------------------------------------------------------------------------- - * Check H5T_NATIVE_SHORT + * Check H5T_NATIVE_SHORT *------------------------------------------------------------------------- */ write_dset(file1_id,2,dims,"dset2a",H5T_NATIVE_SHORT,buf2a); @@ -447,7 +447,7 @@ int test_native(const char *file1, const char UNUSED *file2) write_dset(file1_id,2,dims,"dset5b",H5T_NATIVE_FLOAT,buf5b); /*------------------------------------------------------------------------- - * Check H5T_NATIVE_DOUBLE + * Check H5T_NATIVE_DOUBLE *------------------------------------------------------------------------- */ @@ -488,7 +488,7 @@ int test_native(const char *file1, const char UNUSED *file2) /*------------------------------------------------------------------------- - * Close + * Close *------------------------------------------------------------------------- */ status = H5Fclose(file1_id); diff --git a/tools/h5diff/testh5diff_dset.c b/tools/h5diff/testh5diff_dset.c index cae7d1c..6d18c8a 100644 --- a/tools/h5diff/testh5diff_dset.c +++ b/tools/h5diff/testh5diff_dset.c @@ -19,7 +19,7 @@ /*------------------------------------------------------------------------- * Function: write_dset_in * - * Purpose: write datasets in LOC_ID + * Purpose: write datasets in LOC_ID * * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * @@ -28,28 +28,28 @@ *------------------------------------------------------------------------- */ - -static void write_dset_in(hid_t loc_id, + +static void write_dset_in(hid_t loc_id, const char* dset_name, /* for saving reference to dataset*/ hid_t file_id, int make_diffs /* flag to modify data buffers */) { /* Compound datatype */ - typedef struct s_t + typedef struct s_t { char a; double b; } s_t; - typedef enum + typedef enum { RED, GREEN } e_t; hid_t dset_id; - hid_t space_id; - hid_t type_id; + hid_t space_id; + hid_t type_id; hid_t plist_id; herr_t status; int val, i, j, k, n; @@ -95,22 +95,22 @@ static void write_dset_in(hid_t loc_id, /*------------------------------------------------------------------------- - * 1D + * 1D *------------------------------------------------------------------------- */ - + /*------------------------------------------------------------------------- * H5T_STRING *------------------------------------------------------------------------- */ - + if (make_diffs) { for (i=0; i<2; i++) for (j=0; j<2; j++) { - buf1[i][j]='z'; + buf1[i][j]='z'; } } @@ -163,7 +163,7 @@ static void write_dset_in(hid_t loc_id, { for (i=0; i<2; i++) { - buf45[i]=GREEN; + buf45[i]=GREEN; } } @@ -172,7 +172,7 @@ static void write_dset_in(hid_t loc_id, H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); write_dset(loc_id,1,dims,"compound",type_id,buf3); status = H5Tclose(type_id); - + /*------------------------------------------------------------------------- * H5T_REFERENCE *------------------------------------------------------------------------- @@ -199,7 +199,7 @@ static void write_dset_in(hid_t loc_id, * H5T_VLEN *------------------------------------------------------------------------- */ - + /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; @@ -238,7 +238,7 @@ static void write_dset_in(hid_t loc_id, for (i=0; i<2; i++) for (j=0; j<3; j++) { - buf6[i][j]=0; + buf6[i][j]=0; } } @@ -255,8 +255,8 @@ static void write_dset_in(hid_t loc_id, { for (i=0; i<2; i++) { - buf7[i]=0; - buf8[i]=0; + buf7[i]=0; + buf8[i]=0; } } @@ -265,7 +265,7 @@ static void write_dset_in(hid_t loc_id, /*------------------------------------------------------------------------- - * 2D + * 2D *------------------------------------------------------------------------- */ @@ -290,7 +290,7 @@ static void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ - + if (make_diffs) { memset(buf22,0,sizeof buf22); @@ -324,7 +324,7 @@ static void write_dset_in(hid_t loc_id, H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); write_dset(loc_id,2,dims2,"compound2D",type_id,buf32); status = H5Tclose(type_id); - + /*------------------------------------------------------------------------- * H5T_REFERENCE *------------------------------------------------------------------------- @@ -368,7 +368,7 @@ static void write_dset_in(hid_t loc_id, else ((int *)buf52[i][j].p)[l] = n++; } } - + space_id = H5Screate_simple(2,dims2,NULL); type_id = H5Tvlen_create(H5T_NATIVE_INT); dset_id = H5Dcreate(loc_id,"vlen2D",type_id,space_id,H5P_DEFAULT); @@ -400,7 +400,7 @@ static void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ - + if (make_diffs) { memset(buf72,0,sizeof buf72); @@ -424,9 +424,9 @@ static void write_dset_in(hid_t loc_id, write_dset(loc_id,2,dims2,"float2D",H5T_NATIVE_FLOAT,buf82); - + /*------------------------------------------------------------------------- - * 3D + * 3D *------------------------------------------------------------------------- */ @@ -502,7 +502,7 @@ static void write_dset_in(hid_t loc_id, H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); write_dset(loc_id,3,dims3,"compound3D",type_id,buf33); status = H5Tclose(type_id); - + /*------------------------------------------------------------------------- * H5T_REFERENCE *------------------------------------------------------------------------- @@ -534,7 +534,7 @@ static void write_dset_in(hid_t loc_id, * H5T_VLEN *------------------------------------------------------------------------- */ - + /* Allocate and initialize VL dataset to write */ n=0; for (i = 0; i < 4; i++) { @@ -549,7 +549,7 @@ static void write_dset_in(hid_t loc_id, } } } - + space_id = H5Screate_simple(3,dims3,NULL); type_id = H5Tvlen_create(H5T_NATIVE_INT); dset_id = H5Dcreate(loc_id,"vlen3D",type_id,space_id,H5P_DEFAULT); @@ -611,11 +611,11 @@ static void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ - + int test_dsetall(const char *file, int make_diffs /* flag to modify data buffers */) { - hid_t file_id; + hid_t file_id; hid_t dset_id; hid_t group_id; hid_t space_id; @@ -643,7 +643,7 @@ int test_dsetall(const char *file, group_id = H5Gcreate(file_id,"g1",0); /*------------------------------------------------------------------------- - * write a series of datasets on the group + * write a series of datasets on the group *------------------------------------------------------------------------- */ diff --git a/tools/h5diff/testh5diff_main.c b/tools/h5diff/testh5diff_main.c index 70a1ff1..8480675 100644 --- a/tools/h5diff/testh5diff_main.c +++ b/tools/h5diff/testh5diff_main.c @@ -25,12 +25,12 @@ int main(int UNUSED argc, const UNUSED char *argv[]) test_native("file4.h5",NULL); /* generate 2 files with attribute differences */ - test_attr("file5.h5",0); - test_attr("file6.h5",1); + test_attr("file5.h5",0); + test_attr("file6.h5",1); /* generate 2 files with all datatype differences */ - test_dsetall("file7.h5",0); - test_dsetall("file8.h5",1); + test_dsetall("file7.h5",0); + test_dsetall("file8.h5",1); return 0; } diff --git a/tools/h5diff/testh5diff_util.c b/tools/h5diff/testh5diff_util.c index b0abf81..5e81881 100644 --- a/tools/h5diff/testh5diff_util.c +++ b/tools/h5diff/testh5diff_util.c @@ -27,16 +27,16 @@ *------------------------------------------------------------------------- */ - -int write_attr(hid_t loc_id, - int rank, - hsize_t *dims, + +int write_attr(hid_t loc_id, + int rank, + hsize_t *dims, const char *attr_name, - hid_t type_id, + hid_t type_id, void *buf) { hid_t attr_id; - hid_t space_id; + hid_t space_id; herr_t status; /* Create a buf space */ @@ -44,7 +44,7 @@ int write_attr(hid_t loc_id, /* Create the attribute */ attr_id = H5Acreate(loc_id,attr_name,type_id,space_id,H5P_DEFAULT); - + /* Write the buf */ if ( buf ) status = H5Awrite(attr_id,type_id,buf); @@ -68,15 +68,15 @@ int write_attr(hid_t loc_id, */ -int write_dset( hid_t loc_id, - int rank, - hsize_t *dims, +int write_dset( hid_t loc_id, + int rank, + hsize_t *dims, const char *dset_name, - hid_t type_id, + hid_t type_id, void *buf ) { hid_t dset_id; - hid_t space_id; + hid_t space_id; herr_t status; /* Create a buf space */ @@ -84,7 +84,7 @@ int write_dset( hid_t loc_id, /* Create a dataset */ dset_id = H5Dcreate(loc_id,dset_name,type_id,space_id,H5P_DEFAULT); - + /* Write the buf */ if ( buf ) status = H5Dwrite(dset_id,type_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf); diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 9aee1bd..4b463cd 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -50,10 +50,10 @@ static int display_attr_data = TRUE; static int display_char = FALSE; /*print 1-byte numbers as ASCII */ static int usingdasho = FALSE; static int display_bb = FALSE; /*superblock */ -static int display_dcpl = FALSE; /*dcpl */ -static int display_fi = FALSE; /*file index */ -static int display_ai = TRUE; /*array index */ -static int display_escape = FALSE; /*escape non printable characters */ +static int display_dcpl = FALSE; /*dcpl */ +static int display_fi = FALSE; /*file index */ +static int display_ai = TRUE; /*array index */ +static int display_escape = FALSE; /*escape non printable characters */ /** ** Added for XML ** @@ -147,13 +147,13 @@ static h5dump_t dataformat = { "%s", /*dset_ptformat_pre */ "%s", /*dset_ptformat */ 1, /*array indices */ - 1 /*escape non printable characters */ + 1 /*escape non printable characters */ }; /** ** Added for XML ** **/ -/* +/* * Alternative formating for data dumped to XML * In general, the numbers are the same, but separators * except spaces are not used. @@ -231,7 +231,7 @@ static h5dump_t xml_dataformat = { "%s", /*dset_ptformat_pre */ "%s", /*dset_ptformat */ 0, /*array indices */ - 0 /*escape non printable characters */ + 0 /*escape non printable characters */ }; /** XML **/ @@ -310,7 +310,7 @@ static const dump_header standardformat = { ")", /*dataspacedimend */ }; -/** +/** ** Added for XML ** **/ /* internal functions used by XML option */ @@ -478,7 +478,7 @@ static void xml_dump_datatype(hid_t type); static herr_t xml_dump_attr(hid_t, const char *, void *); static void xml_dump_data(hid_t, int, struct subset_t *, int); -/** +/** ** Added for XML ** ** ** This is the global dispatch table for the dump functions. @@ -517,7 +517,7 @@ static const dump_functions xml_function_table = { }; /* - * The global table is set to either ddl_function_table or + * The global table is set to either ddl_function_table or * xml_function_table in the initialization. */ static const dump_functions *dump_function_table; @@ -763,7 +763,7 @@ print_datatype(hid_t type,unsigned in_group) case H5T_STRING: /* Make a copy of type in memory in case when TYPE is on disk, the size - * will be bigger than in memory. This makes it easier to compare + * will be bigger than in memory. This makes it easier to compare * types in memory. */ tmp_type = H5Tcopy(type); size = H5Tget_size(tmp_type); @@ -814,9 +814,9 @@ print_datatype(hid_t type,unsigned in_group) if (H5Tequal(tmp_type, str_type)) { printf("H5T_C_S1;\n"); goto done; - } + } - /* Change the endianness and see if they're equal. */ + /* Change the endianness and see if they're equal. */ order = H5Tget_order(tmp_type); if(order==H5T_ORDER_LE) H5Tset_order(str_type, H5T_ORDER_LE); @@ -841,7 +841,7 @@ print_datatype(hid_t type,unsigned in_group) goto done; } - /* Change the endianness and see if they're equal. */ + /* Change the endianness and see if they're equal. */ order = H5Tget_order(tmp_type); if(order==H5T_ORDER_LE) H5Tset_order(str_type, H5T_ORDER_LE); @@ -993,7 +993,7 @@ done: * Purpose: Dump the data type. Data type can be HDF5 predefined * atomic data type or committed/transient data type. * - * Return: void + * Return: void * * Programmer: Ruey-Hsia Li * @@ -1023,7 +1023,7 @@ dump_datatype(hid_t type) * Purpose: Dump the data space. Data space can be named data space, * array, or others. * - * Return: void + * Return: void * * Programmer: Ruey-Hsia Li * @@ -1375,9 +1375,9 @@ dump_all(hid_t group, const char *name, void * op_data) "TargetPath=\"%s\" TargetObj=\"%s\" " "Parents=\"%s\" H5ParentPaths=\"%s\" />\n", xmlnsprefix, - t_name, - linkxid, - t_tmp, + t_name, + linkxid, + t_tmp, t_targbuf, targetxid, parentxid, t_prefix); free(targetxid); @@ -1389,10 +1389,10 @@ dump_all(hid_t group, const char *name, void * op_data) "TargetPath=\"%s\" " "Parents=\"%s\" H5ParentPaths=\"%s\" />\n", xmlnsprefix, - t_name, + t_name, linkxid, - t_tmp, - t_targbuf, + t_tmp, + t_targbuf, parentxid, t_prefix); } @@ -1490,13 +1490,13 @@ dump_all(hid_t group, const char *name, void * op_data) "H5Path=\"%s\" Parents=\"%s\" " "H5ParentPaths=\"%s\">\n", xmlnsprefix, - t_name, dsetxid, get_next_xid(), + t_name, dsetxid, get_next_xid(), t_tmp, parentxid, (strcmp(prefix, "") ? t_prefix : "/")); indentation(indent + COL); xml_name_to_XID(dset_table->objs[i].objname,pointerxid,100,1); - printf("<%sDatasetPtr OBJ-XID=\"%s\" H5Path=\"%s\"/>\n", + printf("<%sDatasetPtr OBJ-XID=\"%s\" H5Path=\"%s\"/>\n", xmlnsprefix, pointerxid,t_tmp); indentation(indent); @@ -1515,7 +1515,7 @@ dump_all(hid_t group, const char *name, void * op_data) goto done; } else { dset_table->objs[i].displayed = 1; - + } } @@ -1632,7 +1632,7 @@ dump_group(hid_t gid, const char *name) H5Gget_objinfo(gid, ".", TRUE, &statbuf); - if (statbuf.nlink > 1) { + if (statbuf.nlink > 1) { i = search_obj(group_table, statbuf.objno); if (i < 0) { @@ -1644,7 +1644,7 @@ dump_group(hid_t gid, const char *name) indentation(indent); printf("%s \"%s\"\n", HARDLINK, group_table->objs[i].objname); } else { - + group_table->objs[i].displayed = 1; H5Aiterate(gid, NULL, dump_attr, NULL); H5Giterate(gid, ".", NULL, dump_all, (void *) &xtype); @@ -1683,15 +1683,15 @@ dump_dataset(hid_t did, const char *name, struct subset_t *sset) dump_header_format->datasetblockbegin); type = H5Dget_type(did); space = H5Dget_space(did); - dcpl_id = H5Dget_create_plist(did); - + dcpl_id = H5Dget_create_plist(did); + dump_comment(did); dump_datatype(type); dump_dataspace(space); if (display_oid) dump_oid(did); - + if (display_dcpl) dump_dcpl(dcpl_id, type, did); @@ -1966,7 +1966,7 @@ dump_data(hid_t obj_id, int obj_data, struct subset_t *sset, int pindex) status = h5tools_dump_dset(stdout, outputformat, obj_id, -1, sset, depth); H5Tclose(f_type); } else { - /* need to call h5tools_dump_mem for the attribute data */ + /* need to call h5tools_dump_mem for the attribute data */ space = H5Aget_space(obj_id); space_type = H5Sget_simple_extent_type(space); if(space_type == H5S_NO_CLASS || space_type == H5S_COMPLEX) { @@ -1985,7 +1985,7 @@ dump_data(hid_t obj_id, int obj_data, struct subset_t *sset, int pindex) alloc_size = nelmts * MAX(H5Tget_size(type), H5Tget_size(p_type)); assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ - + buf = malloc((size_t)alloc_size); assert(buf); @@ -2019,9 +2019,9 @@ dump_data(hid_t obj_id, int obj_data, struct subset_t *sset, int pindex) status = h5tools_dump_mem(stdout, outputformat, obj_id, p_type, space, buf, depth); - + free(buf); - H5Tclose(p_type); + H5Tclose(p_type); H5Tclose(type); } H5Sclose(space); @@ -2082,10 +2082,10 @@ dump_oid(hid_t oid) static void dump_comment(hid_t obj_id) { char comment[50]; - + comment[0] = '\0'; H5Gget_comment(obj_id, ".", sizeof(comment), comment); - + if (comment[0]) { indentation(indent); printf("COMMENT \"%s\"\n", comment); @@ -2175,15 +2175,15 @@ dump_dcpl(hid_t dcpl_id,hid_t type_id, hid_t obj_id) ioffset=H5Dget_offset(obj_id); next=H5Pget_external_count(dcpl_id); strcpy(f_name,"\0"); - + /*------------------------------------------------------------------------- - * STORAGE_LAYOUT + * STORAGE_LAYOUT *------------------------------------------------------------------------- */ indentation(indent + COL); printf("%s %s\n", STORAGE_LAYOUT, BEGIN); - if (H5D_CHUNKED == H5Pget_layout(dcpl_id)) + if (H5D_CHUNKED == H5Pget_layout(dcpl_id)) { /*start indent */ indent += COL; @@ -2191,7 +2191,7 @@ dump_dcpl(hid_t dcpl_id,hid_t type_id, hid_t obj_id) printf("%s ", CHUNKED); rank = H5Pget_chunk(dcpl_id,NELMTS(chsize),chsize); HDfprintf(stdout,"%s %Hu", dump_header_format->dataspacedimbegin, chsize[0]); - for ( i=1; idataspacedimend); indentation(indent + COL); @@ -2201,7 +2201,7 @@ dump_dcpl(hid_t dcpl_id,hid_t type_id, hid_t obj_id) indentation(indent + COL); printf("%s\n",END); } - else if (H5D_COMPACT == H5Pget_layout(dcpl_id)) + else if (H5D_COMPACT == H5Pget_layout(dcpl_id)) { /*start indent */ indent += COL; @@ -2214,13 +2214,13 @@ dump_dcpl(hid_t dcpl_id,hid_t type_id, hid_t obj_id) indentation(indent + COL); printf("%s\n",END); } - else if (H5D_CONTIGUOUS == H5Pget_layout(dcpl_id)) + else if (H5D_CONTIGUOUS == H5Pget_layout(dcpl_id)) { /*------------------------------------------------------------------------- * EXTERNAL_FILE *------------------------------------------------------------------------- */ - if (next) + if (next) { /*start indent */ indent += COL; @@ -2261,7 +2261,7 @@ dump_dcpl(hid_t dcpl_id,hid_t type_id, hid_t obj_id) } } /*------------------------------------------------------------------------- - * FILTERS + * FILTERS *------------------------------------------------------------------------- */ nfilters = H5Pget_nfilters(dcpl_id); @@ -2272,17 +2272,17 @@ dump_dcpl(hid_t dcpl_id,hid_t type_id, hid_t obj_id) if (nfilters) { - for (i=0; inobjs; i++) - if (!type_table->objs[i].recorded) + if (!type_table->objs[i].recorded) { did = H5Dopen(gid, type_table->objs[i].objname); tid = H5Dget_type(did); @@ -2817,7 +2817,7 @@ handle_datasets(hid_t fid, char *dset, void *data) if ((dsetid = H5Dopen(fid, dset)) < 0) { begin_obj(dump_header_format->datasetbegin, dset, - dump_header_format->datasetblockbegin); + dump_header_format->datasetblockbegin); indentation(COL); error_msg(progname, "unable to open dataset \"%s\"\n", dset); end_obj(dump_header_format->datasetend, @@ -2929,7 +2929,7 @@ handle_groups(hid_t fid, char *group, void UNUSED * data) if ((gid = H5Gopen(fid, group)) < 0) { begin_obj(dump_header_format->groupbegin, group, - dump_header_format->groupblockbegin); + dump_header_format->groupblockbegin); indentation(COL); error_msg(progname, "unable to open group \"%s\"\n", group); end_obj(dump_header_format->groupend, @@ -3037,15 +3037,15 @@ handle_datatypes(hid_t fid, char *type, void UNUSED * data) if (!type_table->objs[idx].recorded) { /* unamed data type */ sprintf(name, "#%lu:%lu\n", - type_table->objs[idx].objno[0], + type_table->objs[idx].objno[0], type_table->objs[idx].objno[1]); sprintf(name1, "/#%lu:%lu\n", - type_table->objs[idx].objno[0], + type_table->objs[idx].objno[0], type_table->objs[idx].objno[1]); if (!strncmp(name, type, strlen(type)) || !strncmp(name1, type, strlen(type))) break; - } + } idx++; } @@ -3053,7 +3053,7 @@ handle_datatypes(hid_t fid, char *type, void UNUSED * data) if (idx == type_table->nobjs) { /* unknown type */ begin_obj(dump_header_format->datatypebegin, type, - dump_header_format->datatypeblockbegin); + dump_header_format->datatypeblockbegin); indentation(COL); error_msg(progname, "unable to open datatype \"%s\"\n", type); end_obj(dump_header_format->datatypeend, @@ -3555,7 +3555,7 @@ main(int argc, const char *argv[]) ns = strdup(xmlnsprefix); indx = strrchr(ns,(int)':'); if (indx) *indx = '\0'; - + printf("<%sHDF5-File xmlns:%s=\"http://hdf.ncsa.uiuc.edu/DTDs/HDF5-File\" " "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " "xsi:schemaLocation=\"http://hdf.ncsa.uiuc.edu/DTDs/HDF5File " @@ -3568,7 +3568,7 @@ main(int argc, const char *argv[]) } } - if (!doxml) + if (!doxml) { if (display_fi) { @@ -3576,11 +3576,11 @@ main(int argc, const char *argv[]) end_obj(dump_header_format->fileend,dump_header_format->fileblockend); goto done; } - + if (display_bb) dump_fcpl(fid); } - + if (display_all) { if ((gid = H5Gopen(fid, "/")) < 0) { @@ -3620,39 +3620,39 @@ done: d_status = EXIT_FAILURE; free_handler(hand, argc); - + for(i=0; inobjs; i++) { if(info.group_table->objs[i].objname) free(info.group_table->objs[i].objname); } free(group_table->objs); - + for(i=0; inobjs; i++) { if(info.dset_table->objs[i].objname) free(info.dset_table->objs[i].objname); } free(dset_table->objs); - + for(i=0; inobjs; i++) { if(info.type_table->objs[i].objname) free(info.type_table->objs[i].objname); } free(type_table->objs); - + free(prefix); free(info.prefix); /* To Do: clean up XML table */ H5Eset_auto(func, edata); - + leave(d_status); } /*------------------------------------------------------------------------- * Function: print_enum * - * Purpose: prints the enum data + * Purpose: prints the enum data * * Return: void * @@ -3661,7 +3661,7 @@ done: * Modifications: * * NOTE: this function was taken from h5ls. should be moved into the toolslib - * + * *-----------------------------------------------------------------------*/ static void print_enum(hid_t type) @@ -3761,7 +3761,7 @@ print_enum(hid_t type) /* - * create a string suitable for and XML NCNAME. Uses the + * create a string suitable for and XML NCNAME. Uses the * object reference to create the string. * * 'gen'; 0 - return null if not found @@ -4065,7 +4065,7 @@ xml_print_datatype(hid_t type, unsigned in_group) } } else { - + switch (H5Tget_class(type)) { case H5T_INTEGER: indentation(indent); @@ -4108,9 +4108,9 @@ xml_print_datatype(hid_t type, unsigned in_group) break; case H5T_FLOAT: - /* */ ord = H5Tget_order(type); indentation(indent); @@ -4160,7 +4160,7 @@ xml_print_datatype(hid_t type, unsigned in_group) str_pad = H5Tget_strpad(type); cset = H5Tget_cset(type); is_vlstr = H5Tis_variable_str(type); - + indentation(indent); printf("<%sAtomicType>\n",xmlnsprefix); indent += COL; @@ -4173,7 +4173,7 @@ xml_print_datatype(hid_t type, unsigned in_group) } if(is_vlstr) printf("StrSize=\"H5T_VARIABLE\" StrPad=\""); - else + else printf("StrSize=\"%d\" StrPad=\"", (int) size); if (str_pad == H5T_STR_NULLTERM) { printf("H5T_STR_NULLTERM\"/>\n"); @@ -4476,7 +4476,7 @@ xml_dump_dataspace(hid_t space) case H5S_SCALAR: /* scalar dataspace (just a tag, no XML attrs. defined */ printf("<%sScalarDataspace />\n",xmlnsprefix); - + break; case H5S_SIMPLE: /* simple dataspace */ @@ -4502,11 +4502,11 @@ xml_dump_dataspace(hid_t space) } indentation(indent + COL + COL); printf("\n", xmlnsprefix ); - + break; case H5S_COMPLEX: printf("\n"); - + break; case H5S_NO_CLASS: default: @@ -4784,7 +4784,7 @@ xml_dump_named_datatype(hid_t type, const char *name) xml_name_to_XID(tmp,dtxid,100,1); xml_name_to_XID(prefix,parentxid,100,1); if (strncmp(name, "#", 1) == 0) { - /* Special: this is an 'anonymous' NDT, deleted but + /* Special: this is an 'anonymous' NDT, deleted but still in use. We follow the dumper's undocumented practice, and use its object id as its name. @@ -4795,13 +4795,13 @@ xml_dump_named_datatype(hid_t type, const char *name) printf("<%sNamedDataType Name=\"%s\" OBJ-XID=\"%s\" " "Parents=\"%s\" H5ParentPaths=\"%s\">\n", xmlnsprefix, - name, dtxid, + name, dtxid, parentxid,(strcmp(prefix, "") ? t_prefix : "/")); } else { printf("<%sNamedDataType Name=\"%s\" OBJ-XID=\"%s\" " "H5Path=\"%s\" Parents=\"%s\" H5ParentPaths=\"%s\">\n", xmlnsprefix, - t_name, dtxid, + t_name, dtxid, t_tmp, parentxid, (strcmp(prefix, "") ? t_prefix : "/")); } free(dtxid); @@ -4904,7 +4904,7 @@ xml_dump_group(hid_t gid, const char *name) xml_name_to_XID(par,parentxid,100,1); printf("<%sGroup Name=\"%s\" OBJ-XID=\"%s-%d\" H5Path=\"%s\" " "Parents=\"%s\" H5ParentPaths=\"%s\">\n", - xmlnsprefix,t_name, grpxid, get_next_xid(), + xmlnsprefix,t_name, grpxid, get_next_xid(), t_objname, parentxid, par_name); free(t_objname); free(par_name); @@ -5000,7 +5000,7 @@ xml_dump_group(hid_t gid, const char *name) xml_name_to_XID(par,parentxid,100,1); printf("<%sGroup Name=\"%s\" OBJ-XID=\"%s\" H5Path=\"%s\" " "Parents=\"%s\" H5ParentPaths=\"%s\" >\n", - xmlnsprefix,t_name, grpxid, t_tmp, + xmlnsprefix,t_name, grpxid, t_tmp, parentxid, par_name); free(t_tmp); free(par_name); @@ -5208,7 +5208,7 @@ xml_print_strs(hid_t did, int source) space = H5Aget_space(did); ssiz = H5Sget_simple_extent_npoints(space); ssiz *= H5Tget_size(type); - + buf = malloc((size_t)ssiz); if (buf == NULL) { return FAIL; @@ -5237,7 +5237,7 @@ xml_print_strs(hid_t did, int source) onestring = *(char **)bp; if(onestring) str_size = (size_t)HDstrlen(onestring); - } else { + } else { HDstrncpy(onestring, bp, tsiz); str_size = tsiz; } @@ -5251,7 +5251,7 @@ xml_print_strs(hid_t did, int source) printf("\"%s\"\n", t_onestring); free(t_onestring); } - + bp += tsiz; } @@ -5309,7 +5309,7 @@ check_compression(hid_t dcpl) * Function: check_filters * * Purpose: private function to check for the filters and - * put tags in the XML. + * put tags in the XML. * * Return: void * @@ -5368,13 +5368,13 @@ check_filters(hid_t dcpl) printf("Mode =\"Hardware\" "); } else if (cd_values[0] & H5_SZIP_ALLOW_K13_OPTION_MASK) { printf("Mode =\"K13\" "); - } + } printf("Coding=\""); if (cd_values[0] & H5_SZIP_EC_OPTION_MASK) { printf("Entropy"); } else if (cd_values[0] & H5_SZIP_NN_OPTION_MASK) { printf("NN"); - } + } printf("\" "); printf("ByteOrder=\""); @@ -5382,12 +5382,12 @@ check_filters(hid_t dcpl) printf("LSB"); } else if (cd_values[0] & H5_SZIP_MSB_OPTION_MASK) { printf("MSB"); - } + } printf("\" "); if (cd_values[0] & H5_SZIP_RAW_OPTION_MASK) { printf("Header=\"Raw\""); - } + } printf("/>\n"); } else { /* unknown option */ @@ -5645,13 +5645,13 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) H5Pget_fill_time(dcpl, &ft); printf("FillTime=\""); switch ( ft ) { - case H5D_FILL_TIME_ALLOC: + case H5D_FILL_TIME_ALLOC: printf("FillOnAlloc"); break; - case H5D_FILL_TIME_NEVER: + case H5D_FILL_TIME_NEVER: printf("FillNever"); break; - case H5D_FILL_TIME_IFSET: + case H5D_FILL_TIME_IFSET: printf("FillIfSet"); break; default: @@ -5662,16 +5662,16 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) H5Pget_alloc_time(dcpl, &at); printf("AllocationTime=\""); switch ( at ) { - case H5D_ALLOC_TIME_EARLY: + case H5D_ALLOC_TIME_EARLY: printf("Early"); break; case H5D_ALLOC_TIME_INCR: printf("Incremental"); break; - case H5D_ALLOC_TIME_LATE: + case H5D_ALLOC_TIME_LATE: printf("Late"); break; - case H5D_ALLOC_TIME_DEFAULT: + case H5D_ALLOC_TIME_DEFAULT: default: printf("?"); break; @@ -5708,7 +5708,7 @@ xml_dump_dataset(hid_t did, const char *name, struct subset_t UNUSED * sset) H5Aiterate(did, NULL, dump_function_table->dump_attribute_function, NULL); indent -= COL; tempi = H5Dget_storage_size(did); - + if (display_data && (tempi > 0)) { switch (H5Tget_class(type)) { case H5T_INTEGER: @@ -5930,7 +5930,7 @@ h5_fileaccess(void) const char *name; char s[1024]; hid_t fapl = -1; - + /* First use the environment variable, then the constant */ val = HDgetenv("HDF5_DRIVER"); #ifdef HDF5_DRIVER @@ -5939,7 +5939,7 @@ h5_fileaccess(void) if ((fapl=H5Pcreate(H5P_FILE_ACCESS))<0) return -1; if (!val || !*val) return fapl; /*use default*/ - + HDstrncpy(s, val, sizeof s); s[sizeof(s)-1] = '\0'; if (NULL==(name=HDstrtok(s, " \t\n\r"))) return fapl; diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index 623f6b6..84bf7e6 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -87,16 +87,16 @@ */ /* utility functions */ -static int +static int write_attr(hid_t loc_id, int rank, hsize_t *dims, const char *attr_name, hid_t type_id, void *buf); -static int +static int write_dset( hid_t loc_id, int rank, hsize_t *dims, const char *dset_name, hid_t type_id, void *buf ); /* a filter operation callback function */ static size_t -myfilter(unsigned int UNUSED flags, size_t UNUSED cd_nelmts, +myfilter(unsigned int UNUSED flags, size_t UNUSED cd_nelmts, const unsigned int UNUSED *cd_values, size_t nbytes, size_t UNUSED *buf_size, void UNUSED **buf); @@ -178,11 +178,11 @@ typedef struct s1_t { #define F41_RANK 1 #define F41_ARRAY_RANK 1 #define F41_ARRAY_RANKd 2 -#define F41_DIMb 4 -#define F41_ARRAY_DIMc 6 -#define F41_ARRAY_DIMd1 5 -#define F41_ARRAY_DIMd2 6 -#define F41_ARRAY_DIMf 10 +#define F41_DIMb 4 +#define F41_ARRAY_DIMc 6 +#define F41_ARRAY_DIMd1 5 +#define F41_ARRAY_DIMd2 6 +#define F41_ARRAY_DIMf 10 /* "File 42" macros */ /* Name of dataset to create in datafile */ @@ -200,9 +200,9 @@ typedef struct s1_t { static void gent_group(void) { hid_t fid, group; - + fid = H5Fcreate(FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - + /* / */ group = H5Gcreate (fid, "/g1", 0); H5Gclose(group); @@ -210,17 +210,17 @@ static void gent_group(void) H5Gclose(group); group = H5Gcreate (fid, "/g3", 0); H5Gclose(group); - + /* /g1 */ group = H5Gcreate (fid, "/g1/g1.1", 0); H5Gclose(group); group = H5Gcreate (fid, "/g1/g1.2", 0); H5Gclose(group); - + /* /g2 */ group = H5Gcreate (fid, "/g2/g2.1", 0); H5Gclose(group); - + /* /g3 */ group = H5Gcreate (fid, "/g3/g3.1", 0); H5Gclose(group); @@ -230,7 +230,7 @@ static void gent_group(void) H5Gclose(group); group = H5Gcreate (fid, "/g3/g3.4", 0); H5Gclose(group); - + /* /g2/g2.1 */ group = H5Gcreate (fid, "/g2/g2.1/g2.1.1", 0); H5Gclose(group); @@ -238,7 +238,7 @@ static void gent_group(void) H5Gclose(group); group = H5Gcreate (fid, "/g2/g2.1/g2.1.3", 0); H5Gclose(group); - + H5Fclose(fid); } @@ -249,9 +249,9 @@ static void gent_dataset(void) int dset1[10][20]; double dset2[30][20]; int i, j; - + fid = H5Fcreate(FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - + /* dset1 */ dims[0] = 10; dims[1] = 20; space = H5Screate_simple(2, dims, NULL); @@ -264,7 +264,7 @@ static void gent_dataset(void) H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1); H5Sclose(space); H5Dclose(dataset); - + /* dset2 */ dims[0] = 30; dims[1] = 20; space = H5Screate_simple(2, dims, NULL); @@ -275,7 +275,7 @@ static void gent_dataset(void) dset2[i][j] = 0.0001*j+i; H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2); - + H5Sclose(space); H5Dclose(dataset); H5Fclose(fid); @@ -289,12 +289,12 @@ static void gent_dataset2(void) int dset1[10][20]; double dset2[30][10]; int i, j; - + fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); create_plist = H5Pcreate(H5P_DATASET_CREATE); dims[0] = 5; dims[1] = 5; H5Pset_chunk(create_plist, 2, dims); - + /* dset1 */ dims[0] = 10; dims[1] = 20; maxdims[0] = H5S_UNLIMITED; maxdims[1] = 20; @@ -308,7 +308,7 @@ static void gent_dataset2(void) H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset1); H5Sclose(space); H5Dclose(dataset); - + /* dset2 */ dims[0] = 30; dims[1] = 10; maxdims[0] = 30; maxdims[1] = H5S_UNLIMITED; @@ -337,10 +337,10 @@ static void gent_attribute(void) double d[10]; char string[]= "string attribute"; int point = 100; - + fid = H5Fcreate(FILE3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); root = H5Gopen (fid, "/"); - + /* attribute 1 */ dims[0] = 24; space = H5Screate_simple(1, dims, NULL); @@ -349,7 +349,7 @@ static void gent_attribute(void) H5Awrite(attr, H5T_NATIVE_SCHAR, buf); H5Sclose(space); H5Aclose(attr); - + /* attribute 2 */ dims[0] = 10; space = H5Screate_simple(1, dims, NULL); @@ -360,7 +360,7 @@ static void gent_attribute(void) H5Awrite(attr, H5T_NATIVE_INT, data); H5Sclose(space); H5Aclose(attr); - + /* attribute 3 */ dims[0] = 10; space = H5Screate_simple(1, dims, NULL); @@ -371,14 +371,14 @@ static void gent_attribute(void) H5Awrite(attr, H5T_NATIVE_DOUBLE, d); H5Sclose(space); H5Aclose(attr); - + /* attribute 4 */ space = H5Screate(H5S_SCALAR); attr = H5Acreate (root, "attr4", H5T_STD_I32BE, space, H5P_DEFAULT); H5Awrite(attr, H5T_NATIVE_INT, &point); H5Sclose(space); H5Aclose(attr); - + /* attribute 5 */ space = H5Screate(H5S_SCALAR); type = H5Tcopy(H5T_C_S1); @@ -396,7 +396,7 @@ static void gent_attribute(void) static void gent_softlink(void) { hid_t fid, root; - + fid = H5Fcreate(FILE4, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); root = H5Gopen (fid, "/"); H5Glink (root, H5G_LINK_SOFT, "somevalue", "slink1"); @@ -424,9 +424,9 @@ static void gent_hardlink(void) hid_t fid, group, dataset, space; hsize_t dim = 5; int i, dset[5]; - + fid = H5Fcreate(FILE5, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - + space = H5Screate_simple(1, &dim, NULL); dataset = H5Dcreate(fid, "/dset1", H5T_STD_I32BE, space, H5P_DEFAULT); @@ -435,15 +435,15 @@ static void gent_hardlink(void) H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset); H5Sclose(space); H5Dclose(dataset); - + group = H5Gcreate (fid, "/g1", 0); H5Glink (group, H5G_LINK_HARD, "/dset1", "dset2"); H5Gclose(group); - + group = H5Gcreate (fid, "/g2", 0); H5Glink (group, H5G_LINK_HARD, "/dset1", "dset3"); H5Gclose(group); - + group = H5Gopen(fid, "/g1"); H5Glink (group, H5G_LINK_HARD, "/g2", "g1.1"); H5Gclose(group); @@ -498,12 +498,12 @@ static void gent_compound_dt(void) { /* test compound data type */ hsize_t sdim = 5; hsize_t dset3_dim[2]; - + for (i = 0; i < (int)sdim; i++) { - dset1[i].a = i; + dset1[i].a = i; dset1[i].b = (float)(i*i); dset1[i].c = (float)(1./(i+1)); - + dset2[i].a = i; dset2[i].b = (float)(i+ i*0.1); @@ -520,7 +520,7 @@ static void gent_compound_dt(void) { /* test compound data type */ space = H5Screate_simple(1, &sdim, NULL); type = H5Tcreate (H5T_COMPOUND, sizeof(dset1[0])); - type2 = H5Tcreate(H5T_COMPOUND, sizeof(dset1[0])); + type2 = H5Tcreate(H5T_COMPOUND, sizeof(dset1[0])); H5Tinsert(type, "a_name", HOFFSET(dset1_t, a), H5T_STD_I32BE); H5Tinsert(type, "b_name", HOFFSET(dset1_t, b), H5T_IEEE_F32BE); H5Tinsert(type, "c_name", HOFFSET(dset1_t, c), H5T_IEEE_F64BE); @@ -687,10 +687,10 @@ static void gent_compound_dt2(void) { /* test compound data type */ sdim = 10; for (i = 0; i < (int)sdim; i++) { - dset1[i].a = i; + dset1[i].a = i; dset1[i].b = (float)(i*i); dset1[i].c = (float)(1./(i+1)); - + dset2[i].a = i; dset2[i].b = (float)(i+ i*0.1); @@ -714,7 +714,7 @@ static void gent_compound_dt2(void) { /* test compound data type */ space = H5Screate_simple(1, &sdim, &maxdim); type = H5Tcreate (H5T_COMPOUND, sizeof(dset1[0])); - + H5Tinsert(type, "a_name", HOFFSET(dset1_t, a), H5T_STD_I32BE); H5Tinsert(type, "b_name", HOFFSET(dset1_t, b), H5T_IEEE_F32BE); H5Tinsert(type, "c_name", HOFFSET(dset1_t, c), H5T_IEEE_F64BE); @@ -722,7 +722,7 @@ static void gent_compound_dt2(void) { /* test compound data type */ dataset = H5Dcreate(fid, "/dset1", type, space, create_plist); type2 = H5Tcreate (H5T_COMPOUND, sizeof(dset1[0])); - + H5Tinsert(type2, "a_name", HOFFSET(dset1_t, a), H5T_NATIVE_INT); H5Tinsert(type2, "b_name", HOFFSET(dset1_t, b), H5T_NATIVE_FLOAT); H5Tinsert(type2, "c_name", HOFFSET(dset1_t, c), H5T_NATIVE_DOUBLE); @@ -751,7 +751,7 @@ static void gent_compound_dt2(void) { /* test compound data type */ type2 = H5Tcreate (H5T_COMPOUND, sizeof(dset2_t)); H5Tinsert(type2, "int_name", HOFFSET(dset2_t, a), H5T_NATIVE_INT); - H5Tinsert(type2, "float_name", HOFFSET(dset2_t, b), H5T_NATIVE_FLOAT); + H5Tinsert(type2, "float_name", HOFFSET(dset2_t, b), H5T_NATIVE_FLOAT); H5Dwrite(dataset, type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2); H5Tclose(type); @@ -938,7 +938,7 @@ float dset2_1[10], dset2_2[3][5]; H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_1); H5Sclose(space); H5Dclose(dataset); - + /* dset2.2 */ dims[0] = 3; dims[1] = 5; space = H5Screate_simple(2, dims, NULL); @@ -960,9 +960,9 @@ float dset2_1[10], dset2_2[3][5]; o /___\ g1 o/ \o g2 - \___/ + \___/ + - o - group objects */ @@ -997,7 +997,7 @@ hid_t fid, group; H5Gclose(group); /* create path from object at /g1 to object at /g2 and name it g1.1 */ - H5Glink (fid, H5G_LINK_HARD, "/g2", "/g1/g1.1"); + H5Glink (fid, H5G_LINK_HARD, "/g2", "/g1/g1.1"); /* create path from object at /g2 to object at /g1 and name it g2.1 */ H5Glink (fid, H5G_LINK_SOFT, "/g1", "/g2/g2.1"); @@ -1122,7 +1122,7 @@ static void gent_many(void) { idx[perm[1]] = i1; for (i0 = 0; i0 < 2; i0++) { idx[perm[0]] = i0; - + dset1[j].a[idx[3]][idx[2]][idx[1]][idx[0]] = i0+j; dset1[j].b[idx[3]][idx[2]][idx[1]][idx[0]] = (double)(i0+j); #ifdef WIN32 @@ -1224,18 +1224,18 @@ static void gent_str(void) { hsize_t dims2[]={20}; char string2[20][10] = {"ab cd ef1", "ab cd ef2", "ab cd ef3", "ab cd ef4", - "ab cd ef5", "ab cd ef6", "ab cd ef7", "ab cd ef8", - "ab cd ef9", "ab cd ef0", "ab cd ef1", "ab cd ef2", - "ab cd ef3", "ab cd ef4", "ab cd ef5", "ab cd ef6", + "ab cd ef5", "ab cd ef6", "ab cd ef7", "ab cd ef8", + "ab cd ef9", "ab cd ef0", "ab cd ef1", "ab cd ef2", + "ab cd ef3", "ab cd ef4", "ab cd ef5", "ab cd ef6", "ab cd ef7", "ab cd ef8", "ab cd ef9", "ab cd ef0"}; hsize_t dims3[] = { 27}; - char string3[27][6] = {"abcd0", "abcd1", "abcd2", "abcd3", - "abcd4", "abcd5", "abcd6", "abcd7", - "abcd8", "abcd9", "abcd0", "abcd1", - "abcd2", "abcd3", "abcd4", "abcd5", - "abcd6", "abcd7", "abcd8", "abcd9", - "abcd0", "abcd1", "abcd2", "abcd3", + char string3[27][6] = {"abcd0", "abcd1", "abcd2", "abcd3", + "abcd4", "abcd5", "abcd6", "abcd7", + "abcd8", "abcd9", "abcd0", "abcd1", + "abcd2", "abcd3", "abcd4", "abcd5", + "abcd6", "abcd7", "abcd8", "abcd9", + "abcd0", "abcd1", "abcd2", "abcd3", "abcd4", "abcd5", "abcd6"}; int i, j, k, l; @@ -1335,7 +1335,7 @@ static void gent_str(void) { for (k = 0 ; k < 12; k++) strcpy(comp1[i][j].s[k], "abcdefgh12345678abcdefgh12345678"); } - + dataset = H5Dcreate(fid, "/comp1", f_type, space, H5P_DEFAULT); H5Dwrite(dataset, f_type2, H5S_ALL, H5S_ALL, H5P_DEFAULT, comp1); @@ -1351,8 +1351,8 @@ static void gent_str(void) { / / / | \ \ \ g1 g2 g3 g4 g5 g6 - | | | | \ \ - string1 string3 string5 + | | | | \ \ + string1 string3 string5 string2 string4 string6 */ @@ -1635,7 +1635,7 @@ static void gent_objref(void) /* Close disk dataspace */ H5Sclose(sid1); - + /* Close Dataset */ H5Dclose(dataset); @@ -1739,13 +1739,13 @@ static void gent_datareg(void) /* Close disk dataspace */ H5Sclose(sid1); - + /* Close Dataset */ H5Dclose(dset1); /* Close uint8 dataset dataspace */ H5Sclose(sid2); - + /* Close file */ H5Fclose(fid1); @@ -1769,8 +1769,8 @@ static void gent_nestcomp(void) typedef struct s1_t { int a; float b; - double c; - cmp_t d; + double c; + cmp_t d; } s2_t; hid_t cmp_tid; /* Handle for the compound datatype */ hid_t char_id; /* Handle for the string datatype */ @@ -1812,16 +1812,16 @@ static void gent_nestcomp(void) file = H5Fcreate(FILE18, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); /* - * Create the memory data type. + * Create the memory data type. */ - /* + /* * Create a datatype for compound field first. */ cmp_tid = H5Tcreate (H5T_COMPOUND, sizeof(cmp_t)); /* We are using C string of length one to represent "real" character */ char_id = H5Tcopy(H5T_C_S1); - H5Tset_strpad(char_id, H5T_STR_NULLTERM); + H5Tset_strpad(char_id, H5T_STR_NULLTERM); H5Tinsert(cmp_tid, "char_name", HOFFSET(cmp_t, a), char_id); array_dt=H5Tarray_create(H5T_NATIVE_FLOAT,ndims,array_dims,NULL); @@ -1836,13 +1836,13 @@ static void gent_nestcomp(void) /* Insert compound memeber created above */ H5Tinsert(s2_tid, "d_name", HOFFSET(s2_t, d), cmp_tid); - /* + /* * Create the dataset. */ dataset = H5Dcreate(file, datasetname, s2_tid, space, H5P_DEFAULT); /* - * Wtite data to the dataset; + * Wtite data to the dataset; */ status = H5Dwrite(dataset, s2_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, s1); if (status < 0) @@ -1870,7 +1870,7 @@ static void gent_opaque(void) test[x][0] = x; test[x][1] = 99 - x; } - + /* * Create the data space. */ @@ -1882,25 +1882,25 @@ static void gent_opaque(void) file = H5Fcreate(FILE19, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); /* - * Create the memory datatype. + * Create the memory datatype. */ type = H5Tcreate (H5T_OPAQUE, sizeof(char)*100*2); H5Tset_tag(type, "test opaque type"); - /* + /* * Create the dataset. */ dataset = H5Dcreate(file, "opaque test", type, space, H5P_DEFAULT); /* - * Write data to the dataset; + * Write data to the dataset; */ H5Dwrite(dataset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, test); H5Tclose(type); H5Sclose(space); H5Dclose(dataset); - H5Fclose(file); + H5Fclose(file); } static void gent_bitfields(void) @@ -1911,7 +1911,7 @@ static void gent_bitfields(void) unsigned char buf[32]; file = H5Fcreate(FILE20, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - + if ((grp=H5Gcreate(file, "typetests", 0))<0) goto error; /* bitfield_1 */ @@ -1961,7 +1961,7 @@ static void gent_vldatatypes(void) herr_t ret=0; file = H5Fcreate(FILE21, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - + /* Allocate and initialize VL dataset to write */ for(i = 0; i < SPACE1_DIM1; i++) { int j; @@ -2252,8 +2252,8 @@ static void gent_vldatatypes4(void) static void gent_vldatatypes5(void) { hvl_t wdata [SPACE1_DIM1]; - hid_t fid1; - hid_t dataset; + hid_t fid1; + hid_t dataset; hid_t sid1; hid_t tid1; hsize_t dims1[] = {SPACE1_DIM1}; @@ -2789,9 +2789,9 @@ static void gent_empty(void) static void gent_group_comments(void) { hid_t fid, group; - + fid = H5Fcreate(FILE33, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - + /* / */ group = H5Gcreate (fid, "/g1", 0); H5Gset_comment(group, "/g1", "Comment for group /g1"); @@ -2802,7 +2802,7 @@ static void gent_group_comments(void) group = H5Gcreate (fid, "/g3", 0); H5Gset_comment(group, "/g3", "Comment for group /g3"); H5Gclose(group); - + /* /g1 */ group = H5Gcreate (fid, "/g1/g1.1", 0); H5Gset_comment(group, "/g1/g1.1", "Comment for group /g1/g1.1"); @@ -2810,12 +2810,12 @@ static void gent_group_comments(void) group = H5Gcreate (fid, "/g1/g1.2", 0); H5Gset_comment(group, "/g1/g1.2", "Comment for group /g1/g1.2"); H5Gclose(group); - + /* /g2 */ group = H5Gcreate (fid, "/g2/g2.1", 0); H5Gset_comment(group, "/g2/g2.1", "Comment for group /g2/g2.1"); H5Gclose(group); - + /* /g3 */ group = H5Gcreate (fid, "/g3/g3.1", 0); H5Gset_comment(group, "/g3/g3.1", "Comment for group /g3/g3.1"); @@ -2829,7 +2829,7 @@ static void gent_group_comments(void) group = H5Gcreate (fid, "/g3/g3.4", 0); H5Gset_comment(group, "/g3/g3.4", "Comment for group /g3/g3.4"); H5Gclose(group); - + /* /g2/g2.1 */ group = H5Gcreate (fid, "/g2/g2.1/g2.1.1", 0); H5Gset_comment(group, "/g2/g2.1/g2.1.1", "Comment for group /g2/g2.1/g2.1.1"); @@ -2840,7 +2840,7 @@ static void gent_group_comments(void) group = H5Gcreate (fid, "/g2/g2.1/g2.1.3", 0); H5Gset_comment(group, "/g2/g2.1/g2.1.3", "Comment for group /g2/g2.1/g2.1.3"); H5Gclose(group); - + H5Fclose(fid); } @@ -2977,7 +2977,7 @@ static void gent_large_objname(void) hid_t fid, group, group2; char grp_name[128]; register int i; - + fid = H5Fcreate(FILE37, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); group = H5Gcreate(fid, "this_is_a_large_group_name", 0); @@ -3078,7 +3078,7 @@ static void gent_char(void) /*------------------------------------------------------------------------- * Function: write_attr_in * - * Purpose: write attributes in LOC_ID (dataset, group, named datatype) + * Purpose: write attributes in LOC_ID (dataset, group, named datatype) * * Return: void * @@ -3089,26 +3089,26 @@ static void gent_char(void) *------------------------------------------------------------------------- */ -static void write_attr_in(hid_t loc_id, +static void write_attr_in(hid_t loc_id, const char* dset_name, /* for saving reference to dataset*/ hid_t file_id) { /* Compound datatype */ - typedef struct s_t + typedef struct s_t { char a; double b; } s_t; - typedef enum + typedef enum { E_RED, E_GREEN } e_t; hid_t attr_id; - hid_t space_id; - hid_t type_id; + hid_t space_id; + hid_t type_id; herr_t status; int val, i, j, k, n; float f; @@ -3154,7 +3154,7 @@ static void write_attr_in(hid_t loc_id, * 1D attributes *------------------------------------------------------------------------- */ - + /*------------------------------------------------------------------------- * H5T_STRING *------------------------------------------------------------------------- @@ -3190,7 +3190,7 @@ static void write_attr_in(hid_t loc_id, H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); write_attr(loc_id,1,dims,"compound",type_id,buf3); status = H5Tclose(type_id); - + /*------------------------------------------------------------------------- * H5T_REFERENCE *------------------------------------------------------------------------- @@ -3217,7 +3217,7 @@ static void write_attr_in(hid_t loc_id, * H5T_VLEN *------------------------------------------------------------------------- */ - + /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; @@ -3295,7 +3295,7 @@ static void write_attr_in(hid_t loc_id, H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); write_attr(loc_id,2,dims2,"compound2D",type_id,buf32); status = H5Tclose(type_id); - + /*------------------------------------------------------------------------- * H5T_REFERENCE *------------------------------------------------------------------------- @@ -3337,7 +3337,7 @@ static void write_attr_in(hid_t loc_id, ((int *)buf52[i][j].p)[l] = n++; } } - + space_id = H5Screate_simple(2,dims2,NULL); type_id = H5Tvlen_create(H5T_NATIVE_INT); attr_id = H5Acreate(loc_id,"vlen2D",type_id,space_id,H5P_DEFAULT); @@ -3364,7 +3364,7 @@ static void write_attr_in(hid_t loc_id, write_attr(loc_id,2,dims2,"integer2D",H5T_NATIVE_INT,buf72); write_attr(loc_id,2,dims2,"float2D",H5T_NATIVE_FLOAT,buf82); - + /*------------------------------------------------------------------------- * 3D attributes *------------------------------------------------------------------------- @@ -3424,7 +3424,7 @@ static void write_attr_in(hid_t loc_id, H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); write_attr(loc_id,3,dims3,"compound3D",type_id,buf33); status = H5Tclose(type_id); - + /*------------------------------------------------------------------------- * H5T_REFERENCE *------------------------------------------------------------------------- @@ -3455,7 +3455,7 @@ static void write_attr_in(hid_t loc_id, * H5T_VLEN *------------------------------------------------------------------------- */ - + /* Allocate and initialize VL dataset to write */ n=0; for (i = 0; i < 4; i++) { @@ -3469,7 +3469,7 @@ static void write_attr_in(hid_t loc_id, } } } - + space_id = H5Screate_simple(3,dims3,NULL); type_id = H5Tvlen_create(H5T_NATIVE_INT); attr_id = H5Acreate(loc_id,"vlen3D",type_id,space_id,H5P_DEFAULT); @@ -3518,7 +3518,7 @@ static void write_attr_in(hid_t loc_id, /*------------------------------------------------------------------------- * Function: write_dset_in * - * Purpose: write datasets in LOC_ID + * Purpose: write datasets in LOC_ID * * Return: void * @@ -3529,26 +3529,26 @@ static void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ -static void write_dset_in(hid_t loc_id, +static void write_dset_in(hid_t loc_id, const char* dset_name, /* for saving reference to dataset*/ hid_t file_id) { /* Compound datatype */ - typedef struct s_t + typedef struct s_t { char a; double b; } s_t; - typedef enum + typedef enum { E_RED, E_GREEN } e_t; hid_t dset_id; - hid_t space_id; - hid_t type_id; + hid_t space_id; + hid_t type_id; hid_t plist_id; herr_t status; int val, i, j, k, n; @@ -3593,10 +3593,10 @@ static void write_dset_in(hid_t loc_id, /*------------------------------------------------------------------------- - * 1D + * 1D *------------------------------------------------------------------------- */ - + /*------------------------------------------------------------------------- * H5T_STRING *------------------------------------------------------------------------- @@ -3632,7 +3632,7 @@ static void write_dset_in(hid_t loc_id, H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); write_dset(loc_id,1,dims,"compound",type_id,buf3); status = H5Tclose(type_id); - + /*------------------------------------------------------------------------- * H5T_REFERENCE *------------------------------------------------------------------------- @@ -3659,7 +3659,7 @@ static void write_dset_in(hid_t loc_id, * H5T_VLEN *------------------------------------------------------------------------- */ - + /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; @@ -3698,7 +3698,7 @@ static void write_dset_in(hid_t loc_id, /*------------------------------------------------------------------------- - * 2D + * 2D *------------------------------------------------------------------------- */ @@ -3737,7 +3737,7 @@ static void write_dset_in(hid_t loc_id, H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); write_dset(loc_id,2,dims2,"compound2D",type_id,buf32); status = H5Tclose(type_id); - + /*------------------------------------------------------------------------- * H5T_REFERENCE *------------------------------------------------------------------------- @@ -3779,7 +3779,7 @@ static void write_dset_in(hid_t loc_id, ((int *)buf52[i][j].p)[l] = n++; } } - + space_id = H5Screate_simple(2,dims2,NULL); type_id = H5Tvlen_create(H5T_NATIVE_INT); dset_id = H5Dcreate(loc_id,"vlen2D",type_id,space_id,H5P_DEFAULT); @@ -3819,9 +3819,9 @@ static void write_dset_in(hid_t loc_id, write_dset(loc_id,2,dims2,"float2D",H5T_NATIVE_FLOAT,buf82); - + /*------------------------------------------------------------------------- - * 3D + * 3D *------------------------------------------------------------------------- */ @@ -3879,7 +3879,7 @@ static void write_dset_in(hid_t loc_id, H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); write_dset(loc_id,3,dims3,"compound3D",type_id,buf33); status = H5Tclose(type_id); - + /*------------------------------------------------------------------------- * H5T_REFERENCE *------------------------------------------------------------------------- @@ -3910,7 +3910,7 @@ static void write_dset_in(hid_t loc_id, * H5T_VLEN *------------------------------------------------------------------------- */ - + /* Allocate and initialize VL dataset to write */ n=0; for (i = 0; i < 4; i++) { @@ -3924,7 +3924,7 @@ static void write_dset_in(hid_t loc_id, } } } - + space_id = H5Screate_simple(3,dims3,NULL); type_id = H5Tvlen_create(H5T_NATIVE_INT); dset_id = H5Dcreate(loc_id,"vlen3D",type_id,space_id,H5P_DEFAULT); @@ -3974,7 +3974,7 @@ static void write_dset_in(hid_t loc_id, /*------------------------------------------------------------------------- * Function: gent_attr_all * - * Purpose: generate all datatype attributes + * Purpose: generate all datatype attributes * * Return: void * @@ -3987,7 +3987,7 @@ static void write_dset_in(hid_t loc_id, static void gent_attr_all(void) { - hid_t file_id; + hid_t file_id; hid_t dset_id; hid_t group_id; hid_t group2_id; @@ -3997,7 +3997,7 @@ static void gent_attr_all(void) herr_t status; /* Create a file and a dataset */ - file_id = H5Fcreate(FILE40, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + file_id = H5Fcreate(FILE40, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); /* Create a 1D dataset */ space_id = H5Screate_simple(1,dims,NULL); @@ -4054,12 +4054,12 @@ static void gent_attr_all(void) *------------------------------------------------------------------------- */ -static +static int write_attr(hid_t loc_id, int rank, hsize_t *dims, const char *attr_name, hid_t type_id, void *buf) { hid_t attr_id; - hid_t space_id; + hid_t space_id; herr_t status; /* Create a buf space */ @@ -4067,7 +4067,7 @@ int write_attr(hid_t loc_id, int rank, hsize_t *dims, const char *attr_name, /* Create the attribute */ attr_id = H5Acreate(loc_id,attr_name,type_id,space_id,H5P_DEFAULT); - + /* Write the buf */ if ( buf ) status = H5Awrite(attr_id,type_id,buf); @@ -4083,7 +4083,7 @@ int write_attr(hid_t loc_id, int rank, hsize_t *dims, const char *attr_name, * * Purpose: utility function to create and write a dataset in LOC_ID * - * Return: + * Return: * * Programmer: pvn@ncsa.uiuc.edu * @@ -4097,7 +4097,7 @@ int write_dset( hid_t loc_id, int rank, hsize_t *dims, const char *dset_name, hid_t type_id, void *buf ) { hid_t dset_id; - hid_t space_id; + hid_t space_id; herr_t status; /* Create a buf space */ @@ -4105,7 +4105,7 @@ int write_dset( hid_t loc_id, int rank, hsize_t *dims, const char *dset_name, /* Create a dataset */ dset_id = H5Dcreate(loc_id,dset_name,type_id,space_id,H5P_DEFAULT); - + /* Write the buf */ if ( buf ) status = H5Dwrite(dset_id,type_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf); @@ -4157,7 +4157,7 @@ static void gent_compound_complex(void) hsize_t array_dimb[] = {F41_DIMb}; /* Array dimensions */ hsize_t array_dimd[]={F41_ARRAY_DIMd1,F41_ARRAY_DIMd2}; /* Array dimensions */ hsize_t array_dimf[]={F41_ARRAY_DIMf}; /* Array dimensions */ - hid_t str_array_id; + hid_t str_array_id; int m, n, o; /* Array init loop vars */ @@ -4367,7 +4367,7 @@ static void gent_named_dtype_attr(void) * *------------------------------------------------------------------------- */ -static +static int make_dset(hid_t loc_id, const char *name, hid_t sid, @@ -4416,7 +4416,7 @@ make_external(hid_t fid) hsize_t max_size[1]; /*data space maximum size */ hsize_t size; /*bytes reserved for data in the external file*/ int ret; - + cur_size[0] = max_size[0] = 100; size = (max_size[0]*sizeof(int)/2); @@ -4470,11 +4470,11 @@ static void gent_filters(void) buf1[i][j]=n++; } } - + /* create a file */ fid = H5Fcreate(FILE44, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); assert(fid>=0); - + /* create a space */ sid = H5Screate_simple(SPACE2_RANK, dims1, NULL); @@ -4635,7 +4635,7 @@ static void gent_filters(void) ret=make_dset(fid,"all",sid,H5T_NATIVE_INT,dcpl,buf1); assert(ret>=0); - + /*------------------------------------------------------------------------- * user defined filter *------------------------------------------------------------------------- @@ -4646,9 +4646,9 @@ static void gent_filters(void) #ifdef H5_WANT_H5_V1_4_COMPAT ret=H5Zregister (MYFILTER_ID, "myfilter", myfilter); -#else +#else ret=H5Zregister (H5Z_MYFILTER); -#endif +#endif assert(ret>=0); ret=H5Pset_filter (dcpl, MYFILTER_ID, 0, 0, NULL); @@ -4668,7 +4668,7 @@ static void gent_filters(void) make_external(fid); /*------------------------------------------------------------------------- - * H5D_ALLOC_TIME_EARLY + * H5D_ALLOC_TIME_EARLY *------------------------------------------------------------------------- */ ret=H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_EARLY); @@ -4677,7 +4677,7 @@ static void gent_filters(void) assert(ret>=0); /*------------------------------------------------------------------------- - * H5D_ALLOC_TIME_INCR + * H5D_ALLOC_TIME_INCR *------------------------------------------------------------------------- */ ret=H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_INCR); @@ -4686,7 +4686,7 @@ static void gent_filters(void) assert(ret>=0); /*------------------------------------------------------------------------- - * H5D_ALLOC_TIME_LATE + * H5D_ALLOC_TIME_LATE *------------------------------------------------------------------------- */ ret=H5Pset_alloc_time(dcpl, H5D_ALLOC_TIME_LATE); @@ -4707,14 +4707,14 @@ static void gent_filters(void) ret=H5Tclose(tid); assert(ret>=0); - + /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- */ ret=H5Sclose(sid); assert(ret>=0); - + ret=H5Pclose(dcpl); assert(ret>=0); @@ -4731,7 +4731,7 @@ static void gent_filters(void) *------------------------------------------------------------------------- */ static size_t -myfilter(unsigned int UNUSED flags, size_t UNUSED cd_nelmts, +myfilter(unsigned int UNUSED flags, size_t UNUSED cd_nelmts, const unsigned int UNUSED *cd_values, size_t nbytes, size_t UNUSED *buf_size, void UNUSED **buf) { @@ -4753,17 +4753,17 @@ set_local_myfilter(hid_t dcpl_id, hid_t UNUSED type_id, hid_t UNUSED space_id) unsigned flags; /* Filter flags */ size_t cd_nelmts=0; /* Number of filter parameters */ unsigned cd_values[2]={5,6}; /* Filter parameters */ - + /* Get the filter's current parameters */ if(H5Pget_filter_by_id(dcpl_id,MYFILTER_ID,&flags,&cd_nelmts,cd_values,0,NULL)<0) return(FAIL); - cd_nelmts=2; - + cd_nelmts=2; + /* Modify the filter's parameters for this dataset */ if(H5Pmodify_filter(dcpl_id,MYFILTER_ID,flags, cd_nelmts,cd_values)<0) return(FAIL); - + return(SUCCEED); } @@ -4888,7 +4888,7 @@ static void gent_fcontents(void) static void gent_fvalues(void) { /* compound datatype */ - typedef struct c_t + typedef struct c_t { char a; double b; @@ -4914,7 +4914,7 @@ static void gent_fvalues(void) /* create a file */ fid = H5Fcreate(FILE48, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); assert(fid>=0); - + /* create a space */ sid = H5Screate_simple(1, dims, NULL); @@ -4957,7 +4957,7 @@ static void gent_fvalues(void) ret=H5Pset_fill_value(dcpl, H5T_NATIVE_INT, &fillval1); assert(ret>=0); - + ret=make_dset(fid,"fill_time_alloc",sid,H5T_NATIVE_INT,dcpl,buf); assert(ret>=0); @@ -4988,7 +4988,7 @@ static void gent_fvalues(void) assert(ret>=0); /*------------------------------------------------------------------------- - * dataset with a H5T_VLEN fill value + * dataset with a H5T_VLEN fill value *------------------------------------------------------------------------- */ buf3[0].len = 1; @@ -5001,7 +5001,7 @@ static void gent_fvalues(void) tid = H5Tvlen_create(H5T_NATIVE_INT); dcpl = H5Pcreate(H5P_DATASET_CREATE); - + fillval3.p=NULL; fillval3.len=0; ret = H5Pset_fill_value(dcpl, tid, &fillval3); assert(ret>=0); @@ -5017,7 +5017,7 @@ static void gent_fvalues(void) assert(ret>=0); /*------------------------------------------------------------------------- - * dataset with a H5T_ARRAY fill value + * dataset with a H5T_ARRAY fill value *------------------------------------------------------------------------- */ tid = H5Tarray_create(H5T_NATIVE_INT,1,dimarray,NULL); @@ -5046,7 +5046,7 @@ static void gent_fvalues(void) static void gent_string(void) { /* compound datatype */ - typedef struct c_t + typedef struct c_t { int a; char str[255]; @@ -5063,7 +5063,7 @@ static void gent_string(void) "conceived in liberty\n and dedicated to the proposition that all men are created equal.", "Now we are engaged\n in a great civil war,", "testing whether that\n nation or any nation so conceived and so dedicated can long endure." - }; + }; c_t buf3 = {24, "Four score and seven\n years ago our forefathers brought forth on this continent a new nation"}; char buf4[] = {"Four score and seven\n years ago our forefathers brought forth on this continent a new nation"}; hsize_t dims1[] = {1}; @@ -5191,7 +5191,7 @@ static void gent_aindices(void) } } } - + /* create a file */ fid = H5Fcreate(FILE50, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); assert(fid>=0); @@ -5221,7 +5221,7 @@ static void gent_aindices(void) write_dset(gid[5],4,dims4,"4d",H5T_NATIVE_INT,buf4); for (i=0; i<6; i++) H5Gclose(gid[i]); - + /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c index db3020c..f5cc080 100755 --- a/tools/h5import/h5import.c +++ b/tools/h5import/h5import.c @@ -21,7 +21,7 @@ #include #include "h5import.h" -int main(int argc, char *argv[]) +int main(int argc, char *argv[]) { struct Options opt; int outfile_named = FALSE; @@ -39,14 +39,14 @@ int main(int argc, char *argv[]) const char *err7 = "Invalid type of data - %s.\n"; const char *err8 = "Invalid size of data - %s.\n"; const char *err9 = "Cannot specify more than 30 input files in one call to h5import.\n"; - + (void) setvbuf(stderr, (char *) NULL, _IOLBF, 0); (void) setvbuf(stdout, (char *) NULL, _IOLBF, 0); /* * validate the number of command line arguments */ - + if (argc < 2) { (void) fprintf(stderr, err1, argc); @@ -68,25 +68,25 @@ int main(int argc, char *argv[]) usage(argv[0]); goto err; } - + state = state_table[state][token]; switch (state) { - - case 1: /* counting input files */ - if (opt.fcount < 29) { + + case 1: /* counting input files */ + if (opt.fcount < 29) { (void) HDstrcpy(opt.infiles[opt.fcount].datafile, argv[i]); in = &(opt.infiles[opt.fcount].in); opt.infiles[opt.fcount].config = 0; - setDefaultValues(in, opt.fcount); + setDefaultValues(in, opt.fcount); opt.fcount++; } else { (void) fprintf(stderr, err9, argv[i]); goto err; } - + break; case 2: /* -c found; look for configfile */ @@ -159,7 +159,7 @@ int main(int argc, char *argv[]) (void) fprintf(stderr, err8, argv[i]); goto err; } - /*set default value for output-size */ + /*set default value for output-size */ in->outputSize = in->inputSize; break; @@ -177,11 +177,11 @@ int main(int argc, char *argv[]) usage(argv[0]); goto err; } - + if (process(&opt) == -1) goto err; - return(0); + return(0); err: (void) fprintf(stderr, err4); return(-1); @@ -208,38 +208,38 @@ gtoken(char *s) if (!HDstrncmp("outfile", &s[1], len)) token = OPT_o; break; - + case 'c': if (!HDstrncmp("config", &s[1], len)) token = OPT_c; break; - + case 'h': if (!HDstrncmp("help", &s[1], len)) token = OPT_h; - break; + break; case 'd': if (!HDstrncmp("dims", &s[1], len)) token = OPT_d; - break; + break; case 'p': if (!HDstrncmp("path", &s[1], len)) token = OPT_p; - break; + break; case 't': if (!HDstrncmp("type", &s[1], len)) token = OPT_t; - break; + break; case 's': if (!HDstrncmp("size", &s[1], len)) token = OPT_s; - break; + break; } - + if (token == ERR) (void) fprintf(stderr, err1, s); } @@ -250,7 +250,7 @@ gtoken(char *s) return (token); } -static int +static int processDataFile(char *infile, struct Input *in, FILE **strm) { const char *err1 = "Unable to open the input file %s for reading.\n"; @@ -258,8 +258,8 @@ processDataFile(char *infile, struct Input *in, FILE **strm) const char *err3 = "Error in allocating floating-point data storage.\n"; const char *err4 = "Error in reading integer data.\n"; const char *err5 = "Error in reading floating-point data.\n"; - const char *err6 = "Error in allocating unsigned integer data storage.\n"; - const char *err7 = "Error in reading unsigned integer data.\n"; + const char *err6 = "Error in allocating unsigned integer data storage.\n"; + const char *err7 = "Error in reading unsigned integer data.\n"; const char *err10 = "Unrecognized input class type.\n"; if ((*strm = fopen(infile, "r")) == NULL) @@ -275,33 +275,33 @@ processDataFile(char *infile, struct Input *in, FILE **strm) if (allocateIntegerStorage(in) == -1) { (void) fprintf(stderr, err2, infile); - return(-1); + return(-1); } if (readIntegerData(strm, in) == -1) { (void) fprintf(stderr, err4, infile); - return(-1); + return(-1); } break; case 1: /* TEXTFP */ case 2: /* TEXTFPE */ - case 3: /* FP */ + case 3: /* FP */ if (allocateFloatStorage(in) == -1) { (void) fprintf(stderr, err3, infile); - return(-1); + return(-1); } - + if (readFloatData(strm, in) == -1) { (void) fprintf(stderr, err5, infile); - return(-1); + return(-1); } break; - + case 5: /* STR */ break; @@ -310,15 +310,15 @@ processDataFile(char *infile, struct Input *in, FILE **strm) if (allocateUIntegerStorage(in) == -1) { (void) fprintf(stderr, err6, infile); - return(-1); + return(-1); } if (readUIntegerData(strm, in) == -1) { (void) fprintf(stderr, err7, infile); - return(-1); + return(-1); } break; - + default: (void) fprintf(stderr, err10); return(-1); @@ -326,7 +326,7 @@ processDataFile(char *infile, struct Input *in, FILE **strm) return (0); } -static int +static int readIntegerData(FILE **strm, struct Input *in) { H5DT_INT8 *in08; @@ -342,7 +342,7 @@ readIntegerData(FILE **strm, struct Input *in) const char *err1 = "Unable to get integer value from file.\n"; const char *err2 = "Unrecongnized input class type.\n"; - const char *err3 = "Invalid input size.\n"; + const char *err3 = "Invalid input size.\n"; for (j=0; jrank;j++) len *= in->sizeOfDimension[j]; @@ -353,38 +353,38 @@ readIntegerData(FILE **strm, struct Input *in) switch(in->inputClass) { case 0: /* TEXTIN */ - in08 = (H5DT_INT8 *) in->data; + in08 = (H5DT_INT8 *) in->data; for (i = 0; i < len; i++, in08++) - { + { if (fscanf(*strm, "%hd", &temp) != 1) { (void) fprintf(stderr, err1); return (-1); } (*in08) = (H5DT_INT8)temp; - } + } break; case 4: /* IN */ - in08 = (H5DT_INT8 *) in->data; + in08 = (H5DT_INT8 *) in->data; for (i = 0; i < len; i++, in08++) { if (fread((char *) in08, sizeof(H5DT_INT8), 1, *strm) != 1) - { + { (void) fprintf(stderr, err1); return (-1); - } + } } break; - + default: (void) fprintf(stderr, err2); return (-1); } break; - + case 16: - in16 = (H5DT_INT16 *) in->data; + in16 = (H5DT_INT16 *) in->data; switch(in->inputClass) { case 0: /* TEXTIN */ @@ -403,21 +403,21 @@ readIntegerData(FILE **strm, struct Input *in) for (i = 0; i < len; i++, in16++) { if (fread((char *) in16, sizeof(H5DT_INT16), 1, *strm) != 1) - { + { (void) fprintf(stderr, err1); return (-1); - } + } } break; - + default: (void) fprintf(stderr, err2); return (-1); } break; - + case 32: - in32 = (H5DT_INT32 *) in->data; + in32 = (H5DT_INT32 *) in->data; switch(in->inputClass) { case 0: /* TEXTIN */ @@ -435,13 +435,13 @@ readIntegerData(FILE **strm, struct Input *in) for (i = 0; i < len; i++, in32++) { if (fread((char *) in32, sizeof(H5DT_INT32), 1, *strm) != 1) - { + { (void) fprintf(stderr, err1); return (-1); - } + } } break; - + default: (void) fprintf(stderr, err2); return (-1); @@ -450,7 +450,7 @@ readIntegerData(FILE **strm, struct Input *in) #ifndef WIN32 case 64: - in64 = (H5DT_INT64 *) in->data; + in64 = (H5DT_INT64 *) in->data; switch(in->inputClass) { case 0: /* TEXTIN */ @@ -460,7 +460,7 @@ readIntegerData(FILE **strm, struct Input *in) { (void) fprintf(stderr, err1); return (-1); - } + } *in64 = (H5DT_INT64) HDstrtoll(buffer, NULL, 10); } break; @@ -469,20 +469,20 @@ readIntegerData(FILE **strm, struct Input *in) for (i = 0; i < len; i++, in64++) { if (fread((char *) in64, sizeof(H5DT_INT64), 1, *strm) != 1) - { + { (void) fprintf(stderr, err1); return (-1); - } + } } break; - + default: (void) fprintf(stderr, err2); return (-1); } break; -#endif /* ifndef WIN32 */ - +#endif /* ifndef WIN32 */ + default: (void) fprintf(stderr, err3); break; @@ -490,13 +490,13 @@ readIntegerData(FILE **strm, struct Input *in) return(0); } -static int +static int readUIntegerData(FILE **strm, struct Input *in) { H5DT_UINT8 *in08; H5DT_UINT16 *in16, temp; H5DT_UINT32 *in32; -#ifndef WIN32 +#ifndef WIN32 H5DT_UINT64 *in64; char buffer[256]; #endif @@ -516,38 +516,38 @@ readUIntegerData(FILE **strm, struct Input *in) switch(in->inputClass) { case 6: /* TEXTUIN */ - in08 = (H5DT_UINT8 *) in->data; + in08 = (H5DT_UINT8 *) in->data; for (i = 0; i < len; i++, in08++) - { + { if (fscanf(*strm, "%hu", &temp) != 1) { (void) fprintf(stderr, err1); return (-1); } (*in08) = (H5DT_UINT8)temp; - } + } break; case 7: /* UIN */ - in08 = (H5DT_UINT8 *) in->data; + in08 = (H5DT_UINT8 *) in->data; for (i = 0; i < len; i++, in08++) { if (fread((char *) in08, sizeof(H5DT_UINT8), 1, *strm) != 1) - { + { (void) fprintf(stderr, err1); return (-1); - } + } } break; - + default: (void) fprintf(stderr, err2); return (-1); } break; - + case 16: - in16 = (H5DT_UINT16 *) in->data; + in16 = (H5DT_UINT16 *) in->data; switch(in->inputClass) { case 6: /* TEXTUIN */ @@ -565,21 +565,21 @@ readUIntegerData(FILE **strm, struct Input *in) for (i = 0; i < len; i++, in16++) { if (fread((char *) in16, sizeof(H5DT_UINT16), 1, *strm) != 1) - { + { (void) fprintf(stderr, err1); return (-1); - } + } } break; - + default: (void) fprintf(stderr, err2); return (-1); } break; - + case 32: - in32 = (H5DT_UINT32 *) in->data; + in32 = (H5DT_UINT32 *) in->data; switch(in->inputClass) { case 6: /* TEXTUIN */ @@ -597,13 +597,13 @@ readUIntegerData(FILE **strm, struct Input *in) for (i = 0; i < len; i++, in32++) { if (fread((char *) in32, sizeof(H5DT_UINT32), 1, *strm) != 1) - { + { (void) fprintf(stderr, err1); return (-1); - } + } } break; - + default: (void) fprintf(stderr, err2); return (-1); @@ -612,7 +612,7 @@ readUIntegerData(FILE **strm, struct Input *in) #ifndef WIN32 case 64: - in64 = (H5DT_UINT64 *) in->data; + in64 = (H5DT_UINT64 *) in->data; switch(in->inputClass) { case 6: /* TEXTUIN */ @@ -622,7 +622,7 @@ readUIntegerData(FILE **strm, struct Input *in) { (void) fprintf(stderr, err1); return (-1); - } + } *in64 = (H5DT_UINT64) HDstrtoll(buffer, NULL, 10); } break; @@ -631,20 +631,20 @@ readUIntegerData(FILE **strm, struct Input *in) for (i = 0; i < len; i++, in64++) { if (fread((char *) in64, sizeof(H5DT_UINT64), 1, *strm) != 1) - { + { (void) fprintf(stderr, err1); return (-1); - } + } } break; - + default: (void) fprintf(stderr, err2); return (-1); } break; #endif /* ifndef WIN32 */ - + default: (void) fprintf(stderr, err3); break; @@ -652,7 +652,7 @@ readUIntegerData(FILE **strm, struct Input *in) return(0); } -static int +static int readFloatData(FILE **strm, struct Input *in) { H5DT_FLOAT32 *fp32; @@ -671,7 +671,7 @@ readFloatData(FILE **strm, struct Input *in) switch(in->inputSize) { case 32: - fp32 = (H5DT_FLOAT32 *) in->data; + fp32 = (H5DT_FLOAT32 *) in->data; switch(in->inputClass) { case 1: /* TEXTFP */ @@ -694,13 +694,13 @@ readFloatData(FILE **strm, struct Input *in) for (i = 0; i < len; i++, fp32++) { if (fread((char *) fp32, sizeof(H5DT_FLOAT32), 1, *strm) != 1) - { + { (void) fprintf(stderr, err1); return (-1); - } + } } break; - + default: (void) fprintf(stderr, err2); return (-1); @@ -708,7 +708,7 @@ readFloatData(FILE **strm, struct Input *in) break; case 64: - fp64 = (H5DT_FLOAT64 *) in->data; + fp64 = (H5DT_FLOAT64 *) in->data; switch(in->inputClass) { case 1: /* TEXTFP */ @@ -731,13 +731,13 @@ readFloatData(FILE **strm, struct Input *in) for (i = 0; i < len; i++, fp64++) { if (fread((char *) fp64, sizeof(H5DT_FLOAT64), 1, *strm) != 1) - { + { (void) fprintf(stderr, err1); return (-1); - } + } } break; - + default: (void) fprintf(stderr, err2); return (-1); @@ -751,7 +751,7 @@ readFloatData(FILE **strm, struct Input *in) return(0); } -static int +static int allocateIntegerStorage(struct Input *in) { hsize_t len=1; @@ -771,7 +771,7 @@ allocateIntegerStorage(struct Input *in) return (-1); } break; - + case 16: if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_INT16))) == NULL) { @@ -779,13 +779,13 @@ allocateIntegerStorage(struct Input *in) return (-1); } break; - + case 32: if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_INT32))) == NULL) { (void) fprintf(stderr, err1); return (-1); - } + } break; case 64: @@ -793,9 +793,9 @@ allocateIntegerStorage(struct Input *in) { (void) fprintf(stderr, err1); return (-1); - } + } break; - + default: (void) fprintf(stderr, err2); break; @@ -822,7 +822,7 @@ static int allocateUIntegerStorage(struct Input *in) return (-1); } break; - + case 16: if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_UINT16))) == NULL) { @@ -830,13 +830,13 @@ static int allocateUIntegerStorage(struct Input *in) return (-1); } break; - + case 32: if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_UINT32))) == NULL) { (void) fprintf(stderr, err1); return (-1); - } + } break; case 64: @@ -844,24 +844,24 @@ static int allocateUIntegerStorage(struct Input *in) { (void) fprintf(stderr, err1); return (-1); - } + } break; - + default: (void) fprintf(stderr, err2); break; } - return(0); + return(0); } -static int +static int allocateFloatStorage(struct Input *in) { hsize_t len = 1; int j; const char *err1 = "Unable to allocate dynamic memory.\n"; const char *err2 = "Invalid storage size for float input data.\n"; - + for (j=0; jrank;j++) len *= in->sizeOfDimension[j]; @@ -872,7 +872,7 @@ allocateFloatStorage(struct Input *in) { (void) fprintf(stderr, err1); return (-1); - } + } break; case 64: @@ -880,9 +880,9 @@ allocateFloatStorage(struct Input *in) { (void) fprintf(stderr, err1); return (-1); - } + } break; - + default: (void) fprintf(stderr, err2); break; @@ -890,52 +890,52 @@ allocateFloatStorage(struct Input *in) return(0); } -static int +static int processConfigurationFile(char *infile, struct Input *in, FILE **strm) { char key[255]; int kindex; char temp[255]; int ival; - + const char *err1 = "Unable to open the configuration file: %s for reading.\n"; const char *err2 = "Unknown keyword in configuration file: %s\n"; const char *err3a = "PATH keyword appears twice in %s.\n"; const char *err3b = "Error in parsing the path information from %s.\n"; - const char *err4a = "INPUT-CLASS keyword appears twice in %s.\n"; + const char *err4a = "INPUT-CLASS keyword appears twice in %s.\n"; const char *err4b = "Error in retrieving the input class from %s.\n"; - const char *err5a = "INPUT-SIZE keyword appears twice in %s.\n"; + const char *err5a = "INPUT-SIZE keyword appears twice in %s.\n"; const char *err5b = "Error in retrieving the input size from %s.\n"; - const char *err6a = "RANK keyword appears twice in %s.\n"; + const char *err6a = "RANK keyword appears twice in %s.\n"; const char *err6b = "Error in retrieving the rank from %s.\n"; - const char *err7a = "DIMENSION-SIZES keyword appears twice in %s.\n"; - const char *err7b = "DIMENSION-SIZES cannot appear before RANK is provided.\n"; - const char *err7c = "Error in retrieving the dimension sizes from %s.\n"; - const char *err8a = "OUTPUT-CLASS keyword appears twice in %s.\n"; + const char *err7a = "DIMENSION-SIZES keyword appears twice in %s.\n"; + const char *err7b = "DIMENSION-SIZES cannot appear before RANK is provided.\n"; + const char *err7c = "Error in retrieving the dimension sizes from %s.\n"; + const char *err8a = "OUTPUT-CLASS keyword appears twice in %s.\n"; const char *err8b = "Error in retrieving the output class from %s.\n"; - const char *err9a = "OUTPUT-SIZE keyword appears twice in %s.\n"; + const char *err9a = "OUTPUT-SIZE keyword appears twice in %s.\n"; const char *err9b = "Error in retrieving the output size from %s.\n"; - const char *err10a = "OUTPUT-ARCHITECTURE keyword appears twice in %s.\n"; + const char *err10a = "OUTPUT-ARCHITECTURE keyword appears twice in %s.\n"; const char *err10b = "Error in retrieving the output architecture from %s.\n"; - const char *err11a = "OUTPUT-BYTE-ORDER keyword appears twice in %s.\n"; + const char *err11a = "OUTPUT-BYTE-ORDER keyword appears twice in %s.\n"; const char *err11b = "Error in retrieving the output byte order from %s.\n"; - const char *err12a = "CHUNKED-DIMENSION-SIZES keyword appears twice in %s.\n"; - const char *err12b = "CHUNKED-DIMENSION-SIZES cannot appear before DIMENSION-SIZES are provided.\n"; - const char *err12c = "Error in retrieving the chunked dimension sizes from %s.\n"; - const char *err13a = "COMPRESSION-TYPE keyword appears twice in %s.\n"; + const char *err12a = "CHUNKED-DIMENSION-SIZES keyword appears twice in %s.\n"; + const char *err12b = "CHUNKED-DIMENSION-SIZES cannot appear before DIMENSION-SIZES are provided.\n"; + const char *err12c = "Error in retrieving the chunked dimension sizes from %s.\n"; + const char *err13a = "COMPRESSION-TYPE keyword appears twice in %s.\n"; const char *err13b = "Error in retrieving the compression type from %s.\n"; - const char *err14a = "COMPRESSION-PARAM keyword appears twice in %s.\n"; + const char *err14a = "COMPRESSION-PARAM keyword appears twice in %s.\n"; const char *err14b = "Error in retrieving the compression parameter from %s.\n"; - const char *err15a = "EXTERNAL-STORAGE keyword appears twice in %s.\n"; + const char *err15a = "EXTERNAL-STORAGE keyword appears twice in %s.\n"; const char *err15b = "Error in retrieving the external storage paramters from %s.\n"; const char *err16a = "MAXIMUM-DIMENSIONS keyword appears twice in %s.\n"; - const char *err16b = "MAXIMUM-DIMENSIONS cannot appear before DIMENSION-SIZES are provided.\n"; + const char *err16b = "MAXIMUM-DIMENSIONS cannot appear before DIMENSION-SIZES are provided.\n"; const char *err16c = "Error in retrieving the maximum dimension sizes from %s.\n"; const char *err17 = "Configuration parameters are invalid in %s.\n"; const char *err18 = "Unable to get string value.\n"; const char *err19 = "Unable to get integer value.\n"; - /* create vector to map which keywords have been found + /* create vector to map which keywords have been found check vector after each keyword to check for violation at the end check vector to see if required fields have been provided process the output file according to the options @@ -946,7 +946,7 @@ processConfigurationFile(char *infile, struct Input *in, FILE **strm) (void) fprintf(stderr, err1, infile); return (-1); } - + while (fscanf(*strm, "%s", key) == 1) { if ((kindex = mapKeywordToIndex(key)) == -1) @@ -960,17 +960,17 @@ processConfigurationFile(char *infile, struct Input *in, FILE **strm) if (in->configOptionVector[PATH] == 1) { (void) fprintf(stderr, err3a, infile); - return (-1); + return (-1); } if (fscanf(*strm, "%s", temp) != 1) { (void) fprintf(stderr, err18); - return (-1); - } + return (-1); + } if (parsePathInfo(&in->path, temp) == -1) { (void) fprintf(stderr, err3b, infile); - return (-1); + return (-1); } in->configOptionVector[PATH] = 1; break; @@ -979,7 +979,7 @@ processConfigurationFile(char *infile, struct Input *in, FILE **strm) if (in->configOptionVector[INPUT_CLASS] == 1) { (void) fprintf(stderr, err4a, infile); - return (-1); + return (-1); } if (fscanf(*strm, "%s", temp) != 1) @@ -990,7 +990,7 @@ processConfigurationFile(char *infile, struct Input *in, FILE **strm) if (getInputClass(in, temp) == -1) { (void) fprintf(stderr, err4b, infile); - return (-1); + return (-1); } in->configOptionVector[INPUT_CLASS] = 1; @@ -1011,7 +1011,7 @@ processConfigurationFile(char *infile, struct Input *in, FILE **strm) if (in->configOptionVector[INPUT_SIZE] == 1) { (void) fprintf(stderr, err5a, infile); - return (-1); + return (-1); } if (fscanf(*strm, "%d", (&ival)) != 1) { @@ -1021,11 +1021,11 @@ processConfigurationFile(char *infile, struct Input *in, FILE **strm) if (getInputSize(in, ival) == -1) { (void) fprintf(stderr, err5b, infile); - return (-1); + return (-1); } in->configOptionVector[INPUT_SIZE] = 1; - - /*set default value for output-size */ + + /*set default value for output-size */ if (in->configOptionVector[OUTPUT_SIZE] == 0) in->outputSize = in->inputSize; break; @@ -1034,13 +1034,13 @@ processConfigurationFile(char *infile, struct Input *in, FILE **strm) if (in->configOptionVector[RANK] == 1) { (void) fprintf(stderr, err6a, infile); - return (-1); + return (-1); } if (getRank(in, strm) == -1) { (void) fprintf(stderr, err6b, infile); - return (-1); + return (-1); } in->configOptionVector[RANK] = 1; break; @@ -1049,18 +1049,18 @@ processConfigurationFile(char *infile, struct Input *in, FILE **strm) if (in->configOptionVector[DIM] == 1) { (void) fprintf(stderr, err7a, infile); - return (-1); + return (-1); } if (in->configOptionVector[RANK] == 0) { (void) fprintf(stderr, err7b, infile); - return (-1); - } + return (-1); + } if (getDimensionSizes(in, strm) == -1) { (void) fprintf(stderr, err7c, infile); - return (-1); + return (-1); } in->configOptionVector[DIM] = 1; break; @@ -1069,13 +1069,13 @@ processConfigurationFile(char *infile, struct Input *in, FILE **strm) if (in->configOptionVector[OUTPUT_CLASS] == 1) { (void) fprintf(stderr, err8a, infile); - return (-1); + return (-1); } if (getOutputClass(in, strm) == -1) { (void) fprintf(stderr, err8b, infile); - return (-1); + return (-1); } in->configOptionVector[OUTPUT_CLASS] = 1; break; @@ -1084,14 +1084,14 @@ processConfigurationFile(char *infile, struct Input *in, FILE **strm) if (in->configOptionVector[OUTPUT_SIZE] == 1) { (void) fprintf(stderr, err9a, infile); - return (-1); + return (-1); } if (getOutputSize(in, strm) == -1) { (void) fprintf(stderr, err9b, infile); - return (-1); - } + return (-1); + } in->configOptionVector[OUTPUT_SIZE] = 1; break; @@ -1099,14 +1099,14 @@ processConfigurationFile(char *infile, struct Input *in, FILE **strm) if (in->configOptionVector[OUTPUT_ARCH] == 1) { (void) fprintf(stderr, err10a, infile); - return (-1); + return (-1); } if (getOutputArchitecture(in, strm) == -1) { (void) fprintf(stderr, err10b, infile); - return (-1); - } + return (-1); + } in->configOptionVector[OUTPUT_ARCH] = 1; break; @@ -1114,14 +1114,14 @@ processConfigurationFile(char *infile, struct Input *in, FILE **strm) if (in->configOptionVector[OUTPUT_B_ORDER] == 1) { (void) fprintf(stderr, err11a, infile); - return (-1); + return (-1); } if (getOutputByteOrder(in, strm) == -1) { (void) fprintf(stderr, err11b, infile); - return (-1); - } + return (-1); + } in->configOptionVector[OUTPUT_B_ORDER] = 1; break; @@ -1129,37 +1129,37 @@ processConfigurationFile(char *infile, struct Input *in, FILE **strm) if (in->configOptionVector[CHUNK] == 1) { (void) fprintf(stderr, err12a, infile); - return (-1); + return (-1); } /* cant appear before dimension sizes have been provided */ if (in->configOptionVector[DIM] == 0) { (void) fprintf(stderr, err12b, infile); - return (-1); + return (-1); } if (getChunkedDimensionSizes(in, strm) == -1) { (void) fprintf(stderr, err12c, infile); - return (-1); - } - in->configOptionVector[CHUNK] = 1; + return (-1); + } + in->configOptionVector[CHUNK] = 1; break; case 10: /* COMPRESSION-TYPE */ if (in->configOptionVector[COMPRESS] == 1) { (void) fprintf(stderr, err13a, infile); - return (-1); + return (-1); } if (getCompressionType(in, strm) == -1) { (void) fprintf(stderr, err13b, infile); - return (-1); + return (-1); } in->configOptionVector[COMPRESS] = 1; - + if (in->configOptionVector[COMPRESS_PARAM] == 0) { if (in->compressionType == 0) @@ -1171,20 +1171,20 @@ processConfigurationFile(char *infile, struct Input *in, FILE **strm) if (in->configOptionVector[COMPRESS_PARAM] == 1) { (void) fprintf(stderr, err14a, infile); - return (-1); + return (-1); } if (getCompressionParameter(in, strm) == -1) { (void) fprintf(stderr, err14b, infile); - return (-1); + return (-1); } - + in->configOptionVector[COMPRESS_PARAM] = 1; if (in->configOptionVector[COMPRESS] == 0) - in->compressionType = 0; - + in->compressionType = 0; + in->configOptionVector[COMPRESS] = 1; break; @@ -1192,38 +1192,38 @@ processConfigurationFile(char *infile, struct Input *in, FILE **strm) if (in->configOptionVector[EXTERNAL] == 1) { (void) fprintf(stderr, err15a, infile); - return (-1); + return (-1); } if (getExternalFilename(in, strm) == -1) { (void) fprintf(stderr, err15b, infile); - return (-1); - } - in->configOptionVector[EXTERNAL] = 1; + return (-1); + } + in->configOptionVector[EXTERNAL] = 1; break; case 13: /* MAXIMUM-DIMENSIONS */ if (in->configOptionVector[EXTEND] == 1) { (void) fprintf(stderr, err16a, infile); - return (-1); + return (-1); } /* cant appear before dimension sizes have been provided */ if (in->configOptionVector[DIM] == 0) { (void) fprintf(stderr, err16b, infile); - return (-1); - } + return (-1); + } if (getMaximumDimensionSizes(in, strm) == -1) { (void) fprintf(stderr, err16c, infile); - return (-1); - } - in->configOptionVector[EXTEND] = 1; + return (-1); + } + in->configOptionVector[EXTEND] = 1; break; - - default: + + default: break; } } @@ -1231,20 +1231,20 @@ processConfigurationFile(char *infile, struct Input *in, FILE **strm) check if keywords obtained are valid if yes, return 0 else error */ - + if (validateConfigurationParameters(in) == -1) { (void) fprintf(stderr, err17, infile); - return (-1); - } + return (-1); + } - return (0); + return (0); } -static int +static int validateConfigurationParameters(struct Input * in) { - const char *err1 = "One or more of the required fields (RANK, DIMENSION-SIZES) missing.\n"; + const char *err1 = "One or more of the required fields (RANK, DIMENSION-SIZES) missing.\n"; const char *err2 = "Cannot specify chunking or compression or extendible data sets with the external file option.\n"; const char *err3 = "Cannot specify the compression or the extendible data sets without the chunking option.\n"; const char *err4a = "OUTPUT-ARCHITECTURE cannot be STD if OUTPUT-CLASS is floating point (FP).\n"; @@ -1255,25 +1255,25 @@ validateConfigurationParameters(struct Input * in) #endif if ( - (in->configOptionVector[DIM] != 1) || + (in->configOptionVector[DIM] != 1) || (in->configOptionVector[RANK] != 1)) { (void) fprintf(stderr, err1); - return (-1); + return (-1); } if (in->configOptionVector[EXTERNAL] == 1) { - if ((in->configOptionVector[COMPRESS] == 1) || - (in->configOptionVector[CHUNK] == 1) || + if ((in->configOptionVector[COMPRESS] == 1) || + (in->configOptionVector[CHUNK] == 1) || (in->configOptionVector[EXTEND] == 1)) { (void) fprintf(stderr, err2); - return (-1); + return (-1); } } - if ((in->configOptionVector[COMPRESS] == 1) || + if ((in->configOptionVector[COMPRESS] == 1) || (in->configOptionVector[EXTEND] == 1)) { if (in->configOptionVector[CHUNK] != 1) @@ -1282,7 +1282,7 @@ validateConfigurationParameters(struct Input * in) return (-1); } } - + /* Arch cant be STD if O/p class is FP */ if (in->outputArchitecture == 1) if (in->outputClass == 1) @@ -1298,7 +1298,7 @@ validateConfigurationParameters(struct Input * in) (void) fprintf(stderr, err4b); return (-1); } - + if (in->outputClass == 1) if(in->outputSize != 32 && in->outputSize != 64 ) @@ -1314,10 +1314,10 @@ validateConfigurationParameters(struct Input * in) return -1; } #endif - return (0); + return (0); } -static int +static int mapKeywordToIndex(char *key) { int i; @@ -1327,7 +1327,7 @@ mapKeywordToIndex(char *key) return -1; } -static int +static int parsePathInfo(struct path_info *path, char *temp) { const char delimiter[] = "/"; @@ -1347,7 +1347,7 @@ parsePathInfo(struct path_info *path, char *temp) return (0); } -static int +static int parseDimensions(struct Input *in, char *strm) { const char delimiter[] = ","; @@ -1367,7 +1367,7 @@ parseDimensions(struct Input *in, char *strm) i++; } in->rank = i+1; - if ((in->sizeOfDimension = + if ((in->sizeOfDimension = (hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL) { (void) fprintf(stderr, err1); @@ -1388,37 +1388,37 @@ parseDimensions(struct Input *in, char *strm) return (0); } -static int +static int getOutputClass(struct Input *in, FILE** strm) { char temp[255]; int kindex; const char *err1 = "Unable to get 'string' value.\n"; const char *err2 = "Invalid value for output class.\n"; - + if (fscanf(*strm, "%s", temp) != 1) { (void) fprintf(stderr, err1); - return (-1); + return (-1); } if ((kindex = OutputClassStrToInt(temp)) == -1) { (void) fprintf(stderr, err2); - return (-1); + return (-1); } - + in->outputClass = kindex; return (0); } -static int +static int OutputClassStrToInt(char *temp) { int i; char classKeywordTable[3][15] = { "IN", - "FP", + "FP", "UIN" }; for (i=0; i<3; i++) @@ -1427,7 +1427,7 @@ OutputClassStrToInt(char *temp) return -1; } /* same as getInputSize. But defined separately for extensibility */ -static int +static int getOutputSize(struct Input *in, FILE** strm) { int ival; @@ -1435,7 +1435,7 @@ getOutputSize(struct Input *in, FILE** strm) int outputSizeValidValues[4] = {8,16,32,64}; const char *err1 = "Unable to get integer value.\n"; const char *err2 = "Invalid value for output size.\n"; - + if (fscanf(*strm, "%d", (&ival)) != 1) { (void) fprintf(stderr, err1); @@ -1443,37 +1443,37 @@ getOutputSize(struct Input *in, FILE** strm) } for (i=0; i<4; i++) - if (outputSizeValidValues[i] == ival) + if (outputSizeValidValues[i] == ival) { in->outputSize = ival; - return (0); - } - (void) fprintf(stderr, err2); - return(-1); + return (0); + } + (void) fprintf(stderr, err2); + return(-1); } -static int +static int getInputClass(struct Input *in, char * temp) { int kindex; const char *err1 = "Invalid value for input class.\n"; - + if ((kindex = InputClassStrToInt(temp)) == -1) { (void) fprintf(stderr, err1); - return (-1); + return (-1); } - + in->inputClass = kindex; return (0); } -static int +static int InputClassStrToInt(char *temp) { int i; char classKeywordTable[8][15] = { - "TEXTIN", + "TEXTIN", "TEXTFP", "TEXTFPE", "FP", @@ -1488,7 +1488,7 @@ InputClassStrToInt(char *temp) } /* same as getOutputSize. But defined separately for extensibility */ -static int +static int getInputSize(struct Input *in, int ival) { int i; @@ -1496,40 +1496,40 @@ getInputSize(struct Input *in, int ival) const char *err1 = "Invalid value for input size.\n"; for (i=0; i<4; i++) - if (inputSizeValidValues[i] == ival) + if (inputSizeValidValues[i] == ival) { in->inputSize = ival; - return (0); - } - (void) fprintf(stderr, err1); - return(-1); + return (0); + } + (void) fprintf(stderr, err1); + return(-1); } -static int +static int getRank(struct Input *in, FILE** strm) { int ival; const char *err1 = "Unable to get integer value.\n"; const char *err2 = "Invalid value for rank.\n"; - + if (fscanf(*strm, "%d", (&ival)) != 1) { (void) fprintf(stderr, err1); return (-1); } - if (ival >=MIN_NUM_DIMENSION && ival <=MAX_NUM_DIMENSION ) + if (ival >=MIN_NUM_DIMENSION && ival <=MAX_NUM_DIMENSION ) { in->rank = ival; return (0); } - (void) fprintf(stderr, err2); - return(-1); + (void) fprintf(stderr, err2); + return(-1); } /* same as getChunkedDimensionSizes. But defined separately for extensibility */ -static int +static int getDimensionSizes(struct Input *in, FILE **strm) { int ival; @@ -1538,16 +1538,16 @@ getDimensionSizes(struct Input *in, FILE **strm) const char *err1 = "Unable to allocate dynamic memory.\n"; const char *err2 = "No. of dimensions for which dimension sizes provided is not equal to provided rank.\n"; - if ((in->sizeOfDimension = + if ((in->sizeOfDimension = (hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL) { (void) fprintf(stderr, err1); return (-1); } - + while (fscanf(*strm, "%d", (&ival)) == 1) in->sizeOfDimension[i++] = ival; - + if (in->rank != i) { (void) fprintf(stderr, err2); @@ -1556,7 +1556,7 @@ getDimensionSizes(struct Input *in, FILE **strm) return (0); } /* same as getDimensionSizes. But defined separately for extensibility */ -static int +static int getChunkedDimensionSizes(struct Input *in, FILE **strm) { int ival; @@ -1566,16 +1566,16 @@ getChunkedDimensionSizes(struct Input *in, FILE **strm) const char *err2 = "No. of dimensions for which chunked dimension sizes provided is not equal to provided rank.\n"; const char *err3 = "The CHUNKED-DIMENSION-SIZES cannot exceed the sizes of DIMENSION-SIZES\n"; - if ((in->sizeOfChunk = + if ((in->sizeOfChunk = (hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL) { (void) fprintf(stderr, err1); return (-1); } - + while (fscanf(*strm, "%d", (&ival)) == 1) in->sizeOfChunk[i++] = ival; - + if (in->rank != i) { (void) fprintf(stderr, err2); @@ -1591,7 +1591,7 @@ getChunkedDimensionSizes(struct Input *in, FILE **strm) return (0); } -static int +static int getMaximumDimensionSizes(struct Input *in, FILE **strm) { int ival; @@ -1601,13 +1601,13 @@ getMaximumDimensionSizes(struct Input *in, FILE **strm) const char *err2 = "No. of dimensions for which maximum dimension sizes provided is not equal to provided rank.\n"; const char *err3 = "The MAXIMUM-DIMENSIONS cannot be less than the sizes of DIMENSION-SIZES. Exception: can be -1 to indicate unlimited size\n"; - if ((in->maxsizeOfDimension = + if ((in->maxsizeOfDimension = (hsize_t *) HDmalloc ((size_t) in->rank * sizeof(hsize_t))) == NULL) { (void) fprintf(stderr, err1); return (-1); } - + while (fscanf(*strm, "%d", (&ival)) == 1) { if (ival == -1) @@ -1615,7 +1615,7 @@ getMaximumDimensionSizes(struct Input *in, FILE **strm) else in->maxsizeOfDimension[i++] = ival; } - + if (in->rank != i) { (void) fprintf(stderr, err2); @@ -1634,31 +1634,31 @@ getMaximumDimensionSizes(struct Input *in, FILE **strm) return (0); } -static int +static int getOutputArchitecture(struct Input *in, FILE** strm) { char temp[255]; int kindex; const char *err1 = "Unable to get 'string' value.\n"; const char *err2 = "Invalid value for output architecture.\n"; - + if (fscanf(*strm, "%s", temp) != 1) { (void) fprintf(stderr, err1); - return (-1); + return (-1); } if ((kindex = OutputArchStrToInt(temp)) == -1) { (void) fprintf(stderr, err2); - return (-1); + return (-1); } - + in->outputArchitecture = kindex; return (0); } -static int +static int OutputArchStrToInt(char *temp) { int i; @@ -1677,31 +1677,31 @@ OutputArchStrToInt(char *temp) return -1; } -static int +static int getOutputByteOrder(struct Input *in, FILE** strm) { char temp[255]; int kindex; const char *err1 = "Unable to get 'string' value.\n"; const char *err2 = "Invalid value for output byte-order.\n"; - + if (fscanf(*strm, "%s", temp) != 1) { (void) fprintf(stderr, err1); - return (-1); + return (-1); } if ((kindex = OutputByteOrderStrToInt(temp)) == -1) { (void) fprintf(stderr, err2); - return (-1); + return (-1); } - + in->outputByteOrder = kindex; return (0); } -static int +static int OutputByteOrderStrToInt(char *temp) { int i; @@ -1714,32 +1714,32 @@ OutputByteOrderStrToInt(char *temp) return -1; } -static int +static int getCompressionType(struct Input *in, FILE** strm) { char temp[255]; int kindex; const char *err1 = "Unable to get 'string' value.\n"; const char *err2 = "Invalid value for compression.\n"; - + if (fscanf(*strm, "%s", temp) != 1) { (void) fprintf(stderr, err1); - return (-1); + return (-1); } if ((kindex = CompressionTypeStrToInt(temp)) == -1) { (void) fprintf(stderr, err2); - return (-1); + return (-1); } - + in->outputByteOrder = kindex; return (0); } -static int +static int CompressionTypeStrToInt(char *temp) { /* currently supports only GZIP */ @@ -1754,17 +1754,17 @@ CompressionTypeStrToInt(char *temp) return -1; } -static int +static int getCompressionParameter(struct Input *in, FILE** strm) { /* currently supports only GZIP */ - /* can be extended by adding more values to COMPRESSION-TYPE and + /* can be extended by adding more values to COMPRESSION-TYPE and handling the paramters here by adding more cases */ int ival; const char *err1 = "Unable to get integer value.\n"; const char *err2 = "Invalid value for compression paramter.\n"; - const char *err3 = "Unsupported Compression Type.\n"; + const char *err3 = "Unsupported Compression Type.\n"; switch (in->compressionType) { @@ -1778,7 +1778,7 @@ getCompressionParameter(struct Input *in, FILE** strm) if (ival <0 || ival > 9) { (void) fprintf(stderr, err2); - return (-1); + return (-1); } in->compressionParam = ival; return (0); @@ -1789,34 +1789,34 @@ getCompressionParameter(struct Input *in, FILE** strm) } } -static int +static int getExternalFilename(struct Input *in, FILE** strm) { char temp[255]; const char *err1 = "Unable to get 'string' value.\n"; - + if (fscanf(*strm, "%s", temp) != 1) { (void) fprintf(stderr, err1); - return (-1); + return (-1); } - + in->externFilename = (char *) HDmalloc ((size_t) (HDstrlen(temp)) * sizeof(char)); (void) HDstrcpy(in->externFilename, temp); return (0); } -void +void setDefaultValues(struct Input *in, int count) { int i; char temp[255]; - char num[255]; + char num[255]; in->inputClass = 3; /* FP */ in->inputSize = 32; in->outputClass = 1; /* FP */ - in->outputSize = 32; + in->outputSize = 32; in->rank = 0; in->path.count = 1; @@ -1832,15 +1832,15 @@ setDefaultValues(struct Input *in, int count) in->configOptionVector[i] = 0; } -hid_t +hid_t createOutputDataType(struct Input *in) { hid_t new_type = (-1); const char *err1 = "Invalid value for output class.\n"; - + switch (in->outputClass) { - case 0: + case 0: switch (in->outputArchitecture) { case 0: /* NATIVE */ @@ -1851,11 +1851,11 @@ createOutputDataType(struct Input *in) break; case 16: - new_type = H5Tcopy (H5T_NATIVE_SHORT); + new_type = H5Tcopy (H5T_NATIVE_SHORT); break; case 32: - new_type = H5Tcopy (H5T_NATIVE_INT); + new_type = H5Tcopy (H5T_NATIVE_INT); break; case 64: @@ -1873,9 +1873,9 @@ createOutputDataType(struct Input *in) case 1: H5Tset_order (new_type,H5T_ORDER_LE); break; - } + } break; - + case 1: /* STD */ switch(in->outputSize) { @@ -1890,7 +1890,7 @@ createOutputDataType(struct Input *in) case 1: new_type = H5Tcopy (H5T_STD_I8LE); break; - } + } break; case 16: @@ -1904,7 +1904,7 @@ createOutputDataType(struct Input *in) case 1: new_type = H5Tcopy (H5T_STD_I16LE); break; - } + } break; case 32: @@ -1918,7 +1918,7 @@ createOutputDataType(struct Input *in) case 1: new_type = H5Tcopy (H5T_STD_I32LE); break; - } + } break; case 64: @@ -1932,11 +1932,11 @@ createOutputDataType(struct Input *in) case 1: new_type = H5Tcopy (H5T_STD_I64LE); break; - } - break; + } + break; } break; - + } break; @@ -1947,7 +1947,7 @@ createOutputDataType(struct Input *in) switch(in->outputSize) { case 32: - new_type = H5Tcopy (H5T_NATIVE_FLOAT); + new_type = H5Tcopy (H5T_NATIVE_FLOAT); break; case 64: @@ -1965,9 +1965,9 @@ createOutputDataType(struct Input *in) case 1: H5Tset_order (new_type,H5T_ORDER_LE); break; - } + } break; - + case 1: /* STD not supported for float */ break; @@ -1986,7 +1986,7 @@ createOutputDataType(struct Input *in) case 1: new_type = H5Tcopy (H5T_IEEE_F32LE); break; - } + } break; case 64: @@ -2000,11 +2000,11 @@ createOutputDataType(struct Input *in) case 1: new_type = H5Tcopy (H5T_IEEE_F64LE); break; - } - break; + } + break; } break; - + } break; @@ -2019,11 +2019,11 @@ createOutputDataType(struct Input *in) break; case 16: - new_type = H5Tcopy (H5T_NATIVE_USHORT); + new_type = H5Tcopy (H5T_NATIVE_USHORT); break; case 32: - new_type = H5Tcopy (H5T_NATIVE_UINT); + new_type = H5Tcopy (H5T_NATIVE_UINT); break; case 64: @@ -2041,9 +2041,9 @@ createOutputDataType(struct Input *in) case 1: H5Tset_order (new_type,H5T_ORDER_LE); break; - } + } break; - + case 1: switch(in->outputSize) { @@ -2058,7 +2058,7 @@ createOutputDataType(struct Input *in) case 1: new_type = H5Tcopy (H5T_STD_U8LE); break; - } + } break; case 16: @@ -2072,7 +2072,7 @@ createOutputDataType(struct Input *in) case 1: new_type = H5Tcopy (H5T_STD_U16LE); break; - } + } break; case 32: @@ -2086,7 +2086,7 @@ createOutputDataType(struct Input *in) case 1: new_type = H5Tcopy (H5T_STD_U32LE); break; - } + } break; case 64: @@ -2100,15 +2100,15 @@ createOutputDataType(struct Input *in) case 1: new_type = H5Tcopy (H5T_STD_U64LE); break; - } - break; + } + break; } break; - + case 2: /* IEEE not supported for INT */ break; - + } break; @@ -2120,7 +2120,7 @@ createOutputDataType(struct Input *in) return new_type; } -hid_t +hid_t createInputDataType(struct Input *in) { hid_t new_type = (-1); @@ -2137,11 +2137,11 @@ createInputDataType(struct Input *in) break; case 16: - new_type = H5Tcopy (H5T_NATIVE_SHORT); + new_type = H5Tcopy (H5T_NATIVE_SHORT); break; case 32: - new_type = H5Tcopy (H5T_NATIVE_INT); + new_type = H5Tcopy (H5T_NATIVE_INT); break; case 64: @@ -2160,8 +2160,8 @@ createInputDataType(struct Input *in) break; case 64: - new_type = H5Tcopy (H5T_NATIVE_DOUBLE); - break; + new_type = H5Tcopy (H5T_NATIVE_DOUBLE); + break; } break; @@ -2177,11 +2177,11 @@ createInputDataType(struct Input *in) break; case 16: - new_type = H5Tcopy (H5T_NATIVE_USHORT); + new_type = H5Tcopy (H5T_NATIVE_USHORT); break; case 32: - new_type = H5Tcopy (H5T_NATIVE_UINT); + new_type = H5Tcopy (H5T_NATIVE_UINT); break; case 64: @@ -2194,43 +2194,43 @@ createInputDataType(struct Input *in) (void) fprintf(stderr, err1); return (-1); } - return new_type; + return new_type; } -static int +static int process(struct Options *opt) { struct Input *in; - hid_t file_id, group_id, handle; - hid_t dataset, dataspace = (-1); + hid_t file_id, group_id, handle; + hid_t dataset, dataspace = (-1); FILE *strm, *extfile; hid_t intype, outtype; - hid_t proplist; - hsize_t numOfElements = 1; + hid_t proplist; + hsize_t numOfElements = 1; int j,k; const char *err1 = "Error creating HDF output file: %s.\n"; const char *err2 = "Error in processing the configuration file: %s.\n"; const char *err3 = "Error in reading the input file: %s.\n"; - const char *err4 = "Error in creating or opening external file.\n"; + const char *err4 = "Error in creating or opening external file.\n"; const char *err5 = "Error in creating the output data set. Dataset with the same name may exist at the specified path\n"; const char *err6 = "Error in writing the output data set.\n"; H5E_BEGIN_TRY { if ((file_id = H5Fopen(opt->outfile, H5F_ACC_RDWR, H5P_DEFAULT)) < 0) { - if ((file_id = H5Fcreate(opt->outfile, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) == FAIL) + if ((file_id = H5Fcreate(opt->outfile, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) == FAIL) { (void) fprintf(stderr, err1, opt->outfile); return (-1); } } } H5E_END_TRY; - + for (k = 0; k < opt->fcount; k++) { in = &(opt->infiles[k].in); if (opt->infiles[k].config == 1) - { + { if (processConfigurationFile(opt->infiles[k].configfile, in, &strm) == -1) { (void) fprintf(stderr, err2, opt->infiles[k].configfile); @@ -2242,14 +2242,14 @@ process(struct Options *opt) { (void) fprintf(stderr, err3, opt->infiles[k].datafile); return (-1); - } - + } + for (j=0; jrank;j++) numOfElements *= in->sizeOfDimension[j]; /* disable error reporting */ H5E_BEGIN_TRY { - + /* create parent groups */ if (in->path.count > 1) { @@ -2261,15 +2261,15 @@ process(struct Options *opt) { group_id = H5Gcreate(handle, in->path.group[j++], 0); for (; jpath.count-1; j++) - group_id = H5Gcreate(group_id, in->path.group[j], 0); + group_id = H5Gcreate(group_id, in->path.group[j], 0); handle = group_id; break; - } + } handle = group_id; j++; } } - else + else { handle = file_id; j=0; @@ -2277,25 +2277,25 @@ process(struct Options *opt) /*enable error reporting */ } H5E_END_TRY; - + /*create data type */ intype = createInputDataType(in); - outtype = createOutputDataType(in); - + outtype = createOutputDataType(in); + /* create property list */ - proplist = H5Pcreate (H5P_DATASET_CREATE); + proplist = H5Pcreate (H5P_DATASET_CREATE); if (in->configOptionVector[CHUNK] == 1) { - H5Pset_layout (proplist, H5D_CHUNKED); + H5Pset_layout (proplist, H5D_CHUNKED); /* not reqd chunking is implied if set_chunk is used */ H5Pset_chunk (proplist, in->rank, in->sizeOfChunk); } - + if (in->configOptionVector[COMPRESS] == 1) { H5Pset_deflate (proplist, (unsigned) in->compressionParam); } - + if (in->configOptionVector[EXTERNAL] == 1) { /* creating the external file if it doesnt exist */ @@ -2304,13 +2304,13 @@ process(struct Options *opt) (void) fprintf(stderr, err4); H5Pclose(proplist); H5Sclose(dataspace); - H5Fclose(file_id); - return (-1); + H5Fclose(file_id); + return (-1); } HDfclose(extfile); H5Pset_external (proplist, in->externFilename, (off_t)0, numOfElements * in->inputSize / 8); } - + /* create dataspace */ if (in->configOptionVector[EXTEND] == 1) { @@ -2320,38 +2320,38 @@ process(struct Options *opt) { dataspace = H5Screate_simple(in->rank, in->sizeOfDimension, NULL); } - + /* disable error reporting */ H5E_BEGIN_TRY { /* create data set */ - if ((dataset = H5Dcreate(handle, in->path.group[j], outtype, dataspace, proplist)) < 0) + if ((dataset = H5Dcreate(handle, in->path.group[j], outtype, dataspace, proplist)) < 0) { (void) fprintf(stderr, err5); H5Pclose(proplist); H5Sclose(dataspace); - H5Fclose(file_id); - return (-1); + H5Fclose(file_id); + return (-1); } - + /*enable error reporting */ } H5E_END_TRY; /* write dataset */ - if (H5Dwrite(dataset, intype, H5S_ALL, H5S_ALL, H5P_DEFAULT, (VOIDP)in->data) < 0) + if (H5Dwrite(dataset, intype, H5S_ALL, H5S_ALL, H5P_DEFAULT, (VOIDP)in->data) < 0) { (void) fprintf(stderr, err6); H5Dclose(dataset); H5Pclose(proplist); H5Sclose(dataspace); - H5Fclose(file_id); - return (-1); - } - + H5Fclose(file_id); + return (-1); + } + H5Dclose(dataset); - H5Pclose(proplist); - H5Sclose(dataspace); + H5Pclose(proplist); + H5Sclose(dataspace); } - H5Fclose(file_id); + H5Fclose(file_id); return (0); } diff --git a/tools/h5import/h5import.h b/tools/h5import/h5import.h index 353e548..cf318fc 100755 --- a/tools/h5import/h5import.h +++ b/tools/h5import/h5import.h @@ -13,9 +13,9 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /* - * - * Data and structure definitions for h5import - * + * + * Data and structure definitions for h5import + * */ /* @@ -39,7 +39,7 @@ #define MAX_NUM_DIMENSION 32 #define BASE_10 10 -#define CHUNK 0 +#define CHUNK 0 #define COMPRESS 1 #define EXTEND 2 #define EXTERNAL 3 @@ -51,8 +51,8 @@ #define OUTPUT_CLASS 9 #define OUTPUT_SIZE 10 #define OUTPUT_ARCH 11 -#define OUTPUT_B_ORDER 12 -#define COMPRESS_PARAM 13 +#define OUTPUT_B_ORDER 12 +#define COMPRESS_PARAM 13 /* data types */ #define H5DT_INT8 signed char @@ -75,7 +75,7 @@ struct path_info struct Input { - struct path_info path; + struct path_info path; int inputClass; int inputSize; int rank; @@ -85,7 +85,7 @@ struct Input int outputArchitecture; int outputByteOrder; hsize_t* sizeOfChunk; - hsize_t* maxsizeOfDimension; + hsize_t* maxsizeOfDimension; int compressionType; int compressionParam; char *externFilename; @@ -105,7 +105,7 @@ struct Options { struct infilesformat infiles[30]; /* structure to hold the list of input file names. Limited to 30*/ char outfile[256]; /* output file name */ - int fcount; /* number of input files */ + int fcount; /* number of input files */ }; char keytable[NUM_KEYS][30] = { @@ -147,7 +147,7 @@ static int state_table[15][8] = /* state 5: outfile */ {ERR, ERR, ERR, ERR, ERR, ERR, ERR, ERR}, - + /* state 6: -h[elp] */ {ERR, ERR, ERR, ERR, ERR, ERR, ERR, ERR}, @@ -177,9 +177,9 @@ static int state_table[15][8] = }; -/* +/* * - * Function declarations for h5import + * Function declarations for h5import * */ void usage(char *); diff --git a/tools/h5import/h5importtest.c b/tools/h5import/h5importtest.c index 48670c5..e6c29e5 100755 --- a/tools/h5import/h5importtest.c +++ b/tools/h5import/h5importtest.c @@ -19,7 +19,7 @@ * * Description: * This program creates that can be - * used to test the h5import program. + * used to test the h5import program. * */ /* @@ -38,24 +38,24 @@ main(void) float rowo4 = (float)11.0e0, colo4 = (float)21.0e0, plno4 = (float)51.0e0; float rowi4 = (float)1.0e0, coli4 = (float)2.0e0, plni4 = (float)5.0e0; - int b32i3[5][3][4]; + int b32i3[5][3][4]; int row4i[3], col4i[4], pln4i[5]; int rowo4i = (int)11 , colo4i = (int)21 , plno4i = (int)51 ; int rowi4i = (int)1 , coli4i = (int)2 , plni4i = (int)5 ; #ifndef WIN32 - long_long b64i2[3][4], b64i3[5][3][4]; + long_long b64i2[3][4], b64i3[5][3][4]; long_long row4i64[3], col4i64[4], pln4i64[5]; long_long rowo4i64 = (long_long)11 , colo4i64 = (long_long)21 , plno4i64 = (long_long)51 ; long_long rowi4i64 = (long_long)1 , coli4i64 = (long_long)2 , plni4i64 = (long_long)5 ; #endif - short b16i3[5][3][4]; + short b16i3[5][3][4]; short row4i16[3], col4i16[4], pln4i16[5]; short rowo4i16 = (short)11 , colo4i16 = (short)21 , plno4i16 = (short)51 ; short rowi4i16 = (short)1 , coli4i16 = (short)2 , plni4i16 = (short)5 ; - char b8i3[5][3][4]; + char b8i3[5][3][4]; char row4i8[3], col4i8[4], pln4i8[5]; char rowo4i8 = (char)11 , colo4i8 = (char)21 , plno4i8 = (char)51 ; char rowi4i8 = (char)1 , coli4i8 = (char)2 , plni4i8 = (char)5 ; @@ -65,7 +65,7 @@ main(void) double rowo8 = 11.0e0, colo8 = 21.0e0, plno8 = 51.0e0; double rowi8 = 1.0e0, coli8 = 2.0e0, plni8 = 5.0e0; - + /* * initialize the row, column, and plane vectors * @@ -74,7 +74,7 @@ main(void) * plane values start at 51 and increment by 5 => 51, 56, 61, 66, 71 */ - + /* * build array elements - rank 2 * @@ -84,16 +84,16 @@ main(void) row4[0] = rowo4; col4[0] = colo4; pln4[0] = plno4; - + row8[0] = rowo8; col8[0] = colo8; pln8[0] = plno8; - + row4i[0] = rowo4i; col4i[0] = colo4i; pln4i[0] = plno4i; -#ifndef WIN32 +#ifndef WIN32 row4i64[0] = rowo4i64; col4i64[0] = colo4i64; pln4i64[0] = plno4i64; @@ -102,11 +102,11 @@ main(void) row4i16[0] = rowo4i16; col4i16[0] = colo4i16; pln4i16[0] = plno4i16; - + row4i8[0] = rowo4i8; col4i8[0] = colo4i8; pln4i8[0] = plno4i8; - + for (i = 1; i < nrow; i++) { row4[i] = row4[i - 1] + rowi4; @@ -116,18 +116,18 @@ main(void) row4i64[i] = row4i64[i - 1] + rowi4i64; #endif row4i16[i] = row4i16[i - 1] + rowi4i16; - row4i8[i] = row4i8[i - 1] + rowi4i8; + row4i8[i] = row4i8[i - 1] + rowi4i8; } - + for (j = 1; j < ncol; j++) { col4[j] = col4[j - 1] + coli4; col8[j] = col8[j - 1] + coli8; col4i[j] = col4i[j - 1] + coli4i; #ifndef WIN32 - col4i64[j] = col4i64[j - 1] + coli4i64; + col4i64[j] = col4i64[j - 1] + coli4i64; #endif - col4i16[j] = col4i16[j - 1] + coli4i16; + col4i16[j] = col4i16[j - 1] + coli4i16; col4i8[j] = col4i8[j - 1] + coli4i8; } for (k = 1; k < npln; k++) @@ -138,7 +138,7 @@ main(void) #ifndef WIN32 pln4i64[k] = pln4i64[k - 1] + plni4i64; #endif - pln4i16[k] = pln4i16[k - 1] + plni4i16; + pln4i16[k] = pln4i16[k - 1] + plni4i16; pln4i8[k] = pln4i8[k - 1] + plni4i8; } @@ -147,7 +147,7 @@ main(void) for (j = 0; j < ncol; j++) { #ifndef WIN32 - b64i2[i][j] = row4i64[i] + col4i64[j]; + b64i2[i][j] = row4i64[i] + col4i64[j]; #endif } } @@ -175,13 +175,13 @@ main(void) } } } - + /* * binary 32-bit file - rank 2 & 3 */ #ifndef UNICOS - + sp = fopen("txtin16", "w"); for (k = 0; k < npln; k++) @@ -204,7 +204,7 @@ main(void) (void) fclose(sp); sp = fopen("bin32", "w"); - for (k = 0; k < npln; k++) + for (k = 0; k < npln; k++) for (i = 0; i < nrow; i++) for (j = 0; j < ncol; j++) (void) fwrite((char *) &b32i3[k][i][j], sizeof(int), 1, sp); @@ -212,7 +212,7 @@ main(void) sp = fopen("buin32", "w"); - for (k = 0; k < npln; k++) + for (k = 0; k < npln; k++) for (i = 0; i < nrow; i++) for (j = 0; j < ncol; j++) (void) fwrite((char *) &b32i3[k][i][j], sizeof(unsigned int), 1, sp); @@ -234,7 +234,7 @@ main(void) (void) fwrite((char *) &b32r3[k][i][j], sizeof(float), 1, sp); (void) fclose(sp); - + sp = fopen("bin16", "w"); for (k = 0; k < npln; k++) for (i = 0; i < nrow; i++) @@ -261,7 +261,7 @@ main(void) sp); (void) fclose(sp); #endif - + sp = fopen("bin8", "w"); for (k = 0; k < npln; k++) for (i = 0; i < nrow; i++) @@ -269,13 +269,13 @@ main(void) (void) fwrite((char *) &b8i3[k][i][j], sizeof(char), 1, sp); (void) fclose(sp); - + #endif /* * binary 64-bit file - rank 2 & 3 */ - + sp = fopen("bfp64", "w"); for (k = 0; k < npln; k++) for (i = 0; i < nrow; i++) diff --git a/tools/h5jam/getub.c b/tools/h5jam/getub.c index 01756a5..3d9cbd1 100644 --- a/tools/h5jam/getub.c +++ b/tools/h5jam/getub.c @@ -39,11 +39,11 @@ static struct long_options l_opts[] = { /*------------------------------------------------------------------------- * Function: usage * - * Purpose: Print the usage message + * Purpose: Print the usage message * * Return: void * - * Programmer: + * Programmer: * * Modifications: * @@ -62,11 +62,11 @@ usage (const char *prog) * * Purpose: Parse the command line for the h5dumper. * - * Return: Success: + * Return: Success: * * Failure: Exits program with EXIT_FAILURE value. * - * Programmer: + * Programmer: * * Modifications: * diff --git a/tools/h5jam/h5jam.c b/tools/h5jam/h5jam.c index b0cf908..e585f3a 100644 --- a/tools/h5jam/h5jam.c +++ b/tools/h5jam/h5jam.c @@ -63,11 +63,11 @@ static struct long_options l_opts[] = { /*------------------------------------------------------------------------- * Function: usage * - * Purpose: Print the usage message + * Purpose: Print the usage message * * Return: void * - * Programmer: + * Programmer: * * Modifications: * @@ -94,11 +94,11 @@ usage (const char *prog) * * Purpose: Parse the command line for the h5dumper. * - * Return: Success: + * Return: Success: * * Failure: Exits program with EXIT_FAILURE value. * - * Programmer: + * Programmer: * * Modifications: * @@ -146,7 +146,7 @@ parse_command_line (int argc, const char *argv[]) * Return: Success: 0 * Failure: 1 * - * Programmer: + * Programmer: * * Modifications: * @@ -315,7 +315,7 @@ main (int argc, const char *argv[]) } } - /* copy the HDF5 from starting at usize to starting at newubsize: + /* copy the HDF5 from starting at usize to starting at newubsize: * makes room at 'from' for new ub */ /* if no current ub, usize is 0 */ copy_some_to_file (h5fid, ofid, usize, newubsize, @@ -362,7 +362,7 @@ main (int argc, const char *argv[]) * Return: Success: last byte written in the output. * Failure: Exits program with EXIT_FAILURE value. * - * Programmer: + * Programmer: * * Modifications: * @@ -478,10 +478,10 @@ copy_some_to_file (int infid, int outfid, hsize_t startin, hsize_t startout, /*------------------------------------------------------------------------- * Function: compute_user_block_size * - * Purpose: Find the offset of the HDF5 header after the user block: + * Purpose: Find the offset of the HDF5 header after the user block: * align at 0, 512, 1024, etc. * ublock_size: the size of the user block (bytes). - * + * * Return: Success: the location of the header == the size of the * padded user block. * Failure: none @@ -489,7 +489,7 @@ copy_some_to_file (int infid, int outfid, hsize_t startin, hsize_t startout, * Return: Success: last byte written in the output. * Failure: Exits program with EXIT_FAILURE value. * - * Programmer: + * Programmer: * * Modifications: * diff --git a/tools/h5jam/h5jamgentest.c b/tools/h5jam/h5jamgentest.c index c3981a4..4cc01a9 100644 --- a/tools/h5jam/h5jamgentest.c +++ b/tools/h5jam/h5jamgentest.c @@ -237,7 +237,7 @@ float dset2_1[10], dset2_2[3][5]; H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_1); H5Sclose(space); H5Dclose(dataset); - + /* dset2.2 */ dims[0] = 3; dims[1] = 5; space = H5Screate_simple(2, dims, NULL); @@ -367,7 +367,7 @@ char *bp; H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_1); H5Sclose(space); H5Dclose(dataset); - + /* dset2.2 */ dims[0] = 3; dims[1] = 5; space = H5Screate_simple(2, dims, NULL); @@ -392,7 +392,7 @@ char *bp; memset(buf,'\0',512); bp = buf; for (u = 0; u < strlen(pattern); u++) { - *bp++ = pattern[u%10]; + *bp++ = pattern[u%10]; } HDwrite(fd,buf,512); @@ -511,7 +511,7 @@ char *bp; H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2_1); H5Sclose(space); H5Dclose(dataset); - + /* dset2.2 */ dims[0] = 3; dims[1] = 5; space = H5Screate_simple(2, dims, NULL); @@ -536,7 +536,7 @@ char *bp; memset(buf,'\0',1024); bp = buf; for (i = 0; i < 513; i++) { - *bp++ = pattern[i%10]; + *bp++ = pattern[i%10]; } HDwrite(fd,buf,1024); @@ -567,10 +567,10 @@ char *bp; /* fill buf with pattern */ bp = buf; for (i = 0; i < size; i++) { - *bp++ = pattern[i%10]; + *bp++ = pattern[i%10]; } - + HDwrite(fd,buf,size); close(fd); @@ -597,9 +597,9 @@ char *bp; /* fill buf with pattern */ bp = buf; for (i = 0; i < size; i++) { - *bp++ = (char) i & 0xff; + *bp++ = (char) i & 0xff; } - + HDwrite(fd,buf,size); close(fd); diff --git a/tools/h5jam/h5unjam.c b/tools/h5jam/h5unjam.c index 4ed7dd9..7141ea8 100644 --- a/tools/h5jam/h5unjam.c +++ b/tools/h5jam/h5unjam.c @@ -55,18 +55,18 @@ static struct long_options l_opts[] = { {"delet", no_arg, 'd'}, {"dele", no_arg, 'd'}, {"del", no_arg, 'd'}, - {"de", no_arg, 'd'}, + {"de", no_arg, 'd'}, { NULL, 0, '\0' } }; /*------------------------------------------------------------------------- * Function: usage * - * Purpose: Print the usage message + * Purpose: Print the usage message * * Return: void * - * Programmer: + * Programmer: * * Modifications: * @@ -89,11 +89,11 @@ usage(const char *prog) * * Purpose: Parse the command line for the h5dumper. * - * Return: Success: + * Return: Success: * * Failure: Exits program with EXIT_FAILURE value. * - * Programmer: + * Programmer: * * Modifications: * @@ -148,7 +148,7 @@ parse_command_line(int argc, const char *argv[]) * Return: Success: 0 * Failure: 1 * - * Programmer: + * Programmer: * * Modifications: * @@ -207,7 +207,7 @@ main(int argc, const char *argv[]) /* no user block to remove: message? */ error_msg(progname, "\"%s\" has no user block: no change to file\n", input_file); exit(EXIT_SUCCESS); - + } res = stat(input_file, &sbuf); @@ -260,14 +260,14 @@ main(int argc, const char *argv[]) } - /* copy from 0 to 'usize - 1' into ufid */ + /* copy from 0 to 'usize - 1' into ufid */ if (!do_delete) { copy_to_file( ifid, ufid, 0, (ssize_t) usize); } - /* copy from usize to end of file into h5fid, + /* copy from usize to end of file into h5fid, * starting at end of user block if present - */ + */ copy_to_file( ifid, h5fid, (ssize_t) usize, (ssize_t)(fsize - (ssize_t)usize) ); @@ -279,12 +279,12 @@ main(int argc, const char *argv[]) } /* - * Copy 'how_much' bytes from the input file to the output file, + * Copy 'how_much' bytes from the input file to the output file, * starting at byte 'where' in the input file. - * + * * Returns the size of the output file. */ -hsize_t +hsize_t copy_to_file( int infid, int ofid, ssize_t where, ssize_t how_much ) { char buf[1024]; off_t to; diff --git a/tools/h5jam/tellub.c b/tools/h5jam/tellub.c index 24a04d4..2766638 100644 --- a/tools/h5jam/tellub.c +++ b/tools/h5jam/tellub.c @@ -42,11 +42,11 @@ static struct long_options l_opts[] = { /*------------------------------------------------------------------------- * Function: usage * - * Purpose: Print the usage message + * Purpose: Print the usage message * * Return: void * - * Programmer: + * Programmer: * * Modifications: * @@ -68,11 +68,11 @@ usage (const char *prog) * * Purpose: Parse the command line for the h5dumper. * - * Return: Success: + * Return: Success: * * Failure: Exits program with EXIT_FAILURE value. * - * Programmer: + * Programmer: * * Modifications: * @@ -116,7 +116,7 @@ parse_command_line (int argc, const char *argv[]) * Return: Success: 0 * Failure: 1 * - * Programmer: + * Programmer: * * Modifications: * diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c index 4b5d5cd..e2ab625 100644 --- a/tools/h5ls/h5ls.c +++ b/tools/h5ls/h5ls.c @@ -151,7 +151,7 @@ sym_insert(H5G_stat_t *sb, const char *name) /* Don't add it if the link count is 1 because such an object can only * have one name. */ if (sb->nlink<2) return; - + /* Extend the table */ if (idtab_g.nobjs>=idtab_g.nalloc) { idtab_g.nalloc = MAX(256, 2*idtab_g.nalloc); @@ -188,7 +188,7 @@ static char * sym_lookup(H5G_stat_t *sb) { int n; - + if (sb->nlink<2) return NULL; /*only one name possible*/ for (n=0; nobjno[0] && @@ -220,7 +220,7 @@ static int display_string(FILE *stream, const char *s, hbool_t escape_spaces) { int nprint=0; - + for (/*void*/; s && *s; s++) { switch (*s) { case '"': @@ -544,9 +544,9 @@ display_int_type(hid_t type, int ind) const char *order_s=NULL; /* byte order string */ H5T_sign_t sign; /* sign scheme value */ const char *sign_s=NULL; /* sign scheme string */ - + if (H5T_INTEGER!=H5Tget_class(type)) return FALSE; - + /* Byte order */ if (H5Tget_size(type)>1) { order = H5Tget_order(type); @@ -575,7 +575,7 @@ display_int_type(hid_t type, int ind) } else { sign_s = " unknown-sign"; } - + /* Print size, order, and sign on first line, precision and padding * information on the subsequent lines */ printf("%lu-bit%s%s integer", @@ -614,9 +614,9 @@ display_float_type(hid_t type, int ind) const char *norm_s=NULL; /* normalization string */ H5T_pad_t pad; /* internal padding value */ const char *pad_s=NULL; /* internal padding string */ - + if (H5T_FLOAT!=H5Tget_class(type)) return FALSE; - + /* Byte order */ if (H5Tget_size(type)>1) { order = H5Tget_order(type); @@ -657,7 +657,7 @@ display_float_type(hid_t type, int ind) norm_s = ", unknown normalization"; break; } - printf("\n%*s(significant for %lu bit%s at bit %lu%s)", ind, "", + printf("\n%*s(significant for %lu bit%s at bit %lu%s)", ind, "", (unsigned long)msize, 1==msize?"":"s", (unsigned long)mpos, norm_s); printf("\n%*s(exponent for %lu bit%s at bit %lu, bias is 0x%lx)", @@ -714,7 +714,7 @@ display_cmpd_type(hid_t type, int ind) unsigned nmembs; /* number of members */ int n; /* miscellaneous counters */ unsigned i; /* miscellaneous counters */ - + if (H5T_COMPOUND!=H5Tget_class(type)) return FALSE; printf("struct {"); nmembs=H5Tget_nmembers(type); @@ -769,7 +769,7 @@ display_enum_type(hid_t type, int ind) size_t dst_size; /* destination value type size */ unsigned i; /* miscellaneous counters */ size_t j; - + if (H5T_ENUM!=H5Tget_class(type)) return FALSE; nmembs = H5Tget_nmembers(type); assert(nmembs>0); @@ -777,7 +777,7 @@ display_enum_type(hid_t type, int ind) printf("enum "); display_type(super, ind+4); printf(" {"); - + /* Determine what data type to use for the native values. To simplify * things we entertain three possibilities: * 1. long_long -- the largest native signed integer @@ -868,7 +868,7 @@ display_string_type(hid_t type, int UNUSED ind) const char *pad_s=NULL; H5T_cset_t cset; const char *cset_s=NULL; - + if (H5T_STRING!=H5Tget_class(type)) return FALSE; /* Padding */ @@ -968,7 +968,7 @@ display_reference_type(hid_t type, int UNUSED ind) printf("%lu-byte unknown reference", (unsigned long)H5Tget_size(type)); } - + return TRUE; } @@ -994,7 +994,7 @@ display_opaque_type(hid_t type, int ind) { char *tag; size_t size; - + if (H5T_OPAQUE!=H5Tget_class(type)) return FALSE; size = H5Tget_size(type); @@ -1027,7 +1027,7 @@ static hbool_t display_vlen_type(hid_t type, int ind) { hid_t super; - + if (H5T_VLEN!=H5Tget_class(type)) return FALSE; printf("variable length of\n%*s", ind+4, ""); @@ -1085,7 +1085,7 @@ display_array_type(hid_t type, int ind) } else { fputs(" [SCALAR]", stdout); } - + /* Print parent type */ putchar(' '); @@ -1094,7 +1094,7 @@ display_array_type(hid_t type, int ind) H5Tclose(super); return TRUE; } - + /*------------------------------------------------------------------------- * Function: display_bitfield_type * @@ -1166,7 +1166,7 @@ display_type(hid_t type, int ind) { H5T_class_t data_class = H5Tget_class(type); H5G_stat_t sb; - + /* Bad data type */ if (type<0) { printf(""); @@ -1183,7 +1183,7 @@ display_type(hid_t type, int ind) printf("shared "); } } - + /* Print the type */ if ((!simple_output_g && display_native_type(type, ind)) || display_ieee_type(type, ind) || @@ -1231,7 +1231,7 @@ dump_dataset_values(hid_t dset) h5dump_t info; char string_prefix[64]; static char fmt_double[16], fmt_float[16]; - + /* Set to all default values and then override */ memset(&info, 0, sizeof info); @@ -1242,7 +1242,7 @@ dump_dataset_values(hid_t dset) info.line_multi_new = 0; info.line_pre = " "; info.line_cont = " "; - + info.arr_pre = ""; info.arr_suf = ""; info.arr_sep = " "; @@ -1252,10 +1252,10 @@ dump_dataset_values(hid_t dset) info.cmpd_sep = " "; if (label_g) info.cmpd_name = "%s="; - + info.elmt_suf1 = " "; info.str_locale = ESCAPE_HTML; - + } else { info.idx_fmt = "(%s)"; info.line_ncols = width_g; @@ -1274,15 +1274,15 @@ dump_dataset_values(hid_t dset) info.dset_format = "DSET-%lu:%lu:%lu:%lu-"; info.dset_hidefileno = 0; - + info.obj_format = "-%lu:%lu:%lu:%lu"; info.obj_hidefileno = 0; - + info.dset_blockformat_pre = "%sBlk%lu: "; info.dset_ptformat_pre = "%sPt%lu: "; - + info.line_indent = ""; - + if (hexdump_g) { /* Print all data in hexadecimal format if the `-x' or `--hexdump' * command line switch was given. */ @@ -1298,8 +1298,8 @@ dump_dataset_values(hid_t dset) info.line_pre = string_prefix; info.line_suf = "\""; } - - /* Print all the values. */ + + /* Print all the values. */ printf(" Data:\n"); if (h5tools_dump_dset(stdout, &info, dset, -1, NULL, -1) < 0) { printf(" Unable to print data.\n"); @@ -1382,7 +1382,7 @@ list_attr (hid_t obj, const char *attr_name, void UNUSED *op_data) info.line_pre = " "; info.line_cont = " "; info.str_repeat = 8; - + } else { printf(" Data:\n"); info.idx_fmt = "(%s)"; @@ -1390,7 +1390,7 @@ list_attr (hid_t obj, const char *attr_name, void UNUSED *op_data) info.line_cont = " %s "; info.str_repeat = 8; } - + info.line_ncols = width_g; if (label_g) info.cmpd_name = "%s="; if (string_g && 1==H5Tget_size(type) && @@ -1420,16 +1420,16 @@ list_attr (hid_t obj, const char *attr_name, void UNUSED *op_data) if (H5Aread(attr, p_type, buf)>=0) h5tools_dump_mem(stdout, &info, attr, p_type, space, buf, -1); free(buf); - H5Tclose(p_type); + H5Tclose(p_type); } - + H5Sclose(space); H5Tclose(type); H5Aclose(attr); } else { putchar('\n'); } - + return 0; } @@ -1524,7 +1524,7 @@ dataset_list2(hid_t dset, const char UNUSED *name) int n, max_len; /* max extern file name length */ double utilization; /* percent utilization of storage */ int i; - + if (verbose_g>0) { dcpl = H5Dget_create_plist(dset); space = H5Dget_space(dset); @@ -1558,7 +1558,7 @@ dataset_list2(hid_t dset, const char UNUSED *name) printf(", %1.2f%% utilization", utilization); } putchar('\n'); - + /* Print information about external strorage */ if ((nf = H5Pget_external_count(dcpl))>0) { for (i=0, max_len=0; icontainer, name); if (fullname_g) { @@ -1795,7 +1795,7 @@ list (hid_t group, const char *name, void *_iter) } else { sym_insert(&sb, fullname); } - + /* Open the object. Not all objects can be opened. If this is the case * then return right away. */ if (sb.type>=0 && @@ -1804,13 +1804,13 @@ list (hid_t group, const char *name, void *_iter) printf(" *ERROR*\n"); goto done; } - - /* List the first line of information for the object. */ + + /* List the first line of information for the object. */ if (sb.type>=0 && dispatch_g[sb.type].list1) { (dispatch_g[sb.type].list1)(obj); } putchar('\n'); - + /* Show detailed information about the object, beginning with information * which is common to all objects. */ if (verbose_g>0 && H5G_LINK!=sb.type) { @@ -1838,8 +1838,8 @@ list (hid_t group, const char *name, void *_iter) if (sb.type>=0 && dispatch_g[sb.type].list2) { (dispatch_g[sb.type].list2)(obj, fullname); } - - /* Close the object. */ + + /* Close the object. */ done: if (sb.type>=0 && obj>=0 && dispatch_g[sb.type].close) { (dispatch_g[sb.type].close)(obj); @@ -2000,7 +2000,7 @@ static void leave(int ret) { h5tools_close(); - + exit(ret); } @@ -2075,7 +2075,7 @@ main (int argc, const char *argv[]) } else if (!strcmp(argv[argno], "--full")) { fullname_g = TRUE; } else if (!strcmp(argv[argno], "--group")) { - grp_literal_g = TRUE; + grp_literal_g = TRUE; } else if (!strcmp(argv[argno], "--label")) { label_g = TRUE; } else if (!strcmp(argv[argno], "--recursive")) { diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c index 09d83b9..5b5f8c3 100644 --- a/tools/h5repack/h5repack.c +++ b/tools/h5repack/h5repack.c @@ -17,7 +17,7 @@ /*------------------------------------------------------------------------- * File: h5repack.c - * Purpose: Public API functions + * Purpose: Public API functions *------------------------------------------------------------------------- */ @@ -37,7 +37,7 @@ static void aux_initglb_filter(pack_opt_t *options) { int k; options->filter_g.filtn = -1; - for ( k=0; kfilter_g.cd_values[k] = -1; } @@ -45,12 +45,12 @@ static void aux_initglb_filter(pack_opt_t *options) /*------------------------------------------------------------------------- * Function: h5repack * - * Purpose: locate all high-level HDF5 objects in the file + * Purpose: locate all high-level HDF5 objects in the file * and compress/chunk them using options * * Algorythm: 2 traversals are made to the file; the 1st builds a list of * the objects, the 2nd makes a copy of them, using the options; - * the reason for the 1st traversal is to check for invalid + * the reason for the 1st traversal is to check for invalid * object name requests * * Return: 0, ok, -1, fail @@ -61,23 +61,23 @@ static void aux_initglb_filter(pack_opt_t *options) * *------------------------------------------------------------------------- */ -int h5repack(const char* infile, - const char* outfile, +int h5repack(const char* infile, + const char* outfile, pack_opt_t *options) { /* check input */ if (check_options(options)<0) return -1; - + /* check for objects in input that are in the file */ if (check_objects(infile,options)<0) return -1; - + /* copy the objects */ if (copy_objects(infile,outfile,options)<0) return -1; - + return 0; } @@ -93,7 +93,7 @@ int h5repack(const char* infile, *------------------------------------------------------------------------- */ -int h5repack_init (pack_opt_t *options, +int h5repack_init (pack_opt_t *options, int verbose) { memset(options,0,sizeof(pack_opt_t)); @@ -118,7 +118,7 @@ int h5repack_end (pack_opt_t *options) /*------------------------------------------------------------------------- * Function: h5repack_addfilter * - * Purpose: add a compression -f option to table + * Purpose: add a compression -f option to table * Example: -f dset:GZIP=6 * * Return: 0, ok, -1, fail @@ -126,7 +126,7 @@ int h5repack_end (pack_opt_t *options) *------------------------------------------------------------------------- */ -int h5repack_addfilter(const char* str, +int h5repack_addfilter(const char* str, pack_opt_t *options) { obj_list_t *obj_list=NULL; /*one object list for the -f and -c option entry */ @@ -172,10 +172,10 @@ int h5repack_addfilter(const char* str, */ -int h5repack_addlayout(const char* str, +int h5repack_addlayout(const char* str, pack_opt_t *options) { - + obj_list_t *obj_list=NULL; /*one object list for the -t and -c option entry */ int n_objs; /*number of objects in the current -t or -c option entry */ pack_info_t pack; /*info about layout to extract from parse */ @@ -188,7 +188,7 @@ int h5repack_addlayout(const char* str, is present with other objects <%s>\n",str); return -1; } - + /* parse the layout option */ obj_list=parse_layout(str,&n_objs,&pack,options); if (obj_list==NULL) @@ -198,7 +198,7 @@ int h5repack_addlayout(const char* str, if (options->all_layout==1 ) { options->layout_g=pack.layout; - if (pack.layout==H5D_CHUNKED) + if (pack.layout==H5D_CHUNKED) { /* -2 means the NONE option, remove chunking and set the global layout to contiguous */ @@ -210,7 +210,7 @@ int h5repack_addlayout(const char* str, else { options->chunk_g.rank=pack.chunk.rank; - for (j = 0; j < pack.chunk.rank; j++) + for (j = 0; j < pack.chunk.rank; j++) options->chunk_g.chunk_lengths[j] = pack.chunk.chunk_lengths[j]; } } @@ -249,7 +249,7 @@ static int check_options(pack_opt_t *options) * objects to layout *------------------------------------------------------------------------- */ - if (options->verbose) + if (options->verbose) { printf("Objects to modify layout are...\n"); if (options->all_layout==1) { @@ -271,22 +271,22 @@ static int check_options(pack_opt_t *options) printf(" Apply %s layout to all\n", slayout); if (H5D_CHUNKED==options->layout_g) { printf("with dimension ["); - for ( j = 0; j < options->chunk_g.rank; j++) + for ( j = 0; j < options->chunk_g.rank; j++) printf("%d ",(int)options->chunk_g.chunk_lengths[j]); printf("]\n"); } } }/* verbose */ - 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->op_tbl->objs[i].chunk.rank>0) { if (options->verbose){ - printf(" <%s> with chunk size ",name); - for ( k = 0; k < options->op_tbl->objs[i].chunk.rank; k++) + printf(" <%s> with chunk size ",name); + for ( k = 0; k < options->op_tbl->objs[i].chunk.rank; k++) printf("%d ",(int)options->op_tbl->objs[i].chunk.chunk_lengths[k]); printf("\n"); } @@ -295,26 +295,26 @@ static int check_options(pack_opt_t *options) else if (options->op_tbl->objs[i].chunk.rank==-2) { if (options->verbose) - printf(" <%s> %s\n",name,"NONE (contigous)"); + printf(" <%s> %s\n",name,"NONE (contigous)"); has_ck=1; } } - + if (options->all_layout==1 && has_ck){ printf("Error: Invalid chunking input: all option\ is present with other objects\n"); return -1; } - + /*------------------------------------------------------------------------- * objects to filter *------------------------------------------------------------------------- */ - - if (options->verbose) + + if (options->verbose) { printf("Objects to apply filter are...\n"); - if (options->all_filter==1) + if (options->all_filter==1) { H5Z_filter_t filtn=options->filter_g.filtn; switch (filtn) @@ -336,14 +336,14 @@ static int check_options(pack_opt_t *options) } } /* verbose */ - for ( i = 0; i < options->op_tbl->nelems; i++) + for ( i = 0; i < options->op_tbl->nelems; i++) { pack_info_t pack = options->op_tbl->objs[i]; char* name = pack.path; for ( j=0; jverbose) + if (options->verbose) { printf(" <%s> with %s filter\n", name, @@ -354,13 +354,13 @@ static int check_options(pack_opt_t *options) } /* j */ } /* i */ - + if (options->all_filter==1 && has_cp){ printf("Error: Invalid compression input: all option\ is present with other objects\n"); return -1; } - + return 0; } @@ -380,7 +380,7 @@ static int check_options(pack_opt_t *options) */ void read_info(const char *filename, - pack_opt_t *options) + pack_opt_t *options) { char stype[10]; @@ -390,15 +390,15 @@ void read_info(const char *filename, int i, rc=1; char *srcdir = getenv("srcdir"); /* the source directory */ char data_file[512]=""; /* buffer to hold name of existing file */ - + /* compose the name of the file to open, using the srcdir, if appropriate */ if (srcdir){ strcpy(data_file,srcdir); strcat(data_file,"/"); - } + } strcat(data_file,filename); - + if ((fp = fopen(data_file, "r")) == (FILE *)NULL) { printf( "Cannot open options file %s", filename); exit(1); @@ -410,12 +410,12 @@ void read_info(const char *filename, rc=fscanf(fp, "%s", stype); if (rc==-1) break; - + /*------------------------------------------------------------------------- * filter *------------------------------------------------------------------------- */ - if (strcmp(stype,"-f") == 0) { + if (strcmp(stype,"-f") == 0) { /* find begining of info */ i=0; c='0'; @@ -434,7 +434,7 @@ void read_info(const char *filename, if (feof(fp)) break; if (c==10 /*eol*/) break; } - comp_info[i-1]='\0'; /*cut the last " */ + comp_info[i-1]='\0'; /*cut the last " */ if (h5repack_addfilter(comp_info,options)==-1){ printf( "Could not add compression option. Exiting\n"); @@ -445,8 +445,8 @@ void read_info(const char *filename, * layout *------------------------------------------------------------------------- */ - else if (strcmp(stype,"-l") == 0) { - + else if (strcmp(stype,"-l") == 0) { + /* find begining of info */ i=0; c='0'; while( c!=' ' ) @@ -464,7 +464,7 @@ void read_info(const char *filename, if (feof(fp)) break; if (c==10 /*eol*/) break; } - comp_info[i-1]='\0'; /*cut the last " */ + comp_info[i-1]='\0'; /*cut the last " */ if (h5repack_addlayout(comp_info,options)==-1){ printf( "Could not add chunck option. Exiting\n"); diff --git a/tools/h5repack/h5repack.h b/tools/h5repack/h5repack.h index e4de4d3..f8ea1db 100644 --- a/tools/h5repack/h5repack.h +++ b/tools/h5repack/h5repack.h @@ -37,17 +37,17 @@ /* a list of names */ typedef struct { - char obj[MAX_NC_NAME]; + char obj[MAX_NC_NAME]; } obj_list_t; -/* - the type of filter and additional parameter +/* + the type of filter and additional parameter type can be one of the filters H5Z_FILTER_NONE 0, uncompress if compressed - H5Z_FILTER_DEFLATE 1 , deflation like gzip + H5Z_FILTER_DEFLATE 1 , deflation like gzip H5Z_FILTER_SHUFFLE 2 , shuffle the data H5Z_FILTER_FLETCHER32 3 , letcher32 checksum of EDC - H5Z_FILTER_SZIP 4 , szip compression + H5Z_FILTER_SZIP 4 , szip compression */ #define CDVALUES 2 @@ -56,15 +56,15 @@ typedef struct { H5Z_filter_t filtn; /* filter identification number */ int cd_values[CDVALUES]; /* filter client data values */ /* extra input for szip, selects the coding method - entropy coding method: EC=0 - nearest neighbor coding method: NN=1 + entropy coding method: EC=0 + nearest neighbor coding method: NN=1 */ - int szip_coding; + int szip_coding; } filter_info_t; /* chunk lengths along each dimension and rank */ typedef struct { - hsize_t chunk_lengths[MAX_VAR_DIMS]; + hsize_t chunk_lengths[MAX_VAR_DIMS]; int rank; } chunk_info_t; @@ -140,29 +140,29 @@ int h5repack_cmpdcpl (const char *fname1, */ -int check_objects(const char* fname, +int check_objects(const char* fname, pack_opt_t *options); -int copy_objects(const char* fnamein, +int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options); -void print_objlist(const char *filename, - int nobjects, +void print_objlist(const char *filename, + int nobjects, trav_info_t *travi ); -int do_copy_objects(hid_t fidin, - hid_t fidout, +int do_copy_objects(hid_t fidin, + hid_t fidout, trav_table_t *travt, pack_opt_t *options); -int copy_attr(hid_t loc_in, - hid_t loc_out, +int copy_attr(hid_t loc_in, + hid_t loc_out, pack_opt_t *options ); -int do_copy_refobjs(hid_t fidin, - hid_t fidout, +int do_copy_refobjs(hid_t fidin, + hid_t fidout, trav_table_t *travt, pack_opt_t *options); /* repack options */ @@ -234,13 +234,13 @@ pack_info_t* options_get_object( const char *path, *------------------------------------------------------------------------- */ -obj_list_t* parse_filter(const char *str, - int *n_objs, +obj_list_t* parse_filter(const char *str, + int *n_objs, filter_info_t *filt, pack_opt_t *options); -obj_list_t* parse_layout(const char *str, - int *n_objs, +obj_list_t* parse_layout(const char *str, + int *n_objs, pack_info_t *pack, /* info about object */ pack_opt_t *options); @@ -278,23 +278,23 @@ int parse_number(char *str); int make_testfiles(void); -int write_dset( hid_t loc_id, - int rank, - hsize_t *dims, +int write_dset( hid_t loc_id, + int rank, + hsize_t *dims, const char *dset_name, - hid_t type_id, + hid_t type_id, void *buf ); -int write_attr(hid_t loc_id, - int rank, - hsize_t *dims, +int write_attr(hid_t loc_id, + int rank, + hsize_t *dims, const char *attr_name, - hid_t type_id, + hid_t type_id, void *buf); -void write_attr_in(hid_t loc_id, +void write_attr_in(hid_t loc_id, const char* dset_name, /* for saving reference to dataset*/ hid_t fid, /* for reference create */ int make_diffs /* flag to modify data buffers */); -void write_dset_in(hid_t loc_id, +void write_dset_in(hid_t loc_id, const char* dset_name, /* for saving reference to dataset*/ hid_t file_id, int make_diffs /* flag to modify data buffers */); @@ -307,15 +307,15 @@ void write_dset_in(hid_t loc_id, */ int make_dset(hid_t loc_id, const char *name, - hid_t sid, + hid_t sid, hid_t dcpl, void *buf); -int make_attr(hid_t loc_id, - int rank, - hsize_t *dims, +int make_attr(hid_t loc_id, + int rank, + hsize_t *dims, const char *attr_name, - hid_t type_id, + hid_t type_id, void *buf); diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c index c1ae54a..94d1e09 100644 --- a/tools/h5repack/h5repack_copy.c +++ b/tools/h5repack/h5repack_copy.c @@ -26,16 +26,16 @@ /*------------------------------------------------------------------------- * Function: print_obj * - * Purpose: print name and filters of an object + * Purpose: print name and filters of an object * *------------------------------------------------------------------------- */ static void print_obj(hid_t dcpl_id, char *name) { - char str[255]; + char str[255]; #if defined (PRINT_DEBUG ) - char temp[255]; -#endif + char temp[255]; +#endif int nfilters; /* number of filters */ unsigned filt_flags; /* filter flags */ H5Z_filter_t filtn; /* filter identification number */ @@ -47,18 +47,18 @@ static void print_obj(hid_t dcpl_id, char *name) strcpy(str,"\0"); /* get information about input filters */ - if ((nfilters = H5Pget_nfilters(dcpl_id))<0) + if ((nfilters = H5Pget_nfilters(dcpl_id))<0) return; for ( i=0; iverbose) printf(" %-10s %s\n", "group",travt->objs[i].name ); - if ((grp_out=H5Gcreate(fidout,travt->objs[i].name, 0))<0) + if ((grp_out=H5Gcreate(fidout,travt->objs[i].name, 0))<0) goto error; - if((grp_in = H5Gopen (fidin,travt->objs[i].name))<0) + if((grp_in = H5Gopen (fidin,travt->objs[i].name))<0) goto error; /*------------------------------------------------------------------------- * copy attrs *------------------------------------------------------------------------- */ - if (copy_attr(grp_in,grp_out,options)<0) + if (copy_attr(grp_in,grp_out,options)<0) goto error; - - if (H5Gclose(grp_out)<0) + + if (H5Gclose(grp_out)<0) goto error; - if (H5Gclose(grp_in)<0) + if (H5Gclose(grp_in)<0) goto error; @@ -288,15 +288,15 @@ int do_copy_objects(hid_t fidin, */ case H5G_DATASET: - if ((dset_in=H5Dopen(fidin,travt->objs[i].name))<0) + if ((dset_in=H5Dopen(fidin,travt->objs[i].name))<0) goto error; - if ((space_id=H5Dget_space(dset_in))<0) + if ((space_id=H5Dget_space(dset_in))<0) goto error; - if ((ftype_id=H5Dget_type (dset_in))<0) + if ((ftype_id=H5Dget_type (dset_in))<0) goto error; - if ((dcpl_id=H5Dget_create_plist(dset_in))<0) + if ((dcpl_id=H5Dget_create_plist(dset_in))<0) goto error; - if ((dcpl_out = H5Pcopy (dcpl_id))<0) + if ((dcpl_out = H5Pcopy (dcpl_id))<0) goto error; if ( (rank=H5Sget_simple_extent_ndims(space_id))<0) goto error; @@ -304,12 +304,12 @@ int do_copy_objects(hid_t fidin, if ( H5Sget_simple_extent_dims(space_id,dims,NULL)<0) goto error; nelmts=1; - for (j=0; jverbose) print_obj(dcpl_id,travt->objs[i].name ); - + if ((mtype_id=h5tools_get_native_type(ftype_id))<0) goto error; @@ -320,7 +320,7 @@ int do_copy_objects(hid_t fidin, * check for external files *------------------------------------------------------------------------- */ - if ((next=H5Pget_external_count (dcpl_id))<0) + if ((next=H5Pget_external_count (dcpl_id))<0) goto error; if (next) { @@ -328,8 +328,8 @@ int do_copy_objects(hid_t fidin, } /*------------------------------------------------------------------------- - * check if the dataset creation property list has filters that - * are not registered in the current configuration + * check if the dataset creation property list has filters that + * are not registered in the current configuration * 1) the external filters GZIP and SZIP might not be available * 2) the internal filters might be turned off *------------------------------------------------------------------------- @@ -345,10 +345,10 @@ int do_copy_objects(hid_t fidin, */ if ( (H5T_REFERENCE!=H5Tget_class(mtype_id))) { - + /* get the storage size of the input dataset */ dsize_in=H5Dget_storage_size(dset_in); - + /*------------------------------------------------------------------------- * read to memory *------------------------------------------------------------------------- @@ -362,7 +362,7 @@ int do_copy_objects(hid_t fidin, } if (H5Dread(dset_in,mtype_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0) goto error; - + /*------------------------------------------------------------------------- * apply the filter *------------------------------------------------------------------------- @@ -371,7 +371,7 @@ int do_copy_objects(hid_t fidin, goto error; }/*nelmts*/ - + /*------------------------------------------------------------------------- * create; * disable error checking in case the dataset cannot be created with the @@ -385,9 +385,9 @@ int do_copy_objects(hid_t fidin, if (dset_out==FAIL) { - if ((dset_out=H5Dcreate(fidout,travt->objs[i].name,mtype_id,space_id,dcpl_id))<0) + if ((dset_out=H5Dcreate(fidout,travt->objs[i].name,mtype_id,space_id,dcpl_id))<0) goto error; - + if (options->verbose) printf("Warning: Could not apply the filter to <%s>\n", travt->objs[i].name); } @@ -405,16 +405,16 @@ int do_copy_objects(hid_t fidin, * copy attrs *------------------------------------------------------------------------- */ - if (copy_attr(dset_in,dset_out,options)<0) + if (copy_attr(dset_in,dset_out,options)<0) goto error; /*close */ - if (H5Dclose(dset_out)<0) + if (H5Dclose(dset_out)<0) goto error; - + if (buf) free(buf); - + }/*H5T_STD_REF_OBJ*/ }/*can_read*/ @@ -423,19 +423,19 @@ int do_copy_objects(hid_t fidin, * close *------------------------------------------------------------------------- */ - if (H5Tclose(ftype_id)<0) + if (H5Tclose(ftype_id)<0) goto error; - if (H5Tclose(mtype_id)<0) + if (H5Tclose(mtype_id)<0) goto error; - if (H5Pclose(dcpl_id)<0) + if (H5Pclose(dcpl_id)<0) goto error; - if (H5Pclose(dcpl_out)<0) + if (H5Pclose(dcpl_out)<0) goto error; - if (H5Sclose(space_id)<0) + if (H5Sclose(space_id)<0) goto error; - if (H5Dclose(dset_in)<0) + if (H5Dclose(dset_in)<0) goto error; - + break; /*------------------------------------------------------------------------- @@ -444,25 +444,25 @@ int do_copy_objects(hid_t fidin, */ case H5G_TYPE: - if ((type_in = H5Topen (fidin,travt->objs[i].name))<0) + if ((type_in = H5Topen (fidin,travt->objs[i].name))<0) goto error; - if ((type_out = H5Tcopy(type_in))<0) + if ((type_out = H5Tcopy(type_in))<0) goto error; - if ((H5Tcommit(fidout,travt->objs[i].name,type_out))<0) + if ((H5Tcommit(fidout,travt->objs[i].name,type_out))<0) goto error; /*------------------------------------------------------------------------- * copy attrs *------------------------------------------------------------------------- */ - if (copy_attr(type_in,type_out,options)<0) + if (copy_attr(type_in,type_out,options)<0) goto error; - - if (H5Tclose(type_in)<0) + + if (H5Tclose(type_in)<0) goto error; - if (H5Tclose(type_out)<0) + if (H5Tclose(type_out)<0) goto error; if (options->verbose) @@ -480,12 +480,12 @@ int do_copy_objects(hid_t fidin, { H5G_stat_t statbuf; char *targbuf=NULL; - + if (H5Gget_objinfo(fidin,travt->objs[i].name,FALSE,&statbuf)<0) goto error; - + targbuf = malloc(statbuf.linklen); - + if (H5Gget_linkval(fidin,travt->objs[i].name,statbuf.linklen,targbuf)<0) goto error; @@ -493,11 +493,11 @@ int do_copy_objects(hid_t fidin, H5G_LINK_SOFT, targbuf, /* current name of object */ travt->objs[i].name /* new name of object */ - )<0) + )<0) goto error; - + free(targbuf); - + if (options->verbose) printf(" %-10s %s\n","link",travt->objs[i].name ); @@ -510,31 +510,31 @@ int do_copy_objects(hid_t fidin, break; } } - + /*------------------------------------------------------------------------- - * the root is a special case, we get an ID for the root group + * the root is a special case, we get an ID for the root group * and copy its attributes using that ID * it must be done last, because the attributes might contain references to * objects in the object list *------------------------------------------------------------------------- */ - if ((grp_out = H5Gopen(fidout,"/"))<0) + if ((grp_out = H5Gopen(fidout,"/"))<0) goto error; - - if ((grp_in = H5Gopen(fidin,"/"))<0) + + if ((grp_in = H5Gopen(fidin,"/"))<0) goto error; - - if (copy_attr(grp_in,grp_out,options)<0) + + if (copy_attr(grp_in,grp_out,options)<0) goto error; - - if (H5Gclose(grp_out)<0) + + if (H5Gclose(grp_out)<0) goto error; - if (H5Gclose(grp_in)<0) + if (H5Gclose(grp_in)<0) goto error; - + return 0; - + error: H5E_BEGIN_TRY { H5Gclose(grp_in); @@ -558,7 +558,7 @@ error: /*------------------------------------------------------------------------- * Function: copy_attr * - * Purpose: copy attributes located in LOC_IN, which is obtained either from + * Purpose: copy attributes located in LOC_IN, which is obtained either from * loc_id = H5Gopen( fid, name); * loc_id = H5Dopen( fid, name); * loc_id = H5Topen( fid, name); @@ -572,15 +572,15 @@ error: *------------------------------------------------------------------------- */ -int copy_attr(hid_t loc_in, - hid_t loc_out, +int copy_attr(hid_t loc_in, + hid_t loc_out, pack_opt_t *options ) { - hid_t attr_id=-1; /* attr ID */ - hid_t attr_out=-1; /* attr ID */ - hid_t space_id=-1; /* space ID */ - hid_t ftype_id=-1; /* file data type ID */ + hid_t attr_id=-1; /* attr ID */ + hid_t attr_out=-1; /* attr ID */ + hid_t space_id=-1; /* space ID */ + hid_t ftype_id=-1; /* file data type ID */ hid_t mtype_id=-1; /* memory data type ID */ size_t msize; /* memory size of type */ void *buf=NULL; /* data buffer */ @@ -591,44 +591,44 @@ int copy_attr(hid_t loc_in, int n, j; unsigned u; - if ((n = H5Aget_num_attrs(loc_in))<0) + if ((n = H5Aget_num_attrs(loc_in))<0) goto error; - + for ( u = 0; u < (unsigned)n; u++) { - /* set data buffer to NULL each iteration - we might not use it in the case of references + /* set data buffer to NULL each iteration + we might not use it in the case of references */ - buf=NULL; + buf=NULL; /*------------------------------------------------------------------------- * open *------------------------------------------------------------------------- */ /* open attribute */ - if ((attr_id = H5Aopen_idx(loc_in, u))<0) + if ((attr_id = H5Aopen_idx(loc_in, u))<0) goto error; - + /* get name */ - if (H5Aget_name( attr_id, 255, name )<0) + if (H5Aget_name( attr_id, 255, name )<0) goto error; /* get the file datatype */ if ((ftype_id = H5Aget_type( attr_id )) < 0 ) goto error; - + /* get the dataspace handle */ if ((space_id = H5Aget_space( attr_id )) < 0 ) goto error; - + /* get dimensions */ if ( (rank = H5Sget_simple_extent_dims(space_id, dims, NULL)) < 0 ) goto error; - + nelmts=1; - for (j=0; jverbose) printf(" %-13s %s\n", "attr", name); - + /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- @@ -695,7 +695,7 @@ int copy_attr(hid_t loc_in, if (H5Aclose(attr_id)<0) goto error; } /* u */ - + return 0; error: diff --git a/tools/h5repack/h5repack_filters.c b/tools/h5repack/h5repack_filters.c index 7108c3a..b87a713 100644 --- a/tools/h5repack/h5repack_filters.c +++ b/tools/h5repack/h5repack_filters.c @@ -25,26 +25,26 @@ * *------------------------------------------------------------------------- */ -static +static int aux_find_obj(const char* name, /* object name from traverse list */ - pack_opt_t *options, /* repack options */ + pack_opt_t *options, /* repack options */ pack_info_t *obj /*OUT*/) /* info about object to filter */ { char *pdest; int result; int i; - - for ( i=0; iop_tbl->nelems; i++) + + for ( i=0; iop_tbl->nelems; i++) { if (strcmp(options->op_tbl->objs[i].path,name)==0) { *obj = options->op_tbl->objs[i]; return i; } - + pdest = strstr(name,options->op_tbl->objs[i].path); result = (int)(pdest - name); - + /* found at position 1, meaning without '/' */ if( pdest != NULL && result==1 ) { @@ -52,7 +52,7 @@ int aux_find_obj(const char* name, /* object name from traverse list */ return i; } }/*i*/ - + return -1; } @@ -79,11 +79,11 @@ int aux_assign_obj(const char* name, /* object name from traverse lis init_packobject(&tmp); idx = aux_find_obj(name,options,&tmp); - + /* name was on input */ if (idx>=0) { - + /* applying to all objects */ if (options->all_layout) { @@ -93,7 +93,7 @@ int aux_assign_obj(const char* name, /* object name from traverse lis { case H5D_CHUNKED: tmp.chunk.rank=options->chunk_g.rank; - for ( i=0; ichunk_g.chunk_lengths[i]; break; default: @@ -107,15 +107,15 @@ int aux_assign_obj(const char* name, /* object name from traverse lis { case H5D_CHUNKED: tmp.chunk.rank = options->op_tbl->objs[idx].chunk.rank; - for ( i=0; iop_tbl->objs[idx].chunk.chunk_lengths[i]; break; default: break; }/*switch*/ - + } - + /* applying to all objects */ if (options->all_filter) { @@ -126,29 +126,29 @@ int aux_assign_obj(const char* name, /* object name from traverse lis else { tmp.nfilters=options->op_tbl->objs[idx].nfilters; - for ( i=0; iop_tbl->objs[idx].filter[i]; } } - - + + } /* if idx */ - + /* no input name */ else { - + if (options->all_filter) { /* assign the global filter */ tmp.nfilters=1; tmp.filter[0]=options->filter_g; } - - + + if (options->all_layout) { /* assign the global layout info to the OBJ info */ @@ -157,21 +157,21 @@ int aux_assign_obj(const char* name, /* object name from traverse lis { case H5D_CHUNKED: tmp.chunk.rank=options->chunk_g.rank; - for ( i=0; ichunk_g.chunk_lengths[i]; break; default: break; }/*switch*/ - + } - - + + } - + *obj = tmp; return 1; - + } @@ -179,7 +179,7 @@ int aux_assign_obj(const char* name, /* object name from traverse lis /*------------------------------------------------------------------------- * Function: apply_filters * - * Purpose: apply the filters in the object to the property list; + * Purpose: apply the filters in the object to the property list; * do extra checking in the case of SZIP; delete all filters in the case * of H5Z_FILTER_NONE present in the PACK_INFO_T filter array * @@ -197,7 +197,7 @@ int apply_filters(const char* name, /* object name from traverse list */ hid_t dcpl_id, /* dataset creation property list */ hid_t type_id, /* dataset datatype */ pack_opt_t *options) /* repack options */ -{ +{ int nfilters; /* number of filters in DCPL */ unsigned aggression; /* the deflate level */ hsize_t nelmts; /* number of elements in dataset */ @@ -206,30 +206,30 @@ int apply_filters(const char* name, /* object name from traverse list */ H5D_layout_t layout; int i; pack_info_t obj; - + if (rank==0) goto out; - + /*------------------------------------------------------------------------- * initialize the assigment object *------------------------------------------------------------------------- */ init_packobject(&obj); - - + + /*------------------------------------------------------------------------- * find options *------------------------------------------------------------------------- */ if (aux_assign_obj(name,options,&obj)==0) return 0; - - + + /* check for datasets too small */ if ((size=H5Tget_size(type_id))==0) return 0; nelmts=1; - for (i=0; ithreshold ) { @@ -238,9 +238,9 @@ int apply_filters(const char* name, /* object name from traverse list */ name,(int)options->threshold); return 0; } - + /* get information about input filters */ - if ((nfilters = H5Pget_nfilters(dcpl_id))<0) + if ((nfilters = H5Pget_nfilters(dcpl_id))<0) return -1; /*------------------------------------------------------------------------- * check if we have filters in the pipeline @@ -249,11 +249,11 @@ int apply_filters(const char* name, /* object name from traverse list */ *------------------------------------------------------------------------- */ if (nfilters && obj.nfilters ) { - if (H5Premove_filter(dcpl_id,H5Z_FILTER_ALL)<0) + if (H5Premove_filter(dcpl_id,H5Z_FILTER_ALL)<0) return -1; } - + /*------------------------------------------------------------------------- * check if there is an existent chunk * read it only if there is not a requested layout @@ -261,9 +261,9 @@ int apply_filters(const char* name, /* object name from traverse list */ */ if (obj.layout == -1 ) { - if ((layout = H5Pget_layout(dcpl_id))<0) + if ((layout = H5Pget_layout(dcpl_id))<0) return -1; - + if (layout==H5D_CHUNKED) { if ((rank = H5Pget_chunk(dcpl_id,NELMTS(chsize),chsize/*out*/))<0) @@ -275,21 +275,21 @@ int apply_filters(const char* name, /* object name from traverse list */ } } - + /*------------------------------------------------------------------------- - * the type of filter and additional parameter + * the type of filter and additional parameter * type can be one of the filters * H5Z_FILTER_NONE 0, uncompress if compressed - * H5Z_FILTER_DEFLATE 1 , deflation like gzip + * H5Z_FILTER_DEFLATE 1 , deflation like gzip * H5Z_FILTER_SHUFFLE 2 , shuffle the data * H5Z_FILTER_FLETCHER32 3 , fletcher32 checksum of EDC - * H5Z_FILTER_SZIP 4 , szip compression + * H5Z_FILTER_SZIP 4 , szip compression *------------------------------------------------------------------------- */ - + if (obj.nfilters) { - + /*------------------------------------------------------------------------- * filters require CHUNK layout; if we do not have one define a default *------------------------------------------------------------------------- @@ -297,19 +297,19 @@ int apply_filters(const char* name, /* object name from traverse list */ if (obj.layout==-1) { obj.chunk.rank=rank; - for (i=0; i=0) { /* a layout was defined */ - if (H5Pset_layout(dcpl_id, obj.layout)<0) + if (H5Pset_layout(dcpl_id, obj.layout)<0) return -1; - + if (H5D_CHUNKED==obj.layout) { /* set up chunk */ if(H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths)<0) return -1; } else if (H5D_COMPACT==obj.layout) { - if (H5Pset_alloc_time(dcpl_id, H5D_ALLOC_TIME_EARLY)<0) + if (H5Pset_alloc_time(dcpl_id, H5D_ALLOC_TIME_EARLY)<0) return -1; } - + } - + return 0; - + out: if (options->verbose) printf("Warning: Filter could not be applied to <%s>\n",name); @@ -414,7 +414,7 @@ out: *------------------------------------------------------------------------- */ -int print_filters(hid_t dcpl_id) +int print_filters(hid_t dcpl_id) { int nfilters; /* number of filters */ unsigned filt_flags; /* filter flags */ @@ -427,20 +427,20 @@ int print_filters(hid_t dcpl_id) int i; /* get information about filters */ - if ((nfilters = H5Pget_nfilters(dcpl_id))<0) + if ((nfilters = H5Pget_nfilters(dcpl_id))<0) return -1; - - for (i=0; i: %s\n", fname, H5FOPENERROR ); @@ -74,18 +74,18 @@ int check_objects(const char* fname, * compare with user supplied list *------------------------------------------------------------------------- */ - + 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) { @@ -109,41 +109,41 @@ int check_objects(const char* fname, int ppb=options->op_tbl->objs[i].filter->cd_values[0]; hsize_t dims[H5S_MAX_RANK]; int rank; - hid_t did; - hid_t sid; + hid_t did; + hid_t sid; if (options->op_tbl->objs[i].chunk.rank>0) { rank=options->op_tbl->objs[i].chunk.rank; - for (j=0; jop_tbl->objs[i].chunk.chunk_lengths[j]; } else { - if ((did=H5Dopen(fid,travt->objs[i].name))<0) + if ((did=H5Dopen(fid,travt->objs[i].name))<0) goto out; - if ((sid=H5Dget_space(did))<0) + if ((sid=H5Dget_space(did))<0) goto out; if ( (rank=H5Sget_simple_extent_ndims(sid))<0) goto out; HDmemset(dims, 0, sizeof dims); if ( H5Sget_simple_extent_dims(sid,dims,NULL)<0) goto out; - for (j=0; j\n",argv[i+1]); @@ -89,23 +89,23 @@ int main(int argc, char **argv) } ++i; } - - else if (strcmp(argv[i], "-e") == 0) { + + else if (strcmp(argv[i], "-e") == 0) { read_info(argv[++i],&options); } - + else if (argv[i][0] == '-') { usage(); exit(1); } } - if (infile == NULL || outfile == NULL) + if (infile == NULL || outfile == NULL) { usage(); exit(1); } - + /* pack it */ ret=h5repack(infile,outfile,&options); @@ -128,7 +128,7 @@ int main(int argc, char **argv) *------------------------------------------------------------------------- */ -static +static void usage(void) { printf("h5repack -i input -o output [-h] [-v] [-f 'filter'] [-l 'layout'][-m number][-e file] \n"); diff --git a/tools/h5repack/h5repack_opttable.c b/tools/h5repack/h5repack_opttable.c index d85e1f5..7bb6d10 100644 --- a/tools/h5repack/h5repack_opttable.c +++ b/tools/h5repack/h5repack_opttable.c @@ -31,21 +31,21 @@ void init_packobject(pack_info_t *obj) { int j, k; - + strcpy(obj->path,"\0"); for ( j=0; jfilter[j].filtn = -1; obj->filter[j].szip_coding = -1; - for ( k=0; kfilter[j].cd_values[k] = -1; } obj->chunk.rank = -1; obj->refobj_id = -1; obj->layout = H5D_LAYOUT_ERROR; obj->nfilters = 0; - - + + } /*------------------------------------------------------------------------- @@ -58,7 +58,7 @@ void init_packobject(pack_info_t *obj) *------------------------------------------------------------------------- */ -static void aux_tblinsert_filter(pack_opttbl_t *table, +static void aux_tblinsert_filter(pack_opttbl_t *table, int I, filter_info_t filt) { @@ -83,14 +83,14 @@ static void aux_tblinsert_filter(pack_opttbl_t *table, *------------------------------------------------------------------------- */ -static void aux_tblinsert_layout(pack_opttbl_t *table, +static void aux_tblinsert_layout(pack_opttbl_t *table, int I, pack_info_t *pack) { int k; - + table->objs[I].layout = pack->layout; - if (H5D_CHUNKED==pack->layout) + if (H5D_CHUNKED==pack->layout) { /* -2 means the NONE option, remove chunking and set the layout to contiguous */ @@ -103,7 +103,7 @@ static void aux_tblinsert_layout(pack_opttbl_t *table, else { table->objs[I].chunk.rank = pack->chunk.rank; - for (k = 0; k < pack->chunk.rank; k++) + for (k = 0; k < pack->chunk.rank; k++) table->objs[I].chunk.chunk_lengths[k] = pack->chunk.chunk_lengths[k]; } } @@ -123,14 +123,14 @@ static void aux_tblinsert_layout(pack_opttbl_t *table, static int aux_inctable(pack_opttbl_t *table, int n_objs ) { int i; - + table->size += n_objs; table->objs = (pack_info_t*)realloc(table->objs, table->size * sizeof(pack_info_t)); if (table->objs==NULL) { printf("Error: not enough memory for options table\n"); return -1; } - for (i = table->nelems; i < table->size; i++) + for (i = table->nelems; i < table->size; i++) { init_packobject(&table->objs[i]); } @@ -155,7 +155,7 @@ int options_table_init( pack_opttbl_t **tbl ) printf("Error: not enough memory for options table\n"); return -1; } - + table->size = 30; table->nelems = 0; table->objs = (pack_info_t*) malloc(table->size * sizeof(pack_info_t)); @@ -163,12 +163,12 @@ int options_table_init( pack_opttbl_t **tbl ) printf("Error: not enough memory for options table\n"); return -1; } - - for ( i=0; isize; i++) + + for ( i=0; isize; i++) { init_packobject(&table->objs[i]); } - + *tbl = table; return 0; } @@ -207,22 +207,22 @@ int options_add_layout( obj_list_t *obj_list, pack_opttbl_t *table ) { int i, j, I, added=0, found=0; - + /* increase the size of the collection by N_OBJS if necessary */ - if (table->nelems+n_objs >= table->size) + if (table->nelems+n_objs >= table->size) { if (aux_inctable(table,n_objs)<0) return -1; } - + /* search if this object is already in the table; "path" is the key */ if (table->nelems>0) { /* go tru the supplied list of names */ - for (j = 0; j < n_objs; j++) + for (j = 0; j < n_objs; j++) { /* linear table search */ - for (i = 0; i < table->nelems; i++) + for (i = 0; i < table->nelems; i++) { /*already on the table */ if (strcmp(obj_list[j].obj,table->objs[i].path)==0) @@ -242,47 +242,47 @@ int options_add_layout( obj_list_t *obj_list, } } /* if */ } /* i */ - + if (found==0) { /* keep the grow in a temp var */ - I = table->nelems + added; + I = table->nelems + added; added++; strcpy(table->objs[I].path,obj_list[j].obj); aux_tblinsert_layout(table,I,pack); } /* cases where we have an already inserted name but there is a new name also example: - -f dset1:GZIP=1 -l dset1,dset2:CHUNK=20x20 - dset1 is already inserted, but dset2 must also be + -f dset1:GZIP=1 -l dset1,dset2:CHUNK=20x20 + dset1 is already inserted, but dset2 must also be */ else if (found==1 && strcmp(obj_list[j].obj,table->objs[i].path)!=0) { /* keep the grow in a temp var */ - I = table->nelems + added; + I = table->nelems + added; added++; strcpy(table->objs[I].path,obj_list[j].obj); aux_tblinsert_layout(table,I,pack); } - } /* j */ + } /* j */ } - + /* first time insertion */ else { /* go tru the supplied list of names */ - for (j = 0; j < n_objs; j++) + for (j = 0; j < n_objs; j++) { - I = table->nelems + added; + I = table->nelems + added; added++; strcpy(table->objs[I].path,obj_list[j].obj); aux_tblinsert_layout(table,I,pack); } } - + table->nelems+= added; - + return 0; } @@ -303,24 +303,24 @@ int options_add_filter(obj_list_t *obj_list, filter_info_t filt, pack_opttbl_t *table ) { - + int i, j, I, added=0, found=0; - + /* increase the size of the collection by N_OBJS if necessary */ - if (table->nelems+n_objs >= table->size) + if (table->nelems+n_objs >= table->size) { if (aux_inctable(table,n_objs)<0) return -1; } - + /* search if this object is already in the table; "path" is the key */ if (table->nelems>0) { /* go tru the supplied list of names */ - for (j = 0; j < n_objs; j++) + for (j = 0; j < n_objs; j++) { /* linear table search */ - for (i = 0; i < table->nelems; i++) + for (i = 0; i < table->nelems; i++) { /*already on the table */ if (strcmp(obj_list[j].obj,table->objs[i].path)==0) @@ -331,11 +331,11 @@ int options_add_filter(obj_list_t *obj_list, break; } /* if */ } /* i */ - + if (found==0) { /* keep the grow in a temp var */ - I = table->nelems + added; + I = table->nelems + added; added++; strcpy(table->objs[I].path,obj_list[j].obj); aux_tblinsert_filter(table,I,filt); @@ -343,34 +343,34 @@ int options_add_filter(obj_list_t *obj_list, /* cases where we have an already inserted name but there is a new name also example: -l dset1:CHUNK=20x20 -f dset1,dset2:GZIP=1 - dset1 is already inserted, but dset2 must also be + dset1 is already inserted, but dset2 must also be */ else if (found==1 && strcmp(obj_list[j].obj,table->objs[i].path)!=0) { /* keep the grow in a temp var */ - I = table->nelems + added; + I = table->nelems + added; added++; strcpy(table->objs[I].path,obj_list[j].obj); aux_tblinsert_filter(table,I,filt); } - } /* j */ + } /* j */ } - + /* first time insertion */ else { /* go tru the supplied list of names */ - for (j = 0; j < n_objs; j++) + for (j = 0; j < n_objs; j++) { - I = table->nelems + added; + I = table->nelems + added; added++; strcpy(table->objs[I].path,obj_list[j].obj); aux_tblinsert_filter(table,I,filt); } } - + table->nelems+= added; - + return 0; } @@ -388,8 +388,8 @@ pack_info_t* options_get_object( const char *path, pack_opttbl_t *table ) { int i; - - for ( i = 0; i < table->nelems; i++) + + for ( i = 0; i < table->nelems; i++) { /* found it */ if (strcmp(table->objs[i].path,path)==0) @@ -397,7 +397,7 @@ pack_info_t* options_get_object( const char *path, return (&table->objs[i]); } } - + return NULL; } diff --git a/tools/h5repack/h5repack_parse.c b/tools/h5repack/h5repack_parse.c index 8f548b0..64691ba 100644 --- a/tools/h5repack/h5repack_parse.c +++ b/tools/h5repack/h5repack_parse.c @@ -34,9 +34,9 @@ * SZIP, to apply the HDF5 SZIP filter (SZIP compression) * SHUF, to apply the HDF5 shuffle filter * FLET, to apply the HDF5 checksum filter - * NONE, to remove the filter + * NONE, to remove the filter * - * Examples: + * Examples: * "GZIP=6" * "A,B:NONE" * @@ -48,8 +48,8 @@ */ -obj_list_t* parse_filter(const char *str, - int *n_objs, +obj_list_t* parse_filter(const char *str, + int *n_objs, filter_info_t *filt, pack_opt_t *options) { @@ -57,10 +57,10 @@ obj_list_t* parse_filter(const char *str, char c; size_t len=strlen(str); int j, m, n, k, l, end_obj=-1, no_param=0; - char sobj[MAX_NC_NAME]; + char sobj[MAX_NC_NAME]; char scomp[10]; char stype[5]; - char smask[3]; + char smask[3]; obj_list_t* obj_list=NULL; unsigned pixels_per_block; @@ -89,7 +89,7 @@ obj_list_t* parse_filter(const char *str, /* apply to all objects */ options->all_filter=1; } - + n++; obj_list=malloc(n*sizeof(obj_list_t)); if (obj_list==NULL) @@ -104,7 +104,7 @@ obj_list_t* parse_filter(const char *str, { c = str[j]; sobj[k]=c; - if ( c==',' || j==end_obj-1) + if ( c==',' || j==end_obj-1) { if ( c==',') sobj[k]='\0'; else sobj[k+1]='\0'; strcpy(obj_list[n].obj,sobj); @@ -128,7 +128,7 @@ obj_list_t* parse_filter(const char *str, { c = str[i]; scomp[k]=c; - if ( c=='=' || i==len-1) + if ( c=='=' || i==len-1) { if ( c=='=') { /*one more parameter */ scomp[k]='\0'; /*cut space */ @@ -137,11 +137,11 @@ obj_list_t* parse_filter(const char *str, SZIP=8,EC SZIP=8,NN */ - + if (strcmp(scomp,"SZIP")==0) { l=-1; /* mask index check */ - for ( m=0,u=i+1; uszip_coding=0; else if (strcmp(smask,"EC")==0) filt->szip_coding=1; @@ -175,17 +175,17 @@ obj_list_t* parse_filter(const char *str, printf("Input Error: szip mask must be 'NN' or 'EC' \n"); exit(1); } - + } } - + } /* u */ } /*if */ - + else { /* here we could have 1 or 2 digits */ - for ( m=0,u=i+1; ucd_values[j++]=atoi(stype); i+=m; /* jump */ } @@ -285,7 +285,7 @@ obj_list_t* parse_filter(const char *str, switch (filt->filtn) { - + case H5Z_FILTER_DEFLATE: if (filt->cd_values[0]<0 || filt->cd_values[0]>9 ){ if (obj_list) free(obj_list); @@ -293,8 +293,8 @@ obj_list_t* parse_filter(const char *str, exit(1); } break; - - + + case H5Z_FILTER_SZIP: pixels_per_block=filt->cd_values[0]; if ((pixels_per_block%2)==1) { @@ -346,7 +346,7 @@ const char* get_sfilter(H5Z_filter_t filtn) exit(1); } return NULL; -} +} /*------------------------------------------------------------------------- @@ -354,14 +354,14 @@ const char* get_sfilter(H5Z_filter_t filtn) * * Purpose: read layout info * - * Return: a list of names, the number of names and its chunking info for + * Return: a list of names, the number of names and its chunking info for * chunked. NULL, on error * the layout type can be: * CHUNK, to apply chunking layout * CONTI, to apply continuous layout * COMPA, to apply compact layout * - * Example: + * Example: * "AA,B,CDE:CHUNK=10X10" * * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu @@ -370,8 +370,8 @@ const char* get_sfilter(H5Z_filter_t filtn) * *------------------------------------------------------------------------- */ -obj_list_t* parse_layout(const char *str, - int *n_objs, +obj_list_t* parse_layout(const char *str, + int *n_objs, pack_info_t *pack, /* info about layout needed */ pack_opt_t *options) { @@ -380,7 +380,7 @@ obj_list_t* parse_layout(const char *str, char c; size_t len=strlen(str); int j, n, k, end_obj=-1, c_index; - char sobj[MAX_NC_NAME]; + char sobj[MAX_NC_NAME]; char sdim[10]; char slayout[10]; @@ -388,7 +388,7 @@ obj_list_t* parse_layout(const char *str, 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; iall_layout=1; } - + n++; obj_list=malloc(n*sizeof(obj_list_t)); if (obj_list==NULL) @@ -421,7 +421,7 @@ obj_list_t* parse_layout(const char *str, { c = str[j]; sobj[k]=c; - if ( c==',' || j==end_obj-1) + if ( c==',' || j==end_obj-1) { if ( c==',') sobj[k]='\0'; else sobj[k+1]='\0'; strcpy(obj_list[n].obj,sobj); @@ -442,11 +442,11 @@ obj_list_t* parse_layout(const char *str, /* get layout info */ for ( j=end_obj+1, n=0; n<=5; j++,n++) { - if (n==5) + if (n==5) { slayout[n]='\0'; /*cut string */ if (strcmp(slayout,"COMPA")==0) - pack->layout=H5D_COMPACT; + pack->layout=H5D_COMPACT; else if (strcmp(slayout,"CONTI")==0) pack->layout=H5D_CONTIGUOUS; else if (strcmp(slayout,"CHUNK")==0) @@ -462,7 +462,7 @@ obj_list_t* parse_layout(const char *str, slayout[n]=c; } } /* j */ - + if ( pack->layout==H5D_CHUNKED ) { @@ -471,7 +471,7 @@ obj_list_t* parse_layout(const char *str, * get chunk info *------------------------------------------------------------------------- */ - k=0; + k=0; if (j>(int)len) { @@ -485,8 +485,8 @@ obj_list_t* parse_layout(const char *str, c = str[i]; sdim[k]=c; k++; /*increment sdim index */ - - if (!isdigit(c) && c!='x' + + if (!isdigit(c) && c!='x' && c!='N' && c!='O' && c!='N' && c!='E' ){ if (obj_list) free(obj_list); @@ -494,11 +494,11 @@ obj_list_t* parse_layout(const char *str, sdim,str); exit(1); } - - if ( c=='x' || i==len-1) + + if ( c=='x' || i==len-1) { - if ( c=='x') { - sdim[k-1]='\0'; + if ( c=='x') { + sdim[k-1]='\0'; k=0; pack->chunk.chunk_lengths[c_index]=atoi(sdim); if (pack->chunk.chunk_lengths[c_index]==0) { @@ -510,7 +510,7 @@ obj_list_t* parse_layout(const char *str, c_index++; } else if (i==len-1) { /*no more parameters */ - sdim[k]='\0'; + sdim[k]='\0'; k=0; if (strcmp(sdim,"NONE")==0) { @@ -531,10 +531,10 @@ obj_list_t* parse_layout(const char *str, } /*if c=='x' || i==len-1 */ } /*i*/ - + } /*H5D_CHUNKED*/ - + return obj_list; } @@ -561,7 +561,7 @@ int parse_number(char *str) int n; char c; size_t len=strlen(str); - + for ( i=0; inobjs; i++) { switch ( travt->objs[i].type ) @@ -82,7 +82,7 @@ int do_copy_refobjs(hid_t fidin, *------------------------------------------------------------------------- */ case H5G_GROUP: - + /*------------------------------------------------------------------------- * check for hard links *------------------------------------------------------------------------- @@ -92,37 +92,37 @@ int do_copy_refobjs(hid_t fidin, { for ( j=0; jobjs[i].nlinks; j++) { - H5Glink(fidout, + H5Glink(fidout, H5G_LINK_HARD, travt->objs[i].name, travt->objs[i].links[j].new_name); } } - + break; - + /*------------------------------------------------------------------------- * H5G_DATASET *------------------------------------------------------------------------- */ case H5G_DATASET: - - if ((dset_in=H5Dopen(fidin,travt->objs[i].name))<0) + + if ((dset_in=H5Dopen(fidin,travt->objs[i].name))<0) goto error; - if ((space_id=H5Dget_space(dset_in))<0) + if ((space_id=H5Dget_space(dset_in))<0) goto error; - if ((ftype_id=H5Dget_type (dset_in))<0) + if ((ftype_id=H5Dget_type (dset_in))<0) goto error; - if ((dcpl_id=H5Dget_create_plist(dset_in))<0) + if ((dcpl_id=H5Dget_create_plist(dset_in))<0) goto error; if ( (rank=H5Sget_simple_extent_ndims(space_id))<0) goto error; if ( H5Sget_simple_extent_dims(space_id,dims,NULL)<0) goto error; nelmts=1; - for (j=0; jobjs[i].name,mtype_id,space_id,dcpl_id))<0) + if ((dset_out=H5Dcreate(fidout,travt->objs[i].name,mtype_id,space_id,dcpl_id))<0) goto error; if (nelmts) { if (H5Dwrite(dset_out,mtype_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,refbuf)<0) goto error; } - + if (buf) free(buf); if (refbuf) free(refbuf); - + }/*H5T_STD_REF_OBJ*/ /*------------------------------------------------------------------------- * dataset region references *------------------------------------------------------------------------- */ - else if (H5Tequal(mtype_id, H5T_STD_REF_DSETREG)) + else if (H5Tequal(mtype_id, H5T_STD_REF_DSETREG)) { H5G_obj_t1 obj_type; hid_t refobj_id; @@ -254,12 +254,12 @@ int do_copy_refobjs(hid_t fidin, goto error; if ((obj_type = H5Rget_obj_type(dset_in,H5R_DATASET_REGION,buf))<0) goto error; - + /*------------------------------------------------------------------------- * create output *------------------------------------------------------------------------- */ - + refbuf=HDcalloc(sizeof(hdset_reg_ref_t),(size_t)nelmts); /*init to zero */ if ( refbuf==NULL){ printf( "cannot allocate memory\n" ); @@ -271,8 +271,8 @@ int do_copy_refobjs(hid_t fidin, if ((refobj_id = H5Rdereference(dset_in,H5R_DATASET_REGION,&buf[u]))<0) continue; } H5E_END_TRY; - - /* get the name. a valid name could only occur in the + + /* get the name. a valid name could only occur in the second traversal of the file */ if ((refname=MapIdToName(refobj_id,travt))!=NULL) { @@ -282,7 +282,7 @@ int do_copy_refobjs(hid_t fidin, /* create the reference, we need the space_id */ if (H5Rcreate(&refbuf[u],fidout,refname,H5R_DATASET_REGION,region_id)<0) goto error; - if (H5Sclose(region_id)<0) + if (H5Sclose(region_id)<0) goto error; if (options->verbose) printf("object <%s> region reference created to <%s>\n", @@ -292,18 +292,18 @@ int do_copy_refobjs(hid_t fidin, close_obj(obj_type,refobj_id); }/* u */ }/*nelmts*/ - + /*------------------------------------------------------------------------- * create/write dataset/close *------------------------------------------------------------------------- */ - if ((dset_out=H5Dcreate(fidout,travt->objs[i].name,mtype_id,space_id,dcpl_id))<0) + if ((dset_out=H5Dcreate(fidout,travt->objs[i].name,mtype_id,space_id,dcpl_id))<0) goto error; if (nelmts) { if (H5Dwrite(dset_out,mtype_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,refbuf)<0) goto error; } - + if (buf) free(buf); if (refbuf) @@ -317,19 +317,19 @@ int do_copy_refobjs(hid_t fidin, */ else { - if ((dset_out=H5Dopen(fidout,travt->objs[i].name))<0) + if ((dset_out=H5Dopen(fidout,travt->objs[i].name))<0) goto error; } assert(dset_out!=FAIL); - + /*------------------------------------------------------------------------- * copy referenced objects in attributes *------------------------------------------------------------------------- */ - if (copy_refs_attr(dset_in,dset_out,options,travt,fidout)<0) + if (copy_refs_attr(dset_in,dset_out,options,travt,fidout)<0) goto error; - + /*------------------------------------------------------------------------- * check for hard links @@ -338,92 +338,92 @@ int do_copy_refobjs(hid_t fidin, if (travt->objs[i].nlinks) { for ( j=0; jobjs[i].nlinks; j++){ - H5Glink(fidout, + H5Glink(fidout, H5G_LINK_HARD, travt->objs[i].name, travt->objs[i].links[j].new_name); } } - if (H5Dclose(dset_out)<0) + if (H5Dclose(dset_out)<0) goto error; }/*can_read*/ - + /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- */ - - if (H5Tclose(ftype_id)<0) + + if (H5Tclose(ftype_id)<0) goto error; - if (H5Tclose(mtype_id)<0) + if (H5Tclose(mtype_id)<0) goto error; - if (H5Pclose(dcpl_id)<0) + if (H5Pclose(dcpl_id)<0) goto error; - if (H5Sclose(space_id)<0) + if (H5Sclose(space_id)<0) goto error; - if (H5Dclose(dset_in)<0) + if (H5Dclose(dset_in)<0) goto error; - + break; - + /*------------------------------------------------------------------------- * H5G_TYPE *------------------------------------------------------------------------- */ case H5G_TYPE: - - if ((type_in = H5Topen (fidin,travt->objs[i].name))<0) + + if ((type_in = H5Topen (fidin,travt->objs[i].name))<0) goto error; - - if (H5Tclose(type_in)<0) + + if (H5Tclose(type_in)<0) goto error; - + break; - + /*------------------------------------------------------------------------- * H5G_LINK *------------------------------------------------------------------------- */ - + case H5G_LINK: - + /*nothing to do */ break; - + default: - + break; } } - - - + + + /*------------------------------------------------------------------------- - * the root is a special case, we get an ID for the root group + * the root is a special case, we get an ID for the root group * and copy its attributes using that ID * it must be done last, because the attributes might contain references to * objects in the object list *------------------------------------------------------------------------- */ - - if ((grp_out = H5Gopen(fidout,"/"))<0) + + if ((grp_out = H5Gopen(fidout,"/"))<0) goto error; - - if ((grp_in = H5Gopen(fidin,"/"))<0) + + if ((grp_in = H5Gopen(fidin,"/"))<0) goto error; - - if (copy_refs_attr(grp_in,grp_out,options,travt,fidout)<0) + + if (copy_refs_attr(grp_in,grp_out,options,travt,fidout)<0) goto error; - - if (H5Gclose(grp_out)<0) + + if (H5Gclose(grp_out)<0) goto error; - if (H5Gclose(grp_in)<0) + if (H5Gclose(grp_in)<0) goto error; - + return 0; - + error: H5E_BEGIN_TRY { H5Gclose(grp_in); @@ -437,7 +437,7 @@ error: H5Tclose(type_in); } H5E_END_TRY; return -1; - + } @@ -445,7 +445,7 @@ error: * Function: copy_refs_attr * * Purpose: duplicate all referenced HDF5 located in attributes - * relative to LOC_IN, which is obtained either from + * relative to LOC_IN, which is obtained either from * loc_id = H5Gopen( fid, name); * loc_id = H5Dopen( fid, name); * loc_id = H5Topen( fid, name); @@ -459,17 +459,17 @@ error: *------------------------------------------------------------------------- */ -static int copy_refs_attr(hid_t loc_in, - hid_t loc_out, +static int copy_refs_attr(hid_t loc_in, + hid_t loc_out, pack_opt_t *options, trav_table_t *travt, hid_t fidout /* for saving references */ ) { - hid_t attr_id=-1; /* attr ID */ - hid_t attr_out=-1; /* attr ID */ - hid_t space_id=-1; /* space ID */ - hid_t ftype_id=-1; /* file data type ID */ + hid_t attr_id=-1; /* attr ID */ + hid_t attr_out=-1; /* attr ID */ + hid_t space_id=-1; /* space ID */ + hid_t ftype_id=-1; /* file data type ID */ hid_t mtype_id=-1; /* memory data type ID */ size_t msize; /* memory size of type */ hsize_t nelmts; /* number of elements in dataset */ @@ -479,9 +479,9 @@ static int copy_refs_attr(hid_t loc_in, int n, j; unsigned u; - if ((n = H5Aget_num_attrs(loc_in))<0) + if ((n = H5Aget_num_attrs(loc_in))<0) goto error; - + for ( u = 0; u < (unsigned)n; u++) { @@ -490,32 +490,32 @@ static int copy_refs_attr(hid_t loc_in, *------------------------------------------------------------------------- */ /* open attribute */ - if ((attr_id = H5Aopen_idx(loc_in, u))<0) + if ((attr_id = H5Aopen_idx(loc_in, u))<0) goto error; - + /* get name */ - if (H5Aget_name( attr_id, 255, name )<0) + if (H5Aget_name( attr_id, 255, name )<0) goto error; /* get the file datatype */ if ((ftype_id = H5Aget_type( attr_id )) < 0 ) goto error; - + /* get the dataspace handle */ if ((space_id = H5Aget_space( attr_id )) < 0 ) goto error; - + /* get dimensions */ if ( (rank = H5Sget_simple_extent_dims(space_id, dims, NULL)) < 0 ) goto error; - + /*------------------------------------------------------------------------- * elements *------------------------------------------------------------------------- */ nelmts=1; - for (j=0; jverbose) printf("object <%s> region reference created to <%s>\n",name,refname); @@ -666,19 +666,19 @@ static int copy_refs_attr(hid_t loc_in, close_obj(obj_type,refobj_id); }/* k */ }/*nelmts */ - + /*------------------------------------------------------------------------- - * copy + * copy *------------------------------------------------------------------------- */ - + if ((attr_out=H5Acreate(loc_out,name,ftype_id,space_id,H5P_DEFAULT))<0) goto error; if (nelmts) { if(H5Awrite(attr_out,mtype_id,refbuf)<0) goto error; } - if (H5Aclose(attr_out)<0) + if (H5Aclose(attr_out)<0) goto error; if (refbuf) free(refbuf); @@ -696,7 +696,7 @@ static int copy_refs_attr(hid_t loc_in, if (H5Sclose(space_id)<0) goto error; if (H5Aclose(attr_id)<0) goto error; } /* u */ - + return 0; error: @@ -720,9 +720,9 @@ error: static void close_obj(H5G_obj_t1 obj_type, hid_t obj_id) { - H5E_BEGIN_TRY + H5E_BEGIN_TRY { - switch (obj_type) + switch (obj_type) { case H5G_GROUP: H5Gclose(obj_id); @@ -736,7 +736,7 @@ static void close_obj(H5G_obj_t1 obj_type, hid_t obj_id) default: break; } - } H5E_END_TRY; + } H5E_END_TRY; } /*------------------------------------------------------------------------- @@ -747,7 +747,7 @@ static void close_obj(H5G_obj_t1 obj_type, hid_t obj_id) *------------------------------------------------------------------------- */ -static const char* MapIdToName(hid_t refobj_id, +static const char* MapIdToName(hid_t refobj_id, trav_table_t *travt) { hid_t id; @@ -769,18 +769,18 @@ static const char* MapIdToName(hid_t refobj_id, /* linear search */ for ( i=0; inobjs; i++) { - switch ( travt->objs[i].type ) + switch ( travt->objs[i].type ) { default: break; - + /*------------------------------------------------------------------------- * H5G_DATASET *------------------------------------------------------------------------- */ - + case H5G_DATASET: - + if ((id = H5Dopen(fid,travt->objs[i].name))<0) return NULL; if(H5Gget_objinfo(id, ".", 0, &objstat) <0) diff --git a/tools/h5repack/h5repack_verify.c b/tools/h5repack/h5repack_verify.c index 94fa561..8e3c469 100644 --- a/tools/h5repack/h5repack_verify.c +++ b/tools/h5repack/h5repack_verify.c @@ -33,9 +33,9 @@ */ int has_filter(hid_t dcpl_id, - H5Z_filter_t filtnin) + H5Z_filter_t filtnin) { - + int nfilters; /* number of filters */ unsigned filt_flags; /* filter flags */ H5Z_filter_t filtn; /* filter identification number */ @@ -44,34 +44,34 @@ int has_filter(hid_t dcpl_id, char f_name[256]; /* filter name */ int have=0; /* flag, filter is present */ int i; /* index */ - + /* if no information about the input filter is requested return exit */ if (filtnin==-1) - return 1; - + return 1; + /* get information about filters */ - if ((nfilters = H5Pget_nfilters(dcpl_id))<0) + if ((nfilters = H5Pget_nfilters(dcpl_id))<0) return -1; /* if we do not have filters and the requested filter is NONE, return 1 */ if (!nfilters && filtnin==H5Z_FILTER_NONE) return 1; - - for (i=0; ilayout!=H5D_CHUNKED) return 1; - + /* get layout */ - if ((layout = H5Pget_layout(dcpl_id))<0) + if ((layout = H5Pget_layout(dcpl_id))<0) return -1; - + if (obj->layout != layout) return 0; - + if (layout==H5D_CHUNKED) { if ((rank = H5Pget_chunk(dcpl_id,NELMTS(chsize),chsize/*out*/))<0) return -1; if (obj->chunk.rank != rank) return 0; - for ( i=0; ichunk.chunk_lengths[i]) return 0; } - + return 1; } @@ -157,9 +157,9 @@ int h5repack_verify(const char *fname, pack_opt_t *options) { hid_t fid; /* file ID */ - hid_t dset_id=-1; /* dataset ID */ - hid_t dcpl_id=-1; /* dataset creation property list ID */ - hid_t space_id=-1; /* space ID */ + hid_t dset_id=-1; /* dataset ID */ + hid_t dcpl_id=-1; /* dataset creation property list ID */ + hid_t space_id=-1; /* space ID */ int ret=1, i, j; trav_table_t *travt=NULL; @@ -167,7 +167,7 @@ int h5repack_verify(const char *fname, if ((fid=H5Fopen(fname,H5F_ACC_RDONLY,H5P_DEFAULT))<0 ) return -1; - for ( i=0; iop_tbl->nelems; i++) + for ( i=0; iop_tbl->nelems; i++) { char* name=options->op_tbl->objs[i].path; pack_info_t *obj = &options->op_tbl->objs[i]; @@ -176,13 +176,13 @@ int h5repack_verify(const char *fname, * open *------------------------------------------------------------------------- */ - if ((dset_id=H5Dopen(fid,name))<0) + if ((dset_id=H5Dopen(fid,name))<0) goto error; - if ((space_id=H5Dget_space(dset_id))<0) + if ((space_id=H5Dget_space(dset_id))<0) goto error; - if ((dcpl_id=H5Dget_create_plist(dset_id))<0) + if ((dcpl_id=H5Dget_create_plist(dset_id))<0) goto error; - + /*------------------------------------------------------------------------- * filter check *------------------------------------------------------------------------- @@ -204,11 +204,11 @@ int h5repack_verify(const char *fname, * close *------------------------------------------------------------------------- */ - if (H5Pclose(dcpl_id)<0) + if (H5Pclose(dcpl_id)<0) goto error; - if (H5Sclose(space_id)<0) + if (H5Sclose(space_id)<0) goto error; - if (H5Dclose(dset_id)<0) + if (H5Dclose(dset_id)<0) goto error; } @@ -221,10 +221,10 @@ int h5repack_verify(const char *fname, if (options->all_filter==1 || options->all_layout==1) { - + /* init table */ trav_table_init(&travt); - + /* get the list of objects in the file */ if (h5trav_gettable(fid,travt)<0) goto error; @@ -236,16 +236,16 @@ int h5repack_verify(const char *fname, switch ( travt->objs[i].type ) { case H5G_DATASET: - + /*------------------------------------------------------------------------- * open *------------------------------------------------------------------------- */ - if ((dset_id=H5Dopen(fid,name))<0) + if ((dset_id=H5Dopen(fid,name))<0) goto error; - if ((space_id=H5Dget_space(dset_id))<0) + if ((space_id=H5Dget_space(dset_id))<0) goto error; - if ((dcpl_id=H5Dget_create_plist(dset_id))<0) + if ((dcpl_id=H5Dget_create_plist(dset_id))<0) goto error; /*------------------------------------------------------------------------- @@ -269,35 +269,35 @@ int h5repack_verify(const char *fname, if (has_layout(dcpl_id,&pack)==0) ret=0; } - - + + /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- */ - if (H5Pclose(dcpl_id)<0) + if (H5Pclose(dcpl_id)<0) goto error; - if (H5Sclose(space_id)<0) + if (H5Sclose(space_id)<0) goto error; - if (H5Dclose(dset_id)<0) + if (H5Dclose(dset_id)<0) goto error; - + break; default: break; } /* switch */ - + } /* i */ - + /* free table */ trav_table_free(travt); } - + /*------------------------------------------------------------------------- * close *------------------------------------------------------------------------- */ - + if (H5Fclose(fid)<0) return -1; @@ -334,12 +334,12 @@ error: int h5repack_cmpdcpl(const char *fname1, const char *fname2) { - hid_t fid1=-1; /* file ID */ - hid_t fid2=-1; /* file ID */ - hid_t dset1=-1; /* dataset ID */ - hid_t dset2=-1; /* dataset ID */ - hid_t dcpl1=-1; /* dataset creation property list ID */ - hid_t dcpl2=-1; /* dataset creation property list ID */ + hid_t fid1=-1; /* file ID */ + hid_t fid2=-1; /* file ID */ + hid_t dset1=-1; /* dataset ID */ + hid_t dset2=-1; /* dataset ID */ + hid_t dcpl1=-1; /* dataset creation property list ID */ + hid_t dcpl2=-1; /* dataset creation property list ID */ trav_table_t *travt1=NULL; trav_table_t *travt2=NULL; int ret=1, i; @@ -351,7 +351,7 @@ int h5repack_cmpdcpl(const char *fname1, /* disable error reporting */ H5E_BEGIN_TRY { - + /* Open the files */ if ((fid1=H5Fopen(fname1,H5F_ACC_RDONLY,H5P_DEFAULT))<0 ) { @@ -400,25 +400,25 @@ int h5repack_cmpdcpl(const char *fname1, *------------------------------------------------------------------------- */ case H5G_DATASET: - if ((dset1=H5Dopen(fid1,travt1->objs[i].name))<0) + if ((dset1=H5Dopen(fid1,travt1->objs[i].name))<0) goto error; - if ((dset2=H5Dopen(fid2,travt1->objs[i].name))<0) + if ((dset2=H5Dopen(fid2,travt1->objs[i].name))<0) goto error; - if ((dcpl1=H5Dget_create_plist(dset1))<0) + if ((dcpl1=H5Dget_create_plist(dset1))<0) goto error; - if ((dcpl2=H5Dget_create_plist(dset2))<0) + if ((dcpl2=H5Dget_create_plist(dset2))<0) goto error; /*------------------------------------------------------------------------- * compare the property lists *------------------------------------------------------------------------- */ - if ((ret=H5Pequal(dcpl1,dcpl2))<0) + if ((ret=H5Pequal(dcpl1,dcpl2))<0) goto error; if (ret==0) { - printf("Property lists for <%s> are different\n",travt1->objs[i].name); + printf("Property lists for <%s> are different\n",travt1->objs[i].name); goto error; } @@ -426,15 +426,15 @@ int h5repack_cmpdcpl(const char *fname1, * close *------------------------------------------------------------------------- */ - if (H5Pclose(dcpl1)<0) + if (H5Pclose(dcpl1)<0) goto error; - if (H5Pclose(dcpl2)<0) + if (H5Pclose(dcpl2)<0) goto error; - if (H5Dclose(dset1)<0) + if (H5Dclose(dset1)<0) goto error; - if (H5Dclose(dset2)<0) + if (H5Dclose(dset2)<0) goto error; - + break; } /*switch*/ @@ -465,7 +465,7 @@ int h5repack_cmpdcpl(const char *fname1, error: H5E_BEGIN_TRY { H5Pclose(dcpl1); - H5Pclose(dcpl2); + H5Pclose(dcpl2); H5Dclose(dset1); H5Dclose(dset2); H5Fclose(fid1); diff --git a/tools/h5repack/testh5repack_attr.c b/tools/h5repack/testh5repack_attr.c index a1dad92..f18bbc2 100644 --- a/tools/h5repack/testh5repack_attr.c +++ b/tools/h5repack/testh5repack_attr.c @@ -19,7 +19,7 @@ /*------------------------------------------------------------------------- * Function: write_attr_in * - * Purpose: write attributes in LOC_ID (dataset, group, named datatype) + * Purpose: write attributes in LOC_ID (dataset, group, named datatype) * * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * @@ -28,28 +28,28 @@ *------------------------------------------------------------------------- */ - -void write_attr_in(hid_t loc_id, + +void write_attr_in(hid_t loc_id, const char* dset_name, /* for saving reference to dataset*/ hid_t fid, /* for reference create */ int make_diffs /* flag to modify data buffers */) { /* Compound datatype */ - typedef struct s_t + typedef struct s_t { char a; double b; } s_t; - typedef enum + typedef enum { RED, GREEN } e_t; hid_t attr_id; - hid_t space_id; - hid_t type_id; + hid_t space_id; + hid_t type_id; herr_t status; int val, i, j, k, n; float f; @@ -98,7 +98,7 @@ void write_attr_in(hid_t loc_id, * 1D attributes *------------------------------------------------------------------------- */ - + /*------------------------------------------------------------------------- * H5T_STRING *------------------------------------------------------------------------- @@ -109,11 +109,11 @@ void write_attr_in(hid_t loc_id, for (i=0; i<2; i++) for (j=0; j<2; j++) { - buf1[i][j]='z'; + buf1[i][j]='z'; } } - /* - buf1[2][2]= {"ab","de"}; + /* + buf1[2][2]= {"ab","de"}; $h5diff file7.h5 file6.h5 g1 g1 -v Group: and Attribute: and @@ -139,8 +139,8 @@ void write_attr_in(hid_t loc_id, for (i=0; i<2; i++) buf2[i]=buf2[1]=0; } - /* - buf2[2]= {1,2}; + /* + buf2[2]= {1,2}; $h5diff file7.h5 file6.h5 g1 g1 -v Group: and Attribute: and @@ -160,8 +160,8 @@ void write_attr_in(hid_t loc_id, *------------------------------------------------------------------------- */ - /* - buf2[2]= {1,2}; + /* + buf2[2]= {1,2}; $h5diff file7.h5 file6.h5 g1 g1 -v Group: and Attribute: and @@ -181,7 +181,7 @@ void write_attr_in(hid_t loc_id, * H5T_COMPOUND *------------------------------------------------------------------------- */ - + if (make_diffs) { for (i=0; i<2; i++) @@ -189,9 +189,9 @@ void write_attr_in(hid_t loc_id, buf3[i].a=0; buf3[i].b=0; } } - - /* - buf3[2]= {{1,2},{3,4}}; + + /* + buf3[2]= {{1,2},{3,4}}; $h5diff file7.h5 file6.h5 g1 g1 -v Group: and Attribute: and @@ -208,7 +208,7 @@ void write_attr_in(hid_t loc_id, H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); make_attr(loc_id,1,dims,"compound",type_id,buf3); status = H5Tclose(type_id); - + /*------------------------------------------------------------------------- * H5T_REFERENCE *------------------------------------------------------------------------- @@ -230,10 +230,10 @@ void write_attr_in(hid_t loc_id, { for (i=0; i<2; i++) { - buf45[i]=GREEN; + buf45[i]=GREEN; } } - /* + /* buf45[2]= {RED,RED}; $h5diff file7.h5 file6.h5 g1 g1 -v Group: and @@ -253,7 +253,7 @@ void write_attr_in(hid_t loc_id, * H5T_VLEN *------------------------------------------------------------------------- */ - + /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; @@ -270,7 +270,7 @@ void write_attr_in(hid_t loc_id, ((int *)buf5[1].p)[0]=0; ((int *)buf5[1].p)[1]=0; } - /* + /* $h5diff file7.h5 file6.h5 g1 g1 -v Group: and position vlen of vlen of difference @@ -301,10 +301,10 @@ void write_attr_in(hid_t loc_id, for (i=0; i<2; i++) for (j=0; j<3; j++) { - buf6[i][j]=0; + buf6[i][j]=0; } } - /* + /* buf6[2][3]= {{1,2,3},{4,5,6}}; $h5diff file7.h5 file6.h5 g1 g1 -v Group: and @@ -331,12 +331,12 @@ position array of array of difference { for (i=0; i<2; i++) { - buf7[i]=0; - buf8[i]=0; + buf7[i]=0; + buf8[i]=0; } } - /* - buf7[2]= {1,2}; + /* + buf7[2]= {1,2}; buf8[2]= {1,2}; $h5diff file7.h5 file6.h5 g1 g1 -v Group: and @@ -367,7 +367,7 @@ position array of array of difference memset(buf12, 'z', sizeof buf12); } - /* + /* buf12[6][2]= {"ab","cd","ef","gh","ij","kl"}; $h5diff file7.h5 file6.h5 g1 g1 -v Attribute: and @@ -402,8 +402,8 @@ position array of array of difference memset(buf22,0,sizeof buf22); } - /* - buf22[3][2]= {{1,2},{3,4},{5,6}}; + /* + buf22[3][2]= {{1,2},{3,4},{5,6}}; $h5diff file7.h5 file6.h5 g1 g1 -v Attribute: and position bitfield2D of bitfield2D of difference @@ -426,8 +426,8 @@ position array of array of difference *------------------------------------------------------------------------- */ - /* - buf22[3][2]= {{1,2},{3,4},{5,6}}; + /* + buf22[3][2]= {{1,2},{3,4},{5,6}}; $h5diff file7.h5 file6.h5 g1 g1 -v Attribute: and position opaque2D of opaque2D of difference @@ -453,7 +453,7 @@ position array of array of difference memset(buf32,0,sizeof buf32); } - /* + /* buf32[6]= {{1,2},{3,4},{5,6},{7,8},{9,10},{11,12}}; $h5diff file7.h5 file6.h5 g1 g1 -v Attribute: and @@ -473,7 +473,7 @@ position array of array of difference H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); make_attr(loc_id,2,dims2,"compound2D",type_id,buf32); status = H5Tclose(type_id); - + /*------------------------------------------------------------------------- * H5T_REFERENCE *------------------------------------------------------------------------- @@ -496,7 +496,7 @@ position array of array of difference for (i=0; i<3; i++) for (j=0; j<2; j++) { - if (make_diffs) buf452[i][j]=GREEN; else buf452[i][j]=RED; + if (make_diffs) buf452[i][j]=GREEN; else buf452[i][j]=RED; } /* @@ -550,7 +550,7 @@ position enum2D of enum2D of difference [ 2 1 ] 10 0 10 [ 2 1 ] 11 0 11 */ - + space_id = H5Screate_simple(2,dims2,NULL); type_id = H5Tvlen_create(H5T_NATIVE_INT); attr_id = H5Acreate(loc_id,"vlen2D",type_id,space_id,H5P_DEFAULT); @@ -571,8 +571,8 @@ position enum2D of enum2D of difference { memset(buf62,0,sizeof buf62); } - /* - buf62[6][3]= {{1,2,3},{4,5,6},{7,8,9},{10,11,12},{13,14,15},{16,17,18}}; + /* + buf62[6][3]= {{1,2,3},{4,5,6},{7,8,9},{10,11,12},{13,14,15},{16,17,18}}; $h5diff file7.h5 file6.h5 g1 g1 -v Group: and Attribute: and @@ -636,7 +636,7 @@ position float2D of float2D of difference make_attr(loc_id,2,dims2,"integer2D",H5T_NATIVE_INT,buf72); make_attr(loc_id,2,dims2,"float2D",H5T_NATIVE_FLOAT,buf82); - + /*------------------------------------------------------------------------- * 3D attributes *------------------------------------------------------------------------- @@ -850,7 +850,7 @@ position bitfield3D of bitfield3D of difference H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); make_attr(loc_id,3,dims3,"compound3D",type_id,buf33); status = H5Tclose(type_id); - + /*------------------------------------------------------------------------- * H5T_REFERENCE *------------------------------------------------------------------------- @@ -920,7 +920,7 @@ position enum3D of enum3D of difference * H5T_VLEN *------------------------------------------------------------------------- */ - + /* Allocate and initialize VL dataset to write */ n=0; for (i = 0; i < 4; i++) { @@ -949,7 +949,7 @@ position vlen3D of vlen3D of difference [ 1 0 1 ] 9 0 9 [ 1 1 0 ] 10 0 10 etc -*/ +*/ space_id = H5Screate_simple(3,dims3,NULL); type_id = H5Tvlen_create(H5T_NATIVE_INT); attr_id = H5Acreate(loc_id,"vlen3D",type_id,space_id,H5P_DEFAULT); @@ -1023,7 +1023,7 @@ etc [ 1 1 0 ] 9 0 9 [ 1 1 1 ] 10 0 10 etc -*/ +*/ make_attr(loc_id,3,dims3,"integer3D",H5T_NATIVE_INT,buf73); make_attr(loc_id,3,dims3,"float3D",H5T_NATIVE_FLOAT,buf83); } diff --git a/tools/h5repack/testh5repack_detect_szip.c b/tools/h5repack/testh5repack_detect_szip.c index 4f12c40..16962af 100644 --- a/tools/h5repack/testh5repack_detect_szip.c +++ b/tools/h5repack/testh5repack_detect_szip.c @@ -24,15 +24,15 @@ * Purpose: detects szip encoder, prints "yes" or "no" to stdout. * Intended to be used in test scripts. * - * Return: + * Return: * - * Programmer: + * Programmer: * - * Date: + * Date: * * Comments: * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ diff --git a/tools/h5repack/testh5repack_dset.c b/tools/h5repack/testh5repack_dset.c index 8781ae7..862257a 100644 --- a/tools/h5repack/testh5repack_dset.c +++ b/tools/h5repack/testh5repack_dset.c @@ -22,7 +22,7 @@ static void make_dset_reg_ref(hid_t loc_id); /*------------------------------------------------------------------------- * Function: write_dset_in * - * Purpose: write datasets in LOC_ID + * Purpose: write datasets in LOC_ID * * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * @@ -31,28 +31,28 @@ static void make_dset_reg_ref(hid_t loc_id); *------------------------------------------------------------------------- */ - -void write_dset_in(hid_t loc_id, + +void write_dset_in(hid_t loc_id, const char* dset_name, /* for saving reference to dataset*/ hid_t file_id, int make_diffs /* flag to modify data buffers */) { /* Compound datatype */ - typedef struct s_t + typedef struct s_t { char a; double b; } s_t; - typedef enum + typedef enum { RED, GREEN } e_t; hid_t dset_id; - hid_t space_id; - hid_t type_id; + hid_t space_id; + hid_t type_id; hid_t plist_id; herr_t status; int val, i, j, k, n; @@ -100,22 +100,22 @@ void write_dset_in(hid_t loc_id, /*------------------------------------------------------------------------- - * 1D + * 1D *------------------------------------------------------------------------- */ - + /*------------------------------------------------------------------------- * H5T_STRING *------------------------------------------------------------------------- */ - + if (make_diffs) { for (i=0; i<2; i++) for (j=0; j<2; j++) { - buf1[i][j]='z'; + buf1[i][j]='z'; } } @@ -172,7 +172,7 @@ void write_dset_in(hid_t loc_id, { for (i=0; i<2; i++) { - buf45[i]=GREEN; + buf45[i]=GREEN; } } @@ -181,7 +181,7 @@ void write_dset_in(hid_t loc_id, H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); write_dset(loc_id,1,dims,"compound",type_id,buf3); status = H5Tclose(type_id); - + /*------------------------------------------------------------------------- * H5T_REFERENCE *------------------------------------------------------------------------- @@ -211,7 +211,7 @@ void write_dset_in(hid_t loc_id, * H5T_VLEN *------------------------------------------------------------------------- */ - + /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; @@ -250,7 +250,7 @@ void write_dset_in(hid_t loc_id, for (i=0; i<2; i++) for (j=0; j<3; j++) { - buf6[i][j]=0; + buf6[i][j]=0; } } @@ -267,8 +267,8 @@ void write_dset_in(hid_t loc_id, { for (i=0; i<2; i++) { - buf7[i]=0; - buf8[i]=0; + buf7[i]=0; + buf8[i]=0; } } @@ -277,7 +277,7 @@ void write_dset_in(hid_t loc_id, /*------------------------------------------------------------------------- - * 2D + * 2D *------------------------------------------------------------------------- */ @@ -302,7 +302,7 @@ void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ - + if (make_diffs) { memset(buf22,0,sizeof buf22); @@ -336,7 +336,7 @@ void write_dset_in(hid_t loc_id, H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); write_dset(loc_id,2,dims2,"compound2D",type_id,buf32); status = H5Tclose(type_id); - + /*------------------------------------------------------------------------- * H5T_REFERENCE *------------------------------------------------------------------------- @@ -380,7 +380,7 @@ void write_dset_in(hid_t loc_id, else ((int *)buf52[i][j].p)[l] = n++; } } - + space_id = H5Screate_simple(2,dims2,NULL); type_id = H5Tvlen_create(H5T_NATIVE_INT); dset_id = H5Dcreate(loc_id,"vlen2D",type_id,space_id,H5P_DEFAULT); @@ -412,7 +412,7 @@ void write_dset_in(hid_t loc_id, *------------------------------------------------------------------------- */ - + if (make_diffs) { memset(buf72,0,sizeof buf72); @@ -435,9 +435,9 @@ void write_dset_in(hid_t loc_id, write_dset(loc_id,2,dims2,"float2D",H5T_NATIVE_FLOAT,buf82); - + /*------------------------------------------------------------------------- - * 3D + * 3D *------------------------------------------------------------------------- */ @@ -513,7 +513,7 @@ void write_dset_in(hid_t loc_id, H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); write_dset(loc_id,3,dims3,"compound3D",type_id,buf33); status = H5Tclose(type_id); - + /*------------------------------------------------------------------------- * H5T_REFERENCE *------------------------------------------------------------------------- @@ -545,7 +545,7 @@ void write_dset_in(hid_t loc_id, * H5T_VLEN *------------------------------------------------------------------------- */ - + /* Allocate and initialize VL dataset to write */ n=0; for (i = 0; i < 4; i++) { @@ -560,7 +560,7 @@ void write_dset_in(hid_t loc_id, } } } - + space_id = H5Screate_simple(3,dims3,NULL); type_id = H5Tvlen_create(H5T_NATIVE_INT); dset_id = H5Dcreate(loc_id,"vlen3D",type_id,space_id,H5P_DEFAULT); @@ -618,7 +618,7 @@ void write_dset_in(hid_t loc_id, /*------------------------------------------------------------------------- * Function: make_dset_reg_ref * - * Purpose: write dataset region references + * Purpose: write dataset region references * *------------------------------------------------------------------------- */ @@ -646,52 +646,52 @@ static void make_dset_reg_ref(hid_t loc_id) int *dwbuf; /* Buffer for writing numeric data to disk */ int i; /* counting variables */ herr_t ret; /* Generic return value */ - + /* Allocate write & read buffers */ wbuf=calloc(sizeof(hdset_reg_ref_t), SPACE1_DIM1); dwbuf=malloc(sizeof(int)*SPACE2_DIM1*SPACE2_DIM2); - + /* Create dataspace for datasets */ sid2 = H5Screate_simple(SPACE2_RANK, dims2, NULL); - + /* Create a dataset */ dset2=H5Dcreate(loc_id,"dsetreg",H5T_NATIVE_UCHAR,sid2,H5P_DEFAULT); - + for(i=0; i #include "h5diff.h" -#include "H5private.h" +#include "H5private.h" @@ -46,19 +46,19 @@ int print_objname(diff_opt_t *options, hsize_t nfound) *------------------------------------------------------------------------- */ -hsize_t h5diff(const char *fname1, - const char *fname2, - const char *objname1, - const char *objname2, +hsize_t h5diff(const char *fname1, + const char *fname2, + const char *objname1, + const char *objname2, diff_opt_t *options) { int nobjects1, nobjects2; trav_info_t *info1=NULL; trav_info_t *info2=NULL; - hid_t file1_id=(-1), file2_id=(-1); + hid_t file1_id=(-1), file2_id=(-1); hsize_t nfound=0; - if (options->m_quiet && + if (options->m_quiet && (options->m_verbose || options->m_report)) { printf("Error: -q (quiet mode) cannot be added to verbose or report modes\n"); @@ -130,7 +130,7 @@ hsize_t h5diff(const char *fname1, * object name was supplied *------------------------------------------------------------------------- */ - + if ( objname1 ) { assert(objname2); @@ -144,13 +144,13 @@ hsize_t h5diff(const char *fname1, *------------------------------------------------------------------------- */ - else + else { nfound=diff_match(file1_id,nobjects1,info1, file2_id,nobjects2,info2,options); } - - + + h5trav_freeinfo(info1,nobjects1); h5trav_freeinfo(info2,nobjects2); @@ -170,8 +170,8 @@ out: /*------------------------------------------------------------------------- * Function: diff_match * - * Purpose: Find common objects; the algorithm used for this search is the - * cosequential match algorithm and is described in + * Purpose: Find common objects; the algorithm used for this search is the + * cosequential match algorithm and is described in * Folk, Michael; Zoellick, Bill. (1992). File Structures. Addison-Wesley. * * Return: Number of differences found @@ -182,12 +182,12 @@ out: * *------------------------------------------------------------------------- */ -hsize_t diff_match( hid_t file1_id, - int nobjects1, +hsize_t diff_match( hid_t file1_id, + int nobjects1, trav_info_t *info1, - hid_t file2_id, - int nobjects2, - trav_info_t *info2, + hid_t file2_id, + int nobjects2, + trav_info_t *info2, diff_opt_t *options ) { int more_names_exist = (nobjects1>0 && nobjects2>0) ? 1 : 0; @@ -195,7 +195,7 @@ hsize_t diff_match( hid_t file1_id, int cmp; int curr1=0; int curr2=0; - unsigned infile[2]; + unsigned infile[2]; char c1, c2; hsize_t nfound=0; int i; @@ -224,7 +224,7 @@ hsize_t diff_match( hid_t file1_id, trav_table_addflags(infile, info1[curr1].name, info1[curr1].type, table ); curr1++; } - else + else { infile[0]=0; infile[1]=1; trav_table_addflags(infile, info2[curr2].name, info2[curr2].type, table ); @@ -233,7 +233,7 @@ hsize_t diff_match( hid_t file1_id, more_names_exist = (curr1objs[i].flags[0] && table->objs[i].flags[1] ) { options->cmn_objs=1; - nfound+=diff( file1_id, - table->objs[i].name, - file2_id, - table->objs[i].name, - options, + nfound+=diff( file1_id, + table->objs[i].name, + file2_id, + table->objs[i].name, + options, table->objs[i].type ); } } @@ -300,19 +300,19 @@ hsize_t diff_match( hid_t file1_id, /* free table */ trav_table_free(table); - + /*------------------------------------------------------------------------- * do the diff for the root. - * this is a special case, we get an ID for the root group and call diff() + * this is a special case, we get an ID for the root group and call diff() * with this ID; it compares only the root group attributes *------------------------------------------------------------------------- */ - nfound+=diff( file1_id, - "/", - file2_id, - "/", - options, + nfound+=diff( file1_id, + "/", + file2_id, + "/", + options, H5G_GROUP ); @@ -334,15 +334,15 @@ hsize_t diff_match( hid_t file1_id, *------------------------------------------------------------------------- */ -hsize_t diff_compare( hid_t file1_id, - const char *file1_name, - const char *obj1_name, - int nobjects1, +hsize_t diff_compare( hid_t file1_id, + const char *file1_name, + const char *obj1_name, + int nobjects1, trav_info_t *info1, - hid_t file2_id, - const char *file2_name, - const char *obj2_name, - int nobjects2, + hid_t file2_id, + const char *file2_name, + const char *obj2_name, + int nobjects2, trav_info_t *info2, diff_opt_t *options ) { @@ -376,12 +376,12 @@ hsize_t diff_compare( hid_t file1_id, if ( info1[i].type != info2[j].type) { if (options->m_verbose) - printf("Comparison not possible: <%s> is of type %s and <%s> is of type %s\n", - obj1_name, get_type(info1[i].type), + printf("Comparison not possible: <%s> is of type %s and <%s> is of type %s\n", + obj1_name, get_type(info1[i].type), obj2_name, get_type(info2[j].type) ); return 0; } - + nfound=diff( file1_id, obj1_name, file2_id, obj2_name, options, info1[i].type ); return nfound; @@ -393,10 +393,10 @@ hsize_t diff_compare( hid_t file1_id, * * Purpose: switch between types and choose the diff function * TYPE is either - * H5G_LINK Object is a symbolic link - * H5G_GROUP Object is a group - * H5G_DATASET Object is a dataset - * H5G_TYPE Object is a named data type + * H5G_LINK Object is a symbolic link + * H5G_GROUP Object is a group + * H5G_DATASET Object is a dataset + * H5G_TYPE Object is a named data type * * Return: Number of differences found * @@ -407,11 +407,11 @@ hsize_t diff_compare( hid_t file1_id, *------------------------------------------------------------------------- */ -hsize_t diff( hid_t file1_id, - const char *path1, - hid_t file2_id, - const char *path2, - diff_opt_t *options, +hsize_t diff( hid_t file1_id, + const char *path1, + hid_t file2_id, + const char *path2, + diff_opt_t *options, H5G_obj_t1 type ) { hid_t type1_id=(-1); @@ -439,7 +439,7 @@ hsize_t diff( hid_t file1_id, if (print_objname(options,(hsize_t)1)) printf( "Dataset: <%s> and <%s>\n",path1,path2); nfound=diff_dataset(file1_id,file2_id,path1,path2,options); - + } /* check first if we have differences */ else @@ -451,7 +451,7 @@ hsize_t diff( hid_t file1_id, nfound=diff_dataset(file1_id,file2_id,path1,path2,options); /* print again */ options->m_quiet=0; - if (nfound) + if (nfound) { if (print_objname(options,nfound)) printf( "Dataset: <%s> and <%s>\n",path1,path2); @@ -472,33 +472,33 @@ hsize_t diff( hid_t file1_id, *------------------------------------------------------------------------- */ case H5G_TYPE: - if ((type1_id = H5Topen(file1_id, path1))<0) + if ((type1_id = H5Topen(file1_id, path1))<0) goto out; - if ((type2_id = H5Topen(file2_id, path2))<0) + if ((type2_id = H5Topen(file2_id, path2))<0) goto out; - + if ((ret = H5Tequal(type1_id,type2_id))<0) goto out; - + /* if H5Tequal is > 0 then the datatypes refer to the same datatype */ nfound = (ret>0) ? 0 : 1; if (print_objname(options,nfound)) printf( "Datatype: <%s> and <%s>\n",path1,path2); - + /*------------------------------------------------------------------------- * compare attributes * the if condition refers to cases when the dataset is a referenced object *------------------------------------------------------------------------- */ - if (path1) + if (path1) diff_attr(type1_id,type2_id,path1,path2,options); - + if ( H5Tclose(type1_id)<0) goto out; if ( H5Tclose(type2_id)<0) goto out; - + break; /*------------------------------------------------------------------------- @@ -506,32 +506,32 @@ hsize_t diff( hid_t file1_id, *------------------------------------------------------------------------- */ case H5G_GROUP: - if ((grp1_id = H5Gopen(file1_id, path1))<0) + if ((grp1_id = H5Gopen(file1_id, path1))<0) goto out; - if ((grp2_id = H5Gopen(file2_id, path2))<0) + if ((grp2_id = H5Gopen(file2_id, path2))<0) goto out; - + ret = HDstrcmp(path1,path2); - + /* if "path1" != "path2" then the groups are "different" */ nfound = (ret!=0) ? 1 : 0; if (print_objname(options,nfound)) printf( "Group: <%s> and <%s>\n",path1,path2); - + /*------------------------------------------------------------------------- * compare attributes * the if condition refers to cases when the dataset is a referenced object *------------------------------------------------------------------------- */ - if (path1) + if (path1) diff_attr(grp1_id,grp2_id,path1,path2,options); - + if ( H5Gclose(grp1_id)<0) goto out; if ( H5Gclose(grp2_id)<0) goto out; - + break; @@ -544,17 +544,17 @@ hsize_t diff( hid_t file1_id, goto out; if (H5Gget_objinfo(file1_id,path1,FALSE,&sb2)<0) goto out; - + buf1 = malloc(sb1.linklen); buf2 = malloc(sb2.linklen); - + if (H5Gget_linkval(file1_id,path1,sb1.linklen,buf1)<0) goto out; if (H5Gget_linkval(file2_id,path2,sb1.linklen,buf2)<0) goto out; ret = HDstrcmp(buf1,buf2); - + /* if "buf1" != "buf2" then the links are "different" */ nfound = (ret!=0) ? 1 : 0; @@ -570,19 +570,19 @@ hsize_t diff( hid_t file1_id, free(buf2); buf2=NULL; } - + break; - - + + default: nfound=0; if (options->m_verbose) { - printf("Comparison not supported: <%s> and <%s> are of type %s\n", + printf("Comparison not supported: <%s> and <%s> are of type %s\n", path1, path2, get_type(type) ); } break; - } - + } + out: @@ -595,12 +595,12 @@ hsize_t diff( hid_t file1_id, H5Tclose(grp2_id); /* enable error reporting */ } H5E_END_TRY; - + if (buf1) free(buf1); if (buf2) free(buf2); - + return nfound; } diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h index 454be76..54f5483 100644 --- a/tools/lib/h5diff.h +++ b/tools/lib/h5diff.h @@ -76,10 +76,10 @@ typedef struct { extern "C" { #endif -hsize_t h5diff(const char *fname1, - const char *fname2, - const char *objname1, - const char *objname2, +hsize_t h5diff(const char *fname1, + const char *fname2, + const char *objname1, + const char *objname2, diff_opt_t *options); @@ -95,75 +95,75 @@ hsize_t h5diff(const char *fname1, */ -hsize_t diff_dataset( hid_t file1_id, - hid_t file2_id, - const char *obj1_name, +hsize_t diff_dataset( hid_t file1_id, + hid_t file2_id, + const char *obj1_name, const char *obj2_name, diff_opt_t *options ); -hsize_t diff_datasetid( hid_t dset1_id, - hid_t dset2_id, - const char *obj1_name, - const char *obj2_name, +hsize_t diff_datasetid( hid_t dset1_id, + hid_t dset2_id, + const char *obj1_name, + const char *obj2_name, diff_opt_t *options ); -hsize_t diff( hid_t file1_id, - const char *path1, - hid_t file2_id, - const char *path2, - diff_opt_t *options, +hsize_t diff( hid_t file1_id, + const char *path1, + hid_t file2_id, + const char *path2, + diff_opt_t *options, H5G_obj_t1 type ); -hsize_t diff_compare( hid_t file1_id, - const char *file1_name, - const char *obj1_name, - int nobjects1, +hsize_t diff_compare( hid_t file1_id, + const char *file1_name, + const char *obj1_name, + int nobjects1, trav_info_t *info1, - hid_t file2_id, - const char *file2_name, - const char *obj2_name, - int nobjects2, + hid_t file2_id, + const char *file2_name, + const char *obj2_name, + int nobjects2, trav_info_t *info2, diff_opt_t *options ); -hsize_t diff_match( hid_t file1_id, - int nobjects1, +hsize_t diff_match( hid_t file1_id, + int nobjects1, trav_info_t *info1, - hid_t file2_id, - int nobjects2, - trav_info_t *info2, + hid_t file2_id, + int nobjects2, + trav_info_t *info2, diff_opt_t *options ); -hsize_t diff_array( void *_mem1, - void *_mem2, - hsize_t nelmts, - int rank, - hsize_t *dims, - diff_opt_t *options, - const char *name1, +hsize_t diff_array( void *_mem1, + void *_mem2, + hsize_t nelmts, + int rank, + hsize_t *dims, + diff_opt_t *options, + const char *name1, const char *name2, hid_t m_type, hid_t container1_id, hid_t container2_id); /* dataset where the reference came from*/ -int diff_can_type( hid_t f_type1, /* file data type */ +int diff_can_type( hid_t f_type1, /* file data type */ hid_t f_type2, /* file data type */ - int rank1, + int rank1, int rank2, - hsize_t *dims1, + hsize_t *dims1, hsize_t *dims2, - hsize_t *maxdim1, + hsize_t *maxdim1, hsize_t *maxdim2, - const char *obj1_name, - const char *obj2_name, + const char *obj1_name, + const char *obj2_name, diff_opt_t *options ); -int diff_attr(hid_t loc1_id, - hid_t loc2_id, - const char *path1, - const char *path2, +int diff_attr(hid_t loc1_id, + hid_t loc2_id, + const char *path1, + const char *path2, diff_opt_t *options ); @@ -180,13 +180,13 @@ const char* get_type(int type); const char* get_class(H5T_class_t tclass); const char* get_sign(H5T_sign_t sign); void print_dims( int r, hsize_t *d ); -void print_pos( int *ph, - int per, - hsize_t curr_pos, - hsize_t *acc, - hsize_t *pos, - int rank, - const char *obj1, +void print_pos( int *ph, + int per, + hsize_t curr_pos, + hsize_t *acc, + hsize_t *pos, + int rank, + const char *obj1, const char *obj2 ); int print_objname(diff_opt_t *options, hsize_t nfound); @@ -201,172 +201,172 @@ void print_sizes( const char *obj1, const char *obj2, hsize_t diff_native_uchar(unsigned char *mem1, unsigned char *mem2, - hsize_t i, - int rank, - hsize_t *acc, + hsize_t i, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph); hsize_t diff_char(unsigned char *mem1, unsigned char *mem2, - hsize_t i, - int rank, - hsize_t *acc, + hsize_t i, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph); -hsize_t diff_datum(void *_mem1, - void *_mem2, +hsize_t diff_datum(void *_mem1, + void *_mem2, hid_t m_type, - hsize_t i, - int rank, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, + hsize_t i, + int rank, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, const char *obj2, hid_t container1_id, hid_t container2_id, /*where the reference came from*/ - int *ph); /*print header */ + int *ph); /*print header */ hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph); hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph); hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph); hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph); hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph); hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph); hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph); hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph); hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph); hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph); hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph); hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph); diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index d8212ab..82eb306 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -14,7 +14,7 @@ #include #include "h5diff.h" -#include "H5private.h" +#include "H5private.h" /* local functions */ @@ -30,7 +30,7 @@ static hbool_t is_zero(const void *_mem, size_t size); *------------------------------------------------------------------------- */ static int print_data(diff_opt_t *options) -{ +{ return ( (options->m_report || options->m_verbose) && !options->m_quiet)?1:0; } @@ -45,22 +45,22 @@ static int print_data(diff_opt_t *options) * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * * Date: November 12, 2003 - * + * *------------------------------------------------------------------------- */ -hsize_t diff_array( void *_mem1, - void *_mem2, - hsize_t nelmts, - int rank, - hsize_t *dims, - diff_opt_t *options, - const char *name1, +hsize_t diff_array( void *_mem1, + void *_mem2, + hsize_t nelmts, + int rank, + hsize_t *dims, + diff_opt_t *options, + const char *name1, const char *name2, hid_t m_type, hid_t container1_id, hid_t container2_id) /* dataset where the reference came from*/ -{ +{ hsize_t nfound=0; /* number of differences found */ size_t size; /* size of datum */ unsigned char *mem1 = (unsigned char*)_mem1; @@ -85,13 +85,13 @@ hsize_t diff_array( void *_mem1, pos[j]=0; - if(H5Tis_variable_str(m_type)) + if(H5Tis_variable_str(m_type)) { - tmp1 = ((unsigned char**)mem1)[0]; - tmp2 = ((unsigned char**)mem2)[0]; + tmp1 = ((unsigned char**)mem1)[0]; + tmp2 = ((unsigned char**)mem2)[0]; nfound+=diff_datum( tmp1, - tmp2, + tmp2, m_type, (hsize_t)0, rank, @@ -106,47 +106,47 @@ hsize_t diff_array( void *_mem1, } else - + { - - switch (H5Tget_class(m_type)) + + switch (H5Tget_class(m_type)) { default: assert(0); break; - + case H5T_FLOAT: - if (H5Tequal(m_type, H5T_NATIVE_FLOAT)) + if (H5Tequal(m_type, H5T_NATIVE_FLOAT)) nfound=diff_float(mem1,mem2,nelmts,rank,acc,pos,options,name1,name2,&ph); - else if (H5Tequal(m_type, H5T_NATIVE_DOUBLE)) + else if (H5Tequal(m_type, H5T_NATIVE_DOUBLE)) nfound=diff_double(mem1,mem2,nelmts,rank,acc,pos,options,name1,name2,&ph); break; - + case H5T_INTEGER: - + if (H5Tequal(m_type, H5T_NATIVE_SCHAR)) nfound=diff_schar(mem1,mem2,nelmts,rank,acc,pos,options,name1,name2,&ph); - else if (H5Tequal(m_type, H5T_NATIVE_UCHAR)) + else if (H5Tequal(m_type, H5T_NATIVE_UCHAR)) nfound=diff_uchar(mem1,mem2,nelmts,rank,acc,pos,options,name1,name2,&ph); else if (H5Tequal(m_type, H5T_NATIVE_SHORT)) nfound=diff_short(mem1,mem2,nelmts,rank,acc,pos,options,name1,name2,&ph); else if (H5Tequal(m_type, H5T_NATIVE_USHORT)) nfound=diff_ushort(mem1,mem2,nelmts,rank,acc,pos,options,name1,name2,&ph); - else if (H5Tequal(m_type, H5T_NATIVE_INT)) + else if (H5Tequal(m_type, H5T_NATIVE_INT)) nfound=diff_int(mem1,mem2,nelmts,rank,acc,pos,options,name1,name2,&ph); - else if (H5Tequal(m_type, H5T_NATIVE_UINT)) + else if (H5Tequal(m_type, H5T_NATIVE_UINT)) nfound=diff_uint(mem1,mem2,nelmts,rank,acc,pos,options,name1,name2,&ph); - else if (H5Tequal(m_type, H5T_NATIVE_LONG)) + else if (H5Tequal(m_type, H5T_NATIVE_LONG)) nfound=diff_long(mem1,mem2,nelmts,rank,acc,pos,options,name1,name2,&ph); - else if (H5Tequal(m_type, H5T_NATIVE_ULONG)) + else if (H5Tequal(m_type, H5T_NATIVE_ULONG)) nfound=diff_ulong(mem1,mem2,nelmts,rank,acc,pos,options,name1,name2,&ph); - else if (H5Tequal(m_type, H5T_NATIVE_LLONG)) + else if (H5Tequal(m_type, H5T_NATIVE_LLONG)) nfound=diff_llong(mem1,mem2,nelmts,rank,acc,pos,options,name1,name2,&ph); - else if (H5Tequal(m_type, H5T_NATIVE_ULLONG)) + else if (H5Tequal(m_type, H5T_NATIVE_ULLONG)) nfound=diff_ullong(mem1,mem2,nelmts,rank,acc,pos,options,name1,name2,&ph); break; - + case H5T_COMPOUND: case H5T_STRING: case H5T_BITFIELD: @@ -155,7 +155,7 @@ hsize_t diff_array( void *_mem1, case H5T_ARRAY: case H5T_VLEN: case H5T_REFERENCE: - + for ( i = 0; i < nelmts; i++) { nfound+=diff_datum( @@ -177,7 +177,7 @@ hsize_t diff_array( void *_mem1, } /* i */ } /* switch */ } /* else */ - + return nfound; } @@ -198,7 +198,7 @@ hsize_t diff_array( void *_mem1, * The compare of the 2 buffers read from the files is made datum by datum. * * H5T_INTEGER and H5T_FLOAT - * Copy the buffer into a compatible local datum and do a numerical + * Copy the buffer into a compatible local datum and do a numerical * compare of this datum * H5T_COMPOUND * Recursively call this function for each member @@ -207,34 +207,34 @@ hsize_t diff_array( void *_mem1, * H5T_VLEN * Recursively call this function for each element  * H5T_STRING - * compare byte by byte in a cycle from 0 to type_size. this type_size is the - * value obtained by the get_size function but it is the string lenght for + * compare byte by byte in a cycle from 0 to type_size. this type_size is the + * value obtained by the get_size function but it is the string lenght for * variable sized strings * H5T_OPAQUE * compare byte by byte in a cycle from 0 to type_size * H5T_BITFIELD * compare byte by byte in a cycle from 0 to type_size * H5T_ENUM - * for each pair of elements being compared, both bit patterns are converted to + * for each pair of elements being compared, both bit patterns are converted to * their corresponding enumeration constant and a string comparison is made * H5T_REFERENCE - * Dereference the object and compare the type (basic object type). + * Dereference the object and compare the type (basic object type). *------------------------------------------------------------------------- */ -hsize_t diff_datum(void *_mem1, - void *_mem2, +hsize_t diff_datum(void *_mem1, + void *_mem2, hid_t m_type, - hsize_t i, - int rank, - hsize_t *acc, - hsize_t *pos, - diff_opt_t *options, - const char *obj1, + hsize_t i, + int rank, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, const char *obj2, hid_t container1_id, hid_t container2_id, /*where the reference came from*/ - int *ph) /*print header */ + int *ph) /*print header */ { static char fmt_llong[255]; static char fmt_ullong[255]; @@ -245,7 +245,7 @@ hsize_t diff_datum(void *_mem1, unsigned char *mem2 = (unsigned char*)_mem2; unsigned u; hid_t memb_type; - size_t type_size; + size_t type_size; size_t offset; int nmembs; int j; @@ -264,22 +264,22 @@ hsize_t diff_datum(void *_mem1, int ret=0; /* check return error */ if (!fmt_llong[0]) { - + /* Build default formats for long long types */ - sprintf(fmt_llong, "%%%sd %%%sd %%%sd\n", + sprintf(fmt_llong, "%%%sd %%%sd %%%sd\n", H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH); - sprintf(fmt_ullong, "%%%su %%%su %%%su\n", + sprintf(fmt_ullong, "%%%su %%%su %%%su\n", H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH); - sprintf(fmt_llongp, "%%%sd %%%sd %%%sd %%%sd\n", + sprintf(fmt_llongp, "%%%sd %%%sd %%%sd %%%sd\n", H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH); - sprintf(fmt_ullongp, "%%%su %%%su %%%su %%%su\n", + sprintf(fmt_ullongp, "%%%su %%%su %%%su %%%su\n", H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH); - + } type_size = H5Tget_size( m_type ); - switch (H5Tget_class(m_type)) + switch (H5Tget_class(m_type)) { default: assert(0); @@ -294,7 +294,7 @@ hsize_t diff_datum(void *_mem1, */ case H5T_COMPOUND: nmembs = H5Tget_nmembers(m_type); - for (j = 0; j < nmembs; j++) + for (j = 0; j < nmembs; j++) { offset = H5Tget_member_offset(m_type, (unsigned)j); memb_type = H5Tget_member_type(m_type, (unsigned)j); @@ -321,25 +321,25 @@ hsize_t diff_datum(void *_mem1, *------------------------------------------------------------------------- */ case H5T_STRING: - - if(H5Tis_variable_str(m_type)) + + if(H5Tis_variable_str(m_type)) type_size = HDstrlen((char*)mem1); - else + else type_size = H5Tget_size(m_type); - + for (u=0; u= 0) && (H5Tenum_nameof(m_type, mem2, enum_name2, sizeof enum_name2) >= 0)) { if (HDstrcmp(enum_name1,enum_name2)!=0) { nfound=1; - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -427,20 +427,20 @@ hsize_t diff_datum(void *_mem1, mem1 + u, mem2 + u, /* offset */ i, /* index position */ - rank, + rank, acc, pos, - options, - obj1, + options, + obj1, obj2, ph); } - + /* enable error reporting */ } H5E_END_TRY; } - + break; /*------------------------------------------------------------------------- * H5T_ARRAY @@ -453,11 +453,11 @@ hsize_t diff_datum(void *_mem1, ndims = H5Tget_array_ndims(m_type); H5Tget_array_dims(m_type, dims, NULL); assert(ndims >= 1 && ndims <= H5S_MAX_RANK); - + /* calculate the number of array elements */ for (u = 0, nelmts = 1; u len; - - for (j = 0; j < (int)nelmts; j++) + + for (j = 0; j < (int)nelmts; j++) nfound+=diff_datum( ((char *)(((hvl_t *)mem1)->p)) + j * size, ((char *)(((hvl_t *)mem2)->p)) + j * size, /* offset */ @@ -503,14 +503,14 @@ hsize_t diff_datum(void *_mem1, container1_id, container2_id, ph); - + H5Tclose(memb_type); - + break; case H5T_REFERENCE: - + iszero1=is_zero(_mem1, H5Tget_size(m_type)); iszero2=is_zero(_mem2, H5Tget_size(m_type)); if (iszero1==1 && iszero2==1) @@ -525,8 +525,8 @@ hsize_t diff_datum(void *_mem1, * Dataset region reference *------------------------------------------------------------------------- */ - - if (H5Tequal(m_type, H5T_STD_REF_DSETREG)) + + if (H5Tequal(m_type, H5T_STD_REF_DSETREG)) { hid_t region1_id; hid_t region2_id; @@ -553,12 +553,12 @@ hsize_t diff_datum(void *_mem1, { printf("Different region referenced\n"); } - + close_obj(H5G_DATASET,obj1_id); close_obj(H5G_DATASET,obj2_id); H5Sclose(region1_id); H5Sclose(region2_id); - + }/*dataset reference*/ @@ -567,7 +567,7 @@ hsize_t diff_datum(void *_mem1, * Object references. get the type and OID of the referenced object *------------------------------------------------------------------------- */ - else if (H5Tequal(m_type, H5T_STD_REF_OBJ)) + else if (H5Tequal(m_type, H5T_STD_REF_OBJ)) { if ((obj1_type = H5Rget_obj_type(container1_id, H5R_OBJECT, _mem1))<0) @@ -606,19 +606,19 @@ hsize_t diff_datum(void *_mem1, options); break; default: - printf("Warning: Comparison not possible of object types referenced: <%s> and <%s>", + printf("Warning: Comparison not possible of object types referenced: <%s> and <%s>", obj1, obj2); break; } close_obj(obj1_type,obj1_id); close_obj(obj2_type,obj2_id); - + }/*object reference*/ - + }/*is zero*/ - - + + break; @@ -629,7 +629,7 @@ hsize_t diff_datum(void *_mem1, * H5T_NATIVE_SCHAR *------------------------------------------------------------------------- */ - if (H5Tequal(m_type, H5T_NATIVE_SCHAR)) + if (H5Tequal(m_type, H5T_NATIVE_SCHAR)) { char temp1_char; char temp2_char; @@ -641,7 +641,7 @@ hsize_t diff_datum(void *_mem1, { if (abs(temp1_char-temp2_char) > options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -655,7 +655,7 @@ hsize_t diff_datum(void *_mem1, { if ( temp1_char!=0 && abs(1-temp2_char/temp1_char) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -668,10 +668,10 @@ hsize_t diff_datum(void *_mem1, /* -d and -p */ else if ( options->d && options->p) { - if ( temp1_char!=0 && abs(1-temp2_char/temp1_char) > options->percent && + if ( temp1_char!=0 && abs(1-temp2_char/temp1_char) > options->percent && abs(temp1_char-temp2_char) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -683,7 +683,7 @@ hsize_t diff_datum(void *_mem1, } else if (temp1_char != temp2_char) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -691,19 +691,19 @@ hsize_t diff_datum(void *_mem1, } nfound++; } - + } /*H5T_NATIVE_SCHAR*/ /*------------------------------------------------------------------------- * H5T_NATIVE_UCHAR *------------------------------------------------------------------------- */ - else if (H5Tequal(m_type, H5T_NATIVE_UCHAR)) + else if (H5Tequal(m_type, H5T_NATIVE_UCHAR)) { unsigned char temp1_uchar; unsigned char temp2_uchar; assert(type_size==sizeof(unsigned char)); - + memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); /* -d and !-p */ @@ -711,7 +711,7 @@ hsize_t diff_datum(void *_mem1, { if (abs(temp1_uchar-temp2_uchar) > options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -725,7 +725,7 @@ hsize_t diff_datum(void *_mem1, { if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -738,10 +738,10 @@ hsize_t diff_datum(void *_mem1, /* -d and -p */ else if ( options->d && options->p) { - if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > options->percent && + if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > options->percent && abs(temp1_uchar-temp2_uchar) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -753,7 +753,7 @@ hsize_t diff_datum(void *_mem1, } else if (temp1_uchar != temp2_uchar) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -761,7 +761,7 @@ hsize_t diff_datum(void *_mem1, } nfound++; } - + } /*H5T_NATIVE_UCHAR*/ @@ -769,13 +769,13 @@ hsize_t diff_datum(void *_mem1, * H5T_NATIVE_SHORT *------------------------------------------------------------------------- */ - + else if (H5Tequal(m_type, H5T_NATIVE_SHORT)) { short temp1_short; short temp2_short; assert(type_size==sizeof(short)); - + memcpy(&temp1_short, mem1, sizeof(short)); memcpy(&temp2_short, mem2, sizeof(short)); /* -d and !-p */ @@ -783,7 +783,7 @@ hsize_t diff_datum(void *_mem1, { if (abs(temp1_short-temp2_short) > options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -797,7 +797,7 @@ hsize_t diff_datum(void *_mem1, { if ( temp1_short!=0 && abs(1-temp2_short/temp1_short) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -810,10 +810,10 @@ hsize_t diff_datum(void *_mem1, /* -d and -p */ else if ( options->d && options->p) { - if ( temp1_short!=0 && abs(1-temp2_short/temp1_short) > options->percent && + if ( temp1_short!=0 && abs(1-temp2_short/temp1_short) > options->percent && abs(temp1_short-temp2_short) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -825,7 +825,7 @@ hsize_t diff_datum(void *_mem1, } else if (temp1_short != temp2_short) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -833,21 +833,21 @@ hsize_t diff_datum(void *_mem1, } nfound++; } - - + + } /*H5T_NATIVE_SHORT*/ /*------------------------------------------------------------------------- * H5T_NATIVE_USHORT *------------------------------------------------------------------------- */ - + else if (H5Tequal(m_type, H5T_NATIVE_USHORT)) { unsigned short temp1_ushort; unsigned short temp2_ushort; assert(type_size==sizeof(short)); - + memcpy(&temp1_ushort, mem1, sizeof(unsigned short)); memcpy(&temp2_ushort, mem2, sizeof(unsigned short)); /* -d and !-p */ @@ -855,8 +855,8 @@ hsize_t diff_datum(void *_mem1, { if (abs(temp1_ushort-temp2_ushort) > options->delta) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -870,8 +870,8 @@ hsize_t diff_datum(void *_mem1, { if ( temp1_ushort!=0 && abs(1-temp2_ushort/temp1_ushort) > options->percent ) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -884,11 +884,11 @@ hsize_t diff_datum(void *_mem1, /* -d and -p */ else if ( options->d && options->p) { - if ( temp1_ushort!=0 && abs(1-temp2_ushort/temp1_ushort) > options->percent && + if ( temp1_ushort!=0 && abs(1-temp2_ushort/temp1_ushort) > options->percent && abs(temp1_ushort-temp2_ushort) > options->delta ) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -900,8 +900,8 @@ hsize_t diff_datum(void *_mem1, } else if (temp1_ushort != temp2_ushort) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -909,8 +909,8 @@ hsize_t diff_datum(void *_mem1, } nfound++; } - - + + } /*H5T_NATIVE_USHORT*/ @@ -918,13 +918,13 @@ hsize_t diff_datum(void *_mem1, * H5T_NATIVE_INT *------------------------------------------------------------------------- */ - - else if (H5Tequal(m_type, H5T_NATIVE_INT)) + + else if (H5Tequal(m_type, H5T_NATIVE_INT)) { int temp1_int; int temp2_int; assert(type_size==sizeof(int)); - + memcpy(&temp1_int, mem1, sizeof(int)); memcpy(&temp2_int, mem2, sizeof(int)); /* -d and !-p */ @@ -932,8 +932,8 @@ hsize_t diff_datum(void *_mem1, { if (abs(temp1_int-temp2_int) > options->delta) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -947,8 +947,8 @@ hsize_t diff_datum(void *_mem1, { if ( temp1_int!=0 && abs(1-temp2_int/temp1_int) > options->percent ) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -961,11 +961,11 @@ hsize_t diff_datum(void *_mem1, /* -d and -p */ else if ( options->d && options->p) { - if ( temp1_int!=0 && abs(1-temp2_int/temp1_int) > options->percent && + if ( temp1_int!=0 && abs(1-temp2_int/temp1_int) > options->percent && abs(temp1_int-temp2_int) > options->delta ) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -977,8 +977,8 @@ hsize_t diff_datum(void *_mem1, } else if (temp1_int != temp2_int) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -986,8 +986,8 @@ hsize_t diff_datum(void *_mem1, } nfound++; } - - + + } /*H5T_NATIVE_INT*/ @@ -995,13 +995,13 @@ hsize_t diff_datum(void *_mem1, * H5T_NATIVE_UINT *------------------------------------------------------------------------- */ - - else if (H5Tequal(m_type, H5T_NATIVE_UINT)) + + else if (H5Tequal(m_type, H5T_NATIVE_UINT)) { unsigned int temp1_uint; unsigned int temp2_uint; assert(type_size==sizeof(int)); - + memcpy(&temp1_uint, mem1, sizeof(unsigned int)); memcpy(&temp2_uint, mem2, sizeof(unsigned int)); /* -d and !-p */ @@ -1009,8 +1009,8 @@ hsize_t diff_datum(void *_mem1, { if (abs((int)(temp1_uint-temp2_uint)) > options->delta) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1024,8 +1024,8 @@ hsize_t diff_datum(void *_mem1, { if ( temp1_uint!=0 && abs((int)(1-temp2_uint/temp1_uint)) > options->percent ) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1038,11 +1038,11 @@ hsize_t diff_datum(void *_mem1, /* -d and -p */ else if ( options->d && options->p) { - if ( temp1_uint!=0 && abs((int)(1-temp2_uint/temp1_uint)) > options->percent && + if ( temp1_uint!=0 && abs((int)(1-temp2_uint/temp1_uint)) > options->percent && abs((int)(temp1_uint-temp2_uint)) > options->delta ) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1054,8 +1054,8 @@ hsize_t diff_datum(void *_mem1, } else if (temp1_uint != temp2_uint) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1063,9 +1063,9 @@ hsize_t diff_datum(void *_mem1, } nfound++; } - - - + + + } /*H5T_NATIVE_UINT*/ @@ -1073,13 +1073,13 @@ hsize_t diff_datum(void *_mem1, * H5T_NATIVE_LONG *------------------------------------------------------------------------- */ - - else if (H5Tequal(m_type, H5T_NATIVE_LONG)) + + else if (H5Tequal(m_type, H5T_NATIVE_LONG)) { long temp1_long; long temp2_long; assert(type_size==sizeof(long)); - + memcpy(&temp1_long, mem1, sizeof(long)); memcpy(&temp2_long, mem2, sizeof(long)); /* -d and !-p */ @@ -1087,8 +1087,8 @@ hsize_t diff_datum(void *_mem1, { if (labs(temp1_long-temp2_long) > (long)options->delta) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1102,8 +1102,8 @@ hsize_t diff_datum(void *_mem1, { if ( temp1_long!=0 && labs(1-temp2_long/temp1_long) > (long)options->percent ) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1116,11 +1116,11 @@ hsize_t diff_datum(void *_mem1, /* -d and -p */ else if ( options->d && options->p) { - if ( temp1_long!=0 && labs(1-temp2_long/temp1_long) > (long)options->percent && + if ( temp1_long!=0 && labs(1-temp2_long/temp1_long) > (long)options->percent && labs(temp1_long-temp2_long) > (long)options->delta ) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1132,8 +1132,8 @@ hsize_t diff_datum(void *_mem1, } else if (temp1_long != temp2_long) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1141,22 +1141,22 @@ hsize_t diff_datum(void *_mem1, } nfound++; } - - - + + + } /*H5T_NATIVE_LONG*/ /*------------------------------------------------------------------------- * H5T_NATIVE_ULONG *------------------------------------------------------------------------- */ - - else if (H5Tequal(m_type, H5T_NATIVE_ULONG)) + + else if (H5Tequal(m_type, H5T_NATIVE_ULONG)) { unsigned long temp1_ulong; unsigned long temp2_ulong; assert(type_size==sizeof(unsigned long)); - + memcpy(&temp1_ulong, mem1, sizeof(unsigned long)); memcpy(&temp2_ulong, mem2, sizeof(unsigned long)); /* -d and !-p */ @@ -1164,8 +1164,8 @@ hsize_t diff_datum(void *_mem1, { if (labs((long)(temp1_ulong-temp2_ulong)) > (long)options->delta) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1179,8 +1179,8 @@ hsize_t diff_datum(void *_mem1, { if ( temp1_ulong!=0 && labs((long)(1-temp2_ulong/temp1_ulong)) > (long)options->percent ) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1193,11 +1193,11 @@ hsize_t diff_datum(void *_mem1, /* -d and -p */ else if ( options->d && options->p) { - if ( temp1_ulong!=0 && labs((long)(1-temp2_ulong/temp1_ulong)) > (long)options->percent && + if ( temp1_ulong!=0 && labs((long)(1-temp2_ulong/temp1_ulong)) > (long)options->percent && labs((long)(temp1_ulong-temp2_ulong)) > (long)options->delta ) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1209,8 +1209,8 @@ hsize_t diff_datum(void *_mem1, } else if (temp1_ulong != temp2_ulong) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1218,21 +1218,21 @@ hsize_t diff_datum(void *_mem1, } nfound++; } - - + + } /*H5T_NATIVE_ULONG*/ /*------------------------------------------------------------------------- * H5T_NATIVE_LLONG *------------------------------------------------------------------------- */ - - else if (H5Tequal(m_type, H5T_NATIVE_LLONG)) + + else if (H5Tequal(m_type, H5T_NATIVE_LLONG)) { long_long temp1_llong; long_long temp2_llong; assert(type_size==sizeof(long_long)); - + memcpy(&temp1_llong, mem1, sizeof(long_long)); memcpy(&temp2_llong, mem2, sizeof(long_long)); /* -d and !-p */ @@ -1240,8 +1240,8 @@ hsize_t diff_datum(void *_mem1, { if (labs((long)(temp1_llong-temp2_llong)) > (long)options->delta) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1255,8 +1255,8 @@ hsize_t diff_datum(void *_mem1, { if ( temp1_llong!=0 && labs((long)(1-temp2_llong/temp1_llong)) > (long)options->percent ) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1269,11 +1269,11 @@ hsize_t diff_datum(void *_mem1, /* -d and -p */ else if ( options->d && options->p) { - if ( temp1_llong!=0 && labs((long)(1-temp2_llong/temp1_llong)) > (long)options->percent && + if ( temp1_llong!=0 && labs((long)(1-temp2_llong/temp1_llong)) > (long)options->percent && labs((long)(temp1_llong-temp2_llong)) > (long)options->delta ) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1285,8 +1285,8 @@ hsize_t diff_datum(void *_mem1, } else if (temp1_llong != temp2_llong) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1294,21 +1294,21 @@ hsize_t diff_datum(void *_mem1, } nfound++; } - - + + } /*H5T_NATIVE_LLONG*/ /*------------------------------------------------------------------------- * H5T_NATIVE_ULLONG *------------------------------------------------------------------------- */ - - else if (H5Tequal(m_type, H5T_NATIVE_ULLONG)) + + else if (H5Tequal(m_type, H5T_NATIVE_ULLONG)) { unsigned long_long temp1_ullong; unsigned long_long temp2_ullong; assert(type_size==sizeof(unsigned long_long)); - + memcpy(&temp1_ullong, mem1, sizeof(unsigned long_long)); memcpy(&temp2_ullong, mem2, sizeof(unsigned long_long)); /* -d and !-p */ @@ -1316,8 +1316,8 @@ hsize_t diff_datum(void *_mem1, { if (labs((long)(temp1_ullong-temp2_ullong)) > (long)options->delta) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1332,8 +1332,8 @@ hsize_t diff_datum(void *_mem1, { if ( temp1_ullong!=0 && labs((long)(1-temp2_ullong/temp1_ullong)) > (long)options->percent ) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1347,11 +1347,11 @@ hsize_t diff_datum(void *_mem1, /* -d and -p */ else if ( options->d && options->p) { - if ( temp1_ullong!=0 && labs((long)(1-temp2_ullong/temp1_ullong)) > (long)options->percent && + if ( temp1_ullong!=0 && labs((long)(1-temp2_ullong/temp1_ullong)) > (long)options->percent && labs((long)(temp1_ullong-temp2_ullong)) > (long)options->delta ) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1364,8 +1364,8 @@ hsize_t diff_datum(void *_mem1, } else if (temp1_ullong != temp2_ullong) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1374,10 +1374,10 @@ hsize_t diff_datum(void *_mem1, } nfound++; } - + } /*H5T_NATIVE_ULLONG*/ - + break; /* H5T_INTEGER class */ case H5T_FLOAT: @@ -1385,13 +1385,13 @@ hsize_t diff_datum(void *_mem1, * H5T_NATIVE_FLOAT *------------------------------------------------------------------------- */ - - if (H5Tequal(m_type, H5T_NATIVE_FLOAT)) + + if (H5Tequal(m_type, H5T_NATIVE_FLOAT)) { float temp1_float; float temp2_float; assert(type_size==sizeof(float)); - + memcpy(&temp1_float, mem1, sizeof(float)); memcpy(&temp2_float, mem2, sizeof(float)); @@ -1401,8 +1401,8 @@ hsize_t diff_datum(void *_mem1, { if (fabs(temp1_float-temp2_float) > options->delta) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1416,8 +1416,8 @@ hsize_t diff_datum(void *_mem1, { if ( temp1_float!=0 && fabs(1-temp2_float/temp1_float) > options->percent ) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1430,11 +1430,11 @@ hsize_t diff_datum(void *_mem1, /* -d and -p */ else if ( options->d && options->p) { - if ( temp1_float!=0 && fabs(1-temp2_float/temp1_float) > options->percent && + if ( temp1_float!=0 && fabs(1-temp2_float/temp1_float) > options->percent && fabs(temp1_float-temp2_float) > options->delta ) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1446,8 +1446,8 @@ hsize_t diff_datum(void *_mem1, } else if (temp1_float != temp2_float) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1455,7 +1455,7 @@ hsize_t diff_datum(void *_mem1, } nfound++; } - + } /*H5T_NATIVE_FLOAT*/ /*------------------------------------------------------------------------- @@ -1463,12 +1463,12 @@ hsize_t diff_datum(void *_mem1, *------------------------------------------------------------------------- */ - else if (H5Tequal(m_type, H5T_NATIVE_DOUBLE)) + else if (H5Tequal(m_type, H5T_NATIVE_DOUBLE)) { double temp1_double; double temp2_double; assert(type_size==sizeof(double)); - + memcpy(&temp1_double, mem1, sizeof(double)); memcpy(&temp2_double, mem2, sizeof(double)); /* -d and !-p */ @@ -1476,8 +1476,8 @@ hsize_t diff_datum(void *_mem1, { if (fabs(temp1_double-temp2_double) > options->delta) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1491,8 +1491,8 @@ hsize_t diff_datum(void *_mem1, { if ( temp1_double!=0 && fabs(1-temp2_double/temp1_double) > options->percent ) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1505,11 +1505,11 @@ hsize_t diff_datum(void *_mem1, /* -d and -p */ else if ( options->d && options->p) { - if ( temp1_double!=0 && fabs(1-temp2_double/temp1_double) > options->percent && + if ( temp1_double!=0 && fabs(1-temp2_double/temp1_double) > options->percent && fabs(temp1_double-temp2_double) > options->delta ) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1521,8 +1521,8 @@ hsize_t diff_datum(void *_mem1, } else if (temp1_double != temp2_double) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1530,15 +1530,15 @@ hsize_t diff_datum(void *_mem1, } nfound++; } - + } /*H5T_NATIVE_DOUBLE*/ - + break; /* H5T_FLOAT class */ - + } /* switch */ - - + + return nfound; } @@ -1560,19 +1560,19 @@ hsize_t diff_datum(void *_mem1, hsize_t diff_native_uchar(unsigned char *mem1, unsigned char *mem2, - hsize_t i, - int rank, - hsize_t *acc, + hsize_t i, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph) { hsize_t nfound=0; /* differences found */ unsigned char temp1_uchar; unsigned char temp2_uchar; - + memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); @@ -1581,7 +1581,7 @@ hsize_t diff_native_uchar(unsigned char *mem1, { if (abs(temp1_uchar-temp2_uchar) > options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1595,7 +1595,7 @@ hsize_t diff_native_uchar(unsigned char *mem1, { if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1608,10 +1608,10 @@ hsize_t diff_native_uchar(unsigned char *mem1, /* -d and -p */ else if ( options->d && options->p) { - if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > options->percent && + if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > options->percent && abs(temp1_uchar-temp2_uchar) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1623,7 +1623,7 @@ hsize_t diff_native_uchar(unsigned char *mem1, } else if (temp1_uchar != temp2_uchar) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1631,9 +1631,9 @@ hsize_t diff_native_uchar(unsigned char *mem1, } nfound++; } - + return nfound; -} +} /*------------------------------------------------------------------------- @@ -1652,25 +1652,25 @@ hsize_t diff_native_uchar(unsigned char *mem1, hsize_t diff_char(unsigned char *mem1, unsigned char *mem2, - hsize_t i, - int rank, - hsize_t *acc, + hsize_t i, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph) { hsize_t nfound=0; /* differences found */ unsigned char temp1_uchar; unsigned char temp2_uchar; - + memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); if (temp1_uchar != temp2_uchar) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1678,9 +1678,9 @@ hsize_t diff_char(unsigned char *mem1, } nfound++; } - + return nfound; -} +} @@ -1698,11 +1698,11 @@ static hbool_t is_zero(const void *_mem, size_t size) { const unsigned char *mem = (const unsigned char *)_mem; - + while (size-- > 0) if (mem[size]) return FALSE; - + return TRUE; } @@ -1714,10 +1714,10 @@ is_zero(const void *_mem, size_t size) *------------------------------------------------------------------------- */ -static +static void close_obj(H5G_obj_t1 obj_type, hid_t obj_id) { - + switch (obj_type) { case H5G_GROUP: H5Gclose(obj_id); @@ -1759,7 +1759,7 @@ static int diff_region(hid_t region1_id, hid_t region2_id) #if defined (H5DIFF_DEBUG) int i; #endif - + /* * These two functions fail if the region does not have blocks or points, * respectively. They do not currently know how to translate from one to @@ -1775,9 +1775,9 @@ static int diff_region(hid_t region1_id, hid_t region2_id) if (nblocks1!=nblocks2 || npoints1!=npoints2 || ndims1!=ndims2) return 1; - + /* compare block information */ - if (nblocks1 > 0) + if (nblocks1 > 0) { alloc_size = nblocks1 * ndims1 * 2 * sizeof(ptdata1[0]); @@ -1794,30 +1794,30 @@ static int diff_region(hid_t region1_id, hid_t region2_id) ret=HDmemcmp(ptdata1,ptdata2,(size_t)alloc_size); #if defined (H5DIFF_DEBUG) - for (i = 0; i < nblocks1; i++) + for (i = 0; i < nblocks1; i++) { int j; - + /* start coordinates and opposite corner */ for (j = 0; j < ndims1; j++) printf("%s%lu", j ? "," : "(", (unsigned long)ptdata1[i * 2 * ndims1 + j]); - + for (j = 0; j < ndims1; j++) printf("%s%lu", j ? "," : ")-(", (unsigned long)ptdata1[i * 2 * ndims1 + j + ndims1]); - + printf(")\n"); } -#endif - - +#endif + + HDfree(ptdata1); HDfree(ptdata2); } - + /* Print point information */ - if (npoints1 > 0) + if (npoints1 > 0) { alloc_size = npoints1 * ndims1 * sizeof(ptdata1[0]); assert(alloc_size == (hsize_t)((size_t)alloc_size)); /*check for overflow*/ @@ -1829,30 +1829,30 @@ static int diff_region(hid_t region1_id, hid_t region2_id) ptdata2 = malloc((size_t)alloc_size); H5_CHECK_OVERFLOW(npoints1,hssize_t,hsize_t); H5Sget_select_elem_pointlist(region2_id, (hsize_t)0, (hsize_t)npoints2, ptdata2); - + ret=HDmemcmp(ptdata1,ptdata2,(size_t)alloc_size); #if defined (H5DIFF_DEBUG) - for (i = 0; i < npoints1; i++) + for (i = 0; i < npoints1; i++) { int j; - + printf("%sPt%lu: " , i ? "," : "", (unsigned long)i); - + for (j = 0; j < ndims1; j++) printf("%s%lu", j ? "," : "(", (unsigned long)(ptdata1[i * ndims1 + j])); - + printf(")"); } -#endif - +#endif + HDfree(ptdata1); HDfree(ptdata2); } - + return ret; } @@ -1870,33 +1870,33 @@ static int diff_region(hid_t region1_id, hid_t region2_id) hsize_t diff_float(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph) - + { hsize_t nfound=0; /* number of differences found */ float temp1_float; float temp2_float; hsize_t i; - - + + /* -d and !-p */ if (options->d && !options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_float, mem1, sizeof(float)); memcpy(&temp2_float, mem2, sizeof(float)); - + if (fabs(temp1_float-temp2_float) > options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1910,19 +1910,19 @@ hsize_t diff_float(unsigned char *mem1, return nfound; } } - + /* !-d and -p */ else if (!options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_float, mem1, sizeof(float)); memcpy(&temp2_float, mem2, sizeof(float)); - + if ( temp1_float!=0 && fabs(1-temp2_float/temp1_float) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1936,21 +1936,21 @@ hsize_t diff_float(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - } - + } + /* -d and -p */ else if ( options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_float, mem1, sizeof(float)); memcpy(&temp2_float, mem2, sizeof(float)); - - if ( temp1_float!=0 && fabs(1-temp2_float/temp1_float) > options->percent && + + if ( temp1_float!=0 && fabs(1-temp2_float/temp1_float) > options->percent && fabs(temp1_float-temp2_float) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1964,18 +1964,18 @@ hsize_t diff_float(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - } - else + } + else { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_float, mem1, sizeof(float)); memcpy(&temp2_float, mem2, sizeof(float)); - + if (temp1_float != temp2_float) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -1983,15 +1983,15 @@ hsize_t diff_float(unsigned char *mem1, } nfound++; } - + mem1+=sizeof(float); mem2+=sizeof(float); if (options->n && nfound>=options->count) return nfound; } /* nelmts */ - + } - + return nfound; } @@ -2009,34 +2009,34 @@ hsize_t diff_float(unsigned char *mem1, hsize_t diff_double(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph) - + { hsize_t nfound=0; /* number of differences found */ double temp1_double; double temp2_double; hsize_t i; - - + + /* -d and !-p */ if (options->d && !options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_double, mem1, sizeof(double)); memcpy(&temp2_double, mem2, sizeof(double)); - + if (fabs(temp1_double-temp2_double) > options->delta) { - - if ( print_data(options) ) + + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2050,19 +2050,19 @@ hsize_t diff_double(unsigned char *mem1, return nfound; } } - + /* !-d and -p */ else if (!options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_double, mem1, sizeof(double)); memcpy(&temp2_double, mem2, sizeof(double)); - + if ( temp1_double!=0 && fabs(1-temp2_double/temp1_double) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2076,21 +2076,21 @@ hsize_t diff_double(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - } - + } + /* -d and -p */ else if ( options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_double, mem1, sizeof(double)); memcpy(&temp2_double, mem2, sizeof(double)); - - if ( temp1_double!=0 && fabs(1-temp2_double/temp1_double) > options->percent && + + if ( temp1_double!=0 && fabs(1-temp2_double/temp1_double) > options->percent && fabs(temp1_double-temp2_double) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2104,18 +2104,18 @@ hsize_t diff_double(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - } - else + } + else { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_double, mem1, sizeof(double)); memcpy(&temp2_double, mem2, sizeof(double)); - + if (temp1_double != temp2_double) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2123,15 +2123,15 @@ hsize_t diff_double(unsigned char *mem1, } nfound++; } - + mem1+=sizeof(double); mem2+=sizeof(double); if (options->n && nfound>=options->count) return nfound; } /* nelmts */ - + } - + return nfound; } @@ -2150,33 +2150,33 @@ hsize_t diff_double(unsigned char *mem1, hsize_t diff_schar(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph) - + { hsize_t nfound=0; /* number of differences found */ char temp1_char; char temp2_char; hsize_t i; - - + + /* -d and !-p */ if (options->d && !options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_char, mem1, sizeof(char)); memcpy(&temp2_char, mem2, sizeof(char)); - + if (abs(temp1_char-temp2_char) > options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2190,19 +2190,19 @@ hsize_t diff_schar(unsigned char *mem1, return nfound; } } - + /* !-d and -p */ else if (!options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_char, mem1, sizeof(char)); memcpy(&temp2_char, mem2, sizeof(char)); - + if ( temp1_char!=0 && abs(1-temp2_char/temp1_char) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2216,21 +2216,21 @@ hsize_t diff_schar(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - } - + } + /* -d and -p */ else if ( options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_char, mem1, sizeof(char)); memcpy(&temp2_char, mem2, sizeof(char)); - - if ( temp1_char!=0 && abs(1-temp2_char/temp1_char) > options->percent && + + if ( temp1_char!=0 && abs(1-temp2_char/temp1_char) > options->percent && abs(temp1_char-temp2_char) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2244,19 +2244,19 @@ hsize_t diff_schar(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - - } - else + + } + else { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_char, mem1, sizeof(char)); memcpy(&temp2_char, mem2, sizeof(char)); - + if (temp1_char != temp2_char) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2264,15 +2264,15 @@ hsize_t diff_schar(unsigned char *mem1, } nfound++; } - + mem1+=sizeof(char); mem2+=sizeof(char); if (options->n && nfound>=options->count) return nfound; } /* nelmts */ - + } - + return nfound; } @@ -2290,33 +2290,33 @@ hsize_t diff_schar(unsigned char *mem1, hsize_t diff_uchar(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph) - + { hsize_t nfound=0; /* number of differences found */ unsigned char temp1_uchar; unsigned char temp2_uchar; hsize_t i; - - + + /* -d and !-p */ if (options->d && !options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); - + if (abs(temp1_uchar-temp2_uchar) > options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2329,21 +2329,21 @@ hsize_t diff_uchar(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - + } - + /* !-d and -p */ else if (!options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); - + if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2357,21 +2357,21 @@ hsize_t diff_uchar(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - } - + } + /* -d and -p */ else if ( options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); - - if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > options->percent && + + if ( temp1_uchar!=0 && abs(1-temp2_uchar/temp1_uchar) > options->percent && abs(temp1_uchar-temp2_uchar) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2385,19 +2385,19 @@ hsize_t diff_uchar(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - - } - else + + } + else { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); - + if (temp1_uchar != temp2_uchar) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2405,15 +2405,15 @@ hsize_t diff_uchar(unsigned char *mem1, } nfound++; } - + mem1+=sizeof(unsigned char); mem2+=sizeof(unsigned char); if (options->n && nfound>=options->count) return nfound; } /* nelmts */ - + } - + return nfound; } @@ -2432,33 +2432,33 @@ hsize_t diff_uchar(unsigned char *mem1, hsize_t diff_short(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph) - + { hsize_t nfound=0; /* number of differences found */ short temp1_short; short temp2_short; hsize_t i; - - + + /* -d and !-p */ if (options->d && !options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_short, mem1, sizeof(short)); memcpy(&temp2_short, mem2, sizeof(short)); - + if (abs(temp1_short-temp2_short) > options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2471,21 +2471,21 @@ hsize_t diff_short(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - + } - + /* !-d and -p */ else if (!options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_short, mem1, sizeof(short)); memcpy(&temp2_short, mem2, sizeof(short)); - + if ( temp1_short!=0 && abs(1-temp2_short/temp1_short) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2499,23 +2499,23 @@ hsize_t diff_short(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - - - } - + + + } + /* -d and -p */ else if ( options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_short, mem1, sizeof(short)); memcpy(&temp2_short, mem2, sizeof(short)); - - if ( temp1_short!=0 && abs(1-temp2_short/temp1_short) > options->percent && + + if ( temp1_short!=0 && abs(1-temp2_short/temp1_short) > options->percent && abs(temp1_short-temp2_short) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2529,19 +2529,19 @@ hsize_t diff_short(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - - } - else + + } + else { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_short, mem1, sizeof(short)); memcpy(&temp2_short, mem2, sizeof(short)); - + if (temp1_short != temp2_short) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2549,15 +2549,15 @@ hsize_t diff_short(unsigned char *mem1, } nfound++; } - + mem1+=sizeof(short); mem2+=sizeof(short); if (options->n && nfound>=options->count) return nfound; } /* nelmts */ - + } - + return nfound; } @@ -2574,33 +2574,33 @@ hsize_t diff_short(unsigned char *mem1, hsize_t diff_ushort(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph) - + { hsize_t nfound=0; /* number of differences found */ unsigned short temp1_ushort; unsigned short temp2_ushort; hsize_t i; - - + + /* -d and !-p */ if (options->d && !options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_ushort, mem1, sizeof(unsigned short)); memcpy(&temp2_ushort, mem2, sizeof(unsigned short)); - + if (abs(temp1_ushort-temp2_ushort) > options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2613,21 +2613,21 @@ hsize_t diff_ushort(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - + } - + /* !-d and -p */ else if (!options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_ushort, mem1, sizeof(unsigned short)); memcpy(&temp2_ushort, mem2, sizeof(unsigned short)); - + if ( temp1_ushort!=0 && abs(1-temp2_ushort/temp1_ushort) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2641,23 +2641,23 @@ hsize_t diff_ushort(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - - - } - + + + } + /* -d and -p */ else if ( options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_ushort, mem1, sizeof(unsigned short)); memcpy(&temp2_ushort, mem2, sizeof(unsigned short)); - - if ( temp1_ushort!=0 && abs(1-temp2_ushort/temp1_ushort) > options->percent && + + if ( temp1_ushort!=0 && abs(1-temp2_ushort/temp1_ushort) > options->percent && abs(temp1_ushort-temp2_ushort) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2671,19 +2671,19 @@ hsize_t diff_ushort(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - - } - else + + } + else { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_ushort, mem1, sizeof(unsigned short)); memcpy(&temp2_ushort, mem2, sizeof(unsigned short)); - + if (temp1_ushort != temp2_ushort) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2691,15 +2691,15 @@ hsize_t diff_ushort(unsigned char *mem1, } nfound++; } - + mem1+=sizeof(unsigned short); mem2+=sizeof(unsigned short); if (options->n && nfound>=options->count) return nfound; } /* nelmts */ - + } - + return nfound; } @@ -2717,33 +2717,33 @@ hsize_t diff_ushort(unsigned char *mem1, hsize_t diff_int(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph) - + { hsize_t nfound=0; /* number of differences found */ int temp1_int; int temp2_int; hsize_t i; - - + + /* -d and !-p */ if (options->d && !options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_int, mem1, sizeof(int)); memcpy(&temp2_int, mem2, sizeof(int)); - + if (abs(temp1_int-temp2_int) > options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2756,21 +2756,21 @@ hsize_t diff_int(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - + } - + /* !-d and -p */ else if (!options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_int, mem1, sizeof(int)); memcpy(&temp2_int, mem2, sizeof(int)); - + if ( temp1_int!=0 && abs(1-temp2_int/temp1_int) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2784,23 +2784,23 @@ hsize_t diff_int(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - - - } - + + + } + /* -d and -p */ else if ( options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_int, mem1, sizeof(int)); memcpy(&temp2_int, mem2, sizeof(int)); - - if ( temp1_int!=0 && abs(1-temp2_int/temp1_int) > options->percent && + + if ( temp1_int!=0 && abs(1-temp2_int/temp1_int) > options->percent && abs(temp1_int-temp2_int) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2814,19 +2814,19 @@ hsize_t diff_int(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - - } - else + + } + else { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_int, mem1, sizeof(int)); memcpy(&temp2_int, mem2, sizeof(int)); - + if (temp1_int != temp2_int) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2834,15 +2834,15 @@ hsize_t diff_int(unsigned char *mem1, } nfound++; } - + mem1+=sizeof(int); mem2+=sizeof(int); if (options->n && nfound>=options->count) return nfound; } /* nelmts */ - + } - + return nfound; } @@ -2860,33 +2860,33 @@ hsize_t diff_int(unsigned char *mem1, hsize_t diff_uint(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph) - + { hsize_t nfound=0; /* number of differences found */ unsigned int temp1_uint; unsigned int temp2_uint; hsize_t i; - - + + /* -d and !-p */ if (options->d && !options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_uint, mem1, sizeof(unsigned int)); memcpy(&temp2_uint, mem2, sizeof(unsigned int)); - + if (abs(temp1_uint-temp2_uint) > options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2899,21 +2899,21 @@ hsize_t diff_uint(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - + } - + /* !-d and -p */ else if (!options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_uint, mem1, sizeof(unsigned int)); memcpy(&temp2_uint, mem2, sizeof(unsigned int)); - + if ( temp1_uint!=0 && abs(1-temp2_uint/temp1_uint) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2927,23 +2927,23 @@ hsize_t diff_uint(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - - - } - + + + } + /* -d and -p */ else if ( options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_uint, mem1, sizeof(unsigned int)); memcpy(&temp2_uint, mem2, sizeof(unsigned int)); - - if ( temp1_uint!=0 && abs(1-temp2_uint/temp1_uint) > options->percent && + + if ( temp1_uint!=0 && abs(1-temp2_uint/temp1_uint) > options->percent && abs(temp1_uint-temp2_uint) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2957,19 +2957,19 @@ hsize_t diff_uint(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - - } - else + + } + else { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_uint, mem1, sizeof(unsigned int)); memcpy(&temp2_uint, mem2, sizeof(unsigned int)); - + if (temp1_uint != temp2_uint) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -2977,15 +2977,15 @@ hsize_t diff_uint(unsigned char *mem1, } nfound++; } - + mem1+=sizeof(unsigned int); mem2+=sizeof(unsigned int); if (options->n && nfound>=options->count) return nfound; } /* nelmts */ - + } - + return nfound; } @@ -3003,33 +3003,33 @@ hsize_t diff_uint(unsigned char *mem1, hsize_t diff_long(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph) - + { hsize_t nfound=0; /* number of differences found */ long temp1_long; long temp2_long; hsize_t i; - - + + /* -d and !-p */ if (options->d && !options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_long, mem1, sizeof(long)); memcpy(&temp2_long, mem2, sizeof(long)); - + if (labs(temp1_long-temp2_long) > (long)options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -3042,21 +3042,21 @@ hsize_t diff_long(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - + } - + /* !-d and -p */ else if (!options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_long, mem1, sizeof(long)); memcpy(&temp2_long, mem2, sizeof(long)); - + if ( temp1_long!=0 && labs(1-temp2_long/temp1_long) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -3070,23 +3070,23 @@ hsize_t diff_long(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - - - } - + + + } + /* -d and -p */ else if ( options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_long, mem1, sizeof(long)); memcpy(&temp2_long, mem2, sizeof(long)); - - if ( temp1_long!=0 && labs(1-temp2_long/temp1_long) > options->percent && + + if ( temp1_long!=0 && labs(1-temp2_long/temp1_long) > options->percent && labs(temp1_long-temp2_long) > (long)options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -3100,19 +3100,19 @@ hsize_t diff_long(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - - } - else + + } + else { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_long, mem1, sizeof(long)); memcpy(&temp2_long, mem2, sizeof(long)); - + if (temp1_long != temp2_long) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -3120,15 +3120,15 @@ hsize_t diff_long(unsigned char *mem1, } nfound++; } - + mem1+=sizeof(long); mem2+=sizeof(long); if (options->n && nfound>=options->count) return nfound; } /* nelmts */ - + } - + return nfound; } @@ -3146,33 +3146,33 @@ hsize_t diff_long(unsigned char *mem1, hsize_t diff_ulong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph) - + { hsize_t nfound=0; /* number of differences found */ unsigned long temp1_ulong; unsigned long temp2_ulong; hsize_t i; - - + + /* -d and !-p */ if (options->d && !options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_ulong, mem1, sizeof(unsigned long)); memcpy(&temp2_ulong, mem2, sizeof(unsigned long)); - + if (labs((long)(temp1_ulong-temp2_ulong)) > (long)options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -3185,21 +3185,21 @@ hsize_t diff_ulong(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - + } - + /* !-d and -p */ else if (!options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_ulong, mem1, sizeof(unsigned long)); memcpy(&temp2_ulong, mem2, sizeof(unsigned long)); - + if ( temp1_ulong!=0 && labs(1-temp2_ulong/temp1_ulong) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -3213,23 +3213,23 @@ hsize_t diff_ulong(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - - - } - + + + } + /* -d and -p */ else if ( options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_ulong, mem1, sizeof(unsigned long)); memcpy(&temp2_ulong, mem2, sizeof(unsigned long)); - - if ( temp1_ulong!=0 && labs(1-temp2_ulong/temp1_ulong) > options->percent && + + if ( temp1_ulong!=0 && labs(1-temp2_ulong/temp1_ulong) > options->percent && labs(temp1_ulong-temp2_ulong) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -3243,19 +3243,19 @@ hsize_t diff_ulong(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - - } - else + + } + else { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_ulong, mem1, sizeof(unsigned long)); memcpy(&temp2_ulong, mem2, sizeof(unsigned long)); - + if (temp1_ulong != temp2_ulong) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -3263,15 +3263,15 @@ hsize_t diff_ulong(unsigned char *mem1, } nfound++; } - + mem1+=sizeof(unsigned long); mem2+=sizeof(unsigned long); if (options->n && nfound>=options->count) return nfound; } /* nelmts */ - + } - + return nfound; } @@ -3289,14 +3289,14 @@ hsize_t diff_ulong(unsigned char *mem1, hsize_t diff_llong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph) - + { hsize_t nfound=0; /* number of differences found */ long_long temp1_llong; @@ -3307,25 +3307,25 @@ hsize_t diff_llong(unsigned char *mem1, if (!fmt_llong[0]) { /* build default formats for long long types */ - sprintf(fmt_llong, "%%%sd %%%sd %%%sd\n", + sprintf(fmt_llong, "%%%sd %%%sd %%%sd\n", H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH); - sprintf(fmt_llongp, "%%%sd %%%sd %%%sd %%%sd\n", + sprintf(fmt_llongp, "%%%sd %%%sd %%%sd %%%sd\n", H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH); } - - + + /* -d and !-p */ if (options->d && !options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_llong, mem1, sizeof(long_long)); memcpy(&temp2_llong, mem2, sizeof(long_long)); - + if (labs( (long) (temp1_llong-temp2_llong)) > options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -3338,21 +3338,21 @@ hsize_t diff_llong(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - + } - + /* !-d and -p */ else if (!options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_llong, mem1, sizeof(long_long)); memcpy(&temp2_llong, mem2, sizeof(long_long)); - + if ( temp1_llong!=0 && labs((long)(1-temp2_llong/temp1_llong)) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -3366,23 +3366,23 @@ hsize_t diff_llong(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - - - } - + + + } + /* -d and -p */ else if ( options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_llong, mem1, sizeof(long_long)); memcpy(&temp2_llong, mem2, sizeof(long_long)); - - if ( temp1_llong!=0 && labs((long)(1-temp2_llong/temp1_llong)) > options->percent && + + if ( temp1_llong!=0 && labs((long)(1-temp2_llong/temp1_llong)) > options->percent && labs((long)(temp1_llong-temp2_llong)) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -3396,19 +3396,19 @@ hsize_t diff_llong(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - - } - else + + } + else { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_llong, mem1, sizeof(long_long)); memcpy(&temp2_llong, mem2, sizeof(long_long)); - + if (temp1_llong != temp2_llong) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -3416,15 +3416,15 @@ hsize_t diff_llong(unsigned char *mem1, } nfound++; } - + mem1+=sizeof(long_long); mem2+=sizeof(long_long); if (options->n && nfound>=options->count) return nfound; } /* nelmts */ - + } - + return nfound; } @@ -3442,14 +3442,14 @@ hsize_t diff_llong(unsigned char *mem1, hsize_t diff_ullong(unsigned char *mem1, unsigned char *mem2, hsize_t nelmts, - int rank, - hsize_t *acc, + int rank, + hsize_t *acc, hsize_t *pos, - diff_opt_t *options, - const char *obj1, + diff_opt_t *options, + const char *obj1, const char *obj2, int *ph) - + { hsize_t nfound=0; /* number of differences found */ unsigned long_long temp1_ullong; @@ -3460,25 +3460,25 @@ hsize_t diff_ullong(unsigned char *mem1, if (!fmt_ullong[0]) { /* build default formats for long long types */ - sprintf(fmt_ullong, "%%%su %%%su %%%su\n", + sprintf(fmt_ullong, "%%%su %%%su %%%su\n", H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH); - sprintf(fmt_ullongp, "%%%su %%%su %%%su %%%su\n", + sprintf(fmt_ullongp, "%%%su %%%su %%%su %%%su\n", H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH); } - - + + /* -d and !-p */ if (options->d && !options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_ullong, mem1, sizeof(unsigned long_long)); memcpy(&temp2_ullong, mem2, sizeof(unsigned long_long)); - + if (labs((long)(temp1_ullong-temp2_ullong)) > options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -3491,21 +3491,21 @@ hsize_t diff_ullong(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - + } - + /* !-d and -p */ else if (!options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_ullong, mem1, sizeof(unsigned long_long)); memcpy(&temp2_ullong, mem2, sizeof(unsigned long_long)); - + if ( temp1_ullong!=0 && labs((long)(1-temp2_ullong/temp1_ullong)) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -3519,23 +3519,23 @@ hsize_t diff_ullong(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - - - } - + + + } + /* -d and -p */ else if ( options->d && options->p) { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_ullong, mem1, sizeof(unsigned long_long)); memcpy(&temp2_ullong, mem2, sizeof(unsigned long_long)); - - if ( temp1_ullong!=0 && labs((long)(1-temp2_ullong/temp1_ullong)) > options->percent && + + if ( temp1_ullong!=0 && labs((long)(1-temp2_ullong/temp1_ullong)) > options->percent && labs((long)(temp1_ullong-temp2_ullong)) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -3549,19 +3549,19 @@ hsize_t diff_ullong(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - - } - else + + } + else { - + for ( i = 0; i < nelmts; i++) { memcpy(&temp1_ullong, mem1, sizeof(unsigned long_long)); memcpy(&temp2_ullong, mem2, sizeof(unsigned long_long)); - + if (temp1_ullong != temp2_ullong) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); @@ -3569,15 +3569,15 @@ hsize_t diff_ullong(unsigned char *mem1, } nfound++; } - + mem1+=sizeof(unsigned long_long); mem2+=sizeof(unsigned long_long); if (options->n && nfound>=options->count) return nfound; } /* nelmts */ - + } - + return nfound; } diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index 60ce814..e1cd395 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -14,19 +14,19 @@ #include "h5tools.h" #include "h5diff.h" -#include "H5private.h" +#include "H5private.h" /*------------------------------------------------------------------------- * Function: diff_attr * - * Purpose: compare attributes located in LOC1_ID and LOC2_ID, which are - * obtained either from + * Purpose: compare attributes located in LOC1_ID and LOC2_ID, which are + * obtained either from * loc_id = H5Gopen( fid, name); * loc_id = H5Dopen( fid, name); * loc_id = H5Topen( fid, name); * - * Return: + * Return: * 0 : no differences found * 1 : differences found * @@ -37,19 +37,19 @@ *------------------------------------------------------------------------- */ -int diff_attr(hid_t loc1_id, - hid_t loc2_id, - const char *path1, - const char *path2, +int diff_attr(hid_t loc1_id, + hid_t loc2_id, + const char *path1, + const char *path2, diff_opt_t *options ) { - hid_t attr1_id=-1; /* attr ID */ - hid_t attr2_id=-1; /* attr ID */ - hid_t space1_id=-1; /* space ID */ - hid_t space2_id=-1; /* space ID */ - hid_t ftype1_id=-1; /* file data type ID */ - hid_t ftype2_id=-1; /* file data type ID */ + hid_t attr1_id=-1; /* attr ID */ + hid_t attr2_id=-1; /* attr ID */ + hid_t space1_id=-1; /* space ID */ + hid_t space2_id=-1; /* space ID */ + hid_t ftype1_id=-1; /* file data type ID */ + hid_t ftype2_id=-1; /* file data type ID */ hid_t mtype1_id=-1; /* memory data type ID */ hid_t mtype2_id=-1; /* memory data type ID */ size_t msize1; /* memory size of memory type */ @@ -68,40 +68,40 @@ int diff_attr(hid_t loc1_id, hsize_t nfound; int cmp=1; - if ((n1 = H5Aget_num_attrs(loc1_id))<0) + if ((n1 = H5Aget_num_attrs(loc1_id))<0) goto error; - if ((n2 = H5Aget_num_attrs(loc2_id))<0) + if ((n2 = H5Aget_num_attrs(loc2_id))<0) goto error; if (n1!=n2) return 1; - + for ( i = 0; i < n1; i++) { /* reset buffers for every attribute, we might goto out and call free */ - buf1=NULL; - buf2=NULL; + buf1=NULL; + buf2=NULL; /*------------------------------------------------------------------------- * open *------------------------------------------------------------------------- */ /* open attribute */ - if ((attr1_id = H5Aopen_idx(loc1_id, (unsigned)i))<0) + if ((attr1_id = H5Aopen_idx(loc1_id, (unsigned)i))<0) goto error; - if ((attr2_id = H5Aopen_idx(loc2_id, (unsigned)i))<0) + if ((attr2_id = H5Aopen_idx(loc2_id, (unsigned)i))<0) goto error; - + /* get name */ - if (H5Aget_name( attr1_id, 255, name1 )<0) + if (H5Aget_name( attr1_id, 255, name1 )<0) goto error; - if (H5Aget_name( attr2_id, 255, name2 )<0) + if (H5Aget_name( attr2_id, 255, name2 )<0) goto error; if (HDstrcmp(name1,name2)!=0) { - if (options->m_verbose) + if (options->m_verbose) { printf("Different name for attributes: <%s> and <%s>\n", name1, name2); } @@ -110,19 +110,19 @@ int diff_attr(hid_t loc1_id, ret=1; continue; } - + /* get the file datatype */ if ((ftype1_id = H5Aget_type( attr1_id )) < 0 ) goto error; if ((ftype2_id = H5Aget_type( attr2_id )) < 0 ) goto error; - + /* get the dataspace handle */ if ((space1_id = H5Aget_space( attr1_id )) < 0 ) goto error; if ((space2_id = H5Aget_space( attr2_id )) < 0 ) goto error; - + /* get dimensions */ if ( (rank1 = H5Sget_simple_extent_dims(space1_id, dims1, NULL)) < 0 ) goto error; @@ -135,33 +135,33 @@ int diff_attr(hid_t loc1_id, *------------------------------------------------------------------------- */ - if (diff_can_type(ftype1_id, - ftype2_id, - rank1, + if (diff_can_type(ftype1_id, + ftype2_id, + rank1, rank2, - dims1, + dims1, dims2, - NULL, NULL, - name1, - name2, + NULL, + name1, + name2, options)!=1) cmp=0; /*------------------------------------------------------------------------- - * only attempt to compare if possible + * only attempt to compare if possible *------------------------------------------------------------------------- */ - if (cmp) + if (cmp) { - + /*------------------------------------------------------------------------- * read to memory *------------------------------------------------------------------------- */ nelmts1=1; - for (j=0; jm_verbose) { - printf( "Attribute: <%s> and <%s>\n",name1,name2); - nfound = diff_array(buf1, + printf( "Attribute: <%s> and <%s>\n",name1,name2); + nfound = diff_array(buf1, buf2, nelmts1, rank1, @@ -210,7 +210,7 @@ int diff_attr(hid_t loc1_id, attr1_id, attr2_id); print_found(nfound); - + } /* check first if we have differences */ else @@ -219,7 +219,7 @@ int diff_attr(hid_t loc1_id, { /* shut up temporarily */ options->m_quiet=1; - nfound = diff_array(buf1, + nfound = diff_array(buf1, buf2, nelmts1, rank1, @@ -232,10 +232,10 @@ int diff_attr(hid_t loc1_id, attr2_id); /* print again */ options->m_quiet=0; - if (nfound) + if (nfound) { - printf( "Attribute: <%s> and <%s>\n",name1,name2); - nfound = diff_array(buf1, + printf( "Attribute: <%s> and <%s>\n",name1,name2); + nfound = diff_array(buf1, buf2, nelmts1, rank1, @@ -252,7 +252,7 @@ int diff_attr(hid_t loc1_id, /* in quiet mode, just count differences */ else { - nfound = diff_array(buf1, + nfound = diff_array(buf1, buf2, nelmts1, rank1, @@ -287,7 +287,7 @@ int diff_attr(hid_t loc1_id, if (buf2) HDfree(buf2); } /* i */ - + return ret; error: @@ -305,7 +305,7 @@ error: if (buf2) HDfree(buf2); } H5E_END_TRY; - + options->err_stat=1; return 0; } diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index a9cdb60..543ed6b 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -13,13 +13,13 @@ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ #include "h5diff.h" -#include "H5private.h" +#include "H5private.h" #include "h5tools.h" /*------------------------------------------------------------------------- * Function: diff_dataset * - * Purpose: check for comparable datasets and read into a compatible + * Purpose: check for comparable datasets and read into a compatible * memory type * * Return: Number of differences found @@ -30,10 +30,10 @@ * *------------------------------------------------------------------------- */ -hsize_t diff_dataset( hid_t file1_id, - hid_t file2_id, - const char *obj1_name, - const char *obj2_name, +hsize_t diff_dataset( hid_t file1_id, + hid_t file2_id, + const char *obj1_name, + const char *obj2_name, diff_opt_t *options ) { hid_t dset1_id=-1; @@ -63,20 +63,20 @@ hsize_t diff_dataset( hid_t file1_id, } H5E_END_TRY; - if ((dcpl1_id=H5Dget_create_plist(dset1_id))<0) + if ((dcpl1_id=H5Dget_create_plist(dset1_id))<0) goto error; - if ((dcpl2_id=H5Dget_create_plist(dset2_id))<0) + if ((dcpl2_id=H5Dget_create_plist(dset2_id))<0) goto error; /*------------------------------------------------------------------------- - * check if the dataset creation property list has filters that - * are not registered in the current configuration + * check if the dataset creation property list has filters that + * are not registered in the current configuration * 1) the external filters GZIP and SZIP might not be available * 2) the internal filters might be turned off *------------------------------------------------------------------------- */ if ((h5tools_canreadf((options->m_verbose?obj1_name:NULL),dcpl1_id)==1) && - (h5tools_canreadf((options->m_verbose?obj2_name:NULL),dcpl2_id)==1)) + (h5tools_canreadf((options->m_verbose?obj2_name:NULL),dcpl2_id)==1)) { nfound=diff_datasetid(dset1_id, dset2_id, @@ -96,7 +96,7 @@ hsize_t diff_dataset( hid_t file1_id, H5Dclose(dset2_id); /* enable error reporting */ } H5E_END_TRY; - + return nfound; error: @@ -109,7 +109,7 @@ error: H5Dclose(dset2_id); /* enable error reporting */ } H5E_END_TRY; - + return nfound; } @@ -120,7 +120,7 @@ error: /*------------------------------------------------------------------------- * Function: diff_datasetid * - * Purpose: check for comparable datasets and read into a compatible + * Purpose: check for comparable datasets and read into a compatible * memory type * * Return: Number of differences found @@ -131,19 +131,19 @@ error: * *------------------------------------------------------------------------- */ -hsize_t diff_datasetid( hid_t dset1_id, - hid_t dset2_id, - const char *obj1_name, - const char *obj2_name, +hsize_t diff_datasetid( hid_t dset1_id, + hid_t dset2_id, + const char *obj1_name, + const char *obj2_name, diff_opt_t *options ) { hid_t space1_id =-1; hid_t space2_id =-1; - hid_t f_type1=-1, f_type2=-1; /* file data type */ + hid_t f_type1=-1, f_type2=-1; /* file data type */ hid_t m_type1=-1, m_type2=-1; /* memory data type */ size_t m_size1, m_size2; /* size of type in memory */ H5T_sign_t sign1, sign2; /* sign of type */ - int rank1, rank2; + int rank1, rank2; void *buf1=NULL, *buf2=NULL; hsize_t nelmts1, nelmts2; hsize_t dims1[H5S_MAX_RANK]; @@ -183,7 +183,7 @@ hsize_t diff_datasetid( hid_t dset1_id, goto error; /*------------------------------------------------------------------------- - * Get the file data type + * Get the file data type *------------------------------------------------------------------------- */ @@ -205,7 +205,7 @@ hsize_t diff_datasetid( hid_t dset1_id, storage_size2=H5Dget_storage_size(dset2_id); if (storage_size1<=0 && storage_size2<=0) { - if (options->m_verbose && obj1_name && obj2_name) + if (options->m_verbose && obj1_name && obj2_name) printf("<%s> and <%s> are empty datasets\n", obj1_name, obj2_name); cmp=0; } @@ -216,16 +216,16 @@ hsize_t diff_datasetid( hid_t dset1_id, *------------------------------------------------------------------------- */ - if (diff_can_type(f_type1, - f_type2, - rank1, + if (diff_can_type(f_type1, + f_type2, + rank1, rank2, - dims1, + dims1, dims2, - maxdim1, + maxdim1, maxdim2, - obj1_name, - obj2_name, + obj1_name, + obj2_name, options)!=1) cmp=0; /*------------------------------------------------------------------------- @@ -233,13 +233,13 @@ hsize_t diff_datasetid( hid_t dset1_id, *------------------------------------------------------------------------- */ nelmts1 = 1; - for (i = 0; i < rank1; i++) + for (i = 0; i < rank1; i++) { nelmts1 *= dims1[i]; } - + nelmts2 = 1; - for (i = 0; i < rank2; i++) + for (i = 0; i < rank2; i++) { nelmts2 *= dims2[i]; } @@ -251,7 +251,7 @@ hsize_t diff_datasetid( hid_t dset1_id, *------------------------------------------------------------------------- */ - if ( (H5Tequal(f_type1, f_type2)==0) && options->m_verbose && obj1_name) + if ( (H5Tequal(f_type1, f_type2)==0) && options->m_verbose && obj1_name) { printf("Warning: Different storage datatype\n"); printf("<%s> has file datatype ", obj1_name); @@ -278,7 +278,7 @@ hsize_t diff_datasetid( hid_t dset1_id, #if defined (H5DIFF_DEBUG) if (obj1_name) print_sizes(obj1_name,obj2_name,f_type1,f_type2,m_type1,m_type2); -#endif +#endif /*------------------------------------------------------------------------- * check for different signed/unsigned types @@ -297,7 +297,7 @@ hsize_t diff_datasetid( hid_t dset1_id, } /*------------------------------------------------------------------------- - * "upgrade" the smaller memory size + * "upgrade" the smaller memory size *------------------------------------------------------------------------- */ @@ -325,15 +325,15 @@ hsize_t diff_datasetid( hid_t dset1_id, printf("WARNING: Size was upgraded\n"); if (obj1_name) print_sizes(obj1_name,obj2_name,f_type1,f_type2,m_type1,m_type2); -#endif +#endif } assert(m_size1==m_size2); /*------------------------------------------------------------------------- - * only attempt to compare if possible + * only attempt to compare if possible *------------------------------------------------------------------------- */ - if (cmp) + if (cmp) { buf1 = (void *) HDmalloc((unsigned) (nelmts1*m_size1)); @@ -366,7 +366,7 @@ hsize_t diff_datasetid( hid_t dset1_id, if (obj2_name!=NULL) name2=diff_basename(obj2_name); - nfound = diff_array(buf1, + nfound = diff_array(buf1, buf2, nelmts1, rank1, @@ -392,8 +392,8 @@ hsize_t diff_datasetid( hid_t dset1_id, * close *------------------------------------------------------------------------- */ - - + + if ( buf1) HDfree(buf1); if ( buf2) HDfree(buf2); /* close */ @@ -407,7 +407,7 @@ hsize_t diff_datasetid( hid_t dset1_id, H5Tclose(m_type2); /* enable error reporting */ } H5E_END_TRY; - + return nfound; error: @@ -425,7 +425,7 @@ error: H5Tclose(m_type2); /* enable error reporting */ } H5E_END_TRY; - + return nfound; } @@ -434,7 +434,7 @@ error: * * Purpose: check for comparable TYPE and SPACE * - * Return: + * Return: * 1, can compare * 0, cannot compare * -1, error @@ -446,20 +446,20 @@ error: *------------------------------------------------------------------------- */ -int diff_can_type( hid_t f_type1, /* file data type */ +int diff_can_type( hid_t f_type1, /* file data type */ hid_t f_type2, /* file data type */ - int rank1, + int rank1, int rank2, - hsize_t *dims1, + hsize_t *dims1, hsize_t *dims2, - hsize_t *maxdim1, + hsize_t *maxdim1, hsize_t *maxdim2, - const char *obj1_name, - const char *obj2_name, + const char *obj1_name, + const char *obj2_name, diff_opt_t *options ) { - - + + H5T_class_t tclass1; H5T_class_t tclass2; int maxdim_diff=0; /* maximum dimensions are different */ @@ -467,21 +467,21 @@ int diff_can_type( hid_t f_type1, /* file data type */ int i; /*------------------------------------------------------------------------- - * check for the same class + * check for the same class *------------------------------------------------------------------------- */ - if ((tclass1=H5Tget_class(f_type1))<0) + if ((tclass1=H5Tget_class(f_type1))<0) return -1; - if ((tclass2=H5Tget_class(f_type2))<0) + if ((tclass2=H5Tget_class(f_type2))<0) return -1; if ( tclass1 != tclass2 ) { if (options->m_verbose && obj1_name) { - printf("Comparison not possible: <%s> is of class %s and <%s> is of class %s\n", - obj1_name, get_class(tclass1), + printf("Comparison not possible: <%s> is of class %s and <%s> is of class %s\n", + obj1_name, get_class(tclass1), obj2_name, get_class(tclass2) ); } return 0; @@ -493,7 +493,7 @@ int diff_can_type( hid_t f_type1, /* file data type */ */ assert(tclass1==tclass2); - switch (tclass1) + switch (tclass1) { case H5T_INTEGER: case H5T_FLOAT: @@ -505,12 +505,12 @@ int diff_can_type( hid_t f_type1, /* file data type */ case H5T_ENUM: case H5T_VLEN: case H5T_REFERENCE: - + break; - + default: /*H5T_TIME */ - if (options->m_verbose && obj1_name ) - printf("Comparison not supported: <%s> and <%s> are of class %s\n", + if (options->m_verbose && obj1_name ) + printf("Comparison not supported: <%s> and <%s> are of class %s\n", obj1_name,obj2_name,get_class(tclass2) ); return 0; } @@ -520,7 +520,7 @@ int diff_can_type( hid_t f_type1, /* file data type */ *------------------------------------------------------------------------- */ - if ( (H5Tequal(f_type1, f_type2)==0) && options->m_verbose && obj1_name) + if ( (H5Tequal(f_type1, f_type2)==0) && options->m_verbose && obj1_name) { printf("Warning: Different storage datatype\n"); printf("<%s> has file datatype ", obj1_name); @@ -535,7 +535,7 @@ int diff_can_type( hid_t f_type1, /* file data type */ * check for the same rank *------------------------------------------------------------------------- */ - + if ( rank1 != rank2 ) { if (options->m_verbose && obj1_name) { @@ -556,9 +556,9 @@ int diff_can_type( hid_t f_type1, /* file data type */ * check for different dimensions *------------------------------------------------------------------------- */ - + assert(rank1==rank2); - for ( i=0; i0 && '/'==name[i-1]) --i; - + /* Skip backward over base name */ while (i>0 && '/'!=name[i-1]) --i; - + return(name+i); } @@ -262,7 +262,7 @@ get_type(int type) return("H5G_LINK"); default: return("user defined type"); - } + } } /*------------------------------------------------------------------------- @@ -274,7 +274,7 @@ get_type(int type) * * Date: May 9, 2003 * - * Comments: + * Comments: * *------------------------------------------------------------------------- */ @@ -289,7 +289,7 @@ get_sign(H5T_sign_t sign) return("H5T_SGN_NONE"); case H5T_SGN_2: return("H5T_SGN_2"); - } + } } @@ -307,7 +307,7 @@ get_sign(H5T_sign_t sign) const char* get_class(H5T_class_t tclass) { - switch (tclass) + switch (tclass) { default: return("Invalid class"); @@ -359,7 +359,7 @@ void print_found(hsize_t nfound) #if defined (H5DIFF_DEBUG) void print_sizes( const char *obj1, const char *obj2, hid_t f_type1, hid_t f_type2, - hid_t m_type1, hid_t m_type2 ) + hid_t m_type1, hid_t m_type2 ) { size_t f_size1, f_size2; /* size of type in file */ size_t m_size1, m_size2; /* size of type in memory */ diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index e47b534..45fb639 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -186,9 +186,9 @@ int UNUSED argc, const char UNUSED *argv[] } else if (!strcmp(driver, drivernames[FAMILY_IDX])) { /* FAMILY Driver */ if((fapl = H5Pcreate(H5P_FILE_ACCESS))>=0) { - /* Set member size to be 0 to indicate the current first member size - * is the member size. - */ + /* Set member size to be 0 to indicate the current first member size + * is the member size. + */ H5Pset_fapl_family(fapl, (hsize_t)0, H5P_DEFAULT); if(drivernum) @@ -391,7 +391,7 @@ static size_t h5tools_ncols(const char *s) { register size_t i; - + for (i = 0; *s; s++) if (*s >= ' ') i++; @@ -416,9 +416,9 @@ h5tools_ncols(const char *s) * If a new prefix is printed then the current element number is set back * to zero. * pvn, 2004-07-08 - * Added support for printing array indices: + * Added support for printing array indices: * the indentation is printed before the prefix (printed one indentation - * level before) + * level before) *------------------------------------------------------------------------- */ static void @@ -429,10 +429,10 @@ h5tools_simple_prefix(FILE *stream, const h5dump_t *info, h5tools_str_t str; /*temporary for indentation */ size_t templength = 0; int i, indentlevel = 0; - + if (!ctx->need_prefix) return; - + memset(&prefix, 0, sizeof(h5tools_str_t)); memset(&str, 0, sizeof(h5tools_str_t)); @@ -585,7 +585,7 @@ h5tools_dump_simple_data(FILE *stream, const h5dump_t *info, hid_t container, } else if ((ctx->prev_prefix_len + h5tools_ncols(s) + strlen(OPT(info->elmt_suf2, " ")) + strlen(OPT(info->line_suf, ""))) <= ncols) { - /* + /* * ...but *could* fit on one line otherwise, then we * should end the current line and start this element on its * own line. @@ -626,7 +626,7 @@ h5tools_dump_simple_data(FILE *stream, const h5dump_t *info, hid_t container, */ if (info->line_per_line > 0 && ctx->cur_elmt >= info->line_per_line) ctx->need_prefix = TRUE; - + /* * Each OPTIONAL_LINE_BREAK embedded in the rendered string can cause * the data to split across multiple lines. We display the sections @@ -664,7 +664,7 @@ h5tools_dump_simple_data(FILE *stream, const h5dump_t *info, hid_t container, fputs(OPT(info->elmt_suf2, " "), stream); ctx->cur_column += strlen(OPT(info->elmt_suf2, " ")); } - + /* Print the section */ fputs(section, stream); ctx->cur_column += strlen(section); @@ -689,7 +689,7 @@ h5tools_dump_simple_data(FILE *stream, const h5dump_t *info, hid_t container, * Bill Wendling, Wednesday, 07. March 2001 * Modifications: *------------------------------------------------------------------------- - */ + */ static herr_t h5tools_dump_simple_subset(FILE *stream, const h5dump_t *info, hid_t dset, hid_t p_type, struct subset_t *sset, @@ -752,10 +752,10 @@ h5tools_dump_simple_subset(FILE *stream, const h5dump_t *info, hid_t dset, for (; count > 0; sset->start[ctx.ndims - 1] += sset->stride[ctx.ndims - 1], count--) { /* calculate the potential number of elements we're going to print */ - H5Sselect_hyperslab(f_space, H5S_SELECT_SET, - sset->start, + H5Sselect_hyperslab(f_space, H5S_SELECT_SET, + sset->start, sset->stride, - sset->count, + sset->count, sset->block); sm_nelmts = H5Sget_select_npoints(f_space); @@ -856,7 +856,7 @@ done: * Robb Matzke, Thursday, July 23, 1998 * Modifications: *------------------------------------------------------------------------- - */ + */ static int h5tools_dump_simple_dset(FILE *stream, const h5dump_t *info, hid_t dset, hid_t p_type, int indentlevel) @@ -880,7 +880,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5dump_t *info, hid_t dset, hsize_t sm_nelmts; /*elements per stripmine*/ unsigned char *sm_buf = NULL; /*buffer for raw data */ hid_t sm_space; /*stripmine data space */ - + /* Hyperslab info */ hsize_t hs_offset[H5S_MAX_RANK];/*starting offset */ hsize_t hs_size[H5S_MAX_RANK]; /*size this pass */ @@ -926,7 +926,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5dump_t *info, hid_t dset, } /* end if */ else ctx.size_last_dim = 0; - + if (p_nelmts == 0) { /* nothing to print */ H5Sclose(f_space); @@ -953,7 +953,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5dump_t *info, hid_t dset, assert(sm_nbytes == (hsize_t)((size_t)sm_nbytes)); /*check for overflow*/ sm_buf = malloc((size_t)sm_nbytes); - + sm_nelmts = sm_nbytes / p_type_nbytes; sm_space = H5Screate_simple(1, &sm_nelmts, NULL); @@ -1024,7 +1024,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5dump_t *info, hid_t dset, H5Sclose(sm_space); H5Sclose(f_space); - + free(sm_buf); return SUCCEED; @@ -1068,7 +1068,7 @@ h5tools_dump_simple_mem(FILE *stream, const h5dump_t *info, hid_t obj_id, ctx.indent_level = indentlevel; ctx.need_prefix = 1; - + /* Assume entire data space to be printed */ for (i = 0; i < ctx.ndims; i++) ctx.p_min_idx[i] = 0; @@ -1077,7 +1077,7 @@ h5tools_dump_simple_mem(FILE *stream, const h5dump_t *info, hid_t obj_id, for (i = 0, nelmts = 1; ctx.ndims != 0 && i < ctx.ndims; i++) nelmts *= ctx.p_max_idx[i] - ctx.p_min_idx[i]; - + if (nelmts == 0) return SUCCEED; /*nothing to print*/ if(ctx.ndims>0) { @@ -1100,7 +1100,7 @@ h5tools_dump_simple_mem(FILE *stream, const h5dump_t *info, hid_t obj_id, putc('\n', stream); fputs(OPT(info->line_sep, ""), stream); } - + return SUCCEED; } @@ -1219,7 +1219,7 @@ h5tools_dump_mem(FILE *stream, const h5dump_t *info, hid_t obj_id, hid_t type, hid_t space, void *mem, int indentlevel) { h5dump_t info_dflt; - + /* Use default values */ if (!stream) stream = stdout; @@ -1255,7 +1255,7 @@ void init_acc_pos(h5tools_context_t *ctx, hsize_t *dims) int i; assert(ctx->ndims); - + ctx->acc[ctx->ndims-1]=1; for(i=(ctx->ndims-2); i>=0; i--) { diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index 0c3633f..7a0109e 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -59,7 +59,7 @@ typedef struct h5dump_t { * fmt_uchar: The printf() format to use when rendering data which is * typed `unsigned char'. The default is `%u'. This format * is used only if the `ascii' field is zero. - * + * * fmt_short: The printf() format to use when rendering data which is * typed `short'. The default is `%d'. * @@ -82,7 +82,7 @@ typedef struct h5dump_t { * * fmt_double: The printf() format to use when rendering data which is * typed `double'. The default is `%g'. - * + * * fmt_float: The printf() format to use when rendering data which is * typed `float'. The default is `%g'. * @@ -142,7 +142,7 @@ typedef struct h5dump_t { const char *arr_sep; const char *arr_suf; int arr_linebreak; - + /* * Fields associated with compound data types. * @@ -161,8 +161,8 @@ typedef struct h5dump_t { * * suf: A string to print at the end of each compound type. The * default is right curly brace. - * - * end: a string to print after we reach the last element of + * + * end: a string to print after we reach the last element of * each compound type. prints out before the suf. */ const char *cmpd_name; @@ -184,8 +184,8 @@ typedef struct h5dump_t { * * suf: A string to print at the end of each vlen type. The * default is a right parentheses. - * - * end: a string to print after we reach the last element of + * + * end: a string to print after we reach the last element of * each compound type. prints out before the suf. */ const char *vlen_sep; @@ -210,7 +210,7 @@ typedef struct h5dump_t { const char *elmt_fmt; const char *elmt_suf1; const char *elmt_suf2; - + /* * Fields associated with the index values printed at the left edge of * each line of output. @@ -231,7 +231,7 @@ typedef struct h5dump_t { const char *idx_n_fmt; /*index number format */ const char *idx_sep; /*separator between numbers */ const char *idx_fmt; /*entire index format */ - + /* * Fields associated with entire lines. * @@ -259,7 +259,7 @@ typedef struct h5dump_t { * suf: This character string will be appended to each line of * output. It should not contain line feeds. The default * is the empty string. - * + * * sep: A character string to be printed after every line feed * defaulting to the empty string. It should end with a * line feed. @@ -282,7 +282,7 @@ typedef struct h5dump_t { * should the following element begin on the next line? The * default is to start the next element on the same line * unless it wouldn't fit. - * + * * indentlevel: a string that shows how far to indent if extra spacing * is needed. dumper uses it. */ diff --git a/tools/lib/h5tools_filters.c b/tools/lib/h5tools_filters.c index 11ebae7..c46e38bf 100644 --- a/tools/lib/h5tools_filters.c +++ b/tools/lib/h5tools_filters.c @@ -28,8 +28,8 @@ static void print_warning(const char *dname, const char *fname) /*------------------------------------------------------------------------- * Function: h5tools_canreadf * - * Purpose: check if the dataset creation property list has filters that - * are not registered in the current configuration + * Purpose: check if the dataset creation property list has filters that + * are not registered in the current configuration * 1) the external filters GZIP and SZIP might not be available * 2) the internal filters might be turned off * @@ -50,7 +50,7 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr int i; /* index */ int have_deflate=0; /* assume initially we do not have filters */ int have_szip=0; - int have_shuffle=0; + int have_shuffle=0; int have_fletcher=0; #ifdef H5_HAVE_FILTER_DEFLATE @@ -67,23 +67,23 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr #endif /* get information about filters */ - if ((nfilters = H5Pget_nfilters(dcpl_id))<0) + if ((nfilters = H5Pget_nfilters(dcpl_id))<0) return -1; /* if we do not have filters, we can read the dataset safely */ if (!nfilters) return 1; - + /* check availability of filters */ - for (i=0; idset_blockformat_pre, i ? "," OPTIONAL_LINE_BREAK " " : "", (unsigned long)i); - + /* Start coordinates and opposite corner */ for (j = 0; j < ndims; j++) h5tools_str_append(str, "%s%lu", j ? "," : "(", @@ -435,7 +435,7 @@ h5tools_str_dump_region(h5tools_str_t *str, hid_t region, const h5dump_t *info) h5tools_str_append(str, info->dset_ptformat_pre , i ? "," OPTIONAL_LINE_BREAK " " : "", (unsigned long)i); - + for (j = 0; j < ndims; j++) h5tools_str_append(str, "%s%lu", j ? "," : "(", (unsigned long)(ptdata[i * ndims + j])); @@ -445,7 +445,7 @@ h5tools_str_dump_region(h5tools_str_t *str, hid_t region, const h5dump_t *info) free(ptdata); } - + h5tools_str_append(str, "}"); return 0; } @@ -523,7 +523,7 @@ h5tools_print_char(h5tools_str_t *str, const h5dump_t *info, unsigned char ch) default: if (isprint(ch)) h5tools_str_append(str, "%c", (char)ch); - else + else h5tools_str_append(str, "\\%03o", ch); break; @@ -596,7 +596,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5dump_t *info, hid_t container, int tempint; unsigned short tempushort; short tempshort; - + /* Build default formats for long long types */ if (!fmt_llong[0]) { sprintf(fmt_llong, "%%%sd", H5_PRINTF_LL_WIDTH); @@ -618,10 +618,10 @@ h5tools_str_sprint(h5tools_str_t *str, const h5dump_t *info, hid_t container, } } } else if (H5Tequal(type, H5T_NATIVE_FLOAT)) { - memcpy(&tempfloat, vp, sizeof(float)); + memcpy(&tempfloat, vp, sizeof(float)); h5tools_str_append(str, OPT(info->fmt_float, "%g"), tempfloat); } else if (H5Tequal(type, H5T_NATIVE_DOUBLE)) { - memcpy(&tempdouble, vp, sizeof(double)); + memcpy(&tempdouble, vp, sizeof(double)); h5tools_str_append(str, OPT(info->fmt_double, "%g"), tempdouble); } else if (info->ascii && (H5Tequal(type, H5T_NATIVE_SCHAR) || H5Tequal(type, H5T_NATIVE_UCHAR))) { @@ -660,7 +660,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5dump_t *info, hid_t container, if (info->str_repeat > 0) while (i + j < size && s[i] == s[i + j]) j++; - + /* * Print the opening quote. If the repeat count is high enough to * warrant printing the number of repeats instead of enumerating @@ -677,10 +677,10 @@ h5tools_str_sprint(h5tools_str_t *str, const h5dump_t *info, hid_t container, quote = '"'; h5tools_str_append(str, "%s%c", i ? " " : "", quote); } - + /* Print the character */ h5tools_print_char(str, info, (unsigned char)(s[i])); - + /* Print the repeat count */ if (info->str_repeat && j > info->str_repeat) { #ifdef REPEAT_VERBOSE @@ -731,7 +731,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5dump_t *info, hid_t container, h5tools_str_append(str, OPT(info->fmt_ullong, fmt_ullong), tempullong); } else if (H5Tequal(type, H5T_NATIVE_HSSIZE)) { if (sizeof(hssize_t) == sizeof(int)) { - memcpy(&tempint, vp, sizeof(int)); + memcpy(&tempint, vp, sizeof(int)); h5tools_str_append(str, OPT(info->fmt_int, "%d"), tempint); } else if (sizeof(hssize_t) == sizeof(long)) { memcpy(&templong, vp, sizeof(long)); @@ -912,7 +912,7 @@ h5tools_str_sprint(h5tools_str_t *str, const h5dump_t *info, hid_t container, temp_nelmts *= dims[k]; assert(temp_nelmts==(hsize_t)((size_t)temp_nelmts)); nelmts = (size_t)temp_nelmts; - } + } /* Print the opening bracket */ h5tools_str_append(str, "%s", OPT(info->arr_pre, "[")); diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index 0573a0d..8029805 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -66,7 +66,7 @@ error_msg(const char *progname, const char *fmt, ...) HDfflush(stdout); HDfprintf(stderr, "%s error: ", progname); HDvfprintf(stderr, fmt, ap); - + va_end(ap); } @@ -298,7 +298,7 @@ print_version(const char *progname) /*------------------------------------------------------------------------- * Function: init_table * - * Purpose: allocate and initialize tables for shared groups, datasets, + * Purpose: allocate and initialize tables for shared groups, datasets, * and committed types * * Return: void @@ -353,7 +353,7 @@ init_prefix(char **prefix, size_t prefix_len) /*------------------------------------------------------------------------- * Function: free_table * - * Purpose: free tables for shared groups, datasets, + * Purpose: free tables for shared groups, datasets, * and committed types * * Return: void @@ -386,7 +386,7 @@ free_table(table_t **table) * *------------------------------------------------------------------------- */ -int +int search_obj(table_t *table, unsigned long *objno) { int i; @@ -394,13 +394,13 @@ search_obj(table_t *table, unsigned long *objno) for (i = 0; i < table->nobjs; i++) if (table->objs[i].objno[0] == *objno && table->objs[i].objno[1] == *(objno + 1)) return i; - + return FAIL; } /*------------------------------------------------------------------------- - * Function: find_objs + * Function: find_objs * * Purpose: Find objects, committed types and store them in tables * @@ -430,7 +430,7 @@ find_objs(hid_t group, const char *name, void *op_data) H5Gget_objinfo(group, name, TRUE, &statbuf); tmp = HDmalloc(HDstrlen(info->prefix) + HDstrlen(name) + 2); - HDstrcpy(tmp, info->prefix); + HDstrcpy(tmp, info->prefix); switch (statbuf.type) { case H5G_GROUP: @@ -445,7 +445,7 @@ find_objs(hid_t group, const char *name, void *op_data) if (statbuf.nlink > info->threshold) { if (search_obj(info->group_table, statbuf.objno) == FAIL) { - add_obj(info->group_table, statbuf.objno, info->prefix); + add_obj(info->group_table, statbuf.objno, info->prefix); H5Giterate(obj, ".", NULL, find_objs, (void *)info); } } else { @@ -468,7 +468,7 @@ find_objs(hid_t group, const char *name, void *op_data) search_obj(info->dset_table, statbuf.objno) == FAIL) add_obj(info->dset_table, statbuf.objno, tmp); - if ((obj = H5Dopen (group, name)) >= 0) { + if ((obj = H5Dopen (group, name)) >= 0) { type = H5Dget_type(obj); if (H5Tcommitted(type) > 0) { @@ -485,7 +485,7 @@ find_objs(hid_t group, const char *name, void *op_data) } else { info->status = 1; } - + break; case H5G_TYPE: @@ -504,9 +504,9 @@ find_objs(hid_t group, const char *name, void *op_data) } else { free(info->type_table->objs[i].objname); info->type_table->objs[i].objname = HDstrdup(tmp); - info->type_table->objs[i].recorded = 1; + info->type_table->objs[i].recorded = 1; - /* named data type */ + /* named data type */ info->type_table->objs[info->type_table->nobjs-1].objflag = 1; } @@ -534,7 +534,7 @@ find_objs(hid_t group, const char *name, void *op_data) * *------------------------------------------------------------------------- */ -void +void dump_table(char* tablename, table_t *table) { int i; diff --git a/tools/lib/h5tools_utils.h b/tools/lib/h5tools_utils.h index 5240050..cd97eab 100644 --- a/tools/lib/h5tools_utils.h +++ b/tools/lib/h5tools_utils.h @@ -60,7 +60,7 @@ enum { * and can have more than one short named option specified at one time: * * -aw80 - * + * * in which case those options which expect an argument need to come at the * end. */ @@ -95,7 +95,7 @@ typedef struct table_t { /*this struct stores the information that is passed to the find_objs function*/ typedef struct find_objs_t { - size_t prefix_len; + size_t prefix_len; char *prefix; unsigned int threshold; /* should be 0 or 1 */ table_t *group_table; diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c index 52916d7..3e76250 100644 --- a/tools/lib/h5trav.c +++ b/tools/lib/h5trav.c @@ -14,29 +14,29 @@ #include "h5trav.h" -#include "H5private.h" +#include "H5private.h" /* functions for traversal */ -int traverse( hid_t loc_id, - const char *group_name, - trav_table_t *table, - trav_info_t *info, +int traverse( hid_t loc_id, + const char *group_name, + trav_table_t *table, + trav_info_t *info, int *idx, int print); -herr_t get_nnames( hid_t loc_id, +herr_t get_nnames( hid_t loc_id, const char *group_name ); -herr_t get_name_type( hid_t loc_id, - const char *group_name, - int idx, - char **name, +herr_t get_name_type( hid_t loc_id, + const char *group_name, + int idx, + char **name, H5G_obj_t1 *type ); /*------------------------------------------------------------------------- * Function: h5trav_getinfo * - * Purpose: get an array of "trav_info_t" , containing the name and type of + * Purpose: get an array of "trav_info_t" , containing the name and type of * objects in the file * * Return: number of object names in file @@ -48,8 +48,8 @@ herr_t get_name_type( hid_t loc_id, *------------------------------------------------------------------------- */ -int h5trav_getinfo(hid_t file_id, - trav_info_t *info, +int h5trav_getinfo(hid_t file_id, + trav_info_t *info, int print ) { @@ -118,7 +118,7 @@ int h5trav_getindex( const char *obj, int nobjs, trav_info_t *info ) int result; int i; - for ( i = 0; i < nobjs; i++) + for ( i = 0; i < nobjs; i++) { if ( strcmp(obj,info[i].name)==0 ) return i; @@ -161,7 +161,7 @@ void h5trav_freeinfo( trav_info_t *info, int nobjs ) /*------------------------------------------------------------------------- * Function: count_names * - * Purpose: operator function + * Purpose: operator function * * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * @@ -186,7 +186,7 @@ static herr_t count_names( hid_t loc_id, const char *name, void *op_data) /* Define a default zero value for return. This will cause the iterator to continue */ return 0; -} +} /*------------------------------------------------------------------------- * Function: get_nnames @@ -197,7 +197,7 @@ static herr_t count_names( hid_t loc_id, const char *name, void *op_data) * * Date: October 10, 2002 * - * Return: + * Return: * Success: The return value of the first operator that * returns non-zero, or zero if all members were * processed with no operator returning non-zero. @@ -209,7 +209,7 @@ static herr_t count_names( hid_t loc_id, const char *name, void *op_data) *------------------------------------------------------------------------- */ -herr_t get_nnames( hid_t loc_id, const char *group_name ) +herr_t get_nnames( hid_t loc_id, const char *group_name ) { int nobjs = 0; @@ -224,7 +224,7 @@ herr_t get_nnames( hid_t loc_id, const char *group_name ) /*------------------------------------------------------------------------- * Function: opget_info * - * Purpose: operator function + * Purpose: operator function * * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * @@ -250,19 +250,19 @@ static herr_t opget_info( hid_t loc_id, const char *name, void *op_data) /* Define 1 for return. This will cause the iterator to stop */ return 1; -} +} /*------------------------------------------------------------------------- * Function: get_name_type * - * Purpose: + * Purpose: * * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * * Date: October 10, 2002 * - * Return: + * Return: * Success: The return value of the first operator that * returns non-zero, or zero if all members were * processed with no operator returning non-zero. @@ -274,18 +274,18 @@ static herr_t opget_info( hid_t loc_id, const char *name, void *op_data) *------------------------------------------------------------------------- */ -herr_t get_name_type( hid_t loc_id, - const char *group_name, - int idx, - char **name, - H5G_obj_t1 *type ) +herr_t get_name_type( hid_t loc_id, + const char *group_name, + int idx, + char **name, + H5G_obj_t1 *type ) { trav_info_t info; if (H5Giterate( loc_id, group_name, &idx, opget_info, (void *)&info) < 0 ) return -1; - + *name = info.name; *type = info.type; @@ -306,14 +306,14 @@ herr_t get_name_type( hid_t loc_id, *------------------------------------------------------------------------- */ -int traverse( hid_t loc_id, - const char *group_name, - trav_table_t *table, - trav_info_t *info, +int traverse( hid_t loc_id, + const char *group_name, + trav_table_t *table, + trav_info_t *info, int *idx, - int print) + int print) { - + char *name=NULL; H5G_obj_t1 type; int n_names; @@ -325,20 +325,20 @@ int traverse( hid_t loc_id, /* get the number of names */ if (( n_names = get_nnames( loc_id, group_name )) < 0 ) return -1; - - for ( i = 0; i < n_names; i++) + + for ( i = 0; i < n_names; i++) { if (get_name_type( loc_id, group_name, i, &name, &type ) < 0 ) return -1; - + /* allocate path buffer */ path = (char*) HDmalloc(strlen(group_name) + strlen(name) + 2); - + /* initialize path */ strcpy( path, group_name ); if ( strcmp(group_name,"/")!=0 ) strcat( path, "/" ); - strcat( path, name ); + strcat( path, name ); /* disable error reporting */ H5E_BEGIN_TRY { @@ -354,16 +354,16 @@ int traverse( hid_t loc_id, info[*idx].type = type; (*idx)++; } - - - switch ( type ) + + + switch ( type ) { /*------------------------------------------------------------------------- * H5G_GROUP *------------------------------------------------------------------------- */ - + case H5G_GROUP: /* increment */ @@ -378,14 +378,14 @@ int traverse( hid_t loc_id, /* print it */ if (print) printf(" %-10s %s\n", "group", path ); - + /* recurse with the absolute name */ inserted_objs += traverse( loc_id, path, table, info, idx, print ); } /* search table group with more than one link to it */ - if (statbuf.nlink > 1) + if (statbuf.nlink > 1) { if ((j = trav_table_search(statbuf.objno, table )) < 0 ) return -1; @@ -404,14 +404,14 @@ int traverse( hid_t loc_id, } } - + break; /*------------------------------------------------------------------------- * H5G_DATASET *------------------------------------------------------------------------- */ - + case H5G_DATASET: /* increment */ @@ -430,7 +430,7 @@ int traverse( hid_t loc_id, /* search table dataset with more than one link to it */ - if (statbuf.nlink > 1) + if (statbuf.nlink > 1) { if ((j = trav_table_search(statbuf.objno, table )) < 0 ) return -1; @@ -448,15 +448,15 @@ int traverse( hid_t loc_id, printf(" %-10s %s %s %s\n", "dataset", path, "->", table->objs[j].name ); } /* displayed==1 */ } /* nlink>1 */ - - + + break; /*------------------------------------------------------------------------- * H5G_TYPE *------------------------------------------------------------------------- */ - + case H5G_TYPE: /* increment */ @@ -472,7 +472,7 @@ int traverse( hid_t loc_id, if (print) printf(" %-10s %s\n", "datatype", path ); } - + break; @@ -480,14 +480,14 @@ int traverse( hid_t loc_id, * H5G_LINK *------------------------------------------------------------------------- */ - + case H5G_LINK: { char *targbuf=NULL; - + /* increment */ inserted_objs++; - + /* add object to table */ trav_table_add(statbuf.objno, path, H5G_LINK, table ); @@ -495,7 +495,7 @@ int traverse( hid_t loc_id, { targbuf=malloc(statbuf.linklen); H5Gget_linkval(loc_id,path,statbuf.linklen,targbuf); - if (print) + if (print) printf(" %-10s %s -> %s\n", "link", path, targbuf); if (targbuf) free(targbuf); @@ -506,28 +506,28 @@ int traverse( hid_t loc_id, printf(" %-10s %s ->\n", "link", path); } } - + break; - + default: break; - - } + + } /*------------------------------------------------------------------------- * end switch *------------------------------------------------------------------------- */ - + if ( name ) HDfree( name ); - + if ( path ) HDfree( path ); - + } /* i */ - + return inserted_objs; } @@ -645,7 +645,7 @@ int h5trav_getindext(const char *name, trav_table_t *table) int result; int i, j; - for ( i = 0; i < table->nobjs; i++) + for ( i = 0; i < table->nobjs; i++) { if ( strcmp(name,table->objs[i].name)==0 ) return i; @@ -664,10 +664,10 @@ int h5trav_getindext(const char *name, trav_table_t *table) { if ( strcmp(name,table->objs[i].links[j].new_name)==0 ) return i; - + pdest = strstr( table->objs[i].links[j].new_name, name ); result = (int)(pdest - table->objs[i].links[j].new_name); - + /* found at position 1, meaning without '/' */ if( pdest != NULL && result==1 ) return i; diff --git a/tools/lib/h5trav.h b/tools/lib/h5trav.h index b6522e6..ca9755a 100644 --- a/tools/lib/h5trav.h +++ b/tools/lib/h5trav.h @@ -24,12 +24,12 @@ /*------------------------------------------------------------------------- * public struct to store name and type of an object - * the TYPE can be: - * H5G_UNKNOWN = -1, - * H5G_LINK, Object is a symbolic link - * H5G_GROUP, Object is a group - * H5G_DATASET, Object is a dataset - * H5G_TYPE, Object is a named data type + * the TYPE can be: + * H5G_UNKNOWN = -1, + * H5G_LINK, Object is a symbolic link + * H5G_GROUP, Object is a group + * H5G_DATASET, Object is a dataset + * H5G_TYPE, Object is a named data type *------------------------------------------------------------------------- */ @@ -124,21 +124,21 @@ void trav_table_init(trav_table_t **table); void trav_table_free(trav_table_t *table); -int trav_table_search(unsigned long *objno, +int trav_table_search(unsigned long *objno, trav_table_t *table ); -void trav_table_add(unsigned long *objno, - char *objname, - H5G_obj_t1 type, +void trav_table_add(unsigned long *objno, + char *objname, + H5G_obj_t1 type, trav_table_t *table); -void trav_table_addflags(unsigned *flags, - char *objname, - H5G_obj_t1 type, +void trav_table_addflags(unsigned *flags, + char *objname, + H5G_obj_t1 type, trav_table_t *table); -void trav_table_addlink(trav_table_t *table, +void trav_table_addlink(trav_table_t *table, int j /* the object index */, char *path ); diff --git a/tools/lib/h5trav_table.c b/tools/lib/h5trav_table.c index 7527975..7f29813 100644 --- a/tools/lib/h5trav_table.c +++ b/tools/lib/h5trav_table.c @@ -14,7 +14,7 @@ #include "h5trav.h" -#include "H5private.h" +#include "H5private.h" /*------------------------------------------------------------------------- * Function: trav_table_search @@ -33,11 +33,11 @@ int trav_table_search(unsigned long *objno, trav_table_t *table ) { int i; - + for (i = 0; i < table->nobjs; i++) if (table->objs[i].objno[0] == *objno && table->objs[i].objno[1] == *(objno + 1)) return i; - + return -1; } @@ -56,18 +56,18 @@ int trav_table_search(unsigned long *objno, trav_table_t *table ) *------------------------------------------------------------------------- */ -void trav_table_add(unsigned long *objno, - char *name, - H5G_obj_t1 type, +void trav_table_add(unsigned long *objno, + char *name, + H5G_obj_t1 type, trav_table_t *table) { int i; - + if (table->nobjs == table->size) { table->size *= 2; - table->objs = + table->objs = (trav_obj_t*)HDrealloc(table->objs, table->size * sizeof(trav_obj_t)); - + for (i = table->nobjs; i < table->size; i++) { table->objs[i].objno[0] = table->objs[i].objno[1] = 0; table->objs[i].flags[0] = table->objs[i].flags[1] = 0; @@ -79,7 +79,7 @@ void trav_table_add(unsigned long *objno, table->objs[i].sizelinks = 0; } } - + i = table->nobjs++; table->objs[i].objno[0] = objno[0]; table->objs[i].objno[1] = objno[1]; @@ -106,18 +106,18 @@ void trav_table_add(unsigned long *objno, *------------------------------------------------------------------------- */ -void trav_table_addflags(unsigned *flags, - char *name, - H5G_obj_t1 type, +void trav_table_addflags(unsigned *flags, + char *name, + H5G_obj_t1 type, trav_table_t *table) { int i; - + if (table->nobjs == table->size) { table->size *= 2; - table->objs = + table->objs = (trav_obj_t*)HDrealloc(table->objs, table->size * sizeof(trav_obj_t)); - + for (i = table->nobjs; i < table->size; i++) { table->objs[i].objno[0] = table->objs[i].objno[1] = 0; table->objs[i].flags[0] = table->objs[i].flags[1] = 0; @@ -129,7 +129,7 @@ void trav_table_addflags(unsigned *flags, table->objs[i].sizelinks = 0; } } - + i = table->nobjs++; table->objs[i].objno[0] = 0; table->objs[i].objno[1] = 0; @@ -146,7 +146,7 @@ void trav_table_addflags(unsigned *flags, /*------------------------------------------------------------------------- * Function: trav_table_init * - * Purpose: Initialize the table + * Purpose: Initialize the table * * Return: void * @@ -161,12 +161,12 @@ void trav_table_init( trav_table_t **tbl ) { int i; trav_table_t* table = (trav_table_t*) HDmalloc(sizeof(trav_table_t)); - + table->size = 20; table->nobjs = 0; - table->objs = + table->objs = (trav_obj_t*)HDmalloc(table->size * sizeof(trav_obj_t)); - + for (i = 0; i < table->size; i++) { table->objs[i].objno[0] = table->objs[i].objno[1] = 0; table->objs[i].flags[0] = table->objs[i].flags[1] = 0; @@ -177,7 +177,7 @@ void trav_table_init( trav_table_t **tbl ) table->objs[i].nlinks = 0; table->objs[i].sizelinks = 0; } - + *tbl = table; } @@ -232,7 +232,7 @@ void trav_table_free( trav_table_t *table ) *------------------------------------------------------------------------- */ -void trav_table_addlink(trav_table_t *table, +void trav_table_addlink(trav_table_t *table, int j /* the object index */, char *path ) { @@ -245,8 +245,8 @@ void trav_table_addlink(trav_table_t *table, /* allocate space if necessary */ if (table->objs[j].nlinks == table->objs[j].sizelinks) { table->objs[j].sizelinks += 2; - table->objs[j].links = - (trav_link_t*)HDrealloc(table->objs[j].links, + table->objs[j].links = + (trav_link_t*)HDrealloc(table->objs[j].links, table->objs[j].sizelinks * sizeof(trav_link_t)); } diff --git a/tools/misc/h5debug.c b/tools/misc/h5debug.c index 466279c..78448a6 100644 --- a/tools/misc/h5debug.c +++ b/tools/misc/h5debug.c @@ -20,7 +20,7 @@ * * Purpose: Debugs an existing HDF5 file at a low level. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ @@ -107,7 +107,7 @@ main(int argc, char *argv[]) fprintf(stderr, "cannot obtain H5F_t pointer\n"); HDexit(2); } - + /* * Parse command arguments. */ @@ -137,7 +137,7 @@ main(int argc, char *argv[]) * Debug a local heap. */ status = H5HL_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL); - + } else if (!HDmemcmp (sig, H5HG_MAGIC, H5HG_SIZEOF_MAGIC)) { /* * Debug a global heap collection. @@ -157,7 +157,7 @@ main(int argc, char *argv[]) * after the B-tree signature. */ H5B_subid_t subtype = (H5B_subid_t)sig[H5B_SIZEOF_MAGIC]; - + switch (subtype) { case H5B_SNODE_ID: status = H5G_node_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, extra); diff --git a/tools/misc/h5import.c b/tools/misc/h5import.c index 0fcc7ed..4192821 100644 --- a/tools/misc/h5import.c +++ b/tools/misc/h5import.c @@ -67,7 +67,7 @@ usage (const char *argv0) /*------------------------------------------------------------------------- * Function: main * - * Purpose: + * Purpose: * * Return: Success: 0 * @@ -104,7 +104,7 @@ main (int argc, char *argv[]) exit (1); } } H5E_END_TRY; - + /* process files from command-line */ for (argno=3; argno=0) close (fd); fd = -1; diff --git a/tools/misc/h5repart.c b/tools/misc/h5repart.c index 0518a76..173fa0c 100644 --- a/tools/misc/h5repart.c +++ b/tools/misc/h5repart.c @@ -129,7 +129,7 @@ get_size (const char *progname, int *argno, int argc, char *argv[]) { off_t retval=-1; char *suffix; - + if (isdigit ((int)(argv[*argno][2]))) { retval = strtol (argv[*argno]+2, &suffix, 10); (*argno)++; @@ -168,9 +168,9 @@ get_size (const char *progname, int *argno, int argc, char *argv[]) * * Purpose: Split an hdf5 file * - * Return: Success: + * Return: Success: * - * Failure: + * Failure: * * Programmer: Robb Matzke * Wednesday, May 13, 1998 @@ -202,7 +202,7 @@ main (int argc, char *argv[]) int src_is_family; /*is source name a family name? */ int src_membno=0; /*source member number */ - + const char *dst_gen_name; /*general destination name */ char dst_name[NAMELEN]; /*destination member name */ int dst_is_family; /*is dst name a family name? */ @@ -223,7 +223,7 @@ main (int argc, char *argv[]) off_t src_act_size; /*source actual member size */ off_t dst_size=1 GB; /*destination logical memb size */ #endif - + /* * Get the program name from argv[0]. Use only the last component. */ @@ -441,7 +441,7 @@ main (int argc, char *argv[]) } } close (dst); - + /* Free resources and return */ free (buf); return 0; diff --git a/tools/misc/pdb2hdf.c b/tools/misc/pdb2hdf.c index c6a8951..c3e93aa 100644 --- a/tools/misc/pdb2hdf.c +++ b/tools/misc/pdb2hdf.c @@ -98,7 +98,7 @@ usage: %s [OPTIONS] [PDBFILE ...]\n\ the characters \".h5\". For example, \"/tmp/test/eos.data\" would result\n\ in an HDF5 file called \"eos.h5\" in the current directory.\n", progname); - + } @@ -150,7 +150,7 @@ fix_name(const char *pdb_name, char *hdf_name, size_t size) { char *s; const char *ext; - + if (!pdb_name || !hdf_name) return NULL; if ((s=strrchr(pdb_name, '/'))) pdb_name = s; if (NULL==(ext=strrchr(pdb_name, '.'))) ext = pdb_name + strlen(pdb_name); @@ -189,15 +189,15 @@ fix_type(PDBfile *pdb, const char *s) assert(d); assert(d->size>0); if (d->onescmp) return -1; - - + + if (!strcmp(s, "char")) { /* * Character datatypes. Use whatever sign the native system uses by * default. */ type = H5Tcopy(H5T_NATIVE_CHAR); - + } else if (!strcmp(s, "integer")) { /* * Integer datatypes. PDB supports various sizes of signed or @@ -209,7 +209,7 @@ fix_type(PDBfile *pdb, const char *s) assert(NORMAL_ORDER==d->order_flag || REVERSE_ORDER==d->order_flag); H5Tset_order(type, NORMAL_ORDER==d->order_flag?H5T_ORDER_BE:H5T_ORDER_LE); - + } else if (!strcmp(s, "float") || !strcmp(s, "double")) { /* * Floating-point datatypes @@ -221,14 +221,14 @@ fix_type(PDBfile *pdb, const char *s) H5Tset_precision(type, 8*d->size); assert(d->order); H5Tset_order(type, 1==d->order[0]?H5T_ORDER_BE:H5T_ORDER_LE); - + /* - * format[0] = # of bits per number - * format[1] = # of bits in exponent - * format[2] = # of bits in mantissa - * format[3] = start bit of sign - * format[4] = start bit of exponent - * format[5] = start bit of mantissa + * format[0] = # of bits per number + * format[1] = # of bits in exponent + * format[2] = # of bits in mantissa + * format[3] = start bit of sign + * format[4] = start bit of exponent + * format[5] = start bit of mantissa * format[6] = high order mantissa bit (CRAY needs this) * format[7] = bias of exponent */ @@ -298,7 +298,7 @@ fix_external(hid_t dcpl, const char *pdb_file_name, long nelmts, hsize_t elmt_size, symblock *block) { int i; - + for (i=0; nelmts>0; i++) { hsize_t nbytes = block[i].number * elmt_size; H5Pset_external(dcpl, pdb_file_name, block[i].diskaddr, nbytes); @@ -344,7 +344,7 @@ traverse(PDBfile *pdb, const char *pdb_file_name, hid_t hdf) printf("%s %s\n", _PD_fixname(pdb, list[i]), ep->type); fflush(stdout); } - + if ('/'==list[i][strlen(list[i])-1]) { /* @@ -361,14 +361,14 @@ traverse(PDBfile *pdb, const char *pdb_file_name, hid_t hdf) } else { in_subdir = TRUE; } - + traverse(pdb, pdb_file_name, group); if (!PD_cd(pdb, "..")) { fprintf(stderr, "cannot traverse out of PDB %s\n", list[i]); goto error; } H5Gclose(group); - + } else { /* This is some non-directory PDB object */ @@ -401,7 +401,7 @@ traverse(PDBfile *pdb, const char *pdb_file_name, hid_t hdf) H5Sclose(h_space); H5Tclose(h_type); } - + } for (i=0; i