From 6b45f5172ccb4311e0be9ae15da3758abb6b0e67 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Sat, 13 Aug 2005 15:53:35 -0500 Subject: [svn-r11245] 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 | 46 +- c++/src/H5AbstractDs.h | 12 +- c++/src/H5ArrayType.cpp | 20 +- c++/src/H5ArrayType.h | 2 +- c++/src/H5AtomType.cpp | 34 +- c++/src/H5AtomType.h | 16 +- c++/src/H5Attribute.cpp | 16 +- c++/src/H5Attribute.h | 6 +- c++/src/H5CommonFG.cpp | 176 +-- c++/src/H5CommonFG.h | 10 +- c++/src/H5CompType.cpp | 84 +- c++/src/H5CompType.h | 28 +- c++/src/H5CppDoc.h | 12 +- c++/src/H5DataSet.cpp | 44 +- c++/src/H5DataSet.h | 6 +- c++/src/H5DataSpace.cpp | 60 +- c++/src/H5DataSpace.h | 4 +- c++/src/H5DataType.cpp | 110 +- c++/src/H5DataType.h | 28 +- c++/src/H5DcreatProp.cpp | 16 +- c++/src/H5DcreatProp.h | 8 +- c++/src/H5DxferProp.cpp | 24 +- c++/src/H5DxferProp.h | 14 +- c++/src/H5EnumType.cpp | 20 +- c++/src/H5EnumType.h | 12 +- c++/src/H5Exception.cpp | 38 +- c++/src/H5Exception.h | 10 +- c++/src/H5FaccProp.cpp | 42 +- c++/src/H5FaccProp.h | 4 +- c++/src/H5FcreatProp.cpp | 34 +- 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 | 16 +- c++/src/H5IdComponent.cpp | 34 +- c++/src/H5IntType.cpp | 10 +- c++/src/H5IntType.h | 2 +- c++/src/H5Library.cpp | 36 +- c++/src/H5Library.h | 22 +- c++/src/H5Object.cpp | 34 +- c++/src/H5Object.h | 8 +- c++/src/H5PredType.cpp | 16 +- c++/src/H5PredType.h | 10 +- c++/src/H5PropList.cpp | 64 +- 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/tattr.cpp | 120 +- c++/test/testhdf5.cpp | 2 +- c++/test/tfile.cpp | 22 +- c++/test/th5s.cpp | 54 +- examples/h5_attribute.c | 78 +- examples/h5_chunk_read.c | 90 +- examples/h5_compound.c | 16 +- examples/h5_drivers.c | 8 +- examples/h5_dtransform.c | 34 +- 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 | 80 +- 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 | 632 +++++----- fortran/src/H5Rf.c | 66 +- fortran/src/H5Sf.c | 258 ++-- fortran/src/H5Tf.c | 508 ++++---- fortran/src/H5Zf.c | 4 +- fortran/src/H5_f.c | 172 +-- fortran/src/H5f90.h | 2 +- fortran/src/H5f90kit.c | 2 +- fortran/src/H5f90proto.h | 48 +- fortran/src/H5match_types.c | 8 +- fortran/test/t.c | 28 +- fortran/test/t.h | 6 +- hl/c++/src/H5PacketTable.cpp | 6 +- hl/c++/src/H5PacketTable.h | 4 +- hl/c++/test/ptableTest.cpp | 4 +- hl/fortran/src/H5IMcc.c | 100 +- hl/fortran/src/H5IMcc.h | 16 +- hl/fortran/src/H5IMfc.c | 132 +- hl/fortran/src/H5LTf90proto.h | 164 +-- hl/fortran/src/H5LTfc.c | 234 ++-- hl/fortran/src/H5TBfc.c | 132 +- hl/src/H5DS.c | 514 ++++---- hl/src/H5DS.h | 20 +- hl/src/H5HL_private.c | 18 +- hl/src/H5HL_private.h | 2 +- hl/src/H5IM.c | 286 ++--- hl/src/H5IM.h | 42 +- hl/src/H5LT.c | 596 ++++----- hl/src/H5LT.h | 210 ++-- hl/src/H5PT.c | 72 +- hl/src/H5PT.h | 8 +- hl/src/H5TB.c | 648 +++++----- hl/src/H5TB.h | 48 +- hl/test/pal_rgb.h | 2 +- hl/test/test_ds.c | 546 ++++---- hl/test/test_image.c | 210 ++-- hl/test/test_lite.c | 88 +- hl/test/test_packet.c | 24 +- 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 +- perform/pio_standalone.h | 8 +- src/H5.c | 68 +- src/H5A.c | 122 +- src/H5AC.c | 172 +-- src/H5ACprivate.h | 10 +- src/H5ACpublic.h | 2 +- src/H5B.c | 72 +- src/H5B2.c | 86 +- src/H5B2cache.c | 12 +- src/H5B2private.h | 2 +- src/H5BP.c | 4 +- src/H5BPcache.c | 8 +- src/H5BPprivate.h | 2 +- src/H5BT.c | 18 +- src/H5BTcache.c | 4 +- src/H5BTprivate.h | 2 +- src/H5Bprivate.h | 6 +- src/H5C.c | 894 +++++++------- src/H5CS.c | 16 +- src/H5Cpkg.h | 190 +-- src/H5Cprivate.h | 204 +-- src/H5D.c | 262 ++-- src/H5Dcompact.c | 58 +- src/H5Dcontig.c | 16 +- src/H5Defl.c | 24 +- src/H5Dio.c | 14 +- src/H5Distore.c | 154 +-- src/H5Dmpio.c | 4 +- src/H5Dprivate.h | 12 +- src/H5Dpublic.h | 4 +- src/H5Dselect.c | 8 +- src/H5E.c | 296 ++--- src/H5Eprivate.h | 2 +- src/H5Epublic.h | 10 +- src/H5Eterm.h | 242 ++-- src/H5F.c | 312 ++--- src/H5FD.c | 106 +- src/H5FDcore.c | 44 +- src/H5FDfamily.c | 94 +- src/H5FDfphdf5.c | 20 +- src/H5FDlog.c | 52 +- src/H5FDmpi.c | 16 +- src/H5FDmpio.c | 54 +- src/H5FDmpiposix.c | 42 +- src/H5FDmulti.c | 76 +- src/H5FDpublic.h | 4 +- src/H5FDsec2.c | 36 +- src/H5FDstdio.c | 54 +- src/H5FDstream.c | 14 +- src/H5FDstream.h | 2 +- src/H5FL.c | 92 +- src/H5FLprivate.h | 2 +- src/H5FP.c | 2 +- src/H5FPclient.c | 36 +- src/H5FPprivate.h | 4 +- src/H5FPserver.c | 96 +- src/H5FS.c | 16 +- src/H5Fdbg.c | 2 +- src/H5Fmount.c | 34 +- src/H5Fpkg.h | 2 +- src/H5Fprivate.h | 22 +- src/H5Fpublic.h | 4 +- src/H5Fsfile.c | 6 +- src/H5Fsuper.c | 30 +- src/H5G.c | 240 ++-- src/H5Gent.c | 12 +- src/H5Gnode.c | 44 +- src/H5Gpkg.h | 2 +- src/H5Gpublic.h | 8 +- src/H5Gstab.c | 16 +- src/H5HG.c | 78 +- src/H5HL.c | 16 +- src/H5HLprivate.h | 2 +- src/H5I.c | 80 +- src/H5Ipublic.h | 2 +- src/H5MF.c | 10 +- src/H5MM.c | 2 +- src/H5MP.c | 2 +- src/H5MPtest.c | 2 +- src/H5O.c | 142 +-- 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 | 38 +- src/H5Omtime.c | 22 +- src/H5Oname.c | 4 +- src/H5Onull.c | 2 +- src/H5Opkg.h | 4 +- src/H5Opline.c | 16 +- src/H5Oprivate.h | 22 +- src/H5Osdspace.c | 26 +- src/H5Oshared.c | 12 +- src/H5Ostab.c | 4 +- src/H5P.c | 104 +- src/H5Pdcpl.c | 160 +-- src/H5Pdxpl.c | 74 +- src/H5Pfapl.c | 300 ++--- src/H5Pfcpl.c | 16 +- src/H5Pocpl.c | 14 +- src/H5Pprivate.h | 2 +- src/H5Ppublic.h | 20 +- src/H5R.c | 26 +- src/H5S.c | 76 +- src/H5SH.c | 6 +- src/H5SHcache.c | 4 +- src/H5SHprivate.h | 2 +- src/H5SL.c | 2 +- src/H5ST.c | 14 +- src/H5Sall.c | 4 +- src/H5Shyper.c | 72 +- src/H5Smpio.c | 2 +- src/H5Snone.c | 2 +- src/H5Spkg.h | 6 +- src/H5Spoint.c | 14 +- src/H5Sprivate.h | 2 +- src/H5T.c | 246 ++-- src/H5TS.c | 14 +- src/H5Tarray.c | 20 +- src/H5Tbit.c | 62 +- src/H5Tcommit.c | 18 +- src/H5Tcompound.c | 24 +- src/H5Tconv.c | 652 +++++----- src/H5Tcset.c | 12 +- src/H5Tenum.c | 28 +- src/H5Tfields.c | 36 +- src/H5Tfixed.c | 10 +- src/H5Tfloat.c | 22 +- src/H5Tnative.c | 298 ++--- src/H5Toffset.c | 10 +- src/H5Topaque.c | 4 +- src/H5Torder.c | 2 +- src/H5Tpad.c | 6 +- src/H5Tpkg.h | 4 +- src/H5Tprecis.c | 8 +- src/H5Tpublic.h | 2 +- src/H5Tstrpad.c | 8 +- src/H5Tvlen.c | 34 +- src/H5V.c | 6 +- src/H5Z.c | 44 +- src/H5Zdeflate.c | 8 +- src/H5Zfletcher32.c | 50 +- src/H5Znbit.c | 330 ++--- src/H5Zprivate.h | 2 +- src/H5Zpublic.h | 18 +- src/H5Zscaleoffset.c | 426 +++---- src/H5Zshuffle.c | 8 +- src/H5Zszip.c | 18 +- src/H5Ztrans.c | 162 +-- src/H5api_adpt.h | 2 +- src/H5detect.c | 46 +- src/H5private.h | 34 +- src/H5public.h | 4 +- test/b+tree.c | 8 +- test/big.c | 32 +- test/bittests.c | 50 +- test/blocktrack.c | 30 +- test/btree2.c | 162 +-- test/cache.c | 1912 ++++++++++++++--------------- test/cmpd_dset.c | 48 +- test/createnoenc.c | 2 +- test/dangle.c | 32 +- test/dsets.c | 648 +++++----- test/dt_arith.c | 404 +++--- test/dtransform.c | 108 +- test/dtypes.c | 204 +-- test/enum.c | 56 +- test/err_compat.c | 46 +- test/error_test.c | 90 +- test/extend.c | 6 +- test/external.c | 20 +- test/fillval.c | 148 +-- test/flush1.c | 2 +- test/flush2.c | 8 +- test/gen_deflate.c | 6 +- test/gen_filters.c | 10 +- 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 | 30 +- test/mount.c | 142 +-- test/mtime.c | 18 +- test/ntypes.c | 414 +++---- test/ohdr.c | 10 +- test/pool.c | 4 +- test/reserved.c | 24 +- test/set_extent.c | 16 +- test/sheap.c | 8 +- test/space_overflow.c | 6 +- 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 | 112 +- test/th5s.c | 80 +- test/theap.c | 70 +- test/tid.c | 4 +- test/titerate.c | 106 +- test/tmeta.c | 4 +- test/tmisc.c | 202 +-- test/trefer.c | 44 +- test/trefstr.c | 34 +- test/tselect.c | 438 +++---- 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 | 18 +- test/ttst.c | 26 +- test/tunicode.c | 8 +- test/tvlstr.c | 78 +- test/tvltypes.c | 92 +- test/unlink.c | 42 +- test/vfd.c | 142 +-- testpar/t_coll_chunk.c | 48 +- testpar/t_dset.c | 2 +- testpar/t_fphdf5.c | 118 +- testpar/t_mdset.c | 298 ++--- testpar/t_mpi.c | 60 +- testpar/t_ph5basic.c | 6 +- testpar/t_span_tree.c | 290 ++--- testpar/testphdf5.c | 58 +- 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_common.c | 38 +- tools/h5diff/h5diff_main.c | 8 +- tools/h5diff/ph5diff_main.c | 38 +- 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 | 266 ++-- tools/h5dump/h5dumpgentest.c | 318 ++--- 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 | 268 ++-- tools/h5repack/h5repack_filters.c | 186 +-- 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 | 154 +-- tools/h5repack/testh5repack_attr.c | 92 +- tools/h5repack/testh5repack_detect_szip.c | 8 +- tools/h5repack/testh5repack_dset.c | 88 +- tools/h5repack/testh5repack_main.c | 140 +-- tools/h5repack/testh5repack_make.c | 208 ++-- tools/h5repack/testh5repack_util.c | 46 +- tools/lib/h5diff.c | 60 +- tools/lib/h5diff.h | 240 ++-- tools/lib/h5diff_array.c | 928 +++++++------- tools/lib/h5diff_attr.c | 80 +- tools/lib/h5diff_dset.c | 132 +- tools/lib/h5diff_util.c | 72 +- tools/lib/h5tools.c | 50 +- tools/lib/h5tools.h | 24 +- tools/lib/h5tools_filters.c | 46 +- tools/lib/h5tools_str.c | 28 +- tools/lib/h5tools_utils.c | 28 +- tools/lib/h5tools_utils.h | 4 +- tools/lib/h5trav.c | 134 +- tools/lib/h5trav.h | 28 +- tools/lib/h5trav_table.c | 50 +- tools/lib/ph5diff.h | 6 +- tools/misc/h5debug.c | 16 +- tools/misc/h5import.c | 8 +- tools/misc/h5repart.c | 36 +- tools/misc/h5repart_gentest.c | 16 +- tools/misc/pdb2hdf.c | 38 +- tools/misc/repart_test.c | 30 +- 449 files changed, 16825 insertions(+), 16825 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 9e02181..e3bbd79 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 hid_t datatype_id; try { @@ -79,7 +79,7 @@ H5T_class_t AbstractDs::getTypeClass() const return( type_class ); else { - throw DataTypeIException(inMemFunc("getTypeClass"), + throw DataTypeIException(inMemFunc("getTypeClass"), "H5Tget_class returns H5T_NO_CLASS"); } } @@ -95,8 +95,8 @@ H5T_class_t AbstractDs::getTypeClass() const DataType AbstractDs::getDataType() const { // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getDataType. Then, create and + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getDataType. Then, create and // return the DataType object try { DataType datatype(p_get_type()); @@ -121,8 +121,8 @@ DataType AbstractDs::getDataType() const ArrayType AbstractDs::getArrayType() const { // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getArrayType. Then, create and + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getArrayType. Then, create and // return the ArrayType object try { ArrayType arraytype(p_get_type()); @@ -138,7 +138,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 @@ -147,8 +147,8 @@ ArrayType AbstractDs::getArrayType() const CompType AbstractDs::getCompType() const { // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getCompType. Then, create and + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getCompType. Then, create and // return the CompType object try { CompType comptype(p_get_type()); @@ -164,7 +164,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 @@ -173,8 +173,8 @@ CompType AbstractDs::getCompType() const EnumType AbstractDs::getEnumType() const { // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getEnumType. Then, create and + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getEnumType. Then, create and // return the EnumType object try { EnumType enumtype(p_get_type()); @@ -190,7 +190,7 @@ EnumType AbstractDs::getEnumType() 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 @@ -199,8 +199,8 @@ EnumType AbstractDs::getEnumType() const IntType AbstractDs::getIntType() const { // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getIntType. Then, create and + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getIntType. Then, create and // return the IntType object try { IntType inttype(p_get_type()); @@ -225,8 +225,8 @@ IntType AbstractDs::getIntType() const FloatType AbstractDs::getFloatType() const { // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getFloatType. Then, create and + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getFloatType. Then, create and // return the FloatType object try { FloatType floatype(p_get_type()); @@ -242,7 +242,7 @@ FloatType AbstractDs::getFloatType() 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 @@ -251,8 +251,8 @@ FloatType AbstractDs::getFloatType() const StrType AbstractDs::getStrType() const { // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getStrType. Then, create and + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getStrType. Then, create and // return the StrType object try { StrType strtype(p_get_type()); @@ -277,8 +277,8 @@ StrType AbstractDs::getStrType() const VarLenType AbstractDs::getVarLenType() const { // Gets the id of the datatype used by this dataset or attribute using - // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type - // depending on which object invokes getVarLenType. Then, create and + // p_get_type. p_get_type calls either H5Dget_type or H5Aget_type + // depending on which object invokes getVarLenType. Then, create and // return the VarLenType object try { VarLenType varlentype(p_get_type()); diff --git a/c++/src/H5AbstractDs.h b/c++/src/H5AbstractDs.h index 03b87ec..de086a3 100644 --- a/c++/src/H5AbstractDs.h +++ b/c++/src/H5AbstractDs.h @@ -35,9 +35,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; @@ -53,11 +53,11 @@ 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 + // 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 + // Returns the amount of storage size required for this abstract // dataset - pure virtual. virtual hsize_t getStorageSize() const = 0; @@ -65,7 +65,7 @@ class H5_DLLCPP AbstractDs : public H5Object { AbstractDs( const AbstractDs& original ); // Destructor - virtual ~AbstractDs(); + virtual ~AbstractDs(); protected: // Default constructor diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp index 6366752..b23877c 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 023998d..faf738a 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 56bb6eb..c58f2e7 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 @@ -88,7 +88,7 @@ H5T_order_t AtomType::getOrder() const // return a byte order constant if successful if( type_order == H5T_ORDER_ERROR ) { - throw DataTypeIException(inMemFunc("getOrder"), + throw DataTypeIException(inMemFunc("getOrder"), "H5Tget_order returns H5T_ORDER_ERROR"); } return( type_order ); @@ -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 9cca02c..b9a583c 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; // Returns this class name diff --git a/c++/src/H5Attribute.cpp b/c++/src/H5Attribute.cpp index ccfdd4c..9a177b9 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 73a5612..9eeab98 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 767286e..de46889 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::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 //-------------------------------------------------------------------------- @@ -284,7 +284,7 @@ void CommonFG::unlink( const string& name ) const ///\param dst - IN: Object's new name ///\exception H5::FileIException or H5::GroupIException ///\note -/// Exercise care in moving groups as it is possible to render +/// Exercise care in moving groups as it is possible to render /// data in a file inaccessible with Group::move. Please refer /// to the Group Interface in the HDF5 User's Guide at: /// http://hdf.ncsa.uiuc.edu/HDF5/doc/Groups.html @@ -302,7 +302,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 //-------------------------------------------------------------------------- @@ -336,7 +336,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 //-------------------------------------------------------------------------- @@ -348,7 +348,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 @@ -371,7 +371,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 //-------------------------------------------------------------------------- @@ -387,11 +387,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 //-------------------------------------------------------------------------- @@ -407,7 +407,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 //-------------------------------------------------------------------------- @@ -495,7 +495,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 ); @@ -512,7 +512,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 //-------------------------------------------------------------------------- @@ -549,7 +549,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 //-------------------------------------------------------------------------- @@ -580,7 +580,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 //-------------------------------------------------------------------------- @@ -600,14 +600,14 @@ void CommonFG::unmount( const string& name ) const DataType CommonFG::openDataType( const char* name ) const { // Call C function H5Topen to open the named datatype in this group, - // given either the file or group id + // given either the file or group id hid_t type_id = H5Topen(getLocId(), name); - + // If the datatype's opening failed, throw an exception - if( type_id < 0 ) - { + if( type_id < 0 ) + { throwException("openDataType", "H5Topen failed"); - } + } // No failure, create and return the DataType object DataType data_type(type_id); return(data_type); @@ -616,7 +616,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 //-------------------------------------------------------------------------- @@ -636,14 +636,14 @@ DataType CommonFG::openDataType( const string& name ) const ArrayType CommonFG::openArrayType( const char* name ) const { // Call C function H5Topen to open the named datatype in this group, - // given either the file or group id + // given either the file or group id hid_t type_id = H5Topen(getLocId(), name); - + // If the datatype's opening failed, throw an exception - if( type_id < 0 ) - { + if( type_id < 0 ) + { throwException("openArrayType", "H5Topen failed"); - } + } // No failure, create and return the ArrayType object ArrayType array_type (type_id); return(array_type); @@ -672,14 +672,14 @@ ArrayType CommonFG::openArrayType( const string& name ) const CompType CommonFG::openCompType( const char* name ) const { // Call C function H5Topen to open the named datatype in this group, - // given either the file or group id + // given either the file or group id hid_t type_id = H5Topen(getLocId(), name); - + // If the datatype's opening failed, throw an exception - if( type_id < 0 ) - { + if( type_id < 0 ) + { throwException("openCompType", "H5Topen failed"); - } + } // No failure, create and return the CompType object CompType comp_type(type_id); return(comp_type); @@ -688,7 +688,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 //-------------------------------------------------------------------------- @@ -708,30 +708,30 @@ CompType CommonFG::openCompType( const string& name ) const EnumType CommonFG::openEnumType( const char* name ) const { // Call C function H5Topen to open the named datatype in this group, - // given either the file or group id + // given either the file or group id hid_t type_id = H5Topen(getLocId(), name); - + // If the datatype's opening failed, throw an exception - if( type_id < 0 ) - { + if( type_id < 0 ) + { throwException("openEnumType", "H5Topen failed"); - } + } // No failure, create and return the EnumType object EnumType enum_type(type_id); 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 @@ -742,16 +742,16 @@ EnumType CommonFG::openEnumType( const string& name ) const // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- IntType CommonFG::openIntType( const char* name ) const -{ +{ // Call C function H5Topen to open the named datatype in this group, - // given either the file or group id + // given either the file or group id hid_t type_id = H5Topen(getLocId(), name); - + // If the datatype's opening failed, throw an exception - if( type_id < 0 ) - { + if( type_id < 0 ) + { throwException("openIntType", "H5Topen failed"); - } + } // No failure, create and return the IntType object IntType int_type(type_id); return(int_type); @@ -760,12 +760,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()) ); } @@ -778,16 +778,16 @@ IntType CommonFG::openIntType( const string& name ) const // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- FloatType CommonFG::openFloatType( const char* name ) const -{ +{ // Call C function H5Topen to open the named datatype in this group, - // given either the file or group id + // given either the file or group id hid_t type_id = H5Topen(getLocId(), name); - + // If the datatype's opening failed, throw an exception - if( type_id < 0 ) - { + if( type_id < 0 ) + { throwException("openFloatType", "H5Topen failed"); - } + } // No failure, create and return the FloatType object FloatType float_type(type_id); return(float_type); @@ -796,12 +796,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()) ); } @@ -816,14 +816,14 @@ FloatType CommonFG::openFloatType( const string& name ) const StrType CommonFG::openStrType( const char* name ) const { // Call C function H5Topen to open the named datatype in this group, - // given either the file or group id + // given either the file or group id hid_t type_id = H5Topen(getLocId(), name); - + // If the datatype's opening failed, throw an exception - if( type_id < 0 ) - { + if( type_id < 0 ) + { throwException("openStrType", "H5Topen failed"); - } + } // No failure, create and return the StrType object StrType str_type(type_id); return(str_type); @@ -832,7 +832,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 //-------------------------------------------------------------------------- @@ -852,14 +852,14 @@ StrType CommonFG::openStrType( const string& name ) const VarLenType CommonFG::openVarLenType( const char* name ) const { // Call C function H5Topen to open the named datatype in this group, - // given either the file or group id + // given either the file or group id hid_t type_id = H5Topen(getLocId(), name); - + // If the datatype's opening failed, throw an exception - if( type_id < 0 ) - { + if( type_id < 0 ) + { throwException("openVarLenType", "H5Topen failed"); - } + } // No failure, create and return the VarLenType object VarLenType varlen_type(type_id); return(varlen_type); @@ -884,8 +884,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 @@ -903,7 +903,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 0bb8e67..c2934b1 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; @@ -142,9 +142,9 @@ class H5_DLLCPP CommonFG { VarLenType openVarLenType(const string& name) const; #ifndef DOXYGEN_SHOULD_SKIP_THIS - /// 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; #endif // DOXYGEN_SHOULD_SKIP_THIS diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp index aed4b58..9990087 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 } @@ -204,7 +204,7 @@ H5T_class_t CompType::getMemberClass( unsigned member_num ) const 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. @@ -224,8 +224,8 @@ hid_t CompType::p_get_member_type(unsigned member_num) const //-------------------------------------------------------------------------- // 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 @@ -234,7 +234,7 @@ hid_t CompType::p_get_member_type(unsigned member_num) const DataType CompType::getMemberDataType( unsigned member_num ) const { try { - DataType datatype(p_get_member_type(member_num)); + DataType datatype(p_get_member_type(member_num)); return(datatype); } catch (DataTypeIException E) { @@ -264,8 +264,8 @@ ArrayType CompType::getMemberArrayType( unsigned member_num ) const //-------------------------------------------------------------------------- // 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 @@ -274,7 +274,7 @@ ArrayType CompType::getMemberArrayType( unsigned member_num ) const EnumType CompType::getMemberEnumType( unsigned member_num ) const { try { - EnumType enumtype(p_get_member_type(member_num)); + EnumType enumtype(p_get_member_type(member_num)); return(enumtype); } catch (DataTypeIException E) { @@ -284,8 +284,8 @@ EnumType CompType::getMemberEnumType( 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 @@ -294,7 +294,7 @@ EnumType CompType::getMemberEnumType( unsigned member_num ) const CompType CompType::getMemberCompType( unsigned member_num ) const { try { - CompType comptype(p_get_member_type(member_num)); + CompType comptype(p_get_member_type(member_num)); return(comptype); } catch (DataTypeIException E) { @@ -304,8 +304,8 @@ CompType CompType::getMemberCompType( unsigned member_num ) const //-------------------------------------------------------------------------- // 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 @@ -314,7 +314,7 @@ CompType CompType::getMemberCompType( unsigned member_num ) const IntType CompType::getMemberIntType( unsigned member_num ) const { try { - IntType inttype(p_get_member_type(member_num)); + IntType inttype(p_get_member_type(member_num)); return(inttype); } catch (DataTypeIException E) { @@ -324,8 +324,8 @@ IntType CompType::getMemberIntType( unsigned member_num ) const //-------------------------------------------------------------------------- // 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 @@ -334,7 +334,7 @@ IntType CompType::getMemberIntType( unsigned member_num ) const FloatType CompType::getMemberFloatType( unsigned member_num ) const { try { - FloatType floatype(p_get_member_type(member_num)); + FloatType floatype(p_get_member_type(member_num)); return(floatype); } catch (DataTypeIException E) { @@ -344,8 +344,8 @@ FloatType CompType::getMemberFloatType( unsigned member_num ) const //-------------------------------------------------------------------------- // 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 @@ -354,13 +354,13 @@ FloatType CompType::getMemberFloatType( unsigned member_num ) const StrType CompType::getMemberStrType( unsigned member_num ) const { try { - StrType strtype(p_get_member_type(member_num)); + StrType strtype(p_get_member_type(member_num)); return(strtype); } catch (DataTypeIException E) { throw DataTypeIException("CompType::getMemberStrType", E.getDetailMsg()); } -} +} //-------------------------------------------------------------------------- // Function: CompType::getMemberVarLenType @@ -382,35 +382,35 @@ VarLenType CompType::getMemberVarLenType( unsigned member_num ) const } } -/* 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 */ @@ -442,7 +442,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 d548043..401ed6b 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; // 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 array datatype of the specified member in + // Returns the array 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 variable length datatype of the specified member in + // Returns the variable length 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; // Returns this class name @@ -108,7 +108,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 7ab5179..34a87d7 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 //-------------------------------------------------------------------------- @@ -436,7 +436,7 @@ void* DataSet::Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_ ///\return A reference ///\exception H5::DataSetIException ///\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 @@ -454,7 +454,7 @@ void* DataSet::Reference(const char* name) const //-------------------------------------------------------------------------- // Function: DataSet::Reference ///\brief This is an overloaded function, provided for your 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 the object's name. ///\param name - IN: Name of the object to be referenced - \c std::string // Programmer Binh-Minh Ribler - May, 2004 @@ -470,10 +470,10 @@ void* DataSet::Reference(const string& 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::DataSetIException // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- diff --git a/c++/src/H5DataSet.h b/c++/src/H5DataSet.h index 24e88a7..453a60e 100644 --- a/c++/src/H5DataSet.h +++ b/c++/src/H5DataSet.h @@ -32,7 +32,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. @@ -40,7 +40,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; @@ -100,7 +100,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 d29ba20..7ed6ae2 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 @@ -101,7 +101,7 @@ void DataSpace::copy( const DataSpace& like_space ) { // If this object has a valid id, appropriately decrement reference // counter and close the id. - if( id != H5S_ALL ) { + if( id != H5S_ALL ) { try { decRefCount(); } @@ -110,7 +110,7 @@ void DataSpace::copy( const DataSpace& like_space ) } } // if - // call C routine to copy the dataspace + // call C routine to copy the dataspace id = H5Scopy( like_space.getId() ); if( id < 0 ) @@ -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 //-------------------------------------------------------------------------- @@ -572,10 +572,10 @@ void DataSpace::close() // ID reference counting mechanism - June 1, 2004 //-------------------------------------------------------------------------- DataSpace::~DataSpace() -{ +{ // If this object has a valid id, appropriately decrement reference // counter and close the id. - if( id != H5S_ALL ) { + if( id != H5S_ALL ) { try { decRefCount(); } @@ -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 46c620e..3510a19 100644 --- a/c++/src/H5DataSpace.h +++ b/c++/src/H5DataSpace.h @@ -68,7 +68,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. @@ -83,7 +83,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 28668a46..62dca0f 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 ) @@ -161,7 +161,7 @@ bool DataType::operator==(const DataType& compared_type ) const //-------------------------------------------------------------------------- // 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 @@ -172,7 +172,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 ) { @@ -183,7 +183,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 //-------------------------------------------------------------------------- @@ -194,8 +194,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 @@ -216,11 +216,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 //-------------------------------------------------------------------------- @@ -237,14 +237,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 //-------------------------------------------------------------------------- @@ -269,8 +269,8 @@ void DataType::convert( const DataType& dest, size_t nelmts, void *buf, void *ba /// ///\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 @@ -289,7 +289,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 @@ -308,7 +308,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 @@ -326,7 +326,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 @@ -334,7 +334,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 @@ -352,14 +352,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: @@ -381,7 +381,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 //-------------------------------------------------------------------------- @@ -392,14 +392,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 //-------------------------------------------------------------------------- @@ -407,7 +407,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 ) { @@ -418,7 +418,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 //-------------------------------------------------------------------------- @@ -429,15 +429,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 ) { @@ -448,7 +448,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 //-------------------------------------------------------------------------- @@ -459,7 +459,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 @@ -473,8 +473,8 @@ 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 { @@ -486,7 +486,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 @@ -507,7 +507,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 @@ -554,7 +554,7 @@ void* DataType::Reference(const char* name, DataSpace& dataspace, H5R_type_t ref ///\return A reference ///\exception H5::DataTypeIException ///\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 string& 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::DataTypeIException // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- @@ -659,7 +659,7 @@ void DataType::close() // ID reference counting mechanism - June 1, 2004 //-------------------------------------------------------------------------- DataType::~DataType() -{ +{ // The datatype id will be closed properly if( is_predtype == false ) { try { @@ -669,7 +669,7 @@ DataType::~DataType() cerr << inMemFunc("~DataType - ") << close_error.getDetailMsg() << endl; } } -} +} #ifndef H5_NO_NAMESPACE } // end namespace diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h index c135845..d685e9d 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,29 +59,29 @@ 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 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. @@ -106,7 +106,7 @@ class H5_DLLCPP DataType : public H5Object { virtual string fromClass () const { return ("DataType"); } - // 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 9ecc9a3..74bb19e 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 @@ -333,7 +333,7 @@ H5Z_filter_t DSetCreatPropList::getFilter(int filter_number, unsigned int &flags unsigned int& filter_config) 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, &filter_config); if( filter_id == H5Z_FILTER_ERROR ) { @@ -350,7 +350,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 @@ -363,7 +363,7 @@ void DSetCreatPropList::getFilterById(H5Z_filter_t filter_id, unsigned int &flag unsigned int* cd_values, size_t namelen, char name[], unsigned int &filter_config) const { - herr_t ret_value = H5Pget_filter_by_id(id, filter_id, &flags, &cd_nelmts, + herr_t ret_value = H5Pget_filter_by_id(id, filter_id, &flags, &cd_nelmts, cd_values, namelen, name, &filter_config ); if (ret_value < 0) { diff --git a/c++/src/H5DcreatProp.h b/c++/src/H5DcreatProp.h index fabadc6..b040abf 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; @@ -109,7 +109,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 379e02e..d6d279d 100644 --- a/c++/src/H5DxferProp.cpp +++ b/c++/src/H5DxferProp.cpp @@ -41,7 +41,7 @@ DSetMemXferPropList::DSetMemXferPropList() : PropList(H5P_DATASET_XFER) {} // Function DSetMemXferPropList copy constructor ///\brief Copy constructor: makes a copy of the original /// DSetMemXferPropList object -///\param orig - IN: The original dataset memory and transfer property +///\param orig - IN: The original dataset memory and transfer property /// list object to copy // Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- @@ -222,7 +222,7 @@ void DSetMemXferPropList::getTypeConvCB( H5T_conv_except_func_t *op, void **user //-------------------------------------------------------------------------- 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 ) { @@ -233,7 +233,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 @@ -246,7 +246,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 @@ -270,7 +270,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 - April, 2004 //-------------------------------------------------------------------------- @@ -304,7 +304,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: @@ -363,7 +363,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 @@ -389,14 +389,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 - April, 2004 //-------------------------------------------------------------------------- void DSetMemXferPropList::setEDCCheck(H5Z_EDC_t check) diff --git a/c++/src/H5DxferProp.h b/c++/src/H5DxferProp.h index 2d00a5b..30dfc73 100644 --- a/c++/src/H5DxferProp.h +++ b/c++/src/H5DxferProp.h @@ -42,7 +42,7 @@ class H5_DLLCPP DSetMemXferPropList : public PropList { // Checks status of the dataset transfer property list bool getPreserve() const; - // 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 @@ -54,18 +54,18 @@ class H5_DLLCPP DSetMemXferPropList : public PropList { // Gets the exception handling callback for datatype conversion void getTypeConvCB( H5T_conv_except_func_t *op, void **user_data) 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. @@ -97,7 +97,7 @@ class H5_DLLCPP DSetMemXferPropList : public PropList { // Returns this class name virtual string fromClass () const { return ("DSetMemXferPropList"); } - // 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 abd9c51..14ba706 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 0313acb..58199db 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 37d0da5..074d734 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 @@ -71,7 +71,7 @@ string Exception::getMajorString( hid_t err_major ) const // If H5Eget_msg() returns a negative value, raise an exception, if( mesg_size < 0 ) - throw IdComponentException("Exception::getMajorString", + throw IdComponentException("Exception::getMajorString", "H5Eget_msg failed"); // Call H5Eget_msg again to get the actual message @@ -80,7 +80,7 @@ string Exception::getMajorString( hid_t err_major ) const // Check for failure again if( mesg_size < 0 ) - throw IdComponentException("Exception::getMajorString", + throw IdComponentException("Exception::getMajorString", "H5Eget_msg failed"); // Convert the C error description and return @@ -107,7 +107,7 @@ string Exception::getMinorString( hid_t err_minor ) const // If H5Eget_msg() returns a negative value, raise an exception, if( mesg_size < 0 ) - throw IdComponentException("Exception::getMinorString", + throw IdComponentException("Exception::getMinorString", "H5Eget_msg failed"); // Call H5Eget_msg again to get the actual message @@ -116,7 +116,7 @@ string Exception::getMinorString( hid_t err_minor ) const // Check for failure again if( mesg_size < 0 ) - throw IdComponentException("Exception::getMinorString", + throw IdComponentException("Exception::getMinorString", "H5Eget_msg failed"); // Convert the C error description and return @@ -132,7 +132,7 @@ string Exception::getMinorString( hid_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. @@ -168,16 +168,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_stack_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_stack( H5E_DEFAULT, &func, client_data ); if( ret_value < 0 ) throw Exception( "Exception::getAutoPrint", "H5Eget_auto failed" ); @@ -325,7 +325,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 @@ -348,7 +348,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 @@ -371,7 +371,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 @@ -394,7 +394,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 @@ -417,7 +417,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 @@ -440,7 +440,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 @@ -463,7 +463,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 @@ -486,7 +486,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 @@ -509,7 +509,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 @@ -532,7 +532,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 4a5bf37..41a6e24 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_stack_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_stack_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 7e96bc0..4dede63 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. // Programmer: Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void FileAccPropList::setCache( int mdc_nelmts, size_t rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0 ) const @@ -594,7 +594,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 //-------------------------------------------------------------------------- @@ -628,8 +628,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 d77fa49..143c3ab 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 0eb9462..b776f6a 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,14 +151,14 @@ 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"); } } //-------------------------------------------------------------------------- // 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 @@ -173,14 +173,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 @@ -194,14 +194,14 @@ 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"); } } //-------------------------------------------------------------------------- // 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 @@ -215,7 +215,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"); } } @@ -236,7 +236,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 6b7bfcc..4ed8868 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 361d448..54c4f6d 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 //-------------------------------------------------------------------------- @@ -466,11 +466,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 //-------------------------------------------------------------------------- @@ -503,10 +503,10 @@ void* H5File::Reference(const string& 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 //-------------------------------------------------------------------------- @@ -546,7 +546,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 //-------------------------------------------------------------------------- @@ -599,30 +599,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 - June 1, 2004 //-------------------------------------------------------------------------- -H5File::~H5File() -{ +H5File::~H5File() +{ // The HDF5 file id will be closed properly try { decRefCount(); @@ -630,7 +630,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 3b7ffaf..0aad671 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 bc30963..45c992e 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; // Returns this class name diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp index 1d587c8..6bf25a1 100644 --- a/c++/src/H5Group.cpp +++ b/c++/src/H5Group.cpp @@ -103,7 +103,7 @@ void* Group::Reference(const char* name, DataSpace& dataspace, H5R_type_t ref_ty ///\return A reference ///\exception H5::GroupIException ///\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 @@ -137,10 +137,10 @@ void* Group::Reference(const string& 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::GroupIException // Programmer Binh-Minh Ribler - May, 2004 //-------------------------------------------------------------------------- @@ -222,16 +222,16 @@ void Group::throwException(const string func_name, const string msg) const // ID reference counting mechanism - June 1, 2004 //-------------------------------------------------------------------------- Group::~Group() -{ +{ // The group id will be closed properly try { decRefCount(); } - catch (Exception close_error) { + 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 51bdc02..ee6ea49 100644 --- a/c++/src/H5IdComponent.cpp +++ b/c++/src/H5IdComponent.cpp @@ -79,10 +79,10 @@ void IdComponent::decRefCount(const 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(inMemFunc("decRefCount"), + throw IdComponentException(inMemFunc("decRefCount"), "object ref count is 0 or negative"); else - throw IdComponentException(inMemFunc("decRefCount"), + throw IdComponentException(inMemFunc("decRefCount"), "decrementing object ref count failed"); } @@ -158,8 +158,8 @@ H5I_type_t IdComponent::getHDFObjType(const hid_t obj_id) // 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 //-------------------------------------------------------------------------- @@ -200,7 +200,7 @@ void IdComponent::setId(const 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 //-------------------------------------------------------------------------- @@ -216,8 +216,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 ) @@ -242,7 +242,7 @@ IdComponent::~IdComponent() { // // Implementation of protected functions for HDF5 Reference Interface. -// +// #ifndef DOXYGEN_SHOULD_SKIP_THIS //-------------------------------------------------------------------------- @@ -250,9 +250,9 @@ IdComponent::~IdComponent() { ///\brief Makes and returns string "::" ///\param func_name - Name of the function where failure occurs // Description -/// Concatenates the class name of this object with the -/// passed-in function name to create a string that indicates -/// where the failure occurs. The class-name is provided by +/// Concatenates the class name of this object with the +/// passed-in function name to create a string that indicates +/// where the failure occurs. The class-name is provided by /// fromClass(). This string will be used by a base class when /// an exception is thrown. // Programmer Binh-Minh Ribler - Aug 6, 2005 @@ -278,7 +278,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 //-------------------------------------------------------------------------- @@ -338,10 +338,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 //-------------------------------------------------------------------------- @@ -378,7 +378,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 ab43d0f..6178e3f 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; // Returns this class name 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 27c62ad..7e477ea 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(inMemFunc("getNumAttrs"), + throw AttributeIException(inMemFunc("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 //-------------------------------------------------------------------------- @@ -288,7 +288,7 @@ void H5Object::renameAttr(const char* oldname, const char* newname) const //-------------------------------------------------------------------------- // Function: H5Object::renameAttr ///\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 the names. // Programmer Binh-Minh Ribler - Mar, 2005 //-------------------------------------------------------------------------- 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 183c7d2..d16933c 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 @@ -514,18 +514,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 d444b52..28b1d32 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 @@ -191,7 +191,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 @@ -207,7 +207,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, @@ -223,8 +223,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 dc9cfc3..ff46e29 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(inMemFunc("getClass"), + throw PropListIException(inMemFunc("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 std::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 @@ -620,7 +620,7 @@ PropList PropList::getClassParent() const // ID reference counting mechanism - June 1, 2004 //-------------------------------------------------------------------------- PropList::~PropList() -{ +{ // The property list id will be closed properly try { decRefCount(); @@ -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 84883ad..35087a0 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 fbf4ac4..aef797d 100644 --- a/c++/src/H5StrType.h +++ b/c++/src/H5StrType.h @@ -31,25 +31,25 @@ 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; // Returns this class name virtual string fromClass () const { return ("StrType"); } - // 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 f721ea1..c0249c5 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"); } @@ -455,7 +455,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 @@ -465,37 +465,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); @@ -598,13 +598,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)"); @@ -618,7 +618,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; @@ -742,7 +742,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"); @@ -759,13 +759,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(); @@ -846,7 +846,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/tattr.cpp b/c++/test/tattr.cpp index ae1d986..64e2ad1 100644 --- a/c++/test/tattr.cpp +++ b/c++/test/tattr.cpp @@ -103,9 +103,9 @@ int attr_data1a[ATTR1_DIM1]={256,11945,-22107}; ** ** test_attr_basic_write(): Test basic write attribute. ** Tests integer attributes on both datasets and groups -** +** ****************************************************************/ -static void +static void test_attr_basic_write(void) { hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3}; @@ -114,10 +114,10 @@ test_attr_basic_write(void) int read_data1[ATTR1_DIM1]={0}; // Buffer for reading 1st attribute int i; - // Output message about test being performed + // Output message about test being performed MESSAGE(5, ("Testing Basic Attribute Writing Functions\n")); - try { + try { // Create file H5File fid1 (FILENAME, H5F_ACC_TRUNC); @@ -133,12 +133,12 @@ test_attr_basic_write(void) // Create an attribute for the dataset Attribute ds_attr1 = dataset.createAttribute (ATTR1_NAME, PredType::NATIVE_INT, att_space); - // Try creating an attribute that already exists. This should fail - // since two attributes cannot have the same name. If an exception - // is not thrown for this action by createAttribute, then throw an + // Try creating an attribute that already exists. This should fail + // since two attributes cannot have the same name. If an exception + // is not thrown for this action by createAttribute, then throw an // invalid action exception. try { - Attribute invalid_attr = dataset.createAttribute (ATTR1_NAME, PredType::NATIVE_INT, att_space); + Attribute invalid_attr = dataset.createAttribute (ATTR1_NAME, PredType::NATIVE_INT, att_space); // continuation here, that means no exception has been thrown throw InvalidActionException("H5File::createDataSet", "Library allowed overwrite of existing dataset"); @@ -197,7 +197,7 @@ test_attr_basic_write(void) try { Attribute invalid_attr = group.createAttribute (ATTR2_NAME, PredType::NATIVE_INT, sid3); // continuation here, that means no exception has been thrown - throw InvalidActionException("H5Group::createAttribute", + throw InvalidActionException("H5Group::createAttribute", "Attempting to create an existing attribute"); } catch (AttributeIException E) // catching invalid creating attribute @@ -208,7 +208,7 @@ test_attr_basic_write(void) // Check storage size for attribute attr_size = gr_attr.getStorageSize(); - verify_val((long)attr_size, (long)(ATTR2_DIM1*ATTR2_DIM2*sizeof(int)), + verify_val((long)attr_size, (long)(ATTR2_DIM1*ATTR2_DIM2*sizeof(int)), "Attribute::getStorageSize", __LINE__, __FILE__); } // end try block @@ -220,9 +220,9 @@ test_attr_basic_write(void) /**************************************************************** ** ** test_attr_rename(): Test renaming attribute function. -** +** ****************************************************************/ -static void +static void test_attr_rename(void) { int read_data1[ATTR1_DIM1]={0}; // Buffer for reading the attribute @@ -276,7 +276,7 @@ test_attr_rename(void) if(attr_data1a[i]!=read_data1[i]) TestErrPrintf("%d: attribute data different: attr_data1a[%d]=%d,read_data1[%d]=%d\n",__LINE__,i,attr_data1a[i],i,read_data1[i]); - // Close attribute + // Close attribute attr2.close(); // Change first attribute back to the original name @@ -291,9 +291,9 @@ test_attr_rename(void) /******************************************************************** ** ** test_attr_basic_read(): Test basic read attribute. -** +** ********************************************************************/ -static void +static void test_attr_basic_read(void) { int i, j; @@ -301,7 +301,7 @@ test_attr_basic_read(void) // Output message about test being performed MESSAGE(5, ("Testing Basic Attribute Reading Functions\n")); - try { + try { // Open file H5File fid1(FILENAME, H5F_ACC_RDWR); @@ -321,7 +321,7 @@ test_attr_basic_read(void) // Verify values read in for(i=0; i>>" << 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 @@ -259,7 +259,7 @@ test_h5s_basic(void) * with a special routine. *------------------------------------------------------------------------- */ -static void +static void test_h5s_scalar_write(void) { // Output message about test being performed @@ -305,7 +305,7 @@ test_h5s_scalar_write(void) } // test_h5s_scalar_write() /*------------------------------------------------------------------------- - * + * * Function: test_h5s_scalar_read * * Purpose: Test scalar H5S (dataspace) reading code @@ -324,7 +324,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 @@ -362,11 +362,11 @@ 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_null * * Purpose: Test null H5S (dataspace) code @@ -385,7 +385,7 @@ test_h5s_scalar_read(void) * with a special routine. *------------------------------------------------------------------------- */ -static void +static void test_h5s_null(void) { // Output message about test being performed @@ -403,7 +403,7 @@ test_h5s_null(void) n = sid1.getSimpleExtentNpoints(); verify_val((long)n, 0, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__); - // Create a dataset + // Create a dataset DataSet dataset = fid1.createDataSet("Dataset1", PredType::NATIVE_UINT,sid1); // Try to write nothing to the dataset @@ -420,10 +420,10 @@ test_h5s_null(void) } // test_h5s_null() /*------------------------------------------------------------------------- - * + * * 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 @@ -440,7 +440,7 @@ test_h5s_null(void) * with a special routine. *------------------------------------------------------------------------- */ -static void +static void test_h5s_compound_scalar_write(void) { // Output message about test being performed @@ -494,10 +494,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 @@ -514,7 +514,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 @@ -544,14 +544,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; @@ -569,7 +569,7 @@ test_h5s_compound_scalar_read(void) } // test_h5s_compound_scalar_read() /*------------------------------------------------------------------------- - * + * * Function: test_h5s * * Purpose: Main dataspace testing routine @@ -582,7 +582,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_dtransform.c b/examples/h5_dtransform.c index 3c15eec..2208e7e 100644 --- a/examples/h5_dtransform.c +++ b/examples/h5_dtransform.c @@ -12,8 +12,8 @@ * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* - * This example demonstrates how the data transform features of +/* + * This example demonstrates how the data transform features of * HDF5 works. * * (1) @@ -31,7 +31,7 @@ * (4) * Get the transform from the property using H5Pget_data_transform. */ - + #include "hdf5.h" #define ROWS 12 @@ -63,7 +63,7 @@ const float windchillF[ROWS][COLS] = } - + int main (void) @@ -71,8 +71,8 @@ main (void) hid_t file, dataset; /* file and dataset handles */ hid_t dataspace; /* handles */ hsize_t dimsf[2]; /* dataset dimensions */ - herr_t status; - hid_t dxpl_id_f_to_c, dxpl_id_c_to_f; /* data transform handles */ + herr_t status; + hid_t dxpl_id_f_to_c, dxpl_id_c_to_f; /* data transform handles */ const char* f_to_c = "(5/9.0)*(x-32)"; const char* c_to_f = "(9/5.0)*x + 32"; char* transform; @@ -88,11 +88,11 @@ main (void) /* * Describe the size of the array and create the data space for fixed - * size dataset. + * size dataset. */ dimsf[0] = ROWS; dimsf[1] = COLS; - dataspace = H5Screate_simple(2, dimsf, NULL); + dataspace = H5Screate_simple(2, dimsf, NULL); /* * Create a new dataset within the file using defined dataspace and @@ -125,11 +125,11 @@ main (void) /* Print the data from the read*/ printf("\nData with no write transform, but a read transform: \n"); PRINT(windchillC); - + /**************** PART 2 **************/ /* - * Write the data to the dataset with the f_to_c transform set + * Write the data to the dataset with the f_to_c transform set */ status = H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillF); @@ -142,8 +142,8 @@ main (void) PRINT(windchillC); /************** PART 3 ***************/ - - + + /* Create the dataset transfer property list */ dxpl_id_c_to_f = H5Pcreate(H5P_DATASET_XFER); @@ -156,7 +156,7 @@ main (void) */ status = H5Dwrite(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillF); - + /* Read the data with the c_to_f data transform */ H5Dread(dataset, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_c_to_f, windchillC); @@ -168,9 +168,9 @@ main (void) transform_size = H5Pget_data_transform(dxpl_id_f_to_c, NULL, 0); transform = (char*) malloc(transform_size+1); H5Pget_data_transform(dxpl_id_f_to_c, transform, transform_size+1); - + printf("\nTransform string (from dxpl_id_f_to_c) is: %s\n", transform); - + /* * Close/release resources. */ @@ -179,6 +179,6 @@ main (void) H5Sclose(dataspace); H5Dclose(dataset); H5Fclose(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 1541626..f19e206 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 @@ -115,8 +115,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 @@ -125,7 +125,7 @@ nh5awritec_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims) * Programmer: Elena Pourmal * Thursday, August 12, 1999 * Modifications: dims parameter added - * April 4, 2001 + * April 4, 2001 *---------------------------------------------------------------------------*/ int_f nh5awrite_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims) @@ -140,12 +140,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. @@ -167,8 +167,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. @@ -196,7 +196,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 @@ -204,7 +204,7 @@ done: * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5aclose_c ( hid_t_f *attr_id ) { int_f ret_value=0; /* Return value */ @@ -218,9 +218,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 @@ -248,13 +248,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 @@ -275,13 +275,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 @@ -301,12 +301,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 @@ -326,14 +326,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 @@ -352,13 +352,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 @@ -376,7 +376,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 d8abc88..68ff852 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 @@ -99,7 +99,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; /* @@ -115,12 +115,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 @@ -136,7 +136,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. */ @@ -147,8 +147,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 @@ -175,7 +175,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. */ @@ -188,19 +188,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 @@ -233,9 +233,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. */ @@ -253,13 +253,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 @@ -284,7 +284,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. */ @@ -294,10 +294,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. */ @@ -310,14 +310,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 @@ -333,7 +333,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. */ @@ -344,8 +344,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 @@ -372,7 +372,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. */ @@ -390,13 +390,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 @@ -420,7 +420,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. */ @@ -440,7 +440,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; @@ -449,13 +449,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 @@ -479,7 +479,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. */ @@ -497,20 +497,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 @@ -530,7 +530,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 @@ -539,14 +539,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; @@ -556,7 +556,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 @@ -565,13 +565,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); @@ -585,7 +585,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 @@ -594,13 +594,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); @@ -614,16 +614,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; @@ -647,9 +647,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; @@ -659,9 +659,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 @@ -669,7 +669,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; @@ -687,9 +687,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 @@ -697,7 +697,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; @@ -714,20 +714,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); @@ -735,11 +735,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 @@ -752,7 +752,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; @@ -768,7 +768,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]; @@ -778,14 +778,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_f *)buf; + tmp = (int_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. */ @@ -800,11 +800,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 @@ -817,7 +817,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; @@ -832,7 +832,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; @@ -840,10 +840,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. @@ -851,7 +851,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_f)); } H5Dvlen_reclaim(c_mem_type_id, c_mem_space_id, H5P_DEFAULT, c_buf); @@ -864,13 +864,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 @@ -879,7 +879,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; @@ -895,7 +895,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]; @@ -908,7 +908,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 */ @@ -923,7 +923,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; } @@ -943,12 +943,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 @@ -958,7 +958,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; @@ -974,7 +974,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]; @@ -987,7 +987,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; /* @@ -1017,11 +1017,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 @@ -1034,7 +1034,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; @@ -1050,7 +1050,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]; @@ -1060,14 +1060,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. */ @@ -1082,11 +1082,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 @@ -1099,7 +1099,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; @@ -1114,7 +1114,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; @@ -1122,10 +1122,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. @@ -1133,10 +1133,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: @@ -1161,7 +1161,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. */ @@ -1195,7 +1195,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. */ @@ -1204,7 +1204,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 @@ -1226,7 +1226,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 */ @@ -1236,5 +1236,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 6bd6d74..3c47ee2 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_stack(H5E_DEFAULT); + status = H5Eclear_stack(H5E_DEFAULT); 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_stack(H5E_DEFAULT, 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 @@ -133,16 +133,16 @@ nh5eget_major_c(int_f* error_no, _fcd name, size_t_f* namelen) * Call H5Eget_major function. */ H5Eget_msg(c_error_no, NULL, c_name, c_namelen); - HD5packFstring((char*)c_name, _fcdtocp(name), c_namelen); - + HD5packFstring((char*)c_name, _fcdtocp(name), c_namelen); + 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 @@ -167,18 +167,18 @@ nh5eget_minor_c(int_f* error_no, _fcd name, size_t_f* namelen) * Call H5Eget_minor function. */ H5Eget_msg(c_error_no, NULL, c_name, c_namelen); - HD5packFstring((char*)c_name, _fcdtocp(name), c_namelen); - + HD5packFstring((char*)c_name, _fcdtocp(name), c_namelen); + 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 1a8aa13..6803674 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 "H5public.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 cc3fb36..4b21b45 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, (size_t)c_namelen); + c_name = (char *)HD5f2cstring(name, (size_t)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, (size_t)c_namelen); + c_name = (char *)HD5f2cstring(dsetname, (size_t)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, (size_t)c_namelen); + c_name = (char *)HD5f2cstring(dsetname, (size_t)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, (size_t)c_namelen); + c_name = (char *)HD5f2cstring(name, (size_t)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, (size_t)c_namelen); + c_name = (char *)HD5f2cstring(name, (size_t)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 2b6e8be..91508c0 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 @@ -1131,7 +1131,7 @@ nh5pset_cache_c(hid_t_f *prp_id, int_f* mdc_nelmts, size_t_f* rdcc_nelmts, size * Friday, February 25, 2000 * Modifications: Changed type of the rdcc_w0 parameter to be real_f instead of double * Changed type of the rdcc_nelmts parameter to be int_f. - * EIP October 10, 2003 + * EIP October 10, 2003 *---------------------------------------------------------------------------*/ int_f nh5pget_cache_c(hid_t_f *prp_id, int_f* mdc_nelmts, size_t_f* rdcc_nelmts, size_t_f* rdcc_nbytes , real_f* rdcc_w0) @@ -1140,9 +1140,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. */ @@ -1153,21 +1153,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 @@ -1180,14 +1180,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; } @@ -1197,7 +1197,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; @@ -1213,16 +1213,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 @@ -1235,9 +1235,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; @@ -1252,25 +1252,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 @@ -1295,14 +1295,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 @@ -1355,7 +1355,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 @@ -1388,7 +1388,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. @@ -1410,7 +1410,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; @@ -1465,17 +1465,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 @@ -1506,8 +1506,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. */ @@ -1520,29 +1520,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 @@ -1560,10 +1560,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; /* @@ -1610,14 +1610,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 @@ -1641,35 +1641,35 @@ 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. */ c_prp_id = (hid_t)*prp_id; - c_idx = (unsigned)*idx; + c_idx = (unsigned)*idx; status = H5Pget_external(c_prp_id, c_idx, c_namelen, c_name, &c_offset, &size ); if (status < 0) goto DONE; *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_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 @@ -1696,17 +1696,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 @@ -1731,11 +1731,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 @@ -1748,16 +1748,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; @@ -1766,7 +1766,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 @@ -1778,34 +1778,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; @@ -1820,16 +1820,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; @@ -1854,7 +1854,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; @@ -1869,7 +1869,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 @@ -1879,7 +1879,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; @@ -1894,7 +1894,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 @@ -1904,7 +1904,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; @@ -1929,7 +1929,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; @@ -1954,7 +1954,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; @@ -1972,14 +1972,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; @@ -1995,7 +1995,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 @@ -2003,7 +2003,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; @@ -2020,14 +2020,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; @@ -2043,7 +2043,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 @@ -2051,7 +2051,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; @@ -2068,14 +2068,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; @@ -2091,7 +2091,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 @@ -2099,7 +2099,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; @@ -2116,14 +2116,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; @@ -2139,7 +2139,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 @@ -2147,7 +2147,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; @@ -2156,7 +2156,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; } /*---------------------------------------------------------------------------- @@ -2179,7 +2179,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; @@ -2198,11 +2198,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 @@ -2213,7 +2213,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 */ @@ -2223,12 +2223,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 @@ -2242,7 +2242,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; @@ -2259,11 +2259,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 @@ -2274,7 +2274,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 */ @@ -2288,8 +2288,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 @@ -2303,7 +2303,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; @@ -2321,7 +2321,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 @@ -2339,7 +2339,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; @@ -2355,8 +2355,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 @@ -2402,7 +2402,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; @@ -2447,7 +2447,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 @@ -2477,7 +2477,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 @@ -2495,7 +2495,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; @@ -2528,7 +2528,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; @@ -2560,7 +2560,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; @@ -2599,7 +2599,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 @@ -2620,7 +2620,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); @@ -2646,7 +2646,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 */ @@ -2660,7 +2660,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 @@ -2673,7 +2673,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; @@ -2703,7 +2703,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 */ @@ -2717,7 +2717,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 @@ -2730,7 +2730,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; @@ -2746,8 +2746,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 @@ -2755,7 +2755,7 @@ DONE: * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5pset_shuffle_c ( hid_t_f *prp_id ) { int_f ret_value = 0; @@ -2770,14 +2770,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; @@ -2793,7 +2793,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 @@ -2801,7 +2801,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; @@ -2819,7 +2819,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 @@ -2827,7 +2827,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; @@ -2843,7 +2843,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 @@ -2851,7 +2851,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; @@ -2869,9 +2869,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 @@ -2882,7 +2882,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) { @@ -2890,9 +2890,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; @@ -2910,7 +2910,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); @@ -2921,11 +2921,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; for (i=0; i < H5FD_MEM_NTYPES; i++) { c_memb_map[i] = (H5FD_mem_t)memb_map[i]; @@ -2933,9 +2933,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 */ @@ -2953,19 +2953,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; @@ -2982,10 +2982,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 @@ -2995,16 +2995,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; @@ -3018,7 +3018,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 @@ -3032,13 +3032,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]; @@ -3048,8 +3048,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); @@ -3060,7 +3060,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 @@ -3069,7 +3069,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; @@ -3093,7 +3093,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 @@ -3101,13 +3101,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; /* @@ -3123,15 +3123,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 @@ -3161,8 +3161,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. */ @@ -3173,23 +3173,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. @@ -3211,7 +3211,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; @@ -3237,7 +3237,7 @@ DONE: /*---------------------------------------------------------------------------- * Name: h5premove_filter_c * Purpose: Call H5Premove_filter to delete one or more filters - * Inputs: prp_id - property list identifier + * Inputs: prp_id - property list identifier * filter - Filter to be deleted * Returns: 0 on success, -1 on failure * Programmer: Quincey Koziol @@ -3250,7 +3250,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 df93eae..a7f2b1b 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_NULL_F (2) + * H5S_SCALAR_F (0), H5S_SIMPLE_F (1), H5S_NULL_F (2) * 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); @@ -527,17 +527,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; @@ -568,10 +568,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 @@ -579,7 +579,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; @@ -603,7 +603,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); @@ -615,10 +615,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 @@ -626,7 +626,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; @@ -664,9 +664,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 @@ -675,7 +675,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; @@ -692,8 +692,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 @@ -701,7 +701,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; @@ -710,22 +710,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; @@ -733,19 +733,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 @@ -755,7 +755,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; @@ -763,7 +763,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; @@ -816,10 +816,10 @@ DONE: #ifdef NEW_HYPERSLAB_API /*---------------------------------------------------------------------------- * Name: h5scombine_hyperslab_c - * Purpose: Call H5Scombine_hyperslab - * Inputs: space_id - identifier of the dataspace + * Purpose: Call H5Scombine_hyperslab + * Inputs: space_id - identifier of the dataspace * operator - defines how the new selection is combined - * start - offset of start of hyperslab + * 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 @@ -830,7 +830,7 @@ DONE: * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5scombine_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, hid_t_f *hyper_id) { int ret_value = -1; @@ -839,7 +839,7 @@ nh5scombine_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; @@ -890,9 +890,9 @@ DONE: /*---------------------------------------------------------------------------- * Name: h5scombine_select_c * Purpose: Call H5Scombine_ select - * Inputs: space1_id - identifier of the first dataspace + * Inputs: space1_id - identifier of the first dataspace * operator - defines how the new selection is combined - * space2_id - identifier of the second dataspace + * space2_id - identifier of the second dataspace * Outputs: ds_id - identifier for the new dataspace * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal @@ -900,7 +900,7 @@ DONE: * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5scombine_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id, hid_t_f *ds_id) { int ret_value = -1; @@ -924,14 +924,14 @@ nh5scombine_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id, hid_t * Purpose: Call H5Sselect_ select * Inputs: space1_id - identifier of the first dataspace to modify * operator - defines how the new selection is combined - * space2_id - identifier of the second dataspace + * space2_id - identifier of the second dataspace * Returns: 0 on success, -1 on failure * Programmer: Elena Pourmal * Monday, October 7, 2002 * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sselect_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id) { int ret_value = -1; @@ -951,7 +951,7 @@ nh5sselect_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id) /*---------------------------------------------------------------------------- * 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 @@ -959,7 +959,7 @@ nh5sselect_select_c ( hid_t_f *space1_id , int_f *op, hid_t_f *space2_id) * Modifications: *---------------------------------------------------------------------------*/ -int_f +int_f nh5sget_select_type_c ( hid_t_f *space_id , int_f *type) { int ret_value = -1; @@ -977,20 +977,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; @@ -1021,7 +1021,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 cd1ccd0..a4ac7bd 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 = (hid_t)*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; @@ -1474,7 +1474,7 @@ nh5tenum_valueof_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value) int c_namelen; 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; @@ -1482,16 +1482,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; - 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 @@ -1500,7 +1500,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; @@ -1515,16 +1515,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 @@ -1541,23 +1541,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 @@ -1576,10 +1576,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; } /*---------------------------------------------------------------------------- @@ -1603,14 +1603,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 @@ -1619,7 +1619,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; @@ -1636,7 +1636,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. @@ -1646,7 +1646,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 8b244f0..745dfe4 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: *---------------------------------------------------------------------------*/ @@ -112,49 +112,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 ) { @@ -175,13 +175,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 * h5f_flags - H5F interface flags * h5fd_flags - H5FD interface flags * h5fd_hid_flags- H5FD interface flags of type hid_t @@ -192,18 +192,18 @@ 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 - * Added more FD flags for HDF5 file driver - * EIP, April 9, 2005 + * Added more FD flags for HDF5 file driver + * EIP, April 9, 2005 *---------------------------------------------------------------------------*/ int_f nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags, - int_f *h5fd_flags, hid_t_f *h5fd_hid_flags, + int_f *h5fd_flags, hid_t_f *h5fd_hid_flags, int_f *h5g_flags, int_f *h5i_flags, hid_t_f *h5p_flags, int_f *h5r_flags, int_f *h5s_flags, int_f *h5t_flags, int_f *h5z_flags) @@ -235,7 +235,7 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags, /* * 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; @@ -264,7 +264,7 @@ nh5init_flags_c( int_f *h5d_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; /* @@ -308,8 +308,8 @@ nh5init_flags_c( int_f *h5d_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; @@ -328,9 +328,9 @@ nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags, */ - h5s_flags[0] = H5S_SCALAR; - h5s_flags[1] = H5S_SIMPLE; - h5s_flags[2] = H5S_NULL; + h5s_flags[0] = H5S_SCALAR; + h5s_flags[1] = H5S_SIMPLE; + h5s_flags[2] = H5S_NULL; h5s_flags[3] = H5S_SELECT_SET; h5s_flags[4] = H5S_SELECT_OR; h5s_flags[5] = (int_f)H5S_UNLIMITED; @@ -357,29 +357,29 @@ nh5init_flags_c( int_f *h5d_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_CSET_UTF8; h5t_flags[25] = H5T_STR_NULLTERM; @@ -407,7 +407,7 @@ nh5init_flags_c( int_f *h5d_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; } @@ -419,7 +419,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; } @@ -427,8 +427,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 @@ -436,16 +436,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 @@ -453,24 +453,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: *---------------------------------------------------------------------------*/ @@ -479,30 +479,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: *---------------------------------------------------------------------------*/ @@ -511,22 +511,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: *---------------------------------------------------------------------------*/ @@ -535,16 +535,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: *---------------------------------------------------------------------------*/ @@ -553,7 +553,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 864da1c..a9d15ae 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 "H5private.h" 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 38f6b53..5d972f9 100644 --- a/fortran/src/H5f90proto.h +++ b/fortran/src/H5f90proto.h @@ -236,14 +236,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 */ # define nh5topen_c H5_FC_FUNC_(h5topen_c, H5TOPEN_C) @@ -361,7 +361,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 */ # define nh5pcreate_c H5_FC_FUNC_(h5pcreate_c, H5PCREATE_C) @@ -463,7 +463,7 @@ H5_FCDLL int_f nh5tget_member_class_c ( hid_t_f *type_id , int_f *member_no, in # define nh5pset_fletcher32_c H5_FC_FUNC_(h5pset_fletcher32_c, H5PSET_FLETCHER32_C) # define nh5pset_edc_check_c H5_FC_FUNC_(h5pset_edc_check_c, H5PSET_EDC_CHECK_C) # define nh5pget_edc_check_c H5_FC_FUNC_(h5pget_edc_check_c, H5PGET_EDC_CHECK_C) -# define nh5pset_family_offset_c H5_FC_FUNC_(h5pset_family_offset_c, H5PSET_FAMILY_OFFSET_C) +# define nh5pset_family_offset_c H5_FC_FUNC_(h5pset_family_offset_c, H5PSET_FAMILY_OFFSET_C) # define nh5pget_fapl_multi_c H5_FC_FUNC_(h5pget_fapl_multi_c, H5PGET_FAPL_MULTI_C) # define nh5pset_fapl_multi_c H5_FC_FUNC_(h5pset_fapl_multi_c, H5PSET_FAPL_MULTI_C) # define nh5pset_fapl_multi_sc H5_FC_FUNC_(h5pset_fapl_multi_sc, H5PSET_FAPL_MULTI_SC) @@ -548,23 +548,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 ); @@ -575,11 +575,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 */ # define nh5rcreate_object_c H5_FC_FUNC_(h5rcreate_object_c, H5RCREATE_OBJECT_C) # define nh5rcreate_region_c H5_FC_FUNC_(h5rcreate_region_c, H5RCREATE_REGION_C) @@ -614,7 +614,7 @@ H5_FCDLL int_f nh5iget_ref_c(hid_t_f *obj_id, int_f *ref_count); H5_FCDLL int_f nh5iget_file_id_c(hid_t_f *obj_id, hid_t_f *file_id); /* - * Functions from H5Ef.c + * Functions from H5Ef.c */ # define nh5eclear_c H5_FC_FUNC_(h5eclear_c, H5ECLEAR_C) # define nh5eprint_c1 H5_FC_FUNC_(h5eprint_c1, H5EPRINT_C1) @@ -632,7 +632,7 @@ H5_FCDLL int_f nh5eget_minor_c(int_f* error_no, _fcd name, size_t_f* namelen); H5_FCDLL int_f nh5eset_auto_c(int_f* printflag); /* - * Functions from H5f.c + * Functions from H5f.c */ # define nh5open_c H5_FC_FUNC_(h5open_c, H5OPEN_C) # define nh5close_c H5_FC_FUNC_(h5close_c, H5CLOSE_C) @@ -654,8 +654,8 @@ H5_FCDLL int_f nh5init_flags_c( int_f *h5d_flags, int_f *h5f_flags, int_f *h5fd_flags, hid_t_f *h5fd_hid_flags, int_f *h5g_flags, int_f *h5i_flags, hid_t_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/src/H5match_types.c b/fortran/src/H5match_types.c index 2edc813..2c11a29 100644 --- a/fortran/src/H5match_types.c +++ b/fortran/src/H5match_types.c @@ -221,13 +221,13 @@ int main() #endif /* int */ -#if defined H5_FORTRAN_HAS_NATIVE_8 +#if defined H5_FORTRAN_HAS_NATIVE_8 writeToFiles("INT", "int_f", 8); -#elif defined H5_FORTRAN_HAS_NATIVE_4 +#elif defined H5_FORTRAN_HAS_NATIVE_4 writeToFiles("INT", "int_f", 4); -#elif defined H5_FORTRAN_HAS_NATIVE_2 +#elif defined H5_FORTRAN_HAS_NATIVE_2 writeToFiles("INT", "int_f", 2); -#elif defined H5_FORTRAN_HAS_NATIVE_1 +#elif defined H5_FORTRAN_HAS_NATIVE_1 writeToFiles("INT", "int_f", 1); #else /* Error: couldn't find a size for int */ 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 d66f882..79c6d4b 100644 --- a/fortran/test/t.h +++ b/fortran/test/t.h @@ -26,12 +26,12 @@ char *h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size) # define nh5_cleanup_c H5_FC_FUNC_(h5_cleanup_c, H5_CLEANUP_C) # define nh5_exit_c H5_FC_FUNC_(h5_exit_c, H5_EXIT_C) -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/c++/src/H5PacketTable.cpp b/hl/c++/src/H5PacketTable.cpp index 3f77d8f..010d1a1 100644 --- a/hl/c++/src/H5PacketTable.cpp +++ b/hl/c++/src/H5PacketTable.cpp @@ -30,7 +30,7 @@ } /* IsValid - * Returns true if this packet table is valid, false otherwise. + * Returns true if this packet table is valid, false otherwise. * Use this after the constructor to ensure HDF did not have * any trouble making or opening the packet table. */ @@ -89,7 +89,7 @@ /* Constructor * Creates a packet table in which to store fixed length records. * Takes the ID of the file the packet table will be created in, the name of - * the packet table, the ID of the datatype of the set, and the size + * the packet table, the ID of the datatype of the set, and the size * of a memory chunk used in chunking. */ FL_PacketTable::FL_PacketTable(hid_t fileID, char* name, hid_t dtypeID, int chunkSize) @@ -177,7 +177,7 @@ { return H5PTget_next(table_id, numRecords, data); } - + /********************************/ /* Variable-Length Packet Table */ diff --git a/hl/c++/src/H5PacketTable.h b/hl/c++/src/H5PacketTable.h index 1d6ba31..1e0e4c6 100644 --- a/hl/c++/src/H5PacketTable.h +++ b/hl/c++/src/H5PacketTable.h @@ -31,7 +31,7 @@ public: ~PacketTable(); /* IsValid - * Returns true if this packet table is valid, false otherwise. + * Returns true if this packet table is valid, false otherwise. * Use this after the constructor to ensure HDF did not have * any trouble making or opening the packet table. */ @@ -78,7 +78,7 @@ public: /* Constructor * Creates a packet table in which to store fixed length records. * Takes the ID of the file the packet table will be created in, the name of - * the packet table, the ID of the datatype of the set, and the size + * the packet table, the ID of the datatype of the set, and the size * of a memory chunk used in chunking. */ FL_PacketTable(hid_t fileID, char* name, hid_t dtypeID, int chunkSize); diff --git a/hl/c++/test/ptableTest.cpp b/hl/c++/test/ptableTest.cpp index 9dc2bffe..f2db380 100644 --- a/hl/c++/test/ptableTest.cpp +++ b/hl/c++/test/ptableTest.cpp @@ -84,7 +84,7 @@ int BasicTest() wrapper.AppendPacket(&myRecord); /* get number of records test */ - count = wrapper.GetPacketCount(); + count = wrapper.GetPacketCount(); if(count != 2) goto out; @@ -374,7 +374,7 @@ int SystemTest() hid_t dtypeID1, dtypeID2; unsigned int count; - /* Creating two inter-related datatypes. Create two datasets and put + /* Creating two inter-related datatypes. Create two datasets and put * one datatype in each. */ typedef struct compoundType { diff --git a/hl/fortran/src/H5IMcc.c b/hl/fortran/src/H5IMcc.c index 192d58a..0ff802d 100644 --- a/hl/fortran/src/H5IMcc.c +++ b/hl/fortran/src/H5IMcc.c @@ -22,7 +22,7 @@ * private functions *------------------------------------------------------------------------- */ -herr_t H5IM_get_palette( hid_t loc_id, +herr_t H5IM_get_palette( hid_t loc_id, const char *image_name, int pal_number, hid_t tid, @@ -49,8 +49,8 @@ herr_t H5IM_get_palette( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5IMmake_image_8bitf( hid_t loc_id, - const char *dset_name, +herr_t H5IMmake_image_8bitf( hid_t loc_id, + const char *dset_name, hsize_t width, hsize_t height, int_f *buf ) @@ -58,17 +58,17 @@ herr_t H5IMmake_image_8bitf( hid_t loc_id, hid_t did; /* dataset ID */ hid_t sid; /* space ID */ hsize_t dims[IMAGE8_RANK]; /* dimensions */ - + /* initialize the image dimensions */ - dims[0] = height; - dims[1] = width; - dims[2] = 1; + dims[0] = height; + dims[1] = width; + dims[2] = 1; /*------------------------------------------------------------------------- * create and write the dataset *------------------------------------------------------------------------- */ - + /* create the data space for the dataset. */ if ((sid=H5Screate_simple(IMAGE8_RANK,dims,NULL))<0) return -1; @@ -80,7 +80,7 @@ herr_t H5IMmake_image_8bitf( hid_t loc_id, /* write with memory type H5T_NATIVE_INT */ /* Use long type if Fortran integer is 8 bytes and C long long is also 8 bytes*/ /* Fail if otherwise */ - if (buf) + if (buf) { if (sizeof(int_f) == sizeof(int)) { if (H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0) @@ -105,7 +105,7 @@ herr_t H5IMmake_image_8bitf( hid_t loc_id, * attach the specification attributes *------------------------------------------------------------------------- */ - + /* attach the CLASS attribute */ if ( H5LTset_attribute_string( loc_id, dset_name, "CLASS", IMAGE_CLASS ) < 0 ) return -1; @@ -139,9 +139,9 @@ herr_t H5IMmake_image_8bitf( hid_t loc_id, * The memory datatype is H5T_NATIVE_INT. It is supposed to be called from * the FORTRAN interface where the image buffer is defined as type "integer" * - * 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: @@ -149,8 +149,8 @@ herr_t H5IMmake_image_8bitf( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5IMmake_image_24bitf( hid_t loc_id, - const char *dset_name, +herr_t H5IMmake_image_24bitf( hid_t loc_id, + const char *dset_name, hsize_t width, hsize_t height, const char *interlace, @@ -164,28 +164,28 @@ herr_t H5IMmake_image_24bitf( hid_t loc_id, * attach the image dimensions according to the interlace mode *------------------------------------------------------------------------- */ - 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] = IMAGE24_RANK; + dims[0] = height; + dims[1] = width; + dims[2] = IMAGE24_RANK; } 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] = IMAGE24_RANK; - dims[1] = height; - dims[2] = width; + dims[0] = IMAGE24_RANK; + dims[1] = height; + dims[2] = width; } else return -1; - + /*------------------------------------------------------------------------- * create and write the dataset *------------------------------------------------------------------------- */ - + /* create the data space for the dataset. */ if ((sid=H5Screate_simple(IMAGE24_RANK,dims,NULL))<0) return -1; @@ -195,7 +195,7 @@ herr_t H5IMmake_image_24bitf( hid_t loc_id, return -1; /* write with memory type H5T_NATIVE_INT */ - if (buf) + if (buf) { if (sizeof(int_f) == sizeof(int)) { if (H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0) @@ -263,11 +263,11 @@ herr_t H5IMmake_image_24bitf( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5IMread_imagef( hid_t loc_id, - const char *dset_name, +herr_t H5IMread_imagef( hid_t loc_id, + const char *dset_name, int_f *buf ) { - hid_t did; + hid_t did; /* open the dataset */ if ( (did = H5Dopen( loc_id, dset_name )) < 0 ) @@ -314,7 +314,7 @@ out: * The memory datatype is H5T_NATIVE_INT. It is supposed to be called from * the FORTRAN interface where the image buffer is defined as type "integer" * - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: @@ -322,20 +322,20 @@ out: *------------------------------------------------------------------------- */ -herr_t H5IMmake_palettef( hid_t loc_id, +herr_t H5IMmake_palettef( hid_t loc_id, const char *pal_name, const hsize_t *pal_dims, - int_f *pal_data ) + int_f *pal_data ) + +{ -{ - hid_t did; /* dataset ID */ hid_t sid; /* space ID */ 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; @@ -344,7 +344,7 @@ herr_t H5IMmake_palettef( hid_t loc_id, * create and write the dataset *------------------------------------------------------------------------- */ - + /* create the data space for the dataset. */ if ((sid=H5Screate_simple(2,pal_dims,NULL))<0) return -1; @@ -354,7 +354,7 @@ herr_t H5IMmake_palettef( hid_t loc_id, return -1; /* write with memory type H5T_NATIVE_INT */ - if (pal_data) + if (pal_data) { if (sizeof(int_f) == sizeof(int)) { if (H5Dwrite(did,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,pal_data)<0) @@ -387,7 +387,7 @@ herr_t H5IMmake_palettef( 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; } @@ -409,7 +409,7 @@ herr_t H5IMmake_palettef( hid_t loc_id, * The memory datatype is H5T_NATIVE_INT. It is supposed to be called from * the FORTRAN interface where the image buffer is defined as type "integer" * - * based on HDF5 Image and Palette Specification + * based on HDF5 Image and Palette Specification * http://hdf.ncsa.uiuc.edu/HDF5/H5Image/ImageSpec.html * * Modifications: @@ -417,7 +417,7 @@ herr_t H5IMmake_palettef( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5IMget_palettef( hid_t loc_id, +herr_t H5IMget_palettef( hid_t loc_id, const char *image_name, int pal_number, int_f *pal_data ) @@ -447,19 +447,19 @@ herr_t H5IMget_palettef( hid_t loc_id, * Comments: * This function allows reading of an 8bit palette from disk disk * to memory type TID - * The memory datatype can be H5T_NATIVE_INT or H5T_NATIVE_UCHAR currently. + * The memory datatype can be H5T_NATIVE_INT or H5T_NATIVE_UCHAR currently. * the H5T_NATIVE_INT is supposed to be called from * the FORTRAN interface where the image buffer is defined as type "integer" * * 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: * *------------------------------------------------------------------------- */ -herr_t H5IM_get_palette( hid_t loc_id, +herr_t H5IM_get_palette( hid_t loc_id, const char *image_name, int pal_number, hid_t tid, @@ -488,7 +488,7 @@ herr_t H5IM_get_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; @@ -528,13 +528,13 @@ herr_t H5IM_get_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; diff --git a/hl/fortran/src/H5IMcc.h b/hl/fortran/src/H5IMcc.h index 32c79ff..d568d73 100644 --- a/hl/fortran/src/H5IMcc.h +++ b/hl/fortran/src/H5IMcc.h @@ -31,29 +31,29 @@ extern "C" { -herr_t H5IMmake_image_8bitf( hid_t loc_id, - const char *dset_name, +herr_t H5IMmake_image_8bitf( hid_t loc_id, + const char *dset_name, hsize_t width, hsize_t height, int_f *buf ); -herr_t H5IMmake_image_24bitf( hid_t loc_id, - const char *dset_name, +herr_t H5IMmake_image_24bitf( hid_t loc_id, + const char *dset_name, hsize_t width, hsize_t height, const char *interlace, int_f *buf); -herr_t H5IMread_imagef( hid_t loc_id, - const char *dset_name, +herr_t H5IMread_imagef( hid_t loc_id, + const char *dset_name, int_f *buf ); -herr_t H5IMmake_palettef( hid_t loc_id, +herr_t H5IMmake_palettef( hid_t loc_id, const char *pal_name, const hsize_t *pal_dims, int_f *pal_data ); -herr_t H5IMget_palettef( hid_t loc_id, +herr_t H5IMget_palettef( hid_t loc_id, const char *image_name, int pal_number, int_f *pal_data ); diff --git a/hl/fortran/src/H5IMfc.c b/hl/fortran/src/H5IMfc.c index 7d09f10..822dbe6 100755 --- a/hl/fortran/src/H5IMfc.c +++ b/hl/fortran/src/H5IMfc.c @@ -22,7 +22,7 @@ /*------------------------------------------------------------------------- * Function: h5immake_image_8bit_c * - * Purpose: Call H5IMmake_image_8bit + * Purpose: Call H5IMmake_image_8bit * * Return: Success: 0, Failure: -1 * @@ -39,11 +39,11 @@ */ int_f -nh5immake_image_8bit_c (hid_t_f *loc_id, +nh5immake_image_8bit_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, hsize_t_f *width, - hsize_t_f *height, + hsize_t_f *height, int_f *buf) { int ret_value = -1; @@ -56,7 +56,7 @@ nh5immake_image_8bit_c (hid_t_f *loc_id, * Convert FORTRAN name to C name */ 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; /* @@ -68,12 +68,12 @@ nh5immake_image_8bit_c (hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: h5imread_image_c * - * Purpose: Call H5IMread_image + * Purpose: Call H5IMread_image * * Return: Success: 0, Failure: -1 * @@ -90,9 +90,9 @@ nh5immake_image_8bit_c (hid_t_f *loc_id, */ int_f -nh5imread_image_c (hid_t_f *loc_id, +nh5imread_image_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, int_f *buf) { int ret_value = -1; @@ -106,7 +106,7 @@ nh5imread_image_c (hid_t_f *loc_id, * Convert FORTRAN name to C name */ 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; /* @@ -119,12 +119,12 @@ nh5imread_image_c (hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: h5immake_image_24bit_c * - * Purpose: Call H5IMmake_image_24bit + * Purpose: Call H5IMmake_image_24bit * * Return: Success: 0, Failure: -1 * @@ -141,11 +141,11 @@ nh5imread_image_c (hid_t_f *loc_id, */ int_f -nh5immake_image_24bit_c (hid_t_f *loc_id, +nh5immake_image_24bit_c (hid_t_f *loc_id, int_f *namelen, _fcd name, int_f *ilen, - _fcd il, + _fcd il, hsize_t_f *width, hsize_t_f *height, void *buf) @@ -162,11 +162,11 @@ nh5immake_image_24bit_c (hid_t_f *loc_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; c_ilen = *ilen; - c_il = (char *)HD5f2cstring(il, c_ilen); + c_il = (char *)HD5f2cstring(il, c_ilen); if (c_il == NULL) return ret_value; /* @@ -179,12 +179,12 @@ nh5immake_image_24bit_c (hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: h5imget_image_info_c * - * Purpose: Call H5IMget_image_info + * Purpose: Call H5IMget_image_info * * Return: Success: 0, Failure: -1 * @@ -201,7 +201,7 @@ nh5immake_image_24bit_c (hid_t_f *loc_id, */ int_f -nh5imget_image_info_c(hid_t_f *loc_id, +nh5imget_image_info_c(hid_t_f *loc_id, int_f *namelen, _fcd name, hsize_t_f *width, @@ -226,7 +226,7 @@ nh5imget_image_info_c(hid_t_f *loc_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; /* @@ -239,14 +239,14 @@ nh5imget_image_info_c(hid_t_f *loc_id, * Call H5IMget_image_info function. */ c_loc_id = (hid_t)*loc_id; - + ret = H5IMget_image_info(c_loc_id,c_name,&c_width,&c_height,&c_planes,c_buf,&c_npals); *width = (hsize_t_f) c_width; *height = (hsize_t_f) c_height; *planes = (hsize_t_f) c_planes; *npals = (hsize_t_f) c_npals; - + /* * Convert C name to FORTRAN and place it in the given buffer @@ -254,11 +254,11 @@ nh5imget_image_info_c(hid_t_f *loc_id, HD5packFstring(c_buf, _fcdtocp(interlace), (size_t)*ilen); if(c_buf) free(c_buf); - + if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- @@ -281,7 +281,7 @@ nh5imget_image_info_c(hid_t_f *loc_id, */ int_f -nh5imis_image_c(hid_t_f *loc_id, +nh5imis_image_c(hid_t_f *loc_id, int_f *namelen, _fcd name) { @@ -293,7 +293,7 @@ nh5imis_image_c(hid_t_f *loc_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 -1; /* @@ -302,14 +302,14 @@ nh5imis_image_c(hid_t_f *loc_id, c_loc_id = (hid_t)*loc_id; return( H5IMis_image(c_loc_id, c_name)); - -} + +} /*------------------------------------------------------------------------- * Function: h5immake_palette_c * - * Purpose: Call H5IMmake_palette + * Purpose: Call H5IMmake_palette * * Return: Success: 0, Failure: -1 * @@ -326,9 +326,9 @@ nh5imis_image_c(hid_t_f *loc_id, */ int_f -nh5immake_palette_c (hid_t_f *loc_id, +nh5immake_palette_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, hsize_t_f *dims, void *buf) { @@ -345,7 +345,7 @@ nh5immake_palette_c (hid_t_f *loc_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; c_dims = malloc(sizeof(hsize_t) * (rank )); @@ -367,13 +367,13 @@ nh5immake_palette_c (hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: h5imlink_palette_c * - * Purpose: Call H5IMlink_palette + * Purpose: Call H5IMlink_palette * * Return: Success: 0, Failure: -1 * @@ -390,9 +390,9 @@ nh5immake_palette_c (hid_t_f *loc_id, */ int_f -nh5imlink_palette_c (hid_t_f *loc_id, +nh5imlink_palette_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, int_f *ilen, _fcd pal_name) { @@ -409,11 +409,11 @@ nh5imlink_palette_c (hid_t_f *loc_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; c_namelenpal = *ilen; - c_namepal = (char *)HD5f2cstring(pal_name, c_namelenpal); + c_namepal = (char *)HD5f2cstring(pal_name, c_namelenpal); if (c_namepal == NULL) return ret_value; /* @@ -427,13 +427,13 @@ nh5imlink_palette_c (hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: h5imunlink_palette_c * - * Purpose: Call H5IMunlink_palette + * Purpose: Call H5IMunlink_palette * * Return: Success: 0, Failure: -1 * @@ -450,9 +450,9 @@ nh5imlink_palette_c (hid_t_f *loc_id, */ int_f -nh5imunlink_palette_c (hid_t_f *loc_id, +nh5imunlink_palette_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, int_f *ilen, _fcd pal_name) { @@ -469,11 +469,11 @@ nh5imunlink_palette_c (hid_t_f *loc_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; c_namelenpal = *ilen; - c_namepal = (char *)HD5f2cstring(pal_name, c_namelenpal); + c_namepal = (char *)HD5f2cstring(pal_name, c_namelenpal); if (c_namepal == NULL) return ret_value; /* @@ -487,14 +487,14 @@ nh5imunlink_palette_c (hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} - +} + /*------------------------------------------------------------------------- * Function: h5imget_npalettes_c * - * Purpose: Call H5IMget_npalettes + * Purpose: Call H5IMget_npalettes * * Return: Success: 0, Failure: -1 * @@ -511,7 +511,7 @@ nh5imunlink_palette_c (hid_t_f *loc_id, */ int_f -nh5imget_npalettes_c(hid_t_f *loc_id, +nh5imget_npalettes_c(hid_t_f *loc_id, int_f *namelen, _fcd name, hsize_t_f *npals) @@ -527,7 +527,7 @@ nh5imget_npalettes_c(hid_t_f *loc_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; /* @@ -538,18 +538,18 @@ nh5imget_npalettes_c(hid_t_f *loc_id, ret = H5IMget_npalettes(c_loc_id,c_name,&c_npals); *npals = (hsize_t_f) c_npals; - + if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: h5imget_palette_info_c * - * Purpose: Call H5IMget_palette_info + * Purpose: Call H5IMget_palette_info * * Return: Success: 0, Failure: -1 * @@ -567,7 +567,7 @@ nh5imget_npalettes_c(hid_t_f *loc_id, int_f -nh5imget_palette_info_c(hid_t_f *loc_id, +nh5imget_palette_info_c(hid_t_f *loc_id, int_f *namelen, _fcd name, int_f *pal_number, @@ -585,7 +585,7 @@ nh5imget_palette_info_c(hid_t_f *loc_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; /* @@ -599,17 +599,17 @@ nh5imget_palette_info_c(hid_t_f *loc_id, dims[i] = (hsize_t_f) c_dims[i]; } - + if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: h5imget_palette_c * - * Purpose: Call H5IMget_palette + * Purpose: Call H5IMget_palette * * Return: Success: 0, Failure: -1 * @@ -627,7 +627,7 @@ nh5imget_palette_info_c(hid_t_f *loc_id, int_f -nh5imget_palette_c(hid_t_f *loc_id, +nh5imget_palette_c(hid_t_f *loc_id, int_f *namelen, _fcd name, int_f *pal_number, @@ -643,7 +643,7 @@ nh5imget_palette_c(hid_t_f *loc_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; /* @@ -652,13 +652,13 @@ nh5imget_palette_c(hid_t_f *loc_id, c_loc_id = (hid_t)*loc_id; ret = H5IMget_palettef(c_loc_id,c_name,*pal_number,buf); - + if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} + - /*------------------------------------------------------------------------- * Function: h5imis_palette_c * @@ -679,7 +679,7 @@ nh5imget_palette_c(hid_t_f *loc_id, */ int_f -nh5imis_palette_c(hid_t_f *loc_id, +nh5imis_palette_c(hid_t_f *loc_id, int_f *namelen, _fcd name) { @@ -691,7 +691,7 @@ nh5imis_palette_c(hid_t_f *loc_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 -1; /* @@ -700,5 +700,5 @@ nh5imis_palette_c(hid_t_f *loc_id, c_loc_id = (hid_t)*loc_id; return( H5IMis_palette(c_loc_id, c_name)); - -} + +} diff --git a/hl/fortran/src/H5LTf90proto.h b/hl/fortran/src/H5LTf90proto.h index cae95cf..81c30a4 100755 --- a/hl/fortran/src/H5LTf90proto.h +++ b/hl/fortran/src/H5LTf90proto.h @@ -18,7 +18,7 @@ #include "H5public.h" #include "H5f90i.h" -#include +#include #include @@ -82,118 +82,118 @@ H5_DLL void HD5packFstring (char *src, char *dest, size_t len); # define nh5tbget_table_info_c H5_FC_FUNC_(h5tbget_table_info_c, H5TBGET_TABLE_INFO_C) # define nh5tbget_field_info_c H5_FC_FUNC_(h5tbget_field_info_c, H5TBGET_FIELD_INFO_C) -H5_DLL +H5_DLL int_f -nh5ltmake_dataset_c (hid_t_f *loc_id, +nh5ltmake_dataset_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, - int_f *rank, + _fcd name, + int_f *rank, hsize_t_f *dims, - hid_t_f *type_id, + hid_t_f *type_id, void *buf); -H5_DLL +H5_DLL int_f -nh5ltread_dataset_c (hid_t_f *loc_id, +nh5ltread_dataset_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, - hid_t_f *type_id, + _fcd name, + hid_t_f *type_id, void *buf, hsize_t_f *dims); H5_DLL int_f -nh5ltset_attribute_int_c(hid_t_f *loc_id, +nh5ltset_attribute_int_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, size_t_f *size, void *buf); H5_DLL int_f -nh5ltset_attribute_float_c(hid_t_f *loc_id, +nh5ltset_attribute_float_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, size_t_f *size, void *buf); H5_DLL int_f -nh5ltset_attribute_double_c(hid_t_f *loc_id, +nh5ltset_attribute_double_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, size_t_f *size, void *buf); H5_DLL int_f -nh5ltset_attribute_string_c(hid_t_f *loc_id, +nh5ltset_attribute_string_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, void *buf); H5_DLL int_f -nh5ltget_attribute_int_c(hid_t_f *loc_id, +nh5ltget_attribute_int_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, void *buf); H5_DLL int_f -nh5ltget_attribute_float_c(hid_t_f *loc_id, +nh5ltget_attribute_float_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, void *buf); H5_DLL int_f -nh5ltget_attribute_double_c(hid_t_f *loc_id, +nh5ltget_attribute_double_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, void *buf); H5_DLL int_f -nh5ltget_attribute_string_c(hid_t_f *loc_id, +nh5ltget_attribute_string_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, void *buf); H5_DLL int_f -nh5ltget_dataset_ndims_c(hid_t_f *loc_id, +nh5ltget_dataset_ndims_c(hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, int_f *rank); H5_DLL int_f -nh5ltfind_dataset_c(hid_t_f *loc_id, +nh5ltfind_dataset_c(hid_t_f *loc_id, int_f *namelen, _fcd name); H5_DLL int_f -nh5ltget_dataset_info_c(hid_t_f *loc_id, +nh5ltget_dataset_info_c(hid_t_f *loc_id, int_f *namelen, _fcd name, hsize_t_f *dims, @@ -202,35 +202,35 @@ nh5ltget_dataset_info_c(hid_t_f *loc_id, H5_DLL int_f -nh5ltget_attribute_ndims_c(hid_t_f *loc_id, +nh5ltget_attribute_ndims_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, int_f *rank); H5_DLL int_f -nh5ltget_attribute_info_c(hid_t_f *loc_id, +nh5ltget_attribute_info_c(hid_t_f *loc_id, int_f *namelen, _fcd name, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, hsize_t_f *dims, int_f *type_class, size_t_f *type_size); H5_DLL int_f -nh5ltmake_dataset_string_c (hid_t_f *loc_id, +nh5ltmake_dataset_string_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, char *buf); H5_DLL int_f -nh5ltread_dataset_string_c (hid_t_f *loc_id, +nh5ltread_dataset_string_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, char *buf); /*------------------------------------------------------------------------- @@ -240,32 +240,32 @@ nh5ltread_dataset_string_c (hid_t_f *loc_id, H5_DLL int_f -nh5immake_image_8bit_c (hid_t_f *loc_id, +nh5immake_image_8bit_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, hsize_t_f *width, - hsize_t_f *height, + hsize_t_f *height, int_f *buf); H5_DLL int_f -nh5imread_image_c (hid_t_f *loc_id, +nh5imread_image_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, int_f *buf); H5_DLL int_f -nh5immake_image_24bit_c (hid_t_f *loc_id, +nh5immake_image_24bit_c (hid_t_f *loc_id, int_f *namelen, _fcd name, int_f *ilen, - _fcd il, + _fcd il, hsize_t_f *width, hsize_t_f *height, void *buf); H5_DLL int_f -nh5imget_image_info_c(hid_t_f *loc_id, +nh5imget_image_info_c(hid_t_f *loc_id, int_f *namelen, _fcd name, hsize_t_f *width, @@ -278,38 +278,38 @@ nh5imget_image_info_c(hid_t_f *loc_id, H5_DLL int_f -nh5imis_image_c(hid_t_f *loc_id, +nh5imis_image_c(hid_t_f *loc_id, int_f *namelen, _fcd name); H5_DLL int_f -nh5immake_palette_c (hid_t_f *loc_id, +nh5immake_palette_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, hsize_t_f *dims, void *buf); H5_DLL int_f -nh5imlink_palette_c (hid_t_f *loc_id, +nh5imlink_palette_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, int_f *ilen, _fcd pal_name); H5_DLL int_f -nh5imunlink_palette_c (hid_t_f *loc_id, +nh5imunlink_palette_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, int_f *ilen, _fcd pal_name); H5_DLL int_f -nh5imget_npalettes_c(hid_t_f *loc_id, +nh5imget_npalettes_c(hid_t_f *loc_id, int_f *namelen, _fcd name, hsize_t_f *npals); @@ -317,7 +317,7 @@ nh5imget_npalettes_c(hid_t_f *loc_id, H5_DLL int_f -nh5imget_palette_info_c(hid_t_f *loc_id, +nh5imget_palette_info_c(hid_t_f *loc_id, int_f *namelen, _fcd name, int_f *pal_number, @@ -325,7 +325,7 @@ nh5imget_palette_info_c(hid_t_f *loc_id, H5_DLL int_f -nh5imget_palette_c(hid_t_f *loc_id, +nh5imget_palette_c(hid_t_f *loc_id, int_f *namelen, _fcd name, int_f *pal_number, @@ -333,7 +333,7 @@ nh5imget_palette_c(hid_t_f *loc_id, H5_DLL int_f -nh5imis_palette_c(hid_t_f *loc_id, +nh5imis_palette_c(hid_t_f *loc_id, int_f *namelen, _fcd name); @@ -348,9 +348,9 @@ H5_DLL int_f nh5tbmake_table_c(int_f *namelen1, _fcd name1, - hid_t_f *loc_id, + hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, hsize_t_f *nfields, hsize_t_f *nrecords, size_t_f *type_size, @@ -363,9 +363,9 @@ nh5tbmake_table_c(int_f *namelen1, H5_DLL int_f -nh5tbwrite_field_name_c(hid_t_f *loc_id, +nh5tbwrite_field_name_c(hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, int_f *namelen1, _fcd field_name, hsize_t_f *start, @@ -375,9 +375,9 @@ nh5tbwrite_field_name_c(hid_t_f *loc_id, H5_DLL int_f -nh5tbread_field_name_c(hid_t_f *loc_id, +nh5tbread_field_name_c(hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, int_f *namelen1, _fcd field_name, hsize_t_f *start, @@ -387,9 +387,9 @@ nh5tbread_field_name_c(hid_t_f *loc_id, H5_DLL int_f -nh5tbwrite_field_index_c(hid_t_f *loc_id, +nh5tbwrite_field_index_c(hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, int_f *field_index, hsize_t_f *start, hsize_t_f *nrecords, @@ -398,9 +398,9 @@ nh5tbwrite_field_index_c(hid_t_f *loc_id, H5_DLL int_f -nh5tbread_field_index_c(hid_t_f *loc_id, +nh5tbread_field_index_c(hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, int_f *field_index, hsize_t_f *start, hsize_t_f *nrecords, @@ -409,7 +409,7 @@ nh5tbread_field_index_c(hid_t_f *loc_id, H5_DLL int_f -nh5tbinsert_field_c(hid_t_f *loc_id, +nh5tbinsert_field_c(hid_t_f *loc_id, int_f *namelen, _fcd name, int_f *namelen1, @@ -420,7 +420,7 @@ nh5tbinsert_field_c(hid_t_f *loc_id, H5_DLL int_f -nh5tbdelete_field_c(hid_t_f *loc_id, +nh5tbdelete_field_c(hid_t_f *loc_id, int_f *namelen, _fcd name, int_f *namelen1, @@ -429,17 +429,17 @@ nh5tbdelete_field_c(hid_t_f *loc_id, H5_DLL int_f -nh5tbget_table_info_c(hid_t_f *loc_id, +nh5tbget_table_info_c(hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, hsize_t_f *nfields, hsize_t_f *nrecords); H5_DLL int_f -nh5tbget_field_info_c(hid_t_f *loc_id, +nh5tbget_field_info_c(hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, hsize_t_f *nfields, size_t_f *field_sizes, size_t_f *field_offsets, diff --git a/hl/fortran/src/H5LTfc.c b/hl/fortran/src/H5LTfc.c index 6078b23..693eca9 100755 --- a/hl/fortran/src/H5LTfc.c +++ b/hl/fortran/src/H5LTfc.c @@ -22,7 +22,7 @@ /*------------------------------------------------------------------------- * Function: H5LTmake_dataset_c * - * Purpose: Call H5LTmake_dataset + * Purpose: Call H5LTmake_dataset * * Return: Success: 0, Failure: -1 * @@ -39,12 +39,12 @@ */ int_f -nh5ltmake_dataset_c (hid_t_f *loc_id, +nh5ltmake_dataset_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, - int_f *rank, + _fcd name, + int_f *rank, hsize_t_f *dims, - hid_t_f *type_id, + hid_t_f *type_id, void *buf) { int ret_value = -1; @@ -60,7 +60,7 @@ nh5ltmake_dataset_c (hid_t_f *loc_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; c_dims = malloc(sizeof(hsize_t) * (*rank )); @@ -82,17 +82,17 @@ nh5ltmake_dataset_c (hid_t_f *loc_id, ret = H5LTmake_dataset(c_loc_id, c_name, *rank, c_dims, c_type_id, buf ); free (c_dims); - + if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: H5LTread_dataset_c * - * Purpose: Call H5LTmake_dataset + * Purpose: Call H5LTmake_dataset * * Return: Success: 0, Failure: -1 * @@ -109,10 +109,10 @@ nh5ltmake_dataset_c (hid_t_f *loc_id, */ int_f -nh5ltread_dataset_c (hid_t_f *loc_id, +nh5ltread_dataset_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, - hid_t_f *type_id, + _fcd name, + hid_t_f *type_id, void *buf, hsize_t_f *dims) { @@ -127,7 +127,7 @@ nh5ltread_dataset_c (hid_t_f *loc_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; /* @@ -141,13 +141,13 @@ nh5ltread_dataset_c (hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: H5LTmake_dataset_string_c * - * Purpose: Call H5LTmake_dataset + * Purpose: Call H5LTmake_dataset * * Return: Success: 0, Failure: -1 * @@ -164,9 +164,9 @@ nh5ltread_dataset_c (hid_t_f *loc_id, */ int_f -nh5ltmake_dataset_string_c (hid_t_f *loc_id, +nh5ltmake_dataset_string_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, char *buf) { int ret_value = -1; @@ -179,7 +179,7 @@ nh5ltmake_dataset_string_c (hid_t_f *loc_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; /* @@ -192,13 +192,13 @@ nh5ltmake_dataset_string_c (hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: H5LTread_dataset_string_c * - * Purpose: Call H5LTread_dataset_string + * Purpose: Call H5LTread_dataset_string * * Return: Success: 0, Failure: -1 * @@ -215,9 +215,9 @@ nh5ltmake_dataset_string_c (hid_t_f *loc_id, */ int_f -nh5ltread_dataset_string_c (hid_t_f *loc_id, +nh5ltread_dataset_string_c (hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, char *buf) { int ret_value = -1; @@ -230,7 +230,7 @@ nh5ltread_dataset_string_c (hid_t_f *loc_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; /* @@ -243,14 +243,14 @@ nh5ltread_dataset_string_c (hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} - +} + /*------------------------------------------------------------------------- * Function: H5LTset_attribute_int_c * - * Purpose: Call H5LTset_attribute_int + * Purpose: Call H5LTset_attribute_int * * Return: Success: 0, Failure: -1 * @@ -267,11 +267,11 @@ nh5ltread_dataset_string_c (hid_t_f *loc_id, */ int_f -nh5ltset_attribute_int_c(hid_t_f *loc_id, +nh5ltset_attribute_int_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, size_t_f *size, void *buf) { @@ -288,11 +288,11 @@ nh5ltset_attribute_int_c(hid_t_f *loc_id, * 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; c_attrnamelen = (int)*attrnamelen; - c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); + c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); if (c_attrname == NULL) return ret_value; /* @@ -301,7 +301,7 @@ nh5ltset_attribute_int_c(hid_t_f *loc_id, c_loc_id = (hid_t)*loc_id; c_size = (size_t)*size; - if (sizeof(int_f) == sizeof(int)) + if (sizeof(int_f) == sizeof(int)) ret = H5LTset_attribute_int(c_loc_id,c_name,c_attrname,buf,c_size); else if (sizeof(int_f) == sizeof(long)) ret = H5LTset_attribute_long(c_loc_id,c_name,c_attrname,buf,c_size); @@ -313,7 +313,7 @@ nh5ltset_attribute_int_c(hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: H5LTset_attribute_float_c @@ -335,11 +335,11 @@ nh5ltset_attribute_int_c(hid_t_f *loc_id, */ int_f -nh5ltset_attribute_float_c(hid_t_f *loc_id, +nh5ltset_attribute_float_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, size_t_f *size, void *buf) { @@ -356,11 +356,11 @@ nh5ltset_attribute_float_c(hid_t_f *loc_id, * 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; c_attrnamelen = *attrnamelen; - c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); + c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); if (c_attrname == NULL) return ret_value; /* @@ -370,11 +370,11 @@ nh5ltset_attribute_float_c(hid_t_f *loc_id, c_size = (size_t)*size; ret = H5LTset_attribute_float(c_loc_id,c_name,c_attrname,buf,c_size); - + if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- @@ -397,11 +397,11 @@ nh5ltset_attribute_float_c(hid_t_f *loc_id, */ int_f -nh5ltset_attribute_double_c(hid_t_f *loc_id, +nh5ltset_attribute_double_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, size_t_f *size, void *buf) { @@ -418,11 +418,11 @@ nh5ltset_attribute_double_c(hid_t_f *loc_id, * 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; c_attrnamelen = *attrnamelen; - c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); + c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); if (c_attrname == NULL) return ret_value; /* @@ -432,11 +432,11 @@ nh5ltset_attribute_double_c(hid_t_f *loc_id, c_size = (size_t)*size; ret = H5LTset_attribute_double(c_loc_id,c_name,c_attrname,buf,c_size); - + if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: H5LTset_attribute_string_c @@ -458,11 +458,11 @@ nh5ltset_attribute_double_c(hid_t_f *loc_id, */ int_f -nh5ltset_attribute_string_c(hid_t_f *loc_id, +nh5ltset_attribute_string_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, void *buf) { int ret_value = -1; @@ -477,11 +477,11 @@ nh5ltset_attribute_string_c(hid_t_f *loc_id, * 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; c_attrnamelen = *attrnamelen; - c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); + c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); if (c_attrname == NULL) return ret_value; /* @@ -490,16 +490,16 @@ nh5ltset_attribute_string_c(hid_t_f *loc_id, c_loc_id = (hid_t)*loc_id; ret = H5LTset_attribute_string(c_loc_id,c_name,c_attrname,buf); - + if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: H5LTget_attribute_int_c * - * Purpose: Call H5LTget_attribute_int + * Purpose: Call H5LTget_attribute_int * * Return: Success: 0, Failure: -1 * @@ -516,11 +516,11 @@ nh5ltset_attribute_string_c(hid_t_f *loc_id, */ int_f -nh5ltget_attribute_int_c(hid_t_f *loc_id, +nh5ltget_attribute_int_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, void *buf) { int ret_value = -1; @@ -535,18 +535,18 @@ nh5ltget_attribute_int_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = (int)*namelen; - c_name = (char *)HD5f2cstring(dsetname, c_namelen); + c_name = (char *)HD5f2cstring(dsetname, c_namelen); if (c_name == NULL) return ret_value; c_attrnamelen = (int)*attrnamelen; - c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); + c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); if (c_attrname == NULL) return ret_value; /* * Call H5LTget_attribute_int function. */ c_loc_id = (hid_t)*loc_id; - + if(sizeof(int_f) == sizeof(int)) ret = H5LTget_attribute_int(c_loc_id,c_name,c_attrname,buf); else if (sizeof(int_f) == sizeof(long)) @@ -555,17 +555,17 @@ nh5ltget_attribute_int_c(hid_t_f *loc_id, ret = H5LTget_attribute_long_long(c_loc_id,c_name,c_attrname,buf); else return ret_value; - + if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: H5LTget_attribute_float_c * - * Purpose: Call H5LTget_attribute_float + * Purpose: Call H5LTget_attribute_float * * Return: Success: 0, Failure: -1 * @@ -582,11 +582,11 @@ nh5ltget_attribute_int_c(hid_t_f *loc_id, */ int_f -nh5ltget_attribute_float_c(hid_t_f *loc_id, +nh5ltget_attribute_float_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, void *buf) { int ret_value = -1; @@ -601,11 +601,11 @@ nh5ltget_attribute_float_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = (int)*namelen; - c_name = (char *)HD5f2cstring(dsetname, c_namelen); + c_name = (char *)HD5f2cstring(dsetname, c_namelen); if (c_name == NULL) return ret_value; c_attrnamelen = (int)*attrnamelen; - c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); + c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); if (c_attrname == NULL) return ret_value; /* @@ -614,16 +614,16 @@ nh5ltget_attribute_float_c(hid_t_f *loc_id, c_loc_id = (hid_t)*loc_id; ret = H5LTget_attribute_float(c_loc_id,c_name,c_attrname,buf); - + if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: H5LTget_attribute_double_c * - * Purpose: Call H5LTget_attribute_double + * Purpose: Call H5LTget_attribute_double * * Return: Success: 0, Failure: -1 * @@ -640,11 +640,11 @@ nh5ltget_attribute_float_c(hid_t_f *loc_id, */ int_f -nh5ltget_attribute_double_c(hid_t_f *loc_id, +nh5ltget_attribute_double_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, void *buf) { int ret_value = -1; @@ -659,11 +659,11 @@ nh5ltget_attribute_double_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = (int)*namelen; - c_name = (char *)HD5f2cstring(dsetname, c_namelen); + c_name = (char *)HD5f2cstring(dsetname, c_namelen); if (c_name == NULL) return ret_value; c_attrnamelen = (int)*attrnamelen; - c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); + c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); if (c_attrname == NULL) return ret_value; /* @@ -672,16 +672,16 @@ nh5ltget_attribute_double_c(hid_t_f *loc_id, c_loc_id = (hid_t)*loc_id; ret = H5LTget_attribute_double(c_loc_id,c_name,c_attrname,buf); - + if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: H5LTget_attribute_string_c * - * Purpose: Call H5LTget_attribute_string + * Purpose: Call H5LTget_attribute_string * * Return: Success: 0, Failure: -1 * @@ -698,11 +698,11 @@ nh5ltget_attribute_double_c(hid_t_f *loc_id, */ int_f -nh5ltget_attribute_string_c(hid_t_f *loc_id, +nh5ltget_attribute_string_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, void *buf) { int ret_value = -1; @@ -717,11 +717,11 @@ nh5ltget_attribute_string_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = (int)*namelen; - c_name = (char *)HD5f2cstring(dsetname, c_namelen); + c_name = (char *)HD5f2cstring(dsetname, c_namelen); if (c_name == NULL) return ret_value; c_attrnamelen = (int)*attrnamelen; - c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); + c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); if (c_attrname == NULL) return ret_value; /* @@ -730,17 +730,17 @@ nh5ltget_attribute_string_c(hid_t_f *loc_id, c_loc_id = (hid_t)*loc_id; ret = H5LTget_attribute_string(c_loc_id,c_name,c_attrname,buf); - + if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: H5LTget_dataset_ndims_c * - * Purpose: Call H5LTget_dataset_ndims + * Purpose: Call H5LTget_dataset_ndims * * Return: Success: 0, Failure: -1 * @@ -757,9 +757,9 @@ nh5ltget_attribute_string_c(hid_t_f *loc_id, */ int_f -nh5ltget_dataset_ndims_c(hid_t_f *loc_id, +nh5ltget_dataset_ndims_c(hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, int_f *rank) { int ret_value = -1; @@ -773,7 +773,7 @@ nh5ltget_dataset_ndims_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ 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; /* @@ -782,12 +782,12 @@ nh5ltget_dataset_ndims_c(hid_t_f *loc_id, c_loc_id = (hid_t)*loc_id; ret = H5LTget_dataset_ndims(c_loc_id, c_name, &c_rank); - + if (ret < 0) return ret_value; *rank = (int_f)c_rank; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- @@ -810,7 +810,7 @@ nh5ltget_dataset_ndims_c(hid_t_f *loc_id, */ int_f -nh5ltfind_dataset_c(hid_t_f *loc_id, +nh5ltfind_dataset_c(hid_t_f *loc_id, int_f *namelen, _fcd name) { @@ -822,7 +822,7 @@ nh5ltfind_dataset_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen = (int)*namelen; - c_name = (char *)HD5f2cstring(name, c_namelen); + c_name = (char *)HD5f2cstring(name, c_namelen); if (c_name == NULL) return -1; /* @@ -831,13 +831,13 @@ nh5ltfind_dataset_c(hid_t_f *loc_id, c_loc_id = (hid_t)*loc_id; return( H5LTfind_dataset(c_loc_id, c_name)); - -} + +} /*------------------------------------------------------------------------- * Function: h5ltget_dataset_info_c * - * Purpose: Call H5LTget_dataset_info + * Purpose: Call H5LTget_dataset_info * * Return: Success: 0, Failure: -1 * @@ -854,7 +854,7 @@ nh5ltfind_dataset_c(hid_t_f *loc_id, */ int_f -nh5ltget_dataset_info_c(hid_t_f *loc_id, +nh5ltget_dataset_info_c(hid_t_f *loc_id, int_f *namelen, _fcd name, hsize_t_f *dims, @@ -875,7 +875,7 @@ nh5ltget_dataset_info_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ 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; /* @@ -891,16 +891,16 @@ nh5ltget_dataset_info_c(hid_t_f *loc_id, dims[i] = (hsize_t_f) c_dims[i]; } - + if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: h5ltget_attribute_ndims_c * - * Purpose: Call H5LTget_attribute_ndims + * Purpose: Call H5LTget_attribute_ndims * * Return: Success: 0, Failure: -1 * @@ -917,11 +917,11 @@ nh5ltget_dataset_info_c(hid_t_f *loc_id, */ int_f -nh5ltget_attribute_ndims_c(hid_t_f *loc_id, +nh5ltget_attribute_ndims_c(hid_t_f *loc_id, int_f *namelen, - _fcd dsetname, + _fcd dsetname, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, int_f *rank) { int ret_value = -1; @@ -937,11 +937,11 @@ nh5ltget_attribute_ndims_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ c_namelen =(int) *namelen; - c_name = (char *)HD5f2cstring(dsetname, c_namelen); + c_name = (char *)HD5f2cstring(dsetname, c_namelen); if (c_name == NULL) return ret_value; c_attrnamelen = (int)*attrnamelen; - c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); + c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); if (c_attrname == NULL) return ret_value; /* @@ -950,18 +950,18 @@ nh5ltget_attribute_ndims_c(hid_t_f *loc_id, c_loc_id = (hid_t)*loc_id; ret = H5LTget_attribute_ndims(c_loc_id,c_name,c_attrname,&c_rank); - + if (ret < 0) return ret_value; *rank = (int_f)c_rank; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: h5ltget_attribute_info_c * - * Purpose: Call H5LTget_attribute_info + * Purpose: Call H5LTget_attribute_info * * Return: Success: 0, Failure: -1 * @@ -978,11 +978,11 @@ nh5ltget_attribute_ndims_c(hid_t_f *loc_id, */ int_f -nh5ltget_attribute_info_c(hid_t_f *loc_id, +nh5ltget_attribute_info_c(hid_t_f *loc_id, int_f *namelen, _fcd name, int_f *attrnamelen, - _fcd attrname, + _fcd attrname, hsize_t_f *dims, int_f *type_class, size_t_f *type_size) @@ -1003,11 +1003,11 @@ nh5ltget_attribute_info_c(hid_t_f *loc_id, * Convert FORTRAN name to C name */ 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; c_attrnamelen = (int)*attrnamelen; - c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); + c_attrname = (char *)HD5f2cstring(attrname, c_attrnamelen); if (c_attrname == NULL) return ret_value; /* @@ -1023,8 +1023,8 @@ nh5ltget_attribute_info_c(hid_t_f *loc_id, dims[i] = (hsize_t_f) c_dims[i]; } - + if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} diff --git a/hl/fortran/src/H5TBfc.c b/hl/fortran/src/H5TBfc.c index 6af79db..56515b1 100755 --- a/hl/fortran/src/H5TBfc.c +++ b/hl/fortran/src/H5TBfc.c @@ -20,7 +20,7 @@ /*------------------------------------------------------------------------- * Function: h5tbmake_table_c * - * Purpose: Call H5TBmake_table + * Purpose: Call H5TBmake_table * * Return: Success: 0, Failure: -1 * @@ -38,9 +38,9 @@ int_f nh5tbmake_table_c(int_f *namelen1, _fcd name1, - hid_t_f *loc_id, + hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, hsize_t_f *nfields, hsize_t_f *nrecords, size_t_f *type_size, @@ -66,7 +66,7 @@ nh5tbmake_table_c(int_f *namelen1, hsize_t c_chunk_size = *chunk_size; size_t c_type_size = *type_size; size_t *c_field_offset; - hid_t *c_field_types; + hid_t *c_field_types; char **c_field_names; char *tmp, *tmp_p; @@ -80,11 +80,11 @@ nh5tbmake_table_c(int_f *namelen1, * 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; c_namelen1 = *namelen1; - c_name1 = (char *)HD5f2cstring(name1, c_namelen1); + c_name1 = (char *)HD5f2cstring(name1, c_namelen1); if (c_name1 == NULL) return ret_value; c_field_offset = (size_t*)malloc(sizeof(size_t) * (size_t)c_nfields); @@ -101,12 +101,12 @@ nh5tbmake_table_c(int_f *namelen1, /* * Allocate array of character pointers */ - c_field_names = (char **)malloc((size_t)num_elem * sizeof(char *)); + c_field_names = (char **)malloc((size_t)num_elem * sizeof(char *)); if (c_field_names == NULL) return ret_value; /* Copy data to long C string */ tmp = (char *)HD5f2cstring(field_names, (int)(max_len*num_elem)); - if (tmp == NULL) { + if (tmp == NULL) { free(c_field_names); return ret_value; } @@ -118,7 +118,7 @@ nh5tbmake_table_c(int_f *namelen1, for (i=0; i < num_elem; i++) { c_field_names[i] = (char *) malloc((size_t)namelen2[i]+1); memcpy(c_field_names[i], tmp_p, (size_t)namelen2[i]); - c_field_names[i][namelen2[i]] = '\0'; + c_field_names[i][namelen2[i]] = '\0'; tmp_p = tmp_p + max_len; } @@ -140,7 +140,7 @@ nh5tbmake_table_c(int_f *namelen1, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} @@ -148,7 +148,7 @@ nh5tbmake_table_c(int_f *namelen1, /*------------------------------------------------------------------------- * Function: h5tbwrite_field_name_c * - * Purpose: Call H5TBwrite_fields_name + * Purpose: Call H5TBwrite_fields_name * * Return: Success: 0, Failure: -1 * @@ -165,15 +165,15 @@ nh5tbmake_table_c(int_f *namelen1, */ int_f -nh5tbwrite_field_name_c(hid_t_f *loc_id, +nh5tbwrite_field_name_c(hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, int_f *namelen1, _fcd field_name, hsize_t_f *start, hsize_t_f *nrecords, size_t_f *type_size, - void *buf) + void *buf) { int ret_value = -1; herr_t ret; @@ -194,11 +194,11 @@ nh5tbwrite_field_name_c(hid_t_f *loc_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; c_namelen1 = *namelen1; - c_name1 = (char *)HD5f2cstring(field_name, c_namelen1); + c_name1 = (char *)HD5f2cstring(field_name, c_namelen1); if (c_name1 == NULL) return ret_value; /* @@ -211,13 +211,13 @@ nh5tbwrite_field_name_c(hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: h5tbread_field_name_c * - * Purpose: Call H5TBread_fields_name + * Purpose: Call H5TBread_fields_name * * Return: Success: 0, Failure: -1 * @@ -234,15 +234,15 @@ nh5tbwrite_field_name_c(hid_t_f *loc_id, */ int_f -nh5tbread_field_name_c(hid_t_f *loc_id, +nh5tbread_field_name_c(hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, int_f *namelen1, _fcd field_name, hsize_t_f *start, hsize_t_f *nrecords, size_t_f *type_size, - void *buf) + void *buf) { int ret_value = -1; herr_t ret; @@ -263,11 +263,11 @@ nh5tbread_field_name_c(hid_t_f *loc_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; c_namelen1 = *namelen1; - c_name1 = (char *)HD5f2cstring(field_name, c_namelen1); + c_name1 = (char *)HD5f2cstring(field_name, c_namelen1); if (c_name1 == NULL) return ret_value; /* @@ -280,14 +280,14 @@ nh5tbread_field_name_c(hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: h5tbwrite_field_index_c * - * Purpose: Call H5TBwrite_fields_index + * Purpose: Call H5TBwrite_fields_index * * Return: Success: 0, Failure: -1 * @@ -304,14 +304,14 @@ nh5tbread_field_name_c(hid_t_f *loc_id, */ int_f -nh5tbwrite_field_index_c(hid_t_f *loc_id, +nh5tbwrite_field_index_c(hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, int_f *field_index, hsize_t_f *start, hsize_t_f *nrecords, size_t_f *type_size, - void *buf) + void *buf) { int ret_value = -1; herr_t ret; @@ -332,7 +332,7 @@ nh5tbwrite_field_index_c(hid_t_f *loc_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; @@ -346,13 +346,13 @@ nh5tbwrite_field_index_c(hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: h5tbread_field_index_c * - * Purpose: Call H5TBread_fields_index + * Purpose: Call H5TBread_fields_index * * Return: Success: 0, Failure: -1 * @@ -369,14 +369,14 @@ nh5tbwrite_field_index_c(hid_t_f *loc_id, */ int_f -nh5tbread_field_index_c(hid_t_f *loc_id, +nh5tbread_field_index_c(hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, int_f *field_index, hsize_t_f *start, hsize_t_f *nrecords, size_t_f *type_size, - void *buf) + void *buf) { int ret_value = -1; herr_t ret; @@ -397,7 +397,7 @@ nh5tbread_field_index_c(hid_t_f *loc_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; /* @@ -410,13 +410,13 @@ nh5tbread_field_index_c(hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: h5tbinsert_field_c * - * Purpose: Call H5TBinsert_field + * Purpose: Call H5TBinsert_field * * Return: Success: 0, Failure: -1 * @@ -431,16 +431,16 @@ nh5tbread_field_index_c(hid_t_f *loc_id, * *------------------------------------------------------------------------- */ - + int_f -nh5tbinsert_field_c(hid_t_f *loc_id, +nh5tbinsert_field_c(hid_t_f *loc_id, int_f *namelen, _fcd name, int_f *namelen1, _fcd field_name, hid_t_f *field_type, int_f *position, - void *buf) + void *buf) { int ret_value = -1; herr_t ret; @@ -456,11 +456,11 @@ nh5tbinsert_field_c(hid_t_f *loc_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; c_namelen1 = *namelen1; - c_name1 = (char *)HD5f2cstring(field_name, c_namelen1); + c_name1 = (char *)HD5f2cstring(field_name, c_namelen1); if (c_name1 == NULL) return ret_value; /* @@ -472,13 +472,13 @@ nh5tbinsert_field_c(hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: h5tbdelete_field_c * - * Purpose: Call H5TBdelete_field + * Purpose: Call H5TBdelete_field * * Return: Success: 0, Failure: -1 * @@ -493,13 +493,13 @@ nh5tbinsert_field_c(hid_t_f *loc_id, * *------------------------------------------------------------------------- */ - + int_f -nh5tbdelete_field_c(hid_t_f *loc_id, +nh5tbdelete_field_c(hid_t_f *loc_id, int_f *namelen, _fcd name, int_f *namelen1, - _fcd field_name) + _fcd field_name) { int ret_value = -1; herr_t ret; @@ -513,11 +513,11 @@ nh5tbdelete_field_c(hid_t_f *loc_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; c_namelen1 = *namelen1; - c_name1 = (char *)HD5f2cstring(field_name, c_namelen1); + c_name1 = (char *)HD5f2cstring(field_name, c_namelen1); if (c_name1 == NULL) return ret_value; /* @@ -529,14 +529,14 @@ nh5tbdelete_field_c(hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} - +} + /*------------------------------------------------------------------------- * Function: h5tbget_table_info_c * - * Purpose: Call H5TBread_fields_index + * Purpose: Call H5TBread_fields_index * * Return: Success: 0, Failure: -1 * @@ -553,11 +553,11 @@ nh5tbdelete_field_c(hid_t_f *loc_id, */ int_f -nh5tbget_table_info_c(hid_t_f *loc_id, +nh5tbget_table_info_c(hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, hsize_t_f *nfields, - hsize_t_f *nrecords) + hsize_t_f *nrecords) { int ret_value = -1; herr_t ret; @@ -571,7 +571,7 @@ nh5tbget_table_info_c(hid_t_f *loc_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; /* @@ -586,14 +586,14 @@ nh5tbget_table_info_c(hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} /*------------------------------------------------------------------------- * Function: h5tbget_field_info_c * - * Purpose: Call H5TBget_field_info + * Purpose: Call H5TBget_field_info * * Return: Success: 0, Failure: -1 * @@ -609,16 +609,16 @@ nh5tbget_table_info_c(hid_t_f *loc_id, *------------------------------------------------------------------------- */ int_f -nh5tbget_field_info_c(hid_t_f *loc_id, +nh5tbget_field_info_c(hid_t_f *loc_id, int_f *namelen, - _fcd name, + _fcd name, hsize_t_f *nfields, size_t_f *field_sizes, size_t_f *field_offsets, size_t_f *type_size, int_f *namelen2, /* field_names lenghts */ _fcd field_names) /* field_names */ - + { int ret_value = -1; herr_t ret; @@ -647,7 +647,7 @@ nh5tbget_field_info_c(hid_t_f *loc_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; @@ -659,7 +659,7 @@ nh5tbget_field_info_c(hid_t_f *loc_id, c_field_names = malloc( sizeof(char*) * (size_t)c_nfields ); if (!c_field_names) return ret_value; - for ( i = 0; i < c_nfields; i++) + for ( i = 0; i < c_nfields; i++) { c_field_names[i] = malloc( sizeof(char) * HLTB_MAX_FIELD_LEN ); } @@ -683,12 +683,12 @@ nh5tbget_field_info_c(hid_t_f *loc_id, namelen2[i] = (int_f)strlen(c_field_names[i]); length = MAX(length, strlen(c_field_names[i])); tmp_p = tmp_p + c_lenmax; - } + } HD5packFstring(tmp, _fcdtocp(field_names), (int)(c_lenmax*c_nfields)); *type_size = (size_t_f)c_type_size; - for (i=0; i < num_elem; i++) + for (i=0; i < num_elem; i++) { field_sizes[i] = (size_t_f)c_field_sizes[i]; field_offsets[i] = (size_t_f)c_field_offsets[i]; @@ -709,5 +709,5 @@ nh5tbget_field_info_c(hid_t_f *loc_id, if (ret < 0) return ret_value; ret_value = 0; return ret_value; -} +} diff --git a/hl/src/H5DS.c b/hl/src/H5DS.c index fbf7f19..b77b97f 100644 --- a/hl/src/H5DS.c +++ b/hl/src/H5DS.c @@ -22,7 +22,7 @@ /*------------------------------------------------------------------------- * Function: H5DSset_scale * - * Purpose: Convert dataset DSID to a dimension scale, by writing the standard + * Purpose: Convert dataset DSID to a dimension scale, by writing the standard * attributes for a Dimension Scale dataset; optionally set its name * * Return: Success: SUCCESS, Failure: FAIL @@ -38,9 +38,9 @@ *------------------------------------------------------------------------- */ -herr_t H5DSset_scale(hid_t dsid, - char *dimname) -{ +herr_t H5DSset_scale(hid_t dsid, + char *dimname) +{ int has_dimlist; H5I_type_t it; @@ -66,12 +66,12 @@ herr_t H5DSset_scale(hid_t dsid, if (has_dimlist == 1) return FAIL; - + /*------------------------------------------------------------------------- * write the standard attributes for a Dimension Scale dataset *------------------------------------------------------------------------- */ - + if (H5LT_set_attribute_string(dsid,"CLASS",DIMENSION_SCALE_CLASS)<0) return FAIL; @@ -89,10 +89,10 @@ herr_t H5DSset_scale(hid_t dsid, /*------------------------------------------------------------------------- * Function: H5DSattach_scale * - * Purpose: attach a DS with DSID to the IDX dimension of the existing + * Purpose: attach a DS with DSID to the IDX dimension of the existing * dataset DID * - * Return: + * Return: * Success: SUCCESS * Failure: FAIL * @@ -109,8 +109,8 @@ herr_t H5DSset_scale(hid_t dsid, herr_t H5DSattach_scale(hid_t did, hid_t dsid, - unsigned int idx) -{ + unsigned int idx) +{ int has_dimlist; int has_reflist; int is_ds; @@ -130,15 +130,15 @@ herr_t H5DSattach_scale(hid_t did, H5I_type_t it1, it2; int i, len; int found_ds=0; - + /*------------------------------------------------------------------------- * parameter checking *------------------------------------------------------------------------- */ /* the dataset cannot be a DS dataset */ - if ((H5DSis_scale(did))==1) + if ((H5DSis_scale(did))==1) return FAIL; - + /* get info for the dataset in the parameter list */ if (H5Gget_objinfo(did,".",TRUE,&sb1)<0) return FAIL; @@ -148,7 +148,7 @@ herr_t H5DSattach_scale(hid_t did, return FAIL; /* same object, not valid */ - if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) + if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) return FAIL; /* get ID type */ @@ -172,7 +172,7 @@ herr_t H5DSattach_scale(hid_t did, /*------------------------------------------------------------------------- * The dataset may or may not have the associated DS attribute * 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 DS *------------------------------------------------------------------------- */ @@ -180,7 +180,7 @@ herr_t H5DSattach_scale(hid_t did, /* get dataset space */ if ((sid = H5Dget_space(did))<0) return FAIL; - + /* get rank */ if ((rank=H5Sget_simple_extent_ndims(sid))<0) goto out; @@ -205,15 +205,15 @@ herr_t H5DSattach_scale(hid_t did, /* create a reference for the >>DS<< dataset */ if (H5Rcreate(&ref_to_ds,dsid,".",H5R_OBJECT,-1)<0) return FAIL; - + /* create a reference for the >>data<< dataset */ if (H5Rcreate(&dsl.ref,did,".",H5R_OBJECT,-1)<0) return FAIL; - + /* try to find the attribute "DIMENSION_LIST" on the >>data<< dataset */ if ((has_dimlist = H5LT_find_attribute(did,DIMENSION_LIST))<0) return FAIL; - + /*------------------------------------------------------------------------- * it does not exist. we create the attribute and its reference data *------------------------------------------------------------------------- @@ -231,7 +231,7 @@ herr_t H5DSattach_scale(hid_t did, /* space for the attribute */ if ((sid = H5Screate_simple(1,dims,NULL))<0) return FAIL; - + /* create the type for the attribute "DIMENSION_LIST" */ if ((tid = H5Tvlen_create(H5T_STD_REF_OBJ))<0) goto out; @@ -239,7 +239,7 @@ herr_t H5DSattach_scale(hid_t did, /* create the attribute */ if ((aid = H5Acreate(did,DIMENSION_LIST,tid,sid,H5P_DEFAULT))<0) goto out; - + /* allocate and initialize the VL */ buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t)); @@ -251,7 +251,7 @@ herr_t H5DSattach_scale(hid_t did, buf[i].len = 0; buf[i].p = NULL; } - + /* store the REF information in the index of the dataset that has the DS */ buf[idx].len = 1; buf[idx].p = malloc( 1 * sizeof(hobj_ref_t)); @@ -260,7 +260,7 @@ herr_t H5DSattach_scale(hid_t did, /* write the attribute with the reference */ if (H5Awrite(aid,tid,buf)<0) goto out; - + /* close */ if (H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf)<0) goto out; @@ -275,32 +275,32 @@ herr_t H5DSattach_scale(hid_t did, free(dims); if (buf) free(buf); - + } - + /*------------------------------------------------------------------------- * the attribute already exists, open it, extend the buffer, * and insert the new reference *------------------------------------------------------------------------- */ - + else if ( has_dimlist == 1 ) { if ((aid = H5Aopen_name(did,DIMENSION_LIST))<0) goto out; - + if ((tid = H5Aget_type(aid))<0) goto out; if ((sid = H5Aget_space(aid))<0) goto out; - + /* allocate and initialize the VL */ buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t)); if (buf == NULL) goto out; - + /* read */ if (H5Aread(aid,tid,buf)<0) goto out; @@ -315,21 +315,21 @@ herr_t H5DSattach_scale(hid_t did, /* get the scale id for this REF */ if ((dsid_j = H5Rdereference(did,H5R_OBJECT,&ref_j))<0) goto out; - + /* get info for DS in the parameter list */ if (H5Gget_objinfo(dsid,".",TRUE,&sb1)<0) goto out; - + /* get info for this DS */ if (H5Gget_objinfo(dsid_j,".",TRUE,&sb2)<0) goto out; - + /* same object, so this DS scale is already in this DIM IDX */ - if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) + if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) { found_ds = 1; } - + /* close the dereferenced dataset */ if (H5Dclose(dsid_j)<0) goto out; @@ -353,30 +353,30 @@ herr_t H5DSattach_scale(hid_t did, ((hobj_ref_t *)buf[idx].p)[0] = ref_to_ds; } } - + /* write the attribute with the new references */ if (H5Awrite(aid,tid,buf)<0) goto out; - + /* close */ if (H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf)<0) goto out; if (H5Sclose(sid)<0) goto out; - if (H5Tclose(tid)<0) + if (H5Tclose(tid)<0) goto out; if (H5Aclose(aid)<0) goto out; if (buf) free(buf); - - } /* has_dimlist */ - + + } /* has_dimlist */ + /*------------------------------------------------------------------------- * save DS info on the >>DS<< dataset *------------------------------------------------------------------------- */ - + /* try to find the attribute "REFERENCE_LIST" on the >>DS<< dataset */ if ((has_reflist = H5LT_find_attribute(dsid,REFERENCE_LIST))<0) goto out; @@ -398,30 +398,30 @@ herr_t H5DSattach_scale(hid_t did, /* space for the attribute */ if ((sid = H5Screate_simple(1,dims,NULL))<0) goto out; - + /* create the compound datatype for the attribute "REFERENCE_LIST" */ if ((tid = H5Tcreate(H5T_COMPOUND,sizeof(ds_list_t)))<0) goto out; - + /* insert reference field */ if (H5Tinsert(tid,"dataset",HOFFSET(ds_list_t,ref),H5T_STD_REF_OBJ)<0) goto out; - + /* insert dimension idx of the dataset field */ if (H5Tinsert(tid,"dimension",HOFFSET(ds_list_t,dim_idx),H5T_NATIVE_INT)<0) goto out; - + /* create the attribute */ if ((aid = H5Acreate(dsid,REFERENCE_LIST,tid,sid,H5P_DEFAULT))<0) goto out; - + /* store the IDX information */ dsl.dim_idx = idx; - + /* write the attribute with the reference */ if (H5Awrite(aid,tid,&dsl)<0) goto out; - + /* close */ if (H5Sclose(sid)<0) goto out; @@ -438,32 +438,32 @@ herr_t H5DSattach_scale(hid_t did, * the "REFERENCE_LIST" array already exists, open it and extend it *------------------------------------------------------------------------- */ - + else if ( has_reflist == 1 ) { if ((aid = H5Aopen_name(dsid,REFERENCE_LIST))<0) goto out; - + if ((tid = H5Aget_type(aid))<0) goto out; - + /* get and save the old reference(s) */ if ((sid = H5Aget_space(aid))<0) goto out; - + if ((nelmts = H5Sget_simple_extent_npoints(sid))<0) goto out; - + nelmts++; - + dsbuf = malloc((size_t)nelmts * sizeof(ds_list_t)); if (dsbuf == NULL) goto out; - + if (H5Aread(aid,tid,dsbuf)<0) goto out; - + /* close */ if (H5Sclose(sid)<0) goto out; @@ -474,7 +474,7 @@ herr_t H5DSattach_scale(hid_t did, * create a new attribute *------------------------------------------------------------------------- */ - + /* the attribute must be deleted, in order to the new one can reflect the changes*/ if (H5Adelete(dsid,REFERENCE_LIST)<0) goto out; @@ -488,34 +488,34 @@ herr_t H5DSattach_scale(hid_t did, if (dims == NULL) goto out; dims[0] = nelmts; - + if ((sid = H5Screate_simple(1,dims,NULL))<0) goto out; if (dims) free(dims); - + /* create the attribute again with the changes of space */ if ((aid = H5Acreate(dsid,REFERENCE_LIST,tid,sid,H5P_DEFAULT))<0) goto out; - + /* write the attribute with the new references */ if (H5Awrite(aid,tid,dsbuf)<0) goto out; - + /* close */ if (H5Sclose(sid)<0) goto out; - if (H5Tclose(tid)<0) + if (H5Tclose(tid)<0) goto out; if (H5Aclose(aid)<0) goto out; - + if (dsbuf) free(dsbuf); - - } /* has_reflist */ - + + } /* has_reflist */ + /*------------------------------------------------------------------------- * write the standard attributes for a Dimension Scale dataset *------------------------------------------------------------------------- @@ -523,7 +523,7 @@ herr_t H5DSattach_scale(hid_t did, if ((is_ds=H5DSis_scale(dsid))<0) return FAIL; - + if (is_ds == 0 ) { if (H5LT_set_attribute_string(dsid,"CLASS",DIMENSION_SCALE_CLASS)<0) @@ -531,7 +531,7 @@ herr_t H5DSattach_scale(hid_t did, } return SUCCESS; - + /* error zone, gracefully close */ out: H5E_BEGIN_TRY { @@ -545,10 +545,10 @@ out: /*------------------------------------------------------------------------- * Function: H5DSdetach_scale * - * Purpose: detach a DS with DSID to the IDX dimension of the existing + * Purpose: detach a DS with DSID to the IDX dimension of the existing * dataset DID * - * Return: + * Return: * Success: SUCCESS * Failure: FAIL * @@ -565,8 +565,8 @@ out: herr_t H5DSdetach_scale(hid_t did, hid_t dsid, - unsigned int idx) -{ + unsigned int idx) +{ int has_dimlist; int has_reflist; hssize_t nelmts; @@ -584,15 +584,15 @@ herr_t H5DSdetach_scale(hid_t did, H5G_stat_t sb1, sb2, sb3, sb4; int found_dset=0, found_ds=0; H5I_type_t it1, it2; - + /*------------------------------------------------------------------------- * parameter checking *------------------------------------------------------------------------- */ /* the dataset cannot be a DS dataset */ - if ((H5DSis_scale(did))==1) + if ((H5DSis_scale(did))==1) return FAIL; - + /* get info for the dataset in the parameter list */ if (H5Gget_objinfo(did,".",TRUE,&sb1)<0) return FAIL; @@ -602,7 +602,7 @@ herr_t H5DSdetach_scale(hid_t did, return FAIL; /* same object, not valid */ - if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) + if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) return FAIL; /* get ID type */ @@ -629,7 +629,7 @@ herr_t H5DSdetach_scale(hid_t did, /* get dataset space */ if ((sid = H5Dget_space(did))<0) return FAIL; - + /* get rank */ if ((rank=H5Sget_simple_extent_ndims(sid))<0) goto out; @@ -650,31 +650,31 @@ herr_t H5DSdetach_scale(hid_t did, if (has_reflist == 0) return FAIL; - + /*------------------------------------------------------------------------- * open "DIMENSION_LIST", and delete the reference *------------------------------------------------------------------------- */ - + if ((aid = H5Aopen_name(did,DIMENSION_LIST))<0) return FAIL; - + if ((tid = H5Aget_type(aid))<0) goto out; - + if ((sid = H5Aget_space(aid))<0) goto out; - + /* allocate and initialize the VL */ buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t)); - + if (buf == NULL) goto out; - + /* read */ if (H5Aread(aid,tid,buf)<0) goto out; - + /* reset */ if ( buf[idx].len > 0 ) { @@ -682,28 +682,28 @@ herr_t H5DSdetach_scale(hid_t did, { /* get the reference */ ref = ((hobj_ref_t *)buf[idx].p)[j]; - + /* get the DS id */ if ((dsid_j = H5Rdereference(did,H5R_OBJECT,&ref))<0) goto out; - + /* get info for DS in the parameter list */ if (H5Gget_objinfo(dsid,".",TRUE,&sb1)<0) goto out; - + /* get info for this DS */ if (H5Gget_objinfo(dsid_j,".",TRUE,&sb2)<0) goto out; - + /* same object, reset */ - if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) + if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) { for(jj=j; jj>data<< dataset must exist + * the attribute "DIMENSION_LIST" on the >>data<< dataset must exist *------------------------------------------------------------------------- */ /* get dataset space */ if ((sid = H5Dget_space(did))<0) return FAIL; - + /* get rank */ if ((rank=H5Sget_simple_extent_ndims(sid))<0) goto out; @@ -973,10 +973,10 @@ int H5DSget_num_scales(hid_t did, return 0; /*------------------------------------------------------------------------- - * the attribute exists, open it + * the attribute exists, open it *------------------------------------------------------------------------- */ - + else if ( has_dimlist == 1 ) { if ((aid = H5Aopen_name(did,DIMENSION_LIST))<0) @@ -985,13 +985,13 @@ int H5DSget_num_scales(hid_t did, goto out; if ((sid = H5Aget_space(aid))<0) goto out; - + /* allocate and initialize the VL */ buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t)); if (buf == NULL) goto out; - + /* read */ if (H5Aread(aid,tid,buf)<0) goto out; @@ -1003,17 +1003,17 @@ int H5DSget_num_scales(hid_t did, goto out; if (H5Sclose(sid)<0) goto out; - if (H5Tclose(tid)<0) + if (H5Tclose(tid)<0) goto out; if (H5Aclose(aid)<0) goto out; if (buf) free(buf); - - } /* has_dimlist */ + + } /* has_dimlist */ return nscales; - + /* error zone, gracefully close */ out: H5E_BEGIN_TRY { @@ -1043,10 +1043,10 @@ out: *------------------------------------------------------------------------- */ -herr_t H5DSset_label(hid_t did, +herr_t H5DSset_label(hid_t did, unsigned int idx, char *label) -{ +{ int has_labels; hid_t sid; /* space ID */ hid_t tid; /* attribute type ID */ @@ -1080,7 +1080,7 @@ herr_t H5DSset_label(hid_t did, /* get dataset space */ if ((sid = H5Dget_space(did))<0) return FAIL; - + /* get rank */ if ((rank=H5Sget_simple_extent_ndims(sid))<0) goto out; @@ -1101,17 +1101,17 @@ herr_t H5DSset_label(hid_t did, /* space for the attribute */ if ((sid = H5Screate_simple(1,dims,NULL))<0) goto out; - + /* create the datatype */ if ((tid = H5Tcopy(H5T_C_S1))<0) goto out; if (H5Tset_size(tid,H5T_VARIABLE)<0) goto out; - + /* create the attribute */ if ((aid = H5Acreate(did,DIMENSION_LABELS,tid,sid,H5P_DEFAULT))<0) goto out; - + /* allocate and initialize */ buf = (char **)malloc((size_t)rank * sizeof(char *)); @@ -1120,14 +1120,14 @@ herr_t H5DSset_label(hid_t did, for(i=0; i<(unsigned int)rank; i++) buf[i] = NULL; - + /* store the label information in the required index */ buf[idx] = label; - + /* write the attribute with the label */ if (H5Awrite(aid,tid,buf)<0) goto out; - + /* close */ if (H5Sclose(sid)<0) goto out; @@ -1138,7 +1138,7 @@ herr_t H5DSset_label(hid_t did, if (buf) free(buf); } - + /*------------------------------------------------------------------------- * just insert label *------------------------------------------------------------------------- @@ -1148,29 +1148,29 @@ herr_t H5DSset_label(hid_t did, { if ((aid = H5Aopen_name(did,DIMENSION_LABELS))<0) goto out; - + if ((tid = H5Aget_type(aid))<0) goto out; - + /* allocate and initialize */ buf = (char **)malloc((size_t)rank * sizeof(char *)); if (buf == NULL) goto out; - + /* read */ if (H5Aread(aid,tid,buf)<0) goto out; /* store the label information in the required index */ buf[idx] = label; - + /* write the attribute with the new references */ if (H5Awrite(aid,tid,buf)<0) goto out; - + /* close */ - if (H5Tclose(tid)<0) + if (H5Tclose(tid)<0) goto out; if (H5Aclose(aid)<0) goto out; @@ -1193,7 +1193,7 @@ out: /*------------------------------------------------------------------------- * Function: H5DSget_label * - * Purpose: Read the label LABEL for dimension IDX of datsset DID + * Purpose: Read the label LABEL for dimension IDX of datsset DID * Up to 'size' characters are stored in 'label' followed by a '\0' string * terminator. If the label is longer than 'size'-1, * the string terminator is stored in the last position of the buffer to @@ -1211,11 +1211,11 @@ out: * *------------------------------------------------------------------------- */ -ssize_t H5DSget_label(hid_t did, +ssize_t H5DSget_label(hid_t did, unsigned int idx, char *label, size_t size) -{ +{ int has_labels; hid_t sid; /* space ID */ hid_t tid; /* attribute type ID */ @@ -1257,7 +1257,7 @@ ssize_t H5DSget_label(hid_t did, /* get dataset space */ if ((sid = H5Dget_space(did))<0) return FAIL; - + /* get rank */ if ((rank=H5Sget_simple_extent_ndims(sid))<0) goto out; @@ -1275,36 +1275,36 @@ ssize_t H5DSget_label(hid_t did, { if ((aid = H5Aopen_name(did,DIMENSION_LABELS))<0) goto out; - + if ((tid = H5Aget_type(aid))<0) goto out; - + /* allocate and initialize */ buf = (char **)malloc((size_t)rank * sizeof(char *)); if (buf == NULL) goto out; - + /* read */ if (H5Aread(aid,tid,buf)<0) goto out; - + /* get the real string length */ nbytes = HDstrlen(buf[idx]); - + /* compute the string length which will fit into the user's buffer */ copy_len = MIN(size-1, nbytes); - + /* copy all/some of the name */ if( label ) { HDmemcpy(label, buf[idx], copy_len); - + /* terminate the string */ label[copy_len]='\0'; } - + /* close */ - if (H5Tclose(tid)<0) + if (H5Tclose(tid)<0) goto out; if (H5Aclose(aid)<0) goto out; @@ -1348,10 +1348,10 @@ out: *------------------------------------------------------------------------- */ -ssize_t H5DSget_scale_name(hid_t did, +ssize_t H5DSget_scale_name(hid_t did, char *name, - size_t size) -{ + size_t size) +{ hid_t aid; /* attribute ID */ hid_t tid; /* attribute type ID */ hid_t sid; /* space ID */ @@ -1372,9 +1372,9 @@ ssize_t H5DSget_scale_name(hid_t did, if (H5I_DATASET!=it) return FAIL; - if ((H5DSis_scale(did))<=0) + if ((H5DSis_scale(did))<=0) return FAIL; - + /*------------------------------------------------------------------------- * check if the DS has a name *------------------------------------------------------------------------- @@ -1391,7 +1391,7 @@ ssize_t H5DSget_scale_name(hid_t did, * open the attribute *------------------------------------------------------------------------- */ - + if ((aid = H5Aopen_name(did,"NAME"))<0) return FAIL; @@ -1411,22 +1411,22 @@ ssize_t H5DSget_scale_name(hid_t did, buf = (char*)malloc(nbytes * sizeof(char)); if (buf == NULL) goto out; - + /* read */ if (H5Aread(aid,tid,buf)<0) goto out; /* compute the string length which will fit into the user's buffer */ copy_len = MIN(size-1, nbytes); - + /* copy all/some of the name */ if (name) { HDmemcpy(name, buf, copy_len); - + /* terminate the string */ name[copy_len]='\0'; } - + /* close */ if (H5Tclose(tid)<0) goto out; @@ -1475,8 +1475,8 @@ out: *------------------------------------------------------------------------- */ -htri_t H5DSis_scale(hid_t did) -{ +htri_t H5DSis_scale(hid_t did) +{ hid_t tid; /* attribute type ID */ hid_t aid; /* attribute ID */ herr_t has_class; /* has the "CLASS" attribute */ @@ -1506,19 +1506,19 @@ htri_t H5DSis_scale(hid_t did) { if ((aid = H5Aopen_name(did,"CLASS"))<0) goto out; - + if ((tid = H5Aget_type(aid))<0) goto out; if (H5Aread(aid,tid,buf)<0) goto out; - if( strcmp(buf,DIMENSION_SCALE_CLASS)==0) + if( strcmp(buf,DIMENSION_SCALE_CLASS)==0) is_ds = 1; else is_ds = 0; - - if (H5Tclose(tid)<0) + + if (H5Tclose(tid)<0) goto out; if (H5Aclose(aid)<0) @@ -1526,7 +1526,7 @@ htri_t H5DSis_scale(hid_t did) } return is_ds; - + /* error zone, gracefully close */ out: H5E_BEGIN_TRY { @@ -1541,16 +1541,16 @@ out: /*------------------------------------------------------------------------- * Function: H5DSiterate_scales * - * Purpose: H5DSiterate_scales iterates over the scales attached to dimension dim - * of dataset dset. For each scale in the list, the visitor_data and some - * additional information, specified below, are passed to the visitor function. - * The iteration begins with the idx object in the group and the next element - * to be processed by the operator is returned in idx. If idx is NULL, then the + * Purpose: H5DSiterate_scales iterates over the scales attached to dimension dim + * of dataset dset. For each scale in the list, the visitor_data and some + * additional information, specified below, are passed to the visitor function. + * The iteration begins with the idx object in the group and the next element + * to be processed by the operator is returned in idx. If idx is NULL, then the * iterator starts at zero. * * Parameters: * - * hid_t DID; IN: the dataset + * hid_t DID; IN: the dataset * unsigned int dim; IN: the dimension of the dataset * int *idx; IN/OUT: input the index to start iterating, output the next index * to visit. If NULL, start at the first position. @@ -1560,10 +1560,10 @@ out: * Iterate over all scales of DIM, calling an application callback * with the item, key and any operator data. * - * The operator callback receives a pointer to the item , + * The operator callback receives a pointer to the item , * 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. @@ -1581,10 +1581,10 @@ out: *------------------------------------------------------------------------- */ -herr_t H5DSiterate_scales(hid_t did, - unsigned int dim, - int *idx, - H5DS_iterate_t visitor, +herr_t H5DSiterate_scales(hid_t did, + unsigned int dim, + int *idx, + H5DS_iterate_t visitor, void *visitor_data ) { hid_t scale_id; @@ -1619,7 +1619,7 @@ herr_t H5DSiterate_scales(hid_t did, /* get dataset space */ if ((sid = H5Dget_space(did))<0) return FAIL; - + /* get rank */ if ((rank=H5Sget_simple_extent_ndims(sid))<0) goto out; @@ -1643,22 +1643,22 @@ herr_t H5DSiterate_scales(hid_t did, goto out; if ((sid = H5Aget_space(aid))<0) goto out; - + /* allocate and initialize the VL */ buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t)); if (buf == NULL) goto out; - + /* read */ if (H5Aread(aid,tid,buf)<0) goto out; - + if ( buf[dim].len > 0 ) { if (idx!=NULL) j_idx = *idx; - else + else j_idx=0; /* iterate */ @@ -1673,15 +1673,15 @@ herr_t H5DSiterate_scales(hid_t did, if ((scale_id = H5Rdereference(did,H5R_OBJECT,&ref))<0) goto out; } H5E_END_TRY; - + if((ret_value=(visitor)(did,dim,scale_id,visitor_data))!=0) { /* set the return IDX OUT value at current scale index and break */ - if (idx!=NULL) + if (idx!=NULL) { *idx = i; } - + /* close the DS id */ if (H5Dclose(scale_id)<0) goto out; @@ -1695,23 +1695,23 @@ herr_t H5DSiterate_scales(hid_t did, } /* i */ } /* if */ - + /* close */ if (H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf)<0) goto out; if (H5Sclose(sid)<0) goto out; - if (H5Tclose(tid)<0) + if (H5Tclose(tid)<0) goto out; if (H5Aclose(aid)<0) goto out; if (buf) free(buf); - + } /* if has_dimlist */ return ret_value; - + out: H5E_BEGIN_TRY { if (buf) @@ -1724,17 +1724,17 @@ out: H5Tclose(tid); } H5E_END_TRY; return FAIL; -} +} /*------------------------------------------------------------------------- * Function: H5DSis_attached * - * Purpose: Report if dimension scale DSID is currently attached to + * Purpose: Report if dimension scale DSID is currently attached to * dimension IDX of dataset DID by checking if DID has a pointer in the REFERENCE_LIST - * attribute and DSID (scale ) has a pointer in the DIMENSION_LIST attribute + * attribute and DSID (scale ) has a pointer in the DIMENSION_LIST attribute * - * Return: + * Return: * 1: both the DS and the dataset pointers match * 0: one of them or both do not match * FAIL (-1): error @@ -1752,8 +1752,8 @@ out: htri_t H5DSis_attached(hid_t did, hid_t dsid, - unsigned int idx) -{ + unsigned int idx) +{ int has_dimlist; int has_reflist; hssize_t nelmts; @@ -1775,9 +1775,9 @@ htri_t H5DSis_attached(hid_t did, *------------------------------------------------------------------------- */ /* the dataset cannot be a DS dataset */ - if ((H5DSis_scale(did))==1) + if ((H5DSis_scale(did))==1) return FAIL; - + /* get info for the dataset in the parameter list */ if (H5Gget_objinfo(did,".",TRUE,&sb1)<0) return FAIL; @@ -1787,7 +1787,7 @@ htri_t H5DSis_attached(hid_t did, return FAIL; /* same object, not valid */ - if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) + if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) return FAIL; /* get ID type */ @@ -1807,7 +1807,7 @@ htri_t H5DSis_attached(hid_t did, /* get dataset space */ if ((sid = H5Dget_space(did))<0) return FAIL; - + /* get rank */ if ((rank=H5Sget_simple_extent_ndims(sid))<0) goto out; @@ -1828,24 +1828,24 @@ htri_t H5DSis_attached(hid_t did, * open "DIMENSION_LIST" *------------------------------------------------------------------------- */ - + if ( has_dimlist == 1 ) { if ((aid = H5Aopen_name(did,DIMENSION_LIST))<0) goto out; - + if ((tid = H5Aget_type(aid))<0) goto out; if ((sid = H5Aget_space(aid))<0) goto out; - + /* allocate and initialize the VL */ buf = (hvl_t*)malloc((size_t)rank * sizeof(hvl_t)); if (buf == NULL) goto out; - + /* read */ if (H5Aread(aid,tid,buf)<0) goto out; @@ -1859,83 +1859,83 @@ htri_t H5DSis_attached(hid_t did, /* get the scale id for this REF */ if ((dsid_j = H5Rdereference(did,H5R_OBJECT,&ref))<0) goto out; - + /* get info for DS in the parameter list */ if (H5Gget_objinfo(dsid,".",TRUE,&sb1)<0) goto out; - + /* get info for this DS */ if (H5Gget_objinfo(dsid_j,".",TRUE,&sb2)<0) goto out; - + /* same object */ - if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) + if (sb1.fileno==sb2.fileno && sb1.objno==sb2.objno) { found_ds = 1; } - + /* close the dereferenced dataset */ if (H5Dclose(dsid_j)<0) goto out; } - + /* close */ if (H5Dvlen_reclaim(tid,sid,H5P_DEFAULT,buf)<0) goto out; if (H5Sclose(sid)<0) goto out; - if (H5Tclose(tid)<0) + if (H5Tclose(tid)<0) goto out; if (H5Aclose(aid)<0) goto out; if (buf) free(buf); - } /* has_dimlist */ - + } /* has_dimlist */ + /*------------------------------------------------------------------------- * info on the >>DS<< dataset *------------------------------------------------------------------------- */ - + /* try to find the attribute "REFERENCE_LIST" on the >>DS<< dataset */ if ((has_reflist = H5LT_find_attribute(dsid,REFERENCE_LIST))<0) goto out; /*------------------------------------------------------------------------- - * open "REFERENCE_LIST" + * open "REFERENCE_LIST" *------------------------------------------------------------------------- */ - + if ( has_reflist == 1 ) { if ((aid = H5Aopen_name(dsid,REFERENCE_LIST))<0) goto out; - + if ((tid = H5Aget_type(aid))<0) goto out; - + /* get and save the old reference(s) */ if ((sid = H5Aget_space(aid))<0) goto out; - + if ((nelmts = H5Sget_simple_extent_npoints(sid))<0) goto out; - + dsbuf = malloc((size_t)nelmts * sizeof(ds_list_t)); if (dsbuf == NULL) goto out; - + if (H5Aread(aid,tid,dsbuf)<0) goto out; - + /*------------------------------------------------------------------------- * iterate *------------------------------------------------------------------------- */ - + for(i=0; i table_size ) goto out; - /* Get the dataspace handle */ + /* Get the dataspace handle */ if ( (space_id = H5Dget_space( dataset_id )) < 0 ) goto out; diff --git a/hl/src/H5HL_private.h b/hl/src/H5HL_private.h index d6f2157..c431e7d 100644 --- a/hl/src/H5HL_private.h +++ b/hl/src/H5HL_private.h @@ -28,7 +28,7 @@ extern "C" { */ herr_t H5TBcommon_append_records( hid_t dataset_id, - hid_t mem_type_id, + hid_t mem_type_id, hsize_t nrecords, hsize_t orig_table_size, const void * data); diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c index 9e8982d..0db602c 100644 --- a/hl/src/H5IM.c +++ b/hl/src/H5IM.c @@ -27,7 +27,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: @@ -35,17 +35,17 @@ *------------------------------------------------------------------------- */ -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 ) { hsize_t dims[IMAGE8_RANK]; - + /* Initialize the image dimensions */ - dims[0] = height; - dims[1] = width; + dims[0] = height; + dims[1] = width; dims[2] = 1; /* Make the dataset */ @@ -79,12 +79,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: @@ -92,34 +92,34 @@ 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, const unsigned char *buffer ) { hsize_t dims[IMAGE24_RANK]; - + /* 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] = IMAGE24_RANK; + dims[0] = height; + dims[1] = width; + dims[2] = IMAGE24_RANK; } 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] = IMAGE24_RANK; - dims[1] = height; - dims[2] = width; + dims[0] = IMAGE24_RANK; + dims[1] = height; + dims[2] = width; } else return -1; - + /* Make the dataset */ if ( H5LTmake_dataset( loc_id, dset_name, IMAGE24_RANK, dims, H5T_NATIVE_UCHAR, buffer ) < 0 ) return -1; @@ -151,7 +151,7 @@ herr_t H5IMmake_image_24bit( hid_t loc_id, * * Purpose: operator function used by H5LT_find_palette * - * Return: + * Return: * * Programmer: Pedro Vicente Nunes, pvn@ncsa.uiuc.edu * @@ -167,33 +167,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 * @@ -209,7 +209,7 @@ static herr_t find_palette( hid_t loc_id, const char *name, void *op_data ) *------------------------------------------------------------------------- */ -herr_t H5IM_find_palette( hid_t loc_id ) +herr_t H5IM_find_palette( hid_t loc_id ) { unsigned int attr_num; /* Starting attribute to look up */ @@ -225,7 +225,7 @@ 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 @@ -235,7 +235,7 @@ 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: @@ -243,18 +243,18 @@ 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[IMAGE24_RANK]; hid_t attr_id; - hid_t attr_type; + hid_t attr_type; int has_attr; hid_t attr_space_id; hid_t attr_class; @@ -289,7 +289,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; @@ -304,18 +304,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]; } @@ -324,7 +324,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 = 1; } @@ -345,7 +345,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; @@ -366,13 +366,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; @@ -403,7 +403,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: @@ -411,11 +411,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 ) @@ -450,7 +450,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: @@ -458,18 +458,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; @@ -485,7 +485,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; } @@ -503,23 +503,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; @@ -532,12 +532,12 @@ herr_t H5IMlink_palette( hid_t loc_id, hsize_t dim_ref; int ok_pal; - /* The image dataset may or may not have the attribute "PALETTE" + /* The image dataset may or may 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; @@ -551,11 +551,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; @@ -581,7 +581,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; @@ -615,7 +615,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; @@ -636,22 +636,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: @@ -673,7 +673,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: @@ -681,10 +681,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; @@ -693,17 +693,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; @@ -720,7 +720,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; @@ -735,21 +735,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: @@ -776,8 +776,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; @@ -802,7 +802,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; @@ -820,13 +820,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; @@ -843,7 +843,7 @@ out: return -1; } - + /*------------------------------------------------------------------------- * Function: H5IMget_palette_info @@ -857,7 +857,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: @@ -865,7 +865,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 ) @@ -895,7 +895,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; @@ -931,7 +931,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; @@ -946,18 +946,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; @@ -969,7 +969,7 @@ out: return -1; } - + /*------------------------------------------------------------------------- * Function: H5IMget_palette @@ -983,7 +983,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: @@ -991,7 +991,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 ) @@ -1019,7 +1019,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; @@ -1059,13 +1059,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; } @@ -1081,7 +1081,7 @@ out: return -1; } - + /*------------------------------------------------------------------------- * Function: H5IMis_image * @@ -1094,7 +1094,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: @@ -1102,7 +1102,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; @@ -1133,7 +1133,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; @@ -1143,12 +1143,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_CLASS ) == 0 ) + if( strcmp( attr_data, IMAGE_CLASS ) == 0 ) ret = 1; else ret = 0; - - if ( H5Tclose( attr_type ) < 0 ) + + if ( H5Tclose( attr_type ) < 0 ) goto out; if ( H5Aclose( attr_id ) < 0 ) @@ -1180,7 +1180,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: @@ -1188,7 +1188,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; @@ -1219,7 +1219,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; @@ -1229,12 +1229,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_CLASS ) == 0 ) + if( strcmp( attr_data, PALETTE_CLASS ) == 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 b2d96ad..a18434f 100644 --- a/hl/src/H5IM.h +++ b/hl/src/H5IM.h @@ -28,69 +28,69 @@ extern "C" { #define IMAGE24_RANK 3 -H5_HLDLL herr_t H5IMmake_image_8bit( hid_t loc_id, - const char *dset_name, +H5_HLDLL herr_t H5IMmake_image_8bit( hid_t loc_id, + const char *dset_name, hsize_t width, hsize_t height, const unsigned char *buffer ); -H5_HLDLL herr_t H5IMmake_image_24bit( hid_t loc_id, - const char *dset_name, +H5_HLDLL 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 ); -H5_HLDLL herr_t H5IMget_image_info( hid_t loc_id, - const char *dset_name, +H5_HLDLL 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 ); -H5_HLDLL herr_t H5IMread_image( hid_t loc_id, - const char *dset_name, +H5_HLDLL herr_t H5IMread_image( hid_t loc_id, + const char *dset_name, unsigned char *buffer ); -H5_HLDLL herr_t H5IMmake_palette( hid_t loc_id, +H5_HLDLL herr_t H5IMmake_palette( hid_t loc_id, const char *pal_name, const hsize_t *pal_dims, const unsigned char *pal_data ); -H5_HLDLL herr_t H5IMlink_palette( hid_t loc_id, - const char *image_name, +H5_HLDLL herr_t H5IMlink_palette( hid_t loc_id, + const char *image_name, const char *pal_name ); -H5_HLDLL herr_t H5IMunlink_palette( hid_t loc_id, - const char *image_name, +H5_HLDLL herr_t H5IMunlink_palette( hid_t loc_id, + const char *image_name, const char *pal_name ); -H5_HLDLL herr_t H5IMget_npalettes( hid_t loc_id, - const char *image_name, +H5_HLDLL herr_t H5IMget_npalettes( hid_t loc_id, + const char *image_name, hssize_t *npals ); -H5_HLDLL herr_t H5IMget_palette_info( hid_t loc_id, - const char *image_name, +H5_HLDLL herr_t H5IMget_palette_info( hid_t loc_id, + const char *image_name, int pal_number, hsize_t *pal_dims ); -H5_HLDLL herr_t H5IMget_palette( hid_t loc_id, +H5_HLDLL herr_t H5IMget_palette( hid_t loc_id, const char *image_name, int pal_number, unsigned char *pal_data ); -H5_HLDLL herr_t H5IMis_image( hid_t loc_id, +H5_HLDLL herr_t H5IMis_image( hid_t loc_id, const char *dset_name ); -H5_HLDLL herr_t H5IMis_palette( hid_t loc_id, +H5_HLDLL herr_t H5IMis_palette( hid_t loc_id, const char *dset_name ); H5_HLDLL herr_t H5IM_find_palette(hid_t loc_id ); - + #ifdef __cplusplus diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index bdd76ef..aab6a37 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -15,23 +15,23 @@ #include /*------------------------------------------------------------------------- - * + * * internal 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; @@ -1576,14 +1576,14 @@ herr_t H5LTset_attribute_long( hid_t loc_id, *------------------------------------------------------------------------- */ -herr_t H5LTset_attribute_long_long( hid_t loc_id, - const char *obj_name, +herr_t H5LTset_attribute_long_long( hid_t loc_id, + const char *obj_name, const char *attr_name, const long_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_LLONG, data ) < 0 ) return -1; @@ -1608,14 +1608,14 @@ herr_t H5LTset_attribute_long_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; @@ -1641,14 +1641,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; @@ -1673,14 +1673,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; @@ -1709,28 +1709,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; -} +} /*------------------------------------------------------------------------- @@ -1745,7 +1745,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. @@ -1757,10 +1757,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; @@ -1785,16 +1785,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; @@ -1854,19 +1854,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; @@ -1936,7 +1936,7 @@ out: /*------------------------------------------------------------------------- * Function: H5LTcreate_compound_type * - * Purpose: + * Purpose: * * Return: Success: 0, Failure: -1 * @@ -1952,19 +1952,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; @@ -1984,7 +1984,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 @@ -1993,7 +1993,7 @@ out: * * Date: January 17, 2002 * - * Comments: + * Comments: * * Modifications: * @@ -2001,16 +2001,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 */ @@ -2042,12 +2042,12 @@ herr_t H5LTrepack( hsize_t nfields, src_buf += src_sizes[j]; } - + } - + if ( size_pad != NULL ) free( size_pad ); - + return 0; out: @@ -2057,9 +2057,9 @@ out: /*------------------------------------------------------------------------- - * + * * Get attribute functions - * + * *------------------------------------------------------------------------- */ @@ -2083,10 +2083,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 */ @@ -2096,7 +2096,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; @@ -2130,10 +2130,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 */ @@ -2143,7 +2143,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; @@ -2177,10 +2177,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 */ @@ -2190,7 +2190,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; @@ -2226,10 +2226,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 */ @@ -2239,7 +2239,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; @@ -2273,10 +2273,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 */ @@ -2286,7 +2286,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; @@ -2322,10 +2322,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 */ @@ -2335,7 +2335,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; @@ -2369,10 +2369,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 */ @@ -2382,7 +2382,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; @@ -2418,10 +2418,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 */ @@ -2431,7 +2431,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; @@ -2464,10 +2464,10 @@ herr_t H5LTget_attribute_long( hid_t loc_id, * *------------------------------------------------------------------------- */ -herr_t H5LTget_attribute_long_long( hid_t loc_id, - const char *obj_name, +herr_t H5LTget_attribute_long_long( hid_t loc_id, + const char *obj_name, const char *attr_name, - long_long *data ) + long_long *data ) { /* identifiers */ @@ -2477,7 +2477,7 @@ herr_t H5LTget_attribute_long_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; @@ -2512,10 +2512,10 @@ herr_t H5LTget_attribute_long_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 */ @@ -2525,7 +2525,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; @@ -2562,10 +2562,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 */ @@ -2575,7 +2575,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; @@ -2612,10 +2612,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 */ @@ -2625,7 +2625,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; @@ -2662,11 +2662,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 */ @@ -2676,7 +2676,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; @@ -2695,7 +2695,7 @@ herr_t H5LTget_attribute( hid_t loc_id, return 0; } - + /*------------------------------------------------------------------------- * private functions *------------------------------------------------------------------------- @@ -2721,10 +2721,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 */ @@ -2764,9 +2764,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; @@ -2780,7 +2780,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; @@ -2818,26 +2818,26 @@ out: */ -herr_t H5LT_set_attribute_string(hid_t dset_id, +herr_t H5LT_set_attribute_string(hid_t dset_id, char *name, - char *buf ) + char *buf ) { hid_t tid; hid_t sid; hid_t aid; int has_attr; size_t size; - + /* verify if the attribute already exists */ has_attr = H5LT_find_attribute(dset_id,name); - + /* the attribute already exists, delete it */ if ( has_attr == 1 ) { if ( H5Adelete(dset_id,name)<0) return FAIL; } - + /*------------------------------------------------------------------------- * create the attribute type *------------------------------------------------------------------------- @@ -2856,7 +2856,7 @@ herr_t H5LT_set_attribute_string(hid_t dset_id, if ((sid = H5Screate(H5S_SCALAR))<0) goto out; - + /*------------------------------------------------------------------------- * create and write the attribute *------------------------------------------------------------------------- @@ -2866,10 +2866,10 @@ herr_t H5LT_set_attribute_string(hid_t dset_id, if (H5Awrite(aid,tid,buf)<0) goto out; - + if (H5Aclose(aid)<0) goto out; - + if (H5Sclose(sid)<0) goto out; @@ -2877,7 +2877,7 @@ herr_t H5LT_set_attribute_string(hid_t dset_id, goto out; return SUCCESS; - + /* error zone, gracefully close */ out: H5E_BEGIN_TRY { @@ -2886,6 +2886,6 @@ out: H5Sclose(sid); } H5E_END_TRY; return FAIL; - + } diff --git a/hl/src/H5LT.h b/hl/src/H5LT.h index 53b97ba..c9d6269 100644 --- a/hl/src/H5LT.h +++ b/hl/src/H5LT.h @@ -46,51 +46,51 @@ extern "C" { *------------------------------------------------------------------------- */ -H5_HLDLL herr_t H5LTmake_dataset( hid_t loc_id, - const char *dset_name, - int rank, +H5_HLDLL 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 ); -H5_HLDLL herr_t H5LTmake_dataset_char( hid_t loc_id, - const char *dset_name, - int rank, +H5_HLDLL herr_t H5LTmake_dataset_char( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, const char *buffer ); -H5_HLDLL herr_t H5LTmake_dataset_short( hid_t loc_id, - const char *dset_name, - int rank, +H5_HLDLL herr_t H5LTmake_dataset_short( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, const short *buffer ); -H5_HLDLL herr_t H5LTmake_dataset_int( hid_t loc_id, - const char *dset_name, - int rank, +H5_HLDLL herr_t H5LTmake_dataset_int( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, const int *buffer ); -H5_HLDLL herr_t H5LTmake_dataset_long( hid_t loc_id, - const char *dset_name, - int rank, +H5_HLDLL herr_t H5LTmake_dataset_long( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, const long *buffer ); -H5_HLDLL herr_t H5LTmake_dataset_float( hid_t loc_id, - const char *dset_name, - int rank, +H5_HLDLL herr_t H5LTmake_dataset_float( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, const float *buffer ); -H5_HLDLL herr_t H5LTmake_dataset_double( hid_t loc_id, - const char *dset_name, - int rank, +H5_HLDLL herr_t H5LTmake_dataset_double( hid_t loc_id, + const char *dset_name, + int rank, const hsize_t *dims, const double *buffer ); -H5_HLDLL herr_t H5LTmake_dataset_string( hid_t loc_id, - const char *dset_name, +H5_HLDLL herr_t H5LTmake_dataset_string( hid_t loc_id, + const char *dset_name, const char *buf ); @@ -101,36 +101,36 @@ H5_HLDLL herr_t H5LTmake_dataset_string( hid_t loc_id, *------------------------------------------------------------------------- */ -H5_HLDLL herr_t H5LTread_dataset( hid_t loc_id, +H5_HLDLL herr_t H5LTread_dataset( hid_t loc_id, const char *dset_name, hid_t type_id, void *buffer ); -H5_HLDLL herr_t H5LTread_dataset_char( hid_t loc_id, +H5_HLDLL herr_t H5LTread_dataset_char( hid_t loc_id, const char *dset_name, char *buffer ); -H5_HLDLL herr_t H5LTread_dataset_short( hid_t loc_id, +H5_HLDLL herr_t H5LTread_dataset_short( hid_t loc_id, const char *dset_name, short *buffer ); -H5_HLDLL herr_t H5LTread_dataset_int( hid_t loc_id, +H5_HLDLL herr_t H5LTread_dataset_int( hid_t loc_id, const char *dset_name, int *buffer ); -H5_HLDLL herr_t H5LTread_dataset_long( hid_t loc_id, +H5_HLDLL herr_t H5LTread_dataset_long( hid_t loc_id, const char *dset_name, long *buffer ); -H5_HLDLL herr_t H5LTread_dataset_float( hid_t loc_id, +H5_HLDLL herr_t H5LTread_dataset_float( hid_t loc_id, const char *dset_name, float *buffer ); -H5_HLDLL herr_t H5LTread_dataset_double( hid_t loc_id, +H5_HLDLL herr_t H5LTread_dataset_double( hid_t loc_id, const char *dset_name, double *buffer ); -H5_HLDLL herr_t H5LTread_dataset_string( hid_t loc_id, +H5_HLDLL herr_t H5LTread_dataset_string( hid_t loc_id, const char *dset_name, char *buf ); @@ -142,17 +142,17 @@ H5_HLDLL herr_t H5LTread_dataset_string( hid_t loc_id, */ -H5_HLDLL herr_t H5LTget_dataset_ndims( hid_t loc_id, +H5_HLDLL herr_t H5LTget_dataset_ndims( hid_t loc_id, const char *dset_name, int *rank ); -H5_HLDLL herr_t H5LTget_dataset_info( hid_t loc_id, +H5_HLDLL 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 ); -H5_HLDLL herr_t H5LTfind_dataset( hid_t loc_id, const char *name ); +H5_HLDLL herr_t H5LTfind_dataset( hid_t loc_id, const char *name ); @@ -164,73 +164,73 @@ H5_HLDLL herr_t H5LTfind_dataset( hid_t loc_id, const char *name ); */ -H5_HLDLL herr_t H5LTset_attribute_string( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_string( hid_t loc_id, + const char *obj_name, const char *attr_name, const char *attr_data ); -H5_HLDLL herr_t H5LTset_attribute_char( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_char( hid_t loc_id, + const char *obj_name, const char *attr_name, const char *buffer, size_t size ); -H5_HLDLL herr_t H5LTset_attribute_uchar( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_uchar( hid_t loc_id, + const char *obj_name, const char *attr_name, const unsigned char *buffer, size_t size ); -H5_HLDLL herr_t H5LTset_attribute_short( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_short( hid_t loc_id, + const char *obj_name, const char *attr_name, const short *buffer, size_t size ); -H5_HLDLL herr_t H5LTset_attribute_ushort( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_ushort( hid_t loc_id, + const char *obj_name, const char *attr_name, const unsigned short *buffer, size_t size ); -H5_HLDLL herr_t H5LTset_attribute_int( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_int( hid_t loc_id, + const char *obj_name, const char *attr_name, const int *buffer, size_t size ); -H5_HLDLL herr_t H5LTset_attribute_uint( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_uint( hid_t loc_id, + const char *obj_name, const char *attr_name, const unsigned int *buffer, size_t size ); -H5_HLDLL herr_t H5LTset_attribute_long( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_long( hid_t loc_id, + const char *obj_name, const char *attr_name, const long *buffer, size_t size ); -H5_HLDLL herr_t H5LTset_attribute_long_long( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_long_long( hid_t loc_id, + const char *obj_name, const char *attr_name, const long_long *buffer, size_t size ); -H5_HLDLL herr_t H5LTset_attribute_ulong( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_ulong( hid_t loc_id, + const char *obj_name, const char *attr_name, const unsigned long *buffer, size_t size ); -H5_HLDLL herr_t H5LTset_attribute_float( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_float( hid_t loc_id, + const char *obj_name, const char *attr_name, const float *buffer, size_t size ); -H5_HLDLL herr_t H5LTset_attribute_double( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTset_attribute_double( hid_t loc_id, + const char *obj_name, const char *attr_name, const double *buffer, size_t size ); @@ -242,69 +242,69 @@ H5_HLDLL herr_t H5LTset_attribute_double( hid_t loc_id, *------------------------------------------------------------------------- */ -H5_HLDLL herr_t H5LTget_attribute( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute( hid_t loc_id, + const char *obj_name, const char *attr_name, hid_t mem_type_id, void *data ); -H5_HLDLL herr_t H5LTget_attribute_string( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_string( hid_t loc_id, + const char *obj_name, const char *attr_name, char *data ); -H5_HLDLL herr_t H5LTget_attribute_char( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_char( hid_t loc_id, + const char *obj_name, const char *attr_name, char *data ); -H5_HLDLL herr_t H5LTget_attribute_uchar( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_uchar( hid_t loc_id, + const char *obj_name, const char *attr_name, unsigned char *data ); -H5_HLDLL herr_t H5LTget_attribute_short( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_short( hid_t loc_id, + const char *obj_name, const char *attr_name, short *data ); -H5_HLDLL herr_t H5LTget_attribute_ushort( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_ushort( hid_t loc_id, + const char *obj_name, const char *attr_name, unsigned short *data ); -H5_HLDLL herr_t H5LTget_attribute_int( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_int( hid_t loc_id, + const char *obj_name, const char *attr_name, int *data ); -H5_HLDLL herr_t H5LTget_attribute_uint( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_uint( hid_t loc_id, + const char *obj_name, const char *attr_name, unsigned int *data ); -H5_HLDLL herr_t H5LTget_attribute_long( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_long( hid_t loc_id, + const char *obj_name, const char *attr_name, long *data ); -H5_HLDLL herr_t H5LTget_attribute_long_long( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_long_long( hid_t loc_id, + const char *obj_name, const char *attr_name, long_long *data ); -H5_HLDLL herr_t H5LTget_attribute_ulong( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_ulong( hid_t loc_id, + const char *obj_name, const char *attr_name, unsigned long *data ); -H5_HLDLL herr_t H5LTget_attribute_float( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_float( hid_t loc_id, + const char *obj_name, const char *attr_name, float *data ); -H5_HLDLL herr_t H5LTget_attribute_double( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_double( hid_t loc_id, + const char *obj_name, const char *attr_name, double *data ); @@ -317,13 +317,13 @@ H5_HLDLL herr_t H5LTget_attribute_double( hid_t loc_id, */ -H5_HLDLL herr_t H5LTget_attribute_ndims( hid_t loc_id, - const char *obj_name, +H5_HLDLL herr_t H5LTget_attribute_ndims( hid_t loc_id, + const char *obj_name, const char *attr_name, int *rank ); -H5_HLDLL herr_t H5LTget_attribute_info( hid_t loc_id, - const char *obj_name, +H5_HLDLL 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, @@ -341,51 +341,51 @@ H5_HLDLL herr_t H5LTget_attribute_info( hid_t loc_id, */ -H5_HLDLL hid_t H5LTcreate_compound_type( hsize_t nfields, size_t size, const char *field_names[], +H5_HLDLL 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 ); -H5_HLDLL 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, +H5_HLDLL 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 - * + * *------------------------------------------------------------------------- */ -H5_HLDLL herr_t H5LT_get_attribute_mem( hid_t obj_id, +H5_HLDLL herr_t H5LT_get_attribute_mem( hid_t obj_id, const char *attr_name, hid_t mem_type_id, void *data ); -H5_HLDLL herr_t H5LT_get_attribute_disk( hid_t obj_id, +H5_HLDLL herr_t H5LT_get_attribute_disk( hid_t obj_id, const char *attr_name, void *data ); -H5_HLDLL herr_t H5LT_find_attribute( hid_t loc_id, const char *name ); +H5_HLDLL herr_t H5LT_find_attribute( hid_t loc_id, const char *name ); -H5_HLDLL herr_t H5LT_set_attribute_numerical( hid_t loc_id, - const char *obj_name, +H5_HLDLL 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, const void *data ); -H5_HLDLL herr_t H5LT_set_attribute_string( hid_t dset_id, +H5_HLDLL herr_t H5LT_set_attribute_string( hid_t dset_id, char *name, char *buf ); diff --git a/hl/src/H5PT.c b/hl/src/H5PT.c index d59e9ed..083e0e7 100644 --- a/hl/src/H5PT.c +++ b/hl/src/H5PT.c @@ -54,8 +54,8 @@ herr_t H5PT_set_index(htbl_t *table_id, hsize_t pt_index); * * Date: March 12, 2004 * - * Comments: This function does not handle compression or fill data - * currently. Fill data is not necessary because the + * Comments: This function does not handle compression or fill data + * currently. Fill data is not necessary because the * table is initially of size 0. * * Modifications: @@ -112,7 +112,7 @@ hid_t H5PTcreate_fl ( hid_t loc_id, /* Create the table identifier */ table->dset_id = dset_id; - if((table->type_id = H5Tcopy(dtype_id)) <0) + if((table->type_id = H5Tcopy(dtype_id)) <0) goto out; H5PT_create_index(table); @@ -152,8 +152,8 @@ hid_t H5PTcreate_fl ( hid_t loc_id, * * Date: April 12, 2004 * - * Comments: This function does not handle compression or fill data - * currently. Fill data is not necessary because the + * Comments: This function does not handle compression or fill data + * currently. Fill data is not necessary because the * table is initially of size 0. * * Modifications: @@ -200,7 +200,7 @@ out: * * Date: March 10, 2004 * - * Comments: + * Comments: * * Modifications: * @@ -273,7 +273,7 @@ out: /*------------------------------------------------------------------------- * Function: H5PT_close * - * Purpose: Closes a table (i.e. cleans up all open resources used by a + * Purpose: Closes a table (i.e. cleans up all open resources used by a * table). * * Return: Success: 0, Failure: -1 @@ -283,7 +283,7 @@ out: * * Date: March 10, 2004 * - * Comments: + * Comments: * * Modifications: * @@ -321,7 +321,7 @@ out: /*------------------------------------------------------------------------- * Function: H5PTclose * - * Purpose: Closes a table (i.e. cleans up all open resources used by a + * Purpose: Closes a table (i.e. cleans up all open resources used by a * table). * * Return: Success: 0, Failure: -1 @@ -331,7 +331,7 @@ out: * * Date: April 21, 2004 * - * Comments: + * Comments: * * Modifications: * @@ -386,7 +386,7 @@ out: * * Date: March 12, 2004 * - * Comments: + * Comments: * * Modifications: * @@ -406,7 +406,7 @@ herr_t H5PTappend( hid_t table_id, if (nrecords == 0) return 0; - if((H5TBcommon_append_records(table->dset_id, table->type_id, + if((H5TBcommon_append_records(table->dset_id, table->type_id, nrecords, table->size, data)) <0) goto out; @@ -427,9 +427,9 @@ out: /*------------------------------------------------------------------------- - * Function: H5PTget_next + * Function: H5PTget_next * - * Purpose: Reads packets starting at the current index and updates + * Purpose: Reads packets starting at the current index and updates * that index * * Return: Success: 0, Failure: -1 @@ -441,7 +441,7 @@ out: * * Comments: * - * Modifications: + * Modifications: * * *------------------------------------------------------------------------- @@ -460,7 +460,7 @@ herr_t H5PTget_next( hid_t table_id, if (nrecords == 0) return 0; - if((H5TBcommon_read_records(table->dset_id, table->type_id, + if((H5TBcommon_read_records(table->dset_id, table->type_id, table->current_index, nrecords, table->size, data)) < 0) goto out; @@ -473,7 +473,7 @@ out: } /*------------------------------------------------------------------------- - * Function: H5PTread_packets + * Function: H5PTread_packets * * Purpose: Reads packets from anywhere in a packet table * @@ -484,9 +484,9 @@ out: * * Date: March 12, 2004 * - * Comments: + * Comments: * - * Modifications: + * Modifications: * * *------------------------------------------------------------------------- @@ -507,7 +507,7 @@ herr_t H5PTread_packets( hid_t table_id, if (nrecords == 0) return 0; - if( H5TBcommon_read_records(table->dset_id, table->type_id, + if( H5TBcommon_read_records(table->dset_id, table->type_id, start, nrecords, table->size, data) < 0) goto out; @@ -518,9 +518,9 @@ out: } /*------------------------------------------------------------------------- - * + * * Table attribute functions - * + * *------------------------------------------------------------------------- */ @@ -536,9 +536,9 @@ out: * * Date: March 12, 2004 * - * Comments: + * Comments: * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ @@ -578,9 +578,9 @@ herr_t H5PT_set_index(htbl_t *table, hsize_t index) * * Date: April 23, 2004 * - * Comments: + * Comments: * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ @@ -613,7 +613,7 @@ herr_t H5PTset_index(hid_t table_id, hsize_t pt_index) */ /*------------------------------------------------------------------------- - * Function: H5PTget_num_packets + * Function: H5PTget_num_packets * * Purpose: Returns by reference the number of packets in the dataset * @@ -626,7 +626,7 @@ herr_t H5PTset_index(hid_t table_id, hsize_t pt_index) * * Comments: * - * Modifications: + * Modifications: * * *------------------------------------------------------------------------- @@ -648,7 +648,7 @@ out: /*------------------------------------------------------------------------- - * Function: H5PTis_valid + * Function: H5PTis_valid * * Purpose: Validates a table identifier * @@ -661,7 +661,7 @@ out: * * Comments: * - * Modifications: + * Modifications: * * *------------------------------------------------------------------------- @@ -676,7 +676,7 @@ herr_t H5PTis_valid(hid_t table_id) } /*------------------------------------------------------------------------- - * Function: H5PTis_varlen + * Function: H5PTis_varlen * * Purpose: Returns 1 if a table_id corresponds to a packet table of variable- * length records or 0 for fixed-length records. @@ -690,7 +690,7 @@ herr_t H5PTis_valid(hid_t table_id) * * Comments: * - * Modifications: + * Modifications: * * *------------------------------------------------------------------------- @@ -716,16 +716,16 @@ out: } /*------------------------------------------------------------------------- - * + * * Memory Management functions - * + * *------------------------------------------------------------------------- */ /*------------------------------------------------------------------------- * Function: H5PTfree_vlen_readbuff * - * Purpose: Frees memory used when reading from a variable length packet + * Purpose: Frees memory used when reading from a variable length packet * table. * * Return: Success: 0, Failure: -1 @@ -738,7 +738,7 @@ out: * * Comments: * - * Modifications: + * Modifications: * * *------------------------------------------------------------------------- diff --git a/hl/src/H5PT.h b/hl/src/H5PT.h index 699419e..9d07131 100644 --- a/hl/src/H5PT.h +++ b/hl/src/H5PT.h @@ -90,9 +90,9 @@ H5_HLDLL herr_t H5PTis_valid( hid_t table_id ); H5_HLDLL herr_t H5PTis_varlen( hid_t table_id ); /*------------------------------------------------------------------------- - * + * * Packet Table "current index" functions - * + * *------------------------------------------------------------------------- */ @@ -102,9 +102,9 @@ H5_HLDLL herr_t H5PTset_index( hid_t table_id, hsize_t pt_index ); /*------------------------------------------------------------------------- - * + * * Memory Management functions - * + * *------------------------------------------------------------------------- */ diff --git a/hl/src/H5TB.c b/hl/src/H5TB.c index 59642da..c67747f 100644 --- a/hl/src/H5TB.c +++ b/hl/src/H5TB.c @@ -21,25 +21,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); @@ -64,14 +64,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, @@ -82,12 +82,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]; @@ -107,7 +107,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; @@ -125,25 +125,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 ) { @@ -151,8 +151,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; @@ -168,7 +168,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_CLASS ) < 0 ) goto out; @@ -176,7 +176,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; @@ -193,7 +193,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; @@ -211,7 +211,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; @@ -229,28 +229,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 */ @@ -279,7 +279,7 @@ out: * * Return: Success: 0, Failure: -1 * - * Programmers: + * Programmers: * Pedro Vicente, pvn@ncsa.uiuc.edu * Quincey Koziol * @@ -287,23 +287,23 @@ 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; hid_t sid=-1; hid_t mem_space_id=-1; @@ -327,7 +327,7 @@ herr_t H5TBappend_records( hid_t loc_id, /* Append the records */ if ((H5TBcommon_append_records(did, mem_type_id, nrecords, nrecords_orig, data))<0) - goto out; + goto out; /* Release the datatype. */ if ( H5Tclose( tid ) < 0 ) @@ -341,7 +341,7 @@ herr_t H5TBappend_records( hid_t loc_id, if ( H5Dclose( did ) < 0 ) goto out; - + return 0; /* error zone, gracefully close */ @@ -369,27 +369,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; @@ -418,7 +418,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; @@ -440,7 +440,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; @@ -453,7 +453,7 @@ herr_t H5TBwrite_records( hid_t loc_id, if ( H5Dclose( did ) < 0 ) return -1; - + return 0; /* error zone, gracefully close */ @@ -481,13 +481,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, @@ -495,15 +495,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; @@ -513,9 +513,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. */ @@ -525,7 +525,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; @@ -552,9 +552,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) { @@ -601,7 +601,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; @@ -617,7 +617,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 */ @@ -648,15 +648,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, @@ -665,15 +665,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; @@ -682,9 +682,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. */ @@ -694,11 +694,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; @@ -709,7 +709,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 ); @@ -720,9 +720,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) @@ -748,7 +748,7 @@ herr_t H5TBwrite_fields_index( hid_t loc_id, goto out; free( member_name ); - + } /* Get the dataspace handle */ @@ -764,7 +764,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; @@ -780,7 +780,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 */ @@ -817,25 +817,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; @@ -843,13 +843,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) @@ -893,30 +893,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]; @@ -936,7 +936,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; @@ -1011,15 +1011,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, @@ -1027,24 +1027,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; @@ -1076,9 +1076,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) @@ -1136,7 +1136,7 @@ herr_t H5TBread_fields_name( hid_t loc_id, goto out; if ( H5Dclose( did ) < 0 ) return -1; - + return 0; /* error zone, gracefully close */ @@ -1166,15 +1166,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, @@ -1183,16 +1183,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; @@ -1216,7 +1216,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 ); @@ -1227,13 +1227,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) @@ -1251,7 +1251,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; @@ -1270,7 +1270,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 ) @@ -1287,7 +1287,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; @@ -1299,7 +1299,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 */ @@ -1340,7 +1340,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 ) @@ -1351,8 +1351,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; @@ -1366,7 +1366,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 *------------------------------------------------------------------------- @@ -1381,11 +1381,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) *------------------------------------------------------------------------- @@ -1399,7 +1399,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; @@ -1412,7 +1412,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; @@ -1461,11 +1461,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 @@ -1474,11 +1474,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: @@ -1499,15 +1499,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, @@ -1521,18 +1521,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) *------------------------------------------------------------------------- */ @@ -1556,7 +1556,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; @@ -1565,7 +1565,7 @@ herr_t H5TBinsert_record( hid_t loc_id, if ( H5Dextend ( did, dims ) < 0 ) goto out; - + /*------------------------------------------------------------------------- * Write the inserted records *------------------------------------------------------------------------- @@ -1588,13 +1588,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 *------------------------------------------------------------------------- @@ -1617,7 +1617,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; @@ -1664,7 +1664,7 @@ out: * * Date: December 5, 2001 * - * Comments: + * Comments: * * Modifications: * @@ -1672,22 +1672,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; @@ -1711,13 +1711,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 *------------------------------------------------------------------------- */ @@ -1754,12 +1754,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 *------------------------------------------------------------------------- @@ -1772,7 +1772,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; @@ -1784,7 +1784,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 */ @@ -1810,14 +1810,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, @@ -1826,23 +1826,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]; @@ -1850,7 +1850,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; @@ -1882,13 +1882,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 *------------------------------------------------------------------------- */ @@ -1911,7 +1911,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 *------------------------------------------------------------------------- @@ -1966,44 +1966,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 *------------------------------------------------------------------------- @@ -2024,7 +2024,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 *------------------------------------------------------------------------- @@ -2046,7 +2046,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; @@ -2063,7 +2063,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1, free( tmp_buf ); /*------------------------------------------------------------------------- - * Get information about the 2nd table + * Get information about the 2nd table *------------------------------------------------------------------------- */ @@ -2108,7 +2108,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 *------------------------------------------------------------------------- @@ -2130,7 +2130,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; @@ -2151,7 +2151,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; @@ -2191,32 +2191,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; @@ -2231,7 +2231,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; @@ -2251,16 +2251,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; @@ -2272,7 +2272,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; @@ -2313,7 +2313,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; @@ -2337,7 +2337,7 @@ herr_t H5TBinsert_field( hid_t loc_id, continue; } - + /* Get the member name */ member_name = H5Tget_member_name( type_id1, (unsigned)idx ); @@ -2347,7 +2347,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; @@ -2360,9 +2360,9 @@ herr_t H5TBinsert_field( hid_t loc_id, if ( H5Tclose( member_type_id ) < 0 ) goto out; - + } /* i */ - + /*------------------------------------------------------------------------- * Create a new temporary dataset *------------------------------------------------------------------------- @@ -2407,7 +2407,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 *------------------------------------------------------------------------- @@ -2427,15 +2427,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 */ @@ -2468,8 +2468,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; @@ -2495,7 +2495,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; @@ -2511,7 +2511,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; /*------------------------------------------------------------------------- @@ -2519,7 +2519,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; /*------------------------------------------------------------------------- @@ -2567,10 +2567,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; @@ -2598,19 +2598,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; @@ -2621,12 +2621,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: @@ -2645,7 +2645,7 @@ out: * * Date: January 30, 2002 * - * Comments: + * Comments: * * Modifications: * @@ -2653,20 +2653,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; @@ -2694,11 +2694,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 *------------------------------------------------------------------------- @@ -2718,7 +2718,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; @@ -2733,9 +2733,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 ); @@ -2748,7 +2748,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; @@ -2760,7 +2760,7 @@ herr_t H5TBdelete_field( hid_t loc_id, } free( member_name ); - + } /* i */ /* No field to delete was found */ @@ -2787,15 +2787,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 ); @@ -2812,11 +2812,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 *------------------------------------------------------------------------- @@ -2845,9 +2845,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 *------------------------------------------------------------------------- @@ -2874,9 +2874,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 ); @@ -2903,23 +2903,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 */ @@ -2932,7 +2932,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 ) @@ -2941,10 +2941,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 */ @@ -2952,7 +2952,7 @@ herr_t H5TBdelete_field( hid_t loc_id, * Release resources from 1st table *------------------------------------------------------------------------- */ - + /* Release the datatype. */ if ( H5Tclose( type_id1 ) < 0 ) goto out; @@ -2978,7 +2978,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; @@ -2996,7 +2996,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; /*------------------------------------------------------------------------- @@ -3004,9 +3004,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 *------------------------------------------------------------------------- @@ -3035,45 +3035,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. */ @@ -3083,7 +3083,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 ); @@ -3095,9 +3095,9 @@ out: } /*------------------------------------------------------------------------- - * + * * Table attribute functions - * + * *------------------------------------------------------------------------- */ @@ -3112,22 +3112,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; } @@ -3143,18 +3143,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; @@ -3168,7 +3168,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 ) @@ -3217,7 +3217,7 @@ out: */ /*------------------------------------------------------------------------- - * Function: H5TBget_table_info + * Function: H5TBget_table_info * * Purpose: Gets the number of records and fields of a table * @@ -3230,26 +3230,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; @@ -3270,19 +3270,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 @@ -3290,15 +3290,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*/ @@ -3340,7 +3340,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, @@ -3348,7 +3348,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; @@ -3414,7 +3414,7 @@ herr_t H5TBget_field_info( hid_t loc_id, goto out; free( member_name ); - + } /* i */ /* Release the datatype. */ @@ -3459,19 +3459,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; -} +} /*------------------------------------------------------------------------- @@ -3496,17 +3496,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_CLASS ) < 0 ) goto out; @@ -3514,7 +3514,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; @@ -3531,7 +3531,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; @@ -3565,10 +3565,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) { @@ -3587,7 +3587,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 space ) + if ( j > space ) { n++; j=0; @@ -130,14 +130,14 @@ static int test_simple(void) for (i=0, j=0, n=0; i < WIDTH*HEIGHT*3; i++, j++) { image_in2[i] = n; - if (j==3) + if (j==3) { n++; j=0; } if (n>255) n=0; } - + /* create a file using default properties */ if ((fid=H5Fcreate(FILE1,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0) goto out; @@ -163,7 +163,7 @@ static int test_simple(void) /* attach the palette to the image dataset */ if (H5IMlink_palette(fid,"image1","palette")<0) goto out; - + /* get info */ if (H5IMget_image_info(fid,"image1",&width,&height,&planes,interlace,&npals)<0) goto out; @@ -180,11 +180,11 @@ static int test_simple(void) /* read image */ if (H5IMread_image(fid,"image1",image_out1)<0) goto out; - + /* check */ - for (i = 0; i < height*width*planes; i++) + for (i = 0; i < height*width*planes; i++) { - if ( image_in1[i] != image_out1[i] ) + if ( image_in1[i] != image_out1[i] ) { goto out; } @@ -199,7 +199,7 @@ static int test_simple(void) */ TESTING2("true color image"); - + /* write image */ if (H5IMmake_image_24bit(fid,"image2",WIDTH,HEIGHT,"INTERLACE_PIXEL",image_in2)) goto out; @@ -220,9 +220,9 @@ static int test_simple(void) goto out; /* check */ - for (i = 0; i < height*width*planes; i++) + for (i = 0; i < height*width*planes; i++) { - if ( image_in2[i] != image_out2[i] ) + if ( image_in2[i] != image_out2[i] ) { goto out; } @@ -252,9 +252,9 @@ static int test_simple(void) goto out; /* check */ - for (i = 0; i < 2; i++) + for (i = 0; i < 2; i++) { - if ( pal_dims[i] != pal_dims_out[i] ) + if ( pal_dims[i] != pal_dims_out[i] ) { goto out; } @@ -269,9 +269,9 @@ static int test_simple(void) goto out; /* check */ - for (i = 0; i < PAL_ENTRIES*3; i++) + for (i = 0; i < PAL_ENTRIES*3; i++) { - if ( pal_data_in[i] != pal_data_out[i] ) + if ( pal_data_in[i] != pal_data_out[i] ) { goto out; } @@ -308,14 +308,14 @@ static int test_simple(void) PASSED(); /*------------------------------------------------------------------------- - * close + * close *------------------------------------------------------------------------- - */ + */ if (H5Fclose(fid)<0) goto out; return 0; - + /* error zone, gracefully close */ out: H5E_BEGIN_TRY { @@ -354,7 +354,7 @@ static int test_data(void) TESTING2("make indexed image"); - /* read first data file */ + /* read first data file */ if (read_data(DATA_FILE1,&width,&height)<0) goto out; @@ -371,11 +371,11 @@ static int test_data(void) * palette #1. rainbow palette. data is contained in "pal_rgb.h" *------------------------------------------------------------------------- */ - + /* initialize the palette data */ pal_dims[0] = 256; pal_dims[1] = 3; - + /* make a palette */ if (H5IMmake_palette(fid,PAL1_NAME,pal_dims,pal_rgb)<0) goto out; @@ -385,7 +385,7 @@ static int test_data(void) goto out; /*------------------------------------------------------------------------- - * palette #2. sepia palette. + * palette #2. sepia palette. * read a PAL file and attach the palette to the HDF5 file *------------------------------------------------------------------------- */ @@ -411,7 +411,7 @@ static int test_data(void) goto out; /*------------------------------------------------------------------------- - * palette #3. earth palette. + * palette #3. earth palette. * read a PAL file and attach the palette to the HDF5 file *------------------------------------------------------------------------- */ @@ -440,7 +440,7 @@ static int test_data(void) /*------------------------------------------------------------------------- - * palette #4. blue-red + * palette #4. blue-red * make a palette whith blue to red colors *------------------------------------------------------------------------- */ @@ -467,16 +467,16 @@ static int test_data(void) TESTING2("make true color image with pixel interlace"); - /* read second data file */ + /* read second data file */ if ((read_data(DATA_FILE2,&width,&height))<0) goto out; - + /* make image */ if ((H5IMmake_image_24bit(fid,IMAGE2_NAME,width,height,"INTERLACE_PIXEL",image_data))<0) goto out; PASSED(); - + /*------------------------------------------------------------------------- * True color image example with plane interlace *------------------------------------------------------------------------- @@ -484,26 +484,26 @@ static int test_data(void) TESTING2("make true color image with plane interlace"); - /* read third data file */ + /* read third data file */ if ((read_data(DATA_FILE3,&width,&height))<0) goto out; - + /* make image */ if ((H5IMmake_image_24bit(fid,IMAGE3_NAME,width,height,"INTERLACE_PLANE",image_data))<0) goto out; PASSED(); - + /*------------------------------------------------------------------------- - * close + * close *------------------------------------------------------------------------- - */ + */ if (H5Fclose(fid)<0) goto out; return 0; - + /* error zone, gracefully close */ out: H5E_BEGIN_TRY { @@ -515,23 +515,23 @@ out: /* - The following test provides an examples of how to generate HDF5 image data from - floating point data. In the example we use real life topographic data - (from the North American hemisphere). In the dataset sea values are represented - as negative numbers and land values are represented as positive numbers. - The example generates 3 HDF5 images, one that generates an image from all the values, - another that generates an image from the land values and another that generates an + The following test provides an examples of how to generate HDF5 image data from + floating point data. In the example we use real life topographic data + (from the North American hemisphere). In the dataset sea values are represented + as negative numbers and land values are represented as positive numbers. + The example generates 3 HDF5 images, one that generates an image from all the values, + another that generates an image from the land values and another that generates an image from the sea values. For the example we used data from MODB, the Mediterranean Oceanic Data Base http://modb.oce.ulg.ac.be/ - + */ static int test_generate(void) { hid_t fid; hsize_t pal_dims[2] = { 256, 3 }; - float *data; + float *data; int imax, jmax, kmax; float valex, xmin, xmax, value; FILE *f; @@ -555,7 +555,7 @@ static int test_generate(void) strcat(data_file, "/"); } strcat(data_file,DATA_FILE4); - + /*------------------------------------------------------------------------- * read data; the file data format is described below *------------------------------------------------------------------------- @@ -570,14 +570,14 @@ static int test_generate(void) } /* -!The first line of the ASCII file contains the dimension of the array : -! IMAX, JMAX, KMAX. The integers are stored with the FORTRAN format I5. -!The second line contains the exclusion value, the minimum and the maximum value of this -! file. These numbers are stored with the FORTRAN format E12.5. -! The remaining lines contains the data of the array, with 5 numbers per line -! (except the last line for each I-line). -! The array is stored in horizontal slices from sea surface to sea bottom and from -! north to south. So the indexes go from : +!The first line of the ASCII file contains the dimension of the array : +! IMAX, JMAX, KMAX. The integers are stored with the FORTRAN format I5. +!The second line contains the exclusion value, the minimum and the maximum value of this +! file. These numbers are stored with the FORTRAN format E12.5. +! The remaining lines contains the data of the array, with 5 numbers per line +! (except the last line for each I-line). +! The array is stored in horizontal slices from sea surface to sea bottom and from +! north to south. So the indexes go from : ! ! DO K = KMAX to 1 ! DO J = JMAX to 1 @@ -586,7 +586,7 @@ static int test_generate(void) ! OD ! OD ! OD -! +! ! ____________________________ ! / /| (imax,jmax,kmax) ! / sea surface / | @@ -603,21 +603,21 @@ static int test_generate(void) ! i ! */ - - - fscanf( f, "%d %d %d", &imax, &jmax, &kmax ); - fscanf( f, "%f %f %f", &valex, &xmin, &xmax ); - + + + fscanf( f, "%d %d %d", &imax, &jmax, &kmax ); + fscanf( f, "%f %f %f", &valex, &xmin, &xmax ); + data = (float*) malloc ( imax * jmax * kmax * sizeof( float )); image_data = (unsigned char*) malloc ( imax * jmax * kmax * sizeof( unsigned char )); - - for ( i = 0; i < imax * jmax * kmax; i++ ) + + for ( i = 0; i < imax * jmax * kmax; i++ ) { - fscanf( f, "%f ", &value ); + fscanf( f, "%f ", &value ); data[i] = value; } fclose( f ); - + /*------------------------------------------------------------------------- * transform the data from floating point to unsigend char * we are processing all the data here @@ -625,18 +625,18 @@ static int test_generate(void) */ TESTING2("make indexed image from all the data"); - - for ( i = 0; i < imax * jmax * kmax; i++ ) + + for ( i = 0; i < imax * jmax * kmax; i++ ) { image_data[i] = (unsigned char)(( 255 * (data[i] - xmin ) ) / (xmax - xmin )); } - + /* Make the image */ if ((H5IMmake_image_8bit(fid,"All data",(hsize_t)imax,(hsize_t)jmax,image_data))<0) goto out; PASSED(); - + /*------------------------------------------------------------------------- * transform the data from floating point to unsigend char * here we just process the land data @@ -644,21 +644,21 @@ static int test_generate(void) */ TESTING2("make indexed image from land data"); - - for ( i = 0; i < imax * jmax * kmax; i++ ) + + for ( i = 0; i < imax * jmax * kmax; i++ ) { if ( data[i] < 0 ) image_data[i] = 0; else image_data[i] = (unsigned char)(( 255 * (data[i] ) ) / xmax ); } - + /* make the image */ if ((H5IMmake_image_8bit(fid,"Land data",(hsize_t)imax,(hsize_t)jmax,image_data))<0) goto out; PASSED(); - + /*------------------------------------------------------------------------- * transform the data from floating point to unsigend char * here we just process the sea data @@ -666,32 +666,32 @@ static int test_generate(void) */ TESTING2("make indexed image from sea data"); - - for ( i = 0; i < imax * jmax * kmax; i++ ) + + for ( i = 0; i < imax * jmax * kmax; i++ ) { if ( data[i] > 0 ) image_data[i] = 0; else image_data[i] = (unsigned char)(( 255 * (data[i] - xmin ) ) / xmin ); } - + /* make the image */ if ((H5IMmake_image_8bit(fid,"Sea data",(hsize_t)imax,(hsize_t)jmax,image_data))<0) goto out; PASSED(); - + /*------------------------------------------------------------------------- * make a palette and attach it to the datasets *------------------------------------------------------------------------- */ TESTING2("attaching palettes"); - + /* make a palette */ if ((H5IMmake_palette(fid,PAL1_NAME,pal_dims,pal_rgb))<0) goto out; - + /* attach the palette to the image datasets */ if ((H5IMlink_palette(fid,"All data",PAL1_NAME))<0) goto out; @@ -701,17 +701,17 @@ static int test_generate(void) goto out; PASSED(); - + /*------------------------------------------------------------------------- - * close + * close *------------------------------------------------------------------------- - */ + */ if (H5Fclose(fid)<0) goto out; return 0; - + /* error zone, gracefully close */ out: H5E_BEGIN_TRY { @@ -733,7 +733,7 @@ out: * n * width * n - * + * * followed by the image data * *------------------------------------------------------------------------- @@ -778,10 +778,10 @@ static int read_data( const char* fname, /*IN*/ fscanf( f, "%s", str ); fscanf( f, "%d", &color_planes ); fscanf( f, "%s", str ); - fscanf( f, "%d", &h); + fscanf( f, "%d", &h); fscanf( f, "%s", str ); - fscanf( f, "%d", &w); - + fscanf( f, "%d", &w); + *width = (hsize_t)w; *height = (hsize_t)h; @@ -811,7 +811,7 @@ static int read_data( const char* fname, /*IN*/ * Read an ASCII palette file .PAL into an array * the files have a header of the type * - * Parameters: + * Parameters: * fname - name of file to read. * palette - array of rgb_t to store the read palette. * palette_size - number of elements in 'palette' array @@ -825,8 +825,8 @@ static int read_data( const char* fname, /*IN*/ #define STRING_CWPAL "CWPAL" #define VERSION_CWPAL "100" -static int read_palette(const char* fname, - rgb_t *palette, +static int read_palette(const char* fname, + rgb_t *palette, int palette_size) { FILE *file; @@ -850,42 +850,42 @@ static int read_palette(const char* fname, strcat(data_file, "/"); } strcat(data_file,fname); - + /* ensure the given palette is valid */ if (!palette) return -1; - + /* open the input file */ if (!(file = fopen(data_file, "r"))) { printf( "Could not open file %s. Try set $srcdir \n", data_file ); return -1; } - + /* read the file ident string */ if (fgets(buffer, sizeof(buffer), file) == NULL) { fclose(file); return -1; } - + /* ensure it matches the palette file ident string */ - if ( strncmp(buffer, STRING_JASC, sizeof(STRING_JASC) - 1) != 0 && + if ( strncmp(buffer, STRING_JASC, sizeof(STRING_JASC) - 1) != 0 && strncmp(buffer, STRING_CWPAL, sizeof(STRING_CWPAL) - 1) != 0 ) { fclose(file); return -1; } - + /* read the version string */ if (fgets(buffer, sizeof(buffer), file) == NULL) { fclose(file); return -1; } - - /* ensure it matches the palette file version string */ - if ( strncmp(buffer, VERSION_JASC, sizeof(VERSION_JASC) - 1) != 0 && + + /* ensure it matches the palette file version string */ + if ( strncmp(buffer, VERSION_JASC, sizeof(VERSION_JASC) - 1) != 0 && strncmp(buffer, VERSION_CWPAL, sizeof(VERSION_CWPAL) - 1) != 0 ) { fclose(file); @@ -898,31 +898,31 @@ static int read_palette(const char* fname, fclose(file); return -1; } - - - /* extract the number of colors. + + + /* extract the number of colors. check for missing version or number of colors in this case it reads the first entry */ - if ( strlen( buffer ) > 4 ) + if ( strlen( buffer ) > 4 ) { fclose(file); return -1; } - + if (sscanf(buffer, "%d", &nentries) != 1) { fclose(file); return -1; } - - /* ensure there are a sensible number of colors in the palette */ + + /* ensure there are a sensible number of colors in the palette */ if ((nentries < 0) || (nentries > 256) || (nentries > palette_size)) { fclose(file); return(-1); } - + /* read the palette entries */ for (i = 0; i < nentries; i++) { @@ -940,7 +940,7 @@ static int read_palette(const char* fname, /* close file */ fclose(file); - + return nentries; } diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index bc5fb72..ae29444 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -62,7 +62,7 @@ static int test_dsets( void ) char data_char_out[DIM]; short data_short_in[DIM] = {1,2,3,4,5,6}; short data_short_out[DIM]; - int data_int_in[DIM] = {1,2,3,4,5,6}; + int data_int_in[DIM] = {1,2,3,4,5,6}; int data_int_out[DIM]; long data_long_in[DIM] = {1,2,3,4,5,6}; long data_long_out[DIM]; @@ -74,7 +74,7 @@ static int test_dsets( void ) char data_string_out[20]; int i; - + /* Create a new file using default properties. */ file_id = H5Fcreate( FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT ); @@ -91,13 +91,13 @@ static int test_dsets( void ) /* Read dataset using the basic HDF5 API */ - if ( ( dataset_id = H5Dopen ( file_id, DSET0_NAME) ) < 0 ) + if ( ( dataset_id = H5Dopen ( file_id, DSET0_NAME) ) < 0 ) goto out; - if ( H5Dread ( dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data_int_out ) < 0 ) + if ( H5Dread ( dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data_int_out ) < 0 ) goto out; - if ( H5Dclose( dataset_id ) < 0 ) + if ( H5Dclose( dataset_id ) < 0 ) goto out; for (i = 0; i < DIM; i++) @@ -110,7 +110,7 @@ static int test_dsets( void ) PASSED(); /*------------------------------------------------------------------------- - * read using the LT function H5LTread_dataset + * read using the LT function H5LTread_dataset *------------------------------------------------------------------------- */ @@ -127,7 +127,7 @@ static int test_dsets( void ) } PASSED(); - + /*------------------------------------------------------------------------- * test the H5LTmake_dataset_ functions *------------------------------------------------------------------------- @@ -135,7 +135,7 @@ static int test_dsets( void ) /*------------------------------------------------------------------------- - * H5LTmake_dataset_char + * H5LTmake_dataset_char *------------------------------------------------------------------------- */ @@ -171,7 +171,7 @@ static int test_dsets( void ) /*------------------------------------------------------------------------- - * H5LTmake_dataset_short + * H5LTmake_dataset_short *------------------------------------------------------------------------- */ @@ -206,7 +206,7 @@ static int test_dsets( void ) PASSED(); /*------------------------------------------------------------------------- - * H5LTmake_dataset_int + * H5LTmake_dataset_int *------------------------------------------------------------------------- */ @@ -219,14 +219,14 @@ static int test_dsets( void ) /* Read dataset */ if ( H5LTread_dataset( file_id, DSET3_NAME, H5T_NATIVE_INT, data_int_out ) < 0 ) goto out; - + for (i = 0; i < DIM; i++) { if ( data_int_in[i] != data_int_out[i] ) { goto out; } } - + /* Read dataset */ if ( H5LTread_dataset_int( file_id, DSET3_NAME, data_int_out ) < 0 ) goto out; @@ -242,7 +242,7 @@ static int test_dsets( void ) /*------------------------------------------------------------------------- - * H5LTmake_dataset_long + * H5LTmake_dataset_long *------------------------------------------------------------------------- */ @@ -278,7 +278,7 @@ static int test_dsets( void ) /*------------------------------------------------------------------------- - * H5LTmake_dataset_float + * H5LTmake_dataset_float *------------------------------------------------------------------------- */ @@ -314,7 +314,7 @@ static int test_dsets( void ) /*------------------------------------------------------------------------- - * H5LTmake_dataset_double + * H5LTmake_dataset_double *------------------------------------------------------------------------- */ @@ -327,7 +327,7 @@ static int test_dsets( void ) /* Read dataset */ if ( H5LTread_dataset( file_id, DSET6_NAME, H5T_NATIVE_DOUBLE, data_double_out ) < 0 ) goto out; - + for (i = 0; i < DIM; i++) { if ( data_double_in[i] != data_double_out[i] ) { @@ -350,7 +350,7 @@ static int test_dsets( void ) /*------------------------------------------------------------------------- - * H5LTmake_dataset_string + * H5LTmake_dataset_string *------------------------------------------------------------------------- */ @@ -363,17 +363,17 @@ static int test_dsets( void ) /* Read dataset */ if ( H5LTread_dataset_string(file_id,DSET7_NAME,data_string_out) < 0 ) goto out; - - if ( strcmp(data_string_in,data_string_out) != 0 ) + + if ( strcmp(data_string_in,data_string_out) != 0 ) goto out; - - + + /*------------------------------------------------------------------------- * end tests *------------------------------------------------------------------------- */ - + /* Close the file. */ H5Fclose( file_id ); @@ -399,7 +399,7 @@ static int test_attr( void ) hid_t file_id; hid_t dataset_id; hid_t group_id; - hid_t space_id; + hid_t space_id; hsize_t dims[1] = { 5 }; /* Create a new file using default properties. */ @@ -414,7 +414,7 @@ static int test_attr( void ) if ((space_id = H5Screate_simple( 1, dims, NULL ))<0) goto out; /* Create the dataset */ - if ((dataset_id = H5Dcreate( file_id , "dset", H5T_NATIVE_INT, space_id, + if ((dataset_id = H5Dcreate( file_id , "dset", H5T_NATIVE_INT, space_id, H5P_DEFAULT ))<0) goto out; /* Close */ @@ -426,33 +426,33 @@ static int test_attr( void ) */ /* Create a group. */ - if ((group_id = H5Gcreate( file_id, "grp", 0 ))<0) + if ((group_id = H5Gcreate( file_id, "grp", 0 ))<0) goto out; - + /* Close */ H5Gclose( group_id ); - + /*------------------------------------------------------------------------- - * + * * Create attributes in the root group - * Note that we are calling the H5LTset_attribute functions with the name "." - * + * Note that we are calling the H5LTset_attribute functions with the name "." + * *------------------------------------------------------------------------- */ if (make_attributes( file_id, "." )<0) goto out; - + /*------------------------------------------------------------------------- - * + * * Create attributes in the dataset "dset" - * + * *------------------------------------------------------------------------- */ if (make_attributes( file_id, "dset" )<0) goto out; - + /*------------------------------------------------------------------------- - * + * * Create attributes in the group "grp" * *------------------------------------------------------------------------- @@ -519,7 +519,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name ) */ TESTING("H5LTset_attribute_string"); - + /* Set the attribute */ if ( H5LTset_attribute_string( loc_id, obj_name, ATTR1_NAME, attr_str_in ) < 0 ) return -1; @@ -533,12 +533,12 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name ) TESTING("H5LTget_attribute_string"); - + /* Get the attribute */ if ( H5LTget_attribute_string( loc_id, obj_name, ATTR1_NAME, attr_str_out ) < 0 ) return -1; - if ( strcmp( attr_str_in, attr_str_out ) != 0 ) + if ( strcmp( attr_str_in, attr_str_out ) != 0 ) { return -1; } @@ -994,13 +994,13 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name ) /*------------------------------------------------------------------------- - * H5LTget_attribute_ndims test + * H5LTget_attribute_ndims test *------------------------------------------------------------------------- */ TESTING("H5LTget_attribute_ndims"); - + if ( H5LTget_attribute_ndims( loc_id, obj_name, ATTR2_NAME, &rank_out ) < 0 ) return -1; @@ -1011,7 +1011,7 @@ static herr_t make_attributes( hid_t loc_id, const char* obj_name ) PASSED(); /*------------------------------------------------------------------------- - * H5LTget_attribute_info test + * H5LTget_attribute_info test *------------------------------------------------------------------------- */ @@ -1060,12 +1060,12 @@ int main( void ) /* check for errors */ if (nerrors) goto error; - + return 0; - + error: return 1; - + } diff --git a/hl/test/test_packet.c b/hl/test/test_packet.c index 38e1bc4..cd9a9e9 100644 --- a/hl/test/test_packet.c +++ b/hl/test/test_packet.c @@ -38,20 +38,20 @@ * structure used for some tests, a particle *------------------------------------------------------------------------- */ -typedef struct particle_t +typedef struct particle_t { char name[16]; int lati; int longi; float pressure; - double temperature; + double temperature; } particle_t; /*------------------------------------------------------------------------- * a static array of particles for writing and checking reads *------------------------------------------------------------------------- */ -static particle_t testPart[NRECORDS] = { +static particle_t testPart[NRECORDS] = { {"zero", 0,0, 0.0f, 0.0}, {"one", 10,10, 1.0f, 10.0}, {"two", 20,20, 2.0f, 20.0}, @@ -122,14 +122,14 @@ static int create_hl_table(hid_t fid) HOFFSET( particle_t, temperature )}; /* Define field information */ - const char *field_names[NFIELDS] = + const char *field_names[NFIELDS] = { "Name","Latitude", "Longitude", "Pressure", "Temperature" }; hid_t field_type[NFIELDS]; hid_t string_type; hsize_t chunk_size = 10; int *fill_data = NULL; int compress = 0; - herr_t status; + herr_t status; /* Initialize the field field_type */ string_type = H5Tcopy( H5T_C_S1 ); @@ -142,13 +142,13 @@ static int create_hl_table(hid_t fid) /*------------------------------------------------------------------------ - * H5TBmake_table + * H5TBmake_table *------------------------------------------------------------------------- */ status=H5TBmake_table( "Table Title", fid, H5TB_TABLE_NAME, (hsize_t) NFIELDS, - (hsize_t)NRECORDS, sizeof(particle_t), - field_names, part_offset, field_type, + (hsize_t)NRECORDS, sizeof(particle_t), + field_names, part_offset, field_type, chunk_size, fill_data, compress, testPart ); if(status<0) @@ -750,7 +750,7 @@ int test_opaque(hid_t fid) * * ensures that the packet table API throws the correct errors used on * objects that are not packet tables. - * + * *------------------------------------------------------------------------- */ int test_error(hid_t fid) @@ -807,7 +807,7 @@ int test_error(hid_t fid) if(H5PTread_packets(id, 0, 1, readBuf) >= 0) goto out; if(H5PTcreate_index(id) >= 0) - goto out; + goto out; H5E_END_TRY id_open=0; @@ -833,7 +833,7 @@ int test_error(hid_t fid) if(H5PTread_packets(id, 0, 1, readBuf) >= 0) goto out; if(H5PTcreate_index(id) >= 0) - goto out; + goto out; H5E_END_TRY PASSED(); @@ -882,7 +882,7 @@ int main(void) /*------------------------------------------------------------------------- * Packet test: test each function of the packet table *------------------------------------------------------------------------- - */ + */ /* create a file using default properties */ fid=H5Fcreate(TEST_FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); diff --git a/hl/test/test_table.c b/hl/test/test_table.c index 42987b2..6483932 100644 --- a/hl/test/test_table.c +++ b/hl/test/test_table.c @@ -29,7 +29,7 @@ * * Functions tested: * - * H5TBmake_table + * H5TBmake_table * H5TBread_table * H5TBwrite_records * H5TBread_records @@ -56,12 +56,12 @@ * structure used for all tests, a particle with properties *------------------------------------------------------------------------- */ -typedef struct particle_t +typedef struct particle_t { char name[16]; long longi; float pressure; - double temperature; + double temperature; int lati; } particle_t; @@ -72,24 +72,24 @@ typedef struct particle_t static hid_t h5file_open(const char *fname, unsigned flags); static int cmp_par(hsize_t i, hsize_t j, particle_t *rbuf, particle_t *wbuf ); -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); /*------------------------------------------------------------------------- * a subset of particle_t, with latitude and longitude fields *------------------------------------------------------------------------- */ - typedef struct position_t + typedef struct position_t { long longi; int lati; } position_t; /*------------------------------------------------------------------------- - * a subset of particle_t, with name and pressure fields + * a subset of particle_t, with name and pressure fields *------------------------------------------------------------------------- */ - typedef struct namepressure_t + typedef struct namepressure_t { char name[16]; float pressure; @@ -117,7 +117,7 @@ static int compare_deleted(hsize_t rrecords, hsize_t dstart, hsize_t drecords, { char name[16]; long longi; - double temperature; + double temperature; int lati; } particle3_t; @@ -159,7 +159,7 @@ int test_table(hid_t fid, int write) hsize_t start2; /* record to start writing in 2nd table */ /*------------------------------------------------------------------------- - * read, write, insert, append buffers + * read, write, insert, append buffers *------------------------------------------------------------------------- */ particle_t rbuf[NRECORDS+4]; @@ -169,7 +169,7 @@ int test_table(hid_t fid, int write) particle_t abuf[2]={{"eight",80,8.0f,80.0,80},{"nine",90,9.0f,90.0,90}}; particle_t ibuf[2]={{"zero", 0, 0.0f, 0.0, 0},{"zero", 0, 0.0f, 0.0, 0}}; particle_t wbufd[NRECORDS]; - particle_t wbuf[NRECORDS] = { + particle_t wbuf[NRECORDS] = { {"zero", 0, 0.0f, 0.0, 0,}, {"one", 10, 1.0f, 10.0, 10}, {"two", 20, 2.0f, 20.0, 20}, @@ -187,23 +187,23 @@ int test_table(hid_t fid, int write) position_t position_out[NRECORDS]; position_t position_in[NRECORDS] = { {0,0}, {10,10}, - {20,20}, - {30,30}, + {20,20}, + {30,30}, {40,40}, - {50,50}, - {60,60}, + {50,50}, + {60,60}, {70,70} }; /* buffers for the fields "Name,Pressure" */ namepressure_t namepre_out[NRECORDS]; - namepressure_t namepre_in[NRECORDS] = + namepressure_t namepre_in[NRECORDS] = { {"zero",0.0f}, - {"one", 1.0f}, - {"two", 2.0f}, - {"three", 3.0f}, + {"one", 1.0f}, + {"two", 2.0f}, + {"three", 3.0f}, {"four", 4.0f}, {"five", 5.0f}, - {"six", 6.0f}, - {"seven", 7.0f}, + {"six", 6.0f}, + {"seven", 7.0f}, }; @@ -219,7 +219,7 @@ int test_table(hid_t fid, int write) HOFFSET( position_t, lati ) }; size_t field_offset_namepre[2]= - { + { HOFFSET( namepressure_t, name ), HOFFSET( namepressure_t, pressure ) }; @@ -229,12 +229,12 @@ int test_table(hid_t fid, int write) sizeof(position_in[0].lati) }; size_t field_sizes_namepre[2]= - { + { sizeof(namepre_in[0].name), sizeof(namepre_in[0].pressure) }; size_t field_sizes_pre[1]= - { + { sizeof(namepre_in[0].pressure) }; @@ -295,7 +295,7 @@ int test_table(hid_t fid, int write) sizeof( rbuf3[0].longi), sizeof( rbuf3[0].temperature), sizeof( rbuf3[0].lati)}; - + /*------------------------------------------------------------------------- * initialize table parameters @@ -306,7 +306,7 @@ int test_table(hid_t fid, int write) */ size_t type_size_mem = sizeof( particle_t ); - size_t field_offset[NFIELDS]= + size_t field_offset[NFIELDS]= { HOFFSET( particle_t, name ), HOFFSET( particle_t, longi ), @@ -314,17 +314,17 @@ int test_table(hid_t fid, int write) HOFFSET( particle_t, temperature ), HOFFSET( particle_t, lati ) }; - size_t field_size[NFIELDS] = + size_t field_size[NFIELDS] = { sizeof( rbuf[0].name), sizeof( rbuf[0].longi), sizeof( rbuf[0].pressure), sizeof( rbuf[0].temperature), - sizeof( rbuf[0].lati) + sizeof( rbuf[0].lati) }; - const char *field_names[NFIELDS] = + const char *field_names[NFIELDS] = { "Name","Longitude","Pressure","Temperature","Latitude" }; - hid_t field_type[NFIELDS]; + hid_t field_type[NFIELDS]; hid_t string_type = H5Tcopy( H5T_C_S1 ); H5Tset_size( string_type, 16 ); field_type[0] = string_type; @@ -337,7 +337,7 @@ int test_table(hid_t fid, int write) * * Functions tested: * - * H5TBmake_table + * H5TBmake_table * H5TBread_table * *------------------------------------------------------------------------- @@ -348,29 +348,29 @@ int test_table(hid_t fid, int write) if (H5TBmake_table(TITLE,fid,"table1",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; PASSED(); } TESTING2("reading table"); - + /*------------------------------------------------------------------------- * read the table *------------------------------------------------------------------------- */ - - if (H5TBread_table(fid,"table1",type_size_mem,field_offset,field_size,rbuf)<0) + + if (H5TBread_table(fid,"table1",type_size_mem,field_offset,field_size,rbuf)<0) goto out; - + /* compare the extracted table with the original array */ - for( i = 0; i < NRECORDS; i++ ) + for( i = 0; i < NRECORDS; i++ ) { - if (cmp_par(i,i,rbuf,wbuf)<0) + if (cmp_par(i,i,rbuf,wbuf)<0) goto out; } - + PASSED(); @@ -382,35 +382,35 @@ int test_table(hid_t fid, int write) * *------------------------------------------------------------------------- */ - if (write) + if (write) { TESTING2("writing records"); /* create an empty table */ if (H5TBmake_table(TITLE,fid,"table2",NFIELDS,NRECORDS,type_size_mem, field_names,field_offset,field_type, - chunk_size,fill,compress,0)<0) + chunk_size,fill,compress,0)<0) goto out; /*------------------------------------------------------------------------- * write records, start at 0, write 8 - * 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 *------------------------------------------------------------------------- */ wstart=0; wrecords=8; if (H5TBwrite_records(fid,"table2",wstart,wrecords,type_size_mem,field_offset, - field_size,wbuf)<0) + field_size,wbuf)<0) goto out; /* read it back */ - if (H5TBread_table(fid,"table2",type_size_mem,field_offset,field_size,rbuf)<0) + if (H5TBread_table(fid,"table2",type_size_mem,field_offset,field_size,rbuf)<0) goto out; - + /* compare */ - for( i = 0; i < NRECORDS; i++ ) + for( i = 0; i < NRECORDS; i++ ) { - if (cmp_par(i,i,rbuf,wbuf)<0) + if (cmp_par(i,i,rbuf,wbuf)<0) goto out; } @@ -427,14 +427,14 @@ int test_table(hid_t fid, int write) */ TESTING2("reading records"); - + /*------------------------------------------------------------------------- * read records, start at 0, read 8 - * pos = 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 the read test we cannot use "table2" because it has been appended * we use the original "table1" instead @@ -444,16 +444,16 @@ int test_table(hid_t fid, int write) strcpy(tname,"table2"); else strcpy(tname,"table1"); - + rstart=0; rrecords=8; if (H5TBread_records(fid,tname,rstart,rrecords,type_size_mem,field_offset, - field_size,rbuf)<0) + field_size,rbuf)<0) goto out; /* compare */ - for( i=rstart; 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; } } @@ -579,151 +579,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); @@ -955,7 +955,7 @@ int test_table(hid_t fid, int write) *------------------------------------------------------------------------- */ TESTING2("reading fields by name"); - + /*------------------------------------------------------------------------- * write and read the "Pressure" field *------------------------------------------------------------------------- @@ -964,32 +964,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 *------------------------------------------------------------------------- @@ -997,28 +997,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 @@ -1027,23 +1027,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 ) { @@ -1051,7 +1051,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; @@ -1061,15 +1061,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 ) { @@ -1093,42 +1093,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; } } @@ -1145,7 +1145,7 @@ int test_table(hid_t fid, int write) * *------------------------------------------------------------------------- */ - + TESTING2("reading fields by index"); if (write) @@ -1153,9 +1153,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 *------------------------------------------------------------------------- @@ -1163,29 +1163,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 *------------------------------------------------------------------------- @@ -1194,23 +1194,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 ) { @@ -1227,24 +1227,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 ) { @@ -1253,7 +1253,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; @@ -1263,18 +1263,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 ) { @@ -1293,7 +1293,7 @@ int test_table(hid_t fid, int write) * *------------------------------------------------------------------------- */ - + if (write) { TESTING2("inserting fields"); @@ -1301,12 +1301,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; @@ -1315,7 +1315,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 || @@ -1345,7 +1345,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; @@ -1356,9 +1356,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 || @@ -1403,10 +1403,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 ); } @@ -1415,7 +1415,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; @@ -1423,7 +1423,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] ); } @@ -1451,11 +1451,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); @@ -1472,7 +1472,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); @@ -1527,18 +1527,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 ); @@ -1573,21 +1573,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 4150b49..a8a6516 100644 --- a/perform/chunk.c +++ b/perform/chunk.c @@ -156,7 +156,7 @@ create_dataset (void) H5Pset_chunk (dcpl, 2, size); H5Zregister (H5Z_COUNTER); H5Pset_filter (dcpl, FILTER_COUNTER, 0, 0, NULL); - + /* The dataset */ dset = H5Dcreate (file, "dset", H5T_NATIVE_SCHAR, space, dcpl); assert (dset>=0); @@ -238,8 +238,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); @@ -290,7 +290,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); @@ -328,9 +328,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 @@ -406,7 +406,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 d9715e7..4835d44 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, @@ -225,13 +225,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++) { @@ -267,7 +267,7 @@ test(fill_t fill_style, const double splits[], } -#if !defined( __MWERKS__) +#if !defined( __MWERKS__) /* Determine overhead */ if (verbose) { @@ -282,9 +282,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); @@ -314,15 +314,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 - + } @@ -348,7 +348,7 @@ test(fill_t fill_style, const double splits[], /*------------------------------------------------------------------------- * Function: main * - * Purpose: + * Purpose: * * Return: Success: zero * @@ -378,7 +378,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 e157c78..69f4146 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 @@ -1524,7 +1524,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); @@ -1559,7 +1559,7 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags) } break; - } + } done: return ret_code; @@ -1632,10 +1632,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 0e816fc..cde0545 100644 --- a/perform/pio_perf.c +++ b/perform/pio_perf.c @@ -608,7 +608,7 @@ run_test(iotype iot, parameters parms, struct options *opts) pio_time_destroy(res.timers); } - /* + /* * Show various statistics */ /* Write statistics */ @@ -721,7 +721,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: @@ -776,7 +776,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/perform/pio_standalone.h b/perform/pio_standalone.h index bf80544..4a67ba0 100644 --- a/perform/pio_standalone.h +++ b/perform/pio_standalone.h @@ -50,7 +50,7 @@ #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 @@ -58,9 +58,9 @@ extern char *strdup(const char *s); #endif /* WIN32 */ -#define HDstrcmp(S,T) strcmp(S,T) +#define HDstrcmp(S,T) strcmp(S,T) #define HDstrlen(S) strlen(S) -#define HDstrncmp(S,T,L) strncmp(S,T,L) +#define HDstrncmp(S,T,L) strncmp(S,T,L) #define HDstrncpy(X,Y,Z) strncpy(X,Y,Z) #define HDstrchr(S,C) strchr(S,C) #define HDfree(M) free(M) @@ -74,7 +74,7 @@ extern char *strdup(const char *s); #define HDclose(F) close(F) #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) diff --git a/src/H5.c b/src/H5.c index a0e1e1f..f719877 100644 --- a/src/H5.c +++ b/src/H5.c @@ -61,7 +61,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 * @@ -70,7 +70,7 @@ static void H5_debug_mask(const char*); * *-------------------------------------------------------------------------- */ -herr_t +herr_t H5_init_library(void) { herr_t ret_value=SUCCEED; @@ -132,7 +132,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. */ @@ -181,7 +181,7 @@ H5_term_library(void) unsigned at=0; char loop[1024]; H5E_auto_stack_t func; - + #ifdef H5_HAVE_THREADSAFE /* explicit locking of the API */ H5_FIRST_THREAD_INIT @@ -209,7 +209,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 @@ -274,7 +274,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: @@ -448,7 +448,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? */ @@ -501,7 +501,7 @@ H5_debug_mask(const char *s) } } } - + /*------------------------------------------------------------------------- * Function: H5get_libversion @@ -577,11 +577,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? */ @@ -606,7 +606,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. */ @@ -626,7 +626,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 */ @@ -855,7 +855,7 @@ HDfprintf(FILE *stream, const char *fmt, ...) char *rest, format_templ[128]; const char *s; va_list ap; - + assert (stream); assert (fmt); @@ -894,7 +894,7 @@ HDfprintf(FILE *stream, const char *fmt, ...) } /*lint !e744 Switch statement doesn't _need_ default */ s++; } - + /* Field width */ if (HDisdigit (*s)) { zerofill = ('0'==*s); @@ -986,7 +986,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) { @@ -1173,13 +1173,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++; @@ -1188,7 +1188,7 @@ HDstrtoll(const char *s, const char **rest, int base) s++; } else if ('-'==*s) { sign = -1; - s++; + s++; } /* Zero base prefix */ @@ -1201,7 +1201,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') || @@ -1328,7 +1328,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); @@ -1361,7 +1361,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 @@ -1504,7 +1504,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 @@ -1537,7 +1537,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; @@ -1559,7 +1559,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 @@ -1736,7 +1736,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } } break; - + case 's': if (ptr) { if (vp) { @@ -1765,7 +1765,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } } break; - + case 't': if (ptr) { if (vp) { @@ -1788,7 +1788,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } } break; - + default: fprintf (out, "BADTYPE(D%c)", type[1]); goto error; @@ -1808,7 +1808,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) else fprintf (out, "FAIL"); } break; - + case 'E': switch (type[1]) { case 'd': @@ -1833,7 +1833,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } } break; - + case 'e': if (ptr) { if (vp) { @@ -1869,7 +1869,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } } break; - + default: fprintf (out, "BADTYPE(E%c)", type[1]); goto error; @@ -2072,7 +2072,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; @@ -2271,7 +2271,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) asize[argno] = is; } break; - + case 'u': if (ptr) { if (vp) { @@ -2528,7 +2528,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...) } } break; - + default: fprintf(out, "BADTYPE(S%c)", type[1]); goto error; @@ -2568,7 +2568,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 a8acc3a..78286fb 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_register_type(H5I_ATTR, (size_t)H5I_ATTRID_HASHSIZE, H5A_RESERVED_ATOMS, (H5I_free_t)H5A_close)0) { (void)H5I_clear_type(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 datatype 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_stack(NULL); 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 a7f5aa1..d4b70d2 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 @@ -86,7 +86,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); @@ -318,10 +318,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. @@ -331,17 +331,17 @@ 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 * - * Deleted the old size_hint parameter and added the + * Deleted the old size_hint parameter and added the * max_cache_size, and min_clean_size parameters. * * JRM - 3/10/05 * * Deleted the max_cache_size, and min_clean_size parameters, - * and added the config_ptr parameter. Added code to + * and added the config_ptr parameter. Added code to * validate the resize configuration before we do anything. * * JRM - 3/24/05 @@ -371,7 +371,7 @@ static const char * H5AC_entry_type_names[H5AC_NTYPES] = }; herr_t -H5AC_create(const H5F_t *f, +H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -390,7 +390,7 @@ H5AC_create(const H5F_t *f, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Bad cache configuration"); } - /* The default max cache size and min clean size will frequently be + /* The default max cache size and min clean size will frequently be * overwritten shortly by the subsequent set resize config call. * -- JRM */ @@ -437,14 +437,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 @@ -477,34 +477,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 @@ -547,10 +547,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 ) { @@ -597,16 +597,16 @@ 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(). * * JRM - 1/6/05 * Added the flags parameter. At present, this parameter is * only used to set the new flush_marker field on the new * entry. Since this doesn't apply to the SAP code, no change - * is needed there. Thus the only change to the body of the - * code is to pass the flags parameter through to + * is needed there. Thus the only change to the body of the + * code is to pass the flags parameter through to * H5C_insert_entry(). * * JRM - 6/6/05 @@ -659,7 +659,7 @@ H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void * lf = f->shared->lf; if ( H5FD_is_fphdf5_driver(lf) ) { - + /* Newly inserted entry are presumed to be dirty */ info->is_dirty = TRUE; @@ -667,7 +667,7 @@ H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void * * This is the FPHDF5 driver. Grab a lock for this piece of * metadata from the SAP. Bail-out quickly if we're unable to do * that. In the case of the FPHDF5 driver, the local cache is - * turned off. We lock the address then write the data to the SAP. + * turned off. We lock the address then write the data to the SAP. * We do this because the cache is off and thus cannot retain the * data which has just been added to it. We will get it from the * SAP as needed in the future. @@ -719,7 +719,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, @@ -762,8 +762,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(). * *------------------------------------------------------------------------- @@ -785,7 +785,7 @@ H5AC_rename(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t new_ad #ifdef H5_HAVE_PARALLEL #ifdef H5_HAVE_FPHDF5 - /* In the flexible parallel case, the cache is always empty. + /* In the flexible parallel case, the cache is always empty. * Thus H5AC_rename() has nothing to do by definition. */ { @@ -837,7 +837,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. * @@ -845,8 +845,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. @@ -887,19 +887,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 #ifndef H5_HAVE_FPHDF5 UNUSED @@ -957,7 +957,7 @@ H5AC_protect(H5F_t *f, * by some other process, we can loop and wait or bail * out of this function */ - HDfprintf(stderr, + HDfprintf(stderr, "Couldn't get lock for metadata at address %a\n", addr); #endif /* 0 */ @@ -966,7 +966,7 @@ H5AC_protect(H5F_t *f, } /* Load a thing from the SAP. */ - if ( NULL == (thing = type->load(f, dxpl_id, addr, + if ( NULL == (thing = type->load(f, dxpl_id, addr, udata1, udata2)) ) { #if 0 @@ -985,7 +985,7 @@ H5AC_protect(H5F_t *f, HGOTO_DONE(NULL) } - + info = (H5AC_info_t *)thing; HDassert(info->is_dirty == FALSE); @@ -1000,7 +1000,7 @@ H5AC_protect(H5F_t *f, "Can't get size of thing") } - HDassert(info->size < H5C_MAX_ENTRY_SIZE); + HDassert(info->size < H5C_MAX_ENTRY_SIZE); info->next = NULL; info->prev = NULL; @@ -1015,7 +1015,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, @@ -1045,15 +1045,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. @@ -1092,20 +1092,20 @@ 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(). - * + * * JRM - 1/6/05 * Replaced the deleted parameter with the new flags parameter. * Since the deleted parameter is not used by the FPHDF5 code, - * the only change in the body is to replace the deleted - * parameter with the flags parameter in the call to + * the only change in the body is to replace the deleted + * parameter with the flags parameter in the call to * H5C_unprotect(). * * JRM - 6/6/05 - * Added the dirtied flag and supporting code. This is - * part of a collection of changes directed at moving + * Added the dirtied flag and supporting code. This is + * part of a collection of changes directed at moving * management of cache entry dirty flags into the H5C code. * *------------------------------------------------------------------------- @@ -1152,7 +1152,7 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, ((H5AC_info_t *)thing)->is_protected = FALSE; /* mark the entry as dirty if appropriate. JRM - 6/6/05 */ - ((H5AC_info_t *)thing)->is_dirty |= + ((H5AC_info_t *)thing)->is_dirty |= (flags & H5AC__DIRTIED_FLAG) ? TRUE : FALSE; /* @@ -1160,7 +1160,7 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, * (deleted == TRUE), we need to send a request to the SAP * telling it to remove that bit of metadata from its cache. */ - /* the deleted parameter has been replaced with the flags + /* the deleted parameter has been replaced with the flags * parameter. The actual value of deleted is still passed * in as a bit in flags. If it is needed, it can be extracted * as follows: @@ -1204,7 +1204,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, @@ -1239,8 +1239,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(). * *------------------------------------------------------------------------- @@ -1334,7 +1334,7 @@ H5AC_get_cache_auto_resize_config(H5AC_t * cache_ptr, config_ptr->decrement = internal_config.decrement; config_ptr->apply_max_decrement = internal_config.apply_max_decrement; config_ptr->max_decrement = internal_config.max_decrement; - config_ptr->epochs_before_eviction = + config_ptr->epochs_before_eviction = (int)(internal_config.epochs_before_eviction); config_ptr->apply_empty_reserve = internal_config.apply_empty_reserve; config_ptr->empty_reserve = internal_config.empty_reserve; @@ -1522,7 +1522,7 @@ H5AC_set_cache_auto_resize_config(H5AC_t * cache_ptr, if ( ( config_ptr->rpt_fcn_enabled != TRUE ) && ( config_ptr->rpt_fcn_enabled != FALSE ) ) { - HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "config_ptr->rpt_fcn_enabled must be either TRUE or FALSE.") } @@ -1536,13 +1536,13 @@ H5AC_set_cache_auto_resize_config(H5AC_t * cache_ptr, internal_config.rpt_fcn = NULL; } - + internal_config.set_initial_size = config_ptr->set_initial_size; internal_config.initial_size = config_ptr->initial_size; internal_config.min_clean_fraction = config_ptr->min_clean_fraction; internal_config.max_size = config_ptr->max_size; internal_config.min_size = config_ptr->min_size; - internal_config.epoch_length = + internal_config.epoch_length = (int64_t)(config_ptr->epoch_length); internal_config.incr_mode = config_ptr->incr_mode; @@ -1556,12 +1556,12 @@ H5AC_set_cache_auto_resize_config(H5AC_t * cache_ptr, internal_config.decrement = config_ptr->decrement; internal_config.apply_max_decrement = config_ptr->apply_max_decrement; internal_config.max_decrement = config_ptr->max_decrement; - internal_config.epochs_before_eviction = + internal_config.epochs_before_eviction = (int32_t)(config_ptr->epochs_before_eviction); internal_config.apply_empty_reserve = config_ptr->apply_empty_reserve; internal_config.empty_reserve = config_ptr->empty_reserve; - result = H5C_set_cache_auto_resize_config((H5C_t *)cache_ptr, + result = H5C_set_cache_auto_resize_config((H5C_t *)cache_ptr, &internal_config); if ( result < 0 ) { @@ -1579,7 +1579,7 @@ done: /*------------------------------------------------------------------------- * Function: H5AC_validate_config() * - * Purpose: Run a sanity check on the contents of the supplied + * Purpose: Run a sanity check on the contents of the supplied * instance of H5AC_cache_config_t. * * Do nothing and return SUCCEED if no errors are detected, @@ -1587,7 +1587,7 @@ done: * * At present, this function operates by packing the data * from the instance of H5AC_cache_config_t into an instance - * of H5C_auto_size_ctl_t, and then calling + * of H5C_auto_size_ctl_t, and then calling * H5C_validate_resize_config(). As H5AC_cache_config_t and * H5C_auto_size_ctl_t diverge, we may have to change this. * @@ -1640,13 +1640,13 @@ H5AC_validate_config(H5AC_cache_config_t * config_ptr) internal_config.rpt_fcn = NULL; } - + internal_config.set_initial_size = config_ptr->set_initial_size; internal_config.initial_size = config_ptr->initial_size; internal_config.min_clean_fraction = config_ptr->min_clean_fraction; internal_config.max_size = config_ptr->max_size; internal_config.min_size = config_ptr->min_size; - internal_config.epoch_length = + internal_config.epoch_length = (int64_t)(config_ptr->epoch_length); internal_config.incr_mode = config_ptr->incr_mode; @@ -1660,7 +1660,7 @@ H5AC_validate_config(H5AC_cache_config_t * config_ptr) internal_config.decrement = config_ptr->decrement; internal_config.apply_max_decrement = config_ptr->apply_max_decrement; internal_config.max_decrement = config_ptr->max_decrement; - internal_config.epochs_before_eviction = + internal_config.epochs_before_eviction = (int32_t)(config_ptr->epochs_before_eviction); internal_config.apply_empty_reserve = config_ptr->apply_empty_reserve; internal_config.empty_reserve = config_ptr->empty_reserve; @@ -1688,10 +1688,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 3d35028..450907f 100644 --- a/src/H5ACprivate.h +++ b/src/H5ACprivate.h @@ -53,8 +53,8 @@ #define H5AC_BPT_LEAF_ID 11 /*B+ tree leaf */ #define H5AC_NTYPES 12 -/* 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 @@ -208,7 +208,7 @@ extern hid_t H5AC_ind_dxpl_id; */ /* #defines of flags used in the flags parameters in some of the - * following function calls. Note that they are just copies of + * following function calls. Note that they are just copies of * the equivalent flags from H5Cprivate.h. */ @@ -224,12 +224,12 @@ extern hid_t H5AC_ind_dxpl_id; H5_DLL herr_t H5AC_init(void); H5_DLL herr_t H5AC_create(const H5F_t *f, H5AC_cache_config_t *config_ptr); -H5_DLL herr_t H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, +H5_DLL herr_t H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void *thing, unsigned int flags); H5_DLL void *H5AC_protect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, const void *udata1, void *udata2, H5AC_protect_t rw); -H5_DLL herr_t H5AC_unprotect(H5F_t *f, hid_t dxpl_id, +H5_DLL herr_t H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void *thing, unsigned flags); H5_DLL herr_t H5AC_flush(H5F_t *f, hid_t dxpl_id, unsigned flags); diff --git a/src/H5ACpublic.h b/src/H5ACpublic.h index f8f3b6d..2381ccc 100644 --- a/src/H5ACpublic.h +++ b/src/H5ACpublic.h @@ -55,7 +55,7 @@ extern "C" { * version number, or an error will be flagged. * * rpt_fcn_enabled: Boolean field used to enable and disable the default - * reporting function. This function is invoked every time the + * reporting function. This function is invoked every time the * automatic cache resize code is run, and reports on its activities. * * This is a debugging function, and should normally be turned off. diff --git a/src/H5B.c b/src/H5B.c index 3123bfc..c5775d8 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. @@ -251,7 +251,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) { @@ -261,7 +261,7 @@ done: if (bt) (void)H5B_dest(f,bt); } - + FUNC_LEAVE_NOAPI(ret_value) } /*lint !e818 Can't make udata a pointer to const */ @@ -580,7 +580,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") @@ -593,8 +593,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 @@ -713,7 +713,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. */ @@ -782,8 +782,8 @@ done: * of H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * - * In this case, that required adding the new - * old_bt_dirtied_ptr parameter to the function's argument + * In this case, that required adding the new + * old_bt_dirtied_ptr parameter to the function's argument * list. * *------------------------------------------------------------------------- @@ -870,7 +870,7 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_t *old_bt, unsigned *old_bt_flags, if (H5DEBUG(B)) fprintf(H5DEBUG(B), " split %3d/%-3d\n", nleft, nright); #endif - + /* * Create the new B-tree node. */ @@ -883,9 +883,9 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_t *old_bt, unsigned *old_bt_flags, /* * Copy data from the old node to the new node. */ - + /* this function didn't used to mark the new bt entry as dirty. Since - * we just inserted the entry, this doesn't matter unless the entry + * we just inserted the entry, this doesn't matter unless the entry * somehow gets flushed between the insert and the protect. At present, * I don't think this can happen, but it doesn't hurt to mark the entry * dirty again. @@ -906,7 +906,7 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_t *old_bt, unsigned *old_bt_flags, */ *old_bt_flags |= H5AC__DIRTIED_FLAG; old_bt->nchildren = nleft; - + /* * Update sibling pointers. */ @@ -921,7 +921,7 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_t *old_bt, unsigned *old_bt_flags, tmp_bt->left = *new_addr_p; - if (H5AC_unprotect(f, dxpl_id, H5AC_BT, old_bt->right, tmp_bt, + if (H5AC_unprotect(f, dxpl_id, H5AC_BT, old_bt->right, tmp_bt, H5AC__DIRTIED_FLAG) != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree node") } @@ -929,7 +929,7 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_t *old_bt, unsigned *old_bt_flags, old_bt->right = *new_addr_p; done: - if (new_bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, *new_addr_p, new_bt, + if (new_bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, *new_addr_p, new_bt, new_bt_flags) < 0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree node") @@ -1020,14 +1020,14 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, if (H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, H5AC__NO_FLAGS_SET) != SUCCEED) 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, H5AC__NO_FLAGS_SET) != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release new child") bt = NULL; @@ -1103,11 +1103,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 @@ -1137,7 +1137,7 @@ done: *------------------------------------------------------------------------- */ static herr_t -H5B_insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx, +H5B_insert_child(H5B_t *bt, unsigned *bt_flags, unsigned idx, haddr_t child, H5B_ins_t anchor, const void *md_key) { H5B_shared_t *shared; /* Pointer to shared B-tree info */ @@ -1476,7 +1476,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, tmp_bt_flags_ptr, 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). @@ -1499,9 +1499,9 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type done: { - herr_t e1 = (bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, + herr_t e1 = (bt && H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, bt_flags) < 0); - herr_t e2 = (twin && H5AC_unprotect(f, dxpl_id, H5AC_BT, *new_node_p, + herr_t e2 = (twin && H5AC_unprotect(f, dxpl_id, H5AC_BT, *new_node_p, twin, twin_flags)<0); if (e1 || e2) /*use vars to prevent short-circuit of side effects */ HDONE_ERROR(H5E_BTREE, H5E_PROTECT, H5B_INS_ERROR, "unable to release node(s)") @@ -1554,7 +1554,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) /* @@ -1677,7 +1677,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); @@ -1809,7 +1809,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type sibling->right = bt->right; - if (H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->left, sibling, + if (H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->left, sibling, H5AC__DIRTIED_FLAG) != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, H5B_INS_ERROR, "unable to release node from tree") sibling=NULL; /* Make certain future references will be caught */ @@ -1823,7 +1823,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type sibling->left = bt->left; - if (H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->right, sibling, + if (H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->right, sibling, H5AC__DIRTIED_FLAG) != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, H5B_INS_ERROR, "unable to release node from tree") sibling=NULL; /* Make certain future references will be caught */ @@ -1851,7 +1851,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type */ bt_flags |= H5AC__DIRTIED_FLAG; bt->nchildren -= 1; - + HDmemmove(bt->native, bt->native + type->sizeof_nkey, (bt->nchildren+1) * type->sizeof_nkey); @@ -1885,7 +1885,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type HDmemcpy(H5B_NKEY(sibling,shared,0), H5B_NKEY(bt,shared,bt->nchildren), type->sizeof_nkey); - if (H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->right, sibling, + if (H5AC_unprotect(f, dxpl_id, H5AC_BT, bt->right, sibling, H5AC__DIRTIED_FLAG) != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, H5B_INS_ERROR, "unable to release node from tree") sibling=NULL; /* Make certain future references will be caught */ @@ -1904,7 +1904,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type */ bt_flags |= H5AC__DIRTIED_FLAG; bt->nchildren -= 1; - + HDmemmove(bt->native + idx * type->sizeof_nkey, bt->native + (idx+1) * type->sizeof_nkey, (bt->nchildren+1-idx) * type->sizeof_nkey); @@ -1912,7 +1912,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; } @@ -1962,7 +1962,7 @@ H5B_remove(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void unsigned bt_flags = H5AC__NO_FLAGS_SET; H5B_t *bt = NULL; /*btree node */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5B_remove, FAIL) /* Check args */ @@ -1987,7 +1987,7 @@ H5B_remove(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void bt->level = 0; bt_flags |= H5AC__DIRTIED_FLAG; } - + if (H5AC_unprotect(f, dxpl_id, H5AC_BT, addr, bt, bt_flags) != SUCCEED) HGOTO_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release node") bt=NULL; /* Make certain future references will be caught */ @@ -2027,7 +2027,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 */ @@ -2067,7 +2067,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, H5C__DELETED_FLAG)<0) HDONE_ERROR(H5E_BTREE, H5E_PROTECT, FAIL, "unable to release B-tree node in cache") @@ -2283,7 +2283,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/H5B2.c b/src/H5B2.c index 68ad206..b7cbb5d 100644 --- a/src/H5B2.c +++ b/src/H5B2.c @@ -67,25 +67,25 @@ static herr_t H5B2_split_root(H5F_t *f, hid_t dxpl_id, H5B2_t *bt2, static herr_t H5B2_redistribute2(H5F_t *f, hid_t dxpl_id, unsigned depth, H5B2_internal_t *internal, unsigned idx); static herr_t H5B2_split2(H5F_t *f, hid_t dxpl_id, unsigned depth, - H5B2_node_ptr_t *curr_node_ptr, unsigned * parent_cache_info_flags_ptr, + H5B2_node_ptr_t *curr_node_ptr, unsigned * parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx); -static herr_t H5B2_split3(H5F_t *f, hid_t dxpl_id, unsigned depth, +static herr_t H5B2_split3(H5F_t *f, hid_t dxpl_id, unsigned depth, H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags, H5B2_internal_t *internal, unsigned *internal_flags, unsigned idx); static herr_t H5B2_redistribute3(H5F_t *f, hid_t dxpl_id, unsigned depth, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx); static herr_t H5B2_merge2(H5F_t *f, hid_t dxpl_id, unsigned depth, - H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, + H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx); static herr_t H5B2_merge3(H5F_t *f, hid_t dxpl_id, unsigned depth, - H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, + H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx); static herr_t H5B2_swap_leaf(H5F_t *f, hid_t dxpl_id, unsigned depth, - H5B2_internal_t *internal, unsigned *internal_flags_ptr, + H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx, void *swap_loc); static herr_t H5B2_insert_internal(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, unsigned depth, H5AC_info_t *parent_cache_info, - unsigned *parent_cache_info_flags_ptr, + unsigned *parent_cache_info_flags_ptr, H5B2_node_ptr_t *curr_node_ptr, void *udata); static herr_t H5B2_insert_leaf(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, H5B2_node_ptr_t *curr_node_ptr, void *udata); @@ -354,7 +354,7 @@ done: if (bt2) (void)H5B2_cache_hdr_dest(f,bt2); } /* end if */ - + FUNC_LEAVE_NOAPI(ret_value) } /* end H5B2_create() */ @@ -854,7 +854,7 @@ done: * of H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * - * In this case, that required adding the new + * In this case, that required adding the new * parent_cache_info_dirtied_ptr and internal_dirtied_ptr * parameters to the function's argument list. * @@ -862,7 +862,7 @@ done: */ static herr_t H5B2_split2(H5F_t *f, hid_t dxpl_id, unsigned depth, H5B2_node_ptr_t *curr_node_ptr, - unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, + unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx) { const H5AC_class_t *child_class; /* Pointer to child node's class info */ @@ -1135,8 +1135,8 @@ done: * of H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * - * In this case, that required adding the new - * internal_dirtied_ptr parameter to the function's + * In this case, that required adding the new + * internal_dirtied_ptr parameter to the function's * argument list. * *------------------------------------------------------------------------- @@ -1516,16 +1516,16 @@ done: * of H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * - * In this case, that required adding the new + * In this case, that required adding the new * parent_cache_info_dirtied_ptr and internal_dirtied_ptr * parameters to the function's argument list. * *------------------------------------------------------------------------- */ static herr_t -H5B2_split3(H5F_t *f, hid_t dxpl_id, unsigned depth, +H5B2_split3(H5F_t *f, hid_t dxpl_id, unsigned depth, H5B2_node_ptr_t *curr_node_ptr, - unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, + unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx) { const H5AC_class_t *child_class; /* Pointer to child node's class info */ @@ -1711,7 +1711,7 @@ H5B2_split3(H5F_t *f, hid_t dxpl_id, unsigned depth, /* Move records from middle node to new node */ HDmemcpy(H5B2_NAT_NREC(new_native,shared,0),H5B2_NAT_NREC(middle_native,shared,(*middle_nrec-new_nrec_move)),shared->type->nrec_size*new_nrec_move); - + /* Move record from middle node up to parent node */ HDmemcpy(H5B2_INT_NREC(internal,shared,idx),H5B2_NAT_NREC(middle_native,shared,((*middle_nrec-new_nrec_move)-1)),shared->type->nrec_size); @@ -1856,14 +1856,14 @@ done: * of H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * - * In this case, that required adding the new + * In this case, that required adding the new * parent_cache_info_dirtied_ptr and internal_dirtied_ptr * parameters to the function's argument list. * *------------------------------------------------------------------------- */ static herr_t -H5B2_merge2(H5F_t *f, hid_t dxpl_id, unsigned depth, +H5B2_merge2(H5F_t *f, hid_t dxpl_id, unsigned depth, H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx) { @@ -2023,15 +2023,15 @@ done: * of H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * - * In this case, that required adding the new + * In this case, that required adding the new * parent_cache_info_dirtied_ptr and internal_dirtied_ptr * parameters to the function's argument list. * *------------------------------------------------------------------------- */ static herr_t -H5B2_merge3(H5F_t *f, hid_t dxpl_id, unsigned depth, - H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, +H5B2_merge3(H5F_t *f, hid_t dxpl_id, unsigned depth, + H5B2_node_ptr_t *curr_node_ptr, unsigned *parent_cache_info_flags_ptr, H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx) { const H5AC_class_t *child_class; /* Pointer to child node's class info */ @@ -2258,15 +2258,15 @@ done: * of H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * - * In this case, that required adding the new - * internal_dirtied_ptr parameter to the function's + * In this case, that required adding the new + * internal_dirtied_ptr parameter to the function's * argument list. * *------------------------------------------------------------------------- */ static herr_t H5B2_swap_leaf(H5F_t *f, hid_t dxpl_id, unsigned depth, - H5B2_internal_t *internal, unsigned *internal_flags_ptr, + H5B2_internal_t *internal, unsigned *internal_flags_ptr, unsigned idx, void *swap_loc) { const H5AC_class_t *child_class; /* Pointer to child node's class info */ @@ -2457,7 +2457,7 @@ done: */ static herr_t H5B2_insert_internal(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, - unsigned depth, H5AC_info_t *parent_cache_info, + unsigned depth, H5AC_info_t *parent_cache_info, unsigned *parent_cache_info_flags_ptr, H5B2_node_ptr_t *curr_node_ptr, void *udata) { @@ -2648,7 +2648,7 @@ H5B2_insert(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, if(H5B2_split_root(f, dxpl_id, bt2, &bt2_flags, bt2->shared)<0) HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to split root node") } /* end if */ - + /* Attempt to insert record into B-tree */ if(bt2->depth>0) { if(H5B2_insert_internal(f,dxpl_id,bt2->shared,bt2->depth,&(bt2->cache_info),&bt2_flags,&bt2->root,udata)<0) @@ -2686,7 +2686,7 @@ done: * Modifications: * * John Mainzer, 6/15/05 - * Modified the function to avoid modifying the is_dirty + * Modified the function to avoid modifying the is_dirty * field of the cache info, as that field is now maintained * by the cache code. Since this function uses a call to * H5AC_set(), and that function presumes that the newly @@ -2767,7 +2767,7 @@ done: * Modifications: * * John Mainzer, 6/15/05 - * Modified the function to avoid modifying the is_dirty + * Modified the function to avoid modifying the is_dirty * field of the cache info, as that field is now maintained * by the cache code. Since this function uses a call to * H5AC_set(), and that function presumes that the newly @@ -3030,7 +3030,7 @@ done: * UDATA pointer depending on the type of leaf node * requested. The UDATA can point to additional data passed * to the key comparison function. - * + * * The 'OP' routine is called with the record found and the * OP_DATA pointer, to allow caller to return information about * the record. @@ -3189,7 +3189,7 @@ H5B2_find(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, if (H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") } - + done: /* Check if we need to decrement the reference count for the B-tree's shared info */ if(incr_rc) @@ -3204,7 +3204,7 @@ done: * * Purpose: Locate the IDX'th record in a B-tree according to the * ordering used by the B-tree. The IDX values are 0-based. - * + * * The 'OP' routine is called with the record found and the * OP_DATA pointer, to allow caller to return information about * the record. @@ -3373,7 +3373,7 @@ H5B2_index(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, if (H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, H5AC__NO_FLAGS_SET) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") } - + done: /* Check if we need to decrement the reference count for the B-tree's shared info */ if(incr_rc) @@ -3458,7 +3458,7 @@ H5B2_remove_leaf(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, /* Release space for B-tree node on disk */ if (H5MF_xfree(f, H5FD_MEM_BTREE, dxpl_id, leaf_addr, (hsize_t)shared->node_size)<0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free B-tree leaf node") - + /* Let the cache know that the object is deleted */ leaf_flags |= H5AC__DELETED_FLAG; @@ -3496,8 +3496,8 @@ done: * of H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * - * In this case, that required adding the new - * parent_cache_info_dirtied_ptr parameter to the + * In this case, that required adding the new + * parent_cache_info_dirtied_ptr parameter to the * function's argument list. * *------------------------------------------------------------------------- @@ -3559,7 +3559,7 @@ H5B2_remove_internal(H5F_t *f, hid_t dxpl_id, H5RC_t *bt2_shared, /* Release space for root B-tree node on disk */ if (H5MF_xfree(f, H5FD_MEM_BTREE, dxpl_id, internal_addr, (hsize_t)shared->node_size)<0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free B-tree leaf node") - + /* Let the cache know that the object is deleted */ internal_flags |= H5AC__DELETED_FLAG; @@ -3702,7 +3702,7 @@ done: * Function: H5B2_remove * * Purpose: Removes a record from a B-tree. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol @@ -3780,7 +3780,7 @@ done: * Function: H5B2_get_nrec * * Purpose: Retrieves the number of records in a B-tree - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol @@ -3836,7 +3836,7 @@ done: * caller-supplied UDATA pointer depending on the type of leaf node * requested. The UDATA can point to additional data passed * to the key comparison function. - * + * * The 'OP' routine is called with the record found and the * OP_DATA pointer, to allow caller to return information about * the record. @@ -3936,7 +3936,7 @@ done: * caller-supplied UDATA pointer depending on the type of leaf node * requested. The UDATA can point to additional data passed * to the key comparison function. - * + * * The 'OP' routine is called with the record found and the * OP_DATA pointer, to allow caller to return information about * the record. @@ -4033,7 +4033,7 @@ done: * caller-supplied UDATA pointer depending on the type of leaf node * requested. The UDATA can point to additional data passed * to the key comparison function. - * + * * The 'OP' routine is called with the record found and the * OP_DATA pointer, to allow caller to return information about * the record. @@ -4228,7 +4228,7 @@ H5B2_delete(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr) /* Release space for B-tree node on disk */ if (H5MF_xfree(f, H5FD_MEM_BTREE, dxpl_id, addr, (hsize_t)H5B2_HEADER_SIZE(f))<0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free B-tree header info") - + done: /* Release the B-tree header info */ if (bt2 && H5AC_unprotect(f, dxpl_id, H5AC_BT2_HDR, addr, bt2, H5AC__DELETED_FLAG) < 0) @@ -4244,7 +4244,7 @@ done: * Purpose: Locate the specified information in a B-tree and modify it. * The UDATA can point to additional data passed * to the key comparison function. - * + * * The 'OP' routine is called with the record found and the * OP_DATA pointer, to allow caller to modify information about * the record. @@ -4418,7 +4418,7 @@ H5B2_modify(H5F_t *f, hid_t dxpl_id, const H5B2_class_t *type, haddr_t addr, if (H5AC_unprotect(f, dxpl_id, H5AC_BT2_LEAF, curr_node_ptr.addr, leaf, leaf_flags) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTUNPROTECT, FAIL, "unable to release B-tree node") } - + done: /* Check if we need to decrement the reference count for the B-tree's shared info */ if(incr_rc) diff --git a/src/H5B2cache.c b/src/H5B2cache.c index 9f7d9db..7810aae 100644 --- a/src/H5B2cache.c +++ b/src/H5B2cache.c @@ -345,7 +345,7 @@ H5B2_cache_hdr_clear(H5F_t *f, H5B2_t *bt2, hbool_t destroy) /* Reset the dirty flag. */ bt2->cache_info.is_dirty = FALSE; - + if (destroy) if (H5B2_cache_hdr_dest(f, bt2) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree header") @@ -359,7 +359,7 @@ done: * Function: H5B2_cache_hdr_size * * Purpose: Compute the size in bytes of a B-tree header - * on disk, and return it in *size_ptr. On failure, + * on disk, and return it in *size_ptr. On failure, * the value of *size_ptr is undefined. * * Return: Non-negative on success/Negative on failure @@ -627,7 +627,7 @@ H5B2_cache_leaf_clear(H5F_t *f, H5B2_leaf_t *leaf, hbool_t destroy) /* Reset the dirty flag. */ leaf->cache_info.is_dirty = FALSE; - + if (destroy) if (H5B2_cache_leaf_dest(f, leaf) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree leaf node") @@ -641,7 +641,7 @@ done: * Function: H5B2_cache_leaf_size * * Purpose: Compute the size in bytes of a B-tree leaf node - * on disk, and return it in *size_ptr. On failure, + * on disk, and return it in *size_ptr. On failure, * the value of *size_ptr is undefined. * * Return: Non-negative on success/Negative on failure @@ -949,7 +949,7 @@ H5B2_cache_internal_clear(H5F_t *f, H5B2_internal_t *internal, hbool_t destroy) /* Reset the dirty flag. */ internal->cache_info.is_dirty = FALSE; - + if (destroy) if (H5B2_cache_internal_dest(f, internal) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B-tree internal node") @@ -963,7 +963,7 @@ done: * Function: H5B2_cache_internal_size * * Purpose: Compute the size in bytes of a B-tree internal node - * on disk, and return it in *size_ptr. On failure, + * on disk, and return it in *size_ptr. On failure, * the value of *size_ptr is undefined. * * Return: Non-negative on success/Negative on failure diff --git a/src/H5B2private.h b/src/H5B2private.h index da67213..3be4413 100644 --- a/src/H5B2private.h +++ b/src/H5B2private.h @@ -44,7 +44,7 @@ #define H5B2_ITER_CONT (0) #define H5B2_ITER_STOP (1) - + /****************************/ /* Library Private Typedefs */ /****************************/ diff --git a/src/H5BP.c b/src/H5BP.c index 55d0095..758d1d6 100644 --- a/src/H5BP.c +++ b/src/H5BP.c @@ -229,7 +229,7 @@ done: if (bpt) (void)H5BP_cache_hdr_dest(f,bpt); } /* end if */ - + FUNC_LEAVE_NOAPI(ret_value) } /* end H5BP_create() */ @@ -443,7 +443,7 @@ HDfprintf(stderr,"%s: attempting to split root node\n",FUNC); HGOTO_ERROR(H5E_BTREE, H5E_UNSUPPORTED, FAIL, "Can't split root yet!") #endif /* LATER */ } /* end if */ - + /* Attempt to insert record into B+ tree */ if(bpt->depth>0) { #ifdef LATER diff --git a/src/H5BPcache.c b/src/H5BPcache.c index e511ae2..57e1677 100644 --- a/src/H5BPcache.c +++ b/src/H5BPcache.c @@ -328,7 +328,7 @@ H5BP_cache_hdr_clear(H5F_t *f, H5BP_t *bpt, hbool_t destroy) /* Reset the dirty flag. */ bpt->cache_info.is_dirty = FALSE; - + if (destroy) if (H5BP_cache_hdr_dest(f, bpt) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B+ tree header") @@ -342,7 +342,7 @@ done: * Function: H5BP_cache_hdr_size * * Purpose: Compute the size in bytes of a B+ tree header - * on disk, and return it in *size_ptr. On failure, + * on disk, and return it in *size_ptr. On failure, * the value of *size_ptr is undefined. * * Return: Non-negative on success/Negative on failure @@ -662,7 +662,7 @@ H5BP_cache_leaf_clear(H5F_t *f, H5BP_leaf_t *leaf, hbool_t destroy) /* Reset the dirty flag. */ leaf->cache_info.is_dirty = FALSE; - + if (destroy) if (H5BP_cache_leaf_dest(f, leaf) < 0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to destroy B+ tree leaf node") @@ -676,7 +676,7 @@ done: * Function: H5BP_cache_leaf_size * * Purpose: Compute the size in bytes of a B+ tree leaf node - * on disk, and return it in *size_ptr. On failure, + * on disk, and return it in *size_ptr. On failure, * the value of *size_ptr is undefined. * * Return: Non-negative on success/Negative on failure diff --git a/src/H5BPprivate.h b/src/H5BPprivate.h index 88048ef..9921a73 100644 --- a/src/H5BPprivate.h +++ b/src/H5BPprivate.h @@ -37,7 +37,7 @@ /* Library Private Macros */ /**************************/ - + /****************************/ /* Library Private Typedefs */ /****************************/ diff --git a/src/H5BT.c b/src/H5BT.c index b0d9a09..84d13dc 100644 --- a/src/H5BT.c +++ b/src/H5BT.c @@ -121,7 +121,7 @@ done: if (bt) (void)H5BT_cache_dest(f,bt); } /* end if */ - + FUNC_LEAVE_NOAPI(ret_value) } /* end H5BT_create() */ @@ -445,7 +445,7 @@ done: /* Release the block tracker info */ if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BLTR, addr, bt, bt_flags) < 0) HDONE_ERROR(H5E_BLKTRK, H5E_CANTUNPROTECT, FAIL, "unable to release block tracker info") - + FUNC_LEAVE_NOAPI(ret_value) } /* end H5BT_insert() */ @@ -496,7 +496,7 @@ done: /* Release the block tracker info */ if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BLTR, addr, bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BLKTRK, H5E_CANTUNPROTECT, FAIL, "unable to release block tracker info") - + FUNC_LEAVE_NOAPI(ret_value) } /* end H5BT_get_total_size() */ @@ -706,7 +706,7 @@ done: /* Release the block tracker info */ if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BLTR, addr, bt, bt_flags) < 0) HDONE_ERROR(H5E_BLKTRK, H5E_CANTUNPROTECT, FAIL, "unable to release block tracker info") - + FUNC_LEAVE_NOAPI(ret_value) } /* end H5BT_remove() */ @@ -807,7 +807,7 @@ done: /* Release the block tracker info */ if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BLTR, addr, bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BLKTRK, H5E_CANTUNPROTECT, FAIL, "unable to release block tracker info") - + FUNC_LEAVE_NOAPI(ret_value) } /* end H5BT_locate() */ @@ -862,7 +862,7 @@ done: /* Release the block tracker info */ if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BLTR, addr, bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BLKTRK, H5E_CANTUNPROTECT, FAIL, "unable to release block tracker info") - + FUNC_LEAVE_NOAPI(ret_value) } /* end H5BT_iterate() */ @@ -955,7 +955,7 @@ done: /* Release the block tracker info */ if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BLTR, addr, bt, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_BLKTRK, H5E_CANTUNPROTECT, FAIL, "unable to release block tracker info") - + FUNC_LEAVE_NOAPI(ret_value) } /* end H5BT_neighbor() */ @@ -1005,12 +1005,12 @@ H5BT_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) /* Release space for block tracker info on disk */ if (H5MF_xfree(f, H5FD_MEM_BLKTRK, dxpl_id, addr, (hsize_t)H5BT_SIZE(f))<0) HGOTO_ERROR(H5E_BTREE, H5E_CANTFREE, FAIL, "unable to free block tracker info") - + done: /* Release the block tracker info */ if (bt && H5AC_unprotect(f, dxpl_id, H5AC_BLTR, addr, bt, H5AC__DIRTIED_FLAG | H5AC__DELETED_FLAG) < 0) HDONE_ERROR(H5E_BLKTRK, H5E_CANTUNPROTECT, FAIL, "unable to release block tracker info") - + FUNC_LEAVE_NOAPI(ret_value) } /* end H5BT_remove() */ diff --git a/src/H5BTcache.c b/src/H5BTcache.c index f5f6a4e..d579c05 100644 --- a/src/H5BTcache.c +++ b/src/H5BTcache.c @@ -289,7 +289,7 @@ H5BT_cache_clear(H5F_t *f, H5BT_t *bt, hbool_t destroy) /* Reset the dirty flag. */ bt->cache_info.is_dirty = FALSE; - + if (destroy) if (H5BT_cache_dest(f, bt) < 0) HGOTO_ERROR(H5E_BLKTRK, H5E_CANTFREE, FAIL, "unable to destroy block tracker info") @@ -303,7 +303,7 @@ done: * Function: H5BT_cache_size * * Purpose: Compute the size in bytes of a block tracker info - * on disk, and return it in *size_ptr. On failure, + * on disk, and return it in *size_ptr. On failure, * the value of *size_ptr is undefined. * * Return: Non-negative on success/Negative on failure diff --git a/src/H5BTprivate.h b/src/H5BTprivate.h index 3eab872..e7de549 100644 --- a/src/H5BTprivate.h +++ b/src/H5BTprivate.h @@ -45,7 +45,7 @@ #define H5BT_ITER_CONT H5B2_ITER_CONT #define H5BT_ITER_STOP H5B2_ITER_STOP - + /****************************/ /* Library Private Typedefs */ /****************************/ 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 0f13a65..afad50b 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 @@ -43,9 +43,9 @@ * an overview. * * Some elements of the automatic cache resize code depend on - * the LRU list. Thus if we ever choose to support a new + * the LRU list. Thus if we ever choose to support a new * replacement policy, we will either have to disable those - * elements of the auto resize code when running the new + * elements of the auto resize code when running the new * policy, or modify them to make use of similar information * maintained by the new policy code. * @@ -69,7 +69,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 @@ -87,7 +87,7 @@ * * Tests: * - * - Trim execution time. (This is no longer a major issue with the + * - Trim execution time. (This is no longer a major issue with the * shift from the TBBT to a hash table for indexing.) * * - Add random tests. @@ -113,11 +113,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. * @@ -145,7 +145,7 @@ * size, but this would break the index_size = LRU_list_size + pl_size * invarient. * - * Alternatively, I could pass the current decr_mode in to the macro, + * Alternatively, I could pass the current decr_mode in to the macro, * and just skip the check whenever epoch markers may be in use. * * However, any size errors should be caught when the cache is flushed @@ -156,10 +156,10 @@ * * - In the H5C__DLL_PRE_INSERT_SC macro, replaced the lines: * - * ( ( (len) == 1 ) && + * ( ( (len) == 1 ) && * ( ( (head_ptr) != (tail_ptr) ) || ( (Size) <= 0 ) || - * ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) - * ) + * ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) + * ) * ) || * * with: @@ -167,7 +167,7 @@ * ( ( (len) == 1 ) && * ( ( (head_ptr) != (tail_ptr) ) || * ( (head_ptr) == NULL ) || ( (head_ptr)->size != (Size) ) - * ) + * ) * ) || * * Epoch markers have size 0, so we can now have a non-empty list with @@ -185,7 +185,7 @@ * ) * ) || * - * with + * with * * ( ( (len) == 1 ) && * ( ( (head_ptr) != (tail_ptr) ) || @@ -199,7 +199,7 @@ * take on negative values, and thus the revised clause "( (Size) < 0 )" * caused compiler warnings. * JRM - 1/10/05 - * + * ****************************************************************************/ #if H5C_DO_SANITY_CHECKS @@ -495,7 +495,7 @@ if ( ( (entry_ptr) == NULL ) || \ * The following macros must handle stats collection when this collection * is enabled, and evaluate to the empty string when it is not. * - * The sole exception to this rule is + * The sole exception to this rule is * H5C__UPDATE_CACHE_HIT_RATE_STATS(), which is always active as * the cache hit rate stats are always collected and available. * @@ -529,7 +529,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])++; @@ -614,16 +614,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 ) \ @@ -643,7 +643,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) @@ -838,12 +838,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. @@ -854,7 +854,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. * @@ -866,8 +866,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 @@ -875,7 +875,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 @@ -915,7 +915,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. * @@ -965,7 +965,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. @@ -976,10 +976,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. @@ -1073,10 +1073,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. @@ -1193,7 +1193,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. @@ -1288,14 +1288,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. @@ -1409,10 +1409,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. @@ -1438,7 +1438,7 @@ if ( ( (cache_ptr) == NULL ) || \ * at optimization. * * JRM - 6/23/05 - * Added the was_dirty parameter. It is possible that + * Added the was_dirty parameter. It is possible that * the entry was clean when it was renamed -- if so it * it is in the clean LRU regardless of the current * value of the is_dirty field. @@ -1554,7 +1554,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. @@ -1566,8 +1566,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 @@ -1779,10 +1779,10 @@ const H5C_class_t epoch_marker_class = ***************************************************************************/ static void * -H5C_epoch_marker_load(UNUSED H5F_t *f, - UNUSED hid_t dxpl_id, +H5C_epoch_marker_load(UNUSED H5F_t *f, + UNUSED hid_t dxpl_id, UNUSED haddr_t addr, - UNUSED const void *udata1, + UNUSED const void *udata1, UNUSED void *udata2) { void * ret_value = NULL; /* Return value */ @@ -1796,11 +1796,11 @@ done: FUNC_LEAVE_NOAPI(ret_value) } -static herr_t -H5C_epoch_marker_flush(UNUSED H5F_t *f, - UNUSED hid_t dxpl_id, +static herr_t +H5C_epoch_marker_flush(UNUSED H5F_t *f, + UNUSED hid_t dxpl_id, UNUSED hbool_t dest, - UNUSED haddr_t addr, + UNUSED haddr_t addr, UNUSED void *thing) { herr_t ret_value = FAIL; /* Return value */ @@ -1814,8 +1814,8 @@ done: FUNC_LEAVE_NOAPI(ret_value) } -static herr_t -H5C_epoch_marker_dest(UNUSED H5F_t *f, +static herr_t +H5C_epoch_marker_dest(UNUSED H5F_t *f, UNUSED void *thing) { herr_t ret_value = FAIL; /* Return value */ @@ -1829,9 +1829,9 @@ done: FUNC_LEAVE_NOAPI(ret_value) } -static herr_t -H5C_epoch_marker_clear(UNUSED H5F_t *f, - UNUSED void *thing, +static herr_t +H5C_epoch_marker_clear(UNUSED H5F_t *f, + UNUSED void *thing, UNUSED hbool_t dest) { herr_t ret_value = FAIL; /* Return value */ @@ -1845,9 +1845,9 @@ done: FUNC_LEAVE_NOAPI(ret_value) } -static herr_t -H5C_epoch_marker_size(UNUSED const H5F_t *f, - UNUSED const void *thing, +static herr_t +H5C_epoch_marker_size(UNUSED const H5F_t *f, + UNUSED const void *thing, UNUSED size_t *size_ptr) { herr_t ret_value = FAIL; /* Return value */ @@ -1865,16 +1865,16 @@ done: /*------------------------------------------------------------------------- * 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. @@ -1891,7 +1891,7 @@ done: * * JRM -- 10/5/04 * Added call to H5C_reset_cache_hit_rate_stats(). Also - * added initialization for cache_is_full flag and for + * added initialization for cache_is_full flag and for * resize_ctl. * * JRM -- 11/12/04 @@ -1938,7 +1938,7 @@ H5C_create(size_t max_cache_size, "memory allocation failed") } - if ( (cache_ptr->slist_ptr = H5SL_create(H5SL_TYPE_HADDR,0.5,(size_t)16)) + if ( (cache_ptr->slist_ptr = H5SL_create(H5SL_TYPE_HADDR,0.5,(size_t)16)) == NULL ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTCREATE, NULL, "can't create skip list.") @@ -2093,7 +2093,7 @@ done: * * This function should only be used where HDprintf() behaves * well -- i.e. not on Windows. - * + * * Return: void * * Programmer: John Mainzer @@ -2102,12 +2102,12 @@ done: * Modifications: * * JRM -- 11/22/04 - * Reworked function to adapt it to the addition of the + * Reworked function to adapt it to the addition of the * ageout method of cache size reduction. * *------------------------------------------------------------------------- */ -void +void H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, int32_t version, double hit_rate, @@ -2137,7 +2137,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, HDfprintf(stdout, "out of bounds low (%6.5lf).\n", (cache_ptr->resize_ctl).lower_hr_threshold); - HDfprintf(stdout, + HDfprintf(stdout, " cache size increased from (%Zu/%Zu) to (%Zu/%Zu).\n", old_max_cache_size, old_min_clean_size, @@ -2154,11 +2154,11 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, HDassert( hit_rate > (cache_ptr->resize_ctl).upper_hr_threshold ); - HDfprintf(stdout, + HDfprintf(stdout, "Auto cache resize -- decrease by threshold. "); - HDfprintf(stdout, "HR = %lf > %6.5lf\n", - hit_rate, + HDfprintf(stdout, "HR = %lf > %6.5lf\n", + hit_rate, (cache_ptr->resize_ctl).upper_hr_threshold); HDfprintf(stdout, "out of bounds high (%6.5lf).\n", @@ -2166,7 +2166,7 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, break; case H5C_decr__age_out: - HDfprintf(stdout, + HDfprintf(stdout, "Auto cache resize -- decrease by ageout. "); HDfprintf(stdout, "HR = %lf\n", hit_rate); break; @@ -2175,20 +2175,20 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, HDassert( hit_rate > (cache_ptr->resize_ctl).upper_hr_threshold ); - HDfprintf(stdout, + HDfprintf(stdout, "Auto cache resize -- decrease by ageout with "); HDfprintf(stdout, "threshold. HR = %lf > %6.5lf\n", - hit_rate, + hit_rate, (cache_ptr->resize_ctl).upper_hr_threshold); break; default: - HDfprintf(stdout, + HDfprintf(stdout, "Auto cache resize -- decrease by unknown mode."); HDfprintf(stdout, " HR = %lf\n", hit_rate); } - HDfprintf(stdout, + HDfprintf(stdout, " cache size decreased from (%Zu/%Zu) to (%Zu/%Zu).\n", old_max_cache_size, old_min_clean_size, @@ -2246,11 +2246,11 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, * 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. @@ -2267,9 +2267,9 @@ H5C_def_auto_resize_rpt_fcn(H5C_t * cache_ptr, *------------------------------------------------------------------------- */ 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 */ @@ -2280,7 +2280,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, H5C__FLUSH_INVALIDATE_FLAG) < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache") @@ -2332,8 +2332,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, \ @@ -2364,18 +2364,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 @@ -2390,32 +2390,32 @@ done: * Added code to remove all epoch markers (if any) from the * LRU list before a destroy. Strictly speaking, this isn't * necessary, as the marker entries reside only in the LRU - * list, never in the index or in the tree. However, it + * list, never in the index or in the tree. However, it * never hurts to tidy up. * * JRM -- 1/6/05 - * Reworked code to support the new + * Reworked code to support the new * H5C__FLUSH_MARKED_ENTRIES_FLAG, and for the replacement of * H5F_FLUSH_INVALIDATE flag with H5C__FLUSH_INVALIDATE_FLAG. * * Note that the H5C__FLUSH_INVALIDATE_FLAG takes precidence * over the H5C__FLUSH_MARKED_ENTRIES_FLAG. Thus if both are - * set, the functions behaves as if just the + * set, the functions behaves as if just the * H5C__FLUSH_INVALIDATE_FLAG was set. * - * The H5C__FLUSH_CLEAR_ONLY_FLAG flag can co-exist with - * either the H5C__FLUSH_MARKED_ENTRIES_FLAG, or the + * The H5C__FLUSH_CLEAR_ONLY_FLAG flag can co-exist with + * either the H5C__FLUSH_MARKED_ENTRIES_FLAG, or the * H5C__FLUSH_INVALIDATE_FLAG. In all cases, it is simply * passed along to H5C_flush_single_entry(). In the case of - * H5C__FLUSH_MARKED_ENTRIES_FLAG, it will only apply to + * H5C__FLUSH_MARKED_ENTRIES_FLAG, it will only apply to * the marked entries. * *------------------------------------------------------------------------- */ 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) { @@ -2486,21 +2486,21 @@ 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 ) { @@ -2549,7 +2549,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 ) { @@ -2562,14 +2562,14 @@ 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 ) { @@ -2587,10 +2587,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; @@ -2627,7 +2627,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C_get_cache_auto_resize_config * - * Purpose: Copy the current configuration of the cache automatic + * Purpose: Copy the current configuration of the cache automatic * re-sizing function into the instance of H5C_auto_size_ctl_t * pointed to by config_ptr. * @@ -2644,7 +2644,7 @@ done: */ herr_t -H5C_get_cache_auto_resize_config(H5C_t * cache_ptr, +H5C_get_cache_auto_resize_config(H5C_t * cache_ptr, H5C_auto_size_ctl_t *config_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -2676,10 +2676,10 @@ done: /*------------------------------------------------------------------------- * Function: H5C_get_cache_size * - * Purpose: Return the cache maximum size, the minimum clean size, the - * current size, and the current number of entries in + * Purpose: Return the cache maximum size, the minimum clean size, the + * current size, and the current number of entries in * *max_size_ptr, *min_clean_size_ptr, *cur_size_ptr, and - * *cur_num_entries_ptr respectively. If any of these + * *cur_num_entries_ptr respectively. If any of these * parameters are NULL, skip that value. * * Return: SUCCEED on success, and FAIL on failure. @@ -2695,7 +2695,7 @@ done: */ herr_t -H5C_get_cache_size(H5C_t * cache_ptr, +H5C_get_cache_size(H5C_t * cache_ptr, size_t * max_size_ptr, size_t * min_clean_size_ptr, size_t * cur_size_ptr, @@ -2740,10 +2740,10 @@ done: /*------------------------------------------------------------------------- * Function: H5C_get_cache_hit_rate * - * Purpose: Compute and return the current cache hit rate in - * *hit_rate_ptr. If there have been no accesses since the + * Purpose: Compute and return the current cache hit rate in + * *hit_rate_ptr. If there have been no accesses since the * last time the cache hit rate stats were reset, set - * *hit_rate_ptr to 0.0. On error, *hit_rate_ptr is + * *hit_rate_ptr to 0.0. On error, *hit_rate_ptr is * undefined. * * Return: SUCCEED on success, and FAIL on failure. @@ -2804,15 +2804,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. @@ -2837,24 +2837,24 @@ done: * * JRM -- 1/6/05 * Added the flags parameter, and code supporting - * H5C__SET_FLUSH_MARKER_FLAG. Note that this flag is + * H5C__SET_FLUSH_MARKER_FLAG. Note that this flag is * ignored unless the new entry is dirty. * * JRM -- 6/6/05 * Added code to force all inserted entries to be dirty. - * This is part of a set of changes moving management of the + * This is part of a set of changes moving management of the * is_dirty field of H5C_cache_entry_t into the H5C code. * *------------------------------------------------------------------------- */ 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, unsigned int flags) { @@ -2893,7 +2893,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; @@ -2901,12 +2901,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) { @@ -2916,8 +2916,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 ) { @@ -2936,13 +2936,13 @@ H5C_insert_entry(H5F_t * f, space_needed = cache_ptr->max_cache_size; } - /* Note that space_needed is just the amount of space that + /* Note that space_needed is just the amount of space that * needed to insert the new entry without exceeding the cache * size limit. The subsequent call to H5C_make_space_in_cache() * may evict the entries required to free more or less space * depending on conditions. It MAY be less if the cache is * currently undersized, or more if the cache is oversized. - * + * * The cache can exceed its maximum size limit via the following * mechanisms: * @@ -2952,20 +2952,20 @@ H5C_insert_entry(H5F_t * f, * Second, when writes are not permitted it is also possible * for the cache to grow without bound. * - * Finally, we usually 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 + * Finally, we usually 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. * * Since items 1 and 2 are not changing any time soon, I see * no point in worrying about the third. */ - 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, &first_flush); @@ -2997,7 +2997,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. */ @@ -3007,8 +3007,8 @@ H5C_insert_entry(H5F_t * f, H5C__INSERT_IN_INDEX(cache_ptr, entry_ptr, FAIL) /* New entries are presumed to be dirty, so this if statement is - * unnecessary. Rework it once the rest of the code changes are - * in and tested. -- JRM + * unnecessary. Rework it once the rest of the code changes are + * in and tested. -- JRM */ if ( entry_ptr->is_dirty ) { @@ -3051,7 +3051,7 @@ done: * JRM -- 6/6/05 * Updated function to force all renamed entries to be * dirty. This is part of a series of code modifications - * moving management of the is_dirty field of + * moving management of the is_dirty field of * H5C_cache_entry_t into the H5C code. * *------------------------------------------------------------------------- @@ -3059,7 +3059,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) { @@ -3091,7 +3091,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, \ @@ -3106,7 +3106,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, mark it as dirty (if it isn't already) and then re-insert. * * Update the replacement policy for a hit to avoid an eviction before @@ -3154,7 +3154,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. * @@ -3162,20 +3162,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 @@ -3190,17 +3190,17 @@ done: * Updated for the addition of the hash table. * * JRM -- 10/28/04 - * Added code to set cache_full to TRUE whenever we try to + * Added code to set cache_full to TRUE whenever we try to * make space in the cache. * * JRM -- 11/12/04 - * Added code to call to H5C_make_space_in_cache() after the - * call to H5C__auto_adjust_cache_size() if that function + * Added code to call to H5C_make_space_in_cache() after the + * call to H5C__auto_adjust_cache_size() if that function * sets the size_decreased flag is TRUE. * * JRM -- 4/25/05 - * The size_decreased flag can also be set to TRUE in - * H5C_set_cache_auto_resize_config() if a new configuration + * The size_decreased flag can also be set to TRUE in + * H5C_set_cache_auto_resize_config() if a new configuration * forces an immediate reduction in cache size. Modified * the code to deal with this eventuallity. * @@ -3208,13 +3208,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; @@ -3260,7 +3260,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 ) { size_t space_needed; @@ -3269,8 +3269,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 ) { @@ -3321,8 +3321,8 @@ H5C_protect(H5F_t * f, * no point in worrying about the third. */ - 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, &first_flush); @@ -3333,7 +3333,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) @@ -3375,8 +3375,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 ) { @@ -3414,17 +3414,17 @@ H5C_protect(H5F_t * f, if ( cache_ptr->size_decreased ) { cache_ptr->size_decreased = FALSE; - + /* check to see if the cache is now oversized due to the cache - * size reduction. If it is, try to evict enough entries to + * size reduction. If it is, try to evict enough entries to * bring the cache size down to the current maximum cache size. */ if ( cache_ptr->index_size > cache_ptr->max_cache_size ) { cache_ptr->cache_full = TRUE; - 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, (size_t)0, write_permitted, &first_flush); @@ -3486,7 +3486,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C_set_cache_auto_resize_config * - * Purpose: Set the cache automatic resize configuration to the + * Purpose: Set the cache automatic resize configuration to the * provided values if they are in range, and fail if they * are not. * @@ -3503,8 +3503,8 @@ done: * Modifications: * * JRM -- 11/18/04 - * Reworked function to match major changes in - * H5C_auto_size_ctl_t. + * Reworked function to match major changes in + * H5C_auto_size_ctl_t. * * JRM -- 4/25/05 * Added code to set cache_ptr->size_decreased to TRUE @@ -3515,7 +3515,7 @@ done: */ herr_t -H5C_set_cache_auto_resize_config(H5C_t * cache_ptr, +H5C_set_cache_auto_resize_config(H5C_t * cache_ptr, H5C_auto_size_ctl_t *config_ptr) { herr_t ret_value = SUCCEED; /* Return value */ @@ -3588,7 +3588,7 @@ H5C_set_cache_auto_resize_config(H5C_t * cache_ptr, ( config_ptr->max_increment <= 0 ) ) ) { cache_ptr->size_increase_possible = FALSE; - } + } break; default: /* should be unreachable */ @@ -3647,18 +3647,18 @@ H5C_set_cache_auto_resize_config(H5C_t * cache_ptr, cache_ptr->resize_ctl = *config_ptr; - /* Resize the cache to the supplied initial value if requested, or as - * necessary to force it within the bounds of the current automatic + /* Resize the cache to the supplied initial value if requested, or as + * necessary to force it within the bounds of the current automatic * cache resizing configuration. * - * Note that the min_clean_fraction may have changed, so we + * Note that the min_clean_fraction may have changed, so we * go through the exercise even if the current size is within * range and an initial size has not been provided. */ if ( (cache_ptr->resize_ctl).set_initial_size ) { - + new_max_cache_size = (cache_ptr->resize_ctl).initial_size; - } + } else if ( cache_ptr->max_cache_size > (cache_ptr->resize_ctl).max_size ) { new_max_cache_size = (cache_ptr->resize_ctl).max_size; @@ -3740,9 +3740,9 @@ done: * 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 @@ -3834,8 +3834,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") @@ -3858,7 +3858,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] ) @@ -3878,54 +3878,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) slist 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), @@ -3947,13 +3947,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, @@ -3986,7 +3986,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 ) ) { @@ -3997,36 +3997,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])); @@ -4107,7 +4107,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; @@ -4129,17 +4129,17 @@ H5C_stats__reset(H5C_t * cache_ptr) * 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 @@ -4148,7 +4148,7 @@ H5C_stats__reset(H5C_t * cache_ptr) * 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 @@ -4165,27 +4165,27 @@ H5C_stats__reset(H5C_t * cache_ptr) * * JRM -- 1/6/05 * Added the flags parameter, and code supporting - * H5C__SET_FLUSH_MARKER_FLAG. Note that this flag is - * ignored unless the new entry is dirty. Also note that - * once the flush_marker field of an entry is set, the + * H5C__SET_FLUSH_MARKER_FLAG. Note that this flag is + * ignored unless the new entry is dirty. Also note that + * once the flush_marker field of an entry is set, the * only way it can be reset is by being flushed. * * JRM -- 6/3/05 - * Added the dirtied parameter and supporting code. This + * Added the dirtied parameter and supporting code. This * is part of an effort to move management of the is_dirty - * field into the cache code. This has become necessary + * field into the cache code. This has become necessary * to repair a cache coherency bug in PHDF5. * *------------------------------------------------------------------------- */ 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, unsigned int flags) { hbool_t deleted; @@ -4224,7 +4224,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; /* if the entry is dirty, or its flush_marker with the set flush flag, * and then add it to the skip list if it isn't there already. @@ -4243,17 +4243,17 @@ 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 */ if ( deleted ) { /* the following first flush flag will never be used as we are - * calling H5C_flush_single_entry with both the - * H5C__FLUSH_CLEAR_ONLY_FLAG and H5C__FLUSH_INVALIDATE_FLAG flags. + * calling H5C_flush_single_entry with both the + * H5C__FLUSH_CLEAR_ONLY_FLAG and H5C__FLUSH_INVALIDATE_FLAG flags. * However, it is needed for the function call. */ hbool_t dummy_first_flush = TRUE; @@ -4273,15 +4273,15 @@ 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, - (H5C__FLUSH_CLEAR_ONLY_FLAG | + type, + addr, + (H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__FLUSH_INVALIDATE_FLAG), - &dummy_first_flush, + &dummy_first_flush, TRUE) < 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, "Can't flush.") @@ -4300,7 +4300,7 @@ done: /*------------------------------------------------------------------------- * Function: H5C_validate_resize_config() * - * Purpose: Run a sanity check on the specified sections of the + * Purpose: Run a sanity check on the specified sections of the * provided instance of struct H5C_auto_size_ctl_t. * * Do nothing and return SUCCEED if no errors are detected, @@ -4339,7 +4339,7 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, if ( (tests & H5C_RESIZE_CFG__VALIDATE_GENERAL) != 0 ) { - if ( ( config_ptr->set_initial_size != TRUE ) && + if ( ( config_ptr->set_initial_size != TRUE ) && ( config_ptr->set_initial_size != FALSE ) ) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ @@ -4362,14 +4362,14 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, } if ( ( config_ptr->set_initial_size ) && - ( ( config_ptr->initial_size < config_ptr->min_size ) || + ( ( config_ptr->initial_size < config_ptr->min_size ) || ( config_ptr->initial_size > config_ptr->max_size ) ) ) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ "initial_size must be in the interval [min_size, max_size]"); } - if ( ( config_ptr->min_clean_fraction < 0.0 ) || + if ( ( config_ptr->min_clean_fraction < 0.0 ) || ( config_ptr->min_clean_fraction > 1.0 ) ) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ @@ -4397,8 +4397,8 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, } if ( config_ptr->incr_mode == H5C_incr__threshold ) { - - if ( ( config_ptr->lower_hr_threshold < 0.0 ) || + + if ( ( config_ptr->lower_hr_threshold < 0.0 ) || ( config_ptr->lower_hr_threshold > 1.0 ) ) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ @@ -4445,7 +4445,7 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, "upper_hr_threshold must be <= 1.0"); } - if ( ( config_ptr->decrement > 1.0 ) || + if ( ( config_ptr->decrement > 1.0 ) || ( config_ptr->decrement < 0.0 ) ) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ @@ -4481,7 +4481,7 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, } if ( ( config_ptr->apply_empty_reserve ) && - ( ( config_ptr->empty_reserve > 1.0 ) || + ( ( config_ptr->empty_reserve > 1.0 ) || ( config_ptr->empty_reserve < 0.0 ) ) ) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ @@ -4495,12 +4495,12 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, if ( config_ptr->decr_mode == H5C_decr__age_out_with_threshold ) { - if ( ( config_ptr->upper_hr_threshold > 1.0 ) || + if ( ( config_ptr->upper_hr_threshold > 1.0 ) || ( config_ptr->upper_hr_threshold < 0.0 ) ) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, \ "upper_hr_threshold must be in the interval [0.0, 1.0]"); - } + } } /* H5C_decr__age_out_with_threshold */ } /* H5C_RESIZE_CFG__VALIDATE_DECREMENT */ @@ -4515,9 +4515,9 @@ H5C_validate_resize_config(H5C_auto_size_ctl_t * config_ptr, ( config_ptr->decr_mode == H5C_decr__age_out_with_threshold ) ) && - ( config_ptr->lower_hr_threshold - >= - config_ptr->upper_hr_threshold + ( config_ptr->lower_hr_threshold + >= + config_ptr->upper_hr_threshold ) ) { @@ -4541,15 +4541,15 @@ done: * * Function: H5C__auto_adjust_cache_size * - * Purpose: Obtain the current full cache hit rate, and compare it - * with the hit rate thresholds for modifying cache size. - * If one of the thresholds has been crossed, adjusts the + * Purpose: Obtain the current full cache hit rate, and compare it + * with the hit rate thresholds for modifying cache size. + * If one of the thresholds has been crossed, adjusts the * size of the cache accordingly. * - * The function then resets the full cache hit rate + * The function then resets the full cache hit rate * statistics, and exits. * - * 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. * * @@ -4559,7 +4559,7 @@ done: * * JRM -- 11/18/04 * Major re-write to support ageout method of cache size - * reduction, and to adjust to changes in the + * reduction, and to adjust to changes in the * H5C_auto_size_ctl_t structure. * *------------------------------------------------------------------------- @@ -4587,7 +4587,7 @@ H5C__auto_adjust_cache_size(H5C_t * cache_ptr, HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - HDassert( cache_ptr->cache_accesses >= + HDassert( cache_ptr->cache_accesses >= (cache_ptr->resize_ctl).epoch_length ); HDassert( 0.0 <= (cache_ptr->resize_ctl).min_clean_fraction ); HDassert( (cache_ptr->resize_ctl).min_clean_fraction <= 100.0 ); @@ -4623,8 +4623,8 @@ H5C__auto_adjust_cache_size(H5C_t * cache_ptr, if ( ! cache_ptr->size_increase_possible ) { status = increase_disabled; - - } else if ( cache_ptr->max_cache_size >= + + } else if ( cache_ptr->max_cache_size >= (cache_ptr->resize_ctl).max_size ) { HDassert( cache_ptr->max_cache_size == \ @@ -4642,7 +4642,7 @@ H5C__auto_adjust_cache_size(H5C_t * cache_ptr, (cache_ptr->resize_ctl).increment); /* clip to max size if necessary */ - if ( new_max_cache_size > + if ( new_max_cache_size > (cache_ptr->resize_ctl).max_size ) { new_max_cache_size = (cache_ptr->resize_ctl).max_size; @@ -4650,7 +4650,7 @@ H5C__auto_adjust_cache_size(H5C_t * cache_ptr, /* clip to max increment if necessary */ if ( ( (cache_ptr->resize_ctl).apply_max_increment ) && - ( (cache_ptr->max_cache_size + + ( (cache_ptr->max_cache_size + (cache_ptr->resize_ctl).max_increment) < new_max_cache_size ) ) { @@ -4667,28 +4667,28 @@ H5C__auto_adjust_cache_size(H5C_t * cache_ptr, HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "unknown incr_mode.") } - /* If the decr_mode is either age out or age out with threshold, we + /* If the decr_mode is either age out or age out with threshold, we * must run the marker maintenance code, whether we run the size - * reduction code or not. We do this in two places -- here we + * reduction code or not. We do this in two places -- here we * insert a new marker if the number of active epoch markers is * is less than the the current epochs before eviction, and after * the ageout call, we cycle the markers. * * However, we can't call the ageout code or cycle the markers - * unless there was a full complement of markers in place on + * unless there was a full complement of markers in place on * entry. The inserted_epoch_marker flag is used to track this. */ - if ( ( ( (cache_ptr->resize_ctl).decr_mode == H5C_decr__age_out ) + if ( ( ( (cache_ptr->resize_ctl).decr_mode == H5C_decr__age_out ) || - ( (cache_ptr->resize_ctl).decr_mode == + ( (cache_ptr->resize_ctl).decr_mode == H5C_decr__age_out_with_threshold ) ) && - ( cache_ptr->epoch_markers_active < - (cache_ptr->resize_ctl).epochs_before_eviction - ) + ( cache_ptr->epoch_markers_active < + (cache_ptr->resize_ctl).epochs_before_eviction + ) ) { result = H5C__autoadjust__ageout__insert_new_marker(cache_ptr); @@ -4722,8 +4722,8 @@ H5C__auto_adjust_cache_size(H5C_t * cache_ptr, if ( ! cache_ptr->size_decrease_possible ) { status = decrease_disabled; - - } else if ( cache_ptr->max_cache_size <= + + } else if ( cache_ptr->max_cache_size <= (cache_ptr->resize_ctl).min_size ) { HDassert( cache_ptr->max_cache_size == @@ -4737,20 +4737,20 @@ H5C__auto_adjust_cache_size(H5C_t * cache_ptr, (cache_ptr->resize_ctl).decrement); /* clip to min size if necessary */ - if ( new_max_cache_size < + if ( new_max_cache_size < (cache_ptr->resize_ctl).min_size ) { - new_max_cache_size = + new_max_cache_size = (cache_ptr->resize_ctl).min_size; } /* clip to max decrement if necessary */ if ( ( (cache_ptr->resize_ctl).apply_max_decrement ) && ( ((cache_ptr->resize_ctl).max_decrement + - new_max_cache_size) < + new_max_cache_size) < cache_ptr->max_cache_size ) ) { - new_max_cache_size = cache_ptr->max_cache_size - + new_max_cache_size = cache_ptr->max_cache_size - (cache_ptr->resize_ctl).max_decrement; } @@ -4794,9 +4794,9 @@ H5C__auto_adjust_cache_size(H5C_t * cache_ptr, } /* cycle the epoch markers here if appropriate */ - if ( ( ( (cache_ptr->resize_ctl).decr_mode == H5C_decr__age_out ) + if ( ( ( (cache_ptr->resize_ctl).decr_mode == H5C_decr__age_out ) || - ( (cache_ptr->resize_ctl).decr_mode == + ( (cache_ptr->resize_ctl).decr_mode == H5C_decr__age_out_with_threshold ) ) @@ -4820,7 +4820,7 @@ H5C__auto_adjust_cache_size(H5C_t * cache_ptr, old_min_clean_size = cache_ptr->min_clean_size; new_min_clean_size = (size_t) - ((double)new_max_cache_size * + ((double)new_max_cache_size * ((cache_ptr->resize_ctl).min_clean_fraction)); /* new_min_clean_size is of size_t, and thus must be non-negative. @@ -4878,11 +4878,11 @@ done: * * Function: H5C__autoadjust__ageout * - * Purpose: Implement the ageout automatic cache size decrement + * Purpose: Implement the ageout automatic cache size decrement * algorithm. Note that while this code evicts aged out * entries, the code does not change the maximum cache size. * Instead, the function simply computes the new value (if - * any change is indicated) and reports this value in + * any change is indicated) and reports this value in * *new_max_cache_size_ptr. * * Return: Non-negative on success/Negative on failure or if there was @@ -4933,10 +4933,10 @@ H5C__autoadjust__ageout(H5C_t * cache_ptr, } } - if ( ( (cache_ptr->resize_ctl).decr_mode == H5C_decr__age_out ) + if ( ( (cache_ptr->resize_ctl).decr_mode == H5C_decr__age_out ) || - ( ( (cache_ptr->resize_ctl).decr_mode == - H5C_decr__age_out_with_threshold + ( ( (cache_ptr->resize_ctl).decr_mode == + H5C_decr__age_out_with_threshold ) && ( hit_rate >= (cache_ptr->resize_ctl).upper_hr_threshold ) @@ -4987,17 +4987,17 @@ H5C__autoadjust__ageout(H5C_t * cache_ptr, if ( *new_max_cache_size_ptr < (cache_ptr->resize_ctl).min_size ) { - *new_max_cache_size_ptr = + *new_max_cache_size_ptr = (cache_ptr->resize_ctl).min_size; } /* clip to max decrement if necessary */ if ( ( (cache_ptr->resize_ctl).apply_max_decrement ) && ( ((cache_ptr->resize_ctl).max_decrement + - *new_max_cache_size_ptr) < + *new_max_cache_size_ptr) < cache_ptr->max_cache_size ) ) { - *new_max_cache_size_ptr = cache_ptr->max_cache_size - + *new_max_cache_size_ptr = cache_ptr->max_cache_size - (cache_ptr->resize_ctl).max_decrement; } } @@ -5047,7 +5047,7 @@ H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t * cache_ptr) HDassert( cache_ptr ); HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); - if ( cache_ptr->epoch_markers_active <= 0 ) { + if ( cache_ptr->epoch_markers_active <= 0 ) { HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ "No active epoch markers on entry?!?!?.") @@ -5057,8 +5057,8 @@ H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t * cache_ptr) i = cache_ptr->epoch_marker_ringbuf[cache_ptr->epoch_marker_ringbuf_first]; - cache_ptr->epoch_marker_ringbuf_first = - (cache_ptr->epoch_marker_ringbuf_first + 1) % + cache_ptr->epoch_marker_ringbuf_first = + (cache_ptr->epoch_marker_ringbuf_first + 1) % (H5C__MAX_EPOCH_MARKERS + 1); cache_ptr->epoch_marker_ringbuf_size -= 1; @@ -5082,14 +5082,14 @@ H5C__autoadjust__ageout__cycle_epoch_marker(H5C_t * cache_ptr) /* now, re-insert it at the head of the LRU list, and at the tail of * the ring buffer. - */ + */ HDassert( ((cache_ptr->epoch_markers)[i]).addr == (haddr_t)i ); HDassert( ((cache_ptr->epoch_markers)[i]).next == NULL ); HDassert( ((cache_ptr->epoch_markers)[i]).prev == NULL ); - cache_ptr->epoch_marker_ringbuf_last = - (cache_ptr->epoch_marker_ringbuf_last + 1) % + cache_ptr->epoch_marker_ringbuf_last = + (cache_ptr->epoch_marker_ringbuf_last + 1) % (H5C__MAX_EPOCH_MARKERS + 1); (cache_ptr->epoch_marker_ringbuf)[cache_ptr->epoch_marker_ringbuf_last] = i; @@ -5119,26 +5119,26 @@ done: * Function: H5C__autoadjust__ageout__evict_aged_out_entries * * Purpose: Evict clean entries in the cache that haven't - * been accessed for at least + * been accessed for at least * (cache_ptr->resize_ctl).epochs_before_eviction epochs, * and flush dirty entries that haven't been accessed for * that amount of time. * - * Depending on configuration, the function will either + * Depending on configuration, the function will either * flush or evict all such entries, or all such entries it * encounters until it has freed the maximum amount of space * allowed under the maximum decrement. * * If we are running in parallel mode, writes may not be - * permitted. If so, the function simply skips any dirty + * permitted. If so, the function simply skips any dirty * entries it may encounter. * - * The function makes no attempt to maintain the minimum + * The function makes no attempt to maintain the minimum * clean size, as there is no guarantee that the cache size - * will be changed. + * will be changed. * - * If there is no cache size change, the minimum clean size - * constraint will be met through a combination of clean + * If there is no cache size change, the minimum clean size + * constraint will be met through a combination of clean * entries and free space in the cache. * * If there is a cache size reduction, the minimum clean size @@ -5146,13 +5146,13 @@ done: * we have to make space in the cache. * * The primary_dxpl_id and secondary_dxpl_id parameters - * specify the dxpl_ids used depending on the value of + * specify the dxpl_ids used depending on the value of * *first_flush_ptr. The idea is to use the primary_dxpl_id * on the first write in a sequence of writes, and to use * the secondary_dxpl_id on all subsequent writes. * - * This is useful in the metadata cache, but may not be - * needed elsewhere. If so, just use the same dxpl_id for + * 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. @@ -5189,7 +5189,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC ); /* if there is a limit on the amount that the cache size can be decrease - * in any one round of the cache size reduction algorithm, load that + * in any one round of the cache size reduction algorithm, load that * limit into eviction_size_limit. Otherwise, set eviction_size_limit * to the equivalent of infinity. The current size of the index will * do nicely. @@ -5252,7 +5252,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, } /* end while */ /* for now at least, don't bother to maintain the minimum clean size, - * as the cache should now be less than its maximum size. Due to + * as the cache should now be less than its maximum size. Due to * the vaguries of the cache size reduction algorthim, we may not * reduce the size of the cache. * @@ -5261,7 +5261,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, * * If we don't, no action is necessary, as we have just evicted and/or * or flushed a bunch of entries and therefore the sum of the clean - * and free space in the cache must be greater than or equal to the + * and free space in the cache must be greater than or equal to the * min clean space requirement (assuming that requirement was met on * entry). */ @@ -5269,16 +5269,16 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, } else /* ! write_permitted */ { /* since we are not allowed to write, all we can do is evict - * any clean entries that we may encounter before we either + * any clean entries that we may encounter before we either * hit the eviction size limit, or encounter the epoch marker. * * If we are operating read only, this isn't an issue, as there * will not be any dirty entries. * - * If we are operating in R/W mode, all the dirty entries we + * If we are operating in R/W mode, all the dirty entries we * skip will be flushed the next time we attempt to make space - * when writes are permitted. This may have some local - * performance implications, but it shouldn't cause any net + * when writes are permitted. This may have some local + * performance implications, but it shouldn't cause any net * slowdown. */ @@ -5312,7 +5312,7 @@ H5C__autoadjust__ageout__evict_aged_out_entries(H5F_t * f, "unable to flush clean entry") } } - /* just skip the entry if it is dirty, as we can't do + /* just skip the entry if it is dirty, as we can't do * anything with it now since we can't write. */ @@ -5337,8 +5337,8 @@ done: * * Function: H5C__autoadjust__ageout__insert_new_marker * - * Purpose: Find an unused marker cache entry, mark it as used, and - * insert it at the head of the LRU list. Also add the + * Purpose: Find an unused marker cache entry, mark it as used, and + * insert it at the head of the LRU list. Also add the * marker's index in the epoch_markers array. * * Return: SUCCEED on success/FAIL on failure. @@ -5372,8 +5372,8 @@ H5C__autoadjust__ageout__insert_new_marker(H5C_t * cache_ptr) /* find an unused marker */ i = 0; - while ( ( (cache_ptr->epoch_marker_active)[i] ) && - ( i < H5C__MAX_EPOCH_MARKERS ) ) + while ( ( (cache_ptr->epoch_marker_active)[i] ) && + ( i < H5C__MAX_EPOCH_MARKERS ) ) { i++; } @@ -5391,8 +5391,8 @@ H5C__autoadjust__ageout__insert_new_marker(H5C_t * cache_ptr) (cache_ptr->epoch_marker_active)[i] = TRUE; - cache_ptr->epoch_marker_ringbuf_last = - (cache_ptr->epoch_marker_ringbuf_last + 1) % + cache_ptr->epoch_marker_ringbuf_last = + (cache_ptr->epoch_marker_ringbuf_last + 1) % (H5C__MAX_EPOCH_MARKERS + 1); (cache_ptr->epoch_marker_ringbuf)[cache_ptr->epoch_marker_ringbuf_last] = i; @@ -5424,7 +5424,7 @@ done: * * Function: H5C__autoadjust__ageout__remove_all_markers * - * Purpose: Remove all epoch markers from the LRU list and mark them + * Purpose: Remove all epoch markers from the LRU list and mark them * as inactive. * * Return: SUCCEED on success/FAIL on failure. @@ -5452,15 +5452,15 @@ H5C__autoadjust__ageout__remove_all_markers(H5C_t * cache_ptr) while ( cache_ptr->epoch_markers_active > 0 ) { - /* get the index of the last epoch marker in the LRU list + /* get the index of the last epoch marker in the LRU list * and remove it from the ring buffer. */ ring_buf_index = cache_ptr->epoch_marker_ringbuf_first; i = (cache_ptr->epoch_marker_ringbuf)[ring_buf_index]; - cache_ptr->epoch_marker_ringbuf_first = - (cache_ptr->epoch_marker_ringbuf_first + 1) % + cache_ptr->epoch_marker_ringbuf_first = + (cache_ptr->epoch_marker_ringbuf_first + 1) % (H5C__MAX_EPOCH_MARKERS + 1); cache_ptr->epoch_marker_ringbuf_size -= 1; @@ -5508,9 +5508,9 @@ done: * * Function: H5C__autoadjust__ageout__remove_excess_markers * - * Purpose: Remove epoch markers from the end of the LRU list and + * Purpose: Remove epoch markers from the end of the LRU list and * mark them as inactive until the number of active markers - * equals the the current value of + * equals the the current value of * (cache_ptr->resize_ctl).epochs_before_eviction. * * Return: SUCCEED on success/FAIL on failure. @@ -5542,18 +5542,18 @@ H5C__autoadjust__ageout__remove_excess_markers(H5C_t * cache_ptr) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, "no excess markers on entry.") } - while ( cache_ptr->epoch_markers_active > + while ( cache_ptr->epoch_markers_active > (cache_ptr->resize_ctl).epochs_before_eviction ) { - /* get the index of the last epoch marker in the LRU list + /* get the index of the last epoch marker in the LRU list * and remove it from the ring buffer. */ ring_buf_index = cache_ptr->epoch_marker_ringbuf_first; i = (cache_ptr->epoch_marker_ringbuf)[ring_buf_index]; - cache_ptr->epoch_marker_ringbuf_first = - (cache_ptr->epoch_marker_ringbuf_first + 1) % + cache_ptr->epoch_marker_ringbuf_first = + (cache_ptr->epoch_marker_ringbuf_first + 1) % (H5C__MAX_EPOCH_MARKERS + 1); cache_ptr->epoch_marker_ringbuf_size -= 1; @@ -5601,24 +5601,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 H5C__FLUSH_INVALIDATE_FLAG flag is set, the entry will @@ -5626,17 +5626,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 @@ -5652,19 +5652,19 @@ done: * JRM -- 1/6/05 * Updated function to reset the flush_marker field. * Also replace references to H5F_FLUSH_INVALIDATE and - * H5F_FLUSH_CLEAR_ONLY with references to + * H5F_FLUSH_CLEAR_ONLY with references to * H5C__FLUSH_INVALIDATE_FLAG and H5C__FLUSH_CLEAR_ONLY_FLAG * respectively. * *------------------------------------------------------------------------- */ 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) @@ -5684,7 +5684,7 @@ H5C_flush_single_entry(H5F_t * f, HDassert( first_flush_ptr ); destroy = ( (flags & H5C__FLUSH_INVALIDATE_FLAG) != 0 ); - clear_only = ( (flags & H5C__FLUSH_CLEAR_ONLY_FLAG) != 0); + clear_only = ( (flags & H5C__FLUSH_CLEAR_ONLY_FLAG) != 0); /* attempt to find the target entry in the hash table */ H5C__SEARCH_INDEX(cache_ptr, addr, entry_ptr, FAIL) @@ -5702,7 +5702,7 @@ H5C_flush_single_entry(H5F_t * f, } } else { - if ( ( entry_ptr->is_dirty ) || + if ( ( entry_ptr->is_dirty ) || ( entry_ptr->flush_marker ) || ( entry_ptr->addr != addr ) ) { @@ -5711,12 +5711,12 @@ H5C_flush_single_entry(H5F_t * f, } } } -#if 0 +#if 0 /* this should be useful for debugging from time to time. * lets leave it in for now. -- JRM 12/15/04 */ else { - HDfprintf(stdout, + HDfprintf(stdout, "H5C_flush_single_entry(): non-existant entry. addr = %a\n", addr); HDfflush(stdout); @@ -5737,12 +5737,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 @@ -5750,9 +5750,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 */ @@ -5791,19 +5791,19 @@ 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 - * 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 + /* 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 ) { H5C__DELETE_FROM_INDEX(cache_ptr, entry_ptr) - if ( ( entry_ptr->in_slist ) && + if ( ( entry_ptr->in_slist ) && ( del_entry_from_slist_on_destroy ) ) { H5C__REMOVE_ENTRY_FROM_SLIST(cache_ptr, entry_ptr) @@ -5811,7 +5811,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 */ @@ -5837,21 +5837,21 @@ H5C_flush_single_entry(H5F_t * f, HDfprintf(stdout, "cache_ptr->dLRU_list_size < entry_ptr->size.\n"); - if ( ( (cache_ptr->dLRU_list_size) == entry_ptr->size ) && + if ( ( (cache_ptr->dLRU_list_size) == entry_ptr->size ) && ( ! ( (cache_ptr->dLRU_list_len) == 1 ) ) ) HDfprintf(stdout, "dLRU_list_size == size && dLRU_list_len != 1\n"); - if ( ( entry_ptr->aux_prev == NULL ) && + if ( ( entry_ptr->aux_prev == NULL ) && ( cache_ptr->dLRU_head_ptr != entry_ptr ) ) HDfprintf(stdout, "entry_ptr->aux_prev == NULL && dLRU_head_ptr != entry_ptr\n"); - if ( ( entry_ptr->aux_next == NULL ) && + if ( ( entry_ptr->aux_next == NULL ) && ( cache_ptr->dLRU_tail_ptr != entry_ptr ) ) HDfprintf(stdout, "entry_ptr->aux_next == NULL && dLRU_tail_ptr != entry_ptr\n"); if ( ( cache_ptr->dLRU_list_len == 1 ) && - ( ! ( ( cache_ptr->dLRU_head_ptr == entry_ptr ) && + ( ! ( ( cache_ptr->dLRU_head_ptr == entry_ptr ) && ( cache_ptr->dLRU_tail_ptr == entry_ptr ) && ( entry_ptr->aux_next == NULL ) && ( entry_ptr->aux_prev == NULL ) && @@ -5863,8 +5863,8 @@ H5C_flush_single_entry(H5F_t * f, HDfprintf(stdout, "single entry dlru sanity check fails\n"); } - } - else + } + else { if ( cache_ptr->cLRU_head_ptr == NULL ) HDfprintf(stdout,"cache_ptr->cLRU_head_ptr == NULL.\n"); @@ -5882,21 +5882,21 @@ H5C_flush_single_entry(H5F_t * f, HDfprintf(stdout, "cache_ptr->cLRU_list_size < entry_ptr->size.\n"); - if ( ( (cache_ptr->cLRU_list_size) == entry_ptr->size ) && + if ( ( (cache_ptr->cLRU_list_size) == entry_ptr->size ) && ( ! ( (cache_ptr->cLRU_list_len) == 1 ) ) ) HDfprintf(stdout, "cLRU_list_size == size && cLRU_list_len != 1\n"); - if ( ( entry_ptr->aux_prev == NULL ) && + if ( ( entry_ptr->aux_prev == NULL ) && ( cache_ptr->cLRU_head_ptr != entry_ptr ) ) HDfprintf(stdout, "entry_ptr->aux_prev == NULL && cLRU_head_ptr != entry_ptr\n"); - if ( ( entry_ptr->aux_next == NULL ) && + if ( ( entry_ptr->aux_next == NULL ) && ( cache_ptr->cLRU_tail_ptr != entry_ptr ) ) HDfprintf(stdout, "entry_ptr->aux_next == NULL && cLRU_tail_ptr != entry_ptr\n"); if ( ( cache_ptr->cLRU_list_len == 1 ) && - ( ! ( ( cache_ptr->cLRU_head_ptr == entry_ptr ) && + ( ! ( ( cache_ptr->cLRU_head_ptr == entry_ptr ) && ( cache_ptr->cLRU_tail_ptr == entry_ptr ) && ( entry_ptr->aux_next == NULL ) && ( entry_ptr->aux_prev == NULL ) && @@ -5928,19 +5928,19 @@ 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); } @@ -5952,7 +5952,7 @@ H5C_flush_single_entry(H5F_t * f, } if ( ! destroy ) { - + HDassert( !(entry_ptr->is_dirty) ); HDassert( !(entry_ptr->flush_marker) ); } @@ -5974,7 +5974,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. @@ -5990,11 +5990,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) { @@ -6031,7 +6031,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; @@ -6060,24 +6060,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. @@ -6093,7 +6093,7 @@ done: * table to facilitate lookups. * * JRM -- 11/22/04 - * Added the first_flush_ptr parameter, which replaces the + * Added the first_flush_ptr parameter, which replaces the * old first_flush local variable. This allows the function * to coordinate on the first flush issue with other functions. * @@ -6131,8 +6131,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 ) && @@ -6149,25 +6149,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, - H5C__NO_FLAGS_SET, - first_flush_ptr, + entry_ptr->type, + entry_ptr->addr, + H5C__NO_FLAGS_SET, + first_flush_ptr, 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, H5C__FLUSH_INVALIDATE_FLAG, - first_flush_ptr, + first_flush_ptr, TRUE); } } else { @@ -6203,14 +6203,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, - H5C__NO_FLAGS_SET, - first_flush_ptr, + entry_ptr->type, + entry_ptr->addr, + H5C__NO_FLAGS_SET, + first_flush_ptr, FALSE); if ( result < 0 ) { @@ -6231,12 +6231,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 ) ) @@ -6246,14 +6246,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, H5C__FLUSH_INVALIDATE_FLAG, - first_flush_ptr, + first_flush_ptr, TRUE); if ( result < 0 ) { diff --git a/src/H5CS.c b/src/H5CS.c index 58817b8..63928dd 100644 --- a/src/H5CS.c +++ b/src/H5CS.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/H5Cpkg.h b/src/H5Cpkg.h index 2ab2e9b..54a8f48 100644 --- a/src/H5Cpkg.h +++ b/src/H5Cpkg.h @@ -16,14 +16,14 @@ * Programmer: John Mainzer -- 10/12/04 * * Purpose: This file contains declarations which are normally visible - * only within the H5C package (just H5C.c at present). + * only within the H5C package (just H5C.c at present). * - * Source files outside the H5C package should include + * Source files outside the H5C package should include * H5Cprivate.h instead. * * The one exception to this rule is test/cache.c. The test - * code is easier to write if it can look at the cache's - * internal data structures. Indeed, this is the main + * code is easier to write if it can look at the cache's + * internal data structures. Indeed, this is the main * reason why this file was created. */ @@ -50,27 +50,27 @@ * * 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. * @@ -83,12 +83,12 @@ * 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. @@ -103,11 +103,11 @@ * 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. @@ -116,11 +116,11 @@ * 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. @@ -132,7 +132,7 @@ * 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 @@ -146,16 +146,16 @@ * * 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. * @@ -330,7 +330,7 @@ * Automatic cache size adjustment: * * While the default cache size is adequate for most cases, we can run into - * cases where the default is too small. Ideally, we will let the user + * cases where the default is too small. Ideally, we will let the user * adjust the cache size as required. However, this is not possible in all * cases. Thus I have added automatic cache size adjustment code. * @@ -349,25 +349,25 @@ * all the ways this can happen, we simply set this flag when * we receive a new configuration. * - * cache_full: Boolean flag used to keep track of whether the cache is - * full, so we can refrain from increasing the size of a + * cache_full: Boolean flag used to keep track of whether the cache is + * full, so we can refrain from increasing the size of a * cache which hasn't used up the space alotted to it. * * The field is initialized to FALSE, and then set to TRUE * whenever we attempt to make space in the cache. * * resize_enabled: This is another convenience flag which is set whenever - * a new set of values for resize_ctl are provided. Very - * simply, + * a new set of values for resize_ctl are provided. Very + * simply, * - * resize_enabled = size_increase_possible || + * resize_enabled = size_increase_possible || * size_decrease_possible; * - * size_decreased: Boolean flag set to TRUE whenever the maximun cache - * size is decreased. The flag triggers a call to + * size_decreased: Boolean flag set to TRUE whenever the maximun cache + * size is decreased. The flag triggers a call to * H5C_make_space_in_cache() on the next call to H5C_protect(). * - * resize_ctl: Instance of H5C_auto_size_ctl_t containing configuration + * resize_ctl: Instance of H5C_auto_size_ctl_t containing configuration * data for automatic cache resizing. * * epoch_markers_active: Integer field containing the number of epoch @@ -381,37 +381,37 @@ * epoch_marker_ringbuf: Array of int of length H5C__MAX_EPOCH_MARKERS + 1. * * To manage the epoch marker cache entries, it is necessary - * to track their order in the LRU list. This is done with - * epoch_marker_ringbuf. When markers are inserted at the - * head of the LRU list, the index of the marker in the + * to track their order in the LRU list. This is done with + * epoch_marker_ringbuf. When markers are inserted at the + * head of the LRU list, the index of the marker in the * epoch_markers array is inserted at the tail of the ring * buffer. When it becomes the epoch_marker_active'th marker * in the LRU list, it will have worked its way to the head - * of the ring buffer as well. This allows us to remove it + * of the ring buffer as well. This allows us to remove it * without scanning the LRU list if such is required. * * epoch_marker_ringbuf_first: Integer field containing the index of the * first entry in the ring buffer. * - * epoch_marker_ringbuf_last: Integer field containing the index of the + * epoch_marker_ringbuf_last: Integer field containing the index of the * last entry in the ring buffer. * * epoch_marker_ringbuf_size: Integer field containing the number of entries * in the ring buffer. - * + * * epoch_markers: Array of instances of H5C_cache_entry_t of length * H5C__MAX_EPOCH_MARKERS. The entries are used as markers * in the LRU list to identify cache entries that haven't - * been accessed for some (small) specified number of - * epochs. These entries (if any) can then be evicted and + * been accessed for some (small) specified number of + * epochs. These entries (if any) can then be evicted and * the cache size reduced -- ideally without evicting any * of the current working set. Needless to say, the epoch * length and the number of epochs before an unused entry * must be chosen so that all, or almost all, the working * set will be accessed before the limit. * - * Epoch markers only appear in the LRU list, never in - * the index or slist. While they are of type + * Epoch markers only appear in the LRU list, never in + * the index or slist. While they are of type * H5C__EPOCH_MARKER_TYPE, and have associated class * functions, these functions should never be called. * @@ -419,7 +419,7 @@ * are set to the index of the instance in the epoch_markers * array, the size is set to 0, and the type field points * to the constant structure epoch_marker_class defined - * in H5C.c. The next and prev fields are used as usual + * in H5C.c. The next and prev fields are used as usual * to link the entry into the LRU list. * * All other fields are unused. @@ -427,18 +427,18 @@ * * Cache hit rate collection fields: * - * We supply the current cache hit rate on request, so we must keep a - * simple cache hit rate computation regardless of whether statistics + * We supply the current cache hit rate on request, so we must keep a + * simple cache hit rate computation regardless of whether statistics * collection is enabled. The following fields support this capability. * - * cache_hits: Number of cache hits since the last time the cache hit - * rate statistics were reset. Note that when automatic cache - * re-sizing is enabled, this field will be reset every automatic + * cache_hits: Number of cache hits since the last time the cache hit + * rate statistics were reset. Note that when automatic cache + * re-sizing is enabled, this field will be reset every automatic * resize epoch. * * cache_accesses: Number of times the cache has been accessed while - * since the last since the last time the cache hit rate statistics - * were reset. Note that when automatic cache re-sizing is enabled, + * since the last since the last time the cache hit rate statistics + * were reset. Note that when automatic cache re-sizing is enabled, * this field will be reset every automatic resize epoch. * * @@ -448,39 +448,39 @@ * 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 + 1. 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 + 1. 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 + 1. 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 + 1. 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 + 1. 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 + 1. 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 + 1. 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 + 1. 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 + 1. 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 + 1. 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 + 1. 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 + 1. 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 + 1. 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 + 1. 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 @@ -489,10 +489,10 @@ * 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. * @@ -500,7 +500,7 @@ * 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 @@ -524,28 +524,28 @@ * 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 + 1. 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 + 1. 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 + 1. 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 + 1. 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 + 1. 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 + 1. 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 + 1. 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 + 1. 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 + 1. 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. * @@ -563,9 +563,9 @@ * 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 diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h index ed3f394..7c0151b 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 @@ -114,23 +114,23 @@ typedef struct H5C_t H5C_t; * 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 { @@ -153,8 +153,8 @@ typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f, * out of a hat -- you should be able to change them as necessary. * * However, if you need a very big cache, you should also increase the - * size of the hash table (H5C__HASH_TABLE_LEN in H5Cpkg.h). The current - * upper bound on cache size is rather large for the current hash table + * size of the hash table (H5C__HASH_TABLE_LEN in H5Cpkg.h). The current + * upper bound on cache size is rather large for the current hash table * size. */ @@ -174,11 +174,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. @@ -212,12 +212,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 @@ -235,7 +235,7 @@ typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f, * being flushed. * * flush_marker: Boolean flag indicating that the entry is to be flushed - * the next time H5C_flush_cache() is called with the + * the next time H5C_flush_cache() is called with the * H5AC__FLUSH_MARKED_ENTRIES_FLAG. The flag is reset when * the entry is flushed for whatever reason. * @@ -248,63 +248,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 H5Cpkg.h 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. @@ -312,7 +312,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. @@ -322,7 +322,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. @@ -331,8 +331,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 @@ -367,7 +367,7 @@ typedef struct H5C_cache_entry_t #endif /* H5C_COLLECT_CACHE_ENTRY_STATS */ -} H5C_cache_entry_t; +} H5C_cache_entry_t; /**************************************************************************** @@ -375,13 +375,13 @@ typedef struct H5C_cache_entry_t * structure H5C_auto_size_ctl_t * * Instances of H5C_auto_size_ctl_t are used to get and set the control - * fields for automatic cache re-sizing. + * fields for automatic cache re-sizing. * * The fields of the structure are discussed individually below: * - * version: Integer field containing the version number of this version - * of the H5C_auto_size_ctl_t structure. Any instance of - * H5C_auto_size_ctl_t passed to the cache must have a known + * version: Integer field containing the version number of this version + * of the H5C_auto_size_ctl_t structure. Any instance of + * H5C_auto_size_ctl_t passed to the cache must have a known * version number, or an error will be flagged. * * report_fcn: Pointer to the function that is to be called to report @@ -391,9 +391,9 @@ typedef struct H5C_cache_entry_t * If the field is not NULL, it must contain the address of a function * of type H5C_auto_resize_report_fcn. * - * set_initial_size: Boolean flag indicating whether the size of the - * initial size of the cache is to be set to the value given in - * the initial_size field. If set_initial_size is FALSE, the + * set_initial_size: Boolean flag indicating whether the size of the + * initial size of the cache is to be set to the value given in + * the initial_size field. If set_initial_size is FALSE, the * initial_size field is ignored. * * initial_size: If enabled, this field contain the size the cache is @@ -404,21 +404,21 @@ typedef struct H5C_cache_entry_t * of the cache that is to be kept clean. This field is only used * in parallel mode. Typical values are 0.1 to 0.5. * - * max_size: Maximum size to which the cache can be adjusted. The + * max_size: Maximum size to which the cache can be adjusted. The * supplied value must fall in the closed interval - * [MIN_MAX_CACHE_SIZE, MAX_MAX_CACHE_SIZE]. Also, max_size must + * [MIN_MAX_CACHE_SIZE, MAX_MAX_CACHE_SIZE]. Also, max_size must * be greater than or equal to min_size. * * min_size: Minimum size to which the cache can be adjusted. The * supplied value must fall in the closed interval - * [MIN_MAX_CACHE_SIZE, MAX_MAX_CACHE_SIZE]. Also, min_size must + * [MIN_MAX_CACHE_SIZE, MAX_MAX_CACHE_SIZE]. Also, min_size must * be less than or equal to max_size. * * epoch_length: Number of accesses on the cache over which to collect * hit rate stats before running the automatic cache resize code, - * if it is enabled. - * - * At the end of an epoch, we discard prior hit rate data and start + * if it is enabled. + * + * At the end of an epoch, we discard prior hit rate data and start * collecting afresh. The epoch_length must lie in the closed * interval [H5C__MIN_AR_EPOCH_LENGTH, H5C__MAX_AR_EPOCH_LENGTH]. * @@ -429,15 +429,15 @@ typedef struct H5C_cache_entry_t * value indicates how we determine whether the cache size should be * increased. At present there are two possible values: * - * H5C_incr__off: Don't attempt to increase the size of the cache + * H5C_incr__off: Don't attempt to increase the size of the cache * automatically. * * When this increment mode is selected, the remaining fields * in the cache size increase section ar ignored. * - * H5C_incr__threshold: Attempt to increase the size of the cache - * whenever the average hit rate over the last epoch drops - * below the value supplied in the lower_hr_threshold + * H5C_incr__threshold: Attempt to increase the size of the cache + * whenever the average hit rate over the last epoch drops + * below the value supplied in the lower_hr_threshold * field. * * Note that this attempt will fail if the cache is already @@ -445,9 +445,9 @@ typedef struct H5C_cache_entry_t * all available space. * * lower_hr_threshold: Lower hit rate threshold. If the increment mode - * (incr_mode) is H5C_incr__threshold and the hit rate drops below the - * value supplied in this field in an epoch, increment the cache size by - * size_increment. Note that cache size may not be incremented above + * (incr_mode) is H5C_incr__threshold and the hit rate drops below the + * value supplied in this field in an epoch, increment the cache size by + * size_increment. Note that cache size may not be incremented above * max_size, and that the increment may be further restricted by the * max_increment field if it is enabled. * @@ -460,73 +460,73 @@ typedef struct H5C_cache_entry_t * The increment must be greater than 1.0, and should not exceed 2.0. * * The new cache size is obtained by multiplying the current max cache - * size by the increment, and then clamping to max_size and to stay + * size by the increment, and then clamping to max_size and to stay * within the max_increment as necessary. * * apply_max_increment: Boolean flag indicating whether the max_increment * field should be used to limit the maximum cache size increment. * - * max_increment: If enabled by the apply_max_increment field described - * above, this field contains the maximum number of bytes by which the - * cache size can be increased in a single re-size. + * max_increment: If enabled by the apply_max_increment field described + * above, this field contains the maximum number of bytes by which the + * cache size can be increased in a single re-size. * * * Cache size decrease control fields: * - * decr_mode: Instance of the H5C_cache_decr_mode enumerated type whose + * decr_mode: Instance of the H5C_cache_decr_mode enumerated type whose * value indicates how we determine whether the cache size should be * decreased. At present there are four possibilities. * - * H5C_decr__off: Don't attempt to decrease the size of the cache + * H5C_decr__off: Don't attempt to decrease the size of the cache * automatically. * * When this increment mode is selected, the remaining fields * in the cache size decrease section are ignored. * - * H5C_decr__threshold: Attempt to decrease the size of the cache - * whenever the average hit rate over the last epoch rises - * above the value supplied in the upper_hr_threshold + * H5C_decr__threshold: Attempt to decrease the size of the cache + * whenever the average hit rate over the last epoch rises + * above the value supplied in the upper_hr_threshold * field. * - * H5C_decr__age_out: At the end of each epoch, search the cache for - * entries that have not been accessed for at least the number + * H5C_decr__age_out: At the end of each epoch, search the cache for + * entries that have not been accessed for at least the number * of epochs specified in the epochs_before_eviction field, and - * evict these entries. Conceptually, the maximum cache size + * evict these entries. Conceptually, the maximum cache size * is then decreased to match the new actual cache size. However, - * this reduction may be modified by the min_size, the + * this reduction may be modified by the min_size, the * max_decrement, and/or the empty_reserve. * - * H5C_decr__age_out_with_threshold: Same as age_out, but we only - * attempt to reduce the cache size when the hit rate observed - * over the last epoch exceeds the value provided in the + * H5C_decr__age_out_with_threshold: Same as age_out, but we only + * attempt to reduce the cache size when the hit rate observed + * over the last epoch exceeds the value provided in the * upper_hr_threshold field. * * upper_hr_threshold: Upper hit rate threshold. The use of this field * varies according to the current decr_mode: * - * H5C_decr__off or H5C_decr__age_out: The value of this field is + * H5C_decr__off or H5C_decr__age_out: The value of this field is * ignored. * - * H5C_decr__threshold: If the hit rate exceeds this threshold in any + * H5C_decr__threshold: If the hit rate exceeds this threshold in any * epoch, attempt to decrement the cache size by size_decrement. * * Note that cache size may not be decremented below min_size. * - * Note also that if the upper_threshold is 1.0, the cache size + * Note also that if the upper_threshold is 1.0, the cache size * will never be reduced. * - * H5C_decr__age_out_with_threshold: If the hit rate exceeds this - * threshold in any epoch, attempt to reduce the cache size - * by evicting entries that have not been accessed for more + * H5C_decr__age_out_with_threshold: If the hit rate exceeds this + * threshold in any epoch, attempt to reduce the cache size + * by evicting entries that have not been accessed for more * than the specified number of epochs. * - * decrement: This field is only used when the decr_mode is + * decrement: This field is only used when the decr_mode is * H5C_decr__threshold. * - * The field is a double containing the multiplier used to derive the - * new cache size from the old if a cache size decrement is triggered. + * The field is a double containing the multiplier used to derive the + * new cache size from the old if a cache size decrement is triggered. * The decrement must be in the range 0.0 (in which case the cache will - * try to contract to its minimum size) to 1.0 (in which case the + * try to contract to its minimum size) to 1.0 (in which case the * cache will never shrink). * * apply_max_decrement: Boolean flag used to determine whether decrements @@ -537,21 +537,21 @@ typedef struct H5C_cache_entry_t * restricted by the min_size of the cache, and (in age out modes) by * the empty_reserve field. * - * epochs_before_eviction: Integer field used in H5C_decr__age_out and + * epochs_before_eviction: Integer field used in H5C_decr__age_out and * H5C_decr__age_out_with_threshold decrement modes. * - * This field contains the number of epochs an entry must remain - * unaccessed before it is evicted in an attempt to reduce the + * This field contains the number of epochs an entry must remain + * unaccessed before it is evicted in an attempt to reduce the * cache size. If applicable, this field must lie in the range * [1, H5C__MAX_EPOCH_MARKERS]. * * apply_empty_reserve: Boolean field controlling whether the empty_reserve - * field is to be used in computing the new cache size when the + * field is to be used in computing the new cache size when the * decr_mode is H5C_decr__age_out or H5C_decr__age_out_with_threshold. * * empty_reserve: To avoid a constant racheting down of cache size by small - * amounts in the H5C_decr__age_out and H5C_decr__age_out_with_threshold - * modes, this field allows one to require that any cache size + * amounts in the H5C_decr__age_out and H5C_decr__age_out_with_threshold + * modes, this field allows one to require that any cache size * reductions leave the specified fraction of unused space in the cache. * * The value of this field must be in the range [0.0, 1.0]. I would @@ -639,7 +639,7 @@ typedef struct H5C_auto_size_ctl_t hbool_t apply_max_increment; size_t max_increment; - + /* size decrease control fields: */ enum H5C_cache_decr_mode decr_mode; @@ -663,7 +663,7 @@ typedef struct H5C_auto_size_ctl_t * Library prototypes. */ -/* #defines of flags used in the flags parameters in some of the +/* #defines of flags used in the flags parameters in some of the * following function calls. Note that not all flags are applicable * to all function calls. Flags that don't apply to a particular * function are ignored in that function. diff --git a/src/H5D.c b/src/H5D.c index 5f9658d..64c0847 100644 --- a/src/H5D.c +++ b/src/H5D.c @@ -34,7 +34,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); @@ -115,7 +115,7 @@ NAME H5D_init_interface -- Initialize interface-specific information USAGE herr_t H5D_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -150,26 +150,26 @@ H5D_init_interface(void) * - Default value for filter callback * - Default value for datatype conversion 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; - 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 */ H5Z_EDC_t enable_edc = H5D_XFER_EDC_DEF; H5Z_cb_t filter_cb = H5D_XFER_FILTER_CB_DEF; H5T_conv_cb_t conv_cb = H5D_XFER_CONV_CB_DEF; - void *def_xfer_xform = H5D_XFER_XFORM_DEF; + void *def_xfer_xform = H5D_XFER_XFORM_DEF; /* Dataset creation property class variables. In sequence, they are, * - Creation property list class to modify @@ -187,7 +187,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; @@ -201,7 +201,7 @@ H5D_init_interface(void) if (H5I_register_type(H5I_DATASET, H5I_DATASETID_HASHSIZE, H5D_RESERVED_ATOMS, (H5I_free_t)H5D_close) 0) { /* Set the driver for the property list */ if(H5FD_dxpl_open(new_plist, driver_id, driver_info)<0) @@ -1148,13 +1148,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 @@ -1248,7 +1248,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") @@ -1291,8 +1291,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 @@ -1329,7 +1329,7 @@ done: /*------------------------------------------------------------------------- - * Function: H5Dget_space + * Function: H5Dget_space * * Purpose: Returns a copy of the file data space for a dataset. * @@ -1354,7 +1354,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); @@ -1387,9 +1387,9 @@ done: * * Purpose: Returns the status of data space allocation. * - * Return: + * Return: * Success: Non-negative - * + * * Failture: Negative * * Programmer: Raymond Lu @@ -1512,11 +1512,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); @@ -1535,7 +1535,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") @@ -1567,10 +1567,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. * *------------------------------------------------------------------------- @@ -1584,7 +1584,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); @@ -1647,7 +1647,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); @@ -1695,7 +1695,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))) @@ -1754,7 +1754,7 @@ done: * Thursday, June 24, 2004 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1828,10 +1828,10 @@ done: * Modifications: * * John Mainzer 6/6/05 - * Modified function to use the new dirtied parameter of + * Modified function to use the new dirtied parameter of * H5AC_unprotect() instead of manipulating the is_dirty * field of the cache info directly. - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1939,7 +1939,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") @@ -2032,7 +2032,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, &oh_flags) < 0) HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to update modification time message") @@ -2067,8 +2067,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 * @@ -2089,13 +2089,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 @@ -2113,7 +2113,7 @@ done: * Peter X. Cao * May 09, 2005 * Add property to create intermediate groups - * + * *------------------------------------------------------------------------- */ static H5D_t * @@ -2225,13 +2225,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") @@ -2322,7 +2322,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") @@ -2357,7 +2357,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) * @@ -2389,7 +2389,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. @@ -2467,7 +2467,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); @@ -2485,7 +2485,7 @@ H5D_isa(H5G_entry_t *ent, hid_t dxpl_id) } else if (!exists) { HGOTO_DONE(FALSE) } - + done: FUNC_LEAVE_NOAPI(ret_value) @@ -2493,7 +2493,7 @@ done: /* - *------------------------------------------------------------------------- + *------------------------------------------------------------------------- * Function: H5D_open * * Purpose: Checks if dataset is already open, or opens a dataset for @@ -2517,7 +2517,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 */ @@ -2599,18 +2599,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") @@ -2626,7 +2626,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") @@ -2691,7 +2691,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) @@ -2706,7 +2706,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; @@ -2744,7 +2744,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 */ @@ -2772,8 +2772,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 */ @@ -2856,7 +2856,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 @@ -2916,7 +2916,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) @@ -2991,7 +2991,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 @@ -3035,7 +3035,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; } } } @@ -3183,7 +3183,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 */ @@ -3235,7 +3235,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. */ @@ -3251,7 +3251,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 @@ -3322,7 +3322,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. * *------------------------------------------------------------------------- @@ -3369,9 +3369,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") @@ -3383,7 +3383,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() */ @@ -3414,7 +3414,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); @@ -3451,7 +3451,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) { @@ -3477,7 +3477,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) } @@ -3488,12 +3488,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: * @@ -3504,7 +3504,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); @@ -3523,15 +3523,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: * @@ -3543,7 +3543,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); @@ -3554,11 +3554,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) @@ -3573,7 +3573,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) } @@ -3619,12 +3619,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. @@ -3869,7 +3869,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") @@ -3931,7 +3931,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 @@ -3974,7 +3974,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 @@ -4065,7 +4065,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") @@ -4157,14 +4157,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 @@ -4218,7 +4218,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 a13bf5d..85d78eb 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_*. @@ -35,32 +35,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); @@ -69,42 +69,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); @@ -115,6 +115,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 fd4dde0..bec3615 100644 --- a/src/H5Dcontig.c +++ b/src/H5Dcontig.c @@ -125,7 +125,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 */ @@ -216,7 +216,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; @@ -249,7 +249,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 */ @@ -422,7 +422,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 */ @@ -689,7 +689,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 */ @@ -717,7 +717,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 { @@ -845,7 +845,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 cfe10d6..aaba3a6 100644 --- a/src/H5Defl.c +++ b/src/H5Defl.c @@ -63,7 +63,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 */ @@ -80,7 +80,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); @@ -111,14 +111,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 @@ -150,7 +150,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 */ @@ -167,7 +167,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); @@ -200,14 +200,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 @@ -240,7 +240,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 */ @@ -291,7 +291,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 @@ -324,7 +324,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 */ @@ -375,4 +375,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 df9e1b7..ffff901 100644 --- a/src/H5Dio.c +++ b/src/H5Dio.c @@ -1136,7 +1136,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 @@ -1161,7 +1161,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); @@ -1176,7 +1176,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. */ @@ -1203,7 +1203,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: @@ -1397,7 +1397,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 @@ -1432,7 +1432,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. */ @@ -3383,7 +3383,7 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: + * Programmer: * * Modifications: * diff --git a/src/H5Distore.c b/src/H5Distore.c index 661ab2d..688b5d4 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 479db17..43b736d 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -306,7 +306,7 @@ done: * * Return: non-negative on success, negative on failure. * - * Programmer: + * Programmer: * * Modifications: * @@ -336,7 +336,7 @@ H5D_mpio_select_read(H5D_io_info_t *io_info, * * Return: non-negative on success, negative on failure. * - * Programmer: + * Programmer: * * Modifications: * diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h index 732af1f..df97218 100644 --- a/src/H5Dprivate.h +++ b/src/H5Dprivate.h @@ -39,7 +39,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) @@ -49,7 +49,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) @@ -65,7 +65,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) @@ -74,7 +74,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 ======== */ @@ -216,11 +216,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 e1d2b18..a3a363c 100644 --- a/src/H5E.c +++ b/src/H5E.c @@ -93,7 +93,7 @@ int H5E_mpi_error_str_len; #endif /* Static function declarations */ -static H5E_cls_t *H5E_register_class(const char *cls_name, const char *lib_name, +static H5E_cls_t *H5E_register_class(const char *cls_name, const char *lib_name, const char *version); static herr_t H5E_unregister_class(H5E_cls_t *cls); static ssize_t H5E_get_class_name(const H5E_cls_t *cls, char *name, size_t size); @@ -108,7 +108,7 @@ static ssize_t H5E_get_num(const H5E_t *err_stack); static herr_t H5E_pop(H5E_t *err_stack, size_t count); static herr_t H5E_clear_entries(H5E_t *estack, size_t nentries); static herr_t H5E_print_stack(const H5E_t *estack, FILE *stream); -static herr_t H5E_walk_stack(const H5E_t *estack, H5E_direction_t direction, H5E_walk_t func, +static herr_t H5E_walk_stack(const H5E_t *estack, H5E_direction_t direction, H5E_walk_t func, void *client_data); static herr_t H5E_walk_cb(unsigned n, const H5E_error_t *err_desc, void *client_data); static herr_t H5E_get_auto_stack(const H5E_t *estack, hbool_t new_api, void **func, void **client_data); @@ -161,7 +161,7 @@ done: * * Programmer: Raymond Lu * Friday, July 11, 2003 - * + * *-------------------------------------------------------------------------- */ static herr_t @@ -175,15 +175,15 @@ H5E_init_interface(void) FUNC_ENTER_NOAPI_NOINIT(H5E_init_interface) /* Initialize the atom group for the error class IDs */ - if(H5I_register_type(H5I_ERROR_CLASS, H5I_ERRCLS_HASHSIZE, H5E_RESERVED_ATOMS, + if(H5I_register_type(H5I_ERROR_CLASS, H5I_ERRCLS_HASHSIZE, H5E_RESERVED_ATOMS, (H5I_free_t)H5E_unregister_class)0) H5I_clear_type(H5I_ERROR_STACK, FALSE); - + /* Clear all the error classes */ if (ncls>0) { H5I_clear_type(H5I_ERROR_CLASS, FALSE); - + /* Reset the HDF5 error class, if its been closed */ if(H5I_nmembers(H5I_ERROR_CLASS)==0) H5E_ERR_CLS_g = -1; } - + /* Clear all the error messages */ if (nmsg>0) { H5I_clear_type(H5I_ERROR_MSG, FALSE); - + /* Reset the HDF5 error messages, if they've been closed */ if(H5I_nmembers(H5I_ERROR_MSG)==0) { /* Include the automatically generated error code termination */ @@ -352,7 +352,7 @@ H5Eregister_class(const char *cls_name, const char *lib_name, const char *versio FUNC_ENTER_API(H5Eregister_class, FAIL) H5TRACE3("i","sss",cls_name,lib_name,version); - + /* Check arguments */ if (cls_name==NULL || lib_name==NULL || version==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid string") @@ -389,9 +389,9 @@ H5E_register_class(const char *cls_name, const char *lib_name, const char *versi { H5E_cls_t *cls; /* Pointer to error class */ H5E_cls_t *ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5E_register_class) - + /* Check arguments */ assert(cls_name); assert(lib_name); @@ -438,7 +438,7 @@ H5Eunregister_class(hid_t class_id) FUNC_ENTER_API(H5Eunregister_class, FAIL) H5TRACE1("e","i",class_id); - + /* Check arguments */ if (H5I_ERROR_CLASS != H5I_get_type(class_id)) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an error class") @@ -482,14 +482,14 @@ H5E_unregister_class(H5E_cls_t *cls) (void)H5I_search(H5I_ERROR_MSG, H5E_close_msg_cb, cls); /* Free error class structure */ - if(cls->cls_name) + if(cls->cls_name) H5MM_xfree((void*)cls->cls_name); if(cls->lib_name) H5MM_xfree((void*)cls->lib_name); if(cls->lib_vers) H5MM_xfree((void*)cls->lib_vers); H5FL_FREE(H5E_cls_t, cls); - + FUNC_LEAVE_NOAPI(SUCCEED) } @@ -500,7 +500,7 @@ H5E_unregister_class(H5E_cls_t *cls) * Purpose: Retrieves error class name. * * Return: Non-negative for name length if succeeds(zero means no name); - * otherwise returns negative value. + * otherwise returns negative value. * * Programmer: Raymond Lu * Friday, July 11, 2003 @@ -517,7 +517,7 @@ H5Eget_class_name(hid_t class_id, char *name, size_t size) FUNC_ENTER_API(H5Eget_class_name, FAIL) H5TRACE3("Zs","isz",class_id,name,size); - + /* Get the error class */ if(NULL==(cls = H5I_object_verify(class_id, H5I_ERROR_CLASS))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error class ID") @@ -535,9 +535,9 @@ done: * Function: H5E_get_class_name * * Purpose: Private function to retrieve error class name. - * + * * Return: Non-negative for name length if succeeds(zero means no name); - * otherwise returns negative value. + * otherwise returns negative value. * * Programmer: Raymond Lu * Friday, July 11, 2003 @@ -550,7 +550,7 @@ static ssize_t H5E_get_class_name(const H5E_cls_t *cls, char *name, size_t size) { ssize_t len; /* Length of rror class's name */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_get_class_name) /* Check arguments */ @@ -564,8 +564,8 @@ H5E_get_class_name(const H5E_cls_t *cls, char *name, size_t size) HDstrncpy(name, cls->cls_name, MIN((size_t)(len+1), size)); if((size_t)len >= size) name[size-1]='\0'; - } - + } + /* Return the full length */ FUNC_LEAVE_NOAPI(len) } @@ -579,7 +579,7 @@ H5E_get_class_name(const H5E_cls_t *cls, char *name, size_t size) * * Programmer: Raymond Lu * July 14, 2003 - * + * * Return: Non-negative value on success/Negative on failure * * Modifications: @@ -592,9 +592,9 @@ H5E_close_msg_cb(void *obj_ptr, hid_t obj_id, void *key) H5E_msg_t *err_msg = (H5E_msg_t*)obj_ptr; H5E_cls_t *cls = (H5E_cls_t*)key; herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5E_close_msg_cb) - + /* Check arguments */ assert(err_msg); @@ -602,7 +602,7 @@ H5E_close_msg_cb(void *obj_ptr, hid_t obj_id, void *key) if(err_msg->cls == cls) if(H5I_dec_ref(obj_id)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTDEC, FAIL, "unable to decrement ref count on error message") - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -626,7 +626,7 @@ herr_t H5Eclose_msg(hid_t err_id) { herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Eclose_msg, FAIL) H5TRACE1("e","i",err_id); @@ -664,7 +664,7 @@ H5E_close_msg(H5E_msg_t *err) /* Check arguments */ assert(err); - if(err->msg) + if(err->msg) H5MM_xfree((void*)err->msg); /* Don't free err->cls here */ @@ -693,10 +693,10 @@ H5Ecreate_msg(hid_t class_id, H5E_type_t msg_type, const char *msg_str) H5E_cls_t *cls; /* Pointer to error class */ H5E_msg_t *msg; /* Pointer to new error message */ hid_t ret_value; /* Return value */ - + FUNC_ENTER_API(H5Ecreate_msg, FAIL) H5TRACE3("i","iEts",class_id,msg_type,msg_str); - + /* Check arguments */ if(msg_type!=H5E_MAJOR && msg_type!=H5E_MINOR) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a valid message type") @@ -738,9 +738,9 @@ H5E_create_msg(H5E_cls_t *cls, H5E_type_t msg_type, const char *msg_str) { H5E_msg_t *msg; /* Pointer to new error message */ H5E_msg_t *ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5E_create_msg) - + /* Check arguments */ assert(cls); assert(msg_type==H5E_MAJOR || msg_type==H5E_MINOR); @@ -770,7 +770,7 @@ done: * Purpose: Retrieves a major error message. * * Return: Returns message if succeeds. - * otherwise returns NULL. + * otherwise returns NULL. * * Programmer: Raymond Lu * Friday, July 14, 2003 @@ -789,7 +789,7 @@ H5Eget_major(H5E_major_t maj) char *ret_value = NULL; FUNC_ENTER_API_NOCLEAR(H5Eget_major,NULL) - + /* Get the message object */ if((msg = H5I_object_verify(maj, H5I_ERROR_MSG))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a error message ID") @@ -797,7 +797,7 @@ H5Eget_major(H5E_major_t maj) /* Get the message's text */ if((size = H5E_get_msg(msg, &type, NULL, 0))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, NULL, "can't get error message text"); - + if(type != H5E_MAJOR) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, NULL, "Error message isn't a major one"); @@ -808,7 +808,7 @@ H5Eget_major(H5E_major_t maj) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, NULL, "can't get error message text") ret_value = msg_str; - + done: FUNC_LEAVE_API(ret_value) } @@ -820,7 +820,7 @@ done: * Purpose: Retrieves a minor error message. * * Return: Returns message if succeeds. - * otherwise returns NULL. + * otherwise returns NULL. * * Programmer: Raymond Lu * Friday, July 14, 2003 @@ -839,7 +839,7 @@ H5Eget_minor(H5E_minor_t min) char *ret_value = NULL; FUNC_ENTER_API_NOCLEAR(H5Eget_minor,NULL) - + /* Get the message object */ if((msg = H5I_object_verify(min, H5I_ERROR_MSG))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a error message ID") @@ -847,10 +847,10 @@ H5Eget_minor(H5E_minor_t min) /* Get the message's text */ if((size = H5E_get_msg(msg, &type, NULL, 0))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, NULL, "can't get error message text"); - + if(type != H5E_MINOR) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, NULL, "Error message isn't a minor one"); - + /* Don't know who is going to free it */ msg_str = (char*)H5MM_malloc((size_t)(++size)*sizeof(char)); @@ -858,7 +858,7 @@ H5Eget_minor(H5E_minor_t min) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, NULL, "can't get error message text") ret_value = msg_str; - + done: FUNC_LEAVE_API(ret_value) } @@ -870,7 +870,7 @@ done: * Purpose: Retrieves an error message. * * Return: Non-negative for message length if succeeds(zero means no message); - * otherwise returns negative value. + * otherwise returns negative value. * * Programmer: Raymond Lu * Friday, July 14, 2003 @@ -887,7 +887,7 @@ H5Eget_msg(hid_t msg_id, H5E_type_t *type, char *msg_str, size_t size) FUNC_ENTER_API(H5Eget_msg, FAIL) H5TRACE4("Zs","i*Etsz",msg_id,type,msg_str,size); - + /* Get the message object */ if((msg = H5I_object_verify(msg_id, H5I_ERROR_MSG))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error message ID") @@ -905,9 +905,9 @@ done: * Function: H5E_get_msg * * Purpose: Private function to retrieve an error message. - * + * * Return: Non-negative for name length if succeeds(zero means no name); - * otherwise returns negative value. + * otherwise returns negative value. * * Programmer: Raymond Lu * Friday, July 14, 2003 @@ -920,7 +920,7 @@ static ssize_t H5E_get_msg(const H5E_msg_t *msg, H5E_type_t *type, char *msg_str, size_t size) { ssize_t len; /* Length of rror class's name */ - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_get_msg) /* Check arguments */ @@ -934,8 +934,8 @@ H5E_get_msg(const H5E_msg_t *msg, H5E_type_t *type, char *msg_str, size_t size) HDstrncpy(msg_str, msg->msg, MIN((size_t)(len+1), size)); if((size_t)len >= size) msg_str[size-1]='\0'; - } - + } + /* Give the message type, if asked */ if(type) *type = msg->type; @@ -969,7 +969,7 @@ H5Eget_current_stack(void) /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(H5Eget_current_stack, FAIL) H5TRACE0("i",""); - + /* Get the current stack */ if((stk=H5E_get_current_stack())==NULL) HGOTO_ERROR(H5E_ERROR, H5E_CANTCREATE, FAIL, "can't create error stack") @@ -1004,7 +1004,7 @@ H5E_get_current_stack(void) H5E_t *estack_copy=NULL; /* Pointer to new error stack to return */ unsigned u; /* Local index variable */ H5E_t *ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5E_get_current_stack) /* Get a pointer to the current error stack */ @@ -1016,24 +1016,24 @@ H5E_get_current_stack(void) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") /* Make a copy of current error stack */ - estack_copy->nused = current_stack->nused; + estack_copy->nused = current_stack->nused; for(u=0; unused; u++) { H5E_error_t *current_error, *new_error; /* Pointers to errors on each stack */ /* Get pointers into the current error stack location */ current_error = &(current_stack->slot[u]); new_error = &(estack_copy->slot[u]); - + /* Increment the IDs to indicate that they are used in this stack */ if(H5I_inc_ref(current_error->cls_id)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, NULL, "unable to increment ref count on error class") - new_error->cls_id = current_error->cls_id; + new_error->cls_id = current_error->cls_id; if(H5I_inc_ref(current_error->maj_num)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, NULL, "unable to increment ref count on error message") - new_error->maj_num = current_error->maj_num; + new_error->maj_num = current_error->maj_num; if(H5I_inc_ref(current_error->min_num)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, NULL, "unable to increment ref count on error message") - new_error->min_num = current_error->min_num; + new_error->min_num = current_error->min_num; if((new_error->func_name = HDstrdup(current_error->func_name))==NULL) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") if((new_error->file_name = HDstrdup(current_error->file_name))==NULL) @@ -1042,10 +1042,10 @@ H5E_get_current_stack(void) if((new_error->desc = HDstrdup(current_error->desc))==NULL) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed") } /* end for */ - - /* Empty current error stack */ + + /* Empty current error stack */ H5E_clear_stack(current_stack); - + /* Set the return value */ ret_value = estack_copy; @@ -1062,7 +1062,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Eset_current_stack * - * Purpose: Replaces current stack with specified stack. + * Purpose: Replaces current stack with specified stack. * * Return: Non-negative value on success/Negative on failure * @@ -1078,10 +1078,10 @@ H5Eset_current_stack(hid_t err_stack) { H5E_t *estack; herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Eset_current_stack, FAIL) H5TRACE1("e","i",err_stack); - + if(err_stack != H5E_DEFAULT) { if((estack = H5I_object_verify(err_stack, H5I_ERROR_STACK))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error stack ID") @@ -1116,7 +1116,7 @@ H5E_set_current_stack(H5E_t *estack) H5E_t *current_stack; /* Default error stack */ unsigned u; /* Local index variable */ herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5E_set_current_stack) /* Sanity check */ @@ -1126,18 +1126,18 @@ H5E_set_current_stack(H5E_t *estack) if((current_stack = 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") - /* Empty current error stack */ + /* Empty current error stack */ H5E_clear_stack(current_stack); /* Copy new stack to current error stack */ - current_stack->nused = estack->nused; + current_stack->nused = estack->nused; for(u=0; unused; u++) { H5E_error_t *current_error, *new_error; /* Pointers to errors on each stack */ /* Get pointers into the current error stack location */ current_error = &(current_stack->slot[u]); new_error = &(estack->slot[u]); - + /* Increment the IDs to indicate that they are used in this stack */ if(H5I_inc_ref(new_error->cls_id)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTINC, FAIL, "unable to decrement ref count on error class") @@ -1220,7 +1220,7 @@ static herr_t H5E_close_stack(H5E_t *estack) { FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_close_stack) - + /* Sanity check */ assert(estack); @@ -1229,7 +1229,7 @@ H5E_close_stack(H5E_t *estack) /* Free the stack structure */ H5FL_FREE(H5E_t, estack); - + FUNC_LEAVE_NOAPI(SUCCEED) } @@ -1260,7 +1260,7 @@ H5Eget_num(hid_t error_stack_id) /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(H5Eget_num, FAIL) H5TRACE1("Is","i",error_stack_id); - + /* Need to check for errors */ if(error_stack_id == H5E_DEFAULT) { if((estack = H5E_get_my_stack())==NULL) /*lint !e506 !e774 Make lint 'constant value Boolean' in non-threaded case */ @@ -1274,7 +1274,7 @@ H5Eget_num(hid_t error_stack_id) if((estack = H5I_object_verify(error_stack_id, H5I_ERROR_STACK))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error stack ID") } /* end else */ - + /* Get the number of errors on stack */ if((ret_value=H5E_get_num(estack))<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, FAIL, "can't get number of errors") @@ -1305,8 +1305,8 @@ static ssize_t H5E_get_num(const H5E_t *estack) { FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_get_num) - - assert(estack); + + assert(estack); FUNC_LEAVE_NOAPI((ssize_t)estack->nused) } @@ -1335,7 +1335,7 @@ H5Epop(hid_t err_stack, size_t count) /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(H5Epop, FAIL) H5TRACE2("e","iz",err_stack,count); - + /* Need to check for errors */ if(err_stack == H5E_DEFAULT) { if((estack = H5E_get_my_stack())==NULL) /*lint !e506 !e774 Make lint 'constant value Boolean' in non-threaded case */ @@ -1382,7 +1382,7 @@ static herr_t H5E_pop(H5E_t *estack, size_t count) { herr_t ret_value = SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5E_pop) /* Sanity check */ @@ -1403,17 +1403,17 @@ done: * * Purpose: This function definition is for backward compatibility only. * It doesn't have error stack and error class as parameters. - * The old definition of major and minor is casted as HID_T - * in H5Epublic.h + * The old definition of major and minor is casted as HID_T + * in H5Epublic.h * * Return: Non-negative on success/Negative on failure * * Programmer: Raymond Lu * Tuesday, Sep 16, 2003 * - * Notes: Basically a public API wrapper around the H5E_push_stack + * Notes: Basically a public API wrapper around the H5E_push_stack * function. For backward compatibility, it maintains the - * same parameter as the old function, in contrary to + * same parameter as the old function, in contrary to * H5Epush_stack. * * Modifications: @@ -1421,7 +1421,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Epush(const char *file, const char *func, unsigned line, +H5Epush(const char *file, const char *func, unsigned line, H5E_major_t maj, H5E_minor_t min, const char *str) { H5E_t *estack = NULL; /* Default error stack */ @@ -1430,7 +1430,7 @@ H5Epush(const char *file, const char *func, unsigned line, /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(H5Epush, FAIL) H5TRACE6("e","ssIuiis",file,func,line,maj,min,str); - + /* Push the error on the stack */ if(H5E_push_stack(estack, file, func, line, H5E_ERR_CLS_g, maj, min, str)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTSET, FAIL, "can't push error on stack") @@ -1456,7 +1456,7 @@ done: * Programmer: Quincey Koziol * Monday, October 18, 1999 * - * Notes: Basically a new public API wrapper around the H5E_push_stack + * Notes: Basically a new public API wrapper around the H5E_push_stack * function. * * Modifications: @@ -1470,7 +1470,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5Epush_stack(hid_t err_stack, const char *file, const char *func, unsigned line, +H5Epush_stack(hid_t err_stack, const char *file, const char *func, unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *fmt, ...) { va_list ap; /* Varargs info */ @@ -1486,7 +1486,7 @@ H5Epush_stack(hid_t err_stack, const char *file, const char *func, unsigned line /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(H5Epush_stack, FAIL) H5TRACE7("e","issIuiis",err_stack,file,func,line,maj_id,min_id,fmt); - + if(err_stack == H5E_DEFAULT) estack = NULL; else { @@ -1497,7 +1497,7 @@ H5Epush_stack(hid_t err_stack, const char *file, const char *func, unsigned line if((estack = H5I_object_verify(err_stack, H5I_ERROR_STACK))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error stack ID") } /* end else */ - + /* Check for mis-matches in major & minor error classes */ if((maj_ptr = H5I_object_verify(maj_id, H5I_ERROR_MSG))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error message ID") @@ -1581,10 +1581,10 @@ done: * Programmer: Robb Matzke * Friday, December 12, 1997 * - * Modifications: + * Modifications: * Raymond Lu * Tuesday, July 15, 2003 - * + * * Added the ID of the error stack to which the error is pushed * on. The error message can be appended more message in the * same control format as printf and fprintf. @@ -1592,7 +1592,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5E_push_stack(H5E_t *estack, const char *file, const char *func, unsigned line, +H5E_push_stack(H5E_t *estack, const char *file, const char *func, unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *desc) { herr_t ret_value=SUCCEED; /* Return value */ @@ -1675,7 +1675,7 @@ H5Eclear(void) { H5E_t *estack = NULL; /* Default error stack to operate on */ herr_t ret_value=SUCCEED; /* Return value */ - + /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(H5Eclear, FAIL) H5TRACE0("e",""); @@ -1708,7 +1708,7 @@ H5Eclear_stack(hid_t err_stack) { H5E_t *estack; /* Error stack to operate on */ herr_t ret_value=SUCCEED; /* Return value */ - + /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(H5Eclear_stack, FAIL) H5TRACE1("e","i",err_stack); @@ -1723,7 +1723,7 @@ H5Eclear_stack(hid_t err_stack) if((estack = H5I_object_verify(err_stack, H5I_ERROR_STACK))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error stack ID") } /* end else */ - + /* Clear the error stack */ if(H5E_clear_stack(estack)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTSET, FAIL, "can't clear error stack") @@ -1761,7 +1761,7 @@ H5E_clear_entries(H5E_t *estack, size_t nentries) assert(estack); assert(estack->nused>=nentries); - /* Empty the error stack from the top down */ + /* Empty the error stack from the top down */ for(u=0; nentries>0; nentries--,u++) { error = &(estack->slot[estack->nused-(u+1)]); @@ -1785,7 +1785,7 @@ H5E_clear_entries(H5E_t *estack, size_t nentries) /* Decrement number of errors on stack */ estack->nused-=u; - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -1818,12 +1818,12 @@ H5E_clear_stack(H5E_t *estack) 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") - /* Empty the error stack */ + /* Empty the error stack */ assert(estack); if(estack->nused) if(H5E_clear_entries(estack, estack->nused)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTSET, FAIL, "can't clear error stack") - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -1855,14 +1855,14 @@ H5Eprint(FILE *stream) { H5E_t *estack; /* Error stack to operate on */ herr_t ret_value=SUCCEED; /* Return value */ - + /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(H5Eprint, FAIL) /*NO TRACE*/ 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") - + /* Print error stack */ if(H5E_print_stack(estack, stream)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTLIST, FAIL, "can't display error stack") @@ -1895,7 +1895,7 @@ done: * Print for specified error stack. A line will appear before the error * messages of each error class. It states the information of library * name, version number and thread ID. - * + * *------------------------------------------------------------------------- */ herr_t @@ -1903,7 +1903,7 @@ H5Eprint_stack(hid_t err_stack, FILE *stream) { H5E_t *estack; /* Error stack to operate on */ herr_t ret_value=SUCCEED; /* Return value */ - + /* Don't clear the error stack! :-) */ FUNC_ENTER_API_NOCLEAR(H5Eprint_stack, FAIL) /*NO TRACE*/ @@ -1920,7 +1920,7 @@ H5Eprint_stack(hid_t err_stack, FILE *stream) if((estack = H5I_object_verify(err_stack, H5I_ERROR_STACK))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error stack ID") } /* end else */ - + /* Print error stack */ if(H5E_print_stack(estack, stream)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTLIST, FAIL, "can't display error stack") @@ -1933,10 +1933,10 @@ done: /*------------------------------------------------------------------------- * Function: H5E_print_stack * - * Purpose: Private function to print the error stack in some default + * Purpose: Private function to print the error stack in some default * way. This is just a convenience function for H5Ewalk() and - * H5Ewalk_stack() with a function that prints error messages. - * Users are encouraged to write there own more specific error + * H5Ewalk_stack() with a function that prints error messages. + * Users are encouraged to write there own more specific error * handlers. * * Return: Non-negative on success/Negative on failure @@ -1954,7 +1954,7 @@ done: * Print for specified error stack. A line will appear before the error * messages of each error class. It states the information of library * name, version number and thread ID. - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1965,23 +1965,23 @@ H5E_print_stack(const H5E_t *estack, FILE *stream) /* Don't clear the error stack! :-) */ FUNC_ENTER_NOAPI_NOINIT(H5E_print_stack) - + /* Sanity check */ assert(estack); /* If no stream was given, use stderr */ - if (!stream) + if (!stream) eprint.stream = stderr; else eprint.stream = stream; /* Reset the original error class information */ HDmemset(&eprint.cls,0,sizeof(H5E_cls_t)); - + /* Walk the error stack */ if(H5E_walk_stack(estack, H5E_WALK_DOWNWARD, H5E_walk_cb, (void*)&eprint)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTLIST, FAIL, "can't walk error stack") - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -2041,7 +2041,7 @@ done: * Raymond Lu * Wednesday, July 16, 2003 * Let it walk through specified error stack. - * + * *------------------------------------------------------------------------- */ herr_t @@ -2104,7 +2104,7 @@ done: * Raymond Lu * Wednesday, July 16, 2003 * Let it walk through specified error stack. - * + * *------------------------------------------------------------------------- */ static herr_t @@ -2138,7 +2138,7 @@ H5E_walk_stack(const H5E_t *estack, H5E_direction_t direction, H5E_walk_t func, if(status<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTLIST, FAIL, "can't walk error stack") } /* end if */ - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -2197,7 +2197,7 @@ H5E_walk_cb(unsigned n, const H5E_error_t *err_desc, void *client_data) /* If no client data was passed, output to stderr */ if (!client_data) stream = stderr; else stream = eprint->stream; - + /* Get descriptions for the major and minor error numbers */ maj_ptr = H5I_object_verify(err_desc->maj_num, H5I_ERROR_MSG); min_ptr = H5I_object_verify(err_desc->min_num, H5I_ERROR_MSG); @@ -2209,7 +2209,7 @@ H5E_walk_cb(unsigned n, const H5E_error_t *err_desc, void *client_data) /* Get error class info */ cls_ptr = maj_ptr->cls; - + /* Print error class header if new class */ if(eprint->cls.lib_name==NULL || HDstrcmp(cls_ptr->lib_name, eprint->cls.lib_name)) { /* update to the new class information */ @@ -2218,7 +2218,7 @@ H5E_walk_cb(unsigned n, const H5E_error_t *err_desc, void *client_data) if(cls_ptr->lib_vers) eprint->cls.lib_vers = cls_ptr->lib_vers; fprintf (stream, "%s-DIAG: Error detected in %s (%s) ", cls_ptr->cls_name, cls_ptr->lib_name, cls_ptr->lib_vers); - + /* try show the process or thread id in multiple processes cases*/ #ifdef H5_HAVE_PARALLEL { int mpi_rank, mpi_initialized; @@ -2262,15 +2262,15 @@ H5E_walk_cb(unsigned n, const H5E_error_t *err_desc, void *client_data) * * Purpose: This function is for backward compatbility. * Returns the current settings for the automatic error stack - * traversal function and its data for specific error stack. - * Either (or both) arguments may be null in which case the + * traversal function and its data for specific error stack. + * Either (or both) arguments may be null in which case the * value is not returned. * * Return: Non-negative on success/Negative on failure * * Programmer: Raymond Lu * Sep 16, 2003 - * + * * Modifications: * *------------------------------------------------------------------------- @@ -2280,11 +2280,11 @@ H5Eget_auto(H5E_auto_t *func, void **client_data) { H5E_t *estack; /* Error stack to operate on */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Eget_auto, FAIL) H5TRACE2("e","*xx",func,client_data); - /* Retrieve default error stack */ + /* Retrieve default 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") @@ -2301,8 +2301,8 @@ done: * Function: H5Eget_auto_stack * * Purpose: Returns the current settings for the automatic error stack - * traversal function and its data for specific error stack. - * Either (or both) arguments may be null in which case the + * traversal function and its data for specific error stack. + * Either (or both) arguments may be null in which case the * value is not returned. * * Return: Non-negative on success/Negative on failure @@ -2313,7 +2313,7 @@ done: * Modifications: * Raymond Lu * July 18, 2003 - * Added error stack in the parameters. It returns the + * Added error stack in the parameters. It returns the * traversal function and data for that error stack. * *------------------------------------------------------------------------- @@ -2323,10 +2323,10 @@ H5Eget_auto_stack(hid_t estack_id, H5E_auto_stack_t *func, void **client_data) { H5E_t *estack; /* Error stack to operate on */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Eget_auto_stack, FAIL) H5TRACE3("e","i*xx",estack_id,func,client_data); - + if(estack_id == H5E_DEFAULT) { 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") @@ -2347,9 +2347,9 @@ done: /*------------------------------------------------------------------------- * Function: H5E_get_auto_stack * - * Purpose: Private function to return the current settings for the - * automatic error stack traversal function and its data - * for specific error stack. Either (or both) arguments may + * Purpose: Private function to return the current settings for the + * automatic error stack traversal function and its data + * for specific error stack. Either (or both) arguments may * be null in which case the value is not returned. * * Return: Non-negative on success/Negative on failure @@ -2367,7 +2367,7 @@ H5E_get_auto_stack(const H5E_t *estack, hbool_t new_api, void * *func, void **cl FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_get_auto_stack) assert (estack); - + /* Retrieve the requested information */ if(func) *func = new_api ? (void *)estack->u.func_stack : (void *)estack->u.func; @@ -2382,8 +2382,8 @@ H5E_get_auto_stack(const H5E_t *estack, hbool_t new_api, void * *func, void **cl * Function: H5Eset_auto * * Purpose: This function is for backward compatbility. - * Turns on or off automatic printing of errors for certain - * error stack. When turned on (non-null FUNC pointer) any + * Turns on or off automatic printing of errors for certain + * error stack. When turned on (non-null FUNC pointer) any * API function which returns an error indication will first * call FUNC passing it CLIENT_DATA as an argument. * @@ -2393,7 +2393,7 @@ H5E_get_auto_stack(const H5E_t *estack, hbool_t new_api, void * *func, void **cl * * Automatic stack traversal is always in the H5E_WALK_DOWNWARD * direction. - * + * * See Also: H5Ewalk() * * Return: Non-negative on success/Negative on failure @@ -2410,13 +2410,13 @@ H5Eset_auto(H5E_auto_t func, void *client_data) { H5E_t *estack; /* Error stack to operate on */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Eset_auto, FAIL) H5TRACE2("e","xx",func,client_data); 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 information */ if(H5E_set_auto_stack(estack, FALSE, (void *)func, client_data)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTSET, FAIL, "can't set automatic error info") @@ -2429,8 +2429,8 @@ done: /*------------------------------------------------------------------------- * Function: H5Eset_auto_stack * - * Purpose: Turns on or off automatic printing of errors for certain - * error stack. When turned on (non-null FUNC pointer) any + * Purpose: Turns on or off automatic printing of errors for certain + * error stack. When turned on (non-null FUNC pointer) any * API function which returns an error indication will first * call FUNC passing it CLIENT_DATA as an argument. * @@ -2440,7 +2440,7 @@ done: * * Automatic stack traversal is always in the H5E_WALK_DOWNWARD * direction. - * + * * See Also: H5Ewalk() * * Return: Non-negative on success/Negative on failure @@ -2457,7 +2457,7 @@ H5Eset_auto_stack(hid_t estack_id, H5E_auto_stack_t func, void *client_data) { H5E_t *estack; /* Error stack to operate on */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Eset_auto_stack, FAIL) H5TRACE3("e","ixx",estack_id,func,client_data); @@ -2468,7 +2468,7 @@ H5Eset_auto_stack(hid_t estack_id, H5E_auto_stack_t func, void *client_data) else if((estack = H5I_object_verify(estack_id, H5I_ERROR_STACK))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error stack ID") - + /* Set the automatic error reporting information */ if(H5E_set_auto_stack(estack, TRUE, (void *)func, client_data)<0) HGOTO_ERROR(H5E_ERROR, H5E_CANTSET, FAIL, "can't set automatic error info") @@ -2481,10 +2481,10 @@ done: /*------------------------------------------------------------------------- * Function: H5E_set_auto_stack * - * Purpose: Private function to turn on or off automatic printing of - * errors for certain error stack. When turned on (non-null - * FUNC pointer) any API function which returns an error - * indication will first call FUNC passing it CLIENT_DATA + * Purpose: Private function to turn on or off automatic printing of + * errors for certain error stack. When turned on (non-null + * FUNC pointer) any API function which returns an error + * indication will first call FUNC passing it CLIENT_DATA * as an argument. * * The default values before this function is called are @@ -2493,7 +2493,7 @@ done: * * Automatic stack traversal is always in the H5E_WALK_DOWNWARD * direction. - * + * * See Also: H5Ewalk() * * Return: Non-negative on success/Negative on failure @@ -2530,7 +2530,7 @@ H5E_set_auto_stack(H5E_t *estack, hbool_t new_api, void *func, void *client_data * 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. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol @@ -2574,7 +2574,7 @@ done: * error stack conforms to the H5E_auto_stack_t typedef * or the H5E_auto_t typedef. The IS_STACK parameter is set * to 1 for the first case and 0 for the latter case. - * + * * Return: Non-negative on success/Negative on failure * * Programmer: Quincey Koziol @@ -2589,7 +2589,7 @@ H5Eauto_is_stack(hid_t estack_id, unsigned *is_stack) { H5E_t *estack; /* Error stack to operate on */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Eauto_is_stack, FAIL) H5TRACE2("e","i*Iu",estack_id,is_stack); @@ -2600,7 +2600,7 @@ H5Eauto_is_stack(hid_t estack_id, unsigned *is_stack) else if((estack = H5I_object_verify(estack_id, H5I_ERROR_STACK))==NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a error stack ID") - + /* Check if the error stack reporting function is the "newer" stack type */ if(is_stack) *is_stack=estack->new_api; diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h index a1d8f0b..0c99f9f 100644 --- a/src/H5Eprivate.h +++ b/src/H5Eprivate.h @@ -113,7 +113,7 @@ typedef struct H5E_print_t { /* Library-private functions defined in H5E package */ H5_DLL herr_t H5E_init(void); -H5_DLL herr_t H5E_push_stack(H5E_t *estack, const char *file, const char *func, unsigned line, +H5_DLL herr_t H5E_push_stack(H5E_t *estack, const char *file, const char *func, unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *desc); H5_DLL herr_t H5E_clear_stack(H5E_t *estack); H5_DLL herr_t H5E_dump_api_stack(int is_api); diff --git a/src/H5Epublic.h b/src/H5Epublic.h index 883e8c6..001f0a5 100644 --- a/src/H5Epublic.h +++ b/src/H5Epublic.h @@ -162,10 +162,10 @@ H5_DLL herr_t H5Eauto_is_stack(hid_t err_stack, unsigned *is_stack); /* These old APIs are kept for backward compatibility. They don't have * the error stack in the parameters. */ -H5_DLL herr_t H5Epush(const char *file, const char *func, unsigned line, +H5_DLL herr_t H5Epush(const char *file, const char *func, unsigned line, H5E_major_t maj, H5E_minor_t min, const char *str); H5_DLL herr_t H5Eprint(FILE *stream); -H5_DLL herr_t H5Ewalk(H5E_direction_t direction, H5E_walk_t func, +H5_DLL herr_t H5Ewalk(H5E_direction_t direction, H5E_walk_t func, void *client_data); H5_DLL herr_t H5Eget_auto(H5E_auto_t *func, void **client_data); H5_DLL herr_t H5Eset_auto(H5E_auto_t func, void *client_data); @@ -173,12 +173,12 @@ H5_DLL herr_t H5Eclear(void); H5_DLL const char * H5Eget_major(H5E_major_t maj); H5_DLL const char * H5Eget_minor(H5E_minor_t min); -/* New APIs function the same as the old ones above, with the error stack +/* New APIs function the same as the old ones above, with the error stack * in the parameters */ -H5_DLL herr_t H5Epush_stack(hid_t err_stack, const char *file, const char *func, unsigned line, +H5_DLL herr_t H5Epush_stack(hid_t err_stack, const char *file, const char *func, unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *msg, ...); H5_DLL herr_t H5Eprint_stack(hid_t err_stack, FILE *stream); -H5_DLL herr_t H5Ewalk_stack(hid_t err_stack, H5E_direction_t direction, H5E_walk_t func, +H5_DLL herr_t H5Ewalk_stack(hid_t err_stack, H5E_direction_t direction, H5E_walk_t func, void *client_data); H5_DLL herr_t H5Eget_auto_stack(hid_t estack_id, H5E_auto_stack_t *func, void **client_data); H5_DLL herr_t H5Eset_auto_stack(hid_t estack_id, H5E_auto_stack_t func, void *client_data); diff --git a/src/H5Eterm.h b/src/H5Eterm.h index 987315a..1d89d87 100644 --- a/src/H5Eterm.h +++ b/src/H5Eterm.h @@ -20,168 +20,168 @@ #define _H5Eterm_H /* Reset major error IDs */ - -H5E_DATASET_g= -H5E_FUNC_g= -H5E_STORAGE_g= -H5E_FILE_g= -H5E_FPHDF5_g= -H5E_SYM_g= -H5E_VFL_g= -H5E_INTERNAL_g= -H5E_BTREE_g= -H5E_REFERENCE_g= -H5E_DATASPACE_g= -H5E_RESOURCE_g= -H5E_PLIST_g= -H5E_DATATYPE_g= -H5E_RS_g= -H5E_HEAP_g= -H5E_OHDR_g= -H5E_ATOM_g= -H5E_ATTR_g= -H5E_IO_g= -H5E_BLKTRK_g= -H5E_SLIST_g= -H5E_EFL_g= -H5E_TST_g= -H5E_ARGS_g= -H5E_ERROR_g= -H5E_PLINE_g= + +H5E_DATASET_g= +H5E_FUNC_g= +H5E_STORAGE_g= +H5E_FILE_g= +H5E_FPHDF5_g= +H5E_SYM_g= +H5E_VFL_g= +H5E_INTERNAL_g= +H5E_BTREE_g= +H5E_REFERENCE_g= +H5E_DATASPACE_g= +H5E_RESOURCE_g= +H5E_PLIST_g= +H5E_DATATYPE_g= +H5E_RS_g= +H5E_HEAP_g= +H5E_OHDR_g= +H5E_ATOM_g= +H5E_ATTR_g= +H5E_IO_g= +H5E_BLKTRK_g= +H5E_SLIST_g= +H5E_EFL_g= +H5E_TST_g= +H5E_ARGS_g= +H5E_ERROR_g= +H5E_PLINE_g= H5E_CACHE_g= (-1); /* Reset minor error IDs */ -/* Generic low-level file I/O errors */ -H5E_SEEKERROR_g= -H5E_READERROR_g= -H5E_WRITEERROR_g= -H5E_CLOSEERROR_g= -H5E_OVERFLOW_g= +/* Generic low-level file I/O errors */ +H5E_SEEKERROR_g= +H5E_READERROR_g= +H5E_WRITEERROR_g= +H5E_CLOSEERROR_g= +H5E_OVERFLOW_g= H5E_FCNTL_g= -/* Resource errors */ -H5E_NOSPACE_g= -H5E_CANTCOPY_g= -H5E_CANTFREE_g= -H5E_ALREADYEXISTS_g= -H5E_CANTLOCK_g= -H5E_CANTUNLOCK_g= -H5E_CANTGC_g= +/* Resource errors */ +H5E_NOSPACE_g= +H5E_CANTCOPY_g= +H5E_CANTFREE_g= +H5E_ALREADYEXISTS_g= +H5E_CANTLOCK_g= +H5E_CANTUNLOCK_g= +H5E_CANTGC_g= H5E_CANTGETSIZE_g= -/* Heap errors */ +/* Heap errors */ H5E_CANTRESTORE_g= -/* Function entry/exit interface errors */ -H5E_CANTINIT_g= -H5E_ALREADYINIT_g= +/* Function entry/exit interface errors */ +H5E_CANTINIT_g= +H5E_ALREADYINIT_g= H5E_CANTRELEASE_g= -/* Property list errors */ -H5E_CANTGET_g= -H5E_CANTSET_g= +/* Property list errors */ +H5E_CANTGET_g= +H5E_CANTSET_g= H5E_DUPCLASS_g= -/* Object header related errors */ -H5E_LINKCOUNT_g= -H5E_VERSION_g= -H5E_ALIGNMENT_g= -H5E_BADMESG_g= +/* Object header related errors */ +H5E_LINKCOUNT_g= +H5E_VERSION_g= +H5E_ALIGNMENT_g= +H5E_BADMESG_g= H5E_CANTDELETE_g= -/* FPHDF5 errors */ -H5E_CANTRECV_g= -H5E_CANTSENDMDATA_g= -H5E_CANTCHANGE_g= +/* FPHDF5 errors */ +H5E_CANTRECV_g= +H5E_CANTSENDMDATA_g= +H5E_CANTCHANGE_g= H5E_CANTALLOC_g= -/* System level errors */ +/* System level errors */ H5E_SYSERRSTR_g= -/* I/O pipeline errors */ -H5E_NOFILTER_g= -H5E_CALLBACK_g= -H5E_CANAPPLY_g= -H5E_SETLOCAL_g= +/* I/O pipeline errors */ +H5E_NOFILTER_g= +H5E_CALLBACK_g= +H5E_CANAPPLY_g= +H5E_SETLOCAL_g= H5E_NOENCODER_g= -/* Group related errors */ -H5E_CANTOPENOBJ_g= -H5E_CANTCLOSEOBJ_g= -H5E_COMPLEN_g= -H5E_CWG_g= -H5E_LINK_g= +/* Group related errors */ +H5E_CANTOPENOBJ_g= +H5E_CANTCLOSEOBJ_g= +H5E_COMPLEN_g= +H5E_CWG_g= +H5E_LINK_g= H5E_SLINK_g= -/* File accessability errors */ -H5E_FILEEXISTS_g= -H5E_FILEOPEN_g= -H5E_CANTCREATE_g= -H5E_CANTOPENFILE_g= -H5E_CANTCLOSEFILE_g= -H5E_NOTHDF5_g= -H5E_BADFILE_g= -H5E_TRUNCATED_g= +/* File accessability errors */ +H5E_FILEEXISTS_g= +H5E_FILEOPEN_g= +H5E_CANTCREATE_g= +H5E_CANTOPENFILE_g= +H5E_CANTCLOSEFILE_g= +H5E_NOTHDF5_g= +H5E_BADFILE_g= +H5E_TRUNCATED_g= H5E_MOUNT_g= -/* Object atom related errors */ -H5E_BADATOM_g= -H5E_BADGROUP_g= -H5E_CANTREGISTER_g= -H5E_CANTINC_g= -H5E_CANTDEC_g= +/* Object atom related errors */ +H5E_BADATOM_g= +H5E_BADGROUP_g= +H5E_CANTREGISTER_g= +H5E_CANTINC_g= +H5E_CANTDEC_g= H5E_NOIDS_g= -/* Cache related errors */ -H5E_CANTFLUSH_g= -H5E_CANTSERIALIZE_g= -H5E_CANTLOAD_g= -H5E_PROTECT_g= -H5E_NOTCACHED_g= -H5E_SYSTEM_g= -H5E_CANTINS_g= -H5E_CANTRENAME_g= -H5E_CANTPROTECT_g= +/* Cache related errors */ +H5E_CANTFLUSH_g= +H5E_CANTSERIALIZE_g= +H5E_CANTLOAD_g= +H5E_PROTECT_g= +H5E_NOTCACHED_g= +H5E_SYSTEM_g= +H5E_CANTINS_g= +H5E_CANTRENAME_g= +H5E_CANTPROTECT_g= H5E_CANTUNPROTECT_g= -/* Parallel MPI errors */ -H5E_MPI_g= +/* Parallel MPI errors */ +H5E_MPI_g= H5E_MPIERRSTR_g= -/* Block tracker errors */ +/* Block tracker errors */ H5E_OVERLAPS_g= -/* Dataspace errors */ -H5E_CANTCLIP_g= -H5E_CANTCOUNT_g= -H5E_CANTSELECT_g= -H5E_CANTNEXT_g= -H5E_BADSELECT_g= +/* Dataspace errors */ +H5E_CANTCLIP_g= +H5E_CANTCOUNT_g= +H5E_CANTSELECT_g= +H5E_CANTNEXT_g= +H5E_BADSELECT_g= H5E_CANTCOMPARE_g= -/* B-tree related errors */ -H5E_NOTFOUND_g= -H5E_EXISTS_g= -H5E_CANTENCODE_g= -H5E_CANTDECODE_g= -H5E_CANTSPLIT_g= -H5E_CANTREDISTRIBUTE_g= -H5E_CANTSWAP_g= -H5E_CANTINSERT_g= -H5E_CANTLIST_g= +/* B-tree related errors */ +H5E_NOTFOUND_g= +H5E_EXISTS_g= +H5E_CANTENCODE_g= +H5E_CANTDECODE_g= +H5E_CANTSPLIT_g= +H5E_CANTREDISTRIBUTE_g= +H5E_CANTSWAP_g= +H5E_CANTINSERT_g= +H5E_CANTLIST_g= H5E_CANTMODIFY_g= -/* Argument errors */ -H5E_UNINITIALIZED_g= -H5E_UNSUPPORTED_g= -H5E_BADTYPE_g= -H5E_BADRANGE_g= +/* Argument errors */ +H5E_UNINITIALIZED_g= +H5E_UNSUPPORTED_g= +H5E_BADTYPE_g= +H5E_BADRANGE_g= H5E_BADVALUE_g= -/* Datatype conversion errors */ -H5E_CANTCONVERT_g= +/* Datatype conversion errors */ +H5E_CANTCONVERT_g= H5E_BADSIZE_g= (-1); #endif /* H5Eterm_H */ diff --git a/src/H5F.c b/src/H5F.c index 61d38d5..285bb41 100644 --- a/src/H5F.c +++ b/src/H5F.c @@ -58,7 +58,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 @@ -143,10 +143,10 @@ done: * J. Mainzer, 2005-03-10 * Updated function for changes in property list entries required * by the new metadata cache. - * + * *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5F_init_interface(void) { size_t nprops; /* Number of properties */ @@ -154,7 +154,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 @@ -162,7 +162,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; @@ -174,7 +174,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 * - Initial metadata cache resize configuration * - Size of raw data chunk cache(elements) @@ -186,10 +186,10 @@ 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; - H5AC_cache_config_t + H5AC_cache_config_t mdc_initCacheCfg = H5F_ACS_META_CACHE_INIT_CONFIG_DEF; size_t rdcc_nelmts = H5F_ACS_DATA_CACHE_ELMT_SIZE_DEF; size_t rdcc_nbytes = H5F_ACS_DATA_CACHE_BYTE_SIZE_DEF; @@ -208,13 +208,13 @@ H5F_init_interface(void) hbool_t family_to_sec2 = H5F_ACS_FAMILY_TO_SEC2_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_register_type(H5I_FILE, (size_t)H5I_FILEID_HASHSIZE, 0, (H5I_free_t)H5F_close) 0) { /* Set the driver for the property list */ if(H5FD_fapl_open(plist, driver_id, driver_info)<0) @@ -496,7 +496,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. * @@ -505,12 +505,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; @@ -531,7 +531,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) @@ -545,24 +545,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; @@ -673,7 +673,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; @@ -732,11 +732,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) } @@ -763,7 +763,7 @@ 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 @@ -772,12 +772,12 @@ done: * weren't being close. * * J Mainzer, Mar 10, 2005 - * Updated function for changes in the property list entries + * Updated function for changes in the property list entries * used by the new metadata cache. - * + * * Quincey Koziol, May 25, 2005 * Extracted guts into new internal routine. - * + * *------------------------------------------------------------------------- */ hid_t @@ -785,7 +785,7 @@ H5Fget_access_plist(hid_t file_id) { H5F_t *f = NULL; hid_t ret_value = SUCCEED; - + FUNC_ENTER_API(H5Fget_access_plist, FAIL) H5TRACE1("i","i",file_id); @@ -822,7 +822,7 @@ done: * Wednesday, May 25, 2005 * * Modifications: - * + * *------------------------------------------------------------------------- */ hid_t @@ -830,9 +830,9 @@ H5F_get_access_plist(H5F_t *f) { H5P_genplist_t *new_plist; /* New property list */ H5P_genplist_t *old_plist; /* Old property list */ - void *driver_info=NULL; + void *driver_info=NULL; hid_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5F_get_access_plist, FAIL) /* Check args */ @@ -893,7 +893,7 @@ H5F_get_access_plist(H5F_t *f) 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_NOAPI(ret_value) @@ -903,11 +903,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 * @@ -1006,20 +1006,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); @@ -1031,10 +1031,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 @@ -1075,28 +1075,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; @@ -1111,9 +1111,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. * @@ -1129,13 +1129,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) )) @@ -1179,12 +1179,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) { @@ -1213,10 +1213,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 * @@ -1229,7 +1229,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); @@ -1263,7 +1263,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; @@ -1419,11 +1419,11 @@ 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. * * J Mainzer, Mar 10, 2005 - * Updated for the new metadata cache, and associated + * Updated for the new metadata cache, and associated * property list changes. * *------------------------------------------------------------------------- @@ -1433,7 +1433,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))) @@ -1448,7 +1448,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 @@ -1493,7 +1493,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) @@ -1519,7 +1519,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 */ @@ -1531,7 +1531,7 @@ done: H5FL_FREE(H5F_file_t,f->shared); H5FL_FREE(H5F_t,f); } - + FUNC_LEAVE_NOAPI(ret_value) } @@ -1574,7 +1574,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 */ @@ -1628,7 +1628,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. @@ -1718,7 +1718,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 @@ -1855,9 +1855,9 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d /* This step is for h5repart tool only. If user wants to change file driver from * family to sec2 while using h5repart, this private property should be set so that - * in the later step, the library can ignore the family driver information saved + * in the later step, the library can ignore the family driver information saved * in the superblock. - */ + */ if(H5P_exist_plist(a_plist, H5F_ACS_FAMILY_TO_SEC2_NAME) > 0) if(H5P_get(a_plist, H5F_ACS_FAMILY_TO_SEC2_NAME, &fam_sec2) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get property of changing family to sec2") @@ -1953,8 +1953,8 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "unable to read superblock") } - /* The following barrier ensures that all set eoa operations - * associated with creating the superblock are complete before + /* The following barrier ensures that all set eoa operations + * associated with creating the superblock are complete before * we attempt any allocations. * JRM - 4/13/04 */ @@ -1981,10 +1981,10 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d if (H5F_read_superblock(file, dxpl_id, &root_ent, HADDR_UNDEF, NULL, (size_t)0) < 0) HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "unable to read superblock") -#ifdef H5_HAVE_FPHDF5 +#ifdef H5_HAVE_FPHDF5 if (H5FD_is_fphdf5_driver(lf)) { - /* reading the superblock generates lots of set_eoa calls. To avoid - * race conditions with allocations, make sure that everyone is done + /* reading the superblock generates lots of set_eoa calls. To avoid + * race conditions with allocations, make sure that everyone is done * reading the superblock before we proceed. */ if ( (mrc = MPI_Barrier(H5FP_SAP_BARRIER_COMM)) != MPI_SUCCESS ) { @@ -2000,7 +2000,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. */ @@ -2061,10 +2061,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. @@ -2078,9 +2078,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. * *------------------------------------------------------------------------- @@ -2170,7 +2170,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. @@ -2258,7 +2258,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); @@ -2346,10 +2346,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 * @@ -2360,14 +2360,14 @@ 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. * * John Mainzer, 2005-01-07 * H5AC (and H5C) now have their own system of flags. Hence - * we must now translate between the H5F_FLUSH flags and the + * we must now translate between the H5F_FLUSH flags and the * H5AC flags. Added code to handle this detail. * *------------------------------------------------------------------------- @@ -2626,16 +2626,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; @@ -2679,7 +2679,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) @@ -2820,7 +2820,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); @@ -3225,7 +3225,7 @@ hid_t H5F_get_id(H5F_t *file) { hid_t ret_value; - + FUNC_ENTER_NOAPI_NOINIT(H5F_get_id) assert(file); @@ -3239,7 +3239,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: @@ -3263,7 +3263,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 */ @@ -3290,7 +3290,7 @@ H5F_get_base_addr(const H5F_t *f) * *------------------------------------------------------------------------- */ -haddr_t +haddr_t H5F_get_eoa(const H5F_t *f) { haddr_t ret_value; @@ -3334,7 +3334,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") @@ -3368,7 +3368,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") @@ -3483,7 +3483,7 @@ H5F_get_fcpl(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 * @@ -3538,8 +3538,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 * @@ -3722,7 +3722,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Fget_filesize * - * Purpose: Retrieves the file size of the HDF5 file. This function + * Purpose: Retrieves the file size of the HDF5 file. This function * is called after an existing file is opened in order * to learn the true size of the underlying file. * @@ -3769,7 +3769,7 @@ done: * from the metadata cache, and return it in *config_ptr. * * Note that the version field of *config_Ptr must be correctly - * filled in by the caller. This allows us to adapt for + * filled in by the caller. This allows us to adapt for * obsolete versions of the structure. * * Return: Success: SUCCEED @@ -3803,7 +3803,7 @@ H5Fget_mdc_config(hid_t file_id, HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID") } - if ( ( NULL == config_ptr ) || + if ( ( NULL == config_ptr ) || ( config_ptr->version != H5AC__CURR_CACHE_CONFIG_VERSION ) ) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Bad config_ptr") @@ -3828,8 +3828,8 @@ done: /*------------------------------------------------------------------------- * Function: H5Fset_mdc_config * - * Purpose: Sets the current metadata cache automatic resize - * configuration, using the contents of the instance of + * Purpose: Sets the current metadata cache automatic resize + * configuration, using the contents of the instance of * H5AC_cache_config_t pointed to by config_ptr. * * Return: Success: SUCCEED @@ -3883,7 +3883,7 @@ done: * * Purpose: Retrieves the current hit rate from the metadata cache. * This rate is the overall hit rate since the last time - * the hit rate statistics were reset either manually or + * the hit rate statistics were reset either manually or * automatically. * * Return: Success: SUCCEED @@ -3900,7 +3900,7 @@ done: */ herr_t -H5Fget_mdc_hit_rate(hid_t file_id, +H5Fget_mdc_hit_rate(hid_t file_id, double *hit_rate_ptr) { H5F_t *file=NULL; /* File object for file ID */ @@ -3942,8 +3942,8 @@ done: * * Purpose: Retrieves the maximum size, minimum clean size, current * size, and current number of entries from the metadata - * cache associated with the specified file. If any of - * the ptr parameters are NULL, the associated datum is + * cache associated with the specified file. If any of + * the ptr parameters are NULL, the associated datum is * not returned. * * Return: Success: SUCCEED @@ -3960,7 +3960,7 @@ done: */ herr_t -H5Fget_mdc_size(hid_t file_id, +H5Fget_mdc_size(hid_t file_id, size_t *max_size_ptr, size_t *min_clean_size_ptr, size_t *cur_size_ptr, @@ -4009,7 +4009,7 @@ done: * Function: H5Freset_mdc_hit_rate_stats * * Purpose: Reset the hit rate statistic whose current value can - * be obtained via the H5Fget_mdc_hit_rate() call. Note + * be obtained via the H5Fget_mdc_hit_rate() call. Note * that this statistic will also be reset once per epoch * by the automatic cache resize code if it is enabled. * @@ -4054,7 +4054,7 @@ H5Freset_mdc_hit_rate_stats(hid_t file_id) HGOTO_ERROR(H5E_CACHE, H5E_SYSTEM, FAIL, \ "H5AC_reset_cache_hit_rate_stats() failed."); } - + done: @@ -4073,8 +4073,8 @@ done: * just returning the number of characters required to store the name. * If an error occurs then the buffer pointed to by `name' (NULL or non-NULL) * is unchanged and the function returns a negative value. - * - * Return: Success: The length of the file name + * + * Return: Success: The length of the file name * Failure: Negative * * Programmer: Raymond Lu diff --git a/src/H5FD.c b/src/H5FD.c index 599f73c..6474446 100644 --- a/src/H5FD.c +++ b/src/H5FD.c @@ -397,9 +397,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. * *------------------------------------------------------------------------- @@ -460,7 +460,7 @@ hsize_t H5FD_sb_size(H5FD_t *file) { hsize_t ret_value=0; - + FUNC_ENTER_NOAPI(H5FD_sb_size, 0) assert(file && file->cls); @@ -505,7 +505,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) } @@ -567,7 +567,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 */ @@ -661,7 +661,7 @@ void * H5FD_fapl_get(H5FD_t *file) { void *ret_value=NULL; - + FUNC_ENTER_NOAPI(H5FD_fapl_get, NULL) assert(file); @@ -695,7 +695,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 */ @@ -737,7 +737,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 */ @@ -780,7 +780,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") @@ -812,7 +812,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 */ @@ -820,7 +820,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") @@ -854,7 +854,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 */ @@ -897,7 +897,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") @@ -999,9 +999,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. * *------------------------------------------------------------------------- @@ -1012,17 +1012,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") @@ -1034,7 +1034,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; @@ -1152,7 +1152,7 @@ H5FD_close(H5FD_t *file) { const H5FD_class_t *driver; herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5FD_close, FAIL) /* check args */ @@ -1278,10 +1278,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: @@ -1362,10 +1362,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: @@ -1398,7 +1398,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); @@ -1455,7 +1455,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); @@ -1535,9 +1535,9 @@ H5FD_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) if ( H5FD_is_fphdf5_driver(file) && !H5FD_fphdf5_is_sap(file) ) { haddr_t addr; - if ( (addr = H5FP_client_alloc(file, type, dxpl_id, size)) + if ( (addr = H5FP_client_alloc(file, type, dxpl_id, size)) == HADDR_UNDEF) { - HGOTO_ERROR(H5E_FPHDF5, H5E_CANTALLOC, HADDR_UNDEF, + HGOTO_ERROR(H5E_FPHDF5, H5E_CANTALLOC, HADDR_UNDEF, "allocation failed.") } else { HGOTO_DONE(addr) @@ -1561,7 +1561,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); @@ -1778,7 +1778,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") @@ -2060,7 +2060,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 @@ -2192,7 +2192,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") @@ -2238,7 +2238,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 */ @@ -2447,7 +2447,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; @@ -2463,7 +2463,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") @@ -2546,12 +2546,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)); @@ -2563,7 +2563,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") @@ -2975,7 +2975,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") @@ -3015,7 +3015,7 @@ haddr_t H5FDget_eof(H5FD_t *file) { haddr_t ret_value; - + FUNC_ENTER_API(H5FDget_eof, HADDR_UNDEF) H5TRACE1("a","x",file); @@ -3056,7 +3056,7 @@ H5FD_get_eof(const 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))) @@ -3384,7 +3384,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. */ @@ -3734,7 +3734,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. @@ -3751,7 +3751,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); @@ -3768,7 +3768,7 @@ done: * Purpose: Retrieve the file handle for file driver. * * Return: Non-negative if succeed; negative if fails. - * + * * Programmer: Raymond Lu * Sep. 16, 2002 * @@ -3779,7 +3779,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); @@ -3788,7 +3788,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 b72887c..492e06f 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(const H5FD_t *_file) haddr_t ret_value; /* Return value */ const H5FD_core_t *file = (const 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 73cb11c..832495f 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 */ @@ -60,7 +60,7 @@ typedef struct H5FD_family_t { hid_t memb_fapl_id; /*file access property list for members */ hsize_t memb_size; /*actual size of each member file */ hsize_t pmem_size; /*member size passed in from property */ - hsize_t mem_newsize; /*new member size passed in as private property. + hsize_t mem_newsize; /*new member size passed in as private property. *It's used only by h5repart */ unsigned nmembs; /*number of family members */ unsigned amembs; /*number of member slots allocated */ @@ -90,7 +90,7 @@ static herr_t H5FD_family_dxpl_free(void *_dx); static hsize_t H5FD_family_sb_size(H5FD_t *_file); static herr_t H5FD_family_sb_encode(H5FD_t *_file, char *name/*out*/, unsigned char *buf/*out*/); -static herr_t H5FD_family_sb_decode(H5FD_t *_file, const char *name, +static herr_t H5FD_family_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf); static H5FD_t *H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); @@ -146,7 +146,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 @@ -242,9 +242,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. * *------------------------------------------------------------------------- @@ -255,11 +255,11 @@ H5Pset_fapl_family(hid_t fapl_id, hsize_t msize, hid_t memb_fapl_id) herr_t ret_value; H5FD_family_fapl_t fa={0, -1}; H5P_genplist_t *plist; /* Property list pointer */ - + FUNC_ENTER_API(H5Pset_fapl_family, FAIL) H5TRACE3("e","ihi",fapl_id,msize,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") @@ -300,9 +300,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. * *------------------------------------------------------------------------- @@ -314,7 +314,7 @@ H5Pget_fapl_family(hid_t fapl_id, hsize_t *msize/*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,msize,memb_fapl_id); @@ -583,7 +583,7 @@ H5FD_family_sb_size(H5FD_t UNUSED *_file) FUNC_ENTER_NOAPI(H5FD_family_sb_size, UFAIL) - /* 8 bytes field for the size of member file size field should be + /* 8 bytes field for the size of member file size field should be * enough for now. */ ret_value += 8; @@ -630,7 +630,7 @@ H5FD_family_sb_encode(H5FD_t *_file, char *name/*out*/, /* copy member file size */ msize = (uint64_t)file->memb_size; UINT64ENCODE(p, msize); - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -639,11 +639,11 @@ done: /*------------------------------------------------------------------------- * Function: H5FD_family_sb_decode * - * Purpose: This function has 2 seperate purpose. One is to decodes the - * superblock information for this driver. The NAME argument is + * Purpose: This function has 2 seperate purpose. One is to decodes the + * superblock information for this driver. The NAME argument is * the eight-character (plus null termination) name stored in i - * the file. The FILE argument is updated according to the - * information in the superblock. + * the file. The FILE argument is updated according to the + * information in the superblock. * * Return: Success: 0 * @@ -663,14 +663,14 @@ H5FD_family_sb_decode(H5FD_t *_file, const char UNUSED *name, const unsigned cha uint64_t msize = 0; char err_msg[128]; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5FD_family_sb_decode, FAIL) /* Read member file size. Skip name template for now although it's saved. */ UINT64DECODE(buf, msize); - - /* For h5repart only. Private property of new member size is used to signal - * h5repart is being used to change member file size. h5repart will open + + /* For h5repart only. Private property of new member size is used to signal + * h5repart is being used to change member file size. h5repart will open * files for read and write. When the files are closed, metadata will be * flushed to the files and updated this new size */ if(file->mem_newsize) { @@ -678,7 +678,7 @@ H5FD_family_sb_decode(H5FD_t *_file, const char UNUSED *name, const unsigned cha HGOTO_DONE(ret_value) } - /* Default - use the saved member size */ + /* Default - use the saved member size */ if(file->pmem_size == H5F_FAMILY_DEFAULT) { file->pmem_size = msize; } @@ -690,7 +690,7 @@ H5FD_family_sb_decode(H5FD_t *_file, const char UNUSED *name, const unsigned cha } /* Update member file size to the size saved in the superblock. - * That's the size intended to be. */ + * That's the size intended to be. */ file->memb_size = msize; done: @@ -716,17 +716,17 @@ 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. * * Raymond Lu * Tuesday, May 24, 2005 * The modification described above has been changed. The major checking - * is done in H5F_read_superblock. Member file size is saved in the + * is done in H5F_read_superblock. Member file size is saved in the * superblock now. H5F_read_superblock() reads this saved size and compare - * to the size passed in from file access property. Wrong size will + * to the size passed in from file access property. Wrong size will * result in a failure. * *------------------------------------------------------------------------- @@ -767,7 +767,7 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, if(NULL == (plist = H5I_object(fapl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a file access property list") fa = H5P_get_driver_info(plist); - + /* New family file size. It's used by h5repart only. */ if(H5P_exist_plist(plist, H5F_ACS_FAMILY_NEWSIZE_NAME) > 0) if(H5P_get(plist, H5F_ACS_FAMILY_NEWSIZE_NAME, &fam_newsize) < 0) @@ -789,11 +789,11 @@ 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); - + if (!strcmp(memb_name, temp)) HGOTO_ERROR(H5E_FILE, H5E_FILEEXISTS, NULL, "file names not unique") @@ -811,7 +811,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. @@ -830,7 +830,7 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, file->nmembs++; } - /* If the file is reopened and there's only one member file existing, this file maybe + /* If the file is reopened and there's only one member file existing, this file maybe * smaller than the size specified through H5Pset_fapl_family(). Update the actual * member size. */ @@ -949,7 +949,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: @@ -986,7 +986,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 */ @@ -1084,7 +1084,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) { @@ -1163,27 +1163,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 */ @@ -1259,7 +1259,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) @@ -1336,7 +1336,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/H5FDfphdf5.c b/src/H5FDfphdf5.c index de25c33..c600715 100644 --- a/src/H5FDfphdf5.c +++ b/src/H5FDfphdf5.c @@ -122,7 +122,7 @@ NAME H5FD_fphdf5_init_interface -- Initialize interface-specific information USAGE herr_t H5FD_fphdf5_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -231,7 +231,7 @@ H5Pset_fapl_fphdf5(hid_t fapl_id, MPI_Comm comm, MPI_Comm barrier_comm, H5P_genplist_t *plist; int mrc, comm_size; herr_t ret_value; - + FUNC_ENTER_API(H5Pset_fapl_fphdf5, FAIL) H5TRACE5("e","iMcMcMiIu",fapl_id,comm,barrier_comm,info,sap_rank); @@ -284,7 +284,7 @@ H5Pget_fapl_fphdf5(hid_t fapl_id, MPI_Comm *comm, MPI_Comm *barrier_comm, H5FD_fphdf5_fapl_t *fa; H5P_genplist_t *plist; herr_t ret_value = SUCCEED; - + FUNC_ENTER_API(H5Pget_fapl_fphdf5, FAIL) H5TRACE6("e","i*Mc*Mc*Mi*Iu*Iu",fapl_id,comm,barrier_comm,info,sap_rank, capt_rank); @@ -332,7 +332,7 @@ unsigned H5FD_fphdf5_file_id(H5FD_t *_file) { H5FD_fphdf5_t *file = (H5FD_fphdf5_t*)_file; - unsigned ret_value; + unsigned ret_value; FUNC_ENTER_NOAPI(H5FD_fphdf5_file_id, 0) @@ -464,7 +464,7 @@ H5Pset_dxpl_fphdf5(hid_t dxpl_id, H5FD_mpio_xfer_t xfer_mode) FUNC_ENTER_API(H5Pset_dxpl_fphdf5, 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") @@ -950,17 +950,17 @@ done: * Modifications: *------------------------------------------------------------------------- */ -static herr_t +static herr_t H5FD_fphdf5_get_handle(H5FD_t *_file, hid_t UNUSED fapl, void** file_handle) -{ +{ H5FD_fphdf5_t *file = (H5FD_fphdf5_t *)_file; herr_t ret_value = SUCCEED; - + FUNC_ENTER_NOAPI(H5FD_fphdf5_get_handle, FAIL) /* check args */ assert(file); - + if (!file_handle) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "file handle not valid") @@ -1496,7 +1496,7 @@ static int H5FD_fphdf5_mpi_size(const H5FD_t *_file) { const H5FD_fphdf5_t *file = (const H5FD_fphdf5_t*)_file; - int ret_value; + int ret_value; FUNC_ENTER_NOAPI(H5FD_fphdf5_mpi_size, FAIL) diff --git a/src/H5FDlog.c b/src/H5FDlog.c index 75c3c20..5725f87 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 @@ -326,7 +326,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 @@ -337,7 +337,7 @@ H5FD_log_term(void) * * Raymond Lu, 2001-10-25 * Changed the file access list to the new generic property list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -349,10 +349,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; @@ -420,7 +420,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); @@ -976,36 +976,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 @@ -1034,7 +1034,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); @@ -1111,7 +1111,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; @@ -1153,7 +1153,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); @@ -1165,13 +1165,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; @@ -1212,7 +1212,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); @@ -1252,7 +1252,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 920d1e2..f285f1a 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 b6bfa80..16c4de6 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 @@ -361,7 +361,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); @@ -392,7 +392,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 @@ -420,7 +420,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); @@ -485,7 +485,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 */ @@ -519,7 +519,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)))) @@ -621,7 +621,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; @@ -734,7 +734,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") } @@ -1048,26 +1048,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") @@ -1157,7 +1157,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; @@ -1217,13 +1217,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") @@ -1288,7 +1288,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 155ec68..71b5c91 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -78,10 +78,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; } @@ -867,7 +867,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. */ @@ -925,7 +925,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_multi_fapl_t *new_fa = malloc(sizeof(H5FD_multi_fapl_t)); int nerrors = 0; static const char *func="H5FD_multi_fapl_copy"; /* Function Name for error reporting */ - + assert(new_fa); /* Clear the error stack */ @@ -1118,7 +1118,7 @@ H5FD_multi_dxpl_copy(const void *_old_dx) H5FD_multi_dxpl_t *new_dx = malloc(sizeof(H5FD_multi_dxpl_t)); 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_stack(H5E_DEFAULT); @@ -1500,7 +1500,7 @@ H5FD_multi_set_eoa(H5FD_t *_file, haddr_t eoa) if (status<0) H5Epush_ret(func, H5E_ERR_CLS, H5E_FILE, H5E_BADVALUE, "member H5FDset_eoa failed", -1) } - + /* Save new eoa for return later */ file->eoa = eoa; @@ -1545,7 +1545,7 @@ H5FD_multi_get_eof(const H5FD_t *_file) if (HADDR_UNDEF==tmp) H5Epush_ret(func, H5E_ERR_CLS, 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 @@ -1553,27 +1553,27 @@ H5FD_multi_get_eof(const H5FD_t *_file) */ tmp = file->memb_next[mt]; assert(HADDR_UNDEF!=tmp); - + } else { H5Epush_ret(func, H5E_ERR_CLS, 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: * @@ -1581,7 +1581,7 @@ H5FD_multi_get_eof(const 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 */ @@ -1593,7 +1593,7 @@ H5FD_multi_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle) H5Epush_ret(func, H5E_ERR_CLS, 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)); } @@ -1624,7 +1624,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_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file can't alloc", HADDR_UNDEF) addr += file->fa.memb_addr[mmt]; @@ -1660,7 +1660,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); @@ -1702,7 +1702,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]; @@ -1757,7 +1757,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]; @@ -1804,7 +1804,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"); @@ -1821,7 +1821,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]); @@ -1847,7 +1847,7 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing) } if (nerrors) H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "error flushing member files", -1) - + return 0; } @@ -1878,7 +1878,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] && @@ -1891,7 +1891,7 @@ compute_next(H5FD_multi_t *file) file->memb_next[mt1] = HADDR_MAX; /*last member*/ } } END_MEMBERS; - + return 0; } @@ -1918,7 +1918,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_stack(H5E_DEFAULT); diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h index 94e215b..285404a 100644 --- a/src/H5FDpublic.h +++ b/src/H5FDpublic.h @@ -115,7 +115,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. @@ -139,7 +139,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 41c9e62..f45deb1 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/H5FDstdio.c b/src/H5FDstdio.c index 99aae42..fc7dd1c 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -115,7 +115,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. @@ -254,7 +254,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 @@ -277,7 +277,7 @@ H5Pset_fapl_stdio(hid_t fapl_id) if(0 == H5Pisa_class(fapl_id, H5P_FILE_ACCESS)) H5Epush_ret(func, H5E_ERR_CLS, H5E_PLIST, H5E_BADTYPE, "not a file access property list", -1) - + return H5Pset_driver(fapl_id, H5FD_STDIO, NULL); } @@ -291,10 +291,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 @@ -402,7 +402,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 * @@ -622,34 +622,34 @@ H5FD_stdio_get_eof(const 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_stack(H5E_DEFAULT); *file_handle = &(file->fp); if(*file_handle==NULL) H5Epush_ret(func, H5E_ERR_CLS, H5E_IO, H5E_WRITEERROR, "get handle failed", -1) - return(0); + return(0); } @@ -661,8 +661,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 * @@ -693,7 +693,7 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz H5Eclear_stack(H5E_DEFAULT); /* Check for overflow */ - if (HADDR_UNDEF==addr) + if (HADDR_UNDEF==addr) H5Epush_ret (func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1) if (REGION_OVERFLOW(addr, size)) H5Epush_ret (func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1) @@ -729,7 +729,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 @@ -743,7 +743,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. */ @@ -760,8 +760,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 * @@ -797,7 +797,7 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, H5Epush_ret (func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1) if (addr+size>file->eoa) H5Epush_ret (func, H5E_ERR_CLS, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1) - + /* * Seek to the correct file position. */ @@ -810,7 +810,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 @@ -821,7 +821,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_ERR_CLS, H5E_IO, H5E_WRITEERROR, "fwrite failed", -1) } - + /* * Update seek optimizing data. */ @@ -842,8 +842,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 d23db5b..a798539 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 450726b..e59d092 100644 --- a/src/H5FDstream.h +++ b/src/H5FDstream.h @@ -18,7 +18,7 @@ #ifdef H5_HAVE_STREAM # define H5FD_STREAM (H5FD_stream_init()) -#else +#else # define H5FD_STREAM (-1) #endif /*H5_HAVE_STREAM */ diff --git a/src/H5FL.c b/src/H5FL.c index 40483c8..cc9edb5 100644 --- a/src/H5FL.c +++ b/src/H5FL.c @@ -118,7 +118,7 @@ NAME H5FL_init_interface -- Initialize interface-specific information USAGE herr_t H5FL_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -151,7 +151,7 @@ H5FL_init_interface(void) * Tuesday, August 1, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static void * @@ -190,7 +190,7 @@ done: * Friday, March 24, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -236,7 +236,7 @@ done: * Friday, March 24, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -302,7 +302,7 @@ done: * Friday, March 24, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -362,7 +362,7 @@ done: * Monday, December 23, 2002 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -399,7 +399,7 @@ done: * Tuesday, July 25, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -408,7 +408,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 */ @@ -458,7 +458,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 @@ -466,7 +466,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 */ @@ -618,7 +618,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() */ @@ -651,7 +651,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; @@ -688,7 +688,7 @@ done: * Saturday, March 25, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -814,7 +814,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") @@ -1034,7 +1034,7 @@ H5FL_blk_unlink(H5FL_blk_head_t *pq) herr_t ret_value=SUCCEED; /* Return value */ FUNC_ENTER_NOAPI_NOINIT(H5FL_blk_unlink) - + /* Find the node to remove from the global list */ last=NULL; tmp=H5FL_blk_gc_head.first; @@ -1079,7 +1079,7 @@ done: * Thursday, March 23, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1088,7 +1088,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 */ @@ -1143,7 +1143,7 @@ H5FL_blk_gc_list(H5FL_blk_head_t *head) * Saturday, March 25, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1151,7 +1151,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 */ @@ -1199,7 +1199,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) { @@ -1229,7 +1229,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() */ @@ -1247,7 +1247,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 @@ -1277,7 +1277,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; @@ -1298,7 +1298,7 @@ done: * Friday, March 24, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1374,7 +1374,7 @@ done: * Saturday, March 25, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1449,7 +1449,7 @@ done: * Monday, December 23, 2002 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1487,7 +1487,7 @@ done: * Saturday, March 25, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1548,7 +1548,7 @@ done: * Tuesday, July 25, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1558,7 +1558,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 */ @@ -1610,7 +1610,7 @@ H5FL_arr_gc_list(H5FL_arr_head_t *head) * Saturday, March 25, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -1618,7 +1618,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 */ @@ -1664,7 +1664,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 */ @@ -1698,7 +1698,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() */ @@ -1715,7 +1715,7 @@ printf("H5FL_arr_term: head->name=%s, head->allocated=%d\n", H5FL_arr_gc_head.fi * Saturday, April 3, 2004 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1749,7 +1749,7 @@ H5FL_seq_free(H5FL_seq_head_t *head, void *obj) * Saturday, April 3, 2004 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1783,7 +1783,7 @@ done: * Saturday, April 3, 2004 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1817,7 +1817,7 @@ done: * Saturday, April 3, 2004 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1851,7 +1851,7 @@ done: * Wednesday, February 2, 2005 * * Modifications: - * + * *------------------------------------------------------------------------- */ H5FL_fac_head_t * @@ -1868,7 +1868,7 @@ H5FL_fac_init(size_t size) /* Allocate room for the new factory */ if(NULL==(factory=H5FL_MALLOC(H5FL_fac_head_t))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for factory object") - + /* Initialize block header information */ HDmemset(&(factory->queue),0,sizeof(H5FL_blk_head_t)); @@ -1895,7 +1895,7 @@ done: * Wednesday, February 2, 2005 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1929,7 +1929,7 @@ H5FL_fac_free(H5FL_fac_head_t *head, void *obj) * Wednesday, February 2, 2005 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1962,7 +1962,7 @@ done: * Wednesday, February 2, 2005 * * Modifications: - * + * *------------------------------------------------------------------------- */ void * @@ -1995,7 +1995,7 @@ done: * Wednesday, February 2, 2005 * * Modifications: - * + * *------------------------------------------------------------------------- */ herr_t @@ -2039,7 +2039,7 @@ done: * Friday, March 24, 2000 * * Modifications: - * + * *------------------------------------------------------------------------- */ herr_t @@ -2095,7 +2095,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) { @@ -2145,7 +2145,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 4c8fa94..b7b2030 100644 --- a/src/H5FLprivate.h +++ b/src/H5FLprivate.h @@ -134,7 +134,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/H5FP.c b/src/H5FP.c index 0497cb1..6d85b88 100644 --- a/src/H5FP.c +++ b/src/H5FP.c @@ -335,7 +335,7 @@ done: /* * Function: H5FP_commit_sap_datatypes - * Purpose: Commit the H5FP_request, H5FP_reply, H5FP_read, + * Purpose: Commit the H5FP_request, H5FP_reply, H5FP_read, * H5FP_alloc, H5FP_eoa and H5FP_super structure datatypes * to MPI. * Return: Success: SUCCEED diff --git a/src/H5FPclient.c b/src/H5FPclient.c index a01bfaf..274324a 100644 --- a/src/H5FPclient.c +++ b/src/H5FPclient.c @@ -327,7 +327,7 @@ H5FP_request_read_metadata(H5FD_t *file, unsigned file_id, hid_t dxpl_id, HDmemset(&mpi_status, 0, sizeof(mpi_status)); /* the following code is a bit odd and doubtless needs a bit - * of explanation. I certainly stumbled over it the first + * of explanation. I certainly stumbled over it the first * time I read it. * * For reasons unknown, read requests sent to the SAP only @@ -345,7 +345,7 @@ H5FP_request_read_metadata(H5FD_t *file, unsigned file_id, hid_t dxpl_id, * * JRM - 4/13/04 */ - if (size < sap_read.md_size) + if (size < sap_read.md_size) { char *mdata; @@ -361,7 +361,7 @@ HDfprintf(stderr, "Metadata Read Failed!!!!\n"); H5FP_SAP_COMM, &mpi_status)) != MPI_SUCCESS) HMPI_GOTO_ERROR(FAIL, "MPI_Recv failed", mrc); } else { - HDfprintf(stdout, + HDfprintf(stdout, "H5FP_request_read_metadata: size = %d > md_size = %d.\n", (int)size, (int)(sap_read.md_size)); HDfprintf(stdout, "Mssg received from SAP is too small!!!!\n"); @@ -569,7 +569,7 @@ H5FP_request_flush_metadata(H5FD_t *file, unsigned file_id, hid_t dxpl_id, if ((mrc = MPI_Recv(&sap_reply, 1, H5FP_reply, (int)H5FP_sap_rank, H5FP_TAG_REPLY, H5FP_SAP_COMM, &mpi_status)) != MPI_SUCCESS) HMPI_GOTO_ERROR(FAIL, "MPI_Recv failed", mrc); - + if (sap_reply.status != H5FP_STATUS_OK) HGOTO_ERROR(H5E_RESOURCE, H5E_CANTCHANGE, FAIL, "can't write metadata to server"); @@ -649,15 +649,15 @@ done: /* * Function: H5FP_client_alloc * Purpose: Handle the client side of an allocation in the FP case. - * In essence, this is simply a matter of referring the + * In essence, this is simply a matter of referring the * request to the SAP, and then returning the reply. * * A modified version of this code used to live in H5FD_alloc(), * but I move it here to encapsulate it and generally tidy up. - * - * One can argue that we should all be done in an alloc - * routine in H5FDfdhdf5.c, but this invlves a smaller - * change to the code, and thus a smaller loss if I missed + * + * One can argue that we should all be done in an alloc + * routine in H5FDfdhdf5.c, but this invlves a smaller + * change to the code, and thus a smaller loss if I missed * a major gotcha. If things go well, and we don't heave * the current implementation of FP, I'll probably go that * route eventually. @@ -707,14 +707,14 @@ H5FP_client_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) if ( !capt_only || H5FD_fphdf5_is_captain(file) ) { /* Send the request to the SAP */ if ( H5FP_request_allocate(file, type, size, &fp_alloc.addr, - &fp_alloc.eoa, &req_id, &status) + &fp_alloc.eoa, &req_id, &status) != SUCCEED ) { HGOTO_ERROR(H5E_FPHDF5, H5E_CANTALLOC, HADDR_UNDEF, "server couldn't allocate from file") } } - /* It should be impossible for this assertion to fail, but then + /* It should be impossible for this assertion to fail, but then * that is what assertions are for. */ HDassert(status == H5FP_STATUS_OK); @@ -730,7 +730,7 @@ H5FP_client_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size) } /* we used to send the eoa to the sap here, but that is silly, - * as the sap already knows, and it is possible that another + * as the sap already knows, and it is possible that another * interleaving allocation will result in a corrupted eoa. * * JRM - 4/7/04 @@ -745,7 +745,7 @@ done: } /* H5FP_client_alloc() */ -/* This function is now called only by H5FP_client_alloc() above. +/* This function is now called only by H5FP_client_alloc() above. * Should we make it a private function only accessible from this * file? JRM - 4/8/04 */ @@ -964,8 +964,8 @@ H5FP_request_set_eoa(H5FD_t *file, haddr_t eoa, unsigned *req_id, H5FP_status_t req.proc_rank = H5FD_mpi_get_rank(file); req.addr = eoa; -#if 0 - /* This is useful debugging code -- lets keep for a while. +#if 0 + /* This is useful debugging code -- lets keep for a while. * JRM -- 4/13/04 */ /* dump stack each time we set the eoa */ @@ -974,7 +974,7 @@ H5FP_request_set_eoa(H5FD_t *file, haddr_t eoa, unsigned *req_id, H5FP_status_t MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); - HDfprintf(stdout, + HDfprintf(stdout, "%d: %s: setting eoa: last eoa = %a, new eoa = %a.\n", mpi_rank, "H5FP_request_set_eoa", last_eoa_received, eoa); H5FS_print(stdout); @@ -1051,7 +1051,7 @@ H5FP_request_update_eoma_eosda(H5FD_t *file, unsigned *req_id, H5FP_status_t *st H5FP_SAP_BARRIER_COMM)) != MPI_SUCCESS) HMPI_GOTO_ERROR(FAIL, "MPI_Bcast failed!", mrc); -#if 0 +#if 0 /* The following set_eoa just parrots back to the SAP the eoa * we just received from it. While I don't think it is a problem * in this case, there are obvious potentials for race conditions, @@ -1096,7 +1096,7 @@ H5FP_gen_request_id() /* * Function: H5FP_dump_to_file - * Purpose: Dump the updated metadata to the file. + * Purpose: Dump the updated metadata to the file. * Return: Success: SUCCEED * Failure: FAIL * Programmer: Bill Wendling, 03. February 2003 diff --git a/src/H5FPprivate.h b/src/H5FPprivate.h index e309982..da34a6c 100644 --- a/src/H5FPprivate.h +++ b/src/H5FPprivate.h @@ -317,14 +317,14 @@ extern herr_t H5FP_request_flush_metadata(H5FD_t *file, unsigned file_id, extern herr_t H5FP_request_close(H5FD_t *file, unsigned sap_file_id, unsigned *req_id, H5FP_status_t *status); -/* the following function should probably become a private function +/* the following function should probably become a private function * in H5FPclient.c if H5FP_client_alloc() does the job. -- JRM */ extern herr_t H5FP_request_allocate(H5FD_t *file, H5FD_mem_t mem_type, hsize_t size, haddr_t *addr, haddr_t *eoa, unsigned *req_id, H5FP_status_t *status); -extern haddr_t H5FP_client_alloc(H5FD_t *file, H5FD_mem_t type, +extern haddr_t H5FP_client_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size); extern herr_t H5FP_request_free(H5FD_t *file, H5FD_mem_t mem_type, haddr_t addr, hsize_t size, diff --git a/src/H5FPserver.c b/src/H5FPserver.c index 9eee898..d7bd97a 100644 --- a/src/H5FPserver.c +++ b/src/H5FPserver.c @@ -184,7 +184,7 @@ H5FP_sap_receive_loop(void) herr_t ret_value = SUCCEED; int comm_size; int stop = 0; - H5FP_request_t req; + H5FP_request_t req; FUNC_ENTER_NOAPI(H5FP_sap_receive_loop, FAIL) @@ -318,7 +318,7 @@ H5FP_new_object_lock(hobj_ref_t oid, unsigned rank, H5FP_obj_t obj_type, { int comm_size; H5FP_object_lock *ret_value = NULL; - + FUNC_ENTER_NOAPI_NOINIT(H5FP_new_object_lock) if (MPI_Comm_size(H5FP_SAP_COMM, &comm_size) != MPI_SUCCESS) @@ -547,7 +547,7 @@ H5FP_merge_mod_node_with_next(H5SL_t *slist, H5SL_node_t *node_ptr) unsigned offset; unsigned i,j; - /* The next node address range is not completely subsumed in + /* The next node address range is not completely subsumed in * that of the current node. Must allocate a new buffer, and * copy over the contents of the two buffers. Where the buffers * overlap, give precidence to the data from *node_ptr @@ -565,7 +565,7 @@ H5FP_merge_mod_node_with_next(H5SL_t *slist, H5SL_node_t *node_ptr) combined_metadata_ptr[i++] = (mod_ptr->metadata)[j]; offset = (mod_ptr->addr + mod_ptr->md_size) - next_mod_ptr->addr; - + for ( j = offset; j < next_mod_ptr->md_size; j++ ) combined_metadata_ptr[i++] = (next_mod_ptr->metadata)[j]; @@ -583,7 +583,7 @@ H5FP_merge_mod_node_with_next(H5SL_t *slist, H5SL_node_t *node_ptr) H5SL_remove(slist, &next_mod_ptr->addr); H5FP_free_mod_node(next_mod_ptr); - + done: FUNC_LEAVE_NOAPI(ret_value) } /* H5FP_merge_mod_node_with_next() */ @@ -631,7 +631,7 @@ H5FP_merge_mod_node_with_prev(H5SL_t *slist, H5SL_node_t *node_ptr) char *combined_metadata_ptr; unsigned limit; - /* The node address range is not completely subsumed in + /* The node address range is not completely subsumed in * that of the previous node. Must allocate a new buffer, and * copy over the contents of the two buffers. Where the buffers * overlap, give precidence to the data from *node_ptr @@ -661,7 +661,7 @@ H5FP_merge_mod_node_with_prev(H5SL_t *slist, H5SL_node_t *node_ptr) prev_mod_ptr->md_size = combined_md_size; } else { /* supplied node is completely inside previous node */ /* no need to allocate a new buffer. Just copy data from - * mod_ptr->metadata to the appropriate locations in + * mod_ptr->metadata to the appropriate locations in * prev_mod_ptr->metadata. */ @@ -673,15 +673,15 @@ H5FP_merge_mod_node_with_prev(H5SL_t *slist, H5SL_node_t *node_ptr) HDassert(i <= prev_mod_ptr->md_size); } /* end else */ - /* We have copied metadata from the current node into the previous - * node. All that remains is to delete the current node from the + /* We have copied metadata from the current node into the previous + * node. All that remains is to delete the current node from the * tree and free it. */ H5SL_remove(slist, &mod_ptr->addr); H5FP_free_mod_node(mod_ptr); - + done: FUNC_LEAVE_NOAPI(ret_value) } /* H5FP_merge_mod_node_with_prev() */ @@ -689,9 +689,9 @@ done: /* * Function: H5FP_mod_node_overlaps_with_next * - * Purpose: Given a node in a mod tree, see if there is an overlap - * between the address range of the supplied node, and that - * of the next node in the tree (if any). + * Purpose: Given a node in a mod tree, see if there is an overlap + * between the address range of the supplied node, and that + * of the next node in the tree (if any). * * Return: TRUE if there is an overlap, and FALSE if there * isn't. @@ -715,7 +715,7 @@ H5FP_mod_node_overlaps_with_next(H5SL_node_t *node_ptr) next_node_ptr = H5SL_next(node_ptr); if ( next_node_ptr != NULL ) { -#if 0 +#if 0 if ( ( ((H5FP_mdata_mod *)H5SL_item(node_ptr))->addr > 100000 ) || ( (((H5FP_mdata_mod *)H5SL_item(node_ptr))->md_size) > 1024 ) ) { HDfprintf(stdout, "%s: addr = %a, size = %u, mem_type = %d.\n", @@ -726,7 +726,7 @@ H5FP_mod_node_overlaps_with_next(H5SL_node_t *node_ptr) } if ( (((H5FP_mdata_mod *)H5SL_item(node_ptr))->addr) - >= + >= (((H5FP_mdata_mod *)H5SL_item(next_node_ptr))->addr) ) { HDfprintf(stdout, "%s: addr,len = %a,%u, next_addr,len = %a,%u.\n", @@ -736,7 +736,7 @@ H5FP_mod_node_overlaps_with_next(H5SL_node_t *node_ptr) (((H5FP_mdata_mod *)H5SL_item(next_node_ptr))->addr), ((H5FP_mdata_mod *)H5SL_item(next_node_ptr))->md_size); - HDassert((((H5FP_mdata_mod *)H5SL_item(node_ptr))->addr) + HDassert((((H5FP_mdata_mod *)H5SL_item(node_ptr))->addr) < (((H5FP_mdata_mod *)H5SL_item(next_node_ptr))->addr) ); @@ -745,15 +745,15 @@ H5FP_mod_node_overlaps_with_next(H5SL_node_t *node_ptr) if ( ( (((H5FP_mdata_mod *)H5SL_item(node_ptr))->addr) + (((H5FP_mdata_mod *)H5SL_item(node_ptr))->md_size) - ) + ) > (((H5FP_mdata_mod *)H5SL_item(next_node_ptr))->addr) ) { -#if 0 +#if 0 /* This is useful debugging code -- keep it around for * a while. JRM -- 4/13/03 */ - HDfprintf(stdout, + HDfprintf(stdout, "H5FP_mod_node_overlaps_with_next: addr = %a, next_addr = %a.\n", (((H5FP_mdata_mod *)(node_ptr->data))->addr), (((H5FP_mdata_mod *)(next_node_ptr->data))->addr)); @@ -768,9 +768,9 @@ H5FP_mod_node_overlaps_with_next(H5SL_node_t *node_ptr) /* * Function: H5FP_mod_node_overlaps_with_prev * - * Purpose: Givena node in a mod tree, see if there is an overlap - * between the address range of the supplied node, and that - * of the previous node in the tree (if any). + * Purpose: Givena node in a mod tree, see if there is an overlap + * between the address range of the supplied node, and that + * of the previous node in the tree (if any). * * Return: TRUE if there is an overlap, and FALSE if there * isn't. @@ -795,7 +795,7 @@ H5FP_mod_node_overlaps_with_prev(H5SL_node_t *node_ptr) if ( prev_node_ptr != NULL ) { - HDassert((((H5FP_mdata_mod *)H5SL_item(node_ptr))->addr) + HDassert((((H5FP_mdata_mod *)H5SL_item(node_ptr))->addr) > (((H5FP_mdata_mod *)H5SL_item(prev_node_ptr))->addr) ); @@ -803,15 +803,15 @@ H5FP_mod_node_overlaps_with_prev(H5SL_node_t *node_ptr) if ( ( (((H5FP_mdata_mod *)H5SL_item(prev_node_ptr))->addr) + (((H5FP_mdata_mod *)H5SL_item(prev_node_ptr))->md_size) - ) + ) > (((H5FP_mdata_mod *)H5SL_item(node_ptr))->addr) ) { -#if 0 +#if 0 /* This is useful debugging code -- keep it around for * a while. JRM - 4/13/04 */ - HDfprintf(stdout, + HDfprintf(stdout, "H5FP_mod_node_overlaps_with_prev: addr = %a, prev_addr = %a.\n", (((H5FP_mdata_mod *)(node_ptr->data))->addr), (((H5FP_mdata_mod *)(prev_node_ptr->data))->addr)); @@ -839,7 +839,7 @@ H5FP_mod_node_overlaps_with_prev(H5SL_node_t *node_ptr) * JRM -- 3/29/04 */ static herr_t -H5FP_add_file_mod_to_list(H5FP_file_info *info, H5FD_mem_t mem_type, +H5FP_add_file_mod_to_list(H5FP_file_info *info, H5FD_mem_t mem_type, haddr_t addr, unsigned md_size, char *metadata) { @@ -853,13 +853,13 @@ H5FP_add_file_mod_to_list(H5FP_file_info *info, H5FD_mem_t mem_type, assert(info); #if 0 - /* This is useful debugging code -- keep it around for a + /* This is useful debugging code -- keep it around for a * while. JRM -- 4/13/04 */ - HDfprintf(stdout, - "H5FP_add_file_mod_to_list: Adding chunk at %a of length %u.\n", + HDfprintf(stdout, + "H5FP_add_file_mod_to_list: Adding chunk at %a of length %u.\n", addr, md_size); -#endif +#endif if ((node = H5SL_find(info->mod_list, &addr)) != NULL) { /* * The metadata is in the cache already. All we have to do is @@ -883,7 +883,7 @@ H5FP_add_file_mod_to_list(H5FP_file_info *info, H5FD_mem_t mem_type, (info->num_mods)--; /* since we just merged */ } - } else { /* fm->md_size == md_size */ + } else { /* fm->md_size == md_size */ HDfree(fm->metadata); fm->metadata = metadata; } @@ -907,7 +907,7 @@ H5FP_add_file_mod_to_list(H5FP_file_info *info, H5FD_mem_t mem_type, } /* if the tree was valid to begin with, we must merge with at - * most one previous node. + * most one previous node. */ if ( H5FP_mod_node_overlaps_with_prev(node) ) { if ( H5FP_merge_mod_node_with_prev(info->mod_list, node) < 0 ) @@ -1313,7 +1313,7 @@ H5FP_sap_handle_lock_request(H5FP_request_t *req) exit_state = H5FP_STATUS_BAD_FILE_ID; HGOTO_DONE(FAIL) } - + if (oids[j].info->closing) { /* we're closing the file - don't accept anymore locks */ exit_state = H5FP_STATUS_FILE_CLOSING; @@ -1446,7 +1446,7 @@ assert(0); HDfree(oids); H5FP_send_reply(req->proc_rank, req->req_id, req->file_id, exit_state); FUNC_LEAVE_NOAPI(ret_value) -} +} /* * Function: H5FP_sap_handle_release_lock_request @@ -1575,10 +1575,10 @@ H5FP_sap_handle_read_request(H5FP_request_t *req) int mrc; FUNC_ENTER_NOAPI_NOINIT(H5FP_sap_handle_read_request) -#if 0 +#if 0 /* More useful debugging code to keep for a time. JRM - 4/13/04 */ - HDfprintf(stdout, - "H5FP_sap_handle_read_request: req->addr = %a.\n", + HDfprintf(stdout, + "H5FP_sap_handle_read_request: req->addr = %a.\n", req->addr); #endif @@ -1659,8 +1659,8 @@ H5FP_sap_handle_write_request(H5FP_request_t *req, char *mdata, unsigned md_size FUNC_ENTER_NOAPI_NOINIT(H5FP_sap_handle_write_request) #if 0 /* Debugging code -- lets keep it for a time. JRM -- 4/13/04 */ - HDfprintf(stdout, - "H5FP_sap_handle_write_request: addr = %a, md_size = %d.\n", + HDfprintf(stdout, + "H5FP_sap_handle_write_request: addr = %a, md_size = %d.\n", (haddr_t)(req->addr), (int)md_size); #endif if ((info = H5SL_search(file_info_list,&req->file_id)) != NULL) { @@ -1850,9 +1850,9 @@ H5FP_sap_handle_alloc_request(H5FP_request_t *req) sap_alloc.eoa = HADDR_UNDEF; sap_alloc.status = H5FP_STATUS_CANT_ALLOC; } -#if 0 +#if 0 /* Debugging code -- lets keep it for a time. JRM -- 4/13/04 */ - HDfprintf(stdout, + HDfprintf(stdout, "%s: req_size = %d, req_type = %d, addr = %a, eoa = %a, status = %d, rp_rank = %d.\n", "H5FP_sap_handle_alloc_request", (int)(req->meta_block_size), @@ -1897,7 +1897,7 @@ H5FP_sap_handle_free_request(H5FP_request_t *req) #if 0 /* Debugging code -- lets keep it for a time. JRM -- 4/13/04 */ - HDfprintf(stdout, + HDfprintf(stdout, "%s: addr = %a, block_size = %a, mem_type = %d, rp_rank = %d.\n", "H5FP_sap_handle_free_request", req->addr, @@ -2006,10 +2006,10 @@ H5FP_sap_handle_set_eoa_request(H5FP_request_t *req) if ((info = H5SL_search(file_info_list,&req->file_id)) != NULL) { -#if 0 +#if 0 /* Debugging code -- lets keep it for a time. JRM -- 4/13/04 */ if ( req->addr < ((H5FD_fphdf5_t*)&info->file)->eoa ) { - HDfprintf(stdout, + HDfprintf(stdout, "%s: old eoa = %a, new eoa = %a, rp_rank = %d. %s\n", "H5FP_sap_handle_set_eoa_request", ((H5FD_fphdf5_t*)&info->file)->eoa, @@ -2019,14 +2019,14 @@ H5FP_sap_handle_set_eoa_request(H5FP_request_t *req) } #if 0 else { - HDfprintf(stdout, + HDfprintf(stdout, "%s: old eoa = %a, new eoa = %a, rp_rank = %d.\n", "H5FP_sap_handle_set_eoa_request", ((H5FD_fphdf5_t*)&info->file)->eoa, req->addr, (int)(req->proc_rank)); } -#endif +#endif #endif /* Get the EOA. */ @@ -2035,7 +2035,7 @@ H5FP_sap_handle_set_eoa_request(H5FP_request_t *req) } else { #if 1 /* Debugging code -- lets keep it for a time. JRM -- 4/13/04 */ - HDfprintf(stdout, + HDfprintf(stdout, "%s: Function failed -- Couldn't get info. new eoa = %a.\n", "H5FP_sap_handle_set_eoa_request", req->addr); 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 8e68d0b..4458c7a 100644 --- a/src/H5Fpkg.h +++ b/src/H5Fpkg.h @@ -123,7 +123,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 211a2aa..d3f6cd8 100644 --- a/src/H5Fprivate.h +++ b/src/H5Fprivate.h @@ -282,7 +282,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" @@ -317,7 +317,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 @@ -340,7 +340,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" @@ -358,7 +358,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) @@ -395,18 +395,18 @@ typedef struct H5F_t H5F_t; #define H5F_ACS_FAMILY_OFFSET_SIZE sizeof(hsize_t) #define H5F_ACS_FAMILY_OFFSET_DEF 0 -/* Definition for new member size of family driver. It's private +/* Definition for new member size of family driver. It's private * property only used by h5repart */ #define H5F_ACS_FAMILY_NEWSIZE_NAME "family_newsize" #define H5F_ACS_FAMILY_NEWSIZE_SIZE sizeof(hsize_t) #define H5F_ACS_FAMILY_NEWSIZE_DEF 0 - -/* Definition for whether to conver family to sec2 driver. It's private + +/* Definition for whether to conver family to sec2 driver. It's private * property only used by h5repart */ #define H5F_ACS_FAMILY_TO_SEC2_NAME "family_to_sec2" #define H5F_ACS_FAMILY_TO_SEC2_SIZE sizeof(hbool_t) #define H5F_ACS_FAMILY_TO_SEC2_DEF FALSE - + /* Definition for data type in multi file driver */ #define H5F_ACS_MULTI_TYPE_NAME "multi_type" #define H5F_ACS_MULTI_TYPE_SIZE sizeof(H5FD_mem_t) @@ -415,8 +415,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 */ @@ -481,7 +481,7 @@ H5_DLL void H5F_addr_decode(const H5F_t *, const uint8_t** /*in,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 a829b97..a38fe25 100644 --- a/src/H5Fpublic.h +++ b/src/H5Fpublic.h @@ -86,7 +86,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 @@ -121,7 +121,7 @@ H5_DLL herr_t H5Fmount(hid_t loc, const char *name, hid_t child, hid_t plist); H5_DLL herr_t H5Funmount(hid_t loc, const char *name); H5_DLL hssize_t H5Fget_freespace(hid_t file_id); H5_DLL herr_t H5Fget_filesize(hid_t file_id, hsize_t *size); -H5_DLL herr_t H5Fget_mdc_config(hid_t file_id, +H5_DLL herr_t H5Fget_mdc_config(hid_t file_id, H5AC_cache_config_t * config_ptr); H5_DLL herr_t H5Fset_mdc_config(hid_t file_id, H5AC_cache_config_t * config_ptr); 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 4cb1646..1676fe3 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 @@ -69,10 +69,10 @@ H5F_init_super_interface(void) * Modifications: * Raymond Lu * May 24, 2005 - * Started to check if driver(only family and multi drivers) + * Started to check if driver(only family and multi drivers) * matches driver information saved in the superblock. Wrong * driver will result in a failure. - * + * *------------------------------------------------------------------------- */ herr_t @@ -138,21 +138,21 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent, haddr_t addr /* 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") @@ -162,7 +162,7 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent, haddr_t addr /* 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") @@ -184,7 +184,7 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent, haddr_t addr 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++; @@ -277,10 +277,10 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent, haddr_t addr /* This step is for h5repart tool only. If user wants to change file driver from * family to sec2 while using h5repart, set the driver address to undefined to let * the library ignore the family driver information saved in the superblock. - */ + */ if(shared->fam_to_sec2) shared->driver_addr = HADDR_UNDEF; - + /* Decode the optional driver information block */ if (H5F_addr_defined(shared->driver_addr)) { haddr_t drv_addr = shared->base_addr + shared->driver_addr; @@ -324,13 +324,13 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent, haddr_t addr HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to read file driver information") } /* end if */ - /* Check if driver matches driver information saved. Unfortunately, we can't push this + /* Check if driver matches driver information saved. Unfortunately, we can't push this * function to each specific driver because we're checking if the driver is correct.*/ if(!HDstrncmp(driver_name, "NCSAfami", 8) && HDstrcmp(lf->cls->name, "family")) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "family driver should be used") if(!HDstrncmp(driver_name, "NCSAmult", 8) && HDstrcmp(lf->cls->name, "multi")) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "multi driver should be used") - + if (H5FD_sb_decode(lf, driver_name, p) < 0) HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to decode driver information") @@ -342,7 +342,7 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent, haddr_t addr /* 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. @@ -363,7 +363,7 @@ H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent, haddr_t addr #endif /* !H5_HAVE_FPHDF5 */ 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. @@ -545,7 +545,7 @@ H5F_write_superblock(H5F_t *f, hid_t dxpl_id, uint8_t *buf) *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 c133e90..b34bb68 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. @@ -132,7 +132,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 { @@ -177,14 +177,14 @@ static herr_t H5G_namei(const H5G_entry_t *loc_ent, const char *name, H5G_entry_t *ent, hid_t dxpl_id); static herr_t H5G_traverse_slink(H5G_entry_t *grp_ent/*in,out*/, H5G_entry_t *obj_ent/*in,out*/, int *nlinks/*in,out*/, hid_t dxpl_id); -static H5G_t *H5G_create(H5G_entry_t *loc, const char *name, size_t size_hint, +static H5G_t *H5G_create(H5G_entry_t *loc, const char *name, size_t size_hint, hid_t dxpl_id, hid_t gcpl_id, hid_t gapl_id); 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); @@ -247,7 +247,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, H5P_GROUP_CREATE_DEFAULT, H5P_DEFAULT))) @@ -270,7 +270,7 @@ done: * * Purpose: Creates a new group relative to LOC_ID and gives it the * specified NAME, and creation property list GCPL_ID and access - * property list GAPL_ID. + * property list GAPL_ID. * * The optional SIZE_HINT specifies how much file space to * reserve to store the names that will appear in this @@ -278,7 +278,7 @@ done: * then a default size is chosen. * * Given the default setting, H5Gcreate_expand() will have the - * same function of H5Gcreate() + * same function of H5Gcreate() * * See also: H5Gcreate(), H5Dcreate_expand() * @@ -290,8 +290,8 @@ done: * * Failure: FAIL * - * Programmer: Peter Cao - * May 08, 2005 + * Programmer: Peter Cao + * May 08, 2005 *------------------------------------------------------------------------- */ hid_t @@ -308,7 +308,7 @@ H5Gcreate_expand(hid_t loc_id, const char *name, size_t size_hint, hid_t gcpl_id HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") if (!name || !*name) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name given") - + /* Check group creation property list */ if(H5P_DEFAULT == gcpl_id) gcpl_id = H5P_GROUP_CREATE_DEFAULT; @@ -473,7 +473,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); @@ -535,15 +535,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: * @@ -554,7 +554,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); @@ -587,12 +587,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: * @@ -625,14 +625,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: * @@ -643,7 +643,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); @@ -668,7 +668,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 @@ -684,7 +684,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; @@ -713,7 +713,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"); @@ -729,8 +729,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 @@ -750,7 +750,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; @@ -816,7 +816,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); @@ -858,7 +858,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); @@ -900,7 +900,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); @@ -941,7 +941,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); @@ -986,7 +986,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); @@ -1009,7 +1009,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 *------------------------------------------------------------------------- - *------------------------------------------------------------------------- + *------------------------------------------------------------------------- */ /*------------------------------------------------------------------------- @@ -1096,7 +1096,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_type(H5I_GROUP, FALSE); @@ -1106,7 +1106,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_dec_type_ref(H5I_GROUP); @@ -1119,7 +1119,7 @@ H5G_term_interface(void) n = 1; /*H5I*/ } } - + FUNC_LEAVE_NOAPI(n); } @@ -1150,7 +1150,7 @@ H5G_register_type(H5G_obj_t type, htri_t(*isa)(H5G_entry_t*, hid_t), const char char *desc = NULL; size_t i; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_register_type); assert(type>=0); @@ -1184,7 +1184,7 @@ H5G_register_type(H5G_obj_t type, htri_t(*isa)(H5G_entry_t*, hid_t), const char 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; @@ -1263,7 +1263,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 */ @@ -1306,7 +1306,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 */ @@ -1402,7 +1402,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. @@ -1458,7 +1458,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 */ @@ -1478,7 +1478,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"); @@ -1492,7 +1492,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); @@ -1503,7 +1503,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; @@ -1631,11 +1631,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 */ @@ -1697,7 +1697,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 */ @@ -1717,7 +1717,7 @@ H5G_traverse_slink (H5G_entry_t *grp_ent/*in,out*/, if (H5HL_unprotect(grp_ent->file, dxpl_id, heap, stab_mesg.heap_addr, H5AC__NO_FLAGS_SET) < 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; @@ -1910,7 +1910,7 @@ H5G_create(H5G_entry_t *loc, const char *name, size_t size_hint, 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 */ - + /* Get the property list */ if (NULL == (gc_plist = H5I_object(gcpl_id))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a property list") @@ -1971,7 +1971,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); @@ -2006,7 +2006,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); @@ -2211,7 +2211,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"); } } @@ -2501,7 +2501,7 @@ H5G_loc (hid_t loc_id) case H5I_GENPROP_CLS: case H5I_GENPROP_LST: HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "unable to get symbol table entry of property list"); - + case H5I_ERROR_CLASS: case H5I_ERROR_MSG: case H5I_ERROR_STACK: @@ -2537,7 +2537,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"); @@ -2582,7 +2582,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 */ @@ -2603,7 +2603,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_stack (NULL); /*it's okay that we didn't find it*/ @@ -2664,7 +2664,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); @@ -2701,7 +2701,7 @@ H5G_get_type(H5G_entry_t *ent, hid_t dxpl_id) htri_t isa; size_t i; H5G_obj_t ret_value=H5G_UNKNOWN; /* Return value */ - + FUNC_ENTER_NOAPI(H5G_get_type, H5G_UNKNOWN); for (i=H5G_ntypes_g; i>0; --i) { @@ -2752,7 +2752,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); @@ -2828,27 +2828,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 */ @@ -2866,9 +2866,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); } @@ -2878,24 +2878,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 */ @@ -2915,7 +2915,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"); @@ -2944,26 +2944,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 H5G_obj_t +static H5G_obj_t 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 */ H5G_obj_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5G_get_objtype_by_idx); - + /* Sanity check */ assert(loc); @@ -2976,12 +2976,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"); @@ -3029,7 +3029,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); /* @@ -3051,7 +3051,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 */ @@ -3093,7 +3093,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 */ @@ -3148,7 +3148,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 */ @@ -3175,7 +3175,7 @@ done: FUNC_LEAVE_NOAPI(ret_value); } - + /*------------------------------------------------------------------------- * Function: H5G_unlink @@ -3204,7 +3204,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 */ @@ -3231,7 +3231,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"); @@ -3277,7 +3277,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; @@ -3287,7 +3287,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 */ @@ -3314,7 +3314,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. @@ -3325,7 +3325,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)) @@ -3446,9 +3446,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); @@ -3476,7 +3476,7 @@ done: * * Date: August 22, 2002 * - * Comments: + * Comments: * * Modifications: * @@ -3486,9 +3486,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); @@ -3500,7 +3500,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); } @@ -3522,7 +3522,7 @@ done: * * Date: June 11, 2002 * - * Comments: + * Comments: * * Modifications: * @@ -3537,7 +3537,7 @@ H5G_replace_name(H5G_obj_t 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); @@ -3600,7 +3600,7 @@ H5G_replace_name(H5G_obj_t type, H5G_entry_t *loc, if(search_datatype) H5I_search(H5I_DATATYPE, H5G_replace_ent, &names); -done: +done: FUNC_LEAVE_NOAPI(ret_value); } @@ -3617,7 +3617,7 @@ done: * * Date: September 24, 2002 * - * Comments: + * Comments: * * Modifications: * @@ -3630,9 +3630,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); @@ -3686,7 +3686,7 @@ done: * * Date: June 5, 2002 * - * Comments: + * Comments: * * Modifications: * @@ -3700,11 +3700,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: @@ -3719,7 +3719,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; @@ -3727,7 +3727,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 @@ -4006,11 +4006,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); @@ -4054,9 +4054,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 d6219ab..fa58ca7 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 4c08b9c..214e3fe 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 @@ -1006,7 +1006,7 @@ H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED *_lt_key HGOTO_ERROR(H5E_SYM, H5E_UNSUPPORTED, FAIL, "internal erorr (unknown symbol find operation)"); done: - if (sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, + if (sn && H5AC_unprotect(f, dxpl_id, H5AC_SNODE, addr, sn, H5AC__NO_FLAGS_SET) < 0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, FAIL, "unable to release symbol table node"); @@ -1343,7 +1343,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"); @@ -1385,7 +1385,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 @@ -1397,7 +1397,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 @@ -1409,7 +1409,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 @@ -1451,7 +1451,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, sn_flags)<0) HDONE_ERROR(H5E_SYM, H5E_PROTECT, H5B_INS_ERROR, "unable to release symbol table node"); @@ -1582,7 +1582,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 * @@ -1635,10 +1635,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: @@ -1658,7 +1658,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; @@ -1673,11 +1673,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"); @@ -1713,7 +1713,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 * * Modifications: @@ -1741,13 +1741,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; @@ -1756,7 +1756,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, H5AC__NO_FLAGS_SET) != 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 9b299ed..78d1bbd 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 094a4a2..d38a8cb 100644 --- a/src/H5Gpublic.h +++ b/src/H5Gpublic.h @@ -63,7 +63,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; #define H5G_NTYPES 256 /* Max possible number of types */ #define H5G_NLIBTYPES 8 /* Number of internal types */ @@ -80,7 +80,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) @@ -98,7 +98,7 @@ H5_DLL herr_t H5Giterate(hid_t loc_id, const char *name, int *idx, H5_DLL herr_t H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs); H5_DLL ssize_t H5Gget_objname_by_idx(hid_t loc_id, hsize_t idx, char* name, size_t size); H5_DLL H5G_obj_t H5Gget_objtype_by_idx(hid_t loc_id, hsize_t idx); -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); @@ -111,7 +111,7 @@ H5_DLL herr_t H5Gset_comment(hid_t loc_id, const char *name, const char *comment); H5_DLL int H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize, char *buf); -H5_DLL hid_t H5Gcreate_expand(hid_t loc_id, const char *name, size_t size_hint, +H5_DLL hid_t H5Gcreate_expand(hid_t loc_id, const char *name, size_t size_hint, hid_t gcpl_id, hid_t gapl_id); #ifdef __cplusplus diff --git a/src/H5Gstab.c b/src/H5Gstab.c index 01c439e..94378a8 100644 --- a/src/H5Gstab.c +++ b/src/H5Gstab.c @@ -238,7 +238,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; @@ -267,7 +267,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); @@ -307,18 +307,18 @@ done: * *------------------------------------------------------------------------- */ -herr_t +herr_t H5G_stab_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_stab_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); @@ -430,8 +430,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 631f1a0..26133b5 100644 --- a/src/H5HG.c +++ b/src/H5HG.c @@ -176,21 +176,21 @@ 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(). * * John Mainzer 6/8/05 * Removed code setting the is_dirty field of the cache info. - * This is no longer pemitted, as the cache code is now + * This is no longer pemitted, as the cache code is now * manageing this field. Since this function uses a call to * H5AC_set() (which marks the entry dirty automaticly), no * other change is required. * *------------------------------------------------------------------------- */ -static haddr_t +static haddr_t H5HG_create (H5F_t *f, hid_t dxpl_id, size_t size) { H5HG_heap_t *heap = NULL; @@ -198,7 +198,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 */ @@ -275,7 +275,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); @@ -330,7 +330,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 */ @@ -476,9 +476,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) @@ -512,7 +512,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 */ @@ -555,7 +555,7 @@ static herr_t H5HG_dest (H5F_t *f, H5HG_heap_t *heap) { int i; - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HG_dest); /* Check arguments */ @@ -668,7 +668,7 @@ H5HG_compute_size(const H5F_t UNUSED *f, const H5HG_heap_t *heap, size_t *size_p * Modified the function to use the new dirtied parameter of * of H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. - * + * * In this case, that required adding the new heap_dirtied_ptr * parameter to the function's argument list. * @@ -737,7 +737,7 @@ H5HG_alloc (H5F_t *f, H5HG_heap_t *heap, size_t size, unsigned * heap_flags_ptr) */ 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, @@ -751,7 +751,7 @@ H5HG_alloc (H5F_t *f, H5HG_heap_t *heap, size_t size, unsigned * heap_flags_ptr) 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, @@ -794,7 +794,7 @@ done: * Modified the function to use the new dirtied parameter of * of H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. - * + * * In this case, that required adding the new heap_dirtied_ptr * parameter to the function's argument list. * @@ -906,14 +906,14 @@ 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 * this function to account for the change in H5HG_create(). * * John Mainzer - 6/8/05 - * Modified function to use the dirtied parameter of + * Modified function to use the dirtied parameter of * H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * @@ -930,7 +930,7 @@ H5HG_insert (H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out* unsigned heap_flags = H5AC__NO_FLAGS_SET; 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 */ @@ -944,24 +944,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 @@ -1014,8 +1014,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]; @@ -1026,13 +1026,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, &heap_flags); - + /* Copy data into the heap */ if(size>0) { HDmemcpy(heap->obj[idx].begin+H5HG_SIZEOF_OBJHDR(f), obj, size); @@ -1088,7 +1088,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 */ @@ -1153,7 +1153,7 @@ done: * Modifications: * * John Mainzer - 6/8/05 - * Modified function to use the dirtied parameter of + * Modified function to use the dirtied parameter of * H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * @@ -1165,9 +1165,9 @@ H5HG_link (H5F_t *f, hid_t dxpl_id, const H5HG_t *hobj, int adjust) H5HG_heap_t *heap = NULL; unsigned heap_flags = H5AC__NO_FLAGS_SET; int ret_value; /* Return value */ - + FUNC_ENTER_NOAPI(H5HG_link, FAIL); - + /* Check args */ assert (f); assert (hobj); @@ -1213,7 +1213,7 @@ done: * Modifications: * * John Mainzer - 6/8/05 - * Modified function to use the dirtied parameter of + * Modified function to use the dirtied parameter of * H5AC_unprotect() instead of modifying the is_dirty * field of the cache info. * @@ -1229,7 +1229,7 @@ H5HG_remove (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj) unsigned u; unsigned flags=H5AC__NO_FLAGS_SET;/* Whether the heap gets deleted */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5HG_remove, FAIL); /* Check args */ @@ -1247,7 +1247,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) @@ -1300,7 +1300,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, flags) != SUCCEED) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release object header"); diff --git a/src/H5HL.c b/src/H5HL.c index 72a1005..ee31ecc 100644 --- a/src/H5HL.c +++ b/src/H5HL.c @@ -870,11 +870,11 @@ H5HL_offset_into(H5F_t *f, const H5HL_t *heap, size_t offset) * Modifications: * * John Mainzer - 6/8/05/ - * Modified function to use the new dirtied parmeter of + * Modified function to use the new dirtied parmeter of * H5AC_unprotect(), which allows management of the is_dirty * field of the cache info to be moved into the cache code. * - * This required the addition of the heap_dirtied parameter + * This required the addition of the heap_dirtied parameter * to the function's parameter list. * *------------------------------------------------------------------------- @@ -947,7 +947,7 @@ H5HL_remove_free(H5HL_t *heap, H5HL_free_t *fl) * The ADDR argument is passed by value. * * John Mainzer, 6/7/05 - * Modified code to use the dirtied parameter of + * Modified code to use the dirtied parameter of * H5AC_unprotect() instead of manipulating the is_dirty * field of the cache info directly. * @@ -1100,7 +1100,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); } @@ -1143,7 +1143,7 @@ done: * The ADDR argument is passed by value. * * John Mainzer, 6/7/05 - * Modified code to use the dirtied parameter of + * Modified code to use the dirtied parameter of * H5AC_unprotect() instead of manipulating the is_dirty * field of the cache info directly. * @@ -1177,7 +1177,7 @@ H5HL_write(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t offset, size_t size, co HDmemcpy(heap->chunk + H5HL_SIZEOF_HDR(f) + offset, buf, size); done: - if (heap && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP, addr, heap, heap_flags) != SUCCEED && + if (heap && H5AC_unprotect(f, dxpl_id, H5AC_LHEAP, addr, heap, heap_flags) != SUCCEED && ret_value != FAIL) HDONE_ERROR(H5E_HEAP, H5E_PROTECT, FAIL, "unable to release object header"); @@ -1213,7 +1213,7 @@ done: * The ADDR argument is passed by value. * * John Mainzer, 6/7/05 - * Modified code to use the dirtied parameter of + * Modified code to use the dirtied parameter of * H5AC_unprotect() instead of manipulating the is_dirty * field of the cache info directly. * @@ -1343,7 +1343,7 @@ done: * Modifications: * * John Mainzer - 6/17/05 - * Modified function to use the new dirtied parmeter of + * Modified function to use the new dirtied parmeter of * H5AC_unprotect(), which allows management of the is_dirty * field of the cache info to be moved into the cache code. * diff --git a/src/H5HLprivate.h b/src/H5HLprivate.h index 7321bb9..001c3a1 100644 --- a/src/H5HLprivate.h +++ b/src/H5HLprivate.h @@ -64,7 +64,7 @@ typedef struct H5HL_t H5HL_t; H5_DLL herr_t H5HL_create(H5F_t *f, hid_t dxpl_id, size_t size_hint, haddr_t *addr/*out*/); H5_DLL const H5HL_t *H5HL_protect(H5F_t *f, hid_t dxpl_id, haddr_t addr); H5_DLL void *H5HL_offset_into(H5F_t *f, const H5HL_t *heap, size_t offset); -H5_DLL herr_t H5HL_unprotect(H5F_t *f, hid_t dxpl_id, const H5HL_t *heap, +H5_DLL herr_t H5HL_unprotect(H5F_t *f, hid_t dxpl_id, const H5HL_t *heap, haddr_t addr, unsigned heap_flags); H5_DLL size_t H5HL_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, size_t size, const void *buf); diff --git a/src/H5I.c b/src/H5I.c index 6ae8ca8..a0e2096 100644 --- a/src/H5I.c +++ b/src/H5I.c @@ -14,17 +14,17 @@ /* * FILE: H5I.c - Internal storage routines for handling "IDs" - * + * * REMARKS: ID's which allow objects (void *'s currently) to be bundled * into "types" for more general storage. - * + * * DESIGN: The types are stored in an array of pointers to store each * type in an element. Each "type" node contains a link to a * hash table to manage the IDs in each type. Allowed types are * values within the range 1 to MAX_NUM_TYPES and are given out * at run-time. Types used by the library are stored in global * variables defined in H5Ipublic.h. - * + * * AUTHOR: Quincey Koziol * * MODIFICATIONS: @@ -109,7 +109,7 @@ typedef struct { /*-------------------- Locally scoped variables -----------------------------*/ /* Array of pointers to atomic types */ -static H5I_id_type_t *H5I_id_type_list_g[MAX_NUM_TYPES]; +static H5I_id_type_t *H5I_id_type_list_g[MAX_NUM_TYPES]; /* Variable to keep track of the number of types allocated. Its value is the */ /* next type ID to be handed out, so it is always one greater than the number */ @@ -135,7 +135,7 @@ NAME H5I_init_interface -- Initialize interface-specific information USAGE herr_t H5I_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -163,7 +163,7 @@ H5I_init_interface(void) * * Failure: Negative. * - * Programmer: + * Programmer: * * Modifications: * @@ -205,10 +205,10 @@ H5I_term_interface(void) * Function: H5Iregister_type * * Purpose: Public interface to H5I_register_type. Creates a new type - * of ID's to give out. A specific number (RESERVED) of type - * entries may be reserved to enable "constant" values to be handed - * out which are valid IDs in the type, but which do not map to any - * data structures and are not allocated dynamically later. HASH_SIZE is + * of ID's to give out. A specific number (RESERVED) of type + * entries may be reserved to enable "constant" values to be handed + * out which are valid IDs in the type, but which do not map to any + * data structures and are not allocated dynamically later. HASH_SIZE is * the minimum hash table size to use for the type. FREE_FUNC is * called with an object pointer when the object is removed from * the type. @@ -322,7 +322,7 @@ H5I_type_t H5I_register_type(H5I_type_t type_id, size_t hash_size, unsigned rese { ret_value = type_id; } - + /* Initialize the type */ /* Check arguments */ #ifdef HASH_SIZE_POWER_2 @@ -372,10 +372,10 @@ H5I_type_t H5I_register_type(H5I_type_t type_id, size_t hash_size, unsigned rese /*------------------------------------------------------------------------- * Function: H5Itype_exists * - * Purpose: Query function to inform the user if a given type is - * currently registered with the library. + * Purpose: Query function to inform the user if a given type is + * currently registered with the library. * - * Return: Success: 1 if the type is registered, 0 if it is not + * Return: Success: 1 if the type is registered, 0 if it is not * * Failure: Negative * @@ -579,7 +579,7 @@ H5I_clear_type(H5I_type_t type, hbool_t force) if (type <= H5I_BADID || type >= H5I_next_type) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type number"); - + type_ptr = H5I_id_type_list_g[type]; if (type_ptr == NULL || type_ptr->count <= 0) HGOTO_ERROR(H5E_ATOM, H5E_BADGROUP, FAIL, "invalid type"); @@ -666,7 +666,7 @@ H5I_clear_type(H5I_type_t type, hbool_t force) } /* end else */ } /* end for */ } /* end for */ - + done: FUNC_LEAVE_NOAPI(ret_value); } @@ -680,7 +680,7 @@ done: * involves calling the free-func for each ID's object and * then adding the ID struct to the ID free list. Public * interface to H5I_destroy_type. - * + * * Return: Zero on success/Negative on failure * * Programmer: Nathaniel Furrer @@ -807,7 +807,7 @@ hid_t H5Iregister(H5I_type_t type, void *object) * *------------------------------------------------------------------------- */ -hid_t +hid_t H5I_register(H5I_type_t type, void *object) { H5I_id_type_t *type_ptr=NULL; /*ptr to the type */ @@ -818,7 +818,7 @@ H5I_register(H5I_type_t type, 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 */ @@ -911,13 +911,13 @@ H5I_register(H5I_type_t type, 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 */ @@ -940,7 +940,7 @@ done: * Function: H5Iobject_verify * * Purpose: Find an object pointer for the specified ID, verifying that - * its in a particular type. Public interface to + * its in a particular type. Public interface to * H5I_object_verify. * * Return: Success: Non-null object pointer associated with the @@ -993,7 +993,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 */ @@ -1033,7 +1033,7 @@ done: * *------------------------------------------------------------------------- */ -H5I_type_t +H5I_type_t H5I_get_type(hid_t id) { H5I_type_t ret_value = H5I_BADID; @@ -1062,7 +1062,7 @@ done: * * Failure: H5I_BADID, a negative value * - * Programmer: + * Programmer: * * Modifications: * Robb Matzke, 1999-08-23 @@ -1144,7 +1144,7 @@ void *H5Iremove_verify(hid_t id, H5I_type_t id_type) * *------------------------------------------------------------------------- */ -void * +void * H5I_remove_verify(hid_t id, H5I_type_t id_type) { void * ret_value = NULL; /*return value */ @@ -1176,13 +1176,13 @@ done: * * Failure: NULL * - * Programmer: + * Programmer: * * Modifications: * *------------------------------------------------------------------------- */ -void * +void * H5I_remove(hid_t id) { H5I_id_type_t *type_ptr = NULL;/*ptr to the atomic type */ @@ -1334,7 +1334,7 @@ H5I_dec_ref(hid_t id) type_ptr = H5I_id_type_list_g[type]; if (type_ptr == NULL || type_ptr->count <= 0) HGOTO_ERROR(H5E_ARGS, H5E_BADRANGE, FAIL, "invalid type 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"); @@ -1632,7 +1632,7 @@ done: * return value of 0 means that the type will have to be * re-initialized before it can be used again (and should probably * be set to H5I_UNINIT). - * + * * Return: Number of references to type on success/Negative on failure * * Programmer: Nathaniel Furrer @@ -1673,7 +1673,7 @@ herr_t H5Idec_type_ref(H5I_type_t type) * return value of 0 means that the type will have to be * re-initialized before it can be used again (and should probably * be set to H5I_UNINIT). - * + * * Return: Number of references to type on success/Negative on failure * * Programmer: Unknown @@ -1716,7 +1716,7 @@ H5I_dec_type_ref(H5I_type_t type) --(type_ptr->count); ret_value = type_ptr->count; } - + done: FUNC_LEAVE_NOAPI(ret_value); } @@ -1921,7 +1921,7 @@ done: * * Failure: NULL * - * Programmer: + * Programmer: * * Modifications: * @@ -1976,10 +1976,10 @@ H5I_find_id(hid_t id) /*------------------------------------------------------------------------- * 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 @@ -2126,14 +2126,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: * @@ -2159,14 +2159,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: * @@ -2185,7 +2185,7 @@ H5I_get_file_id(hid_t obj_id) type = H5I_TYPE(obj_id); if(type == 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"); diff --git a/src/H5Ipublic.h b/src/H5Ipublic.h index bda034c..1efa6ad 100644 --- a/src/H5Ipublic.h +++ b/src/H5Ipublic.h @@ -47,7 +47,7 @@ typedef enum H5I_type_t { H5I_GENPROP_LST, /*type ID for generic property lists */ H5I_ERROR_CLASS, /*type ID for error classes */ H5I_ERROR_MSG, /*type ID for error messages */ - H5I_ERROR_STACK, /*type ID for error stacks */ + H5I_ERROR_STACK, /*type ID for error stacks */ H5I_NTYPES /*number of library types, MUST BE LAST! */ } H5I_type_t; diff --git a/src/H5MF.c b/src/H5MF.c index 5e1cb45..f4ce055 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/H5MP.c b/src/H5MP.c index 490b38a..e620f09 100644 --- a/src/H5MP.c +++ b/src/H5MP.c @@ -265,7 +265,7 @@ HDfprintf(stderr,"%s: request = %Zu, needed = %Zu\n", FUNC, request, needed); size_t page_size; /* Size of page needed */ /* Check if the request is too large for a standard page */ - page_size = (needed > mp->max_size) ? + page_size = (needed > mp->max_size) ? (needed + H5MP_BLOCK_ALIGN(sizeof(H5MP_page_t))) : mp->page_size; /* Allocate new page */ diff --git a/src/H5MPtest.c b/src/H5MPtest.c index 7962457..45d5179 100644 --- a/src/H5MPtest.c +++ b/src/H5MPtest.c @@ -158,7 +158,7 @@ HDfprintf(stderr,"%s: page_free = %Zu, page->free_size = %Zu\n", "H5MP_pool_is_f page = page->next; } /* end while */ - /* Check that the free space from the pages + /* Check that the free space from the pages * corresponds to free space in pool */ #ifdef QAK HDfprintf(stderr,"%s: pool_free = %Zu, mp->free_size = %Zu\n", "H5MP_pool_is_free_size_correct", pool_free, mp->free_size); diff --git a/src/H5O.c b/src/H5O.c index a15d9ac..c675bd6 100644 --- a/src/H5O.c +++ b/src/H5O.c @@ -20,7 +20,7 @@ * * Purpose: Object header virtual functions. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ @@ -67,7 +67,7 @@ static int H5O_modify_real(H5G_entry_t *ent, const H5O_class_t *type, int overwrite, unsigned flags, unsigned update_flags, const void *mesg, hid_t dxpl_id); static int H5O_append_real(H5F_t *f, hid_t dxpl_id, H5O_t *oh, - const H5O_class_t *type, unsigned flags, const void *mesg, + const H5O_class_t *type, unsigned flags, const void *mesg, unsigned * oh_flags_ptr); static herr_t H5O_remove_real(H5G_entry_t *ent, const H5O_class_t *type, int sequence, hid_t dxpl_id); @@ -82,7 +82,7 @@ static unsigned H5O_new_mesg(H5F_t *f, H5O_t *oh, unsigned *flags, const H5O_class_t **new_type, const void **new_mesg, hid_t dxpl_id, unsigned * oh_flags_ptr); static herr_t H5O_write_mesg(H5O_t *oh, unsigned idx, const H5O_class_t *type, - const void *mesg, unsigned flags, unsigned update_flags, + const void *mesg, unsigned flags, unsigned update_flags, unsigned * oh_flags_ptr); /* Metadata cache callbacks */ @@ -262,9 +262,9 @@ done: * Modifications: * * JRM -- 6/6/05 - * Removed code modifying the is_dirty field of the + * Removed code modifying the is_dirty field of the * cache_info. This field is now managed by the cache - * proper. + * proper. * *------------------------------------------------------------------------- */ @@ -306,7 +306,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; @@ -421,7 +421,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. @@ -509,10 +509,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); @@ -540,7 +540,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; @@ -551,7 +551,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); @@ -694,11 +694,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) { @@ -712,7 +712,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); @@ -731,7 +731,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 @@ -917,7 +917,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 @@ -944,7 +944,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)); @@ -1068,7 +1068,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,&oh_flags)<0) HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, FAIL, "unable to write message"); @@ -1927,14 +1927,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, &oh_flags); - + /* Set return value */ ret_value = sequence; done: if (oh && H5AC_unprotect(ent->file, dxpl_id, H5AC_OHDR, ent->header, oh, oh_flags) < 0) HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header"); - + FUNC_LEAVE_NOAPI(ret_value); } /* end H5O_modify_real() */ @@ -2000,7 +2000,7 @@ done: * Modifications: * * John Mainzer, 6/6/05 - * Updated function to use the new dirtied parameter of + * Updated function to use the new dirtied parameter of * H5AC_unprotect() instead of manipulating the is_dirty * field of the cache info directly. * @@ -2049,7 +2049,7 @@ done: * Feb 14 2003 * * John Mainzer, 6/6/05 - * Updated function to use the new dirtied parameter of + * Updated function to use the new dirtied parameter of * H5AC_unprotect() instead of manipulating the is_dirty * field of the cache info directly. * @@ -2101,14 +2101,14 @@ done: * Modifications: * * John Mainzer, 6/6/05 - * Updated function to use the new dirtied parameter of + * Updated function to use the new dirtied parameter of * H5AC_unprotect() instead of manipulating the is_dirty * of the cache info. * *------------------------------------------------------------------------- */ 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 * oh_flags_ptr) { unsigned idx; /* Index of message to modify */ @@ -2155,7 +2155,7 @@ done: * Modifications: * * John Mainzer, 6/7/05 - * Modified function to use the new dirtied parameter to + * Modified function to use the new dirtied parameter to * H5AC_unprotect() instead of modfying the is_dirty field. * In this case, that requires the addition of the oh_dirtied_ptr * parameter to track whether *oh is dirty. @@ -2237,7 +2237,7 @@ done: * Modifications: * * John Mainzer, 6/6/05 - * Modified function to use the new dirtied parameter to + * Modified function to use the new dirtied parameter to * H5AC_unprotect() instead of modfying the is_dirty field. * In this case, that requires the addition of the oh_dirtied_ptr * parameter to track whether *oh is dirty. @@ -2246,7 +2246,7 @@ done: */ static herr_t H5O_write_mesg(H5O_t *oh, unsigned idx, const H5O_class_t *type, - const void *mesg, unsigned flags, unsigned update_flags, + const void *mesg, unsigned flags, unsigned update_flags, unsigned * oh_flags_ptr) { H5O_mesg_t *idx_msg; /* Pointer to message to modify */ @@ -2295,7 +2295,7 @@ done: * Modifications: * * John Mainzer, 6/6/05 - * Modified function to use the new dirtied parameter to + * Modified function to use the new dirtied parameter to * H5AC_unprotect() instead of modfying the is_dirty field. * In this case, that requires the addition of the oh_dirtied_ptr * parameter to track whether *oh is dirty. @@ -2312,7 +2312,7 @@ H5O_touch_oh(H5F_t *f, H5O_t *oh, hbool_t force, unsigned * oh_flags_ptr) time_t now; size_t size; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5O_touch_oh); assert(oh); @@ -2370,7 +2370,7 @@ done: * Modifications: * * John Mainzer, 6/16/05 - * Modified function to use the new dirtied parameter to + * Modified function to use the new dirtied parameter to * H5AC_unprotect() instead of modfying the is_dirty field. * *------------------------------------------------------------------------- @@ -2381,7 +2381,7 @@ H5O_touch(H5G_entry_t *ent, hbool_t force, hid_t dxpl_id) H5O_t *oh = NULL; unsigned oh_flags = H5AC__NO_FLAGS_SET; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5O_touch, FAIL); /* check args */ @@ -2422,7 +2422,7 @@ done: * Modifications: * * John Mainzer, 6/16/05 - * Modified function to use the new dirtied parameter to + * Modified function to use the new dirtied parameter to * H5AC_unprotect() instead of modfying the is_dirty field. * In this case, that requires the addition of the oh_dirtied_ptr * parameter to track whether *oh is dirty. @@ -2435,7 +2435,7 @@ H5O_bogus_oh(H5F_t *f, H5O_t *oh, hbool_t * oh_flags_ptr) int idx; size_t size; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER(H5O_bogus_oh, FAIL); assert(f); @@ -2484,7 +2484,7 @@ done: * Modifications: * * John Mainzer, 6/16/05 - * Modified function to use the new dirtied parameter to + * Modified function to use the new dirtied parameter to * H5AC_unprotect() instead of modfying the is_dirty field. * *------------------------------------------------------------------------- @@ -2495,7 +2495,7 @@ H5O_bogus(H5G_entry_t *ent, hid_t dxpl_id) H5O_t *oh = NULL; unsigned oh_flags = H5AC__NO_FLAGS_SET; herr_t ret_value = SUCCEED; - + FUNC_ENTER(H5O_bogus, FAIL); /* check args */ @@ -2632,7 +2632,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; @@ -2805,7 +2805,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++) { @@ -2936,7 +2936,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. @@ -3181,7 +3181,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 */ @@ -3230,7 +3230,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 */ @@ -3274,7 +3274,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 */ @@ -3318,7 +3318,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 */ @@ -3334,7 +3334,7 @@ H5O_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr) HGOTO_ERROR(H5E_OHDR, H5E_CANTDELETE, FAIL, "can't delete object from file"); done: - if (oh && + if (oh && H5AC_unprotect(f, dxpl_id, H5AC_OHDR, addr, oh, H5AC__DIRTIED_FLAG | H5C__DELETED_FLAG)<0) HDONE_ERROR(H5E_OHDR, H5E_PROTECT, FAIL, "unable to release object header"); @@ -3368,7 +3368,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 */ @@ -3430,7 +3430,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 */ @@ -3492,7 +3492,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 */ @@ -3532,7 +3532,7 @@ done: /*------------------------------------------------------------------------- * Function: H5O_encode * - * Purpose: Encode an object(data type and simple data space only) + * Purpose: Encode an object(data type and simple data space only) * description into a buffer. * * Return: Success: Non-negative @@ -3560,7 +3560,7 @@ H5O_encode(H5F_t *f, unsigned char *buf, void *obj, unsigned type_id) type=message_type_g[type_id]; /* map the type ID to the actual type object */ assert(type); - /* Encode */ + /* Encode */ if ((type->encode)(f, buf, obj)<0) HGOTO_ERROR (H5E_OHDR, H5E_CANTENCODE, FAIL, "unable to encode message"); @@ -3572,10 +3572,10 @@ done: /*------------------------------------------------------------------------- * Function: H5O_decode * - * Purpose: Decode a binary object(data type and data space only) + * Purpose: Decode a binary object(data type and data space only) * description and return a new object handle. * - * Return: Success: Pointer to object(data type or space) + * Return: Success: Pointer to object(data type or space) * * Failure: NULL * @@ -3631,7 +3631,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. @@ -3730,7 +3730,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 */ @@ -3868,7 +3868,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); } @@ -3881,14 +3881,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; @@ -3901,7 +3901,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 0ab8bc5..7a7972b 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 */ @@ -723,7 +723,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]); @@ -737,11 +737,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) @@ -880,7 +880,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 @@ -923,9 +923,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 @@ -1133,7 +1133,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); @@ -1175,7 +1175,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); @@ -1208,7 +1208,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 @@ -1220,7 +1220,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 */ @@ -1311,7 +1311,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 8959233..9106310 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, H5AC__NO_FLAGS_SET) < 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 a7c0af9..32b772f 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); @@ -311,16 +311,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: * @@ -450,7 +450,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. * @@ -470,7 +470,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); @@ -510,7 +510,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); @@ -544,8 +544,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) { @@ -582,15 +582,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); } @@ -669,7 +669,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); @@ -747,7 +747,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); } @@ -771,7 +771,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); @@ -789,7 +789,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 1d50f94..b488e57 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 default now and * is revised to just store information needed for each storage type. */ #define H5O_LAYOUT_VERSION_1 1 @@ -352,7 +352,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; @@ -376,20 +376,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 @@ -397,20 +397,20 @@ H5O_layout_meta_size(const H5F_t *f, const void *_mesg) { const H5O_layout_t *mesg = (const H5O_layout_t *) _mesg; size_t ret_value; - + FUNC_ENTER_NOAPI_NOINIT(H5O_layout_meta_size); - + /* check args */ assert(f); assert(mesg); - + ret_value = 1 + /* Version number */ 1; /* layout class type */ 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: @@ -419,7 +419,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; @@ -434,15 +434,15 @@ H5O_layout_meta_size(const H5F_t *f, const void *_mesg) HGOTO_ERROR(H5E_OHDR, H5E_CANTENCODE, 0, "Invalid layout class"); } /* end switch */ -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 9fb5b3f..64477af 100644 --- a/src/H5Oname.c +++ b/src/H5Oname.c @@ -20,7 +20,7 @@ * * Purpose: Object name message. * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ @@ -177,7 +177,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 376b3ec..028a535 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 ed2c56d..2e0d21f 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; @@ -242,16 +242,16 @@ H5_DLL void *H5O_read(const H5G_entry_t *ent, unsigned type_id, int sequence, 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 herr_t H5O_unprotect(H5G_entry_t *ent, struct H5O_t *oh, hid_t dxpl_id, unsigned oh_flags); -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, unsigned * oh_flags_ptr); 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, +H5_DLL herr_t H5O_touch_oh(H5F_t *f, struct H5O_t *oh, hbool_t force, unsigned * oh_flags_ptr); #ifdef H5O_ENABLE_BOGUS H5_DLL herr_t H5O_bogus(H5G_entry_t *ent, hid_t dxpl_id); -H5_DLL herr_t H5O_bogus_oh(H5F_t *f, struct H5O_t *oh, +H5_DLL herr_t H5O_bogus_oh(H5F_t *f, struct H5O_t *oh, unsigned * oh_flags_ptr); #endif /* H5O_ENABLE_BOGUS */ H5_DLL herr_t H5O_remove(H5G_entry_t *ent, unsigned type_id, int sequence, diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c index 70249ea..cc3beb1 100644 --- a/src/H5Osdspace.c +++ b/src/H5Osdspace.c @@ -86,7 +86,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. @@ -103,7 +103,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 */ @@ -139,9 +139,9 @@ H5O_sdspace_decode(H5F_t *f, hid_t UNUSED dxpl_id, const uint8_t *p, H5O_shared_ /* Increment past reserved byte */ p++; } /* end else */ - + p += 4; /*reserved*/ - + if (sdim->rank > 0) { if (NULL==(sdim->size=H5FL_ARR_MALLOC(hsize_t,sdim->rank))) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); @@ -166,7 +166,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); @@ -181,7 +181,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 @@ -198,7 +198,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. @@ -246,7 +246,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]); } } @@ -326,7 +326,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. */ @@ -363,7 +363,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); @@ -414,7 +414,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 @@ -436,13 +436,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 014f226..f48809a 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; @@ -206,14 +206,14 @@ NAME H5P_init_interface -- Initialize interface-specific information USAGE herr_t H5P_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION Initializes any interface-specific data or routines. Modification: - + Peter Cao May 08, 2005 Add Group creation property, Add object creation property class. @@ -271,7 +271,7 @@ H5P_init_interface(void) /* Assume that if there are properties in the class, they are the default ones */ if(nprops==0) { /* register create intermediate groups */ - if(H5P_register(obj_class,H5G_CRT_INTERMEDIATE_GROUP_NAME,H5G_CRT_INTERMEDIATE_GROUP_SIZE, + if(H5P_register(obj_class,H5G_CRT_INTERMEDIATE_GROUP_NAME,H5G_CRT_INTERMEDIATE_GROUP_SIZE, &intmd_group,NULL,NULL,NULL,NULL,NULL,NULL,NULL)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class") } @@ -498,7 +498,7 @@ H5P_copy_pclass(H5P_genclass_t *pclass) assert(pclass); - /* + /* * Create new property class object */ @@ -574,12 +574,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 */ @@ -1533,7 +1533,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 @@ -1556,7 +1556,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; @@ -1617,7 +1617,7 @@ H5P_create(H5P_genclass_t *pclass) assert(pclass); - /* + /* * Create new property list object */ @@ -2239,7 +2239,7 @@ 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_delete, - H5P_prp_copy_func_t prp_copy, H5P_prp_compare_func_t prp_cmp, + H5P_prp_copy_func_t prp_copy, H5P_prp_compare_func_t prp_cmp, H5P_prp_close_func_t prp_close) #endif /* H5_WANT_H5_V1_6_COMPAT */ { @@ -2402,7 +2402,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. @@ -2420,7 +2420,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 */ @@ -2615,7 +2615,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. @@ -2634,13 +2634,13 @@ 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) #else /* H5_WANT_H5_V1_6_COMPAT */ 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_compare_func_t prp_cmp, H5P_prp_close_func_t prp_close) #endif /* H5_WANT_H5_V1_6_COMPAT */ { @@ -3042,7 +3042,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"); @@ -3198,7 +3198,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"); @@ -3207,7 +3207,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: @@ -3430,7 +3430,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"); @@ -3539,7 +3539,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 @@ -3645,7 +3645,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 @@ -4018,27 +4018,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 @@ -4176,27 +4176,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 @@ -4280,25 +4280,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 @@ -4325,13 +4325,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: @@ -4917,7 +4917,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 @@ -5026,12 +5026,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. @@ -5089,12 +5089,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 3359b52..8977a51 100644 --- a/src/H5Pdcpl.c +++ b/src/H5Pdcpl.c @@ -106,7 +106,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. * *------------------------------------------------------------------------- @@ -153,7 +153,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. * *------------------------------------------------------------------------- @@ -199,7 +199,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. * *------------------------------------------------------------------------- @@ -268,7 +268,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. * *------------------------------------------------------------------------- @@ -289,10 +289,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"); @@ -341,7 +341,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. * *------------------------------------------------------------------------- @@ -382,7 +382,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) { @@ -400,7 +400,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"); @@ -425,7 +425,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. * *------------------------------------------------------------------------- @@ -439,7 +439,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"); @@ -447,10 +447,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); } @@ -482,7 +482,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. * *------------------------------------------------------------------------- @@ -497,7 +497,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"); @@ -505,7 +505,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"); @@ -638,7 +638,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. * *------------------------------------------------------------------------- @@ -747,7 +747,7 @@ done: * should be a value between zero and N-1 as described for * H5Pget_nfilters() and the function will return failure if the * filter number is out of range. - * + * * Return: Success: Filter identification number. * * Failure: H5Z_FILTER_ERROR (Negative) @@ -759,7 +759,7 @@ done: * * Raymond Lu * Tuesday, October 2, 2001 - * Changed the way to check paramter and set property for + * Changed the way to check paramter and set property for * generic property list. * * James Laird and Nat Furrer @@ -786,7 +786,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); #ifdef H5_WANT_H5_V1_6_COMPAT H5TRACE7("Zf","iIux*zxzx",plist_id,idx,flags,cd_nelmts,cd_values,namelen, @@ -795,7 +795,7 @@ H5Pget_filter(hid_t plist_id, unsigned idx, unsigned int *flags/*out*/, H5TRACE7("Zf","iIux*zxzx",plist_id,idx,flags,cd_nelmts,cd_values,namelen, name); #endif /* H5_WANT_H5_V1_6_COMPAT */ - + /* Check args */ if (cd_nelmts || cd_values) { @@ -884,7 +884,7 @@ done: * field contaning encode/decode flags from H5Zpublic.h. 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 * @@ -915,11 +915,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) { @@ -994,7 +994,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 @@ -1012,10 +1012,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"); @@ -1053,8 +1053,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. * *------------------------------------------------------------------------- */ @@ -1064,14 +1064,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"); @@ -1120,7 +1120,7 @@ H5Pset_szip(hid_t plist_id, unsigned options_mask, unsigned pixels_per_block) unsigned cd_values[2]; /* Filter parameters */ unsigned int config_flags; herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_szip, FAIL); H5TRACE3("e","iIuIu",plist_id,options_mask,pixels_per_block); @@ -1135,7 +1135,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"); @@ -1171,10 +1171,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 @@ -1190,14 +1190,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"); @@ -1226,7 +1226,7 @@ done: * Wednesday, December 22, 2004 * * Modifications: - * + * * *------------------------------------------------------------------------- */ @@ -1267,28 +1267,28 @@ done: * Purpose: Sets scaleoffset filter for a dataset creation property list * and user-supplied parameters * - * Parameters: scale_factor: - for integer datatype, - this parameter will be - minimum-bits, if this value is set to 0, + * Parameters: scale_factor: + for integer datatype, + this parameter will be + minimum-bits, if this value is set to 0, scaleoffset filter will calculate the minimum-bits. - + For floating-point datatype, - For variable-minimum-bits method, this will be + For variable-minimum-bits method, this will be the decimal precision of the filter, - For fixed-minimum-bits method, this will be + For fixed-minimum-bits method, this will be the minimum-bit of the filter. scale_type: 0 for floating-point variable-minimum-bits, 1 for floating-point fixed-minimum-bits, other values, for integer datatype - + * Return: Non-negative on success/Negative on failure * * Programmer: Xiaowen Wu * Thursday, April 14, 2005 * * Modifications: - * + * * *------------------------------------------------------------------------- */ @@ -1311,13 +1311,13 @@ H5Pset_scaleoffset(hid_t plist_id, int scale_factor, unsigned scale_type) if(NULL == (plist = H5I_object(plist_id))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID"); - /* Set parameters for the filter + /* Set parameters for the filter * scale_type = 0: floating-point type, filter uses variable-minimum-bits method, * scale_factor is decimal scale factor * scale_type = 1: floating-point type, filter uses fixed-minimum-bits method, * scale_factor is the fixed minimum number of bits * scale type = other: integer type, scale_factor is minimum number of bits - * if scale_factor = 0, then filter calculates minimum number of bits + * if scale_factor = 0, then filter calculates minimum number of bits */ cd_values[0] = scale_factor; cd_values[1] = scale_type; @@ -1338,7 +1338,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 @@ -1356,10 +1356,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"); @@ -1384,7 +1384,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 @@ -1396,8 +1396,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. * *------------------------------------------------------------------------- */ @@ -1408,7 +1408,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); @@ -1442,7 +1442,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); } @@ -1466,7 +1466,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. * *------------------------------------------------------------------------- @@ -1482,7 +1482,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); @@ -1491,7 +1491,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"); @@ -1503,14 +1503,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? */ @@ -1525,7 +1525,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"); @@ -1536,7 +1536,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"); @@ -1558,7 +1558,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 @@ -1590,7 +1590,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: @@ -1602,14 +1602,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: - * + * * *------------------------------------------------------------------------- */ @@ -1631,11 +1631,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); @@ -1648,14 +1648,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: - * + * * *------------------------------------------------------------------------- */ @@ -1676,7 +1676,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"); @@ -1713,7 +1713,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); } @@ -1723,14 +1723,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: - * + * * *------------------------------------------------------------------------- */ @@ -1838,8 +1838,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 3515c55..a9642ef 100644 --- a/src/H5Pdxpl.c +++ b/src/H5Pdxpl.c @@ -30,15 +30,15 @@ * Function: H5Pset_data_transform * * Purpose: - * Sets data transform expression. + * Sets data transform expression. + * + * + * Return: Returns a non-negative value if successful; otherwise returns a negative value. + * * - * - * Return: Returns a non-negative value if successful; otherwise returns a negative value. - * - * * Programmer: Leon Arber * Monday, March 07, 2004 - * + * * Modifications: * *------------------------------------------------------------------------- @@ -50,7 +50,7 @@ herr_t H5Pset_data_transform(hid_t plist_id, const char* expression) herr_t ret_value=SUCCEED; /* return value */ FUNC_ENTER_API(H5Pset_data_transform, FAIL); - + /* Check arguments */ if (expression == NULL) HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "expression cannot be NULL"); @@ -82,10 +82,10 @@ done: * Function: H5Pget_data_transform * * Purpose: - * Gets data transform expression. - * - * Return: Returns a non-negative value if successful; otherwise returns a negative value. - * + * Gets data transform expression. + * + * Return: Returns a non-negative value if successful; otherwise returns a negative value. + * * Comments: * If `expression' is non-NULL then write up to `size' bytes into that * buffer and always return the length of the transform name. @@ -95,10 +95,10 @@ done: * is unchanged and the function returns a negative value. * If a zero is returned for the name's length, then there is no name * associated with the ID. - * + * * Programmer: Leon Arber * August 27, 2004 - * + * * Modifications: * October 20, 2004 LA: Changed API to use size and return ssize_t *------------------------------------------------------------------------- @@ -123,13 +123,13 @@ ssize_t H5Pget_data_transform(hid_t plist_id, char* expression /*out*/, size_t s if(NULL == data_xform_prop) HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Cannot get a data transform that has not been set"); - + /* Get the data transform string */ - pexp = H5Z_xform_extract_xform_str(data_xform_prop); + pexp = H5Z_xform_extract_xform_str(data_xform_prop); if(!pexp) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Failed to retrieve transform expression"); - + len = HDstrlen(pexp); if(expression) { @@ -137,9 +137,9 @@ ssize_t H5Pget_data_transform(hid_t plist_id, char* expression /*out*/, size_t s if(len >= size) expression[size-1]='\0'; } - + ret_value = (ssize_t)len; - + done: if(ret_value<0) { if(data_xform_prop) @@ -278,7 +278,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); @@ -318,7 +318,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); @@ -341,9 +341,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 @@ -360,14 +360,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"); @@ -375,7 +375,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); } @@ -384,9 +384,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 @@ -403,7 +403,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); @@ -422,7 +422,7 @@ H5Pget_edc_check(hid_t plist_id) done: FUNC_LEAVE_API(ret_value); } - + /*------------------------------------------------------------------------- * Function: H5Pset_filter_callback @@ -446,7 +446,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); @@ -457,7 +457,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"); @@ -488,7 +488,7 @@ H5Pset_type_conv_cb(hid_t plist_id, H5T_conv_except_func_t op, void *operate_dat H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ H5T_conv_cb_t cb_struct; - + FUNC_ENTER_API(H5Pset_type_conv_cb, FAIL); H5TRACE3("e","ixx",plist_id,op,operate_data); @@ -499,7 +499,7 @@ H5Pset_type_conv_cb(hid_t plist_id, H5T_conv_except_func_t op, void *operate_dat /* Update property list */ cb_struct.func = op; cb_struct.user_data = operate_data; - + if (H5P_set(plist,H5D_XFER_CONV_CB_NAME,&cb_struct)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set value"); @@ -530,7 +530,7 @@ H5Pget_type_conv_cb(hid_t plist_id, H5T_conv_except_func_t *op, void **operate_d H5P_genplist_t *plist; /* Property list pointer */ H5T_conv_cb_t cb_struct; herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pget_type_conv_cb, FAIL); H5TRACE3("e","i*xx",plist_id,op,operate_data); @@ -637,7 +637,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 9868627..0a9e29e 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); -} +} /*------------------------------------------------------------------------- @@ -799,7 +799,7 @@ done: * * Modifications: * - * Raymond Lu + * Raymond Lu * Tuesday, Oct 23, 2001 * Changed the file access list to the new generic property list. * @@ -807,7 +807,7 @@ done: * Thurs. 3/17/05 * The mdc_nelmts entry is no more in the FAPL, so I modified * the code to ignore it. - * + * *------------------------------------------------------------------------- */ herr_t @@ -816,7 +816,7 @@ H5Pset_cache(hid_t plist_id, int UNUSED 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); @@ -859,14 +859,14 @@ 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. * * J Mainzer * Thurs, 3/17/05 * The mdc_nelmts fapl entry is no more, so we now just * return a constant when that value is requested. - * + * *------------------------------------------------------------------------- */ herr_t @@ -875,7 +875,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); @@ -908,7 +908,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Pset_mdc_config * - * Purpose: Set the initial metadata cache resize configuration in the + * Purpose: Set the initial metadata cache resize configuration in the * target FAPL. * * Return: Non-negative on success/Negative on failure @@ -919,16 +919,16 @@ done: * Modifications: * * Done. - * + * *------------------------------------------------------------------------- */ herr_t -H5Pset_mdc_config(hid_t plist_id, +H5Pset_mdc_config(hid_t plist_id, H5AC_cache_config_t *config_ptr) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value=SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pset_mdc_config, FAIL); H5TRACE2("e","ix",plist_id,config_ptr); @@ -947,7 +947,7 @@ H5Pset_mdc_config(hid_t plist_id, /* set the modified config */ - /* If we ever support multiple versions of H5AC_cache_config_t, we + /* If we ever support multiple versions of H5AC_cache_config_t, we * will have to test the version and do translation here. */ @@ -956,7 +956,7 @@ H5Pset_mdc_config(hid_t plist_id, HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, \ "can't set metadata cache initial config"); } - + done: FUNC_LEAVE_API(ret_value); @@ -982,17 +982,17 @@ done: * Modifications: * * None. - * + * *------------------------------------------------------------------------- */ herr_t -H5Pget_mdc_config(hid_t plist_id, +H5Pget_mdc_config(hid_t plist_id, H5AC_cache_config_t *config_ptr) { H5P_genplist_t *plist; /* Property list pointer */ herr_t ret_value = SUCCEED; /* return value */ - + FUNC_ENTER_API(H5Pget_mdc_config, FAIL); H5TRACE2("e","ix",plist_id,config_ptr); @@ -1056,11 +1056,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 @@ -1100,9 +1100,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 @@ -1135,8 +1135,8 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: Raymond Lu - * November, 2001 + * Programmer: Raymond Lu + * November, 2001 * * Modifications: * @@ -1167,12 +1167,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: * @@ -1189,12 +1189,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); -} +} /*------------------------------------------------------------------------- @@ -1205,7 +1205,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 @@ -1221,8 +1221,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. * *------------------------------------------------------------------------- */ @@ -1261,9 +1261,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. * *------------------------------------------------------------------------- @@ -1301,7 +1301,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 @@ -1314,9 +1314,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. * *------------------------------------------------------------------------- @@ -1326,7 +1326,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); @@ -1356,9 +1356,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. * *------------------------------------------------------------------------- @@ -1394,7 +1394,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 04f5d1d..48ae10d 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 @@ -308,7 +308,7 @@ done: * Modifications: * * Raymond Lu, Oct 14, 2001 - * Changed to the new generic property list. + * Changed to the new generic property list. * *------------------------------------------------------------------------- */ @@ -325,7 +325,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) @@ -360,7 +360,7 @@ done: * * Raymond Lu * Changed to the new generic property list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -408,7 +408,7 @@ done: * * Raymond Lu, Oct 14, 2001 * Changed to the new generic property list. - * + * *------------------------------------------------------------------------- */ herr_t @@ -459,7 +459,7 @@ done: * * Raymond Lu, Oct 14, 2001 * Changed to the new generic property list. - * + * *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Pocpl.c b/src/H5Pocpl.c index e0f7da7..14a477d 100755 --- a/src/H5Pocpl.c +++ b/src/H5Pocpl.c @@ -26,15 +26,15 @@ /*------------------------------------------------------------------------- - * Function: H5Pset_create_intermediate_group + * Function: H5Pset_create_intermediate_group * * Purpose: set crt_intmd_group so that H5Gcreate(), H5Dcreate, etc. * will create missing groups along the given path "name" * * Return: Non-negative on success/Negative on failure * - * Programmer: Peter Cao - * May 08, 2005 + * Programmer: Peter Cao + * May 08, 2005 *------------------------------------------------------------------------- */ herr_t @@ -60,15 +60,15 @@ done: /*------------------------------------------------------------------------- - * Function: H5Pget_create_intermediate_group + * Function: H5Pget_create_intermediate_group * - * Purpose: Returns the crt_intmd_group, which is set at H5Gcreate(hid_t loc_id, + * Purpose: Returns the crt_intmd_group, which is set at H5Gcreate(hid_t loc_id, * const char* name, ... ) for create missing groups * * Return: Non-negative on success/Negative on failure * - * Programmer: Peter Cao - * May 08, 2005 + * Programmer: Peter Cao + * May 08, 2005 *------------------------------------------------------------------------- */ herr_t diff --git a/src/H5Pprivate.h b/src/H5Pprivate.h index 0d09b96..12b3e93 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 49d8288..0a37721 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -47,7 +47,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); @@ -63,7 +63,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 @@ -134,7 +134,7 @@ H5_DLLVAR hid_t H5P_LST_DATATYPE_CREATE_g; H5_DLLVAR hid_t H5P_LST_DATATYPE_ACCESS_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); @@ -144,7 +144,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, @@ -156,7 +156,7 @@ H5_DLL herr_t H5Pinsert(hid_t plist_id, const char *name, size_t size, 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_compare_func_t prp_cmp, H5P_prp_close_func_t prp_close); @@ -272,10 +272,10 @@ H5_DLL herr_t H5Pset_scaleoffset(hid_t plist_id, int scale_factor, unsigned scal 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); H5_DLL herr_t H5Pset_cache(hid_t plist_id, int mdc_nelmts, - size_t rdcc_nelmts, size_t rdcc_nbytes, + size_t rdcc_nelmts, size_t rdcc_nbytes, double rdcc_w0); H5_DLL herr_t H5Pget_cache(hid_t plist_id, int *mdc_nelmts, /* out */ @@ -295,12 +295,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 87a402c..c20e21e 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_type(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 @@ -177,7 +177,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 */ @@ -250,7 +250,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 @@ -306,7 +306,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 @@ -444,7 +444,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 @@ -495,7 +495,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 @@ -568,7 +568,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 @@ -625,7 +625,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 @@ -721,7 +721,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 @@ -757,7 +757,7 @@ H5Rget_obj_type(hid_t id, H5R_type_t ref_type, void *_ref) /* Get the object information */ if ((ret_value=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 ef7f53c..db535f6 100644 --- a/src/H5S.c +++ b/src/H5S.c @@ -72,7 +72,7 @@ NAME H5S_init_interface -- Initialize interface-specific information USAGE herr_t H5S_init_interface() - + RETURNS Non-negative on success/Negative on failure DESCRIPTION @@ -182,8 +182,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); } @@ -198,8 +198,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); } @@ -214,8 +214,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); } @@ -235,7 +235,7 @@ H5S_term_interface(void) path->stats[j].read_timer.etime, buf); } - + /* Write */ if (path->stats[j].write_ncalls) { H5_bandwidth(buf, @@ -272,7 +272,7 @@ H5S_term_interface(void) n = 1; /*H5I*/ } } - + FUNC_LEAVE_NOAPI(n); } @@ -514,7 +514,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); @@ -560,7 +560,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); @@ -1097,7 +1097,7 @@ done: *------------------------------------------------------------------------- */ herr_t -H5S_append(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh, const H5S_t *ds, +H5S_append(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh, const H5S_t *ds, unsigned * oh_flags_ptr) { herr_t ret_value=SUCCEED; /* Return value */ @@ -1404,7 +1404,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 @@ -1427,7 +1427,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. * *------------------------------------------------------------------------- @@ -1438,7 +1438,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 */ @@ -1457,7 +1457,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. */ @@ -1517,7 +1517,7 @@ H5S_extend (H5S_t *space, const hsize_t *size) { int ret_value=0; unsigned u; - + FUNC_ENTER_NOAPI(H5S_extend, FAIL); /* Check args */ @@ -1619,11 +1619,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) @@ -1669,7 +1669,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() */ @@ -1698,7 +1698,7 @@ H5Sencode(hid_t obj_id, void *buf, size_t *nalloc) { H5S_t *dspace; herr_t ret_value=SUCCEED; - + FUNC_ENTER_API (H5Sencode, FAIL); H5TRACE3("e","ix*z",obj_id,buf,nalloc); @@ -1717,8 +1717,8 @@ done: /*------------------------------------------------------------------------- * Function: H5S_encode * - * Purpose: Private function for H5Sencode. Converts an object - * description for data space and its selection into binary + * Purpose: Private function for H5Sencode. Converts an object + * description for data space and its selection into binary * in a buffer. * * Return: Success: non-negative @@ -1762,7 +1762,7 @@ H5S_encode(H5S_t *obj, unsigned char *buf, size_t *nalloc) *nalloc = extent_size+select_size+1+1+1+4; HGOTO_DONE(ret_value); } - + /* Encode the type of the information */ *buf++ = H5O_SDSPACE_ID; @@ -1774,7 +1774,7 @@ H5S_encode(H5S_t *obj, unsigned char *buf, size_t *nalloc) /* Encode size of extent information. Pointer is actually moved in this macro. */ UINT32ENCODE(buf, extent_size); - + /* Encode the extent part of dataspace */ if(H5O_encode(&f, buf, obj, H5O_SDSPACE_ID)<0) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTENCODE, FAIL, "can't encode extent space"); @@ -1795,7 +1795,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Sdecode * - * Purpose: Decode a binary object description of data space and + * Purpose: Decode a binary object description of data space and * return a new object handle. * * Return: Success: dataspace ID(non-negative) @@ -1815,7 +1815,7 @@ H5Sdecode(const void *buf) { H5S_t *ds; hid_t ret_value; - + FUNC_ENTER_API (H5Sdecode, FAIL); H5TRACE1("i","x",buf); @@ -1824,7 +1824,7 @@ H5Sdecode(const void *buf) if((ds = H5S_decode(buf))==NULL) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDECODE, FAIL, "can't decode object"); - + /* Register the type and return the ID */ if ((ret_value=H5I_register (H5I_DATASPACE, ds))<0) HGOTO_ERROR (H5E_DATASPACE, H5E_CANTREGISTER, FAIL, "unable to register dataspace"); @@ -1838,7 +1838,7 @@ done: * Function: H5S_decode * * Purpose: Private function for H5Sdecode. Reconstructs a binary - * description of dataspace and returns a new object handle. + * description of dataspace and returns a new object handle. * * Return: Success: dataspace ID(non-negative) * @@ -1882,7 +1882,7 @@ H5S_decode(const unsigned char *buf) /* Decode size of extent information */ UINT32DECODE(buf, extent_size); - + /* Decode the extent part of dataspace */ if((extent = H5O_decode(&f, buf, H5O_SDSPACE_ID))==NULL) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDECODE, NULL, "can't decode object"); @@ -1978,7 +1978,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); } @@ -2016,7 +2016,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); } @@ -2123,7 +2123,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 */ @@ -2200,7 +2200,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 */ @@ -2243,9 +2243,9 @@ 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_NULL: fprintf(stream, "%*s%-*s H5S_NULL\n", indent, "", fwidth, @@ -2256,14 +2256,14 @@ H5S_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream, int indent, 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/H5SH.c b/src/H5SH.c index c77d0fd..9c8e330 100644 --- a/src/H5SH.c +++ b/src/H5SH.c @@ -72,8 +72,8 @@ H5FL_DEFINE(H5SH_t); * Mar 23 2005 * * Changes: John Mainzer -- 6/7/05 - * Removed code modifying the is_dirty field of the cache - * info. Management of this field is in the process of + * Removed code modifying the is_dirty field of the cache + * info. Management of this field is in the process of * being moved to the H5C code. * *------------------------------------------------------------------------- @@ -173,7 +173,7 @@ H5SH_alloc_extend_cb(const H5BT_blk_info_t *record, void *_op_data) H5BT_COMPARE_LESS, (record->addr + record->len + 1), &free_block) < 0) HGOTO_ERROR(H5E_HEAP, H5E_NOSPACE, H5BT_ITER_ERROR, "can't search for free space") - + /* Check if we can use free space for part of block to allocate */ if(H5F_addr_defined(free_block.addr) && (free_block.addr + free_block.len) == (record->addr + record->len)) { diff --git a/src/H5SHcache.c b/src/H5SHcache.c index 5a57084..aa4c981 100644 --- a/src/H5SHcache.c +++ b/src/H5SHcache.c @@ -289,7 +289,7 @@ H5SH_cache_clear(H5F_t *f, H5SH_t *sh, hbool_t destroy) /* Reset the dirty flag. */ sh->cache_info.is_dirty = FALSE; - + if (destroy) if (H5SH_cache_dest(f, sh) < 0) HGOTO_ERROR(H5E_HEAP, H5E_CANTFREE, FAIL, "unable to destroy segmented heap info") @@ -303,7 +303,7 @@ done: * Function: H5SH_cache_size * * Purpose: Compute the size in bytes of a segmented heap info - * on disk, and return it in *size_ptr. On failure, + * on disk, and return it in *size_ptr. On failure, * the value of *size_ptr is undefined. * * Return: Non-negative on success/Negative on failure diff --git a/src/H5SHprivate.h b/src/H5SHprivate.h index b6f2306..375be19 100644 --- a/src/H5SHprivate.h +++ b/src/H5SHprivate.h @@ -36,7 +36,7 @@ /* Library Private Macros */ /**************************/ - + /****************************/ /* Library Private Typedefs */ /****************************/ 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 563e118..92f4b10 100644 --- a/src/H5Shyper.c +++ b/src/H5Shyper.c @@ -1047,7 +1047,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; @@ -1258,7 +1258,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; @@ -1374,7 +1374,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 */ @@ -1783,7 +1783,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 */ @@ -1903,7 +1903,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; @@ -2124,7 +2124,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 */ @@ -2157,7 +2157,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() */ @@ -2477,7 +2477,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 */ @@ -2490,7 +2490,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); @@ -2927,7 +2927,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; @@ -3217,7 +3217,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. @@ -3283,7 +3283,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. @@ -3620,7 +3620,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 */ @@ -3739,7 +3739,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 */ @@ -4235,7 +4235,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 */ @@ -4244,7 +4244,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; @@ -4256,7 +4256,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; @@ -4266,7 +4266,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 */ @@ -4443,7 +4443,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 */ @@ -4530,7 +4530,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 */ @@ -4613,7 +4613,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 */ @@ -4705,7 +4705,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 */ @@ -5089,7 +5089,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) { @@ -5210,7 +5210,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 */ @@ -5292,7 +5292,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; @@ -5541,7 +5541,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"); @@ -5787,7 +5787,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op, assert(start); assert(count); assert(op>H5S_SELECT_NOOP && opH5S_SELECT_NOOP && opextent.rank,start,stride,count,block))==NULL) HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't create hyperslab information"); @@ -6387,7 +6387,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op, assert(start); assert(count); assert(op>H5S_SELECT_NOOP && opH5S_SELECT_NOOP && opselect.sel_info.hslab->span_lst==NULL) if(H5S_hyper_generate_spans(space1)<0) @@ -6809,7 +6809,7 @@ done: with the resulting selection. USAGE hid_t H5Scombine_select(space1, op, space2) - hid_t space1; IN: First Dataspace ID + hid_t space1; IN: First Dataspace ID H5S_seloper_t op; IN: Selection operation hid_t space2; IN: Second Dataspace ID RETURNS @@ -6893,7 +6893,7 @@ H5S_select_select (H5S_t *space1, H5S_seloper_t op, H5S_t *space2) assert(space1); assert(space2); assert(op>H5S_SELECT_NOOP && opselect.sel_info.hslab->span_lst==NULL) if(H5S_hyper_generate_spans(space1)<0) @@ -6935,7 +6935,7 @@ done: to modify it. USAGE herr_t H5Sselect_select(space1, op, space2) - hid_t space1; IN/OUT: First Dataspace ID + hid_t space1; IN/OUT: First Dataspace ID H5S_seloper_t op; IN: Selection operation hid_t space2; IN: Second Dataspace ID RETURNS @@ -7253,7 +7253,7 @@ partial_done: /* Yes, goto's are evil, so sue me... :-) */ else { off[curr_seq]=loc_off; len[curr_seq]=span_size; - + /* Increment the number of sequences in arrays */ curr_seq++; } /* end else */ @@ -7285,7 +7285,7 @@ partial_done: /* Yes, goto's are evil, so sue me... :-) */ else { off[curr_seq]=loc_off; len[curr_seq]=span_size; - + /* Increment the number of sequences in arrays */ curr_seq++; } /* end else */ diff --git a/src/H5Smpio.c b/src/H5Smpio.c index 48f2358..7105ef9 100644 --- a/src/H5Smpio.c +++ b/src/H5Smpio.c @@ -530,7 +530,7 @@ H5S_mpio_span_hyper_type( const H5S_t *space, *new_type = span_type; /* fill in the remaining return values */ - *count = 1; + *count = 1; *extra_offset = 0; *is_derived_type = 1; diff --git a/src/H5Snone.c b/src/H5Snone.c index b50af6a..154758c 100644 --- a/src/H5Snone.c +++ b/src/H5Snone.c @@ -442,7 +442,7 @@ H5S_none_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/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 a948cd2..a394e20 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==H5T_VLEN && dt->shared->u.vlen.type==H5T_VLEN_STRING) ret_value=H5T_STRING; else ret_value=dt->shared->type; - /* Externally, a VL string is a string; internally, a VL string is a VL. */ - if(internal) { + /* Externally, a VL string is a string; internally, a VL string is a VL. */ + if(internal) { ret_value=dt->shared->type; } else { if(H5T_IS_VL_STRING(dt->shared)) @@ -1946,7 +1946,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"); @@ -1987,7 +1987,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 @@ -2091,7 +2091,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); @@ -2184,7 +2184,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); @@ -2208,16 +2208,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: * @@ -2227,7 +2227,7 @@ H5T_t * H5T_get_super(H5T_t *dt) { H5T_t *ret_value=NULL; - + FUNC_ENTER_NOAPI(H5T_get_super, NULL); assert(dt); @@ -2290,7 +2290,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 @@ -2369,7 +2369,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)) { @@ -2392,7 +2392,7 @@ H5T_register(H5T_pers_t pers, const char *name, H5T_t *src, H5T_t *dst, H5E_clear_stack(NULL); } /* end for */ } /* end else */ - + done: if (ret_value<0) { if (new_path) { @@ -2643,7 +2643,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"); @@ -2653,7 +2653,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); } @@ -2693,7 +2693,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); @@ -2722,7 +2722,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Tencode * - * Purpose: Given an datatype ID, converts the object description into + * Purpose: Given an datatype ID, converts the object description into * binary in a buffer. * * Return: Success: non-negative @@ -2742,7 +2742,7 @@ H5Tencode(hid_t obj_id, void *buf, size_t *nalloc) { H5T_t *dtype; herr_t ret_value=SUCCEED; - + FUNC_ENTER_API (H5Tencode, FAIL); H5TRACE3("e","ix*z",obj_id,buf,nalloc); @@ -2783,7 +2783,7 @@ H5Tdecode(const void *buf) { H5T_t *dt; hid_t ret_value; - + FUNC_ENTER_API (H5Tdecode, FAIL); H5TRACE1("i","x",buf); @@ -2792,7 +2792,7 @@ H5Tdecode(const void *buf) if((dt = H5T_decode(buf))==NULL) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTDECODE, FAIL, "can't decode object"); - + /* Register the type and return the ID */ if ((ret_value=H5I_register (H5I_DATATYPE, dt))<0) HGOTO_ERROR (H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register data type"); @@ -2803,14 +2803,14 @@ done: /*------------------------------------------------------------------------- * API functions are above; library-private functions are below... - *------------------------------------------------------------------------- + *------------------------------------------------------------------------- */ /*------------------------------------------------------------------------- * Function: H5T_encode * - * Purpose: Private function for H5Tencode. Converts an object + * Purpose: Private function for H5Tencode. Converts an object * description into binary in a buffer. * * Return: Success: non-negative @@ -2833,7 +2833,7 @@ H5T_encode(H5T_t *obj, unsigned char *buf, size_t *nalloc) herr_t ret_value = SUCCEED; FUNC_ENTER_NOAPI(H5T_encode, FAIL); - + /* Find out the size of buffer needed */ if((buf_size=H5O_raw_size(H5O_DTYPE_ID, &f, obj))==0) HGOTO_ERROR(H5E_DATATYPE, H5E_BADSIZE, FAIL, "can't find datatype size"); @@ -2862,7 +2862,7 @@ done: * Function: H5T_decode * * Purpose: Private function for H5Tdecode. Reconstructs a binary - * description of datatype and returns a new object handle. + * description of datatype and returns a new object handle. * * Return: Success: datatype ID(non-negative) * @@ -2946,7 +2946,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; @@ -3026,7 +3026,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); @@ -3061,7 +3061,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); @@ -3136,7 +3136,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); @@ -3236,7 +3236,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 @@ -3284,7 +3284,7 @@ H5T_copy(const H5T_t *old_dt, H5T_copy_t method) } break; } /* end switch */ - + switch(new_dt->shared->type) { case H5T_COMPOUND: { @@ -3363,7 +3363,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: @@ -3405,7 +3405,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) @@ -3541,7 +3541,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() */ @@ -3584,7 +3584,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); @@ -3689,7 +3689,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++) { @@ -3699,7 +3699,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)) @@ -3723,12 +3723,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; @@ -3781,7 +3781,7 @@ H5T_set_size(H5T_t *dt, size_t size) } } /* end if */ } - + done: FUNC_LEAVE_NOAPI(ret_value); } @@ -4331,7 +4331,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 @@ -4439,7 +4439,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); } @@ -4657,7 +4657,7 @@ H5G_entry_t * H5T_entof (H5T_t *dt) { H5G_entry_t *ret_value = NULL; - + FUNC_ENTER_NOAPI(H5T_entof, NULL); assert (dt); @@ -4681,14 +4681,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: * @@ -4714,13 +4714,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: @@ -4752,7 +4752,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 @@ -4802,7 +4802,7 @@ htri_t H5T_is_sensible(const H5T_t *dt) { htri_t ret_value; - + FUNC_ENTER_NOAPI(H5T_is_sensible, FAIL); assert(dt); @@ -4845,7 +4845,7 @@ done: H5T_t *dt; IN/OUT: Pointer to the datatype to mark H5F_t *f; IN: Pointer to the file the datatype is in H5T_vlen_type_t loc IN: location of type - + RETURNS One of two values on success: TRUE - If the location of any vlen types changed @@ -4889,7 +4889,7 @@ H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "Unable to set VL location"); if(changed>0) ret_value=changed; - + /* Check if the field changed size */ if(old_size != dt->shared->parent->shared->size) { /* Adjust the size of the array */ @@ -4901,7 +4901,7 @@ H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc) case H5T_COMPOUND: /* Check each field and recurse on VL, compound and array type */ /* Sort the fields based on offsets */ H5T_sort_value(dt,NULL); - + for (i=0,accum_change=0; ishared->u.compnd.nmembs; i++) { H5T_t *memb_type; /* Member's datatype pointer */ @@ -4922,7 +4922,7 @@ H5T_set_loc(H5T_t *dt, H5F_t *f, H5T_loc_t loc) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "Unable to set VL location"); if(changed>0) ret_value=changed; - + /* Check if the field changed size */ if(old_size != memb_type->shared->size) { /* Adjust the size of the member */ @@ -5055,7 +5055,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)++) { @@ -5083,8 +5083,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); } @@ -5254,7 +5254,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++) { @@ -5275,7 +5275,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, " "); @@ -5289,7 +5289,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 812f8ce..fa69fc8 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. * @@ -156,7 +156,7 @@ H5TS_mutex_lock(H5TS_mutex_t *mutex) mutex->owner_thread = H5MM_malloc(sizeof(pthread_t)); if (!mutex->owner_thread) { - H5E_push_stack(NULL, "H5TS_mutex_lock", __FILE__, __LINE__, + H5E_push_stack(NULL, "H5TS_mutex_lock", __FILE__, __LINE__, H5E_ERR_CLS_g, H5E_RESOURCE, H5E_NOSPACE, "memory allocation failed"); return FAIL; } @@ -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 0049682..e3769fe 100644 --- a/src/H5Tbit.c +++ b/src/H5Tbit.c @@ -58,7 +58,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 @@ -94,7 +94,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. @@ -110,7 +110,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 @@ -119,7 +119,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<>= 16. SHIFT_DIST is positive for + * value <<= 3, or value >>= 16. SHIFT_DIST is positive for * left shift, negative for right shift. The bit vector starts * at OFFSET and is SIZE long. The caller has to make sure * SIZE+OFFSET doesn't exceed the size of BUF. * * For example, if we have a bit sequence 00011100, offset=2, - * size=3, shift_dist=2, the result will be 00010000. + * size=3, shift_dist=2, the result will be 00010000. * * Return: void * @@ -188,23 +188,23 @@ H5T_bit_shift (uint8_t *buf, ssize_t shift_dist, size_t offset, size_t size) assert(size); if(!shift_dist) - goto done; + goto done; if((size_t)ABS(shift_dist) >= size) { H5T_bit_set(buf, offset, size, 0); goto done; } - + tmp_buf = (uint8_t*)H5MM_calloc(size/8+1); assert(tmp_buf); - /* Shift vector by making copies */ - if(shift_dist > 0) { /* left shift */ + /* Shift vector by making copies */ + if(shift_dist > 0) { /* left shift */ /* Copy part to be shifted to a temporary buffer */ H5T_bit_copy (tmp_buf, 0, buf, offset, (size_t)(size-shift_dist)); - + /* Copy it back to the original buffer */ H5T_bit_copy (buf, offset+shift_dist, tmp_buf, 0, (size_t)(size-shift_dist)); - + /* Zero-set the left part*/ H5T_bit_set(buf, offset, (size_t)shift_dist, 0); } else { /* right shift */ @@ -246,7 +246,7 @@ H5T_bit_get_d (uint8_t *buf, size_t offset, size_t size) hsize_t val=0; size_t i, hs; hsize_t ret_value; /* Return value */ - + FUNC_ENTER_NOAPI_NOFUNC(H5T_bit_get_d); assert (8*sizeof(val)>=size); @@ -293,7 +293,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) { @@ -351,7 +351,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; @@ -376,7 +376,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 @@ -411,7 +411,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--) { @@ -443,7 +443,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) { @@ -472,7 +472,7 @@ H5T_bit_find (uint8_t *buf, size_t offset, size_t size, H5T_sdir_t direction, } break; } - + done: FUNC_LEAVE_NOAPI(ret_value); } @@ -481,10 +481,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 @@ -550,7 +550,7 @@ H5T_bit_inc(uint8_t *buf, size_t start, size_t size) /*------------------------------------------------------------------------- * Function: H5T_bit_dec * - * Purpose: decrement part of a bit field by substracting 1. The bit + * Purpose: decrement part of a bit field by substracting 1. The bit * field starts with bit position START and is SIZE bits long. * * Return: Success: The "borrow-in" value. It's one if underflows, @@ -572,7 +572,7 @@ H5T_bit_dec(uint8_t *buf, size_t start, size_t size) size_t pos = start % 8; uint8_t tmp; unsigned borrow = 0; - + /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_bit_dec); @@ -581,21 +581,21 @@ H5T_bit_dec(uint8_t *buf, size_t start, size_t size) /* The first partial byte */ if ((size+start-1)/8 > idx) { /*bit sequence doesn't end in the same byte as starts*/ - /* Example: a sequence like 11000100 and start = 3. We substract 00001000 from - * it and get 10111100. If a sequence is 00000111, we do right shift for START + /* Example: a sequence like 11000100 and start = 3. We substract 00001000 from + * it and get 10111100. If a sequence is 00000111, we do right shift for START * bits and get 00000000. So we need to borrow from higher byte when we substract * 00001000. - */ + */ if(!(buf[idx] >> pos)) borrow = 1; buf[idx] -= 1 << pos; idx++; size -= (8 - pos); } else { /* bit sequence ends in the same byte as starts */ - /* Example: a sequence like 11000100 and pos=3, size=3. We substract 00001000 + /* Example: a sequence like 11000100 and pos=3, size=3. We substract 00001000 * and get 10111100. A bit is borrowed from 6th bit(buf[idx]>>6=00000010, tmp>>6=00000011, * not equal). We need to put this bit back by increment 1000000. - */ + */ tmp = buf[idx]; buf[idx] -= 1 << pos; if((buf[idx] >> (pos+size)) != tmp >> (pos+size)) { @@ -604,7 +604,7 @@ H5T_bit_dec(uint8_t *buf, size_t start, size_t size) } goto done; } - + /* The middle bytes */ while (borrow && size>=8) { if(buf[idx]) @@ -632,7 +632,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_bit_neg * - * Purpose: negate part of a bit sequence. The bit + * Purpose: negate part of a bit sequence. The bit * field starts with bit position START and is SIZE bits long. * * Return: void @@ -650,7 +650,7 @@ H5T_bit_neg(uint8_t *buf, size_t start, size_t size) size_t idx = start / 8; size_t pos = start % 8; uint8_t tmp; - + /* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_bit_neg); diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c index cd2929c..c98543d 100644 --- a/src/H5Tcommit.c +++ b/src/H5Tcommit.c @@ -41,7 +41,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 @@ -79,7 +79,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); @@ -110,8 +110,8 @@ done: * * Return: Non-negative on success/Negative on failure * - * Programmer: Peter Cao - * May 17, 2005 + * Programmer: Peter Cao + * May 17, 2005 * * Modifications: * @@ -123,7 +123,7 @@ H5Tcommit_expand(hid_t loc_id, const char *name, hid_t type_id, hid_t tcpl_id, h H5G_entry_t *loc = NULL; H5T_t *type = NULL; herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_API(H5Tcommit_expand, FAIL) /* Check arguments */ @@ -172,8 +172,8 @@ done: * * Modifications: * Added datatype creation & access property lists - * Peter Cao - * May 17, 2005 + * Peter Cao + * May 17, 2005 * *------------------------------------------------------------------------- */ @@ -184,7 +184,7 @@ H5T_commit(H5G_entry_t *loc, const char *name, H5T_t *type, hid_t dxpl_id, H5F_t *file = NULL; H5P_genplist_t *tc_plist; /* Property list created */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI_NOINIT(H5T_commit) HDassert (loc); @@ -282,7 +282,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 4746b10..2076a7c 100644 --- a/src/H5Tconv.c +++ b/src/H5Tconv.c @@ -123,12 +123,12 @@ H5FL_BLK_DEFINE_STATIC(array_seq); * least as large as the destination. Overflows can occur when * the destination is narrower than the source. * - * xF: Integers to float-point(float or double) values where the desination - * is at least as wide as the source. This case cannot generate + * xF: Integers to float-point(float or double) values where the desination + * is at least as wide as the source. This case cannot generate * overflows. * * Fx: Float-point(float or double) values to integer where the source is - * at least as wide as the destination. Overflow can occur + * at least as wide as the destination. Overflow can occur * when the source magnitude is too large for the destination. * * The macros take a subset of these arguments in the order listed here: @@ -156,15 +156,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 @@ -738,7 +738,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"); } @@ -857,43 +857,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; } @@ -1329,7 +1329,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; @@ -1352,7 +1352,7 @@ H5T_conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* Allocate space for order-reversed source buffer */ src_rev = (uint8_t*)H5MM_calloc(src->shared->size); - + /* The conversion loop */ for (elmtno=0; elmtnoshared->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 @@ -1405,11 +1405,11 @@ H5T_conv_b_b(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /*overflow*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ H5T_reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } - - if(except_ret == H5T_CONV_UNHANDLED) { + + if(except_ret == H5T_CONV_UNHANDLED) { H5T_bit_copy(d, dst->shared->u.atomic.offset, s, src->shared->u.atomic.offset, dst->shared->u.atomic.prec); } else if(except_ret == H5T_CONV_ABORT) @@ -1478,7 +1478,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: @@ -1490,7 +1490,7 @@ done: H5MM_free(src_rev); FUNC_LEAVE_NOAPI(ret_value); } - + /*------------------------------------------------------------------------- * Function: H5T_conv_struct_init @@ -1528,9 +1528,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. @@ -1625,7 +1625,7 @@ done: } -/*------------------------------------------------------------------------- +/*------------------------------------------------------------------------- * Function: H5T_conv_struct * * Purpose: Converts between compound data types. This is a soft @@ -1636,7 +1636,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; @@ -1839,7 +1839,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); } @@ -1860,7 +1860,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 @@ -1888,7 +1888,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 @@ -1940,7 +1940,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 @@ -2014,7 +2014,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 @@ -2106,7 +2106,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); } @@ -2138,7 +2138,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; @@ -2174,7 +2174,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. @@ -2284,7 +2284,7 @@ H5T_conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_conv_cb_t cb_struct; /*conversion callback structure */ H5T_conv_ret_t except_ret; /*return of callback function */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_enum, FAIL); switch (cdata->command) { @@ -2332,7 +2332,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. */ @@ -2349,7 +2349,7 @@ H5T_conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, s = buf + (nelmts-1) * src->shared->size; d = buf + (nelmts-1) * dst->shared->size; } - + /* Get the plist structure */ if(NULL == (plist = H5P_object_verify(dxpl_id,H5P_DATASET_XFER))) HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find property list for ID"); @@ -2357,7 +2357,7 @@ H5T_conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* Get conversion exception callback property */ if (H5P_get(plist,H5D_XFER_CONV_CB_NAME,&cb_struct)<0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get conversion exception callback"); - + for (i=0; ilength) { /* Use O(1) lookup */ @@ -2373,11 +2373,11 @@ H5T_conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /*overflow*/ except_ret = H5T_CONV_UNHANDLED; if(cb_struct.func) { /*If user's exception handler is present, use it*/ - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, s, d, cb_struct.user_data); } - - if(except_ret == H5T_CONV_UNHANDLED) { + + if(except_ret == H5T_CONV_UNHANDLED) { HDmemset(d, 0xff, dst->shared->size); } else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") @@ -2406,11 +2406,11 @@ H5T_conv_enum(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if (lt>=rt) { except_ret = H5T_CONV_UNHANDLED; if(cb_struct.func) { /*If user's exception handler is present, use it*/ - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src, d, cb_struct.user_data); } - - if(except_ret == H5T_CONV_UNHANDLED) { + + if(except_ret == H5T_CONV_UNHANDLED) { HDmemset(d, 0xff, dst->shared->size); } else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") @@ -2442,7 +2442,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 @@ -2464,9 +2464,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. * *------------------------------------------------------------------------- */ @@ -2581,7 +2581,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"); @@ -2654,7 +2654,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) { @@ -2990,7 +2990,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; @@ -3012,7 +3012,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; @@ -3058,7 +3058,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 @@ -3091,7 +3091,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) { /* @@ -3109,11 +3109,11 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /*overflow*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ H5T_reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } - - if(except_ret == H5T_CONV_UNHANDLED) { + + if(except_ret == H5T_CONV_UNHANDLED) { H5T_bit_set (d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec, TRUE); } else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") @@ -3124,7 +3124,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) { /* @@ -3138,11 +3138,11 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /*overflow - source is negative*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ H5T_reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, src_id, dst_id, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, src_id, dst_id, src_rev, d, cb_struct.user_data); } - - if(except_ret == H5T_CONV_UNHANDLED) { + + if(except_ret == H5T_CONV_UNHANDLED) { H5T_bit_set (d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec, FALSE); } else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") @@ -3158,10 +3158,10 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /*overflow - source is positive*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ H5T_reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } - + if(except_ret == H5T_CONV_UNHANDLED) H5T_bit_set (d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec, TRUE); else if(except_ret == H5T_CONV_ABORT) @@ -3173,7 +3173,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) { /* @@ -3185,11 +3185,11 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /*overflow*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ H5T_reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } - - if(except_ret == H5T_CONV_UNHANDLED) { + + if(except_ret == H5T_CONV_UNHANDLED) { H5T_bit_set (d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec-1, TRUE); H5T_bit_set (d, (dst->shared->u.atomic.offset + dst->shared->u.atomic.prec-1), 1, FALSE); } else if(except_ret == H5T_CONV_ABORT) @@ -3217,16 +3217,16 @@ 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(cb_struct.func) { /*If user's exception handler is present, use it*/ H5T_reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, src_id, dst_id, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, src_id, dst_id, src_rev, d, cb_struct.user_data); } - - if(except_ret == H5T_CONV_UNHANDLED) { + + if(except_ret == H5T_CONV_UNHANDLED) { H5T_bit_set (d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec-1, FALSE); H5T_bit_set (d, (dst->shared->u.atomic.offset + dst->shared->u.atomic.prec-1), 1, TRUE); } else if(except_ret == H5T_CONV_ABORT) @@ -3240,7 +3240,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 @@ -3252,11 +3252,11 @@ H5T_conv_i_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /*overflow*/ if(cb_struct.func) { /*If user's exception handler is present, use it*/ H5T_reverse_order(src_rev, s, src->shared->size, src->shared->u.atomic.order); /*reverse order first*/ - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } - - if(except_ret == H5T_CONV_UNHANDLED) { + + if(except_ret == H5T_CONV_UNHANDLED) { H5T_bit_set (d, dst->shared->u.atomic.offset, dst->shared->u.atomic.prec-1, TRUE); H5T_bit_set (d, (dst->shared->u.atomic.offset + dst->shared->u.atomic.prec-1), 1, FALSE); } else if(except_ret == H5T_CONV_ABORT) @@ -3316,7 +3316,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: @@ -3393,7 +3393,7 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_conv_ret_t except_ret; /*return of callback function */ hbool_t reverse; /*if reverse the order of destination */ herr_t ret_value=SUCCEED; /*return value */ - + FUNC_ENTER_NOAPI(H5T_conv_f_f, FAIL); switch (cdata->command) { @@ -3488,7 +3488,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 @@ -3538,9 +3538,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); } else if(except_ret == H5T_CONV_HANDLED) { @@ -3556,7 +3556,7 @@ 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 */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ @@ -3574,9 +3574,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); } else if(except_ret == H5T_CONV_HANDLED) { @@ -3619,7 +3619,7 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, * the exponent bias yet. */ expo = H5T_bit_get_d(s, src.u.f.epos, src.u.f.esize); - + if(expo==0) denormalized=TRUE; @@ -3644,7 +3644,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. @@ -3706,11 +3706,11 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } - - if(except_ret == H5T_CONV_UNHANDLED) { + + if(except_ret == H5T_CONV_UNHANDLED) { expo = expo_max; H5T_bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE); msize = 0; @@ -3742,7 +3742,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 @@ -3768,7 +3768,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), @@ -3777,7 +3777,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++; @@ -3793,11 +3793,11 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } - - if(except_ret == H5T_CONV_UNHANDLED) { + + if(except_ret == H5T_CONV_UNHANDLED) { expo = expo_max; H5T_bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE); } else if(except_ret == H5T_CONV_ABORT) @@ -3857,9 +3857,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"); } @@ -3904,7 +3904,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) { @@ -3966,7 +3966,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: @@ -4044,12 +4044,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++] = ' '; @@ -4777,7 +4777,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: @@ -4843,7 +4843,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: @@ -5404,7 +5404,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: @@ -7276,7 +7276,7 @@ H5T_conv_schar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_schar_float, FAIL); H5T_CONV_xF(SCHAR, FLOAT, signed char, float, -, -); @@ -7308,7 +7308,7 @@ H5T_conv_schar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_schar_double, FAIL); H5T_CONV_xF(SCHAR, DOUBLE, signed char, double, -, -); @@ -7321,7 +7321,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_schar_ldouble * - * Purpose: Convert native signed char to native long double using + * Purpose: Convert native signed char to native long double using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -7341,7 +7341,7 @@ H5T_conv_schar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_schar_ldouble, FAIL); H5T_CONV_xF(SCHAR, LDOUBLE, signed char, long double, -, -); @@ -7374,7 +7374,7 @@ H5T_conv_uchar_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_uchar_float, FAIL); H5T_CONV_xF(UCHAR, FLOAT, unsigned char, float, -, -); @@ -7406,7 +7406,7 @@ H5T_conv_uchar_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_uchar_double, FAIL); H5T_CONV_xF(UCHAR, DOUBLE, unsigned char, double, -, -); @@ -7419,7 +7419,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_uchar_ldouble * - * Purpose: Convert native unsigned char to native long double using + * Purpose: Convert native unsigned char to native long double using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -7439,7 +7439,7 @@ H5T_conv_uchar_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_uchar_ldouble, FAIL); H5T_CONV_xF(UCHAR, LDOUBLE, unsigned char, long double, -, -); @@ -7472,7 +7472,7 @@ H5T_conv_short_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_short_float, FAIL); H5T_CONV_xF(SHORT, FLOAT, short, float, -, -); @@ -7504,7 +7504,7 @@ H5T_conv_short_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_short_double, FAIL); H5T_CONV_xF(SHORT, DOUBLE, short, double, -, -); @@ -7537,7 +7537,7 @@ H5T_conv_short_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_short_ldouble, FAIL); H5T_CONV_xF(SHORT, LDOUBLE, short, long double, -, -); @@ -7570,7 +7570,7 @@ H5T_conv_ushort_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ushort_float, FAIL); H5T_CONV_xF(USHORT, FLOAT, unsigned short, float, -, -); @@ -7602,7 +7602,7 @@ H5T_conv_ushort_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ushort_double, FAIL); H5T_CONV_xF(USHORT, DOUBLE, unsigned short, double, -, -); @@ -7635,7 +7635,7 @@ H5T_conv_ushort_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ushort_ldouble, FAIL); H5T_CONV_xF(USHORT, LDOUBLE, unsigned short, long double, -, -); @@ -7668,7 +7668,7 @@ H5T_conv_int_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_int_float, FAIL); H5T_CONV_xF(INT, FLOAT, int, float, -, -); @@ -7700,7 +7700,7 @@ H5T_conv_int_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_int_double, FAIL); H5T_CONV_xF(INT, DOUBLE, int, double, -, -); @@ -7733,7 +7733,7 @@ H5T_conv_int_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_int_ldouble, FAIL); H5T_CONV_xF(INT, LDOUBLE, int, long double, -, -); @@ -7747,7 +7747,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_uint_float * - * Purpose: Convert native unsigned integer to native float using + * Purpose: Convert native unsigned integer to native float using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -7766,7 +7766,7 @@ H5T_conv_uint_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_uint_float, FAIL); H5T_CONV_xF(UINT, FLOAT, unsigned int, float, -, -); @@ -7779,7 +7779,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_uint_double * - * Purpose: Convert native unsigned integer to native double using + * Purpose: Convert native unsigned integer to native double using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -7798,7 +7798,7 @@ H5T_conv_uint_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_uint_double, FAIL); H5T_CONV_xF(UINT, DOUBLE, unsigned int, double, -, -); @@ -7811,7 +7811,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_uint_ldouble * - * Purpose: Convert native unsigned integer to native long double using + * Purpose: Convert native unsigned integer to native long double using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -7831,7 +7831,7 @@ H5T_conv_uint_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_uint_ldouble, FAIL); H5T_CONV_xF(UINT, LDOUBLE, unsigned int, long double, -, -); @@ -7864,7 +7864,7 @@ H5T_conv_long_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_long_float, FAIL); H5T_CONV_xF(LONG, FLOAT, long, float, -, -); @@ -7896,7 +7896,7 @@ H5T_conv_long_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_long_double, FAIL); H5T_CONV_xF(LONG, DOUBLE, long, double, -, -); @@ -7929,7 +7929,7 @@ H5T_conv_long_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_long_ldouble, FAIL); H5T_CONV_xF(LONG, LDOUBLE, long, long double, -, -); @@ -7963,7 +7963,7 @@ H5T_conv_ulong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ulong_float, FAIL); H5T_CONV_xF(ULONG, FLOAT, unsigned long, float, -, -); @@ -7997,7 +7997,7 @@ H5T_conv_ulong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ulong_double, FAIL); H5T_CONV_xF(ULONG, DOUBLE, unsigned long, double, -, -); @@ -8011,7 +8011,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ulong_ldouble * - * Purpose: Convert native unsigned long to native long double using + * Purpose: Convert native unsigned long to native long double using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8031,7 +8031,7 @@ H5T_conv_ulong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ulong_ldouble, FAIL); H5T_CONV_xF(ULONG, LDOUBLE, unsigned long, long double, -, -); @@ -8064,7 +8064,7 @@ H5T_conv_llong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_llong_float, FAIL); H5T_CONV_xF(LLONG, FLOAT, long_long, float, -, -); @@ -8096,7 +8096,7 @@ H5T_conv_llong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_llong_double, FAIL); H5T_CONV_xF(LLONG, DOUBLE, long_long, double, -, -); @@ -8109,7 +8109,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_llong_ldouble * - * Purpose: Convert native long long to native long double using + * Purpose: Convert native long long to native long double using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8129,7 +8129,7 @@ H5T_conv_llong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_llong_ldouble, FAIL); H5T_CONV_xF(LLONG, LDOUBLE, long_long, long double, -, -); @@ -8144,7 +8144,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ullong_float * - * Purpose: Convert native unsigned long long to native float using + * Purpose: Convert native unsigned long long to native float using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8163,7 +8163,7 @@ H5T_conv_ullong_float (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ullong_float, FAIL); H5T_CONV_xF(ULLONG, FLOAT, unsigned long_long, float, -, -); @@ -8176,7 +8176,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ullong_double * - * Purpose: Convert native unsigned long long to native double using + * Purpose: Convert native unsigned long long to native double using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8195,7 +8195,7 @@ H5T_conv_ullong_double (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ullong_double, FAIL); H5T_CONV_xF(ULLONG, DOUBLE, unsigned long_long, double, -, -); @@ -8208,7 +8208,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ullong_ldouble * - * Purpose: Convert native unsigned long long to native long double using + * Purpose: Convert native unsigned long long to native long double using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8228,7 +8228,7 @@ H5T_conv_ullong_ldouble (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ullong_ldouble, FAIL); H5T_CONV_xF(ULLONG, LDOUBLE, unsigned long_long, long double, -, -); @@ -8243,7 +8243,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_float_schar * - * Purpose: Convert native float to native signed char using + * Purpose: Convert native float to native signed char using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8262,7 +8262,7 @@ H5T_conv_float_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_float_schar, FAIL); H5T_CONV_Fx(FLOAT, SCHAR, float, signed char, SCHAR_MIN, SCHAR_MAX); @@ -8275,7 +8275,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_float_uchar * - * Purpose: Convert native float to native unsigned char using + * Purpose: Convert native float to native unsigned char using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8294,7 +8294,7 @@ H5T_conv_float_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_float_uchar, FAIL); H5T_CONV_Fx(FLOAT, UCHAR, float, unsigned char, 0, UCHAR_MAX); @@ -8307,7 +8307,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_double_schar * - * Purpose: Convert native double to native signed char using + * Purpose: Convert native double to native signed char using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8326,7 +8326,7 @@ H5T_conv_double_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_double_schar, FAIL); H5T_CONV_Fx(DOUBLE, SCHAR, double, signed char, SCHAR_MIN, SCHAR_MAX); @@ -8339,7 +8339,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_double_uchar * - * Purpose: Convert native double to native unsigned char using + * Purpose: Convert native double to native unsigned char using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8358,7 +8358,7 @@ H5T_conv_double_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_double_uchar, FAIL); H5T_CONV_Fx(DOUBLE, UCHAR, double, unsigned char, 0, UCHAR_MAX); @@ -8371,7 +8371,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ldouble_schar * - * Purpose: Convert native long double to native signed char using + * Purpose: Convert native long double to native signed char using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8391,7 +8391,7 @@ H5T_conv_ldouble_schar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ldouble_schar, FAIL); H5T_CONV_Fx(LDOUBLE, SCHAR, long double, signed char, SCHAR_MIN, SCHAR_MAX); @@ -8405,7 +8405,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ldouble_uchar * - * Purpose: Convert native long double to native unsigned char using + * Purpose: Convert native long double to native unsigned char using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8425,7 +8425,7 @@ H5T_conv_ldouble_uchar (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ldouble_uchar, FAIL); H5T_CONV_Fx(LDOUBLE, UCHAR, long double, unsigned char, 0, UCHAR_MAX); @@ -8439,7 +8439,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_float_short * - * Purpose: Convert native float to native short using + * Purpose: Convert native float to native short using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8458,7 +8458,7 @@ H5T_conv_float_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_float_short, FAIL); H5T_CONV_Fx(FLOAT, SHORT, float, short, SHRT_MIN, SHRT_MAX); @@ -8471,7 +8471,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_float_ushort * - * Purpose: Convert native float to native unsigned short using + * Purpose: Convert native float to native unsigned short using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8490,7 +8490,7 @@ H5T_conv_float_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_float_ushort, FAIL); H5T_CONV_Fx(FLOAT, USHORT, float, unsigned short, 0, USHRT_MAX); @@ -8503,7 +8503,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_double_short * - * Purpose: Convert native double to native short using + * Purpose: Convert native double to native short using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8522,7 +8522,7 @@ H5T_conv_double_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_double_short, FAIL); H5T_CONV_Fx(DOUBLE, SHORT, double, short, SHRT_MIN, SHRT_MAX); @@ -8535,7 +8535,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_double_ushort * - * Purpose: Convert native double to native unsigned short using + * Purpose: Convert native double to native unsigned short using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8554,7 +8554,7 @@ H5T_conv_double_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_double_ushort, FAIL); H5T_CONV_Fx(DOUBLE, USHORT, double, unsigned short, 0, USHRT_MAX); @@ -8567,7 +8567,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ldouble_short * - * Purpose: Convert native long double to native short using + * Purpose: Convert native long double to native short using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8587,7 +8587,7 @@ H5T_conv_ldouble_short (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ldouble_short, FAIL); H5T_CONV_Fx(LDOUBLE, SHORT, long double, short, SHRT_MIN, SHRT_MAX); @@ -8601,7 +8601,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ldouble_ushort * - * Purpose: Convert native long double to native unsigned short using + * Purpose: Convert native long double to native unsigned short using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8621,7 +8621,7 @@ H5T_conv_ldouble_ushort (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ldouble_ushort, FAIL); H5T_CONV_Fx(LDOUBLE, USHORT, long double, unsigned short, 0, USHRT_MAX); @@ -8635,7 +8635,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_float_int * - * Purpose: Convert native float to native int using + * Purpose: Convert native float to native int using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8654,7 +8654,7 @@ H5T_conv_float_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_float_int, FAIL); H5T_CONV_Fx(FLOAT, INT, float, int, INT_MIN, INT_MAX); @@ -8667,7 +8667,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_float_uint * - * Purpose: Convert native float to native unsigned int using + * Purpose: Convert native float to native unsigned int using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8686,7 +8686,7 @@ H5T_conv_float_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_float_uint, FAIL); H5T_CONV_Fx(FLOAT, UINT, float, unsigned int, 0, UINT_MAX); @@ -8699,7 +8699,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_double_int * - * Purpose: Convert native double to native int using + * Purpose: Convert native double to native int using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8718,7 +8718,7 @@ H5T_conv_double_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_double_int, FAIL); H5T_CONV_Fx(DOUBLE, INT, double, int, INT_MIN, INT_MAX); @@ -8731,7 +8731,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_double_uint * - * Purpose: Convert native double to native unsigned int using + * Purpose: Convert native double to native unsigned int using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8750,7 +8750,7 @@ H5T_conv_double_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_double_uint, FAIL); H5T_CONV_Fx(DOUBLE, UINT, double, unsigned int, 0, UINT_MAX); @@ -8763,7 +8763,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ldouble_int * - * Purpose: Convert native long double to native int using + * Purpose: Convert native long double to native int using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8783,7 +8783,7 @@ H5T_conv_ldouble_int (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ldouble_int, FAIL); H5T_CONV_Fx(LDOUBLE, INT, long double, int, INT_MIN, INT_MAX); @@ -8797,7 +8797,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ldouble_uint * - * Purpose: Convert native long double to native unsigned int using + * Purpose: Convert native long double to native unsigned int using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8817,7 +8817,7 @@ H5T_conv_ldouble_uint (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ldouble_uint, FAIL); H5T_CONV_Fx(LDOUBLE, UINT, long double, unsigned int, 0, UINT_MAX); @@ -8831,7 +8831,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_float_long * - * Purpose: Convert native float to native long using + * Purpose: Convert native float to native long using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8850,7 +8850,7 @@ H5T_conv_float_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_float_long, FAIL); H5T_CONV_Fx(FLOAT, LONG, float, long, LONG_MIN, LONG_MAX); @@ -8863,7 +8863,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_float_ulong * - * Purpose: Convert native float to native unsigned long using + * Purpose: Convert native float to native unsigned long using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8882,7 +8882,7 @@ H5T_conv_float_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_float_ulong, FAIL); H5T_CONV_Fx(FLOAT, ULONG, float, unsigned long, 0, ULONG_MAX); @@ -8895,7 +8895,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_double_long * - * Purpose: Convert native double to native long using + * Purpose: Convert native double to native long using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8914,7 +8914,7 @@ H5T_conv_double_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_double_long, FAIL); H5T_CONV_Fx(DOUBLE, LONG, double, long, LONG_MIN, LONG_MAX); @@ -8927,7 +8927,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_double_ulong * - * Purpose: Convert native double to native unsigned long using + * Purpose: Convert native double to native unsigned long using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8946,7 +8946,7 @@ H5T_conv_double_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_double_ulong, FAIL); H5T_CONV_Fx(DOUBLE, ULONG, double, unsigned long, 0, ULONG_MAX); @@ -8959,7 +8959,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ldouble_long * - * Purpose: Convert native long double to native long using + * Purpose: Convert native long double to native long using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -8979,7 +8979,7 @@ H5T_conv_ldouble_long (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ldouble_long, FAIL); H5T_CONV_Fx(LDOUBLE, LONG, long double, long, LONG_MIN, LONG_MAX); @@ -8993,7 +8993,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ldouble_ulong * - * Purpose: Convert native long double to native unsigned long using + * Purpose: Convert native long double to native unsigned long using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -9013,7 +9013,7 @@ H5T_conv_ldouble_ulong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ldouble_ulong, FAIL); H5T_CONV_Fx(LDOUBLE, ULONG, long double, unsigned long, 0, ULONG_MAX); @@ -9027,7 +9027,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_float_llong * - * Purpose: Convert native float to native long long using + * Purpose: Convert native float to native long long using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -9047,7 +9047,7 @@ H5T_conv_float_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_float_llong, FAIL); H5T_CONV_Fx(FLOAT, LLONG, float, long_long, LLONG_MIN, LLONG_MAX); @@ -9061,7 +9061,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_float_ullong * - * Purpose: Convert native float to native unsigned long long using + * Purpose: Convert native float to native unsigned long long using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -9081,7 +9081,7 @@ H5T_conv_float_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_float_ullong, FAIL); H5T_CONV_Fx(FLOAT, ULLONG, float, unsigned long_long, 0, ULLONG_MAX); @@ -9095,7 +9095,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_double_llong * - * Purpose: Convert native double to native long long using + * Purpose: Convert native double to native long long using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -9115,7 +9115,7 @@ H5T_conv_double_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_double_llong, FAIL); H5T_CONV_Fx(DOUBLE, LLONG, double, long_long, LLONG_MIN, LLONG_MAX); @@ -9129,7 +9129,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_double_ullong * - * Purpose: Convert native double to native unsigned long long using + * Purpose: Convert native double to native unsigned long long using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -9149,7 +9149,7 @@ H5T_conv_double_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_double_ullong, FAIL); H5T_CONV_Fx(DOUBLE, ULLONG, double, unsigned long_long, 0, ULLONG_MAX); @@ -9163,7 +9163,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ldouble_llong * - * Purpose: Convert native long double to native long long using + * Purpose: Convert native long double to native long long using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -9175,7 +9175,7 @@ done: * *------------------------------------------------------------------------- */ -#if !H5_HW_FP_TO_LLONG_NOT_WORKS && H5_SW_LDOUBLE_TO_INTEGER_WORKS +#if !H5_HW_FP_TO_LLONG_NOT_WORKS && H5_SW_LDOUBLE_TO_INTEGER_WORKS herr_t H5T_conv_ldouble_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t buf_stride, @@ -9183,7 +9183,7 @@ H5T_conv_ldouble_llong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t UNUSED dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ldouble_llong, FAIL); H5T_CONV_Fx(LDOUBLE, LLONG, long double, long_long, LLONG_MIN, LLONG_MAX); @@ -9197,7 +9197,7 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_ldouble_ullong * - * Purpose: Convert native long double to native unsigned long long using + * Purpose: Convert native long double to native unsigned long long using * hardware. This is a fast special case. * * Return: Non-negative on success/Negative on failure @@ -9217,7 +9217,7 @@ H5T_conv_ldouble_ullong (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, hid_t dxpl_id) { herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_ldouble_ullong, FAIL); H5T_CONV_Fx(LDOUBLE, ULLONG, long double, unsigned long_long, 0, ULLONG_MAX); @@ -9231,8 +9231,8 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_f_i * - * Purpose: Convert one floating-point type to an integer. This is - * the catch-all function for float-integer conversions and + * Purpose: Convert one floating-point type to an integer. This is + * the catch-all function for float-integer conversions and * is probably not particularly fast. * * Return: Non-negative on success/Negative on failure @@ -9246,7 +9246,7 @@ done: * Wednesday, April 21, 2004 * There is a new design for exception handling like overflow, * which is passed in as a transfer property. - * + * *------------------------------------------------------------------------- */ herr_t @@ -9270,7 +9270,7 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* Conversion-related variables */ hssize_t expo; /*source exponent */ hssize_t sign; /*source sign bit value */ - uint8_t *int_buf=NULL; /*buffer for temporary value */ + uint8_t *int_buf=NULL; /*buffer for temporary value */ size_t buf_size; /*buffer size for temporary value */ size_t i; /*miscellaneous counters */ size_t first; /*first bit(MSB) in an integer */ @@ -9281,7 +9281,7 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, hbool_t reverse; /*if reverse order of destination at the end */ H5T_conv_ret_t except_ret; /*return of callback function */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_f_i, FAIL); switch (cdata->command) { @@ -9335,9 +9335,9 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, direction = -1; } - /* Allocate enough space for the buffer holding temporary + /* Allocate enough space for the buffer holding temporary * converted value - */ + */ buf_size = (size_t)HDpow((double)2.0, (double)src.u.f.esize) / 8 + 1; int_buf = (uint8_t*)H5MM_calloc(buf_size); @@ -9393,10 +9393,10 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, s[i] = tmp; } } - - /*zero-set all destination bits*/ + + /*zero-set all destination bits*/ H5T_bit_set (d, dst.offset, dst.prec, FALSE); - + /* * Find the sign bit value of the source. */ @@ -9424,7 +9424,7 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } if(except_ret == H5T_CONV_UNHANDLED) { - if (H5T_SGN_2==dst.u.i.sign) + if (H5T_SGN_2==dst.u.i.sign) H5T_bit_set (d, dst.prec-1, 1, TRUE); } else if(except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ @@ -9441,9 +9441,9 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } if(except_ret == H5T_CONV_UNHANDLED) { - if (H5T_SGN_NONE==dst.u.i.sign) + if (H5T_SGN_NONE==dst.u.i.sign) H5T_bit_set (d, dst.offset, dst.prec, TRUE); - else if (H5T_SGN_2==dst.u.i.sign) + else if (H5T_SGN_2==dst.u.i.sign) H5T_bit_set (d, dst.offset, dst.prec-1, TRUE); } else if(except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ @@ -9451,26 +9451,26 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, goto next; } else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") - } + } goto padding; } } else if (H5T_NORM_NONE==src.u.f.norm && H5T_bit_find (s, src.u.f.mpos, src.u.f.msize-1, 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.*/ /* +Infinity or -Infinity */ if(sign) { /* -Infinity */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_NINF, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_NINF, src_id, dst_id, src_rev, d, cb_struct.user_data); } if(except_ret == H5T_CONV_UNHANDLED) { - if (H5T_SGN_2==dst.u.i.sign) + if (H5T_SGN_2==dst.u.i.sign) H5T_bit_set (d, dst.prec-1, 1, TRUE); } else if(except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ @@ -9487,17 +9487,17 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } if(except_ret == H5T_CONV_UNHANDLED) { - if (H5T_SGN_NONE==dst.u.i.sign) + if (H5T_SGN_NONE==dst.u.i.sign) H5T_bit_set (d, dst.offset, dst.prec, TRUE); - else if (H5T_SGN_2==dst.u.i.sign) + else if (H5T_SGN_2==dst.u.i.sign) H5T_bit_set (d, dst.offset, dst.prec-1, TRUE); } else if(except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ - reverse = FALSE; + reverse = FALSE; goto next; } else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") - } + } goto padding; } else if (H5T_bit_find (s, src.u.f.epos, src.u.f.esize, H5T_BIT_LSB, FALSE)<0) { @@ -9521,14 +9521,14 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, goto padding; } - + /* * Get the exponent as an unsigned quantity from the section of - * the source bit field where it's located. Not expecting + * the source bit field where it's located. Not expecting * exponent to be greater than the maximal value of hssize_t. */ expo = H5T_bit_get_d(s, src.u.f.epos, src.u.f.esize); - + /* * Calculate the true source exponent by adjusting according to * the source exponent bias. @@ -9545,15 +9545,15 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* * Get the mantissa as bit vector from the section of * the source bit field where it's located. - * Keep the little-endian order in the buffer. + * Keep the little-endian order in the buffer. * A sequence 0x01020304 will be like in the buffer, * 04 03 02 01 * | | | | * V V V V - * buf[0] buf[1] buf[2] buf[3] + * buf[0] buf[1] buf[2] buf[3] */ H5T_bit_copy(int_buf, 0, s, src.u.f.mpos, src.u.f.msize); - + /* * Restore the implicit bit for mantissa if it's implied. * Equivalent to mantissa |= (hsize_t)1<shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, src_id, dst_id, src_rev, d, cb_struct.user_data); if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") @@ -9618,11 +9618,11 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } - if(except_ret == H5T_CONV_UNHANDLED) + if(except_ret == H5T_CONV_UNHANDLED) H5T_bit_set (d, dst.offset, dst.prec, TRUE); else if(except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ @@ -9634,12 +9634,12 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(truncated && cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_TRUNCATE, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_TRUNCATE, src_id, dst_id, src_rev, d, cb_struct.user_data); } - - if(except_ret == H5T_CONV_UNHANDLED) - /*copy source value into it if case is ignored by user handler*/ + + if(except_ret == H5T_CONV_UNHANDLED) + /*copy source value into it if case is ignored by user handler*/ H5T_bit_copy (d, dst.offset, int_buf, 0, first+1); else if(except_ret == H5T_CONV_HANDLED) { /*No need to reverse the order of destination because user handles it*/ @@ -9648,23 +9648,23 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") } - } + } } else if (H5T_SGN_2==dst.u.i.sign) { /*Destination is signed*/ if(sign) { /*source is negative*/ if(first < dst.prec-1) { if(truncated && cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_TRUNCATE, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_TRUNCATE, src_id, dst_id, src_rev, d, cb_struct.user_data); } - - if(except_ret == H5T_CONV_UNHANDLED) { /*If this case ignored by user handler*/ + + if(except_ret == H5T_CONV_UNHANDLED) { /*If this case ignored by user handler*/ /*Convert to integer representation. Equivalent to ~(value - 1).*/ H5T_bit_dec(int_buf, 0, 8*buf_size); H5T_bit_neg(int_buf, 0, 8*buf_size); - /*copy source value into destination*/ + /*copy source value into destination*/ H5T_bit_copy (d, dst.offset, int_buf, 0, dst.prec-1); H5T_bit_set (d, (dst.offset + dst.prec-1), 1, TRUE); } else if(except_ret == H5T_CONV_ABORT) @@ -9675,13 +9675,13 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, goto next; } } else { - /* if underflows and no callback, do nothing except turn on + /* if underflows and no callback, do nothing except turn on * the sign bit because 0x80...00 is the biggest negative value. */ if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_LOW, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -9698,10 +9698,10 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, } else { /*source is positive*/ if (first >= dst.prec-1) { /*overflow*/ - if(cb_struct.func) { /*If user's exception handler is present, use it*/ + if(cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); } @@ -9718,12 +9718,12 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(truncated && cb_struct.func) { /*If user's exception handler is present, use it*/ /*reverse order first*/ H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_TRUNCATE, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_TRUNCATE, src_id, dst_id, src_rev, d, cb_struct.user_data); } - - if(except_ret == H5T_CONV_UNHANDLED) { - /*copy source value into it if case is ignored by user handler*/ + + if(except_ret == H5T_CONV_UNHANDLED) { + /*copy source value into it if case is ignored by user handler*/ H5T_bit_copy (d, dst.offset, int_buf, 0, first+1); } else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") @@ -9763,7 +9763,7 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, d[i] = tmp; } } - + next: /* * If we had used a temporary buffer for the destination then we @@ -9781,9 +9781,9 @@ H5T_conv_f_i (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HDmemset(int_buf, 0, buf_size); } - + break; - + default: HGOTO_ERROR (H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unknown conversion command"); } @@ -9800,8 +9800,8 @@ done: /*------------------------------------------------------------------------- * Function: H5T_conv_i_f * - * Purpose: Convert one integer type to a floating-point type. This is - * the catch-all function for integer-float conversions and + * Purpose: Convert one integer type to a floating-point type. This is + * the catch-all function for integer-float conversions and * is probably not particularly fast. * * Return: Non-negative on success/Negative on failure @@ -9810,12 +9810,12 @@ done: * Friday, Feb 6, 2004 * * Modifications: - * + * * Raymond Lu * Wednesday, April 21, 2004 * There is a new design for exception handling like overflow, * which is passed in as a transfer property. - * + * *------------------------------------------------------------------------- */ herr_t @@ -9842,7 +9842,7 @@ H5T_conv_i_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, size_t sign; /*source sign bit value */ hbool_t is_max_neg; /*source is maximal negative value*/ hbool_t do_round; /*whether there is roundup */ - uint8_t *int_buf=NULL; /*buffer for temporary value */ + uint8_t *int_buf=NULL; /*buffer for temporary value */ size_t buf_size; /*buffer size for temporary value */ size_t i; /*miscellaneous counters */ size_t first; /*first bit(MSB) in an integer */ @@ -9852,7 +9852,7 @@ H5T_conv_i_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_conv_ret_t except_ret; /*return of callback function */ hbool_t reverse; /*if reverse the order of destination */ herr_t ret_value=SUCCEED; /* Return value */ - + FUNC_ENTER_NOAPI(H5T_conv_i_f, FAIL); switch (cdata->command) { @@ -9906,9 +9906,9 @@ H5T_conv_i_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, direction = -1; } - /* Allocate enough space for the buffer holding temporary + /* Allocate enough space for the buffer holding temporary * converted value - */ + */ buf_size = (src.prec > dst.u.f.msize ? src.prec : dst.u.f.msize)/8 + 1; int_buf = (uint8_t*)H5MM_calloc(buf_size); @@ -9970,10 +9970,10 @@ H5T_conv_i_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, s[i] = tmp; } } - - /*zero-set all destination bits*/ + + /*zero-set all destination bits*/ H5T_bit_set (d, dst.offset, dst.prec, FALSE); - + /* Copy source into a temporary buffer */ H5T_bit_copy(int_buf, 0, s, src.offset, src.prec); @@ -9984,21 +9984,21 @@ H5T_conv_i_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, sign = (size_t)H5T_bit_get_d(int_buf, src.prec-1, 1); /* - * What is the bit position(starting from 0 as first one) for the most significant + * What is the bit position(starting from 0 as first one) for the most significant * bit(MSB) of S which is set? */ if(H5T_SGN_2 == src.u.i.sign) { sfirst = H5T_bit_find(int_buf, 0, src.prec-1, H5T_BIT_MSB, TRUE); if(sign && sfirst < 0) /* The case 0x80...00, which is negative with maximal value */ - is_max_neg = 1; + is_max_neg = 1; } else if(H5T_SGN_NONE == src.u.i.sign) sfirst = H5T_bit_find(int_buf, 0, src.prec, H5T_BIT_MSB, TRUE); /* Handle special cases here. Integer is zero */ if(!sign && sfirst < 0) goto padding; - + /* * Convert source integer if it's negative */ @@ -10017,7 +10017,7 @@ H5T_conv_i_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, is_max_neg = 0; } - /* Sign bit has been negated if bit vector isn't 0x80...00. Set all bits in front of + /* Sign bit has been negated if bit vector isn't 0x80...00. Set all bits in front of * sign bit to 0 in the temporary buffer because they're all negated from the previous * step. */ H5T_bit_set(int_buf, src.prec, buf_size*8-src.prec, 0); @@ -10048,29 +10048,29 @@ H5T_conv_i_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, first++; } - /* Roundup for mantissa */ + /* Roundup for mantissa */ if(first > dst.u.f.msize) { - /* If the bit sequence is bigger than the mantissa part, there'll be some - * precision loss. Let user's handler deal with the case if it's present + /* If the bit sequence is bigger than the mantissa part, there'll be some + * precision loss. Let user's handler deal with the case if it's present */ - if(cb_struct.func) { + if(cb_struct.func) { H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); /*reverse order first*/ - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_PRECISION, src_id, dst_id, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_PRECISION, src_id, dst_id, src_rev, d, cb_struct.user_data); } - + if(except_ret == H5T_CONV_HANDLED) { reverse = FALSE; goto padding; } else if(except_ret == H5T_CONV_ABORT) HGOTO_ERROR(H5E_DATATYPE, H5E_CANTCONVERT, FAIL, "can't handle conversion exception") - /* If user's exception handler does deal with it, we do it by dropping off the - * extra bits at the end and do rounding. If we have .50...0(decimal) after radix - * point, we do roundup when the least significant digit before radix is odd, we do + /* If user's exception handler does deal with it, we do it by dropping off the + * extra bits at the end and do rounding. If we have .50...0(decimal) after radix + * point, we do roundup when the least significant digit before radix is odd, we do * rounddown if it's even. */ - + /* Check 1st dropoff bit, see if it's set. */ if(H5T_bit_get_d(int_buf, ((first-dst.u.f.msize)-1), 1)) { /* Check all bits after 1st dropoff bit, see if any of them is set. */ @@ -10081,7 +10081,7 @@ H5T_conv_i_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, if(H5T_bit_get_d(int_buf, (first-dst.u.f.msize), 1)) do_round = 1; } - } + } /* Right shift to drop off extra bits */ H5T_bit_shift(int_buf, (ssize_t)(dst.u.f.msize-first), 0, buf_size*8); @@ -10090,22 +10090,22 @@ H5T_conv_i_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, H5T_bit_inc(int_buf, 0, buf_size*8); do_round = 0; - /* If integer is like 0x0ff...fff and we need to round up the + /* If integer is like 0x0ff...fff and we need to round up the * last f, we get 0x100...000. Treat this special case here. - */ + */ if(H5T_bit_get_d(int_buf, dst.u.f.msize, 1)) { if (H5T_NORM_IMPLIED==dst.u.f.norm) { - /* The bit at this 1's position was impled already, so this - * number should be 0x200...000. We need to increment the - * exponent in this case. - */ + /* The bit at this 1's position was impled already, so this + * number should be 0x200...000. We need to increment the + * exponent in this case. + */ expo++; } else if (H5T_NORM_NONE==dst.u.f.norm) { /* Right shift 1 bit to let the carried 1 fit in the mantissa, * and increment exponent by 1. */ H5T_bit_shift(int_buf, -1, 0, buf_size*8); - expo++; + expo++; } } } @@ -10113,16 +10113,16 @@ H5T_conv_i_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, /* The bit sequence can fit mantissa part. Left shift to fit in from high-order of * bit position. */ H5T_bit_shift(int_buf, (ssize_t)(dst.u.f.msize-first), 0, dst.u.f.msize); - } - + } + /* Check if the exponent is too big */ - expo_max = (hsize_t)HDpow((double)2.0, (double)dst.u.f.esize) - 1; + expo_max = (hsize_t)HDpow((double)2.0, (double)dst.u.f.esize) - 1; if(expo > expo_max) { /*overflows*/ if(cb_struct.func) { /*user's exception handler. Reverse back source order*/ H5T_reverse_order(src_rev, s, src_p->shared->size, src_p->shared->u.atomic.order); /*reverse order first*/ - except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, + except_ret = (cb_struct.func)(H5T_CONV_EXCEPT_RANGE_HI, src_id, dst_id, src_rev, d, cb_struct.user_data); if(except_ret == H5T_CONV_ABORT) @@ -10131,9 +10131,9 @@ H5T_conv_i_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, reverse = FALSE; goto padding; } - } else { + } else { /*make destination infinity by setting exponent to maximal number and - *mantissa to zero.*/ + *mantissa to zero.*/ expo = expo_max; HDmemset(int_buf, 0, buf_size); } @@ -10174,7 +10174,7 @@ H5T_conv_i_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, d[i] = tmp; } } - + /* * If we had used a temporary buffer for the destination then we * should copy the value to the true destination buffer. @@ -10191,9 +10191,9 @@ H5T_conv_i_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts, HDmemset(int_buf, 0, buf_size); } - + break; - + default: HGOTO_ERROR (H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unknown conversion command"); } @@ -10210,19 +10210,19 @@ done: /*------------------------------------------------------------------------- * Function: H5T_reverse_order * - * Purpose: Internal assisting function to reverse the order of - * a sequence of byte when it's big endian. The byte sequence + * Purpose: Internal assisting function to reverse the order of + * a sequence of byte when it's big endian. The byte sequence * simulates the endian order. * * Return: Success: A pointer to the reversed byte sequence * - * Failure: Null + * Failure: Null * * Programmer: Raymond Lu * April 26, 2004 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -10241,6 +10241,6 @@ H5T_reverse_order(uint8_t *rev, uint8_t *s, size_t size, H5T_order_t order) else for (i=0; ishared->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 84a71b0..2e0af76 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 */ @@ -561,7 +561,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 986d440..56694c2 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 */ @@ -705,21 +705,21 @@ 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); } -#if H5_SIZEOF_LONG_DOUBLE !=0 +#if H5_SIZEOF_LONG_DOUBLE !=0 else if(size<=sizeof(long double)) { match=H5T_NATIVE_FLOAT_MATCH_LDOUBLE; - native_size = sizeof(long double); - } + native_size = sizeof(long double); + } #endif else { /* If not match, return the biggest datatype */ #if H5_SIZEOF_LONG_DOUBLE !=0 @@ -729,53 +729,53 @@ H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_alig match=H5T_NATIVE_FLOAT_MATCH_DOUBLE; native_size = sizeof(double); #endif - } + } } else { -#if H5_SIZEOF_LONG_DOUBLE !=0 +#if H5_SIZEOF_LONG_DOUBLE !=0 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); - } + } #else if(size>=sizeof(double)) { match=H5T_NATIVE_FLOAT_MATCH_DOUBLE; - native_size = sizeof(double); + native_size = sizeof(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); - } + } #endif } @@ -791,7 +791,7 @@ H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_alig align = H5T_NATIVE_DOUBLE_COMP_ALIGN_g; break; -#if H5_SIZEOF_LONG_DOUBLE !=0 +#if H5_SIZEOF_LONG_DOUBLE !=0 case H5T_NATIVE_FLOAT_MATCH_LDOUBLE: tid = H5T_NATIVE_LDOUBLE; align = H5T_NATIVE_LDOUBLE_COMP_ALIGN_g; @@ -801,18 +801,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) } @@ -821,23 +821,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; @@ -852,7 +852,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 7763dd9..6854bc2 100644 --- a/src/H5Tpkg.h +++ b/src/H5Tpkg.h @@ -163,8 +163,8 @@ typedef struct H5T_vlen_t { H5T_vlen_type_t type; /* Type of VL data in buffer */ H5T_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 3e492c3..0a132c0 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; @@ -246,7 +246,7 @@ H5T_set_precision(const H5T_t *dt, size_t prec) dt->shared->u.atomic.u.f.epos + dt->shared->u.atomic.u.f.esize > prec+offset || dt->shared->u.atomic.u.f.mpos + dt->shared->u.atomic.u.f.msize > prec+offset) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "adjust sign, mantissa, and exponent fields first") - break; + break; default: HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "operation not defined for datatype class") } /* end switch */ /*lint !e788 All appropriate cases are covered */ @@ -259,7 +259,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 fdc25c0..6eeb21b 100644 --- a/src/H5Tpublic.h +++ b/src/H5Tpublic.h @@ -553,7 +553,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 4c93842..39f85c1 100644 --- a/src/H5Tvlen.c +++ b/src/H5Tvlen.c @@ -74,7 +74,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 @@ -114,7 +114,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); @@ -157,7 +157,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 */ @@ -200,7 +200,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 @@ -272,7 +272,7 @@ H5T_vlen_set_loc(const H5T_t *dt, H5F_t *f, H5T_loc_t loc) /* Mark this type as being stored on disk */ dt->shared->u.vlen.loc=H5T_LOC_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 @@ -832,7 +832,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); @@ -883,7 +883,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 */ @@ -905,7 +905,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) @@ -947,7 +947,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 */ @@ -969,7 +969,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); @@ -988,7 +988,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 @@ -1000,7 +1000,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 */ @@ -1100,7 +1100,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 @@ -1113,7 +1113,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 */ @@ -1146,8 +1146,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 @@ -1161,7 +1161,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 */ 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 a243552..f11756b 100644 --- a/src/H5Z.c +++ b/src/H5Z.c @@ -96,7 +96,7 @@ H5Z_init_interface (void) #endif /* H5_HAVE_FILTER_FLETCHER32 */ #ifdef H5_HAVE_FILTER_SZIP H5Z_SZIP->encoder_present = SZ_encoder_enabled(); - if (H5Z_SZIP->encoder_present < 0) + if (H5Z_SZIP->encoder_present < 0) HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "szip filter reports bad status") if (H5Z_register (H5Z_SZIP)<0) HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register szip filter") @@ -178,7 +178,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, @@ -271,7 +271,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); @@ -378,7 +378,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); @@ -387,7 +387,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") @@ -438,7 +438,7 @@ H5Zfilter_avail(H5Z_filter_t id) ret_value=TRUE; break; } /* end if */ - + done: FUNC_LEAVE_API(ret_value) } /* end H5Zfilter_avail() */ @@ -468,7 +468,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)); @@ -521,7 +521,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; @@ -911,7 +911,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; @@ -924,9 +924,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); @@ -937,7 +937,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 @@ -1043,7 +1043,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); @@ -1104,7 +1104,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() */ @@ -1114,8 +1114,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 * @@ -1180,7 +1180,7 @@ H5Z_delete(H5O_pline_t *pline, H5Z_filter_t filter) done: FUNC_LEAVE_NOAPI(ret_value) -} +} /*------------------------------------------------------------------------- * Function: H5Zget_filter_info diff --git a/src/H5Zdeflate.c b/src/H5Zdeflate.c index 53a330d..8e7428b 100644 --- a/src/H5Zdeflate.c +++ b/src/H5Zdeflate.c @@ -57,7 +57,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 @@ -74,7 +74,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 */ @@ -131,7 +131,7 @@ H5Z_filter_deflate (unsigned flags, size_t cd_nelmts, } } /* end else */ } while(status==Z_OK); - + /* Free the input buffer */ H5MM_xfree(*buf); @@ -155,7 +155,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 04741b4..b0c120a 100644 --- a/src/H5Zfletcher32.c +++ b/src/H5Zfletcher32.c @@ -52,7 +52,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 * @@ -120,7 +120,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 @@ -128,19 +128,19 @@ 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 */ @@ -150,11 +150,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. */ @@ -171,20 +171,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; @@ -195,7 +195,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; @@ -204,10 +204,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); @@ -222,7 +222,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/H5Znbit.c b/src/H5Znbit.c index 938528c..96c71d9 100644 --- a/src/H5Znbit.c +++ b/src/H5Znbit.c @@ -24,7 +24,7 @@ #ifdef H5_HAVE_FILTER_NBIT -/* Struct of parameters needed for compressing/decompressing +/* Struct of parameters needed for compressing/decompressing * one nbit atomic datatype: integer or floating-point */ typedef struct { @@ -32,12 +32,12 @@ typedef struct { int order; /* datatype endianness order */ int precision; /* datatype precision */ int offset; /* datatype offset */ -} parms_atomic; +} parms_atomic; /* Local function prototypes */ static herr_t H5Z_can_apply_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id); static herr_t H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id); -static size_t H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], +static size_t H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf); static void H5Z_calc_parms_nooptype(void); @@ -51,31 +51,31 @@ static herr_t H5Z_set_parms_array(hid_t type_id, unsigned cd_values[]); static herr_t H5Z_set_parms_compound(hid_t type_id, unsigned cd_values[]); static void H5Z_nbit_next_byte(size_t *j, int *buf_len); -static void H5Z_nbit_decompress_one_byte(unsigned char *data, size_t data_offset, int k, int begin_i, +static void H5Z_nbit_decompress_one_byte(unsigned char *data, size_t data_offset, int k, int begin_i, int end_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int datatype_len); -static void H5Z_nbit_compress_one_byte(unsigned char *data, size_t data_offset, int k, int begin_i, +static void H5Z_nbit_compress_one_byte(unsigned char *data, size_t data_offset, int k, int begin_i, int end_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int datatype_len); -static void H5Z_nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, +static void H5Z_nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, int *buf_len, unsigned size); -static void H5Z_nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, +static void H5Z_nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p); -static void H5Z_nbit_decompress_one_array(unsigned char *data, size_t data_offset, - unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]); -static void H5Z_nbit_decompress_one_compound(unsigned char *data, size_t data_offset, - unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]); -static void H5Z_nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, +static void H5Z_nbit_decompress_one_array(unsigned char *data, size_t data_offset, + unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]); +static void H5Z_nbit_decompress_one_compound(unsigned char *data, size_t data_offset, + unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]); +static void H5Z_nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, const unsigned parms[]); -static void H5Z_nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, +static void H5Z_nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, int *buf_len, unsigned size); -static void H5Z_nbit_compress_one_atomic(unsigned char *data, size_t data_offset, +static void H5Z_nbit_compress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p); -static void H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, - unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]); -static void H5Z_nbit_compress_one_compound(unsigned char *data, size_t data_offset, - unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]); -static void H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, +static void H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, + unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]); +static void H5Z_nbit_compress_one_compound(unsigned char *data, size_t data_offset, + unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]); +static void H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, size_t *buffer_size, const unsigned parms[]); - + /* This message derives from H5Z */ H5Z_class_t H5Z_NBIT[1] = {{ H5Z_CLASS_T_VERS, /* H5Z_class_t version */ @@ -123,7 +123,7 @@ static unsigned parms_index = 0; * Programmer: Xiaowen Wu * Tuesday, December 21, 2004 * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ @@ -165,18 +165,18 @@ static void H5Z_calc_parms_nooptype(void) { /* Store datatype class code */ ++cd_values_actual_nparms; - + /* Store datatype size */ ++cd_values_actual_nparms; -} +} /*------------------------------------------------------------------------- * Function: H5Z_calc_parms_atomic * * Purpose: Calculate the number of parameters of array cd_values[] - * of atomic datatype whose datatype class is integer - * or floating point + * of atomic datatype whose datatype class is integer + * or floating point * * Programmer: Xiaowen Wu * Saturday, January 29, 2005 @@ -189,7 +189,7 @@ static void H5Z_calc_parms_atomic(void) { /* Store datatype class code */ ++cd_values_actual_nparms; - + /* Store datatype size */ ++cd_values_actual_nparms; @@ -201,7 +201,7 @@ static void H5Z_calc_parms_atomic(void) /* Store datatype's offset */ ++cd_values_actual_nparms; -} +} /*------------------------------------------------------------------------- @@ -231,7 +231,7 @@ static herr_t H5Z_calc_parms_array(hid_t type_id) /* Store datatype class code */ ++cd_values_actual_nparms; - + /* Store array datatype's size */ ++cd_values_actual_nparms; @@ -246,10 +246,10 @@ static herr_t H5Z_calc_parms_array(hid_t type_id) /* Calculate number of the rest parameters according to base datatype's class */ switch(dtype_base_class) { case H5T_INTEGER: - case H5T_FLOAT: + case H5T_FLOAT: H5Z_calc_parms_atomic(); break; - case H5T_ARRAY: + case H5T_ARRAY: if(H5Z_calc_parms_array(dtype_base)==FAIL) HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot compute parameters for datatype") break; @@ -286,7 +286,7 @@ done: */ static herr_t H5Z_calc_parms_compound(hid_t type_id) { - int i; /* local index variable */ + int i; /* local index variable */ int nmembers; /* Compound datatype's number of members */ hid_t dtype_member; /* Compound datatype's member datatype */ H5T_class_t dtype_member_class; /* Compound datatype's member datatype's class */ @@ -296,7 +296,7 @@ static herr_t H5Z_calc_parms_compound(hid_t type_id) /* Store compound datatype class code */ ++cd_values_actual_nparms; - + /* Store compound datatype's size */ ++cd_values_actual_nparms; @@ -323,10 +323,10 @@ static herr_t H5Z_calc_parms_compound(hid_t type_id) /* Calculate parameters according to member's datatype class */ switch(dtype_member_class) { case H5T_INTEGER: - case H5T_FLOAT: + case H5T_FLOAT: H5Z_calc_parms_atomic(); break; - case H5T_ARRAY: + case H5T_ARRAY: if(H5Z_calc_parms_array(dtype_member)==FAIL) HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot compute parameters for datatype") break; @@ -347,10 +347,10 @@ done: /*------------------------------------------------------------------------- * Function: H5Z_set_parms_nooptype * - * Purpose: Set the array cd_values[] for a given datatype identifier + * Purpose: Set the array cd_values[] for a given datatype identifier * type_id if its datatype class is not integer, nor * floating-point, nor array, nor compound, nor VL datatype, - * and nor VL string + * and nor VL string * * Return: Success: Non-negative * Failure: Negative @@ -371,7 +371,7 @@ static herr_t H5Z_set_parms_nooptype(hid_t type_id, unsigned cd_values[]) /* Set datatype class code */ cd_values[cd_values_index++] = H5Z_NBIT_NOOPTYPE; - + /* Get datatype's size */ if((dtype_size=H5Tget_size(type_id))==0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size") @@ -387,8 +387,8 @@ done: /*------------------------------------------------------------------------- * Function: H5Z_set_parms_atomic * - * Purpose: Set the array cd_values[] for a given datatype identifier - * type_id if its datatype class is integer or floating point + * Purpose: Set the array cd_values[] for a given datatype identifier + * type_id if its datatype class is integer or floating point * * Return: Success: Non-negative * Failure: Negative @@ -412,7 +412,7 @@ static herr_t H5Z_set_parms_atomic(hid_t type_id, unsigned cd_values[]) /* Set datatype class code */ cd_values[cd_values_index++] = H5Z_NBIT_ATOMIC; - + /* Get datatype's size */ if((dtype_size=H5Tget_size(type_id))==0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size") @@ -455,13 +455,13 @@ static herr_t H5Z_set_parms_atomic(hid_t type_id, unsigned cd_values[]) /* Set "local" parameter for datatype offset */ cd_values[cd_values_index++] = dtype_offset; - /* If before this point, there is no need to compress, check the need to - * compress at this point. If current datatype is not full-precision, - * flag need_not_compress should be set to FALSE. + /* If before this point, there is no need to compress, check the need to + * compress at this point. If current datatype is not full-precision, + * flag need_not_compress should be set to FALSE. */ if(need_not_compress) /* so far no need to compress */ if(dtype_offset != 0 || dtype_precision != dtype_size * 8) - need_not_compress = FALSE; + need_not_compress = FALSE; done: FUNC_LEAVE_NOAPI(ret_value) } /* end H5Z_set_parms_atomic() */ @@ -470,7 +470,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Z_set_parms_array * - * Purpose: Set the array cd_values[] for a given datatype identifier + * Purpose: Set the array cd_values[] for a given datatype identifier * type_id if its datatype class is array datatype * * Return: Success: Non-negative @@ -495,7 +495,7 @@ static herr_t H5Z_set_parms_array(hid_t type_id, unsigned cd_values[]) /* Set datatype class code */ cd_values[cd_values_index++] = H5Z_NBIT_ARRAY; - + /* Get array datatype's size */ if((dtype_size=H5Tget_size(type_id))==0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size") @@ -514,15 +514,15 @@ static herr_t H5Z_set_parms_array(hid_t type_id, unsigned cd_values[]) /* Call appropriate function according to base datatype's class */ switch(dtype_base_class) { case H5T_INTEGER: - case H5T_FLOAT: + case H5T_FLOAT: if(H5Z_set_parms_atomic(dtype_base, cd_values)==FAIL) HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot set parameters for datatype") break; - case H5T_ARRAY: + case H5T_ARRAY: if(H5Z_set_parms_array(dtype_base, cd_values)==FAIL) HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot set parameters for datatype") break; - case H5T_COMPOUND: + case H5T_COMPOUND: if(H5Z_set_parms_compound(dtype_base, cd_values)==FAIL) HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot set parameters for datatype") break; @@ -548,7 +548,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Z_set_parms_compound * - * Purpose: Set the array cd_values[] for a given datatype identifier + * Purpose: Set the array cd_values[] for a given datatype identifier * type_id if its datatype class is compound datatype * * Return: Success: Non-negative @@ -577,7 +577,7 @@ static herr_t H5Z_set_parms_compound(hid_t type_id, unsigned cd_values[]) /* Set "local" parameter for compound datatype class code */ cd_values[cd_values_index++] = H5Z_NBIT_COMPOUND; - + /* Get datatype's size */ if((dtype_size=H5Tget_size(type_id))==0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size") @@ -611,28 +611,28 @@ static herr_t H5Z_set_parms_compound(hid_t type_id, unsigned cd_values[]) /* Call appropriate function according to member's datatype class */ switch(dtype_member_class) { case H5T_INTEGER: - case H5T_FLOAT: + case H5T_FLOAT: if(H5Z_set_parms_atomic(dtype_member, cd_values)==FAIL) HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot set parameters for datatype") break; - case H5T_ARRAY: + case H5T_ARRAY: if(H5Z_set_parms_array(dtype_member, cd_values)==FAIL) - HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot set parameters for datatype") + HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot set parameters for datatype") break; case H5T_COMPOUND: if(H5Z_set_parms_compound(dtype_member, cd_values)==FAIL) HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot set parameters for datatype") break; - default: /* other datatype that nbit does no compression */ + default: /* other datatype that nbit does no compression */ /* Check if datatype is a variable-length string */ if((is_vlstring=H5Tis_variable_str(dtype_member))<0) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "cannot determine if datatype is a variable-length string") - /* Because for some no-op datatype (VL datatype and VL string datatype), its - * size can not be retrieved correctly by using function call H5Tget_size, - * special handling is needed for getting the size. Here the difference between - * adjacent member offset is used (if alignment is present, the result can be + /* Because for some no-op datatype (VL datatype and VL string datatype), its + * size can not be retrieved correctly by using function call H5Tget_size, + * special handling is needed for getting the size. Here the difference between + * adjacent member offset is used (if alignment is present, the result can be * larger, but it does not affect the nbit filter's correctness). */ if(dtype_member_class == H5T_VLEN || is_vlstring) { @@ -646,7 +646,7 @@ static herr_t H5Z_set_parms_compound(hid_t type_id, unsigned cd_values[]) /* Set "local" parameter for datatype size */ cd_values[cd_values_index++] = dtype_next_member_offset - dtype_member_offset; - } else + } else if(H5Z_set_parms_nooptype(dtype_member, cd_values)==FAIL) HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot set parameters for datatype") break; @@ -666,10 +666,10 @@ done: * Failure: Negative * * Programmer: Xiaowen Wu - * Tuesday, January 11, 2005 + * Tuesday, January 11, 2005 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -688,30 +688,30 @@ H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id) if((dtype_class = H5Tget_class(type_id)) == H5T_NO_CLASS ) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype class") - /* Calculate how many parameters will fill the cd_values array + /* Calculate how many parameters will fill the cd_values array * First three parameters reserved for: - * 1. number of parameters in array cd_values - * 2. flag if TRUE indicating no need to do nbit compression + * 1. number of parameters in array cd_values + * 2. flag if TRUE indicating no need to do nbit compression * 3. number of elements in the chunk - */ - cd_values_actual_nparms = 3; + */ + cd_values_actual_nparms = 3; switch(dtype_class) { case H5T_INTEGER: - case H5T_FLOAT: + case H5T_FLOAT: H5Z_calc_parms_atomic(); break; - case H5T_ARRAY: + case H5T_ARRAY: if(H5Z_calc_parms_array(type_id)==FAIL) - HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot compute parameters for datatype") + HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot compute parameters for datatype") break; - case H5T_COMPOUND: + case H5T_COMPOUND: if(H5Z_calc_parms_compound(type_id)==FAIL) HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot compute parameters for datatype") break; default: /* no need to calculate other datatypes at top level */ break; } /* end switch */ - + /* Check if the number of parameters exceed what cd_values[] can store */ if(cd_values_actual_nparms > H5Z_NBIT_MAX_NPARMS) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "datatype needs too many nbit parameters") @@ -737,24 +737,24 @@ H5Z_set_local_nbit(hid_t dcpl_id, hid_t type_id, hid_t space_id) /* Set "local" parameter for number of elements in the chunk */ H5_ASSIGN_OVERFLOW(cd_values[cd_values_index++],npoints,hssize_t,unsigned); - + /* Assume no need to compress now, will be changed to FALSE later if not */ need_not_compress = TRUE; /* Call appropriate function according to the datatype class */ switch(dtype_class) { case H5T_INTEGER: - case H5T_FLOAT: + case H5T_FLOAT: if(H5Z_set_parms_atomic(type_id, cd_values)==FAIL) HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot set parameters for datatype") break; - case H5T_ARRAY: + case H5T_ARRAY: if(H5Z_set_parms_array(type_id, cd_values)==FAIL) HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot set parameters for datatype") break; case H5T_COMPOUND: if(H5Z_set_parms_compound(type_id, cd_values)==FAIL) - HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot set parameters for datatype") + HGOTO_ERROR(H5E_PLINE,H5E_BADTYPE,FAIL,"nbit cannot set parameters for datatype") break; default: /* no need to set parameters for other datatypes at top level */ break; @@ -781,35 +781,35 @@ done: * Function: H5Z_filter_nbit * * Purpose: Implement an I/O filter for storing packed nbit data - * + * * Return: Success: Size of buffer filtered - * Failure: 0 + * Failure: 0 * * Programmer: Xiaowen Wu * Friday, January 21, 2005 * * Modifications: - * + * *------------------------------------------------------------------------- */ static size_t -H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], +H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf) { size_t ret_value = 0; /* return value */ size_t size_out = 0; /* size of output buffer */ unsigned d_nelmts = 0; /* number of elements in the chunk */ unsigned char *outbuf = NULL; /* pointer to new output buffer */ - + FUNC_ENTER_NOAPI(H5Z_filter_nbit, 0) /* check arguments * cd_values[0] stores actual number of parameters in cd_values[] */ - if (cd_nelmts!=cd_values[0]) + if (cd_nelmts!=cd_values[0]) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid nbit aggression level") - /* check if need to do nbit compress or decompress + /* check if need to do nbit compress or decompress * cd_values[1] stores the flag if true indicating no need to compress */ if (cd_values[1]) { @@ -827,12 +827,12 @@ H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], /* allocate memory space for decompressed buffer */ if(NULL==(outbuf = H5MM_malloc(size_out))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed for nbit decompression") - + /* decompress the buffer */ - H5Z_nbit_decompress(outbuf, d_nelmts, *buf, cd_values); + H5Z_nbit_decompress(outbuf, d_nelmts, *buf, cd_values); } /* output; compress */ - else { + else { assert(nbytes == d_nelmts * cd_values[4]); size_out = nbytes; @@ -840,7 +840,7 @@ H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], /* allocate memory space for compressed buffer */ if(NULL==(outbuf = H5MM_malloc(size_out))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed for nbit compression") - + /* compress the buffer, size_out will be changed */ H5Z_nbit_compress(*buf, d_nelmts, outbuf, &size_out, cd_values); } @@ -854,7 +854,7 @@ H5Z_filter_nbit(unsigned flags, size_t cd_nelmts, const unsigned cd_values[], *buf_size = size_out; ret_value = size_out; -done: +done: if(outbuf) H5MM_xfree(outbuf); FUNC_LEAVE_NOAPI(ret_value) @@ -864,17 +864,17 @@ done: * assume one byte has 8 bit * assume padding bit is 0 * assume size of unsigned char is one byte - * assume one data item of certain datatype is stored continously in bytes - * atomic datatype is treated on byte basis + * assume one data item of certain datatype is stored continously in bytes + * atomic datatype is treated on byte basis */ static void H5Z_nbit_next_byte(size_t *j, int *buf_len) { - ++(*j); + ++(*j); *buf_len = 8 * sizeof(unsigned char); } -static void H5Z_nbit_decompress_one_byte(unsigned char *data, size_t data_offset, int k, int begin_i, +static void H5Z_nbit_decompress_one_byte(unsigned char *data, size_t data_offset, int k, int begin_i, int end_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int datatype_len) { int dat_len; /* dat_len is the number of bits to be copied in each data byte */ @@ -886,7 +886,7 @@ int end_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int d uchar_offset = 0; if(begin_i != end_i) { /* significant bits occupy >1 unsigned char */ - if(k == begin_i) + if(k == begin_i) dat_len = 8 - (datatype_len - p.precision - p.offset) % 8; else if(k == end_i) { dat_len = 8 - p.offset %8; @@ -899,7 +899,7 @@ int end_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int d dat_len = p.precision; } - if(*buf_len > dat_len) { + if(*buf_len > dat_len) { data[data_offset + k] = ((val >> (*buf_len - dat_len)) & ~(~0 << dat_len)) << uchar_offset; *buf_len -= dat_len; @@ -913,11 +913,11 @@ int end_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int d val = buffer[*j]; data[data_offset + k] |= ((val >> (*buf_len - dat_len)) & ~(~0 << dat_len)) << uchar_offset; - *buf_len -= dat_len; + *buf_len -= dat_len; } } -static void H5Z_nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, +static void H5Z_nbit_decompress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, int *buf_len, unsigned size) { unsigned i; /* index */ @@ -936,12 +936,12 @@ static void H5Z_nbit_decompress_one_nooptype(unsigned char *data, size_t data_of val = buffer[*j]; data[data_offset + i] |= ((val >> (*buf_len - dat_len)) & ~(~0 << dat_len)); - *buf_len -= dat_len; + *buf_len -= dat_len; } } -static void H5Z_nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, - unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p) +static void H5Z_nbit_decompress_one_atomic(unsigned char *data, size_t data_offset, + unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p) { /* begin_i: the index of byte having first significant bit end_i: the index of byte having last significant bit */ @@ -957,8 +957,8 @@ static void H5Z_nbit_decompress_one_atomic(unsigned char *data, size_t data_offs begin_i = (p.precision + p.offset) / 8 - 1; end_i = p.offset / 8; - for(k = begin_i; k >= end_i; k--) - H5Z_nbit_decompress_one_byte(data, data_offset, k, begin_i, end_i, + for(k = begin_i; k >= end_i; k--) + H5Z_nbit_decompress_one_byte(data, data_offset, k, begin_i, end_i, buffer, j, buf_len, p, datatype_len); } @@ -970,14 +970,14 @@ static void H5Z_nbit_decompress_one_atomic(unsigned char *data, size_t data_offs else end_i = (datatype_len - p.offset) / 8 - 1; - for(k = begin_i; k <= end_i; k++) - H5Z_nbit_decompress_one_byte(data, data_offset, k, begin_i, end_i, + for(k = begin_i; k <= end_i; k++) + H5Z_nbit_decompress_one_byte(data, data_offset, k, begin_i, end_i, buffer, j, buf_len, p, datatype_len); - } + } } -static void H5Z_nbit_decompress_one_array(unsigned char *data, size_t data_offset, - unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]) +static void H5Z_nbit_decompress_one_array(unsigned char *data, size_t data_offset, + unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]) { unsigned i, total_size, base_class, base_size, n, begin_index; parms_atomic p; @@ -1018,13 +1018,13 @@ static void H5Z_nbit_decompress_one_array(unsigned char *data, size_t data_offse break; case H5Z_NBIT_NOOPTYPE: parms_index++; /* skip size of no-op type */ - H5Z_nbit_decompress_one_nooptype(data, data_offset, buffer, j, buf_len, total_size); + H5Z_nbit_decompress_one_nooptype(data, data_offset, buffer, j, buf_len, total_size); break; } /* end switch */ } -static void H5Z_nbit_decompress_one_compound(unsigned char *data, size_t data_offset, - unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]) +static void H5Z_nbit_decompress_one_compound(unsigned char *data, size_t data_offset, + unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]) { unsigned i, nmembers, member_offset, member_class, size; parms_atomic p; @@ -1041,15 +1041,15 @@ static void H5Z_nbit_decompress_one_compound(unsigned char *data, size_t data_of p.order = parms[parms_index++]; p.precision = parms[parms_index++]; p.offset = parms[parms_index++]; - H5Z_nbit_decompress_one_atomic(data, data_offset + member_offset, + H5Z_nbit_decompress_one_atomic(data, data_offset + member_offset, buffer, j, buf_len, p); break; case H5Z_NBIT_ARRAY: - H5Z_nbit_decompress_one_array(data, data_offset + member_offset, + H5Z_nbit_decompress_one_array(data, data_offset + member_offset, buffer, j, buf_len, parms); break; case H5Z_NBIT_COMPOUND: - H5Z_nbit_decompress_one_compound(data, data_offset+member_offset, + H5Z_nbit_decompress_one_compound(data, data_offset+member_offset, buffer, j, buf_len, parms); break; case H5Z_NBIT_NOOPTYPE: @@ -1061,24 +1061,24 @@ static void H5Z_nbit_decompress_one_compound(unsigned char *data, size_t data_of } } -static void H5Z_nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, - const unsigned parms[]) +static void H5Z_nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, + const unsigned parms[]) { - /* i: index of data, j: index of buffer, + /* i: index of data, j: index of buffer, buf_len: number of bits to be filled in current byte */ size_t i, j, size; - int buf_len; + int buf_len; parms_atomic p; - /* may not have to initialize to zeros */ - for(i = 0; i < d_nelmts*parms[4]; i++) data[i] = 0; - - /* initialization before the loop */ - j = 0; - buf_len = sizeof(unsigned char) * 8; + /* may not have to initialize to zeros */ + for(i = 0; i < d_nelmts*parms[4]; i++) data[i] = 0; + + /* initialization before the loop */ + j = 0; + buf_len = sizeof(unsigned char) * 8; switch(parms[3]) { - case H5Z_NBIT_ATOMIC: + case H5Z_NBIT_ATOMIC: /* set the index before goto function call */ p.size = parms[4]; p.order = parms[5]; @@ -1090,13 +1090,13 @@ static void H5Z_nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned break; case H5Z_NBIT_ARRAY: size = parms[4]; - parms_index = 4; + parms_index = 4; for(i = 0; i < d_nelmts; i++) { H5Z_nbit_decompress_one_array(data, i*size, buffer, &j, &buf_len, parms); parms_index = 4; } break; - case H5Z_NBIT_COMPOUND: + case H5Z_NBIT_COMPOUND: size = parms[4]; parms_index = 4; for(i = 0; i < d_nelmts; i++) { @@ -1107,7 +1107,7 @@ static void H5Z_nbit_decompress(unsigned char *data, unsigned d_nelmts, unsigned } /* end switch */ } -static void H5Z_nbit_compress_one_byte(unsigned char *data, size_t data_offset, int k, int begin_i, +static void H5Z_nbit_compress_one_byte(unsigned char *data, size_t data_offset, int k, int begin_i, int end_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int datatype_len) { int dat_len; /* dat_len is the number of bits to be copied in each data byte */ @@ -1116,7 +1116,7 @@ int end_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int d /* initialize value and bits of unsigned char to be copied */ val = data[data_offset + k]; if(begin_i != end_i) { /* significant bits occupy >1 unsigned char */ - if(k == begin_i) + if(k == begin_i) dat_len = 8 - (datatype_len - p.precision - p.offset) % 8; else if(k == end_i) { dat_len = 8 - p.offset % 8; @@ -1129,7 +1129,7 @@ int end_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int d dat_len = p.precision; } - if(*buf_len > dat_len) { + if(*buf_len > dat_len) { buffer[*j] |= (val & ~(~0 << dat_len)) << (*buf_len - dat_len); *buf_len -= dat_len; } else { @@ -1139,11 +1139,11 @@ int end_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int d if(dat_len == 0) return; buffer[*j] = (val & ~(~0 << dat_len)) << (*buf_len - dat_len); - *buf_len -= dat_len; + *buf_len -= dat_len; } } -static void H5Z_nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, +static void H5Z_nbit_compress_one_nooptype(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, int *buf_len, unsigned size) { unsigned i; /* index */ @@ -1154,22 +1154,22 @@ static void H5Z_nbit_compress_one_nooptype(unsigned char *data, size_t data_offs /* initialize value and bits of unsigned char to be copied */ val = data[data_offset + i]; dat_len = sizeof(unsigned char) * 8; - + buffer[*j] |= (val >> (dat_len - *buf_len)) & ~(~0 << *buf_len); dat_len -= *buf_len; H5Z_nbit_next_byte(j, buf_len); if(dat_len == 0) continue; buffer[*j] = (val & ~(~0 << dat_len)) << (*buf_len - dat_len); - *buf_len -= dat_len; + *buf_len -= dat_len; } } -static void H5Z_nbit_compress_one_atomic(unsigned char *data, size_t data_offset, - unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p) +static void H5Z_nbit_compress_one_atomic(unsigned char *data, size_t data_offset, + unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p) { /* begin_i: the index of byte having first significant bit - end_i: the index of byte having last significant bit */ + end_i: the index of byte having last significant bit */ int k, begin_i, end_i, datatype_len; datatype_len = p.size * 8; @@ -1182,8 +1182,8 @@ static void H5Z_nbit_compress_one_atomic(unsigned char *data, size_t data_offset begin_i = (p.precision + p.offset) / 8 - 1; end_i = p.offset / 8; - for(k = begin_i; k >= end_i; k--) - H5Z_nbit_compress_one_byte(data, data_offset, k, begin_i, end_i, + for(k = begin_i; k >= end_i; k--) + H5Z_nbit_compress_one_byte(data, data_offset, k, begin_i, end_i, buffer, j, buf_len, p, datatype_len); } @@ -1195,19 +1195,19 @@ static void H5Z_nbit_compress_one_atomic(unsigned char *data, size_t data_offset else end_i = (datatype_len - p.offset) / 8 - 1; - for(k = begin_i; k <= end_i; k++) - H5Z_nbit_compress_one_byte(data, data_offset, k, begin_i, end_i, + for(k = begin_i; k <= end_i; k++) + H5Z_nbit_compress_one_byte(data, data_offset, k, begin_i, end_i, buffer, j, buf_len, p, datatype_len); - } + } } -static void H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, unsigned char *buffer, - size_t *j, int *buf_len, const unsigned parms[]) +static void H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, unsigned char *buffer, + size_t *j, int *buf_len, const unsigned parms[]) { unsigned i, total_size, base_class, base_size, n, begin_index; parms_atomic p; - total_size = parms[parms_index++]; + total_size = parms[parms_index++]; base_class = parms[parms_index++]; switch(base_class) { @@ -1218,7 +1218,7 @@ static void H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, p.offset = parms[parms_index++]; n = total_size/p.size; for(i = 0; i < n; i++) - H5Z_nbit_compress_one_atomic(data, data_offset + i*p.size, + H5Z_nbit_compress_one_atomic(data, data_offset + i*p.size, buffer, j, buf_len, p); break; case H5Z_NBIT_ARRAY: @@ -1226,7 +1226,7 @@ static void H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, n = total_size/base_size; /* number of base_type elements inside the array datatype */ begin_index = parms_index; for(i = 0; i < n; i++) { - H5Z_nbit_compress_one_array(data, data_offset + i*base_size, + H5Z_nbit_compress_one_array(data, data_offset + i*base_size, buffer, j, buf_len, parms); parms_index = begin_index; } @@ -1236,20 +1236,20 @@ static void H5Z_nbit_compress_one_array(unsigned char *data, size_t data_offset, n = total_size/base_size; /* number of base_type elements inside the array datatype */ begin_index = parms_index; for(i = 0; i < n; i++) { - H5Z_nbit_compress_one_compound(data, data_offset + i*base_size, + H5Z_nbit_compress_one_compound(data, data_offset + i*base_size, buffer, j, buf_len, parms); parms_index = begin_index; } break; case H5Z_NBIT_NOOPTYPE: parms_index++; /* skip size of no-op type */ - H5Z_nbit_compress_one_nooptype(data, data_offset, buffer, j, buf_len, total_size); + H5Z_nbit_compress_one_nooptype(data, data_offset, buffer, j, buf_len, total_size); break; } /* end switch */ } -static void H5Z_nbit_compress_one_compound(unsigned char *data, size_t data_offset, - unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]) +static void H5Z_nbit_compress_one_compound(unsigned char *data, size_t data_offset, + unsigned char *buffer, size_t *j, int *buf_len, const unsigned parms[]) { unsigned i, nmembers, member_offset, member_class, size; parms_atomic p; @@ -1262,20 +1262,20 @@ static void H5Z_nbit_compress_one_compound(unsigned char *data, size_t data_offs member_class = parms[parms_index++]; switch(member_class) { - case H5Z_NBIT_ATOMIC: + case H5Z_NBIT_ATOMIC: p.size = parms[parms_index++]; p.order = parms[parms_index++]; p.precision = parms[parms_index++]; p.offset = parms[parms_index++]; - H5Z_nbit_compress_one_atomic(data, data_offset + member_offset, + H5Z_nbit_compress_one_atomic(data, data_offset + member_offset, buffer, j, buf_len, p); break; - case H5Z_NBIT_ARRAY: - H5Z_nbit_compress_one_array(data, data_offset + member_offset, + case H5Z_NBIT_ARRAY: + H5Z_nbit_compress_one_array(data, data_offset + member_offset, buffer, j, buf_len, parms); break; case H5Z_NBIT_COMPOUND: - H5Z_nbit_compress_one_compound(data, data_offset+member_offset, + H5Z_nbit_compress_one_compound(data, data_offset+member_offset, buffer, j, buf_len, parms); break; case H5Z_NBIT_NOOPTYPE: @@ -1287,24 +1287,24 @@ static void H5Z_nbit_compress_one_compound(unsigned char *data, size_t data_offs } } -static void H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, - size_t *buffer_size, const unsigned parms[]) +static void H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, + size_t *buffer_size, const unsigned parms[]) { - /* i: index of data, j: index of buffer, + /* i: index of data, j: index of buffer, buf_len: number of bits to be filled in current byte */ size_t i, j, size; - int buf_len; + int buf_len; parms_atomic p; /* must initialize buffer to be zeros */ for(j = 0; j < *buffer_size; j++) buffer[j] = 0; - /* initialization before the loop */ - j = 0; - buf_len = sizeof(unsigned char) * 8; + /* initialization before the loop */ + j = 0; + buf_len = sizeof(unsigned char) * 8; switch(parms[3]) { - case H5Z_NBIT_ATOMIC: + case H5Z_NBIT_ATOMIC: /* set the index before goto function call */ p.size = parms[4]; p.order = parms[5]; @@ -1315,10 +1315,10 @@ static void H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned c H5Z_nbit_compress_one_atomic(data, i*p.size, buffer, &j, &buf_len, p); } break; - case H5Z_NBIT_ARRAY: + case H5Z_NBIT_ARRAY: size = parms[4]; parms_index = 4; - for(i = 0; i < d_nelmts; i++) { + for(i = 0; i < d_nelmts; i++) { H5Z_nbit_compress_one_array(data, i*size, buffer, &j, &buf_len, parms); parms_index = 4; } @@ -1326,7 +1326,7 @@ static void H5Z_nbit_compress(unsigned char *data, unsigned d_nelmts, unsigned c case H5Z_NBIT_COMPOUND: size = parms[4]; parms_index = 4; - for(i = 0; i < d_nelmts; i++) { + for(i = 0; i < d_nelmts; i++) { H5Z_nbit_compress_one_compound(data, i*size, buffer, &j, &buf_len, parms); parms_index = 4; } diff --git a/src/H5Zprivate.h b/src/H5Zprivate.h index 2c1072d..e13876a 100644 --- a/src/H5Zprivate.h +++ b/src/H5Zprivate.h @@ -54,7 +54,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 a4eeb5e..38134f3 100644 --- a/src/H5Zpublic.h +++ b/src/H5Zpublic.h @@ -55,11 +55,11 @@ 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 - + /* Special parameters for ScaleOffset filter*/ #define H5_SO_FLOAT_DSCALE 0 #define H5_SO_FLOAT_ESCALE 1 @@ -75,7 +75,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) @@ -108,18 +108,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. */ @@ -133,16 +133,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/H5Zscaleoffset.c b/src/H5Zscaleoffset.c index da7df7f..2dc8692 100644 --- a/src/H5Zscaleoffset.c +++ b/src/H5Zscaleoffset.c @@ -24,15 +24,15 @@ #ifdef H5_HAVE_FILTER_SCALEOFFSET -/* Struct of parameters needed for compressing/decompressing one atomic datatype */ +/* Struct of parameters needed for compressing/decompressing one atomic datatype */ typedef struct { size_t size; /* datatype size */ uint32_t minbits; /* minimum bits to compress one value of such datatype */ unsigned mem_order; /* current memory endianness order */ -} parms_atomic; +} parms_atomic; enum H5Z_scaleoffset_type {t_bad=0, t_uchar=1, t_ushort, t_uint, t_ulong, t_ulong_long, - t_schar, t_short, t_int, t_long, t_long_long, + t_schar, t_short, t_int, t_long, t_long_long, t_float, t_double}; /* Local function prototypes */ @@ -40,7 +40,7 @@ static double H5Z_scaleoffset_rnd(double val); static herr_t H5Z_can_apply_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id); static enum H5Z_scaleoffset_type H5Z_scaleoffset_get_type(unsigned dtype_class, unsigned dtype_size, unsigned dtype_sign); -static herr_t H5Z_scaleoffset_set_parms_fillval(hid_t dcpl_id, hid_t type_id, +static herr_t H5Z_scaleoffset_set_parms_fillval(hid_t dcpl_id, hid_t type_id, enum H5Z_scaleoffset_type type, unsigned cd_values[], int need_convert); static herr_t H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id); static size_t H5Z_filter_scaleoffset(unsigned flags, size_t cd_nelmts, @@ -55,7 +55,7 @@ static void H5Z_scaleoffset_postdecompress_i(void *data, unsigned d_nelmts, uint32_t minbits, unsigned long_long minval); static herr_t H5Z_scaleoffset_precompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_type type, unsigned filavail, const void *filval_buf, - uint32_t *minbits, unsigned long_long *minval, double D_val); + uint32_t *minbits, unsigned long_long *minval, double D_val); static herr_t H5Z_scaleoffset_postdecompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_type type, unsigned filavail, const void *filval_buf, uint32_t minbits, unsigned long_long minval, double D_val); @@ -66,11 +66,11 @@ static void H5Z_scaleoffset_decompress_one_byte(unsigned char *data, size_t data static void H5Z_scaleoffset_compress_one_byte(unsigned char *data, size_t data_offset, int k, int begin_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int dtype_len); -static void H5Z_scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, +static void H5Z_scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p); -static void H5Z_scaleoffset_compress_one_atomic(unsigned char *data, size_t data_offset, +static void H5Z_scaleoffset_compress_one_atomic(unsigned char *data, size_t data_offset, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p); -static void H5Z_scaleoffset_decompress(unsigned char *data, unsigned d_nelmts, +static void H5Z_scaleoffset_decompress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, parms_atomic p); static void H5Z_scaleoffset_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, size_t buffer_size, parms_atomic p); @@ -567,7 +567,7 @@ H5Z_class_t H5Z_SCALEOFFSET[1] = {{ /*------------------------------------------------------------------------- * Function: H5Z_can_apply_scaleoffset * - * Purpose: Check the parameters for scaleoffset compression for + * Purpose: Check the parameters for scaleoffset compression for * validity and whether they fit a particular dataset. * * Return: Success: Non-negative @@ -576,7 +576,7 @@ H5Z_class_t H5Z_SCALEOFFSET[1] = {{ * Programmer: Xiaowen Wu * Friday, February 4, 2005 * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ @@ -618,51 +618,51 @@ done: * * Purpose: Get the specific integer type based on datatype size and sign * or floating-point type based on size - * + * * Return: Success: id number of integer type - * Failure: 0 + * Failure: 0 * * Programmer: Xiaowen Wu * Wednesday, April 13, 2005 * * Modifications: - * + * *------------------------------------------------------------------------- */ -static enum H5Z_scaleoffset_type +static enum H5Z_scaleoffset_type H5Z_scaleoffset_get_type(unsigned dtype_class, unsigned dtype_size, unsigned dtype_sign) { enum H5Z_scaleoffset_type type; /* integer type */ enum H5Z_scaleoffset_type ret_value; /* return value */ FUNC_ENTER_NOAPI_NOINIT(H5Z_scaleoffset_get_type) - + if(dtype_class==H5Z_SCALEOFFSET_CLS_INTEGER) { if(dtype_sign==H5Z_SCALEOFFSET_SGN_NONE) { /* unsigned integer */ if (dtype_size == sizeof(unsigned char)) type = t_uchar; - else if(dtype_size == sizeof(unsigned short)) type = t_ushort; - else if(dtype_size == sizeof(unsigned int)) type = t_uint; + else if(dtype_size == sizeof(unsigned short)) type = t_ushort; + else if(dtype_size == sizeof(unsigned int)) type = t_uint; else if(dtype_size == sizeof(unsigned long)) type = t_ulong; - else if(dtype_size == sizeof(unsigned long_long)) type = t_ulong_long; - else + else if(dtype_size == sizeof(unsigned long_long)) type = t_ulong_long; + else HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, t_bad, "cannot find matched memory dataype") } if(dtype_sign==H5Z_SCALEOFFSET_SGN_2) { /* signed integer */ if (dtype_size == sizeof(signed char)) type = t_schar; - else if(dtype_size == sizeof(short)) type = t_short; - else if(dtype_size == sizeof(int)) type = t_int; + else if(dtype_size == sizeof(short)) type = t_short; + else if(dtype_size == sizeof(int)) type = t_int; else if(dtype_size == sizeof(long)) type = t_long; - else if(dtype_size == sizeof(long_long)) type = t_long_long; - else + else if(dtype_size == sizeof(long_long)) type = t_long_long; + else HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, t_bad, "cannot find matched memory dataype") } } if(dtype_class==H5Z_SCALEOFFSET_CLS_FLOAT) { if(dtype_size == sizeof(float)) type = t_float; - else if(dtype_size == sizeof(double)) type = t_double; - else + else if(dtype_size == sizeof(double)) type = t_double; + else HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, t_bad, "cannot find matched memory dataype") } @@ -677,7 +677,7 @@ done: /*------------------------------------------------------------------------- * Function: H5Z_scaleoffset_set_parms_fillval * - * Purpose: Get the fill value of the dataset and store in cd_values[] + * Purpose: Get the fill value of the dataset and store in cd_values[] * * Return: Success: Non-negative * Failure: Negative @@ -685,11 +685,11 @@ done: * Programmer: Xiaowen Wu * Monday, March 7, 2005 * - * Modifications: + * Modifications: * *------------------------------------------------------------------------- */ -static herr_t H5Z_scaleoffset_set_parms_fillval(hid_t dcpl_id, hid_t type_id, +static herr_t H5Z_scaleoffset_set_parms_fillval(hid_t dcpl_id, hid_t type_id, enum H5Z_scaleoffset_type type, unsigned cd_values[], int need_convert) { herr_t ret_value=SUCCEED; /* Return value */ @@ -697,34 +697,34 @@ static herr_t H5Z_scaleoffset_set_parms_fillval(hid_t dcpl_id, hid_t type_id, FUNC_ENTER_NOAPI(H5Z_scaleoffset_set_parms_fillval, FAIL) if(type == t_uchar) - H5Z_scaleoffset_set_filval_3(unsigned char, dcpl_id, type_id, + H5Z_scaleoffset_set_filval_3(unsigned char, dcpl_id, type_id, cd_values, need_convert) - else if(type == t_ushort) - H5Z_scaleoffset_set_filval_1(unsigned short, dcpl_id, type_id, + else if(type == t_ushort) + H5Z_scaleoffset_set_filval_1(unsigned short, dcpl_id, type_id, cd_values, need_convert) - else if(type == t_uint) - H5Z_scaleoffset_set_filval_1(unsigned int, dcpl_id, type_id, + else if(type == t_uint) + H5Z_scaleoffset_set_filval_1(unsigned int, dcpl_id, type_id, cd_values, need_convert) - else if(type == t_ulong) - H5Z_scaleoffset_set_filval_1(unsigned long, dcpl_id, type_id, + else if(type == t_ulong) + H5Z_scaleoffset_set_filval_1(unsigned long, dcpl_id, type_id, cd_values, need_convert) - else if(type == t_ulong_long) - H5Z_scaleoffset_set_filval_1(unsigned long_long, dcpl_id, type_id, + else if(type == t_ulong_long) + H5Z_scaleoffset_set_filval_1(unsigned long_long, dcpl_id, type_id, cd_values, need_convert) - else if(type == t_schar) - H5Z_scaleoffset_set_filval_3(signed char, dcpl_id, type_id, + else if(type == t_schar) + H5Z_scaleoffset_set_filval_3(signed char, dcpl_id, type_id, cd_values, need_convert) else if(type == t_short) - H5Z_scaleoffset_set_filval_2(short, dcpl_id, type_id, + H5Z_scaleoffset_set_filval_2(short, dcpl_id, type_id, cd_values, need_convert) - else if(type == t_int) - H5Z_scaleoffset_set_filval_2(int, dcpl_id, type_id, + else if(type == t_int) + H5Z_scaleoffset_set_filval_2(int, dcpl_id, type_id, cd_values, need_convert) - else if(type == t_long) - H5Z_scaleoffset_set_filval_2(long, dcpl_id, type_id, + else if(type == t_long) + H5Z_scaleoffset_set_filval_2(long, dcpl_id, type_id, cd_values, need_convert) - else if(type == t_long_long) - H5Z_scaleoffset_set_filval_2(long_long, dcpl_id, type_id, + else if(type == t_long_long) + H5Z_scaleoffset_set_filval_2(long_long, dcpl_id, type_id, cd_values, need_convert) else if(type == t_float) H5Z_scaleoffset_set_filval_4(float, dcpl_id, type_id, @@ -751,7 +751,7 @@ done: * Friday, February 4, 2005 * * Modifications: - * + * *------------------------------------------------------------------------- */ static herr_t @@ -826,7 +826,7 @@ H5Z_set_local_scaleoffset(hid_t dcpl_id, hid_t type_id, hid_t space_id) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad integer sign") } /* end switch */ } - + /* Get datatype's endianness order */ if((dtype_order=H5Tget_order(type_id))==H5T_ORDER_ERROR) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype endianness order") @@ -895,19 +895,19 @@ done: * * Purpose: Implement an I/O filter for storing packed integer * data using scale and offset method. - * + * * Return: Success: Size of buffer filtered - * Failure: 0 + * Failure: 0 * * Programmer: Xiaowen Wu * Monday, February 7, 2005 * * Modifications: - * + * *------------------------------------------------------------------------- */ static size_t -H5Z_filter_scaleoffset (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], +H5Z_filter_scaleoffset (unsigned flags, size_t cd_nelmts, const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf) { size_t ret_value = 0; /* return value */ @@ -928,7 +928,7 @@ H5Z_filter_scaleoffset (unsigned flags, size_t cd_nelmts, const unsigned cd_valu unsigned buf_offset = 21; /* buffer offset because of parameters stored in file */ unsigned i; /* index */ parms_atomic p; /* paramters needed for compress/decompress functions */ - + FUNC_ENTER_NOAPI(H5Z_filter_scaleoffset, 0) /* check arguments */ @@ -965,18 +965,18 @@ H5Z_filter_scaleoffset (unsigned flags, size_t cd_nelmts, const unsigned cd_valu * scale type can be H5_SO_FLOAT_DSCALE (0), H5_SO_FLOAT_ESCALE (1) or H5_SO_INT (other) * H5_SO_FLOAT_DSCALE : floating-point type, variable-minimum-bits method, * scale factor is decimal scale factor - * H5_SO_FLOAT_ESCALE : floating-point type, fixed-minimum-bits method, + * H5_SO_FLOAT_ESCALE : floating-point type, fixed-minimum-bits method, * scale factor is the fixed minimum number of bits - * H5_SO_INT : integer type, scale_factor is minimum number of bits + * H5_SO_INT : integer type, scale_factor is minimum number of bits */ if(dtype_class==H5Z_SCALEOFFSET_CLS_FLOAT) { /* floating-point type */ if(scale_type!=H5_SO_FLOAT_DSCALE && scale_type!=H5_SO_FLOAT_ESCALE) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "scale type must be 0 or 1") - } + } else if(dtype_class==H5Z_SCALEOFFSET_CLS_INTEGER) { /* integer type */ if(scale_type==H5_SO_FLOAT_DSCALE || scale_type==H5_SO_FLOAT_ESCALE) { HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "scale type cannot be 0 or 1") - /* check here when scale_factor is less than 0 for integer, library will reset it to 0 + /* check here when scale_factor is less than 0 for integer, library will reset it to 0 in this case, library will calculate the minimum-bits */ if(scale_factor < 0) scale_factor = 0; } @@ -986,7 +986,7 @@ H5Z_filter_scaleoffset (unsigned flags, size_t cd_nelmts, const unsigned cd_valu if(scale_type==H5_SO_FLOAT_DSCALE) { /* floating-point type, variable-minimum-bits */ D_val = (double)scale_factor; } else { /* integer type, or floating-point type with fixed-minimum-bits method */ - if(scale_factor>cd_values[H5Z_SCALEOFFSET_PARM_SIZE]*8) + if(scale_factor>cd_values[H5Z_SCALEOFFSET_PARM_SIZE]*8) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "minimum number of bits exceeds maximum") /* no need to process data */ @@ -1041,11 +1041,11 @@ H5Z_filter_scaleoffset (unsigned flags, size_t cd_nelmts, const unsigned cd_valu HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed for scaleoffset decompression") /* special case: minbits equal to full precision */ - if(minbits == p.size * 8) { + if(minbits == p.size * 8) { HDmemcpy(outbuf, (unsigned char*)(*buf)+buf_offset, size_out); /* convert to dataset datatype endianness order if needed */ - if(need_convert) + if(need_convert) H5Z_scaleoffset_convert(outbuf, d_nelmts, p.size); *buf = outbuf; @@ -1055,11 +1055,11 @@ H5Z_filter_scaleoffset (unsigned flags, size_t cd_nelmts, const unsigned cd_valu goto done; } - /* decompress the buffer if minbits not equal to zero */ - if(minbits != 0) - H5Z_scaleoffset_decompress(outbuf, d_nelmts, (unsigned char*)(*buf)+buf_offset, p); - else { - /* fill value is not defined and all data elements have the same value */ + /* decompress the buffer if minbits not equal to zero */ + if(minbits != 0) + H5Z_scaleoffset_decompress(outbuf, d_nelmts, (unsigned char*)(*buf)+buf_offset, p); + else { + /* fill value is not defined and all data elements have the same value */ for(i = 0; i < size_out; i++) outbuf[i] = 0; } @@ -1069,26 +1069,26 @@ H5Z_filter_scaleoffset (unsigned flags, size_t cd_nelmts, const unsigned cd_valu /* postprocess after decompression */ if(dtype_class==H5Z_SCALEOFFSET_CLS_INTEGER) - H5Z_scaleoffset_postdecompress_i(outbuf, d_nelmts, type, filavail, + H5Z_scaleoffset_postdecompress_i(outbuf, d_nelmts, type, filavail, &cd_values[H5Z_SCALEOFFSET_PARM_FILVAL], minbits, minval); if(dtype_class==H5Z_SCALEOFFSET_CLS_FLOAT) - if(scale_type==0) { /* variable-minimum-bits method */ - if(H5Z_scaleoffset_postdecompress_fd(outbuf, d_nelmts, type, filavail, + if(scale_type==0) { /* variable-minimum-bits method */ + if(H5Z_scaleoffset_postdecompress_fd(outbuf, d_nelmts, type, filavail, &cd_values[H5Z_SCALEOFFSET_PARM_FILVAL], minbits, minval, D_val)==FAIL) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, 0, "post-decompression failed") } /* after postprocess, convert to dataset datatype endianness order if needed */ - if(need_convert) + if(need_convert) H5Z_scaleoffset_convert(outbuf, d_nelmts, p.size); } /* output; compress */ - else { + else { assert(nbytes == d_nelmts * p.size); /* before preprocess, convert to memory endianness order if needed */ - if(need_convert) + if(need_convert) H5Z_scaleoffset_convert(*buf, d_nelmts, p.size); /* before preprocess, get memory type */ @@ -1097,11 +1097,11 @@ H5Z_filter_scaleoffset (unsigned flags, size_t cd_nelmts, const unsigned cd_valu /* preprocess before compression */ if(dtype_class==H5Z_SCALEOFFSET_CLS_INTEGER) - H5Z_scaleoffset_precompress_i(*buf, d_nelmts, type, filavail, + H5Z_scaleoffset_precompress_i(*buf, d_nelmts, type, filavail, &cd_values[H5Z_SCALEOFFSET_PARM_FILVAL], &minbits, &minval); - + if(dtype_class==H5Z_SCALEOFFSET_CLS_FLOAT) - if(scale_type==0) { /* variable-minimum-bits method */ + if(scale_type==0) { /* variable-minimum-bits method */ if(H5Z_scaleoffset_precompress_fd(*buf, d_nelmts, type, filavail, &cd_values[H5Z_SCALEOFFSET_PARM_FILVAL], &minbits, &minval, D_val)==FAIL) HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, 0, "pre-compression failed") @@ -1142,10 +1142,10 @@ H5Z_filter_scaleoffset (unsigned flags, size_t cd_nelmts, const unsigned cd_valu goto done; } - /* compress the buffer if minbits not equal to zero - * minbits equal to zero only when fill value is not defined and - * all data elements have the same value - */ + /* compress the buffer if minbits not equal to zero + * minbits equal to zero only when fill value is not defined and + * all data elements have the same value + */ if(minbits != 0) H5Z_scaleoffset_compress(*buf, d_nelmts, outbuf+buf_offset, size_out-buf_offset, p); } @@ -1169,13 +1169,13 @@ done: * assume one byte has 8 bit * assume padding bit is 0 * assume size of unsigned char is one byte - * assume one data item of certain datatype is stored continously in bytes - * atomic datatype is treated on byte basis + * assume one data item of certain datatype is stored continously in bytes + * atomic datatype is treated on byte basis */ /* change byte order of input buffer either from little-endian to big-endian - * or from big-endian to little-endian 2/21/2005 + * or from big-endian to little-endian 2/21/2005 */ static void H5Z_scaleoffset_convert(void *buf, unsigned d_nelmts, unsigned dtype_size) { @@ -1195,28 +1195,28 @@ static void H5Z_scaleoffset_convert(void *buf, unsigned d_nelmts, unsigned dtype } /* Round a floating-point value to the nearest integer value 4/19/05 */ -/* rounding to the bigger absolute value if val is in the middle, +/* rounding to the bigger absolute value if val is in the middle, 0.5 -> 1, -0.5 ->-1 5/9/05, KY */ -static double H5Z_scaleoffset_rnd(double val) -{ - double u_val, l_val; - - u_val = HDceil(val); +static double H5Z_scaleoffset_rnd(double val) +{ + double u_val, l_val; + + u_val = HDceil(val); l_val = HDfloor(val); if(val > 0) { - if((u_val - val)<=(val - l_val)) return u_val; - else return l_val; - } + if((u_val - val)<=(val - l_val)) return u_val; + else return l_val; + } else { - if((val - l_val)<=(u_val - val)) return l_val; - else return u_val; - } -} + if((val - l_val)<=(u_val - val)) return l_val; + else return u_val; + } +} /* return ceiling of floating-point log2 function - * receive unsigned integer as argument 3/10/2005 + * receive unsigned integer as argument 3/10/2005 */ static unsigned H5Z_scaleoffset_log2(unsigned long_long num) { @@ -1231,119 +1231,119 @@ static unsigned H5Z_scaleoffset_log2(unsigned long_long num) } /* precompress for integer type */ -static void -H5Z_scaleoffset_precompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_type type, +static void +H5Z_scaleoffset_precompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_type type, unsigned filavail, const void *filval_buf, uint32_t *minbits, unsigned long_long *minval) { if(type == t_uchar) - H5Z_scaleoffset_precompress_1(unsigned char, data, d_nelmts, + H5Z_scaleoffset_precompress_1(unsigned char, data, d_nelmts, filavail, filval_buf, minbits, minval) - else if(type == t_ushort) - H5Z_scaleoffset_precompress_1(unsigned short, data, d_nelmts, + else if(type == t_ushort) + H5Z_scaleoffset_precompress_1(unsigned short, data, d_nelmts, filavail, filval_buf, minbits, minval) - else if(type == t_uint) - H5Z_scaleoffset_precompress_1(unsigned int, data, d_nelmts, + else if(type == t_uint) + H5Z_scaleoffset_precompress_1(unsigned int, data, d_nelmts, filavail, filval_buf, minbits, minval) else if(type == t_ulong) - H5Z_scaleoffset_precompress_1(unsigned long, data, d_nelmts, + H5Z_scaleoffset_precompress_1(unsigned long, data, d_nelmts, filavail, filval_buf, minbits, minval) - else if(type == t_ulong_long) - H5Z_scaleoffset_precompress_1(unsigned long_long, data, d_nelmts, + else if(type == t_ulong_long) + H5Z_scaleoffset_precompress_1(unsigned long_long, data, d_nelmts, filavail, filval_buf, minbits, minval) else if(type == t_schar) { - signed char *buf = data, min = 0, max = 0, filval = 0; - unsigned char span; unsigned i; - - if(filavail == H5Z_SCALEOFFSET_FILL_DEFINED) { /* fill value defined */ - H5Z_scaleoffset_get_filval_1(i, signed char, filval_buf, filval); - if(*minbits == H5_SO_INT_MINIMUMBITS_DEFAULT ) { /* minbits not set yet, calculate max, min, and minbits */ + signed char *buf = data, min = 0, max = 0, filval = 0; + unsigned char span; unsigned i; + + if(filavail == H5Z_SCALEOFFSET_FILL_DEFINED) { /* fill value defined */ + H5Z_scaleoffset_get_filval_1(i, signed char, filval_buf, filval); + if(*minbits == H5_SO_INT_MINIMUMBITS_DEFAULT ) { /* minbits not set yet, calculate max, min, and minbits */ H5Z_scaleoffset_max_min_1(i, d_nelmts, buf, filval, max, min) - if((unsigned char)(max - min) > (unsigned char)(~(unsigned char)0 - 2)) - { *minbits = sizeof(signed char)*8; return; } - span = max - min + 1; + if((unsigned char)(max - min) > (unsigned char)(~(unsigned char)0 - 2)) + { *minbits = sizeof(signed char)*8; return; } + span = max - min + 1; *minbits = H5Z_scaleoffset_log2((unsigned long_long)(span+1)); - } else /* minbits already set, only calculate min */ - H5Z_scaleoffset_min_1(i, d_nelmts, buf, filval, min) - if(*minbits != sizeof(signed char)*8) /* change values if minbits != full precision */ - for(i = 0; i < d_nelmts; i++) - buf[i] = (buf[i] == filval)?(((unsigned char)1 << *minbits) - 1):(buf[i] - min); - } else { /* fill value undefined */ - if(*minbits == H5_SO_INT_MINIMUMBITS_DEFAULT ) { /* minbits not set yet, calculate max, min, and minbits */ - H5Z_scaleoffset_max_min_2(i, d_nelmts, buf, max, min) + } else /* minbits already set, only calculate min */ + H5Z_scaleoffset_min_1(i, d_nelmts, buf, filval, min) + if(*minbits != sizeof(signed char)*8) /* change values if minbits != full precision */ + for(i = 0; i < d_nelmts; i++) + buf[i] = (buf[i] == filval)?(((unsigned char)1 << *minbits) - 1):(buf[i] - min); + } else { /* fill value undefined */ + if(*minbits == H5_SO_INT_MINIMUMBITS_DEFAULT ) { /* minbits not set yet, calculate max, min, and minbits */ + H5Z_scaleoffset_max_min_2(i, d_nelmts, buf, max, min) if((unsigned char)(max - min) > (unsigned char)(~(unsigned char)0 - 2)) { *minbits = sizeof(signed char)*8; *minval = min; return; - } - span = max - min + 1; + } + span = max - min + 1; *minbits = H5Z_scaleoffset_log2((unsigned long_long)span); - } else /* minbits already set, only calculate min */ - H5Z_scaleoffset_min_2(i, d_nelmts, buf, min) - if(*minbits != sizeof(signed char)*8) /* change values if minbits != full precision */ - for(i = 0; i < d_nelmts; i++) buf[i] -= min; - } - *minval = min; - } + } else /* minbits already set, only calculate min */ + H5Z_scaleoffset_min_2(i, d_nelmts, buf, min) + if(*minbits != sizeof(signed char)*8) /* change values if minbits != full precision */ + for(i = 0; i < d_nelmts; i++) buf[i] -= min; + } + *minval = min; + } else if(type == t_short) - H5Z_scaleoffset_precompress_2(short, data, d_nelmts, + H5Z_scaleoffset_precompress_2(short, data, d_nelmts, filavail, filval_buf, minbits, minval) else if(type == t_int) - H5Z_scaleoffset_precompress_2(int, data, d_nelmts, + H5Z_scaleoffset_precompress_2(int, data, d_nelmts, filavail, filval_buf, minbits, minval) - else if(type == t_long) - H5Z_scaleoffset_precompress_2(long, data, d_nelmts, + else if(type == t_long) + H5Z_scaleoffset_precompress_2(long, data, d_nelmts, filavail, filval_buf, minbits, minval) - else if(type == t_long_long) - H5Z_scaleoffset_precompress_2(long_long, data, d_nelmts, + else if(type == t_long_long) + H5Z_scaleoffset_precompress_2(long_long, data, d_nelmts, filavail, filval_buf, minbits, minval) } /* postdecompress for integer type */ -static void -H5Z_scaleoffset_postdecompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_type type, +static void +H5Z_scaleoffset_postdecompress_i(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_type type, unsigned filavail, const void *filval_buf, uint32_t minbits, unsigned long_long minval) { long_long sminval = *(long_long*)&minval; /* for signed integer types */ - if(type == t_uchar) - H5Z_scaleoffset_postdecompress_1(unsigned char, data, d_nelmts, filavail, + if(type == t_uchar) + H5Z_scaleoffset_postdecompress_1(unsigned char, data, d_nelmts, filavail, filval_buf, minbits, minval) - else if(type == t_ushort) - H5Z_scaleoffset_postdecompress_1(unsigned short, data, d_nelmts, filavail, + else if(type == t_ushort) + H5Z_scaleoffset_postdecompress_1(unsigned short, data, d_nelmts, filavail, filval_buf, minbits, minval) - else if(type == t_uint) - H5Z_scaleoffset_postdecompress_1(unsigned int, data, d_nelmts, filavail, + else if(type == t_uint) + H5Z_scaleoffset_postdecompress_1(unsigned int, data, d_nelmts, filavail, filval_buf, minbits, minval) - else if(type == t_ulong) - H5Z_scaleoffset_postdecompress_1(unsigned long, data, d_nelmts, filavail, + else if(type == t_ulong) + H5Z_scaleoffset_postdecompress_1(unsigned long, data, d_nelmts, filavail, filval_buf, minbits, minval) - else if(type == t_ulong_long) - H5Z_scaleoffset_postdecompress_1(unsigned long_long, data, d_nelmts, filavail, + else if(type == t_ulong_long) + H5Z_scaleoffset_postdecompress_1(unsigned long_long, data, d_nelmts, filavail, filval_buf, minbits, minval) else if(type == t_schar) { signed char *buf = data, filval = 0; unsigned i; if(filavail == H5Z_SCALEOFFSET_FILL_DEFINED) { /* fill value defined */ H5Z_scaleoffset_get_filval_1(i, signed char, filval_buf, filval) - for(i = 0; i < d_nelmts; i++) + for(i = 0; i < d_nelmts; i++) buf[i] = (buf[i] == (((unsigned char)1 << minbits) - 1))?filval:(buf[i] + sminval); } else /* fill value undefined */ for(i = 0; i < d_nelmts; i++) buf[i] += sminval; - } - else if(type == t_short) - H5Z_scaleoffset_postdecompress_2(short, data, d_nelmts, filavail, + } + else if(type == t_short) + H5Z_scaleoffset_postdecompress_2(short, data, d_nelmts, filavail, filval_buf, minbits, sminval) - else if(type == t_int) - H5Z_scaleoffset_postdecompress_2(int, data, d_nelmts, filavail, + else if(type == t_int) + H5Z_scaleoffset_postdecompress_2(int, data, d_nelmts, filavail, filval_buf, minbits, sminval) - else if(type == t_long) - H5Z_scaleoffset_postdecompress_2(long, data, d_nelmts, filavail, + else if(type == t_long) + H5Z_scaleoffset_postdecompress_2(long, data, d_nelmts, filavail, filval_buf, minbits, sminval) - else if(type == t_long_long) - H5Z_scaleoffset_postdecompress_2(long_long, data, d_nelmts, filavail, + else if(type == t_long_long) + H5Z_scaleoffset_postdecompress_2(long_long, data, d_nelmts, filavail, filval_buf, minbits, sminval) } -/* precompress for floating-point type, variable-minimum-bits method +/* precompress for floating-point type, variable-minimum-bits method success: non-negative, failure: negative 4/15/05 */ static herr_t H5Z_scaleoffset_precompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_type type, @@ -1353,18 +1353,18 @@ unsigned filavail, const void *filval_buf, uint32_t *minbits, unsigned long_long FUNC_ENTER_NOAPI(H5Z_scaleoffset_precompress_fd, FAIL) - if(type == t_float) - H5Z_scaleoffset_precompress_3(float, data, d_nelmts, + if(type == t_float) + H5Z_scaleoffset_precompress_3(float, data, d_nelmts, filavail, filval_buf, minbits, minval, D_val) - else if(type == t_double) - H5Z_scaleoffset_precompress_3(double, data, d_nelmts, + else if(type == t_double) + H5Z_scaleoffset_precompress_3(double, data, d_nelmts, filavail, filval_buf, minbits, minval, D_val) done: FUNC_LEAVE_NOAPI(ret_value) } -/* postdecompress for floating-point type, variable-minimum-bits method +/* postdecompress for floating-point type, variable-minimum-bits method success: non-negative, failure: negative 4/15/05 */ static herr_t H5Z_scaleoffset_postdecompress_fd(void *data, unsigned d_nelmts, enum H5Z_scaleoffset_type type, @@ -1375,23 +1375,23 @@ unsigned filavail, const void *filval_buf, uint32_t minbits, unsigned long_long FUNC_ENTER_NOAPI(H5Z_scaleoffset_postdecompress_fd, FAIL) - if(type == t_float) - H5Z_scaleoffset_postdecompress_3(float, data, d_nelmts, filavail, + if(type == t_float) + H5Z_scaleoffset_postdecompress_3(float, data, d_nelmts, filavail, filval_buf, minbits, sminval, D_val) - else if(type == t_double) - H5Z_scaleoffset_postdecompress_3(double, data, d_nelmts, filavail, + else if(type == t_double) + H5Z_scaleoffset_postdecompress_3(double, data, d_nelmts, filavail, filval_buf, minbits, sminval, D_val) done: FUNC_LEAVE_NOAPI(ret_value) -} +} static void H5Z_scaleoffset_next_byte(size_t *j, int *buf_len) { ++(*j); *buf_len = 8 * sizeof(unsigned char); } -static void H5Z_scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, int k, +static void H5Z_scaleoffset_decompress_one_byte(unsigned char *data, size_t data_offset, int k, int begin_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int dtype_len) { int dat_len; /* dat_len is the number of bits to be copied in each data byte */ @@ -1399,12 +1399,12 @@ int begin_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int /* initialize value and bits of unsigned char to be copied */ val = buffer[*j]; - if(k == begin_i) + if(k == begin_i) dat_len = 8 - (dtype_len - p.minbits) % 8; - else + else dat_len = 8; - if(*buf_len > dat_len) { + if(*buf_len > dat_len) { data[data_offset + k] = ((val >> (*buf_len - dat_len)) & ~(~0 << dat_len)); *buf_len -= dat_len; @@ -1418,12 +1418,12 @@ int begin_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int val = buffer[*j]; data[data_offset + k] |= ((val >> (*buf_len - dat_len)) & ~(~0 << dat_len)); - *buf_len -= dat_len; + *buf_len -= dat_len; } } -static void H5Z_scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, - unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p) +static void H5Z_scaleoffset_decompress_one_atomic(unsigned char *data, size_t data_offset, + unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p) { /* begin_i: the index of byte having first significant bit */ int k, begin_i, dtype_len; @@ -1435,41 +1435,41 @@ static void H5Z_scaleoffset_decompress_one_atomic(unsigned char *data, size_t da if(p.mem_order == H5Z_SCALEOFFSET_ORDER_LE) { /* little endian */ begin_i = p.size - 1 - (dtype_len - p.minbits) / 8; - for(k = begin_i; k >= 0; k--) - H5Z_scaleoffset_decompress_one_byte(data, data_offset, k, begin_i, + for(k = begin_i; k >= 0; k--) + H5Z_scaleoffset_decompress_one_byte(data, data_offset, k, begin_i, buffer, j, buf_len, p, dtype_len); } if(p.mem_order == H5Z_SCALEOFFSET_ORDER_BE) { /* big endian */ begin_i = (dtype_len - p.minbits) / 8; - for(k = begin_i; k <= p.size - 1; k++) - H5Z_scaleoffset_decompress_one_byte(data, data_offset, k, begin_i, + for(k = begin_i; k <= p.size - 1; k++) + H5Z_scaleoffset_decompress_one_byte(data, data_offset, k, begin_i, buffer, j, buf_len, p, dtype_len); - } + } } -static void H5Z_scaleoffset_decompress(unsigned char *data, unsigned d_nelmts, - unsigned char *buffer, parms_atomic p) +static void H5Z_scaleoffset_decompress(unsigned char *data, unsigned d_nelmts, + unsigned char *buffer, parms_atomic p) { - /* i: index of data, j: index of buffer, + /* i: index of data, j: index of buffer, buf_len: number of bits to be filled in current byte */ size_t i, j; - int buf_len; + int buf_len; - /* must initialize to zeros */ - for(i = 0; i < d_nelmts*p.size; i++) data[i] = 0; - - /* initialization before the loop */ - j = 0; - buf_len = sizeof(unsigned char) * 8; + /* must initialize to zeros */ + for(i = 0; i < d_nelmts*p.size; i++) data[i] = 0; + + /* initialization before the loop */ + j = 0; + buf_len = sizeof(unsigned char) * 8; /* decompress */ - for(i = 0; i < d_nelmts; i++) + for(i = 0; i < d_nelmts; i++) H5Z_scaleoffset_decompress_one_atomic(data, i*p.size, buffer, &j, &buf_len, p); } -static void H5Z_scaleoffset_compress_one_byte(unsigned char *data, size_t data_offset, int k, +static void H5Z_scaleoffset_compress_one_byte(unsigned char *data, size_t data_offset, int k, int begin_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int dtype_len) { int dat_len; /* dat_len is the number of bits to be copied in each data byte */ @@ -1477,12 +1477,12 @@ int begin_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int /* initialize value and bits of unsigned char to be copied */ val = data[data_offset + k]; - if(k == begin_i) + if(k == begin_i) dat_len = 8 - (dtype_len - p.minbits) % 8; else dat_len = 8; - if(*buf_len > dat_len) { + if(*buf_len > dat_len) { buffer[*j] |= (val & ~(~0 << dat_len)) << (*buf_len - dat_len); *buf_len -= dat_len; } else { @@ -1492,12 +1492,12 @@ int begin_i, unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p, int if(dat_len == 0) return; buffer[*j] = (val & ~(~0 << dat_len)) << (*buf_len - dat_len); - *buf_len -= dat_len; + *buf_len -= dat_len; } } -static void H5Z_scaleoffset_compress_one_atomic(unsigned char *data, size_t data_offset, - unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p) +static void H5Z_scaleoffset_compress_one_atomic(unsigned char *data, size_t data_offset, + unsigned char *buffer, size_t *j, int *buf_len, parms_atomic p) { /* begin_i: the index of byte having first significant bit */ int k, begin_i, dtype_len; @@ -1509,38 +1509,38 @@ static void H5Z_scaleoffset_compress_one_atomic(unsigned char *data, size_t data if(p.mem_order == H5Z_SCALEOFFSET_ORDER_LE) { /* little endian */ begin_i = p.size - 1 - (dtype_len - p.minbits) / 8; - for(k = begin_i; k >= 0; k--) - H5Z_scaleoffset_compress_one_byte(data, data_offset, k, begin_i, + for(k = begin_i; k >= 0; k--) + H5Z_scaleoffset_compress_one_byte(data, data_offset, k, begin_i, buffer, j, buf_len, p, dtype_len); } if(p.mem_order == H5Z_SCALEOFFSET_ORDER_BE) { /* big endian */ begin_i = (dtype_len - p.minbits) / 8; - for(k = begin_i; k <= p.size - 1; k++) - H5Z_scaleoffset_compress_one_byte(data, data_offset, k, begin_i, + for(k = begin_i; k <= p.size - 1; k++) + H5Z_scaleoffset_compress_one_byte(data, data_offset, k, begin_i, buffer, j, buf_len, p, dtype_len); - } + } } -static void H5Z_scaleoffset_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, - size_t buffer_size, parms_atomic p) +static void H5Z_scaleoffset_compress(unsigned char *data, unsigned d_nelmts, unsigned char *buffer, + size_t buffer_size, parms_atomic p) { - /* i: index of data, j: index of buffer, + /* i: index of data, j: index of buffer, buf_len: number of bits to be filled in current byte */ size_t i, j; - int buf_len; + int buf_len; /* must initialize buffer to be zeros */ - for(j = 0; j < buffer_size; j++) + for(j = 0; j < buffer_size; j++) buffer[j] = 0; - /* initialization before the loop */ - j = 0; - buf_len = sizeof(unsigned char) * 8; + /* initialization before the loop */ + j = 0; + buf_len = sizeof(unsigned char) * 8; /* compress */ - for(i = 0; i < d_nelmts; i++) + for(i = 0; i < d_nelmts; i++) H5Z_scaleoffset_compress_one_atomic(data, i*p.size, buffer, &j, &buf_len, p); } #endif /* H5_HAVE_FILTER_SCALEOFFSET */ diff --git a/src/H5Zshuffle.c b/src/H5Zshuffle.c index d97676e..0082bea 100644 --- a/src/H5Zshuffle.c +++ b/src/H5Zshuffle.c @@ -106,7 +106,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 @@ -118,7 +118,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 */ @@ -202,7 +202,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 */ @@ -257,7 +257,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 d2c8416..1da1b39 100644 --- a/src/H5Zszip.c +++ b/src/H5Zszip.c @@ -127,7 +127,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 * *------------------------------------------------------------------------- @@ -190,8 +190,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 */ @@ -199,12 +199,12 @@ H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id) if(scanlinetok_type = current->tok_last_type; current->tok_begin = current->tok_last_begin; current->tok_end = current->tok_last_end; FUNC_LEAVE_NOAPI_VOID - - + + } @@ -351,12 +351,12 @@ H5Z_unget_token(H5Z_token *current) static H5Z_token * H5Z_get_token(H5Z_token *current) { - + void* ret_value=current; - + FUNC_ENTER_NOAPI(H5Z_get_token, NULL) - + /* check args */ assert(current); @@ -466,7 +466,7 @@ H5Z_get_token(H5Z_token *current) done: FUNC_LEAVE_NOAPI(ret_value) - + } @@ -485,7 +485,7 @@ void H5Z_xform_destroy_parse_tree(H5Z_node *tree) { FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5Z_xform_destroy_parse_tree) - + if (tree) { H5Z_xform_destroy_parse_tree(tree->lchild); @@ -516,20 +516,20 @@ H5Z_xform_parse(const char *expression, H5Z_datval_ptrs* dat_val_pointers) { H5Z_token tok; void* ret_value; - + FUNC_ENTER_NOAPI_NOFUNC(H5Z_xform_parse) - + if (!expression) HGOTO_DONE(NULL) - - + + /* Set up the initial H5Z_token for parsing */ tok.tok_expr = tok.tok_begin = tok.tok_end = expression; - + ret_value = (void*)H5Z_parse_expression(&tok, dat_val_pointers); H5Z_xform_reduce_tree((H5Z_node*)ret_value); - + done: FUNC_LEAVE_NOAPI(ret_value) } @@ -643,13 +643,13 @@ H5Z_parse_term(H5Z_token *current, H5Z_datval_ptrs* dat_val_pointers) { H5Z_node *term = NULL; void* ret_value; - + FUNC_ENTER_NOAPI(H5Z_parse_term, NULL); term = H5Z_parse_factor(current, dat_val_pointers); - + for (;;) { H5Z_node *new_node; - + current = H5Z_get_token(current); switch (current->tok_type) { @@ -887,7 +887,7 @@ H5Z_new_node(H5Z_token_type type) /*------------------------------------------------------------------------- * Function: H5Z_xform_eval * Purpose: If the transform is trivial, this function applies it. - * Otherwise, it calls H5Z_xform_eval_full to do the full + * Otherwise, it calls H5Z_xform_eval_full to do the full * transform. * Return: SUCCEED if transform applied succesfully, FAIL otherwise * Programmer: Leon Arber @@ -913,12 +913,12 @@ H5Z_xform_eval(H5Z_data_xform_t *data_xform_prop, void* array, size_t array_size tree=data_xform_prop->parse_root; /* Get the datatype ID for the buffer's type */ - if( (array_type = H5Z_xform_find_type(buf_type)) < 0) + if( (array_type = H5Z_xform_find_type(buf_type)) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Cannot perform data transform on this type.") /*After this point, we're assured that the type of the array is handled by the eval code, so we no * longer have to check for valid types */ - + /* If it's a trivial data transform, perform it */ if( tree->type == H5Z_XFORM_INTEGER || tree->type == H5Z_XFORM_FLOAT) { @@ -991,7 +991,7 @@ H5Z_xform_eval(H5Z_data_xform_t *data_xform_prop, void* array, size_t array_size done: if(ret_value < 0) { - /* If we ran out of memory above copying the array for temp storage (which we easily can for + /* If we ran out of memory above copying the array for temp storage (which we easily can for * polynomial transforms of high order) we free those arrays which we already allocated */ if(data_xform_prop->dat_val_pointers->num_ptrs > 1) for(i=0; idat_val_pointers->num_ptrs; i++) @@ -1030,42 +1030,42 @@ H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_ /* check args */ assert(tree); - if (tree->type == H5Z_XFORM_INTEGER) + if (tree->type == H5Z_XFORM_INTEGER) { res->type = H5Z_XFORM_INTEGER; res->value.int_val = tree->value.int_val; - } - else if (tree->type == H5Z_XFORM_FLOAT) + } + else if (tree->type == H5Z_XFORM_FLOAT) { res->type = H5Z_XFORM_FLOAT; res->value.float_val = tree->value.float_val; - } - else if (tree->type == H5Z_XFORM_SYMBOL) + } + else if (tree->type == H5Z_XFORM_SYMBOL) { res->type = H5Z_XFORM_SYMBOL; /*since dat_val stores the address of the array which is really stored in the dat_val_pointers, - * here we make dat_val store a pointer to the array itself instead of the address of it so that the + * here we make dat_val store a pointer to the array itself instead of the address of it so that the * rest of the code below works normally. */ res->value.dat_val = *((void**)(tree->value.dat_val)); - } - else + } + else { if(H5Z_xform_eval_full(tree->lchild, array_size, array_type, &resl) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while performing data transform") if(H5Z_xform_eval_full(tree->rchild, array_size, array_type, &resr) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "error while performing data transform") - res->type = H5Z_XFORM_SYMBOL; + res->type = H5Z_XFORM_SYMBOL; /* For each type of operation: * 1. See if "x" is on left hand side, right hand side, or if both sides are "x" * 2. Figure out what type of data we're going to be manipulating * 3. Do the operation on the data. */ - + switch (tree->type) { - case H5Z_XFORM_PLUS: + case H5Z_XFORM_PLUS: H5Z_XFORM_TYPE_OP(resl, resr, array_type, +=, array_size) break; @@ -1076,12 +1076,12 @@ H5Z_xform_eval_full(H5Z_node *tree, const size_t array_size, const hid_t array_ case H5Z_XFORM_MULT: H5Z_XFORM_TYPE_OP(resl, resr, array_type, *=, array_size) break; - - case H5Z_XFORM_DIVIDE: + + case H5Z_XFORM_DIVIDE: H5Z_XFORM_TYPE_OP(resl, resr, array_type, /=, array_size) break; - default: + default: HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "Invalid expression tree") } /* The result stores a pointer to the new data */ @@ -1108,7 +1108,7 @@ done: * Return: Native type of datatype that is passed in * Programmer: Leon Arber, 4/20/04 * Modifications: - * + * * *------------------------------------------------------------------------- */ @@ -1201,12 +1201,12 @@ done: */ void * H5Z_xform_copy_tree(H5Z_node* tree, H5Z_datval_ptrs* dat_val_pointers, H5Z_datval_ptrs* new_dat_val_pointers) -{ +{ H5Z_node* ret_value=NULL; FUNC_ENTER_NOAPI(H5Z_xform_copy_tree, NULL) - - assert(tree); + + assert(tree); if(tree->type == H5Z_XFORM_INTEGER) { @@ -1221,40 +1221,40 @@ H5Z_xform_copy_tree(H5Z_node* tree, H5Z_datval_ptrs* dat_val_pointers, H5Z_datva } } else if (tree->type == H5Z_XFORM_FLOAT) - { + { if ((ret_value = (H5Z_node*) H5MM_malloc(sizeof(H5Z_node))) == NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Ran out of memory trying to copy parse tree") else - { + { ret_value -> type = H5Z_XFORM_FLOAT; ret_value ->value.float_val = tree->value.float_val; ret_value -> lchild = NULL; ret_value -> rchild = NULL; - } + } } else if(tree->type == H5Z_XFORM_SYMBOL) - { + { if ((ret_value = (H5Z_node*) H5MM_malloc(sizeof(H5Z_node))) == NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "Ran out of memory trying to copy parse tree") else - { + { ret_value -> type = H5Z_XFORM_SYMBOL; ret_value -> value.dat_val = &(new_dat_val_pointers->ptr_dat_val[new_dat_val_pointers->num_ptrs]); new_dat_val_pointers->num_ptrs++; ret_value -> lchild = NULL; ret_value -> rchild = NULL; - } - } + } + } else if(tree->type == H5Z_XFORM_MULT) - H5Z_XFORM_DO_OP4(H5Z_XFORM_MULT) + H5Z_XFORM_DO_OP4(H5Z_XFORM_MULT) else if(tree->type == H5Z_XFORM_PLUS) - H5Z_XFORM_DO_OP4(H5Z_XFORM_PLUS) + H5Z_XFORM_DO_OP4(H5Z_XFORM_PLUS) else if(tree->type == H5Z_XFORM_MINUS) - H5Z_XFORM_DO_OP4(H5Z_XFORM_MINUS) + H5Z_XFORM_DO_OP4(H5Z_XFORM_MINUS) else if(tree->type == H5Z_XFORM_DIVIDE) - H5Z_XFORM_DO_OP4(H5Z_XFORM_DIVIDE) - + H5Z_XFORM_DO_OP4(H5Z_XFORM_DIVIDE) + else HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "Error in parse tree while trying to copy") @@ -1281,7 +1281,7 @@ void H5Z_xform_reduce_tree(H5Z_node* tree) { FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5Z_xform_reduce_tree) - + if(tree) { if((tree->type == H5Z_XFORM_PLUS) || (tree->type == H5Z_XFORM_DIVIDE) ||(tree->type == H5Z_XFORM_MULT) ||(tree->type == H5Z_XFORM_MINUS)) { @@ -1322,9 +1322,9 @@ H5Z_xform_reduce_tree(H5Z_node* tree) static void H5Z_do_op(H5Z_node* tree) { - + FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5Z_do_op) - + if(tree->type == H5Z_XFORM_DIVIDE) H5Z_XFORM_DO_OP3(/) @@ -1334,9 +1334,9 @@ H5Z_do_op(H5Z_node* tree) H5Z_XFORM_DO_OP3(+) else if(tree->type == H5Z_XFORM_MINUS) H5Z_XFORM_DO_OP3(-) - + FUNC_LEAVE_NOAPI_VOID; - + } @@ -1353,7 +1353,7 @@ H5Z_do_op(H5Z_node* tree) * * Date: May 4, 2004 * - * Comments: + * Comments: * * Modifications: * @@ -1374,32 +1374,32 @@ H5Z_xform_create(const char *expr) /* Allocate space for the data transform information */ if((data_xform_prop = H5MM_calloc(sizeof(H5Z_data_xform_t)))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate memory for data transform info") - + if((data_xform_prop->dat_val_pointers = HDmalloc(sizeof(H5Z_datval_ptrs))) == NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate memory for data transform array storage") - + /* copy the user's string into the property */ if((data_xform_prop->xform_exp = H5MM_xstrdup(expr))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate memory for data transform expression") - + /* Find the number of times "x" is used in this equation, and allocate room for storing that many points */ for(i=0; i 0) if((data_xform_prop->dat_val_pointers->ptr_dat_val = (void**) HDcalloc(count, sizeof(void**))) == NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate memory for pointers in transform array") /* Initialize the num_ptrs field, which will be used to keep track of the number of copies - * of the data we have for polynomial transforms */ + * of the data we have for polynomial transforms */ data_xform_prop->dat_val_pointers->num_ptrs = 0; - + /* we generate the parse tree right here and store a poitner to its root in the property. */ if((data_xform_prop->parse_root = H5Z_xform_parse(expr, data_xform_prop->dat_val_pointers))==NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to generate parse tree from expression") @@ -1424,8 +1424,8 @@ done: H5MM_xfree(data_xform_prop); } /* end if */ } /* end if */ - - FUNC_LEAVE_NOAPI(ret_value) + + FUNC_LEAVE_NOAPI(ret_value) } /* H5Z_xform_create() */ @@ -1442,7 +1442,7 @@ done: * * Date: May 4, 2004 * - * Comments: + * Comments: * * Modifications: * @@ -1463,15 +1463,15 @@ H5Z_xform_destroy(H5Z_data_xform_t *data_xform_prop) /* Free the pointers to the temp. arrays, if there are any */ if(data_xform_prop->dat_val_pointers->num_ptrs > 0) H5MM_xfree(data_xform_prop->dat_val_pointers->ptr_dat_val); - + /* Free the data storage struct */ H5MM_xfree(data_xform_prop->dat_val_pointers); - + /* Free the node */ H5MM_xfree(data_xform_prop); } /* end if */ - FUNC_LEAVE_NOAPI(SUCCEED) + FUNC_LEAVE_NOAPI(SUCCEED) } /* H5Z_xform_destroy() */ @@ -1514,29 +1514,29 @@ H5Z_xform_copy(H5Z_data_xform_t **data_xform_prop) /* Copy string */ if((new_data_xform_prop->xform_exp = H5MM_xstrdup((*data_xform_prop)->xform_exp))==NULL) HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate memory for data transform expression") - + if((new_data_xform_prop->dat_val_pointers = HDmalloc(sizeof(H5Z_datval_ptrs))) == NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate memory for data transform array storage") - + /* Find the number of times "x" is used in this equation, and allocate room for storing that many points */ for(i=0; ixform_exp); i++) { if(isalpha(new_data_xform_prop->xform_exp[i])) count++; } - + if(count > 0) if((new_data_xform_prop->dat_val_pointers->ptr_dat_val = (void**) HDcalloc(count, sizeof(void**))) == NULL) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate memory for pointers in transform array") - + /* Zero out num_pointers prior to H5Z_xform_cop_tree call; that call will increment it to the right amount */ new_data_xform_prop->dat_val_pointers->num_ptrs = 0; - + /* Copy parse tree */ if((new_data_xform_prop->parse_root = (H5Z_node*)H5Z_xform_copy_tree((*data_xform_prop)->parse_root, (*data_xform_prop)->dat_val_pointers, new_data_xform_prop->dat_val_pointers)) == NULL) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "error copying the parse tree") - + /* Sanity check * count should be the same num_ptrs */ if(count != new_data_xform_prop->dat_val_pointers->num_ptrs) @@ -1558,7 +1558,7 @@ done: } /* end if */ } /* end if */ - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* H5Z_xform_copy() */ @@ -1588,7 +1588,7 @@ H5Z_xform_noop(const H5Z_data_xform_t *data_xform_prop) ret_value=(data_xform_prop ? FALSE : TRUE); - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* H5Z_xform_noop() */ @@ -1619,9 +1619,9 @@ H5Z_xform_extract_xform_str(const H5Z_data_xform_t *data_xform_prop) * that calls this one checks to make sure it isn't before * pasing them */ assert(data_xform_prop); - + ret_value = data_xform_prop->xform_exp; - FUNC_LEAVE_NOAPI(ret_value) + FUNC_LEAVE_NOAPI(ret_value) } /* H5Z_xform_extract_xform_str() */ diff --git a/src/H5api_adpt.h b/src/H5api_adpt.h index 7312c4f..96b87dd 100644 --- a/src/H5api_adpt.h +++ b/src/H5api_adpt.h @@ -110,7 +110,7 @@ #else /*WIN32*/ #define H5_DLL #define H5_HLDLL -#define H5_HLCPPDLL +#define H5_HLCPPDLL #define HDF5_HL_F90CSTUBDLL #define H5_DLLVAR extern #define H5_DLLCPP diff --git a/src/H5detect.c b/src/H5detect.c index 1b8f635..62bdd1f 100644 --- a/src/H5detect.c +++ b/src/H5detect.c @@ -46,7 +46,7 @@ static const char *FileHeader = "\n\ * features which aren't available. We're not * running on a Vax or other machine with mixed * endianess. - * + * * Modifications: * *------------------------------------------------------------------------- @@ -75,10 +75,10 @@ typedef struct detected_t { size_t comp_align; /*alignment for structure */ } detected_t; -/* This structure holds structure alignment for pointers, hvl_t, hobj_ref_t, +/* This structure holds structure alignment for pointers, hvl_t, hobj_ref_t, * hdset_reg_ref_t */ typedef struct malign_t { - const char *name; + const char *name; size_t comp_align; /*alignment for structure */ } malign_t; @@ -86,7 +86,7 @@ typedef struct malign_t { static detected_t d_g[MAXDETECT]; static malign_t m_g[MAXDETECT]; static volatile int nd_g = 0, na_g = 0; - + static void print_results(int nd, detected_t *d, int na, malign_t *m); static void iprint(detected_t *); static int byte_cmp(int, void *, void *); @@ -127,7 +127,7 @@ static void precision (detected_t *d) { int n; - + if (0==d->msize) { /* * An integer. The permutation can have negative values at the @@ -322,7 +322,7 @@ precision (detected_t *d) * Function: DETECT_M * * Purpose: This macro takes only miscellaneous structures or pointer - * (pointer, hvl_t, hobj_ref_t, hdset_reg_ref_t). It + * (pointer, hvl_t, hobj_ref_t, hdset_reg_ref_t). It * constructs the names and decides the alignment in structure. * * Return: void @@ -462,7 +462,7 @@ sigsegv_handler(int UNUSED signo) signal(SIGSEGV, sigsegv_handler); longjmp(jbuf_g, 1); } - + /*------------------------------------------------------------------------- * Function: sigbus_handler @@ -487,7 +487,7 @@ sigbus_handler(int UNUSED signo) signal(SIGBUS, sigbus_handler); longjmp(jbuf_g, 1); } - + /*------------------------------------------------------------------------- * Function: print_results @@ -614,10 +614,10 @@ H5TN_init_interface(void)\n\ d[i].varname, (unsigned long)(d[i].align)); /* Variables for alignment of compound datatype */ - if(!strcmp(d[i].varname, "SCHAR") || !strcmp(d[i].varname, "SHORT") || - !strcmp(d[i].varname, "INT") || !strcmp(d[i].varname, "LONG") || - !strcmp(d[i].varname, "LLONG") || !strcmp(d[i].varname, "FLOAT") || - !strcmp(d[i].varname, "DOUBLE") || !strcmp(d[i].varname, "LDOUBLE")) { + if(!strcmp(d[i].varname, "SCHAR") || !strcmp(d[i].varname, "SHORT") || + !strcmp(d[i].varname, "INT") || !strcmp(d[i].varname, "LONG") || + !strcmp(d[i].varname, "LLONG") || !strcmp(d[i].varname, "FLOAT") || + !strcmp(d[i].varname, "DOUBLE") || !strcmp(d[i].varname, "LDOUBLE")) { printf(" H5T_NATIVE_%s_COMP_ALIGN_g = %lu;\n", d[i].varname, (unsigned long)(d[i].comp_align)); } @@ -632,7 +632,7 @@ H5TN_init_interface(void)\n\ printf("\n /* Structure alignment for pointers, hvl_t, hobj_ref_t, hdset_reg_ref_t */\n"); for(j=0; j0 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 dac97b9..6ccb14a 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -165,7 +165,7 @@ /*------------------------------------------------------------------------ * Purpose: Begin to collect MPE log information for a function. It should * be ahead of the actual function's process. - * + * * Programmer: Long Wang * *------------------------------------------------------------------------ @@ -203,7 +203,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 @@ -214,9 +214,9 @@ } #else /* H5_HAVE_MPE */ -#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 /* H5_HAVE_MPE */ @@ -228,11 +228,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 @@ -706,7 +706,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) @@ -904,7 +904,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 @@ -979,7 +979,7 @@ extern H5_debug_t H5_debug_g; * Programmer: Robb Matzke * * Modifications: - *------------------------------------------------------------------------- + *------------------------------------------------------------------------- */ #ifdef H5_DEBUG_API #define H5TRACE_DECL const char *RTYPE=NULL; \ @@ -1265,10 +1265,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)); \ @@ -1279,10 +1279,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 a629060..4c35554 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 diff --git a/test/b+tree.c b/test/b+tree.c index 39b174b..1c756b8 100644 --- a/test/b+tree.c +++ b/test/b+tree.c @@ -65,7 +65,7 @@ test_create(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) STACK_ERROR - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) STACK_ERROR @@ -123,7 +123,7 @@ test_insert_basic(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) STACK_ERROR - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) STACK_ERROR @@ -160,9 +160,9 @@ error: * * Purpose: Test the B+ tree code * - * Return: Success: + * Return: Success: * - * Failure: + * Failure: * * Programmer: Quincey Koziol * Tuesday, April 19, 2005 diff --git a/test/big.c b/test/big.c index 5f624b7..021b628 100644 --- a/test/big.c +++ b/test/big.c @@ -82,15 +82,15 @@ 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; } @@ -118,7 +118,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; @@ -188,7 +188,7 @@ enough_room(hid_t fapl) ret_value=0; HDunlink(name); } - + return ret_value; } @@ -226,7 +226,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 @@ -235,15 +235,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 @@ -263,7 +263,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; @@ -279,7 +279,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; @@ -437,11 +437,11 @@ usage(void) /*------------------------------------------------------------------------- * Function: main * - * Purpose: + * Purpose: * - * Return: Success: + * Return: Success: * - * Failure: + * Failure: * * Programmer: Robb Matzke * Friday, April 10, 1998 @@ -462,7 +462,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; @@ -544,7 +544,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 872a01a..a44da2a 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; i= 0) { H5_FAILED(); @@ -425,7 +425,7 @@ test_increment (void) size_t offset, size; int i, j; ssize_t n; - + TESTING("bit increment operations"); for (i=0; ir)"); @@ -567,7 +567,7 @@ test_insert_level1_2leaf_redistrib(hid_t fapl) PASSED(); /* - * Create v2 B-tree + * Create v2 B-tree */ if (H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, 512, 8, 100, 40, &bt2_addr/*out*/)<0) { H5_FAILED(); @@ -576,7 +576,7 @@ test_insert_level1_2leaf_redistrib(hid_t fapl) } /* - * Test inserting many records into v2 B-tree + * Test inserting many records into v2 B-tree */ TESTING("B-tree insert: redistribute 2 leaves in level 1 B-tree (r->l)"); @@ -647,7 +647,7 @@ test_insert_level1_2leaf_split(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -655,7 +655,7 @@ test_insert_level1_2leaf_split(hid_t fapl) } /* - * Create v2 B-tree + * Create v2 B-tree */ if (H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, 512, 8, 100, 40, &bt2_addr/*out*/)<0) { H5_FAILED(); @@ -664,7 +664,7 @@ test_insert_level1_2leaf_split(hid_t fapl) } /* - * Test inserting many records into v2 B-tree + * Test inserting many records into v2 B-tree */ TESTING("B-tree insert: split 2 leaves to 3 in level 1 B-tree (l->r)"); @@ -690,7 +690,7 @@ test_insert_level1_2leaf_split(hid_t fapl) PASSED(); /* - * Create v2 B-tree + * Create v2 B-tree */ if (H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, 512, 8, 100, 40, &bt2_addr/*out*/)<0) { H5_FAILED(); @@ -699,7 +699,7 @@ test_insert_level1_2leaf_split(hid_t fapl) } /* - * Test inserting many records into v2 B-tree + * Test inserting many records into v2 B-tree */ TESTING("B-tree insert: split 2 leaves to 3 in level 1 B-tree (r->l)"); @@ -772,7 +772,7 @@ test_insert_level1_3leaf_redistrib(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -780,7 +780,7 @@ test_insert_level1_3leaf_redistrib(hid_t fapl) } /* - * Create v2 B-tree + * Create v2 B-tree */ if (H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, 512, 8, 100, 40, &bt2_addr/*out*/)<0) { H5_FAILED(); @@ -789,7 +789,7 @@ test_insert_level1_3leaf_redistrib(hid_t fapl) } /* - * Test inserting many records into v2 B-tree + * Test inserting many records into v2 B-tree */ TESTING("B-tree insert: redistribute 3 leaves in level 1 B-tree"); @@ -873,7 +873,7 @@ test_insert_level1_3leaf_split(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -881,7 +881,7 @@ test_insert_level1_3leaf_split(hid_t fapl) } /* - * Create v2 B-tree + * Create v2 B-tree */ if (H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, 512, 8, 100, 40, &bt2_addr/*out*/)<0) { H5_FAILED(); @@ -890,7 +890,7 @@ test_insert_level1_3leaf_split(hid_t fapl) } /* - * Test inserting many records into v2 B-tree + * Test inserting many records into v2 B-tree */ TESTING("B-tree insert: split 3 leaves to 4 in level 1 B-tree"); @@ -960,7 +960,7 @@ test_insert_make_level2(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -968,7 +968,7 @@ test_insert_make_level2(hid_t fapl) } /* - * Create v2 B-tree + * Create v2 B-tree */ if (H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, 512, 8, 100, 40, &bt2_addr/*out*/)<0) { H5_FAILED(); @@ -977,7 +977,7 @@ test_insert_make_level2(hid_t fapl) } /* - * Test inserting many records into v2 B-tree + * Test inserting many records into v2 B-tree */ TESTING("B-tree insert: make level 2 B-tree"); @@ -1126,7 +1126,7 @@ test_insert_level2_leaf_redistrib(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -1134,7 +1134,7 @@ test_insert_level2_leaf_redistrib(hid_t fapl) } /* - * Create v2 B-tree + * Create v2 B-tree */ if (H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, 512, 8, 100, 40, &bt2_addr/*out*/)<0) { H5_FAILED(); @@ -1143,7 +1143,7 @@ test_insert_level2_leaf_redistrib(hid_t fapl) } /* - * Test inserting many records into v2 B-tree + * Test inserting many records into v2 B-tree */ TESTING("B-tree insert: redistrib right-most leaf in level 2 B-tree"); @@ -1252,7 +1252,7 @@ test_insert_level2_leaf_split(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -1260,7 +1260,7 @@ test_insert_level2_leaf_split(hid_t fapl) } /* - * Create v2 B-tree + * Create v2 B-tree */ if (H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, 512, 8, 100, 40, &bt2_addr/*out*/)<0) { H5_FAILED(); @@ -1269,7 +1269,7 @@ test_insert_level2_leaf_split(hid_t fapl) } /* - * Test inserting many records into v2 B-tree + * Test inserting many records into v2 B-tree */ TESTING("B-tree insert: split right-most leaf in level 2 B-tree"); @@ -1379,7 +1379,7 @@ test_insert_level2_2internal_redistrib(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -1387,7 +1387,7 @@ test_insert_level2_2internal_redistrib(hid_t fapl) } /* - * Create v2 B-tree + * Create v2 B-tree */ if (H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, 512, 8, 100, 40, &bt2_addr/*out*/)<0) { H5_FAILED(); @@ -1396,7 +1396,7 @@ test_insert_level2_2internal_redistrib(hid_t fapl) } /* - * Test inserting many records into v2 B-tree + * Test inserting many records into v2 B-tree */ TESTING("B-tree insert: redist. 2 internal (r->l) in level 2 B-tree"); @@ -1484,7 +1484,7 @@ test_insert_level2_2internal_split(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -1492,7 +1492,7 @@ test_insert_level2_2internal_split(hid_t fapl) } /* - * Create v2 B-tree + * Create v2 B-tree */ if (H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, 512, 8, 100, 40, &bt2_addr/*out*/)<0) { H5_FAILED(); @@ -1501,7 +1501,7 @@ test_insert_level2_2internal_split(hid_t fapl) } /* - * Test inserting many records into v2 B-tree + * Test inserting many records into v2 B-tree */ TESTING("B-tree insert: split 2 internals to 3 in level 2 B-tree (r->l)"); @@ -1590,7 +1590,7 @@ test_insert_level2_3internal_redistrib(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -1598,7 +1598,7 @@ test_insert_level2_3internal_redistrib(hid_t fapl) } /* - * Create v2 B-tree + * Create v2 B-tree */ if (H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, 512, 8, 100, 40, &bt2_addr/*out*/)<0) { H5_FAILED(); @@ -1607,7 +1607,7 @@ test_insert_level2_3internal_redistrib(hid_t fapl) } /* - * Test inserting many records into v2 B-tree + * Test inserting many records into v2 B-tree */ TESTING("B-tree insert: redistrib 3 internals in level 2 B-tree"); @@ -1693,7 +1693,7 @@ test_insert_level2_3internal_split(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -1701,7 +1701,7 @@ test_insert_level2_3internal_split(hid_t fapl) } /* - * Create v2 B-tree + * Create v2 B-tree */ if (H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, 512, 8, 100, 40, &bt2_addr/*out*/)<0) { H5_FAILED(); @@ -1710,7 +1710,7 @@ test_insert_level2_3internal_split(hid_t fapl) } /* - * Test inserting many records into v2 B-tree + * Test inserting many records into v2 B-tree */ TESTING("B-tree insert: split 3 internals to 4 in level 2 B-tree"); @@ -1822,7 +1822,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -1830,7 +1830,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); } /* - * Create v2 B-tree + * Create v2 B-tree */ if (H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, 512, 8, 100, 40, &bt2_addr/*out*/)<0) { H5_FAILED(); @@ -1839,7 +1839,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); } /* - * Test inserting many records into v2 B-tree + * Test inserting many records into v2 B-tree */ TESTING("B-tree insert: create random level 4 B-tree"); @@ -1974,7 +1974,7 @@ test_remove_basic(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -2304,7 +2304,7 @@ test_remove_level1_noredistrib(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -2487,7 +2487,7 @@ test_remove_level1_redistrib(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -2655,7 +2655,7 @@ test_remove_level1_2leaf_merge(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -2809,7 +2809,7 @@ test_remove_level1_3leaf_merge(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -2925,7 +2925,7 @@ test_remove_level1_promote(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -3087,7 +3087,7 @@ test_remove_level1_promote_2leaf_redistrib(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -3225,7 +3225,7 @@ test_remove_level1_promote_3leaf_redistrib(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -3363,7 +3363,7 @@ test_remove_level1_promote_2leaf_merge(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -3501,7 +3501,7 @@ test_remove_level1_promote_3leaf_merge(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -3639,7 +3639,7 @@ test_remove_level1_collapse(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -3755,7 +3755,7 @@ test_remove_level2_promote(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -3961,7 +3961,7 @@ test_remove_level2_promote_2internal_redistrib(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -4097,7 +4097,7 @@ test_remove_level2_promote_3internal_redistrib(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -4233,7 +4233,7 @@ test_remove_level2_promote_2internal_merge(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -4369,7 +4369,7 @@ test_remove_level2_promote_3internal_merge(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -4505,7 +4505,7 @@ test_remove_level2_2internal_merge_left(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -4621,7 +4621,7 @@ test_remove_level2_2internal_merge_right(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -4737,7 +4737,7 @@ test_remove_level2_3internal_merge(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -4853,7 +4853,7 @@ test_remove_level2_collapse_right(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -4997,7 +4997,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -5005,7 +5005,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); } /* - * Create v2 B-tree + * Create v2 B-tree */ if (H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, 512, 8, 100, 40, &bt2_addr/*out*/)<0) { H5_FAILED(); @@ -5014,7 +5014,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); } /* - * Test inserting many records into v2 B-tree + * Test inserting many records into v2 B-tree */ TESTING("B-tree remove: create random level 4 B-tree and delete all records"); @@ -5120,7 +5120,7 @@ test_find_neighbor(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -5128,7 +5128,7 @@ test_find_neighbor(hid_t fapl) } /* - * Create v2 B-tree + * Create v2 B-tree */ if (H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, 512, 8, 100, 40, &bt2_addr/*out*/)<0) { H5_FAILED(); @@ -5306,7 +5306,7 @@ test_delete(hid_t fapl) } /* end if */ /* - * Create v2 B-tree + * Create v2 B-tree */ if (H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, 512, 8, 100, 40, &bt2_addr/*out*/)<0) { H5_FAILED(); @@ -5315,7 +5315,7 @@ test_delete(hid_t fapl) } /* end if */ /* - * Delete v2 B-tree + * Delete v2 B-tree */ if (H5B2_delete(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr)<0) { H5_FAILED(); @@ -5346,7 +5346,7 @@ test_delete(hid_t fapl) } /* end if */ /* - * Create v2 B-tree + * Create v2 B-tree */ if (H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, 512, 8, 100, 40, &bt2_addr/*out*/)<0) { H5_FAILED(); @@ -5365,7 +5365,7 @@ test_delete(hid_t fapl) } /* end for */ /* - * Delete v2 B-tree + * Delete v2 B-tree */ if (H5B2_delete(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr)<0) { H5_FAILED(); @@ -5396,7 +5396,7 @@ test_delete(hid_t fapl) } /* end if */ /* - * Create v2 B-tree + * Create v2 B-tree */ if (H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, 512, 8, 100, 40, &bt2_addr/*out*/)<0) { H5_FAILED(); @@ -5415,7 +5415,7 @@ test_delete(hid_t fapl) } /* end for */ /* - * Delete v2 B-tree + * Delete v2 B-tree */ if (H5B2_delete(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr)<0) { H5_FAILED(); @@ -5446,7 +5446,7 @@ test_delete(hid_t fapl) } /* end if */ /* - * Create v2 B-tree + * Create v2 B-tree */ if (H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, 512, 8, 100, 40, &bt2_addr/*out*/)<0) { H5_FAILED(); @@ -5465,7 +5465,7 @@ test_delete(hid_t fapl) } /* end for */ /* - * Delete v2 B-tree + * Delete v2 B-tree */ if (H5B2_delete(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr)<0) { H5_FAILED(); @@ -5527,7 +5527,7 @@ test_modify(hid_t fapl) /* Create the file to work on */ if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR; - + /* Get a pointer to the internal file object */ if (NULL==(f=H5I_object(file))) { H5Eprint_stack(H5E_DEFAULT, stdout); @@ -5535,7 +5535,7 @@ test_modify(hid_t fapl) } /* end if */ /* - * Create v2 B-tree + * Create v2 B-tree */ if (H5B2_create(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, 512, 8, 100, 40, &bt2_addr/*out*/)<0) { H5_FAILED(); @@ -5642,9 +5642,9 @@ error: * * Purpose: Test the B-tree v2 code * - * Return: Success: + * Return: Success: * - * Failure: + * Failure: * * Programmer: Quincey Koziol * Tuesday, February 1, 2005 diff --git a/test/cache.c b/test/cache.c index c53d8aa..1ee2c22 100644 --- a/test/cache.c +++ b/test/cache.c @@ -15,7 +15,7 @@ /* Programmer: John Mainzer * 6/9/04 * - * This file contains tests for the cache implemented in + * This file contains tests for the cache implemented in * H5C.c */ #include "h5test.h" @@ -108,20 +108,20 @@ const char *FILENAME[] = { #define MONSTER_ALT_BASE_ADDR (haddr_t)(HUGE_ALT_BASE_ADDR + \ (HUGE_ENTRY_SIZE * NUM_HUGE_ENTRIES)) -typedef struct test_entry_t +typedef struct test_entry_t { - H5C_cache_entry_t header; /* entry data used by the cache - * -- must be first + H5C_cache_entry_t header; /* entry data used by the cache + * -- must be first */ struct test_entry_t * self; /* pointer to this entry -- used for * sanity checking. */ - haddr_t addr; /* where the cache thinks this entry - * is located + haddr_t addr; /* where the cache thinks this entry + * is located */ hbool_t at_main_addr; /* boolean flag indicating whether * the entry is supposed to be at - * either its main or alternate + * either its main or alternate * address. */ haddr_t main_addr; /* initial location of the entry @@ -129,33 +129,33 @@ typedef struct test_entry_t haddr_t alt_addr; /* location to which the entry * can be relocated or "renamed" */ - size_t size; /* how big the cache thinks this - * entry is + size_t size; /* how big the cache thinks this + * entry is */ - int32_t type; /* indicates which entry array this - * entry is in + int32_t type; /* indicates which entry array this + * entry is in */ - int32_t index; /* index in its entry array + int32_t index; /* index in its entry array */ int32_t reads; /* number of times this entry has * been loaded. */ - int32_t writes; /* number of times this entry has - * been written + int32_t writes; /* number of times this entry has + * been written */ - hbool_t is_dirty; /* entry has been modified since - * last write + hbool_t is_dirty; /* entry has been modified since + * last write */ - hbool_t is_protected; /* entry should currently be on + hbool_t is_protected; /* entry should currently be on * the cache's protected list. */ - hbool_t loaded; /* entry has been loaded since the + hbool_t loaded; /* entry has been loaded since the * last time it was reset. */ - hbool_t cleared; /* entry has been cleared since the + hbool_t cleared; /* entry has been cleared since the * last time it was reset. */ - hbool_t flushed; /* entry has been flushed since the + hbool_t flushed; /* entry has been flushed since the * last time it was reset. */ hbool_t destroyed; /* entry has been destroyed since the @@ -163,7 +163,7 @@ typedef struct test_entry_t */ } test_entry_t; -/* The following is a cut down copy of the hash table manipulation +/* The following is a cut down copy of the hash table manipulation * macros from H5C.c, which have been further modified to avoid references * to the error reporting macros. Needless to say, these macros must be * updated as necessary. @@ -300,11 +300,11 @@ const size_t entry_sizes[NUMBER_OF_ENTRY_TYPES] = PICO_ENTRY_SIZE, NANO_ENTRY_SIZE, MICRO_ENTRY_SIZE, - TINY_ENTRY_SIZE, + TINY_ENTRY_SIZE, SMALL_ENTRY_SIZE, MEDIUM_ENTRY_SIZE, LARGE_ENTRY_SIZE, - HUGE_ENTRY_SIZE, + HUGE_ENTRY_SIZE, MONSTER_ENTRY_SIZE }; @@ -380,49 +380,49 @@ herr_t huge_dest(H5F_t * f, void * thing); herr_t monster_dest(H5F_t * f, void * thing); -static herr_t flush(H5F_t *f, hid_t UNUSED dxpl_id, hbool_t dest, +static herr_t flush(H5F_t *f, hid_t UNUSED dxpl_id, hbool_t dest, haddr_t addr, void *thing); -herr_t pico_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, +herr_t pico_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, void *thing); -herr_t nano_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, +herr_t nano_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, void *thing); -herr_t micro_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, +herr_t micro_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, void *thing); -herr_t tiny_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, +herr_t tiny_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, void *thing); -herr_t small_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, +herr_t small_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, void *thing); -herr_t medium_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, +herr_t medium_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, void *thing); -herr_t large_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, +herr_t large_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, void *thing); -herr_t huge_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, +herr_t huge_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, void *thing); -herr_t monster_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, +herr_t monster_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, void *thing); static void * load(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr, const void UNUSED *udata1, void UNUSED *udata2); -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); -void * nano_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, +void * nano_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *udata1, void *udata2); -void * micro_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, +void * micro_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *udata1, void *udata2); -void * tiny_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, +void * tiny_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *udata1, void *udata2); -void * small_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, +void * small_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *udata1, void *udata2); -void * medium_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, +void * medium_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *udata1, void *udata2); -void * large_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, +void * large_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *udata1, void *udata2); -void * huge_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, +void * huge_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *udata1, void *udata2); -void * monster_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, +void * monster_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *udata1, void *udata2); @@ -520,19 +520,19 @@ static const H5C_class_t types[NUMBER_OF_ENTRY_TYPES] = /* private function declarations: */ -static void addr_to_type_and_index(haddr_t addr, - int32_t * type_ptr, +static void addr_to_type_and_index(haddr_t addr, + int32_t * type_ptr, int32_t * index_ptr); #if 0 /* keep this for a while -- it may be useful */ -static haddr_t type_and_index_to_addr(int32_t type, +static haddr_t type_and_index_to_addr(int32_t type, int32_t idx); #endif static void insert_entry(H5C_t * cache_ptr, int32_t type, int32_t idx, - hbool_t dirty, + hbool_t dirty, unsigned int flags); static void rename_entry(H5C_t * cache_ptr, @@ -680,8 +680,8 @@ static void check_auto_cache_resize_epoch_markers(void); static void check_auto_cache_resize_input_errs(void); static void check_auto_cache_resize_aux_fcns(void); -static void takedown_cache(H5C_t * cache_ptr, - hbool_t dump_stats, +static void takedown_cache(H5C_t * cache_ptr, + hbool_t dump_stats, hbool_t dump_detailed_stats); static void flush_cache(H5C_t * cache_ptr, @@ -733,7 +733,7 @@ static void check_file_mdc_api_errs(void); /*------------------------------------------------------------------------- * Function: addr_to_type_and_index * - * Purpose: Given an address, compute the type and index of the + * Purpose: Given an address, compute the type and index of the * associated entry. * * Return: void @@ -757,7 +757,7 @@ addr_to_type_and_index(haddr_t addr, HDassert( type_ptr ); HDassert( index_ptr ); - /* we only have a small number of entry types, so just do a + /* we only have a small number of entry types, so just do a * linear search. If NUMBER_OF_ENTRY_TYPES grows, we may want * to do a binary search instead. */ @@ -808,13 +808,13 @@ addr_to_type_and_index(haddr_t addr, } /* addr_to_type_and_index() */ -#if 0 /* This function has never been used, but we may want it +#if 0 /* This function has never been used, but we may want it * some time. Lets keep it for now. */ /*------------------------------------------------------------------------- * Function: type_and_index_to_addr * - * Purpose: Given a type and index of an entry, compute the associated + * Purpose: Given a type and index of an entry, compute the associated * addr and return that value. * * Return: computed addr @@ -896,7 +896,7 @@ check_write_permitted(const H5F_t UNUSED * f, /*------------------------------------------------------------------------- * Function: clear & friends * - * Purpose: clear the entry. The helper functions verify that the + * Purpose: clear the entry. The helper functions verify that the * correct version of clear is being called, and then call * clear proper. * @@ -910,7 +910,7 @@ check_write_permitted(const H5F_t UNUSED * f, *------------------------------------------------------------------------- */ -static herr_t +static herr_t clear(H5F_t * f, void * thing, hbool_t dest) @@ -946,74 +946,74 @@ clear(H5F_t * f, } /* clear() */ -herr_t +herr_t pico_clear(H5F_t * f, void * thing, hbool_t dest) { HDassert ( ((test_entry_t *)thing)->type == 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. * @@ -1027,7 +1027,7 @@ monster_clear(H5F_t * f, void * thing, hbool_t dest) *------------------------------------------------------------------------- */ -static herr_t +static herr_t destroy(H5F_t UNUSED * f, void * thing) { @@ -1056,75 +1056,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 @@ -1137,7 +1137,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, @@ -1187,74 +1187,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. * @@ -1306,75 +1306,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 @@ -1387,7 +1387,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) @@ -1414,68 +1414,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)); -} +} /**************************************************************************/ @@ -1487,7 +1487,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. @@ -1660,7 +1660,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++; } } @@ -1681,7 +1681,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. @@ -1717,12 +1717,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++; } } @@ -1763,7 +1763,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, @@ -1825,7 +1825,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 @@ -1854,12 +1854,12 @@ 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, H5C__FLUSH_INVALIDATE_FLAG); } else { - result = H5C_flush_cache(NULL, -1, -1, cache_ptr, + result = H5C_flush_cache(NULL, -1, -1, cache_ptr, H5C__NO_FLAGS_SET); } } @@ -1900,11 +1900,11 @@ flush_cache(H5C_t * cache_ptr, * Modifications: * * JRM -- 1/13/05 - * Updated function for the flags parameter in + * Updated function for the flags parameter in * H5C_insert_entry(), and to allow access to this parameter. * * JRM -- 6/17/05 - * The interface no longer permits clean inserts. + * The interface no longer permits clean inserts. * Accordingly, the dirty parameter is no longer meaningfull. * *------------------------------------------------------------------------- @@ -1914,7 +1914,7 @@ static void insert_entry(H5C_t * cache_ptr, int32_t type, int32_t idx, - hbool_t dirty, + hbool_t dirty, unsigned int flags) { herr_t result; @@ -1949,7 +1949,7 @@ insert_entry(H5C_t * cache_ptr, pass = FALSE; failure_mssg = "error in H5C_insert()."; -#if 0 +#if 0 /* This is useful debugging code. Lets keep it around. */ HDfprintf(stdout, "result = %d\n", (int)result); @@ -1957,10 +1957,10 @@ insert_entry(H5C_t * cache_ptr, (int)(entry_ptr->header.is_protected)); HDfprintf(stdout, "entry_ptr->header.type != &(types[type]) = %d\n", (int)(entry_ptr->header.type != &(types[type]))); - HDfprintf(stdout, + HDfprintf(stdout, "entry_ptr->size != entry_ptr->header.size = %d\n", (int)(entry_ptr->size != entry_ptr->header.size)); - HDfprintf(stdout, + HDfprintf(stdout, "entry_ptr->addr != entry_ptr->header.addr = %d\n", (int)(entry_ptr->addr != entry_ptr->header.addr)); #endif @@ -2022,7 +2022,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 */ @@ -2032,7 +2032,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 */ @@ -2125,9 +2125,9 @@ protect_entry(H5C_t * cache_ptr, ( entry_ptr->size != entry_ptr->header.size ) || ( entry_ptr->addr != entry_ptr->header.addr ) ) { -#if 0 - /* I've written the following debugging code several times - * now. Lets keep it around so I don't have to write it +#if 0 + /* I've written the following debugging code several times + * now. Lets keep it around so I don't have to write it * again. * - JRM */ @@ -2137,10 +2137,10 @@ protect_entry(H5C_t * cache_ptr, (long)cache_entry_ptr, (long)entry_ptr); HDfprintf(stdout, "entry_ptr->header.is_protected = %d\n", (int)(entry_ptr->header.is_protected)); - HDfprintf(stdout, + HDfprintf(stdout, "( entry_ptr->header.type != &(types[type]) ) = %d\n", (int)( entry_ptr->header.type != &(types[type]) )); - HDfprintf(stdout, + HDfprintf(stdout, "entry_ptr->size = %d, entry_ptr->header.size = %d\n", (int)(entry_ptr->size), (int)(entry_ptr->header.size)); HDfprintf(stdout, @@ -2179,11 +2179,11 @@ protect_entry(H5C_t * cache_ptr, * Modifications: * * JRM -- 1/7/05 - * Updated for the replacement of the deleted parameter in + * Updated for the replacement of the deleted parameter in * H5C_unprotect() with the new flags parameter. * * JRM - 6/17/05 - * Modified function to use the new dirtied parameter of + * Modified function to use the new dirtied parameter of * H5C_unprotect(). * *------------------------------------------------------------------------- @@ -2225,7 +2225,7 @@ unprotect_entry(H5C_t * cache_ptr, } result = H5C_unprotect(NULL, -1, -1, cache_ptr, &(types[type]), - entry_ptr->addr, (void *)entry_ptr, + entry_ptr->addr, (void *)entry_ptr, flags); if ( ( result < 0 ) || @@ -2340,9 +2340,9 @@ 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, + unprotect_entry(cache_ptr, type, idx+lag-2, NO_CHANGE, H5C__NO_FLAGS_SET); } @@ -2351,7 +2351,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); } @@ -2373,14 +2373,14 @@ row_major_scan_forward(H5C_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag - 5)); - unprotect_entry(cache_ptr, type, idx+lag-5, NO_CHANGE, + unprotect_entry(cache_ptr, type, idx+lag-5, NO_CHANGE, H5C__NO_FLAGS_SET); } 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); } @@ -2393,7 +2393,7 @@ row_major_scan_forward(H5C_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag + 2)); - unprotect_entry(cache_ptr, type, idx-lag+2, NO_CHANGE, + unprotect_entry(cache_ptr, type, idx-lag+2, NO_CHANGE, H5C__NO_FLAGS_SET); } @@ -2428,7 +2428,7 @@ row_major_scan_forward(H5C_t * cache_ptr, } else { unprotect_entry(cache_ptr, type, idx - lag, - dirty_unprotects, + dirty_unprotects, H5C__NO_FLAGS_SET); } break; @@ -2446,7 +2446,7 @@ row_major_scan_forward(H5C_t * cache_ptr, } else { unprotect_entry(cache_ptr, type, idx - lag, - dirty_destroys, + dirty_destroys, H5C__DELETED_FLAG); } break; @@ -2465,11 +2465,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, H5C__NO_FLAGS_SET); } } - + if ( verbose ) HDfprintf(stdout, "\n"); @@ -2492,7 +2492,7 @@ row_major_scan_forward(H5C_t * cache_ptr, * Function: hl_row_major_scan_forward() * * Purpose: Do a high locality sequence of inserts, protects, and - * unprotects while scanning through the set of entries. + * unprotects while scanning through the set of entries. * If pass is false on entry, do nothing. * * Return: void @@ -2573,7 +2573,7 @@ hl_row_major_scan_forward(H5C_t * cache_ptr, protect_entry(cache_ptr, type, i); if ( verbose ) - HDfprintf(stdout, "(u, %d, %d) ", type, i); + HDfprintf(stdout, "(u, %d, %d) ", type, i); unprotect_entry(cache_ptr, type, i, NO_CHANGE, H5C__NO_FLAGS_SET); @@ -2603,7 +2603,7 @@ hl_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 @@ -2631,7 +2631,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; @@ -2681,9 +2681,9 @@ 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, + unprotect_entry(cache_ptr, type, idx-lag+2, NO_CHANGE, H5C__NO_FLAGS_SET); } @@ -2692,7 +2692,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); } @@ -2714,14 +2714,14 @@ row_major_scan_backward(H5C_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, (idx - lag + 5)); - unprotect_entry(cache_ptr, type, idx-lag+5, NO_CHANGE, + unprotect_entry(cache_ptr, type, idx-lag+5, NO_CHANGE, H5C__NO_FLAGS_SET); } 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); } @@ -2734,7 +2734,7 @@ row_major_scan_backward(H5C_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, (idx + lag - 2)); - unprotect_entry(cache_ptr, type, idx+lag-2, NO_CHANGE, + unprotect_entry(cache_ptr, type, idx+lag-2, NO_CHANGE, H5C__NO_FLAGS_SET); } @@ -2764,7 +2764,7 @@ row_major_scan_backward(H5C_t * cache_ptr, } else { unprotect_entry(cache_ptr, type, idx + lag, - dirty_unprotects, + dirty_unprotects, H5C__NO_FLAGS_SET); } break; @@ -2782,7 +2782,7 @@ row_major_scan_backward(H5C_t * cache_ptr, } else { unprotect_entry(cache_ptr, type, idx + lag, - dirty_destroys, + dirty_destroys, H5C__DELETED_FLAG); } break; @@ -2805,11 +2805,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, H5C__NO_FLAGS_SET); } } - + if ( verbose ) HDfprintf(stdout, "\n"); @@ -2832,7 +2832,7 @@ row_major_scan_backward(H5C_t * cache_ptr, * Function: hl_row_major_scan_backward() * * Purpose: Do a high locality sequence of inserts, protects, and - * unprotects while scanning through the set of entries. + * unprotects while scanning through the set of entries. * If pass is false on entry, do nothing. * * Return: void @@ -2913,9 +2913,9 @@ hl_row_major_scan_backward(H5C_t * cache_ptr, protect_entry(cache_ptr, type, i); if ( verbose ) - HDfprintf(stdout, "(u, %d, %d) ", type, i); + HDfprintf(stdout, "(u, %d, %d) ", type, i); - unprotect_entry(cache_ptr, type, i, NO_CHANGE, + unprotect_entry(cache_ptr, type, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i--; @@ -3017,10 +3017,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, H5C__NO_FLAGS_SET); } - + if ( verbose ) HDfprintf(stdout, "\n"); @@ -3043,7 +3043,7 @@ col_major_scan_forward(H5C_t * cache_ptr, /*------------------------------------------------------------------------- * Function: hl_col_major_scan_forward() * - * Purpose: Do a high locality sequence of inserts, protects, and + * Purpose: Do a high locality sequence of inserts, protects, and * unprotects while scanning through the set of entries. If * pass is false on entry, do nothing. * @@ -3135,10 +3135,10 @@ hl_col_major_scan_forward(H5C_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, i); - unprotect_entry(cache_ptr, type, i, + unprotect_entry(cache_ptr, type, i, dirty_unprotects, H5C__NO_FLAGS_SET); } - + if ( verbose ) HDfprintf(stdout, "\n"); @@ -3165,7 +3165,7 @@ hl_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 @@ -3242,10 +3242,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, H5C__NO_FLAGS_SET); } - + if ( verbose ) HDfprintf(stdout, "\n"); @@ -3274,8 +3274,8 @@ col_major_scan_backward(H5C_t * cache_ptr, /*------------------------------------------------------------------------- * Function: hl_col_major_scan_backward() * - * Purpose: Do a high locality sequence of inserts, protects, and - * unprotects while scanning backwards through the set of + * Purpose: Do a high locality sequence of inserts, protects, and + * unprotects while scanning backwards through the set of * entries. If pass is false on entry, do nothing. * * Return: void @@ -3365,10 +3365,10 @@ hl_col_major_scan_backward(H5C_t * cache_ptr, if ( verbose ) HDfprintf(stdout, "(u, %d, %d) ", type, i); - unprotect_entry(cache_ptr, type, i, + unprotect_entry(cache_ptr, type, i, dirty_unprotects, H5C__NO_FLAGS_SET); } - + if ( verbose ) HDfprintf(stdout, "\n"); @@ -3400,8 +3400,8 @@ hl_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 @@ -3445,20 +3445,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, @@ -3476,7 +3476,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, @@ -3494,7 +3494,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, @@ -3512,18 +3512,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, @@ -3537,18 +3537,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, @@ -3562,13 +3562,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(); @@ -3577,7 +3577,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() */ @@ -3586,9 +3586,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 @@ -3632,20 +3632,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, @@ -3663,7 +3663,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, @@ -3681,7 +3681,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, @@ -3699,18 +3699,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, @@ -3724,18 +3724,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, @@ -3749,13 +3749,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(); @@ -3764,7 +3764,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() */ @@ -3773,9 +3773,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 * @@ -3818,20 +3818,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, @@ -3849,7 +3849,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, @@ -3867,7 +3867,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, @@ -3885,18 +3885,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, @@ -3910,18 +3910,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, @@ -3935,13 +3935,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(); @@ -3950,7 +3950,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() */ @@ -3960,8 +3960,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 @@ -4005,20 +4005,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, @@ -4036,7 +4036,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, @@ -4054,7 +4054,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, @@ -4072,18 +4072,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, @@ -4097,18 +4097,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, @@ -4122,13 +4122,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(); @@ -4137,7 +4137,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() */ @@ -4146,10 +4146,10 @@ smoke_check_4(void) /*------------------------------------------------------------------------- * Function: smoke_check_5() * - * Purpose: A basic functional test on a cache with automatic cache - * resizing enabled, with inserts in the mix, along with - * repeated protects and unprotects. All entries are marked - * as clean. + * Purpose: A basic functional test on a cache with automatic cache + * resizing enabled, with inserts in the mix, along with + * repeated protects and unprotects. All entries are marked + * as clean. * * Return: void * @@ -4240,13 +4240,13 @@ smoke_check_5(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), @@ -4264,7 +4264,7 @@ smoke_check_5(void) } if ( show_progress ) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); hl_row_major_scan_forward(/* cache_ptr */ cache_ptr, @@ -4277,7 +4277,7 @@ smoke_check_5(void) /* dirty_inserts */ dirty_inserts); if ( show_progress ) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); hl_row_major_scan_backward(/* cache_ptr */ cache_ptr, @@ -4290,7 +4290,7 @@ smoke_check_5(void) /* dirty_inserts */ dirty_inserts); if ( show_progress ) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); hl_row_major_scan_forward(/* cache_ptr */ cache_ptr, @@ -4303,18 +4303,18 @@ smoke_check_5(void) /* dirty_inserts */ dirty_inserts); 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); hl_col_major_scan_forward(/* cache_ptr */ cache_ptr, @@ -4328,18 +4328,18 @@ smoke_check_5(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); hl_col_major_scan_backward(/* cache_ptr */ cache_ptr, @@ -4353,13 +4353,13 @@ smoke_check_5(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(); @@ -4368,7 +4368,7 @@ smoke_check_5(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_5() */ @@ -4377,10 +4377,10 @@ smoke_check_5(void) /*------------------------------------------------------------------------- * Function: smoke_check_6() * - * Purpose: A basic functional test on a cache with automatic cache - * resizing enabled, with inserts in the mix, along with + * Purpose: A basic functional test on a cache with automatic cache + * resizing enabled, with inserts in the mix, along with * repeated protects and unprotects. About one half of all - * entries are marked as dirty. + * entries are marked as dirty. * * Return: void * @@ -4471,13 +4471,13 @@ smoke_check_6(void) } 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), @@ -4495,7 +4495,7 @@ smoke_check_6(void) } if ( show_progress ) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); hl_row_major_scan_forward(/* cache_ptr */ cache_ptr, @@ -4508,7 +4508,7 @@ smoke_check_6(void) /* dirty_inserts */ dirty_inserts); if ( show_progress ) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); hl_row_major_scan_backward(/* cache_ptr */ cache_ptr, @@ -4521,7 +4521,7 @@ smoke_check_6(void) /* dirty_inserts */ dirty_inserts); if ( show_progress ) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); hl_row_major_scan_forward(/* cache_ptr */ cache_ptr, @@ -4534,18 +4534,18 @@ smoke_check_6(void) /* dirty_inserts */ dirty_inserts); 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); hl_col_major_scan_forward(/* cache_ptr */ cache_ptr, @@ -4559,18 +4559,18 @@ smoke_check_6(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); hl_col_major_scan_backward(/* cache_ptr */ cache_ptr, @@ -4584,13 +4584,13 @@ smoke_check_6(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(); @@ -4599,7 +4599,7 @@ smoke_check_6(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_6() */ @@ -4608,10 +4608,10 @@ smoke_check_6(void) /*------------------------------------------------------------------------- * Function: smoke_check_7() * - * Purpose: A basic functional test on a cache with automatic cache - * resizing enabled, with inserts in the mix, along with - * repeated protects and unprotects. All entries are marked - * as clean. + * Purpose: A basic functional test on a cache with automatic cache + * resizing enabled, with inserts in the mix, along with + * repeated protects and unprotects. All entries are marked + * as clean. * * Return: void * @@ -4668,7 +4668,7 @@ smoke_check_7(void) /* size_t max_increment = */ (8 * 1024 * 1024), - /* enum H5C_cache_decr_mode decr_mode = */ + /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold, /* double upper_hr_threshold = */ 0.995, @@ -4703,13 +4703,13 @@ smoke_check_7(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), @@ -4727,7 +4727,7 @@ smoke_check_7(void) } if ( show_progress ) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); hl_row_major_scan_forward(/* cache_ptr */ cache_ptr, @@ -4740,7 +4740,7 @@ smoke_check_7(void) /* dirty_inserts */ dirty_inserts); if ( show_progress ) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); hl_row_major_scan_backward(/* cache_ptr */ cache_ptr, @@ -4753,7 +4753,7 @@ smoke_check_7(void) /* dirty_inserts */ dirty_inserts); if ( show_progress ) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); hl_row_major_scan_forward(/* cache_ptr */ cache_ptr, @@ -4766,18 +4766,18 @@ smoke_check_7(void) /* dirty_inserts */ dirty_inserts); 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); hl_col_major_scan_forward(/* cache_ptr */ cache_ptr, @@ -4791,18 +4791,18 @@ smoke_check_7(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); hl_col_major_scan_backward(/* cache_ptr */ cache_ptr, @@ -4816,13 +4816,13 @@ smoke_check_7(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(); @@ -4831,7 +4831,7 @@ smoke_check_7(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_7() */ @@ -4840,10 +4840,10 @@ smoke_check_7(void) /*------------------------------------------------------------------------- * Function: smoke_check_8() * - * Purpose: A basic functional test on a cache with automatic cache - * resizing enabled, with inserts in the mix, along with + * Purpose: A basic functional test on a cache with automatic cache + * resizing enabled, with inserts in the mix, along with * repeated protects and unprotects. About one half of all - * entries are marked as dirty. + * entries are marked as dirty. * * Return: void * @@ -4900,7 +4900,7 @@ smoke_check_8(void) /* size_t max_increment = */ (4 * 1024 * 1024), - /* enum H5C_cache_decr_mode decr_mode = */ + /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold, /* double upper_hr_threshold = */ 0.995, @@ -4935,13 +4935,13 @@ smoke_check_8(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), @@ -4959,7 +4959,7 @@ smoke_check_8(void) } if ( show_progress ) /* 3 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); hl_row_major_scan_forward(/* cache_ptr */ cache_ptr, @@ -4972,7 +4972,7 @@ smoke_check_8(void) /* dirty_inserts */ dirty_inserts); if ( show_progress ) /* 4 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); hl_row_major_scan_backward(/* cache_ptr */ cache_ptr, @@ -4985,7 +4985,7 @@ smoke_check_8(void) /* dirty_inserts */ dirty_inserts); if ( show_progress ) /* 5 */ - HDfprintf(stdout, "%s() - %0d -- pass = %d\n", + HDfprintf(stdout, "%s() - %0d -- pass = %d\n", fcn_name, mile_stone++, (int)pass); hl_row_major_scan_forward(/* cache_ptr */ cache_ptr, @@ -4998,18 +4998,18 @@ smoke_check_8(void) /* dirty_inserts */ dirty_inserts); 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); hl_col_major_scan_forward(/* cache_ptr */ cache_ptr, @@ -5023,18 +5023,18 @@ smoke_check_8(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); hl_col_major_scan_backward(/* cache_ptr */ cache_ptr, @@ -5048,13 +5048,13 @@ smoke_check_8(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(); @@ -5063,7 +5063,7 @@ smoke_check_8(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_8() */ @@ -5073,8 +5073,8 @@ smoke_check_8(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. * @@ -5110,20 +5110,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, @@ -5141,7 +5141,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; @@ -5161,7 +5161,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; @@ -5181,18 +5181,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, @@ -5206,7 +5206,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; @@ -5224,13 +5224,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(); @@ -5239,7 +5239,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 */ @@ -5280,7 +5280,7 @@ check_flush_cache(void) pass = TRUE; /* allocate a cache, and flush it under various circumstances. - * To the extent possible, verify that the desired actions took + * To the extent possible, verify that the desired actions took * place. */ @@ -5323,7 +5323,7 @@ check_flush_cache(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_cache() */ @@ -5381,7 +5381,7 @@ check_flush_cache__empty_cache(H5C_t * cache_ptr) if ( pass ) { - result = H5C_flush_cache(NULL, -1, -1, cache_ptr, + result = H5C_flush_cache(NULL, -1, -1, cache_ptr, H5C__FLUSH_INVALIDATE_FLAG); if ( result < 0 ) { @@ -5393,7 +5393,7 @@ check_flush_cache__empty_cache(H5C_t * cache_ptr) if ( pass ) { - result = H5C_flush_cache(NULL, -1, -1, cache_ptr, + result = H5C_flush_cache(NULL, -1, -1, cache_ptr, H5C__FLUSH_CLEAR_ONLY_FLAG); if ( result < 0 ) { @@ -5406,7 +5406,7 @@ check_flush_cache__empty_cache(H5C_t * cache_ptr) if ( pass ) { - result = H5C_flush_cache(NULL, -1, -1, cache_ptr, + result = H5C_flush_cache(NULL, -1, -1, cache_ptr, H5C__FLUSH_MARKED_ENTRIES_FLAG); if ( result < 0 ) { @@ -6533,7 +6533,7 @@ check_flush_cache__multi_entry_test(H5C_t * cache_ptr, { if ( spec[i].insert_flag ) { - insert_entry(cache_ptr, spec[i].entry_type, spec[i].entry_index, + insert_entry(cache_ptr, spec[i].entry_type, spec[i].entry_index, spec[i].dirty_flag, spec[i].flags); } else { @@ -6545,7 +6545,7 @@ check_flush_cache__multi_entry_test(H5C_t * cache_ptr, } total_entry_size += entry_sizes[spec[i].entry_type]; - + i++; } @@ -6576,7 +6576,7 @@ check_flush_cache__multi_entry_test(H5C_t * cache_ptr, #if 0 /* This is useful debugging code. Lets keep it around. */ - HDfprintf(stdout, + HDfprintf(stdout, "loaded = %d(%d), clrd = %d(%d), flshd = %d(%d), dest = %d(%d)\n", (int)(entry_ptr->loaded), (int)(spec[i].expected_loaded), @@ -6600,14 +6600,14 @@ check_flush_cache__multi_entry_test(H5C_t * cache_ptr, if ( pass ) { - if ( ( ( (flush_flags & H5C__FLUSH_INVALIDATE_FLAG) == 0 ) + if ( ( ( (flush_flags & H5C__FLUSH_INVALIDATE_FLAG) == 0 ) && - ( ( cache_ptr->index_len != spec_size ) + ( ( cache_ptr->index_len != spec_size ) || - ( cache_ptr->index_size != total_entry_size ) + ( cache_ptr->index_size != total_entry_size ) ) ) - || + || ( ( (flush_flags & H5C__FLUSH_INVALIDATE_FLAG) != 0 ) && ( ( cache_ptr->index_len != 0 ) @@ -6625,10 +6625,10 @@ check_flush_cache__multi_entry_test(H5C_t * cache_ptr, } } - /* clean up the cache to prep for the next test */ + /* clean up the cache to prep for the next test */ if ( pass ) { - result = H5C_flush_cache(NULL, -1, -1, cache_ptr, + result = H5C_flush_cache(NULL, -1, -1, cache_ptr, H5C__FLUSH_INVALIDATE_FLAG); if ( result < 0 ) { @@ -6648,7 +6648,7 @@ check_flush_cache__multi_entry_test(H5C_t * cache_ptr, test_num); failure_mssg = msg; - } + } } i = 0; @@ -6864,7 +6864,7 @@ check_flush_cache__single_entry(H5C_t * cache_ptr) /* insert_flag */ FALSE, /* dirty_flag */ FALSE, /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, /* expected_loaded */ TRUE, /* expected_cleared */ TRUE, @@ -6984,7 +6984,7 @@ check_flush_cache__single_entry(H5C_t * cache_ptr) /* insert_flag */ FALSE, /* dirty_flag */ FALSE, /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__FLUSH_MARKED_ENTRIES_FLAG, /* expected_loaded */ TRUE, @@ -7178,7 +7178,7 @@ check_flush_cache__single_entry(H5C_t * cache_ptr) /* insert_flag */ FALSE, /* dirty_flag */ FALSE, /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, /* expected_loaded */ TRUE, /* expected_cleared */ TRUE, @@ -7298,7 +7298,7 @@ check_flush_cache__single_entry(H5C_t * cache_ptr) /* insert_flag */ FALSE, /* dirty_flag */ FALSE, /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__FLUSH_MARKED_ENTRIES_FLAG, /* expected_loaded */ TRUE, @@ -7492,7 +7492,7 @@ check_flush_cache__single_entry(H5C_t * cache_ptr) /* insert_flag */ TRUE, /* dirty_flag */ FALSE, /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, /* expected_loaded */ FALSE, /* expected_cleared */ TRUE, @@ -7612,7 +7612,7 @@ check_flush_cache__single_entry(H5C_t * cache_ptr) /* insert_flag */ TRUE, /* dirty_flag */ FALSE, /* flags */ H5C__NO_FLAGS_SET, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__FLUSH_MARKED_ENTRIES_FLAG, /* expected_loaded */ FALSE, @@ -7806,7 +7806,7 @@ check_flush_cache__single_entry(H5C_t * cache_ptr) /* insert_flag */ TRUE, /* dirty_flag */ FALSE, /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG, /* expected_loaded */ FALSE, /* expected_cleared */ TRUE, @@ -7926,7 +7926,7 @@ check_flush_cache__single_entry(H5C_t * cache_ptr) /* insert_flag */ TRUE, /* dirty_flag */ FALSE, /* flags */ H5C__SET_FLUSH_MARKER_FLAG, - /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | + /* flush_flags */ H5C__FLUSH_INVALIDATE_FLAG | H5C__FLUSH_CLEAR_ONLY_FLAG | H5C__FLUSH_MARKED_ENTRIES_FLAG, /* expected_loaded */ FALSE, @@ -8035,7 +8035,7 @@ check_flush_cache__single_entry_test(H5C_t * cache_ptr, protect_entry(cache_ptr, entry_type, entry_idx); - unprotect_entry(cache_ptr, entry_type, entry_idx, + unprotect_entry(cache_ptr, entry_type, entry_idx, (int)dirty_flag, flags); } } @@ -8057,7 +8057,7 @@ check_flush_cache__single_entry_test(H5C_t * cache_ptr, ( entry_ptr->flushed != expected_flushed ) || ( entry_ptr->destroyed != expected_destroyed ) ) { - HDfprintf(stdout, + HDfprintf(stdout, "loaded = %d(%d), clrd = %d(%d), flshd = %d(%d), dest = %d(%d)\n", (int)(entry_ptr->loaded), (int)expected_loaded, @@ -8074,14 +8074,14 @@ check_flush_cache__single_entry_test(H5C_t * cache_ptr, test_num); failure_mssg = msg; } - else if ( ( ( (flush_flags & H5C__FLUSH_INVALIDATE_FLAG) == 0 ) + else if ( ( ( (flush_flags & H5C__FLUSH_INVALIDATE_FLAG) == 0 ) && - ( ( cache_ptr->index_len != 1 ) + ( ( cache_ptr->index_len != 1 ) || - ( cache_ptr->index_size != entry_sizes[entry_type] ) - ) + ( cache_ptr->index_size != entry_sizes[entry_type] ) + ) ) - || + || ( ( (flush_flags & H5C__FLUSH_INVALIDATE_FLAG) != 0 ) && ( ( cache_ptr->index_len != 0 ) @@ -8098,12 +8098,12 @@ check_flush_cache__single_entry_test(H5C_t * cache_ptr, failure_mssg = msg; } } - - - /* clean up the cache to prep for the next test */ + + + /* clean up the cache to prep for the next test */ if ( pass ) { - result = H5C_flush_cache(NULL, -1, -1, cache_ptr, + result = H5C_flush_cache(NULL, -1, -1, cache_ptr, H5C__FLUSH_INVALIDATE_FLAG); if ( result < 0 ) { @@ -8184,7 +8184,7 @@ check_flush_protected_err(void) unprotect_entry(cache_ptr, 0, 0, TRUE, H5C__NO_FLAGS_SET); - if ( H5C_flush_cache(NULL, -1, -1, cache_ptr, H5C__NO_FLAGS_SET) + if ( H5C_flush_cache(NULL, -1, -1, cache_ptr, H5C__NO_FLAGS_SET) < 0 ) { pass = FALSE; @@ -8200,7 +8200,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() */ @@ -8260,14 +8260,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() */ @@ -8276,7 +8276,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 @@ -8303,7 +8303,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. */ @@ -8321,7 +8321,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, H5C__NO_FLAGS_SET); @@ -8342,7 +8342,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() */ @@ -8431,7 +8431,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() */ @@ -8466,7 +8466,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. */ @@ -8507,7 +8507,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() */ @@ -8527,7 +8527,7 @@ check_double_protect_err(void) * Modifications: * * JRM -- 6/17/05 - * Modified function to use the new dirtied parameter in + * Modified function to use the new dirtied parameter in * H5C_unprotect(). * *------------------------------------------------------------------------- @@ -8545,8 +8545,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. */ @@ -8567,13 +8567,13 @@ check_double_unprotect_err(void) if ( pass ) { result = H5C_unprotect(NULL, -1, -1, cache_ptr, &(types[0]), - entry_ptr->addr, (void *)entry_ptr, + entry_ptr->addr, (void *)entry_ptr, H5C__NO_FLAGS_SET); if ( result > 0 ) { pass = FALSE; - failure_mssg = + failure_mssg = "attempt to unprotect an unprotected entry succeeded 1.\n"; } } @@ -8586,7 +8586,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() */ @@ -8596,8 +8596,8 @@ check_double_unprotect_err(void) * Function: check_auto_cache_resize() * * Purpose: Exercise the automatic cache resizing functionality. - * The objective is to operate the auto-resize code in - * all possible modes. Unfortunately, there are quite + * The objective is to operate the auto-resize code in + * all possible modes. Unfortunately, there are quite * a few of them. * * Return: void @@ -8691,7 +8691,7 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* allocate a cache, enable automatic cache resizing, and then force + /* allocate a cache, enable automatic cache resizing, and then force * the cache through all its operational modes. Verify that all * performs as expected. */ @@ -8727,7 +8727,7 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* force low hit rate with cache not full -- should result in not + /* force low hit rate with cache not full -- should result in not * full status. */ if ( pass ) { @@ -8739,7 +8739,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, PICO_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, PICO_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, PICO_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -8769,7 +8769,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -8787,7 +8787,7 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* force low hit rate with cache not full -- should result in not + /* force low hit rate with cache not full -- should result in not * full status. */ if ( pass ) { @@ -8799,7 +8799,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, PICO_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, PICO_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, PICO_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -8829,7 +8829,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -8859,7 +8859,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -8889,7 +8889,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -8920,7 +8920,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -8950,7 +8950,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -8968,7 +8968,7 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* force low hit rate with cache full and at maximum size -- should + /* force low hit rate with cache full and at maximum size -- should * in no change in size and a result of at_max_size. */ if ( pass ) { @@ -8980,7 +8980,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -8998,7 +8998,7 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* force high hit rate with cache full and at maximum size -- should + /* force high hit rate with cache full and at maximum size -- should * result in a decrease from 14 to 13 Meg -- note that max decrease * reduced the size of the reduction */ @@ -9011,7 +9011,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -9030,7 +9030,7 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); /* the current cache configuration is unconvenient for testing cache - * size reduction, so lets change it some something easier to work + * size reduction, so lets change it some something easier to work * with. */ @@ -9095,7 +9095,7 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* force high hit rate -- should result in a decrease from ~4 to ~3 + /* force high hit rate -- should result in a decrease from ~4 to ~3 * M -- note that max decrease reduces the size of the reduction */ if ( pass ) { @@ -9107,7 +9107,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -9125,8 +9125,8 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* force high hit rate again -- should result in a decrease from ~3 - * to ~2 M -- again note that max decrease reduces the size of the + /* force high hit rate again -- should result in a decrease from ~3 + * to ~2 M -- again note that max decrease reduces the size of the * reduction. */ if ( pass ) { @@ -9138,7 +9138,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -9156,8 +9156,8 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* force high hit rate again -- should result in a decrease from ~2 - * to ~1 M -- again note that max decrease reduces the size of the + /* force high hit rate again -- should result in a decrease from ~2 + * to ~1 M -- again note that max decrease reduces the size of the * reduction, but only by five bites. */ if ( pass ) { @@ -9169,7 +9169,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -9187,7 +9187,7 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* force high hit rate again -- should result in a decrease from ~1 + /* force high hit rate again -- should result in a decrease from ~1 * to ~0.5 M -- max decrease is no longer a factor. New size is five * bytes above the minimum. */ @@ -9200,7 +9200,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -9230,7 +9230,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -9260,7 +9260,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -9278,7 +9278,7 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* force in range hit rate -- should be no change in cache size, + /* force in range hit rate -- should be no change in cache size, * and result should be in_spec. */ if ( pass ) { @@ -9290,18 +9290,18 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; } - while ( ( pass ) && ( i < 1000 ) ) + while ( ( pass ) && ( i < 1000 ) ) { protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i + 1000); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i + 1000, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i + 1000, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -9319,7 +9319,7 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* force low hit rate with cache full -- should + /* force low hit rate with cache full -- should * increase cache size from .5 to 1 M. */ if ( pass ) { @@ -9331,7 +9331,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -9349,7 +9349,7 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* force high hit rate -- should result in a decrease to the + /* force high hit rate -- should result in a decrease to the * minimum cache size. */ if ( pass ) { @@ -9361,7 +9361,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -9445,7 +9445,7 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* force high hit rate -- should result in a decrease to the + /* force high hit rate -- should result in a decrease to the * minimum cache size. */ if ( pass ) { @@ -9457,7 +9457,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -9475,7 +9475,7 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* force low hit rate with cache full -- should increase cache size + /* force low hit rate with cache full -- should increase cache size * from 1 to 4 Meg. */ if ( pass ) { @@ -9487,7 +9487,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -9505,7 +9505,7 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* force low hit rate again with cache full -- should increase cache + /* force low hit rate again with cache full -- should increase cache * size from 4 to 16 Meg. */ if ( pass ) { @@ -9517,7 +9517,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -9547,7 +9547,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -9566,7 +9566,7 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); /****************************************************************** - * We have tested the threshold increment and decrement modes. + * We have tested the threshold increment and decrement modes. * must now test the ageout decrement mode. * * Reconfigure the cache for this testing. @@ -9638,7 +9638,7 @@ check_auto_cache_resize(void) * for three epochs while the markers are inserted into the cache * * Note that hit rate will be zero, so the cache will attempt to - * increase its size. Since we are already at max size, it will + * increase its size. Since we are already at max size, it will * not be able to. */ if ( pass ) { /* first epoch */ @@ -9650,7 +9650,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -9677,7 +9677,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -9704,7 +9704,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -9723,10 +9723,10 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); /* fourth epoch -- If the hit rate were above the lower threshold, - * we would see cache size reduction now. However, nothing will + * we would see cache size reduction now. However, nothing will * happen until we get the hit rate above the lower threshold. */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 3000; @@ -9735,7 +9735,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -9753,10 +9753,10 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* fifth epoch -- force the hit rate to 100%. We should see cache size - * reduction now. + /* fifth epoch -- force the hit rate to 100%. We should see cache size + * reduction now. */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 3000; @@ -9765,7 +9765,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -9783,9 +9783,9 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* sixth epoch -- force the hit rate to 100% again. + /* sixth epoch -- force the hit rate to 100% again. */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 3000; @@ -9794,7 +9794,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -9812,9 +9812,9 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* seventh epoch -- force the hit rate to 100% again. + /* seventh epoch -- force the hit rate to 100% again. */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 3000; @@ -9823,7 +9823,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -9841,10 +9841,10 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* eigth epoch -- force the hit rate to 100% again -- should be steady - * state. + /* eigth epoch -- force the hit rate to 100% again -- should be steady + * state. */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 3000; @@ -9853,7 +9853,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -9871,7 +9871,7 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "*check point %d\n", checkpoint++); - /* now just bang on one entry -- after three epochs, this should + /* now just bang on one entry -- after three epochs, this should * get all entries other than the one evicted, and the cache size * should be decreased to the minimum. */ @@ -9884,7 +9884,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -9911,7 +9911,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -9938,7 +9938,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -9949,7 +9949,7 @@ check_auto_cache_resize(void) ( cache_ptr->max_cache_size != (512 * 1024) ) || ( cache_ptr->min_clean_size != (256 * 1024) ) || ( cache_ptr->index_len != 2 ) || - ( cache_ptr->index_size != + ( cache_ptr->index_size != MONSTER_ENTRY_SIZE + MEDIUM_ENTRY_SIZE ) ) { pass = FALSE; @@ -9968,7 +9968,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -9979,7 +9979,7 @@ check_auto_cache_resize(void) ( cache_ptr->max_cache_size != (512 * 1024) ) || ( cache_ptr->min_clean_size != (256 * 1024) ) || ( cache_ptr->index_len != 2 ) || - ( cache_ptr->index_size != + ( cache_ptr->index_size != MONSTER_ENTRY_SIZE + MEDIUM_ENTRY_SIZE ) ) { pass = FALSE; @@ -10061,7 +10061,7 @@ check_auto_cache_resize(void) * for three epochs while the markers are inserted into the cache * * Note that hit rate will be zero, so the cache will attempt to - * increase its size. Since we are already at max size, it will + * increase its size. Since we are already at max size, it will * not be able to. */ if ( pass ) { /* first epoch */ @@ -10073,7 +10073,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -10100,7 +10100,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -10127,7 +10127,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -10146,10 +10146,10 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); /* fourth epoch -- If the hit rate were above the lower threshold, - * we would see cache size reduction now. However, nothing will + * we would see cache size reduction now. However, nothing will * happen until we get the hit rate above the lower threshold. */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 3000; @@ -10158,7 +10158,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -10176,10 +10176,10 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* fifth epoch -- force the hit rate to 100%. We should see cache size - * reduction now. + /* fifth epoch -- force the hit rate to 100%. We should see cache size + * reduction now. */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 3000; @@ -10188,7 +10188,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -10206,9 +10206,9 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* sixth epoch -- force the hit rate to 100% again. + /* sixth epoch -- force the hit rate to 100% again. */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 2000; @@ -10217,7 +10217,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -10237,7 +10237,7 @@ check_auto_cache_resize(void) /* seventh epoch -- keep hit rate at 100%, and keep 2K entries active. */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 3000; @@ -10246,7 +10246,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -10266,7 +10266,7 @@ check_auto_cache_resize(void) /* eigth epoch -- still 100% hit rate */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 2000; @@ -10275,7 +10275,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -10295,7 +10295,7 @@ check_auto_cache_resize(void) /* ninth epoch --hit rate at 100%. */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 3000; @@ -10304,7 +10304,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -10324,7 +10324,7 @@ check_auto_cache_resize(void) /* tenth epoch -- still 100% hit rate */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 2000; @@ -10333,7 +10333,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -10353,7 +10353,7 @@ check_auto_cache_resize(void) /* eleventh epoch -- hit rate at 100% -- starting to stableize */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 3000; @@ -10362,7 +10362,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -10380,10 +10380,10 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* twelth epoch -- force the hit rate to 100% again -- should be steady - * state. + /* twelth epoch -- force the hit rate to 100% again -- should be steady + * state. */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 2000; @@ -10392,7 +10392,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -10410,7 +10410,7 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* now just bang on one entry -- after three epochs, this should + /* now just bang on one entry -- after three epochs, this should * get all entries other than the one evicted, and the cache size * should be decreased to the minimum. */ @@ -10423,7 +10423,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -10450,7 +10450,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -10458,9 +10458,9 @@ check_auto_cache_resize(void) if ( ( ! rpt_fcn_called ) || ( rpt_status != decrease ) || - ( cache_ptr->max_cache_size != + ( cache_ptr->max_cache_size != (1001 * 1024 + MONSTER_ENTRY_SIZE) ) || - ( cache_ptr->min_clean_size != + ( cache_ptr->min_clean_size != (1001 * 512 + MONSTER_ENTRY_SIZE / 2) ) ) { pass = FALSE; @@ -10479,7 +10479,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -10490,7 +10490,7 @@ check_auto_cache_resize(void) ( cache_ptr->max_cache_size != (512 * 1024) ) || ( cache_ptr->min_clean_size != (256 * 1024) ) || ( cache_ptr->index_len != 2 ) || - ( cache_ptr->index_size != + ( cache_ptr->index_size != MONSTER_ENTRY_SIZE + MEDIUM_ENTRY_SIZE ) ) { pass = FALSE; @@ -10509,7 +10509,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -10520,7 +10520,7 @@ check_auto_cache_resize(void) ( cache_ptr->max_cache_size != (512 * 1024) ) || ( cache_ptr->min_clean_size != (256 * 1024) ) || ( cache_ptr->index_len != 2 ) || - ( cache_ptr->index_size != + ( cache_ptr->index_size != MONSTER_ENTRY_SIZE + MEDIUM_ENTRY_SIZE ) ) { pass = FALSE; @@ -10601,7 +10601,7 @@ check_auto_cache_resize(void) * for three epochs while the markers are inserted into the cache * * Note that hit rate will be zero, so the cache will attempt to - * increase its size. Since we are already at max size, it will + * increase its size. Since we are already at max size, it will * not be able to. */ if ( pass ) { /* first epoch */ @@ -10613,7 +10613,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -10640,7 +10640,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -10667,7 +10667,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -10686,10 +10686,10 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); /* fourth epoch -- If the hit rate were above the lower threshold, - * we would see cache size reduction now. However, nothing will + * we would see cache size reduction now. However, nothing will * happen until we get the hit rate above the lower threshold. */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 3000; @@ -10698,7 +10698,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -10716,10 +10716,10 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* fifth epoch -- force the hit rate to 100%. We should see cache size - * reduction now. + /* fifth epoch -- force the hit rate to 100%. We should see cache size + * reduction now. */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 3000; @@ -10728,7 +10728,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -10746,9 +10746,9 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* sixth epoch -- force the hit rate to 100% again. + /* sixth epoch -- force the hit rate to 100% again. */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 3000; @@ -10757,7 +10757,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -10775,9 +10775,9 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* seventh epoch -- force the hit rate to 100% again. + /* seventh epoch -- force the hit rate to 100% again. */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 3000; @@ -10786,7 +10786,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -10804,10 +10804,10 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* eigth epoch -- force the hit rate to 100% again -- should be steady - * state. + /* eigth epoch -- force the hit rate to 100% again -- should be steady + * state. */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 3000; @@ -10816,7 +10816,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -10834,7 +10834,7 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* now just bang on one entry -- after three epochs, this should + /* now just bang on one entry -- after three epochs, this should * get all entries other than the one evicted, and the cache size * should be decreased to the minimum. */ @@ -10847,7 +10847,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -10874,7 +10874,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -10901,7 +10901,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -10912,7 +10912,7 @@ check_auto_cache_resize(void) ( cache_ptr->max_cache_size != (512 * 1024) ) || ( cache_ptr->min_clean_size != (256 * 1024) ) || ( cache_ptr->index_len != 2 ) || - ( cache_ptr->index_size != + ( cache_ptr->index_size != MONSTER_ENTRY_SIZE + MEDIUM_ENTRY_SIZE ) ) { pass = FALSE; @@ -10931,7 +10931,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -10942,7 +10942,7 @@ check_auto_cache_resize(void) ( cache_ptr->max_cache_size != (512 * 1024) ) || ( cache_ptr->min_clean_size != (256 * 1024) ) || ( cache_ptr->index_len != 2 ) || - ( cache_ptr->index_size != + ( cache_ptr->index_size != MONSTER_ENTRY_SIZE + MEDIUM_ENTRY_SIZE ) ) { pass = FALSE; @@ -11022,7 +11022,7 @@ check_auto_cache_resize(void) /* fill the cache with 4K byte entries -- increment mode is off, - * so cache size reduction should kick in as soon as we get the + * so cache size reduction should kick in as soon as we get the * hit rate above .999. */ if ( pass ) { /* first epoch -- hit rate 0 */ @@ -11034,7 +11034,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, LARGE_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, LARGE_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, LARGE_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -11061,7 +11061,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, LARGE_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, LARGE_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, LARGE_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -11088,7 +11088,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, LARGE_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, LARGE_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, LARGE_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -11107,7 +11107,7 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); /* fourth epoch -- load up the cache again -- hit rate 0 */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 0; @@ -11116,7 +11116,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -11135,7 +11135,7 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); /* fifth epoch -- still loading up the cache -- hit rate 0 */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 1000; @@ -11144,7 +11144,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -11163,7 +11163,7 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); /* sixth epoch -- force hit rate to .998 -- should be no reduction */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 1002; @@ -11172,7 +11172,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -11190,9 +11190,9 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* seventh epoch -- force hit rate to .999 -- should see reduction + /* seventh epoch -- force hit rate to .999 -- should see reduction */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 1003; @@ -11201,7 +11201,7 @@ check_auto_cache_resize(void) protect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MEDIUM_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -11352,7 +11352,7 @@ check_auto_cache_resize(void) * * In this epoch, all we should see is a reduction in the index size. */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 0; @@ -11383,7 +11383,7 @@ check_auto_cache_resize(void) /* fourth epoch -- hit rate still 1.0. Index size should decrease, * but otherwise no change expected. */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 0; @@ -11414,7 +11414,7 @@ check_auto_cache_resize(void) /* fifth epoch -- hit rate still 1.0. Index size should decrease, * but otherwise no change expected. */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 0; @@ -11446,7 +11446,7 @@ check_auto_cache_resize(void) * but otherwise no change expected. Note that the cache size is * now just on the edge of meeting the clean reserve. */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 0; @@ -11476,7 +11476,7 @@ check_auto_cache_resize(void) /* seventh epoch -- hit rate still 1.0. No change in index size expected. */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 0; @@ -11504,10 +11504,10 @@ check_auto_cache_resize(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* eighth epoch -- start loading 1 KB entries. Hit rate 0 so + /* eighth epoch -- start loading 1 KB entries. Hit rate 0 so * decrease code shouldn't be called. */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 0; @@ -11539,7 +11539,7 @@ check_auto_cache_resize(void) * to 1.0. Decrease code should be triggered, but the max decrease * should prevent the empty reserve from being met in this epoch. */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 0; @@ -11571,7 +11571,7 @@ check_auto_cache_resize(void) * to 1.0. Decrease code should be triggered, and the empty reserve * should finally be met. */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 0; @@ -11603,7 +11603,7 @@ check_auto_cache_resize(void) * to 1.0. Decrease code should be triggered, and the empty reserve * should be met again. */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 0; @@ -11633,7 +11633,7 @@ check_auto_cache_resize(void) /* twelth epoch -- hit rate 1.0 -- decrease as before. */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 0; @@ -11663,7 +11663,7 @@ check_auto_cache_resize(void) /* thirteenth epoch -- hit rate 1.0 -- decrease as before. */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 0; @@ -11693,7 +11693,7 @@ check_auto_cache_resize(void) /* fourteenth epoch -- hit rate 1.0 -- decrease as before. */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 0; @@ -11723,7 +11723,7 @@ check_auto_cache_resize(void) /* fifteenth epoch -- hit rate 1.0 -- decrease as before. */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 0; @@ -11753,7 +11753,7 @@ check_auto_cache_resize(void) /* sixteenth epoch -- hit rate 1.0 -- should be stable now */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 0; @@ -11791,7 +11791,7 @@ check_auto_cache_resize(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_auto_cache_resize() */ @@ -11869,7 +11869,7 @@ check_auto_cache_resize_disable(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* allocate a cache, enable automatic cache resizing, and then force + /* allocate a cache, enable automatic cache resizing, and then force * the cache through all its operational modes. Verify that all * performs as expected. */ @@ -11907,7 +11907,7 @@ check_auto_cache_resize_disable(void) /****************************************************************** - * So far, we have forced the auto cache resize through all modes + * So far, we have forced the auto cache resize through all modes * other than increase_disabled and decrease_disabled. Force these * modes now. Note that there are several ways we can reach these * modes. @@ -11974,7 +11974,7 @@ check_auto_cache_resize_disable(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* force low hit rate with cache full -- increase disabled so should + /* force low hit rate with cache full -- increase disabled so should * be no change in cache size, and result should be increase_disabled. */ if ( pass ) { @@ -11986,7 +11986,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -12017,7 +12017,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -12035,7 +12035,7 @@ check_auto_cache_resize_disable(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* force low hit rate again -- increase disabled so should + /* force low hit rate again -- increase disabled so should * be no change in cache size, and result should be increase_disabled. */ if ( pass ) { @@ -12047,7 +12047,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -12090,7 +12090,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.lower_hr_threshold = 0.0; /* disable size increases */ - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0; auto_size_ctl.apply_max_increment = FALSE; auto_size_ctl.max_increment = (4 * 1024 * 1024); @@ -12131,7 +12131,7 @@ check_auto_cache_resize_disable(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* force low hit rate with cache full -- increase disabled so should + /* force low hit rate with cache full -- increase disabled so should * be no change in cache size, and result should be in_spec. */ if ( pass ) { @@ -12143,7 +12143,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -12174,7 +12174,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -12192,7 +12192,7 @@ check_auto_cache_resize_disable(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* force low hit rate again -- increase disabled so should + /* force low hit rate again -- increase disabled so should * be no change in cache size, and result should be increase_disabled. */ if ( pass ) { @@ -12204,7 +12204,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -12223,7 +12223,7 @@ check_auto_cache_resize_disable(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* Repeat the above tests yet again, disabling increase through the + /* Repeat the above tests yet again, disabling increase through the * incr_mode. */ @@ -12245,9 +12245,9 @@ check_auto_cache_resize_disable(void) auto_size_ctl.incr_mode = H5C_incr__off; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75; - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0; auto_size_ctl.apply_max_increment = FALSE; auto_size_ctl.max_increment = (4 * 1024 * 1024); @@ -12288,7 +12288,7 @@ check_auto_cache_resize_disable(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* force low hit rate with cache full -- increase disabled so should + /* force low hit rate with cache full -- increase disabled so should * be no change in cache size, and result should be in_spec. */ if ( pass ) { @@ -12300,7 +12300,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -12331,7 +12331,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -12349,7 +12349,7 @@ check_auto_cache_resize_disable(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* force low hit rate again -- increase disabled so should + /* force low hit rate again -- increase disabled so should * be no change in cache size, and result should be increase_disabled. */ if ( pass ) { @@ -12361,7 +12361,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -12401,9 +12401,9 @@ check_auto_cache_resize_disable(void) auto_size_ctl.incr_mode = H5C_incr__threshold; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75; - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0; auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); @@ -12458,7 +12458,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -12487,7 +12487,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -12517,7 +12517,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -12557,9 +12557,9 @@ check_auto_cache_resize_disable(void) auto_size_ctl.incr_mode = H5C_incr__threshold; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75; - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0; auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); @@ -12569,7 +12569,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.upper_hr_threshold = 1.0; /* disable size decreases */ - auto_size_ctl.decrement = 0.5; + auto_size_ctl.decrement = 0.5; auto_size_ctl.apply_max_decrement = TRUE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -12612,7 +12612,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -12642,7 +12642,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -12672,7 +12672,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -12712,9 +12712,9 @@ check_auto_cache_resize_disable(void) auto_size_ctl.incr_mode = H5C_incr__threshold; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75; - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0; auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); @@ -12724,7 +12724,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.upper_hr_threshold = 0.995; - auto_size_ctl.decrement = 0.5; + auto_size_ctl.decrement = 0.5; auto_size_ctl.apply_max_decrement = TRUE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -12767,7 +12767,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -12797,7 +12797,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -12827,7 +12827,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -12869,9 +12869,9 @@ check_auto_cache_resize_disable(void) auto_size_ctl.incr_mode = H5C_incr__threshold; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75; - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0; auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); @@ -12881,7 +12881,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.upper_hr_threshold = 0.995; - auto_size_ctl.decrement = 0.5; + auto_size_ctl.decrement = 0.5; auto_size_ctl.apply_max_decrement = TRUE; auto_size_ctl.max_decrement = 0; /* disable decrement */ @@ -12929,7 +12929,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, SMALL_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, SMALL_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, SMALL_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -12959,7 +12959,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, SMALL_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, SMALL_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, SMALL_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -12978,7 +12978,7 @@ check_auto_cache_resize_disable(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* Now force a high hit rate so that the size increase code is + /* Now force a high hit rate so that the size increase code is * is satisfied. We would see a decrease here if decrease were * possible. */ @@ -12991,7 +12991,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, SMALL_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, SMALL_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, SMALL_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -13021,7 +13021,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -13041,7 +13041,7 @@ check_auto_cache_resize_disable(void) /* just bang on a single entry. This will see to it that there are * many entries that could be aged out were decreases enabled. - * Should be no change in cache size, and result should be + * Should be no change in cache size, and result should be * decrease_disabled. */ if ( pass ) { @@ -13053,7 +13053,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -13093,9 +13093,9 @@ check_auto_cache_resize_disable(void) auto_size_ctl.incr_mode = H5C_incr__threshold; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75; - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0; auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); @@ -13105,7 +13105,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.upper_hr_threshold = 0.995; - auto_size_ctl.decrement = 0.5; + auto_size_ctl.decrement = 0.5; auto_size_ctl.apply_max_decrement = TRUE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -13153,7 +13153,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, SMALL_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, SMALL_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, SMALL_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -13183,7 +13183,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, SMALL_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, SMALL_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, SMALL_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -13202,7 +13202,7 @@ check_auto_cache_resize_disable(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* Now force a high hit rate so that the size increase code is + /* Now force a high hit rate so that the size increase code is * is satisfied. We would see a decrease here if decrease were * possible. */ @@ -13215,7 +13215,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, SMALL_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, SMALL_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, SMALL_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -13245,7 +13245,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -13265,7 +13265,7 @@ check_auto_cache_resize_disable(void) /* just bang on a single entry. This will see to it that there are * many entries that could be aged out were decreases enabled. - * Should be no change in cache size, and result should be + * Should be no change in cache size, and result should be * decrease_disabled. */ if ( pass ) { @@ -13277,7 +13277,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -13296,13 +13296,13 @@ check_auto_cache_resize_disable(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* Now work with age out with threshold. One can argue that we should + /* Now work with age out with threshold. One can argue that we should * repeat the above age out tests with age out with threshold, but the - * same code is executed in both cases so I don't see the point. If + * same code is executed in both cases so I don't see the point. If * that ever changes, this test should be updated. * * There is only one way of disabling decrements that is peculiar - * to age out with threshold, which is to set the upper threshold + * to age out with threshold, which is to set the upper threshold * to 1.0. Test this now. */ @@ -13324,9 +13324,9 @@ check_auto_cache_resize_disable(void) auto_size_ctl.incr_mode = H5C_incr__threshold; - auto_size_ctl.lower_hr_threshold = 0.75; + auto_size_ctl.lower_hr_threshold = 0.75; - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0; auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); @@ -13336,7 +13336,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.upper_hr_threshold = 1.0; - auto_size_ctl.decrement = 0.5; + auto_size_ctl.decrement = 0.5; auto_size_ctl.apply_max_decrement = TRUE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -13384,7 +13384,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, SMALL_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, SMALL_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, SMALL_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -13414,7 +13414,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, SMALL_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, SMALL_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, SMALL_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -13433,7 +13433,7 @@ check_auto_cache_resize_disable(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* Now force a high hit rate so that the size increase code is + /* Now force a high hit rate so that the size increase code is * is satisfied. We would see a decrease here if decrease were * possible, but the upper threshold cannot be met, so no decrease. * @@ -13448,7 +13448,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, SMALL_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, SMALL_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, SMALL_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -13480,7 +13480,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -13499,10 +13499,10 @@ check_auto_cache_resize_disable(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); /* just bang on a single entry. This keeps the hit rate high, and sees - * to it that there are many entries that could be aged out were + * to it that there are many entries that could be aged out were * decreases enabled. * - * Should be no change in cache size, and result should be + * Should be no change in cache size, and result should be * decrease_disabled. */ if ( pass ) { @@ -13514,7 +13514,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 999); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 999, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 999, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -13535,9 +13535,9 @@ check_auto_cache_resize_disable(void) /********************************************************************* - * Finally, use the auto cache resize code to set the size of the - * cache and keep it there. Again, due to the complexity of the - * interface, there are lots of ways of doing this. We have to + * Finally, use the auto cache resize code to set the size of the + * cache and keep it there. Again, due to the complexity of the + * interface, there are lots of ways of doing this. We have to * check them all. *********************************************************************/ @@ -13561,7 +13561,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.lower_hr_threshold = 0.0; /* disable size increases */ - auto_size_ctl.increment = 2.0; + auto_size_ctl.increment = 2.0; auto_size_ctl.apply_max_increment = TRUE; auto_size_ctl.max_increment = (2 * 1024 * 1024); @@ -13571,7 +13571,7 @@ check_auto_cache_resize_disable(void) auto_size_ctl.upper_hr_threshold = 1.0; /* disable size decreases */ - auto_size_ctl.decrement = 0.5; + auto_size_ctl.decrement = 0.5; auto_size_ctl.apply_max_decrement = TRUE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); @@ -13602,7 +13602,7 @@ check_auto_cache_resize_disable(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* force low hit rate -- should be no response as the auto-resize + /* force low hit rate -- should be no response as the auto-resize * code should be disabled. */ if ( pass ) { @@ -13614,7 +13614,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -13646,7 +13646,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -13727,7 +13727,7 @@ check_auto_cache_resize_disable(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* force low hit rate -- should be no response as the auto-resize + /* force low hit rate -- should be no response as the auto-resize * code should be disabled. */ if ( pass ) { @@ -13739,7 +13739,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -13771,7 +13771,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -13852,7 +13852,7 @@ check_auto_cache_resize_disable(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* force low hit rate -- should be no response as the auto-resize + /* force low hit rate -- should be no response as the auto-resize * code should be disabled. */ if ( pass ) { @@ -13864,7 +13864,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -13896,7 +13896,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -13977,7 +13977,7 @@ check_auto_cache_resize_disable(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* force low hit rate -- should be no response as the auto-resize + /* force low hit rate -- should be no response as the auto-resize * code should be disabled. */ if ( pass ) { @@ -13989,7 +13989,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -14021,7 +14021,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -14103,7 +14103,7 @@ check_auto_cache_resize_disable(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* force low hit rate -- should be no response as the auto-resize + /* force low hit rate -- should be no response as the auto-resize * code should be disabled. */ if ( pass ) { @@ -14115,7 +14115,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -14147,7 +14147,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -14229,7 +14229,7 @@ check_auto_cache_resize_disable(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* force low hit rate -- should be no response as the auto-resize + /* force low hit rate -- should be no response as the auto-resize * code should be disabled. */ if ( pass ) { @@ -14241,7 +14241,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -14273,7 +14273,7 @@ check_auto_cache_resize_disable(void) protect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0); if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -14303,7 +14303,7 @@ check_auto_cache_resize_disable(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_auto_cache_resize_disable() */ @@ -14452,10 +14452,10 @@ check_auto_cache_resize_epoch_markers(void) auto_size_ctl.apply_max_decrement = FALSE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); - auto_size_ctl.epochs_before_eviction = 10; + auto_size_ctl.epochs_before_eviction = 10; auto_size_ctl.apply_empty_reserve = FALSE; - auto_size_ctl.empty_reserve = 0.05; + auto_size_ctl.empty_reserve = 0.05; result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); @@ -14520,7 +14520,7 @@ check_auto_cache_resize_epoch_markers(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - if ( pass ) { + if ( pass ) { j = 2; while ( ( pass ) && ( j <= 10 ) ) @@ -14553,10 +14553,10 @@ check_auto_cache_resize_epoch_markers(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* we now have a full complement of epoch markers -- see if + /* we now have a full complement of epoch markers -- see if * we get the expected reduction. */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 9000; @@ -14573,11 +14573,11 @@ check_auto_cache_resize_epoch_markers(void) if ( ( ! rpt_fcn_called ) || ( rpt_status != decrease ) || - ( cache_ptr->max_cache_size != + ( cache_ptr->max_cache_size != (10 * 1000 * SMALL_ENTRY_SIZE + MEDIUM_ENTRY_SIZE) ) || - ( cache_ptr->min_clean_size != + ( cache_ptr->min_clean_size != ((10 * 1000 * SMALL_ENTRY_SIZE + MEDIUM_ENTRY_SIZE) / 2) ) || - ( cache_ptr->index_size != + ( cache_ptr->index_size != (10 * 1000 * SMALL_ENTRY_SIZE + MEDIUM_ENTRY_SIZE) ) ) { pass = FALSE; @@ -14587,7 +14587,7 @@ check_auto_cache_resize_epoch_markers(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* now reduce the epochs before eviction, and see if the cache + /* now reduce the epochs before eviction, and see if the cache * deletes the extra markers */ if ( pass ) { @@ -14625,10 +14625,10 @@ check_auto_cache_resize_epoch_markers(void) auto_size_ctl.apply_max_decrement = FALSE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); - auto_size_ctl.epochs_before_eviction = 1; + auto_size_ctl.epochs_before_eviction = 1; auto_size_ctl.apply_empty_reserve = FALSE; - auto_size_ctl.empty_reserve = 0.05; + auto_size_ctl.empty_reserve = 0.05; result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); @@ -14663,10 +14663,10 @@ check_auto_cache_resize_epoch_markers(void) } /* Now do an epochs worth of accesses, and verify that everything - * not accessed in this epoch gets evicted, and the cache size + * not accessed in this epoch gets evicted, and the cache size * is reduced. */ - if ( pass ) { + if ( pass ) { rpt_fcn_called = FALSE; i = 9000; @@ -14743,10 +14743,10 @@ check_auto_cache_resize_epoch_markers(void) auto_size_ctl.apply_max_decrement = FALSE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); - auto_size_ctl.epochs_before_eviction = 1; + auto_size_ctl.epochs_before_eviction = 1; auto_size_ctl.apply_empty_reserve = FALSE; - auto_size_ctl.empty_reserve = 0.05; + auto_size_ctl.empty_reserve = 0.05; result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); @@ -14780,7 +14780,7 @@ check_auto_cache_resize_epoch_markers(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); - /* shift the decrement mode to age out with threshold. Set epochs + /* shift the decrement mode to age out with threshold. Set epochs * before eviction to 10 again. */ if ( pass ) { @@ -14818,10 +14818,10 @@ check_auto_cache_resize_epoch_markers(void) auto_size_ctl.apply_max_decrement = FALSE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); - auto_size_ctl.epochs_before_eviction = 10; + auto_size_ctl.epochs_before_eviction = 10; auto_size_ctl.apply_empty_reserve = FALSE; - auto_size_ctl.empty_reserve = 0.05; + auto_size_ctl.empty_reserve = 0.05; result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); @@ -14846,7 +14846,7 @@ check_auto_cache_resize_epoch_markers(void) if ( show_progress ) HDfprintf(stderr, "check point %d\n", checkpoint++); /* build up a full set of epoch markers. */ - if ( pass ) { + if ( pass ) { j = 1; while ( ( pass ) && ( j <= 10 ) ) @@ -14928,10 +14928,10 @@ check_auto_cache_resize_epoch_markers(void) auto_size_ctl.apply_max_decrement = FALSE; auto_size_ctl.max_decrement = (1 * 1024 * 1024); - auto_size_ctl.epochs_before_eviction = 10; + auto_size_ctl.epochs_before_eviction = 10; auto_size_ctl.apply_empty_reserve = FALSE; - auto_size_ctl.empty_reserve = 0.05; + auto_size_ctl.empty_reserve = 0.05; result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); @@ -14958,7 +14958,7 @@ check_auto_cache_resize_epoch_markers(void) /* verify that we still have the expected number of entries in the cache, * and that the cache is of the expected size. */ - if ( pass ) { + if ( pass ) { if ( ( cache_ptr->max_cache_size != (8 * 1024 * 1024) ) || ( cache_ptr->min_clean_size != (4 * 1024 * 1024) )|| @@ -14982,7 +14982,7 @@ check_auto_cache_resize_epoch_markers(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_auto_cache_resize_epoch_markers() */ @@ -15083,7 +15083,7 @@ check_auto_cache_resize_input_errs(void) pass = TRUE; - /* allocate a cache, and set a reference automatic cache control + /* allocate a cache, and set a reference automatic cache control * configuration. Then feed H5C_set_cache_auto_resize_config() * invalid input, and verify that the correct error is returned, * and that the configuration is not modified. @@ -15099,7 +15099,7 @@ check_auto_cache_resize_input_errs(void) if ( pass ) { - result = H5C_set_cache_auto_resize_config(cache_ptr, + result = H5C_set_cache_auto_resize_config(cache_ptr, &ref_auto_size_ctl); if ( result != SUCCEED ) { @@ -15121,7 +15121,7 @@ check_auto_cache_resize_input_errs(void) if ( pass ) { - result = H5C_get_cache_auto_resize_config(cache_ptr, + result = H5C_get_cache_auto_resize_config(cache_ptr, &test_auto_size_ctl); if ( result != SUCCEED ) { @@ -15177,20 +15177,20 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C_set_cache_auto_resize_config(NULL, + result = H5C_set_cache_auto_resize_config(NULL, &invalid_auto_size_ctl); if ( result != FAIL ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_set_cache_auto_resize_config accepted NULL cache_ptr.\n"; } } if ( pass ) { - result = H5C_get_cache_auto_resize_config(cache_ptr, + result = H5C_get_cache_auto_resize_config(cache_ptr, &test_auto_size_ctl); if ( result != SUCCEED ) { @@ -15249,20 +15249,20 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C_set_cache_auto_resize_config(cache_ptr, + result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_set_cache_auto_resize_config accepted bad version.\n"; } } if ( pass ) { - result = H5C_get_cache_auto_resize_config(cache_ptr, + result = H5C_get_cache_auto_resize_config(cache_ptr, &test_auto_size_ctl); if ( result != SUCCEED ) { @@ -15294,7 +15294,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; - + invalid_auto_size_ctl.epoch_length = 5000; @@ -15322,20 +15322,20 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C_set_cache_auto_resize_config(cache_ptr, + result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_set_cache_auto_resize_config accepted bad init size 1.\n"; } } if ( pass ) { - result = H5C_get_cache_auto_resize_config(cache_ptr, + result = H5C_get_cache_auto_resize_config(cache_ptr, &test_auto_size_ctl); if ( result != SUCCEED ) { @@ -15364,7 +15364,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; - + invalid_auto_size_ctl.epoch_length = 5000; @@ -15392,20 +15392,20 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C_set_cache_auto_resize_config(cache_ptr, + result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_set_cache_auto_resize_config accepted bad init size 2.\n"; } } if ( pass ) { - result = H5C_get_cache_auto_resize_config(cache_ptr, + result = H5C_get_cache_auto_resize_config(cache_ptr, &test_auto_size_ctl); if ( result != SUCCEED ) { @@ -15436,7 +15436,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; - + invalid_auto_size_ctl.epoch_length = 5000; @@ -15464,20 +15464,20 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C_set_cache_auto_resize_config(cache_ptr, + result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_set_cache_auto_resize_config accepted bad min clean frac 1.\n"; } } if ( pass ) { - result = H5C_get_cache_auto_resize_config(cache_ptr, + result = H5C_get_cache_auto_resize_config(cache_ptr, &test_auto_size_ctl); if ( result != SUCCEED ) { @@ -15505,7 +15505,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; - + invalid_auto_size_ctl.epoch_length = 5000; @@ -15533,20 +15533,20 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C_set_cache_auto_resize_config(cache_ptr, + result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_set_cache_auto_resize_config accepted bad min clean frac 2.\n"; } } if ( pass ) { - result = H5C_get_cache_auto_resize_config(cache_ptr, + result = H5C_get_cache_auto_resize_config(cache_ptr, &test_auto_size_ctl); if ( result != SUCCEED ) { @@ -15606,20 +15606,20 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C_set_cache_auto_resize_config(cache_ptr, + result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_set_cache_auto_resize_config accepted bad max_size.\n"; } } if ( pass ) { - result = H5C_get_cache_auto_resize_config(cache_ptr, + result = H5C_get_cache_auto_resize_config(cache_ptr, &test_auto_size_ctl); if ( result != SUCCEED ) { @@ -15675,20 +15675,20 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C_set_cache_auto_resize_config(cache_ptr, + result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_set_cache_auto_resize_config accepted bad size pair.\n"; } } if ( pass ) { - result = H5C_get_cache_auto_resize_config(cache_ptr, + result = H5C_get_cache_auto_resize_config(cache_ptr, &test_auto_size_ctl); if ( result != SUCCEED ) { @@ -15744,20 +15744,20 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C_set_cache_auto_resize_config(cache_ptr, + result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_set_cache_auto_resize_config accepted bad min_size.\n"; } } if ( pass ) { - result = H5C_get_cache_auto_resize_config(cache_ptr, + result = H5C_get_cache_auto_resize_config(cache_ptr, &test_auto_size_ctl); if ( result != SUCCEED ) { @@ -15788,7 +15788,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; - + invalid_auto_size_ctl.epoch_length = H5C__MAX_AR_EPOCH_LENGTH + 1; /* INVALID */ @@ -15816,20 +15816,20 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C_set_cache_auto_resize_config(cache_ptr, + result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_set_cache_auto_resize_config accepted bad epoch len 1.\n"; } } if ( pass ) { - result = H5C_get_cache_auto_resize_config(cache_ptr, + result = H5C_get_cache_auto_resize_config(cache_ptr, &test_auto_size_ctl); if ( result != SUCCEED ) { @@ -15857,7 +15857,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; - + invalid_auto_size_ctl.epoch_length = H5C__MIN_AR_EPOCH_LENGTH - 1; /* INVALID */ @@ -15885,20 +15885,20 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C_set_cache_auto_resize_config(cache_ptr, + result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_set_cache_auto_resize_config accepted bad epoch len 2.\n"; } } if ( pass ) { - result = H5C_get_cache_auto_resize_config(cache_ptr, + result = H5C_get_cache_auto_resize_config(cache_ptr, &test_auto_size_ctl); if ( result != SUCCEED ) { @@ -15929,11 +15929,11 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; - + invalid_auto_size_ctl.epoch_length = 5000; - - invalid_auto_size_ctl.incr_mode = + + invalid_auto_size_ctl.incr_mode = (enum H5C_cache_incr_mode) -1; /* INVALID */ invalid_auto_size_ctl.lower_hr_threshold = 0.75; @@ -15958,20 +15958,20 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C_set_cache_auto_resize_config(cache_ptr, + result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_set_cache_auto_resize_config accepted bad incr_mode 1.\n"; } } if ( pass ) { - result = H5C_get_cache_auto_resize_config(cache_ptr, + result = H5C_get_cache_auto_resize_config(cache_ptr, &test_auto_size_ctl); if ( result != SUCCEED ) { @@ -15999,11 +15999,11 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; - + invalid_auto_size_ctl.epoch_length = 5000; - - invalid_auto_size_ctl.incr_mode = + + invalid_auto_size_ctl.incr_mode = (enum H5C_cache_incr_mode) 2; /* INVALID */ invalid_auto_size_ctl.lower_hr_threshold = 0.75; @@ -16028,20 +16028,20 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C_set_cache_auto_resize_config(cache_ptr, + result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_set_cache_auto_resize_config accepted bad incr_mode 2.\n"; } } if ( pass ) { - result = H5C_get_cache_auto_resize_config(cache_ptr, + result = H5C_get_cache_auto_resize_config(cache_ptr, &test_auto_size_ctl); if ( result != SUCCEED ) { @@ -16100,20 +16100,20 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C_set_cache_auto_resize_config(cache_ptr, + result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_set_cache_auto_resize_config accepted bad upper threshold.\n"; } } if ( pass ) { - result = H5C_get_cache_auto_resize_config(cache_ptr, + result = H5C_get_cache_auto_resize_config(cache_ptr, &test_auto_size_ctl); if ( result != SUCCEED ) { @@ -16169,20 +16169,20 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C_set_cache_auto_resize_config(cache_ptr, + result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_set_cache_auto_resize_config accepted bad threshold pair.\n"; } } if ( pass ) { - result = H5C_get_cache_auto_resize_config(cache_ptr, + result = H5C_get_cache_auto_resize_config(cache_ptr, &test_auto_size_ctl); if ( result != SUCCEED ) { @@ -16238,20 +16238,20 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C_set_cache_auto_resize_config(cache_ptr, + result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_set_cache_auto_resize_config accepted bad lower threshold.\n"; } } if ( pass ) { - result = H5C_get_cache_auto_resize_config(cache_ptr, + result = H5C_get_cache_auto_resize_config(cache_ptr, &test_auto_size_ctl); if ( result != SUCCEED ) { @@ -16282,7 +16282,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; - + invalid_auto_size_ctl.epoch_length = 5000; @@ -16311,20 +16311,20 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C_set_cache_auto_resize_config(cache_ptr, + result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_set_cache_auto_resize_config accepted bad increment.\n"; } } if ( pass ) { - result = H5C_get_cache_auto_resize_config(cache_ptr, + result = H5C_get_cache_auto_resize_config(cache_ptr, &test_auto_size_ctl); if ( result != SUCCEED ) { @@ -16355,9 +16355,9 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; - + invalid_auto_size_ctl.epoch_length = 5000; - + invalid_auto_size_ctl.incr_mode = H5C_incr__threshold; @@ -16369,7 +16369,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); - invalid_auto_size_ctl.decr_mode = + invalid_auto_size_ctl.decr_mode = (enum H5C_cache_decr_mode) -1; /* INVALID */ invalid_auto_size_ctl.upper_hr_threshold = 0.999; @@ -16384,20 +16384,20 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C_set_cache_auto_resize_config(cache_ptr, + result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_set_cache_auto_resize_config accepted bad decr_mode 1.\n"; } } if ( pass ) { - result = H5C_get_cache_auto_resize_config(cache_ptr, + result = H5C_get_cache_auto_resize_config(cache_ptr, &test_auto_size_ctl); if ( result != SUCCEED ) { @@ -16425,9 +16425,9 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; - + invalid_auto_size_ctl.epoch_length = 5000; - + invalid_auto_size_ctl.incr_mode = H5C_incr__threshold; @@ -16439,7 +16439,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.max_increment = (2 * 1024 * 1024); - invalid_auto_size_ctl.decr_mode = + invalid_auto_size_ctl.decr_mode = (enum H5C_cache_decr_mode) 4; /* INVALID */ invalid_auto_size_ctl.upper_hr_threshold = 0.999; @@ -16454,20 +16454,20 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C_set_cache_auto_resize_config(cache_ptr, + result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_set_cache_auto_resize_config accepted bad decr_mode 2.\n"; } } if ( pass ) { - result = H5C_get_cache_auto_resize_config(cache_ptr, + result = H5C_get_cache_auto_resize_config(cache_ptr, &test_auto_size_ctl); if ( result != SUCCEED ) { @@ -16498,7 +16498,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; - + invalid_auto_size_ctl.epoch_length = 5000; @@ -16526,20 +16526,20 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C_set_cache_auto_resize_config(cache_ptr, + result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_set_cache_auto_resize_config accepted bad decrement 1.\n"; } } if ( pass ) { - result = H5C_get_cache_auto_resize_config(cache_ptr, + result = H5C_get_cache_auto_resize_config(cache_ptr, &test_auto_size_ctl); if ( result != SUCCEED ) { @@ -16567,7 +16567,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; - + invalid_auto_size_ctl.epoch_length = 5000; @@ -16595,20 +16595,20 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C_set_cache_auto_resize_config(cache_ptr, + result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_set_cache_auto_resize_config accepted bad decrement 2.\n"; } } if ( pass ) { - result = H5C_get_cache_auto_resize_config(cache_ptr, + result = H5C_get_cache_auto_resize_config(cache_ptr, &test_auto_size_ctl); if ( result != SUCCEED ) { @@ -16639,7 +16639,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; - + invalid_auto_size_ctl.epoch_length = 5000; @@ -16667,7 +16667,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C_set_cache_auto_resize_config(cache_ptr, + result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -16679,7 +16679,7 @@ check_auto_cache_resize_input_errs(void) if ( pass ) { - result = H5C_get_cache_auto_resize_config(cache_ptr, + result = H5C_get_cache_auto_resize_config(cache_ptr, &test_auto_size_ctl); if ( result != SUCCEED ) { @@ -16707,7 +16707,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; - + invalid_auto_size_ctl.epoch_length = 5000; @@ -16730,13 +16730,13 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_max_decrement = TRUE; invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); - invalid_auto_size_ctl.epochs_before_eviction = + invalid_auto_size_ctl.epochs_before_eviction = H5C__MAX_EPOCH_MARKERS + 1; /* INVALID */ invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C_set_cache_auto_resize_config(cache_ptr, + result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -16748,7 +16748,7 @@ check_auto_cache_resize_input_errs(void) if ( pass ) { - result = H5C_get_cache_auto_resize_config(cache_ptr, + result = H5C_get_cache_auto_resize_config(cache_ptr, &test_auto_size_ctl); if ( result != SUCCEED ) { @@ -16779,7 +16779,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; - + invalid_auto_size_ctl.epoch_length = 5000; @@ -16807,7 +16807,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = -0.0000001; /* INVALID */ - result = H5C_set_cache_auto_resize_config(cache_ptr, + result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -16819,7 +16819,7 @@ check_auto_cache_resize_input_errs(void) if ( pass ) { - result = H5C_get_cache_auto_resize_config(cache_ptr, + result = H5C_get_cache_auto_resize_config(cache_ptr, &test_auto_size_ctl); if ( result != SUCCEED ) { @@ -16847,7 +16847,7 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.max_size = 16 * 1024 * 1024; invalid_auto_size_ctl.min_size = 1 * 1024 * 1024; - + invalid_auto_size_ctl.epoch_length = 5000; @@ -16870,13 +16870,13 @@ check_auto_cache_resize_input_errs(void) invalid_auto_size_ctl.apply_max_decrement = TRUE; invalid_auto_size_ctl.max_decrement = (1 * 1024 * 1024); - invalid_auto_size_ctl.epochs_before_eviction = + invalid_auto_size_ctl.epochs_before_eviction = H5C__MAX_EPOCH_MARKERS + 1; /* INVALID */ invalid_auto_size_ctl.apply_empty_reserve = TRUE; invalid_auto_size_ctl.empty_reserve = 0.05; - result = H5C_set_cache_auto_resize_config(cache_ptr, + result = H5C_set_cache_auto_resize_config(cache_ptr, &invalid_auto_size_ctl); if ( result != FAIL ) { @@ -16888,7 +16888,7 @@ check_auto_cache_resize_input_errs(void) if ( pass ) { - result = H5C_get_cache_auto_resize_config(cache_ptr, + result = H5C_get_cache_auto_resize_config(cache_ptr, &test_auto_size_ctl); if ( result != SUCCEED ) { @@ -16905,7 +16905,7 @@ check_auto_cache_resize_input_errs(void) } - /* finally, before we finish, try feeding + /* finally, before we finish, try feeding * H5C_get_cache_auto_resize_config invalid data. */ @@ -16916,7 +16916,7 @@ check_auto_cache_resize_input_errs(void) if ( result != FAIL ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_get_cache_auto_resize_config accepted NULL cache_ptr.\n"; } } @@ -16929,7 +16929,7 @@ check_auto_cache_resize_input_errs(void) if ( result != FAIL ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_get_cache_auto_resize_config accepted bad cache_ptr.\n"; } } @@ -16941,7 +16941,7 @@ check_auto_cache_resize_input_errs(void) if ( result != FAIL ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_get_cache_auto_resize_config accepted NULL config ptr.\n"; } } @@ -16954,7 +16954,7 @@ check_auto_cache_resize_input_errs(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_auto_cache_resize_input_errs() */ @@ -16963,7 +16963,7 @@ check_auto_cache_resize_input_errs(void) /*------------------------------------------------------------------------- * Function: check_auto_cache_resize_aux_fcns() * - * Purpose: Verify that the auxilary functions associated with + * Purpose: Verify that the auxilary functions associated with * the automatic cache resize capability are operating * correctly. These functions are: * @@ -17055,7 +17055,7 @@ check_auto_cache_resize_aux_fcns(void) if ( pass ) { - result = H5C_set_cache_auto_resize_config(cache_ptr, + result = H5C_set_cache_auto_resize_config(cache_ptr, &auto_size_ctl); if ( result != SUCCEED ) { @@ -17101,7 +17101,7 @@ check_auto_cache_resize_aux_fcns(void) } else if ( hit_rate != 0.0 ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_get_cache_hit_rate returned unexpected hit rate 1.\n"; } } @@ -17116,7 +17116,7 @@ check_auto_cache_resize_aux_fcns(void) if ( pass ) { - unprotect_entry(cache_ptr, PICO_ENTRY_TYPE, i, + unprotect_entry(cache_ptr, PICO_ENTRY_TYPE, i, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -17135,7 +17135,7 @@ check_auto_cache_resize_aux_fcns(void) } else if ( hit_rate != 0.0 ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_get_cache_hit_rate returned unexpected hit rate 2.\n"; } else if ( ( cache_ptr->cache_accesses != 1000 ) || @@ -17162,7 +17162,7 @@ check_auto_cache_resize_aux_fcns(void) if ( pass ) { - unprotect_entry(cache_ptr, PICO_ENTRY_TYPE, 0, + unprotect_entry(cache_ptr, PICO_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -17181,7 +17181,7 @@ check_auto_cache_resize_aux_fcns(void) } else if ( hit_rate != 0.5 ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_get_cache_hit_rate returned unexpected hit rate 3.\n"; } else if ( ( cache_ptr->cache_accesses != 2000 ) || @@ -17205,14 +17205,14 @@ check_auto_cache_resize_aux_fcns(void) if ( result != FAIL ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_reset_cache_hit_rate_stats accepted NULL cache_ptr.\n"; } else if ( ( cache_ptr->cache_accesses != 2000 ) || ( cache_ptr->cache_hits != 1000 ) ) { pass = FALSE; - failure_mssg = + failure_mssg = "Failed call to H5C_reset_cache_hit_rate_stats altered stats?\n"; } } @@ -17245,7 +17245,7 @@ check_auto_cache_resize_aux_fcns(void) if ( pass ) { - unprotect_entry(cache_ptr, PICO_ENTRY_TYPE, i + 500, + unprotect_entry(cache_ptr, PICO_ENTRY_TYPE, i + 500, NO_CHANGE, H5C__NO_FLAGS_SET); } i++; @@ -17265,7 +17265,7 @@ check_auto_cache_resize_aux_fcns(void) } else if ( hit_rate != 0.5 ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_get_cache_hit_rate returned unexpected hit rate 4.\n"; } else if ( ( cache_ptr->cache_accesses != 1000 ) || @@ -17282,15 +17282,15 @@ check_auto_cache_resize_aux_fcns(void) } } - /*************************************************** - * So much for testing H5C_get_cache_hit_rate() and - * H5C_reset_cache_hit_rate_stats(). Now on to + /*************************************************** + * So much for testing H5C_get_cache_hit_rate() and + * H5C_reset_cache_hit_rate_stats(). Now on to * H5C_get_cache_size(). ***************************************************/ if ( pass ) { - result = H5C_get_cache_size(NULL, &max_size, &min_clean_size, + result = H5C_get_cache_size(NULL, &max_size, &min_clean_size, &cur_size, &cur_num_entries); if ( result != FAIL ) { @@ -17307,7 +17307,7 @@ check_auto_cache_resize_aux_fcns(void) cur_size = 0; cur_num_entries = 0; - result = H5C_get_cache_size(cache_ptr, &max_size, &min_clean_size, + result = H5C_get_cache_size(cache_ptr, &max_size, &min_clean_size, &cur_size, &cur_num_entries); if ( result != SUCCEED ) { @@ -17318,25 +17318,25 @@ check_auto_cache_resize_aux_fcns(void) } else if ( max_size != (1 * 1024 * 1024) ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_get_cache_size reports unexpected max_size 1.\n"; } else if ( min_clean_size != (512 * 1024) ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_get_cache_size reports unexpected min_clean_size 1.\n"; } else if ( cur_size != (1500 * PICO_ENTRY_SIZE) ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_get_cache_size reports unexpected cur_size 1.\n"; } else if ( cur_num_entries != 1500 ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_get_cache_size reports unexpected cur_num_entries 1.\n"; } } @@ -17350,7 +17350,7 @@ check_auto_cache_resize_aux_fcns(void) } if ( pass ) { - unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, + unprotect_entry(cache_ptr, MONSTER_ENTRY_TYPE, 0, NO_CHANGE, H5C__NO_FLAGS_SET); } @@ -17361,7 +17361,7 @@ check_auto_cache_resize_aux_fcns(void) cur_size = 0; cur_num_entries = 0; - result = H5C_get_cache_size(cache_ptr, &max_size, &min_clean_size, + result = H5C_get_cache_size(cache_ptr, &max_size, &min_clean_size, &cur_size, &cur_num_entries); if ( result != SUCCEED ) { @@ -17372,26 +17372,26 @@ check_auto_cache_resize_aux_fcns(void) } else if ( max_size != (1 * 1024 * 1024) ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_get_cache_size reports unexpected max_size 2.\n"; } else if ( min_clean_size != (512 * 1024) ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_get_cache_size reports unexpected min_clean_size 2.\n"; - } else if ( cur_size != + } else if ( cur_size != ((1500 * PICO_ENTRY_SIZE) + MONSTER_ENTRY_SIZE) ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_get_cache_size reports unexpected cur_size 2.\n"; } else if ( cur_num_entries != 1501 ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_get_cache_size reports unexpected cur_num_entries 2.\n"; } } @@ -17413,7 +17413,7 @@ check_auto_cache_resize_aux_fcns(void) } else if ( max_size != (1 * 1024 * 1024) ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_get_cache_size reports unexpected max_size 3.\n"; } else if ( ( min_clean_size != 0 ) || @@ -17423,7 +17423,7 @@ check_auto_cache_resize_aux_fcns(void) pass = FALSE; failure_mssg = "Phantom returns from H5C_get_cache_size?\n"; - } + } } if ( pass ) { @@ -17433,7 +17433,7 @@ check_auto_cache_resize_aux_fcns(void) cur_size = 0; cur_num_entries = 0; - result = H5C_get_cache_size(cache_ptr, NULL, &min_clean_size, + result = H5C_get_cache_size(cache_ptr, NULL, &min_clean_size, NULL, NULL); if ( result != SUCCEED ) { @@ -17444,7 +17444,7 @@ check_auto_cache_resize_aux_fcns(void) } else if ( min_clean_size != (512 * 1024) ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_get_cache_size reports unexpected min_clean_size 4.\n"; } else if ( ( max_size != 0 ) || @@ -17454,7 +17454,7 @@ check_auto_cache_resize_aux_fcns(void) pass = FALSE; failure_mssg = "Phantom returns from H5C_get_cache_size?\n"; - } + } } if ( pass ) { @@ -17471,11 +17471,11 @@ check_auto_cache_resize_aux_fcns(void) pass = FALSE; failure_mssg = "H5C_get_cache_size failed 5.\n"; - } else if ( cur_size != + } else if ( cur_size != ((1500 * PICO_ENTRY_SIZE) + MONSTER_ENTRY_SIZE) ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_get_cache_size reports unexpected cur_size 5.\n"; } else if ( ( max_size != 0 ) || @@ -17485,7 +17485,7 @@ check_auto_cache_resize_aux_fcns(void) pass = FALSE; failure_mssg = "Phantom returns from H5C_get_cache_size?\n"; - } + } } if ( pass ) { @@ -17495,7 +17495,7 @@ check_auto_cache_resize_aux_fcns(void) cur_size = 0; cur_num_entries = 0; - result = H5C_get_cache_size(cache_ptr, NULL, NULL, NULL, + result = H5C_get_cache_size(cache_ptr, NULL, NULL, NULL, &cur_num_entries); if ( result != SUCCEED ) { @@ -17506,7 +17506,7 @@ check_auto_cache_resize_aux_fcns(void) } else if ( cur_num_entries != 1501 ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5C_get_cache_size reports unexpected cur_num_entries 2.\n"; } else if ( ( max_size != 0 ) || @@ -17516,7 +17516,7 @@ check_auto_cache_resize_aux_fcns(void) pass = FALSE; failure_mssg = "Phantom returns from H5C_get_cache_size?\n"; - } + } } if ( pass ) { @@ -17527,7 +17527,7 @@ check_auto_cache_resize_aux_fcns(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_auto_cache_resize_aux_fcns() */ @@ -17536,8 +17536,8 @@ check_auto_cache_resize_aux_fcns(void) /*------------------------------------------------------------------------- * Function: check_fapl_mdc_api_calls() * - * Purpose: Verify that the file access property list related - * metadata cache related API calls are functioning + * Purpose: Verify that the file access property list related + * metadata cache related API calls are functioning * correctly. * * Since we have tested the H5C code elsewhere, it should @@ -17621,7 +17621,7 @@ check_fapl_mdc_api_calls(void) H5AC_cache_config_t default_config = H5AC__DEFAULT_CACHE_CONFIG; H5AC_cache_config_t mod_config = { - /* int version = */ + /* int version = */ H5AC__CURR_CACHE_CONFIG_VERSION, /* hbool_t rpt_fcn_enabled = */ FALSE, /* hbool_t set_initial_size = */ TRUE, @@ -17689,7 +17689,7 @@ check_fapl_mdc_api_calls(void) } - /* Modify the initial mdc configuration in a FAPL, and verify that + /* Modify the initial mdc configuration in a FAPL, and verify that * the changes can be read back */ @@ -17732,16 +17732,16 @@ check_fapl_mdc_api_calls(void) } /* Open a file using the default FAPL. Verify that the resulting - * metadata cache uses the default configuration as well. Get a + * metadata cache uses the default configuration as well. Get a * copy of the FAPL from the file, and verify that it contains the - * default initial meta data cache configuration. Close and delete + * default initial meta data cache configuration. Close and delete * the file. */ /* setup the file name */ if ( pass ) { - if ( h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename)) + if ( h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename)) == NULL ) { pass = FALSE; @@ -17856,9 +17856,9 @@ check_fapl_mdc_api_calls(void) /* Open a file using a FAPL with a modified initial metadata cache - * configuration. Verify that the resulting metadata cache uses the - * modified configuration as well. Get a copy of the FAPL from the - * file, and verify that it contains the modified initial meta data + * configuration. Verify that the resulting metadata cache uses the + * modified configuration as well. Get a copy of the FAPL from the + * file, and verify that it contains the modified initial meta data * cache configuration. Close and delete the file. */ @@ -17890,7 +17890,7 @@ check_fapl_mdc_api_calls(void) /* setup the file name */ if ( pass ) { - if ( h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename)) + if ( h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename)) == NULL ) { pass = FALSE; @@ -18016,7 +18016,7 @@ check_fapl_mdc_api_calls(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_fapl_mdc_api_calls() */ @@ -18029,8 +18029,8 @@ check_fapl_mdc_api_calls(void) * has both internal and external configuration matching * *config_ptr. * - * Do nothin on success. On failure, set pass to FALSE, and - * load an error message into failue_mssg. Note that + * Do nothin on success. On failure, set pass to FALSE, and + * load an error message into failue_mssg. Note that * failure_msg is assumed to be at least 128 bytes in length. * * Return: void @@ -18083,7 +18083,7 @@ validate_mdc_config(hid_t file_id, ( cache_ptr->resize_ctl.version != H5C__CURR_AUTO_SIZE_CTL_VER ) ){ pass = FALSE; - HDsnprintf(msg, (size_t)128, + HDsnprintf(msg, (size_t)128, "Can't access cache resize_ctl #%d.", test_num); failure_mssg = msg; } @@ -18092,11 +18092,11 @@ validate_mdc_config(hid_t file_id, /* compare the cache's internal configuration with the expected value */ if ( pass ) { - if ( ! RESIZE_CONFIGS_ARE_EQUAL(int_config, cache_ptr->resize_ctl, + if ( ! RESIZE_CONFIGS_ARE_EQUAL(int_config, cache_ptr->resize_ctl, compare_init) ) { pass = FALSE; - HDsnprintf(msg, (size_t)128, + HDsnprintf(msg, (size_t)128, "Unexpected internal config #%d.", test_num); failure_mssg = msg; } @@ -18110,7 +18110,7 @@ validate_mdc_config(hid_t file_id, if ( H5Fget_mdc_config(file_id, &scratch) < 0 ) { pass = FALSE; - HDsnprintf(msg, (size_t)128, + HDsnprintf(msg, (size_t)128, "H5Fget_mdc_config() failed #%d.", test_num); failure_mssg = msg; } @@ -18125,7 +18125,7 @@ validate_mdc_config(hid_t file_id, * the supplied external configuration. * * The cache also sets the initial_size field to the current - * cache max size instead of the value initialy supplied. + * cache max size instead of the value initialy supplied. * Depending on circumstances, this may or may not match * the original. Hence the compare_init parameter. */ @@ -18133,7 +18133,7 @@ validate_mdc_config(hid_t file_id, FALSE, compare_init) ) { pass = FALSE; - HDsnprintf(msg, (size_t)128, + HDsnprintf(msg, (size_t)128, "Unexpected external config #%d.", test_num); failure_mssg = msg; } @@ -18147,7 +18147,7 @@ validate_mdc_config(hid_t file_id, /*------------------------------------------------------------------------- * Function: check_file_mdc_api_calls() * - * Purpose: Verify that the file related metadata cache API calls are + * Purpose: Verify that the file related metadata cache API calls are * functioning correctly. * * Since we have tested the H5C code elsewhere, it should @@ -18267,7 +18267,7 @@ check_file_mdc_api_calls(void) /* double increment = */ 2.0, /* hbool_t apply_max_increment = */ TRUE, /* size_t max_increment = */ (2 * 1024 * 1024), - /* enum H5C_cache_decr_mode decr_mode = */ + /* enum H5C_cache_decr_mode decr_mode = */ H5C_decr__age_out_with_threshold, /* double upper_hr_threshold = */ 0.999, /* double decrement = */ 0.9, @@ -18293,7 +18293,7 @@ check_file_mdc_api_calls(void) /* setup the file name */ if ( pass ) { - if ( h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename)) + if ( h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename)) == NULL ) { pass = FALSE; @@ -18369,8 +18369,8 @@ check_file_mdc_api_calls(void) validate_mdc_config(file_id, &mod_config_4, TRUE, 5); - /* Run some quick smoke checks on the cache status monitoring - * calls -- no interesting data as the cache hasn't had a + /* Run some quick smoke checks on the cache status monitoring + * calls -- no interesting data as the cache hasn't had a * chance to do much yet. */ @@ -18384,14 +18384,14 @@ check_file_mdc_api_calls(void) } else if ( hit_rate != 0.0 ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5Fget_mdc_hit_rate() returned unexpected hit rate.\n"; - } + } #if 0 /* this may be useful now and then -- keep it around */ else { - HDfprintf(stdout, + HDfprintf(stdout, "H5Fget_mdc_hit_rate() reports hit_rate = %lf:\n", hit_rate); } @@ -18400,7 +18400,7 @@ check_file_mdc_api_calls(void) if ( pass ) { - if ( H5Fget_mdc_size(file_id, &max_size, &min_clean_size, + if ( H5Fget_mdc_size(file_id, &max_size, &min_clean_size, &cur_size, &cur_num_entries) < 0 ) { pass = FALSE; @@ -18413,7 +18413,7 @@ check_file_mdc_api_calls(void) pass = FALSE; failure_mssg = "H5Fget_mdc_size() returned unexpected value(s).\n"; - } + } #if 0 /* this may be useful now and then -- keep it around */ else { @@ -18444,7 +18444,7 @@ check_file_mdc_api_calls(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_file_mdc_api_calls() */ @@ -18454,18 +18454,18 @@ check_file_mdc_api_calls(void) * Function: check_and_validate_cache_hit_rate() * * Purpose: Use the API functions to get and reset the cache hit rate. - * Verify that the value returned by the API call agrees with + * Verify that the value returned by the API call agrees with * the cache internal data structures. * * If the number of cache accesses exceeds the value provided * in the min_accesses parameter, and the hit rate is less than - * min_hit_rate, set pass to FALSE, and set failure_mssg to + * min_hit_rate, set pass to FALSE, and set failure_mssg to * a string indicating that hit rate was unexpectedly low. * * Return hit rate in *hit_rate_ptr, and print the data to * stdout if requested. * - * If an error is detected, set pass to FALSE, and set + * If an error is detected, set pass to FALSE, and set * failure_mssg to an appropriate value. * * Return: void @@ -18551,7 +18551,7 @@ check_and_validate_cache_hit_rate(hid_t file_id, } if ( pass ) { /* reset the hit rate */ - + result = H5Freset_mdc_hit_rate_stats(file_id); if ( result < 0 ) { @@ -18570,13 +18570,13 @@ check_and_validate_cache_hit_rate(hid_t file_id, /* dump data to stdout if requested */ if ( ( pass ) && ( dump_data ) ) { - HDfprintf(stdout, + HDfprintf(stdout, "cache_hits: %ld, cache_accesses: %ld, hit_rate: %lf\n", (long)cache_hits, (long)cache_accesses, hit_rate); } - if ( ( pass ) && - ( cache_accesses > min_accesses ) && + if ( ( pass ) && + ( cache_accesses > min_accesses ) && ( hit_rate < min_hit_rate ) ) { pass = FALSE; @@ -18591,15 +18591,15 @@ check_and_validate_cache_hit_rate(hid_t file_id, /*------------------------------------------------------------------------- * Function: check_and_validate_cache_size() * - * Purpose: Use the API function to get the cache size data. Verify - * that the values returned by the API call agree with + * Purpose: Use the API function to get the cache size data. Verify + * that the values returned by the API call agree with * the cache internal data structures. * * Return size data in the locations specified by the pointer - * parameters if these parameters are not NULL. Print the + * parameters if these parameters are not NULL. Print the * data to stdout if requested. * - * If an error is detected, set pass to FALSE, and set + * If an error is detected, set pass to FALSE, and set * failure_mssg to an appropriate value. * * Return: void @@ -18715,7 +18715,7 @@ check_and_validate_cache_size(hid_t file_id, /* dump data to stdout if requested */ if ( ( pass ) && ( dump_data ) ) { - HDfprintf(stdout, + HDfprintf(stdout, "max_sz: %ld, min_clean_sz: %ld, cur_sz: %ld, cur_ent: %ld\n", (long)max_size, (long)min_clean_size, (long)cur_size, (long)cur_num_entries); @@ -18729,7 +18729,7 @@ check_and_validate_cache_size(hid_t file_id, /*------------------------------------------------------------------------- * Function: mdc_api_call_smoke_check() * - * Purpose: + * Purpose: * * Return: void * @@ -18749,7 +18749,7 @@ check_and_validate_cache_size(hid_t file_id, static void mdc_api_call_smoke_check(void) { - const char * fcn_name = "mdc_api_call_smoke_check()"; + const char * fcn_name = "mdc_api_call_smoke_check()"; char filename[512]; hbool_t valid_chunk; hbool_t dump_hit_rate = FALSE; @@ -18852,14 +18852,14 @@ mdc_api_call_smoke_check(void) * configured as per the default both by looking at its internal * configuration, and via the H5Fget_mdc_config() call. * - * Then set the cache to mod_config_1, which fixes cache size at - * 500000 bytes, and turns off automatic cache resize. + * Then set the cache to mod_config_1, which fixes cache size at + * 500000 bytes, and turns off automatic cache resize. */ /* setup the file name */ if ( pass ) { - if ( h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename)) + if ( h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename)) == NULL ) { pass = FALSE; @@ -19003,13 +19003,13 @@ mdc_api_call_smoke_check(void) /* initialize all datasets on a round robin basis */ i = 0; - while ( ( pass ) && ( i < DSET_SIZE ) ) + while ( ( pass ) && ( i < DSET_SIZE ) ) { j = 0; - while ( ( pass ) && ( j < DSET_SIZE ) ) + while ( ( pass ) && ( j < DSET_SIZE ) ) { m = 0; - while ( ( pass ) && ( m < NUM_DSETS ) ) + while ( ( pass ) && ( m < NUM_DSETS ) ) { /* initialize the slab */ for ( k = 0; k < CHUNK_SIZE; k++ ) @@ -19049,10 +19049,10 @@ mdc_api_call_smoke_check(void) j += CHUNK_SIZE; } - /* check the cache hit rate, and reset the counters. - * Hit rate should be just about unity here, so we will just + /* check the cache hit rate, and reset the counters. + * Hit rate should be just about unity here, so we will just * get the data and (possibly) print it without checking it - * beyond ensuring that it agrees with the cache internal + * beyond ensuring that it agrees with the cache internal * data structures. * * similarly, check cache size. @@ -19063,7 +19063,7 @@ mdc_api_call_smoke_check(void) check_and_validate_cache_hit_rate(file_id, NULL, dump_hit_rate, min_accesses, min_hit_rate); - check_and_validate_cache_size(file_id, NULL, NULL, NULL, NULL, + check_and_validate_cache_size(file_id, NULL, NULL, NULL, NULL, dump_cache_size); } @@ -19107,7 +19107,7 @@ mdc_api_call_smoke_check(void) /* read the chunk from file */ if ( pass ) { - + status = H5Dread(dataset_ids[m], H5T_NATIVE_INT, memspace_id, filespace_ids[m], H5P_DEFAULT, data_chunk); @@ -19128,17 +19128,17 @@ mdc_api_call_smoke_check(void) { if ( data_chunk[k][l] != - ((DSET_SIZE * DSET_SIZE * m) + + ((DSET_SIZE * DSET_SIZE * m) + (DSET_SIZE * (i + k)) + j + l) ) { valid_chunk = FALSE; #if 0 /* this will be useful from time to time -- lets keep it*/ - HDfprintf(stdout, + HDfprintf(stdout, "data_chunk[%0d][%0d] = %0d, expect %0d.\n", - k, l, data_chunk[k][l], + k, l, data_chunk[k][l], ((DSET_SIZE * DSET_SIZE * m) + (DSET_SIZE * (i + k)) + j + l)); - HDfprintf(stdout, + HDfprintf(stdout, "m = %d, i = %d, j = %d, k = %d, l = %d\n", m, i, j, k, l); #endif @@ -19162,7 +19162,7 @@ mdc_api_call_smoke_check(void) check_and_validate_cache_hit_rate(file_id, NULL, dump_hit_rate, min_accesses, min_hit_rate); - check_and_validate_cache_size(file_id, NULL, NULL, NULL, NULL, + check_and_validate_cache_size(file_id, NULL, NULL, NULL, NULL, dump_cache_size); } @@ -19171,7 +19171,7 @@ mdc_api_call_smoke_check(void) /* close the file spaces we are done with */ i = 1; - while ( ( pass ) && ( i < NUM_DSETS ) ) + while ( ( pass ) && ( i < NUM_DSETS ) ) { if ( H5Sclose(filespace_ids[i]) < 0 ) { @@ -19231,7 +19231,7 @@ mdc_api_call_smoke_check(void) /* read the chunk from file */ if ( pass ) { - + status = H5Dread(dataset_ids[m], H5T_NATIVE_INT, memspace_id, filespace_ids[m], H5P_DEFAULT, data_chunk); @@ -19252,14 +19252,14 @@ mdc_api_call_smoke_check(void) { if ( data_chunk[k][l] != - ((DSET_SIZE * DSET_SIZE * m) + + ((DSET_SIZE * DSET_SIZE * m) + (DSET_SIZE * (i + k)) + j + l) ) { valid_chunk = FALSE; } #if 0 /* this will be useful from time to time -- lets keep it */ HDfprintf(stdout, "data_chunk[%0d][%0d] = %0d, expect %0d.\n", - k, l, data_chunk[k][l], + k, l, data_chunk[k][l], ((DSET_SIZE * DSET_SIZE * m) + (DSET_SIZE * (i + k)) + j + l)); #endif @@ -19282,7 +19282,7 @@ mdc_api_call_smoke_check(void) check_and_validate_cache_hit_rate(file_id, NULL, dump_hit_rate, min_accesses, min_hit_rate); - check_and_validate_cache_size(file_id, NULL, NULL, NULL, NULL, + check_and_validate_cache_size(file_id, NULL, NULL, NULL, NULL, dump_cache_size); } @@ -19337,7 +19337,7 @@ mdc_api_call_smoke_check(void) pass = FALSE; failure_mssg = "H5Fclose() failed.\n"; - } + } else if ( HDremove(filename) < 0 ) { pass = FALSE; @@ -19348,7 +19348,7 @@ mdc_api_call_smoke_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); } /* mdc_api_call_smoke_check() */ @@ -20080,7 +20080,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] = static void check_fapl_mdc_api_errs(void) { - const char * fcn_name = "check_fapl_mdc_api_errs()"; + const char * fcn_name = "check_fapl_mdc_api_errs()"; static char msg[128]; int i; herr_t result; @@ -20108,8 +20108,8 @@ check_fapl_mdc_api_errs(void) } } - /* Create a FAPL for test purposes, and veify that it contains the - * default MDC configuration. + /* Create a FAPL for test purposes, and veify that it contains the + * default MDC configuration. */ if ( pass ) { @@ -20134,8 +20134,8 @@ check_fapl_mdc_api_errs(void) if ( pass ) { - H5E_BEGIN_TRY { - result = H5Pget_mdc_config(fapl_id, NULL); + H5E_BEGIN_TRY { + result = H5Pget_mdc_config(fapl_id, NULL); } H5E_END_TRY; if ( result >= 0 ) { @@ -20150,8 +20150,8 @@ check_fapl_mdc_api_errs(void) scratch.version = -1; /* a convenient, invalid value */ if ( pass ) { - H5E_BEGIN_TRY { - result = H5Pget_mdc_config(fapl_id, &scratch); + H5E_BEGIN_TRY { + result = H5Pget_mdc_config(fapl_id, &scratch); } H5E_END_TRY; if ( result >= 0 ) { @@ -20168,7 +20168,7 @@ check_fapl_mdc_api_errs(void) scratch.version = H5C__CURR_AUTO_SIZE_CTL_VER; if ( pass ) { - H5E_BEGIN_TRY { + H5E_BEGIN_TRY { result = H5Pset_mdc_config(-1, &default_config); } H5E_END_TRY; @@ -20181,7 +20181,7 @@ check_fapl_mdc_api_errs(void) if ( pass ) { - H5E_BEGIN_TRY { + H5E_BEGIN_TRY { result = H5Pset_mdc_config(fapl_id, NULL); } H5E_END_TRY; @@ -20195,7 +20195,7 @@ check_fapl_mdc_api_errs(void) i = 0; while ( ( pass ) && ( i < NUM_INVALID_CONFIGS ) ) { - H5E_BEGIN_TRY { + H5E_BEGIN_TRY { result = H5Pset_mdc_config(fapl_id, &(invalid_configs[i])); } H5E_END_TRY; @@ -20224,7 +20224,7 @@ check_fapl_mdc_api_errs(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_fapl_mdc_api_errs() */ @@ -20249,7 +20249,7 @@ check_fapl_mdc_api_errs(void) static void check_file_mdc_api_errs(void) { - const char * fcn_name = "check_file_mdc_api_errs()"; + const char * fcn_name = "check_file_mdc_api_errs()"; char filename[512]; static char msg[128]; int i; @@ -20267,14 +20267,14 @@ check_file_mdc_api_errs(void) pass = TRUE; - /* Create a file for test purposes, and veify that its metadata cache - * set to the default MDC configuration. + /* Create a file for test purposes, and veify that its metadata cache + * set to the default MDC configuration. */ /* setup the file name */ if ( pass ) { - if ( h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename)) + if ( h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename)) == NULL ) { pass = FALSE; @@ -20301,8 +20301,8 @@ check_file_mdc_api_errs(void) scratch.version = H5C__CURR_AUTO_SIZE_CTL_VER; if ( pass ) { - H5E_BEGIN_TRY { - result = H5Fget_mdc_config(-1, &scratch); + H5E_BEGIN_TRY { + result = H5Fget_mdc_config(-1, &scratch); } H5E_END_TRY; if ( result >= 0 ) { @@ -20314,8 +20314,8 @@ check_file_mdc_api_errs(void) if ( pass ) { - H5E_BEGIN_TRY { - result = H5Fget_mdc_config(file_id, NULL); + H5E_BEGIN_TRY { + result = H5Fget_mdc_config(file_id, NULL); } H5E_END_TRY; if ( result >= 0 ) { @@ -20328,8 +20328,8 @@ check_file_mdc_api_errs(void) scratch.version = -1; /* a convenient, invalid value */ if ( pass ) { - H5E_BEGIN_TRY { - result = H5Fget_mdc_config(file_id, &scratch); + H5E_BEGIN_TRY { + result = H5Fget_mdc_config(file_id, &scratch); } H5E_END_TRY; if ( result >= 0 ) { @@ -20345,7 +20345,7 @@ check_file_mdc_api_errs(void) scratch.version = H5C__CURR_AUTO_SIZE_CTL_VER; if ( pass ) { - H5E_BEGIN_TRY { + H5E_BEGIN_TRY { result = H5Fset_mdc_config(-1, &default_config); } H5E_END_TRY; @@ -20358,7 +20358,7 @@ check_file_mdc_api_errs(void) if ( pass ) { - H5E_BEGIN_TRY { + H5E_BEGIN_TRY { result = H5Fset_mdc_config(file_id, NULL); } H5E_END_TRY; @@ -20372,7 +20372,7 @@ check_file_mdc_api_errs(void) i = 0; while ( ( pass ) && ( i < NUM_INVALID_CONFIGS ) ) { - H5E_BEGIN_TRY { + H5E_BEGIN_TRY { result = H5Fset_mdc_config(file_id, &(invalid_configs[i])); } H5E_END_TRY; @@ -20395,7 +20395,7 @@ check_file_mdc_api_errs(void) /* test H5Fget_mdc_hit_rate() */ if ( pass ) { - H5E_BEGIN_TRY { + H5E_BEGIN_TRY { result = H5Fget_mdc_hit_rate(-1, &hit_rate); } H5E_END_TRY; @@ -20408,7 +20408,7 @@ check_file_mdc_api_errs(void) if ( pass ) { - H5E_BEGIN_TRY { + H5E_BEGIN_TRY { result = H5Fget_mdc_hit_rate(file_id, NULL); } H5E_END_TRY; @@ -20423,14 +20423,14 @@ check_file_mdc_api_errs(void) /* test H5Freset_mdc_hit_rate_stats() */ if ( pass ) { - H5E_BEGIN_TRY { + H5E_BEGIN_TRY { result = H5Freset_mdc_hit_rate_stats(-1); } H5E_END_TRY; if ( result >= 0 ) { pass = FALSE; - failure_mssg = + failure_mssg = "H5Freset_mdc_hit_rate_stats() accepted bad file_id."; } } @@ -20439,8 +20439,8 @@ check_file_mdc_api_errs(void) /* test H5Fget_mdc_size() */ if ( pass ) { - H5E_BEGIN_TRY { - result = H5Fget_mdc_size(-1, &max_size, &min_clean_size, + H5E_BEGIN_TRY { + result = H5Fget_mdc_size(-1, &max_size, &min_clean_size, &cur_size, &cur_num_entries); } H5E_END_TRY; @@ -20454,7 +20454,7 @@ check_file_mdc_api_errs(void) if ( pass ) { if ( ( H5Fget_mdc_size(file_id, &max_size, NULL, NULL, NULL) < 0 ) || - ( H5Fget_mdc_size(file_id, NULL, &min_clean_size, + ( H5Fget_mdc_size(file_id, NULL, &min_clean_size, NULL, NULL) < 0 ) || ( H5Fget_mdc_size(file_id, NULL, NULL, &cur_size, NULL) < 0 ) || ( H5Fget_mdc_size(file_id, NULL, NULL, NULL, @@ -20485,7 +20485,7 @@ check_file_mdc_api_errs(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_file_mdc_api_errs() */ @@ -20496,9 +20496,9 @@ check_file_mdc_api_errs(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/createnoenc.c b/test/createnoenc.c index f444df6..05a2ff1 100644 --- a/test/createnoenc.c +++ b/test/createnoenc.c @@ -77,4 +77,4 @@ main() H5Dclose(dset_id); H5Sclose(space_id); H5Fclose(file_id); -} \ No newline at end of file +} 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 5ea5ac4..7777e43 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -91,7 +91,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 @@ -102,7 +102,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 */ @@ -143,13 +143,13 @@ 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); 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); -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); @@ -193,7 +193,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. @@ -223,7 +223,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. @@ -231,7 +231,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 @@ -280,23 +280,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); @@ -339,11 +339,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++) @@ -351,7 +351,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; @@ -369,7 +369,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; @@ -402,7 +402,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++) { @@ -413,7 +413,7 @@ test_simple_io(hid_t fapl) goto error; } } - } + } HDclose(f); @@ -429,7 +429,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 * @@ -452,17 +452,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; @@ -487,7 +487,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++) { @@ -498,7 +498,7 @@ test_userblock_offset(hid_t fapl) goto error; } } - } + } HDclose(f); @@ -513,17 +513,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: * @@ -548,7 +548,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; @@ -565,23 +565,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); @@ -589,7 +589,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; @@ -620,7 +620,7 @@ test_compact_io(hid_t fapl) error: return -1; } - + /*------------------------------------------------------------------------- * Function: test_max_compact @@ -631,8 +631,8 @@ test_compact_io(hid_t fapl) * * Failure: -1 * - * Programmer: Raymond Lu - * August 8, 2002 + * Programmer: Raymond Lu + * August 8, 2002 * * Modifications: * @@ -655,14 +655,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); @@ -680,7 +680,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; @@ -694,7 +694,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; @@ -720,7 +720,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; @@ -741,7 +741,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); @@ -782,13 +782,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; @@ -804,21 +804,21 @@ test_conv_buffer(hid_t fid) size_t size; 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; @@ -829,7 +829,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; @@ -844,12 +844,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; @@ -857,7 +857,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))); @@ -894,14 +894,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 @@ -933,7 +933,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; @@ -1035,7 +1035,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) { @@ -1120,7 +1120,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) { @@ -1173,11 +1173,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 * @@ -1191,7 +1191,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) { @@ -1201,7 +1201,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]; @@ -1215,14 +1215,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) @@ -1235,9 +1235,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 @@ -1246,23 +1246,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 @@ -1271,14 +1271,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; } @@ -1303,7 +1303,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 */ @@ -1337,7 +1337,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(); @@ -1347,18 +1347,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 { @@ -1437,7 +1437,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32, } } } - + PASSED(); /*---------------------------------------------------------------------- @@ -1445,10 +1445,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 { @@ -1495,7 +1495,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(); @@ -1503,27 +1503,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 { @@ -1547,15 +1547,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)"); @@ -1569,21 +1569,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 { @@ -1593,7 +1593,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= size of int */ for (i= 0;i< size[0]; i++) - for (j = 0; j < size[1]; j++) { - orig_data[i][j] = ((long_long)HDrandom() % + for (j = 0; j < size[1]; j++) { + orig_data[i][j] = ((long_long)HDrandom() % (long_long)HDpow(2.0, precision - 1)) << offset; /* even-numbered values are negtive */ - if((i*size[1]+j+1)%2 == 0) + if((i*size[1]+j+1)%2 == 0) orig_data[i][j] = -orig_data[i][j]; } @@ -2615,9 +2615,9 @@ test_nbit_int(hid_t file) new_data)<0) goto error; - /* Check that the values read are the same as the values written - * Use mask for checking the significant bits, ignoring the padding bits - */ + /* Check that the values read are the same as the values written + * Use mask for checking the significant bits, ignoring the padding bits + */ mask = ~(~0 << (precision + offset)) & (~0 << offset); for (i=0; i= size of unsigned int */ for (i= 0;i< size[0]; i++) - for (j = 0; j < size[1]; j++) + for (j = 0; j < size[1]; j++) for (m = 0; m < adims[0]; m++) for (n = 0; n < adims[1]; n++) - orig_data[i][j][m][n] = ((long_long)HDrandom() % + orig_data[i][j][m][n] = ((long_long)HDrandom() % (long_long)HDpow(2.0, precision)) << offset; PASSED(); #else @@ -3024,19 +3024,19 @@ test_nbit_array(hid_t file) new_data)<0) goto error; - /* Check that the values read are the same as the values written + /* Check that the values read are the same as the values written */ - for (i=0; i= size of member datatypes */ for (i= 0;i< size[0]; i++) for (j = 0; j < size[1]; j++) { - orig_data[i][j].i = ((long_long)HDrandom() % + orig_data[i][j].i = ((long_long)HDrandom() % (long_long)HDpow(2.0, precision[0]-1)) << offset[0]; - orig_data[i][j].c = ((long_long)HDrandom() % + orig_data[i][j].c = ((long_long)HDrandom() % (long_long)HDpow(2.0, precision[1]-1)) << offset[1]; - orig_data[i][j].s = ((long_long)HDrandom() % + orig_data[i][j].s = ((long_long)HDrandom() % (long_long)HDpow(2.0, precision[2]-1)) << offset[2]; orig_data[i][j].f = float_val[i][j]; @@ -3216,7 +3216,7 @@ test_nbit_compound(hid_t file) new_data)<0) goto error; - /* Check that the values read are the same as the values written + /* Check that the values read are the same as the values written * Use mask for checking the significant bits, ignoring the padding bits */ i_mask = ~(~0 << (precision[0] + offset[0])) & (~0 << offset[0]); @@ -3224,8 +3224,8 @@ test_nbit_compound(hid_t file) s_mask = ~(~0 << (precision[2] + offset[2])) & (~0 << offset[2]); for (i=0; i= size of member datatypes */ for (i= 0;i< size[0]; i++) for (j = 0; j < size[1]; j++) { - orig_data[i][j].a.i = ((long_long)HDrandom() % + orig_data[i][j].a.i = ((long_long)HDrandom() % (long_long)HDpow(2.0, precision[0]-1)) << offset[0]; - orig_data[i][j].a.c = ((long_long)HDrandom() % + orig_data[i][j].a.c = ((long_long)HDrandom() % (long_long)HDpow(2.0, precision[1]-1)) << offset[1]; - orig_data[i][j].a.s = -((long_long)HDrandom() % + orig_data[i][j].a.s = -((long_long)HDrandom() % (long_long)HDpow(2.0, precision[2]-1)) << offset[2]; orig_data[i][j].a.f = float_val[i][j]; - orig_data[i][j].v = ((long_long)HDrandom() % + orig_data[i][j].v = ((long_long)HDrandom() % (long_long)HDpow(2.0, precision[3])) << offset[3]; for(m = 0; m < array_dims[0]; m++) @@ -3476,7 +3476,7 @@ test_nbit_compound_2(hid_t file) new_data)<0) goto error; - /* Check that the values read are the same as the values written + /* Check that the values read are the same as the values written * Use mask for checking the significant bits, ignoring the padding bits */ i_mask = ~(~0 << (precision[0] + offset[0])) & (~0 << offset[0]); @@ -3516,10 +3516,10 @@ test_nbit_compound_2(hid_t file) printf(" Read different values than written.\n"); printf(" At index %lu,%lu\n", (unsigned long)i, (unsigned long)j); goto error; - } + } } } - + /*---------------------------------------------------------------------- * Cleanup *---------------------------------------------------------------------- @@ -3601,7 +3601,7 @@ test_nbit_compound_3(hid_t file) i_tid=H5Tcopy(H5T_NATIVE_INT); if(H5Tset_precision(i_tid, 17)<0) goto error; - str_tid=H5Tcopy(H5T_C_S1); + str_tid=H5Tcopy(H5T_C_S1); if(H5Tset_size(str_tid,30)<0) goto error; vl_str_tid = H5Tcopy(H5T_C_S1); @@ -3700,10 +3700,10 @@ test_nbit_compound_3(hid_t file) printf(" Read different values than written.\n"); printf(" At index %lu\n", (unsigned long)i); goto error; - } + } for(k=0; k 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"); @@ -719,12 +719,12 @@ test_derived_flt(void) if(H5Tget_precision(tid1)!=42) { H5_FAILED(); printf("Can't get precision or wrong precision\n"); - goto error; + goto error; } if(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(); @@ -734,7 +734,7 @@ test_derived_flt(void) if(H5Tget_ebias(tid1)!=511) { H5_FAILED(); printf("Can't get exponent bias or wrong bias\n"); - goto error; + goto error; } /* Convert data from native integer to the 1st derived floating-point type. @@ -754,16 +754,16 @@ test_derived_flt(void) /* Convert data from native integer to derived floating-point type. * The mantissa is big enough to retain the integer's precision. */ - if(H5Tconvert(H5T_NATIVE_INT, tid1, nelmts, buf, NULL, dxpl_id)<0) { + if(H5Tconvert(H5T_NATIVE_INT, tid1, nelmts, buf, NULL, dxpl_id)<0) { H5_FAILED(); printf("Can't convert data\n"); - goto error; + goto error; } /* Convert data from the derived floating-point type back to native integer. */ - if(H5Tconvert(tid1, H5T_NATIVE_INT, nelmts, buf, NULL, dxpl_id)<0) { + if(H5Tconvert(tid1, H5T_NATIVE_INT, nelmts, buf, NULL, dxpl_id)<0) { H5_FAILED(); printf("Can't convert data\n"); - goto error; + goto error; } /* Are the values still the same?*/ @@ -772,7 +772,7 @@ 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*/ /* Print errors */ if (0==fails_this_test++) { @@ -807,16 +807,16 @@ test_derived_flt(void) if(buf) free(buf); if(saved_buf) free(saved_buf); if(aligned) free(aligned); - buf = NULL; + buf = NULL; saved_buf = NULL; aligned = NULL; /*-------------------------------------------------------------------------- * 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 *--------------------------------------------------------------------------*/ @@ -824,7 +824,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"); @@ -881,12 +881,12 @@ test_derived_flt(void) if(H5Tget_precision(tid2)!=24) { H5_FAILED(); printf("Can't get precision or wrong precision\n"); - goto error; + goto error; } if(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(); @@ -896,7 +896,7 @@ test_derived_flt(void) if(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. @@ -915,18 +915,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?*/ @@ -935,10 +935,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) || @@ -999,7 +999,7 @@ test_derived_flt(void) PASSED(); reset_hdf5(); /*print statistics*/ - + return 0; error: @@ -1024,17 +1024,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; @@ -1057,43 +1057,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) { @@ -1105,13 +1105,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) { @@ -1119,7 +1119,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"); @@ -1135,12 +1135,12 @@ test_derived_integer(void) if(H5Tget_precision(tid1)!=24) { H5_FAILED(); printf("Can't get precision or wrong precision\n"); - goto error; + goto error; } if(H5Tget_offset(tid1)!=0) { H5_FAILED(); printf("Can't get offset or wrong offset\n"); - goto error; + goto error; } if(H5Tget_size(tid1)!=3) { H5_FAILED(); @@ -1157,34 +1157,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"); @@ -1196,16 +1196,16 @@ test_derived_integer(void) printf("Can't open datatype\n"); goto error; } - + if(H5Tget_precision(tid2)!=48) { H5_FAILED(); printf("Can't get precision or wrong precision\n"); - goto error; + goto error; } if(H5Tget_offset(tid2)!=10) { H5_FAILED(); printf("Can't get offset or wrong offset\n"); - goto error; + goto error; } if(H5Tget_size(tid2)!=8) { H5_FAILED(); @@ -1234,18 +1234,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?*/ @@ -1254,7 +1254,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++) { @@ -1307,7 +1307,7 @@ test_derived_integer(void) PASSED(); reset_hdf5(); /*print statistics*/ - + return 0; error: @@ -1383,7 +1383,7 @@ 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"; @@ -1419,7 +1419,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) src_type_name = "UNKNOWN"; src_type = OTHER; } - + if (H5Tequal(dst, H5T_NATIVE_SCHAR)) { dst_type_name = "signed char"; dst_type = INT_SCHAR; @@ -1470,7 +1470,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) HDfflush(stdout); fails_this_test=0; } - + /* Some information about datatypes */ endian = H5Tget_order(H5T_NATIVE_INT); src_size = H5Tget_size(src); @@ -1995,7 +1995,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst) */ for (k=0; k FLT_MAX; } else if (FLT_DOUBLE==dst_type) { - hw_d = *((long double*)aligned); + hw_d = *((long double*)aligned); hw = (unsigned char*)&hw_d; underflow = HDfabsl(*((long double*)aligned)) < DBL_MIN; overflow = HDfabsl(*((long double*)aligned)) > DBL_MAX; @@ -2731,11 +2731,11 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) } /* For Intel machines, the size of "long double" is 12 bytes, precision - * is 80 bits; for Intel IA64 and AMD processors, the size of "long double" - * is 16 bytes, precision is 80 bits. During hardware conversion, the - * last few unused bytes may have garbage in them. Clean them out with + * is 80 bits; for Intel IA64 and AMD processors, the size of "long double" + * is 16 bytes, precision is 80 bits. During hardware conversion, the + * last few unused bytes may have garbage in them. Clean them out with * 0s before compare the values. - */ + */ #if H5_SIZEOF_LONG_DOUBLE !=0 if(endian==H5T_ORDER_LE && dst_type==FLT_LDOUBLE) { unsigned int q; @@ -2791,7 +2791,7 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) * If the src number is smaller than the dst MIN float number, * consider it okay if the converted sw and hw dst are both * less than or equal to the dst MIN float number. - * If overflow happens when the src value is greater than + * If overflow happens when the src value is greater than * the maximum dst value, the library assign INFINITY to dst. * This might be different from what the compiler does, i.e. * the SGI compiler assigns the dst's maximal value. @@ -2799,14 +2799,14 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) { double check_mant[2]; int check_expo[2]; - + if (FLT_FLOAT==dst_type) { float x; HDmemcpy(&x, &buf[j*dst_size], sizeof(float)); if (underflow && HDfabsf(x) <= FLT_MIN && HDfabsf(hw_f) <= FLT_MIN) continue; /* all underflowed, no error */ - if (overflow && my_isinf(dst_type, endian, buf+j*sizeof(float), + if (overflow && my_isinf(dst_type, endian, buf+j*sizeof(float), dst_size, dst_mpos, dst_msize, dst_epos, dst_esize)) continue; /* all overflowed, no error */ check_mant[0] = HDfrexpf(x, check_expo+0); @@ -2817,7 +2817,7 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) if (underflow && HDfabs(x) <= DBL_MIN && HDfabs(hw_d) <= DBL_MIN) continue; /* all underflowed, no error */ - if (overflow && my_isinf(dst_type, endian, buf+j*sizeof(double), + if (overflow && my_isinf(dst_type, endian, buf+j*sizeof(double), dst_size, dst_mpos, dst_msize, dst_epos, dst_esize)) continue; /* all overflowed, no error */ check_mant[0] = HDfrexp(x, check_expo+0); @@ -2896,7 +2896,7 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) } } printf(" elmt %u\n", (unsigned)j); - + printf(" src ="); for (k=0; k=max_fails) { if(run_test==TEST_NORMAL) HDputs(" maximum failures reached, aborting test..."); else if(run_test==TEST_DENORM || run_test==TEST_SPECIAL) HDputs(" maximum warnings reached, aborting test..."); - + goto done; } } @@ -2980,7 +2980,7 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) HDexit(0); #else reset_hdf5(); - + /* If the source is normalized values, treat the failures as error; * if it is denormalized or special values, treat the failure as warning.*/ if(run_test==TEST_NOOP || run_test==TEST_NORMAL) @@ -3012,14 +3012,14 @@ test_conv_flt_1 (const char *name, int run_test, hid_t src, hid_t dst) /*------------------------------------------------------------------------- * Function: test_conv_int_fp * - * Purpose: Test conversion between integer and float values + * Purpose: Test conversion between integer and float values * from SRC to DST. These types should be any combination of: * * H5T_NATIVE_SCHAR H5T_NATIVE_FLOAT * H5T_NATIVE_SHORT H5T_NATIVE_DOUBLE * H5T_NATIVE_INT H5T_NATIVE_LDOUBLE - * H5T_NATIVE_LONG - * H5T_NATIVE_LLONG + * H5T_NATIVE_LONG + * H5T_NATIVE_LLONG * * Return: Success: 0 * @@ -3181,7 +3181,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) if ((INT_SCHAR==src_type || INT_UCHAR==src_type || INT_SHORT==src_type || INT_USHORT==src_type || INT_INT==src_type || INT_UINT==src_type || INT_LONG==src_type || INT_ULONG==src_type || INT_LLONG==src_type || - INT_ULLONG==src_type) && + INT_ULLONG==src_type) && (FLT_FLOAT!=dst_type && FLT_DOUBLE!=dst_type #if H5_SIZEOF_LONG_DOUBLE !=0 && FLT_LDOUBLE!=dst_type @@ -3202,7 +3202,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) ) && (INT_SCHAR!=dst_type && INT_UCHAR!=dst_type && INT_SHORT!=dst_type && INT_USHORT!=dst_type && INT_INT!=dst_type && INT_UINT!=dst_type - && INT_LONG!=dst_type && INT_ULONG!=dst_type && INT_LLONG!=dst_type + && INT_LONG!=dst_type && INT_ULONG!=dst_type && INT_LLONG!=dst_type && INT_ULLONG!=dst_type)) { sprintf(str, "Testing %s %s -> %s conversions", name, src_type_name, dst_type_name); @@ -3248,22 +3248,22 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) #endif /* This is for some Linux systems where long double has the size - * 12 bytes but precision is 10 bytes. The 2 unused bytes may + * 12 bytes but precision is 10 bytes. The 2 unused bytes may * have garbage causing wrong value comparison. */ HDmemset(&hw_ldouble, 0, sizeof(long double)); - /* Create a dataset transfer property list and datatype conversion + /* Create a dataset transfer property list and datatype conversion * exception handler function and pass in fill value. This is mainly * for NetCDF compatibility, which requests fill in fill value when - * conversion exception happens. We only test (unsigned) int - float + * conversion exception happens. We only test (unsigned) int - float * and float - (unsigned) int conversions, which should cover more cases. */ if((dxpl_id = H5Pcreate(H5P_DATASET_XFER))<0) goto error; - if((src_type == INT_INT && dst_type == FLT_FLOAT) || - (src_type == INT_UINT && dst_type == FLT_FLOAT) || + if((src_type == INT_INT && dst_type == FLT_FLOAT) || + (src_type == INT_UINT && dst_type == FLT_FLOAT) || (src_type == FLT_FLOAT && dst_type == INT_UINT) || (src_type == FLT_FLOAT && dst_type == INT_INT)) { if(H5Pset_type_conv_cb(dxpl_id, except_func, &fill_value)<0) @@ -3276,7 +3276,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) if(op != except_func || *(int*)user_data != fill_value) goto error; - } + } /* Allocate and initialize the source buffer through macro INIT_INTEGER if the source is integer, * INIT_FP_NORM if floating-point. The BUF will be used for the conversion while the SAVED buffer will be @@ -3317,7 +3317,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) INIT_FP_NORM(double, DBL_MAX, DBL_MIN, DBL_MAX_10_EXP, DBL_MIN_10_EXP, src_size, dst_size, buf, saved, nelmts); } else if(run_test==TEST_DENORM) { - INIT_FP_DENORM(double, DBL_MANT_DIG, src_size, src_nbits, endian, dst_size, + INIT_FP_DENORM(double, DBL_MANT_DIG, src_size, src_nbits, endian, dst_size, buf, saved, nelmts); } else { INIT_FP_SPECIAL(src_size, src_nbits, endian, DBL_MANT_DIG, dst_size, buf, saved, nelmts); @@ -3328,12 +3328,12 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) INIT_FP_NORM(long double, LDBL_MAX, LDBL_MIN, LDBL_MAX_10_EXP, LDBL_MIN_10_EXP, src_size, dst_size, buf, saved, nelmts); } else if(run_test==TEST_DENORM) { - INIT_FP_DENORM(long double, LDBL_MANT_DIG, src_size, src_nbits, endian, dst_size, + INIT_FP_DENORM(long double, LDBL_MANT_DIG, src_size, src_nbits, endian, dst_size, buf, saved, nelmts); } else { INIT_FP_SPECIAL(src_size, src_nbits, endian, LDBL_MANT_DIG, dst_size, buf, saved, nelmts); - } -#endif + } +#endif } else goto error; @@ -3701,13 +3701,13 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) /* Make certain that there isn't some weird number of destination bits */ assert(dst_nbits%8==0); - + /* For Intel machines, the size of "long double" is 12 bytes, precision * is 80 bits; for AMD processors, the size of "long double" is 16 bytes, - * precision is 80 bits. During hardware conversion, the last few unused - * bytes may have garbage in them. Clean them out with 0s before compare + * precision is 80 bits. During hardware conversion, the last few unused + * bytes may have garbage in them. Clean them out with 0s before compare * the values. - */ + */ #if H5_SIZEOF_LONG_DOUBLE !=0 if(endian==H5T_ORDER_LE && dst_type==FLT_LDOUBLE) { unsigned int q; @@ -3732,7 +3732,7 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) */ for (k=0; k=max_fails) { if(run_test==TEST_NORMAL) HDputs(" maximum failures reached, aborting test..."); else if(run_test==TEST_DENORM || run_test==TEST_SPECIAL) HDputs(" maximum warnings reached, aborting test..."); - + goto done; } } @@ -4115,9 +4115,9 @@ test_conv_int_fp(const char *name, int run_test, hid_t src, hid_t dst) /*------------------------------------------------------------------------- * Function: overflows * - * Purpose: When convert from float or double to any integer type, - * check if overflow occurs. - * + * Purpose: When convert from float or double to any integer type, + * check if overflow occurs. + * * * Return: TRUE: overflow happens * @@ -4145,10 +4145,10 @@ overflows(unsigned char *origin_bits, hid_t src_id, size_t dst_num_bits) HDmemset(bits, 0, 32); HDmemset(mant_bits, 0, 32); - /* - * Sometimes, type size isn't equal to the precision like Linux's "long - * double", where size is 96 bits and precision is 80 bits. - */ + /* + * Sometimes, type size isn't equal to the precision like Linux's "long + * double", where size is 96 bits and precision is 80 bits. + */ src_prec = H5Tget_precision(src_id); H5Tget_fields(src_id, NULL, &epos, &expt_digits, &mpos, &mant_digits); @@ -4167,7 +4167,7 @@ overflows(unsigned char *origin_bits, hid_t src_id, size_t dst_num_bits) H5T_BIT_LSB, TRUE)<0 && H5T_bit_find (bits, epos, expt_digits, 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.*/ ret_value=TRUE; goto done; @@ -4175,16 +4175,16 @@ overflows(unsigned char *origin_bits, hid_t src_id, size_t dst_num_bits) /* get exponent */ expt = H5T_bit_get_d(bits, mant_digits, expt_digits) - bias; - + if(expt>=(dst_num_bits-1)) { ret_value=TRUE; goto done; - } + } /* get significand */ H5T_bit_copy (mant_bits, 0, bits, 0, mant_digits); - + /* restore implicit bit if normalization is implied*/ if(norm == H5T_NORM_IMPLIED) { H5T_bit_inc(mant_bits, mant_digits, 1); @@ -4200,7 +4200,7 @@ overflows(unsigned char *origin_bits, hid_t src_id, size_t dst_num_bits) ret_value=TRUE; done: - return ret_value; + return ret_value; } @@ -4395,7 +4395,7 @@ run_fp_tests(const char *name) goto done; } - /*Test normalized values. TEST_NORMAL indicates normalized values.*/ + /*Test normalized values. TEST_NORMAL indicates normalized values.*/ nerrors += test_conv_flt_1(name, TEST_NORMAL, H5T_NATIVE_FLOAT, H5T_NATIVE_DOUBLE); nerrors += test_conv_flt_1(name, TEST_NORMAL, H5T_NATIVE_DOUBLE, H5T_NATIVE_FLOAT); #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE !=0 @@ -4405,7 +4405,7 @@ run_fp_tests(const char *name) nerrors += test_conv_flt_1(name, TEST_NORMAL, H5T_NATIVE_LDOUBLE, H5T_NATIVE_DOUBLE); #endif - /*Test denormalized values. TEST_DENORM indicates denormalized values.*/ + /*Test denormalized values. TEST_DENORM indicates denormalized values.*/ nerrors += test_conv_flt_1(name, TEST_DENORM, H5T_NATIVE_FLOAT, H5T_NATIVE_DOUBLE); nerrors += test_conv_flt_1(name, TEST_DENORM, H5T_NATIVE_DOUBLE, H5T_NATIVE_FLOAT); #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE && H5_SIZEOF_LONG_DOUBLE!=0 @@ -4457,7 +4457,7 @@ run_int_fp_conv(const char *name) nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_SHORT, H5T_NATIVE_FLOAT); nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_SHORT, H5T_NATIVE_DOUBLE); - + nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_USHORT, H5T_NATIVE_FLOAT); nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_USHORT, H5T_NATIVE_DOUBLE); @@ -4466,7 +4466,7 @@ run_int_fp_conv(const char *name) nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_UINT, H5T_NATIVE_FLOAT); nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_UINT, H5T_NATIVE_DOUBLE); - + #if H5_SIZEOF_LONG!=H5_SIZEOF_INT nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_LONG, H5T_NATIVE_FLOAT); nerrors += test_conv_int_fp(name, TEST_NORMAL, H5T_NATIVE_LONG, H5T_NATIVE_DOUBLE); @@ -4543,7 +4543,7 @@ run_int_fp_conv(const char *name) #else HDputs(" Test skipped due to disabled long double."); #endif - + } #endif /*H5_SW_INTEGER_TO_LDOUBLE_WORKS*/ @@ -4572,7 +4572,7 @@ run_fp_int_conv(const char *name) int test_values; int i; int run_test = TRUE; - + #ifndef H5_FP_TO_INTEGER_OVERFLOW_WORKS /* For Cray X1, the compiler generates floating exception when the * conversion overflows. So disable all of the conversions from @@ -4581,45 +4581,45 @@ run_fp_int_conv(const char *name) run_test = FALSE; #endif - if(run_test) { + if(run_test) { for(i=0; i<3; i++) { if(i==0) test_values = TEST_NORMAL; else if(i==1) test_values = TEST_DENORM; - else + else test_values = TEST_SPECIAL; nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_SCHAR); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_SCHAR); - + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_UCHAR); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_UCHAR); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_SHORT); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_SHORT); - + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_USHORT); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_USHORT); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_INT); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_INT); - + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_UINT); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_UINT); - + #if H5_SIZEOF_LONG!=H5_SIZEOF_INT nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_LONG); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_LONG); - + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_ULONG); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_ULONG); #endif - + #if H5_SIZEOF_LONG_LONG!=H5_SIZEOF_LONG if(!strcmp(name, "hw")) { /* Hardware conversion */ /* Windows .NET 2003 doesn't work for hardware conversion of this case. - * .NET should define this macro H5_HW_FP_TO_LLONG_NOT_WORKS. */ + * .NET should define this macro H5_HW_FP_TO_LLONG_NOT_WORKS. */ #ifndef H5_HW_FP_TO_LLONG_NOT_WORKS nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_LLONG); nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_LLONG); @@ -4647,7 +4647,7 @@ run_fp_int_conv(const char *name) SKIPPED(); HDputs(" Test skipped due to hardware conversion error."); } -#endif /*H5_FP_TO_ULLONG_RIGHT_MAXIMUM*/ +#endif /*H5_FP_TO_ULLONG_RIGHT_MAXIMUM*/ #endif #if H5_SW_LDOUBLE_TO_INTEGER_WORKS @@ -4659,7 +4659,7 @@ run_fp_int_conv(const char *name) nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_INT); #if H5_CV_LDOUBLE_TO_UINT_WORKS nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_UINT); -#else /*H5_CV_LDOUBLE_TO_UINT_WORKS*/ +#else /*H5_CV_LDOUBLE_TO_UINT_WORKS*/ { char str[256]; /*string */ @@ -4697,7 +4697,7 @@ run_fp_int_conv(const char *name) HDputs(" Test skipped due to disabled long double."); #endif } -#endif /*H5_FP_TO_ULLONG_RIGHT_MAXIMUM*/ +#endif /*H5_FP_TO_ULLONG_RIGHT_MAXIMUM*/ #endif #endif #else /*H5_SW_LDOUBLE_TO_INTEGER_WORKS*/ @@ -4739,9 +4739,9 @@ run_fp_int_conv(const char *name) * * Purpose: Test the data type(integer and floating-point number). * - * Return: Success: + * Return: Success: * - * Failure: + * Failure: * * Programmer: Robb Matzke * Tuesday, December 9, 1997 @@ -4769,11 +4769,11 @@ main(void) /* Do the tests */ - /* Test user-define, query functions and software conversion + /* Test user-define, query functions and software conversion * for user-defined floating-point types */ nerrors += test_derived_flt(); - - /* Test user-define, query functions and software conversion + + /* Test user-define, query functions and software conversion * for user-defined integer types */ nerrors += test_derived_integer(); @@ -4794,10 +4794,10 @@ main(void) /* Test hardware float-integer conversion functions */ nerrors += run_fp_int_conv("hard"); - + /*---------------------------------------------------------------------- * Software tests - *---------------------------------------------------------------------- + *---------------------------------------------------------------------- */ without_hardware_g = TRUE; reset_hdf5(); @@ -4811,12 +4811,12 @@ main(void) /* Test software float-integer conversion functions */ nerrors += run_fp_int_conv("soft"); - + /* Test software integer-float conversion functions */ nerrors += run_int_fp_conv("soft"); - + reset_hdf5(); - + if (nerrors) { printf("***** %lu FAILURE%s! *****\n", nerrors, 1==nerrors?"":"S"); diff --git a/test/dtransform.c b/test/dtransform.c index 2c09c76..085014b 100644 --- a/test/dtransform.c +++ b/test/dtransform.c @@ -18,22 +18,22 @@ hid_t dset_id_int_chunk; hid_t dset_id_float_chunk; -const float windchillFfloat[ROWS][COLS] = +const float windchillFfloat[ROWS][COLS] = { {36.0, 31.0, 25.0, 19.0, 13.0, 7.0, 1.0, -5.0, -11.0, -16.0, -22.0, -28.0, -34.0, -40.0, -46.0, -52.0, -57.0, -63.0 }, - {34.0, 27.0, 21.0, 15.0, 9.0, 3.0, -4.0, -10.0, -16.0, -22.0, -28.0, -35.0, -41.0, -47.0, -53.0, -59.0, -66.0, -72.0 } , - {32.0, 25.0, 19.0, 13.0, 6.0, 0.0, -7.0, -13.0, -19.0, -26.0, -32.0, -39.0, -45.0, -51.0, -58.0, -64.0, -71.0, -77.0 }, - {30.0, 24.0, 17.0, 11.0, 4.0, -2.0, -9.0, -15.0, -22.0, -29.0, -35.0, -42.0, -48.0, -55.0, -61.0, -68.0, -74.0, -81.0 }, - {29.0, 23.0, 16.0, 9.0, 3.0, -4.0, -11.0, -17.0, -24.0, -31.0, -37.0, -44.0, -51.0, -58.0, -64.0, -71.0, -78.0, -84.0 }, - {28.0, 22.0, 15.0, 8.0, 1.0, -5.0, -12.0, -19.0, -26.0, -33.0, -39.0, -46.0, -53.0, -60.0, -67.0, -73.0, -80.0, -87.0 }, - {28.0, 21.0, 14.0, 7.0, 0.0, -7.0, -14.0, -21.0, -27.0, -34.0, -41.0, -48.0, -55.0, -62.0, -69.0, -76.0, -82.0, -89.0 }, - {27.0, 20.0, 13.0, 6.0, -1.0, -8.0, -15.0, -22.0, -29.0, -36.0, -43.0, -50.0, -57.0, -64.0, -71.0, -78.0, -84.0, -91.0 }, + {34.0, 27.0, 21.0, 15.0, 9.0, 3.0, -4.0, -10.0, -16.0, -22.0, -28.0, -35.0, -41.0, -47.0, -53.0, -59.0, -66.0, -72.0 } , + {32.0, 25.0, 19.0, 13.0, 6.0, 0.0, -7.0, -13.0, -19.0, -26.0, -32.0, -39.0, -45.0, -51.0, -58.0, -64.0, -71.0, -77.0 }, + {30.0, 24.0, 17.0, 11.0, 4.0, -2.0, -9.0, -15.0, -22.0, -29.0, -35.0, -42.0, -48.0, -55.0, -61.0, -68.0, -74.0, -81.0 }, + {29.0, 23.0, 16.0, 9.0, 3.0, -4.0, -11.0, -17.0, -24.0, -31.0, -37.0, -44.0, -51.0, -58.0, -64.0, -71.0, -78.0, -84.0 }, + {28.0, 22.0, 15.0, 8.0, 1.0, -5.0, -12.0, -19.0, -26.0, -33.0, -39.0, -46.0, -53.0, -60.0, -67.0, -73.0, -80.0, -87.0 }, + {28.0, 21.0, 14.0, 7.0, 0.0, -7.0, -14.0, -21.0, -27.0, -34.0, -41.0, -48.0, -55.0, -62.0, -69.0, -76.0, -82.0, -89.0 }, + {27.0, 20.0, 13.0, 6.0, -1.0, -8.0, -15.0, -22.0, -29.0, -36.0, -43.0, -50.0, -57.0, -64.0, -71.0, -78.0, -84.0, -91.0 }, {26.0, 19.0, 12.0, 5.0, -2.0, -9.0, -16.0, -23.0, -30.0, -37.0, -44.0, -51.0, -58.0, -65.0, -72.0, -79.0, -86.0, -93.0 }, {26.0, 19.0, 12.0, 4.0, -3.0, -10.0, -17.0, -24.0, -31.0, -38.0, -45.0, -52.0, -60.0, -67.0, -74.0, -81.0, -88.0, -95.0}, - {25.0, 18.0, 11.0, 4.0, -3.0, -11.0, -18.0, -25.0, -32.0, -39.0, -46.0, -54.0, -61.0, -68.0, -75.0, -82.0, -89.0, -97.0}, - {25.0, 17.0, 10.0, 3.0, -4.0, -11.0, -19.0, -26.0, -33.0, -40.0, -48.0, -55.0, -62.0, -69.0, -76.0, -84.0, -91.0, -98.0} + {25.0, 18.0, 11.0, 4.0, -3.0, -11.0, -18.0, -25.0, -32.0, -39.0, -46.0, -54.0, -61.0, -68.0, -75.0, -82.0, -89.0, -97.0}, + {25.0, 17.0, 10.0, 3.0, -4.0, -11.0, -19.0, -26.0, -33.0, -40.0, -48.0, -55.0, -62.0, -69.0, -76.0, -84.0, -91.0, -98.0} }; -const int transformData[ROWS][COLS] = +const int transformData[ROWS][COLS] = { {36, 31, 25, 19, 13, 7, 1, 5, 11, 16, 22, 28, 34, 40, 46, 52, 57, 63 }, {34, 27, 21, 15, 9, 3, 4, 10, 16, 22, 28, 35, 41, 47, 53, 59, 66, 72 } , {32, 25, 19, 13, 6, 0, 7, 13, 19, 26, 32, 39, 45, 51, 58, 64, 71, 77 }, @@ -63,7 +63,7 @@ const int transformData[ROWS][COLS] = } \ } \ PASSED(); \ -} +} #define COMPARE(TYPE,VAR1,VAR2,TOL) \ { \ @@ -80,7 +80,7 @@ const int transformData[ROWS][COLS] = } \ } \ PASSED(); \ -} +} #define TEST_TYPE_CONTIG(XFORM, TYPE, HDF_TYPE, TEST_STR, COMPARE_DATA, SIGNED) \ { \ @@ -216,7 +216,7 @@ int main(void) hid_t dxpl_id_c_to_f, dxpl_id_c_to_f_copy, dxpl_id_simple, dxpl_id_polynomial, dxpl_id_polynomial_copy, dxpl_id_utrans_inv, file_id; const char* c_to_f = "(9/5.0)*x + 32"; - const char* simple = "(4/2) * ( (2 + 4)/(5 - 2.5))"; /* this equals 4.8 */ + const char* simple = "(4/2) * ( (2 + 4)/(5 - 2.5))"; /* this equals 4.8 */ const char* polynomial = "(2+x)* ((x-8)/2)"; /* inverses the utrans transform in init_test to get back original array */ const char* utrans_inv = "(x/3)*4 - 100"; @@ -231,9 +231,9 @@ int main(void) if(H5Pset_data_transform(dxpl_id_utrans_inv, utrans_inv)<0) TEST_ERROR; if((dxpl_id_polynomial_copy = H5Pcopy(dxpl_id_polynomial)) < 0) TEST_ERROR; if((dxpl_id_c_to_f_copy = H5Pcopy(dxpl_id_c_to_f)) < 0) TEST_ERROR; - + /* Run all the tests */ - + if(init_test(&file_id) < 0) TEST_ERROR; if(test_set() < 0) TEST_ERROR; @@ -265,7 +265,7 @@ int main(void) #if H5_SIZEOF_LONG_DOUBLE!=0 TEST_TYPE_CONTIG(dxpl_id_c_to_f, long double, H5T_NATIVE_LDOUBLE, "ldouble", windchillFfloat, 1); #endif - + TEST_TYPE_CHUNK(dxpl_id_utrans_inv, char, H5T_NATIVE_CHAR, "char", transformData, 0); TEST_TYPE_CHUNK(dxpl_id_utrans_inv, unsigned char, H5T_NATIVE_UCHAR, "uchar", transformData, 0); TEST_TYPE_CHUNK(dxpl_id_c_to_f, signed char, H5T_NATIVE_SCHAR, "schar", windchillFfloat, 1); @@ -293,7 +293,7 @@ int main(void) #if H5_SIZEOF_LONG_DOUBLE!=0 TEST_TYPE_CHUNK(dxpl_id_c_to_f, long double, H5T_NATIVE_LDOUBLE, "ldouble", windchillFfloat, 1); #endif - + if(test_copy(dxpl_id_c_to_f_copy, dxpl_id_polynomial_copy) < 0) TEST_ERROR; if(test_trivial(dxpl_id_simple) < 0) TEST_ERROR; if(test_poly(dxpl_id_polynomial) < 0) TEST_ERROR; @@ -314,7 +314,7 @@ int main(void) return 0; - + error: return -1; } @@ -327,39 +327,39 @@ int init_test(hid_t* file_id) hid_t dataspace, dxpl_id_f_to_c, dxpl_id_utrans, cparms, filespace; hsize_t dim[2] = {ROWS, COLS}; - hsize_t offset[2] = {0, 0}; + hsize_t offset[2] = {0, 0}; if((dxpl_id_f_to_c = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR; if((dxpl_id_utrans = H5Pcreate(H5P_DATASET_XFER))<0) TEST_ERROR; - + if(H5Pset_data_transform(dxpl_id_f_to_c, f_to_c)<0) TEST_ERROR; if(H5Pset_data_transform(dxpl_id_utrans, utrans)<0) TEST_ERROR; - + if((*file_id = H5Fcreate("dtransform.h5", H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT))<0) TEST_ERROR; - + cparms = H5Pcreate(H5P_DATASET_CREATE); if(H5Pset_chunk(cparms, 2, dim)<0) TEST_ERROR; - + if((dataspace = H5Screate_simple(2, dim, NULL))<0) TEST_ERROR; TESTING("Intializing test...") - + if((dset_id_int = H5Dcreate(*file_id, "/default_int", H5T_NATIVE_INT, dataspace, H5P_DEFAULT))<0) TEST_ERROR; if(H5Dwrite(dset_id_int, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFfloat)<0) TEST_ERROR; - + if((dset_id_float = H5Dcreate(*file_id, "/default_float", H5T_NATIVE_FLOAT, dataspace, H5P_DEFAULT))<0) TEST_ERROR; if(H5Dwrite(dset_id_float, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_f_to_c, windchillFfloat)<0) TEST_ERROR; - - if((dset_id_int_chunk = H5Dcreate(*file_id, "/default_chunk_int", H5T_NATIVE_INT, dataspace, cparms))<0) TEST_ERROR; - filespace = H5Dget_space (dset_id_int_chunk); - if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, dim, NULL) < 0) TEST_ERROR; + if((dset_id_int_chunk = H5Dcreate(*file_id, "/default_chunk_int", H5T_NATIVE_INT, dataspace, cparms))<0) TEST_ERROR; + + filespace = H5Dget_space (dset_id_int_chunk); + if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL, dim, NULL) < 0) TEST_ERROR; if(H5Dwrite(dset_id_int_chunk, H5T_NATIVE_FLOAT, dataspace, filespace, dxpl_id_f_to_c, windchillFfloat)<0) TEST_ERROR; - if((dset_id_float_chunk = H5Dcreate(*file_id, "/default_chunk_float", H5T_NATIVE_FLOAT, dataspace, cparms))<0) TEST_ERROR; - if(H5Dwrite(dset_id_float_chunk, H5T_NATIVE_FLOAT, dataspace, filespace, dxpl_id_f_to_c, windchillFfloat)<0) TEST_ERROR; + if((dset_id_float_chunk = H5Dcreate(*file_id, "/default_chunk_float", H5T_NATIVE_FLOAT, dataspace, cparms))<0) TEST_ERROR; + if(H5Dwrite(dset_id_float_chunk, H5T_NATIVE_FLOAT, dataspace, filespace, dxpl_id_f_to_c, windchillFfloat)<0) TEST_ERROR; + - PASSED(); @@ -371,7 +371,7 @@ int init_test(hid_t* file_id) error: return -1; } - + int test_poly(const hid_t dxpl_id_polynomial) { float polyflres[ROWS][COLS]; @@ -393,7 +393,7 @@ int test_poly(const hid_t dxpl_id_polynomial) if(H5Dread(dset_id_int, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, dxpl_id_polynomial, polyflread)<0) TEST_ERROR; COMPARE(float, polyflread, polyflres, 2.0) - + for(row = 0; row=0) { H5_FAILED(); puts(" Tries to cut off the last member. Should have failed."); @@ -2059,12 +2059,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 @@ -2072,7 +2072,7 @@ test_compound_12(void) * H5Tget_member_value. *------------------------------------------------------------------------- */ -static int +static int test_query(void) { struct s1 { @@ -2095,7 +2095,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; @@ -2248,7 +2248,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(); @@ -2260,7 +2260,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) { @@ -2328,7 +2328,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); @@ -2411,7 +2411,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); @@ -2457,7 +2457,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); @@ -2541,7 +2541,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; @@ -2589,7 +2589,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. @@ -2797,7 +2797,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. */ @@ -2852,7 +2852,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. */ @@ -3066,11 +3066,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: *------------------------------------------------------------------------- */ @@ -3141,7 +3141,7 @@ test_conv_enum_2(void) nerrors, NTESTELEM); return 1; } - + PASSED(); return 0; } @@ -3282,7 +3282,7 @@ static int test_opaque(void) { int num_errors = 0; - + TESTING("opaque datatypes"); /* Test opaque types with tags */ @@ -3337,10 +3337,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; } @@ -3365,7 +3365,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; @@ -3418,7 +3418,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 @@ -3441,17 +3441,17 @@ opaque_long(void) * Purpose: Tests functions of encoding and decoding data type. * * Return: Success: 0 - * + * * Failure: number of errors * * Programmer: Raymond Lu * July 14, 2004 - * + * * Modifications: * *------------------------------------------------------------------------- */ -static int +static int test_encode(void) { struct s1 { @@ -3482,7 +3482,7 @@ test_encode(void) *----------------------------------------------------------------------- */ /* 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; @@ -3539,7 +3539,7 @@ test_encode(void) printf("Can't insert field into enumeration type\n"); goto error; } /* end if */ - + /*----------------------------------------------------------------------- * Test encoding and decoding compound and enumerate data types *----------------------------------------------------------------------- @@ -3596,7 +3596,7 @@ test_encode(void) goto error; } /* end if */ - + /* Encode enumerate type in a buffer */ if(H5Tencode(tid2, NULL, &enum_buf_size)<0) { H5_FAILED(); @@ -3838,9 +3838,9 @@ test_encode(void) * * Purpose: Test the data type interface. * - * Return: Success: + * Return: Success: * - * Failure: + * Failure: * * Programmer: Robb Matzke * Tuesday, December 9, 1997 diff --git a/test/enum.c b/test/enum.c index b80d488..13769b5 100644 --- a/test/enum.c +++ b/test/enum.c @@ -55,7 +55,7 @@ test_named(hid_t file) hid_t type=-1, cwg=-1; c_e1 val; signed char val8; - + TESTING("named enumeration types"); if ((cwg=H5Gcreate(file, "test_named", 0))<0) goto error; @@ -92,7 +92,7 @@ test_named(hid_t file) if (H5Tenum_insert(type, "BLACK", CPTR(val8, E1_BLACK))<0) goto error; if (H5Tcommit(cwg, "e1_c", type)<0) goto error; if (H5Tclose(type)<0) goto error; - + if (H5Gclose(cwg)<0) goto error; PASSED(); return 0; @@ -159,7 +159,7 @@ test_noconv(hid_t file) goto error; } } - + if (H5Dclose(dset)<0) goto error; if (H5Sclose(space)<0) goto error; if (H5Tclose(type)<0) goto error; @@ -241,7 +241,7 @@ test_tr1(hid_t file) goto error; } } - + if (H5Dclose(dset)<0) goto error; if (H5Sclose(space)<0) goto error; if (H5Tclose(m_type)<0) goto error; @@ -260,7 +260,7 @@ test_tr1(hid_t file) } H5E_END_TRY; return 1; } - + /*------------------------------------------------------------------------- * Function: test_tr2 @@ -321,7 +321,7 @@ test_tr2(hid_t file) goto error; } } - + if (H5Dclose(dset)<0) goto error; if (H5Sclose(space)<0) goto error; if (H5Tclose(m_type)<0) goto error; @@ -340,7 +340,7 @@ test_tr2(hid_t file) } H5E_END_TRY; return 1; } - + /*------------------------------------------------------------------------- * Function: test_value_dsnt_exist @@ -348,8 +348,8 @@ test_tr2(hid_t file) * Purpose: Create an enumeration datatype with "gaps in values" * and then request a name of non-existing value within * an existing range by calling H5Tenum_nameof function. - * Function should fail instead of succeeding and returning - * a name of one of the existing values. + * Function should fail instead of succeeding and returning + * a name of one of the existing values. * Request a value by supplying non-existing name by calling * H5Tenum_nameof function. Function should fail. * @@ -375,15 +375,15 @@ test_value_dsnt_exist(void) size_t size = 100; TESTING("for non-existing name and value"); /* Turn off error reporting since we expect failure in this test */ - - if (H5Eset_auto_stack(H5E_DEFAULT, NULL, NULL) < 0) goto error; + + if (H5Eset_auto_stack(H5E_DEFAULT, NULL, NULL) < 0) goto error; if ((datatype_id = H5Tenum_create(H5T_NATIVE_INT))< 0) goto error; - /* These calls should fail, since no memebrs exist yet */ - if (H5Tenum_valueof(datatype_id, "SAX", &val) >= 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; @@ -391,32 +391,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); @@ -428,11 +428,11 @@ test_value_dsnt_exist(void) /*------------------------------------------------------------------------- * Function: main * - * Purpose: + * Purpose: * - * Return: Success: + * Return: Success: * - * Failure: + * Failure: * * Programmer: Robb Matzke * Tuesday, December 22, 1998 @@ -447,7 +447,7 @@ main(void) hid_t fapl=-1, file=-1; char name[1024]; int nerrors=0; - + h5_reset(); fapl = h5_fileaccess(); @@ -461,9 +461,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/err_compat.c b/test/err_compat.c index 740fe42..addf097 100644 --- a/test/err_compat.c +++ b/test/err_compat.c @@ -14,7 +14,7 @@ /* * Programmer: Raymond Lu - * October 14, 2001 + * October 14, 2001 * * Purpose: Tests Error API */ @@ -23,7 +23,7 @@ #ifndef H5_WANT_H5_V1_6_COMPAT int main(void) { - printf("Test skipped because backward compatbility with v1.6 is NOT configured in\n"); + printf("Test skipped because backward compatbility with v1.6 is NOT configured in\n"); return 0; } #else @@ -39,7 +39,7 @@ const char *FILENAME[] = { int ipoints2[DIM0][DIM1], icheck2[DIM0][DIM1]; #define DSET_NAME "a_dataset" -#define FAKE_ID -1 +#define FAKE_ID -1 herr_t custom_print_cb(int n, H5E_error_t *err_desc, void* client_data); @@ -69,10 +69,10 @@ test_error(hid_t file) const char *FUNC_test_error="test_error"; H5E_auto_t old_func; void *old_data; - + TESTING("error API based on data I/O"); fprintf(stderr, "\n"); - + /* Create the data space */ dims[0] = DIM0; dims[1] = DIM1; @@ -82,11 +82,11 @@ test_error(hid_t file) H5E_BEGIN_TRY { dataset = H5Dcreate(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT); } H5E_END_TRY; - + /* Create the dataset */ if ((dataset = H5Dcreate(file, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT))<0) { - H5Epush(__FILE__, FUNC_test_error, __LINE__, H5E_ERROR, H5E_CANTCREATE, + H5Epush(__FILE__, FUNC_test_error, __LINE__, H5E_ERROR, H5E_CANTCREATE, "H5Dcreate failed"); goto error; } @@ -94,9 +94,9 @@ test_error(hid_t file) /* Test enabling and disabling default printing */ if (H5Eget_auto(&old_func, &old_data)<0) TEST_ERROR; - if (old_data != NULL) + if (old_data != NULL) TEST_ERROR; - if (!old_func) + if (!old_func) TEST_ERROR; if (old_func != (H5E_auto_t)H5Eprint) TEST_ERROR; @@ -106,7 +106,7 @@ test_error(hid_t file) /* Make H5Dwrite fail, verify default print is disabled */ if (H5Dwrite(FAKE_ID, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints2)<0) { - H5Epush(__FILE__, FUNC_test_error, __LINE__, H5E_ERROR, H5E_WRITEERROR, + H5Epush(__FILE__, FUNC_test_error, __LINE__, H5E_ERROR, H5E_WRITEERROR, "H5Dwrite shouldn't succeed"); goto error; } @@ -116,8 +116,8 @@ test_error(hid_t file) /* In case program comes to this point, close dataset */ if(H5Dclose(dataset)<0) TEST_ERROR; - - TEST_ERROR; + + TEST_ERROR; error: return -1; @@ -125,7 +125,7 @@ test_error(hid_t file) /*------------------------------------------------------------------------- - * Function: dump_error + * Function: dump_error * * Purpose: Prints error stack in default and customized ways. * @@ -141,19 +141,19 @@ test_error(hid_t file) * *------------------------------------------------------------------------- */ -static herr_t +static herr_t dump_error(void) { /* Print errors in library default way */ fprintf(stderr, "********* Print error stack in HDF5 default way *********\n"); if(H5Eprint(stderr)<0) TEST_ERROR; - + /* Customized way to print errors */ fprintf(stderr, "\n********* Print error stack in customized way *********\n"); if(H5Ewalk(H5E_WALK_UPWARD, custom_print_cb, stderr)<0) TEST_ERROR; - + return 0; error: @@ -177,7 +177,7 @@ dump_error(void) * *------------------------------------------------------------------------- */ -herr_t +herr_t custom_print_cb(int n, H5E_error_t *err_desc, void* client_data) { FILE *stream = (FILE *)client_data; @@ -204,7 +204,7 @@ custom_print_cb(int n, H5E_error_t *err_desc, void* client_data) error: return -1; } - + /*------------------------------------------------------------------------- * Function: main @@ -227,17 +227,17 @@ main(void) fprintf(stderr, " This program tests the Error API compatible with HDF5 v1.6. There're supposed to be some error messages\n"); fapl = h5_fileaccess(); - + h5_fixname(FILENAME[0], fapl, filename, sizeof filename); if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR ; - /* Test error stack */ + /* Test error stack */ /* Push an error onto error stack */ - H5Epush(__FILE__, FUNC_main, __LINE__, H5E_ERROR, H5E_BADVALUE, + H5Epush(__FILE__, FUNC_main, __LINE__, H5E_ERROR, H5E_BADVALUE, "Error test failed"); - + /* Print out the errors on stack */ dump_error(); @@ -246,7 +246,7 @@ main(void) /* Test error API */ if(test_error(file)<0) { - H5Epush(__FILE__, FUNC_main, __LINE__, H5E_ERROR, H5E_BADMESG, + H5Epush(__FILE__, FUNC_main, __LINE__, H5E_ERROR, H5E_BADMESG, "Error test failed"); H5Eprint(stderr); } diff --git a/test/error_test.c b/test/error_test.c index 9fff2a8..b7994a0 100644 --- a/test/error_test.c +++ b/test/error_test.c @@ -14,7 +14,7 @@ /* * Programmer: Raymond Lu - * October 14, 2001 + * October 14, 2001 * * Purpose: Tests the H5Tget_native_type function. */ @@ -23,7 +23,7 @@ #ifdef H5_WANT_H5_V1_6_COMPAT int main(void) { - printf("Test skipped because backward compatbility with v1.6 is configured in\n"); + printf("Test skipped because backward compatbility with v1.6 is configured in\n"); return 0; } #else @@ -105,7 +105,7 @@ test_error(hid_t file) const char *FUNC_test_error="test_error"; H5E_auto_stack_t old_func; void *old_data; - + TESTING("error API based on data I/O"); /* Create the data space */ @@ -117,11 +117,11 @@ test_error(hid_t file) H5E_BEGIN_TRY { dataset = H5Dcreate(FAKE_ID, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT); } H5E_END_TRY; - + /* Create the dataset */ if ((dataset = H5Dcreate(file, DSET_NAME, H5T_STD_I32BE, space, H5P_DEFAULT))<0) { - H5Epush_stack(H5E_DEFAULT, __FILE__, FUNC_test_error, __LINE__, ERR_CLS, ERR_MAJ_IO, ERR_MIN_CREATE, + H5Epush_stack(H5E_DEFAULT, __FILE__, FUNC_test_error, __LINE__, ERR_CLS, ERR_MAJ_IO, ERR_MIN_CREATE, "H5Dcreate failed"); goto error; } @@ -129,7 +129,7 @@ test_error(hid_t file) /* Test enabling and disabling default printing */ if (H5Eget_auto_stack(H5E_DEFAULT, &old_func, &old_data)<0) TEST_ERROR; - if (old_data != NULL) + if (old_data != NULL) TEST_ERROR; if (old_func != (H5E_auto_stack_t)H5Eprint_stack) TEST_ERROR; @@ -139,7 +139,7 @@ test_error(hid_t file) /* Make H5Dwrite fail, verify default print is disabled */ if (H5Dwrite(FAKE_ID, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints2)>=0) { - H5Epush_stack(H5E_DEFAULT, __FILE__, FUNC_test_error, __LINE__, ERR_CLS, ERR_MAJ_IO, ERR_MIN_WRITE, + H5Epush_stack(H5E_DEFAULT, __FILE__, FUNC_test_error, __LINE__, ERR_CLS, ERR_MAJ_IO, ERR_MIN_WRITE, "H5Dwrite shouldn't succeed"); goto error; } @@ -149,19 +149,19 @@ test_error(hid_t file) /* Test saving and restoring the current error stack */ if (H5Dwrite(FAKE_ID, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints2)<0) { - H5Epush_stack(H5E_DEFAULT, __FILE__, FUNC_test_error, __LINE__, ERR_CLS, ERR_MAJ_IO, ERR_MIN_WRITE, + H5Epush_stack(H5E_DEFAULT, __FILE__, FUNC_test_error, __LINE__, ERR_CLS, ERR_MAJ_IO, ERR_MIN_WRITE, "H5Dwrite failed as supposed to"); estack_id = H5Eget_current_stack(); H5Dclose(dataset); H5Sclose(space); H5Eset_current_stack(estack_id); - goto error; + goto error; } /* In case program comes to this point, close dataset */ if(H5Dclose(dataset)<0) TEST_ERROR; - - TEST_ERROR; + + TEST_ERROR; error: return -1; @@ -185,7 +185,7 @@ test_error(hid_t file) * *------------------------------------------------------------------------- */ -static herr_t +static herr_t init_error(void) { ssize_t cls_size = (ssize_t)HDstrlen(ERR_CLS_NAME)+1; @@ -193,15 +193,15 @@ init_error(void) ssize_t msg_size = (ssize_t)HDstrlen(ERR_MIN_SUBROUTINE_MSG) + 1; char *msg = HDmalloc(HDstrlen(ERR_MIN_SUBROUTINE_MSG)+1); H5E_type_t *msg_type= HDmalloc(sizeof(H5E_type_t)); - + if((ERR_CLS = H5Eregister_class(ERR_CLS_NAME, PROG_NAME, PROG_VERS))<0) TEST_ERROR; - if(cls_size != H5Eget_class_name(ERR_CLS, cls_name, (size_t)cls_size) + 1) + if(cls_size != H5Eget_class_name(ERR_CLS, cls_name, (size_t)cls_size) + 1) TEST_ERROR; - if(strcmp(ERR_CLS_NAME, cls_name)) + if(strcmp(ERR_CLS_NAME, cls_name)) TEST_ERROR; - + if((ERR_MAJ_TEST = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_TEST_MSG))<0) TEST_ERROR; if((ERR_MAJ_IO = H5Ecreate_msg(ERR_CLS, H5E_MAJOR, ERR_MAJ_IO_MSG))<0) @@ -255,31 +255,31 @@ init_error(void) * *------------------------------------------------------------------------- */ -static herr_t +static herr_t error_stack(void) { int err_num; const char *FUNC_error_stack="error_stack"; - + if((err_num = H5Eget_num(H5E_DEFAULT))<0) TEST_ERROR; if(err_num) TEST_ERROR; - + if((ERR_STACK = H5Eget_current_stack())<0) TEST_ERROR; /* Make it push error, force this function to fail */ if((err_num = H5Eget_num(ERR_STACK))==0) { - H5Epush_stack(ERR_STACK, __FILE__, FUNC_error_stack, __LINE__, ERR_CLS, ERR_MAJ_API, ERR_MIN_GETNUM, + H5Epush_stack(ERR_STACK, __FILE__, FUNC_error_stack, __LINE__, ERR_CLS, ERR_MAJ_API, ERR_MIN_GETNUM, "Get number test failed, returned %d", err_num); goto error; - } - - /* In case program falls through here, close the stack and let it fail. */ + } + + /* In case program falls through here, close the stack and let it fail. */ if(H5Eclose_stack(ERR_STACK)<0) TEST_ERROR; - + return -1; error: @@ -303,7 +303,7 @@ error_stack(void) * *------------------------------------------------------------------------- */ -herr_t +herr_t long_desc_cb(unsigned n, const H5E_error_t *err_desc, void* client_data) { char *real_desc = (char *)client_data; @@ -332,7 +332,7 @@ long_desc_cb(unsigned n, const H5E_error_t *err_desc, void* client_data) * *------------------------------------------------------------------------- */ -static herr_t +static herr_t test_long_desc(void) { char *format="Testing very long description string, %s"; @@ -377,7 +377,7 @@ error: /*------------------------------------------------------------------------- - * Function: dump_error + * Function: dump_error * * Purpose: Prints error stack in default and customized ways. * @@ -393,19 +393,19 @@ error: * *------------------------------------------------------------------------- */ -static herr_t +static herr_t dump_error(hid_t estack) { /* Print errors in library default way */ fprintf(stderr, "********* Print error stack in HDF5 default way *********\n"); if(H5Eprint_stack(estack, stderr)<0) TEST_ERROR; - + /* Customized way to print errors */ fprintf(stderr, "\n********* Print error stack in customized way *********\n"); if(H5Ewalk_stack(estack, H5E_WALK_UPWARD, custom_print_cb, stderr)<0) TEST_ERROR; - + return 0; error: @@ -429,7 +429,7 @@ dump_error(hid_t estack) * *------------------------------------------------------------------------- */ -herr_t +herr_t custom_print_cb(unsigned n, const H5E_error_t *err_desc, void* client_data) { FILE *stream = (FILE *)client_data; @@ -444,7 +444,7 @@ custom_print_cb(unsigned n, const H5E_error_t *err_desc, void* client_data) if(H5Eget_msg(err_desc->maj_num, NULL, maj, MSG_SIZE)<0) TEST_ERROR; - + if(H5Eget_msg(err_desc->min_num, NULL, min, MSG_SIZE)<0) TEST_ERROR; @@ -479,19 +479,19 @@ custom_print_cb(unsigned n, const H5E_error_t *err_desc, void* client_data) * *------------------------------------------------------------------------- */ -static herr_t +static herr_t close_error(void) { /* Close major errors, let H5Eunregister_class close minor errors */ if(H5Eclose_msg(ERR_MAJ_TEST)<0) TEST_ERROR ; - + if(H5Eclose_msg(ERR_MAJ_IO)<0) TEST_ERROR ; - + if(H5Eclose_msg(ERR_MAJ_API)<0) TEST_ERROR ; - + if(H5Eunregister_class(ERR_CLS)<0) TEST_ERROR ; @@ -500,7 +500,7 @@ close_error(void) error: return -1; } - + /*------------------------------------------------------------------------- * Function: main @@ -527,22 +527,22 @@ main(void) /* Initialize errors */ if(init_error()<0) TEST_ERROR ; - + fapl = h5_fileaccess(); - + h5_fixname(FILENAME[0], fapl, filename, sizeof filename); if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) TEST_ERROR ; - /* Test error stack */ + /* Test error stack */ if(error_stack()<0) { /* Push an error onto error stack */ - if(H5Epush_stack(ERR_STACK, __FILE__, FUNC_main, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_ERRSTACK, + if(H5Epush_stack(ERR_STACK, __FILE__, FUNC_main, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_ERRSTACK, "Error stack test failed")<0) TEST_ERROR; - + /* Delete an error from the top of error stack */ H5Epop(ERR_STACK, 1); - + /* Print out the errors on stack */ dump_error(ERR_STACK); @@ -555,7 +555,7 @@ main(void) /* Test error API */ if(test_error(file)<0) { - H5Epush_stack(H5E_DEFAULT, __FILE__, FUNC_main, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, + H5Epush_stack(H5E_DEFAULT, __FILE__, FUNC_main, __LINE__, ERR_CLS, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "Error test failed, %s", "it's wrong"); estack_id = H5Eget_current_stack(); H5Eprint_stack(estack_id, stderr); @@ -564,7 +564,7 @@ main(void) /* Test pushing a very long error description */ if(test_long_desc()<0) TEST_ERROR; - + if (H5Fclose(file)<0) TEST_ERROR ; 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/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 - * 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 9417e73..a3a9f58 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_stack(H5E_DEFAULT); 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 a68e69f..b1a6d2f 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 */ @@ -211,7 +211,7 @@ void h5_reset(void) { char filename[1024]; - + HDfflush(stdout); HDfflush(stderr); H5close(); @@ -274,7 +274,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; @@ -290,7 +290,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 || H5FD_FPHDF5 == driver)) { #ifdef H5_HAVE_PARALLEL @@ -301,7 +301,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. */ @@ -450,7 +450,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 @@ -459,7 +459,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; @@ -577,7 +577,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); @@ -599,18 +599,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 @@ -787,7 +787,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; @@ -799,7 +799,7 @@ print_func(const char *format, ...) return ret_value; } -#ifdef H5_HAVE_FILTER_SZIP +#ifdef H5_HAVE_FILTER_SZIP /*------------------------------------------------------------------------- @@ -812,36 +812,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); @@ -879,12 +879,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 2d08ab7..7aa585e 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 @@ -125,7 +125,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[]); @@ -145,7 +145,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 09343e9..33b5210 100644 --- a/test/lheap.c +++ b/test/lheap.c @@ -123,7 +123,7 @@ main(void) H5Eprint_stack(H5E_DEFAULT, stdout); goto error; } - + if (NULL == (s = H5HL_offset_into(f, heap, obj[i]))) { H5_FAILED(); H5Eprint_stack(H5E_DEFAULT, stdout); diff --git a/test/links.c b/test/links.c index 17a828b..cb165fa 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; @@ -468,7 +468,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 762c7b1..3b9d4ce 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; @@ -339,11 +339,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) @@ -365,7 +365,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; @@ -410,7 +410,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) @@ -467,11 +467,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) @@ -531,14 +531,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; @@ -584,7 +584,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]; @@ -603,7 +603,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; @@ -688,7 +688,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; @@ -736,7 +736,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; @@ -777,11 +777,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) @@ -833,11 +833,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) @@ -876,7 +876,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; @@ -920,11 +920,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) @@ -937,7 +937,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; @@ -982,11 +982,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) @@ -1019,11 +1019,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 @@ -1041,7 +1041,7 @@ test_close(hid_t fapl) } H5E_END_TRY; return 1; } - + /*------------------------------------------------------------------------- * Function: test_mount_after_close @@ -1072,11 +1072,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" */ @@ -1243,7 +1243,7 @@ test_mount_after_close(hid_t fapl) TEST_ERROR if(H5Fclose(fid2) < 0) TEST_ERROR - + /* Shut down */ PASSED(); return 0; @@ -1266,7 +1266,7 @@ error: } H5E_END_TRY; return 1; } - + /*------------------------------------------------------------------------- * Function: test_mount_after_unmount @@ -1303,13 +1303,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 @@ -1508,7 +1508,7 @@ test_mount_after_unmount(hid_t fapl) TEST_ERROR if(H5Fclose(fid1) < 0) TEST_ERROR - + /* Shut down */ PASSED(); return 0; @@ -1535,7 +1535,7 @@ error: } H5E_END_TRY; return 1; } - + /*------------------------------------------------------------------------- * Function: test_missing_unmount @@ -1563,13 +1563,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 @@ -1692,7 +1692,7 @@ error: } H5E_END_TRY; return 1; } /* end test_missing_unmount() */ - + /*------------------------------------------------------------------------- * Function: test_hold_open_file @@ -1718,12 +1718,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 @@ -1825,7 +1825,7 @@ error: } H5E_END_TRY; return 1; } /* end test_hold_open_file() */ - + /*------------------------------------------------------------------------- * Function: test_hold_open_group @@ -1851,12 +1851,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 @@ -1984,7 +1984,7 @@ error: } H5E_END_TRY; return 1; } /* end test_hold_open_group() */ - + /*------------------------------------------------------------------------- * Function: test_fcdegree_same @@ -2012,12 +2012,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 @@ -2129,7 +2129,7 @@ error: } H5E_END_TRY; return 1; } /* end test_fcdegree_same() */ - + /*------------------------------------------------------------------------- * Function: test_fcdegree_semi @@ -2157,12 +2157,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 @@ -2271,7 +2271,7 @@ error: } H5E_END_TRY; return 1; } /* end test_fcdegree_semi() */ - + /*------------------------------------------------------------------------- * Function: test_fcdegree_strong @@ -2299,12 +2299,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 @@ -2409,7 +2409,7 @@ error: } H5E_END_TRY; return 1; } /* end test_fcdegree_strong() */ - + /*------------------------------------------------------------------------- * Function: test_acc_perm @@ -2441,13 +2441,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 @@ -2646,13 +2646,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 @@ -2874,13 +2874,13 @@ 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); 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 @@ -3085,12 +3085,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 @@ -3271,7 +3271,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); @@ -3281,7 +3281,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 @@ -3656,13 +3656,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 @@ -3847,12 +3847,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 2c0d2dd..18f0bbf 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) @@ -104,7 +104,7 @@ main(void) puts(" name."); goto error; } - + /* Compare times -- they must be within 60 seconds of one another */ if (0==sb1.mtime) { SKIPPED(); @@ -122,12 +122,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"); @@ -162,7 +162,7 @@ main(void) * and make certain that the time is correct */ TESTING("accessing new modification time messages"); - + { char testfile[512]=""; char *srcdir = HDgetenv("srcdir"); @@ -202,4 +202,4 @@ main(void) } - + diff --git a/test/ntypes.c b/test/ntypes.c index 83b7c5b..ef2c2b2 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; i0) 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; @@ -779,7 +779,7 @@ create_struct1(void) static void delete_struct1(misc5_struct1_hndl *str1hndl) -{ +{ herr_t ret; /* For error checking */ ret=H5Tclose(str1hndl->st1h_id); @@ -795,7 +795,7 @@ delete_struct1(misc5_struct1_hndl *str1hndl) static void set_struct1(misc5_struct1 *buf) -{ +{ unsigned i; /* Local index variable */ buf->st1_el1=MISC5_DBGELVAL1; @@ -1193,7 +1193,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); @@ -1227,16 +1227,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); @@ -1254,7 +1254,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); @@ -1279,7 +1279,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); @@ -1305,11 +1305,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 */ @@ -1318,7 +1318,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 */ @@ -1327,11 +1327,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); @@ -1350,15 +1350,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); @@ -1376,11 +1376,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); @@ -1405,7 +1405,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); @@ -1453,12 +1453,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 */ @@ -1487,7 +1487,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); @@ -1547,7 +1547,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); @@ -1673,7 +1673,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")); @@ -1790,20 +1790,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 @@ -1855,22 +1855,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); @@ -1895,19 +1895,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}; @@ -1953,7 +1953,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"); @@ -2625,8 +2625,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. ** @@ -2636,7 +2636,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 */ @@ -2659,7 +2659,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");*/ @@ -2705,8 +2705,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. ** ****************************************************************/ @@ -2715,7 +2715,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 */ @@ -3346,11 +3346,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. @@ -3366,7 +3366,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); @@ -3487,12 +3487,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 /**************************************************************** ** @@ -3530,9 +3530,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 */ @@ -3559,11 +3559,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. ** ****************************************************************/ @@ -3579,8 +3579,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}; @@ -3623,14 +3623,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"); @@ -3641,7 +3641,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; } @@ -3649,15 +3649,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"); @@ -3665,25 +3665,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 , 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"); } @@ -3739,7 +3739,7 @@ test_misc23(void) /********************************************************************** - * test the old APIs + * test the old APIs **********************************************************************/ H5E_BEGIN_TRY { @@ -3768,7 +3768,7 @@ test_misc23(void) CHECK(status, FAIL, "H5Dclose"); /********************************************************************** - * test H5Gcreate_expand() + * test H5Gcreate_expand() **********************************************************************/ /* Create group creation property list */ @@ -3820,7 +3820,7 @@ test_misc23(void) /********************************************************************** - * test new H5Dcreate + * test new H5Dcreate **********************************************************************/ /* Create dataset creation property list */ @@ -3872,7 +3872,7 @@ test_misc23(void) /********************************************************************** - * test new H5Tcommit + * test new H5Tcommit **********************************************************************/ /* Create datatype creation property list */ @@ -3942,9 +3942,9 @@ test_misc23(void) /**************************************************************** ** ** test_misc(): Main misc. test routine. -** +** ****************************************************************/ -void +void test_misc(void) { /* Output message about test being performed */ @@ -3970,7 +3970,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 */ @@ -4019,7 +4019,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 491dc36..66b7822 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 */ @@ -194,7 +194,7 @@ test_reference_obj(void) /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close Dataset */ ret = H5Dclose(dataset); CHECK(ret, FAIL, "H5Dclose"); @@ -222,7 +222,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"); @@ -290,9 +290,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 */ @@ -405,7 +405,7 @@ test_reference_region(void) /* Close disk dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Close Dataset */ ret = H5Dclose(dset1); CHECK(ret, FAIL, "H5Dclose"); @@ -413,7 +413,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"); @@ -551,9 +551,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 */ @@ -666,7 +666,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"); @@ -674,7 +674,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"); @@ -824,9 +824,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 */ @@ -877,7 +877,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"); @@ -918,9 +918,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 */ @@ -951,9 +951,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 */ @@ -967,7 +967,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"); @@ -1065,9 +1065,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 92e765c..804e928 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"); @@ -2718,11 +2718,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"); @@ -2802,11 +2802,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"); @@ -2826,9 +2826,9 @@ test_select_hyper_union(void) ** test_select_hyper_union_stagger(): Test basic H5S (dataspace) selection code. ** Tests unions of staggered hyperslabs. (Uses H5Scombine_hyperslab ** and H5Sselect_select instead of H5Sselect_hyperslab) -** +** ****************************************************************/ -static void +static void test_select_hyper_union_stagger(void) { hid_t file_id; /* File ID */ @@ -2939,7 +2939,7 @@ test_select_hyper_union_stagger(void) /* Select hyperslab in memory */ error=H5Sselect_hyperslab(memspace,H5S_SELECT_SET,offset_out,stride,count_out,block); CHECK(error, FAIL, "H5Sselect_hyperslab"); - + /* Read File Dataset */ error=H5Dread(dset_id,H5T_NATIVE_INT,memspace,tmp_space,H5P_DEFAULT,data_out); CHECK(error, FAIL, "H5Dread"); @@ -2975,9 +2975,9 @@ test_select_hyper_union_stagger(void) ** test_select_hyper_union_3d(): Test basic H5S (dataspace) selection code. ** Tests unions of hyperslabs in 3-D (Uses H5Scombine_hyperslab ** and H5Scombine_select instead of H5Sselect_hyperslab) -** +** ****************************************************************/ -static void +static void test_select_hyper_union_3d(void) { hid_t fid1; /* HDF5 File IDs */ @@ -3157,11 +3157,11 @@ test_select_hyper_union_3d(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"); @@ -3180,9 +3180,9 @@ test_select_hyper_union_3d(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 */ @@ -3284,11 +3284,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"); @@ -3306,9 +3306,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 */ @@ -3412,11 +3412,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"); @@ -3434,9 +3434,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 */ @@ -3539,11 +3539,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"); @@ -3561,9 +3561,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 */ @@ -3666,11 +3666,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"); @@ -3687,9 +3687,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 */ @@ -3718,9 +3718,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 */ @@ -3882,7 +3882,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"); @@ -3900,9 +3900,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 */ @@ -3910,20 +3910,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 */ @@ -3936,9 +3936,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++) @@ -3956,12 +3956,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"); /* @@ -3972,11 +3972,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; @@ -3984,7 +3984,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"); @@ -3994,11 +3994,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; @@ -4006,7 +4006,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"); @@ -4030,16 +4030,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. */ @@ -4058,8 +4058,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; @@ -4067,7 +4067,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"); @@ -4077,11 +4077,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; @@ -4089,12 +4089,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, @@ -4131,9 +4131,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 */ @@ -4141,23 +4141,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 */ @@ -4169,9 +4169,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++) @@ -4189,7 +4189,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"); /* @@ -4200,7 +4200,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 */ @@ -4325,9 +4325,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 */ @@ -4391,9 +4391,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; @@ -4487,9 +4487,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 */ @@ -4853,9 +4853,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 */ @@ -4887,9 +4887,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 */ @@ -4951,7 +4951,7 @@ test_select_fill_all(void) /* Close dataspace */ ret = H5Sclose(sid1); CHECK(ret, FAIL, "H5Sclose"); - + /* Free memory buffers */ HDfree(wbuf); } /* test_select_fill_all() */ @@ -4960,9 +4960,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 */ @@ -5045,7 +5045,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() */ @@ -5054,9 +5054,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 */ @@ -5144,7 +5144,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() */ @@ -5153,9 +5153,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 */ @@ -5251,7 +5251,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() */ @@ -5260,9 +5260,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 */ @@ -5382,9 +5382,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 */ @@ -5456,11 +5456,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"); @@ -5478,9 +5478,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 */ @@ -5606,11 +5606,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"); @@ -5627,11 +5627,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 */ @@ -5665,7 +5665,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"); @@ -5679,9 +5679,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 */ @@ -6534,9 +6534,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 */ @@ -6583,7 +6583,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"); @@ -6749,16 +6749,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 */ @@ -6807,8 +6807,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; @@ -6821,7 +6821,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); @@ -6850,9 +6850,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 */ @@ -7053,9 +7053,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 f9a5047..e008fe2 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 4e6c516..c000a73 100644 --- a/test/ttsafe_error.c +++ b/test/ttsafe_error.c @@ -66,7 +66,7 @@ typedef struct err_num_struct { hid_t min_num; } err_num_t; -err_num_t expected[8]; +err_num_t expected[8]; int error_flag = 0; int error_count = 0; @@ -82,28 +82,28 @@ void tts_error(void) /* Must initialize these at runtime */ expected[0].maj_num = H5E_DATASET; expected[0].min_num = H5E_CANTINIT; - + expected[1].maj_num = H5E_DATASET; expected[1].min_num = H5E_CANTINIT; - + expected[2].maj_num = H5E_SYM; expected[2].min_num = H5E_EXISTS; - + expected[3].maj_num = H5E_SYM; expected[3].min_num = H5E_CANTINSERT; - + expected[4].maj_num = H5E_SYM; expected[4].min_num = H5E_CANTINSERT; - + expected[5].maj_num = H5E_BTREE; expected[5].min_num = H5E_CANTINIT; - + expected[6].maj_num = H5E_BTREE; expected[6].min_num = H5E_CANTINSERT; expected[7].maj_num = H5E_SYM; expected[7].min_num = H5E_CANTINSERT; - + /* set up mutex for global count of errors */ pthread_mutex_init(&error_mutex, NULL); @@ -201,7 +201,7 @@ herr_t walk_error_callback(unsigned n, const H5E_error_t *err_desc, void UNUSED 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/tunicode.c b/test/tunicode.c index 010d12a..22146bf 100644 --- a/test/tunicode.c +++ b/test/tunicode.c @@ -71,7 +71,7 @@ void test_fl_string(hid_t fid, const char *string) char read_buf[MAX_STRING_LENGTH]; H5T_cset_t cset; herr_t ret; - + /* Create the datatype, ensure that the character set behaves * correctly (it should default to ASCII and can be set to UTF8) */ @@ -221,7 +221,7 @@ void test_strpad(hid_t UNUSED fid, const char *string) } /* Create a src_type that holds the UTF-8 string */ - big_len = length; + big_len = length; src_type = mkstr(big_len, H5T_STR_NULLPAD); CHECK(src_type, FAIL, "mkstr"); /* Create a dst_type that holds half of the UTF-8 string */ @@ -689,7 +689,7 @@ void test_enum(hid_t UNUSED fid, const char * string) /* * test_opaque - * Test comments on opaque datatypes + * Test comments on opaque datatypes */ void test_opaque(hid_t UNUSED fid, const char * string) { @@ -773,7 +773,7 @@ void dump_string(const char * string) printf("The string was:\n"); printf(string); printf("Or in hex:\n"); - + length = strlen(string); for(x=0; xlen; 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 137bc88..c8b7ddc 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 - * Tuesday, Sept 24, 2002 - * +/* + * Programmer: Raymond Lu + * Tuesday, Sept 24, 2002 + * * Purpose: Tests the basic features of Virtual File Drivers */ - + #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.6_" - + /*------------------------------------------------------------------------- - * 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); @@ -221,9 +221,9 @@ test_family_opens(char *fname, hid_t fa_pl) char wrong_name[1024]; int i; - /* Case 1: reopen file with 1st member file name and default property list */ + /* Case 1: reopen file with 1st member file name and default property list */ sprintf(first_name, fname, 0); - + H5E_BEGIN_TRY { file=H5Fopen(first_name, H5F_ACC_RDWR, H5P_DEFAULT); } H5E_END_TRY; @@ -240,7 +240,7 @@ test_family_opens(char *fname, hid_t fa_pl) H5E_BEGIN_TRY { file=H5Fopen(fname, H5F_ACC_RDWR, fa_pl); } H5E_END_TRY; - + /* Case 4: reopen file with wrong name template */ strcpy(wrong_name, fname); for(i=0; i<1024; i++) { @@ -283,7 +283,7 @@ error: * * Raymond Lu * June 2, 2005 - * Added a function test_family_opens() to test different + * Added a function test_family_opens() to test different * wrong way to reopen family files. * *------------------------------------------------------------------------- @@ -316,7 +316,7 @@ test_family(void) if(H5Fclose(file)<0) goto error; - /* Test different wrong ways to reopen family files where there's only + /* Test different wrong ways to reopen family files where there's only * one member file existing. */ if(test_family_opens(filename, fapl)<0) goto error; @@ -354,7 +354,7 @@ test_family(void) for(i=0; i20*KB) goto error; @@ -388,7 +388,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) @@ -412,7 +412,7 @@ test_family(void) if(H5Fclose(file)<0) goto error; - + h5_cleanup(FILENAME, fapl); PASSED(); return 0; @@ -431,7 +431,7 @@ error: /*------------------------------------------------------------------------- * Function: test_family_compat * - * Purpose: Tests the backward compatibility for FAMILY driver. + * Purpose: Tests the backward compatibility for FAMILY driver. * See if we can open files created with v1.6 library. * The source file was created by the test/file_handle.c * of the v1.6 library. Then tools/misc/h5repart.c was @@ -448,14 +448,14 @@ error: * Modifications: *------------------------------------------------------------------------- */ -static herr_t +static herr_t test_family_compat(void) { #ifdef H5_WANT_H5_V1_6_COMPAT 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*/ #endif /*H5_WANT_H5_V1_6_COMPAT*/ TESTING("FAMILY file driver backward compatibility"); @@ -477,7 +477,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) @@ -524,7 +524,7 @@ test_multi_opens(char *fname, hid_t fa_pl) char super_name[1024]; /*name string "%%s-s.h5"*/ char sf_name[1024]; /*name string "multi_file-s.h5"*/ - /* Case: reopen with the name of super file and default property list */ + /* Case: reopen with the name of super file and default property list */ sprintf(super_name, "%%s-%c.h5", 's'); sprintf(sf_name, super_name, fname); @@ -553,7 +553,7 @@ test_multi_opens(char *fname, hid_t fa_pl) * Raymond Lu * Wednesday, June 23, 2004 * Added test for H5Fget_filesize. - * + * *------------------------------------------------------------------------- */ static herr_t @@ -593,7 +593,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; @@ -605,9 +605,9 @@ test_multi(void) if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) goto error; - if(H5Fclose(file)<0) + if(H5Fclose(file)<0) goto error; - + /* Test wrong ways to reopen multi files */ if(test_multi_opens(filename, fapl)<0) goto error; @@ -635,13 +635,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; @@ -681,48 +681,48 @@ 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 basic features of Virtual File Drivers - * + * * 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/testpar/t_coll_chunk.c b/testpar/t_coll_chunk.c index 0d8980b..765124d 100644 --- a/testpar/t_coll_chunk.c +++ b/testpar/t_coll_chunk.c @@ -26,13 +26,13 @@ static void ccslab_set(int mpi_rank,int mpi_size,hsize_t start[],hsize_t count[], hsize_t stride[],hsize_t block[],int mode); -static void ccdataset_fill(hsize_t start[],hsize_t count[], - hsize_t stride[],hsize_t block[],DATATYPE*dataset); +static void ccdataset_fill(hsize_t start[],hsize_t count[], + hsize_t stride[],hsize_t block[],DATATYPE*dataset); static void ccdataset_print(hsize_t start[],hsize_t block[],DATATYPE*dataset); -static int ccdataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], - hsize_t block[], DATATYPE *dataset, DATATYPE *original); +static int ccdataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], + hsize_t block[], DATATYPE *dataset, DATATYPE *original); static void coll_chunktest(const char* filename,int chunk_factor,int select_factor); @@ -94,7 +94,7 @@ coll_chunk4(void) const char *filename; int mpi_size; MPI_Comm comm = MPI_COMM_WORLD; - MPI_Comm_size(comm,&mpi_size); + MPI_Comm_size(comm,&mpi_size); filename = GetTestParameters(); coll_chunktest(filename,mpi_size*2,BYROW_DISCONT); @@ -106,7 +106,7 @@ coll_chunktest(const char* filename,int chunk_factor,int select_factor) { hid_t file,dataset, file_dataspace; hid_t acc_plist,xfer_plist,crp_plist; hsize_t dims[RANK], chunk_dims[RANK]; - int* data_array1 = NULL; + int* data_array1 = NULL; int* data_origin1 = NULL; herr_t status; hsize_t start[RANK]; @@ -129,7 +129,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 = H5Fcreate(filename,H5F_ACC_TRUNC,H5P_DEFAULT,acc_plist); VRFY((file >= 0),"H5Fcreate succeeded"); @@ -137,11 +137,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; @@ -164,7 +164,7 @@ 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; @@ -173,9 +173,9 @@ coll_chunktest(const char* filename,int chunk_factor,int select_factor) { else 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); */ @@ -225,19 +225,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); @@ -257,7 +257,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"); @@ -279,8 +279,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 @@ -329,7 +329,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); - + } @@ -409,11 +409,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); } } - } + } } } @@ -469,7 +469,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_fphdf5.c b/testpar/t_fphdf5.c index 5dbc41f..b1e9535 100644 --- a/testpar/t_fphdf5.c +++ b/testpar/t_fphdf5.c @@ -42,11 +42,11 @@ static void access_dset(hid_t loc, const char *dset_name); static void slab_set(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[]); static void fill_data(void); -static void write_data(hid_t loc, const char *dset_name, +static void write_data(hid_t loc, const char *dset_name, hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[]); static void verify_complete_dataset(hid_t loc, const char *dset_name); -static void verify_partial_dataset(hid_t loc, const char *dset_name, +static void verify_partial_dataset(hid_t loc, const char *dset_name, hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[], int * buf, hsize_t buf_len); @@ -59,7 +59,7 @@ static void usage(const char *prog); /*===----------------------------------------------------------------------=== * Filenames *===----------------------------------------------------------------------=== - * The names of the test files for + * The names of the test files for */ static const char *FILENAME[2] = { /* List of files we want to create */ "FPHDF5Test", @@ -120,20 +120,20 @@ static char dset_name[128]; static const char *grp_tmpl = "Process %d's Datasets"; static char grp_name[128]; -#if 0 -/* A useful debugging function, but no need to compile it unless +#if 0 +/* A useful debugging function, but no need to compile it unless * we are going to use it. JRM - 4/13/4 */ /*------------------------------------------------------------------------- * Function: check_globals - * Purpose: Debugging Function. Check the current values of some - * globals, and generate a message when they change. + * Purpose: Debugging Function. Check the current values of some + * globals, and generate a message when they change. * Return: void * Programmer: John Mainzer - 3/3/04 - * Modifications: + * Modifications: *------------------------------------------------------------------------- */ -static void +static void check_globals(char * location_name) { static hsize_t local_dims[RANK] = {0,0}; @@ -178,23 +178,23 @@ check_globals(char * location_name) } return; } /* check_globals() */ -#endif +#endif -#if 0 -/* Another useful debugging function, again no need to compile it unless +#if 0 +/* Another useful debugging function, again no need to compile it unless * we are going to use it. JRM - 4/13/04 */ /*------------------------------------------------------------------------- * Function: print_globals - * Purpose: Debugging Function. Display the current values of some - * globals. + * Purpose: Debugging Function. Display the current values of some + * globals. * Return: void * Programmer: John Mainzer - 3/9/04 - * Modifications: + * Modifications: *------------------------------------------------------------------------- */ -static void +static void print_globals(void) { printf("%d: dims=[%d,%d], start=[%d,%d], count=[%d, %d], stride=[%d,%d], block=[%d,%d]\n", @@ -258,9 +258,9 @@ create_group(hid_t loc, const char *group_name, size_t size_hint) * Failure: Aborts * Programmer: Bill Wendling * 29. October 2003 - * Modifications: + * Modifications: * Altered function to use the global dims array, instead - * of a locally declared and initialized version. + * of a locally declared and initialized version. * JRM - 3/3/04 *------------------------------------------------------------------------- */ @@ -342,11 +342,11 @@ slab_set(hsize_t my_start[], hsize_t my_count[], hsize_t my_stride[], hsize_t my * 13. November 2003 * Modifications: * Complete re-write of function. The orig_data array is - * now allocated (in main) with size equal the size of the - * array on file, and is loaded with the data we expect to + * now allocated (in main) with size equal the size of the + * array on file, and is loaded with the data we expect to * find there. * - * The new local_orig_data array is allocated to match the + * The new local_orig_data array is allocated to match the * size of this processes contribution to the on file data * set, and is loaded with this processes data. * @@ -374,8 +374,8 @@ fill_data(void) } } else if ( proc_num == mpi_rank ) { for ( col = 0; col < DIM1; col++ ) { - local_orig_data[local_offset++] = - orig_data[offset++] = + local_orig_data[local_offset++] = + orig_data[offset++] = (proc_num * 1000) + (row * 100) + col; } } else { @@ -450,7 +450,7 @@ write_data(hid_t loc, const char *dataset_name, hsize_t my_start[], hsize_t my_c /*------------------------------------------------------------------------- * Function: verify_complete_dataset - * Purpose: Verify that all the data in the dataset is correct -- + * Purpose: Verify that all the data in the dataset is correct -- * including that written by other processes. * Return: Nothing * Programmer: John Mainzer @@ -482,7 +482,7 @@ verify_complete_dataset(hid_t loc, const char *dataset_name) /* Read the dataset */ VRFY((H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data_array) >= 0), "H5Dread"); - + /* Verify the contents of the dataset */ for ( row = 0; row < dims[0]; row++ ) { @@ -499,8 +499,8 @@ verify_complete_dataset(hid_t loc, const char *dataset_name) } VRFY((offset == (mpi_size * DIM0 * DIM1)), "offset OK"); - if (vrfyerrs) { - fprintf(stdout, "%d: %d errors found in verify_complete_dataset\n", + if (vrfyerrs) { + fprintf(stdout, "%d: %d errors found in verify_complete_dataset\n", mpi_rank, vrfyerrs); ++nerrors; } @@ -510,14 +510,14 @@ verify_complete_dataset(hid_t loc, const char *dataset_name) if ( data_array != NULL ) { free(data_array); } - + return; } /* verify_complete_dataset() */ /*------------------------------------------------------------------------- * Function: verify_partial_dataset - * Purpose: Verify that the data in the specified section of the + * Purpose: Verify that the data in the specified section of the * dataset matches the contents of the provided buffer. * Return: Nothing * Programmer: John Mainzer @@ -527,7 +527,7 @@ verify_complete_dataset(hid_t loc, const char *dataset_name) *------------------------------------------------------------------------- */ static void -verify_partial_dataset(hid_t loc, const char *dataset_name, +verify_partial_dataset(hid_t loc, const char *dataset_name, hsize_t my_start[], hsize_t my_count[], hsize_t my_stride[], hsize_t my_block[], int * buf, hsize_t buf_len) @@ -546,7 +546,7 @@ verify_partial_dataset(hid_t loc, const char *dataset_name, file_dataspace = H5Dget_space(dataset); VRFY((file_dataspace >= 0), "H5Dget_space"); VRFY((H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, - my_start, my_stride, my_count, my_block) >= 0), + my_start, my_stride, my_count, my_block) >= 0), "H5Sselect_hyperslab in verify_partial_dataset"); /* Create a memory dataspace */ @@ -556,8 +556,8 @@ verify_partial_dataset(hid_t loc, const char *dataset_name, /* Read the dataset */ VRFY((dims[0] != 0), "dims array initialized."); - data_array = (int *)malloc(((size_t)block[0]) * - ((size_t)block[1]) * + data_array = (int *)malloc(((size_t)block[0]) * + ((size_t)block[1]) * sizeof(int)); VRFY((H5Dread(dataset, H5T_NATIVE_INT, mem_dataspace, file_dataspace, H5P_DEFAULT, data_array) >= 0), "H5Dread"); @@ -578,7 +578,7 @@ verify_partial_dataset(hid_t loc, const char *dataset_name, VRFY((offset == buf_len), "offset OK"); if (vrfyerrs) { - fprintf(stdout, "%d: %d errors found in verify_partial_dataset\n", + fprintf(stdout, "%d: %d errors found in verify_partial_dataset\n", mpi_rank, vrfyerrs); ++nerrors; } @@ -718,7 +718,7 @@ test_dataset_access(hid_t loc) * Programmer: Bill Wendling * 11. November 2003 * Modifications: - * Replaced calls to verify_dataset() with calls to + * Replaced calls to verify_dataset() with calls to * verify_partial_dataset(). In the absence of a barrier, * we don't know that the other processes have done their * writes to the datasets as well. Thus we only check the @@ -745,45 +745,45 @@ test_dataset_write(hid_t loc) /* Write to this dataset */ sprintf(dset_name, dset_tmpl, 0); - printf("%d: Writing to \"/%s/%s\"\n", + printf("%d: Writing to \"/%s/%s\"\n", mpi_rank, grp_name, dset_name); write_data(group, dset_name, start, count, stride, block); - printf("%d: Verifying dataset \"/%s/%s\"\n", + printf("%d: Verifying dataset \"/%s/%s\"\n", mpi_rank, grp_name, dset_name); - verify_partial_dataset(group, dset_name, + verify_partial_dataset(group, dset_name, start, count, stride, block, local_orig_data, (block[0] * block[1])); sprintf(dset_name, dset_tmpl, 1); - printf("%d: Writing to \"/%s/%s\"\n", + printf("%d: Writing to \"/%s/%s\"\n", mpi_rank, grp_name, dset_name); write_data(group, dset_name, start, count, stride, block); - printf("%d: Verifying dataset \"/%s/%s\"\n", + printf("%d: Verifying dataset \"/%s/%s\"\n", mpi_rank, grp_name, dset_name); - verify_partial_dataset(group, dset_name, + verify_partial_dataset(group, dset_name, start, count, stride, block, local_orig_data, (block[0] * block[1])); sprintf(dset_name, dset_tmpl, 2); - printf("%d: Writing to \"/%s/%s\"\n", + printf("%d: Writing to \"/%s/%s\"\n", mpi_rank, grp_name, dset_name); write_data(group, dset_name, start, count, stride, block); - printf("%d: Verifying dataset \"/%s/%s\"\n", + printf("%d: Verifying dataset \"/%s/%s\"\n", mpi_rank, grp_name, dset_name); - verify_partial_dataset(group, dset_name, + verify_partial_dataset(group, dset_name, start, count, stride, block, local_orig_data, (block[0] * block[1])); sprintf(dset_name, dset_tmpl, 3); - printf("%d: Writing to \"/%s/%s\"\n", + printf("%d: Writing to \"/%s/%s\"\n", mpi_rank, grp_name, dset_name); write_data(group, dset_name, start, count, stride, block); - printf("%d: Verifying dataset \"/%s/%s\"\n", + printf("%d: Verifying dataset \"/%s/%s\"\n", mpi_rank, grp_name, dset_name); - verify_partial_dataset(group, dset_name, - start, count, stride, block, + verify_partial_dataset(group, dset_name, + start, count, stride, block, local_orig_data, (block[0] * block[1])); - + /* Close the group */ VRFY((H5Gclose(group) >= 0), "H5Gclose"); } @@ -830,7 +830,7 @@ usage(const char *prog) * This array is used to store the data written by this * process. JRM - 3/5/04 * - * Replaced calls to verify_dataset() with calls to + * Replaced calls to verify_dataset() with calls to * verify_complete_dataset(). JRM - 3/8/04 *------------------------------------------------------------------------- */ @@ -848,7 +848,7 @@ main(int argc, char *argv[]) H5open(); for (nargs = argc; nargs > 1; --nargs) - if (strcmp(argv[nargs - 1], "-v") == 0 || + if (strcmp(argv[nargs - 1], "-v") == 0 || strcmp(argv[nargs - 1], "--verbose") == 0 || strcmp(argv[nargs - 1], "--verbos") == 0 || strcmp(argv[nargs - 1], "--verbo") == 0 || @@ -899,14 +899,14 @@ main(int argc, char *argv[]) slab_set(start, count, stride, block); VRFY((dims[0] != 0), "dims array initialized."); - orig_data = (int *)malloc(((size_t)dims[0]) * - ((size_t)dims[1]) * + orig_data = (int *)malloc(((size_t)dims[0]) * + ((size_t)dims[1]) * sizeof(int)); VRFY((orig_data != NULL), "orig_data malloc succeeded"); VRFY((block[0] != 0), "block array initialized."); - local_orig_data = (int *)malloc(((size_t)block[0]) * - ((size_t)block[1]) * + local_orig_data = (int *)malloc(((size_t)block[0]) * + ((size_t)block[1]) * sizeof(int)); VRFY((orig_data != NULL), "local_orig_data malloc succeeded"); @@ -969,7 +969,7 @@ main(int argc, char *argv[]) printf("%d: Reverifying dataset \"/%s/%s\"\n", mpi_rank, grp_name, dset_name); verify_complete_dataset(group, dset_name); - + /* Close the group */ printf("%d: Closing group.", mpi_rank); VRFY((H5Gclose(group) >= 0), "H5Gclose"); @@ -985,9 +985,9 @@ main(int argc, char *argv[]) if ( local_orig_data != NULL ) { free(local_orig_data); } -#if 1 - /* It is useful to keep the hdf file created by this test for - * debugging purposes. However, this code should always be +#if 1 + /* It is useful to keep the hdf file created by this test for + * debugging purposes. However, this code should always be * turned on for checkin. JRM - 4/13/04 */ if (fapl > -1) diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c index 06aedf3..df2a9a6 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); @@ -271,12 +271,12 @@ void compact_dataset(void) } /* - * Example of using PHDF5 to create, write, and read dataset and attribute + * Example of using PHDF5 to create, write, and read dataset and attribute * of Null dataspace. * * 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. * @@ -300,7 +300,7 @@ void null_dataset(void) filename = GetTestParameters(); - plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, + plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs); iof = H5Fcreate (filename, H5F_ACC_TRUNC, H5P_DEFAULT, plist); @@ -380,7 +380,7 @@ void null_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. * @@ -399,7 +399,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); @@ -409,13 +409,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; @@ -423,28 +423,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; @@ -452,28 +452,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; @@ -481,26 +481,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 @@ -509,10 +509,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 @@ -538,7 +538,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); @@ -654,7 +654,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); @@ -693,7 +693,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, @@ -738,27 +738,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); @@ -773,7 +773,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); @@ -786,7 +786,7 @@ void collective_group_write(void) } #endif /* BARRIER_CHECKS */ } - + H5Pclose(dcpl); H5Sclose(filespace); H5Sclose(memspace); @@ -795,8 +795,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) { @@ -812,16 +812,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); @@ -986,13 +986,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); @@ -1001,7 +1001,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. * @@ -1010,7 +1010,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; @@ -1018,7 +1018,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); @@ -1029,7 +1029,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); @@ -1037,28 +1037,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 @@ -1067,23 +1067,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 @@ -1125,22 +1125,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; @@ -1164,8 +1164,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, @@ -1197,12 +1197,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); } @@ -1224,11 +1224,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; @@ -1237,7 +1237,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 */ @@ -1255,7 +1255,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; @@ -1264,7 +1264,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); @@ -1279,7 +1279,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); } @@ -1293,21 +1293,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); @@ -1317,12 +1317,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 @@ -1331,7 +1331,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; @@ -1349,7 +1349,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"); @@ -1367,14 +1367,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); @@ -1386,23 +1386,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. * @@ -1420,7 +1420,7 @@ void io_mode_confusion(void) /* * HDF5 APIs definitions */ - + const int rank = 1; const char *dataset_name = "IntArray"; @@ -1428,7 +1428,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]; @@ -1466,7 +1466,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); @@ -1529,7 +1529,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); @@ -1538,7 +1538,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); @@ -1556,19 +1556,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); @@ -1590,7 +1590,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"); @@ -1611,7 +1611,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); @@ -1626,7 +1626,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); @@ -1642,7 +1642,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"); @@ -1652,7 +1652,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 29867c4..0d373d6 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; @@ -591,36 +591,36 @@ if (special_request & USEFSYNC){ return nerrs; } -/* +/* Function: test_mpio_derived_dtype -Test Whether the Displacement of MPI derived datatype -(+ File_set_view + MPI_write)works or not on this MPI-IO package +Test Whether the Displacement of MPI derived datatype +(+ File_set_view + MPI_write)works or not on this MPI-IO package and this platform. -1. Details for the test: +1. Details for the test: 1) Create two derived datatypes with MPI_Type_hindexed: - datatype1: - count = 1, blocklens = 1, offsets = 0, + datatype1: + count = 1, blocklens = 1, offsets = 0, base type = MPI_BYTE(essentially a char) - datatype2: - count = 1, blocklens = 1, offsets = 1(byte), + datatype2: + count = 1, blocklens = 1, offsets = 1(byte), base type = MPI_BYTE - + 2) Using these two derived datatypes, Build another derived datatype with MPI_Type_struct: advtype: derived from datatype1 and datatype2 - advtype: - count = 2, blocklens[0] = 1, blocklens[1]=1, - offsets[0] = 0, offsets[1] = 1(byte), - bas_type[0]=datatype1, + advtype: + count = 2, blocklens[0] = 1, blocklens[1]=1, + offsets[0] = 0, offsets[1] = 1(byte), + bas_type[0]=datatype1, bas_type[1] = datatype2; 3) Setting MPI file view with advtype 4) Writing 2 bytes 1 to 2 using MPI_File_write to a file 5) File content: -Supposed the file value of the file is 0(most machines indeed do so) +Supposed the file value of the file is 0(most machines indeed do so) and Fill value is embraced with "() in the following output: Expected output should be: 1,0,2 @@ -629,14 +629,14 @@ Expected output should be: However, at some platforms, for example, IBM AIX(at March 23rd, 2005): the following values were obtained: -1,2,0 +1,2,0 The problem is that the displacement of the second derived datatype(datatype2) which formed the final derived datatype(advtype) has been put after the basic datatype(MPI_BYTE) of datatype2. This is a bug. 2. This test will verify whether the complicated derived datatype is working on -the current platform. +the current platform. If this bug has been fixed in the previous not-working package, this test will issue a printf message to tell the developer to change the configuration specific file of HDF5 so that we can change our configurationsetting to support collective IO for irregular selections. @@ -651,7 +651,7 @@ static int test_mpio_derived_dtype(char *filename) { char mpi_err_str[MPI_MAX_ERROR_STRING]; int mpi_err_strlen; int mpi_err; - int i; + int i; int nerrors = 0; /* number of errors */ MPI_Datatype etype,filetype; MPI_Datatype adv_filetype,bas_filetype[2]; @@ -673,9 +673,9 @@ static int test_mpio_derived_dtype(char *filename) { for(i=0;i<2;i++) buf[i] = i+1; - + if ((mpi_err = MPI_File_open(MPI_COMM_WORLD, filename, - MPI_MODE_RDWR | MPI_MODE_CREATE, + MPI_MODE_RDWR | MPI_MODE_CREATE, MPI_INFO_NULL, &fh)) != MPI_SUCCESS){ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen); @@ -766,7 +766,7 @@ static int test_mpio_derived_dtype(char *filename) { printf("MPI_File_open failed (%s)\n", mpi_err_str); return 1; } - + if((mpi_err = MPI_File_set_view(fh,0,MPI_BYTE,MPI_BYTE,"native",MPI_INFO_NULL))!= MPI_SUCCESS){ MPI_Error_string(mpi_err, mpi_err_str, &mpi_err_strlen); printf("MPI_File_set_view failed (%s)\n", mpi_err_str); @@ -797,7 +797,7 @@ static int test_mpio_derived_dtype(char *filename) { return 1; } - + mpi_err = MPI_Barrier(MPI_COMM_WORLD); return ret; } @@ -925,11 +925,11 @@ main(int argc, char **argv) }else{ MPI_BANNER("MPIO complicated derived datatype test..."); ret_code = test_mpio_derived_dtype(filenames[0]); -#ifdef H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS +#ifdef H5_MPI_COMPLEX_DERIVED_DATATYPE_WORKS if(ret_code == -1) { if(mpi_rank == 0) { - printf("Complicated derived datatype is NOT working at this platform\n"); - printf("Go back to hdf5/config and find the corresponding\n"); + printf("Complicated derived datatype is NOT working at this platform\n"); + printf("Go back to hdf5/config and find the corresponding\n"); printf("configure-specific file (for example, powerpc-ibm-aix5.x) and add\n"); printf("hdf5_mpi_complex_derived_datatype_works=${hdf5_mpi_complex_derived_datatype-works='no'}\n"); printf(" at the end of the file.\n"); diff --git a/testpar/t_ph5basic.c b/testpar/t_ph5basic.c index 1649c13..0062ce6 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. */ @@ -247,7 +247,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. */ @@ -290,7 +290,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 55afa13..8c75a8d 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 @@ -210,12 +210,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 */ @@ -230,8 +230,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]; @@ -246,7 +246,7 @@ void coll_write_test(int chunk_factor) /* Obtain file name */ - filename = GetTestParameters(); + filename = GetTestParameters(); /* * Buffers' initialization. @@ -256,15 +256,15 @@ void coll_write_test(int chunk_factor) #if 0 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"); #endif - acc_plist = create_faccess_plist(comm, info, facc_type, use_gpfs); + acc_plist = create_faccess_plist(comm, info, facc_type, use_gpfs); VRFY((acc_plist >= 0),""); - + /* * Create a file. */ @@ -277,7 +277,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) { @@ -287,7 +287,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); @@ -303,35 +303,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); @@ -344,7 +344,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 */ @@ -356,26 +356,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, 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. */ @@ -383,7 +383,7 @@ void coll_write_test(int chunk_factor) VRFY((ret >= 0),""); ret = H5Dclose(dataseti); VRFY((ret >= 0),""); - + /* * Close the file. */ @@ -408,14 +408,14 @@ void coll_write_test(int chunk_factor) #if 0 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"); #endif - acc_plist = create_faccess_plist(comm, info, facc_type, use_gpfs); + acc_plist = create_faccess_plist(comm, info, facc_type, use_gpfs); VRFY((acc_plist >= 0),""); - + file = H5Fopen(filename, H5F_ACC_RDONLY, acc_plist); VRFY((file >= 0),"H5Fopen succeeded"); @@ -426,8 +426,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); @@ -437,16 +437,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"); @@ -455,13 +455,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); @@ -473,60 +473,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++){ @@ -535,37 +535,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 ; } @@ -579,9 +579,9 @@ void coll_read_test(int chunk_factor) hid_t file, dataseti; /* File and dataset identifiers */ hid_t mspaceid, fspaceid1; /* Dataspace identifiers */ hbool_t use_gpfs = FALSE; - + /* 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 */ @@ -594,8 +594,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; @@ -609,7 +609,7 @@ void coll_read_test(int chunk_factor) /* Obtain file name */ - filename = GetTestParameters(); + filename = GetTestParameters(); /* * Buffers' initialization. @@ -623,13 +623,13 @@ void coll_read_test(int chunk_factor) #if 0 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"); #endif - - acc_plist = create_faccess_plist(comm, info, facc_type, use_gpfs); + + acc_plist = create_faccess_plist(comm, info, facc_type, use_gpfs); VRFY((acc_plist >= 0),""); file = H5Fopen(filename, H5F_ACC_RDONLY, acc_plist); @@ -640,34 +640,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); @@ -679,58 +679,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; @@ -738,7 +738,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++){ @@ -746,33 +746,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 a87af91..2f75e51 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 */ @@ -353,66 +353,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 0 @@ -467,7 +467,7 @@ int main(int argc, char **argv) AddTest("ccchunkr", coll_irregular_complex_chunk_read,NULL, "collective irregular complex chunk read",PARATESTFILE); - + #if 0 if((mpi_size > 3) && MAINPROCESS) { @@ -498,14 +498,14 @@ int main(int argc, char **argv) #endif - AddTest("null", null_dataset, NULL, + AddTest("null", null_dataset, NULL, "null dataset test", PARATESTFILE); 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 b15779e..14e315e 100644 --- a/testpar/testphdf5.h +++ b/testpar/testphdf5.h @@ -60,94 +60,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 27000 /* 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 3600 /* 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 3600 -#define FHCOUNT0 1 /* Count of the first dimension of the first hyperslab selection*/ -#define FHCOUNT1 768 /* 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 768 /* 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 6912 /* 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 768 /* 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 1536 /* 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 768 /* 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 1536 /* 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 27000 /* 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 3600 /* 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 3600 +#define FHCOUNT0 1 /* Count of the first dimension of the first hyperslab selection*/ +#define FHCOUNT1 768 /* 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 768 /* 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 6912 /* 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 768 /* 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 1536 /* 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 768 /* 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 1536 /* 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_common.c b/tools/h5diff/h5diff_common.c index 691fe8a..11fba7c 100644 --- a/tools/h5diff/h5diff_common.c +++ b/tools/h5diff/h5diff_common.c @@ -38,10 +38,10 @@ void parse_input(int argc, const char* argv[], const char** fname1, const char** *------------------------------------------------------------------------- */ - 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(); @@ -60,32 +60,32 @@ void parse_input(int argc, const char* argv[], const char** fname1, const char** * parse command line options *------------------------------------------------------------------------- */ - for (i=3; im_verbose = 1; break; - case 'q': + case 'q': /* use quiet mode; supress the message "0 differences found" */ options->m_quiet = 1; break; - case 'r': + case 'r': options->m_report = 1; break; - case 'd': + case 'd': /* if it is not another option */ if ( ip=1; @@ -122,7 +122,7 @@ void parse_input(int argc, const char* argv[], const char** fname1, const char** usage(); } break; - case 'n': + case 'n': if ( in=1; @@ -141,7 +141,7 @@ void parse_input(int argc, const char* argv[], const char** fname1, const char** } break; } /*switch*/ - } /*for*/ + } /*for*/ } /*if*/ else /* not single-letter switches */ @@ -184,21 +184,21 @@ void parse_input(int argc, const char* argv[], const char** fname1, const char** { if (options->m_quiet || options->err_stat) return; - + if (options->cmn_objs==0) - { + { printf("No common objects found. Files are not comparable.\n"); if (!options->m_verbose) printf("Use -v for a list of objects.\n"); } - + if (options->not_cmp==1) { printf("Some objects are not comparable\n"); if (!options->m_verbose) printf("Use -v for a list of objects.\n"); } - + } /*------------------------------------------------------------------------- @@ -257,8 +257,8 @@ 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') @@ -274,7 +274,7 @@ int check_f_input( const char *str ) /*------------------------------------------------------------------------- * Function: usage * - * Purpose: print a usage message + * Purpose: print a usage message * * Return: void * diff --git a/tools/h5diff/h5diff_main.c b/tools/h5diff/h5diff_main.c index 8dd2610..51c618e 100644 --- a/tools/h5diff/h5diff_main.c +++ b/tools/h5diff/h5diff_main.c @@ -22,7 +22,7 @@ * * 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 @@ -36,7 +36,7 @@ * 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 * * November 2004: Leon Arber (larber@uiuc.edu) * Additions that allow h5diff to be run in parallel @@ -64,9 +64,9 @@ int main(int argc, const char *argv[]) nfound = h5diff(fname1,fname2,objname1,objname2,&options); print_results(nfound, &options); - + /*------------------------------------------------------------------------- - * exit code + * exit code * >0 if differences, 0 if no differences, <0 if error *------------------------------------------------------------------------- */ diff --git a/tools/h5diff/ph5diff_main.c b/tools/h5diff/ph5diff_main.c index 3b6267d..94773c8 100644 --- a/tools/h5diff/ph5diff_main.c +++ b/tools/h5diff/ph5diff_main.c @@ -25,7 +25,7 @@ static void ph5diff_worker(int ); * * Purpose: h5diff/ph5diff 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 @@ -39,12 +39,12 @@ static void ph5diff_worker(int ); * 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 * * November 2004: Leon Arber (larber@uiuc.edu) * Additions that allow h5diff to be run in parallel * - * This function drives the diff process and will do a serial or parallel diff depending + * This function drives the diff process and will do a serial or parallel diff depending * on the value of the global variable g_Parallel (default is 0), set to 1 when the program * is run as "ph5diff" *------------------------------------------------------------------------- @@ -60,7 +60,7 @@ int main(int argc, const char *argv[]) const char *objname2 = NULL; hsize_t nfound=0; diff_opt_t options; - + outBuffOffset = 0; g_Parallel = 1; @@ -74,11 +74,11 @@ int main(int argc, const char *argv[]) printf("Only 1 task available...doing serial diff\n"); g_Parallel = 0; - + parse_input(argc, argv, &fname1, &fname2, &objname1, &objname2, &options); - + nfound = h5diff(fname1,fname2,objname1,objname2,&options); - + print_results(nfound, &options); MPI_Finalize(); @@ -90,13 +90,13 @@ int main(int argc, const char *argv[]) if(nID == 0) { parse_input(argc, argv, &fname1, &fname2, &objname1, &objname2, &options); - + nfound = h5diff(fname1,fname2,objname1,objname2,&options); - + MPI_Barrier(MPI_COMM_WORLD); print_results(nfound, &options); - print_manager_output(); + print_manager_output(); MPI_Finalize(); @@ -125,9 +125,9 @@ int main(int argc, const char *argv[]) */ static void ph5diff_worker(int nID) -{ +{ struct diff_args args; - hid_t file1_id, file2_id; + hid_t file1_id, file2_id; char filenames[2][1024]; char out_data[PRINT_DATA_MAX_SIZE] = {0}; hsize_t nfound=0; @@ -137,7 +137,7 @@ ph5diff_worker(int nID) MPI_Comm_rank(MPI_COMM_WORLD, &nID); outBuffOffset = 0; - + MPI_Recv(filenames, 1024*2, MPI_CHAR, 0, MPI_ANY_TAG, MPI_COMM_WORLD, &Status); if(Status.MPI_TAG == MPI_TAG_PARALLEL) { @@ -180,19 +180,19 @@ ph5diff_worker(int nID) /*Wait for print token. */ MPI_Recv(NULL, 0, MPI_BYTE, 0, MPI_TAG_PRINT_TOK, MPI_COMM_WORLD, &Status); - + /*When get token, send all of our output to the manager task and then return the token */ for(i=0; i= 0) { @@ -211,7 +211,7 @@ ph5diff_worker(int nID) fclose(overflow_file); overflow_file = NULL; } - + fflush(stdout); memset(outBuff, 0, OUTBUFF_SIZE); outBuffOffset = 0; @@ -224,7 +224,7 @@ ph5diff_worker(int nID) else if(Status.MPI_TAG == MPI_TAG_END) { MPI_Recv(NULL, 0, MPI_BYTE, 0, MPI_TAG_END, MPI_COMM_WORLD, &Status); - /* printf("exiting..., task: %d\n", nID); + /* printf("exiting..., task: %d\n", nID); fflush(stdout);*/ break; } @@ -238,6 +238,6 @@ ph5diff_worker(int nID) } MPI_Barrier(MPI_COMM_WORLD); - MPI_Finalize(); + MPI_Finalize(); } 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 82716b2..b4a8728 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; @@ -764,7 +764,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); @@ -815,9 +815,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); @@ -842,7 +842,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); @@ -994,7 +994,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 * @@ -1024,7 +1024,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 * @@ -1381,9 +1381,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); @@ -1395,10 +1395,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); } @@ -1496,13 +1496,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); @@ -1521,7 +1521,7 @@ dump_all(hid_t group, const char *name, void * op_data) goto done; } else { dset_table->objs[i].displayed = 1; - + } } @@ -1636,7 +1636,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) { @@ -1648,7 +1648,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); @@ -1687,15 +1687,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); @@ -1967,7 +1967,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_NULL || space_type == H5S_NO_CLASS || space_type == H5S_COMPLEX) { @@ -1986,7 +1986,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); @@ -2020,9 +2020,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); @@ -2083,10 +2083,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); @@ -2176,15 +2176,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; @@ -2192,7 +2192,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); @@ -2202,7 +2202,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; @@ -2215,13 +2215,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; @@ -2262,7 +2262,7 @@ dump_dcpl(hid_t dcpl_id,hid_t type_id, hid_t obj_id) } } /*------------------------------------------------------------------------- - * FILTERS + * FILTERS *------------------------------------------------------------------------- */ nfilters = H5Pget_nfilters(dcpl_id); @@ -2273,28 +2273,28 @@ 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); @@ -2826,7 +2826,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, @@ -2938,7 +2938,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, @@ -3050,7 +3050,7 @@ handle_datatypes(hid_t fid, char *type, void UNUSED * data) if (!strncmp(name, type, strlen(type)) || !strncmp(name1, type, strlen(type))) break; - } + } idx++; } @@ -3058,7 +3058,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, @@ -3560,7 +3560,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 " @@ -3573,7 +3573,7 @@ main(int argc, const char *argv[]) } } - if (!doxml) + if (!doxml) { if (display_fi) { @@ -3581,11 +3581,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) { @@ -3625,39 +3625,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_stack(H5E_DEFAULT, func, edata); - + leave(d_status); } /*------------------------------------------------------------------------- * Function: print_enum * - * Purpose: prints the enum data + * Purpose: prints the enum data * * Return: void * @@ -3666,7 +3666,7 @@ done: * Modifications: * * NOTE: this function was taken from h5ls. should be moved into the toolslib - * + * *-----------------------------------------------------------------------*/ static void print_enum(hid_t type) @@ -3766,7 +3766,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 @@ -4070,7 +4070,7 @@ xml_print_datatype(hid_t type, unsigned in_group) } } else { - + switch (H5Tget_class(type)) { case H5T_INTEGER: indentation(indent); @@ -4113,9 +4113,9 @@ xml_print_datatype(hid_t type, unsigned in_group) break; case H5T_FLOAT: - /* */ ord = H5Tget_order(type); indentation(indent); @@ -4165,7 +4165,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; @@ -4178,7 +4178,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"); @@ -4481,7 +4481,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 */ @@ -4507,7 +4507,7 @@ xml_dump_dataspace(hid_t space) } indentation(indent + COL + COL); printf("\n", xmlnsprefix ); - + break; #ifdef TMP /* Commented out: wait until the schema is updated first */ @@ -4519,7 +4519,7 @@ xml_dump_dataspace(hid_t space) #endif /* TMP */ case H5S_COMPLEX: printf("\n"); - + break; case H5S_NO_CLASS: default: @@ -4735,7 +4735,7 @@ xml_dump_attr(hid_t attr, const char *attr_name, void UNUSED * op_data) break; } } else { - /* The case of an attribute never yet written ?? + /* The case of an attribute never yet written ?? * Or dataspace is H5S_NULL. */ indentation(indent + COL); printf("<%sData>\n",xmlnsprefix); @@ -4800,7 +4800,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. @@ -4811,13 +4811,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); @@ -4920,7 +4920,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); @@ -5014,7 +5014,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); @@ -5220,7 +5220,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; @@ -5249,7 +5249,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; } @@ -5263,7 +5263,7 @@ xml_print_strs(hid_t did, int source) printf("\"%s\"\n", t_onestring); free(t_onestring); } - + bp += tsiz; } @@ -5327,7 +5327,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 * @@ -5392,13 +5392,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=\""); @@ -5406,12 +5406,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 */ @@ -5669,13 +5669,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: @@ -5686,16 +5686,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; @@ -5732,7 +5732,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: @@ -5954,7 +5954,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 @@ -5963,7 +5963,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 cdb2f1b..f79db30 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); @@ -180,11 +180,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 */ @@ -202,9 +202,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); @@ -212,17 +212,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); @@ -232,7 +232,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); @@ -240,7 +240,7 @@ static void gent_group(void) H5Gclose(group); group = H5Gcreate (fid, "/g2/g2.1/g2.1.3", 0); H5Gclose(group); - + H5Fclose(fid); } @@ -251,9 +251,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); @@ -266,7 +266,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); @@ -277,7 +277,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); @@ -291,12 +291,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; @@ -310,7 +310,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; @@ -339,10 +339,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); @@ -351,7 +351,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); @@ -362,7 +362,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); @@ -373,14 +373,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); @@ -398,7 +398,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"); @@ -426,9 +426,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); @@ -437,15 +437,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); @@ -500,12 +500,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); @@ -522,7 +522,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); @@ -689,10 +689,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); @@ -716,7 +716,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); @@ -724,7 +724,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); @@ -753,7 +753,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); @@ -940,7 +940,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); @@ -962,9 +962,9 @@ float dset2_1[10], dset2_2[3][5]; o /___\ g1 o/ \o g2 - \___/ + \___/ + - o - group objects */ @@ -999,7 +999,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"); @@ -1124,7 +1124,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 @@ -1226,18 +1226,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; @@ -1337,7 +1337,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); @@ -1353,8 +1353,8 @@ static void gent_str(void) { / / / | \ \ \ g1 g2 g3 g4 g5 g6 - | | | | \ \ - string1 string3 string5 + | | | | \ \ + string1 string3 string5 string2 string4 string6 */ @@ -1637,7 +1637,7 @@ static void gent_objref(void) /* Close disk dataspace */ H5Sclose(sid1); - + /* Close Dataset */ H5Dclose(dataset); @@ -1741,13 +1741,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); @@ -1771,8 +1771,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 */ @@ -1814,16 +1814,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); @@ -1838,13 +1838,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) @@ -1872,7 +1872,7 @@ static void gent_opaque(void) test[x][0] = x; test[x][1] = 99 - x; } - + /* * Create the data space. */ @@ -1884,25 +1884,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) @@ -1913,7 +1913,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 */ @@ -1963,7 +1963,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; @@ -2254,8 +2254,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}; @@ -2791,9 +2791,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"); @@ -2804,7 +2804,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"); @@ -2812,12 +2812,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"); @@ -2831,7 +2831,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"); @@ -2842,7 +2842,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); } @@ -2979,7 +2979,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); @@ -3080,7 +3080,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 * @@ -3091,26 +3091,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; @@ -3156,7 +3156,7 @@ static void write_attr_in(hid_t loc_id, * 1D attributes *------------------------------------------------------------------------- */ - + /*------------------------------------------------------------------------- * H5T_STRING *------------------------------------------------------------------------- @@ -3192,7 +3192,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 *------------------------------------------------------------------------- @@ -3219,7 +3219,7 @@ static void write_attr_in(hid_t loc_id, * H5T_VLEN *------------------------------------------------------------------------- */ - + /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; @@ -3297,7 +3297,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 *------------------------------------------------------------------------- @@ -3339,7 +3339,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); @@ -3366,7 +3366,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 *------------------------------------------------------------------------- @@ -3426,7 +3426,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 *------------------------------------------------------------------------- @@ -3457,7 +3457,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++) { @@ -3471,7 +3471,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); @@ -3520,7 +3520,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 * @@ -3531,26 +3531,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; @@ -3595,10 +3595,10 @@ static void write_dset_in(hid_t loc_id, /*------------------------------------------------------------------------- - * 1D + * 1D *------------------------------------------------------------------------- */ - + /*------------------------------------------------------------------------- * H5T_STRING *------------------------------------------------------------------------- @@ -3634,7 +3634,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 *------------------------------------------------------------------------- @@ -3661,7 +3661,7 @@ static void write_dset_in(hid_t loc_id, * H5T_VLEN *------------------------------------------------------------------------- */ - + /* Allocate and initialize VL dataset to write */ buf5[0].len = 1; @@ -3700,7 +3700,7 @@ static void write_dset_in(hid_t loc_id, /*------------------------------------------------------------------------- - * 2D + * 2D *------------------------------------------------------------------------- */ @@ -3739,7 +3739,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 *------------------------------------------------------------------------- @@ -3781,7 +3781,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); @@ -3821,9 +3821,9 @@ static void write_dset_in(hid_t loc_id, write_dset(loc_id,2,dims2,"float2D",H5T_NATIVE_FLOAT,buf82); - + /*------------------------------------------------------------------------- - * 3D + * 3D *------------------------------------------------------------------------- */ @@ -3881,7 +3881,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 *------------------------------------------------------------------------- @@ -3912,7 +3912,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++) { @@ -3926,7 +3926,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); @@ -3976,7 +3976,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 * @@ -3989,7 +3989,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; @@ -3999,7 +3999,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); @@ -4056,12 +4056,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 */ @@ -4069,7 +4069,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); @@ -4085,7 +4085,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 * @@ -4099,7 +4099,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 */ @@ -4107,7 +4107,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); @@ -4159,7 +4159,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 */ @@ -4373,10 +4373,10 @@ static void gent_null_space(void) hid_t fid, root, dataset, space, attr; int dset_buf = 10; int point = 4; - + fid = H5Fcreate(FILE45, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); root = H5Gopen (fid, "/"); - + /* null space */ space = H5Screate(H5S_NULL); @@ -4405,7 +4405,7 @@ static void gent_null_space(void) * *------------------------------------------------------------------------- */ -static +static int make_dset(hid_t loc_id, const char *name, hid_t sid, @@ -4454,7 +4454,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); @@ -4508,11 +4508,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); @@ -4715,7 +4715,7 @@ static void gent_filters(void) ret=make_dset(fid,"all",sid,H5T_NATIVE_INT,dcpl,buf1); assert(ret>=0); - + /*------------------------------------------------------------------------- * user defined filter *------------------------------------------------------------------------- @@ -4726,9 +4726,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); @@ -4748,7 +4748,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); @@ -4757,7 +4757,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); @@ -4766,7 +4766,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); @@ -4787,14 +4787,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); @@ -4811,7 +4811,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) { @@ -4833,7 +4833,7 @@ 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 */ #ifdef H5_WANT_H5_V1_6_COMPAT if(H5Pget_filter_by_id(dcpl_id,MYFILTER_ID,&flags,&cd_nelmts,cd_values,0,NULL)<0) @@ -4842,12 +4842,12 @@ set_local_myfilter(hid_t dcpl_id, hid_t UNUSED type_id, hid_t UNUSED space_id) #endif /* H5_WANT_H5_V1_6_COMPAT */ 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); } @@ -4972,7 +4972,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; @@ -4998,7 +4998,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); @@ -5041,7 +5041,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); @@ -5072,7 +5072,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; @@ -5085,7 +5085,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); @@ -5101,7 +5101,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); @@ -5130,7 +5130,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]; @@ -5147,7 +5147,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}; @@ -5281,7 +5281,7 @@ static void gent_aindices(void) buf5 = malloc(32 * 4097 * sizeof(double) ); for (i = 0; i < 32 * 4097; i++) buf5[i] = 1; - + /* create a file */ fid = H5Fcreate(FILE50, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); assert(fid>=0); @@ -5312,7 +5312,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 b24aa84..79c249b 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,7 +39,7 @@ 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); @@ -50,7 +50,7 @@ int main(int argc, char *argv[]) /* * validate the number of command line arguments */ - + if (argc < 2) { (void) fprintf(stderr, err1, argc); @@ -72,25 +72,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 */ @@ -163,7 +163,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; @@ -181,11 +181,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); @@ -212,38 +212,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); } @@ -254,7 +254,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"; @@ -262,8 +262,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) @@ -279,33 +279,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; @@ -314,15 +314,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); @@ -330,7 +330,7 @@ processDataFile(char *infile, struct Input *in, FILE **strm) return (0); } -static int +static int readIntegerData(FILE **strm, struct Input *in) { H5DT_INT8 *in08; @@ -346,7 +346,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]; @@ -357,38 +357,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 */ @@ -407,21 +407,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 */ @@ -439,13 +439,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); @@ -454,7 +454,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 */ @@ -464,7 +464,7 @@ readIntegerData(FILE **strm, struct Input *in) { (void) fprintf(stderr, err1); return (-1); - } + } *in64 = (H5DT_INT64) HDstrtoll(buffer, NULL, 10); } break; @@ -473,20 +473,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; @@ -494,13 +494,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 @@ -520,38 +520,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 */ @@ -569,21 +569,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 */ @@ -601,13 +601,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); @@ -616,7 +616,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 */ @@ -626,7 +626,7 @@ readUIntegerData(FILE **strm, struct Input *in) { (void) fprintf(stderr, err1); return (-1); - } + } *in64 = (H5DT_UINT64) HDstrtoll(buffer, NULL, 10); } break; @@ -635,20 +635,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; @@ -656,7 +656,7 @@ readUIntegerData(FILE **strm, struct Input *in) return(0); } -static int +static int readFloatData(FILE **strm, struct Input *in) { H5DT_FLOAT32 *fp32; @@ -675,7 +675,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 */ @@ -698,13 +698,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); @@ -712,7 +712,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 */ @@ -735,13 +735,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); @@ -755,7 +755,7 @@ readFloatData(FILE **strm, struct Input *in) return(0); } -static int +static int allocateIntegerStorage(struct Input *in) { hsize_t len=1; @@ -775,7 +775,7 @@ allocateIntegerStorage(struct Input *in) return (-1); } break; - + case 16: if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_INT16))) == NULL) { @@ -783,13 +783,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: @@ -797,9 +797,9 @@ allocateIntegerStorage(struct Input *in) { (void) fprintf(stderr, err1); return (-1); - } + } break; - + default: (void) fprintf(stderr, err2); break; @@ -826,7 +826,7 @@ static int allocateUIntegerStorage(struct Input *in) return (-1); } break; - + case 16: if ((in->data = (VOIDP) HDmalloc((size_t) len * sizeof(H5DT_UINT16))) == NULL) { @@ -834,13 +834,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: @@ -848,24 +848,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]; @@ -876,7 +876,7 @@ allocateFloatStorage(struct Input *in) { (void) fprintf(stderr, err1); return (-1); - } + } break; case 64: @@ -884,9 +884,9 @@ allocateFloatStorage(struct Input *in) { (void) fprintf(stderr, err1); return (-1); - } + } break; - + default: (void) fprintf(stderr, err2); break; @@ -894,52 +894,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 @@ -950,7 +950,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) @@ -964,17 +964,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; @@ -983,7 +983,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) @@ -994,7 +994,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; @@ -1015,7 +1015,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) { @@ -1025,11 +1025,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; @@ -1038,13 +1038,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; @@ -1053,18 +1053,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; @@ -1073,13 +1073,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; @@ -1088,14 +1088,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; @@ -1103,14 +1103,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; @@ -1118,14 +1118,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; @@ -1133,37 +1133,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) @@ -1175,20 +1175,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; @@ -1196,38 +1196,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; } } @@ -1235,20 +1235,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"; @@ -1259,25 +1259,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) @@ -1286,7 +1286,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) @@ -1302,7 +1302,7 @@ validateConfigurationParameters(struct Input * in) (void) fprintf(stderr, err4b); return (-1); } - + if (in->outputClass == 1) if(in->outputSize != 32 && in->outputSize != 64 ) @@ -1318,10 +1318,10 @@ validateConfigurationParameters(struct Input * in) return -1; } #endif - return (0); + return (0); } -static int +static int mapKeywordToIndex(char *key) { int i; @@ -1331,7 +1331,7 @@ mapKeywordToIndex(char *key) return -1; } -static int +static int parsePathInfo(struct path_info *path, char *temp) { const char delimiter[] = "/"; @@ -1351,7 +1351,7 @@ parsePathInfo(struct path_info *path, char *temp) return (0); } -static int +static int parseDimensions(struct Input *in, char *strm) { const char delimiter[] = ","; @@ -1371,7 +1371,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); @@ -1392,37 +1392,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++) @@ -1431,7 +1431,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; @@ -1439,7 +1439,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); @@ -1447,37 +1447,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", @@ -1492,7 +1492,7 @@ InputClassStrToInt(char *temp) } /* same as getOutputSize. But defined separately for extensibility */ -static int +static int getInputSize(struct Input *in, int ival) { int i; @@ -1500,40 +1500,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; @@ -1542,16 +1542,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); @@ -1560,7 +1560,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; @@ -1570,16 +1570,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); @@ -1595,7 +1595,7 @@ getChunkedDimensionSizes(struct Input *in, FILE **strm) return (0); } -static int +static int getMaximumDimensionSizes(struct Input *in, FILE **strm) { int ival; @@ -1605,13 +1605,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) @@ -1619,7 +1619,7 @@ getMaximumDimensionSizes(struct Input *in, FILE **strm) else in->maxsizeOfDimension[i++] = ival; } - + if (in->rank != i) { (void) fprintf(stderr, err2); @@ -1638,31 +1638,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; @@ -1681,31 +1681,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; @@ -1718,32 +1718,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 */ @@ -1758,17 +1758,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) { @@ -1782,7 +1782,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); @@ -1793,34 +1793,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; @@ -1836,15 +1836,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 */ @@ -1855,11 +1855,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: @@ -1877,9 +1877,9 @@ createOutputDataType(struct Input *in) case 1: H5Tset_order (new_type,H5T_ORDER_LE); break; - } + } break; - + case 1: /* STD */ switch(in->outputSize) { @@ -1894,7 +1894,7 @@ createOutputDataType(struct Input *in) case 1: new_type = H5Tcopy (H5T_STD_I8LE); break; - } + } break; case 16: @@ -1908,7 +1908,7 @@ createOutputDataType(struct Input *in) case 1: new_type = H5Tcopy (H5T_STD_I16LE); break; - } + } break; case 32: @@ -1922,7 +1922,7 @@ createOutputDataType(struct Input *in) case 1: new_type = H5Tcopy (H5T_STD_I32LE); break; - } + } break; case 64: @@ -1936,11 +1936,11 @@ createOutputDataType(struct Input *in) case 1: new_type = H5Tcopy (H5T_STD_I64LE); break; - } - break; + } + break; } break; - + } break; @@ -1951,7 +1951,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: @@ -1969,9 +1969,9 @@ createOutputDataType(struct Input *in) case 1: H5Tset_order (new_type,H5T_ORDER_LE); break; - } + } break; - + case 1: /* STD not supported for float */ break; @@ -1990,7 +1990,7 @@ createOutputDataType(struct Input *in) case 1: new_type = H5Tcopy (H5T_IEEE_F32LE); break; - } + } break; case 64: @@ -2004,11 +2004,11 @@ createOutputDataType(struct Input *in) case 1: new_type = H5Tcopy (H5T_IEEE_F64LE); break; - } - break; + } + break; } break; - + } break; @@ -2023,11 +2023,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: @@ -2045,9 +2045,9 @@ createOutputDataType(struct Input *in) case 1: H5Tset_order (new_type,H5T_ORDER_LE); break; - } + } break; - + case 1: switch(in->outputSize) { @@ -2062,7 +2062,7 @@ createOutputDataType(struct Input *in) case 1: new_type = H5Tcopy (H5T_STD_U8LE); break; - } + } break; case 16: @@ -2076,7 +2076,7 @@ createOutputDataType(struct Input *in) case 1: new_type = H5Tcopy (H5T_STD_U16LE); break; - } + } break; case 32: @@ -2090,7 +2090,7 @@ createOutputDataType(struct Input *in) case 1: new_type = H5Tcopy (H5T_STD_U32LE); break; - } + } break; case 64: @@ -2104,15 +2104,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; @@ -2124,7 +2124,7 @@ createOutputDataType(struct Input *in) return new_type; } -hid_t +hid_t createInputDataType(struct Input *in) { hid_t new_type = (-1); @@ -2141,11 +2141,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: @@ -2164,8 +2164,8 @@ createInputDataType(struct Input *in) break; case 64: - new_type = H5Tcopy (H5T_NATIVE_DOUBLE); - break; + new_type = H5Tcopy (H5T_NATIVE_DOUBLE); + break; } break; @@ -2181,11 +2181,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: @@ -2198,43 +2198,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); @@ -2246,14 +2246,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) { @@ -2265,15 +2265,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; @@ -2281,25 +2281,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 */ @@ -2308,13 +2308,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) { @@ -2324,38 +2324,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 0b4b37d..5e4d885 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 ada206b..a3a99ca 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); @@ -566,10 +566,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); @@ -595,9 +595,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 e68d6ac..e235cb5 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 75f4a64..851d01f 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 b2d377d..7957383 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); @@ -187,7 +187,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) @@ -217,7 +217,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 '"': @@ -543,9 +543,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); @@ -574,7 +574,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", @@ -613,9 +613,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); @@ -656,7 +656,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)", @@ -713,7 +713,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); @@ -768,7 +768,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); @@ -776,7 +776,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 @@ -867,7 +867,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 */ @@ -969,7 +969,7 @@ display_reference_type(hid_t type, int UNUSED ind) printf("%lu-byte unknown reference", (unsigned long)H5Tget_size(type)); } - + return TRUE; } @@ -995,7 +995,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); @@ -1028,7 +1028,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, ""); @@ -1086,7 +1086,7 @@ display_array_type(hid_t type, int ind) } else { fputs(" [SCALAR]", stdout); } - + /* Print parent type */ putchar(' '); @@ -1095,7 +1095,7 @@ display_array_type(hid_t type, int ind) H5Tclose(super); return TRUE; } - + /*------------------------------------------------------------------------- * Function: display_bitfield_type * @@ -1167,7 +1167,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:"H5_PRINTF_HADDR_FMT"-"; info.dset_hidefileno = 0; - + info.obj_format = "-%lu:"H5_PRINTF_HADDR_FMT; 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"); @@ -1386,7 +1386,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)"; @@ -1394,7 +1394,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) && @@ -1424,16 +1424,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; } @@ -1529,7 +1529,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); @@ -1563,7 +1563,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) { @@ -1805,7 +1805,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 && @@ -1814,13 +1814,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) { @@ -1848,8 +1848,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); @@ -2010,7 +2010,7 @@ static void leave(int ret) { h5tools_close(); - + exit(ret); } @@ -2085,7 +2085,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 315079d..fb99718 100644 --- a/tools/h5repack/h5repack.h +++ b/tools/h5repack/h5repack.h @@ -38,17 +38,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 @@ -57,15 +57,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; @@ -141,29 +141,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 */ @@ -235,13 +235,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); @@ -283,23 +283,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 */); @@ -312,15 +312,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 05ea7fa..5b0520d 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,7 +47,7 @@ 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; @@ -308,15 +308,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; @@ -324,12 +324,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; @@ -340,7 +340,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) { @@ -348,8 +348,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 *------------------------------------------------------------------------- @@ -365,10 +365,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 *------------------------------------------------------------------------- @@ -382,7 +382,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 *------------------------------------------------------------------------- @@ -391,7 +391,7 @@ int do_copy_objects(hid_t fidin, goto error; }/*nelmts*/ - + /*------------------------------------------------------------------------- * create; * disable error checking in case the dataset cannot be created with the @@ -405,9 +405,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); } @@ -425,16 +425,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*/ @@ -443,19 +443,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; /*------------------------------------------------------------------------- @@ -464,25 +464,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) @@ -500,12 +500,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; @@ -513,11 +513,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 ); @@ -530,31 +530,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); @@ -578,7 +578,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); @@ -592,15 +592,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 */ @@ -611,44 +611,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 *------------------------------------------------------------------------- @@ -715,7 +715,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 28771a9..0b5ff2b 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,31 +206,31 @@ 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 ) { @@ -239,9 +239,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 @@ -250,7 +250,7 @@ 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; } @@ -262,9 +262,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) @@ -278,23 +278,23 @@ 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_NBIT 5 , nbit compression - * H5Z_FILTER_SCALEOFFSET 6 , scaleoffset compression + * H5Z_FILTER_SZIP 4 , szip compression + * H5Z_FILTER_NBIT 5 , nbit compression + * H5Z_FILTER_SCALEOFFSET 6 , scaleoffset compression *------------------------------------------------------------------------- */ - + if (obj.nfilters) { - + /*------------------------------------------------------------------------- * filters require CHUNK layout; if we do not have one define a default *------------------------------------------------------------------------- @@ -302,19 +302,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); @@ -440,7 +440,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 */ @@ -453,31 +453,31 @@ 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 1fd61ca..7e82fde 100644 --- a/tools/h5repack/h5repack_parse.c +++ b/tools/h5repack/h5repack_parse.c @@ -36,9 +36,9 @@ * FLET, to apply the HDF5 checksum filter * NBIT, to apply the HDF5 NBIT filter (NBIT compression) * S+O, to apply the HDF5 scale+offset filter (compression) - * NONE, to remove the filter + * NONE, to remove the filter * - * Examples: + * Examples: * "GZIP=6" * "A,B:NONE" * @@ -50,8 +50,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) { @@ -59,10 +59,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; @@ -91,7 +91,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) @@ -106,7 +106,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); @@ -130,7 +130,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 */ @@ -139,11 +139,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; @@ -177,17 +177,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 */ } @@ -313,7 +313,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); @@ -321,8 +321,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) { @@ -385,7 +385,7 @@ const char* get_sfilter(H5Z_filter_t filtn) exit(1); } return NULL; -} +} /*------------------------------------------------------------------------- @@ -393,14 +393,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 @@ -409,8 +409,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) { @@ -419,7 +419,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]; @@ -427,7 +427,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) @@ -460,7 +460,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); @@ -481,11 +481,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) @@ -501,7 +501,7 @@ obj_list_t* parse_layout(const char *str, slayout[n]=c; } } /* j */ - + if ( pack->layout==H5D_CHUNKED ) { @@ -510,7 +510,7 @@ obj_list_t* parse_layout(const char *str, * get chunk info *------------------------------------------------------------------------- */ - k=0; + k=0; if (j>(int)len) { @@ -524,8 +524,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); @@ -533,11 +533,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) { @@ -549,7 +549,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) { @@ -570,10 +570,10 @@ obj_list_t* parse_layout(const char *str, } /*if c=='x' || i==len-1 */ } /*i*/ - + } /*H5D_CHUNKED*/ - + return obj_list; } @@ -600,7 +600,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_t 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_t 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_t obj_type, hid_t obj_id) default: break; } - } H5E_END_TRY; + } H5E_END_TRY; } /*------------------------------------------------------------------------- @@ -747,7 +747,7 @@ static void close_obj(H5G_obj_t 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 983371e..6653233 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,37 +44,37 @@ 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; } @@ -168,9 +168,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; @@ -178,7 +178,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]; @@ -187,13 +187,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 *------------------------------------------------------------------------- @@ -215,11 +215,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; } @@ -232,10 +232,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; @@ -247,16 +247,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; /*------------------------------------------------------------------------- @@ -280,35 +280,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; @@ -345,12 +345,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; @@ -362,7 +362,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 ) { @@ -411,25 +411,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; } @@ -437,15 +437,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*/ @@ -476,7 +476,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; i0) && g_Parallel) { - printf("%s", outBuff); + printf("%s", outBuff); if(overflow_file) { @@ -121,7 +121,7 @@ static void print_incoming_data(void) MPI_Status Status; do - { + { MPI_Iprobe(MPI_ANY_SOURCE, MPI_TAG_PRINT_DATA, MPI_COMM_WORLD, &incomingMessage, &Status); if(incomingMessage) { @@ -160,11 +160,11 @@ h5diff (const char *fname1, 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); char filenames[2][1024]; hsize_t nfound = 0; int not_cmp = 0; - + memset(filenames, 0, 1024*2); @@ -276,10 +276,10 @@ h5diff (const char *fname1, * object name was supplied *------------------------------------------------------------------------- */ - + if (objname1) { - + #ifdef H5_HAVE_PARALLEL if(g_Parallel) { @@ -348,8 +348,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 @@ -357,7 +357,7 @@ out: * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * * Date: May 9, 2003 - * + * * Modifications: Jan 2005 Leon Arber, larber@uiuc.edu * Added support for parallel diffing * @@ -481,7 +481,7 @@ diff_match (hid_t file1_id, struct diff_args args; int havePrintToken = 1; MPI_Status Status; - + /*set all tasks as free */ memset(workerTasks, 1, g_nTasks-1); #endif @@ -512,13 +512,13 @@ diff_match (hid_t file1_id, * may not work in non-homogeneous MPI environments. */ - /*Set up args to pass to worker task. */ + /*Set up args to pass to worker task. */ if(strlen(table->objs[i].name) > 255) { printf("The parallel diff only supports object names up to 255 characters\n"); MPI_Abort(MPI_COMM_WORLD, 0); } - + strcpy(args.name, table->objs[i].name); args.options = *options; args.type= table->objs[i].type; @@ -571,11 +571,11 @@ diff_match (hid_t file1_id, } /* Print all the data in our incoming queue */ - print_incoming_data(); + print_incoming_data(); } /* check array of tasks to see which ones are free. - * Manager task never does work, so freeTasks[0] is really + * Manager task never does work, so freeTasks[0] is really * worker task 0. */ for(n=1; (nm_verbose) { if (print_objname (options, (hsize_t)1)) - parallel_print("Dataset: <%s> and <%s>\n", path1, path2); + parallel_print("Dataset: <%s> and <%s>\n", path1, path2); nfound = diff_dataset (file1_id, file2_id, path1, path2, options); /* always print the number of differences found */ - print_found(nfound); + print_found(nfound); } /*------------------------------------------------------------------------- * non verbose, check first if we have differences @@ -887,9 +887,9 @@ diff (hid_t file1_id, if (print_objname (options, nfound)) parallel_print("Dataset: <%s> and <%s>\n", path1, path2); nfound = diff_dataset (file1_id, file2_id, path1, path2, options); - /* print the number of differences found only when found + /* print the number of differences found only when found this is valid for the default mode and report mode */ - print_found(nfound); + print_found(nfound); } /*if nfound */ } /*if quiet */ @@ -902,7 +902,7 @@ diff (hid_t file1_id, nfound = diff_dataset (file1_id, file2_id, path1, path2, options); } } /*else verbose */ - + break; /*------------------------------------------------------------------------- @@ -934,7 +934,7 @@ diff (hid_t file1_id, *------------------------------------------------------------------------- */ if (path1) - diff_attr (type1_id, type2_id, path1, path2, options); + diff_attr (type1_id, type2_id, path1, path2, options); if (H5Tclose (type1_id) < 0) goto out; @@ -1029,7 +1029,7 @@ diff (hid_t file1_id, parallel_print("Comparison not supported: <%s> and <%s> are of type %s\n", path1, path2, get_type (type)); options->not_cmp=1; - } + } break; } diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h index a307cb8..9f0a0dc 100644 --- a/tools/lib/h5diff.h +++ b/tools/lib/h5diff.h @@ -77,10 +77,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); #ifdef H5_HAVE_PARALLEL @@ -100,75 +100,75 @@ void print_manager_output(void); */ -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_t 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 ); @@ -186,13 +186,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); @@ -207,172 +207,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 3632cdb..dd4784d 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -15,7 +15,7 @@ #include #include "h5diff.h" #include "ph5diff.h" -#include "H5private.h" +#include "H5private.h" /* local functions */ static void close_obj(H5G_obj_t obj_type, hid_t obj_id); @@ -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, @@ -109,16 +109,16 @@ hsize_t diff_array( void *_mem1, { - 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; @@ -126,23 +126,23 @@ hsize_t diff_array( void *_mem1, 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; @@ -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; @@ -266,20 +266,20 @@ hsize_t diff_datum(void *_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_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); @@ -322,11 +322,11 @@ hsize_t diff_datum(void *_mem1, */ case H5T_STRING: { - + H5T_str_t pad; char *s; - - if(H5Tis_variable_str(m_type)) + + if(H5Tis_variable_str(m_type)) { /* mem1 is the pointer into the struct where a `char*' is stored. So we have * to dereference the pointer to get the `char*' to pass to HDstrlen(). */ @@ -334,14 +334,14 @@ hsize_t diff_datum(void *_mem1, if(s!=NULL) size = HDstrlen(s); } - else + else { s = mem1; size = H5Tget_size(m_type); } - + pad = H5Tget_strpad(m_type); - + /* check for NULL pointer for string */ if(s!=NULL) for (u=0; ulen; - 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 */ @@ -542,7 +542,7 @@ hsize_t diff_datum(void *_mem1, *------------------------------------------------------------------------- */ - if (H5Tequal(m_type, H5T_STD_REF_DSETREG)) + if (H5Tequal(m_type, H5T_STD_REF_DSETREG)) { hid_t region1_id; hid_t region2_id; @@ -583,7 +583,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) @@ -622,7 +622,7 @@ hsize_t diff_datum(void *_mem1, options); break; default: - parallel_print("Warning: Comparison not possible of object types referenced: <%s> and <%s>", + parallel_print("Warning: Comparison not possible of object types referenced: <%s> and <%s>", obj1, obj2); options->not_cmp=1; break; @@ -646,7 +646,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; @@ -658,7 +658,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); parallel_print(SPACES); @@ -672,7 +672,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); parallel_print(SPACES); @@ -684,10 +684,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); parallel_print(SPACES); @@ -698,7 +698,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); parallel_print(SPACES); @@ -713,7 +713,7 @@ hsize_t diff_datum(void *_mem1, * 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; @@ -726,7 +726,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); parallel_print(SPACES); @@ -740,7 +740,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); parallel_print(SPACES); @@ -752,10 +752,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); parallel_print(SPACES); @@ -766,7 +766,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); parallel_print(SPACES); @@ -797,7 +797,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); parallel_print(SPACES); @@ -811,7 +811,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); parallel_print(SPACES); @@ -823,10 +823,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); parallel_print(SPACES); @@ -838,7 +838,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); @@ -870,7 +870,7 @@ 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); parallel_print(SPACES); @@ -885,7 +885,7 @@ 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); @@ -898,11 +898,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); @@ -915,7 +915,7 @@ 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); parallel_print(SPACES); @@ -933,7 +933,7 @@ hsize_t diff_datum(void *_mem1, *------------------------------------------------------------------------- */ - else if (H5Tequal(m_type, H5T_NATIVE_INT)) + else if (H5Tequal(m_type, H5T_NATIVE_INT)) { int temp1_int; int temp2_int; @@ -947,7 +947,7 @@ 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); parallel_print(SPACES); @@ -961,11 +961,11 @@ 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); - + parallel_print(SPACES); parallel_print(IPFORMAT,temp1_int,temp2_int,abs(temp1_int-temp2_int), abs(1-temp2_int/temp1_int)); } @@ -975,14 +975,14 @@ 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); - + parallel_print(SPACES); parallel_print(IPFORMAT,temp1_int,temp2_int,abs(temp1_int-temp2_int), abs(1-temp2_int/temp1_int)); } @@ -991,8 +991,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); parallel_print(SPACES); @@ -1000,8 +1000,8 @@ hsize_t diff_datum(void *_mem1, } nfound++; } - - + + } /*H5T_NATIVE_INT*/ @@ -1009,13 +1009,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 */ @@ -1023,8 +1023,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); parallel_print(SPACES); @@ -1038,11 +1038,11 @@ 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); - + parallel_print(SPACES); parallel_print(IPFORMAT,temp1_uint,temp2_uint,abs((int)(temp1_uint-temp2_uint)), abs((int)(1-temp2_uint/temp1_uint))); } @@ -1052,14 +1052,14 @@ 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); - + parallel_print(SPACES); parallel_print(IPFORMAT,temp1_uint,temp2_uint,abs((int)(temp1_uint-temp2_uint)), abs((int)(1-temp2_uint/temp1_uint))); } @@ -1069,7 +1069,7 @@ 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); @@ -1088,13 +1088,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 */ @@ -1102,8 +1102,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); parallel_print(SPACES); @@ -1117,8 +1117,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); parallel_print(SPACES); @@ -1130,11 +1130,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); parallel_print(SPACES); @@ -1146,7 +1146,7 @@ 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); parallel_print(SPACES); @@ -1155,21 +1155,21 @@ 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 */ @@ -1177,8 +1177,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); parallel_print(SPACES); @@ -1192,8 +1192,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); parallel_print(SPACES); @@ -1205,11 +1205,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); parallel_print(SPACES); @@ -1221,7 +1221,7 @@ 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); parallel_print(SPACES); @@ -1229,21 +1229,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 */ @@ -1251,8 +1251,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); parallel_print(SPACES); @@ -1266,8 +1266,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); parallel_print(SPACES); @@ -1279,11 +1279,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); parallel_print(SPACES); @@ -1295,7 +1295,7 @@ 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); @@ -1304,21 +1304,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 */ @@ -1326,8 +1326,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); parallel_print(SPACES); @@ -1341,8 +1341,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); parallel_print(SPACES); @@ -1354,14 +1354,14 @@ 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); - + parallel_print(SPACES); parallel_print(fmt_ullongp,temp1_ullong,temp2_ullong, (unsigned long_long)labs((long)(temp1_ullong-temp2_ullong)), (unsigned long_long)labs((long)(1-temp2_ullong/temp1_ullong))); } @@ -1370,8 +1370,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); parallel_print(SPACES); @@ -1379,10 +1379,10 @@ hsize_t diff_datum(void *_mem1, } nfound++; } - + } /*H5T_NATIVE_ULLONG*/ - + break; /* H5T_INTEGER class */ case H5T_FLOAT: @@ -1391,7 +1391,7 @@ hsize_t diff_datum(void *_mem1, *------------------------------------------------------------------------- */ - if (H5Tequal(m_type, H5T_NATIVE_FLOAT)) + if (H5Tequal(m_type, H5T_NATIVE_FLOAT)) { float temp1_float; float temp2_float; @@ -1407,7 +1407,7 @@ 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); parallel_print(SPACES); @@ -1422,7 +1422,7 @@ 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); parallel_print(SPACES); @@ -1431,15 +1431,15 @@ hsize_t diff_datum(void *_mem1, nfound++; } } - + /* -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); @@ -1452,7 +1452,7 @@ 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); @@ -1469,7 +1469,7 @@ 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; @@ -1483,7 +1483,7 @@ 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); parallel_print(SPACES); @@ -1498,7 +1498,7 @@ 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); parallel_print(SPACES); @@ -1510,11 +1510,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); @@ -1527,13 +1527,13 @@ 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); parallel_print(SPACES); parallel_print(FFORMAT,temp1_double,temp2_double,fabs(temp1_double-temp2_double)); - + } nfound++; } @@ -1567,12 +1567,12 @@ 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) { @@ -1588,7 +1588,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); parallel_print(SPACES); @@ -1602,7 +1602,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); parallel_print(SPACES); @@ -1614,10 +1614,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); parallel_print(SPACES); @@ -1628,7 +1628,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); parallel_print(SPACES); @@ -1638,7 +1638,7 @@ hsize_t diff_native_uchar(unsigned char *mem1, } return nfound; -} +} /*------------------------------------------------------------------------- @@ -1657,12 +1657,12 @@ 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) { @@ -1675,7 +1675,7 @@ hsize_t diff_char(unsigned char *mem1, if (temp1_uchar != temp2_uchar) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -1685,7 +1685,7 @@ hsize_t diff_char(unsigned char *mem1, } return nfound; -} +} @@ -1703,11 +1703,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; } @@ -1719,10 +1719,10 @@ is_zero(const void *_mem, size_t size) *------------------------------------------------------------------------- */ -static +static void close_obj(H5G_obj_t obj_type, hid_t obj_id) { - + switch (obj_type) { case H5G_GROUP: H5Gclose(obj_id); @@ -1764,7 +1764,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 @@ -1780,9 +1780,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]); @@ -1799,30 +1799,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++) parallel_print("%s%lu", j ? "," : "(", (unsigned long)ptdata1[i * 2 * ndims1 + j]); - + for (j = 0; j < ndims1; j++) parallel_print("%s%lu", j ? "," : ")-(", (unsigned long)ptdata1[i * 2 * ndims1 + j + ndims1]); - + parallel_print(")\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*/ @@ -1834,30 +1834,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; - + parallel_print("%sPt%lu: " , i ? "," : "", (unsigned long)i); - + for (j = 0; j < ndims1; j++) parallel_print("%s%lu", j ? "," : "(", (unsigned long)(ptdata1[i * ndims1 + j])); - + parallel_print(")"); } -#endif - +#endif + HDfree(ptdata1); HDfree(ptdata2); } - + return ret; } @@ -1875,11 +1875,11 @@ 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) @@ -1901,7 +1901,7 @@ hsize_t diff_float(unsigned char *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); parallel_print(SPACES); @@ -1927,7 +1927,7 @@ hsize_t diff_float(unsigned char *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); parallel_print(SPACES); @@ -1941,7 +1941,7 @@ hsize_t diff_float(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - } + } /* -d and -p */ else if ( options->d && options->p) @@ -1952,10 +1952,10 @@ hsize_t diff_float(unsigned char *mem1, 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); parallel_print(SPACES); @@ -1969,8 +1969,8 @@ hsize_t diff_float(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - } - else + } + else { for ( i = 0; i < nelmts; i++) @@ -1980,7 +1980,7 @@ hsize_t diff_float(unsigned char *mem1, if (temp1_float != temp2_float) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -2014,11 +2014,11 @@ 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) @@ -2041,7 +2041,7 @@ hsize_t diff_double(unsigned char *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); parallel_print(SPACES); @@ -2067,7 +2067,7 @@ hsize_t diff_double(unsigned char *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); parallel_print(SPACES); @@ -2081,7 +2081,7 @@ hsize_t diff_double(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - } + } /* -d and -p */ else if ( options->d && options->p) @@ -2092,10 +2092,10 @@ hsize_t diff_double(unsigned char *mem1, 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); parallel_print(SPACES); @@ -2109,8 +2109,8 @@ hsize_t diff_double(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - } - else + } + else { for ( i = 0; i < nelmts; i++) @@ -2120,7 +2120,7 @@ hsize_t diff_double(unsigned char *mem1, if (temp1_double != temp2_double) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -2155,33 +2155,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); parallel_print(SPACES); @@ -2195,19 +2195,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); parallel_print(SPACES); @@ -2221,21 +2221,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); parallel_print(SPACES); @@ -2249,19 +2249,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); parallel_print(SPACES); @@ -2269,15 +2269,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; } @@ -2295,33 +2295,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); parallel_print(SPACES); @@ -2334,21 +2334,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); parallel_print(SPACES); @@ -2362,21 +2362,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); parallel_print(SPACES); @@ -2390,19 +2390,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); parallel_print(SPACES); @@ -2410,15 +2410,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; } @@ -2437,33 +2437,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); parallel_print(SPACES); @@ -2476,21 +2476,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); parallel_print(SPACES); @@ -2504,23 +2504,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); parallel_print(SPACES); @@ -2534,19 +2534,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); parallel_print(SPACES); @@ -2554,15 +2554,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; } @@ -2579,33 +2579,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); parallel_print(SPACES); @@ -2618,21 +2618,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); parallel_print(SPACES); @@ -2646,23 +2646,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); parallel_print(SPACES); @@ -2676,19 +2676,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); parallel_print(SPACES); @@ -2696,15 +2696,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; } @@ -2722,14 +2722,14 @@ 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; @@ -2748,7 +2748,7 @@ hsize_t diff_int(unsigned char *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); parallel_print(SPACES); @@ -2775,7 +2775,7 @@ hsize_t diff_int(unsigned char *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); parallel_print(SPACES); @@ -2791,7 +2791,7 @@ hsize_t diff_int(unsigned char *mem1, } - } + } /* -d and -p */ else if ( options->d && options->p) @@ -2802,10 +2802,10 @@ hsize_t diff_int(unsigned char *mem1, 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); parallel_print(SPACES); @@ -2820,8 +2820,8 @@ hsize_t diff_int(unsigned char *mem1, return nfound; } - } - else + } + else { for ( i = 0; i < nelmts; i++) @@ -2831,7 +2831,7 @@ hsize_t diff_int(unsigned char *mem1, if (temp1_int != temp2_int) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -2865,14 +2865,14 @@ 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; @@ -2891,7 +2891,7 @@ hsize_t diff_uint(unsigned char *mem1, 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); parallel_print(SPACES); @@ -2918,7 +2918,7 @@ hsize_t diff_uint(unsigned char *mem1, 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); parallel_print(SPACES); @@ -2934,7 +2934,7 @@ hsize_t diff_uint(unsigned char *mem1, } - } + } /* -d and -p */ else if ( options->d && options->p) @@ -2945,10 +2945,10 @@ hsize_t diff_uint(unsigned char *mem1, 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); parallel_print(SPACES); @@ -2963,8 +2963,8 @@ hsize_t diff_uint(unsigned char *mem1, return nfound; } - } - else + } + else { for ( i = 0; i < nelmts; i++) @@ -2974,7 +2974,7 @@ hsize_t diff_uint(unsigned char *mem1, if (temp1_uint != temp2_uint) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -3008,14 +3008,14 @@ 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; @@ -3034,7 +3034,7 @@ hsize_t diff_long(unsigned char *mem1, if (labs(temp1_long-temp2_long) > options->delta) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -3061,14 +3061,14 @@ hsize_t diff_long(unsigned char *mem1, if ( temp1_long!=0 && labs(1-temp2_long/temp1_long) > options->percent ) { - if ( print_data(options) ) + if ( print_data(options) ) { 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); parallel_print(SPACES); @@ -3090,7 +3090,7 @@ hsize_t diff_long(unsigned char *mem1, } - } + } /* -d and -p */ else if ( options->d && options->p) @@ -3101,10 +3101,10 @@ hsize_t diff_long(unsigned char *mem1, 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) > options->delta ) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,1,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -3119,8 +3119,8 @@ hsize_t diff_long(unsigned char *mem1, return nfound; } - } - else + } + else { for ( i = 0; i < nelmts; i++) @@ -3130,15 +3130,15 @@ hsize_t diff_long(unsigned char *mem1, if (temp1_long != temp2_long) { - if ( print_data(options) ) + if ( print_data(options) ) { 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); parallel_print(SPACES); @@ -3180,14 +3180,14 @@ 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; @@ -3201,15 +3201,15 @@ hsize_t diff_ulong(unsigned char *mem1, for ( i = 0; i < nelmts; i++) { - + 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); parallel_print(SPACES); @@ -3222,7 +3222,7 @@ hsize_t diff_ulong(unsigned char *mem1, if (options->n && nfound>=options->count) return nfound; } - + } } @@ -3238,7 +3238,7 @@ hsize_t diff_ulong(unsigned char *mem1, 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); parallel_print(SPACES); @@ -3254,7 +3254,7 @@ hsize_t diff_ulong(unsigned char *mem1, } - } + } /* -d and -p */ else if ( options->d && options->p) @@ -3265,10 +3265,10 @@ hsize_t diff_ulong(unsigned char *mem1, 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); parallel_print(SPACES); @@ -3283,8 +3283,8 @@ hsize_t diff_ulong(unsigned char *mem1, return nfound; } - } - else + } + else { for ( i = 0; i < nelmts; i++) @@ -3294,7 +3294,7 @@ hsize_t diff_ulong(unsigned char *mem1, if (temp1_ulong != temp2_ulong) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -3328,14 +3328,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; @@ -3346,9 +3346,9 @@ 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); } @@ -3364,7 +3364,7 @@ hsize_t diff_llong(unsigned char *mem1, 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); parallel_print(SPACES); @@ -3391,7 +3391,7 @@ hsize_t diff_llong(unsigned char *mem1, 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); parallel_print(SPACES); @@ -3407,7 +3407,7 @@ hsize_t diff_llong(unsigned char *mem1, } - } + } /* -d and -p */ else if ( options->d && options->p) @@ -3418,10 +3418,10 @@ hsize_t diff_llong(unsigned char *mem1, 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); parallel_print(SPACES); @@ -3436,8 +3436,8 @@ hsize_t diff_llong(unsigned char *mem1, return nfound; } - } - else + } + else { for ( i = 0; i < nelmts; i++) @@ -3447,7 +3447,7 @@ hsize_t diff_llong(unsigned char *mem1, if (temp1_llong != temp2_llong) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); @@ -3481,11 +3481,11 @@ 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) @@ -3499,9 +3499,9 @@ 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); } @@ -3517,7 +3517,7 @@ hsize_t diff_ullong(unsigned char *mem1, 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); parallel_print(SPACES); @@ -3544,7 +3544,7 @@ hsize_t diff_ullong(unsigned char *mem1, 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); parallel_print(SPACES); @@ -3560,7 +3560,7 @@ hsize_t diff_ullong(unsigned char *mem1, } - } + } /* -d and -p */ else if ( options->d && options->p) @@ -3571,10 +3571,10 @@ hsize_t diff_ullong(unsigned char *mem1, 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); parallel_print(SPACES); @@ -3589,8 +3589,8 @@ hsize_t diff_ullong(unsigned char *mem1, return nfound; } - } - else + } + else { for ( i = 0; i < nelmts; i++) @@ -3600,7 +3600,7 @@ hsize_t diff_ullong(unsigned char *mem1, if (temp1_ullong != temp2_ullong) { - if ( print_data(options) ) + if ( print_data(options) ) { print_pos(ph,0,i,acc,pos,rank,obj1,obj2); parallel_print(SPACES); diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index 56e2af1..aa52d8b 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,9 +68,9 @@ 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) @@ -80,28 +80,28 @@ int diff_attr(hid_t loc1_id, { /* 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) { parallel_print("Different name for attributes: <%s> and <%s>\n", name1, name2); } @@ -135,26 +135,26 @@ 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; options->not_cmp=1; } /*------------------------------------------------------------------------- - * only attempt to compare if possible + * only attempt to compare if possible *------------------------------------------------------------------------- */ - if (cmp) + if (cmp) { /*------------------------------------------------------------------------- @@ -162,7 +162,7 @@ int diff_attr(hid_t loc1_id, *------------------------------------------------------------------------- */ nelmts1=1; - for (j=0; jm_verbose) { - parallel_print( "Attribute: <%s> and <%s>\n",name1,name2); - nfound = diff_array(buf1, + parallel_print( "Attribute: <%s> and <%s>\n",name1,name2); + nfound = diff_array(buf1, buf2, nelmts1, rank1, @@ -222,7 +222,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, @@ -235,10 +235,10 @@ int diff_attr(hid_t loc1_id, attr2_id); /* print again */ options->m_quiet=0; - if (nfound) + if (nfound) { - parallel_print( "Attribute: <%s> and <%s>\n",name1,name2); - nfound = diff_array(buf1, + parallel_print( "Attribute: <%s> and <%s>\n",name1,name2); + nfound = diff_array(buf1, buf2, nelmts1, rank1, @@ -255,7 +255,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, diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index c4b4a4b..5f28c2b 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -14,13 +14,13 @@ #include "h5diff.h" #include "ph5diff.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 @@ -31,10 +31,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; @@ -64,20 +64,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, @@ -97,7 +97,7 @@ hsize_t diff_dataset( hid_t file1_id, H5Dclose(dset2_id); /* enable error reporting */ } H5E_END_TRY; - + return nfound; error: @@ -110,7 +110,7 @@ error: H5Dclose(dset2_id); /* enable error reporting */ } H5E_END_TRY; - + return nfound; } @@ -121,7 +121,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 @@ -132,19 +132,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]; @@ -184,7 +184,7 @@ hsize_t diff_datasetid( hid_t dset1_id, goto error; /*------------------------------------------------------------------------- - * Get the file data type + * Get the file data type *------------------------------------------------------------------------- */ @@ -206,7 +206,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) parallel_print("<%s> and <%s> are empty datasets\n", obj1_name, obj2_name); cmp=0; options->not_cmp=1; @@ -218,16 +218,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; @@ -238,13 +238,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]; } @@ -258,7 +258,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); @@ -285,7 +285,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 @@ -306,7 +306,7 @@ hsize_t diff_datasetid( hid_t dset1_id, } /*------------------------------------------------------------------------- - * "upgrade" the smaller memory size + * "upgrade" the smaller memory size *------------------------------------------------------------------------- */ @@ -334,15 +334,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)); @@ -375,7 +375,7 @@ hsize_t diff_datasetid( hid_t dset1_id, if (obj2_name) { name2=diff_basename(obj2_name); } - nfound = diff_array(buf1, + nfound = diff_array(buf1, buf2, nelmts1, rank1, @@ -401,8 +401,8 @@ hsize_t diff_datasetid( hid_t dset1_id, * close *------------------------------------------------------------------------- */ - - + + if ( buf1) HDfree(buf1); if ( buf2) HDfree(buf2); /* close */ @@ -416,7 +416,7 @@ hsize_t diff_datasetid( hid_t dset1_id, H5Tclose(m_type2); /* enable error reporting */ } H5E_END_TRY; - + return nfound; error: @@ -434,7 +434,7 @@ error: H5Tclose(m_type2); /* enable error reporting */ } H5E_END_TRY; - + return nfound; } @@ -443,7 +443,7 @@ error: * * Purpose: check for comparable TYPE and SPACE * - * Return: + * Return: * 1, can compare * 0, cannot compare * -1, error @@ -455,20 +455,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 */ @@ -476,21 +476,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; @@ -502,7 +502,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: @@ -514,12 +514,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; } @@ -529,7 +529,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); @@ -544,7 +544,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) { @@ -565,9 +565,9 @@ int diff_can_type( hid_t f_type1, /* file data type */ * check for different dimensions *------------------------------------------------------------------------- */ - + assert(rank1==rank2); - for ( i=0; i= (OUTBUFF_SIZE-outBuffOffset)) #else if((bytes_written+1) == (OUTBUFF_SIZE-outBuffOffset)) -#endif +#endif { /* Terminate the outbuff at the end of the previous output */ outBuff[outBuffOffset] = '\0'; - - overflow_file = HDtmpfile(); + + overflow_file = HDtmpfile(); if(overflow_file == NULL) fprintf(stderr, "Warning: Could not create overflow file. Output may be truncated.\n"); else @@ -72,7 +72,7 @@ void parallel_print(const char* format, ...) outBuffOffset += bytes_written; } else - bytes_written = HDvfprintf(overflow_file, format, ap); + bytes_written = HDvfprintf(overflow_file, format, ap); } va_end(ap); @@ -91,13 +91,13 @@ void parallel_print(const char* format, ...) * *------------------------------------------------------------------------- */ -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 i; @@ -108,19 +108,19 @@ void print_pos( int *ph, *ph=0; if (per) { - parallel_print("%-15s %-15s %-15s %-15s %-15s\n", - "position", - (obj1!=NULL) ? obj1 : " ", + parallel_print("%-15s %-15s %-15s %-15s %-15s\n", + "position", + (obj1!=NULL) ? obj1 : " ", (obj2!=NULL) ? obj2 : " ", - "difference", + "difference", "relative"); parallel_print("------------------------------------------------------------------------\n"); } else { - parallel_print("%-15s %-15s %-15s %-20s\n", - "position", - (obj1!=NULL) ? obj1 : " ", + parallel_print("%-15s %-15s %-15s %-20s\n", + "position", + (obj1!=NULL) ? obj1 : " ", (obj2!=NULL) ? obj2 : " ", "difference"); parallel_print("------------------------------------------------------------\n"); @@ -134,7 +134,7 @@ void print_pos( int *ph, } assert( curr_pos == 0 ); - parallel_print("[ " ); + parallel_print("[ " ); for ( i = 0; i < rank; i++) { /* HDfprintf(stdout,"%Hu ", pos[i] ); */ @@ -157,8 +157,8 @@ void print_pos( int *ph, void print_dims( int r, hsize_t *d ) { int i; - parallel_print("[ " ); - for ( i=0; i0 && '/'==name[i-1]) --i; - + /* Skip backward over base name */ while (i>0 && '/'!=name[i-1]) --i; - + return(name+i); } @@ -326,7 +326,7 @@ get_type(int type) return("H5G_LINK"); default: return("user defined type"); - } + } } /*------------------------------------------------------------------------- @@ -338,7 +338,7 @@ get_type(int type) * * Date: May 9, 2003 * - * Comments: + * Comments: * *------------------------------------------------------------------------- */ @@ -353,7 +353,7 @@ get_sign(H5T_sign_t sign) return("H5T_SGN_NONE"); case H5T_SGN_2: return("H5T_SGN_2"); - } + } } @@ -371,7 +371,7 @@ get_sign(H5T_sign_t sign) const char* get_class(H5T_class_t tclass) { - switch (tclass) + switch (tclass) { default: return("Invalid class"); @@ -426,7 +426,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 ddf476d..b9dd89a 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)); @@ -586,7 +586,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. @@ -627,7 +627,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 @@ -670,7 +670,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); @@ -695,7 +695,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, @@ -758,10 +758,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); @@ -862,7 +862,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) @@ -886,7 +886,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 */ @@ -932,7 +932,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); @@ -959,7 +959,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); @@ -1035,7 +1035,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; @@ -1079,7 +1079,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; @@ -1088,7 +1088,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) { @@ -1111,7 +1111,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; } @@ -1230,7 +1230,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; @@ -1268,7 +1268,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 ada098b..c5ca4fa 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. */ @@ -419,7 +419,7 @@ typedef struct h5tools_context_t { hsize_t sm_pos; /* current stripmine element position */ } h5tools_context_t; - + /* a structure to hold the subsetting particulars for a dataset */ struct subset_t { diff --git a/tools/lib/h5tools_filters.c b/tools/lib/h5tools_filters.c index 355ac14..099f132 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; int have_nbit=0; int have_scaleoffset=0; @@ -76,27 +76,27 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr /* 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)); @@ -910,7 +910,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 6684adb..e6211da 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, haddr_t objno) { int i; @@ -394,13 +394,13 @@ search_obj(table_t *table, haddr_t objno) for (i = 0; i < table->nobjs; i++) if (table->objs[i].objno == objno) 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; @@ -683,7 +683,7 @@ add_obj(table_t *table, haddr_t objno, char *objname) * *------------------------------------------------------------------------- */ -static +static FILE * tmpfile(void) { diff --git a/tools/lib/h5tools_utils.h b/tools/lib/h5tools_utils.h index 0c8d83c..a210c0f 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 8094c33..e3578c9 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_t *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_t *type ) +herr_t get_name_type( hid_t loc_id, + const char *group_name, + int idx, + char **name, + H5G_obj_t *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_t 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 e8e8a3f..cd38a9b 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 *------------------------------------------------------------------------- */ @@ -117,21 +117,21 @@ void trav_table_init(trav_table_t **table); void trav_table_free(trav_table_t *table); -int trav_table_search(haddr_t objno, +int trav_table_search(haddr_t objno, trav_table_t *table ); -void trav_table_add(haddr_t objno, - char *objname, - H5G_obj_t type, +void trav_table_add(haddr_t objno, + char *objname, + H5G_obj_t type, trav_table_t *table); -void trav_table_addflags(unsigned *flags, - char *objname, - H5G_obj_t type, +void trav_table_addflags(unsigned *flags, + char *objname, + H5G_obj_t 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 8e794aa..2ebcd6b 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(haddr_t objno, trav_table_t *table ) { int i; - + for (i = 0; i < table->nobjs; i++) if (table->objs[i].objno == objno) return i; - + return -1; } @@ -56,18 +56,18 @@ int trav_table_search(haddr_t objno, trav_table_t *table ) *------------------------------------------------------------------------- */ -void trav_table_add(haddr_t objno, - char *name, - H5G_obj_t type, +void trav_table_add(haddr_t objno, + char *name, + H5G_obj_t 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].flags[0] = table->objs[i].flags[1] = 0; @@ -79,7 +79,7 @@ void trav_table_add(haddr_t objno, table->objs[i].sizelinks = 0; } } - + i = table->nobjs++; table->objs[i].objno = objno; table->objs[i].flags[0] = table->objs[i].flags[1] = 0; @@ -105,18 +105,18 @@ void trav_table_add(haddr_t objno, *------------------------------------------------------------------------- */ -void trav_table_addflags(unsigned *flags, - char *name, - H5G_obj_t type, +void trav_table_addflags(unsigned *flags, + char *name, + H5G_obj_t 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].flags[0] = table->objs[i].flags[1] = 0; @@ -128,7 +128,7 @@ void trav_table_addflags(unsigned *flags, table->objs[i].sizelinks = 0; } } - + i = table->nobjs++; table->objs[i].objno = 0; table->objs[i].flags[0] = flags[0]; @@ -144,7 +144,7 @@ void trav_table_addflags(unsigned *flags, /*------------------------------------------------------------------------- * Function: trav_table_init * - * Purpose: Initialize the table + * Purpose: Initialize the table * * Return: void * @@ -159,12 +159,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].flags[0] = table->objs[i].flags[1] = 0; @@ -175,7 +175,7 @@ void trav_table_init( trav_table_t **tbl ) table->objs[i].nlinks = 0; table->objs[i].sizelinks = 0; } - + *tbl = table; } @@ -230,7 +230,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 ) { @@ -243,8 +243,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/lib/ph5diff.h b/tools/lib/ph5diff.h index 864ae49..3fcc553 100644 --- a/tools/lib/ph5diff.h +++ b/tools/lib/ph5diff.h @@ -18,7 +18,7 @@ #define PRINT_DATA_MAX_SIZE 512 #define OUTBUFF_SIZE PRINT_DATA_MAX_SIZE*4 /* Send from manager to workers */ -#define MPI_TAG_ARGS 1 +#define MPI_TAG_ARGS 1 #define MPI_TAG_PRINT_TOK 2 /*Sent from workers to manager */ @@ -40,9 +40,9 @@ extern FILE* overflow_file; struct diff_args { char name[256]; - H5G_obj_t type; + H5G_obj_t type; diff_opt_t options; -}; +}; struct diffs_found { diff --git a/tools/misc/h5debug.c b/tools/misc/h5debug.c index 75004fc..1f1423f 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: * *------------------------------------------------------------------------- */ @@ -116,7 +116,7 @@ main(int argc, char *argv[]) fprintf(stderr, "cannot obtain H5F_t pointer\n"); HDexit(2); } - + /* * Parse command arguments. */ @@ -149,7 +149,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. @@ -170,7 +170,7 @@ main(int argc, char *argv[]) */ H5B_subid_t subtype = (H5B_subid_t)sig[H5B_SIZEOF_MAGIC]; unsigned ndims; - + switch (subtype) { case H5B_SNODE_ID: status = H5G_node_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, extra); @@ -193,7 +193,7 @@ main(int argc, char *argv[]) * B-tree signature. */ H5B2_subid_t subtype = (H5B2_subid_t)sig[H5B2_SIZEOF_MAGIC+1]; - + switch (subtype) { case H5B2_TEST_ID: status = H5B2_hdr_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, H5B2_TEST); @@ -215,7 +215,7 @@ main(int argc, char *argv[]) * B-tree signature. */ H5B2_subid_t subtype = (H5B2_subid_t)sig[H5B2_SIZEOF_MAGIC+1]; - + switch (subtype) { case H5B2_TEST_ID: status = H5B2_int_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, H5B2_TEST, extra, (unsigned)extra2); @@ -237,7 +237,7 @@ main(int argc, char *argv[]) * B-tree signature. */ H5B2_subid_t subtype = (H5B2_subid_t)sig[H5B2_SIZEOF_MAGIC+1]; - + switch (subtype) { case H5B2_TEST_ID: status = H5B2_leaf_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, H5B2_TEST, extra, (unsigned)extra2); @@ -271,7 +271,7 @@ main(int argc, char *argv[]) * B+ tree signature. */ H5BP_subid_t subtype = (H5BP_subid_t)sig[H5BP_SIZEOF_MAGIC+1]; - + switch (subtype) { case H5BP_TEST_ID: status = H5BP_hdr_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, H5BP_TEST); 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 c88b5a8..ec83ea7 100644 --- a/tools/misc/h5repart.c +++ b/tools/misc/h5repart.c @@ -65,9 +65,9 @@ # define MIN3(X,Y,Z) MIN(MIN(X,Y),Z) #endif -/*Make these 2 private properties(defined in H5Fprivate.h) available to h5repart. +/*Make these 2 private properties(defined in H5Fprivate.h) available to h5repart. *The first one updates the member file size in the superblock. The second one - *change file driver from family to sec2. */ + *change file driver from family to sec2. */ #define H5F_ACS_FAMILY_NEWSIZE_NAME "family_newsize" #define H5F_ACS_FAMILY_TO_SEC2_NAME "family_to_sec2" @@ -136,7 +136,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)++; @@ -175,9 +175,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 @@ -209,7 +209,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? */ @@ -456,7 +456,7 @@ main (int argc, char *argv[]) } close (dst); - /* Modify family driver information saved in superblock through private property. + /* Modify family driver information saved in superblock through private property. * These private properties are for this tool only. */ if ((fapl=H5Pcreate(H5P_FILE_ACCESS))<0) { perror ("H5Pcreate"); @@ -467,13 +467,13 @@ main (int argc, char *argv[]) /* The user wants to change file driver from family to sec2. Open the file * with sec2 driver. This property signals the library to ignore the family * driver information saved in the superblock. */ - if(H5Pset(fapl, H5F_ACS_FAMILY_TO_SEC2_NAME, &family_to_sec2) < 0) { + if(H5Pset(fapl, H5F_ACS_FAMILY_TO_SEC2_NAME, &family_to_sec2) < 0) { perror ("H5Pset"); exit (1); } } else { - /* Modify family size saved in superblock through private property. It signals - * library to save the new member size(specified in command line) in superblock. + /* Modify family size saved in superblock through private property. It signals + * library to save the new member size(specified in command line) in superblock. * This private property is for this tool only. */ if(H5Pset_fapl_family(fapl, H5F_FAMILY_DEFAULT, H5P_DEFAULT) < 0) { perror ("H5Pset_fapl_family"); @@ -482,23 +482,23 @@ main (int argc, char *argv[]) /* Set the property of the new member size as hsize_t */ hdsize = dst_size; - if(H5Pset(fapl, H5F_ACS_FAMILY_NEWSIZE_NAME, &hdsize) < 0) { + if(H5Pset(fapl, H5F_ACS_FAMILY_NEWSIZE_NAME, &hdsize) < 0) { perror ("H5Pset"); exit (1); } } - /* If the new file is a family file, try to open file for "read and write" to - * flush metadata. Flushing metadata will update the superblock to the new - * member size. If the original file is a family file and the new file is a sec2 - * file, the property FAMILY_TO_SEC2 will signal the library to switch to sec2 - * driver when the new file is opened. If the original file is a sec2 file and the - * new file can only be a sec2 file, reopen the new file should fail. There's + /* If the new file is a family file, try to open file for "read and write" to + * flush metadata. Flushing metadata will update the superblock to the new + * member size. If the original file is a family file and the new file is a sec2 + * file, the property FAMILY_TO_SEC2 will signal the library to switch to sec2 + * driver when the new file is opened. If the original file is a sec2 file and the + * new file can only be a sec2 file, reopen the new file should fail. There's * nothing to do in this case. */ H5E_BEGIN_TRY { file=H5Fopen(dst_gen_name, H5F_ACC_RDWR, fapl); } H5E_END_TRY; - if(file>=0) { + if(file>=0) { if(H5Fclose(file)<0) { perror ("H5Fclose"); exit (1); diff --git a/tools/misc/h5repart_gentest.c b/tools/misc/h5repart_gentest.c index 22243b1..913d066 100644 --- a/tools/misc/h5repart_gentest.c +++ b/tools/misc/h5repart_gentest.c @@ -12,11 +12,11 @@ * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -/* - * Programmer: Raymond Lu +/* + * Programmer: Raymond Lu * June 1, 2005 - * - * Purpose: Generate a family file of 1024 bytes for each member + * + * Purpose: Generate a family file of 1024 bytes for each member * for h5repart test. */ #include "hdf5.h" @@ -71,23 +71,23 @@ int main(void) perror ("H5Dwrite"); exit (1); } - + if(H5Sclose(space)<0) { perror ("H5Sclose"); exit (1); } - + if(H5Dclose(dset)<0) { perror ("H5Dclose"); exit (1); } - + if(H5Pclose(fapl)<0) { perror ("H5Pclose"); exit (1); } - + if(H5Fclose(file)<0) { perror ("H5Fclose"); exit (1); 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 * June 1, 2005 * - * Purpose: This program tests family files after being repartitioned + * Purpose: This program tests family files after being repartitioned * by h5repart. It simply tries to reopen the files with * correct family driver and member size. */ @@ -27,11 +27,11 @@ #define FAMILY_H5REPART_SIZE2 (5*KB) #define MAX(a,b) (a>b ? a:b) -const char *FILENAME[] = { +const char *FILENAME[] = { "fst_family%05d.h5", "scd_family%05d.h5", "family_to_sec2.h5", - NULL + NULL }; herr_t test_family_h5repart_opens(void); @@ -57,14 +57,14 @@ herr_t test_family_h5repart_opens(void) { hid_t file=(-1), fapl=(-1); - + /* open 1st file(single member file) with correct family size(20000 byte) */ if ((fapl=H5Pcreate(H5P_FILE_ACCESS))<0) goto error; if(H5Pset_fapl_family(fapl, (hsize_t)FAMILY_H5REPART_SIZE1, H5P_DEFAULT)<0) goto error; - + if((file=H5Fopen(FILENAME[0], H5F_ACC_RDWR, fapl))<0) goto error; @@ -110,7 +110,7 @@ herr_t test_sec2_h5repart_opens(void) { hid_t file=(-1); - + /* open the sec2 file */ if((file=H5Fopen(FILENAME[2], H5F_ACC_RDWR, H5P_DEFAULT))<0) goto error; @@ -130,30 +130,30 @@ error: /*------------------------------------------------------------------------- * Function: main - * - * Purpose: Tests h5repart-ed family files - * + * + * Purpose: Tests h5repart-ed family files + * * Return: Success: exit(0) - * + * * Failure: exit(1) - * + * * Programmer: Raymond Lu * June 1, 2005 - * + * * Modifications: * *------------------------------------------------------------------------- */ int main(void) -{ +{ int nerrors=0; - + nerrors += test_family_h5repart_opens()<0 ?1:0; nerrors += test_sec2_h5repart_opens()<0 ?1:0; if (nerrors) goto error; - + return 0; error: -- cgit v0.12