summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MANIFEST8
-rw-r--r--Makefile.in12
-rwxr-xr-xbin/buildhdf513
-rwxr-xr-xbin/trace171
-rw-r--r--c++/examples/chunks.cpp2
-rw-r--r--c++/examples/extend_ds.cpp3
-rw-r--r--c++/examples/readdata.cpp4
-rw-r--r--c++/examples/writedata.cpp6
-rw-r--r--c++/src/H5AbstractDs.cpp14
-rw-r--r--c++/src/H5ArrayType.cpp32
-rw-r--r--c++/src/H5ArrayType.h4
-rw-r--r--c++/src/H5AtomType.cpp18
-rw-r--r--c++/src/H5AtomType.h2
-rw-r--r--c++/src/H5CompType.cpp18
-rw-r--r--c++/src/H5CompType.h8
-rw-r--r--c++/src/H5DataSpace.cpp6
-rw-r--r--c++/src/H5DataSpace.h6
-rw-r--r--c++/src/H5DataType.cpp327
-rw-r--r--c++/src/H5DataType.h70
-rw-r--r--c++/src/H5DcreatProp.cpp459
-rw-r--r--c++/src/H5DcreatProp.h2
-rw-r--r--c++/src/H5DxferProp.h13
-rw-r--r--c++/src/H5EnumType.cpp2
-rw-r--r--c++/src/H5EnumType.h2
-rw-r--r--c++/src/H5FaccProp.cpp127
-rw-r--r--c++/src/H5FaccProp.h2
-rw-r--r--c++/src/H5FcreatProp.cpp169
-rw-r--r--c++/src/H5FcreatProp.h36
-rw-r--r--c++/src/H5Group.cpp4
-rw-r--r--c++/src/H5IdComponent.cpp25
-rw-r--r--c++/src/H5IdComponent.h10
-rw-r--r--c++/src/H5Library.h2
-rw-r--r--c++/src/H5PredType.h2
-rw-r--r--c++/src/H5PropList.cpp79
-rw-r--r--c++/src/H5PropList.h8
-rw-r--r--c++/src/H5StrType.cpp10
-rw-r--r--c++/src/H5VarLenType.cpp10
-rw-r--r--c++/src/H5VarLenType.h4
-rwxr-xr-xc++/src/h5c++.in13
-rw-r--r--c++/test/dsets.cpp19
-rw-r--r--c++/test/h5cpputil.cpp1
-rw-r--r--c++/test/h5cpputil.h2
-rw-r--r--c++/test/tfile.cpp12
-rw-r--r--c++/test/th5s.cpp75
-rw-r--r--config/commence.in1
-rw-r--r--config/conclude.in34
-rw-r--r--config/dec-flags2
-rw-r--r--config/depend1.in16
-rw-r--r--config/freebsd4
-rw-r--r--config/gnu-flags1
-rw-r--r--config/hpux10.2040
-rw-r--r--config/hpux11.0040
-rw-r--r--config/hpux9.0342
-rw-r--r--config/i386-pc-cygwin326
-rw-r--r--config/ia64-linux-gnu10
-rw-r--r--config/irix5.x60
-rw-r--r--config/irix6.x110
-rw-r--r--config/powerpc-ibm-aix5.x53
-rw-r--r--config/solaris2.x29
-rw-r--r--config/sv1-cray63
-rw-r--r--config/unicos59
-rw-r--r--config/unicos10.0.X60
-rw-r--r--config/unicosmk58
-rw-r--r--config/unicosmk2.0.5.X58
-rw-r--r--config/unicosmk2.0.6.X62
-rw-r--r--config/unicosmk2.0.X56
-rwxr-xr-xconfigure39
-rw-r--r--configure.in34
-rw-r--r--doc/html/Copyright.html19
-rw-r--r--doc/html/Datasets.html4
-rw-r--r--doc/html/Dataspaces.html4
-rw-r--r--doc/html/Datatypes.html31
-rw-r--r--doc/html/DatatypesEnum.html25
-rw-r--r--doc/html/H5.intro.html4
-rw-r--r--doc/html/Intro/IntroExamples.html40
-rw-r--r--doc/html/RM_H5.html72
-rw-r--r--doc/html/RM_H5A.html200
-rw-r--r--doc/html/RM_H5D.html398
-rw-r--r--doc/html/RM_H5E.html137
-rw-r--r--doc/html/RM_H5F.html284
-rw-r--r--doc/html/RM_H5G.html419
-rw-r--r--doc/html/RM_H5I.html58
-rw-r--r--doc/html/RM_H5P.html2059
-rw-r--r--doc/html/RM_H5R.html114
-rw-r--r--doc/html/RM_H5S.html410
-rw-r--r--doc/html/RM_H5T.html920
-rw-r--r--doc/html/RM_H5Z.html79
-rw-r--r--doc/html/References.html2
-rw-r--r--doc/html/Tutor/examples/h5_copy.c4
-rw-r--r--doc/html/Tutor/examples/h5_extend.c2
-rw-r--r--doc/html/Tutor/examples/h5_hyperslab.c4
-rw-r--r--doc/html/Tutor/examples/h5_read.c4
-rw-r--r--doc/html/Tutor/examples/h5_ref2regr.c4
-rw-r--r--doc/html/Tutor/examples/h5_ref2regw.c20
-rw-r--r--doc/html/Tutor/examples/refregexample.f904
-rw-r--r--doc/html/Tutor/examples/selectele.f902
-rw-r--r--doc/html/Tutor/select.html4
-rw-r--r--doc/html/Tutor/selectc.html4
-rw-r--r--doc/html/cpplus/CppInterfaces.html24
-rw-r--r--doc/html/h5s.examples6
-rw-r--r--doc/html/ph5example.c16
-rw-r--r--examples/h5_chunk_read.c106
-rw-r--r--examples/h5_compound.c1
-rw-r--r--examples/h5_drivers.c1
-rw-r--r--examples/h5_extend_write.c7
-rw-r--r--examples/h5_group.c1
-rw-r--r--examples/h5_mount.c1
-rw-r--r--examples/h5_read.c5
-rw-r--r--examples/h5_reference.c1
-rw-r--r--examples/h5_select.c7
-rw-r--r--examples/h5_write.c1
-rw-r--r--examples/ph5example.c80
-rw-r--r--fortran/examples/refregexample.f904
-rw-r--r--fortran/examples/selectele.f902
-rw-r--r--fortran/src/Dependencies74
-rw-r--r--fortran/src/H5Af.c239
-rw-r--r--fortran/src/H5Aff.f9048
-rw-r--r--fortran/src/H5Df.c133
-rw-r--r--fortran/src/H5Dff.f9015
-rw-r--r--fortran/src/H5FDmpiof.c9
-rw-r--r--fortran/src/H5Gf.c53
-rw-r--r--fortran/src/H5Git.c239
-rw-r--r--fortran/src/H5Git.h25
-rw-r--r--fortran/src/H5If.c3
-rw-r--r--fortran/src/H5Iff.f902
-rw-r--r--fortran/src/H5Pf.c156
-rw-r--r--fortran/src/H5Pff.f9033
-rw-r--r--fortran/src/H5Rf.c6
-rw-r--r--fortran/src/H5Sf.c38
-rw-r--r--fortran/src/H5Sff.f9018
-rw-r--r--fortran/src/H5Tf.c26
-rw-r--r--fortran/src/H5_f.c12
-rw-r--r--fortran/src/H5f90global.f906
-rw-r--r--fortran/src/H5f90i.h154
-rw-r--r--fortran/src/H5f90kit.c73
-rw-r--r--fortran/src/H5f90proto.h849
-rw-r--r--fortran/src/Makefile.in2
-rw-r--r--fortran/test/Makefile.in6
-rw-r--r--fortran/test/fflush1.f904
-rw-r--r--fortran/test/fflush2.f904
-rw-r--r--fortran/test/t.c42
-rw-r--r--fortran/test/t.h14
-rw-r--r--fortran/test/tH5A.f902
-rw-r--r--fortran/test/tH5F.f902
-rw-r--r--fortran/test/tH5G.f902
-rw-r--r--fortran/test/tH5I.f906
-rw-r--r--fortran/test/tH5R.f908
-rw-r--r--fortran/test/tH5Sselect.f906
-rw-r--r--fortran/test/tH5Z.f9017
-rw-r--r--fortran/test/tf.f9052
-rw-r--r--hl/src/H5IM.c14
-rw-r--r--hl/src/H5TA.c61
-rw-r--r--hl/src/Makefile.in2
-rw-r--r--hl/test/test_image.c11
-rw-r--r--hl/test/test_table.c8
-rw-r--r--hl/tools/gif2h5/Makefile.in3
-rw-r--r--pablo/PabloHDF.c8
-rw-r--r--perform/Makefile.in3
-rw-r--r--perform/chunk.c4
-rw-r--r--perform/iopipe.c2
-rw-r--r--perform/overhead.c2
-rw-r--r--perform/perf_meta.c4
-rw-r--r--perform/pio_engine.c4
-rw-r--r--perform/zip_perf.c2
-rw-r--r--src/H5.c245
-rw-r--r--src/H5A.c71
-rw-r--r--src/H5AC.c61
-rw-r--r--src/H5ACprivate.h4
-rw-r--r--src/H5B.c74
-rw-r--r--src/H5Bprivate.h12
-rw-r--r--src/H5C.c8
-rw-r--r--src/H5Cprivate.h9
-rw-r--r--src/H5D.c66
-rw-r--r--src/H5Dcompact.c20
-rw-r--r--src/H5Dcontig.c127
-rw-r--r--src/H5Defl.c68
-rw-r--r--src/H5Dio.c158
-rw-r--r--src/H5Distore.c495
-rw-r--r--src/H5Dmpio.c228
-rw-r--r--src/H5Dpkg.h38
-rw-r--r--src/H5Dprivate.h8
-rw-r--r--src/H5Dpublic.h6
-rw-r--r--src/H5Dselect.c4
-rw-r--r--src/H5Dtest.c4
-rw-r--r--src/H5E.c151
-rw-r--r--src/H5Eprivate.h49
-rw-r--r--src/H5F.c1293
-rw-r--r--src/H5FD.c45
-rw-r--r--src/H5FDcore.c7
-rw-r--r--src/H5FDfamily.c58
-rw-r--r--src/H5FDgass.c7
-rw-r--r--src/H5FDlog.c16
-rw-r--r--src/H5FDmpi.c4
-rw-r--r--src/H5FDmpio.c7
-rw-r--r--src/H5FDmpiposix.c7
-rw-r--r--src/H5FDmulti.c81
-rw-r--r--src/H5FDprivate.h2
-rw-r--r--src/H5FDsec2.c8
-rw-r--r--src/H5FDsrb.c7
-rw-r--r--src/H5FDstdio.c51
-rw-r--r--src/H5FDstream.c6
-rw-r--r--src/H5FL.c73
-rw-r--r--src/H5FO.c13
-rw-r--r--src/H5FS.c18
-rw-r--r--src/H5Fpkg.h2
-rw-r--r--src/H5Fprivate.h8
-rw-r--r--src/H5Fpublic.h8
-rw-r--r--src/H5G.c24
-rw-r--r--src/H5Gent.c27
-rw-r--r--src/H5Gnode.c50
-rw-r--r--src/H5Gpkg.h22
-rw-r--r--src/H5Gstab.c8
-rw-r--r--src/H5HG.c23
-rw-r--r--src/H5HGdbg.c4
-rw-r--r--src/H5HGprivate.h4
-rw-r--r--src/H5HL.c10
-rw-r--r--src/H5HLdbg.c4
-rw-r--r--src/H5HLprivate.h2
-rw-r--r--src/H5HP.c26
-rw-r--r--src/H5I.c24
-rw-r--r--src/H5Iprivate.h1
-rw-r--r--src/H5Ipublic.h1
-rw-r--r--src/H5MF.c16
-rw-r--r--src/H5MM.c4
-rw-r--r--src/H5O.c22
-rw-r--r--src/H5Oattr.c7
-rw-r--r--src/H5Obogus.c8
-rw-r--r--src/H5Ocont.c3
-rw-r--r--src/H5Odtype.c34
-rw-r--r--src/H5Oefl.c7
-rw-r--r--src/H5Ofill.c15
-rw-r--r--src/H5Olayout.c9
-rw-r--r--src/H5Omtime.c11
-rw-r--r--src/H5Oname.c7
-rw-r--r--src/H5Opkg.h2
-rw-r--r--src/H5Opline.c7
-rw-r--r--src/H5Oprivate.h4
-rw-r--r--src/H5Osdspace.c12
-rw-r--r--src/H5Oshared.c7
-rw-r--r--src/H5Ostab.c7
-rw-r--r--src/H5P.c14
-rw-r--r--src/H5Pdcpl.c70
-rw-r--r--src/H5Pdxpl.c11
-rw-r--r--src/H5Pfapl.c13
-rw-r--r--src/H5Pfcpl.c39
-rw-r--r--src/H5Pprivate.h2
-rw-r--r--src/H5Ppublic.h22
-rw-r--r--src/H5Ptest.c11
-rw-r--r--src/H5R.c25
-rw-r--r--src/H5RC.c4
-rw-r--r--src/H5RS.c55
-rw-r--r--src/H5Rpublic.h4
-rw-r--r--src/H5S.c48
-rw-r--r--src/H5SL.c7
-rw-r--r--src/H5SLprivate.h2
-rw-r--r--src/H5ST.c18
-rw-r--r--src/H5Sall.c104
-rw-r--r--src/H5Shyper.c393
-rw-r--r--src/H5Smpio.c360
-rw-r--r--src/H5Snone.c125
-rw-r--r--src/H5Spkg.h10
-rw-r--r--src/H5Spoint.c141
-rw-r--r--src/H5Sprivate.h29
-rw-r--r--src/H5Spublic.h19
-rw-r--r--src/H5Sselect.c142
-rw-r--r--src/H5Stest.c6
-rw-r--r--src/H5T.c116
-rw-r--r--src/H5TB.c43
-rw-r--r--src/H5TS.c7
-rw-r--r--src/H5Tarray.c8
-rw-r--r--src/H5Tbit.c27
-rw-r--r--src/H5Tcommit.c80
-rw-r--r--src/H5Tcompound.c73
-rw-r--r--src/H5Tconv.c77
-rw-r--r--src/H5Tcset.c52
-rw-r--r--src/H5Tenum.c38
-rw-r--r--src/H5Tfields.c128
-rw-r--r--src/H5Tfixed.c46
-rw-r--r--src/H5Tfloat.c134
-rw-r--r--src/H5Tnative.c382
-rw-r--r--src/H5Toffset.c59
-rw-r--r--src/H5Topaque.c46
-rw-r--r--src/H5Torder.c52
-rw-r--r--src/H5Tpad.c52
-rw-r--r--src/H5Tpkg.h39
-rw-r--r--src/H5Tprecis.c102
-rw-r--r--src/H5Tprivate.h4
-rw-r--r--src/H5Tpublic.h22
-rw-r--r--src/H5Tstrpad.c60
-rw-r--r--src/H5Tvlen.c96
-rw-r--r--src/H5V.c504
-rw-r--r--src/H5Vprivate.h77
-rw-r--r--src/H5Z.c16
-rw-r--r--src/H5Zdeflate.c75
-rw-r--r--src/H5Zfletcher32.c22
-rw-r--r--src/H5Zpublic.h2
-rw-r--r--src/H5Zshuffle.c32
-rw-r--r--src/H5Zszip.c59
-rw-r--r--src/H5config.h.in3
-rw-r--r--src/H5detect.c34
-rw-r--r--src/H5private.h74
-rw-r--r--src/H5public.h19
-rw-r--r--src/Makefile.in2
-rw-r--r--test/big.c4
-rw-r--r--test/cache.c10
-rw-r--r--test/cmpd_dset.c26
-rw-r--r--test/dsets.c463
-rw-r--r--test/dtypes.c63
-rw-r--r--test/extend.c2
-rw-r--r--test/external.c4
-rw-r--r--test/file_handle.c36
-rw-r--r--test/filename.c2
-rw-r--r--test/fillval.c68
-rw-r--r--test/getname.c2
-rw-r--r--test/h5test.c150
-rw-r--r--test/h5test.h4
-rw-r--r--test/hyperslab.c60
-rw-r--r--test/istore.c21
-rw-r--r--test/ntypes.c703
-rw-r--r--test/ohdr.c4
-rwxr-xr-xtest/reserved.c26
-rw-r--r--test/stab.c4
-rw-r--r--test/stream_test.c2
-rw-r--r--test/tarray.c86
-rw-r--r--test/tattr.c2
-rw-r--r--test/testhdf5.h37
-rw-r--r--test/tfile.c168
-rw-r--r--test/tgenprop.c79
-rw-r--r--test/th5s.c9
-rw-r--r--test/theap.c16
-rw-r--r--test/titerate.c36
-rw-r--r--test/tmeta.c17
-rw-r--r--test/tmisc.c50
-rw-r--r--test/trefer.c116
-rw-r--r--test/trefstr.c6
-rw-r--r--test/tselect.c453
-rw-r--r--test/tskiplist.c16
-rw-r--r--test/ttbbt.c2
-rw-r--r--test/ttime.c18
-rw-r--r--test/ttsafe_acreate.c197
-rw-r--r--test/ttsafe_cancel.c218
-rw-r--r--test/ttsafe_dcreate.c2
-rw-r--r--test/ttsafe_error.c183
-rw-r--r--test/ttst.c19
-rw-r--r--test/tvlstr.c48
-rw-r--r--test/tvltypes.c84
-rw-r--r--test/unlink.c4
-rw-r--r--testpar/Makefile.in2
-rw-r--r--testpar/t_coll_chunk.c54
-rw-r--r--testpar/t_dset.c45
-rw-r--r--testpar/t_file.c8
-rw-r--r--testpar/t_mdset.c69
-rw-r--r--testpar/t_mpi.c15
-rw-r--r--testpar/testphdf5.c27
-rw-r--r--testpar/testphdf5.h102
-rw-r--r--tools/gifconv/Makefile.in3
-rw-r--r--tools/h5dump/h5dump.c266
-rw-r--r--tools/h5dump/h5dumpgentest.c58
-rw-r--r--tools/h5dump/testh5dump.sh.in29
-rwxr-xr-xtools/h5import/Makefile.in2
-rwxr-xr-xtools/h5import/h5import.c92
-rwxr-xr-xtools/h5import/h5import.h4
-rw-r--r--tools/h5jam/getub.c4
-rw-r--r--tools/h5jam/h5jam.c4
-rw-r--r--tools/h5jam/h5jamgentest.c17
-rw-r--r--tools/h5jam/h5unjam.c4
-rw-r--r--tools/h5jam/tellub.c16
-rw-r--r--tools/h5ls/Makefile.in3
-rw-r--r--tools/h5ls/h5ls.c75
-rw-r--r--tools/h5repack/Makefile.in10
-rw-r--r--tools/h5repack/h5repack.c3
-rw-r--r--tools/h5repack/h5repack.h2
-rwxr-xr-xtools/h5repack/h5repack.sh.in13
-rw-r--r--tools/h5repack/h5repack_copy.c27
-rw-r--r--tools/h5repack/h5repack_filters.c18
-rw-r--r--tools/h5repack/h5repack_refs.c18
-rw-r--r--tools/h5repack/testh5repack_dset.c2
-rw-r--r--tools/h5repack/testh5repack_main.c46
-rw-r--r--tools/h5repack/testh5repack_make.c36
-rw-r--r--tools/lib/h5diff.c12
-rw-r--r--tools/lib/h5diff.h1
-rw-r--r--tools/lib/h5diff_array.c28
-rw-r--r--tools/lib/h5diff_attr.c2
-rw-r--r--tools/lib/h5tools.c43
-rw-r--r--tools/lib/h5tools.h7
-rw-r--r--tools/lib/h5tools_filters.c95
-rw-r--r--tools/lib/h5tools_ref.c150
-rw-r--r--tools/lib/h5tools_ref.h6
-rw-r--r--tools/lib/h5tools_str.c4
-rw-r--r--tools/lib/h5trav.c1
-rw-r--r--tools/misc/Makefile.in6
-rwxr-xr-xtools/misc/h5cc.in8
-rw-r--r--tools/misc/h5debug.c7
-rw-r--r--tools/testfiles/help-1.ls1
-rw-r--r--tools/testfiles/help-2.ls1
-rw-r--r--tools/testfiles/help-3.ls1
396 files changed, 12605 insertions, 11586 deletions
diff --git a/MANIFEST b/MANIFEST
index 5b8ed73..e758413 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -839,8 +839,6 @@
./fortran/src/H5Fff.f90
./fortran/src/H5Gf.c
./fortran/src/H5Gff.f90
-./fortran/src/H5Git.c
-./fortran/src/H5Git.h
./fortran/src/H5If.c
./fortran/src/H5Iff.f90
./fortran/src/H5Pf.c
@@ -1076,6 +1074,9 @@
./release_docs/RELEASE.txt
./src/.indent.pro _DO_NOT_DISTRIBUTE_
+./src/hdf5.lnt _DO_NOT_DISTRIBUTE_
+./src/hdf5-lin.lnt _DO_NOT_DISTRIBUTE_
+./src/hdf5-win.lnt _DO_NOT_DISTRIBUTE_
./src/Dependencies
./src/H5.c
./src/H5api_adpt.h
@@ -1109,6 +1110,7 @@
./src/H5Eprivate.h
./src/H5Epublic.h
./src/H5F.c
+./src/H5Fdbg.c
./src/H5Fpkg.h
./src/H5Fprivate.h
./src/H5Fpublic.h
@@ -1368,6 +1370,7 @@
./testpar/t_mpi.c
./testpar/t_ph5basic.c
./testpar/t_coll_chunk.c
+./testpar/t_span_tree.c
./testpar/testphdf5.c
./testpar/testphdf5.h
./testpar/testph5.sh.in
@@ -1463,6 +1466,7 @@
./tools/h5repack/testh5repack_main.c
./tools/h5repack/testh5repack_make.c
./tools/h5repack/testh5repack_util.c
+./tools/h5repack/testh5repack_detect_szip.c
./tools/h5ls/Dependencies
./tools/h5ls/Makefile.in
diff --git a/Makefile.in b/Makefile.in
index 56695dd..ebed7d7 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,5 +1,3 @@
-## Top-level HDF5 Makefile(.in)
-##
##
## Copyright by the Board of Trustees of the University of Illinois.
## All rights reserved.
@@ -17,6 +15,8 @@
## but does so in the correct order. You can alternatively invoke make from
## each subdirectory manually.
##
+## Top-level HDF5 Makefile(.in)
+##
top_srcdir=@top_srcdir@
top_builddir=.
srcdir=@srcdir@
@@ -72,7 +72,7 @@ lib progs check test _test uninstall:
done
tests TAGS dep depend:
- @@SETX@; for d in $(SUBDIRS) perform; do \
+ @@SETX@; for d in $(SUBDIRS) perform; do \
(cd $$d && $(MAKE) $@) || exit 1; \
done
@@ -142,13 +142,13 @@ H5Tinit.c:
mostlyclean distclean maintainer-clean
clean mostlyclean:
- @@SETX@; for d in $(SUBDIRS) doc perform examples; do \
+ @@SETX@; for d in $(SUBDIRS) doc perform examples; do \
(cd $$d && $(MAKE) $@); \
done
-$(RM) conftest conftest.c
distclean:
- @@SETX@; for d in $(SUBDIRS) doc perform examples; do \
+ @@SETX@; for d in $(SUBDIRS) doc perform examples; do \
(cd $$d && $(MAKE) $@); \
done
-$(RM) config/commence config/conclude
@@ -160,7 +160,7 @@ distclean:
maintainer-clean:
@echo "This target is intended for maintainers to use;"
@echo "it deletes files that may require special tools to rebuild."
- @@SETX@; for d in $(SUBDIRS) doc perform examples; do \
+ @@SETX@; for d in $(SUBDIRS) doc perform examples; do \
(cd $$d && $(MAKE) $@); \
done
-$(RM) config.cache config.log config.status src/H5config.h
diff --git a/bin/buildhdf5 b/bin/buildhdf5
index 4ceec6d..03b6ade 100755
--- a/bin/buildhdf5
+++ b/bin/buildhdf5
@@ -1,4 +1,17 @@
#!/bin/sh
+##
+## Copyright by the Board of Trustees of the University of Illinois.
+## All rights reserved.
+##
+## This file is part of HDF5. The full HDF5 copyright notice, including
+## terms governing use, modification, and redistribution, is contained in
+## the files COPYING and Copyright.html. COPYING can be found at the root
+## of the source code distribution tree; Copyright.html can be found at the
+## root level of an installed copy of the electronic HDF5 document set and
+## is linked from the top-level documents page. It can also be found at
+## 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.
+##
# Build HDF5 library by doing configure, make, and tests.
# Usage: See USAGE()
# Programmer: Albert Cheng
diff --git a/bin/trace b/bin/trace
index a8b261e..c29d616 100755
--- a/bin/trace
+++ b/bin/trace
@@ -1,4 +1,17 @@
#!/usr/bin/perl -w
+##
+## Copyright by the Board of Trustees of the University of Illinois.
+## All rights reserved.
+##
+## This file is part of HDF5. The full HDF5 copyright notice, including
+## terms governing use, modification, and redistribution, is contained in
+## the files COPYING and Copyright.html. COPYING can be found at the root
+## of the source code distribution tree; Copyright.html can be found at the
+## root level of an installed copy of the electronic HDF5 document set and
+## is linked from the top-level documents page. It can also be found at
+## 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.
+##
require 5.003;
$Source = "";
@@ -14,83 +27,85 @@ $Source = "";
# Two-character strings begin with an upper-case letter which is
# usually the same as the package name.
#
-%TypeString = ("haddr_t" => "a",
- "hbool_t" => "b",
- "double" => "d",
- "H5D_alloc_time_t" => "Da",
- "H5D_fill_time_t" => "Df",
- "H5D_fill_value_t" => "DF",
- "H5D_layout_t" => "Dl",
- "H5FD_mpio_xfer_t" => "Dt",
- "herr_t" => "e",
- "H5E_direction_t" => "Ed",
- "H5E_error_t*" => "Ee",
- "H5E_major_t" => "Ej",
- "H5E_minor_t" => "En",
- "H5F_close_degree_t" => "Fd",
- "H5F_scope_t" => "Fs",
- "H5FD_t*" => "x",
- "H5FD_class_t*" => "x",
- "H5FD_stream_fapl_t*" => "x",
- "H5G_link_t" => "Gl",
- "H5G_stat_t*" => "Gs",
- "hsize_t" => "h",
- "hssize_t" => "Hs",
- "hid_t" => "i",
- "int" => "Is",
- "unsigned" => "Iu",
- "unsigned int" => "Iu",
- "H5I_type_t" => "It",
- "MPI_Comm" => "Mc",
- "MPI_Info" => "Mi",
- "H5FD_mem_t" => "Mt",
- "off_t" => "o",
- "H5P_class_t" => "p",
- "href_t" => "r",
- "H5R_type_t" => "Rt",
- "char*" => "s",
- "H5S_class_t" => "Sc",
- "H5S_seloper_t" => "Ss",
- "H5S_sel_type" => "St",
- "htri_t" => "t",
- "H5T_cset_t", => "Tc",
- "H5T_direction_t", => "Td",
- "H5T_norm_t" => "Tn",
- "H5T_order_t" => "To",
- "H5T_pad_t" => "Tp",
- "H5T_pers_t" => "Te",
- "H5T_sign_t" => "Ts",
- "H5T_class_t" => "Tt",
- "H5T_str_t" => "Tz",
- "void*" => "x",
- "void**" => "x",
- "FILE*" => "x",
- "H5A_operator_t" => "x",
- "H5D_operator_t" => "x",
- "H5E_auto_t" => "x",
- "H5E_walk_t" => "x",
- "H5G_iterate_t" => "x",
- "H5MM_allocate_t" => "x",
- "H5MM_free_t" => "x",
- "H5P_cls_create_func_t" => "x",
- "H5P_cls_copy_func_t" => "x",
- "H5P_cls_close_func_t" => "x",
- "H5P_iterate_t" => "x",
- "H5P_prp_create_func_t" => "x",
- "H5P_prp_copy_func_t" => "x",
- "H5P_prp_close_func_t" => "x",
- "H5P_prp_delete_func_t" => "x",
- "H5P_prp_get_func_t" => "x",
- "H5P_prp_set_func_t" => "x",
- "H5T_cdata_t**" => "x",
- "H5T_conv_t" => "x",
- "H5T_overflow_t" => "x",
- "H5Z_func_t" => "x",
- "H5Z_filter_func_t" => "x",
- "size_t" => "z",
- "H5Z_EDC_t" => "Ze",
- "H5Z_filter_t" => "Zf",
- "ssize_t" => "Zs",
+%TypeString = ("haddr_t" => "a",
+ "hbool_t" => "b",
+ "double" => "d",
+ "H5D_alloc_time_t" => "Da",
+ "H5D_fill_time_t" => "Df",
+ "H5D_fill_value_t" => "DF",
+ "H5D_layout_t" => "Dl",
+ "H5D_space_status_t" => "Ds",
+ "H5FD_mpio_xfer_t" => "Dt",
+ "herr_t" => "e",
+ "H5E_direction_t" => "Ed",
+ "H5E_error_t*" => "Ee",
+ "H5E_major_t" => "Ej",
+ "H5E_minor_t" => "En",
+ "H5F_close_degree_t" => "Fd",
+ "H5F_scope_t" => "Fs",
+ "H5FD_t*" => "x",
+ "H5FD_class_t*" => "x",
+ "H5FD_stream_fapl_t*" => "x",
+ "H5G_link_t" => "Gl",
+ "H5G_obj_t" => "Go",
+ "H5G_stat_t*" => "Gs",
+ "hsize_t" => "h",
+ "hssize_t" => "Hs",
+ "hid_t" => "i",
+ "int" => "Is",
+ "unsigned" => "Iu",
+ "unsigned int" => "Iu",
+ "H5I_type_t" => "It",
+ "MPI_Comm" => "Mc",
+ "MPI_Info" => "Mi",
+ "H5FD_mem_t" => "Mt",
+ "off_t" => "o",
+ "H5P_class_t" => "p",
+ "H5R_type_t" => "Rt",
+ "char*" => "s",
+ "H5S_class_t" => "Sc",
+ "H5S_seloper_t" => "Ss",
+ "H5S_sel_type" => "St",
+ "htri_t" => "t",
+ "H5T_cset_t", => "Tc",
+ "H5T_direction_t", => "Td",
+ "H5T_norm_t" => "Tn",
+ "H5T_order_t" => "To",
+ "H5T_pad_t" => "Tp",
+ "H5T_pers_t" => "Te",
+ "H5T_sign_t" => "Ts",
+ "H5T_class_t" => "Tt",
+ "H5T_str_t" => "Tz",
+ "void*" => "x",
+ "void**" => "x",
+ "FILE*" => "x",
+ "H5A_operator_t" => "x",
+ "H5D_operator_t" => "x",
+ "H5E_auto_t" => "x",
+ "H5E_walk_t" => "x",
+ "H5G_iterate_t" => "x",
+ "H5MM_allocate_t" => "x",
+ "H5MM_free_t" => "x",
+ "H5P_cls_create_func_t" => "x",
+ "H5P_cls_copy_func_t" => "x",
+ "H5P_cls_close_func_t" => "x",
+ "H5P_iterate_t" => "x",
+ "H5P_prp_create_func_t" => "x",
+ "H5P_prp_copy_func_t" => "x",
+ "H5P_prp_close_func_t" => "x",
+ "H5P_prp_delete_func_t" => "x",
+ "H5P_prp_get_func_t" => "x",
+ "H5P_prp_set_func_t" => "x",
+ "H5T_cdata_t**" => "x",
+ "H5T_conv_t" => "x",
+ "H5T_overflow_t" => "x",
+ "H5Z_func_t" => "x",
+ "H5Z_filter_func_t" => "x",
+ "size_t" => "z",
+ "H5Z_class_t*" => "Zc",
+ "H5Z_EDC_t" => "Ze",
+ "H5Z_filter_t" => "Zf",
+ "ssize_t" => "Zs",
);
##############################################################################
@@ -227,7 +242,7 @@ sub rewrite_func ($$$$$) {
}
} elsif ($body =~ s/((\n[ \t]*)H5TRACE\d+\s*\(.*?\);)\n/"$2$trace"/es) {
# Replaced an H5TRACE macro
- } elsif ($body=~s/((\n[ \t]*)FUNC_ENTER\w*\s*\(.*?\);)\n/"$1$2$trace"/es) {
+ } elsif ($body=~s/((\n[ \t]*)FUNC_ENTER\w*\s*\(.*?\);??)\n/"$1$2$trace"/es) {
# Added an H5TRACE macro after a FUNC_ENTER macro.
} else {
errmesg $file, $name, "unable to insert tracing information";
diff --git a/c++/examples/chunks.cpp b/c++/examples/chunks.cpp
index 3cc4e20..0efd95d 100644
--- a/c++/examples/chunks.cpp
+++ b/c++/examples/chunks.cpp
@@ -144,7 +144,7 @@ int main (void)
/*
* Define the column (hyperslab) to read.
*/
- hssize_t offset[2] = { 0, 2 };
+ hsize_t offset[2] = { 0, 2 };
hsize_t count[2] = { 10, 1 };
int column[10]; // buffer for column to be read
diff --git a/c++/examples/extend_ds.cpp b/c++/examples/extend_ds.cpp
index 4c4476a..9c12304 100644
--- a/c++/examples/extend_ds.cpp
+++ b/c++/examples/extend_ds.cpp
@@ -81,7 +81,6 @@ int main (void)
* Create a new dataset within the file using cparms
* creation properties.
*/
-
DataSet dataset = file.createDataSet( DATASET_NAME, PredType::NATIVE_INT, mspace1, cparms);
/*
@@ -96,7 +95,7 @@ int main (void)
* Select a hyperslab.
*/
DataSpace fspace1 = dataset.getSpace ();
- hssize_t offset[2];
+ hsize_t offset[2];
offset[0] = 0;
offset[1] = 0;
hsize_t dims1[2] = { 3, 3}; /* data1 dimensions */
diff --git a/c++/examples/readdata.cpp b/c++/examples/readdata.cpp
index 1797d27..7e5b195 100644
--- a/c++/examples/readdata.cpp
+++ b/c++/examples/readdata.cpp
@@ -128,7 +128,7 @@ int main (void)
* Define hyperslab in the dataset; implicitly giving strike and
* block NULL.
*/
- hssize_t offset[2]; // hyperslab offset in the file
+ hsize_t offset[2]; // hyperslab offset in the file
hsize_t count[2]; // size of the hyperslab in the file
offset[0] = 1;
offset[1] = 2;
@@ -148,7 +148,7 @@ int main (void)
/*
* Define memory hyperslab.
*/
- hssize_t offset_out[3]; // hyperslab offset in memory
+ hsize_t offset_out[3]; // hyperslab offset in memory
hsize_t count_out[3]; // size of the hyperslab in memory
offset_out[0] = 3;
offset_out[1] = 0;
diff --git a/c++/examples/writedata.cpp b/c++/examples/writedata.cpp
index 8e0404c..0bed680 100644
--- a/c++/examples/writedata.cpp
+++ b/c++/examples/writedata.cpp
@@ -98,7 +98,7 @@ int main (void)
* Select hyperslab for the dataset in the file, using 3x2 blocks,
* (4,3) stride and (2,4) count starting at the position (0,1).
*/
- hssize_t start[2]; // Start of hyperslab
+ hsize_t start[2]; // Start of hyperslab
hsize_t stride[2]; // Stride of hyperslab
hsize_t count[2]; // Block count
hsize_t block[2]; // Block sizes
@@ -156,14 +156,14 @@ int main (void)
/*
* Select sequence of NPOINTS points in the file dataspace.
*/
- hssize_t coord[NPOINTS][FSPACE_RANK]; /* Array to store selected points
+ 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;
coord[3][0] = 5; coord[3][1] = 6;
- fspace.selectElements( H5S_SELECT_SET, NPOINTS, (const hssize_t **)coord);
+ fspace.selectElements( H5S_SELECT_SET, NPOINTS, (const hsize_t **)coord);
/*
* Write new selection of points to the dataset.
diff --git a/c++/src/H5AbstractDs.cpp b/c++/src/H5AbstractDs.cpp
index 0968344..7771c6a 100644
--- a/c++/src/H5AbstractDs.cpp
+++ b/c++/src/H5AbstractDs.cpp
@@ -54,7 +54,7 @@ AbstractDs::AbstractDs( const AbstractDs& original ) : H5Object( original ) {}
// Function: AbstractDs::getTypeClass
///\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
+///\return Datatype class identifier
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -80,7 +80,7 @@ H5T_class_t AbstractDs::getTypeClass() const
// Function: AbstractDs::getDataType
///\brief Returns the generic datatype of this abstract dataset, which
/// can be a dataset or an attribute.
-///\return DataType instance
+///\return DataType instance
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -100,7 +100,7 @@ DataType AbstractDs::getDataType() const
// Function: AbstractDs::getEnumType
///\brief Returns the enumeration datatype of this abstract dataset which
/// can be a dataset or an attribute.
-///\return EnumType instance
+///\return EnumType instance
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -114,7 +114,7 @@ EnumType AbstractDs::getEnumType() const
// Function: AbstractDs::getCompType
///\brief Returns the compound datatype of this abstract dataset which
/// can be a dataset or an attribute.
-///\return CompType instance
+///\return CompType instance
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -128,7 +128,7 @@ CompType AbstractDs::getCompType() const
// Function: AbstractDs::getIntType
///\brief Returns the integer datatype of this abstract dataset which
/// can be a dataset or an attribute.
-///\return IntType instance
+///\return IntType instance
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -142,7 +142,7 @@ IntType AbstractDs::getIntType() const
// Function: AbstractDs::getFloatType
///\brief Returns the floating-point datatype of this abstract dataset,
/// which can be a dataset or an attribute.
-///\return FloatType instance
+///\return FloatType instance
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -156,7 +156,7 @@ FloatType AbstractDs::getFloatType() const
// Function: AbstractDs::getStrType
///\brief Returns the string datatype of this abstract dataset which
/// can be a dataset or an attribute.
-///\return StrType instance
+///\return StrType instance
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
diff --git a/c++/src/H5ArrayType.cpp b/c++/src/H5ArrayType.cpp
index 8859123..681b9c4 100644
--- a/c++/src/H5ArrayType.cpp
+++ b/c++/src/H5ArrayType.cpp
@@ -42,10 +42,10 @@ ArrayType::ArrayType() : DataType()
}
//--------------------------------------------------------------------------
-// Function: ArrayType overloaded constructor
-///\brief Creates an ArrayType object using an existing id.
-///\param existing_id - IN: Id of an existing datatype
-///\exception H5::DataTypeIException
+// Function: ArrayType overloaded constructor
+///\brief Creates an ArrayType object using an existing id.
+///\param existing_id - IN: Id of an existing datatype
+///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
ArrayType::ArrayType( const hid_t existing_id ) : DataType( existing_id )
@@ -81,13 +81,13 @@ ArrayType::ArrayType( const ArrayType& original ) : DataType( original )
}
//--------------------------------------------------------------------------
-// Function: ArrayType overloaded constructor
-///\brief Creates a new array data type based on the specified
+// Function: ArrayType overloaded constructor
+///\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]
-///\param dims - IN: Size of each array dimension
-///\exception H5::DataTypeIException
+///\param base_type - IN: Existing datatype
+///\param ndims - IN: Rank of the array, [0..H5S_MAX_RANK]
+///\param dims - IN: Size of each array dimension
+///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
ArrayType::ArrayType(const DataType& base_type, int ndims, const hsize_t* dims) : DataType()
@@ -105,10 +105,10 @@ ArrayType::ArrayType(const DataType& base_type, int ndims, const hsize_t* dims)
}
//--------------------------------------------------------------------------
-// Function: ArrayType::getArrayNDims
-///\brief Returns the number of dimensions for an array datatype.
+// Function: ArrayType::getArrayNDims
+///\brief Returns the number of dimensions for an array datatype.
///\return Number of dimensions
-///\exception H5::DataTypeIException
+///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
int ArrayType::getArrayNDims()
@@ -127,11 +127,11 @@ int ArrayType::getArrayNDims()
}
//--------------------------------------------------------------------------
-// Function: ArrayType::getArrayDims
-///\brief Retrieves the size of all dimensions of an array datatype.
+// Function: ArrayType::getArrayDims
+///\brief Retrieves the size of all dimensions of an array datatype.
///\param dims - OUT: Sizes of dimensions
///\return Number of dimensions
-///\exception H5::DataTypeIException
+///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - May 2004
//--------------------------------------------------------------------------
int ArrayType::getArrayDims(hsize_t* dims)
diff --git a/c++/src/H5ArrayType.h b/c++/src/H5ArrayType.h
index d98488e..fb5eb2e 100644
--- a/c++/src/H5ArrayType.h
+++ b/c++/src/H5ArrayType.h
@@ -34,10 +34,10 @@ class H5_DLLCPP ArrayType : public DataType {
// Returns the sizes of dimensions of this array datatype.
int getArrayDims(hsize_t* dims);
- // Copy constructor - makes copy of the original object
+ // Copy constructor: makes copy of the original object.
ArrayType( const ArrayType& original );
- // Default destructor
+ // Noop destructor
virtual ~ArrayType();
protected:
diff --git a/c++/src/H5AtomType.cpp b/c++/src/H5AtomType.cpp
index 0d84bd4..fb4c81a 100644
--- a/c++/src/H5AtomType.cpp
+++ b/c++/src/H5AtomType.cpp
@@ -58,7 +58,7 @@ AtomType::AtomType( const AtomType& original ) : DataType( original ) {}
// Function: AtomType::setSize
///\brief Sets the total size for an atomic datatype.
///\param size - IN: Size to set
-///\exception H5::DataTypeIException
+///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void AtomType::setSize( size_t size ) const
@@ -79,7 +79,7 @@ void AtomType::setSize( size_t size ) const
/// \li \c H5T_ORDER_LE
/// \li \c H5T_ORDER_BE
/// \li \c H5T_ORDER_VAX
-///\exception H5::DataTypeIException
+///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5T_order_t AtomType::getOrder( string& order_string ) const
@@ -109,7 +109,7 @@ H5T_order_t AtomType::getOrder( string& order_string ) const
/// \li \c H5T_ORDER_LE
/// \li \c H5T_ORDER_BE
/// \li \c H5T_ORDER_VAX
-///\exception H5::DataTypeIException
+///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void AtomType::setOrder( H5T_order_t order ) const
@@ -126,7 +126,7 @@ void AtomType::setOrder( H5T_order_t order ) const
// Function: AtomType::getPrecision
///\brief Returns the precision of an atomic datatype.
///\return Number of significant bits
-///\exception H5::DataTypeIException
+///\exception H5::DataTypeIException
///\par Description
/// The precision is the number of significant bits which,
/// unless padding is present, is 8 times larger than the
@@ -150,7 +150,7 @@ size_t AtomType::getPrecision() const
// Function: AtomType::setPrecision
///\brief Sets the precision of an atomic datatype.
///\param precision - IN: Number of bits of precision
-///\exception H5::DataTypeIException
+///\exception H5::DataTypeIException
///\par Description
/// For information, please see C layer Reference Manuat at:
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5T.html#Datatype-SetPrecision
@@ -170,7 +170,7 @@ void AtomType::setPrecision( size_t precision ) const
// Function: AtomType::getOffset
///\brief Retrieves the bit offset of the first significant bit.
///\return Offset value
-///\exception H5::DataTypeIException
+///\exception H5::DataTypeIException
///\par Description
/// For information, please see C layer Reference Manuat at:
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5T.html#Datatype-GetOffset
@@ -197,7 +197,7 @@ int AtomType::getOffset() const
// Function: AtomType::setOffset
///\brief Sets the bit offset of the first significant bit.
///\param offset - IN: Offset of first significant bit
-///\exception H5::DataTypeIException
+///\exception H5::DataTypeIException
///\par Description
/// For information, please see C layer Reference Manuat at:
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5T.html#Datatype-SetOffset
@@ -219,7 +219,7 @@ void AtomType::setOffset( size_t offset ) const
/// bit padding.
///\param lsb - OUT: Least-significant bit padding type
///\param msb - OUT: Most-significant bit padding type
-///\exception H5::DataTypeIException
+///\exception H5::DataTypeIException
///\par Description
/// Possible values for \a lsb and \a msb include:
/// \li \c H5T_PAD_ZERO (0) - Set background to zeros.
@@ -242,7 +242,7 @@ void AtomType::getPad( H5T_pad_t& lsb, H5T_pad_t& msb ) const
///\brief Sets the least and most-significant bits padding types.
///\param lsb - IN: Least-significant bit padding type
///\param msb - IN: Most-significant bit padding type
-///\exception H5::DataTypeIException
+///\exception H5::DataTypeIException
///\par Description
/// Valid values for \a lsb and \a msb include:
/// \li \c H5T_PAD_ZERO (0) - Set background to zeros.
diff --git a/c++/src/H5AtomType.h b/c++/src/H5AtomType.h
index e1b1eb9..4190b80 100644
--- a/c++/src/H5AtomType.h
+++ b/c++/src/H5AtomType.h
@@ -57,7 +57,7 @@ class H5_DLLCPP AtomType : public DataType {
// Copy constructor - makes copy of the original object
AtomType( const AtomType& original );
- // Default destructor
+ // Noop destructor
virtual ~AtomType();
protected:
diff --git a/c++/src/H5CompType.cpp b/c++/src/H5CompType.cpp
index 72341f4..e004ab9 100644
--- a/c++/src/H5CompType.cpp
+++ b/c++/src/H5CompType.cpp
@@ -114,7 +114,7 @@ int CompType::getNmembers() const
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-string CompType::getMemberName( int member_num ) const
+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
@@ -170,7 +170,7 @@ int CompType::getMemberIndex(const string& name) const
// Note that byte offset being returned as 0 doesn't indicate
// a failure. (According to Quincey)
//--------------------------------------------------------------------------
-size_t CompType::getMemberOffset( int member_num ) const
+size_t CompType::getMemberOffset( unsigned member_num ) const
{
size_t offset = H5Tget_member_offset( id, member_num );
return( offset );
@@ -192,7 +192,7 @@ int CompType::getMemberDims( int member_num, size_t* dims, int* perm ) const
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-H5T_class_t CompType::getMemberClass( int member_num ) const
+H5T_class_t CompType::getMemberClass( unsigned member_num ) const
{
// get the member datatype first
hid_t member_type_id = H5Tget_member_type( id, member_num );
@@ -216,7 +216,7 @@ H5T_class_t CompType::getMemberClass( int member_num ) const
// of the specified member. It provides the id to construct appropriate
// sub-types in the functions getMemberXxxType below, where Xxx indicates
// the sub-types.
-hid_t CompType::p_get_member_type(int member_num) const
+hid_t CompType::p_get_member_type(unsigned member_num) const
{
// get the id of the specified member first
hid_t member_type_id = H5Tget_member_type( id, member_num );
@@ -326,27 +326,27 @@ StrType CompType::getMemberStrType( int member_num ) const
May, 2004: These should be reconsidered to provide more convenience.
// Returns the datatype of the specified member in this compound datatype.
// Several overloading of getMemberType are for different datatypes
-void CompType::getMemberType( int member_num, EnumType& enumtype ) const
+void CompType::getMemberType( unsigned member_num, EnumType& enumtype ) const
{
p_get_member_type(member_num, enumtype);
}
-void CompType::getMemberType( int member_num, CompType& comptype ) const
+void CompType::getMemberType( unsigned member_num, CompType& comptype ) const
{
p_get_member_type(member_num, comptype);
}
-void CompType::getMemberType( int member_num, IntType& inttype ) const
+void CompType::getMemberType( unsigned member_num, IntType& inttype ) const
{
p_get_member_type(member_num, inttype);
}
-void CompType::getMemberType( int member_num, FloatType& floatype ) const
+void CompType::getMemberType( unsigned member_num, FloatType& floatype ) const
{
p_get_member_type(member_num, floatype);
}
-void CompType::getMemberType( int member_num, StrType& strtype ) const
+void CompType::getMemberType( unsigned member_num, StrType& strtype ) const
{
p_get_member_type(member_num, strtype);
}
diff --git a/c++/src/H5CompType.h b/c++/src/H5CompType.h
index 0c530b1..bc96969 100644
--- a/c++/src/H5CompType.h
+++ b/c++/src/H5CompType.h
@@ -34,7 +34,7 @@ class H5_DLLCPP CompType : public DataType {
// Returns the type class of the specified member of this compound
// datatype. It provides to the user a way of knowing what type
// to create another datatype of the same class
- H5T_class_t getMemberClass( int member_num ) const;
+ H5T_class_t getMemberClass( unsigned member_num ) const;
// Returns the dimensionality of the specified member.
int getMemberDims( int member_num, size_t* dims, int* perm ) const;
@@ -44,10 +44,10 @@ class H5_DLLCPP CompType : public DataType {
int getMemberIndex(const string& name) const;
// Returns the offset of a member of this compound datatype.
- size_t getMemberOffset( int memb_no ) const;
+ size_t getMemberOffset( unsigned memb_no ) const;
// Returns the name of a member of this compound datatype.
- string getMemberName( int member_num ) const;
+ string getMemberName( unsigned member_num ) const;
// Returns the compound datatype of the specified member in
// this compound datatype.
@@ -97,7 +97,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(int member_num) const;
+ hid_t p_get_member_type(unsigned member_num) const;
};
#ifndef H5_NO_NAMESPACE
}
diff --git a/c++/src/H5DataSpace.cpp b/c++/src/H5DataSpace.cpp
index 7e0f317..1dc7b43 100644
--- a/c++/src/H5DataSpace.cpp
+++ b/c++/src/H5DataSpace.cpp
@@ -419,7 +419,7 @@ void DataSpace::getSelectElemPointlist ( hsize_t startpoint, hsize_t numpoints,
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5S.html#Dataspace-SelectBounds
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void DataSpace::getSelectBounds ( hssize_t* start, hssize_t* end ) const
+void DataSpace::getSelectBounds ( hsize_t* start, hsize_t* end ) const
{
herr_t ret_value = H5Sget_select_bounds( id, start, end );
if( ret_value < 0 )
@@ -445,7 +445,7 @@ void DataSpace::getSelectBounds ( hssize_t* start, hssize_t* end ) const
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5S.html#Dataspace-SelectElements
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void DataSpace::selectElements ( H5S_seloper_t op, const size_t num_elements, const hssize_t *coord[ ] ) const
+void DataSpace::selectElements ( H5S_seloper_t op, const size_t num_elements, const hsize_t *coord[ ] ) const
{
herr_t ret_value;
ret_value = H5Sselect_elements( id, op, num_elements, coord );
@@ -525,7 +525,7 @@ bool DataSpace::selectValid () const
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5S.html#Dataspace-SelectHyperslab
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void DataSpace::selectHyperslab( H5S_seloper_t op, const hsize_t *count, const hssize_t *start, const hsize_t *stride, const hsize_t *block ) const
+void DataSpace::selectHyperslab( H5S_seloper_t op, const hsize_t *count, const hsize_t *start, const hsize_t *stride, const hsize_t *block ) const
{
herr_t ret_value;
ret_value = H5Sselect_hyperslab( id, op, start, stride, count, block );
diff --git a/c++/src/H5DataSpace.h b/c++/src/H5DataSpace.h
index 5e20730..a07289b 100644
--- a/c++/src/H5DataSpace.h
+++ b/c++/src/H5DataSpace.h
@@ -41,7 +41,7 @@ class H5_DLLCPP DataSpace : public IdComponent {
void extentCopy( DataSpace& dest_space ) const;
// Gets the bounding box containing the current selection.
- void getSelectBounds( hssize_t* start, hssize_t* end ) const;
+ void getSelectBounds( hsize_t* start, hsize_t* end ) const;
// Gets the number of element points in the current selection.
hssize_t getSelectElemNpoints() const;
@@ -82,10 +82,10 @@ class H5_DLLCPP DataSpace : public IdComponent {
// Selects array elements to be included in the selection for
// this dataspace.
- void selectElements( H5S_seloper_t op, const size_t num_elements, const hssize_t *coord[ ] ) const;
+ void selectElements( H5S_seloper_t op, const size_t num_elements, const hsize_t *coord[ ] ) const;
// Selects a hyperslab region to add to the current selected region.
- void selectHyperslab( H5S_seloper_t op, const hsize_t *count, const hssize_t *start, const hsize_t *stride = NULL, const hsize_t *block = NULL ) const;
+ void selectHyperslab( H5S_seloper_t op, const hsize_t *count, const hsize_t *start, const hsize_t *stride = NULL, const hsize_t *block = NULL ) const;
// Resets the selection region to include no elements.
void selectNone() const;
diff --git a/c++/src/H5DataType.cpp b/c++/src/H5DataType.cpp
index 1f01aa2..8dcb7bd 100644
--- a/c++/src/H5DataType.cpp
+++ b/c++/src/H5DataType.cpp
@@ -39,29 +39,29 @@ namespace H5 {
#endif
//--------------------------------------------------------------------------
-// Function: DataType overloaded constructor
-///\brief Creates a datatype using an existing datatype's id
-///\param existing_id - IN: Id of the existing datatype
-///\param predefined - IN: Indicates whether or not this datatype is
-/// a predefined datatype; default to \c false
+// Function: DataType overloaded constructor
+///\brief Creates a datatype using an existing datatype's id
+///\param existing_id - IN: Id of the existing datatype
+///\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.
-// - BMR 5/2004
-// Programmer Binh-Minh Ribler - 2000
+// 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
//--------------------------------------------------------------------------
DataType::DataType(const hid_t existing_id, bool predefined) : H5Object(existing_id), is_predtype(predefined) {}
//--------------------------------------------------------------------------
-// Function: DataType overloaded constructor
-///\brief Creates a object given its class and size
-///\param type_class - IN: Class of datatype to create
-///\param size - IN: Number of bytes in the datatype to create
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataType overloaded constructor
+///\brief Creates a object given its class and size
+///\param type_class - IN: Class of datatype to create
+///\param size - IN: Number of bytes in the datatype to create
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DataType::DataType( const H5T_class_t type_class, size_t size ) : H5Object(), is_predtype( false )
{
@@ -74,16 +74,16 @@ DataType::DataType( const H5T_class_t type_class, size_t size ) : H5Object(), is
}
//--------------------------------------------------------------------------
-// Function: DataType default constructor
-///\brief Default constructor: Creates a stub datatype
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataType default constructor
+///\brief Default constructor: Creates a stub datatype
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DataType::DataType() : H5Object(), is_predtype( false ) {}
//--------------------------------------------------------------------------
-// Function: DataType copy constructor
-///\brief Copy constructor: makes a copy of the original DataType object.
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataType copy constructor
+///\brief Copy constructor: makes a copy of the original DataType object.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DataType::DataType(const DataType& original) : H5Object(original)
{
@@ -91,11 +91,11 @@ DataType::DataType(const DataType& original) : H5Object(original)
}
//--------------------------------------------------------------------------
-// Function: DataType::copy
-///\brief Copies an existing datatype to this datatype object
-///\param like_type - IN: Datatype to be copied
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataType::copy
+///\brief Copies an existing datatype to this datatype object
+///\param like_type - IN: Datatype to be copied
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DataType::copy( const DataType& like_type )
{
@@ -114,21 +114,19 @@ void DataType::copy( const DataType& like_type )
ref_count = new RefCounter;
if( id <= 0 )
- {
throw DataTypeIException("DataType::copy", "H5Tcopy failed");
- }
}
//--------------------------------------------------------------------------
-// Function: DataType::operator=
-///\brief Assignment operator
-///\param rhs - IN: Reference to the existing datatype
-///\return Reference to DataType instance
-///\exception H5::DataTypeIException
+// Function: DataType::operator=
+///\brief Assignment operator
+///\param rhs - IN: Reference to the existing datatype
+///\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.
-// Programmer Binh-Minh Ribler - 2000
+// 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,13 +135,13 @@ DataType& DataType::operator=( const DataType& rhs )
}
//--------------------------------------------------------------------------
-// Function: DataType::operator==
-///\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.
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataType::operator==
+///\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.
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
bool DataType::operator==(const DataType& compared_type ) const
{
@@ -162,16 +160,15 @@ bool DataType::operator==(const DataType& compared_type ) const
}
//--------------------------------------------------------------------------
-// Function: DataType::commit
-///\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
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataType::commit
+///\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
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-// Commits a transient datatype to a file, creating a new named datatype
-void DataType::commit( CommonFG& loc, const char* name ) const
+void DataType::commit(CommonFG& loc, const char* name) const
{
hid_t loc_id = loc.getLocId(); // get location id for C API
@@ -182,25 +179,26 @@ void DataType::commit( CommonFG& loc, const char* name ) const
throw DataTypeIException("DataType::commit", "H5Tcommit failed");
}
}
+
//--------------------------------------------------------------------------
-// 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
-/// argument \a name.
-// Programmer Binh-Minh Ribler - 2000
+// 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
+/// argument \a name.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void DataType::commit( CommonFG& loc, const string& name ) const
+void DataType::commit(CommonFG& loc, const string& name) const
{
commit( loc, name.c_str() );
}
//--------------------------------------------------------------------------
-// Function: DataType::committed
-///\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
+// Function: DataType::committed
+///\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
//--------------------------------------------------------------------------
bool DataType::committed() const
{
@@ -217,14 +215,14 @@ bool DataType::committed() const
}
//--------------------------------------------------------------------------
-// Function: DataType::find
-///\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
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataType::find
+///\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
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5T_conv_t DataType::find( const DataType& dest, H5T_cdata_t **pcdata ) const
{
@@ -238,17 +236,17 @@ 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.
-///\param dest - IN: Destination datatype
-///\param nelmts - IN: Size of array \a buf
-///\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
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataType::convert
+///\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
+/// values
+///\param background - IN: Optional backgroud buffer
+///\param plist - IN: Dataset transfer property list
+///\return Pointer to a suitable conversion function
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DataType::convert( const DataType& dest, hsize_t nelmts, void *buf, void *background, PropList& plist ) const
{
@@ -284,17 +282,17 @@ H5T_overflow_t DataType::getOverflow(void) const
}
//--------------------------------------------------------------------------
-// Function: DataType::lock
-///\brief Locks a datatype, making it read-only and non-destructible.
-///\exception H5::DataTypeIException
+// Function: DataType::lock
+///\brief Locks a datatype, making it read-only and non-destructible.
+///\exception H5::DataTypeIException
///\par Descrition
-/// This is normally done by the library for predefined data
-/// types so the application doesn't inadvertently change or
-/// delete a predefined type.
+/// 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
-/// the entire library is closed.
-// Programmer Binh-Minh Ribler - 2000
+/// Once a data type is locked it can never be unlocked unless
+/// the entire library is closed.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DataType::lock() const
{
@@ -307,11 +305,11 @@ void DataType::lock() const
}
//--------------------------------------------------------------------------
-// Function: DataType::getClass
-///\brief Returns the datatype class identifier.
-///\return Datatype class identifier
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataType::getClass
+///\brief Returns the datatype class identifier.
+///\return Datatype class identifier
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5T_class_t DataType::getClass() const
{
@@ -327,11 +325,11 @@ H5T_class_t DataType::getClass() const
}
//--------------------------------------------------------------------------
-// Function: DataType::getSize
-///\brief Returns the size of a datatype.
-///\return Datatype size in bytes
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataType::getSize
+///\brief Returns the size of a datatype.
+///\return Datatype size in bytes
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
size_t DataType::getSize() const
{
@@ -346,11 +344,11 @@ size_t DataType::getSize() const
}
//--------------------------------------------------------------------------
-// Function: DataType::getSuper
-///\brief Returns the base datatype from which a datatype is derived.
-///\return DataType object
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataType::getSuper
+///\brief Returns the base datatype from which a datatype is derived.
+///\return DataType object
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DataType DataType::getSuper() const
{
@@ -372,20 +370,20 @@ DataType DataType::getSuper() const
}
//--------------------------------------------------------------------------
-// Function: DataType::registerFunc
-///\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.
-///\param dest - IN: Destination datatype.
-///\param func - IN: Function to convert between source and
-/// destination datatypes.
-///\exception H5::DataTypeIException
+// Function: DataType::registerFunc
+///\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.
+///\param dest - IN: Destination datatype.
+///\param func - IN: Function to convert between source and
+/// destination datatypes.
+///\exception H5::DataTypeIException
///\par Description
-/// For more information, please see:
+/// For more information, please see:
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5T.html#Datatype-Register
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DataType::registerFunc( H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const
{
@@ -398,12 +396,13 @@ void DataType::registerFunc( H5T_pers_t pers, const char* name, const DataType&
throw DataTypeIException("DataType::registerFunc", "H5Tregister failed");
}
}
+
//--------------------------------------------------------------------------
-// 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
-/// argument \a name.
-// Programmer Binh-Minh Ribler - 2000
+// 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
+/// argument \a name.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DataType::registerFunc( H5T_pers_t pers, const string& name, const DataType& dest, H5T_conv_t func ) const
{
@@ -411,17 +410,17 @@ void DataType::registerFunc( H5T_pers_t pers, const string& name, const DataType
}
//--------------------------------------------------------------------------
-// Function: DataType::unregister
-///\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.
-///\param dest - IN: Destination datatype.
-///\param func - IN: Function to convert between source and
-/// destination datatypes.
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataType::unregister
+///\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.
+///\param dest - IN: Destination datatype.
+///\param func - IN: Function to convert between source and
+/// destination datatypes.
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DataType::unregister( H5T_pers_t pers, const char* name, const DataType& dest, H5T_conv_t func ) const
{
@@ -434,12 +433,13 @@ void DataType::unregister( H5T_pers_t pers, const char* name, const DataType& de
throw DataTypeIException("DataType::unregister", "H5Tunregister failed");
}
}
+
//--------------------------------------------------------------------------
-// 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
-/// argument \a name.
-// Programmer Binh-Minh Ribler - 2000
+// 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
+/// argument \a name.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DataType::unregister( H5T_pers_t pers, const string& name, const DataType& dest, H5T_conv_t func ) const
{
@@ -447,12 +447,12 @@ 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.
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataType::setTag
+///\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
{
@@ -463,12 +463,13 @@ void DataType::setTag( const char* tag ) const
throw DataTypeIException("DataType::setTag", "H5Tset_tag failed");
}
}
+
//--------------------------------------------------------------------------
-// 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
-/// argument \a name.
-// Programmer Binh-Minh Ribler - 2000
+// 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
+/// argument \a name.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DataType::setTag( const string& tag ) const
{
@@ -476,11 +477,11 @@ void DataType::setTag( const string& tag ) const
}
//--------------------------------------------------------------------------
-// Function: DataType::getTag
-///\brief Gets the tag associated with an opaque datatype.
-///\return Tag associated with the opaque datatype
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: DataType::getTag
+///\brief Gets the tag associated with an opaque datatype.
+///\return Tag associated with the opaque datatype
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
string DataType::getTag() const
{
@@ -507,7 +508,7 @@ string DataType::getTag() const
/// datatype.
///\return true if this datatype contains or is the specified type,
/// and false, otherwise.
-///\exception H5::DataTypeIException
+///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
bool DataType::detectClass(H5T_class_t cls) const
@@ -529,7 +530,7 @@ bool DataType::detectClass(H5T_class_t cls) const
///\brief Check whether this datatype is a variable-length string.
///\return true if this datatype is a variable-length string, and
/// false, otherwise.
-///\exception H5::DataTypeIException
+///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
bool DataType::isVariableStr() const
@@ -638,8 +639,8 @@ void DataType::p_close() const
#endif // DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: DataType destructor
-///\brief Properly terminates access to this datatype.
+// Function: DataType destructor
+///\brief Properly terminates access to this datatype.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DataType::~DataType()
diff --git a/c++/src/H5DataType.h b/c++/src/H5DataType.h
index 7714231..df3ca59 100644
--- a/c++/src/H5DataType.h
+++ b/c++/src/H5DataType.h
@@ -25,30 +25,39 @@ class H5_DLLCPP DataType : public H5Object {
// Creates a datatype given its class and size
DataType( const H5T_class_t type_class, size_t size );
+ // Copy constructor: makes a copy of the original object
+ DataType( const DataType& original );
+
// Copies an existing datatype to this datatype object
void copy( const DataType& like_type );
+ // Returns the datatype class identifier.
+ H5T_class_t getClass() const;
+
// 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 char* name ) const;
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.
bool committed() const;
+ // 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.
void convert( const DataType& dest, hsize_t nelmts, void *buf, void *background, PropList& plist ) const;
- // Checks whether this datatype contains (or is) a certain type class.
- bool detectClass(H5T_class_t cls) const;
+ // Assignment operator
+ DataType& operator=( const DataType& rhs );
- // 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;
+ // Determines whether two datatypes are the same.
+ bool operator==(const DataType& compared_type ) const;
- // Returns the datatype class identifier.
- H5T_class_t getClass() const;
+ // Locks a datatype.
+ void lock() const;
// Returns a pointer to the current global overflow function.
H5T_overflow_t getOverflow(void) const;
@@ -63,45 +72,39 @@ class H5_DLLCPP DataType : public H5Object {
// Note: not quite right for specific types yet???
DataType getSuper() const;
- // Gets the tag associated with an opaque datatype.
- string getTag() const;
+ // 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.
+ 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.
void setTag( const string& tag ) const;
void setTag( const char* tag ) const;
- // Checks whether this datatype is a variable-length string.
- bool isVariableStr() const;
-
- // Locks a datatype.
- void lock() const;
+ // Gets the tag associated with an opaque datatype.
+ string getTag() const;
- // Assignment operator
- DataType& operator=( const DataType& rhs );
+ // Checks whether this datatype contains (or is) a certain type class.
+ bool detectClass(H5T_class_t cls) const;
- // Determines whether two datatypes are the same.
- bool operator==(const DataType& compared_type ) const;
+ // Checks whether this datatype is a variable-length string.
+ bool isVariableStr() const;
- // 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;
+ // Creates a reference to a named Hdf5 object in this object.
+ void* Reference(const char* name) const;
- // 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;
+ // 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;
// Retrieves the type of object that an object reference points to.
H5G_obj_t getObjType(void *ref, H5R_type_t ref_type) const;
// Retrieves a dataspace with the region pointed to selected.
DataSpace getRegion(void *ref, H5R_type_t ref_type = H5R_DATASET_REGION) const;
-
- // 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;
-
- // Creates a reference to a named Hdf5 object in this object.
- void* Reference(const char* name) const;
// Creates a copy of an existing DataType using its id
DataType( const hid_t type_id, bool predtype = false );
@@ -109,9 +112,6 @@ class H5_DLLCPP DataType : public H5Object {
// Default constructor
DataType();
- // Copy constructor: makes a copy of the original object
- DataType( const DataType& original );
-
#ifndef DOXYGEN_SHOULD_SKIP_THIS
// Used by the API to appropriately close a datatype
void p_close() const;
diff --git a/c++/src/H5DcreatProp.cpp b/c++/src/H5DcreatProp.cpp
index a6260dc..c9a16ba 100644
--- a/c++/src/H5DcreatProp.cpp
+++ b/c++/src/H5DcreatProp.cpp
@@ -34,22 +34,22 @@ namespace H5 {
const DSetCreatPropList DSetCreatPropList::DEFAULT( H5P_DEFAULT );
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList default constructor
-///\brief Default constructor: creates a stub dataset creation property list
+// Function: DSetCreatPropList default constructor
+///\brief Default constructor: creates a stub dataset creation property list
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DSetCreatPropList::DSetCreatPropList() : PropList( H5P_DATASET_CREATE) {}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList copy constructor
-///\brief Copy constructor: makes a copy of the original
-/// DSetCreatPropList object
+// Function: DSetCreatPropList copy constructor
+///\brief Copy constructor: makes a copy of the original
+/// DSetCreatPropList object
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DSetCreatPropList::DSetCreatPropList( const DSetCreatPropList& orig ) : PropList( orig ) {}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList overloaded constructor
+// Function: DSetCreatPropList overloaded constructor
///\brief Creates a DSetCreatPropList object using the id of an
/// existing dataset creation property list.
// Programmer Binh-Minh Ribler - 2000
@@ -57,18 +57,18 @@ DSetCreatPropList::DSetCreatPropList( const DSetCreatPropList& orig ) : PropList
DSetCreatPropList::DSetCreatPropList(const hid_t plist_id) : PropList( plist_id ) {}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::setChunk
-///\brief Sets the size of the chunks used to store a chunked layout
-/// dataset.
-///\param ndims - IN: Number of dimensions of each chunk
-///\param dim - IN: Array containing the size of each chunk
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::setChunk
+///\brief Sets the size of the chunks used to store a chunked layout
+/// dataset.
+///\param ndims - IN: Number of dimensions of each chunk
+///\param dim - IN: Array containing the size of each chunk
+///\exception H5::PropListIException
///\par Description
-/// The \a ndims parameter currently must have the same value as
-/// the rank of the dataset. The values of the \a dim array
-/// define the size of the chunks to store the dataset's raw
-/// data. As a side-effect, the layout of the dataset will be
-/// changed to \c H5D_CHUNKED, if it is not so already.
+/// The \a ndims parameter currently must have the same value as
+/// the rank of the dataset. The values of the \a dim array
+/// define the size of the chunks to store the dataset's raw
+/// data. As a side-effect, the layout of the dataset will be
+/// changed to \c H5D_CHUNKED, if it is not so already.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DSetCreatPropList::setChunk( int ndims, const hsize_t* dim ) const
@@ -81,12 +81,12 @@ void DSetCreatPropList::setChunk( int ndims, const hsize_t* dim ) const
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::getChunk
-///\brief Retrieves the size of the chunks used to store a chunked
-/// layout dataset.
-///\param max_ndims - IN: Size of \a dim array
-///\param dim - OUT: Array to store the chunk dimensions
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::getChunk
+///\brief Retrieves the size of the chunks used to store a chunked
+/// layout dataset.
+///\param max_ndims - IN: Size of \a dim array
+///\param dim - OUT: Array to store the chunk dimensions
+///\exception H5::PropListIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
int DSetCreatPropList::getChunk( int max_ndims, hsize_t* dim ) const
@@ -101,12 +101,12 @@ int DSetCreatPropList::getChunk( int max_ndims, hsize_t* dim ) const
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::setLayout
-///\brief Sets the type of storage used store the raw data for a dataset.
-///\param layout - IN: Type of storage layout for raw data
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::setLayout
+///\brief Sets the type of storage used store the raw data for a dataset.
+///\param layout - IN: Type of storage layout for raw data
+///\exception H5::PropListIException
///\par Description
-/// For information on setting layout type, please refer to
+/// For information on setting layout type, please refer to
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetLayout
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -121,18 +121,18 @@ void DSetCreatPropList::setLayout(H5D_layout_t layout) const
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::getLayout
-///\brief Retrieves the layout type of this property list
-///\return Layout type, which can be:
-/// \li \c H5D_COMPACT - raw data is stored in the object
-/// header in the file.
-/// \li \c H5D_CONTIGUOUS - raw data is stored separately from the
-/// object header in one contiguous chunk in
-/// the file.
-/// \li \c H5D_CHUNKED - raw data is stored separately from the
-/// object header in chunks in separate locations
-/// in the file.
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::getLayout
+///\brief Retrieves the layout type of this property list
+///\return Layout type, which can be:
+/// \li \c H5D_COMPACT - raw data is stored in the object
+/// header in the file.
+/// \li \c H5D_CONTIGUOUS - raw data is stored separately from the
+/// object header in one contiguous chunk in
+/// the file.
+/// \li \c H5D_CHUNKED - raw data is stored separately from the
+/// object header in chunks in separate locations
+/// in the file.
+///\exception H5::PropListIException
///\par Description
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -148,15 +148,15 @@ H5D_layout_t DSetCreatPropList::getLayout() const
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::setDeflate
-///\brief Sets compression method and compression level
-///\param level - IN: Compression level, should [0..9], inclusive
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::setDeflate
+///\brief Sets compression method and compression level
+///\param level - IN: Compression level, should [0..9], inclusive
+///\exception H5::PropListIException
///\par Description
-/// The function sets the compression method for this property
-/// list to \c H5D_COMPRESS_DEFLATE and the compression level to
-/// \a level. Lower compression levels are faster but result in
-/// less compression.
+/// The function sets the compression method for this property
+/// list to \c H5D_COMPRESS_DEFLATE and the compression level to
+/// \a level. Lower compression levels are faster but result in
+/// less compression.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DSetCreatPropList::setDeflate( int level ) const
@@ -170,20 +170,20 @@ void DSetCreatPropList::setDeflate( int level ) const
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::setFillValue
-///\brief Sets a dataset fill value
-///\param fvalue_type - IN: Data type for the value passed via \a value
-///\param value - IN: Pointer to buffer containing the fill value
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::setFillValue
+///\brief Sets a dataset fill value
+///\param fvalue_type - IN: Data type for the value passed via \a value
+///\param value - IN: Pointer to buffer containing the fill value
+///\exception H5::PropListIException
///\par Description
-/// The datatype may differ from that of the dataset, but it must
-/// be one that the HDF5 library is able to convert \a value to
-/// the dataset datatype when the dataset is created.
-/// The default fill value is 0 (zero,) which is interpreted
-/// according to the actual dataset datatype.
+/// The datatype may differ from that of the dataset, but it must
+/// be one that the HDF5 library is able to convert \a value to
+/// the dataset datatype when the dataset is created.
+/// The default fill value is 0 (zero,) which is interpreted
+/// according to the actual dataset datatype.
///\par
-/// For information on setting fill value, please refer to the
-/// C layer Reference Manual at:
+/// For information on setting fill value, please refer to the
+/// C layer Reference Manual at:
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetFillValue
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -198,16 +198,16 @@ void DSetCreatPropList::setFillValue( const DataType& fvalue_type, const void* v
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::getFillValue
-///\brief Retrieves a dataset fill value
-///\param fvalue_type - IN: Data type for the value passed via \a value
-///\param value - OUT: Pointer to buffer to hold the retrieved fill value
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::getFillValue
+///\brief Retrieves a dataset fill value
+///\param fvalue_type - IN: Data type for the value passed via \a value
+///\param value - OUT: Pointer to buffer to hold the retrieved fill value
+///\exception H5::PropListIException
///\par Description
-/// The fill value is returned through \a value pointer
-/// and the memory is allocated by the caller. The fill
-/// value will be converted from its current data type to the
-/// specified by \a fvalue_type.
+/// The fill value is returned through \a value pointer
+/// and the memory is allocated by the caller. The fill
+/// value will be converted from its current data type to the
+/// specified by \a fvalue_type.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DSetCreatPropList::getFillValue( const DataType& fvalue_type, void* value ) const
@@ -221,13 +221,13 @@ void DSetCreatPropList::getFillValue( const DataType& fvalue_type, void* value )
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::isFillValueDefined
-///\brief Check if fill value has been defined for this property
+// Function: DSetCreatPropList::isFillValueDefined
+///\brief Check if fill value has been defined for this property
///\return
-/// \li \c H5D_FILL_VALUE_UNDEFINED =0,
-/// \li \c H5D_FILL_VALUE_DEFAULT =1,
-/// \li \c H5D_FILL_VALUE_USER_DEFINED =2
-///\exception H5::PropListIException
+/// \li \c H5D_FILL_VALUE_UNDEFINED =0,
+/// \li \c H5D_FILL_VALUE_DEFAULT =1,
+/// \li \c H5D_FILL_VALUE_USER_DEFINED =2
+///\exception H5::PropListIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5D_fill_value_t DSetCreatPropList::isFillValueDefined()
@@ -244,23 +244,23 @@ H5D_fill_value_t DSetCreatPropList::isFillValueDefined()
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::setFilter
-///\brief Adds a filter to the filter pipeline
-///\param filter_id - IN: Filter to add
-///\param flags - IN: Specifies general properties of the filter
-///\param cd_nelmts - IN: Number of elements in cd_values
-///\param cd_values - IN: Auxiliary data for the filter
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::setFilter
+///\brief Adds a filter to the filter pipeline
+///\param filter_id - IN: Filter to add
+///\param flags - IN: Specifies general properties of the filter
+///\param cd_nelmts - IN: Number of elements in cd_values
+///\param cd_values - IN: Auxiliary data for the filter
+///\exception H5::PropListIException
///\par Description
-/// The \a flags argument is a bit vector of the field:
-/// \c H5Z_FLAG_OPTIONAL(0x0001)
+/// The \a flags argument is a bit vector of the field:
+/// \c H5Z_FLAG_OPTIONAL(0x0001)
///\par
-/// If this bit is set then the filter is optional. If the filter
-/// fails during a \c DataSet::write() operation then the filter
-/// is just excluded from the pipeline for the chunk for which it
-/// failed; the filter will not participate in the pipeline
-/// during a \c DataSet::read() of the chunk. If this bit is clear
-/// and the filter fails then the entire I/O operation fails.
+/// If this bit is set then the filter is optional. If the filter
+/// fails during a \c DataSet::write() operation then the filter
+/// is just excluded from the pipeline for the chunk for which it
+/// failed; the filter will not participate in the pipeline
+/// during a \c DataSet::read() of the chunk. If this bit is clear
+/// and the filter fails then the entire I/O operation fails.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DSetCreatPropList::setFilter( H5Z_filter_t filter_id, unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[] ) const
@@ -274,13 +274,13 @@ void DSetCreatPropList::setFilter( H5Z_filter_t filter_id, unsigned int flags, s
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::removeFilter
-///\brief Removes one or more filters
-///\param filter_id - IN: Filter to remove
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::removeFilter
+///\brief Removes one or more filters
+///\param filter_id - IN: Filter to remove
+///\exception H5::PropListIException
///\par Description
-/// Deletes a filter from the dataset creation property list;
-/// deletes all filters if \a filter_id is \c H5Z_FILTER_NONE.
+/// Deletes a filter from the dataset creation property list;
+/// deletes all filters if \a filter_id is \c H5Z_FILTER_NONE.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DSetCreatPropList::removeFilter(H5Z_filter_t filter_id) const
@@ -294,10 +294,10 @@ void DSetCreatPropList::removeFilter(H5Z_filter_t filter_id) const
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::getNfilters
-///\brief Returns the number of filters in the pipeline
-///\return Number of filters
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::getNfilters
+///\brief Returns the number of filters in the pipeline
+///\return Number of filters
+///\exception H5::PropListIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
int DSetCreatPropList::getNfilters() const
@@ -313,28 +313,28 @@ 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
-/// 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
-/// 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
-///\param name - OUT: Name of the filter
-///\return Filter id
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::getFilter
+///\brief Returns information about a filter in a pipeline
+///\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
+/// 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
+///\param name - OUT: Name of the filter
+///\return Filter id
+///\exception H5::PropListIException
///\par Description
-/// Failure occurs when \a filter_number is out of range.
-// Programmer Binh-Minh Ribler - 2000
+/// Failure occurs when \a filter_number is out of range.
//--------------------------------------------------------------------------
-H5Z_filter_t DSetCreatPropList::getFilter( int filter_number, unsigned int& flags, size_t& cd_nelmts, unsigned int* cd_values, size_t namelen, char name[] ) const
+H5Z_filter_t DSetCreatPropList::getFilter(int filter_number, unsigned int &flags, size_t &cd_nelmts,
+ unsigned int* cd_values, size_t namelen, char name[] ) const
{
H5Z_filter_t filter_id;
- filter_id = H5Pget_filter(id, filter_number, &flags, &cd_nelmts,
+ filter_id = H5Pget_filter( id, filter_number, &flags, &cd_nelmts,
cd_values, namelen, name);
- if (filter_id == H5Z_FILTER_ERROR)
+ if( filter_id == H5Z_FILTER_ERROR )
{
throw PropListIException("DSetCreatPropList::getFilter",
"H5Pget_filter returned H5Z_FILTER_ERROR");
@@ -344,20 +344,21 @@ H5Z_filter_t DSetCreatPropList::getFilter( int filter_number, unsigned int& flag
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::getFilterById
-///\brief Returns information about a filter in a pipeline given the
-/// 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
-/// 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
-///\param name - OUT: Name of the filter
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::getFilterById
+///\brief Returns information about a filter in a pipeline given the
+/// 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
+/// 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
+///\param name - OUT: Name of the filter
+///\exception H5::PropListIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void DSetCreatPropList::getFilterById(H5Z_filter_t filter_id, unsigned int &flags, size_t &cd_nelmts, unsigned int* cd_values, size_t namelen, char name[]) const
+void DSetCreatPropList::getFilterById(H5Z_filter_t filter_id, unsigned int &flags, size_t &cd_nelmts,
+ unsigned int* cd_values, size_t namelen, char name[]) const
{
herr_t ret_value = H5Pget_filter_by_id(id, filter_id, &flags, &cd_nelmts,
cd_values, namelen, name );
@@ -369,24 +370,24 @@ void DSetCreatPropList::getFilterById(H5Z_filter_t filter_id, unsigned int &flag
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::modifyFilter
-///\brief Modifies the specified filter
-///\param filter_id - IN: Filter to get
-///\param flags - OUT: General properties of the filter
-///\param cd_nelmts - IN: Number of elements in \a cd_values
-/// \n OUT: Number of values defined by the filter
-///\param cd_values - OUT: Array to hold the data; allocated by the user
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::modifyFilter
+///\brief Modifies the specified filter
+///\param filter_id - IN: Filter to get
+///\param flags - OUT: General properties of the filter
+///\param cd_nelmts - IN: Number of elements in \a cd_values
+/// \n OUT: Number of values defined by the filter
+///\param cd_values - OUT: Array to hold the data; allocated by the user
+///\exception H5::PropListIException
///\par Description
-/// The \a flags argument is a bit vector of the field:
-/// \c H5Z_FLAG_OPTIONAL(0x0001)
+/// The \a flags argument is a bit vector of the field:
+/// \c H5Z_FLAG_OPTIONAL(0x0001)
///\par
-/// If this bit is set then the filter is optional. If the filter
-/// fails during a DataSet::write() operation then the filter
-/// is just excluded from the pipeline for the chunk for which it
-/// failed; the filter will not participate in the pipeline
-/// during a DataSet::read() of the chunk. If this bit is clear
-/// and the filter fails then the entire I/O operation fails.
+/// If this bit is set then the filter is optional. If the filter
+/// fails during a DataSet::write() operation then the filter
+/// is just excluded from the pipeline for the chunk for which it
+/// failed; the filter will not participate in the pipeline
+/// during a DataSet::read() of the chunk. If this bit is clear
+/// and the filter fails then the entire I/O operation fails.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DSetCreatPropList::modifyFilter( H5Z_filter_t filter_id, unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[] ) const
@@ -400,12 +401,12 @@ void DSetCreatPropList::modifyFilter( H5Z_filter_t filter_id, unsigned int flags
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::allFiltersAvail
-///\brief Queries whether all the filters set in this property list
-/// are available currently.
-///\return true if all filters available, and false if one or more
-/// filters not currently available
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::allFiltersAvail
+///\brief Queries whether all the filters set in this property list
+/// are available currently.
+///\return true if all filters available, and false if one or more
+/// filters not currently available
+///\exception H5::PropListIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
bool DSetCreatPropList::allFiltersAvail()
@@ -422,12 +423,12 @@ bool DSetCreatPropList::allFiltersAvail()
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::setShuffle
-///\brief Sets method of the shuffle filter
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::setShuffle
+///\brief Sets method of the shuffle filter
+///\exception H5::PropListIException
///\par Description
-/// Please refer to the Reference Manual of \c H5Pset_shuffle for
-/// details.
+/// Please refer to the Reference Manual of \c H5Pset_shuffle for
+/// details.
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetShuffle
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
@@ -442,17 +443,17 @@ void DSetCreatPropList::setShuffle()
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::getAllocTime
-///\brief Get space allocation time for this property.
-///\return Space allocation time.
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::getAllocTime
+///\brief Get space allocation time for this property.
+///\return Space allocation time.
+///\exception H5::PropListIException
///\par Description
-/// The values of space allocation time can be one of the
-/// followings:
-/// \li \c H5D_ALLOC_TIME_DEFAULT
-/// \li \c H5D_ALLOC_TIME_EARLY
-/// \li \c H5D_ALLOC_TIME_LATE
-/// \li \c H5D_ALLOC_TIME_INCR
+/// The values of space allocation time can be one of the
+/// followings:
+/// \li \c H5D_ALLOC_TIME_DEFAULT
+/// \li \c H5D_ALLOC_TIME_EARLY
+/// \li \c H5D_ALLOC_TIME_LATE
+/// \li \c H5D_ALLOC_TIME_INCR
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5D_alloc_time_t DSetCreatPropList::getAllocTime()
@@ -469,14 +470,14 @@ H5D_alloc_time_t DSetCreatPropList::getAllocTime()
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::getFillTime
-///\brief Gets fill value writing time.
-///\return Fill value writing time
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::getFillTime
+///\brief Gets fill value writing time.
+///\return Fill value writing time
+///\exception H5::PropListIException
///\par Description
-/// Valid values for fill value writing time include
-/// \li \c H5D_FILL_TIME_NEVER
-/// \li \c H5D_FILL_TIME_ALLOC.
+/// Valid values for fill value writing time include
+/// \li \c H5D_FILL_TIME_NEVER
+/// \li \c H5D_FILL_TIME_ALLOC.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
H5D_fill_time_t DSetCreatPropList::getFillTime()
@@ -493,16 +494,16 @@ H5D_fill_time_t DSetCreatPropList::getFillTime()
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::setAllocTime
-///\brief Sets space allocation time for dataset during creation.
-///\param alloc_time - IN: Allocation time
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::setAllocTime
+///\brief Sets space allocation time for dataset during creation.
+///\param alloc_time - IN: Allocation time
+///\exception H5::PropListIException
///\par Description
-/// Valid values for space allocation time include:
-/// \li \c H5D_ALLOC_TIME_DEFAULT
-/// \li \c H5D_ALLOC_TIME_EARLY
-/// \li \c H5D_ALLOC_TIME_LATE
-/// \li \c H5D_ALLOC_TIME_INCR
+/// Valid values for space allocation time include:
+/// \li \c H5D_ALLOC_TIME_DEFAULT
+/// \li \c H5D_ALLOC_TIME_EARLY
+/// \li \c H5D_ALLOC_TIME_LATE
+/// \li \c H5D_ALLOC_TIME_INCR
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DSetCreatPropList::setAllocTime(H5D_alloc_time_t alloc_time)
@@ -516,14 +517,14 @@ void DSetCreatPropList::setAllocTime(H5D_alloc_time_t alloc_time)
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::setFillTime
-///\brief Sets fill value writing time for dataset.
-///\return Fill value writing time
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::setFillTime
+///\brief Sets fill value writing time for dataset.
+///\return Fill value writing time
+///\exception H5::PropListIException
///\par Description
-/// Valid values for fill value writing time include
-/// \li \c H5D_FILL_TIME_NEVER
-/// \li \c H5D_FILL_TIME_ALLOC.
+/// Valid values for fill value writing time include
+/// \li \c H5D_FILL_TIME_NEVER
+/// \li \c H5D_FILL_TIME_ALLOC.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DSetCreatPropList::setFillTime(H5D_fill_time_t fill_time)
@@ -537,9 +538,9 @@ void DSetCreatPropList::setFillTime(H5D_fill_time_t fill_time)
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::setFletcher32
-///\brief Sets Fletcher32 checksum of EDC for this property list.
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::setFletcher32
+///\brief Sets Fletcher32 checksum of EDC for this property list.
+///\exception H5::PropListIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DSetCreatPropList::setFletcher32()
@@ -553,19 +554,19 @@ void DSetCreatPropList::setFletcher32()
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::setExternal
-///\brief Adds an external file to the list of external files
-///\param name - IN: Name of the external file
-///\param offset - IN: Location where the data starts in the file
-///\param size - IN: Number of bytes reserved in the file for the data
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::setExternal
+///\brief Adds an external file to the list of external files
+///\param name - IN: Name of the external file
+///\param offset - IN: Location where the data starts in the file
+///\param size - IN: Number of bytes reserved in the file for the data
+///\exception H5::PropListIException
///\par Description
-/// If a dataset is splitted across multiple files then the files
-/// should be defined in order. The total size of the dataset is
-/// the sum of the \a size arguments for all the external files. If
-/// the total size is larger than the size of a dataset then the
-/// dataset can be extended (provided the data space also allows
-/// the extending).
+/// If a dataset is splitted across multiple files then the files
+/// should be defined in order. The total size of the dataset is
+/// the sum of the \a size arguments for all the external files. If
+/// the total size is larger than the size of a dataset then the
+/// dataset can be extended (provided the data space also allows
+/// the extending).
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void DSetCreatPropList::setExternal( const char* name, off_t offset, hsize_t size ) const
@@ -579,10 +580,10 @@ void DSetCreatPropList::setExternal( const char* name, off_t offset, hsize_t siz
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::getExternalCount
-///\brief Returns the number of external files for a dataset
-///\return Number of external files
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::getExternalCount
+///\brief Returns the number of external files for a dataset
+///\return Number of external files
+///\exception H5::PropListIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
int DSetCreatPropList::getExternalCount() const
@@ -598,28 +599,28 @@ int DSetCreatPropList::getExternalCount() const
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList::getExternal
-///\brief Returns information about an external file
-///\param idx - IN: Index of the external file, ranges [0-(N-1)] and
-/// returned by getExternalCount()
-///\param name_size - IN: Maximum length of \a name
-///\param name - IN: Name of the external file
-///\param offset - IN: Location to return an offset value
-///\param size - OUT: Location to return the size of the external file data
-///\exception H5::PropListIException
+// Function: DSetCreatPropList::getExternal
+///\brief Returns information about an external file
+///\param idx - IN: Index of the external file, ranges [0-(N-1)] and
+/// returned by getExternalCount()
+///\param name_size - IN: Maximum length of \a name
+///\param name - IN: Name of the external file
+///\param offset - IN: Location to return an offset value
+///\param size - OUT: Location to return the size of the external file data
+///\exception H5::PropListIException
///\par Description
-/// The parameter \a idx ranges [0..N-1] where N is returned by
-/// getExternalCount(). At most \a name_size characters are copied
-/// into the name array. If the external file name is longer than
-/// name_size with the null terminator, the return value is not
-/// null terminated (similar to strncpy()).
-/// If \a name_size is zero or \a name is a null pointer, the
-/// external file name will not be returned. If \a offset or
-/// \a size are null pointers then the corresponding information
-/// will not be returned.
+/// The parameter \a idx ranges [0..N-1] where N is returned by
+/// getExternalCount(). At most \a name_size characters are copied
+/// into the name array. If the external file name is longer than
+/// name_size with the null terminator, the return value is not
+/// null terminated (similar to strncpy()).
+/// If \a name_size is zero or \a name is a null pointer, the
+/// external file name will not be returned. If \a offset or
+/// \a size are null pointers then the corresponding information
+/// will not be returned.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void DSetCreatPropList::getExternal( int idx, size_t name_size, char* name, off_t& offset, hsize_t& size ) const
+void DSetCreatPropList::getExternal( unsigned idx, size_t name_size, char* name, off_t& offset, hsize_t& size ) const
{
herr_t ret_value = H5Pget_external( id, idx, name_size, name, &offset, &size );
if( ret_value < 0 )
@@ -630,8 +631,8 @@ void DSetCreatPropList::getExternal( int idx, size_t name_size, char* name, off_
}
//--------------------------------------------------------------------------
-// Function: DSetCreatPropList destructor
-///\brief Noop destructor.
+// Function: DSetCreatPropList destructor
+///\brief Noop destructor.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
DSetCreatPropList::~DSetCreatPropList () {}
diff --git a/c++/src/H5DcreatProp.h b/c++/src/H5DcreatProp.h
index 69388ed..61fa860 100644
--- a/c++/src/H5DcreatProp.h
+++ b/c++/src/H5DcreatProp.h
@@ -42,7 +42,7 @@ class H5_DLLCPP DSetCreatPropList : public PropList {
void setChunk( int ndims, const hsize_t* dim ) const;
// Returns information about an external file.
- void getExternal( int idx, size_t name_size, char* name, off_t& offset, hsize_t& size ) const;
+ void getExternal( unsigned idx, size_t name_size, char* name, off_t& offset, hsize_t& size ) const;
// Returns the number of external files for a dataset.
int getExternalCount() const;
diff --git a/c++/src/H5DxferProp.h b/c++/src/H5DxferProp.h
index 7b29fe5..c3fbee4 100644
--- a/c++/src/H5DxferProp.h
+++ b/c++/src/H5DxferProp.h
@@ -22,7 +22,6 @@ namespace H5 {
class H5_DLLCPP DSetMemXferPropList : public PropList {
public:
- // Default dataset memory and transfer property list.
static const DSetMemXferPropList DEFAULT;
#ifdef H5_WANT_H5_V1_4_COMPAT
@@ -46,10 +45,10 @@ class H5_DLLCPP DSetMemXferPropList : public PropList {
size_t getBuffer( void** tconv, void** bkg ) const;
#endif /* H5_WANT_H5_V1_4_COMPAT */
- // Sets B-tree split ratios for a dataset transfer property list.
+ // Sets B-tree split ratios for a dataset transfer property list
void setBtreeRatios( double left, double middle, double right ) const;
- // Gets B-tree split ratios for a dataset transfer property list.
+ // Gets B-tree split ratios for a dataset transfer property list
void getBtreeRatios( double& left, double& middle, double& right ) const;
// Sets the dataset transfer property list status to TRUE or FALSE.
@@ -59,16 +58,16 @@ class H5_DLLCPP DSetMemXferPropList : public PropList {
bool getPreserve() const;
// Sets the memory manager for variable-length datatype
- // allocation in H5Dread and H5Dvlen_reclaim.
+ // allocation in H5Dread and H5Dvlen_reclaim
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
- // malloc and free are to be used.
+ // malloc and free are to be used
void setVlenMemManager() const;
// Gets the memory manager for variable-length datatype
- // allocation in H5Dread and H5Tvlen_reclaim.
+ // allocation in H5Dread and H5Tvlen_reclaim
void getVlenMemManager( H5MM_allocate_t& alloc, void** alloc_info,
H5MM_free_t& free, void** free_info ) const;
@@ -108,7 +107,7 @@ class H5_DLLCPP DSetMemXferPropList : public PropList {
// property list using the property list id.
DSetMemXferPropList (const hid_t plist_id);
- // Noop destructor.
+ // Noop destructor
virtual ~DSetMemXferPropList();
};
diff --git a/c++/src/H5EnumType.cpp b/c++/src/H5EnumType.cpp
index 0421707..f40ae06 100644
--- a/c++/src/H5EnumType.cpp
+++ b/c++/src/H5EnumType.cpp
@@ -256,7 +256,7 @@ int EnumType::getNmembers() const
///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void EnumType::getMemberValue( int memb_no, void *value ) const
+void EnumType::getMemberValue( unsigned memb_no, void *value ) const
{
// Call C routine H5Tget_member_value to get the datatype member's value
hid_t ret_value = H5Tget_member_value( id, memb_no, value );
diff --git a/c++/src/H5EnumType.h b/c++/src/H5EnumType.h
index 4cb6cbd..f88b337 100644
--- a/c++/src/H5EnumType.h
+++ b/c++/src/H5EnumType.h
@@ -41,7 +41,7 @@ class H5_DLLCPP EnumType : public DataType {
int getMemberIndex(const string& name) const;
// Returns the value of an enumeration datatype member
- void getMemberValue( int memb_no, void *value ) const;
+ void getMemberValue( unsigned memb_no, void *value ) const;
// Inserts a new member to this enumeration type.
void insert( const char* name, void *value ) const;
diff --git a/c++/src/H5FaccProp.cpp b/c++/src/H5FaccProp.cpp
index 8892e58..515e883 100644
--- a/c++/src/H5FaccProp.cpp
+++ b/c++/src/H5FaccProp.cpp
@@ -31,32 +31,32 @@ namespace H5 {
const FileAccPropList FileAccPropList::DEFAULT( H5P_DEFAULT );
//--------------------------------------------------------------------------
-// Function: FileAccPropList default constructor
-///\brief Default constructor: creates a file access property list.
-// Programmer: Binh-Minh Ribler - 2000
+// Function: Default Constructor
+///\brief Default constructor: creates a file access property list
+// Programmer: Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
FileAccPropList::FileAccPropList() : PropList( H5P_FILE_ACCESS ) {}
//--------------------------------------------------------------------------
-// Function: FileAccPropList copy constructor
-///\brief Copy constructor: makes a copy of the original FileAccPropList.
-/// FileAccPropList object
-// Programmer: Binh-Minh Ribler - 2000
+// Function: FileAccPropList copy constructor
+///\brief Copy Constructor: makes a copy of the original
+/// FileAccPropList object.
+// Programmer: Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
FileAccPropList::FileAccPropList(const FileAccPropList& orig) : PropList(orig) {}
//--------------------------------------------------------------------------
-// Function: FileAccPropList overloaded constructor
-///\brief Creates a file access property list using the id of an
-/// existing one.
+// Function: FileAccPropList overloaded constructor
+///\brief Creates a file access property list using the id of an
+/// existing one.
// Programmer: Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
FileAccPropList::FileAccPropList(const hid_t plist_id) : PropList(plist_id) {}
//--------------------------------------------------------------------------
-// Function: FileAccPropList::setStdio
-///\brief Modifies this property list to use the \c H5FD_STDIO driver.
-///\exception H5::PropListIException
+// Function: FileAccPropList::setStdio
+///\brief Modifies this property list to use the \c H5FD_STDIO driver.
+///\exception H5::PropListIException
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void FileAccPropList::setStdio() const
@@ -69,34 +69,35 @@ 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
-/// 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:
+// 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
+/// 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:
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-GetDriver
-///\exception H5::PropListIException
+///\exception H5::PropListIException
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
hid_t FileAccPropList::getDriver() const
{
- hid_t driver = H5Pget_driver( id );
+ hid_t driver = H5Pget_driver(id);
if (driver < 0)
{
throw PropListIException("FileAccPropList::getDriver", "H5Pget_driver failed");
}
- return( driver );
+ return(driver);
}
//--------------------------------------------------------------------------
-// Function: FileAccPropList::setDriver
+// Function: FileAccPropList::setDriver
///\brief Set file driver for this property list.
-///\param new_driver_id - IN: File driver
-///\param new_driver_info - IN: Struct containing the driver-specific properites
-///\exception H5::PropListIException
+///\param new_driver_id - IN: File driver
+///\param new_driver_info - IN: Struct containing the driver-specific properites
+///\exception H5::PropListIException
///\par Description
-/// For a list of valid driver identifiers, please refer to
+/// 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
//--------------------------------------------------------------------------
@@ -126,10 +127,10 @@ void FileAccPropList::setFamilyOffset(hsize_t offset) const
}
//--------------------------------------------------------------------------
-// Function: FileAccPropList::getFamilyOffset
+// Function: FileAccPropList::getFamilyOffset
///\brief Get offset for family driver.
-///\return Offset for family driver
-///\exception H5::PropListIException
+///\return Offset for family driver
+///\exception H5::PropListIException
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
hsize_t FileAccPropList::getFamilyOffset() const
@@ -151,7 +152,7 @@ hsize_t FileAccPropList::getFamilyOffset() const
/// time more memory is needed, in bytes
///\param backing_store - IN: Indicating whether to write the file
/// contents to disk when the file is closed
-///\exception H5::PropListIException
+///\exception H5::PropListIException
///\par Description
/// For more details on the use of \c H5FD_CORE driver, please
/// refer to
@@ -170,10 +171,10 @@ 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 increment - OUT: Size of memory increment, in bytes
///\param backing_store - OUT: Indicating whether to write the file
/// contents to disk when the file is closed
-///\exception H5::PropListIException
+///\exception H5::PropListIException
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void FileAccPropList::getCore (size_t& increment, hbool_t& backing_store) const
@@ -191,7 +192,7 @@ void FileAccPropList::getCore (size_t& increment, hbool_t& backing_store) const
///\param memb_size - IN: Size in bytes of each file member
///\param memb_plist - IN: File access property list to be used for
/// each family member
-///\exception H5::PropListIException
+///\exception H5::PropListIException
///\par Description
/// Note that \a memb_size is used only when creating a new file.
// Programmer: Binh-Minh Ribler - April, 2004
@@ -212,7 +213,7 @@ void FileAccPropList::setFamily( hsize_t memb_size, const FileAccPropList& memb_
///\param memb_size - OUT: Size in bytes of each file member
///\param memb_plist - OUT: Retrieved file access property list for each
/// file member
-///\exception H5::PropListIException
+///\exception H5::PropListIException
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void FileAccPropList::getFamily(hsize_t& memb_size, FileAccPropList& memb_plist) const
@@ -228,12 +229,12 @@ void FileAccPropList::getFamily(hsize_t& memb_size, FileAccPropList& memb_plist)
//--------------------------------------------------------------------------
// Function: FileAccPropList::getFamily
-///\brief This is an overloaded member function, provided for convenience.
+///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function only in what arguments it
/// accepts and its return value.
///\param memb_size - OUT: Size in bytes of each file member
///\return The file access property list for each file member
-///\exception H5::PropListIException
+///\exception H5::PropListIException
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
FileAccPropList FileAccPropList::getFamily(hsize_t& memb_size) const
@@ -256,7 +257,7 @@ FileAccPropList FileAccPropList::getFamily(hsize_t& memb_size) const
///\param raw_plist - IN: File access plist for the raw data file
///\param meta_ext - IN: Metadata filename extension as \c char*
///\param raw_ext - IN: Raw data filename extension as \c char*
-///\exception H5::PropListIException
+///\exception H5::PropListIException
///\par Description
/// Temporary - For information, please refer to:
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetFaplSplit
@@ -275,14 +276,14 @@ void FileAccPropList::setSplit( FileAccPropList& meta_plist, FileAccPropList& ra
//--------------------------------------------------------------------------
// Function: FileAccPropList::setSplit
-///\brief This is an overloaded member function, provided for convenience.
+///\brief This is an overloaded member function, provided for convenience.
/// It differs from the above function only in what arguments it
/// accepts.
///\param meta_plist - IN: File access plist for the metadata file
///\param raw_plist - IN: File access plist for the raw data file
///\param meta_ext - IN: Metadata filename extension as \c string
///\param raw_ext - IN: Raw data filename extension as \c string
-///\exception H5::PropListIException
+///\exception H5::PropListIException
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void FileAccPropList::setSplit( FileAccPropList& meta_plist, FileAccPropList& raw_plist, const string& meta_ext, const string& raw_ext ) const
@@ -297,7 +298,7 @@ void FileAccPropList::setSplit( FileAccPropList& meta_plist, FileAccPropList& ra
///\return The streaming I/O file access property list structure
/// For detail on this structure, please refer to
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetFaplStream
-///\exception H5::PropListIException
+///\exception H5::PropListIException
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
H5FD_stream_fapl_t FileAccPropList::getStream() const
@@ -316,7 +317,7 @@ H5FD_stream_fapl_t FileAccPropList::getStream() const
///\brief Modifies this file access property list to use the Stream
/// driver.
///\param fapl - IN: The streaming I/O file access property list
-///\exception H5::PropListIException
+///\exception H5::PropListIException
///\par Description
/// For detail on \a fapl, please refer to
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetFaplStream
@@ -337,7 +338,7 @@ void FileAccPropList::setStream(H5FD_stream_fapl_t &fapl) const
///\brief Returns the current settings for the data sieve buffer size
/// property from this property list.
///\return Data sieve buffer size, in bytes
-///\exception H5::PropListIException
+///\exception H5::PropListIException
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
size_t FileAccPropList::getSieveBufSize() const
@@ -355,7 +356,7 @@ size_t FileAccPropList::getSieveBufSize() const
// Function: FileAccPropList::setSieveBufSize
///\brief Sets the maximum size of the data sieve buffer.
///\param bufsize - IN: Maximum size, in bytes, of data sieve buffer
-///\exception H5::PropListIException
+///\exception H5::PropListIException
///\par Description
/// For detail on data sieving, please refer to
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetSieveBufSize
@@ -374,8 +375,8 @@ 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
-/// block allocations
-///\exception H5::PropListIException
+/// block allocations
+///\exception H5::PropListIException
///\par Description
/// For more detail, please see the C layer Reference Manual at:
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetMetaBlockSize
@@ -394,7 +395,7 @@ void FileAccPropList::setMetaBlockSize(hsize_t &block_size) const
// Function: FileAccPropList::getMetaBlockSize
///\brief Returns the current metadata block size setting.
///\return Metadata block size
-///\exception H5::PropListIException
+///\exception H5::PropListIException
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
hsize_t FileAccPropList::getMetaBlockSize() const
@@ -415,7 +416,7 @@ hsize_t FileAccPropList::getMetaBlockSize() const
///\param logfile - IN: Name of the log file
///\param flags - IN: Flags specifying the types of logging activity
///\param buf_size - IN: Size of the logging buffer
-///\exception H5::PropListIException
+///\exception H5::PropListIException
///\par Description
/// For detail on \a flags, please refer to
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetFaplStream
@@ -449,7 +450,7 @@ void FileAccPropList::setLog(const string& logfile, unsigned flags, size_t buf_s
// Function: FileAccPropList::setSec2
///\brief Modifies this file access property list to use the sec2
/// driver.
-///\exception H5::PropListIException
+///\exception H5::PropListIException
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void FileAccPropList::setSec2() const
@@ -466,7 +467,7 @@ void FileAccPropList::setSec2() const
///\brief Sets the alignment properties of this property list.
///\param threshold - IN: Threshold value for file object size
///\param alignment - IN: Alignment value
-///\exception H5::PropListIException
+///\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
@@ -475,6 +476,7 @@ void FileAccPropList::setSec2() const
///
/// For detail on \a setting alignment, please refer to
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetAlignment
+// Programmer: Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void FileAccPropList::setAlignment( hsize_t threshold, hsize_t alignment ) const
{
@@ -491,7 +493,8 @@ void FileAccPropList::setAlignment( hsize_t threshold, hsize_t alignment ) const
/// this property list.
///\param threshold - OUT: Retrieved threshold value for file object size
///\param alignment - OUT: Retrieved alignment value
-///\exception H5::PropListIException
+///\exception H5::PropListIException
+// Programmer: Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void FileAccPropList::getAlignment( hsize_t &threshold, hsize_t &alignment ) const
{
@@ -506,7 +509,7 @@ void FileAccPropList::getAlignment( hsize_t &threshold, hsize_t &alignment ) con
// Function: FileAccPropList::setMultiType
///\brief Sets data type for \c MULTI driver.
///\param dtype - IN: Type of data
-///\exception H5::PropListIException
+///\exception H5::PropListIException
///\par Description
/// More details and valid values for \a dtype can be found at:
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetMultiType
@@ -525,7 +528,7 @@ void FileAccPropList::setMultiType(H5FD_mem_t dtype) const
// Function: FileAccPropList::getMultiType
///\brief Returns the data type property for \c MULTI driver.
///\return The data type property
-///\exception H5::PropListIException
+///\exception H5::PropListIException
///\par Description
/// More details and possible returned values can be found at:
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-GetMultiType
@@ -601,6 +604,7 @@ void FileAccPropList::getCache( int& mdc_nelmts, int& rdcc_nelmts, size_t& rdcc_
/// 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
{
@@ -618,7 +622,8 @@ void FileAccPropList::setCache( int mdc_nelmts, size_t rdcc_nelmts, size_t rdcc_
///\param rdcc_nelmts - OUT: Number of elements in the raw data chunk cache
///\param rdcc_nbytes - OUT: Total size of the raw data chunk cache, in bytes
///\param rdcc_w0 - OUT: Preemption policy
-///\exception H5::PropListIException
+///\exception H5::PropListIException
+// Programmer: Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void FileAccPropList::getCache( int& mdc_nelmts, size_t& rdcc_nelmts, size_t& rdcc_nbytes, double& rdcc_w0 ) const
{
@@ -634,7 +639,7 @@ void FileAccPropList::getCache( int& mdc_nelmts, size_t& rdcc_nelmts, size_t& rd
// Function: FileAccPropList::setFcloseDegree
///\brief Sets the degree for the file close behavior.
///\param degree - IN:
-///\exception H5::PropListIException
+///\exception H5::PropListIException
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
void FileAccPropList::setFcloseDegree(H5F_close_degree_t degree)
@@ -650,7 +655,7 @@ void FileAccPropList::setFcloseDegree(H5F_close_degree_t degree)
// Function: FileAccPropList::getFcloseDegree
///\brief Returns the degree for the file close behavior.
///\return The degree for the file close behavior
-///\exception H5::PropListIException
+///\exception H5::PropListIException
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
H5F_close_degree_t FileAccPropList::getFcloseDegree()
@@ -669,10 +674,11 @@ H5F_close_degree_t FileAccPropList::getFcloseDegree()
///\brief Sets garbage collecting references flag.
///\param gc_ref - IN: Flag setting reference garbage collection to
/// on (1) or off (0).
-///\exception H5::PropListIException
+///\exception H5::PropListIException
///\par Description
/// For detail on \a fapl, please refer to
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetFaplStream
+// Programmer: Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void FileAccPropList::setGcReferences( unsigned gc_ref ) const
{
@@ -687,7 +693,8 @@ void FileAccPropList::setGcReferences( unsigned gc_ref ) const
// Function: FileAccPropList::getGcReferences
///\brief Returns the garbage collecting references setting.
///\return Garbage collecting references setting, 0 (off) or 1 (on)
-///\exception H5::PropListIException
+///\exception H5::PropListIException
+// Programmer: Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
unsigned FileAccPropList::getGcReferences() const
{
@@ -703,9 +710,9 @@ unsigned FileAccPropList::getGcReferences() const
}
//--------------------------------------------------------------------------
-// Function: FileAccPropList destructor
+// Function: FileAccPropList destructor
///\brief Noop destructor
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
FileAccPropList::~FileAccPropList() {}
diff --git a/c++/src/H5FaccProp.h b/c++/src/H5FaccProp.h
index 8b014ce..6a447b0 100644
--- a/c++/src/H5FaccProp.h
+++ b/c++/src/H5FaccProp.h
@@ -129,7 +129,7 @@ class H5_DLLCPP FileAccPropList : public PropList {
// using the property list id.
FileAccPropList (const hid_t plist_id);
- // Default destructor
+ // Noop destructor
virtual ~FileAccPropList();
};
#ifndef H5_NO_NAMESPACE
diff --git a/c++/src/H5FcreatProp.cpp b/c++/src/H5FcreatProp.cpp
index cd79b93..ff8eb47 100644
--- a/c++/src/H5FcreatProp.cpp
+++ b/c++/src/H5FcreatProp.cpp
@@ -26,48 +26,48 @@ namespace H5 {
#endif
//--------------------------------------------------------------------------
-///\brief Constant for default property
+///\brief Constant for default property
//--------------------------------------------------------------------------
const FileCreatPropList FileCreatPropList::DEFAULT( H5P_DEFAULT );
//--------------------------------------------------------------------------
-// Function: FileCreatPropList default constructor
-///\brief Default constructor: creates a file creation property list.
-// Programmer Binh-Minh Ribler - 2000
+// Function: FileCreatPropList default constructor
+///\brief Default constructor: Creates a file create property list
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
FileCreatPropList::FileCreatPropList() : PropList( H5P_FILE_CREATE ) {}
//--------------------------------------------------------------------------
-// Function: FileCreatPropList overloaded constructor
-///\brief Creates a file creation property list using the id of an
-/// existing one.
-///\param plist_id - IN: FileCreatPropList id to use
-// Programmer Binh-Minh Ribler - 2000
+// Function: FileCreatPropList copy constructor
+///\brief Copy constructor: makes a copy of the original
+/// FileCreatPropList object.
+///\param original - IN: FileCreatPropList instance to copy
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-FileCreatPropList::FileCreatPropList(const hid_t plist_id) : PropList(plist_id) {}
+FileCreatPropList::FileCreatPropList( const FileCreatPropList& original ) : PropList( original ) {}
//--------------------------------------------------------------------------
-// Function: FileCreatPropList copy constructor
-///\brief Copy constructor: makes a copy of the original FileCreatPropList object.
-///\param original - IN: FileCreatPropList instance to copy
-// Programmer Binh-Minh Ribler - 2000
+// Function: FileCreatPropList overloaded constructor
+///\brief Creates a file creation property list using the id of an
+/// existing one.
+///\param plist_id - IN: FileCreatPropList id to use
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-FileCreatPropList::FileCreatPropList(const FileCreatPropList& original) : PropList(original) {}
+FileCreatPropList::FileCreatPropList(const hid_t plist_id) : PropList(plist_id) {}
//--------------------------------------------------------------------------
-// Function: FileCreatPropList::getVersion
-///\brief Retrieves version information for various parts of a file.
-///\param super - OUT: The file super block.
-///\param freelist - OUT: The global free list.
-///\param stab - OUT: The root symbol table entry.
-///\param shhdr - OUT: Shared object headers.
-///\exception H5::PropListIException
+// Function: FileCreatPropList::getVersion
+///\brief Retrieves version information for various parts of a file.
+///\param super - OUT: The file super block.
+///\param freelist - OUT: The global free list.
+///\param stab - OUT: The root symbol table entry.
+///\param shhdr - OUT: Shared object headers.
+///\exception H5::PropListIException
///\par Description
-/// Any (or even all) of the output arguments can be null pointers.
-// Programmer Binh-Minh Ribler - 2000
+/// Any (or even all) of the output arguments can be null pointers.
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void FileCreatPropList::getVersion(
- int& super, int& freelist, int& stab, int& shhdr ) const
+void FileCreatPropList::getVersion(unsigned& super, unsigned& freelist, unsigned& stab, unsigned& shhdr) const
{
herr_t ret_value = H5Pget_version( id, &super, &freelist, &stab, &shhdr );
if( ret_value < 0 )
@@ -78,14 +78,14 @@ void FileCreatPropList::getVersion(
}
//--------------------------------------------------------------------------
-// Function: FileCreatPropList::setUserblock
-///\brief Sets the user block size field of this file creation property list.
-///\param size - IN: User block size to be set, in bytes
-///\exception H5::PropListIException
+// Function: FileCreatPropList::setUserblock
+///\brief Sets the user block size field of this file creation property list.
+///\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
-/// of 2 equal to 512 or greater (512, 1024, 2048, etc.)
-// Programmer Binh-Minh Ribler - 2000
+/// 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
//--------------------------------------------------------------------------
void FileCreatPropList::setUserblock( hsize_t size ) const
{
@@ -98,11 +98,11 @@ void FileCreatPropList::setUserblock( hsize_t size ) const
}
//--------------------------------------------------------------------------
-// Function: FileCreatPropList::getUserblock
-///\brief Returns the user block size of this file creation property list.
-///\return User block size
-///\exception H5::PropListIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: FileCreatPropList::getUserblock
+///\brief Returns the user block size of this file creation property list.
+///\return User block size
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
hsize_t FileCreatPropList::getUserblock() const
{
@@ -117,17 +117,17 @@ hsize_t FileCreatPropList::getUserblock() const
}
//--------------------------------------------------------------------------
-// Function: FileCreatPropList::setSizes
-///\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.
-///\exception H5::PropListIException
+// Function: FileCreatPropList::setSizes
+///\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.
+///\exception H5::PropListIException
///\par Description
-/// For information on setting sizes, please refer to the
-/// C layer Reference Manual at:
+/// For information on setting sizes, please refer to the
+/// C layer Reference Manual at:
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetSizes
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void FileCreatPropList::setSizes( size_t sizeof_addr, size_t sizeof_size ) const
{
@@ -140,11 +140,11 @@ void FileCreatPropList::setSizes( size_t sizeof_addr, size_t sizeof_size ) const
}
//--------------------------------------------------------------------------
-// Function: FileCreatPropList::getSizes
-///\brief Retrieves the size of the offsets and lengths used in an
-/// HDF5 file.
-///\exception H5::PropListIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: FileCreatPropList::getSizes
+///\brief Retrieves the size of the offsets and lengths used in an
+/// HDF5 file.
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void FileCreatPropList::getSizes( size_t& sizeof_addr, size_t& sizeof_size ) const
{
@@ -200,18 +200,18 @@ void FileCreatPropList::getSymk( int& ik, int& lk ) const
}
#else /* H5_WANT_H5_V1_4_COMPAT */
//--------------------------------------------------------------------------
-// Function: FileCreatPropList::setSymk
-///\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
-///\exception H5::PropListIException
+// Function: FileCreatPropList::setSymk
+///\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
+///\exception H5::PropListIException
///\par Description
-/// For information, please see the C layer Reference Manual at:
+/// For information, please see the C layer Reference Manual at:
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetSymK
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void FileCreatPropList::setSymk( int ik, unsigned lk ) const
+void FileCreatPropList::setSymk( unsigned ik, unsigned lk ) const
{
herr_t ret_value = H5Pset_sym_k( id, ik, lk );
if( ret_value < 0 )
@@ -222,16 +222,16 @@ void FileCreatPropList::setSymk( int ik, unsigned lk ) const
}
//--------------------------------------------------------------------------
-// Function: FileCreatPropList::getSymk
-///\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
+// Function: FileCreatPropList::getSymk
+///\brief Retrieves the size of the symbol table B-tree 1/2 rank and
+/// the symbol table leaf node 1/2 size.
+///\exception H5::PropListIException
///\par Description
-/// For information, please see
+/// For information, please see
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetSymK
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void FileCreatPropList::getSymk( int& ik, unsigned& lk ) const
+void FileCreatPropList::getSymk( unsigned& ik, unsigned& lk ) const
{
herr_t ret_value = H5Pget_sym_k( id, &ik, &lk );
if( ret_value < 0 )
@@ -243,17 +243,17 @@ void FileCreatPropList::getSymk( int& ik, unsigned& lk ) const
#endif /* H5_WANT_H5_V1_4_COMPAT */
//--------------------------------------------------------------------------
-// Function: FileCreatPropList::setIstorek
-///\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
+// Function: FileCreatPropList::setIstorek
+///\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
///\par Description
-/// For information, please see the C layer Reference Manual at:
+/// For information, please see the C layer Reference Manual at:
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetIstoreK
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-void FileCreatPropList::setIstorek( int ik ) const
+void FileCreatPropList::setIstorek( unsigned ik ) const
{
herr_t ret_value = H5Pset_istore_k( id, ik );
if( ret_value < 0 )
@@ -262,19 +262,20 @@ void FileCreatPropList::setIstorek( int ik ) const
"H5Pset_istore_k failed");
}
}
+
//--------------------------------------------------------------------------
-// Function: FileCreatPropList::getIstorek
-///\brief Returns the 1/2 rank of an indexed storage B-tree.
-///\return 1/2 rank of chunked storage B-tree
-///\exception H5::PropListIException
+// Function: FileCreatPropList::getIstorek
+///\brief Returns the 1/2 rank of an indexed storage B-tree.
+///\return 1/2 rank of chunked storage B-tree
+///\exception H5::PropListIException
///\par Description
-/// For information, please see
+/// For information, please see
/// http://hdf.ncsa.uiuc.edu/HDF5/doc/RM_H5P.html#Property-SetIstoreK
-// Programmer Binh-Minh Ribler - 2000
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-int FileCreatPropList::getIstorek() const
+unsigned FileCreatPropList::getIstorek() const
{
- int ik;
+ unsigned ik;
herr_t ret_value = H5Pget_istore_k( id, &ik );
if( ret_value < 0 )
{
diff --git a/c++/src/H5FcreatProp.h b/c++/src/H5FcreatProp.h
index 493e28e..66678e2 100644
--- a/c++/src/H5FcreatProp.h
+++ b/c++/src/H5FcreatProp.h
@@ -26,15 +26,14 @@ class H5_DLLCPP FileCreatPropList : public PropList {
// Default file creation property list.
static const FileCreatPropList DEFAULT;
- // Creates a file creation property list.
- FileCreatPropList();
+ // Retrieves version information for various parts of a file.
+ void getVersion( unsigned& super, unsigned& freelist, unsigned& stab, unsigned& shhdr ) const;
- // Returns the 1/2 rank of an indexed storage B-tree.
- int getIstorek() const;
+ // Sets the userblock size field of a file creation property list.
+ void setUserblock( hsize_t size ) const;
- // Sets the size of parameter used to control the B-trees for
- // indexing chunked datasets.
- void setIstorek( int ik ) const;
+ // 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
// file according to this file creation property list.
@@ -53,29 +52,30 @@ class H5_DLLCPP FileCreatPropList : public PropList {
#else /* H5_WANT_H5_V1_4_COMPAT */
// Retrieves the size of the symbol table B-tree 1/2 rank and the
// symbol table leaf node 1/2 size.
- void getSymk( int& int_nodes_k, unsigned& leaf_nodes_k ) const;
+ void getSymk( unsigned& int_nodes_k, unsigned& leaf_nodes_k ) const;
// Sets the size of parameters used to control the symbol table nodes.
- void setSymk( int int_nodes_k, unsigned leaf_nodes_k ) const;
+ void setSymk( unsigned int_nodes_k, unsigned leaf_nodes_k ) const;
#endif /* H5_WANT_H5_V1_4_COMPAT */
- // Gets the size of a user block in this file creation property list.
- hsize_t getUserblock() const;
+ // Returns the 1/2 rank of an indexed storage B-tree.
+ unsigned getIstorek() const;
- // Sets the userblock size field of a file creation property list.
- void setUserblock( hsize_t size ) const;
+ // Sets the size of parameter used to control the B-trees for
+ // indexing chunked datasets.
+ void setIstorek( unsigned ik ) const;
- // Retrieves version information for various parts of a file.
- void getVersion( int& boot, int& freelist, int& stab, int& shhdr ) const;
+ // Creates a file create property list.
+ FileCreatPropList();
- // Copy constructor: creates a copy of a FileCreatPropList object
+ // Copy constructor: creates a copy of a FileCreatPropList object.
FileCreatPropList(const FileCreatPropList& orig);
// Creates a copy of an existing file create property list
- // using the property list id
+ // using the property list id.
FileCreatPropList (const hid_t plist_id);
- // Noop destructor.
+ // Noop destructor
virtual ~FileCreatPropList();
};
#ifndef H5_NO_NAMESPACE
diff --git a/c++/src/H5Group.cpp b/c++/src/H5Group.cpp
index dd03df1..32a4478 100644
--- a/c++/src/H5Group.cpp
+++ b/c++/src/H5Group.cpp
@@ -1,7 +1,7 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
+ * All rights reserved. *
+ * *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
diff --git a/c++/src/H5IdComponent.cpp b/c++/src/H5IdComponent.cpp
index 0508657..f7f8573 100644
--- a/c++/src/H5IdComponent.cpp
+++ b/c++/src/H5IdComponent.cpp
@@ -1,7 +1,7 @@
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
+ * All rights reserved. *
+ * *
* This file is part of HDF5. The full HDF5 copyright notice, including *
* terms governing use, modification, and redistribution, is contained in *
* the files COPYING and Copyright.html. COPYING can be found at the root *
@@ -53,14 +53,14 @@ IdComponent::IdComponent( const IdComponent& original )
//--------------------------------------------------------------------------
// Function: IdComponent::incRefCount
-///\brief Increments id reference counter.
+///\brief Increment id reference counter.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void IdComponent::incRefCount() { ref_count->increment(); }
//--------------------------------------------------------------------------
// Function: IdComponent::decRefCount
-///\brief Decrements id reference counter.
+///\brief Decrement id reference counter.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void IdComponent::decRefCount() { ref_count->decrement(); }
@@ -68,7 +68,7 @@ void IdComponent::decRefCount() { ref_count->decrement(); }
//--------------------------------------------------------------------------
// Function: IdComponent::getCounter
///\brief Returns the reference counter to this identifier.
-///\return Reference count
+///\return Reference count
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
int IdComponent::getCounter() { return( ref_count->getCounter()); }
@@ -94,9 +94,9 @@ bool IdComponent::noReference()
// Function: IdComponent::operator=
///\brief Assignment operator.
///\param rhs - IN: Reference to the existing object
-///\return Reference to IdComponent instance
+///\return Reference to IdComponent instance
///\exception H5::IdComponentException when attempt to close the HDF5
-/// object fails
+/// object fails
// Description
// Reset the identifier of this object so that the HDF5 id can
// be properly closed. Copy the id from rhs to this object,
@@ -147,6 +147,7 @@ void IdComponent::setId( hid_t new_id )
throw IdComponentException("IdComponent::setId", close_error.getDetailMsg());
}
+ // reset object's id to the given id
id = new_id;
// starts counting object references
@@ -155,8 +156,8 @@ void IdComponent::setId( hid_t new_id )
//--------------------------------------------------------------------------
// Function: IdComponent::getId
-///\brief Returns the id of this object.
-///\return HDF5 object id
+///\brief Returns the id of this object
+///\return HDF5 id
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
hid_t IdComponent::getId () const
@@ -269,7 +270,7 @@ void* IdComponent::p_reference(const char* name, hid_t space_id, H5R_type_t ref_
if (ret_value < 0)
{
throw IdComponentException("IdComponent::p_reference",
- "H5Rcreate failed");
+ "H5Rcreate failed");
}
return(ref);
}
@@ -294,7 +295,7 @@ H5G_obj_t IdComponent::p_get_obj_type(void *ref, H5R_type_t ref_type) const
if (obj_type == H5G_UNKNOWN)
{
throw IdComponentException("IdComponent::p_get_obj_type",
- "H5R_get_obj_type failed");
+ "H5R_get_obj_type failed");
}
return(obj_type);
}
@@ -316,7 +317,7 @@ hid_t IdComponent::p_get_region(void *ref, H5R_type_t ref_type) const
if (space_id < 0)
{
throw IdComponentException("IdComponent::p_get_region",
- "H5Rget_region failed");
+ "H5Rget_region failed");
}
return(space_id);
}
diff --git a/c++/src/H5IdComponent.h b/c++/src/H5IdComponent.h
index 5c84990..c01cd08 100644
--- a/c++/src/H5IdComponent.h
+++ b/c++/src/H5IdComponent.h
@@ -25,13 +25,13 @@ namespace H5 {
class H5_DLLCPP IdComponent {
public:
- // Increment reference counter
+ // Increment reference counter.
void incRefCount();
- // Decrement reference counter
+ // Decrement reference counter.
void decRefCount();
- // Get the reference counter to this identifier
+ // Get the reference counter to this identifier.
int getCounter();
// Decrements the reference counter then determines if there are no more
@@ -46,13 +46,13 @@ class H5_DLLCPP IdComponent {
// Sets the identifier of this object to a new value.
void setId( hid_t new_id );
- // Creates an object to hold an HDF5 identifier
+ // Creates an object to hold an HDF5 identifier.
IdComponent( const hid_t h5_id );
// Copy constructor: makes copy of the original IdComponent object.
IdComponent( const IdComponent& original );
- // Gets the value of IdComponent's data member
+ // Gets the value of IdComponent's data member.
virtual hid_t getId () const;
// Pure virtual function so appropriate close function can
diff --git a/c++/src/H5Library.h b/c++/src/H5Library.h
index 404fda6..4208cfb 100644
--- a/c++/src/H5Library.h
+++ b/c++/src/H5Library.h
@@ -22,11 +22,11 @@ namespace H5 {
#ifndef DOXYGEN_SHOULD_SKIP_THIS
#define NOTATEXIT (-10) // just in case the HDF5 library use more
-#endif // DOXYGEN_SHOULD_SKIP_THIS
// negative constants. Note: the solution used for the atexit/global
// 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
class H5_DLLCPP H5Library {
public:
diff --git a/c++/src/H5PredType.h b/c++/src/H5PredType.h
index b51aca0..d75cdcc 100644
--- a/c++/src/H5PredType.h
+++ b/c++/src/H5PredType.h
@@ -34,7 +34,7 @@ class H5_DLLCPP PredType : public AtomType {
// Returns the HDF5 predefined type id.
virtual hid_t getId() const;
- // Default destructor
+ // Noop destructor
virtual ~PredType();
// Declaration of predefined types; their definition is in H5PredType.cpp
diff --git a/c++/src/H5PropList.cpp b/c++/src/H5PropList.cpp
index 065e77a..02c1bde 100644
--- a/c++/src/H5PropList.cpp
+++ b/c++/src/H5PropList.cpp
@@ -36,32 +36,32 @@ namespace H5 {
const PropList PropList::DEFAULT( H5P_DEFAULT );
//--------------------------------------------------------------------------
-// Function Default constructor
-///\brief Default constructor: creates a stub property list object.
+// Function Default constructor
+///\brief Default constructor: creates a stub property list object.
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
-PropList::PropList() : IdComponent(0) {}
+PropList::PropList() : IdComponent( 0 ) {}
//--------------------------------------------------------------------------
-// Function: PropList copy constructor
-///\brief Copy constructor
-///\param original - IN: The original property list to copy
+// Function: PropList copy constructor
+///\brief Copy constructor
+///\param original - IN: The original property list to copy
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
PropList::PropList( const PropList& original ) : IdComponent( original ) {}
//--------------------------------------------------------------------------
-// Function: PropList overloaded constructor
-///\brief Creates a property list using the id of an existing property.
-///\param plist_id - IN: Id of the existing property list
-///\exception H5::PropListIException
+// Function: PropList overloaded constructor
+///\brief Creates a property list using the id of an existing property.
+///\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
-// description was what I came up with from reading the code.
+// 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
//--------------------------------------------------------------------------
PropList::PropList( const hid_t plist_id ) : IdComponent(0)
@@ -83,10 +83,10 @@ PropList::PropList( const hid_t plist_id ) : IdComponent(0)
}
//--------------------------------------------------------------------------
-// Function: PropList::copy
-///\brief Makes a copy of an existing property list
-///\param like_plist - IN: Reference to the existing property list
-///\exception H5::PropListIException
+// Function: PropList::copy
+///\brief Makes a copy of an existing property list.
+///\param like_plist - IN: Reference to the existing property list
+///\exception H5::PropListIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void PropList::copy( const PropList& like_plist )
@@ -106,9 +106,7 @@ void PropList::copy( const PropList& like_plist )
ref_count = new RefCounter;
if( id <= 0 )
- {
throw PropListIException("PropList::copy", "H5Pcopy failed");
- }
}
//--------------------------------------------------------------------------
@@ -118,8 +116,8 @@ 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
-// and stores the new id in the left hand side object.
+// 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
//--------------------------------------------------------------------------
PropList& PropList::operator=( const PropList& rhs )
@@ -129,12 +127,12 @@ PropList& PropList::operator=( const PropList& rhs )
}
//--------------------------------------------------------------------------
-// Function: PropList::copyProp
-///\brief Copies a property from one list or class to another.
-///\param dest - IN: Destination property list or class
-///\param src - IN: Source property list or class
-///\param name - IN: Name of the property to copy - \c char pointer
-///\exception H5::PropListIException
+// Function: PropList::copyProp
+///\brief Copies a property from one list or class to another
+///\param dest - IN: Destination property list or class
+///\param src - IN: Source property list or class
+///\param name - IN: Name of the property to copy - \c char pointer
+///\exception H5::PropListIException
// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
void PropList::copyProp( PropList& dest, PropList& src, const char *name ) const
@@ -146,7 +144,9 @@ void PropList::copyProp( PropList& dest, PropList& src, const char *name ) const
{
throw PropListIException("PropList::copyProp", "H5Pcopy_prop failed");
}
+
}
+
//--------------------------------------------------------------------------
// Function: PropList::copyProp
///\brief This is an overloaded member function, provided for convenience.
@@ -187,11 +187,11 @@ void PropList::p_close() const
#endif // DOXYGEN_SHOULD_SKIP_THIS
//--------------------------------------------------------------------------
-// Function: PropList::getClass
-///\brief Returns the class of this property list, i.e. \c H5P_FILE_CREATE...
-///\return The property list class if it is not equal to \c H5P_NO_CLASS
-///\exception H5::PropListIException
-// Programmer: Binh-Minh Ribler - April, 2004
+// Function: PropList::getClass
+///\brief Returns the class of this property list, i.e. \c H5P_FILE_CREATE...
+///\return The property list class if it is not equal to \c H5P_NO_CLASS
+///\exception H5::PropListIException
+// Programmer Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
hid_t PropList::getClass() const
{
@@ -249,7 +249,7 @@ bool PropList::propExist(const string& name ) const
///\brief Close a property list class.
///\exception H5::PropListIException
///\par Description
-/// Releases memory and de-attaches a class from the property
+/// Releases memory and detaches a class from the property
/// list class hierarchy.
// Programmer: Binh-Minh Ribler - April, 2004
//--------------------------------------------------------------------------
@@ -269,8 +269,9 @@ 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 throw an exception.
+/// 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
//--------------------------------------------------------------------------
void PropList::getProperty(const char* name, void* value) const
@@ -373,7 +374,7 @@ size_t PropList::getPropSize(const string& name) const
//--------------------------------------------------------------------------
// Function: PropList::getClassName
-///\brief Return the name of a generic property list class
+///\brief Return the name of a generic property list class.
///\return A string containing the class name, if success, otherwise,
/// a NULL string.
// Programmer: Binh-Minh Ribler - April, 2004
diff --git a/c++/src/H5PropList.h b/c++/src/H5PropList.h
index 557a39b..b8fa735 100644
--- a/c++/src/H5PropList.h
+++ b/c++/src/H5PropList.h
@@ -25,6 +25,10 @@ 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
+ // existing property list giving the property list id.
+ PropList(const hid_t plist_id);
+
// Make a copy of the given property list using assignment statement
PropList& operator=( const PropList& rhs );
@@ -85,10 +89,6 @@ class H5_DLLCPP PropList : public IdComponent {
// Default constructor: creates a stub PropList object.
PropList();
- // 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);
-
// Copy constructor: creates a copy of a PropList object.
PropList(const PropList& original);
diff --git a/c++/src/H5StrType.cpp b/c++/src/H5StrType.cpp
index d213841..4d30be1 100644
--- a/c++/src/H5StrType.cpp
+++ b/c++/src/H5StrType.cpp
@@ -106,11 +106,11 @@ StrType::StrType( const hid_t existing_id ) : AtomType( existing_id ) {}
StrType::StrType( const StrType& original ) : AtomType ( original ) {}
//--------------------------------------------------------------------------
-// Function: EnumType overloaded constructor
-///\brief Gets the string datatype of the specified dataset
-///\param dataset - IN: Dataset that this string datatype associates with
-///\exception H5::DataTypeIException
-// Programmer Binh-Minh Ribler - 2000
+// Function: EnumType overloaded constructor
+///\brief Gets the string datatype of the specified dataset
+///\param dataset - IN: Dataset that this string datatype associates with
+///\exception H5::DataTypeIException
+// Programmer Binh-Minh Ribler - 2000
//--------------------------------------------------------------------------
StrType::StrType( const DataSet& dataset ) : AtomType ()
{
diff --git a/c++/src/H5VarLenType.cpp b/c++/src/H5VarLenType.cpp
index 882dccc..9cb3bac 100644
--- a/c++/src/H5VarLenType.cpp
+++ b/c++/src/H5VarLenType.cpp
@@ -37,10 +37,10 @@ namespace H5 {
VarLenType::VarLenType() : DataType() {}
//--------------------------------------------------------------------------
-// Function: VarLenType overloaded constructor
-///\brief Creates an VarLenType object using an existing id.
-///\param existing_id - IN: Id of an existing datatype
-///\exception H5::DataTypeIException
+// Function: VarLenType overloaded constructor
+///\brief Creates an VarLenType object using an existing id.
+///\param existing_id - IN: Id of an existing datatype
+///\exception H5::DataTypeIException
// Programmer Binh-Minh Ribler - May, 2004
//--------------------------------------------------------------------------
VarLenType::VarLenType(const hid_t existing_id) : DataType(existing_id) {}
@@ -57,7 +57,7 @@ VarLenType::VarLenType(const VarLenType& original) : DataType(original) {}
///\brief Creates a new variable-length datatype based on the specified
/// \a base_type.
///\param base_type - IN: Pointer to existing datatype
-///\exception H5::DataTypeIException
+///\exception H5::DataTypeIException
// Description
// DataType passed by pointer to avoid clashing with copy
// constructor.
diff --git a/c++/src/H5VarLenType.h b/c++/src/H5VarLenType.h
index 8a2572b..c31946a 100644
--- a/c++/src/H5VarLenType.h
+++ b/c++/src/H5VarLenType.h
@@ -28,10 +28,10 @@ class H5_DLLCPP VarLenType : public DataType {
// on the specified base type.
VarLenType(const DataType* base_type);
- // Copy constructor - makes copy of the original object
+ // Copy constructor: makes copy of the original object.
VarLenType( const VarLenType& original );
- // Default destructor
+ // Noop destructor
virtual ~VarLenType();
protected:
diff --git a/c++/src/h5c++.in b/c++/src/h5c++.in
index 21e07fa..e9e1b86 100755
--- a/c++/src/h5c++.in
+++ b/c++/src/h5c++.in
@@ -27,6 +27,7 @@ prefix="@prefix@"
exec_prefix="@exec_prefix@"
libdir="@libdir@"
includedir="@includedir@"
+HL="@HL@"
############################################################################
## ##
@@ -54,7 +55,6 @@ get_output_file="no"
SHOW="eval"
CXXBASE="@CXX@"
CXXLINKERBASE="@CXX@"
-CFLAGS="@CFLAGS@"
CXXFLAGS="@CXXFLAGS@"
CPPFLAGS="@CPPFLAGS@"
LDFLAGS="@LDFLAGS@"
@@ -229,7 +229,7 @@ if test "x$do_compile" = "xyes"; then
compile_args="-c $compile_args"
fi
- $SHOW $CXX -I$includedir $CPPFLAGS $CXXFLAGS $CFLAGS $compile_args
+ $SHOW $CXX -I$includedir $CPPFLAGS $CXXFLAGS $compile_args
status=$?
if test "$status" != "0"; then
@@ -238,8 +238,13 @@ if test "x$do_compile" = "xyes"; then
fi
if test "x$do_link" = "xyes"; then
- link_args="$link_args ${libdir}/libhdf5_cpp.a ${libdir}/libhdf5.a $LIBS"
- $SHOW $CXXLINKER -I$includedir $CPPFLAGS $CXXFLAGS $CFLAGS $LDFLAGS $clibpath $link_objs $link_args
+ # conditionnaly link with the hl library
+ if test "X$HL" = "Xhl"; then
+ link_args="$link_args ${libdir}/libhdf5_cpp.a ${libdir}/libhdf5.a ${libdir}/libhdf5_hl.a $LIBS"
+ else
+ link_args="$link_args ${libdir}/libhdf5_cpp.a ${libdir}/libhdf5.a $LIBS"
+ fi
+ $SHOW $CXXLINKER -I$includedir $CPPFLAGS $CXXFLAGS $LDFLAGS $clibpath $link_objs $link_args
status=$?
fi
diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp
index 97c5e51..8903cd7 100644
--- a/c++/test/dsets.cpp
+++ b/c++/test/dsets.cpp
@@ -33,7 +33,6 @@
#endif
#include "testhdf5.h"
-#include "h5test.h"
#include "H5Cpp.h"
#ifndef H5_NO_NAMESPACE
@@ -42,15 +41,15 @@ using namespace H5;
#include "h5cpputil.h"
-const string FILE1("dataset.h5");
-#define DSET_DEFAULT_NAME "default"
-#define DSET_CHUNKED_NAME "chunked"
-#define DSET_SIMPLE_IO_NAME "simple_io"
-#define DSET_TCONV_NAME "tconv"
-#define DSET_COMPRESS_NAME "compressed"
-#define DSET_BOGUS_NAME "bogus"
+const string FILE1("dataset.h5");
+const string DSET_DEFAULT_NAME("default");
+const string DSET_CHUNKED_NAME("chunked");
+const string DSET_SIMPLE_IO_NAME("simple_io");
+const string DSET_TCONV_NAME ("tconv");
+const string DSET_COMPRESS_NAME("compressed");
+const string DSET_BOGUS_NAME ("bogus");
-#define H5Z_FILTER_BOGUS 305
+const int H5Z_FILTER_BOGUS = 305;
// Local prototypes
static size_t bogus(unsigned int flags, size_t cd_nelmts,
@@ -601,7 +600,7 @@ test_compression(H5File& file)
TESTING("compression (partial I/O)");
const hsize_t hs_size[2] = {4, 50};
- const hssize_t hs_offset[2] = {7, 30};
+ const hsize_t hs_offset[2] = {7, 30};
for (i = 0; i < hs_size[0]; i++) {
for (j = 0; j < hs_size[1]; j++) {
points[hs_offset[0]+i][hs_offset[1]+j] = rand ();
diff --git a/c++/test/h5cpputil.cpp b/c++/test/h5cpputil.cpp
index 020bab0..8bb0d85 100644
--- a/c++/test/h5cpputil.cpp
+++ b/c++/test/h5cpputil.cpp
@@ -93,4 +93,3 @@ void issue_fail_msg(const char* where, int line, const char* file_name)
}
}
-
diff --git a/c++/test/h5cpputil.h b/c++/test/h5cpputil.h
index d67c459..93ba1b9 100644
--- a/c++/test/h5cpputil.h
+++ b/c++/test/h5cpputil.h
@@ -46,7 +46,7 @@ template <class Type1, class Type2>
cerr << "*** UNEXPECTED VALUE from " << where << " should be "
<< value << ", but is " << x << " at line " << line
<< " in " << file_name << endl;
- H5Eprint (stdout);
+ H5Eprint (stderr);
}
}
diff --git a/c++/test/tfile.cpp b/c++/test/tfile.cpp
index 858c74c..02cee3e 100644
--- a/c++/test/tfile.cpp
+++ b/c++/test/tfile.cpp
@@ -104,7 +104,7 @@ test_file_create(void)
// name, that skips the comparison b/w the 1st & 2nd args would
// be more appropriate, but verify_val can be used for now;
// also, more text about what is testing would be better.
- verify_val(file2.getId(), FAIL, "H5File constructor", __LINE__, __FILE__);
+ verify_val(file2.getId(), FAIL, "H5File constructor", __LINE__, __FILE__);
}
catch( FileIException E ) {} // do nothing, FAIL expected
@@ -156,10 +156,11 @@ test_file_create(void)
verify_val(parm1, F1_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__);
verify_val(parm2, F1_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__);
- int iparm1; /*file-creation parameters */
#ifdef H5_WANT_H5_V1_4_COMPAT
+ int iparm1; /*file-creation parameters */
int iparm2; /*file-creation parameters */
#else /* H5_WANT_H5_V1_4_COMPAT */
+ unsigned iparm1; /*file-creation parameters */
unsigned iparm2; /*file-creation parameters */
#endif /* H5_WANT_H5_V1_4_COMPAT */
tmpl1.getSymk( iparm1, iparm2);
@@ -210,10 +211,11 @@ test_file_create(void)
verify_val(parm1, F2_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__);
verify_val(parm2, F2_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__);
- int iparm1; /*file-creation parameters */
#ifdef H5_WANT_H5_V1_4_COMPAT
+ int iparm1; /*file-creation parameters */
int iparm2; /*file-creation parameters */
#else /* H5_WANT_H5_V1_4_COMPAT */
+ unsigned iparm1; /*file-creation parameters */
unsigned iparm2; /*file-creation parameters */
#endif /* H5_WANT_H5_V1_4_COMPAT */
tmpl1->getSymk( iparm1, iparm2);
@@ -291,17 +293,17 @@ test_file_open(void)
/* Get the file-creation parameters */
hsize_t ublock = tmpl1.getUserblock();
verify_val(ublock, F2_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__, __FILE__);
- verify_val(ublock, F2_USERBLOCK_SIZE, "FileCreatPropList::getUserblock", __LINE__, __FILE__);
size_t parm1, parm2; /*file-creation parameters */
tmpl1.getSizes( parm1, parm2);
verify_val(parm1, F2_OFFSET_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__);
verify_val(parm2, F2_LENGTH_SIZE, "FileCreatPropList::getSizes", __LINE__, __FILE__);
- int iparm1; /*file-creation parameters */
#ifdef H5_WANT_H5_V1_4_COMPAT
+ int iparm1; /*file-creation parameters */
int iparm2; /*file-creation parameters */
#else /* H5_WANT_H5_V1_4_COMPAT */
+ unsigned iparm1; /*file-creation parameters */
unsigned iparm2; /*file-creation parameters */
#endif /* H5_WANT_H5_V1_4_COMPAT */
tmpl1.getSymk( iparm1, iparm2);
diff --git a/c++/test/th5s.cpp b/c++/test/th5s.cpp
index 5f62ed5..ff7e0bf 100644
--- a/c++/test/th5s.cpp
+++ b/c++/test/th5s.cpp
@@ -35,8 +35,8 @@
using namespace H5;
#endif /* !H5_NO_NAMESPACE */
-const char* TESTFILE = "th5s.h5";
-const char* DATAFILE = "th5s1.h5";
+const string TESTFILE("th5s.h5");
+const string DATAFILE("th5s1.h5");
/* 3-D dataset with fixed dimensions */
const string SPACE1_NAME("Space1");
@@ -118,20 +118,20 @@ test_h5s_basic(void)
// Get simple extent npoints of the dataspace sid1 and verify it
hssize_t n; /* Number of dataspace elements */
n = sid1.getSimpleExtentNpoints();
- verify_val(n, SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3,
- "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__);
+ verify_val(n, SPACE1_DIM1 * SPACE1_DIM2 * SPACE1_DIM3,
+ "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__);
// Get the logical rank of dataspace sid1 and verify it
int rank; /* Logical rank of dataspace */
rank = sid1.getSimpleExtentNdims();
- verify_val(rank, SPACE1_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__);
+ verify_val(rank, SPACE1_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__);
// Retrieves dimension size of dataspace sid1 and verify it
int ndims; /* Number of dimensions */
hsize_t tdims[4]; /* Dimension array to test with */
ndims = sid1.getSimpleExtentDims( tdims );
- verify_val(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(unsigned)), 0,
- "DataSpace::getSimpleExtentDims", __LINE__, __FILE__);
+ verify_val(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(unsigned)), 0,
+ "DataSpace::getSimpleExtentDims", __LINE__, __FILE__);
// Create simple dataspace sid2
hsize_t max2[] = {SPACE2_MAX1, SPACE2_MAX2, SPACE2_MAX3, SPACE2_MAX4};
@@ -139,20 +139,20 @@ test_h5s_basic(void)
// Get simple extent npoints of dataspace sid2 and verify it
n = sid2.getSimpleExtentNpoints();
- verify_val(n, SPACE2_DIM1 * SPACE2_DIM2 * SPACE2_DIM3 * SPACE2_DIM4,
- "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__);
+ verify_val(n, SPACE2_DIM1 * SPACE2_DIM2 * SPACE2_DIM3 * SPACE2_DIM4,
+ "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__);
// Get the logical rank of dataspace sid2 and verify it
rank = sid2.getSimpleExtentNdims();
- verify_val(rank, SPACE2_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__);
+ verify_val(rank, SPACE2_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__);
// Retrieves dimension size and max size of dataspace sid2 and
// verify them
ndims = sid2.getSimpleExtentDims( tdims, tmax );
- verify_val(HDmemcmp(tdims, dims2, SPACE2_RANK * sizeof(unsigned)), 0,
- "DataSpace::getSimpleExtentDims", __LINE__, __FILE__);
- verify_val(HDmemcmp(tmax, max2, SPACE2_RANK * sizeof(unsigned)), 0,
- "DataSpace::getSimpleExtentDims", __LINE__, __FILE__);
+ verify_val(HDmemcmp(tdims, dims2, SPACE2_RANK * sizeof(unsigned)), 0,
+ "DataSpace::getSimpleExtentDims", __LINE__, __FILE__);
+ verify_val(HDmemcmp(tmax, max2, SPACE2_RANK * sizeof(unsigned)), 0,
+ "DataSpace::getSimpleExtentDims", __LINE__, __FILE__);
} // end of first try block
catch( DataSpaceIException error )
{
@@ -166,8 +166,8 @@ test_h5s_basic(void)
try {
DataSpace manydims_ds(H5S_MAX_RANK+1, dims3, NULL);
- // Should FAIL but didn't, so issue an error message
- issue_fail_msg("DataSpace constructor", __LINE__, __FILE__);
+ // Should FAIL but didn't, so issue an error message
+ issue_fail_msg("DataSpace constructor", __LINE__, __FILE__);
}
catch( DataSpaceIException error ) {} // do nothing, FAIL expected
@@ -180,11 +180,11 @@ test_h5s_basic(void)
*/
char testfile[512]="";
char *srcdir = getenv("srcdir");
- if (srcdir && ((strlen(srcdir) + strlen(TESTFILE) + 1) < sizeof(testfile))){
+ if (srcdir && ((strlen(srcdir) + strlen(TESTFILE.c_str()) + 1) < sizeof(testfile))){
strcpy(testfile, srcdir);
strcat(testfile, "/");
}
- strcat(testfile, TESTFILE);
+ strcat(testfile, TESTFILE.c_str());
try { // try block for testing higher dimensionality
// Create file
@@ -195,8 +195,8 @@ test_h5s_basic(void)
try {
DataSet dset1 = fid1.openDataSet( "dset" );
- // but didn't, issue an error message
- issue_fail_msg("H5File::openDataSet", __LINE__, __FILE__);
+ // but didn't, issue an error message
+ issue_fail_msg("H5File::openDataSet", __LINE__, __FILE__);
}
catch( FileIException error ) { } // do nothing, FAIL expected
} // end of try block for testing higher dimensionality
@@ -215,8 +215,7 @@ test_h5s_basic(void)
dims1[0] = 0;
try {
DataSpace wrongdim_ds (SPACE1_RANK, dims1);
- verify_val(wrongdim_ds.getId(), FAIL, "DataSpace constructor", __LINE__, __FILE__);
-
+ verify_val(wrongdim_ds.getId(), FAIL, "DataSpace constructor", __LINE__, __FILE__);
}
catch( DataSpaceIException error ) {} // do nothing; FAIL expected
@@ -225,7 +224,7 @@ test_h5s_basic(void)
// Attempts to use incorrect dimensions, should fail
try {
- sid3.setExtentSimple( SPACE1_RANK, dims1 );
+ sid3.setExtentSimple( SPACE1_RANK, dims1 );
// but didn't, issue an error message
issue_fail_msg("DataSpace::setExtentSimple", __LINE__, __FILE__);
@@ -265,11 +264,11 @@ test_h5s_scalar_write(void)
//n = H5Sget_simple_extent_npoints(sid1);
hssize_t n; /* Number of dataspace elements */
n = sid1.getSimpleExtentNpoints();
- verify_val(n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__);
+ verify_val(n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__);
int rank; /* Logical rank of dataspace */
rank = sid1.getSimpleExtentNdims();
- verify_val(rank, SPACE3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__);
+ verify_val(rank, SPACE3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__);
// Retrieves dimension size of dataspace sid1 and verify it
int ndims; /* Number of dimensions */
@@ -280,7 +279,7 @@ test_h5s_scalar_write(void)
/* Verify extent type */
H5S_class_t ext_type; /* Extent type */
ext_type = sid1.getSimpleExtentType();
- verify_val(ext_type, H5S_SCALAR, "DataSpace::getSimpleExtentType", __LINE__, __FILE__);
+ verify_val(ext_type, H5S_SCALAR, "DataSpace::getSimpleExtentType", __LINE__, __FILE__);
/* Create a dataset */
DataSet dataset = fid1.createDataSet("Dataset1", PredType::NATIVE_UINT,sid1);
@@ -327,18 +326,18 @@ test_h5s_scalar_read(void)
// Get the number of dataspace elements
hssize_t n = sid1.getSimpleExtentNpoints();
- verify_val(n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__);
+ verify_val(n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__);
// Get the logical rank of the dataspace
int ndims = sid1.getSimpleExtentNdims();
- verify_val(ndims, SPACE3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__);
+ verify_val(ndims, SPACE3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__);
ndims = sid1.getSimpleExtentDims(tdims);
- verify_val(ndims, 0, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__);
+ verify_val(ndims, 0, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__);
unsigned rdata; /* Scalar data read in */
dataset.read(&rdata, PredType::NATIVE_UINT);
- verify_val(rdata, space3_data, "DataSet::read", __LINE__, __FILE__);
+ verify_val(rdata, space3_data, "DataSet::read", __LINE__, __FILE__);
} // end of try block
catch (Exception error)
{
@@ -395,15 +394,15 @@ test_h5s_compound_scalar_write(void)
// Get the number of dataspace elements
hssize_t n = sid1.getSimpleExtentNpoints();
- verify_val(n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__);
+ verify_val(n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__);
// Get the logical rank of the dataspace
int ndims = sid1.getSimpleExtentNdims();
- verify_val(ndims, SPACE3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__);
+ verify_val(ndims, SPACE3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__);
hsize_t tdims[4]; /* Dimension array to test with */
ndims = sid1.getSimpleExtentDims(tdims);
- verify_val(ndims, 0, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__);
+ verify_val(ndims, 0, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__);
/* Create a dataset */
DataSet dataset = fid1.createDataSet("Dataset1", tid1, sid1);
@@ -452,14 +451,14 @@ test_h5s_compound_scalar_read(void)
// Get the number of dataspace elements
hssize_t n = sid1.getSimpleExtentNpoints();
- verify_val(n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__);
+ verify_val(n, 1, "DataSpace::getSimpleExtentNpoints", __LINE__, __FILE__);
// Get the logical rank of the dataspace
int ndims = sid1.getSimpleExtentNdims();
- verify_val(ndims, SPACE3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__);
+ verify_val(ndims, SPACE3_RANK, "DataSpace::getSimpleExtentNdims", __LINE__, __FILE__);
ndims = sid1.getSimpleExtentDims(tdims);
- verify_val(ndims, 0, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__);
+ verify_val(ndims, 0, "DataSpace::getSimpleExtentDims", __LINE__, __FILE__);
// Get the datatype of this dataset.
CompType type(dataset);
@@ -509,7 +508,7 @@ test_h5s(void)
test_h5s_basic(); /* Test basic H5S code */
test_h5s_scalar_write(); /* Test scalar H5S writing code */
- test_h5s_scalar_read(); /* Test scalar H5S reading code */
+ test_h5s_scalar_read(); /* Test scalar H5S reading code */
test_h5s_compound_scalar_write(); /* Test compound datatype scalar H5S writing code */
test_h5s_compound_scalar_read(); /* Test compound datatype scalar H5S reading code */
} /* test_h5s() */
@@ -532,6 +531,6 @@ test_h5s(void)
void
cleanup_h5s(void)
{
- remove(DATAFILE);
+ remove(DATAFILE.c_str());
}
diff --git a/config/commence.in b/config/commence.in
index 16f13ca..7328296 100644
--- a/config/commence.in
+++ b/config/commence.in
@@ -70,6 +70,7 @@ PUB_DOCS=
PUB_SUBDOCS=
PROGS=
TEST_PROGS=
+PRIV_PROGS=
TEST_PROGS_PARA=
TEST_FLAGS=
TEST_SCRIPTS=
diff --git a/config/conclude.in b/config/conclude.in
index 5a19a48..587a48e 100644
--- a/config/conclude.in
+++ b/config/conclude.in
@@ -108,19 +108,19 @@ check-vfd:
## Make installation directories directories if they don't exist.
##
$(libdir):
- $(top_srcdir)/bin/mkdirs $@
+ -$(top_srcdir)/bin/mkdirs $@
$(includedir):
- $(top_srcdir)/bin/mkdirs $@
+ -$(top_srcdir)/bin/mkdirs $@
$(bindir):
- $(top_srcdir)/bin/mkdirs $@
+ -$(top_srcdir)/bin/mkdirs $@
$(DOCDIR):
- $(top_srcdir)/bin/mkdirs $@
+ -$(top_srcdir)/bin/mkdirs $@
$(EXAMPLEDIR):
- $(top_srcdir)/bin/mkdirs $@
+ -$(top_srcdir)/bin/mkdirs $@
## Install the library, the public header files, and public programs.
##
@@ -223,10 +223,10 @@ install-doc: $(PUB_DOCS) $(DOCDIR)
##
uninstall:
@for f in libhdf5.settings $(LIB); do \
- $(LT_UNINSTALL) $(libdir)/$$f; \
+ $(LT_UNINSTALL) $(libdir)/$$f; \
done
@if test -n "$(PUB_HDR)"; then \
- set -x; cd $(includedir) && $(RM) $(PUB_HDR); \
+ set -x; cd $(includedir) && $(RM) $(PUB_HDR); \
fi
@for f in X $(PUB_PROGS); do \
if test $$f != X; then \
@@ -238,15 +238,15 @@ uninstall:
##
uninstall-doc:
@for d in X $(SUBDIRS); do \
- if test $$d != X; then \
- (set -x; cd $$d && $(MAKE) $@) || exit 1; \
- fi; \
+ if test $$d != X; then \
+ (set -x; cd $$d && $(MAKE) $@) || exit 1; \
+ fi; \
done
@if test -n "$(PUB_DOCS)"; then \
- set -x; cd $(DOCDIR) && $(RM) $(PUB_DOCS); \
+ set -x; cd $(DOCDIR) && $(RM) $(PUB_DOCS); \
fi
- @if test -n "$(PUB_SUBDOCS)"; then \
- set -x; cd $(DOCDIR) && $(RM) $(PUB_SUBDOCS); \
+ @if test -n "$(PUB_SUBDOCS)"; then \
+ set -x; cd $(DOCDIR) && $(RM) $(PUB_SUBDOCS); \
fi
## Removes temporary files without removing the final target files. That is,
@@ -290,10 +290,10 @@ clean: mostlyclean
##
distclean: clean
-$(RM) .depend TAGS *~ core *.core *.bak *.old *.new $(DISTCLEAN)
- @for d in X $(SUBDIRS); do \
- if test $$d != X; then \
- (set -x; cd $$d; $(MAKE) $@) || exit 1; \
- fi; \
+ @for d in X $(SUBDIRS); do \
+ if test $$d != X; then \
+ (set -x; cd $$d; $(MAKE) $@) || exit 1; \
+ fi; \
done
@if test -f $(srcdir)/Makefile.in; then \
(set -x; $(RM) Makefile); \
diff --git a/config/dec-flags b/config/dec-flags
index 6368ee7..32922bb 100644
--- a/config/dec-flags
+++ b/config/dec-flags
@@ -49,7 +49,7 @@ esac
case "$cc_vendor-$cc_version" in
DEC-V5.*)
# Production
- PROD_CFLAGS="-std -verbose -warnprotos -ieee -misalign -O4 -ansi_args -fp_reorder -readonly_strings -inline speed"
+ PROD_CFLAGS="-std -verbose -warnprotos -ieee -misalign -O4 -ansi_args -fp_reorder -readonly_strings -inline speed"
PROD_CPPFLAGS="-D_INTRINSICS -D_INLINE_INTRINSICS"
# Debug
diff --git a/config/depend1.in b/config/depend1.in
index eaa7488..fc2545d 100644
--- a/config/depend1.in
+++ b/config/depend1.in
@@ -21,14 +21,14 @@
## tilde to the file name.
##
$(srcdir)/Dependencies: .depend
- @if test "$(srcdir)" != "."; then \
- echo '## This file is machine generated on GNU systems.' >$@; \
- echo '## Only temporary changes may be made here.' >>$@; \
- echo >>$@; \
- $(PERL) -p $(top_srcdir)/bin/distdep .depend >>$@; \
- else \
- echo 'Dependencies cannot be built when $$srcdir == $$builddir'; \
- fi
+ @if test "$(srcdir)" != "."; then \
+ echo '## This file is machine generated on GNU systems.' >$@; \
+ echo '## Only temporary changes may be made here.' >>$@; \
+ echo >>$@; \
+ $(PERL) -p $(top_srcdir)/bin/distdep .depend >>$@; \
+ else \
+ echo 'Dependencies cannot be built when $$srcdir == $$builddir'; \
+ fi
.depend: $(LIB_SRC) $(TEST_SRC) $(PROG_SRC)
@touch .depend
diff --git a/config/freebsd b/config/freebsd
index 8bdad05..4619beb 100644
--- a/config/freebsd
+++ b/config/freebsd
@@ -7,8 +7,8 @@
# The default compiler is `gcc'
if test "X-" = "X-$CC"; then
- CC=gcc
- CC_BASENAME=gcc
+ CC=gcc
+ CC_BASENAME=gcc
fi
# Add "_POSIX_C_SOURCE" define to cpp flags, to quiet warnings
diff --git a/config/gnu-flags b/config/gnu-flags
index ae40c33..354c7ab 100644
--- a/config/gnu-flags
+++ b/config/gnu-flags
@@ -92,7 +92,6 @@ fi
# Common GCC flags for various situations
case "$cc_vendor-$cc_version" in
gcc*|egcs*|pgcc*)
-
# Architecture-specific flags
arch=
case "$host_os-$host_cpu" in
diff --git a/config/hpux10.20 b/config/hpux10.20
index 0b39f3c..472dbe7 100644
--- a/config/hpux10.20
+++ b/config/hpux10.20
@@ -8,29 +8,29 @@
# Default compiler is `cc'
if test "X-" = "X-$CC"; then
- CC=cc
- CC_BASENAME=cc
+ CC=cc
+ CC_BASENAME=cc
fi
# Flags
case "X-$CC" in
- X-gcc)
- CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions
- DEBUG_CFLAGS="-g -fverbose-asm"
- DEBUG_CPPFLAGS=
- PROD_CFLAGS="-O3"
- PROD_CPPFLAGS=
- PROFILE_CFLAGS="-pg"
- PROFILE_CPPFLAGS=
- ;;
+ X-gcc)
+ CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions
+ DEBUG_CFLAGS="-g -fverbose-asm"
+ DEBUG_CPPFLAGS=
+ PROD_CFLAGS="-O3"
+ PROD_CPPFLAGS=
+ PROFILE_CFLAGS="-pg"
+ PROFILE_CPPFLAGS=
+ ;;
- *)
- CFLAGS="$CFLAGS -Ae"
- DEBUG_CFLAGS=-g
- DEBUG_CPPFLAGS="-Ae"
- PROD_CFLAGS=-O
- PROD_CPPFLAGS="-Ae"
- PROFILE_CFLAGS=
- PROFILE_CPPFLAGS="-Ae"
- ;;
+ *)
+ CFLAGS="$CFLAGS -Ae"
+ DEBUG_CFLAGS=-g
+ DEBUG_CPPFLAGS="-Ae"
+ PROD_CFLAGS=-O
+ PROD_CPPFLAGS="-Ae"
+ PROFILE_CFLAGS=
+ PROFILE_CPPFLAGS="-Ae"
+ ;;
esac
diff --git a/config/hpux11.00 b/config/hpux11.00
index 0b39f3c..472dbe7 100644
--- a/config/hpux11.00
+++ b/config/hpux11.00
@@ -8,29 +8,29 @@
# Default compiler is `cc'
if test "X-" = "X-$CC"; then
- CC=cc
- CC_BASENAME=cc
+ CC=cc
+ CC_BASENAME=cc
fi
# Flags
case "X-$CC" in
- X-gcc)
- CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions
- DEBUG_CFLAGS="-g -fverbose-asm"
- DEBUG_CPPFLAGS=
- PROD_CFLAGS="-O3"
- PROD_CPPFLAGS=
- PROFILE_CFLAGS="-pg"
- PROFILE_CPPFLAGS=
- ;;
+ X-gcc)
+ CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions
+ DEBUG_CFLAGS="-g -fverbose-asm"
+ DEBUG_CPPFLAGS=
+ PROD_CFLAGS="-O3"
+ PROD_CPPFLAGS=
+ PROFILE_CFLAGS="-pg"
+ PROFILE_CPPFLAGS=
+ ;;
- *)
- CFLAGS="$CFLAGS -Ae"
- DEBUG_CFLAGS=-g
- DEBUG_CPPFLAGS="-Ae"
- PROD_CFLAGS=-O
- PROD_CPPFLAGS="-Ae"
- PROFILE_CFLAGS=
- PROFILE_CPPFLAGS="-Ae"
- ;;
+ *)
+ CFLAGS="$CFLAGS -Ae"
+ DEBUG_CFLAGS=-g
+ DEBUG_CPPFLAGS="-Ae"
+ PROD_CFLAGS=-O
+ PROD_CPPFLAGS="-Ae"
+ PROFILE_CFLAGS=
+ PROFILE_CPPFLAGS="-Ae"
+ ;;
esac
diff --git a/config/hpux9.03 b/config/hpux9.03
index abed0b3..6603aab 100644
--- a/config/hpux9.03
+++ b/config/hpux9.03
@@ -7,30 +7,30 @@
# See BlankForm in this directory for details
# Default compiler is `cc'
-if test "X-" = "X-$CC"; then
- CC=cc
- CC_BASENAME=cc
+if test "X$CC" = "X"; then
+ CC=cc
+ CC_BASENAME=cc
fi
# Flags
case "X-$CC" in
- X-gcc)
- CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions
- DEBUG_CFLAGS="-g -fverbose-asm"
- DEBUG_CPPFLAGS=
- PROD_CFLAGS="-O3"
- PROD_CPPFLAGS=
- PROFILE_CFLAGS="-pg"
- PROFILE_CPPFLAGS=
- ;;
+ X-gcc)
+ CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions
+ DEBUG_CFLAGS="-g -fverbose-asm"
+ DEBUG_CPPFLAGS=
+ PROD_CFLAGS="-O3"
+ PROD_CPPFLAGS=
+ PROFILE_CFLAGS="-pg"
+ PROFILE_CPPFLAGS=
+ ;;
- *)
- CFLAGS="$CFLAGS -Ae"
- DEBUG_CFLAGS=-g
- DEBUG_CPPFLAGS=
- PROD_CFLAGS=
- PROD_CPPFLAGS=
- PROFILE_CFLAGS=
- PROFILE_CPPFLAGS=
- ;;
+ *)
+ CFLAGS="$CFLAGS -Ae"
+ DEBUG_CFLAGS=-g
+ DEBUG_CPPFLAGS=
+ PROD_CFLAGS=
+ PROD_CPPFLAGS=
+ PROFILE_CFLAGS=
+ PROFILE_CPPFLAGS=
+ ;;
esac
diff --git a/config/i386-pc-cygwin32 b/config/i386-pc-cygwin32
index 474903b..0d63288 100644
--- a/config/i386-pc-cygwin32
+++ b/config/i386-pc-cygwin32
@@ -8,9 +8,9 @@
# The default compiler is `gcc'.
if test "X-" = "X-$CC"; then
- CC=gcc
- CC_BASENAME=gcc
- LD=ld
+ CC=gcc
+ CC_BASENAME=gcc
+ LD=ld
fi
# Figure out compiler flags
diff --git a/config/ia64-linux-gnu b/config/ia64-linux-gnu
index b212670..76f669f3 100644
--- a/config/ia64-linux-gnu
+++ b/config/ia64-linux-gnu
@@ -6,18 +6,14 @@
# Use Intel C compiler by default (if it's available).
if test "X$CC" = "X" && which icc > /dev/null; then
- CC=icc
- CC_BASENAME=icc
+ CC=icc
+ CC_BASENAME=icc
fi
#----------------------------------------------------------------------------
# Compiler flags. The CPPFLAGS values should not include package debug
# flags like `-DH5G_DEBUG' since these are added with the
-# `--enable-debug' switch of configure. After titan's ecc was updated to 7.1,
-# int64_t couldn't be found because of overlapping definitions in stdint.h
-# and sys/types.h. So added -D__GNUC__ to CFLAGS. (This problem is no longer
-# there since the C library has been updated. So -D__GNUC__ has been taken
-# out.)
+# `--enable-debug' switch of configure.
case $CC_BASENAME in
ecc|icc)
diff --git a/config/irix5.x b/config/irix5.x
index bd757e1..3624e7f 100644
--- a/config/irix5.x
+++ b/config/irix5.x
@@ -7,44 +7,44 @@
# See BlankForm in this directory for details
# The default compiler is `cc' and there is no ranlib.
-if test "X-" = "X-$CC"; then
- CC=cc
- CC_BASENAME=cc
+if test "X-" = "X-$CC"; then
+ CC=cc
+ CC_BASENAME=cc
fi
RANLIB=:
case "X-$CC_BASENAME" in
- X-gcc)
- CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions
- DEBUG_CFLAGS="-g -fverbose-asm"
- DEBUG_CPPFLAGS=
- PROD_CFLAGS="-O3"
+ X-gcc)
+ CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions
+ DEBUG_CFLAGS="-g -fverbose-asm"
+ DEBUG_CPPFLAGS=
+ PROD_CFLAGS="-O3"
PROD_CPPFLAGS=
- PROFILE_CFLAGS="-pg"
- PROFILE_CPPFLAGS=
- ;;
+ PROFILE_CFLAGS="-pg"
+ PROFILE_CPPFLAGS=
+ ;;
- *)
- # Do *not* use -ansi because it prevents hdf5 from being able
- # to read modification dates from the file. On some systems it
- # can also result in compile errors in system header files
- # since hdf5 includes a couple non-ANSI header files.
- #CFLAGS="$CFLAGS -ansi"
+ *)
+ # Do *not* use -ansi because it prevents hdf5 from being able
+ # to read modification dates from the file. On some systems it
+ # can also result in compile errors in system header files
+ # since hdf5 includes a couple non-ANSI header files.
+ #CFLAGS="$CFLAGS -ansi"
- # Always turn off these compiler warnings:
- CFLAGS="$CFLAGS -woff 799"
+ # Always turn off these compiler warnings:
+ CFLAGS="$CFLAGS -woff 799"
- # Extra debugging flags
- DEBUG_CFLAGS=-g
- DEBUG_CPPFLAGS=
+ # Extra debugging flags
+ DEBUG_CFLAGS=-g
+ DEBUG_CPPFLAGS=
- # Extra production flags
- # Note: higher optimizations relax alignment requirements needed.
- PROD_CFLAGS="-O -s"
- PROD_CPPFLAGS=
+ # Extra production flags
+ # Note: higher optimizations relax alignment requirements needed.
+ PROD_CFLAGS="-O -s"
+ PROD_CPPFLAGS=
- # Extra profiling flags
- PROFILE_CFLAGS=-pg
- PROFILE_CPPFLAGS=
- ;;
+ # Extra profiling flags
+ PROFILE_CFLAGS=-pg
+ PROFILE_CPPFLAGS=
+ ;;
esac
diff --git a/config/irix6.x b/config/irix6.x
index e9bb680..c8918a1 100644
--- a/config/irix6.x
+++ b/config/irix6.x
@@ -7,78 +7,76 @@
# See BlankForm in this directory for details.
# Use SGI supplied C compiler by default. There is no ranlib
-if test "X-" = "X-$CC"; then
+if test "X-" = "X-$CC"; then
CC='cc'
CC_BASENAME=cc
# use c99 compiler if available.
if `c99 -version >/dev/null 2>&1` ; then
- CC='c99'
+ CC='c99'
fi
fi
RANLIB=:
# Compiler flags
case "X-$CC_BASENAME" in
- X-gcc)
- . $srcdir/config/gnu-flags
- ;;
+ X-gcc)
+ . $srcdir/config/gnu-flags
+ ;;
- *)
- if [ "$CC_BASENAME" = cc ] ||
- ($CC -version 2>&1 | grep -s "MIPSpro Compilers") 2>&1 > /dev/null
- then
- # use these flags if this is the SGI cc compiler or some compiler
- # command that eventually uses the SGI cc compiler.
+ *)
+ if [ "$CC_BASENAME" = "cc" ] || ($CC -version 2>&1 | grep -s "MIPSpro Compilers") 2>&1 > /dev/null; then
+ # use these flags if this is the SGI cc compiler or some compiler
+ # command that eventually uses the SGI cc compiler.
- # Check for old versions of the compiler that don't work right.
- case "`$CC -version 2>&1 |head -1`" in
- "Mongoose Compilers: Version 7.00")
- echo " +---------------------------------------------------+"
- echo " | You have an old version of cc (Mongoose Compilers |"
- echo " | version 7.00). Please upgrade to MIPSpro version |"
- echo " | 7.2.1.2m (patches are available from the SGI web |"
- echo " | site). The 7.00 version may generate incorrect |"
- echo " | code, especially when optimizations are enabled. |"
- echo " +---------------------------------------------------+"
- sleep 5
- ;;
- esac
+ # Check for old versions of the compiler that don't work right.
+ case "`$CC -version 2>&1 |head -1`" in
+ "Mongoose Compilers: Version 7.00")
+ echo " +---------------------------------------------------+"
+ echo " | You have an old version of cc (Mongoose Compilers |"
+ echo " | version 7.00). Please upgrade to MIPSpro version |"
+ echo " | 7.2.1.2m (patches are available from the SGI web |"
+ echo " | site). The 7.00 version may generate incorrect |"
+ echo " | code, especially when optimizations are enabled. |"
+ echo " +---------------------------------------------------+"
+ sleep 5
+ ;;
+ esac
- # Always turn off these compiler warnings for the -64 compiler:
- # 1174: function declared but not used
- # 1196: __vfork() (this is an SGI config problem)
- # 1209: constant expressions
- # 1429: the `long long' type is not standard
- # 1685: turn off warnings about turning off invalid warnings
- # 3201: remark - parameter not referenced
-# CFLAGS="$CFLAGS -woff 1174,1429,1209,1196,1685,3201"
- CFLAGS="$CFLAGS -woff 1209,3201"
+ # Always turn off these compiler warnings for the -64 compiler:
+ # 1174: function declared but not used
+ # 1196: __vfork() (this is an SGI config problem)
+ # 1209: constant expressions
+ # 1429: the `long long' type is not standard
+ # 1685: turn off warnings about turning off invalid warnings
+ # 3201: remark - parameter not referenced
+ #CFLAGS="$CFLAGS -woff 1174,1429,1209,1196,1685,3201"
+ CFLAGS="$CFLAGS -woff 1209,3201"
- # Always turn off these compiler warnings for the old compiler:
- # 799: the `long long' type is not standard
- # 803: turn off warnings about turning off invalid warnings
- # 835: __vfork() (this is an SGI config problem)
-# CFLAGS="$CFLAGS -woff 799,803,835"
+ # Always turn off these compiler warnings for the old compiler:
+ # 799: the `long long' type is not standard
+ # 803: turn off warnings about turning off invalid warnings
+ # 835: __vfork() (this is an SGI config problem)
+ #CFLAGS="$CFLAGS -woff 799,803,835"
- # Always turn off these loader warnings:
- # (notice the peculiar syntax)
- # 47: branch instructions that degrade performance on R4000
- # 84: a library is not used
- # 85: duplicate definition preemption (from -lnsl)
- # 134: duplicate weak definition preemption (from -lnsl)
- CFLAGS="$CFLAGS -Wl,-woff,47,-woff,84,-woff,85,-woff,134"
- fi
+ # Always turn off these loader warnings:
+ # (notice the peculiar syntax)
+ # 47: branch instructions that degrade performance on R4000
+ # 84: a library is not used
+ # 85: duplicate definition preemption (from -lnsl)
+ # 134: duplicate weak definition preemption (from -lnsl)
+ CFLAGS="$CFLAGS -Wl,-woff,47,-woff,84,-woff,85,-woff,134"
+ fi
- # Extra debugging flags
- DEBUG_CFLAGS="-g -fullwarn"
- DEBUG_CPPFLAGS=
+ # Extra debugging flags
+ DEBUG_CFLAGS="-g -fullwarn"
+ DEBUG_CPPFLAGS=
- # Extra production flags
- PROD_CFLAGS="-O -OPT:Olimit=0 -s"
- PROD_CPPFLAGS=
+ # Extra production flags
+ PROD_CFLAGS="-O -OPT:Olimit=0 -s"
+ PROD_CPPFLAGS=
- # Extra profiling flags
- PROFILE_CFLAGS=
- PROFILE_CPPFLAGS=
- ;;
+ # Extra profiling flags
+ PROFILE_CFLAGS=
+ PROFILE_CPPFLAGS=
+ ;;
esac
diff --git a/config/powerpc-ibm-aix5.x b/config/powerpc-ibm-aix5.x
index e9b9446..485ef6c 100644
--- a/config/powerpc-ibm-aix5.x
+++ b/config/powerpc-ibm-aix5.x
@@ -5,6 +5,7 @@
# the various compile modes.
# Use AIX supplied C compiler by default, xlc for serial, mpcc_r for parallel.
+# Use -D_LARGE_FILES by default to support large file size.
if test "X-" = "X-$CC"; then
if test "X-$enable_parallel" = "X-yes"; then
CC=mpcc_r
@@ -17,7 +18,7 @@ fi
# Define RUNPARALLEL if parallel mode is enabled or a parallel compiler used.
if test "X-$enable_parallel" = "X-yes" -o X-$CC_BASENAME = X-mpcc_r; then
- RUNPARALLEL=${RUNPARALLEL="MP_PROCS=\$\${NPROCS:=3} MP_TASKS_PER_NODE=\$\${NPROCS:=3} poe"}
+ RUNPARALLEL=${RUNPARALLEL="MP_PROCS=\$\${NPROCS:=3} MP_TASKS_PER_NODE=\$\${NPROCS:=3} poe"}
fi
@@ -27,33 +28,33 @@ fi
# `--enable-debug' switch of configure.
case $CC_BASENAME in
- xlc|mpcc_r)
- # Turn off shared lib option. It causes some test suite to fail.
- enable_shared="${enable_shared:-no}"
- # Use -D_LARGE_FILES by default to support large file size.
- CFLAGS="-qlanglvl=ansi -D_LARGE_FILES $CFLAGS"
- DEBUG_CFLAGS="-g"
- DEBUG_CPPFLAGS=
- # -O causes test/dtypes to fail badly. Turn it off for now.
- PROD_CFLAGS=""
- PROD_CPPFLAGS=
- PROFILE_CFLAGS="-pg"
- PROFILE_CPPFLAGS=
- ;;
+ xlc|mpcc_r)
+ # Turn off shared lib option. It causes some test suite to fail.
+ enable_shared="${enable_shared:-no}"
+ # Use -D_LARGE_FILES by default to support large file size.
+ CFLAGS="-qlanglvl=ansi -D_LARGE_FILES -DSTDC $CFLAGS"
+ DEBUG_CFLAGS="-g -qfullpath"
+ DEBUG_CPPFLAGS=
+ # -O causes test/dtypes to fail badly. Turn it off for now.
+ PROD_CFLAGS=""
+ PROD_CPPFLAGS=
+ PROFILE_CFLAGS="-g -qfullpath -pg"
+ PROFILE_CPPFLAGS=
+ ;;
- gcc)
- . $srcdir/config/gnu-flags
- ;;
+ gcc)
+ . $srcdir/config/gnu-flags
+ ;;
- *)
- CFLAGS="$CFLAGS -ansi"
- DEBUG_CFLAGS="-g"
- DEBUG_CPPFLAGS=
- PROD_CFLAGS="-O"
- PROD_CPPFLAGS=
- PROFILE_CFLAGS="-pg"
- PROFILE_CPPFLAGS=
- ;;
+ *)
+ CFLAGS="$CFLAGS -ansi"
+ DEBUG_CFLAGS="-g"
+ DEBUG_CPPFLAGS=
+ PROD_CFLAGS="-O"
+ PROD_CPPFLAGS=
+ PROFILE_CFLAGS="-pg"
+ PROFILE_CPPFLAGS=
+ ;;
esac
#----------------------------------------------------------------------------
diff --git a/config/solaris2.x b/config/solaris2.x
index 5c904f6..775becb 100644
--- a/config/solaris2.x
+++ b/config/solaris2.x
@@ -8,8 +8,8 @@
# The default compiler is `sunpro cc'
if test "X-" = "X-$CC"; then
- CC=cc
- CC_BASENAME=cc
+ CC=cc
+ CC_BASENAME=cc
fi
# Try gcc compiler flags
@@ -17,18 +17,19 @@ fi
# Try solaris native compiler flags
if test "X-" = "X-$cc_flags_set"; then
- CFLAGS="$CFLAGS -erroff=%none -DBSD_COMP"
- DEBUG_CFLAGS="-g -xildoff"
- DEBUG_CPPFLAGS=
- PROD_CFLAGS="-O -s"
- PROD_CPPFLAGS=
- PROFILE_CFLAGS=-xpg
- PROFILE_CPPFLAGS=
- cc_flags_set=yes
- # Turn off optimization flag for SUNpro compiler versions 4.x which
- # have an optimization bug. Version 5.0 works.
- ($CC -V 2>&1) | grep -s 'cc: .* C 4\.' >/dev/null 2>&1 \
- && PROD_CFLAGS="`echo $PROD_CFLAGS | sed -e 's/-O//'`"
+ CFLAGS="$CFLAGS -erroff=%none -DBSD_COMP"
+ DEBUG_CFLAGS="-g -xildoff"
+ DEBUG_CPPFLAGS=
+ PROD_CFLAGS="-O -s"
+ PROD_CPPFLAGS=
+ PROFILE_CFLAGS=-xpg
+ PROFILE_CPPFLAGS=
+ cc_flags_set=yes
+
+ # Turn off optimization flag for SUNpro compiler versions 4.x which
+ # have an optimization bug. Version 5.0 works.
+ ($CC -V 2>&1) | grep -s 'cc: .* C 4\.' >/dev/null 2>&1 \
+ && PROD_CFLAGS="`echo $PROD_CFLAGS | sed -e 's/-O//'`"
fi
# Add socket lib for the Stream Virtual File Driver
diff --git a/config/sv1-cray b/config/sv1-cray
index 3eb53ef..168e78a 100644
--- a/config/sv1-cray
+++ b/config/sv1-cray
@@ -28,8 +28,8 @@
# used within this file.
if test "X-" = "X-$CC"; then
- CC=cc
- CC_BASENAME=cc
+ CC=cc
+ CC_BASENAME=cc
fi
# no need to use RANLIB
RANLIB=:
@@ -88,39 +88,38 @@ RANLIB=:
# above).
case $CC_BASENAME in
- gcc)
- CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions
- DEBUG_CFLAGS="-g -fverbose-asm"
- DEBUG_CPPFLAGS=
- PROD_CFLAGS="-O3 -fomit-frame-pointer"
- PROD_CPPFLAGS=
- PROFILE_CFLAGS="-pg"
- PROFILE_CPPFLAGS=
- ;;
-
- cc)
- CFLAGS="$CFLAGS"
- DEBUG_CFLAGS="-g -h zero"
- DEBUG_CPPFLAGS=
- PROD_CFLAGS="-O2 -h scalar0 -h vector0 -h task1"
- PROD_CPPFLAGS=
- PROFILE_CFLAGS="-pg"
- PROFILE_CPPFLAGS=
- ;;
-
- *)
- CFLAGS="$CFLAGS -ansi"
- DEBUG_CFLAGS="-g"
- DEBUG_CPPFLAGS=
- PROD_CFLAGS="-O"
- PROD_CPPFLAGS=
- PROFILE_CFLAGS="-pg"
- PROFILE_CPPFLAGS=
- ;;
+ gcc)
+ CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions
+ DEBUG_CFLAGS="-g -fverbose-asm"
+ DEBUG_CPPFLAGS=
+ PROD_CFLAGS="-O3 -fomit-frame-pointer"
+ PROD_CPPFLAGS=
+ PROFILE_CFLAGS="-pg"
+ PROFILE_CPPFLAGS=
+ ;;
+
+ cc)
+ CFLAGS="$CFLAGS"
+ DEBUG_CFLAGS="-g -h zero"
+ DEBUG_CPPFLAGS=
+ PROD_CFLAGS="-O2 -h scalar0 -h vector0 -h task1"
+ PROD_CPPFLAGS=
+ PROFILE_CFLAGS="-pg"
+ PROFILE_CPPFLAGS=
+ ;;
+
+ *)
+ CFLAGS="$CFLAGS -ansi"
+ DEBUG_CFLAGS="-g"
+ DEBUG_CPPFLAGS=
+ PROD_CFLAGS="-O"
+ PROD_CPPFLAGS=
+ PROFILE_CFLAGS="-pg"
+ PROFILE_CPPFLAGS=
+ ;;
esac
-
# Overriding Configure Tests
# --------------------------
#
diff --git a/config/unicos b/config/unicos
index 43c1bd9..cc0f478 100644
--- a/config/unicos
+++ b/config/unicos
@@ -28,13 +28,12 @@
# used within this file.
if test "X-" = "X-$CC"; then
- CC=cc
- CC_BASENAME=cc
+ CC=cc
+ CC_BASENAME=cc
fi
# no need to use RANLIB
RANLIB=:
-
# C Compiler and Preprocessor Flags
# ---------------------------------
#
@@ -88,39 +87,37 @@ RANLIB=:
# above).
case $CC_BASENAME in
- gcc)
- CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions
- DEBUG_CFLAGS="-g -fverbose-asm"
- DEBUG_CPPFLAGS="-DH5F_OPT_SEEK=0 -DH5F_LOW_DFLT=H5F_LOW_SEC2"
- PROD_CFLAGS="-O3 -fomit-frame-pointer"
- PROD_CPPFLAGS=
- PROFILE_CFLAGS="-pg"
- PROFILE_CPPFLAGS=
- ;;
+ gcc)
+ CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions
+ DEBUG_CFLAGS="-g -fverbose-asm"
+ DEBUG_CPPFLAGS="-DH5F_OPT_SEEK=0 -DH5F_LOW_DFLT=H5F_LOW_SEC2"
+ PROD_CFLAGS="-O3 -fomit-frame-pointer"
+ PROD_CPPFLAGS=
+ PROFILE_CFLAGS="-pg"
+ PROFILE_CPPFLAGS=
+ ;;
- cc)
- CFLAGS="$CFLAGS"
- DEBUG_CFLAGS="-g -h zero -h scalar0"
- DEBUG_CPPFLAGS="-DH5F_OPT_SEEK=0 -DH5F_LOW_DFLT=H5F_LOW_SEC2"
+ cc)
+ CFLAGS="$CFLAGS"
+ DEBUG_CFLAGS="-g -h zero -h scalar0"
+ DEBUG_CPPFLAGS="-DH5F_OPT_SEEK=0 -DH5F_LOW_DFLT=H5F_LOW_SEC2"
PROD_CFLAGS="-O2 -h scalar0"
- PROD_CPPFLAGS=
- PROFILE_CFLAGS="-pg"
- PROFILE_CPPFLAGS=
- ;;
+ PROD_CPPFLAGS=
+ PROFILE_CFLAGS="-pg"
+ PROFILE_CPPFLAGS=
+ ;;
- *)
- CFLAGS="$CFLAGS -ansi"
- DEBUG_CFLAGS="-g"
- DEBUG_CPPFLAGS="-DH5F_OPT_SEEK=0 -DH5F_LOW_DFLT=H5F_LOW_SEC2"
- PROD_CFLAGS="-O"
- PROD_CPPFLAGS=
- PROFILE_CFLAGS="-pg"
- PROFILE_CPPFLAGS=
- ;;
+ *)
+ CFLAGS="$CFLAGS -ansi"
+ DEBUG_CFLAGS="-g"
+ DEBUG_CPPFLAGS="-DH5F_OPT_SEEK=0 -DH5F_LOW_DFLT=H5F_LOW_SEC2"
+ PROD_CFLAGS="-O"
+ PROD_CPPFLAGS=
+ PROFILE_CFLAGS="-pg"
+ PROFILE_CPPFLAGS=
+ ;;
esac
-
-
# Overriding Configure Tests
# --------------------------
#
diff --git a/config/unicos10.0.X b/config/unicos10.0.X
index 2a7a944..b9aa87d 100644
--- a/config/unicos10.0.X
+++ b/config/unicos10.0.X
@@ -28,8 +28,8 @@
# used within this file.
if test "X-" = "X-$CC"; then
- CC=cc
- CC_BASENAME=cc
+ CC=cc
+ CC_BASENAME=cc
fi
# no need to use RANLIB
RANLIB=:
@@ -88,35 +88,35 @@ RANLIB=:
# above).
case $CC_BASENAME in
- gcc)
- CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions
- DEBUG_CFLAGS="-g -fverbose-asm"
- DEBUG_CPPFLAGS="-DH5F_OPT_SEEK=0 -DH5F_LOW_DFLT=H5F_LOW_SEC2"
- PROD_CFLAGS="-O3 -fomit-frame-pointer"
- PROD_CPPFLAGS=
- PROFILE_CFLAGS="-pg"
- PROFILE_CPPFLAGS=
- ;;
-
- cc)
- CFLAGS="$CFLAGS"
- DEBUG_CFLAGS="-g -h zero -h scalar0"
- DEBUG_CPPFLAGS="-DH5F_OPT_SEEK=0 -DH5F_LOW_DFLT=H5F_LOW_SEC2"
+ gcc)
+ CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions
+ DEBUG_CFLAGS="-g -fverbose-asm"
+ DEBUG_CPPFLAGS="-DH5F_OPT_SEEK=0 -DH5F_LOW_DFLT=H5F_LOW_SEC2"
+ PROD_CFLAGS="-O3 -fomit-frame-pointer"
+ PROD_CPPFLAGS=
+ PROFILE_CFLAGS="-pg"
+ PROFILE_CPPFLAGS=
+ ;;
+
+ cc)
+ CFLAGS="$CFLAGS"
+ DEBUG_CFLAGS="-g -h zero -h scalar0"
+ DEBUG_CPPFLAGS="-DH5F_OPT_SEEK=0 -DH5F_LOW_DFLT=H5F_LOW_SEC2"
PROD_CFLAGS="-O2 -h scalar0"
- PROD_CPPFLAGS=
- PROFILE_CFLAGS="-pg"
- PROFILE_CPPFLAGS=
- ;;
-
- *)
- CFLAGS="$CFLAGS -ansi"
- DEBUG_CFLAGS="-g"
- DEBUG_CPPFLAGS="-DH5F_OPT_SEEK=0 -DH5F_LOW_DFLT=H5F_LOW_SEC2"
- PROD_CFLAGS="-O"
- PROD_CPPFLAGS=
- PROFILE_CFLAGS="-pg"
- PROFILE_CPPFLAGS=
- ;;
+ PROD_CPPFLAGS=
+ PROFILE_CFLAGS="-pg"
+ PROFILE_CPPFLAGS=
+ ;;
+
+ *)
+ CFLAGS="$CFLAGS -ansi"
+ DEBUG_CFLAGS="-g"
+ DEBUG_CPPFLAGS="-DH5F_OPT_SEEK=0 -DH5F_LOW_DFLT=H5F_LOW_SEC2"
+ PROD_CFLAGS="-O"
+ PROD_CPPFLAGS=
+ PROFILE_CFLAGS="-pg"
+ PROFILE_CPPFLAGS=
+ ;;
esac
diff --git a/config/unicosmk b/config/unicosmk
index 66f7c4c..57c04fb 100644
--- a/config/unicosmk
+++ b/config/unicosmk
@@ -28,8 +28,8 @@
# used within this file.
if test "X-" = "X-$CC"; then
- CC=cc
- CC_BASENAME=cc
+ CC=cc
+ CC_BASENAME=cc
fi
# no need to use RANLIB
RANLIB=:
@@ -88,35 +88,35 @@ RANLIB=:
# above).
case $CC_BASENAME in
- gcc)
- CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions
- DEBUG_CFLAGS="-g -fverbose-asm"
- DEBUG_CPPFLAGS=
- PROD_CFLAGS="-O3 -fomit-frame-pointer"
- PROD_CPPFLAGS=
- PROFILE_CFLAGS="-pg"
- PROFILE_CPPFLAGS=
- ;;
+ gcc)
+ CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions
+ DEBUG_CFLAGS="-g -fverbose-asm"
+ DEBUG_CPPFLAGS=
+ PROD_CFLAGS="-O3 -fomit-frame-pointer"
+ PROD_CPPFLAGS=
+ PROFILE_CFLAGS="-pg"
+ PROFILE_CPPFLAGS=
+ ;;
- cc)
- CFLAGS="$CFLAGS"
- DEBUG_CFLAGS="-g -h zero"
- DEBUG_CPPFLAGS=
- PROD_CFLAGS="-O2 -h scalar0"
- PROD_CPPFLAGS=
- PROFILE_CFLAGS="-pg"
- PROFILE_CPPFLAGS=
- ;;
+ cc)
+ CFLAGS="$CFLAGS"
+ DEBUG_CFLAGS="-g -h zero"
+ DEBUG_CPPFLAGS=
+ PROD_CFLAGS="-O2 -h scalar0"
+ PROD_CPPFLAGS=
+ PROFILE_CFLAGS="-pg"
+ PROFILE_CPPFLAGS=
+ ;;
- *)
- CFLAGS="$CFLAGS -ansi"
- DEBUG_CFLAGS="-g"
- DEBUG_CPPFLAGS=
- PROD_CFLAGS="-O"
- PROD_CPPFLAGS=
- PROFILE_CFLAGS="-pg"
- PROFILE_CPPFLAGS=
- ;;
+ *)
+ CFLAGS="$CFLAGS -ansi"
+ DEBUG_CFLAGS="-g"
+ DEBUG_CPPFLAGS=
+ PROD_CFLAGS="-O"
+ PROD_CPPFLAGS=
+ PROFILE_CFLAGS="-pg"
+ PROFILE_CPPFLAGS=
+ ;;
esac
diff --git a/config/unicosmk2.0.5.X b/config/unicosmk2.0.5.X
index 66f7c4c..57c04fb 100644
--- a/config/unicosmk2.0.5.X
+++ b/config/unicosmk2.0.5.X
@@ -28,8 +28,8 @@
# used within this file.
if test "X-" = "X-$CC"; then
- CC=cc
- CC_BASENAME=cc
+ CC=cc
+ CC_BASENAME=cc
fi
# no need to use RANLIB
RANLIB=:
@@ -88,35 +88,35 @@ RANLIB=:
# above).
case $CC_BASENAME in
- gcc)
- CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions
- DEBUG_CFLAGS="-g -fverbose-asm"
- DEBUG_CPPFLAGS=
- PROD_CFLAGS="-O3 -fomit-frame-pointer"
- PROD_CPPFLAGS=
- PROFILE_CFLAGS="-pg"
- PROFILE_CPPFLAGS=
- ;;
+ gcc)
+ CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions
+ DEBUG_CFLAGS="-g -fverbose-asm"
+ DEBUG_CPPFLAGS=
+ PROD_CFLAGS="-O3 -fomit-frame-pointer"
+ PROD_CPPFLAGS=
+ PROFILE_CFLAGS="-pg"
+ PROFILE_CPPFLAGS=
+ ;;
- cc)
- CFLAGS="$CFLAGS"
- DEBUG_CFLAGS="-g -h zero"
- DEBUG_CPPFLAGS=
- PROD_CFLAGS="-O2 -h scalar0"
- PROD_CPPFLAGS=
- PROFILE_CFLAGS="-pg"
- PROFILE_CPPFLAGS=
- ;;
+ cc)
+ CFLAGS="$CFLAGS"
+ DEBUG_CFLAGS="-g -h zero"
+ DEBUG_CPPFLAGS=
+ PROD_CFLAGS="-O2 -h scalar0"
+ PROD_CPPFLAGS=
+ PROFILE_CFLAGS="-pg"
+ PROFILE_CPPFLAGS=
+ ;;
- *)
- CFLAGS="$CFLAGS -ansi"
- DEBUG_CFLAGS="-g"
- DEBUG_CPPFLAGS=
- PROD_CFLAGS="-O"
- PROD_CPPFLAGS=
- PROFILE_CFLAGS="-pg"
- PROFILE_CPPFLAGS=
- ;;
+ *)
+ CFLAGS="$CFLAGS -ansi"
+ DEBUG_CFLAGS="-g"
+ DEBUG_CPPFLAGS=
+ PROD_CFLAGS="-O"
+ PROD_CPPFLAGS=
+ PROFILE_CFLAGS="-pg"
+ PROFILE_CPPFLAGS=
+ ;;
esac
diff --git a/config/unicosmk2.0.6.X b/config/unicosmk2.0.6.X
index 171c95b..638c740 100644
--- a/config/unicosmk2.0.6.X
+++ b/config/unicosmk2.0.6.X
@@ -28,8 +28,8 @@
# used within this file.
if test "X-" = "X-$CC"; then
- CC=cc
- CC_BASENAME=cc
+ CC=cc
+ CC_BASENAME=cc
fi
# no need to use RANLIB
RANLIB=:
@@ -88,35 +88,35 @@ RANLIB=:
# above).
case $CC_BASENAME in
- gcc)
- CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions
- DEBUG_CFLAGS="-g -fverbose-asm"
- DEBUG_CPPFLAGS=
- PROD_CFLAGS="-O3 -fomit-frame-pointer"
- PROD_CPPFLAGS=
- PROFILE_CFLAGS="-pg"
- PROFILE_CPPFLAGS=
- ;;
-
- cc)
- CFLAGS="$CFLAGS"
- DEBUG_CFLAGS="-g -h zero"
- DEBUG_CPPFLAGS=
- PROD_CFLAGS="-O2 -h scalar0"
- PROD_CPPFLAGS=
- PROFILE_CFLAGS="-pg"
- PROFILE_CPPFLAGS=
- ;;
-
- *)
- CFLAGS="$CFLAGS -ansi"
- DEBUG_CFLAGS="-g"
- DEBUG_CPPFLAGS=
- PROD_CFLAGS="-O"
- PROD_CPPFLAGS=
- PROFILE_CFLAGS="-pg"
- PROFILE_CPPFLAGS=
- ;;
+ gcc)
+ CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions
+ DEBUG_CFLAGS="-g -fverbose-asm"
+ DEBUG_CPPFLAGS=
+ PROD_CFLAGS="-O3 -fomit-frame-pointer"
+ PROD_CPPFLAGS=
+ PROFILE_CFLAGS="-pg"
+ PROFILE_CPPFLAGS=
+ ;;
+
+ cc)
+ CFLAGS="$CFLAGS"
+ DEBUG_CFLAGS="-g -h zero"
+ DEBUG_CPPFLAGS=
+ PROD_CFLAGS="-O2 -h scalar0"
+ PROD_CPPFLAGS=
+ PROFILE_CFLAGS="-pg"
+ PROFILE_CPPFLAGS=
+ ;;
+
+ *)
+ CFLAGS="$CFLAGS -ansi"
+ DEBUG_CFLAGS="-g"
+ DEBUG_CPPFLAGS=
+ PROD_CFLAGS="-O"
+ PROD_CPPFLAGS=
+ PROFILE_CFLAGS="-pg"
+ PROFILE_CPPFLAGS=
+ ;;
esac
diff --git a/config/unicosmk2.0.X b/config/unicosmk2.0.X
index 66f7c4c..319390d 100644
--- a/config/unicosmk2.0.X
+++ b/config/unicosmk2.0.X
@@ -28,8 +28,8 @@
# used within this file.
if test "X-" = "X-$CC"; then
- CC=cc
- CC_BASENAME=cc
+ CC=cc
+ CC_BASENAME=cc
fi
# no need to use RANLIB
RANLIB=:
@@ -88,35 +88,35 @@ RANLIB=:
# above).
case $CC_BASENAME in
- gcc)
- CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions
- DEBUG_CFLAGS="-g -fverbose-asm"
- DEBUG_CPPFLAGS=
+ gcc)
+ CFLAGS="$CFLAGS -Wsign-compare" #Only works for some versions
+ DEBUG_CFLAGS="-g -fverbose-asm"
+ DEBUG_CPPFLAGS=
PROD_CFLAGS="-O3 -fomit-frame-pointer"
- PROD_CPPFLAGS=
- PROFILE_CFLAGS="-pg"
- PROFILE_CPPFLAGS=
- ;;
+ PROD_CPPFLAGS=
+ PROFILE_CFLAGS="-pg"
+ PROFILE_CPPFLAGS=
+ ;;
- cc)
- CFLAGS="$CFLAGS"
- DEBUG_CFLAGS="-g -h zero"
- DEBUG_CPPFLAGS=
- PROD_CFLAGS="-O2 -h scalar0"
- PROD_CPPFLAGS=
- PROFILE_CFLAGS="-pg"
- PROFILE_CPPFLAGS=
- ;;
+ cc)
+ CFLAGS="$CFLAGS"
+ DEBUG_CFLAGS="-g -h zero"
+ DEBUG_CPPFLAGS=
+ PROD_CFLAGS="-O2 -h scalar0"
+ PROD_CPPFLAGS=
+ PROFILE_CFLAGS="-pg"
+ PROFILE_CPPFLAGS=
+ ;;
- *)
- CFLAGS="$CFLAGS -ansi"
- DEBUG_CFLAGS="-g"
- DEBUG_CPPFLAGS=
- PROD_CFLAGS="-O"
- PROD_CPPFLAGS=
- PROFILE_CFLAGS="-pg"
- PROFILE_CPPFLAGS=
- ;;
+ *)
+ CFLAGS="$CFLAGS -ansi"
+ DEBUG_CFLAGS="-g"
+ DEBUG_CPPFLAGS=
+ PROD_CFLAGS="-O"
+ PROD_CPPFLAGS=
+ PROFILE_CFLAGS="-pg"
+ PROFILE_CPPFLAGS=
+ ;;
esac
diff --git a/configure b/configure
index ced3dd1..cb9f025 100755
--- a/configure
+++ b/configure
@@ -1513,6 +1513,8 @@ host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+ DEFAULT_LIBS=""
+
echo "$as_me:$LINENO: checking shell variables initial values" >&5
@@ -4155,7 +4157,7 @@ test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
case $host in
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 4158 "configure"' > conftest.$ac_ext
+ echo '#line 4160 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -4696,7 +4698,7 @@ chmod -w .
save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -o out/conftest2.$ac_objext"
compiler_c_o=no
-if { (eval echo configure:4699: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
+if { (eval echo configure:4701: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
if test -s out/conftest.err; then
@@ -6503,7 +6505,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 6506 "configure"
+#line 6508 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -6601,7 +6603,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 6604 "configure"
+#line 6606 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -23678,7 +23680,6 @@ fi
USE_FILTER_SZIP="no"
- USE_FILTER_SZIP_ENCODER="no"
# Check whether --with-szlib or --without-szlib was given.
if test "${with_szlib+set}" = set; then
@@ -24172,14 +24173,8 @@ fi
if test ${hdf5_cv_szlib_can_encode} = "yes"; then
-
-cat >>confdefs.h <<\_ACEOF
-#define SZIP_CAN_ENCODE 1
-_ACEOF
-
echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
- USE_FILTER_SZIP_ENCODER="yes"
else
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
@@ -24189,6 +24184,11 @@ echo "${ECHO_T}no" >&6
EXTERNAL_FILTERS="${EXTERNAL_FILTERS},"
fi
EXTERNAL_FILTERS="${EXTERNAL_FILTERS}szip"
+ if test ${hdf5_cv_szlib_can_encode} = "yes"; then
+ EXTERNAL_FILTERS="${EXTERNAL_FILTERS}(encoder)"
+ else
+ EXTERNAL_FILTERS="${EXTERNAL_FILTERS}(no encoder)"
+ fi
fi
PABLO=""
@@ -25253,7 +25253,6 @@ else
fi
;;
-
no)
echo "$as_me:$LINENO: checking for GASS" >&5
echo $ECHO_N "checking for GASS... $ECHO_C" >&6
@@ -25261,7 +25260,6 @@ echo $ECHO_N "checking for GASS... $ECHO_C" >&6
echo "${ECHO_T}suppressed" >&6
unset GASS TESTGASS
;;
-
*)
case "$withval" in
*,*)
@@ -30263,7 +30261,7 @@ else
LD_LIBRARY_PATH="$LD_LIBRARY_PATH`echo $LDFLAGS | sed -e 's/-L/:/g' -e 's/ //g'`"
export LD_LIBRARY_PATH
-for hdf5_cv_printf_ll in l L ll q unknown; do
+for hdf5_cv_printf_ll in l ll L q unknown; do
if test "$cross_compiling" = yes; then
continue
else
@@ -30651,6 +30649,7 @@ if test "X-$TRACE" = X- ; then
TRACE=yes
fi
fi
+
case "X-$TRACE" in
X-yes)
echo "$as_me:$LINENO: result: yes" >&5
@@ -31078,10 +31077,8 @@ echo "$as_me: error: \'$enable_parallel\' is not a valid parallel search type" >
esac
if test -n "$PARALLEL"; then
- TESTPARALLEL=testpar
-fi
+ TESTPARALLEL=testpar
-if test -n "$PARALLEL"; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_PARALLEL 1
@@ -32098,11 +32095,13 @@ if (grep '^build_libtool_libs=yes' libtool >/dev/null); then
else
enable_shared=no
fi
+
if (grep '^build_old_libs=yes' libtool >/dev/null); then
enable_static=yes
else
enable_static=no
fi
+
if test "X$enable_static" = "Xyes" && test "X$enable_shared" = "Xyes"; then
STATIC_SHARED="static, shared"
elif test "X$enable_static" = "Xyes"; then
@@ -32171,8 +32170,6 @@ if test -n "$CPPFLAGS"; then
fi
-
-
HL=""
echo "$as_me:$LINENO: checking if high level library is enabled" >&5
echo $ECHO_N "checking if high level library is enabled... $ECHO_C" >&6
@@ -32191,7 +32188,6 @@ else
echo "no"
fi
-
COMMENCE=config/commence
CONCLUDE=config/conclude
@@ -32866,6 +32862,7 @@ s,@host_cpu@,$host_cpu,;t t
s,@host_vendor@,$host_vendor,;t t
s,@host_os@,$host_os,;t t
s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@DEFAULT_LIBS@,$DEFAULT_LIBS,;t t
s,@HSIZET@,$HSIZET,;t t
s,@CC@,$CC,;t t
s,@CFLAGS@,$CFLAGS,;t t
@@ -32894,7 +32891,6 @@ s,@LIBTOOL@,$LIBTOOL,;t t
s,@DEPEND@,,;t t
s,@USE_FILTER_DEFLATE@,$USE_FILTER_DEFLATE,;t t
s,@USE_FILTER_SZIP@,$USE_FILTER_SZIP,;t t
-s,@USE_FILTER_SZIP_ENCODER@,$USE_FILTER_SZIP_ENCODER,;t t
s,@PABLO@,$PABLO,;t t
s,@HAVE_PABLO@,$HAVE_PABLO,;t t
s,@SSL@,$SSL,;t t
@@ -33772,4 +33768,3 @@ IF_ENABLED_DISABLED "$THREADSAFE"
PRINT_N " High Level library"
IF_ENABLED_DISABLED "$HDF5_HL"
-
diff --git a/configure.in b/configure.in
index 167327f..a7f21af 100644
--- a/configure.in
+++ b/configure.in
@@ -47,6 +47,12 @@ AC_OUTPUT_COMMANDS([
AC_CANONICAL_HOST
AC_SUBST([CPPFLAGS])
+dnl Different compilers may need default libraries. They are specified in
+dnl the config/* files, so we put this statement here so that it'll be
+dnl set by the code which follows...
+dnl
+AC_SUBST(DEFAULT_LIBS) DEFAULT_LIBS=""
+
dnl ----------------------------------------------------------------------
dnl Set prefix default (install directory) to a directory in the build area.
dnl This allows multiple src-dir builds within one host.
@@ -894,7 +900,6 @@ dnl command-line switch. The value is an include path and/or a library path.
dnl If the library path is specified then it must be preceded by a comma.
dnl
AC_SUBST(USE_FILTER_SZIP) USE_FILTER_SZIP="no"
-AC_SUBST(USE_FILTER_SZIP_ENCODER) USE_FILTER_SZIP_ENCODER="no"
AC_ARG_WITH([szlib],
[AC_HELP_STRING([--with-szlib=DIR],
[Use szlib library for external szlib I/O
@@ -987,10 +992,7 @@ if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then
], [hdf5_cv_szlib_can_encode=yes], [hdf5_cv_szlib_can_encode=no],)])
if test ${hdf5_cv_szlib_can_encode} = "yes"; then
- AC_DEFINE([SZIP_CAN_ENCODE], [1],
- [Define if szip encoder is present])
AC_MSG_RESULT([yes])
- USE_FILTER_SZIP_ENCODER="yes"
else
AC_MSG_RESULT([no])
fi
@@ -1000,6 +1002,11 @@ if test "x$HAVE_SZLIB" = "xyes" -a "x$HAVE_SZLIB_H" = "xyes"; then
EXTERNAL_FILTERS="${EXTERNAL_FILTERS},"
fi
EXTERNAL_FILTERS="${EXTERNAL_FILTERS}szip"
+ if test ${hdf5_cv_szlib_can_encode} = "yes"; then
+ EXTERNAL_FILTERS="${EXTERNAL_FILTERS}(encoder)"
+ else
+ EXTERNAL_FILTERS="${EXTERNAL_FILTERS}(no encoder)"
+ fi
fi
dnl ----------------------------------------------------------------------
@@ -1140,13 +1147,11 @@ case "$withval" in
AC_CHECK_LIB(globus_gass_transfer,main,,unset GASS TESTGASS)
AC_CHECK_LIB(globus_gass_file,globus_gass_open,,unset GASS TESTGASS)
;;
-
no)
AC_MSG_CHECKING([for GASS])
AC_MSG_RESULT([suppressed])
unset GASS TESTGASS
;;
-
*)
case "$withval" in
*,*)
@@ -1613,7 +1618,7 @@ AC_CACHE_VAL([hdf5_cv_printf_ll],
LD_LIBRARY_PATH="$LD_LIBRARY_PATH`echo $LDFLAGS | sed -e 's/-L/:/g' -e 's/ //g'`"
export LD_LIBRARY_PATH
-for hdf5_cv_printf_ll in l L ll q unknown; do
+for hdf5_cv_printf_ll in l ll L q unknown; do
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
@@ -1785,6 +1790,7 @@ if test "X-$TRACE" = X- ; then
TRACE=yes
fi
fi
+
case "X-$TRACE" in
X-yes)
AC_MSG_RESULT([yes])
@@ -2012,16 +2018,12 @@ case "X-$enable_parallel" in
esac
dnl ----------------------------------------------------------------------
-dnl Should the 'testpar' directory participate in the build?
+dnl Print some other parallel information and do some sanity checks.
dnl
if test -n "$PARALLEL"; then
+ dnl The 'testpar' directory should participate in the build
TESTPARALLEL=testpar
-fi
-dnl ----------------------------------------------------------------------
-dnl Print some other parallel information and do some sanity checks.
-dnl
-if test -n "$PARALLEL"; then
dnl We are building a parallel library
AC_DEFINE([HAVE_PARALLEL], [1], [Define if we have parallel support])
@@ -2267,11 +2269,13 @@ if (grep '^build_libtool_libs=yes' libtool >/dev/null); then
else
enable_shared=no
fi
+
if (grep '^build_old_libs=yes' libtool >/dev/null); then
enable_static=yes
else
enable_static=no
fi
+
if test "X$enable_static" = "Xyes" && test "X$enable_shared" = "Xyes"; then
STATIC_SHARED="static, shared"
elif test "X$enable_static" = "Xyes"; then
@@ -2357,12 +2361,10 @@ if test -n "$CPPFLAGS"; then
CPPFLAGS=$TEMP_CPPFLAGS
fi
-
dnl ----------------------------------------------------------------------
dnl Check if they would like the High Level library compiled
dnl
-
AC_SUBST(HL) HL=""
AC_MSG_CHECKING([if high level library is enabled])
AC_ARG_ENABLE([hl],
@@ -2377,7 +2379,6 @@ if test "X$HDF5_HL" = "Xyes"; then
else
echo "no"
fi
-
dnl ----------------------------------------------------------------------
dnl Build the Makefiles. Almost every Makefile.in will begin with the line
@@ -2685,4 +2686,3 @@ IF_ENABLED_DISABLED "$THREADSAFE"
PRINT_N " High Level library"
IF_ENABLED_DISABLED "$HDF5_HL"
-
diff --git a/doc/html/Copyright.html b/doc/html/Copyright.html
index f5ce1aa..cf187b1 100644
--- a/doc/html/Copyright.html
+++ b/doc/html/Copyright.html
@@ -16,27 +16,27 @@
<br>
NCSA HDF5 (Hierarchical Data Format 5) Software Library and Utilities</h3>
<hr>
-
-<font size="-1">
<p>
-
+
+
NCSA HDF5 (Hierarchical Data Format 5) Software Library and Utilities
<br>
Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004 by
the Board of Trustees of the University of Illinois
<br>
<strong>All rights reserved.</strong>
-
<p>
+
Contributors: National Center for Supercomputing Applications (NCSA) at
the University of Illinois at Urbana-Champaign (UIUC), Lawrence Livermore
National Laboratory (LLNL), Sandia National Laboratories (SNL), Los Alamos
National Laboratory (LANL), Jean-loup Gailly and Mark Adler (gzip library).
-
<p>
+
Redistribution and use in source and binary forms, with or without
modification, are permitted for any purpose (including commercial purposes)
provided that the following conditions are met:
+<p>
<ol>
<li>Redistributions of source code must retain the above copyright notice,
@@ -65,10 +65,12 @@ WITH NO WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED. In no event
shall the University or the Contributors be liable for any damages suffered
by the users arising out of the use of this software, even if advised of
the possibility of such damage.
+
</ol>
+
<hr>
Portions of HDF5 were developed with support from the University of
California, Lawrence Livermore National Laboratory (UC LLNL).
@@ -82,8 +84,7 @@ documentation, and/or accompanying materials:
W-7405-ENG-48 (Contract 48) between the U.S. Department of Energy
(DOE) and The Regents of the University of California (University)
for the operation of UC LLNL.
-
- <br><br>
+ <p>
<b>DISCLAIMER:</b>
This work was prepared as an account of work sponsored by an agency
of the United States Government. Neither the United States
@@ -101,7 +102,8 @@ documentation, and/or accompanying materials:
United States Government or the University of California, and shall
not be used for advertising or product endorsement purposes.
</dir>
-</font>
+
+<hr>
<!-- #BeginLibraryItem "/ed_libs/Footer.lbi" --><address>
<a href="mailto:hdfhelp@ncsa.uiuc.edu">HDF Help Desk</a>
@@ -113,6 +115,7 @@ document.writeln("Last modified: 23 January 2004");
-->
</SCRIPT>
+
</body>
</html>
diff --git a/doc/html/Datasets.html b/doc/html/Datasets.html
index ccea555..eca195d 100644
--- a/doc/html/Datasets.html
+++ b/doc/html/Datasets.html
@@ -314,7 +314,7 @@ H5Pset_chunk (plist, 2, size);
external data then zero is returned.
<br><br>
- <dt><code>herr_t H5Pget_external (hid_t <em>plist</em>, int
+ <dt><code>herr_t H5Pget_external (hid_t <em>plist</em>, unsigned
<em>idx</em>, size_t <em>name_size</em>, char *<em>name</em>, off_t
*<em>offset</em>, hsize_t *<em>size</em>)</code>
<dd>This is the counterpart for the <code>H5Pset_external()</code>
@@ -800,7 +800,7 @@ H5Pset_external (plist, "scan3.data", 0, 16);
<p><code><pre>
1 hid_t file, mem_space, file_space, dataset;
2 double dd[200][400];
- 3 hssize_t offset[2];
+ 3 hsize_t offset[2];
4 hsize size[2];
5
6 /*
diff --git a/doc/html/Dataspaces.html b/doc/html/Dataspaces.html
index b19e0c3..c83d285 100644
--- a/doc/html/Dataspaces.html
+++ b/doc/html/Dataspaces.html
@@ -438,7 +438,7 @@ portions of a dataspace may be added in the future.
<DL>
<DT>
<TT>herr_t H5Sselect_hyperslab (hid_t <I>space</I>, h5s_seloper_t <I>op</I>,
- const hssize_t * <I>start</I>, const hsize_t * <I>stride</I>,
+ const hsize_t * <I>start</I>, const hsize_t * <I>stride</I>,
const hsize_t * <I>count</I>, const hsize_t * <I>block</I>)</TT></DT>
<DD>
@@ -488,7 +488,7 @@ I/O is performed.
<DT>
<TT>herr_t H5Sselect_elements (hid_t <I>space</I>, h5s_seloper_t <I>op</I>,
- const size_t <I>num_elements</I>, const hssize_t *<I>coord</I>[])</TT></DT>
+ const size_t <I>num_elements</I>, const hsize_t *<I>coord</I>[])</TT></DT>
<DD>
This function selects array elements to be included in the selection for the
diff --git a/doc/html/Datatypes.html b/doc/html/Datatypes.html
index f738d44..232d7fb 100644
--- a/doc/html/Datatypes.html
+++ b/doc/html/Datatypes.html
@@ -610,7 +610,7 @@
<code>H5Tget_nmembers()</code> returns -1 on failure.
<br><br>
- <dt><code>char *H5Tget_member_name (hid_t <em>type</em>, int
+ <dt><code>char *H5Tget_member_name (hid_t <em>type</em>, unsigned
<em>membno</em>)</code>
<dd>Each member has a name which is unique among its siblings in
a compound datatype. This function returns a pointer to a
@@ -620,7 +620,7 @@
function.
<br><br>
- <dt><code>size_t H5Tget_member_offset (hid_t <em>type</em>, int
+ <dt><code>size_t H5Tget_member_offset (hid_t <em>type</em>, unsigned
<em>membno</em>)</code>
<dd>The byte offset of member number <em>membno</em> with
respect to the beginning of the containing compound datum is
@@ -631,7 +631,7 @@
<em>membno</em> arguments.
<br><br>
- <dt><code>hid_t H5Tget_member_type (hid_t <em>type</em>, int
+ <dt><code>hid_t H5Tget_member_type (hid_t <em>type</em>, unsigned
<em>membno</em>)</code>
<dd>Each member has its own datatype, a copy of which is
returned by this function. The returned datatype identifier
@@ -1297,7 +1297,7 @@ H5Tlock(hdf_fr_colors);</pre>
datatypes.
<br><br>
- <dt><code>char *H5Tget_member_name(hid_t <em>etype</em>, int
+ <dt><code>char *H5Tget_member_name(hid_t <em>etype</em>, unsigned
<em>membno</em>)</code>
<dd>Given an enumeration datatype <em>etype</em> this function
returns the symbol name for the member indexed by
@@ -1310,7 +1310,7 @@ H5Tlock(hdf_fr_colors);</pre>
<code>free()</code>.
<br><br>
- <dt><code>herr_t H5Tget_member_value(hid_t <em>etype</em>, int
+ <dt><code>herr_t H5Tget_member_value(hid_t <em>etype</em>, unsigned
<em>membno</em>, void *<em>value</em>/*out*/)</code>
<dd>Given an enumeration datatype <em>etype</em> this function
returns the value associated with the member indexed by
@@ -1325,12 +1325,13 @@ H5Tlock(hdf_fr_colors);</pre>
when the type is not known by the C compiler.
<pre>
-int i, n = H5Tget_nmembers(hdf_en_colors);
-for (i=0; i&lt;n; i++) {
- char *symbol = H5Tget_member_name(hdf_en_colors, i);
+int n = H5Tget_nmembers(hdf_en_colors);
+unsigned u;
+for (u=0; u&lt;(unsigned)n; u++) {
+ char *symbol = H5Tget_member_name(hdf_en_colors, u);
short val;
- H5Tget_member_value(hdf_en_colors, i, &amp;val);
- printf("#%d %20s = %d\n", i, symbol, val);
+ H5Tget_member_value(hdf_en_colors, u, &amp;val);
+ printf("#%u %20s = %d\n", u, symbol, val);
free(symbol);
}</pre>
@@ -1502,13 +1503,13 @@ int n = H5Tget_nmembers(foreign);
hid_t itype = H5Tget_super(foreign);
void *val = malloc(n * MAX(H5Tget_size(itype), sizeof(int)));
char *name = malloc(n * sizeof(char*));
-int i;
+unsigned u;
/* Get foreign type information */
-for (i=0; i&lt;n; i++) {
- name[i] = H5Tget_member_name(foreign, i);
- H5Tget_member_value(foreign, i,
- (char*)val+i*H5Tget_size(foreign));
+for (u=0; u&lt;(unsigned)n; u++) {
+ name[u] = H5Tget_member_name(foreign, u);
+ H5Tget_member_value(foreign, u,
+ (char*)val+u*H5Tget_size(foreign));
}
/* Convert integer values to new type */
diff --git a/doc/html/DatatypesEnum.html b/doc/html/DatatypesEnum.html
index 2926e7c..607030a 100644
--- a/doc/html/DatatypesEnum.html
+++ b/doc/html/DatatypesEnum.html
@@ -239,7 +239,7 @@ H5Tlock(hdf_fr_colors);</pre>
types.
<br><br>
- <dt><code>char *H5Tget_member_name(hid_t <em>etype</em>, int
+ <dt><code>char *H5Tget_member_name(hid_t <em>etype</em>, unsigned
<em>membno</em>)</code>
<dd>Given an enumeration data type <em>etype</em> this function
returns the symbol name for the member indexed by
@@ -252,7 +252,7 @@ H5Tlock(hdf_fr_colors);</pre>
<code>free()</code>.
<br><br>
- <dt><code>herr_t H5Tget_member_value(hid_t <em>etype</em>, int
+ <dt><code>herr_t H5Tget_member_value(hid_t <em>etype</em>, unsigned
<em>membno</em>, void *<em>value</em>/*out*/)</code>
<dd>Given an enumeration data type <em>etype</em> this function
returns the value associated with the member indexed by
@@ -267,12 +267,13 @@ H5Tlock(hdf_fr_colors);</pre>
when the type is not known by the C compiler.
<pre>
-int i, n = H5Tget_nmembers(hdf_en_colors);
-for (i=0; i&lt;n; i++) {
- char *symbol = H5Tget_member_name(hdf_en_colors, i);
+int n = H5Tget_nmembers(hdf_en_colors);
+unsigned u;
+for (u=0; u&lt;(unsigned)n; u++) {
+ char *symbol = H5Tget_member_name(hdf_en_colors, u);
short val;
- H5Tget_member_value(hdf_en_colors, i, &amp;val);
- printf("#%d %20s = %d\n", i, symbol, val);
+ H5Tget_member_value(hdf_en_colors, u, &amp;val);
+ printf("#%u %20s = %d\n", u, symbol, val);
free(symbol);
}</pre>
@@ -445,13 +446,13 @@ int n = H5Tget_nmembers(foreign);
hid_t itype = H5Tget_super(foreign);
void *val = malloc(n * MAX(H5Tget_size(itype), sizeof(int)));
char *name = malloc(n * sizeof(char*));
-int i;
+unsigned u;
/* Get foreign type information */
-for (i=0; i&lt;n; i++) {
- name[i] = H5Tget_member_name(foreign, i);
- H5Tget_member_value(foreign, i,
- (char*)val+i*H5Tget_size(foreign));
+for (u=0; u&lt;(unsigned)n; u++) {
+ name[u] = H5Tget_member_name(foreign, u);
+ H5Tget_member_value(foreign, u,
+ (char*)val+u*H5Tget_size(foreign));
}
/* Convert integer values to new type */
diff --git a/doc/html/H5.intro.html b/doc/html/H5.intro.html
index d4689cd..b0cee5f 100644
--- a/doc/html/H5.intro.html
+++ b/doc/html/H5.intro.html
@@ -1387,7 +1387,7 @@ A hyperslab specifies a regular pattern of elements in a dataset. It is also po
hsize_t dim2[] = {MSPACE2_DIM}; /* Dimension size of the second
dataset (in memory) */
int values[] = {53, 59, 61, 67}; /* New values to be written */
-hssize_t coord[NPOINTS][FSPACE_RANK]; /* Array to store selected points
+hsize_t coord[NPOINTS][FSPACE_RANK]; /* Array to store selected points
from the file dataspace */
/*
@@ -1404,7 +1404,7 @@ coord[2][0] = 3; coord[2][1] = 5;
coord[3][0] = 5; coord[3][1] = 6;
ret = H5Sselect_elements(fid, H5S_SELECT_SET, NPOINTS,
- (const hssize_t **)coord);
+ (const hsize_t **)coord);
/*
* Write new selection of points to the dataset.
diff --git a/doc/html/Intro/IntroExamples.html b/doc/html/Intro/IntroExamples.html
index 9d1c833..dd4022a 100644
--- a/doc/html/Intro/IntroExamples.html
+++ b/doc/html/Intro/IntroExamples.html
@@ -246,9 +246,9 @@ main (void)
int data_out[NX][NY][NZ ]; /* output buffer */
hsize_t count[2]; /* size of the hyperslab in the file */
- hssize_t offset[2]; /* hyperslab offset in the file */
+ hsize_t offset[2]; /* hyperslab offset in the file */
hsize_t count_out[3]; /* size of the hyperslab in memory */
- hssize_t offset_out[3]; /* hyperslab offset in memory */
+ hsize_t offset_out[3]; /* hyperslab offset in memory */
int i, j, k, status_n, rank;
for (j = 0; j < NX; j++) {
@@ -404,12 +404,12 @@ int main (void)
hsize_t fdim[] = {FSPACE_DIM1, FSPACE_DIM2};
/* Dimension sizes of the dataset (on disk) */
- hssize_t start[2]; /* Start of hyperslab */
+ hsize_t start[2]; /* Start of hyperslab */
hsize_t stride[2]; /* Stride of hyperslab */
hsize_t count[2]; /* Block count */
hsize_t block[2]; /* Block sizes */
- hssize_t coord[NPOINTS][FSPACE_RANK]; /* Array to store selected points
+ hsize_t coord[NPOINTS][FSPACE_RANK]; /* Array to store selected points
from the file dataspace */
herr_t ret;
uint i,j;
@@ -504,7 +504,7 @@ int main (void)
coord[3][0] = 5; coord[3][1] = 6;
ret = H5Sselect_elements(fid, H5S_SELECT_SET, NPOINTS,
- (const hssize_t **)coord);
+ (const hsize_t **)coord);
/*
* Write new selection of points to the dataset.
@@ -779,7 +779,7 @@ main (void)
hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED};
hsize_t chunk_dims[2] ={2, 5};
hsize_t size[2];
- hssize_t offset[2];
+ hsize_t offset[2];
herr_t status;
@@ -956,7 +956,7 @@ main (void)
hsize_t chunk_dims[2];
hsize_t col_dims[1];
hsize_t count[2];
- hssize_t offset[2];
+ hsize_t offset[2];
herr_t status, status_n;
@@ -1117,7 +1117,7 @@ main (void)
H5Fclose(file);
return 0;
-)
+}
</pre>
@@ -1851,18 +1851,18 @@ and then written to the dataset in the file.
int
main(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dset1, /* Dataset ID */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dset1, /* Dataset ID */
dset2; /* Dereferenced dataset ID */
- hid_t sid1, /* Dataspace ID #1 */
+ hid_t sid1, /* Dataspace ID #1 */
sid2; /* Dataspace ID #2 */
- hsize_t dims1[] = {SPACE1_DIM1},
+ hsize_t dims1[] = {SPACE1_DIM1},
dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
- hssize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
- hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */
- hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */
- hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */
- hssize_t coord1[POINT1_NPOINTS][SPACE2_RANK];
+ hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
+ hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */
+ hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */
+ hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */
+ hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK];
/* Coordinates for point selection */
hdset_reg_ref_t *wbuf; /* buffer to write to disk */
int *dwbuf; /* Buffer for writing numeric data to disk */
@@ -1921,7 +1921,7 @@ main(void)
coord1[7][0]=9; coord1[7][1]=0;
coord1[8][0]=7; coord1[8][1]=1;
coord1[9][0]=3; coord1[9][1]=3;
- ret = H5Sselect_elements(sid2,H5S_SELECT_SET,POINT1_NPOINTS,(const hssize_t **)coord1);
+ ret = H5Sselect_elements(sid2,H5S_SELECT_SET,POINT1_NPOINTS,(const hsize_t **)coord1);
/* Store second dataset region */
ret = H5Rcreate(&wbuf[1],fid1,"/Dataset2",H5R_DATASET_REGION,sid2);
@@ -1988,8 +1988,8 @@ main(void)
hid_t sid1, /* Dataspace ID #1 */
sid2; /* Dataspace ID #2 */
hsize_t * coords; /* Coordinate buffer */
- hssize_t low[SPACE2_RANK]; /* Selection bounds */
- hssize_t high[SPACE2_RANK]; /* Selection bounds */
+ hsize_t low[SPACE2_RANK]; /* Selection bounds */
+ hsize_t high[SPACE2_RANK]; /* Selection bounds */
hdset_reg_ref_t *rbuf; /* buffer to to read disk */
int *drbuf; /* Buffer for reading numeric data from disk */
int i, j; /* counting variables */
diff --git a/doc/html/RM_H5.html b/doc/html/RM_H5.html
index 08eadf5..37fe74d 100644
--- a/doc/html/RM_H5.html
+++ b/doc/html/RM_H5.html
@@ -234,14 +234,17 @@ as the corresponding C function.
the 1 is the release number, <code>relnum</code>.
-->
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>unsigned </em><code>majnum</code>
- <dd>IN: The major version of the library.
- <dt><em>unsigned </em><code>minnum</code>
- <dd>IN: The minor version of the library.
- <dt><em>unsigned </em><code>relnum</code>
- <dd>IN: The release number of the library.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>unsigned </em><code>majnum</code></td>
+ <td valign="top">IN: The major version of the library.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned&nbsp;</em><code>minnum&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: The minor version of the library.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned </em><code>relnum</code></td>
+ <td valign="top">IN: The release number of the library.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful.
Upon failure, this function causes the application to abort.
@@ -423,14 +426,17 @@ END SUBROUTINE h5garbage_collect_f
numbers of the version of the HDF library which is linked to
the application.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>unsigned *</em><code>majnum</code>
- <dd>OUT: The major version of the library.
- <dt><em>unsigned *</em><code>minnum</code>
- <dd>OUT: The minor version of the library.
- <dt><em>unsigned *</em><code>relnum</code>
- <dd>OUT: The release number of the library.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>unsigned *</em><code>majnum</code></td>
+ <td valign="top">OUT: The major version of the library.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned&nbsp;*</em><code>minnum&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: The minor version of the library.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned *</em><code>relnum</code></td>
+ <td valign="top">OUT: The release number of the library.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -553,20 +559,26 @@ END SUBROUTINE h5open_f
Using a value of <code>-1</code> for a limit means that
no limit is set for the specified type of free list.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>int</em> <code>reg_global_lim</code>
- <dd>IN: The limit on all regular free list memory used
- <dt><em>int</em> <code>reg_list_lim</code>
- <dd>IN: The limit on memory used in each regular free list
- <dt><em>int</em> <code>arr_global_lim</code>
- <dd>IN: The limit on all array free list memory used
- <dt><em>int</em> <code>arr_list_lim</code>
- <dd>IN: The limit on memory used in each array free list
- <dt><em>int</em> <code>blk_global_lim</code>
- <dd>IN: The limit on all block free list memory used
- <dt><em>int</em> <code>blk_list_lim</code>
- <dd>IN: The limit on memory used in each block free list
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>int</em>&nbsp;<code>reg_global_lim&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: The limit on all regular free list memory used</td></tr>
+ <tr>
+ <td valign="top"><em>int</em> <code>reg_list_lim</code></td>
+ <td valign="top">IN: The limit on memory used in each regular free list</td></tr>
+ <tr>
+ <td valign="top"><em>int</em> <code>arr_global_lim</code></td>
+ <td valign="top">IN: The limit on all array free list memory used</td></tr>
+ <tr>
+ <td valign="top"><em>int</em> <code>arr_list_lim</code></td>
+ <td valign="top">IN: The limit on memory used in each array free list</td></tr>
+ <tr>
+ <td valign="top"><em>int</em> <code>blk_global_lim</code></td>
+ <td valign="top">IN: The limit on all block free list memory used</td></tr>
+ <tr>
+ <td valign="top"><em>int</em> <code>blk_list_lim</code></td>
+ <td valign="top">IN: The limit on memory used in each block free list</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
diff --git a/doc/html/RM_H5A.html b/doc/html/RM_H5A.html
index 82a3e61..334219a 100644
--- a/doc/html/RM_H5A.html
+++ b/doc/html/RM_H5A.html
@@ -208,10 +208,11 @@ See <a href="Attributes.html"><cite>Attributes</cite></a> in the
Further use of a released attribute identifier is illegal;
a function using such an identifier will fail.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>attr_id</code>
- <dd>IN: Attribute to release access to.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>attr_id</code></td>
+ <td>IN: Attribute to release access to.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -240,11 +241,11 @@ END SUBROUTINE h5aclose_f
<dl>
<dt><strong>Name:</strong> <a name="Annot-Create">H5Acreate</a>
<dt><strong>Signature:</strong>
- <dd><font size="-1"><em>hid_t</em> <code>H5Acreate</code>(<em>hid_t</em> <code>loc_id</code>,
+ <dd><em>hid_t</em> <code>H5Acreate</code>(<em>hid_t</em> <code>loc_id</code>,
<em>const char *</em><code>name</code>,
<em>hid_t</em> <code>type_id</code>,
<em>hid_t</em> <code>space_id</code>,
- <em>hid_t</em> <code>create_plist</code></font>
+ <em>hid_t</em> <code>create_plist</code>
)
<dt><strong>Purpose:</strong>
<dd>Creates a dataset as an attribute of another group, dataset,
@@ -275,19 +276,24 @@ END SUBROUTINE h5aclose_f
The attribute identifier returned from this function must be released
with <code>H5Aclose</code> or resource leaks will develop.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>loc_id</code></dt>
- <dd>IN: Object (dataset, group, or named datatype) to be attached to.</dd>
- <dt><em>const char *</em><code>name</code></dt>
- <dd>IN: Name of attribute to create.</dd>
- <dt><em>hid_t</em> <code>type_id</code></dt>
- <dd>IN: Identifier of datatype for attribute.</dd>
- <dt><em>hid_t</em> <code>space_id</code></dt>
- <dd>IN: Identifier of dataspace for attribute.</dd>
- <dt><em>hid_t</em> <code>create_plist</code></dt>
- <dd>IN: Identifier of creation property list. (Currently unused;
- the only accepted value is <code>H5P_DEFAULT</code>.)</dd>
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>loc_id</code></td>
+ <td valign="top">IN: Object (dataset, group, or named datatype) to be attached to.</td></tr>
+ <tr>
+ <td valign="top"><em>const char *</em><code>name</code></td>
+ <td valign="top">IN: Name of attribute to create.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>type_id</code></td>
+ <td valign="top">IN: Identifier of datatype for attribute.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>space_id</code></td>
+ <td valign="top">IN: Identifier of dataspace for attribute.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>create_plist&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of creation property list. (Currently unused;
+ the only accepted value is <code>H5P_DEFAULT</code>.)</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns an attribute identifier if successful;
otherwise returns a negative value.
@@ -338,13 +344,15 @@ END SUBROUTINE h5acreate_f
of the attributes to change and future writes to the open
attributes to produce incorrect results.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>loc_id</code>
- <dd>IN: Identifier of the dataset, group, or named datatype
- to have the attribute deleted from.
- <dt><em>const char *</em><code>name</code>
- <dd>IN: Name of the attribute to delete.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>loc_id</code></td>
+ <td valign="top">IN: Identifier of the dataset, group, or named datatype
+ to have the attribute deleted from.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;char&nbsp;*</em><code>name&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Name of the attribute to delete.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -389,14 +397,17 @@ END SUBROUTINE h5adelete_f
<code>(buf_size -1)</code>, the string terminator is stored in the
last position of the buffer to properly terminate the string.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>attr_id</code>
- <dd>IN: Identifier of the attribute.
- <dt><em>size_t</em> <code>buf_size</code>
- <dd>IN: The size of the buffer to store the name in.
- <dt><em>char *</em><code>buf</code>
- <dd>IN: Buffer to store name in.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>attr_id</code></td>
+ <td valign="top">IN: Identifier of the attribute.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t</em>&nbsp;<code>buf_size&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: The size of the buffer to store the name in.</td></tr>
+ <tr>
+ <td valign="top"><em>char *</em><code>buf</code></td>
+ <td valign="top">IN: Buffer to store name in.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the length of the attribute's name, which may be
longer than <code>buf_size</code>, if successful.
@@ -437,10 +448,11 @@ END SUBROUTINE h5aget_name_f
<code>loc_id</code>.
The object can be a group, dataset, or named datatype.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>loc_id</code>
- <dd>IN: Identifier of a group, dataset, or named datatype.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>loc_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of a group, dataset, or named datatype.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the number of attributes if successful;
otherwise returns a negative value.
@@ -479,10 +491,11 @@ END SUBROUTINE h5aget_num_attrs_f
this function must be released with <code>H5Sclose</code>
or resource leaks will develop.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>attr_id</code>
- <dd>IN: Identifier of an attribute.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>attr_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of an attribute.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns attribute dataspace identifier if successful;
otherwise returns a negative value.
@@ -527,10 +540,11 @@ END SUBROUTINE h5aget_space_f
The datatype identifier returned from this function must be
released with <code>H5Tclose</code> or resource leaks will develop.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>attr_id</code>
- <dd>IN: Identifier of an attribute.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>attr_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of an attribute.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a datatype identifier if successful;
otherwise returns a negative value.
@@ -603,16 +617,20 @@ END SUBROUTINE h5aget_type_f
attribute.
</ul>
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>loc_id</code>
- <dd>IN: Identifier of a group, dataset or named datatype.
- <dt><em>unsigned *</em> <code>idx</code>
- <dd>IN/OUT: Starting (IN) and ending (OUT) attribute index.
- <dt><em>H5A_operator_t</em> <code>op</code>
- <dd>IN: User's function to pass each attribute to
- <dt><em>void *</em><code>op_data</code>
- <dd>IN/OUT: User's data to pass through to iterator operator function
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>loc_id</code></td>
+ <td valign="top">IN: Identifier of a group, dataset or named datatype.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned *</em> <code>idx</code></td>
+ <td valign="top">IN/OUT: Starting (IN) and ending (OUT) attribute index.</td></tr>
+ <tr>
+ <td valign="top"><em>H5A_operator_t</em>&nbsp;<code>op&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: User's function to pass each attribute to</td></tr>
+ <tr>
+ <td valign="top"><em>void *</em><code>op_data</code></td>
+ <td valign="top">IN/OUT: User's data to pass through to iterator operator function</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>If successful, returns the return value of the last operator
if it was non-zero, or zero if all attributes were processed.
@@ -655,13 +673,15 @@ SUBROUTINE
The attribute identifier returned from this function must be
released with <code>H5Aclose</code> or resource leaks will develop.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>loc_id</code>
- <dd>IN: Identifier of the group, dataset, or named datatype
- attribute to be attached to.
- <dt><em>unsigned int</em> <code>idx</code>
- <dd>IN: Index of the attribute to open.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>loc_id</code></td>
+ <td valign="top">IN: Identifier of the group, dataset, or named datatype
+ attribute to be attached to.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned&nbsp;int</em>&nbsp;<code>idx&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Index of the attribute to open.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns attribute identifier if successful;
otherwise returns a negative value.
@@ -707,13 +727,15 @@ END SUBROUTINE h5aopen_idx_f
be released with <code>H5Aclose</code> or resource leaks
will develop.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>loc_id</code>
- <dd>IN: Identifier of a group, dataset, or named datatype
- atttribute to be attached to.
- <dt><em>const char *</em><code>name</code>
- <dd>IN: Attribute name.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>loc_id</code></td>
+ <td valign="top">IN: Identifier of a group, dataset, or named datatype
+ atttribute to be attached to.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;char&nbsp;*</em><code>name&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Attribute name.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns attribute identifier if successful;
otherwise returns a negative value.
@@ -764,14 +786,17 @@ END SUBROUTINE h5aopen_name_f
data conversion, including the range of conversions currently
supported by the HDF5 libraries.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>attr_id</code>
- <dd>IN: Identifier of an attribute to read.
- <dt><em>hid_t</em> <code>mem_type_id</code>
- <dd>IN: Identifier of the attribute datatype (in memory).
- <dt><em>void *</em><code>buf</code>
- <dd>OUT: Buffer for data to be read.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>attr_id</code></td>
+ <td valign="top">IN: Identifier of an attribute to read.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>mem_type_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of the attribute datatype (in memory).</td></tr>
+ <tr>
+ <td valign="top"><em>void *</em><code>buf</code></td>
+ <td valign="top">OUT: Buffer for data to be read.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -831,14 +856,17 @@ END SUBROUTINE h5aread_f
data conversion, including the range of conversions currently
supported by the HDF5 libraries.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>attr_id</code>
- <dd>IN: Identifier of an attribute to write.
- <dt><em>hid_t</em> <code>mem_type_id</code>
- <dd>IN: Identifier of the attribute datatype (in memory).
- <dt><em>const void *</em><code>buf</code>
- <dd>IN: Data to be written.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>attr_id</code></td>
+ <td valign="top">IN: Identifier of an attribute to write.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>mem_type_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of the attribute datatype (in memory).</td></tr>
+ <tr>
+ <td valign="top"><em>const void *</em><code>buf</code></td>
+ <td valign="top">IN: Data to be written.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
diff --git a/doc/html/RM_H5D.html b/doc/html/RM_H5D.html
index c185245..3c72863 100644
--- a/doc/html/RM_H5D.html
+++ b/doc/html/RM_H5D.html
@@ -210,10 +210,11 @@ as the corresponding C function.
Further use of the dataset identifier is illegal in calls to
the dataset API.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>dataset_id</code>
- <dd>IN: Identifier of the dataset to close access to.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>dataset_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of the dataset to close access to.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -297,15 +298,15 @@ END SUBROUTINE h5dclose_f
<table width=80% border="0">
<tr valign="top" align="left"><td width=10%>&nbsp;
</td><td width=45%>
- <a href="#Dataset-Fill">H5Dfill</a><br>
- <a href="RM_H5P.html#Property-SetFillValue">H5Pset_fill_value</a><br>
- <a href="RM_H5P.html#Property-GetFillValue">H5Pget_fill_value</a><br>
- <a href="RM_H5P.html#Property-FillValueDefined">H5Pfill_value_defined</a>
+ <a href="#Dataset-Fill"><code>H5Dfill</code></a><br>
+ <a href="RM_H5P.html#Property-SetFillValue"><code>H5Pset_fill_value</code></a><br>
+ <a href="RM_H5P.html#Property-GetFillValue"><code>H5Pget_fill_value</code></a><br>
+ <a href="RM_H5P.html#Property-FillValueDefined"><code>H5Pfill_value_defined</code></a>
</td><td width=45%>
- <a href="RM_H5P.html#Property-SetFillTime">H5Pset_fill_time</a><br>
- <a href="RM_H5P.html#Property-GetFillTime">H5Pget_fill_time</a><br>
- <a href="RM_H5P.html#Property-SetAllocTime">H5Pset_alloc_time</a><br>
- <a href="RM_H5P.html#Property-GetAllocTime">H5Pget_alloc_time</a>
+ <a href="RM_H5P.html#Property-SetFillTime"><code>H5Pset_fill_time</code></a><br>
+ <a href="RM_H5P.html#Property-GetFillTime"><code>H5Pget_fill_time</code></a><br>
+ <a href="RM_H5P.html#Property-SetAllocTime"><code>H5Pset_alloc_time</code></a><br>
+ <a href="RM_H5P.html#Property-GetAllocTime"><code>H5Pget_alloc_time</code></a>
</td></tr>
</table>
This information is also included in the
@@ -336,21 +337,27 @@ END SUBROUTINE h5dclose_f
Other known similar problems can occur with . . .
-->
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>loc_id</code>
- <dd>IN: Identifier of the file or group
- within which to create the dataset.
- <dt><em>const char *</em> <code>name</code>
- <dd>IN: The name of the dataset to create.
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>IN: Identifier of the datatype to use
- when creating the dataset.
- <dt><em>hid_t</em> <code>space_id</code>
- <dd>IN: Identifier of the dataspace to use
- when creating the dataset.
- <dt><em>hid_t</em> <code>create_plist_id</code>
- <dd>IN: Identifier of the set creation property list.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>loc_id</code></td>
+ <td valign="top">IN: Identifier of the file or group
+ within which to create the dataset.</td></tr>
+ <tr>
+ <td valign="top"><em>const char *</em> <code>name</code></td>
+ <td valign="top">IN: The name of the dataset to create.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>type_id</code></td>
+ <td valign="top">IN: Identifier of the datatype to use
+ when creating the dataset.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>space_id</code></td>
+ <td valign="top">IN: Identifier of the dataspace to use
+ when creating the dataset.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>create_plist_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of the set creation property list.</td></tr>
+ </table></ul>
+<!-- NEW PAGE -->
<dt><strong>Returns:</strong>
<dd>Returns a dataset identifier if successful;
otherwise returns a negative value.
@@ -412,12 +419,14 @@ END SUBROUTINE h5dcreate_f
<a href="RM_H5P.html#Property-SetAllocTime">H5Pset_alloc_time</a>.)
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>dataset_id</code>
- <dd>IN: Identifier of the dataset.
- <dt><em>const hsize_t *</em> <code>size</code>
- <dd>IN: Array containing the new magnitude of each dimension.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>dataset_id</code></td>
+ <td valign="top">IN: Identifier of the dataset.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;hsize_t&nbsp;*</em>&nbsp;<code>size&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Array containing the new magnitude of each dimension.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -491,20 +500,25 @@ END SUBROUTINE h5dextend_f
and
<a href="#Dataset-Create">H5Dcreate</a>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>const void *</em><code>fill</code>
- <dd>IN: Pointer to the fill value to be used.
- <dt><em>hid_t </em><code>fill_type_id</code>
- <dd>IN: Fill value datatype identifier.
- <dt><em>void *</em><code>buf</code>
- <dd>IN/OUT: Pointer to the memory buffer containing the
- selection to be filled.
- <dt><em>hid_t </em><code>buf_type_id</code>
- <dd>IN: Datatype of dataspace elements to be filled.
- <dt><em>hid_t </em><code>space_id</code>
- <dd>IN: Dataspace describing memory buffer and
- containing the selection to be filled.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>const void *</em><code>fill</code></td>
+ <td valign="top">IN: Pointer to the fill value to be used.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t&nbsp;</em><code>fill_type_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Fill value datatype identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>void *</em><code>buf</code></td>
+ <td valign="top">IN/OUT: Pointer to the memory buffer containing the
+ selection to be filled.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t </em><code>buf_type_id</code></td>
+ <td valign="top">IN: Datatype of dataspace elements to be filled.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t </em><code>space_id</code></td>
+ <td valign="top">IN: Dataspace describing memory buffer and
+ containing the selection to be filled.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -550,10 +564,11 @@ END SUBROUTINE h5dfill_f
The creation property list identifier should be released with
the <code>H5Pclose</code> function.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>dataset_id</code>
- <dd>IN: Identifier of the dataset to query.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>dataset_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of the dataset to query.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a dataset creation property list identifier if successful;
otherwise returns a negative value.
@@ -594,10 +609,11 @@ END SUBROUTINE h5dget_create_plist_f
That address is expressed as the offset in bytes from
the beginning of the file.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t </em><code>dset_id</code>
- <dd>Dataset identifier.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t&nbsp;</em><code>dset_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Dataset identifier.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the offset in bytes;
otherwise returns <code>HADDR_UNDEF</code>, a negative value.
@@ -633,10 +649,11 @@ SUBROUTINE
The dataspace identifier should be released with the
<code>H5Sclose</code> function.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>dataset_id</code>
- <dd>IN: Identifier of the dataset to query.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>dataset_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of the dataset to query.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a dataspace identifier if successful;
otherwise returns a negative value.
@@ -679,15 +696,15 @@ END SUBROUTINE h5dget_space_f
<center>
<table border="0">
<tr valign="top"><td rowspan="3">&nbsp;&nbsp;&nbsp;&nbsp;</td><td>
- H5D_SPACE_STATUS_NOT_ALLOCATED
+ <code>H5D_SPACE_STATUS_NOT_ALLOCATED</code>
</td><td>
Space has not been allocated for this dataset.
</td></tr><tr valign="top"><td>
- H5D_SPACE_STATUS_ALLOCATED
+ <code>H5D_SPACE_STATUS_ALLOCATED</code>
</td><td>
Space has been allocated for this dataset.
</td></tr><tr valign="top"><td>
- H5D_SPACE_STATUS_PART_ALLOCATED&nbsp;&nbsp;
+ <code>H5D_SPACE_STATUS_PART_ALLOCATED</code>&nbsp;&nbsp;
</td><td>
Space has been partially allocated for this dataset.
(Used only for datasets with chunked storage.)
@@ -695,12 +712,14 @@ END SUBROUTINE h5dget_space_f
</table>
</center>
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>dset_id</code>
- <dd>IN: Identifier of the dataset to query.
- <dt><em>H5D_space_status_t *</em><code>status</code>
- <dd>OUT: Space allocation status.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>dset_id</code></td>
+ <td valign="top">IN: Identifier of the dataset to query.</td></tr>
+ <tr>
+ <td valign="top"><em>H5D_space_status_t&nbsp;*</em><code>status&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: Space allocation status.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -745,10 +764,11 @@ END SUBROUTINE h5dget_space_status_f
the chunk size.
The return value may be zero if no data has been stored.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>dataset_id</code>
- <dd>IN: Identifier of the dataset to query.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>dataset_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of the dataset to query.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the amount of storage space allocated for the dataset,
not counting meta data;
@@ -794,10 +814,11 @@ END SUBROUTINE h5dget_storage_size_f
Otherwise, the returned datatype is read-only.
If atomization of the datatype fails, then the datatype is closed.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>dataset_id</code>
- <dd>IN: Identifier of the dataset to query.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>dataset_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of the dataset to query.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a datatype identifier if successful;
otherwise returns a negative value.
@@ -848,23 +869,28 @@ END SUBROUTINE h5dget_type_f
the iteration may then be re-started by the user where it left off.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>void *</em><code>buf</code>
- <dd>IN/OUT: Pointer to the buffer in memory containing the
- elements to iterate over.
- <dt><em>hid_t </em><code>type_id</code>
- <dd>IN: Datatype identifier for the elements stored in
- <code>buf</code>.
- <dt><em>hid_t </em><code>space_id</code>
- <dd>IN: Dataspace identifier for <code>buf</code>.
- Also contains the selection to iterate over.
- <dt><em>H5D_operator_t </em><code>operator</code>
- <dd>IN: Function pointer to the routine to be called
- for each element in <code>buf</code> iterated over.
- <dt><em>void *</em><code>operator_data</code>
- <dd>IN/OUT: Pointer to any user-defined data associated
- with the operation.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>void *</em><code>buf</code></td>
+ <td valign="top">IN/OUT: Pointer to the buffer in memory containing the
+ elements to iterate over.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t </em><code>type_id</code></td>
+ <td valign="top">IN: Datatype identifier for the elements stored in
+ <code>buf</code>.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t </em><code>space_id</code></td>
+ <td valign="top">IN: Dataspace identifier for <code>buf</code>.
+ Also contains the selection to iterate over.</td></tr>
+ <tr>
+ <td valign="top"><em>H5D_operator_t&nbsp;</em><code>operator&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Function pointer to the routine to be called
+ for each element in <code>buf</code> iterated over.</td></tr>
+ <tr>
+ <td valign="top"><em>void *</em><code>operator_data</code></td>
+ <td valign="top">IN/OUT: Pointer to any user-defined data associated
+ with the operation.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the return value of the last operator if it was non-zero,
or zero if all elements have been processed.
@@ -901,13 +927,15 @@ SUBROUTINE
or group specified in <code>loc_id</code>. <code>name</code> is
a dataset name and is used to identify the dataset in the file.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>loc_id</code>
- <dd>IN: Identifier of the file or group
- within which the dataset to be accessed will be found.
- <dt><em>const char *</em> <code>name</code>
- <dd>IN: The name of the dataset to access.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>loc_id</code></td>
+ <td valign="top">IN: Identifier of the file or group
+ within which the dataset to be accessed will be found.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;char&nbsp;*</em>&nbsp;<code>name&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: The name of the dataset to access.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a dataset identifier if successful;
otherwise returns a negative value.
@@ -1075,21 +1103,27 @@ END SUBROUTINE h5dopen_f
data conversion, including the range of conversions currently
supported by the HDF5 libraries.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>dataset_id</code>
- <dd>IN: Identifier of the dataset read from.
- <dt><em>hid_t</em> <code>mem_type_id</code>
- <dd>IN: Identifier of the memory datatype.
- <dt><em>hid_t</em> <code>mem_space_id</code>
- <dd>IN: Identifier of the memory dataspace.
- <dt><em>hid_t</em> <code>file_space_id</code>
- <dd>IN: Identifier of the dataset's dataspace in the file.
- <dt><em>hid_t</em> <code>xfer_plist_id</code>
- <dd>IN: Identifier of a transfer property list
- for this I/O operation.
- <dt><em>void *</em> <code>buf</code>
- <dd>OUT: Buffer to receive data read from file.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>dataset_id</code></td>
+ <td valign="top">IN: Identifier of the dataset read from.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>mem_type_id</code></td>
+ <td valign="top">IN: Identifier of the memory datatype.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>mem_space_id</code></td>
+ <td valign="top">IN: Identifier of the memory dataspace.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>file_space_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of the dataset's dataspace in the file.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>xfer_plist_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of a transfer property list
+ for this I/O operation.</td></tr>
+ <tr>
+ <td valign="top"><em>void *</em> <code>buf</code></td>
+ <td valign="top">OUT: Buffer to receive data read from file.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -1101,33 +1135,32 @@ SUBROUTINE h5dread_f(dset_id, mem_type_id, buf, dims, hdferr, &amp;
mem_space_id, file_space_id, xfer_prp)
IMPLICIT NONE
- INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier
- INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier
- TYPE, INTENT(INOUT) :: buf ! Data buffer; may be a scalar
- ! or an array
+ INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier
+ INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier
+ TYPE, INTENT(INOUT) :: buf ! Data buffer; may be a scalar
+ ! or an array
DIMENSION(*), INTEGER(HSIZE_T), INTENT(IN) :: dims
- ! Array to hold corresponding
- ! dimension sizes of data
- ! buffer buf
- ! dim(k) has value of the k-th
- ! dimension of buffer buf
- ! Values are ignored if buf is
- ! a scalar
- INTEGER, INTENT(OUT) :: hdferr ! Error code
- ! 0 on success and -1 on failure
+ ! Array to hold corresponding
+ ! dimension sizes of data
+ ! buffer buf
+ ! dim(k) has value of the k-th
+ ! dimension of buffer buf
+ ! Values are ignored if buf is
+ ! a scalar
+ INTEGER, INTENT(OUT) :: hdferr ! Error code
+ ! 0 on success and -1 on failure
INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id
- ! Memory dataspace identfier
- ! Default value is H5S_ALL_F
+ ! Memory dataspace identfier
+ ! Default value is H5S_ALL_F
INTEGER(HID_T), OPTIONAL, INTENT(IN) :: file_space_id
- ! File dataspace identfier
- ! Default value is H5S_ALL_F
+ ! File dataspace identfier
+ ! Default value is H5S_ALL_F
INTEGER(HID_T), OPTIONAL, INTENT(IN) :: xfer_prp
- ! Transfer property list identifier
- ! Default value is H5P_DEFAULT_F
+ ! Transfer property list identifier
+ ! Default value is H5P_DEFAULT_F
END SUBROUTINE h5dread_f
</pre>
-
<!--<dt><strong>Non-C API(s):</strong>
<dd>
@@ -1159,16 +1192,21 @@ END SUBROUTINE h5dread_f
<code>*size</code> is returned with the number of bytes
required to store the VL data in memory.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>dataset_id</code>
- <dd>IN: Identifier of the dataset to query.
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>IN: Datatype identifier.
- <dt><em>hid_t</em> <code>space_id</code>
- <dd>IN: Dataspace identifier.
- <dt><em>hsize_t</em> *<code>size</code>
- <dd>OUT: The size in bytes of the memory buffer required to store the VL data.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>dataset_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of the dataset to query.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>type_id</code></td>
+ <td valign="top">IN: Datatype identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>space_id</code></td>
+ <td valign="top">IN: Dataspace identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t</em> *<code>size</code></td>
+ <td valign="top">OUT: The size in bytes of the memory
+ buffer required to store the VL data.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns non-negative value if successful;
otherwise returns a negative value.
@@ -1228,16 +1266,20 @@ END SUBROUTINE h5dvlen_get_max_len_f
this routine frees them <em>from the bottom up</em>, releasing all
the memory without creating memory leaks.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>IN: Identifier of the datatype.
- <dt><em>hid_t</em> <code>space_id</code>
- <dd>IN: Identifier of the dataspace.
- <dt><em>hid_t</em> <code>plist_id</code>
- <dd>IN: Identifier of the property list used to create the buffer.
- <dt><em>void</em> *<code>buf</code>
- <dd>IN: Pointer to the buffer to be reclaimed.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>type_id</code></td>
+ <td valign="top">IN: Identifier of the datatype.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>space_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of the dataspace.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist_id</code></td>
+ <td valign="top">IN: Identifier of the property list used to create the buffer.</td></tr>
+ <tr>
+ <td valign="top"><em>void</em> *<code>buf</code></td>
+ <td valign="top">IN: Pointer to the buffer to be reclaimed.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns non-negative value if successful;
otherwise returns a negative value.
@@ -1418,21 +1460,27 @@ SUBROUTINE
write identical data to the dataset from all processes.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>dataset_id</code>
- <dd>IN: Identifier of the dataset to write to.
- <dt><em>hid_t</em> <code>mem_type_id</code>
- <dd>IN: Identifier of the memory datatype.
- <dt><em>hid_t</em> <code>mem_space_id</code>
- <dd>IN: Identifier of the memory dataspace.
- <dt><em>hid_t</em> <code>file_space_id</code>
- <dd>IN: Identifier of the dataset's dataspace in the file.
- <dt><em>hid_t</em> <code>xfer_plist_id</code>
- <dd>IN: Identifier of a transfer property list
- for this I/O operation.
- <dt><em>const void *</em> <code>buf</code>
- <dd>IN: Buffer with data to be written to the file.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>dataset_id</code></td>
+ <td valign="top">IN: Identifier of the dataset to write to.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>mem_type_id</code></td>
+ <td valign="top">IN: Identifier of the memory datatype.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>mem_space_id</code></td>
+ <td valign="top">IN: Identifier of the memory dataspace.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>file_space_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of the dataset's dataspace in the file.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>xfer_plist_id</code></td>
+ <td valign="top">IN: Identifier of a transfer property list
+ for this I/O operation.</td></tr>
+ <tr>
+ <td valign="top"><em>const void *</em> <code>buf</code></td>
+ <td valign="top">IN: Buffer with data to be written to the file.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -1447,7 +1495,9 @@ SUBROUTINE h5dwrite_f(dset_id, mem_type_id, buf, dims, hdferr, &amp;
INTEGER(HID_T), INTENT(IN) :: dset_id ! Dataset identifier
INTEGER(HID_T), INTENT(IN) :: mem_type_id ! Memory datatype identifier
TYPE, INTENT(IN) :: buf ! Data buffer; may be a scalar
- ! or an array
+ ! or an array</pre>
+<!-- NEW PAGE -->
+<pre>
DIMENSION(*), INTEGER(HSIZE_T), INTENT(IN) :: dims
! Array to hold corresponding
! dimension sizes of data
@@ -1455,10 +1505,8 @@ SUBROUTINE h5dwrite_f(dset_id, mem_type_id, buf, dims, hdferr, &amp;
! of the k-th dimension of
! buffer buf; values are
! ignored if buf is a scalar
- INTEGER, INTENT(OUT) :: hdferr ! Error code
- ! 0 on success and -1 on failure</pre>
-<!-- NEW PAGE -->
-<pre>
+ INTEGER, INTENT(OUT) :: hdferr ! Error code
+ ! 0 on success and -1 on failure
INTEGER(HID_T), OPTIONAL, INTENT(IN) :: mem_space_id
! Memory dataspace identfier
! Default value is H5S_ALL_F
diff --git a/doc/html/RM_H5E.html b/doc/html/RM_H5E.html
index 284bb38..c1d5cfd 100644
--- a/doc/html/RM_H5E.html
+++ b/doc/html/RM_H5E.html
@@ -206,9 +206,9 @@ errors within the H5E package.
<code>H5Eclear</code> can fail if there are problems initializing
the library.
<dt><strong>Parameters:</strong>
- <dl>
- <dt>None
- </dl>
+ <ul><table>
+ <tr><td valign="top">None</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -248,13 +248,15 @@ END SUBROUTINE h5eclear_f
and its data, <code>client_data</code>. Either (or both)
arguments may be null in which case the value is not returned.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>H5E_auto_t *</em> <code>func</code>
- <dd>OUT: Current setting for the function to be called upon an
- error condition.
- <dt><em>void **</em><code>client_data</code>
- <dd>OUT: Current setting for the data passed to the error function.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>H5E_auto_t *</em> <code>func</code></td>
+ <td valign="top">OUT: Current setting for the function to be called upon an
+ error condition.</td></tr>
+ <tr>
+ <td valign="top"><em>void&nbsp;**</em><code>client_data&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: Current setting for the data passed to the error function.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -289,10 +291,11 @@ SUBROUTINE
<dd>Given a major error number, <code>H5Eget_major</code> returns a
constant character string that describes the error.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>H5E_major_t</em> <code>n</code>
- <dd>IN: Major error number.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>H5E_major_t</em>&nbsp;<code>n&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Major error number.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd> Returns a character string describing the error if successful.
Otherwise returns "Invalid major error number."
@@ -329,10 +332,11 @@ END SUBROUTINE h5eget_major_f
<dd>Given a minor error number, <code>H5Eget_minor</code> returns a
constant character string that describes the error.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>H5E_minor_t</em> <code>n</code>
- <dd>IN: Minor error number.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>H5E_minor_t</em>&nbsp;<code>n&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Minor error number.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd> Returns a character string describing the error if successful.
Otherwise returns "Invalid minor error number."
@@ -375,10 +379,11 @@ END SUBROUTINE h5eget_minor_f
<code>H5Ewalk</code> with a function that prints error messages.
Users are encouraged to write their own more specific error handlers.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>FILE *</em> <code>stream</code>
- <dd>IN: File pointer, or stderr if NULL.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>FILE&nbsp;*</em>&nbsp;<code>stream&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: File pointer, or stderr if NULL.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -430,20 +435,26 @@ END SUBROUTINE h5eprint_f
The function name, file name, and error description strings
must be statically allocated.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>const char *</em><code>file</code>,
- <dd>IN: Name of the file in which the error was detected.
- <dt><em>const char *</em><code>func</code>,
- <dd>IN: Name of the function in which the error was detected.
- <dt><em>unsigned</em> <code>line</code>,
- <dd>IN: Line within the file at which the error was detected.
- <dt><em>H5E_major_t</em> <code>maj_num</code>,
- <dd>IN: Major error number.
- <dt><em>H5E_minor_t</em> <code>min_num</code>,
- <dd>IN: Minor error number.
- <dt><em>const char *</em><code>str</code>
- <dd>IN: Error description string.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>const char *</em><code>file</code>,</td>
+ <td valign="top">IN: Name of the file in which the error was detected.</td></tr>
+ <tr>
+ <td valign="top"><em>const char *</em><code>func</code>,</td>
+ <td valign="top">IN: Name of the function in which the error was detected.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned</em> <code>line</code>,</td>
+ <td valign="top">IN: Line within the file at which the error was detected.</td></tr>
+ <tr>
+ <td valign="top"><em>H5E_major_t</em>&nbsp;<code>maj_num,&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Major error number.</td></tr>
+ <tr>
+ <td valign="top"><em>H5E_minor_t</em> <code>min_num</code>,</td>
+ <td valign="top">IN: Minor error number.</td></tr>
+ <tr>
+ <td valign="top"><em>const char *</em><code>str</code></td>
+ <td valign="top">IN: Error description string.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -490,12 +501,14 @@ SUBROUTINE
Automatic stack traversal is always in the
<code>H5E_WALK_DOWNWARD</code> direction.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>H5E_auto_t</em> <code>func</code>
- <dd>IN: Function to be called upon an error condition.
- <dt><em>void *</em><code>client_data</code>
- <dd>IN: Data passed to the error function.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>H5E_auto_t</em> <code>func</code></td>
+ <td valign="top">IN: Function to be called upon an error condition.</td></tr>
+ <tr>
+ <td valign="top"><em>void&nbsp;*</em><code>client_data&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Data passed to the error function.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -579,14 +592,17 @@ END SUBROUTINE h5eset_auto_f
<code>H5Ewalk</code> can fail if there are problems initializing
the library.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>H5E_direction_t</em> <code>direction</code>
- <dd>IN: Direction in which the error stack is to be walked.
- <dt><em>H5E_walk_t</em> <code>func</code>
- <dd>IN: Function to be called for each error encountered.
- <dt><em>void *</em> <code>client_data</code>
- <dd>IN: Data to be passed with <code>func</code>.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>H5E_direction_t</em>&nbsp;<code>direction&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Direction in which the error stack is to be walked.</td></tr>
+ <tr>
+ <td valign="top"><em>H5E_walk_t</em> <code>func</code></td>
+ <td valign="top">IN: Function to be called for each error encountered.</td></tr>
+ <tr>
+ <td valign="top"><em>void *</em> <code>client_data</code></td>
+ <td valign="top">IN: Data to be passed with <code>func</code>.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -642,15 +658,18 @@ SUBROUTINE
<code>client_data</code> argument of <code>H5Ewalk</code>.
It is expected to be a file pointer (or stderr if NULL).
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>int</em> <code>n</code>
- <dd>IN/OUT: Number of times this function has been called
- for this traversal of the stack.
- <dt><em>H5E_error_t *</em><code>err_desc</code>
- <dd>OUT: Error description.
- <dt><em>void</em> <code>*client_data</code>
- <dd>IN: A file pointer, or stderr if NULL.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>int</em> <code>n</code></td>
+ <td valign="top">IN/OUT: Number of times this function has been called
+ for this traversal of the stack.</td></tr>
+ <tr>
+ <td valign="top"><em>H5E_error_t&nbsp;*</em><code>err_desc&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: Error description.</td></tr>
+ <tr>
+ <td valign="top"><em>void</em> <code>*client_data</code></td>
+ <td valign="top">IN: A file pointer, or stderr if NULL.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
diff --git a/doc/html/RM_H5F.html b/doc/html/RM_H5F.html
index 8e974b8..b77873d 100644
--- a/doc/html/RM_H5F.html
+++ b/doc/html/RM_H5F.html
@@ -41,7 +41,8 @@ HDF5/H5F API Specification
</td>
<td valign=top align=right>
And in this document, the
-<a href="RM_H5Front.html">HDF5 Reference Manual</a>&nbsp;&nbsp;<br>
+<a href="RM_H5Front.html">HDF5 Reference Manual</a>&nbsp;&nbsp;
+<br>
<a href="RM_H5.html">H5</a>&nbsp;&nbsp;
<a href="RM_H5A.html">H5A</a>&nbsp;&nbsp;
<a href="RM_H5D.html">H5D</a>&nbsp;&nbsp;
@@ -49,7 +50,8 @@ And in this document, the
<a href="RM_H5F.html">H5F</a>&nbsp;&nbsp;
<a href="RM_H5G.html">H5G</a>&nbsp;&nbsp;
<a href="RM_H5I.html">H5I</a>&nbsp;&nbsp;
-<a href="RM_H5P.html">H5P</a>&nbsp;&nbsp;<br>
+<a href="RM_H5P.html">H5P</a>&nbsp;&nbsp;
+<br>
<a href="RM_H5R.html">H5R</a>&nbsp;&nbsp;
<a href="RM_H5S.html">H5S</a>&nbsp;&nbsp;
<a href="RM_H5T.html">H5T</a>&nbsp;&nbsp;
@@ -57,14 +59,9 @@ And in this document, the
<a href="Tools.html">Tools</a>&nbsp;&nbsp;
<a href="PredefDTypes.html">Datatypes</a>&nbsp;&nbsp;
</td></tr>
-<tr><td colspan="2" align="right">
-<i><small>(<a href="http://hdf.ncsa.uiuc.edu/HDF5/doc/PSandPDF/">PDF</a>
-of complete manual formatted as print volume)&nbsp;&nbsp;&nbsp;</small></i>
-</td></tr>
</table>
</center>
-<hr>
-<!-- #EndLibraryItem --><center>
+<hr><!-- #EndLibraryItem --><center>
<h1>H5F: File Interface</h1>
</center>
@@ -171,6 +168,7 @@ as the corresponding C function.
<li><a href="#File-Unmount">h5funmount_f</a>
<li><a href="#File-GetVfdHandle">h5fget_vfd_handle_f</a>
<li><a href="#File-GetFilesize">h5fget_filesize_f</a>
+ <li><a href="#File-GetFreespace">h5fget_freespace_f</a>
</ul>
</td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td valign=top>
<ul>
@@ -179,7 +177,6 @@ as the corresponding C function.
<li><a href="#File-GetName">h5fget_name_f</a>
<li><a href="#File-GetObjCount">h5fget_obj_count_f</a>
<li><a href="#File-GetObjIDs">h5fget_obj_ids_f</a>
- <li><a href="#File-GetObjIDs">h5fget_freespace_f</a>
</ul>
</td></tr>
</table>
@@ -235,10 +232,11 @@ as the corresponding C function.
in a file before calling <code>H5Fclose</code>.
It is generally recommended to do so in all cases.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>file_id</code>
- <dd>IN: Identifier of a file to terminate access to.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>file_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of a file to terminate access to.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -328,11 +326,13 @@ END SUBROUTINE h5fclose_f
with an already opened file.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>const char *</em><code>name</code>
- <dd>IN: Name of the file to access.
- <dt><em>uintn</em> <code>flags</code>
- <dd>IN: File access flags. Allowable values are:
+ <ul><table>
+ <tr>
+ <td valign="top"><em>const&nbsp;char&nbsp;*</em><code>name&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Name of the file to access.</td></tr>
+ <tr>
+ <td valign="top"><em>uintn</em> <code>flags</code></td>
+ <td valign="top">IN: File access flags. Allowable values are:
<ul><dl>
<dt><code>H5F_ACC_TRUNC</code>
<dd>Truncate file, if it already exists,
@@ -345,18 +345,20 @@ END SUBROUTINE h5fclose_f
<li>An additional flag, <code>H5F_ACC_DEBUG</code>, prints
debug information. This flag is used only by HDF5 library
developers; <i>it is neither tested nor supported</i>
- for use in applications.
- <dt><em>hid_t</em> <code>create_id</code>
- <dd>IN: File creation property list identifier, used when modifying
+ for use in applications.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>create_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: File creation property list identifier, used when modifying
default file meta-data.
- Use <code>H5P_DEFAULT</code> for default file creation properties.
- <dt><em>hid_t</em> <code>access_id</code>
- <dd>IN: File access property list identifier.
+ Use <code>H5P_DEFAULT</code> for default file creation properties.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>access_id</code></td>
+ <td valign="top">IN: File access property list identifier.
If parallel file access is desired, this is a collective
call according to the communicator stored in the
<code>access_id</code>.
- Use <code>H5P_DEFAULT</code> for default file access properties.
- </dl>
+ Use <code>H5P_DEFAULT</code> for default file access properties.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a file identifier if successful;
otherwise returns a negative value.
@@ -422,12 +424,12 @@ END SUBROUTINE h5fcreate_f
action is global or local. Valid values are
<center>
<table border=0>
- <tr><td align=left valign=bottom><code>H5F_SCOPE_GLOBAL</code></td>
+ <tr><td align=left valign=top><code>H5F_SCOPE_GLOBAL</code></td>
<td>&nbsp;&nbsp;&nbsp;&nbsp;</td>
- <td align=left valign=bottom>Flushes the entire virtual file.</td></tr>
- <tr><td align=left valign=bottom><code>H5F_SCOPE_LOCAL</code></td>
+ <td align=left valign=top>Flushes the entire virtual file.</td></tr>
+ <tr><td align=left valign=top><code>H5F_SCOPE_LOCAL</code></td>
<td></td>
- <td align=left valign=bottom>Flushes only the specified file.</td></tr>
+ <td align=left valign=top>Flushes only the specified file.</td></tr>
</table>
</center>
<dt><strong>Note:</strong>
@@ -437,12 +439,14 @@ END SUBROUTINE h5fcreate_f
open files. After that, the OS is responsible for ensuring that
the data is actually flushed to disk.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t </em><code>object_id</code>
- <dd>IN: Identifier of object used to identify the file.
- <dt><em>H5F_scope_t</em> <code>scope</code>
- <dd>IN: Specifies the scope of the flushing action.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t </em><code>object_id</code></td>
+ <td valign="top">IN: Identifier of object used to identify the file.</td></tr>
+ <tr>
+ <td valign="top"><em>H5F_scope_t</em>&nbsp;<code>scope&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Specifies the scope of the flushing action.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -489,10 +493,11 @@ END SUBROUTINE h5fflush_f
<cite>HDF5 User's Guide</cite> for
additional information and related functions.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>file_id</code>
- <dd>IN: Identifier of file to get access property list of
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>file_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of file to get access property list of</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a file access property list identifier if successful;
otherwise returns a negative value.
@@ -517,7 +522,6 @@ END SUBROUTINE h5fget_access_plist_f
-->
</dl>
-
<!-- NEW PAGE -->
<!-- HEADER RIGHT "H5Fget_create_plist" -->
<hr>
@@ -542,10 +546,11 @@ END SUBROUTINE h5fget_access_plist_f
<cite>HDF5 User's Guide</cite> for
additional information and related functions.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>file_id</code>
- <dd>IN: Identifier of the file to get creation property list of
- </dl>
+ <ul><table>
+ <dt>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>file_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of the file to get creation property list of</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a file creation property list identifier if successful;
otherwise returns a negative value.
@@ -629,7 +634,7 @@ END SUBROUTINE h5fget_filesize_f
<!-- HEADER RIGHT "H5Fget_freespace" -->
<hr>
<dl>
-<dt><strong>Name:</strong> <a name="File-GetFreespace">H5Fget_freespace</a>
+<dt><strong>Name:</strong> <a name="File-GetFreeSpace">H5Fget_freespace</a>
<dt><strong>Signature:</strong>
<dd><em>hssize_t </em><code>H5Fget_freespace</code>(<em>hid_t</em> <code>file_id</code>)
<dt><strong>Purpose:</strong>
@@ -644,10 +649,11 @@ END SUBROUTINE h5fget_filesize_f
only report the free space that has been created during that
interval.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>file_id</code>
- <dd>IN: Identifier of a currently-open HDF5 file
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>file_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of a currently-open HDF5 file</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a the amount of free space in the file if successful;
otherwise returns a negative value.
@@ -811,13 +817,15 @@ END SUBROUTINE h5fget_name_f
For example, the expression <code>(H5F_OBJ_DATASET|H5F_OBJ_GROUP)</code> would call for
datasets and groups.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>file_id</code>
- <dd>IN: Identifier of a currently-open HDF5 file or
- <code>H5F_OBJ_ALL</code> for all currently-open HDF5 files.
- <dt><em>unsigned int</em> <code>types</code>
- <dd>IN: Type of object for which identifiers are to be returned.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>file_id</code></td>
+ <td valign="top">IN: Identifier of a currently-open HDF5 file or
+ <code>H5F_OBJ_ALL</code> for all currently-open HDF5 files.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned&nbsp;int</em>&nbsp;<code>types&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Type of object for which identifiers are to be returned.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a the number of open objects if successful;
otherwise returns a negative value.
@@ -878,17 +886,22 @@ END SUBROUTINE h5fget_obj_count_f
To retrieve identifiers for all open objects, pass a negative value
for the <code>max_objs</code>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>file_id</code>
- <dd>IN: Identifier of a currently-open HDF5 file or
- <code>H5F_OBJ_ALL</code> for all currently-open HDF5 files.
- <dt><em>unsigned int</em> <code>types</code>
- <dd>IN: Type of object for which identifiers are to be returned.
- <dt><em>int</em> <code>max_objs</code>
- <dd>IN: Maximum number of object identifiers to place into <code>obj_id_list</code>.
- <dt><em>hid_t *</em><code>obj_id_list</code>
- <dd>OUT: Pointer to the returned list of open object identifiers.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>file_id</code></td>
+ <td valign="top">IN: Identifier of a currently-open HDF5 file or
+ <code>H5F_OBJ_ALL</code> for all currently-open HDF5 files.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned int</em> <code>types</code></td>
+ <td valign="top">IN: Type of object for which identifiers are to be returned.</td></tr>
+ <tr>
+ <td valign="top"><em>int</em> <code>max_objs</code></td>
+ <td valign="top">IN: Maximum number of object identifiers to place into
+ <code>obj_id_list</code>.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t&nbsp;*</em><code>obj_id_list&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: Pointer to the returned list of open object identifiers.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns number of objects placed into <code>obj_id_list</code> if successful;
otherwise returns a negative value.
@@ -948,22 +961,25 @@ END SUBROUTINE h5fget_obj_ids_f
open; it will be invalid if the file is closed and reopened or
opened during a subsequent session.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>file_id</code>
- <dd>IN: Identifier of the file to be queried.
- <dt><em>hid_t</em> <code>fapl_id</code>
- <dd>IN: File access property list identifier.
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>file_id</code></td>
+ <td valign="top">IN: Identifier of the file to be queried.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>fapl_id</code></td>
+ <td valign="top">IN: File access property list identifier.
For most drivers, the value will be <code>H5P_DEFAULT</code>.
- For the <code>FAMILY</code> or <code>MULTI</code> drivers,
- this value should be defined through the property list
- functions:
- <code>H5Pset_family_offset</code> for the <code>FAMILY</code>
- driver and <code>H5Pset_multi_type</code> for the
- <code>MULTI</code> driver.
- <dt><em>void *</em><code>file_handle</code>
- <dd>OUT: Pointer to the file handle being used by
- the low-level virtual file driver.
- </dl>
+ For the <code>FAMILY</code> or <code>MULTI</code> drivers,
+ this value should be defined through the property list
+ functions:
+ <code>H5Pset_family_offset</code> for the <code>FAMILY</code>
+ driver and <code>H5Pset_multi_type</code> for the
+ <code>MULTI</code> driver.</td></tr>
+ <tr>
+ <td valign="top"><em>void&nbsp;*</em><code>file_handle&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: Pointer to the file handle being used by
+ the low-level virtual file driver.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -998,10 +1014,11 @@ SUBROUTINE
<dd><code>H5Fis_hdf5</code> determines whether a file is in
the HDF5 format.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>const char *</em><code>name</code>
- <dd>IN: File name to check format.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>const&nbsp;char&nbsp;*</em><code>name&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: File name to check format.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>When successful, returns a positive value, for <code>TRUE</code>,
or <code>0</code> (zero), for <code>FALSE</code>.
@@ -1050,19 +1067,23 @@ END SUBROUTINE h5fis_hdf5_f
Note that <code>loc_id</code> is either a file or group identifier
and <code>name</code> is relative to <code>loc_id</code>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>loc_id</code>
- <dd>IN: Identifier for of file or group in
- which <code>name</code> is defined.
- <dt><em>const char *</em><code>name</code>
- <dd>IN: Name of the group onto which the
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>loc_id</code></td>
+ <td valign="top">IN: Identifier for of file or group in
+ which <code>name</code> is defined.</td>
+ <tr>
+ <td valign="top"><em>const&nbsp;char&nbsp;*</em><code>name&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Name of the group onto which the
file specified by <code>child_id</code>
- is to be mounted.
- <dt><em>hid_t</em> <code>child_id</code>
- <dd>IN: Identifier of the file to be mounted.
- <dt><em>hid_t</em> <code>plist_id</code>
- <dd>IN: Identifier of the property list to be used.
- </dl>
+ is to be mounted.</td>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>child_id</code></td>
+ <td valign="top">IN: Identifier of the file to be mounted.</td>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist_id</code></td>
+ <td valign="top">IN: Identifier of the property list to be used.</td>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -1150,11 +1171,13 @@ END SUBROUTINE h5fmount_f
multiple opens of the same file.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>const char *</em><code>name</code>
- <dd>IN: Name of the file to access.
- <dt><em>unsigned</em> <code>flags</code>
- <dd>IN: File access flags. Allowable values are:
+ <ul><table>
+ <tr>
+ <td valign="top"><em>const&nbsp;char&nbsp;*</em><code>name&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Name of the file to access.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned</em> <code>flags</code></td>
+ <td valign="top">IN: File access flags. Allowable values are:
<ul><dl>
<dt><code>H5F_ACC_RDWR</code>
<dd>Allow read and write access to file.
@@ -1167,15 +1190,16 @@ END SUBROUTINE h5fmount_f
debug information. This flag is used only by HDF5 library
developers; it is neither tested nor supported
for use in applications.
- </ul>
+ </ul></td></tr>
<!-- NEW PAGE -->
- <dt><em>hid_t</em> <code>access_id</code>
- <dd>IN: Identifier for the file access properties list.
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>access_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier for the file access properties list.
If parallel file access is desired, this is a collective
call according to the communicator stored in the
<code>access_id</code>.
- Use <code>H5P_DEFAULT</code> for default file access properties.
- </dl>
+ Use <code>H5P_DEFAULT</code> for default file access properties.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a file identifier if successful;
otherwise returns a negative value.
@@ -1235,11 +1259,12 @@ END SUBROUTINE h5fopen_f
The new file identifier should be closed by calling
<code>H5Fclose</code> when it is no longer needed.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>file_id</code>
- <dd>IN: Identifier of a file for which an additional identifier
- is required.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>file_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of a file for which an additional identifier
+ is required.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a new file identifier if successful;
otherwise returns a negative value.
@@ -1290,13 +1315,15 @@ END SUBROUTINE h5freopen_f
Note that <code>loc_id</code> is either a file or group identifier
and <code>name</code> is relative to <code>loc_id</code>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>loc_id</code>
- <dd>IN: File or group identifier for the location at which
- the specified file is to be unmounted.
- <dt><em>const char *</em><code>name</code>
- <dd>IN: Name of the mount point.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>loc_id</code></td>
+ <td valign="top">IN: File or group identifier for the location at which
+ the specified file is to be unmounted.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;char&nbsp;*</em><code>name&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Name of the mount point.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -1336,7 +1363,8 @@ END SUBROUTINE h5funmount_f
</td>
<td valign=top align=right>
And in this document, the
-<a href="RM_H5Front.html">HDF5 Reference Manual</a>&nbsp;&nbsp;<br>
+<a href="RM_H5Front.html">HDF5 Reference Manual</a>&nbsp;&nbsp;
+<br>
<a href="RM_H5.html">H5</a>&nbsp;&nbsp;
<a href="RM_H5A.html">H5A</a>&nbsp;&nbsp;
<a href="RM_H5D.html">H5D</a>&nbsp;&nbsp;
@@ -1344,7 +1372,8 @@ And in this document, the
<a href="RM_H5F.html">H5F</a>&nbsp;&nbsp;
<a href="RM_H5G.html">H5G</a>&nbsp;&nbsp;
<a href="RM_H5I.html">H5I</a>&nbsp;&nbsp;
-<a href="RM_H5P.html">H5P</a>&nbsp;&nbsp;<br>
+<a href="RM_H5P.html">H5P</a>&nbsp;&nbsp;
+<br>
<a href="RM_H5R.html">H5R</a>&nbsp;&nbsp;
<a href="RM_H5S.html">H5S</a>&nbsp;&nbsp;
<a href="RM_H5T.html">H5T</a>&nbsp;&nbsp;
@@ -1352,17 +1381,12 @@ And in this document, the
<a href="Tools.html">Tools</a>&nbsp;&nbsp;
<a href="PredefDTypes.html">Datatypes</a>&nbsp;&nbsp;
</td></tr>
-<tr><td colspan="2" align="right">
-<i><small>(<a href="http://hdf.ncsa.uiuc.edu/HDF5/doc/PSandPDF/">PDF</a>
-of complete manual formatted as print volume)&nbsp;&nbsp;&nbsp;</small></i>
-</td></tr>
</table>
</center>
-<hr>
-<!-- #EndLibraryItem --><!-- #BeginLibraryItem "/ed_libs/Footer.lbi" --><address>
+<hr><!-- #EndLibraryItem --><!-- #BeginLibraryItem "/ed_libs/Footer.lbi" --><address>
<a href="mailto:hdfhelp@ncsa.uiuc.edu">HDF Help Desk</a>
<br>
-Describes HDF5 Release 1.6.3, September 2004
+Describes HDF5 Release 1.7, the unreleased development branch; working toward HDF5 Release 1.8.0
</address><!-- #EndLibraryItem --><SCRIPT LANGUAGE="JAVASCRIPT">
<!--
document.writeln("Last modified: 24 August 2004");
diff --git a/doc/html/RM_H5G.html b/doc/html/RM_H5G.html
index b7c4386..9400068 100644
--- a/doc/html/RM_H5G.html
+++ b/doc/html/RM_H5G.html
@@ -224,10 +224,11 @@ create or access function.
<p>
Failure to release a group with this call will result in resource leaks.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>group_id</code>
- <dd>IN: Group identifier to release.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>group_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Group identifier to release.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -282,20 +283,23 @@ END SUBROUTINE h5gclose_f
This group identifier should be closed by calling
<code>H5Gclose</code> when it is no longer needed.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>loc_id</code>
- <dd>IN: File or group identifier.
- <dt><em>const char *</em><code>name</code>
- <dd>IN: Absolute or relative name of the new group.
- <dt><em>size_t</em> <code>size_hint</code>
- <dd>IN: Optional parameter indicating the number of bytes
- to reserve for the names that will appear in the group.
- A conservative estimate could result in multiple
- system-level I/O requests to read the group name heap;
- a liberal estimate could result in a single large
- I/O request even when the group has just a few names.
- HDF5 stores each name with a null terminator.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>loc_id</code></td>
+ <td valign="top">IN: File or group identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>const char *</em><code>name</code></td>
+ <td valign="top">IN: Absolute or relative name of the new group.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t</em>&nbsp;<code>size_hint&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Optional parameter indicating the number of bytes
+ to reserve for the names that will appear in the group.
+ A conservative estimate could result in multiple
+ system-level I/O requests to read the group name heap;
+ a liberal estimate could result in a single large
+ I/O request even when the group has just a few names.
+ HDF5 stores each name with a null terminator.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a valid group identifier for the open group if successful;
otherwise returns a negative value.
@@ -352,12 +356,15 @@ END SUBROUTINE h5gcreate_f
If an object does not have a comment, the empty string
is returned.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>loc_id</code>
- <dd>IN: Identifier of a file, group, dataset, or named datatype.
- <dt><em>const char *</em><code>name</code>
- <dd>IN: Name of the object in <code>loc_id</code> whose comment
- is to be retreived.
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>loc_id</code></td>
+ <td valign="top">IN: Identifier of the file, group, dataset, or
+ named datatype.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;char&nbsp;*</em><code>name&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Name of the object in <code>loc_id</code> whose
+ comment is to be retrieved.
<br>
<code>name</code> can be '.' (dot) if <code>loc_id</code>
fully specifies the object for which the associated comment
@@ -365,12 +372,15 @@ END SUBROUTINE h5gcreate_f
<br>
<code>name</code> is ignored if <code>loc_id</code>
is a dataset or named datatype.
- <dt><em>size_t</em> <code>bufsize</code>
- <dd>IN: Anticipated required size of the
- <code>comment</code> buffer.
- <dt><em>char *</em><code>comment</code>
- <dd>OUT: The comment.
- </dl>
+ </td></tr>
+ <tr>
+ <td valign="top"><em>size_t</em> <code>bufsize</code></td>
+ <td valign="top">IN: Anticipated required size of the
+ <code>comment</code> buffer.</td></tr>
+ <tr>
+ <td valign="top"><em>char *</em><code>comment</code></td>
+ <td valign="top">OUT: The comment.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the number of characters in the comment,
counting the null terminator, if successful; the value
@@ -378,19 +388,19 @@ END SUBROUTINE h5gcreate_f
Otherwise returns a negative value.
<dt><strong>Fortran90 Interface:</strong> h5gget_comment_f
<dd>
- <pre>
+ <pre>
SUBROUTINE h5gget_comment_f(loc_id, name, size, buffer, hdferr)
IMPLICIT NONE
- INTEGER(HID_T), INTENT(IN) :: loc_id ! File, group, dataset, or
+ INTEGER(HID_T), INTENT(IN) :: loc_id ! File, group, dataset, or
! named datatype identifier
CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the object link
CHARACTER(LEN=size), INTENT(OUT) :: buffer ! Buffer to hold the comment
INTEGER, INTENT(OUT) :: hdferr ! Error code
! 0 on success and -1 on failure
END SUBROUTINE h5gget_comment_f
- </pre>
-
- <!--<dt><strong>Non-C API(s):</strong>
+ </pre>
+
+ <!--<dt><strong>Non-C API(s):</strong>
<dd>
<img src="Graphics/Java.gif">
@@ -430,17 +440,21 @@ END SUBROUTINE h5gget_comment_f
This function should be used only after <code>H5Gget_objinfo</code> has been called
to verify that <code>name</code> is a symbolic link.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>loc_id</code>
- <dd>IN: Identifier of the file or group.
- <dt><em>const char *</em><code>name</code>
- <dd>IN: Symbolic link to the object whose name is to be returned.
- <dt><em>size_t</em> <code>size</code>
- <dd>IN: Maximum number of characters of <code>value</code>
- to be returned.
- <dt><em>char *</em><code>value</code>
- <dd>OUT: A buffer to hold the name of the object being sought.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>loc_id</code></td>
+ <td valign="top">IN: Identifier of the file or group.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;char&nbsp;*</em><code>name&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Symbolic link to the object whose name is to be returned.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t</em> <code>size</code></td>
+ <td valign="top">IN: Maximum number of characters of <code>value</code>
+ to be returned.</td></tr>
+ <tr>
+ <td valign="top"><em>char *</em><code>value</code></td>
+ <td valign="top">OUT: A buffer to hold the name of the object being sought.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value, with the link value in <code>value</code>,
if successful.
@@ -484,12 +498,14 @@ END SUBROUTINE h5gget_linkval_f
If a file identifier is passed in, then the number of objects in the
root group is returned.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>loc_id</code>
- <dd>IN: Identifier of the group or the file
- <dt><em>hsize_t*</em> <code>num_obj</code>
- <dd>OUT: Number of objects in the group.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>loc_id</code></td>
+ <td valign="top">IN: Identifier of the group or the file</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t&nbsp;*</em><code>num_obj&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: Number of objects in the group.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns positive value if successful;
otherwise returns a negative value.
@@ -616,16 +632,20 @@ SUBROUTINE
unable to retrieve the correct time; such systems (e.g., Irix64)
will report an <code>mtime</code> value of 0 (zero).
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>loc_id</code>
- <dd>IN: File or group identifier.
- <dt><em>const char</em> <code>*name</code>
- <dd>IN: Name of the object for which status is being sought.
- <dt><em>hbool_t</em> <code>follow_link</code>
- <dd>IN: Link flag.
- <dt><em>H5G_stat_t</em> <code>*statbuf</code>
- <dd>OUT: Buffer in which to return information about the object.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>loc_id</code></td>
+ <td valign="top">IN: File or group identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>const char</em> <code>*name</code></td>
+ <td valign="top">IN: Name of the object for which status is being sought.</td></tr>
+ <tr>
+ <td valign="top"><em>hbool_t</em> <code>follow_link</code></td>
+ <td valign="top">IN: Link flag.</td></tr>
+ <tr>
+ <td valign="top"><em>H5G_stat_t</em>&nbsp;<code>*statbuf&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: Buffer in which to return information about the object.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd> Returns a non-negative value if successful, with the fields of
<code>statbuf</code> (if non-null) initialized.
@@ -687,16 +707,20 @@ SUBROUTINE
A second call to <code>H5Gget_objname_by_idx</code>
can then be used to retrieve the actual name.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>loc_id</code>
- <dd>IN: Group or file identifier.
- <dt><em>hsize_t</em> <code>idx</code>
- <dd>IN: Transient index identifying object.
- <dt><em>char *</em><code>name</code>
- <dd>IN/OUT: Pointer to user-provided buffer the object name.
- <dt><em>size_t</em> <code>size</code>
- <dd>IN: Name length.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>loc_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Group or file identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t</em> <code>idx</code></td>
+ <td valign="top">IN: Transient index identifying object.</td></tr>
+ <tr>
+ <td valign="top"><em>char *</em><code>name</code></td>
+ <td valign="top">IN/OUT: Pointer to user-provided buffer the object name.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t</em> <code>size</code></td>
+ <td valign="top">IN: Name length.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the size of the object name if successful,
or <code>0</code> if no name is associated with the group identifier.
@@ -790,12 +814,14 @@ SUBROUTINE
</table>
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>loc_id</code>
- <dd>IN: Group or file identifier.
- <dt><em>hsize_t</em> <code>idx</code>
- <dd>IN: Transient index identifying object.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>loc_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Group or file identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t</em> <code>idx</code></td>
+ <td valign="top">IN: Transient index identifying object.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the type of the object if successful.
Otherwise returns a negative value.
@@ -846,12 +872,15 @@ SUBROUTINE
non-zero.
<p>
The prototype for <code>H5G_iterate_t</code> is:
- <ul><dl>
- <dd><code>typedef</code> <em>herr_t </em>(*<code>H5G_iterate_t</code>)(<em>hid_t</em> <code>group_id</code>,
- <em>const char *</em><code>member_name</code>,
- <em>void *</em><code>operator_data</code>);
- </dl></ul>
- <dd>The operation receives the group identifier for the group being
+ <table>
+ <tr>
+ <td valign="top">&nbsp;&nbsp;&nbsp;&nbsp;</td>
+ <td valign="top"><code>typedef</code> <em>herr_t </em>(*<code>H5G_iterate_t</code>)
+ (<em>hid_t</em> <code>group_id</code>, <em>const char *</em>
+ <code>member_name</code>, <em>void *</em><code>operator_data</code>);</td></tr>
+ </table>
+
+ <p>The operation receives the group identifier for the group being
iterated over, <code>group_id</code>, the name of the current
object within the group, <code>member_name</code>, and the
pointer to the operator data passed in to <code>H5Giterate</code>,
@@ -874,23 +903,29 @@ SUBROUTINE
iteration. If the membership changes during the iteration,
the function's behavior is undefined.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>loc_id</code>
- <dd>IN: File or group identifier.
- <dt><em>const char</em> <code>*name</code>
- <dd>IN: Group over which the iteration is performed.
- <dt><em>int</em> <code>*idx</code>
- <dd>IN/OUT: Location at which to begin the iteration.
- <dt><em>H5G_iterate_t</em> <code>operator</code>
- <dd>IN: Operation to be performed on an object at each step of
- the iteration.
- <dt><em>void</em> <code>*operator_data</code>
- <dd>IN/OUT: Data associated with the operation.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>loc_id</code></td>
+ <td valign="top">IN: File or group identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>const char</em> <code>*name</code></td>
+ <td valign="top">IN: Group over which the iteration is performed.</td></tr>
+ <tr>
+ <td valign="top"><em>int</em> <code>*idx</code></td>
+ <td valign="top">IN/OUT: Location at which to begin the iteration.</td></tr>
+ <tr>
+ <td valign="top"><em>H5G_iterate_t</em>&nbsp;<code>operator&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Operation to be performed on an object at each step of
+ the iteration.</td></tr>
+ <tr>
+ <td valign="top"><em>void</em> <code>*operator_data</code></td>
+ <td valign="top">IN/OUT: Data associated with the operation.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the return value of the last operator if it was non-zero,
or zero if all group members were processed.
Otherwise returns a negative value.
+<!-- NEW PAGE -->
<dt><strong>Fortran90 Interface:</strong>
<dd>There is no direct FORTRAN couterpart for the C function
<code>H5Giterate</code>.
@@ -908,8 +943,8 @@ SUBROUTINE
Returns the number of group members.
</tr>
<tr valign=top align=left>
- <td>
- <code>h5gget_obj_info_idx_f</code>
+ <td>
+ <code>h5gget_obj_info_idx_f</code>
</td><td>&nbsp;&nbsp;</td><td>
<strong>Purpose:</strong>
Returns name and type of the group member identified by its index.
@@ -921,12 +956,11 @@ SUBROUTINE
<pre>
SUBROUTINE h5gn_members_f(loc_id, name, nmembers, hdferr)
IMPLICIT NONE
- INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier
- CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the group
- INTEGER, INTENT(OUT) :: nmembers ! Number of members in the
- ! group
- INTEGER, INTENT(OUT) :: hdferr ! Error code
- ! 0 on success and -1 on failure
+ INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier
+ CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the group
+ INTEGER, INTENT(OUT) :: nmembers ! Number of members in the group
+ INTEGER, INTENT(OUT) :: hdferr ! Error code
+ ! 0 on success and -1 on failure
END SUBROUTINE h5gn_members_f
</pre>
@@ -934,17 +968,17 @@ END SUBROUTINE h5gn_members_f
SUBROUTINE h5gget_obj_info_idx_f(loc_id, name, idx, &amp;
obj_name, obj_type, hdferr)
IMPLICIT NONE
- INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier
- CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the group
- INTEGER, INTENT(IN) :: idx ! Index of member object
+ INTEGER(HID_T), INTENT(IN) :: loc_id ! File or group identifier
+ CHARACTER(LEN=*), INTENT(IN) :: name ! Name of the group
+ INTEGER, INTENT(IN) :: idx ! Index of member object
CHARACTER(LEN=*), INTENT(OUT) :: obj_name ! Name of the object
- INTEGER, INTENT(OUT) :: obj_type ! Object type :
- ! H5G_LINK_F
- ! H5G_GROUP_F
- ! H5G_DATASET_F
- ! H5G_TYPE_F
- INTEGER, INTENT(OUT) :: hdferr ! Error code
- ! 0 on success and -1 on failure
+ INTEGER, INTENT(OUT) :: obj_type ! Object type :
+ ! H5G_LINK_F
+ ! H5G_GROUP_F
+ ! H5G_DATASET_F
+ ! H5G_TYPE_F
+ INTEGER, INTENT(OUT) :: hdferr ! Error code
+ ! 0 on success and -1 on failure
END SUBROUTINE h5gget_obj_info_idx_f
</pre>
</dl>
@@ -982,19 +1016,23 @@ END SUBROUTINE h5gget_obj_info_idx_f
is made for <code>./x/y/bar</code>, then the actual object looked
up is <code>./x/y/./foo</code>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>loc_id</code>
- <dd>IN: File or group identifier.
- <dt><em>H5G_link_t</em> <code>link_type</code>
- <dd>IN: Link type.
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>loc_id</code></td>
+ <td valign="top">IN: File or group identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>H5G_link_t</em> <code>link_type</code></td>
+ <td valign="top">IN: Link type.
Possible values are <code>H5G_LINK_HARD</code> and
- <code>H5G_LINK_SOFT</code>.
- <dt><em>const char *</em> <code>current_name</code>
- <dd>IN: Name of the existing object if link is a hard link.
- Can be anything for the soft link.
- <dt><em>const char *</em> <code>new_name</code>
- <dd>IN: New name for the object.
- </dl>
+ <code>H5G_LINK_SOFT</code>.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;char&nbsp;*</em>&nbsp;<code>current_name&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Name of the existing object if link is a hard link.
+ Can be anything for the soft link.</td></tr>
+ <tr>
+ <td valign="top"><em>const char *</em> <code>new_name</code></td>
+ <td valign="top">IN: New name for the object.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -1058,21 +1096,25 @@ END SUBROUTINE h5glink_f
is made for <code>./x/y/bar</code>, then the actual object looked
up is <code>./x/y/./foo</code>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>curr_loc_id</code>
- <dd>IN: The file or group identifier for the original object.
- <dt><em>const char *</em> <code>current_name</code>
- <dd>IN: Name of the existing object if link is a hard link.
- Can be anything for the soft link.
- <dt><em>H5G_link_t</em> <code>link_type</code>
- <dd>IN: Link type.
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>curr_loc_id</code></td>
+ <td valign="top">IN: The file or group identifier for the original object.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;char&nbsp;*</em>&nbsp;<code>current_name&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Name of the existing object if link is a hard link.
+ Can be anything for the soft link.</td></tr>
+ <tr>
+ <td valign="top"><em>H5G_link_t</em> <code>link_type</code></td>
+ <td valign="top">IN: Link type.
Possible values are <code>H5G_LINK_HARD</code> and
- <code>H5G_LINK_SOFT</code>.
- <dt><em>hid_t</em> <code>new_loc_id</code>
- <dd>IN: The file or group identifier for the new link.
- <dt><em>const char *</em> <code>new_name</code>
- <dd>IN: New name for the object.
- </dl>
+ <code>H5G_LINK_SOFT</code>.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>new_loc_id</code></td>
+ <td valign="top">IN: The file or group identifier for the new link.</td></tr>
+ <td valign="top"><em>const char *</em> <code>new_name</code></td>
+ <td valign="top">IN: New name for the object.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -1128,14 +1170,17 @@ END SUBROUTINE h5glink2_f
See <a href="Groups.html#H5GUnlinkToCorrupt">The Group Interface</a>
in the <cite>HDF5 User's Guide</cite>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>loc_id</code>
- <dd>IN: File or group identifier.
- <dt><em>const char</em> <code>*src_name</code>
- <dd>IN: Object's original name.
- <dt><em>const char</em> <code>*dst_name</code>
- <dd>IN: Object's new name.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>loc_id</code></td>
+ <td valign="top">IN: File or group identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;char</em>&nbsp;<code>*src_name&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Object's original name.</td></tr>
+ <tr>
+ <td valign="top"><em>const char</em> <code>*dst_name</code></td>
+ <td valign="top">IN: Object's new name.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -1184,16 +1229,20 @@ END SUBROUTINE h5gmove_f
inaccessible with <code>H5Gmove</code>. See <a href="Groups.html#H5GUnlinkToCorrupt">The
Group Interface</a> in the <cite>HDF5 User's Guide</cite>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>src_loc_id</code>
- <dd>IN: Original file or group identifier.
- <dt><em>const char</em> <code>*src_name</code>
- <dd>IN: Object's original name.
- <dt><em>hid_t</em> <code>dst_loc_id</code>
- <dd>IN: Destination file or group identifier.
- <dt><em>const char</em> <code>*dst_name</code>
- <dd>IN: Object's new name.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>src_loc_id</code></td>
+ <td valign="top">IN: Original file or group identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;char</em>&nbsp;<code>*src_name&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Object's original name.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>dst_loc_id</code></td>
+ <td valign="top">IN: Destination file or group identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>const char</em> <code>*dst_name</code></td>
+ <td valign="top">IN: Object's new name.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful; otherwise returns a negative
value.
@@ -1243,12 +1292,14 @@ END SUBROUTINE h5gmove2_f
that was opened. This group identifier should be released by
calling <code>H5Gclose</code> when it is no longer needed.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>loc_id</code>
- <dd>IN: File or group identifier within which group is to be open.
- <dt><em>const char *</em> <code>name</code>
- <dd>IN: Name of group to open.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>loc_id</code></td>
+ <td valign="top">IN: File or group identifier within which group is to be open.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;char&nbsp;*</em>&nbsp;<code>name&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Name of group to open.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a valid group identifier if successful;
otherwise returns a negative value.
@@ -1286,7 +1337,7 @@ END SUBROUTINE h5gopen_f
<dt><strong>Purpose:</strong>
<dd>Sets comment for specified object.
<dt><strong>Description:</strong>
- <dd><code>H5Gset_comment</code> sets the comment for the
+ <dd><code>H5Gset_comment</code> sets the comment for the
object specified by <code>loc_id</code> and <code>name</code>
to <code>comment</code>.
Any previously existing comment is overwritten.
@@ -1301,20 +1352,26 @@ END SUBROUTINE h5gopen_f
e.g., datasets, groups, named datatypes, and dataspaces, but
not symbolic links.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>loc_id</code>
- <dd>IN: Identifier of the file, group, dataset, or named datatype.
- <dt><em>const char *</em><code>name</code>
- <dd>IN: Name of the object whose comment is to be set or reset.
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>loc_id</code></td>
+ <td valign="top">IN: Identifier of the file, group, dataset,
+ or named datatype.</td></tr>
+ <tr>
+ <td valign="top"><em>const char *</em><code>name</code></td>
+ <td valign="top">IN: Name of the object whose comment is to be
+ set or reset.
<br>
<code>name</code> can be '.' (dot) if <code>loc_id</code>
fully specifies the object for which the comment is to be set.
<br>
<code>name</code> is ignored if <code>loc_id</code>
is a dataset or named datatype.
- <dt><em>const char *</em><code>comment</code>
- <dd>IN: The new comment.
- </dl>
+ </td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;char&nbsp;*</em><code>comment&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: The new comment.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -1379,12 +1436,14 @@ END SUBROUTINE h5gset_comment_f
See <a href="Groups.html#H5GUnlinkToCorrupt">The Group Interface</a>
in the <cite>HDF5 User's Guide</cite>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>loc_id</code>
- <dd>IN: Identifier of the file or group containing the object.
- <dt><em>const char *</em> <code>name</code>
- <dd>IN: Name of the object to unlink.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>loc_id</code></td>
+ <td valign="top">IN: Identifier of the file or group containing the object.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;char&nbsp;*</em>&nbsp;<code>name&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Name of the object to unlink.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
diff --git a/doc/html/RM_H5I.html b/doc/html/RM_H5I.html
index 1dd7078..472133a 100644
--- a/doc/html/RM_H5I.html
+++ b/doc/html/RM_H5I.html
@@ -202,10 +202,11 @@ as the corresponding C function.
decremented and the HDF5 object will be closed when the reference count
for that that object drops to zero.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>obj_id</code>
- <dd>IN: Object identifier whose reference count will be modified.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>obj_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Object identifier whose reference count will be modified.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative reference count of the object ID after
decrementing it if successful; otherwise a negative value is returned.
@@ -326,16 +327,18 @@ END SUBROUTINE h5iget_file_id_f
varying according to the path through the HDF5 group
hierarchy used to reach that object.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>obj_id</code>
- <dd>IN: Identifier of the object.
- This identifier can refer to a group, dataset, or
- named datatype.
- <dt><em>char *</em><code>name</code>
- <dd>OUT: A name associated with the identifier.
- <dt><em>size_t size</em>
- <dd>IN: The size of the <code>name</code> buffer.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>obj_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of the object.
+ This identifier can refer to a group, dataset, or named datatype.</td></tr>
+ <tr>
+ <td valign="top"><em>char *</em><code>name</code></td>
+ <td valign="top">OUT: A name associated with the identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t size</em></td>
+ <td valign="top">IN: The size of the <code>name</code> buffer.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the length of the name if successful,
returning <code>0</code> (zero) if no name is associated with the identifier.
@@ -385,10 +388,11 @@ END SUBROUTINE h5iget_name_f
A non-negative return value from this function indicates that the ID
is still valid.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>obj_id</code>
- <dd>IN: Object identifier whose reference count will be retrieved.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>obj_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Object identifier whose reference count will be retrieved.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative current reference count of the object ID
if successful; otherwise a negative value is returned.
@@ -452,10 +456,11 @@ END SUBROUTINE h5iget_ref_f
<code>H5Gclose</code>, etc.) to call after a call to
<code>H5Rdereference</code>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>obj_id</code>
- <dd>IN: Object identifier whose type is to be determined.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>obj_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Object identifier whose type is to be determined.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the object type if successful;
otherwise <code>H5I_BADID</code>.
@@ -533,10 +538,11 @@ END SUBROUTINE h5iget_type_f
decremented and the HDF5 object will be closed when the reference count
for that that object drops to zero.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>obj_id</code>
- <dd>IN: Object identifier whose reference count will be modified.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>obj_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Object identifier whose reference count will be modified.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative reference count of the object ID after
incrementing it if successful; otherwise a negative value is returned.
diff --git a/doc/html/RM_H5P.html b/doc/html/RM_H5P.html
index 16e6b5f..3358cc7 100644
--- a/doc/html/RM_H5P.html
+++ b/doc/html/RM_H5P.html
@@ -825,10 +825,11 @@ as the corresponding C function.
set in the dataset creation property list <code>dcpl_id</code> are
currently available.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>dcpl_id</code>
- <dd>IN: Dataset creation property list identifier.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>dcpl_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Dataset creation property list identifier.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns <code>TRUE</code> if all filters are available
and <code>FALSE</code> if one or more is not currently available.<br>
@@ -865,10 +866,11 @@ SUBROUTINE
finished accessing them.
This frees resources used by the property list.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Identifier of the property list to terminate access to.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>plist&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of the property list to terminate access to.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -915,7 +917,7 @@ END SUBROUTINE h5pclose_f
<dt><strong>Parameters:</strong>
<ul><table>
<tr>
- <td><em>hid_t</em> <code>class</code></td>
+ <td><em>hid_t</em>&nbsp;<code>class&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
<td>IN: Property list class to close</td></tr>
</table></ul>
@@ -970,7 +972,7 @@ END SUBROUTINE h5pclose_class_f
<dt><strong>Parameters:</strong>
<ul><table>
<tr>
- <td><em>hid_t</em> <code>plist</code><td>
+ <td><em>hid_t</em>&nbsp;<code>plist&nbsp;&nbsp;&nbsp;&nbsp;</code><td>
<td>IN: Property list to close</td></tr>
</table></ul>
@@ -1013,10 +1015,11 @@ END SUBROUTINE h5pclose_list_f
The new property list has the same properties and values
as the original property list.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Identifier of property list to duplicate.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>plist&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of property list to duplicate.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a property list identifier if successful;
otherwise returns a negative value.
@@ -1092,7 +1095,7 @@ END SUBROUTINE h5pcopy_f
<td><em>hid_t</em> <code>src_id</code></td>
<td>IN: Identifier of the source property list or class</td></tr>
<tr>
- <td><em>const char *</em><code>name</code></td>
+ <td><em>const&nbsp;char&nbsp;*</em><code>name&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
<td>IN: Name of the property to copy</td></tr>
</table></ul>
@@ -1168,10 +1171,11 @@ END SUBROUTINE h5pcopy_prop_f
<code>H5Pclose</code>;
otherwise, errors are likely to occur.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>cls_id</code>
- <dd>IN: The class of the property list to create.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>cls_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: The class of the property list to create.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a property list identifier (<code>plist</code>) if successful;
otherwise Fail (-1).
@@ -1314,7 +1318,7 @@ END SUBROUTINE h5pcreate_f
<td><em>const char *</em><code>name</code></td>
<td>IN: Name of property list class to register</td></tr>
<tr>
- <td><em>H5P_cls_create_func_t</em> <code>create</code></td>
+ <td><em>H5P_cls_create_func_t</em>&nbsp;<code>create&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
<td>IN: Callback routine called when a property list is created</td></tr>
<tr>
<td><em>H5P_cls_copy_func_t</em> <code>copy</code></td>
@@ -1329,6 +1333,7 @@ END SUBROUTINE h5pcreate_f
<dd>Success: a valid property list class identifier
<dd>Failure: a negative value
+<!-- NEW PAGE -->
<dt><strong>Fortran90 Interface:</strong> h5pcreate_class_f
<dd>
<pre>
@@ -1383,7 +1388,7 @@ END SUBROUTINE h5pcreate_class_f
<dt><strong>Parameter:</strong>
<ul><table>
<tr>
- <td><em>hid_t</em> <code>class</code>;</td>
+ <td><em>hid_t</em>&nbsp;<code>class;&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
<td>IN: Class of property list to create.</td></tr>
</table></ul>
@@ -1408,6 +1413,105 @@ SUBROUTINE
</dl>
<!-- NEW PAGE -->
+<!-- HEADER RIGHT "H5Premove_filter" -->
+<hr>
+<dl>
+ <dt><strong>Name:</strong> <a name="Property-RemoveFilter">H5Premove_filter</a>
+ <dt><strong>Signature:</strong>
+ <dd><em>herr_t</em> <code>H5Premove_filter</code>(<em>hid_t</em> <code>plist</code>,
+ <em>H5Z_filter_t</em> <code>filter</code>
+ )
+ <dt><strong>Purpose:</strong>
+ <dd>Delete one or more filters in the filter pipeline.
+ <dt><strong>Description:</strong>
+ <dd><code>H5Premove_filter</code> removes the specified
+ <code>filter</code> from the filter pipeline in the
+ dataset creation property list <code>plist</code>.
+ <p>
+ The <code>filter</code> parameter specifies the filter to be removed.
+ Valid values for use in <code>filter</code> are as follows:
+
+ <center>
+ <table width=75%>
+ <tr valign=top align=left><td>
+ <code>H5Z_FILTER_ALL</code>
+ </td><td>
+ Removes all filters from the permanent filter pipeline.
+ </td></tr>
+ <tr valign=top align=left><td>
+ <code>H5Z_FILTER_DEFLATE</code>
+ </td><td>
+ Data compression filter, employing the gzip algorithm
+ </td></tr>
+ <tr valign=top align=left><td>
+ <code>H5Z_FILTER_SHUFFLE</code>
+ </td><td>
+ Data shuffling filter
+ </td></tr>
+ <tr valign=top align=left><td>
+ <code>H5Z_FILTER_FLETCHER32&nbsp;&nbsp;</code>
+ </td><td>
+ Error detection filter, employing the Fletcher32 checksum algorithm
+ </td></tr>
+ <tr valign=top align=left><td>
+ <code>H5Z_FILTER_SZIP</code>
+ </td><td>
+ Data compression filter, employing the SZIP algorithm
+ </td></tr>
+ </table>
+ </center>
+ <p>
+ Additionally, user-defined filters can be removed with this routine
+ by passing the filter identifier with which they were registered
+ with the HDF5 Library.
+ <p>
+ Attempting to remove a filter that is not in the permanent filter
+ pipeline is an error.
+ <dt><strong>Note:</strong>
+ <dd>This function currently supports only the permanent filter
+ pipeline; <code>plist</code> must be a dataset creation
+ property list.
+ <dt><strong>Parameters:</strong>
+ <dl>
+ <dt><em>hid_t</em> <code>plist_id</code>
+ <dd>IN: Dataset creation property list identifier.
+ <dt><em>H5Z_filter_t</em> <code>filter</code>
+ <dd>IN: Filter to be deleted.
+ </dl>
+ <dt><strong>Returns:</strong>
+ <dd>Returns a non-negative value if successful;
+ otherwise returns a negative value.
+
+ <dt><strong>Fortran90 Interface:</strong> h5premove_filter_f
+ <dd>
+ <pre>
+SUBROUTINE h5premove_filter_f(prp_id, filter, hdferr)
+
+ IMPLICIT NONE
+ INTEGER(HID_T), INTENT(IN) :: prp_id ! Dataset creation property
+ ! list identifier
+ INTEGER, INTENT(IN) :: filter ! Filter to be removed
+ ! Valid values are:
+ ! H5Z_FILTER_ALL_F
+ ! H5Z_FILTER_DEFLATE_F
+ ! H5Z_FILTER_SHUFFLE_F
+ ! H5Z_FILTER_FLETCHER32_F
+ ! H5Z_FILTER_SZIP_F
+ !
+ INTEGER, INTENT(OUT) :: hdferr ! Error code
+ ! 0 on success, -1 on failure
+END SUBROUTINE h5premove_filter_f
+ </pre>
+
+ <!--<dt><strong>Non-C API(s):</strong>
+ <dd>
+
+ <img src="Graphics/Java.gif">
+ <img src="Graphics/C++.gif">
+ -->
+</dl>
+
+<!-- NEW PAGE -->
<!-- HEADER RIGHT "H5Pequal" -->
<hr>
<dl>
@@ -1434,7 +1538,7 @@ SUBROUTINE
<dt><strong>Parameters:</strong>
<ul><table>
<tr>
- <td><em>hid_t</em> <code>id1</code></td>
+ <td><em>hid_t</em>&nbsp;<code>id1&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
<td>IN: First property object to be compared</td></tr>
<tr>
<td><em>hid_t</em> <code>id2</code></td>
@@ -1494,7 +1598,7 @@ END SUBROUTINE h5pequal_f
<td><em>hid_t</em> <code>id</code></td>
<td>IN: Identifier for the property to query</td></tr>
<tr>
- <td><em>const char *</em><code>name</code></td>
+ <td><em>const&nbsp;char&nbsp;*</em><code>name&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
<td>IN: Name of property to check for</td></tr>
</table></ul>
@@ -1564,12 +1668,14 @@ END SUBROUTINE h5pexist_f
See <a href="RM_H5D.html#Dataset-Create">H5Dcreate</a> for
further cross-references.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist_id</code>
- <dd>IN: Dataset creation property list identifier.
- <dt><em>H5D_fill_value_t *</em><code>status</code>
- <dd>OUT: Status of fill value in property list.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist_id</code></td>
+ <td valign="top">IN: Dataset creation property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>H5D_fill_value_t&nbsp;*</em><code>status&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: Status of fill value in property list.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -1631,7 +1737,7 @@ SUBROUTINE
<td><em>hid_t</em> <code>plid</ecodem></td>
<td>IN: Identifier of the property list to query</td></tr>
<tr>
- <td><em>const char *</em><code>name</code></td>
+ <td><em>const&nbsp;char&nbsp;*</em><code>name&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
<td>IN: Name of property to query</td></tr>
<tr>
<td><em>void *</em><code>value</code></td>
@@ -1688,14 +1794,17 @@ END SUBROUTINE h5pget_f
The <code>threshold</code> and/or <code>alignment</code> pointers
may be null pointers (NULL).
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Identifier of a file access property list.
- <dt><em>hsize_t</em> <code>*threshold</code>
- <dd>OUT: Pointer to location of return threshold value.
- <dt><em>hsize_t</em> <code>*alignment</code>
- <dd>OUT: Pointer to location of return alignment value.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist</code></td>
+ <td valign="top">IN: Identifier of a file access property list.</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t</em>&nbsp;<code>*threshold&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: Pointer to location of return threshold value.</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t</em> <code>*alignment</code></td>
+ <td valign="top">OUT: Pointer to location of return alignment value.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -1766,12 +1875,14 @@ END SUBROUTINE h5pget_alignment_f
set with the functions
<code>H5Pget_fill_value</code> and <code>H5Pget_fill_time</code>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist_id</code>
- <dd>IN: Dataset creation property list identifier.
- <dt><em>H5D_alloc_time_t *</em><code>alloc_time</code>
- <dd>IN: When to allocate dataset storage space.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist_id</code></td>
+ <td valign="top">IN: Dataset creation property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>H5D_alloc_time_t&nbsp;*</em><code>alloc_time&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: When to allocate dataset storage space.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -1823,16 +1934,20 @@ END SUBROUTINE h5pget_alloc_time_f
arguments <code>left</code>, <code>middle</code>, and <code>right</code>,
as set by the <a href="#Property-SetBTreeRatios">H5Pset_btree_ratios</a> function.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: The dataset transfer property list identifier.
- <dt><em>double</em> <code>left</code>
- <dd>OUT: The B-tree split ratio for left-most nodes.
- <dt><em>double</em> <code>right</code>
- <dd>OUT: The B-tree split ratio for right-most nodes and lone nodes.
- <dt><em>double</em> <code>middle</code>
- <dd>OUT: The B-tree split ratio for all other nodes.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist</code></td>
+ <td valign="top">IN: The dataset transfer property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>double</em> <code>left</code></td>
+ <td valign="top">OUT: The B-tree split ratio for left-most nodes.</td></tr>
+ <tr>
+ <td valign="top"><em>double</em> <code>right</code></td>
+ <td valign="top">OUT: The B-tree split ratio for right-most nodes and lone nodes.</td></tr>
+ <tr>
+ <td valign="top"><em>double</em>&nbsp;<code>middle&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: The B-tree split ratio for all other nodes.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -1876,16 +1991,19 @@ END SUBROUTINE h5pget_btree_ratios_f
<dd><code>H5Pget_buffer</code> reads values previously set
with H5Pset_buffer.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Identifier for the dataset transfer property list.
- <dt><em>void</em> <code>**tconv</code>
- <dd>OUT: Address of the pointer to application-allocated
- type conversion buffer.
- <dt><em>void</em> <code>**bkg</code>
- <dd>OUT: Address of the pointer to application-allocated
- background buffer.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist</code></td>
+ <td valign="top">IN: Identifier for the dataset transfer property list.</td></tr>
+ <tr>
+ <td valign="top"><em>void</em>&nbsp;<code>**tconv&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: Address of the pointer to application-allocated
+ type conversion buffer.</td></tr>
+ <tr>
+ <td valign="top"><em>void</em> <code>**bkg</code></td>
+ <td valign="top">OUT: Address of the pointer to application-allocated
+ background buffer.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns buffer size, in bytes, if successful;
otherwise 0 on failure.
@@ -1933,25 +2051,30 @@ END SUBROUTINE h5pget_buffer_f
Any (or all) arguments may be null pointers, in which case the
corresponding datum is not returned.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist_id</code>
- <dd>IN: Identifier of the file access property list.
- <dt><em>int</em> <code>*mdc_nelmts</code>
- <dd>IN/OUT: Number of elements (objects) in the meta data cache.
- <dt><em>int</em> <code>*rdcc_nelmts</code>
- <dd>IN/OUT: Number of elements (objects) in the raw data chunk cache.
- <dt><em>size_t</em> <code>*rdcc_nbytes</code>
- <dd>IN/OUT: Total size of the raw data chunk cache, in bytes.
- <dt><em>double</em> <code>*rdcc_w0</code>
- <dd>IN/OUT: Preemption policy.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist_id</code></td>
+ <td valign="top">IN: Identifier of the file access property list.</td></tr>
+ <tr>
+ <td valign="top"><em>int</em> <code>*mdc_nelmts</code></td>
+ <td valign="top">IN/OUT: Number of elements (objects) in the meta data cache.</td></tr>
+ <tr>
+ <td valign="top"><em>int</em> <code>*rdcc_nelmts</code></td>
+ <td valign="top">IN/OUT: Number of elements (objects) in the raw data chunk cache.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t</em>&nbsp;<code>*rdcc_nbytes&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN/OUT: Total size of the raw data chunk cache, in bytes.</td></tr>
+ <tr>
+ <td valign="top"><em>double</em> <code>*rdcc_w0</code></td>
+ <td valign="top">IN/OUT: Preemption policy.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
<dt><strong>Fortran90 Interface:</strong> h5pget_cache_f
<dd>
<pre>
-SUBROUTINE h5pget_cache_f(prp_id, mdc_nelmts, rdcc_nelmts, rdcc_nbytes, &amp;
+SUBROUTINE h5pget_cache_f(prp_id, mdc_nelmts, rdcc_nelmts, rdcc_nbytes,
rdcc_w0, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
@@ -1995,14 +2118,17 @@ END SUBROUTINE h5pget_cache_f
At most, <code>max_ndims</code> elements of <code>dims</code>
will be initialized.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Identifier of property list to query.
- <dt><em>int</em> <code>max_ndims</code>
- <dd>IN: Size of the <code>dims</code> array.
- <dt><em>hsize_t *</em> <code>dims</code>
- <dd>OUT: Array to store the chunk dimensions.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist</code></td>
+ <td valign="top">IN: Identifier of property list to query.</td></tr>
+ <tr>
+ <td valign="top"><em>int</em>&nbsp;<code>max_ndims&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Size of the <code>dims</code> array.</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t *</em> <code>dims</code></td>
+ <td valign="top">OUT: Array to store the chunk dimensions.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns chunk dimensionality successful;
otherwise returns a negative value.
@@ -2047,10 +2173,11 @@ END SUBROUTINE h5pget_chunk_f
Valid property list classes are defined in the description of
<code>H5Pcreate</code>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Identifier of property list to query.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>plist&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of property list to query.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a property list class if successful.
Otherwise returns H5P_NO_CLASS (-1).
@@ -2104,7 +2231,7 @@ END SUBROUTINE h5pget_class_f
<dt><strong>Parameters:</strong>
<ul><table>
<tr>
- <td><em>hid_t</em> <code>pcid</code></td>
+ <td><em>hid_t</em>&nbsp;<code>pcid&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
<td>IN: Identifier of the property class to query</td></tr>
</table></ul>
@@ -2160,7 +2287,7 @@ END SUBROUTINE h5pget_class_name_f
<dt><strong>Parameters:</strong>
<ul><table>
<tr>
- <td><em>hid_t</em> <code>pcid</code></td>
+ <td><em>hid_t</em>&nbsp;<code>pcid&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
<td>IN: Identifier of the property class to query</td></tr>
</table></ul>
@@ -2224,10 +2351,11 @@ END SUBROUTINE h5pget_class_parent_f
The returned driver identifier is only valid as long as the
file driver remains registered.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist_id</code>
- <dd>IN: File access or data transfer property list identifier.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>plist_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: File access or data transfer property list identifier.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a valid low-level driver identifier if successful.
Otherwise returns a negative value.
@@ -2319,12 +2447,14 @@ END SUBROUTINE h5pget_driver_f
<p>
<code>H5Pget_dxpl_mpio</code> is not a collective function.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>dxpl_id</code>
- <dd>IN: Data transfer property list identifier.
- <dt><em>H5FD_mpio_xfer_t *</em><code>xfer_mode</code>
- <dd>OUT: Data transfer mode.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>dxpl_id</code></td>
+ <td valign="top">IN: Data transfer property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>H5FD_mpio_xfer_t&nbsp;*</em><code>xfer_mode&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: Data transfer mode.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful.
Otherwise returns a negative value.
@@ -2369,12 +2499,14 @@ END SUBROUTINE h5pget_dxpl_mpio_f
<dd><code>H5Pget_dxpl_multi</code> returns the data transfer property list
information for the multi-file driver.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>dxpl_id</code>,
- <dd>IN: Data transfer property list identifier.
- <dt><em>const hid_t *</em><code>memb_dxpl</code>
- <dd>OUT: Array of data access property lists.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>dxpl_id</code>,</td>
+ <td valign="top">IN: Data transfer property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;hid_t&nbsp;*</em><code>memb_dxpl&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: Array of data access property lists.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful.
Otherwise returns a negative value.
@@ -2408,10 +2540,11 @@ SUBROUTINE
list <code>plist</code> to determine whether error detection
is enabled for data read operations.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Dataset transfer property list identifier.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>plist&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Dataset transfer property list identifier.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns <code>H5Z_ENABLE_EDC</code> or <code>H5Z_DISABLE_EDC</code>
if successful;
@@ -2446,7 +2579,7 @@ END SUBROUTINE h5pget_edc_check_f
<dt><strong>Name:</strong> <a name="Property-GetExternal">H5Pget_external</a>
<dt><strong>Signature:</strong>
<dd><em>herr_t</em> <code>H5Pget_external</code>(<em>hid_t</em> <code>plist</code>,
- <em>int</em> <code>idx</code>,
+ <em>unsigned</em> <code>idx</code>,
<em>size_t</em> <code>name_size</code>,
<em>char</em> <code>*name</code>,
<em>off_t</em> <code>*offset</code>,
@@ -2469,21 +2602,27 @@ END SUBROUTINE h5pget_edc_check_f
If <code>offset</code> or <code>size</code> are null pointers
then the corresponding information is not returned.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Identifier of a dataset creation property list.
- <dt><em>int</em> <code>idx</code>
- <dd>IN: External file index.
- <dt><em>size_t</em> <code>name_size</code>
- <dd>IN: Maximum length of <code>name</code> array.
- <dt><em>char</em> <code>*name</code>
- <dd>OUT: Name of the external file.
- <dt><em>off_t</em> <code>*offset</code>
- <dd>OUT: Pointer to a location to return an offset value.
- <dt><em>hsize_t</em> <code>*size</code>
- <dd>OUT: Pointer to a location to return the size of the
- external file data.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist</code></td>
+ <td valign="top">IN: Identifier of a dataset creation property list.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned</em> <code>idx</code></td>
+ <td valign="top">IN: External file index.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t</em>&nbsp;<code>name_size&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Maximum length of <code>name</code> array.</td></tr>
+ <tr>
+ <td valign="top"><em>char</em> <code>*name</code></td>
+ <td valign="top">OUT: Name of the external file.</td></tr>
+ <tr>
+ <td valign="top"><em>off_t</em> <code>*offset</code></td>
+ <td valign="top">OUT: Pointer to a location to return an offset value.</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t</em> <code>*size</code></td>
+ <td valign="top">OUT: Pointer to a location to return the size of the
+ external file data.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -2529,10 +2668,11 @@ END SUBROUTINE h5pget_external_f
<dd><code>H5Pget_external_count</code> returns the number of external files
for the specified dataset.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Identifier of a dataset creation property list.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>plist&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of a dataset creation property list.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the number of external files if successful;
otherwise returns a negative value.
@@ -2587,12 +2727,14 @@ END SUBROUTINE h5pget_external_count_f
Use of this function is only appropriate for an HDF5 file written as a
family of files with the <code>FAMILY</code> file driver.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>fapl_id</code>
- <dd>IN: File access property list identifier.
- <dt><em>hsize_t *</em><code>offset</code>
- <dd>IN: Offset in bytes within the HDF5 file.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>fapl_id</code></td>
+ <td valign="top">IN: File access property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t&nbsp;*</em><code>offset&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Offset in bytes within the HDF5 file.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -2629,15 +2771,18 @@ SUBROUTINE
<dd><code>H5Pget_fapl_core</code> queries the <code>H5FD_CORE</code>
driver properties as set by <code>H5Pset_fapl_core</code>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>fapl_id</code>
- <dd>IN: File access property list identifier.
- <dt><em>size_t</em> *<code>increment</code>
- <dd>OUT: Size, in bytes, of memory increments.
- <dt><em>hbool_t</em> *<code>backing_store</code>
- <dd>OUT: Boolean flag indicating whether to write the file
- contents to disk when the file is closed.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>fapl_id</code></td>
+ <td valign="top">IN: File access property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t</em> *<code>increment</code></td>
+ <td valign="top">OUT: Size, in bytes, of memory increments.</td></tr>
+ <tr>
+ <td valign="top"><em>hbool_t</em>&nbsp;*<code>backing_store&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: Boolean flag indicating whether to write the file
+ contents to disk when the file is closed.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful.
Otherwise returns a negative value.
@@ -2683,15 +2828,18 @@ END SUBROUTINE h5pget_fapl_core_f
for use with the family driver.
This information is returned through the output parameters.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>fapl_id</code>
- <dd>IN: File access property list identifier.
- <dt><em> hsize_t *</em><code>memb_size</code>
- <dd>OUT: Size in bytes of each file member.
- <dt><em>hid_t *</em><code>memb_fapl_id</code>
- <dd>OUT: Identifier of file access property list for each
- family member.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>fapl_id</code></td>
+ <td valign="top">IN: File access property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em> hsize_t *</em><code>memb_size</code></td>
+ <td valign="top">OUT: Size in bytes of each file member.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t&nbsp;*</em><code>memb_fapl_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: Identifier of file access property list for each
+ family member.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -2746,12 +2894,14 @@ END SUBROUTINE h5pget_fapl_family_f
For further information, see
<a href="http://www.globus.org/">http//www.globus.org/</a>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>fapl_id</code>,
- <dd>IN: File access property list identifier.
- <dt><em>GASS_Info *</em><code>info</code>
- <dd>OUT: Pointer to the GASS information structure.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>fapl_id</code>,</td>
+ <td valign="top">IN: File access property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>GASS_Info&nbsp;*</em><code>info&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: Pointer to the GASS information structure.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful.
Otherwise returns a negative value.
@@ -2794,14 +2944,17 @@ SUBROUTINE
so they are valid only until the file access property list
is either modified or closed.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>fapl_id</code>
- <dd>IN: File access property list identifier.
- <dt><em>MPI_Comm *</em><code>comm</code>
- <dd>OUT: MPI-2 communicator.
- <dt><em>MPI_Info *</em><code>info</code>
- <dd>OUT: MPI-2 info object.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>fapl_id</code></td>
+ <td valign="top">IN: File access property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>MPI_Comm&nbsp;*</em><code>comm&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: MPI-2 communicator.</td></tr>
+ <tr>
+ <td valign="top"><em>MPI_Info *</em><code>info</code></td>
+ <td valign="top">OUT: MPI-2 info object.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful.
Otherwise returns a negative value.
@@ -2848,12 +3001,14 @@ END SUBROUTINE h5pget_fapl_mpio_f
<code>comm</code> is not copied, so it is valid only
until the file access property list is either modified or closed.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>fapl_id</code>
- <dd>IN: File access property list identifier.
- <dt><em>MPI_Comm *</em><code>comm</code>
- <dd>OUT: MPI-2 communicator.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>fapl_id</code></td>
+ <td valign="top">IN: File access property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>MPI_Comm&nbsp;*</em><code>comm&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: MPI-2 communicator.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful.
Otherwise returns a negative value.
@@ -2897,28 +3052,34 @@ END SUBROUTINE h5pget_fapl_mpiposix_f
<dd><code>H5Pget_fapl_multi</code> returns information about the
multi-file access property list.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>fapl_id</code>
- <dd>IN: File access property list identifier.
- <dt><em>const H5FD_mem_t *</em><code>memb_map</code>
- <dd>OUT: Maps memory usage types to other memory usage types.
- <dt><em>const hid_t *</em><code>memb_fapl</code>
- <dd>OUT: Property list for each memory usage type.
- <dt><em>const char **</em><code>memb_name</code>
- <dd>OUT: Name generator for names of member files.
- <dt><em>const haddr_t *</em><code>memb_addr</code>
- <dd>OUT:
- <dt><em>hbool_t *</em><code>relax</code>
- <dd>OUT: Allows read-only access to incomplete file sets
- when <code>TRUE</code>.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>fapl_id</code></td>
+ <td valign="top">IN: File access property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;H5FD_mem_t&nbsp;*</em><code>memb_map&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: Maps memory usage types to other memory usage types.</td></tr>
+ <tr>
+ <td valign="top"><em>const hid_t *</em><code>memb_fapl</code></td>
+ <td valign="top">OUT: Property list for each memory usage type.</td></tr>
+ <tr>
+ <td valign="top"><em>const char **</em><code>memb_name</code></td>
+ <td valign="top">OUT: Name generator for names of member files.</td></tr>
+ <tr>
+ <td valign="top"><em>const haddr_t *</em><code>memb_addr</code></td>
+ <td valign="top">OUT:</td></tr>
+ <tr>
+ <td valign="top"><em>hbool_t *</em><code>relax</code></td>
+ <td valign="top">OUT: Allows read-only access to incomplete file sets
+ when <code>TRUE</code>.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful.
Otherwise returns a negative value.
<dt><strong>Fortran90 Interface:</strong> h5pget_fapl_multi_f
<dd>
<pre>
-SUBROUTINE h5pget_fapl_multi_f(prp_id, memb_map, memb_fapl, memb_name, &amp;
+SUBROUTINE h5pget_fapl_multi_f(prp_id, memb_map, memb_fapl, memb_name,
memb_addr, relax, hdferr)
IMPLICIT NONE
INTEGER(HID_T),INTENT(IN) :: prp_id ! Property list identifier
@@ -2970,12 +3131,14 @@ END SUBROUTINE h5pget_fapl_multi_f
Storage Resource Broker (SRB). For further information, see
<a href="http://www.npaci.edu/Research/DI/srb/">http//www.npaci.edu/Research/DI/srb/</a>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>fapl_id</code>
- <dd>IN: File access property list identifier.
- <dt><em>SRB_Info *</em><code>info</code>
- <dd>OUT: Pointer to the SRB information structure.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>fapl_id</code></td>
+ <td valign="top">IN: File access property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>SRB_Info&nbsp;*</em><code>info&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: Pointer to the SRB information structure.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful.
Otherwise returns a negative value.
@@ -3013,12 +3176,14 @@ SUBROUTINE
<code>H5Pset_fapl_stream</code> and <code>H5Pget_fapl_stream</code>
are not intended for use in a parallel environment.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>fapl_id</code>
- <dd>IN: File access property list identifier.
- <dt><em>H5FD_stream_fapl_t *</em><code>fapl</code>
- <dd>OUT: The streaming I/O file access property list.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>fapl_id</code></td>
+ <td valign="top">IN: File access property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>H5FD_stream_fapl_t&nbsp;*</em><code>fapl&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: The streaming I/O file access property list.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful.
Otherwise returns a negative value.
@@ -3056,13 +3221,15 @@ SUBROUTINE
is called to close that file.  <code>fc_degree</code> can have any one of
four valid values as described above in <a href="#Property-SetFcloseDegree"><code>H5Pset_fclose_degree</code></a>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>fapl_id</code>
- <dd>IN: File access property list identifier.
- <dt><em>H5F_close_degree_t *</em><code>fc_degree</code>
- <dd>OUT: Pointer to a location to which to return the file close degree
- property, the value of <code>fc_degree</code>.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>fapl_id</code></td>
+ <td valign="top">IN: File access property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>H5F_close_degree_t&nbsp;*</em><code>fc_degree&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: Pointer to a location to which to return the file close degree
+ property, the value of <code>fc_degree</code>.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful. Otherwise returns a negative
value.
@@ -3131,12 +3298,14 @@ END SUBROUTINE h5pget_fclose_degree_f
dataset storage allocation time properties, retrieved with the functions
<code>H5Pget_fill_value</code> and <code>H5Pget_alloc_time</code>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist_id</code>
- <dd>IN: Dataset creation property list identifier.
- <dt><em>H5D_fill_time_t *</em><code>fill_time</code>
- <dd>OUT: Setting for the timing of writing fill values to the dataset.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist_id</code></td>
+ <td valign="top">IN: Dataset creation property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>H5D_fill_time_t&nbsp;*</em><code>fill_time&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: Setting for the timing of writing fill values to the dataset.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -3206,15 +3375,17 @@ END SUBROUTINE h5pget_fill_time_f
and <code>H5Pget_fill_time</code>, respectively.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist_id</code>
- <dd>IN: Dataset creation property list identifier.
- <dt><em>hid_t</em> <code>type_id</code>,
- <dd>IN: Datatype identifier for the value passed
- via <code>value</code>.
- <dt><em>void *</em><code>value</code>
- <dd>OUT: Pointer to buffer to contain the returned fill value.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>plist_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Dataset creation property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>type_id</code>,</td>
+ <td valign="top">IN: Datatype identifier for the value passed
+ via <code>value</code>.</td></tr>
+ <tr><td valign="top"><em>void *</em><code>value</code></td>
+ <td valign="top">OUT: Pointer to buffer to contain the returned fill value.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -3253,7 +3424,7 @@ END SUBROUTINE h5pget_fill_value_f
<em>size_t *</em><code>cd_nelmts</code>,
<em>unsigned int *</em><code>cd_values</code>,
<em>size_t</em> <code>namelen</code>,
- <em>char</em> <code>name[]</code>
+ <em>char</em> <code>name[]</code>
)
<dt><strong>Purpose:</strong>
<dd>Returns information about a filter in a pipeline.
@@ -3292,24 +3463,32 @@ END SUBROUTINE h5pget_fill_value_f
pipeline; <code>plist</code> must be a dataset creation property
list.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Property list identifier.
- <dt><em>int</em> <code>filter_number</code>
- <dd>IN: Sequence number within the filter pipeline of
- the filter for which information is sought.
- <dt><em>unsigned int *</em><code>flags</code>
- <dd>OUT: Bit vector specifying certain general properties
- of the filter.
- <dt><em>size_t *</em><code>cd_nelmts</code>
- <dd>IN/OUT: Number of elements in <code>cd_values</code>.
- <dt><em>unsigned int *</em><code>cd_values</code>
- <dd>OUT: Auxiliary data for the filter.
- <dt><em>size_t</em> <code>namelen</code>
- <dd>IN: Anticipated number of characters in <code>name</code>.
- <dt><em>char</em> <code>name[]</code>
- <dd>OUT: Name of the filter.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist</code></td>
+ <td valign="top">IN: Property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>int</em> <code>filter_number</code></td>
+ <td valign="top">IN: Sequence number within the filter pipeline of
+ the filter for which information is sought.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned int *</em><code>flags</code></td>
+ <td valign="top">OUT: Bit vector specifying certain general properties
+ of the filter.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t *</em><code>cd_nelmts</code></td>
+ <td valign="top">IN/OUT: Number of elements in <code>cd_values</code>.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned&nbsp;int&nbsp;*</em><code>cd_values&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: Auxiliary data for the filter.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t</em> <code>namelen</code></td>
+ <td valign="top">IN: Anticipated number of characters in <code>name</code>.</td></tr>
+ <tr>
+ <td valign="top"><em>char</em> <code>name[]</code></td>
+ <td valign="top">OUT: Name of the filter.</td></tr>
+ </table></ul>
+<!-- NEW PAGE -->
<dt><strong>Returns:</strong>
<dd>Returns the filter identifier if successful:
<center>
@@ -3418,24 +3597,31 @@ END SUBROUTINE h5pget_filter_f
set for the property list, an error will be returned
and <code>H5Pget_filter_by_id</code> will fail.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist_id</code>
- <dd>IN: Property list identifier.
- <dt><em>H5Z_filter_t</em> <code>filter</code>
- <dd>IN: Filter identifier.
- <dt><em>unsigned int</em> <code>flags</code>
- <dd>OUT: Bit vector specifying certain general properties
- of the filter.
- <dt><em>size_t</em> <code>cd_nelmts</code>
- <dd>IN/OUT: Number of elements in <code>cd_values</code>.
- <dt><em>const unsigned int</em> <code>cd_values[]</code>
- <dd>OUT: Auxiliary data for the filter.
- <dt><em>size_t</em> <code>namelen</code>
- <dd>IN/OUT: Length of filter name and
- number of elements in <code>name[]</code>.
- <dt><em>char *</em><code>name[]</code>
- <dd>OUT: Name of filter.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist_id</code></td>
+ <td valign="top">IN: Property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>H5Z_filter_t</em> <code>filter</code></td>
+ <td valign="top">IN: Filter identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned int</em> <code>flags</code></td>
+ <td valign="top">OUT: Bit vector specifying certain general properties
+ of the filter.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t</em> <code>cd_nelmts</code></td>
+ <td valign="top">IN/OUT: Number of elements in <code>cd_values</code>.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;unsigned&nbsp;int</em>&nbsp;<code>cd_values[]&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: Auxiliary data for the filter.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t</em> <code>namelen</code></td>
+ <td valign="top">IN/OUT: Length of filter name and
+ number of elements in <code>name[]</code>.</td></tr>
+ <tr>
+ <td valign="top"><em>char *</em><code>name[]</code></td>
+ <td valign="top">OUT: Name of filter.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -3443,7 +3629,7 @@ END SUBROUTINE h5pget_filter_f
<dt><strong>Fortran90 Interface:</strong> h5pget_filter_by_id_f
<dd>
<pre>
-SUBROUTINE h5pget_filter_by_id_f(prp_id, filter_id, flags, cd_nelmts, &amp;
+SUBROUTINE h5pget_filter_by_id_f(prp_id, filter_id, flags, cd_nelmts,
cd_values, namelen, name, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: prp_id ! Property list identifier
@@ -3488,15 +3674,17 @@ END SUBROUTINE h5pget_filter_by_id_f
The garbage collection references property is set
by <a href="#Property-SetGCReferences">H5Pset_gc_references</a>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: File access property list identifier.
- <dt><em>unsigned</em> <code>gc_ref</code>
- <dd>OUT: Flag returning the state of reference garbage collection.
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist</code></td>
+ <td valign="top">IN: File access property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned</em>&nbsp;<code>gc_ref&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: Flag returning the state of reference garbage collection.
A returned value of <code>1</code> indicates that
garbage collection is on while
- <code>0</code> indicates that garbage collection is off.
- </dl>
+ <code>0</code> indicates that garbage collection is off.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -3608,12 +3796,14 @@ END SUBROUTINE h5pget_hyper_cache_f
was previously set with a call to
<a href="#Property-SetHyperVectorSize">H5Pset_hyper_vector_size</a>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>dxpl_id</code>
- <dd>IN: Dataset transfer property list identifier.
- <dt><em>size_t *</em><code>vector_size</code>
- <dd>OUT: Number of I/O vectors to accumulate in memory for I/O operations.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>dxpl_id</code></td>
+ <td valign="top">IN: Dataset transfer property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t&nbsp;*</em><code>vector_size&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: Number of I/O vectors to accumulate in memory for I/O operations.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -3645,7 +3835,7 @@ END SUBROUTINE h5pget_hyper_vector_size_f
<dt><strong>Name:</strong> <a name="Property-GetIstoreK">H5Pget_istore_k</a>
<dt><strong>Signature:</strong>
<dd><em>herr_t </em><code>H5Pget_istore_k</code>(<em>hid_t</em> <code>plist</code>,
- <em>int *</em> <code>ik</code>
+ <em>unsigned *</em> <code>ik</code>
)
<dt><strong>Purpose:</strong>
<dd>Queries the 1/2 rank of an indexed storage B-tree.
@@ -3657,12 +3847,14 @@ END SUBROUTINE h5pget_hyper_vector_size_f
<p>
See <a href="#Property-SetIstoreK">H5Pset_istore_k</a> for details.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Identifier of property list to query.
- <dt><em>int *</em> <code>ik</code>
- <dd>OUT: Pointer to location to return the chunked storage B-tree 1/2 rank.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>plist&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of property list to query.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned *</em> <code>ik</code></td>
+ <td valign="top">OUT: Pointer to location to return the chunked storage B-tree 1/2 rank.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -3706,10 +3898,11 @@ END SUBROUTINE h5pget_istore_k_f
documentation for details.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Identifier for property list to query.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>plist&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier for property list to query.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the layout type (a non-negative value)
of a dataset creation property list if successful.
@@ -3773,12 +3966,14 @@ END SUBROUTINE h5pget_layout_f
and is retrieved from the file access property list
<code>fapl_id</code>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>fapl_id</code>
- <dd>IN: File access property list identifier.
- <dt><em>hsize_t *</em><code>size</code>
- <dd>OUT: Minimum size, in bytes, of metadata block allocations.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>fapl_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: File access property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t *</em><code>size</code></td>
+ <td valign="top">OUT: Minimum size, in bytes, of metadata block allocations.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful.
Otherwise returns a negative value.
@@ -3836,12 +4031,14 @@ END SUBROUTINE h5pget_meta_block_size_f
Use of this function is only appropriate for an HDF5 file written
as a set of files with the <code>MULTI</code> file driver.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>fapl_id</code>
- <dd>IN: File access property list or data transfer property list identifier.
- <dt><em>H5FD_mem_t *</em><code>type</code>
- <dd>OUT: Type of data.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>fapl_id</code></td>
+ <td valign="top">IN: File access property list or data transfer property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>H5FD_mem_t&nbsp;*</em><code>type&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: Type of data.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -3889,10 +4086,11 @@ SUBROUTINE
pipeline; <code>plist_id</code> must be a dataset creation
property list.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Property list identifier.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>plist&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Property list identifier.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the number of filters in the pipeline if successful;
otherwise returns a negative value.
@@ -3947,7 +4145,7 @@ END SUBROUTINE h5pget_nfilters_f
<td><em>hid_t</em> <code>id</code></td>
<td>IN: Identifier of property object to query</td></tr>
<tr>
- <td><em>size_t *</em><code>nprops</code></td>
+ <td><em>size_t&nbsp;*</em><code>nprops&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
<td>OUT: Number of properties in object</td></tr>
</table></ul>
@@ -3988,10 +4186,11 @@ END SUBROUTINE h5pget_nprops_f
<dd><code>H5Pget_preserve</code> checks the status of the
dataset transfer property list.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Identifier for the dataset transfer property list.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>plist&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier for the dataset transfer property list.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns TRUE or FALSE if successful;
otherwise returns a negative value.
@@ -4027,8 +4226,6 @@ END SUBROUTINE h5pget_preserve_f
<em>hid_t</em> <code>fapl_id</code>,
<em>hsize_t *</em><code>size</code>
)
-<br>
-<br>
<dt><strong>Purpose:</strong>
<dd> Returns maximum data sieve buffer size.
<dt><strong>Description:</strong>
@@ -4040,12 +4237,14 @@ END SUBROUTINE h5pget_preserve_f
and is retrieved from the file access property list
<code>fapl_id</code>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>fapl_id</code>
- <dd>IN: File access property list identifier.
- <dt><em>hsize_t *</em><code>size</code>
- <dd>IN: Maximum size, in bytes, of data sieve buffer.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>fapl_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: File access property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t *</em><code>size</code></td>
+ <td valign="top">IN: Maximum size, in bytes, of data sieve buffer.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful.
Otherwise returns a negative value.
@@ -4101,7 +4300,7 @@ END SUBROUTINE h5pget_sieve_buf_size_f
<td><em>hid_t</em> <code>id</code></td>
<td>IN: Identifier of property object to query</td></tr>
<tr>
- <td><em>const char *</em><code>name</code></td>
+ <td><em>const&nbsp;char&nbsp;*</em><code>name&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
<td>IN: Name of property to query</td></tr>
<tr>
<td><em>size_t *</em><code>size</code></td>
@@ -4150,14 +4349,17 @@ END SUBROUTINE h5pget_size_f
and lengths used in an HDF5 file.
This function is only valid for file creation property lists.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Identifier of property list to query.
- <dt><em>size_t *</em> <code>size</code>
- <dd>OUT: Pointer to location to return offset size in bytes.
- <dt><em>size_t *</em> <code>size</code>
- <dd>OUT: Pointer to location to return length size in bytes.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist</code></td>
+ <td valign="top">IN: Identifier of property list to query.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t&nbsp;*</em>&nbsp;<code>size&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: Pointer to location to return offset size in bytes.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t *</em> <code>size</code></td>
+ <td valign="top">OUT: Pointer to location to return length size in bytes.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -4202,12 +4404,14 @@ END SUBROUTINE h5pget_sizes_f
If the returned value is zero (<code>0</code>), the small data
block mechanism has been disabled for the file.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>fapl_id</code>
- <dd>IN: File access property list identifier .
- <dt><em>hsize_t *</em><code>size</code>
- <dd>OUT: Maximum size, in bytes, of the small data block.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>fapl_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: File access property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t *</em><code>size</code></td>
+ <td valign="top">OUT: Maximum size, in bytes, of the small data block.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise a negative value.
@@ -4239,8 +4443,8 @@ END SUBROUTINE h5pget_small_data_block_size_f
<dt><strong>Name:</strong> <a name="Property-GetSymK">H5Pget_sym_k</a>
<dt><strong>Signature:</strong>
<dd><em>herr_t </em><code>H5Pget_sym_k</code>(<em>hid_t</em> <code>plist</code>,
- <em>int *</em> <code>ik</code>,
- <em>int *</em> <code>lk</code>
+ <em>unsigned *</em> <code>ik</code>,
+ <em>unsigned *</em> <code>lk</code>
)
<dt><strong>Purpose:</strong>
<dd>Retrieves the size of the symbol table B-tree 1/2 rank
@@ -4254,14 +4458,17 @@ END SUBROUTINE h5pget_small_data_block_size_f
<a href="#Property-SetSymK">H5Pset_sym_k</a> for more
information.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Property list to query.
- <dt><em>int *</em> <code>ik</code>
- <dd>OUT: Pointer to location to return the symbol table's B-tree 1/2 rank.
- <dt><em>int *</em> <code>size</code>
- <dd>OUT: Pointer to location to return the symbol table's leaf node 1/2 size.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>plist&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Property list to query.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned *</em> <code>ik</code></td>
+ <td valign="top">OUT: Pointer to location to return the symbol table's B-tree 1/2 rank.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned *</em> <code>size</code></td>
+ <td valign="top">OUT: Pointer to location to return the symbol table's leaf node 1/2 size.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -4301,12 +4508,14 @@ END SUBROUTINE h5pget_sym_k_f
<dd><code>H5Pget_userblock</code> retrieves the size of a user block
in a file creation property list.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Identifier for property list to query.
- <dt><em>hsize_t *</em> <code>size</code>
- <dd>OUT: Pointer to location to return user-block size.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist</code></td>
+ <td valign="top">IN: Identifier for property list to query.</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t&nbsp;*</em>&nbsp;<code>size&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: Pointer to location to return user-block size.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -4338,10 +4547,10 @@ END SUBROUTINE h5pget_userblock_f
<dt><strong>Name:</strong> <a name="Property-GetVersion">H5Pget_version</a>
<dt><strong>Signature:</strong>
<dd><em>herr_t </em><code>H5Pget_version</code>(<em>hid_t</em> <code>plist</code>,
- <em>int *</em> <code>super</code>,
- <em>int *</em> <code>freelist</code>,
- <em>int *</em> <code>stab</code>,
- <em>int *</em> <code>shhdr</code>
+ <em>unsigned *</em> <code>super</code>,
+ <em>unsigned *</em> <code>freelist</code>,
+ <em>unsigned *</em> <code>stab</code>,
+ <em>unsigned *</em> <code>shhdr</code>
)
<dt><strong>Purpose:</strong>
<dd>Retrieves the version information of various objects for
@@ -4351,18 +4560,23 @@ END SUBROUTINE h5pget_userblock_f
for a file creation property list. Any pointer parameters which are
passed as NULL are not queried.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Identifier of the file creation property list.
- <dt><em>int *</em> <code>super</code>
- <dd>OUT: Pointer to location to return super block version number.
- <dt><em>int *</em> <code>freelist</code>
- <dd>OUT: Pointer to location to return global freelist version number.
- <dt><em>int *</em> <code>stab</code>
- <dd>OUT: Pointer to location to return symbol table version number.
- <dt><em>int *</em> <code>shhdr</code>
- <dd>OUT: Pointer to location to return shared object header version number.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist</code></td>
+ <td valign="top">IN: Identifier of the file creation property list.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned *</em> <code>super</code></td>
+ <td valign="top">OUT: Pointer to location to return super block version number.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned&nbsp;*</em>&nbsp;<code>freelist&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: Pointer to location to return global freelist version number.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned *</em> <code>stab</code></td>
+ <td valign="top">OUT: Pointer to location to return symbol table version number.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned *</em> <code>shhdr</code></td>
+ <td valign="top">OUT: Pointer to location to return shared object header version number.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -4415,26 +4629,31 @@ END SUBROUTINE h5pget_version_f
<code>H5Pset_vlen_mem_manager</code>, returning the parameters
set by that function.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Identifier for the dataset transfer property list.
- <dt><em>H5MM_allocate_t</em> <code>alloc</code>
- <dd>OUT: User's allocate routine, or &nbsp; <code> NULL</code>
- for system &nbsp; <code> malloc</code>.
- <dt><em>void</em> *<code>alloc_info</code>
- <dd>OUT: Extra parameter for user's allocation routine.
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist</code></td>
+ <td valign="top">IN: Identifier for the dataset transfer property list.</td></tr>
+ <tr>
+ <td valign="top"><em>H5MM_allocate_t</em>&nbsp;<code>alloc&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: User's allocate routine, or &nbsp; <code> NULL</code>
+ for system &nbsp; <code> malloc</code>.</td></tr>
+ <tr>
+ <td valign="top"><em>void</em> *<code>alloc_info</code></td>
+ <td valign="top">OUT: Extra parameter for user's allocation routine.
<br>
Contents are ignored if preceding parameter is &nbsp;
- <code> NULL</code>.
- <dt><em>H5MM_free_t</em> <code>free</code>
- <dd>OUT: User's free routine, or &nbsp; <code> NULL</code> for
- system <code>free</code>.
- <dt><em>void</em> *<code>free_info</code>
- <dd>OUT: Extra parameter for user's free routine.
+ <code> NULL</code>.</td></tr>
+ <tr>
+ <td valign="top"><em>H5MM_free_t</em> <code>free</code></td>
+ <td valign="top">OUT: User's free routine, or &nbsp; <code> NULL</code> for
+ system <code>free</code>.</td></tr>
+ <tr>
+ <td valign="top"><em>void</em> *<code>free_info</code></td>
+ <td valign="top">OUT: Extra parameter for user's free routine.
<br>
Contents are ignored if preceding parameter is &nbsp;
- <code> NULL</code>.
- </dl>
+ <code> NULL</code>.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -4576,6 +4795,7 @@ SUBROUTINE
routine returns an error value.
</p>
+ <P>
The <code>delete</code> routine is called when a property is being
deleted from a property list.
The <code>H5P_prp_delete_func_t</code> callback function is defined
@@ -4609,6 +4829,7 @@ SUBROUTINE
error value but the property is still deleted.
</P>
+ <P>
The <code>copy</code> routine is called when a new property list
with this property is being created through a copy operation.
The <code>H5P_prp_copy_func_t</code> callback function is defined
@@ -4673,6 +4894,7 @@ SUBROUTINE
list objects; the initial value is assumed to have any necessary setup
already performed on it.
+<!-- NEW PAGE -->
<dt><strong>Parameters:</strong>
<ul><table>
<tr>
@@ -4697,7 +4919,7 @@ SUBROUTINE
<td>IN: Callback routine called when a property value is retrieved
from the property</td></tr>
<tr>
- <td><em>H5P_prp_delete_func_t</em> <code>delete</code></td>
+ <td><em>H5P_prp_delete_func_t</em>&nbsp;<code>delete&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
<td>IN: Callback routine called when a property is deleted from
a property list</td></tr>
<tr>
@@ -4766,7 +4988,7 @@ END SUBROUTINE h5pinsert_f
<td><em>hid_t</em> <code>plist</code></td>
<td>IN: Identifier of the property list</td></tr>
<tr>
- <td><code>hid_t</code> <em>pclass</em></td>
+ <td><code>hid_t</code>&nbsp;<em>pclass&nbsp;&nbsp;&nbsp;&nbsp;</em></td>
<td>IN: Identifier of the property class</td></tr>
</table></ul>
@@ -4888,7 +5110,7 @@ END SUBROUTINE h5pisa_class_f
<td><em>int *</em> <code>idx</code></td>
<td>IN/OUT: Index of the property to begin with</td></tr>
<tr>
- <td><em>H5P_iterate_t</em> <code>iter_func</code></td>
+ <td><em>H5P_iterate_t</em>&nbsp;<code>iter_func&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
<td>IN: Function pointer to function to be called with each
property iterated over</td></tr>
<tr>
@@ -4948,19 +5170,24 @@ SUBROUTINE
pipeline; <code>plist_id</code> must be a dataset creation
property list.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist_id</code>
- <dd>IN: Property list identifier.
- <dt><em>H5Z_filter_t</em> <code>filter</code>
- <dd>IN: Filter to be modified.
- <dt><em>unsigned int</em> <code>flags</code>
- <dd>IN: Bit vector specifying certain general properties
- of the filter.
- <dt><em>size_t</em> <code>cd_nelmts</code>
- <dd>IN: Number of elements in <code>cd_values</code>.
- <dt><em>const unsigned int</em> <code>cd_values[]</code>
- <dd>IN: Auxiliary data for the filter.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist_id</code></td>
+ <td valign="top">IN: Property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>H5Z_filter_t</em> <code>filter</code></td>
+ <td valign="top">IN: Filter to be modified.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned int</em> <code>flags</code></td>
+ <td valign="top">IN: Bit vector specifying certain general properties
+ of the filter.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t</em> <code>cd_nelmts</code></td>
+ <td valign="top">IN: Number of elements in <code>cd_values</code>.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;unsigned&nbsp;int</em>&nbsp;<code>cd_values[]&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Auxiliary data for the filter.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -5035,6 +5262,7 @@ END SUBROUTINE h5pmodify_filter_f
<code>get</code> callbacks are never called.
</P>
+ <P>
The <code>create</code> routine is called when a new property list
with this property is being created.
The <code>H5P_prp_create_func_t</code> callback function is defined
@@ -5064,6 +5292,7 @@ END SUBROUTINE h5pmodify_filter_f
create routine returns an error value.
</P>
+ <P>
The <code>set</code> routine is called before a new value is copied
into the property.
The <code>H5P_prp_set_func_t</code> callback function is defined
@@ -5143,6 +5372,7 @@ END SUBROUTINE h5pmodify_filter_f
routine returns an error value.
</P>
+ <P>
The <code>delete</code> routine is called when a property is being
deleted from a property list.
The <code>H5P_prp_delete_func_t</code> callback function is defined
@@ -5176,6 +5406,7 @@ END SUBROUTINE h5pmodify_filter_f
an error value but the property is still deleted.
</P>
+ <P>
The <code>copy</code> routine is called when a new property list with
this property is being created through a copy operation.
The <code>H5P_prp_copy_func_t</code> callback function is defined
@@ -5236,38 +5467,49 @@ END SUBROUTINE h5pmodify_filter_f
If the <code>close</code> routine returns a negative value,
the property list close routine returns an error value but
the property list is still closed.
+ </P>
<dt><strong>Parameters:</strong>
- <ul><dl>
- <dt><code>hid_t</code> <em>class</em>
- <dd>IN: Property list class to register permanent property
- within
- <dt><code>const char *</code> <em>name</em>
- <dd>IN: Name of property to register
- <dt><code>size_t</code> <em>size</em>
- <dd>IN: Size of property in bytes
- <dt><code>void *</code> <em>default</em>
- <dd>IN: Default value for property in newly created property
- lists
- <dt><code>H5P_prp_create_func_t</code> <em>create</em>
- <dd>IN: Callback routine called when a property list is being
- created and the property value will be initialized
- <dt><code>H5P_prp_set_func_t</code> <em>set</em>
- <dd>IN: Callback routine called before a new value is copied
- into the property's value
- <dt><code>H5P_prp_get_func_t</code> <em>get</em>
- <dd>IN: Callback routine called when a property value is
- retrieved from the property
- <dt><code>H5P_prp_delete_func_t</code> <em>delete</em>
- <dd>IN: Callback routine called when a property is deleted from
- a property list
- <dt><code>H5P_prp_copy_func_t</code> <em>copy</em>
- <dd>IN: Callback routine called when a property is copied from
- a property list
- <dt><code>H5P_prp_close_func_t</code> <em>close</em>
- <dd>IN: Callback routine called when a property list is being
- closed and the property value will be disposed of
- </dl></ul>
+ <ul><table>
+ <tr>
+ <td valign="top"><code>hid_t</code> <em>class</em></td>
+ <td valign="top">IN: Property list class to register permanent property
+ within</td></tr>
+ <tr>
+ <td valign="top"><code>const char *</code> <em>name</em></td>
+ <td valign="top">IN: Name of property to register</td></tr>
+ <tr>
+ <td valign="top"><code>size_t</code> <em>size</em></td>
+ <td valign="top">IN: Size of property in bytes</td></tr>
+ <tr>
+ <td valign="top"><code>void *</code> <em>default</em></td>
+ <td valign="top">IN: Default value for property in newly created property
+ lists</td></tr>
+ <tr>
+ <td valign="top"><code>H5P_prp_create_func_t</code>&nbsp;<em>create&nbsp;&nbsp;&nbsp;&nbsp;</em></td>
+ <td valign="top">IN: Callback routine called when a property list is being
+ created and the property value will be initialized</td></tr>
+ <tr>
+ <td valign="top"><code>H5P_prp_set_func_t</code> <em>set</em></td>
+ <td valign="top">IN: Callback routine called before a new value is copied
+ into the property's value</td></tr>
+ <tr>
+ <td valign="top"><code>H5P_prp_get_func_t</code> <em>get</em></td>
+ <td valign="top">IN: Callback routine called when a property value is
+ retrieved from the property</td></tr>
+ <tr>
+ <td valign="top"><code>H5P_prp_delete_func_t</code> <em>delete</em></td>
+ <td valign="top">IN: Callback routine called when a property is deleted from
+ a property list</td></tr>
+ <tr>
+ <td valign="top"><code>H5P_prp_copy_func_t</code> <em>copy</em></td>
+ <td valign="top">IN: Callback routine called when a property is copied from
+ a property list</td></tr>
+ <tr>
+ <td valign="top"><code>H5P_prp_close_func_t</code> <em>close</em></td>
+ <td valign="top">IN: Callback routine called when a property list is being
+ closed and the property value will be disposed of</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Success: a non-negative value
@@ -5337,7 +5579,7 @@ END SUBROUTINE h5pregister_f
<td><em>hid_t</em> <code>plid</code></td>
<td>IN: Identifier of the property list to modify</td></tr>
<tr>
- <td><em>const char *</em><code>name</code></td>
+ <td><em>const&nbsp;char&nbsp;*</em><code>name&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
<td>IN: Name of property to remove</td></tr>
</table></ul>
@@ -5367,108 +5609,6 @@ END SUBROUTINE h5premove_f
<!-- NEW PAGE -->
-<!-- HEADER RIGHT "H5Premove_filter" -->
-<hr>
-<dl>
- <dt><strong>Name:</strong> <a name="Property-RemoveFilter">H5Premove_filter</a>
- <dt><strong>Signature:</strong>
- <dd><em>herr_t</em> <code>H5Premove_filter</code>(<em>hid_t</em> <code>plist</code>,
- <em>H5Z_filter_t</em> <code>filter</code>
- )
- <dt><strong>Purpose:</strong>
- <dd>Delete one or more filters in the filter pipeline.
- <dt><strong>Description:</strong>
- <dd><code>H5Premove_filter</code> removes the specified
- <code>filter</code> from the filter pipeline in the
- dataset creation property list <code>plist</code>.
- <p>
- The <code>filter</code> parameter specifies the filter to be removed.
- Valid values for use in <code>filter</code> are as follows:
-
- <center>
- <table width=75%>
- <tr valign=top align=left><td>
- <code>H5Z_FILTER_ALL</code>
- </td><td>
- Removes all filters from the permanent filter pipeline.
- </td></tr>
- <tr valign=top align=left><td>
- <code>H5Z_FILTER_DEFLATE</code>
- </td><td>
- Data compression filter, employing the gzip algorithm
- </td></tr>
- <tr valign=top align=left><td>
- <code>H5Z_FILTER_SHUFFLE</code>
- </td><td>
- Data shuffling filter
- </td></tr>
- <tr valign=top align=left><td>
- <code>H5Z_FILTER_FLETCHER32&nbsp;&nbsp;</code>
- </td><td>
- Error detection filter, employing the Fletcher32 checksum algorithm
- </td></tr>
- <tr valign=top align=left><td>
- <code>H5Z_FILTER_SZIP</code>
- </td><td>
- Data compression filter, employing the SZIP algorithm
- </td></tr>
- </table>
- </center>
- <p>
- Additionally, user-defined filters can be removed with this routine
- by passing the filter identifier with which they were registered
- with the HDF5 Library.
- <p>
- Attempting to remove a filter that is not in the permanent filter
- pipeline is an error.
- <dt><strong>Note:</strong>
- <dd>This function currently supports only the permanent filter
- pipeline; <code>plist</code> must be a dataset creation
- property list.
- <dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist_id</code>
- <dd>IN: Dataset creation property list identifier.
- <dt><em>H5Z_filter_t</em> <code>filter</code>
- <dd>IN: Filter to be deleted.
- </dl>
- <dt><strong>Returns:</strong>
- <dd>Returns a non-negative value if successful;
- otherwise returns a negative value.
-
- <dt><strong>Fortran90 Interface:</strong> h5premove_filter_f
- <dd>
- <pre>
-SUBROUTINE h5premove_filter_f(prp_id, filter, hdferr)
-
- IMPLICIT NONE
- INTEGER(HID_T), INTENT(IN) :: prp_id ! Dataset creation property
- ! list identifier
- INTEGER, INTENT(IN) :: filter ! Filter to be removed
- ! Valid values are:
- ! H5Z_FILTER_ALL_F
- ! H5Z_FILTER_DEFLATE_F
- ! H5Z_FILTER_SHUFFLE_F
- ! H5Z_FILTER_FLETCHER32_F
- ! H5Z_FILTER_SZIP_F
- !</pre>
-<!-- NEW PAGE -->
-<pre>
- INTEGER, INTENT(OUT) :: hdferr ! Error code
- ! 0 on success, -1 on failure
-END SUBROUTINE h5premove_filter_f
- </pre>
-
- <!--<dt><strong>Non-C API(s):</strong>
- <dd>
-
- <img src="Graphics/Java.gif">
- <img src="Graphics/C++.gif">
- -->
-</dl>
-
-
-<!-- NEW PAGE -->
<!-- HEADER RIGHT "H5Pset" -->
<hr>
<dl>
@@ -5512,7 +5652,7 @@ END SUBROUTINE h5premove_filter_f
<td><em>hid_t</em> <code>plid</code>;
<td>IN: Property list identifier to modify</td></tr>
<tr>
- <td><em>const char *</em><code>name</code>;
+ <td><em>const&nbsp;char&nbsp;*</em><code>name;&nbsp;&nbsp;&nbsp;&nbsp;</code>
<td>IN: Name of property to modify</td></tr>
<tr>
<td><em>void *</em><code>value</code>;
@@ -5579,19 +5719,20 @@ END SUBROUTINE h5pset_f
For MPI-IO and other parallel systems, choose an alignment
which is a multiple of the disk block size.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Identifier for a file access property list.
- <dt><em>hsize_t</em> <code>threshold</code>
- <dd>IN: Threshold value.
- Must be non-negative.
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist</code></td>
+ <td valign="top">IN: Identifier for a file access property list.</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t</em>&nbsp;<code>threshold&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Threshold value.
Note that setting the threshold value to 0 (zero) has
the effect of a special case, forcing everything
- to be aligned.
- <dt><em>hsize_t</em> <code>alignment</code>
- <dd>IN: Alignment value.
- Must be a positive value.
- </dl>
+ to be aligned.</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t</em> <code>alignment</code></td>
+ <td valign="top">IN: Alignment value.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -5676,12 +5817,14 @@ END SUBROUTINE h5pset_alignment_f
See <a href="RM_H5D.html#Dataset-Create">H5Dcreate</a> for
further cross-references.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist_id</code>
- <dd>IN: Dataset creation property list identifier.
- <dt><em>H5D_alloc_time_t</em> <code>alloc_time</code>
- <dd>IN: When to allocate dataset storage space.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist_id</code></td>
+ <td valign="top">IN: Dataset creation property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>H5D_alloc_time_t</em>&nbsp;<code>alloc_time&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: When to allocate dataset storage space.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -5743,16 +5886,20 @@ END SUBROUTINE h5pset_alloc_time_f
<p>
All ratios are real numbers between 0 and 1, inclusive.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: The dataset transfer property list identifier.
- <dt><em>double</em> <code>left</code>
- <dd>IN: The B-tree split ratio for left-most nodes.
- <dt><em>double</em> <code>right</code>
- <dd>IN: The B-tree split ratio for right-most nodes and lone nodes.
- <dt><em>double</em> <code>middle</code>
- <dd>IN: The B-tree split ratio for all other nodes.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist</code></td>
+ <td valign="top">IN: The dataset transfer property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>double</em> <code>left</code></td>
+ <td valign="top">IN: The B-tree split ratio for left-most nodes.</td></tr>
+ <tr>
+ <td valign="top"><em>double</em> <code>right</code></td>
+ <td valign="top">IN: The B-tree split ratio for right-most nodes and lone nodes.</td></tr>
+ <tr>
+ <td valign="top"><em>double</em>&nbsp;<code>middle&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: The B-tree split ratio for all other nodes.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -5818,16 +5965,20 @@ END SUBROUTINE h5pset_btree_ratios_f
<p>
The default value for the maximum buffer is 1 Mb.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Identifier for the dataset transfer property list.
- <dt><em>hsize_t</em> <code>size</code>
- <dd>IN: Size, in bytes, of the type conversion and background buffers.
- <dt><em>void</em> <code>tconv</code>
- <dd>IN: Pointer to application-allocated type conversion buffer.
- <dt><em>void</em> <code>bkg</code>
- <dd>IN: Pointer to application-allocated background buffer.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist</code></td>
+ <td valign="top">IN: Identifier for the dataset transfer property list.</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t</em>&nbsp;<code>size&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Size, in bytes, of the type conversion and background buffers.</td></tr>
+ <tr>
+ <td valign="top"><em>void</em> <code>tconv</code></td>
+ <td valign="top">IN: Pointer to application-allocated type conversion buffer.</td></tr>
+ <tr>
+ <td valign="top"><em>void</em> <code>bkg</code></td>
+ <td valign="top">IN: Pointer to application-allocated background buffer.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -5889,18 +6040,23 @@ END SUBROUTINE h5pset_buffer_f
preemption is strictly LRU) while a value of one means fully
read chunks are always preempted before other chunks.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist_id</code>
- <dd>IN: Identifier of the file access property list.
- <dt><em>int</em> <code>mdc_nelmts</code>
- <dd>IN: Number of elements (objects) in the meta data cache.
- <dt><em>int</em> <code>rdcc_nelmts</code>
- <dd>IN: Number of elements (objects) in the raw data chunk cache.
- <dt><em>size_t</em> <code>rdcc_nbytes</code>
- <dd>IN: Total size of the raw data chunk cache, in bytes.
- <dt><em>double</em> <code>rdcc_w0</code>
- <dd>IN: Preemption policy.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist_id</code></td>
+ <td valign="top">IN: Identifier of the file access property list.</td></tr>
+ <tr>
+ <td valign="top"><em>int</em> <code>mdc_nelmts</code></td>
+ <td valign="top">IN: Number of elements (objects) in the meta data cache.</td></tr>
+ <tr>
+ <td valign="top"><em>int</em> <code>rdcc_nelmts</code></td>
+ <td valign="top">IN: Number of elements (objects) in the raw data chunk cache.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t</em>&nbsp;<code>rdcc_nbytes&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Total size of the raw data chunk cache, in bytes.</td></tr>
+ <tr>
+ <td valign="top"><em>double</em> <code>rdcc_w0</code></td>
+ <td valign="top">IN: Preemption policy.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -5955,19 +6111,22 @@ END SUBROUTINE h5pset_cache_f
The unit of measure for <code>dim</code> values is
<em>dataset elements</em>.
<p>
- As a side-effect of this function, the layout of the dataset
- is changed to <code>H5D_CHUNKED</code>, if it is not already so set.
+ As a side-effect of this function, the layout of the dataset is
+ changed to <code>H5D_CHUNKED</code>, if it is not already so set.
(See <a href="#Property-SetLayout"><code>H5Pset_layout</code></a>.)
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Identifier for property list to query.
- <dt><em>int</em> <code>ndims</code>
- <dd>IN: The number of dimensions of each chunk.
- <dt><em>const hsize_t *</em> <code>dim</code>
- <dd>IN: An array defining the size, in dataset elements,
- of each chunk.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist</code></td>
+ <td valign="top">IN: Identifier for property list to query.</td></tr>
+ <tr>
+ <td valign="top"><em>int</em> <code>ndims</code></td>
+ <td valign="top">IN: The number of dimensions of each chunk.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;hsize_t&nbsp;*</em>&nbsp;<code>dim&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: An array defining the size, in dataset elements,
+ of each chunk.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -6013,12 +6172,14 @@ END SUBROUTINE h5pset_chunk_f
Lower compression levels are faster but result in less compression.
This is the same algorithm as used by the GNU gzip program.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Identifier for the dataset creation property list.
- <dt><em>int</em> <code>level</code>
- <dd>IN: Compression level.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>plist&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier for the dataset creation property list.</td></tr>
+ <tr>
+ <td valign="top"><em>int</em> <code>level</code></td>
+ <td valign="top">IN: Compression level.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -6117,12 +6278,14 @@ END SUBROUTINE h5pset_deflate_f
</dl>
</dir></p>
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>dxpl_id</code>
- <dd>IN: Data transfer property list identifier.
- <dt><em>H5FD_mpio_xfer_t</em> <code>xfer_mode</code>
- <dd>IN: Transfer mode.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>dxpl_id</code></td>
+ <td valign="top">IN: Data transfer property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>H5FD_mpio_xfer_t</em>&nbsp;<code>xfer_mode&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Transfer mode.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful.
Otherwise returns a negative value.
@@ -6169,12 +6332,14 @@ END SUBROUTINE h5pset_dxpl_mpio_f
<code>H5Pset_dxpl_multi</code> can only be used after
the member map has been set with <code>H5Pset_fapl_multi</code>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>dxpl_id</code>,
- <dd>IN: Data transfer property list identifier.
- <dt><em>const hid_t *</em><code>memb_dxpl</code>
- <dd>IN: Array of data access property lists.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>dxpl_id</code>,</td>
+ <td valign="top">IN: Data transfer property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;hid_t&nbsp;*</em><code>memb_dxpl&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Array of data access property lists.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful.
Otherwise returns a negative value.
@@ -6229,13 +6394,15 @@ SUBROUTINE
<dd>The initial error detection implementation, Fletcher32 checksum,
supports error detection for chunked datasets only.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Dataset transfer property list identifier.
- <dt><em>H5Z_EDC_t</em> <code>check</code>
- <dd>IN: Specifies whether error checking is enabled or disabled
- for dataset read operations.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist</code></td>
+ <td valign="top">IN: Dataset transfer property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>H5Z_EDC_t</em>&nbsp;<code>check&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Specifies whether error checking is enabled or disabled
+ for dataset read operations.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -6296,8 +6463,8 @@ END SUBROUTINE h5pset_edc_check_f
The <code>size</code> argument specifies the number of bytes reserved
for data in the external file.
If <code>size</code> is set to <code>H5F_UNLIMITED</code>, the
- external file can be of unlimited size and no more files can be added to
- the external files list.
+ external file can be of unlimited size and no more files can be added
+ to the external files list.
<p>
All of the external files for a given dataset must be
specified with <code>H5Pset_external</code>
@@ -6307,17 +6474,21 @@ END SUBROUTINE h5pset_edc_check_f
<code>H5Dwrite</code> is called to write data to it,
the library will create the file.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Identifier of a dataset creation property list.
- <dt><em>const char</em> <code>*name</code>
- <dd>IN: Name of an external file.
- <dt><em>off_t</em> <code>offset</code>
- <dd>IN: Offset, in bytes, from the beginning of the file
- to the location in the file where the data starts.
- <dt><em>hsize_t</em> <code>size</code>
- <dd>IN: Number of bytes reserved in the file for the data.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist</code></td>
+ <td valign="top">IN: Identifier of a dataset creation property list.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;char</em>&nbsp;<code>*name&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Name of an external file.</td></tr>
+ <tr>
+ <td valign="top"><em>off_t</em> <code>offset</code></td>
+ <td valign="top">IN: Offset, in bytes, from the beginning of the file
+ to the location in the file where the data starts.</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t</em> <code>size</code></td>
+ <td valign="top">IN: Number of bytes reserved in the file for the data.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -6378,12 +6549,14 @@ END SUBROUTINE h5pset_external_f
Use of this function is only appropriate for an HDF5 file written as a
family of files with the <code>FAMILY</code> file driver.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>fapl_id</code>
- <dd>IN: File access property list identifier.
- <dt><em>hsize_t</em> <code>offset</code>
- <dd>IN: Offset in bytes within the HDF5 file.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>fapl_id</code></td>
+ <td valign="top">IN: File access property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t</em>&nbsp;<code>offset&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Offset in bytes within the HDF5 file.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -6443,15 +6616,18 @@ END SUBROUTINE h5pset_family_offset_f
<dd>There is currently no means for reading a file from disk then
using the <code>H5FD_CORE</code> driver to manipulate the file.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>fapl_id</code>
- <dd>IN: File access property list identifier.
- <dt><em>size_t</em> <code>increment</code>
- <dd>IN: Size, in bytes, of memory increments.
- <dt><em>hbool_t</em> <code>backing_store</code>
- <dd>IN: Boolean flag indicating whether to write the file
- contents to disk when the file is closed.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>fapl_id</code></td>
+ <td valign="top">IN: File access property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t</em> <code>increment</code></td>
+ <td valign="top">IN: Size, in bytes, of memory increments.</td></tr>
+ <tr>
+ <td valign="top"><em>hbool_t</em>&nbsp;<code>backing_store&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Boolean flag indicating whether to write the file
+ contents to disk when the file is closed.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful.
Otherwise returns a negative value.
@@ -6502,15 +6678,18 @@ END SUBROUTINE h5pset_fapl_core_f
<code>memb_fapl_id</code> is the identifier of the
file access property list to be used for each family member.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>fapl_id</code>
- <dd>IN: File access property list identifier.
- <dt><em> hsize_t</em> <code>memb_size</code>
- <dd>IN: Size in bytes of each file member.
- <dt><em>hid_t</em> <code>memb_fapl_id</code>
- <dd>IN: Identifier of file access property list for each
- family member.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>fapl_id</code></td>
+ <td valign="top">IN: File access property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em> hsize_t</em> <code>memb_size</code></td>
+ <td valign="top">IN: Size in bytes of each file member.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>memb_fapl_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of file access property list for each
+ family member.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -6570,12 +6749,14 @@ END SUBROUTINE h5pset_fapl_family_f
For further information, see
<a href="http://www.globus.org/">http//www.globus.org/</a>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>fapl_id</code>,
- <dd>IN: File access property list identifier.
- <dt><em>GASS_Info</em> <code>info</code>
- <dd>IN: Pointer to the GASS information structure.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>fapl_id</code>,</td>
+ <td valign="top">IN: File access property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>GASS_Info</em>&nbsp;<code>info&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Pointer to the GASS information structure.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful.
Otherwise returns a negative value.
@@ -6740,6 +6921,7 @@ SUBROUTINE
<code>(H5FD_LOG_NUM_READ | H5FD_LOG_NUM_WRITE | H5FD_LOG_NUM_SEEK)</code>
</td></tr>
+<!-- NEW PAGE -->
<tr valign=top align=left><td>
<hr>
<code>H5FD_LOG_TIME_OPEN</code>
@@ -6839,16 +7021,20 @@ SUBROUTINE
which must be at least the size in bytes of the file to be logged.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>fapl_id</code>
- <dd>IN: File access property list identifier.
- <dt><em>char *</em><code>logfile</code>
- <dd>IN: Name of the log file.
- <dt><em>unsigned int</em> <code>flags</code>
- <dd>IN: Flags specifying the types of logging activity.
- <dt><em>size_t</em> <code>buf_size</code>
- <dd>IN: The size of the logging buffer.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>fapl_id</code></td>
+ <td valign="top">IN: File access property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>char *</em><code>logfile</code></td>
+ <td valign="top">IN: Name of the log file.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned&nbsp;int</em>&nbsp;<code>flags&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Flags specifying the types of logging activity.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t</em> <code>buf_size</code></td>
+ <td valign="top">IN: The size of the logging buffer.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns non-negative if successful.
Otherwise returns negative.
@@ -6907,14 +7093,17 @@ SUBROUTINE
Users should not modify the info while it is defined
in a property list.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>fapl_id</code>
- <dd>IN: File access property list identifier.
- <dt><em>MPI_Comm</em> <code>comm</code>
- <dd>IN: MPI-2 communicator.
- <dt><em>MPI_Info</em> <code>info</code>
- <dd>IN: MPI-2 info object.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>fapl_id</code></td>
+ <td valign="top">IN: File access property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>MPI_Comm</em>&nbsp;<code>comm&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: MPI-2 communicator.</td></tr>
+ <tr>
+ <td valign="top"><em>MPI_Info</em> <code>info</code></td>
+ <td valign="top">IN: MPI-2 info object.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful.
Otherwise returns a negative value.
@@ -6973,12 +7162,14 @@ END SUBROUTINE h5pset_fapl_mpio_f
Users should not modify the communicator while it is defined
in a property list.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>fapl_id</code>
- <dd>IN: File access property list identifier.
- <dt><em>MPI_Comm</em> <code>comm</code>
- <dd>IN: MPI-2 communicator.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>fapl_id</code></td>
+ <td valign="top">IN: File access property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>MPI_Comm</em>&nbsp;<code>comm&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: MPI-2 communicator.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful.
Otherwise returns a negative value.
@@ -7087,30 +7278,36 @@ END SUBROUTINE h5pset_fapl_mpiposix_f
<code>l</code> &nbsp;&nbsp; for <code>H5FD_MEM_LHEAP</code>
<br>
<code>o</code> &nbsp;&nbsp; for <code>H5FD_MEM_OHDR</code>
- </dir>
+ </dir></dd></dt>
<!-- NEW PAGE -->
<dt><code>memb_addr</code>
<dd>The default value is <code>HADDR_UNDEF</code> for each element.
</dl>
</dir>
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>fapl_id</code>
- <dd>IN: File access property list identifier.
- <dt><em>const H5FD_mem_t *</em><code>memb_map</code>
- <dd>IN: Maps memory usage types to other memory usage types.
- <dt><em>const hid_t *</em><code>memb_fapl</code>
- <dd>IN: Property list for each memory usage type.
- <dt><em>const char * const *</em><code>memb_name</code>
- <dd>IN: Name generator for names of member files.
- <dt><em>const haddr_t *</em><code>memb_addr</code>
- <dd>IN: The offsets within the virtual address space,
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>fapl_id</code></td>
+ <td valign="top">IN: File access property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;H5FD_mem_t&nbsp;*</em><code>memb_map&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Maps memory usage types to other memory usage types.</td></tr>
+ <tr>
+ <td valign="top"><em>const hid_t *</em><code>memb_fapl</code></td>
+ <td valign="top">IN: Property list for each memory usage type.</td></tr>
+ <tr>
+ <td valign="top"><em>const char * const *</em><code>memb_name</code></td>
+ <td valign="top">IN: Name generator for names of member files.</td></tr>
+ <tr>
+ <td valign="top"><em>const haddr_t *</em><code>memb_addr</code></td>
+ <td valign="top">IN: The offsets within the virtual address space,
from <code>0</code> (zero) to <code>HADDR_MAX</code>,
- at which each type of data storage begins.
- <dt><em>hbool_t</em> <code>relax</code>
- <dd>IN: Allows read-only access to incomplete file sets
- when <code>TRUE</code>.
- </dl>
+ at which each type of data storage begins.</td></tr>
+ <tr>
+ <td valign="top"><em>hbool_t</em> <code>relax</code></td>
+ <td valign="top">IN: Allows read-only access to incomplete file sets
+ when <code>TRUE</code>.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful.
Otherwise returns a negative value.
@@ -7147,7 +7344,7 @@ END SUBROUTINE h5pset_fapl_mpiposix_f
<dt><strong>Fortran90 Interface:</strong> h5pset_fapl_multi_f
<dd>
<pre>
-SUBROUTINE h5pset_fapl_multi_f(prp_id, memb_map, memb_fapl, memb_name, &amp;
+SUBROUTINE h5pset_fapl_multi_f(prp_id, memb_map, memb_fapl, memb_name,
memb_addr, relax, hdferr)
IMPLICIT NONE
INTEGER(HID_T),INTENT(IN) :: prp_id ! Property list identifier
@@ -7188,10 +7385,11 @@ END SUBROUTINE h5pset_fapl_multi_f
<dd><code>H5Pset_fapl_sec2</code> modifies the file access property list
to use the <code>H5FD_SEC2</code> driver.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>fapl_id</code>
- <dd>IN: File access property list identifier.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>fapl_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: File access property list identifier.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful.
Otherwise returns a negative value.
@@ -7265,19 +7463,23 @@ END SUBROUTINE h5pset_fapl_sec2_f
HDF5 provides no mechanism to determine whether it was called
as the special case invoked by <code>H5Pset_fapl_split</code>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt>
- <dt><em>hid_t</em> <code>fapl_id</code>,
- <dd>IN: File access property list identifier.
- <dt><em>const char *</em><code>meta_ext</code>,
- <dd>IN: Metadata filename extension.
- <dt><em>hid_t</em> <code>meta_plist_id</code>,
- <dd>IN: File access property list identifier for the metadata file.
- <dt><em>const char *</em><code>raw_ext</code>,
- <dd>IN: Raw data filename extension.
- <dt><em>hid_t</em> <code>raw_plist_id</code>
- <dd>IN: File access property list identifier for the raw data file.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>fapl_id</code>,</td>
+ <td valign="top">IN: File access property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;char&nbsp;*</em><code>meta_ext,&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Metadata filename extension.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>meta_plist_id</code>,</td>
+ <td valign="top">IN: File access property list identifier for the metadata file.</td></tr>
+ <tr>
+ <td valign="top"><em>const char *</em><code>raw_ext</code>,</td>
+ <td valign="top">IN: Raw data filename extension.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>raw_plist_id</code></td>
+ <td valign="top">IN: File access property list identifier for the raw data file.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful.
Otherwise returns a negative value.
@@ -7356,12 +7558,14 @@ END SUBROUTINE h5pset_fapl_split_f
Storage Resource Broker (SRB). For further information, see
<a href="http://www.npaci.edu/Research/DI/srb/">http//www.npaci.edu/Research/DI/srb/</a>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>fapl_id</code>
- <dd>IN: File access property list identifier.
- <dt><em>SRB_Info</em> <code>info</code>
- <dd>IN: Pointer to the SRB information structure.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>fapl_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: File access property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>SRB_Info</em> <code>info</code></td>
+ <td valign="top">IN: Pointer to the SRB information structure.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful.
Otherwise returns a negative value.
@@ -7396,10 +7600,11 @@ SUBROUTINE
<dd><code>H5Pset_fapl_stdio</code> modifies the file access property list
to use the standard I/O driver, <code>H5FD_STDIO</code>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>fapl_id</code>
- <dd>IN: File access property list identifier.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>fapl_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: File access property list identifier.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful.
Otherwise returns a negative value.
@@ -7484,12 +7689,14 @@ END SUBROUTINE h5pset_fapl_stdio_f
<code>H5Pset_fapl_stream</code> and <code>H5Pget_fapl_stream</code>
are not intended for use in a parallel environment.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>fapl_id</code>
- <dd>IN: File access property list identifier.
- <dt><em>H5FD_stream_fapl_t *</em><code>fapl</code>
- <dd>IN: The streaming I/O file access property list.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>fapl_id</code></td>
+ <td valign="top">IN: File access property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>H5FD_stream_fapl_t&nbsp;*</em><code>fapl&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: The streaming I/O file access property list.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful.
Otherwise returns a negative value.
@@ -7562,13 +7769,15 @@ SUBROUTINE
</table>
</div>
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>fapl_id</code>
- <dd>IN: File access property list identifier.
- <dt><em>H5F_close_degree_t</em> <code>fc_degree</code>
- <dd>IN: Pointer to a location containing the file close degree property,
- the value of <code>fc_degree</code>.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>fapl_id</code></td>
+ <td valign="top">IN: File access property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>H5F_close_degree_t</em>&nbsp;<code>fc_degree&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Pointer to a location containing the file close degree property,
+ the value of <code>fc_degree</code>.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful. Otherwise returns a negative
value.
@@ -7639,12 +7848,14 @@ END SUBROUTINE h5pset_fclose_degree_f
See <a href="RM_H5D.html#Dataset-Create">H5Dcreate</a> for
further cross-references.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist_id</code>
- <dd>IN: Dataset creation property list identifier.
- <dt><em>H5D_fill_time_t</em> <code>fill_time</code>
- <dd>IN: When to write fill values to a dataset.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist_id</code></td>
+ <td valign="top">IN: Dataset creation property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>H5D_fill_time_t</em>&nbsp;<code>fill_time&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: When to write fill values to a dataset.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -7730,14 +7941,17 @@ END SUBROUTINE h5pset_fill_time_f
See <a href="RM_H5D.html#Dataset-Create">H5Dcreate</a> for
further cross-references.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist_id</code>
- <dd>IN: Dataset creation property list identifier.
- <dt><em>hid_t</em> <code>type_id</code>,
- <dd>IN: Datatype of <code>value</code>.
- <dt><em>const void *</em><code>value</code>
- <dd>IN: Pointer to buffer containing value to use as fill value.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist_id</code></td>
+ <td valign="top">IN: Dataset creation property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>type_id</code>,</td>
+ <td valign="top">IN: Datatype of <code>value</code>.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;void&nbsp;*</em><code>value&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Pointer to buffer containing value to use as fill value.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -7857,20 +8071,25 @@ END SUBROUTINE h5pset_fill_value_f
If multiple filters are set for a property list, they will be
applied to each chunk in the order in which they were set.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Property list identifier.
- <dt><em>H5Z_filter_t</em> <code>filter</code>
- <dd>IN: Filter identifier
- for the filter to be added to the pipeline.
- <dt><em>unsigned int</em> <code>flags</code>
- <dd>IN: Bit vector specifying certain general properties
- of the filter.
- <dt><em>size_t</em> <code>cd_nelmts</code>
- <dd>IN: Number of elements in <code>cd_values</code>.
- <dt><em>const unsigned int</em> <code>cd_values[]</code>
- <dd>IN: Auxiliary data for the filter.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist</code></td>
+ <td valign="top">IN: Property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>H5Z_filter_t</em> <code>filter</code></td>
+ <td valign="top">IN: Filter identifier for the filter
+ to be added to the pipeline.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned int</em> <code>flags</code></td>
+ <td valign="top">IN: Bit vector specifying certain general properties
+ of the filter.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t</em> <code>cd_nelmts</code></td>
+ <td valign="top">IN: Number of elements in <code>cd_values</code>.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;unsigned&nbsp;int</em>&nbsp;<code>cd_values[]&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Auxiliary data for the filter.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -7940,14 +8159,17 @@ END SUBROUTINE h5pset_filter_f
Valid callback function return values are
<code>H5Z_CB_FAIL</code> and <code>H5Z_CB_CONT</code>.  
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Dataset transfer property list identifier.
- <dt><em>H5Z_filter_func_t</em> <code>func</code>
- <dd>IN: User-defined filter callback function.
- <dt><em>void *</em><code>op_data</code>
- <dd>IN: User-defined input data for the callback function.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist</code></td>
+ <td valign="top">IN: Dataset transfer property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>H5Z_filter_func_t</em>&nbsp;<code>func&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: User-defined filter callback function.</td></tr>
+ <tr>
+ <td valign="top"><em>void *</em><code>op_data</code></td>
+ <td valign="top">IN: User-defined input data for the callback function.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -7983,10 +8205,11 @@ SUBROUTINE
<dd>The initial error detection implementation supports
error detection for chunked datasets only.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Dataset creation property list identifier.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>plist&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Dataset creation property list identifier.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -8037,13 +8260,15 @@ END SUBROUTINE h5pset_fletcher32_f
<p>
The default value for garbage collecting references is off.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: File access property list identifier.
- <dt><em>unsigned</em> <code>gc_ref</code>
- <dd>IN: Flag setting reference garbage collection to
- on (<code>1</code>) or off (<code>0</code>).
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist</code></td>
+ <td valign="top">IN: File access property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned</em>&nbsp;<code>gc_ref&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Flag setting reference garbage collection to
+ on (<code>1</code>) or off (<code>0</code>).</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -8180,14 +8405,15 @@ END SUBROUTINE h5pset_hyper_cache_f
but the library will use more memory during hyperslab I/O.
The default value of <code>vector_size</code> is <code>1024</code>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>dxpl_id</code>
- <dd>IN: Dataset transfer property list identifier.
- <dt><em>size_t</em> <code>vector_size</code>
- <dd>IN: Number of I/O vectors to accumulate in memory for I/O operations.
- Must be greater than <code>1</code> (one).
- Default value: <code>1024</code>.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>dxpl_id</code></td>
+ <td valign="top">IN: Dataset transfer property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t</em>&nbsp;<code>vector_size&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Number of I/O vectors to accumulate in memory for I/O operations.
+ Must be greater than <code>1</code> (one). Default value: <code>1024</code>.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -8219,7 +8445,7 @@ END SUBROUTINE h5pset_hyper_vector_size_f
<dt><strong>Name:</strong> <a name="Property-SetIstoreK">H5Pset_istore_k</a>
<dt><strong>Signature:</strong>
<dd><em>herr_t </em><code>H5Pset_istore_k</code>(<em>hid_t</em> <code>plist</code>,
- <em>int</em> <code>ik</code>
+ <em>unsigned</em> <code>ik</code>
)
<dt><strong>Purpose:</strong>
<dd>Sets the size of the parameter used to control the
@@ -8234,12 +8460,14 @@ END SUBROUTINE h5pset_hyper_vector_size_f
or have an average rank of 1.5 times the value of
<code>ik</code>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Identifier of property list to query.
- <dt><em>int</em> <code>ik</code>
- <dd>IN: 1/2 rank of chunked storage B-tree.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>plist&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of property list to query.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned</em> <code>ik</code></td>
+ <td valign="top">IN: 1/2 rank of chunked storage B-tree.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -8299,12 +8527,14 @@ END SUBROUTINE h5pset_istore_k_f
<a href="RM_H5D.html#Dataset-Write">H5Dwrite</a>
documentation for details.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Identifier of property list to query.
- <dt><em>H5D_layout_t</em> <code>layout</code>
- <dd>IN: Type of storage layout for raw data.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist</code></td>
+ <td valign="top">IN: Identifier of property list to query.</td></tr>
+ <tr>
+ <td valign="top"><em>H5D_layout_t</em>&nbsp;<code>layout&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Type of storage layout for raw data.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -8366,12 +8596,14 @@ END SUBROUTINE h5pset_layout_f
potentially significantly improving library and application
performance.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>fapl_id</code>
- <dd>IN: File access property list identifier.
- <dt><em>hsize_t</em> <code>size</code>
- <dd>IN: Minimum size, in bytes, of metadata block allocations.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>fapl_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: File access property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t</em> <code>size</code></td>
+ <td valign="top">IN: Minimum size, in bytes, of metadata block allocations.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful.
Otherwise returns a negative value.
@@ -8463,12 +8695,14 @@ END SUBROUTINE h5pset_meta_block_size_f
Use of this function is only appropriate for an HDF5 file written
as a set of files with the <code>MULTI</code> file driver.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>fapl_id</code>
- <dd>IN: File access property list or data transfer property list identifier.
- <dt><em>H5FD_mem_t</em> <code>type</code>
- <dd>OUT: Type of data.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>fapl_id</code></td>
+ <td valign="top">IN: File access property list or data transfer property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>H5FD_mem_t</em>&nbsp;<code>type&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: Type of data.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -8509,13 +8743,15 @@ SUBROUTINE
property to TRUE. Otherwise the I/O pipeline treats the
destination datapoints as completely uninitialized.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Identifier for the dataset transfer property list.
- <dt><em>hbool_t</em> <code>status</code>
- <dd>IN: Status of for the dataset transfer property list
- (TRUE/FALSE).
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist</code></td>
+ <td valign="top">IN: Identifier for the dataset transfer property list.</td></tr>
+ <tr>
+ <td valign="top"><em>hbool_t</em>&nbsp;<code>status&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Status of for the dataset transfer property list
+ (TRUE/FALSE).</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -8578,10 +8814,11 @@ END SUBROUTINE h5pset_preserve_f
achieved by the use of a compression filter without
the shuffle filter.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist_id</code>
- <dd>IN: Dataset creation property list identifier.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>plist_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Dataset creation property list identifier.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -8631,12 +8868,14 @@ END SUBROUTINE h5pset_shuffle_f
Setting the value to 0 with this API function will turn off the
data sieving, even if the VFL driver attempts to use that strategy.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>fapl_id</code>
- <dd>IN: File access property list identifier.
- <dt><em>hsize_t</em> <code>size</code>
- <dd>IN: Maximum size, in bytes, of data sieve buffer.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>fapl_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: File access property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t</em> <code>size</code></td>
+ <td valign="top">IN: Maximum size, in bytes, of data sieve buffer.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful.
Otherwise returns a negative value.
@@ -8675,22 +8914,26 @@ END SUBROUTINE h5pset_sieve_buf_size_f
<dd>Sets the byte size of the offsets and lengths used to address objects
in an HDF5 file.
<dt><strong>Description:</strong>
- <dd><code>H5Pset_sizes</code> sets the byte size of the offsets and lengths used to
- address objects in an HDF5 file. This function is only valid for
- file creation property lists. Passing in a value of 0 for one of the
- sizeof parameters retains the current value. The default value
- for both values is the same as <code>sizeof(hsize_t)</code>
- in the library (normally 8 bytes).
+ <dd><code>H5Pset_sizes</code> sets the byte size of the offsets
+ and lengths used to address objects in an HDF5 file.
+ This function is only valid for file creation property lists.
+ Passing in a value of 0 for one of the <code>sizeof_...</code>
+ parameters retains the current value.
+ The default value for both values is the same as
+ <code>sizeof(hsize_t)</code> in the library (normally 8 bytes).
Valid values currently are 2, 4, 8 and 16.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Identifier of property list to modify.
- <dt><em>size_t</em> <code>sizeof_addr</code>
- <dd>IN: Size of an object offset in bytes.
- <dt><em>size_t</em> <code>sizeof_size</code>
- <dd>IN: Size of an object length in bytes.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist</code></td>
+ <td valign="top">IN: Identifier of property list to modify.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t</em>&nbsp;<code>sizeof_addr&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Size of an object offset in bytes.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t</em> <code>sizeof_size</code></td>
+ <td valign="top">IN: Size of an object length in bytes.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -8756,14 +8999,16 @@ END SUBROUTINE h5pset_sizes_f
Setting <code>size</code> to zero (<code>0</code>) disables the
small data block mechanism.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>fapl_id</code>
- <dd>IN: File access property list identifier .
- <dt><em>hsize_t</em> <code>size</code>
- <dd>IN: Maximum size, in bytes, of the small data block.
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>fapl_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: File access property list identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t</em> <code>size</code></td>
+ <td valign="top">IN: Maximum size, in bytes, of the small data block.
<br>
- The default size is <code>2048</code>.
- </dl>
+ The default size is <code>2048</code>.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise a negative value.
@@ -8795,8 +9040,8 @@ END SUBROUTINE h5pset_small_data_block_size_f
<dt><strong>Name:</strong> <a name="Property-SetSymK">H5Pset_sym_k</a>
<dt><strong>Signature:</strong>
<dd><em>herr_t </em><code>H5Pset_sym_k</code>(<em>hid_t</em> <code>plist</code>,
- <em>int</em> <code>ik</code>,
- <em>int</em> <code>lk</code>
+ <em>unsigned</em> <code>ik</code>,
+ <em>unsigned</em> <code>lk</code>
)
<dt><strong>Purpose:</strong>
<dd>Sets the size of parameters used to control the symbol table nodes.
@@ -8819,14 +9064,17 @@ END SUBROUTINE h5pset_small_data_block_size_f
contain 1.5 times the number of symbols specified by
<code>lk</code>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Identifier for property list to query.
- <dt><em>int</em> <code>ik</code>
- <dd>IN: Symbol table tree rank.
- <dt><em>int</em> <code>lk</code>
- <dd>IN: Symbol table node size.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>plist&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier for property list to query.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned</em> <code>ik</code></td>
+ <td valign="top">IN: Symbol table tree rank.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned</em> <code>lk</code></td>
+ <td valign="top">IN: Symbol table node size.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -8988,21 +9236,23 @@ END SUBROUTINE h5pset_sym_k_f
<code>H5Zget_filter_info</code></a> can be employed
to avoid such a failure.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Dataset creation property list identifier.
- <dt><em>unsigned int</em> <code>options_mask</code>
- <dd>IN: A bit-mask conveying the desired SZIP options.
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist</code></td>
+ <td valign="top">IN: Dataset creation property list
+ identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned int</em> <code>options_mask</code></td>
+ <td valign="top">IN: A bit-mask conveying the desired SZIP options.
Valid values are <code>H5_SZIP_EC_OPTION_MASK</code>
- and <code>H5_SZIP_NN_OPTION_MASK</code>.
- <dt><em>unsigned int</em> <code>pixels_per_block</code>
- <dd>IN: The number of pixels, or data elements,
- in each data block.
- </dl>
+ and <code>H5_SZIP_NN_OPTION_MASK</code>.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned&nbsp;int</em>&nbsp;<code>pixels_per_block&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: The number of pixels or data elements in each data block.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
-
<dt><strong>Notes:</strong>
<dd>The following notes are of interest primarily to those who have
used SZIP compression outside of the HDF5 context.
@@ -9178,12 +9428,14 @@ END SUBROUTINE h5pset_szip_f
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.).
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Identifier of property list to modify.
- <dt><em>hsize_t</em> <code>size</code>
- <dd>IN: Size of the user-block in bytes.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist</code></td>
+ <td valign="top">IN: Identifier of property list to modify.</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t</em>&nbsp;<code>size&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Size of the user-block in bytes.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -9262,26 +9514,31 @@ END SUBROUTINE h5pset_userblock_f
and the <code>alloc_info</code> and <code>free_info</code>
parameters are ignored.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>plist</code>
- <dd>IN: Identifier for the dataset transfer property list.
- <dt><em>H5MM_allocate_t</em> <code>alloc</code>
- <dd>IN: User's allocate routine, or &nbsp; <code> NULL</code>
- for system &nbsp; <code> malloc</code>.
- <dt><em>void</em> *<code>alloc_info</code>
- <dd>IN: Extra parameter for user's allocation routine.
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist</code></td>
+ <td valign="top">IN: Identifier for the dataset transfer property list.</td></tr>
+ <tr>
+ <td valign="top"><em>H5MM_allocate_t</em>&nbsp;<code>alloc&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: User's allocate routine, or &nbsp; <code> NULL</code>
+ for system &nbsp; <code> malloc</code>.</td></tr>
+ <tr>
+ <td valign="top"><em>void</em> *<code>alloc_info</code></td>
+ <td valign="top">IN: Extra parameter for user's allocation routine.
<br>
Contents are ignored if preceding parameter is &nbsp;
- <code> NULL</code>.
- <dt><em>H5MM_free_t</em> <code>free</code>
- <dd>IN: User's free routine, or &nbsp; <code> NULL</code>
- for system <code>free</code>.
- <dt><em>void</em> *<code>free_info</code>
- <dd>IN: Extra parameter for user's free routine.
+ <code> NULL</code>.</td></tr>
+ <tr>
+ <td valign="top"><em>H5MM_free_t</em> <code>free</code></td>
+ <td valign="top">IN: User's free routine, or &nbsp; <code> NULL</code>
+ for system <code>free</code>.</td></tr>
+ <tr>
+ <td valign="top"><em>void</em> *<code>free_info</code></td>
+ <td valign="top">IN: Extra parameter for user's free routine.
<br>
Contents are ignored if preceding parameter is &nbsp;
- <code> NULL</code>.
- </dl>
+ <code> NULL</code>.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -9328,7 +9585,7 @@ SUBROUTINE
<dt><strong>Parameters:</strong>
<ul><table>
<tr>
- <td><em>H5P_class_t</em> <code>class</code></td>
+ <td><em>H5P_class_t</em>&nbsp;<code>class&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
<td>IN: Property list class from which to remove
permanent property</td></tr>
<tr>
diff --git a/doc/html/RM_H5R.html b/doc/html/RM_H5R.html
index b1c4f6b..646816e 100644
--- a/doc/html/RM_H5R.html
+++ b/doc/html/RM_H5R.html
@@ -76,6 +76,28 @@ to specific objects and data regions in an HDF5 file.
<p>
<strong>The C Interfaces:</strong>
+<table border=0 width=80%>
+<tr><td valign=top width=40%>
+<ul>
+ <li><a href="#Reference-Create">H5Rcreate</a>
+ <li><a href="#Reference-Dereference">H5Rdereference</a>
+</ul>
+</td><td valign=top width=40%>
+<ul>
+ <li><a href="#Reference-GetRegion">H5Rget_region</a>
+ <li><a href="#Reference-GetObjType">H5Rget_obj_type</a>
+</ul>
+</td><td valign=top width=20%>
+<ul>
+ &nbsp;
+</ul>
+</td></tr>
+</table>
+
+<p>
+
+<i>Alphabetical Listing</i>
+
<table border="0">
<tr>
<td valign="top">
@@ -181,20 +203,25 @@ as the corresponding C function.
to be pointed to for a dataset region reference.
This parameter is unused with object references.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>void *</em><code>ref</code>
- <dd>OUT: Reference created by the function call.
- <dt><em>hid_t</em> <code>loc_id</code>
- <dd>IN: Location identifier used to locate the object being
- pointed to.
- <dt><em>const char *</em><code>name</code>
- <dd>IN: Name of object at location <code>loc_id</code>.
- <dt><em>H5R_type_t</em> <code>ref_type</code>
- <dd>IN: Type of reference.
- <dt><em>hid_t</em> <code>space_id</code>
- <dd>IN: Dataspace identifier with selection.
- Used for dataset region references.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>void *</em><code>ref</code></td>
+ <td valign="top">OUT: Reference created by the function call.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>loc_id</code></td>
+ <td valign="top">IN: Location identifier used to locate the object being
+ pointed to.</td></tr>
+ <tr>
+ <td valign="top"><em>const char *</em><code>name</code></td>
+ <td valign="top">IN: Name of object at location <code>loc_id</code>.</td></tr>
+ <tr>
+ <td valign="top"><em>H5R_type_t</em>&nbsp;<code>ref_type&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Type of reference.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>space_id</code></td>
+ <td valign="top">IN: Dataspace identifier with selection.
+ Used for dataset region references.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -262,14 +289,17 @@ END SUBROUTINE h5rcreate_f
<li><code>H5R_DATASET_REGION</code> (<code>1</code>)
</ul>
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>dataset</code>
- <dd>IN: Dataset containing reference object.
- <dt><em>H5R_type_t</em> <code>ref_type</code>
- <dd>IN: The reference type of <code>ref</code>.
- <dt><em>void *</em><code>ref</code>
- <dd>IN: Reference to open.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>dataset</code></td>
+ <td valign="top">IN: Dataset containing reference object.</td></tr>
+ <tr>
+ <td valign="top"><em>H5R_type_t</em>&nbsp;<code>ref_type&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: The reference type of <code>ref</code>.</td></tr>
+ <tr>
+ <td valign="top"><em>void *</em><code>ref</code></td>
+ <td valign="top">IN: Reference to open.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns valid identifier if successful;
otherwise returns a negative value.
@@ -361,16 +391,19 @@ END SUBROUTINE h5rdereference_f
</td></tr>
</table>
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>id</code>,
- <dd>IN: The dataset containing the reference object or
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>id</code>,</td>
+ <td valign="top">IN: The dataset containing the reference object or
the location identifier of the object that the
- dataset is located within.
- <dt><em>H5R_type_t</em> <code>ref_type</code>
- <dd>IN: Type of reference to query.
- <dt><em>void *</em><code>ref</code>
- <dd>IN: Reference to query.
- </dl>
+ dataset is located within.</td></tr>
+ <tr>
+ <td valign="top"><em>H5R_type_t</em>&nbsp;<code>ref_type&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Type of reference to query.</td></tr>
+ <tr>
+ <td valign="top"><em>void *</em><code>ref</code></td>
+ <td valign="top">IN: Reference to query.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns an object type as defined in <code>H5Gpublic.h</code> if successful;
otherwise returns <code>H5G_UNKNOWN</code>.
@@ -472,14 +505,17 @@ END SUBROUTINE h5rget_object_type_f
<li><code>H5R_DATASET_REGION</code> (<code>1</code>)
</ul>
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>dataset</code>,
- <dd>IN: Dataset containing reference object.
- <dt><em>H5R_type_t</em> <code>ref_type</code>,
- <dd>IN: The reference type of <code>ref</code>.
- <dt><em>void *</em><code>ref</code>
- <dd>IN: Reference to open.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>dataset</code></td>
+ <td valign="top">IN: Dataset containing reference object.</td></tr>
+ <tr>
+ <td valign="top"><em>H5R_type_t</em>&nbsp;<code>ref_type&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: The reference type of <code>ref</code>.</td></tr>
+ <tr>
+ <td valign="top"><em>void *</em><code>ref</code></td>
+ <td valign="top">IN: Reference to open.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a valid identifier if successful;
otherwise returns a negative value.
diff --git a/doc/html/RM_H5S.html b/doc/html/RM_H5S.html
index 3fa420d..9fcd282 100644
--- a/doc/html/RM_H5S.html
+++ b/doc/html/RM_H5S.html
@@ -254,10 +254,11 @@ of the <cite>HDF5 User's Guide.</cite>.
Failure to release a dataspace with this call will
result in resource leaks.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>space_id</code>
- <dd>Identifier of dataspace to release.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>space_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Identifier of dataspace to release.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -296,10 +297,11 @@ END SUBROUTINE h5sclose_f
The dataspace identifier returned from this function should be
released with <code>H5Sclose</code> or resource leaks will occur.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>space_id</code>
- <dd>Identifier of dataspace to copy.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>space_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Identifier of dataspace to copy.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a dataspace identifier if successful;
otherwise returns a negative value.
@@ -309,7 +311,7 @@ END SUBROUTINE h5sclose_f
SUBROUTINE h5scopy_f(space_id, new_space_id, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
- INTEGER(HID_T), INTENT(OUT) :: new_space_id ! Identifier of dataspace's copy
+ INTEGER(HID_T), INTENT(OUT) :: new_space_id ! Identifier of dataspace copy
INTEGER, INTENT(OUT) :: hdferr ! Error code
! 0 on success and -1 on failure
END SUBROUTINE h5scopy_f
@@ -339,10 +341,11 @@ END SUBROUTINE h5scopy_f
<code>H5S_SIMPLE</code>;
others are planned to be added later.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>H5S_class_t</em> <code>type</code>
- <dd>The type of dataspace to be created.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>H5S_class_t</em>&nbsp;<code>type&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">The type of dataspace to be created.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a dataspace identifier if successful;
otherwise returns a negative value.
@@ -405,14 +408,17 @@ END SUBROUTINE h5screate_f
The dataspace identifier returned from this function must be
released with <code>H5Sclose</code> or resource leaks will occur.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>int</em> <code>rank</code>
- <dd>Number of dimensions of dataspace.
- <dt><em>const hsize_t *</em> <code>dims</code>
- <dd>An array of the size of each dimension.
- <dt><em>const hsize_t *</em> <code>maxdims</code>
- <dd>An array of the maximum size of each dimension.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>int</em> <code>rank</code></td>
+ <td valign="top">Number of dimensions of dataspace.</td></tr>
+ <tr>
+ <td valign="top"><em>const hsize_t *</em> <code>dims</code></td>
+ <td valign="top">An array of the size of each dimension.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;hsize_t&nbsp;*</em>&nbsp;<code>maxdims&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">An array of the maximum size of each dimension.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a dataspace identifier if successful;
otherwise returns a negative value.
@@ -456,14 +462,16 @@ END SUBROUTINE h5screate_simple_f
<code>source_space_id</code> to <code>dest_space_id</code>.
This action may change the type of the dataspace.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>dest_space_id</code>
- <dd>IN: The identifier for the dataspace to which
- the extent is copied.
- <dt><em>hid_t</em> <code>source_space_id</code>
- <dd>IN: The identifier for the dataspace from which
- the extent is copied.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>dest_space_id</code></td>
+ <td valign="top">IN: The identifier for the dataspace to which
+ the extent is copied.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>source_space_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: The identifier for the dataspace from which
+ the extent is copied.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -496,8 +504,8 @@ END SUBROUTINE h5sextent_copy_f
<dt><strong>Name:</strong> <a name="Dataspace-SelectBounds">H5Sget_select_bounds</a>
<dt><strong>Signature:</strong>
<dd><em>herr_t </em><code>H5Sget_select_bounds</code>(<em>hid_t </em><code>space_id</code>,
- <em>hssize_t *</em><code>start</code>,
- <em>hssize_t *</em><code>end</code>
+ <em>hsize_t *</em><code>start</code>,
+ <em>hsize_t *</em><code>end</code>
)
<dt><strong>Purpose:</strong>
<dd>Gets the bounding box containing the current selection.
@@ -520,15 +528,18 @@ END SUBROUTINE h5sextent_copy_f
Calling this function on a <code>none</code> selection will
return <code>FAIL</code>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>space_id</code>
- <dd>IN: Identifier of dataspace to query.
- <dt><em>hssize_t *</em><code>start</code>
- <dd>OUT: Starting coordinates of the bounding box.
- <dt><em>hssize_t *</em><code>end</code>
- <dd>OUT: Ending coordinates of the bounding box,
- i.e., the coordinates of the diagonally opposite corner.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>space_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of dataspace to query.</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t *</em><code>start</code></td>
+ <td valign="top">OUT: Starting coordinates of the bounding box.</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t *</em><code>end</code></td>
+ <td valign="top">OUT: Ending coordinates of the bounding box,
+ i.e., the coordinates of the diagonally opposite corner.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -539,9 +550,9 @@ SUBROUTINE h5sget_select_bounds_f(space_id, start, end, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: space_id
! Dataspace identifier
- INTEGER(HSSIZE_T), DIMENSION(*), INTENT(OUT) :: start
+ INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: start
! Starting coordinates of the bounding box
- INTEGER(HSSIZE_T), DIMENSION(*), INTENT(OUT) :: end
+ INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: end
! Ending coordinates of the bounding box,
! i.e., the coordinates of the diagonally
! opposite corner
@@ -570,10 +581,11 @@ END SUBROUTINE h5sget_select_bounds_f
<dd><code>H5Sget_select_elem_npoints</code> returns
the number of element points in the current dataspace selection.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>space_id</code>
- <dd>IN: Identifier of dataspace to query.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>space_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of dataspace to query.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the number of element points in the current dataspace selection if successful.
Otherwise returns a negative value.
@@ -634,23 +646,27 @@ END SUBROUTINE h5sget_select_elem_npoints_f
The points are returned in the order they will be iterated through
when the selection is read/written from/to disk.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>space_id</code>
- <dd>IN: Dataspace identifier of selection to query.
- <dt><em>hsize_t </em><code>startpoint</code>
- <dd>IN: Element point to start with.
- <dt><em>hsize_t </em><code>numpoints</code>
- <dd>IN: Number of element points to get.
- <dt><em>hsize_t *</em><code>buf</code>
- <dd>OUT: List of element points selected.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>space_id</code></td>
+ <td valign="top">IN: Dataspace identifier of selection to query.</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t&nbsp;</em><code>startpoint&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Element point to start with.</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t </em><code>numpoints</code></td>
+ <td valign="top">IN: Number of element points to get.</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t *</em><code>buf</code></td>
+ <td valign="top">OUT: List of element points selected.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
<dt><strong>Fortran90 Interface:</strong> h5sget_select_elem_pointlist_f
<dd>
<pre>
-SUBROUTINE h5sget_select_elem_pointlist_f(space_id, startpoint, num_points, &amp;
+SUBROUTINE h5sget_select_elem_pointlist_f(space_id, startpoint, num_points,
buf, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
@@ -709,23 +725,27 @@ END SUBROUTINE h5sget_select_elem_pointlist_f
<p>
No guarantee is implied as the order in which blocks are listed.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>space_id</code>
- <dd>IN: Dataspace identifier of selection to query.
- <dt><em>hsize_t </em><code>startblock</code>
- <dd>IN: Hyperslab block to start with.
- <dt><em>hsize_t </em><code>numblocks</code>
- <dd>IN: Number of hyperslab blocks to get.
- <dt><em>hsize_t *</em><code>buf</code>
- <dd>OUT: List of hyperslab blocks selected.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>space_id</code></td>
+ <td valign="top">IN: Dataspace identifier of selection to query.</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t&nbsp;</em><code>startblock&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Hyperslab block to start with.</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t </em><code>numblocks</code></td>
+ <td valign="top">IN: Number of hyperslab blocks to get.</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t *</em><code>buf</code></td>
+ <td valign="top">OUT: List of hyperslab blocks selected.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
<dt><strong>Fortran90 Interface:</strong> h5sget_select_hyper_blocklist_f
<dd>
<pre>
-SUBROUTINE h5sget_select_hyper_blocklist_f(space_id, startblock, num_blocks, &amp;
+SUBROUTINE h5sget_select_hyper_blocklist_f(space_id, startblock, num_blocks,
buf, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
@@ -761,10 +781,11 @@ END SUBROUTINE h5sget_select_hyper_blocklist_f
<dd><code>H5Sget_select_hyper_nblocks</code> returns the
number of hyperslab blocks in the current dataspace selection.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>space_id</code>
- <dd>IN: Identifier of dataspace to query.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>space_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of dataspace to query.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the number of hyperslab blocks in
the current dataspace selection if successful.
@@ -802,10 +823,11 @@ END SUBROUTINE h5sget_select_hyper_nblocks_f
<dd><code>H5Sget_select_npoints</code> determines the number of elements
in the current selection of a dataspace.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>space_id</code>
- <dd>Dataspace identifier.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>space_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Dataspace identifier.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the number of elements in the selection if successful;
otherwise returns a negative value.
@@ -844,10 +866,11 @@ END SUBROUTINE h5sget_select_npoints_f
type of selection currently defined for the dataspace
<code>space_id</code>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>space_id</code>
- <dd>Dataspace identifier.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>space_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Dataspace identifier.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the dataspace selection type, a value of
the enumerated datatype <code>H5S_sel_type</code>,
@@ -924,14 +947,17 @@ END SUBROUTINE h5sget_select_type_f
<code>H5S_UNLIMITED</code> (</code>-1</code>),
the maximum size of that dimension is unlimited.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>space_id</code>
- <dd>IN: Identifier of the dataspace object to query
- <dt><em>hsize_t *</em><code>dims</code>
- <dd>OUT: Pointer to array to store the size of each dimension.
- <dt><em>hsize_t *</em><code>maxdims</code>
- <dd>OUT: Pointer to array to store the maximum size of each dimension.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>space_id</code></td>
+ <td valign="top">IN: Identifier of the dataspace object to query</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t *</em><code>dims</code></td>
+ <td valign="top">OUT: Pointer to array to store the size of each dimension.</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t&nbsp;*</em><code>maxdims&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: Pointer to array to store the maximum size of each dimension.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the number of dimensions in the dataspace if successful;
otherwise returns a negative value.
@@ -972,10 +998,11 @@ END SUBROUTINE h5sget_simple_extent_dims_f
<dd><code>H5Sget_simple_extent_ndims</code> determines the dimensionality (or rank)
of a dataspace.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>space_id</code>
- <dd>Identifier of the dataspace
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>space_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Identifier of the dataspace</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the number of dimensions in the dataspace if successful;
otherwise returns a negative value.
@@ -1013,10 +1040,11 @@ END SUBROUTINE h5sget_simple_extent_ndims_f
in a dataspace. For example, a simple 3-dimensional dataspace
with dimensions 2, 3, and 4 would have 24 elements.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>space_id</code>
- <dd>ID of the dataspace object to query
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>space_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">ID of the dataspace object to query</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the number of elements in the dataspace if successful;
otherwise returns 0.
@@ -1058,10 +1086,11 @@ END SUBROUTINE h5sget_simple_extent_npoints_f
<code>H5S_SIMPLE</code>, or
<code>H5S_NONE</code>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>space_id</code>
- <dd>Dataspace identifier.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>space_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Dataspace identifier.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a dataspace class name if successful;
otherwise H5S_NO_CLASS (-1).
@@ -1072,10 +1101,10 @@ SUBROUTINE h5sget_simple_extent_type_f(space_id, classtype, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
INTEGER, INTENT(OUT) :: classtype ! Class type
- ! Valid values are:
+ ! Possible values are:
! H5S_NO_CLASS_F
! H5S_SCALAR_F
- ! H5S_SIMPLE_F
+ ! H5S_SIMPLE_F
INTEGER, INTENT(OUT) :: hdferr ! Error code
! 0 on success and -1 on failure
END SUBROUTINE h5sget_simple_extent_type_f
@@ -1103,10 +1132,11 @@ END SUBROUTINE h5sget_simple_extent_type_f
a simple dataspace. [Currently, all dataspace objects are simple
dataspaces, complex dataspace support will be added in the future]
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>space_id</code>
- <dd>Identifier of the dataspace to query
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>space_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Identifier of the dataspace to query</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>When successful, returns a positive value, for <code>TRUE</code>,
or <code>0</code> (zero), for <code>FALSE</code>.
@@ -1117,8 +1147,8 @@ END SUBROUTINE h5sget_simple_extent_type_f
SUBROUTINE h5sis_simple_f(space_id, flag, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
- LOGICAL, INTENT(OUT) :: flag ! Flag, idicates if dataspace
- ! is simple or not:
+ LOGICAL, INTENT(OUT) :: flag ! Flag, indicates if dataspace
+ ! is simple or not:
! TRUE or FALSE
INTEGER, INTENT(OUT) :: hdferr ! Error code
! 0 on success and -1 on failure
@@ -1156,12 +1186,14 @@ END SUBROUTINE h5sis_simple_f
to different locations within a dataspace without requiring it
to be redefined.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>space_id</code>
- <dd>IN: The identifier for the dataspace object to reset.
- <dt><em>const hssize_t *</em><code>offset</code>
- <dd>IN: The offset at which to position the selection.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>space_id</code></td>
+ <td valign="top">IN: The identifier for the dataspace object to reset.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;hssize_t&nbsp;*</em><code>offset&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: The offset at which to position the selection.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -1205,11 +1237,12 @@ END SUBROUTINE h5soffset_simple_f
<code>space_id</code>. <tt>H5S_SELECT_ALL</tt> selects the
entire dataspace for any dataspace it is applied to.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>space_id</code>
- <dd>IN: The identifier for the dataspace in which the
- selection is being made.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>space_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: The identifier for the dataspace in which the
+ selection is being made.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -1241,7 +1274,7 @@ END SUBROUTINE h5sselect_all_f
<dd><em>herr_t</em> <code>H5Sselect_elements</code>(<em>hid_t </em><code>space_id</code>,
<em>H5S_seloper_t</em> <code>op</code>,
<em>const size_t</em> <code>num_elements</code>,
- <em>const hssize_t *</em><code>coord</code>[ ]
+ <em>const hsize_t *</em><code>coord</code>[ ]
)
<dt><strong>Purpose:</strong>
<dd>Selects array elements to be included in the selection for a dataspace.
@@ -1295,38 +1328,42 @@ END SUBROUTINE h5sselect_all_f
the selection ordering is reset to C array ordering.
-->
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>space_id</code>
- <dd>Identifier of the dataspace.
- <dt><em>H5S_seloper_t</em> <code>op</code>
- <dd>Operator specifying how the new selection is to be
- combined with the existing selection for the dataspace.
- <dt><em>const size_t</em> <code>num_elements</code>
- <dd>Number of elements to be selected.
- <dt><em>const hssize_t *</em><code>coord</code>[ ]
- <dd>A 2-dimensional array of 0-based values specifying the
- coordinates of the elements being selected.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>space_id</code></td>
+ <td valign="top">Identifier of the dataspace.</td></tr>
+ <tr>
+ <td valign="top"><em>H5S_seloper_t</em> <code>op</code></td>
+ <td valign="top">Operator specifying how the new selection is to be
+ combined with the existing selection for the dataspace.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;size_t</em>&nbsp;<code>num_elements&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Number of elements to be selected.</td></tr>
+ <tr>
+ <td valign="top"><em>const hsize_t *</em><code>coord</code>[ ]</td>
+ <td valign="top">A 2-dimensional array of 0-based values specifying the
+ coordinates of the elements being selected.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
<dt><strong>Fortran90 Interface:</strong> h5sselect_elements_f
<dd>
<pre>
-SUBROUTINE h5sselect_elements_f(space_id, operator, num_elements, &amp;
+SUBROUTINE h5sselect_elements_f(space_id, operator, num_elements,
coord, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
INTEGER, INTENT(IN) :: op ! Flag, valid values are:
! H5S_SELECT_SET_F
! H5S_SELECT_OR_F
- INTEGER, INTENT(IN) :: num_elements ! Number of elements to be selected</pre>
-<!-- NEW PAGE -->
-<pre>
- INTEGER(HSSIZE_T), DIMENSION(*,*), INTENT(IN) :: coord
+ INTEGER, INTENT(IN) :: num_elements ! Number of elements to be selected
+ INTEGER(HSIZE_T), DIMENSION(*,*), INTENT(IN) :: coord
! Array with the coordinates
! of the selected elements:
- ! coord(num_elements, rank)
+ ! coord(num_elements, rank)</pre>
+<!-- NEW PAGE -->
+<pre>
INTEGER, INTENT(OUT) :: hdferr ! Error code
! 0 on success and -1 on failure
END SUBROUTINE h5sselect_elements_f
@@ -1348,7 +1385,7 @@ END SUBROUTINE h5sselect_elements_f
<dt><strong>Signature:</strong>
<dd><em>herr_t</em> <code>H5Sselect_hyperslab</code>(<em>hid_t</em> <code>space_id</code>,
<em>H5S_seloper_t</em> <code>op</code>,
- <em>const hssize_t *</em><code>start</code>,
+ <em>const hsize_t *</em><code>start</code>,
<em>const hsize_t *</em><code>stride</code>,
<em>const hsize_t *</em><code>count</code>,
<em>const hsize_t *</em><code>block</code>
@@ -1451,34 +1488,40 @@ END SUBROUTINE h5sselect_elements_f
Regions selected with this function call default to C order
iteration when I/O is performed.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>space_id</code>
- <dd>IN: Identifier of dataspace selection to modify
- <dt><em>H5S_seloper_t</em> <code>op</code>
- <dd>IN: Operation to perform on current selection.
- <dt><em>const hssize_t *</em><code>start</code>
- <dd>IN: Offset of start of hyperslab
- <dt><em>const hsize_t *</em><code>count</code>
- <dd>IN: Number of blocks included in hyperslab.
- <dt><em>const hsize_t *</em><code>stride</code>
- <dd>IN: Hyperslab stride.
- <dt><em>const hsize_t *</em><code>block</code>
- <dd>IN: Size of block in hyperslab.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>space_id</code></td>
+ <td valign="top">IN: Identifier of dataspace selection to modify</td></tr>
+ <tr>
+ <td valign="top"><em>H5S_seloper_t</em> <code>op</code></td>
+ <td valign="top">IN: Operation to perform on current selection.</td></tr>
+ <tr>
+ <td valign="top"><em>const hsize_t *</em><code>start</code></td>
+ <td valign="top">IN: Offset of start of hyperslab</td></tr>
+ <tr>
+ <td valign="top"><em>const hsize_t *</em><code>count</code></td>
+ <td valign="top">IN: Number of blocks included in hyperslab.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;hsize_t&nbsp;*</em><code>stride&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Hyperslab stride.</td></tr>
+ <tr>
+ <td valign="top"><em>const hsize_t *</em><code>block</code></td>
+ <td valign="top">IN: Size of block in hyperslab.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
<dt><strong>Fortran90 Interface:</strong> h5sselect_hyperslab_f
<dd>
<pre>
-SUBROUTINE h5sselect_hyperslab_f(space_id, operator, start, count, &amp;
+SUBROUTINE h5sselect_hyperslab_f(space_id, operator, start, count,
hdferr, stride, block)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
INTEGER, INTENT(IN) :: op ! Flag, valid values are:
! H5S_SELECT_SET_F
! H5S_SELECT_OR_F
- INTEGER(HSSIZE_T), DIMENSION(*), INTENT(IN) :: start
+ INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: start
! Starting coordinates of hyperslab
INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: count
! Number of blocks to select
@@ -1514,11 +1557,12 @@ END SUBROUTINE h5sselect_hyperslab_f
<dd><code>H5Sselect_none</code> resets the selection region
for the dataspace <code>space_id</code> to include no elements.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>space_id</code>
- <dd>IN: The identifier for the dataspace in which the
- selection is being reset.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>space_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: The identifier for the dataspace in which the
+ selection is being reset.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -1555,10 +1599,11 @@ END SUBROUTINE h5sselect_none_f
for the dataspace <code>space_id</code> is within the extent
of the dataspace if the current offset for the dataspace is used.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>space_id</code>
- <dd>The identifier for the dataspace being queried.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>space_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">The identifier for the dataspace being queried.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a positive value, for <code>TRUE</code>,
if the selection is contained within the extent
@@ -1600,11 +1645,12 @@ END SUBROUTINE h5sselect_valid_f
<dd><code>H5Sset_extent_none</code> removes the extent from
a dataspace and sets the type to <tt>H5S_NO_CLASS</tt>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>space_id</code>
- <dd>The identifier for the dataspace from which
- the extent is to be removed.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>space_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">The identifier for the dataspace from which
+ the extent is to be removed.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -1657,23 +1703,27 @@ END SUBROUTINE h5sset_extent_none_f
type is set to <code>H5S_SIMPLE</code>, and the extent is set as
specified.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>space_id</code>
- <dd>Dataspace identifier.
- <dt><em>int</em> <code>rank</code>
- <dd>Rank, or dimensionality, of the dataspace.
- <dt><em>const hsize_t *</em><code>current_size</code>
- <dd>Array containing current size of dataspace.
- <dt><em>const hsize_t *</em><code>maximum_size</code>
- <dd>Array containing maximum size of dataspace.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>space_id</code></td>
+ <td valign="top">Dataspace identifier.</td>
+ <tr>
+ <td valign="top"><em>int</em> <code>rank</code></td>
+ <td valign="top">Rank, or dimensionality, of the dataspace.</td>
+ <tr>
+ <td valign="top"><em>const&nbsp;hsize_t&nbsp;*</em><code>current_size&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Array containing current size of dataspace.</td>
+ <tr>
+ <td valign="top"><em>const hsize_t *</em><code>maximum_size</code></td>
+ <td valign="top">Array containing maximum size of dataspace.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a dataspace identifier if successful;
otherwise returns a negative value.
<dt><strong>Fortran90 Interface:</strong> h5sset_extent_simple_f
<dd>
<pre>
-SUBROUTINE h5sset_extent_simple_f(space_id, rank, current_size, &amp;
+SUBROUTINE h5sset_extent_simple_f(space_id, rank, current_size,
maximum_size, hdferr)
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
diff --git a/doc/html/RM_H5T.html b/doc/html/RM_H5T.html
index a498ead..dc35f47 100644
--- a/doc/html/RM_H5T.html
+++ b/doc/html/RM_H5T.html
@@ -107,8 +107,8 @@ of a dataset.
<li><a href="#Datatype-SetSize">H5Tset_size</a>
<li><a href="#Datatype-GetOrder">H5Tget_order</a>
<li><a href="#Datatype-SetOrder">H5Tset_order</a>
- <li><a href="#Datatype-GetPrecision">H5Tget_precision</a>&nbsp;&nbsp;
- <li><a href="#Datatype-SetPrecision">H5Tset_precision</a>&nbsp;&nbsp;
+ <li><a href="#Datatype-GetPrecision">H5Tget_precision</a>
+ <li><a href="#Datatype-SetPrecision">H5Tset_precision</a>
<li><a href="#Datatype-GetOffset">H5Tget_offset</a>
<li><a href="#Datatype-SetOffset">H5Tset_offset</a>
<li><a href="#Datatype-GetPad">H5Tget_pad</a>
@@ -413,20 +413,24 @@ in the <cite>HDF5 User's Guide</cite> for further information, including a compl
permutation, i.e. C versus FORTRAN array order.
&nbsp;
<b><i>(The parameter </i><code>perm</code><i> is currently unused and is not yet implemented.)</i></b>
- <p>
+
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>base</code>
- <dd>IN: Datatype identifier for the array base datatype.
- <dt><em>int</em> <code>rank</code>
- <dd>IN: Rank of the array.
- <dt><em>const hsize_t</em> <code>dims[/*rank*/]</code>
- <dd>IN: Size of each array dimension.
- <dt><em>const int</em> <code>perm[/*rank*/]</code>
- <dd>IN: Dimension permutation.
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>base</code></td>
+ <td valign="top">IN: Datatype identifier for the array base datatype.</td></tr>
+ <tr>
+ <td valign="top"><em>int</em> <code>rank</code></td>
+ <td valign="top">IN: Rank of the array.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;hsize_t</em>&nbsp;<code>dims[/*rank*/]&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Size of each array dimension.</td></tr>
+ <tr>
+ <td valign="top"><em>const int</em> <code>perm[/*rank*/]</code></td>
+ <td valign="top">IN: Dimension permutation.
&nbsp;
- <b><i>(Currently not implemented.)</i></b>
- </dl>
+ <b><i>(Currently not implemented.)</i></b></td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -467,10 +471,11 @@ END SUBROUTINE h5tarray_create_f
through the datatype identifier is illegal. Failure to release
a datatype with this call will result in resource leaks.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of datatype to release.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>type_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Identifier of datatype to release.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -512,14 +517,17 @@ END SUBROUTINE h5tclose_f
which, when combined with <code>name</code>, refers to a new
named datatype.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>loc_id</code>
- <dd>IN: A file or group identifier.
- <dt><em>const char *</em> <code>name</code>
- <dd>IN: A datatype name.
- <dt><em>hid_t</em> <code>type</code>
- <dd>IN: A datatype identifier.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>loc_id</code></td>
+ <td valign="top">IN: A file or group identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;char&nbsp;*</em>&nbsp;<code>name&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: A datatype name.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>type</code></td>
+ <td valign="top">IN: A datatype identifier.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -562,10 +570,11 @@ END SUBROUTINE h5tcommit_f
return committed datatypes with <code>H5Dget_type()</code> are
able to share the datatype with other datasets in the same file.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type</code>
- <dd>IN: Datatype identifier.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>type&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Datatype identifier.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>When successful, returns a positive value, for <code>TRUE</code>,
if the datatype has been committed, or <code>0</code> (zero),
@@ -624,20 +633,26 @@ END SUBROUTINE h5tcommitted_f
As of Release 1.2, this parameter is only used to pass along the
variable-length datatype custom allocation information.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>src_id</code>
- <dd>Identifier for the source datatype.
- <dt><em>hid_t</em> <code>dst_id</code>
- <dd>Identifier for the destination datatype.
- <dt><em>size_t</em> <code>nelmts</code>
- <dd>Size of array <code>buf</code>.
- <dt><em>void *</em><code>buf</code>
- <dd>Array containing pre- and post-conversion values.
- <dt><em>void *</em><code>background</code>
- <dd>Optional background buffer.
- <dt><em>hid_t</em> <code>plist_id</code>
- <dd>Dataset transfer property list identifier.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>src_id</code></td>
+ <td valign="top">Identifier for the source datatype.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>dst_id</code></td>
+ <td valign="top">Identifier for the destination datatype.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t</em> <code>nelmts</code></td>
+ <td valign="top">Size of array <code>buf</code>.</td></tr>
+ <tr>
+ <td valign="top"><em>void *</em><code>buf</code></td>
+ <td valign="top">Array containing pre- and post-conversion values.</td></tr>
+ <tr>
+ <td valign="top"><em>void&nbsp;*</em><code>background&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Optional background buffer.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>plist_id</code></td>
+ <td valign="top">Dataset transfer property list identifier.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -734,12 +749,13 @@ SUBROUTINE
</dl> </ul>
-->
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of datatype to copy. Can be a datatype
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>type_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Identifier of datatype to copy. Can be a datatype
identifier, a predefined datatype (defined in
- <code>H5Tpublic.h</code>), or a dataset identifier.
- </dl>
+ <code>H5Tpublic.h</code>), or a dataset identifier.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a datatype identifier if successful;
otherwise returns a negative value
@@ -790,12 +806,14 @@ END SUBROUTINE h5tcopy_f
The datatype identifier returned from this function should be
released with <code>H5Tclose</code> or resource leaks will result.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>H5T_class_t</em> <code>class</code>
- <dd>Class of datatype to create.
- <dt><em>size_t</em> <code>size</code>
- <dd>The number of bytes in the datatype to create.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>H5T_class_t</em>&nbsp;<code>class&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Class of datatype to create.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t</em> <code>size</code></td>
+ <td valign="top">The number of bytes in the datatype to create.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns datatype identifier if successful;
otherwise returns a negative value.
@@ -846,12 +864,14 @@ END SUBROUTINE h5tcreate_f
Valid class identifiers are as defined in
<a href="#Datatype-GetClass"><code>H5Tget_class</code></a>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>dtype_id</code>
- <dd>Datatype identifier.
- <dt><em>H5T_class_t</em><code>dtype_class</code>
- <dd>Datatype class.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>dtype_id</code></td>
+ <td valign="top">Datatype identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>H5T_class_t</em>&nbsp;<code>dtype_class&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Datatype class.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns <code>TRUE</code> or <code>FALSE</code> if successful;
otherwise returns a negative value.
@@ -887,10 +907,11 @@ SUBROUTINE
based on the specified base datatype, <code>parent_id</code>,
which must be an integer type.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>parent_id</code>
- <dd>IN: Datatype identifier for the base datatype.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>parent_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Datatype identifier for the base datatype.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the datatype identifier for the new enumeration datatype if successful;
otherwise returns a negative value.
@@ -941,14 +962,17 @@ END SUBROUTINE h5tenum_create_f
<code>value</code> points to data which is of the
datatype defined when the enumeration datatype was created.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type</code>
- <dd>IN: Datatype identifier for the enumeration datatype.
- <dt><em>const char</em> *<code>name</code>
- <dd>IN: Name of the new member.
- <dt><em>void</em> *<code>value</code>
- <dd>IN: Pointer to the value of the new member.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>type</code></td>
+ <td valign="top">IN: Datatype identifier for the enumeration datatype.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;char</em>&nbsp;*<code>name&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Name of the new member.</td></tr>
+ <tr>
+ <td valign="top"><em>void</em> *<code>value</code></td>
+ <td valign="top">IN: Pointer to the value of the new member.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -997,16 +1021,20 @@ END SUBROUTINE h5tenum_insert_f
many characters as possible are copied
(not null terminated) and the function fails.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type</code>
- <dd>IN: Enumeration datatype identifier.
- <dt><em>void</em> *<code>value</code>,
- <dd>IN: Value of the enumeration datatype.
- <dt><em>char</em> *<code>name</code>,
- <dd>OUT: Buffer for output of the symbol name.
- <dt><em>size_t</em> <code>size</code>
- <dd>IN: Anticipated size of the symbol name, in bytes (characters).
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>type</code></td>
+ <td valign="top">IN: Enumeration datatype identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>void</em>&nbsp;*<code>value,&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Value of the enumeration datatype.</td></tr>
+ <tr>
+ <td valign="top"><em>char</em> *<code>name</code>,</td>
+ <td valign="top">OUT: Buffer for output of the symbol name.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t</em> <code>size</code></td>
+ <td valign="top">IN: Anticipated size of the symbol name, in bytes (characters).</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful.
Otherwise returns a negative value
@@ -1055,14 +1083,17 @@ END SUBROUTINE h5tenum_nameof_f
as large as the value of <code>H5Tget_size(type)</code>
in order to hold the result.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type</code>
- <dd>IN: Enumeration datatype identifier.
- <dt><em>const char</em> *<code>name</code>,
- <dd>IN: Symbol name of the enumeration datatype.
- <dt><em>void</em> *<code>value</code>,
- <dd>OUT: Buffer for output of the value of the enumeration datatype.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>type</code></td>
+ <td valign="top">IN: Enumeration datatype identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;char</em>&nbsp;*<code>name,&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Symbol name of the enumeration datatype.</td></tr>
+ <tr>
+ <td valign="top"><em>void</em> *<code>value</code>,</td>
+ <td valign="top">OUT: Buffer for output of the value of the enumeration datatype.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -1101,12 +1132,14 @@ END SUBROUTINE h5tenum_valueof_f
<dd><code>H5Tequal</code> determines whether two datatype identifiers
refer to the same datatype.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id1</code>
- <dd>Identifier of datatype to compare.
- <dt><em>hid_t</em> <code>type_id2</code>
- <dd>Identifier of datatype to compare.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>type_id1&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Identifier of datatype to compare.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>type_id2</code></td>
+ <td valign="top">Identifier of datatype to compare.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>When successful, returns a positive value, for <code>TRUE</code>,
if the datatype identifiers refer to the same datatype,
@@ -1154,14 +1187,17 @@ END SUBROUTINE h5tequal_f
by the soft type conversion function of this path when the
conversion function was installed on the path.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>src_id</code>
- <dd>IN: Identifier for the source datatype.
- <dt><em>hid_t</em> <code>dst_id</code>
- <dd>IN: Identifier for the destination datatype.
- <dt><em>H5T_cdata_t **</em><code>pcdata</code>
- <dd>OUT: Pointer to type conversion data.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>src_id</code></td>
+ <td valign="top">IN: Identifier for the source datatype.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>dst_id</code></td>
+ <td valign="top">IN: Identifier for the destination datatype.</td></tr>
+ <tr>
+ <td valign="top"><em>H5T_cdata_t&nbsp;**</em><code>pcdata&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: Pointer to type conversion data.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a pointer to a suitable conversion function if successful.
Otherwise returns NULL.
@@ -1202,14 +1238,17 @@ SUBROUTINE
The dimension permutations, i.e., C versus FORTRAN array order,
are returned in the array <code>perm</code>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>adtype_id</code>
- <dd>IN: Datatype identifier of array object.
- <dt><em>hsize_t *</em><code>dims[]</code>
- <dd>OUT: Sizes of array dimensions.
- <dt><em>int *</em><code>perm[]</code>
- <dd>OUT: Dimension permutations.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>adtype_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Datatype identifier of array object.</td></tr>
+ <tr>
+ <td valign="top"><em>hsize_t *</em><code>dims[]</code></td>
+ <td valign="top">OUT: Sizes of array dimensions.</td></tr>
+ <tr>
+ <td valign="top"><em>int *</em><code>perm[]</code></td>
+ <td valign="top">OUT: Dimension permutations.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the non-negative number of dimensions of the array type if successful;
otherwise returns a negative value.
@@ -1248,10 +1287,11 @@ END SUBROUTINE h5tget_array_dims_f
<dd><code>H5Tget_array_ndims</code> returns the rank,
the number of dimensions, of an array datatype object.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>adtype_id</code>
- <dd>IN: Datatype identifier of array object.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>adtype_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Datatype identifier of array object.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the rank of the array if successful;
otherwise returns a negative value.
@@ -1301,10 +1341,11 @@ END SUBROUTINE h5tget_array_ndims_f
<li><code>H5T_ARRAY</code>
</ul>
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of datatype to query.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>type_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Identifier of datatype to query.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns datatype class identifier if successful;
otherwise <code>H5T_NO_CLASS</code> (-1).
@@ -1351,15 +1392,16 @@ END SUBROUTINE h5tget_class_f
<dt><strong>Description:</strong>
<dd><code>H5Tget_cset</code> retrieves the character set type
of a string datatype. Valid character set types are:
- <ul> <dl>
+ <dl><ul>
<dt>H5T_CSET_ASCII (<code>0</code>)
<dd>Character set is US ASCII
- </dl> </ul>
+ </ul></dl>
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of datatype to query.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>type_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Identifier of datatype to query.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a valid character set type if successful;
otherwise <code>H5T_CSET_ERROR</code> (-1).
@@ -1398,10 +1440,11 @@ END SUBROUTINE h5tget_cset_f
<dt><strong>Description:</strong>
<dd><code>H5Tget_ebias</code> retrieves the exponent bias of a floating-point type.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of datatype to query.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>type_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Identifier of datatype to query.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the bias if successful;
otherwise 0.
@@ -1447,20 +1490,26 @@ END SUBROUTINE h5tget_ebias_f
numbered with the least significant bit number zero.
Any (or even all) of the arguments can be null pointers.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>IN: Identifier of datatype to query.
- <dt><em>size_t *</em><code>spos</code>
- <dd>OUT: Pointer to location to return floating-point sign bit.
- <dt><em>size_t *</em><code>epos</code>
- <dd>OUT: Pointer to location to return exponent bit-position.
- <dt><em>size_t *</em><code>esize</code>
- <dd>OUT: Pointer to location to return size of exponent in bits.
- <dt><em>size_t *</em><code>mpos</code>
- <dd>OUT: Pointer to location to return mantissa bit-position.
- <dt><em>size_t *</em><code>msize</code>
- <dd>OUT: Pointer to location to return size of mantissa in bits.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>type_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of datatype to query.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t *</em><code>spos</code></td>
+ <td valign="top">OUT: Pointer to location to return floating-point sign bit.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t *</em><code>epos</code></td>
+ <td valign="top">OUT: Pointer to location to return exponent bit-position.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t *</em><code>esize</code></td>
+ <td valign="top">OUT: Pointer to location to return size of exponent in bits.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t *</em><code>mpos</code></td>
+ <td valign="top">OUT: Pointer to location to return mantissa bit-position.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t *</em><code>msize</code></td>
+ <td valign="top">OUT: Pointer to location to return size of mantissa in bits.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -1509,10 +1558,11 @@ END SUBROUTINE h5tget_fields_f
<dd>Leave background alone.
</dl> </ul>
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of datatype to query.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>type_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Identifier of datatype to query.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a valid padding type if successful;
otherwise <code>H5T_PAD_ERROR</code> (-1).
@@ -1548,7 +1598,7 @@ END SUBROUTINE h5tget_inpad_f
<dt><strong>Signature:</strong>
<dd><em>H5T_class_t</em> <code>H5Tget_member_class</code>(
<em>hid_t</em> <code>cdtype_id</code>,
- <em>int </em><code>member_no</code>
+ <em>unsigned </em><code>member_no</code>
)
<dt><strong>Purpose:</strong>
<dd>Returns datatype class of compound datatype member.
@@ -1557,12 +1607,14 @@ END SUBROUTINE h5tget_inpad_f
<code>H5Tget_member_class</code> returns the datatype class of
the compound datatype member specified by <code>member_no</code>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>cdtype_id</code>
- <dd>IN: Datatype identifier of compound object.
- <dt><em>int</em> <code>member_no</code>
- <dd>IN: Compound object member number.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>cdtype_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Datatype identifier of compound object.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned</em> <code>member_no</code></td>
+ <td valign="top">IN: Compound object member number.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the datatype class, a non-negative value, if successful;
otherwise returns a negative value.
@@ -1603,12 +1655,14 @@ END SUBROUTINE h5tget_inpad_f
with index values of 0 through <em>N</em>-1, where <em>N</em> is
the value returned by <code>H5Tget_nmembers</code>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of datatype to query.
- <dt><em>const char *</em> <code>field_name</code>
- <dd>Name of the field or member whose index is to be retrieved.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>type_id</code></td>
+ <td valign="top">Identifier of datatype to query.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;char&nbsp;*</em>&nbsp;<code>field_name&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Name of the field or member whose index is to be retrieved.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a valid field or member index if successful;
otherwise returns a negative value.
@@ -1635,7 +1689,7 @@ END SUBROUTINE h5tget_inpad_f
<dt><strong>Name:</strong> <a name="Datatype-GetMemberName">H5Tget_member_name</a>
<dt><strong>Signature:</strong>
<dd><em>char *</em> <code>H5Tget_member_name</code>(<em>hid_t </em><code>type_id</code>,
- <em>int</em> <code>field_idx</code>
+ <em>unsigned</em> <code>field_idx</code>
)
<dt><strong>Purpose:</strong>
<dd>Retrieves the name of a compound or enumeration datatype member.
@@ -1654,13 +1708,15 @@ END SUBROUTINE h5tget_inpad_f
allocated with <code>malloc()</code> and the caller is responsible
for freeing the memory used.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of datatype to query.
- <dt><em>int</em> <code>field_idx</code>
- <dd>Zero-based index of the field or element whose name
- is to be retrieved.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>type_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Identifier of datatype to query.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned</em> <code>field_idx</code></td>
+ <td valign="top">Zero-based index of the field or element whose name
+ is to be retrieved.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a valid pointer to a string allocated with
<code>malloc()</code> if successful;
@@ -1695,7 +1751,7 @@ END SUBROUTINE h5tget_member_name_f
<dt><strong>Name:</strong> <a name="Datatype-GetMemberOffset">H5Tget_member_offset</a>
<dt><strong>Signature:</strong>
<dd><em>size_t</em> <code>H5Tget_member_offset</code>(<em>hid_t </em><code>type_id</code>,
- <em>int</em> <code>memb_no</code>
+ <em>unsigned</em> <code>memb_no</code>
)
<dt><strong>Purpose:</strong>
<dd>Retrieves the offset of a field of a compound datatype.
@@ -1705,12 +1761,14 @@ END SUBROUTINE h5tget_member_name_f
compound datatype with respect to the beginning
of the compound data type datum.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of datatype to query.
- <dt><em>int</em> <code>memb_no</code>
- <dd>Number of the field whose offset is requested.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>type_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Identifier of datatype to query.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned</em> <code>memb_no</code></td>
+ <td valign="top">Number of the field whose offset is requested.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the byte offset of the field if successful;
otherwise returns <code>0</code> (zero).
@@ -1746,7 +1804,7 @@ END SUBROUTINE h5tget_member_offset_f
<dt><strong>Name:</strong> <a name="Datatype-GetMemberType">H5Tget_member_type</a>
<dt><strong>Signature:</strong>
<dd><em>hid_t</em> <code>H5Tget_member_type</code>(<em>hid_t </em><code>type_id</code>,
- <em>int</em> <code>field_idx</code>
+ <em>unsigned</em> <code>field_idx</code>
)
<dt><strong>Purpose:</strong>
<dd>Returns the datatype of the specified member.
@@ -1754,12 +1812,14 @@ END SUBROUTINE h5tget_member_offset_f
<dd><code>H5Tget_member_type</code> returns the datatype of the specified member. The caller
should invoke H5Tclose() to release resources associated with the type.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of datatype to query.
- <dt><em>int</em> <code>field_idx</code>
- <dd>Field index (0-based) of the field type to retrieve.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>type_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Identifier of datatype to query.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned</em> <code>field_idx</code></td>
+ <td valign="top">Field index (0-based) of the field type to retrieve.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the identifier of a copy of the datatype of the field
if successful;
@@ -1793,7 +1853,7 @@ END SUBROUTINE h5tget_member_type_f
<dt><strong>Name:</strong> <a name="Datatype-GetMemberValue">H5Tget_member_value</a>
<dt><strong>Signature:</strong>
<dd><em>hid_t</em> <code>H5Tget_member_value</code>(<em>hid_t</em> <code>type</code>
- <em>int</em> <code>memb_no</code>,
+ <em>unsigned</em> <code>memb_no</code>,
<em>void</em> *<code>value</code>
)
<dt><strong>Purpose:</strong>
@@ -1805,15 +1865,18 @@ END SUBROUTINE h5tget_member_type_f
The member value is returned in a user-supplied buffer
pointed to by <code>value</code>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type</code>
- <dd>IN: Datatype identifier for the enumeration datatype.
- <dt><em>int</em> <code>memb_no</code>,
- <dd>IN: Number of the enumeration datatype member.
- <dt><em>void</em> *<code>value</code>
- <dd>OUT: Pointer to a buffer for output of the
- value of the enumeration datatype member.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>type</code></td>
+ <td valign="top">IN: Datatype identifier for the enumeration datatype.</td></tr>
+ <tr>
+ <td valign="top"><em>unsigned</em> <code>memb_no</code>,</td>
+ <td valign="top">IN: Number of the enumeration datatype member.</td></tr>
+ <tr>
+ <td valign="top"><em>void</em>&nbsp;*<code>value&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: Pointer to a buffer for output of the
+ value of the enumeration datatype member.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -1907,12 +1970,14 @@ END SUBROUTINE h5tget_member_value_f
should eventually be closed by calling <code>H5Tclose</code>
to release resources.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Datatype identifier for the dataset datatype.
- <dt><em>H5T_direction_t</em> <code>direction</code>
- <dd>Direction of search.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>type_id</code></td>
+ <td valign="top">Datatype identifier for the dataset datatype.</td></tr>
+ <tr>
+ <td valign="top"><em>H5T_direction_t</em>&nbsp;<code>direction&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Direction of search.</td></tr>
+ </table></ul>
<!-- NEW PAGE -->
<dt><strong>Returns:</strong>
<dd>Returns the native datatype identifier for the
@@ -1949,10 +2014,11 @@ SUBROUTINE
the number of fields in a compound datatype or
the number of members of an enumeration datatype.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of datatype to query.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>type_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Identifier of datatype to query.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the number of elements if successful;
otherwise returns a negative value.
@@ -1998,10 +2064,11 @@ END SUBROUTINE h5tget_nmembers_f
<dd>Mantissa is not normalized
</dl> </ul>
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of datatype to query.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>type_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Identifier of datatype to query.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a valid normalization type if successful;
otherwise <code>H5T_NORM_ERROR</code> (-1).
@@ -2093,10 +2160,11 @@ END SUBROUTINE h5tget_norm_f
</tr>
</table>
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of datatype to query.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>type_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Identifier of datatype to query.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns an offset value if successful;
otherwise returns a negative value.
@@ -2144,10 +2212,11 @@ END SUBROUTINE h5tget_offset_f
<dd>VAX mixed byte ordering (not currently supported).
</dl></ul>
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of datatype to query.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>type_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Identifier of datatype to query.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a byte order constant if successful;
otherwise <code>H5T_ORDER_ERROR</code> (-1).
@@ -2240,16 +2309,19 @@ SUBROUTINE
<dd>Leave background alone.
</dl> </ul>
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>IN: Identifier of datatype to query.
- <dt><em>H5T_pad_t *</em> <code>lsb</code>
- <dd>OUT: Pointer to location to return least-significant
- bit padding type.
- <dt><em>H5T_pad_t *</em> <code>msb</code>
- <dd>OUT: Pointer to location to return most-significant
- bit padding type.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>type_id</code></td>
+ <td valign="top">IN: Identifier of datatype to query.</td></tr>
+ <tr>
+ <td valign="top"><em>H5T_pad_t&nbsp;*</em>&nbsp;<code>lsb&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">OUT: Pointer to location to return least-significant
+ bit padding type.</td></tr>
+ <tr>
+ <td valign="top"><em>H5T_pad_t *</em> <code>msb</code></td>
+ <td valign="top">OUT: Pointer to location to return most-significant
+ bit padding type.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -2297,10 +2369,11 @@ END SUBROUTINE h5tget_pad_f
precision is the number of significant bits which, unless padding is
present, is 8 times larger than the value returned by H5Tget_size().
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of datatype to query.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>type_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Identifier of datatype to query.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the number of significant bits if successful;
otherwise 0.
@@ -2343,10 +2416,11 @@ END SUBROUTINE h5tget_precision_f
<dd>Two's complement signed integer type.
</dl> </ul>
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of datatype to query.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>type_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Identifier of datatype to query.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a valid sign type if successful;
otherwise <code>H5T_SGN_ERROR</code> (-1).
@@ -2390,10 +2464,11 @@ END SUBROUTINE h5tget_sign_f
<dt><strong>Description:</strong>
<dd><code>H5Tget_size</code> returns the size of a datatype in bytes.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of datatype to query.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>type_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Identifier of datatype to query.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the size of the datatype in bytes if successful;
otherwise 0.
@@ -2432,10 +2507,11 @@ END SUBROUTINE h5tget_size_f
for a string datatype, as defined in
<a href="#Datatype-SetStrpad"><code>H5Tset_strpad</code></a>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of datatype to query.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>type_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Identifier of datatype to query.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a valid string storage mechanism if successful;
otherwise <code>H5T_STR_ERROR</code> (-1).
@@ -2480,10 +2556,11 @@ END SUBROUTINE h5tget_strpad_f
<P>
In the case of an enumeration type, the return value is an integer type.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type</code>
- <dd>Datatype identifier for the derived datatype.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>type&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Datatype identifier for the derived datatype.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns the datatype identifier for the base datatype if successful;
otherwise returns a negative value.
@@ -2523,10 +2600,11 @@ END SUBROUTINE h5tget_super_f
The tag is returned via a pointer to an
allocated string, which the caller must free.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Datatype identifier for the opaque datatype.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>type_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Datatype identifier for the opaque datatype.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a pointer to an allocated string if successful;
otherwise returns <code>NULL</code>.
@@ -2575,16 +2653,20 @@ END SUBROUTINE h5tget_tag_f
Note: Members of a compound datatype do not have to be atomic datatypes;
a compound datatype can have a member which is a compound datatype.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of compound datatype to modify.
- <dt><em>const char *</em> <code>name</code>
- <dd>Name of the field to insert.
- <dt><em>size_t</em> <code>offset</code>
- <dd>Offset in memory structure of the field to insert.
- <dt><em>hid_t</em> <code>field_id</code>
- <dd>Datatype identifier of the field to insert.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>type_id</code></td>
+ <td valign="top">Identifier of compound datatype to modify.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;char&nbsp;*</em>&nbsp;<code>name&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Name of the field to insert.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t</em> <code>offset</code></td>
+ <td valign="top">Offset in memory structure of the field to insert.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>field_id</code></td>
+ <td valign="top">Datatype identifier of the field to insert.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -2628,10 +2710,11 @@ END SUBROUTINE h5tinsert_f
This function can be used to distinguish between
fixed and variable-length string datatypes.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>dtype_id</code>
- <dd>Datatype identifier.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>dtype_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Datatype identifier.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns <code>TRUE</code> or <code>FALSE</code> if successful;
otherwise returns a negative value.
@@ -2675,10 +2758,11 @@ END SUBROUTINE h5tis_variable_str_f
inadvertently change or delete a predefined type.
Once a datatype is locked it can never be unlocked.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of datatype to lock.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>type_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Identifier of datatype to lock.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -2716,12 +2800,15 @@ SUBROUTINE
group identifier. The identifier should eventually be closed
by calling <code>H5Tclose</code> to release resources.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>loc_id</code>
- <dd>IN: A file or group identifier.
- <dt><em>const char *</em> <code>name</code>
- <dd>IN: A datatype name, defined within the file or group identified by <code>loc_id</code>.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>loc_id</code></td>
+ <td valign="top">IN: A file or group identifier.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;char&nbsp;*</em>&nbsp;<code>name&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: A datatype name, defined within the file
+ or group identified by <code>loc_id</code>.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a named datatype identifier if successful;
otherwise returns a negative value.
@@ -2761,10 +2848,11 @@ END SUBROUTINE h5topen_f
<dd><code>H5Tpack</code> recursively removes padding from within a compound
datatype to make it more efficient (space-wise) to store that data.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of datatype to modify.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>type_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Identifier of datatype to modify.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -2858,20 +2946,24 @@ END SUBROUTINE h5tpack_f
section of&nbsp; &ldquo;The Datatype Interface (H5T)&rdquo;
in the <cite>HDF5 User's Guide</cite>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>H5T_pers_t</em> <code>pers</code>
- <dd><code>H5T_PERS_HARD</code> for hard conversion functions;
- <code>H5T_PERS_SOFT</code> for soft conversion functions.
-<!-- NEW PAGE -->
- <dt><em>const char *</em> <code>name</code>
- <dd>Name displayed in diagnostic output.
- <dt><em>hid_t</em> <code>src_id</code>
- <dd>Identifier of source datatype.
- <dt><em>hid_t</em> <code>dst_id</code>
- <dd>Identifier of destination datatype.
- <dt><em>H5T_conv_t</em> <code>func</code>
- <dd>Function to convert between source and destination datatypes.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>H5T_pers_t</em> <code>pers</code></td>
+ <td valign="top"><code>H5T_PERS_HARD</code> for hard conversion functions;
+ <code>H5T_PERS_SOFT</code> for soft conversion functions.</td></tr>
+ <tr>
+ <td valign="top"><em>const char *</em> <code>name</code></td>
+ <td valign="top">Name displayed in diagnostic output.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>src_id</code></td>
+ <td valign="top">Identifier of source datatype.</td></tr>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>dst_id</code></td>
+ <td valign="top">Identifier of destination datatype.</td></tr>
+ <tr>
+ <td valign="top"><em>H5T_conv_t</em>&nbsp;<code>func&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Function to convert between source and destination datatypes.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -2913,12 +3005,14 @@ SUBROUTINE
<dd>Character set is US ASCII.
</dl> </ul>
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of datatype to modify.
- <dt><em>H5T_cset_t</em> <code>cset</code>
- <dd>Character set type.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>type_id</code></td>
+ <td valign="top">Identifier of datatype to modify.</td></tr>
+ <tr>
+ <td valign="top"><em>H5T_cset_t</em>&nbsp;<code>cset&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Character set type.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -2958,12 +3052,14 @@ END SUBROUTINE h5tset_cset_f
<dt><strong>Description:</strong>
<dd><code>H5Tset_ebias</code> sets the exponent bias of a floating-point type.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of datatype to set.
- <dt><em>size_t</em> <code>ebias</code>
- <dd>Exponent bias value.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>type_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Identifier of datatype to set.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t</em> <code>ebias</code></td>
+ <td valign="top">Exponent bias value.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -3012,21 +3108,27 @@ END SUBROUTINE h5tset_ebias_f
<P>Fields are not allowed to extend beyond the number of bits of
precision, nor are they allowed to overlap with one another.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of datatype to set.
- <dt><em>size_t</em> <code>spos</code>
- <dd>Sign position, i.e., the bit offset of the floating-point
- sign bit.
- <dt><em>size_t</em> <code>epos</code>
- <dd>Exponent bit position.
- <dt><em>size_t</em> <code>esize</code>
- <dd>Size of exponent in bits.
- <dt><em>size_t</em> <code>mpos</code>
- <dd>Mantissa bit position.
- <dt><em>size_t</em> <code>msize</code>
- <dd>Size of mantissa in bits.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>type_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Identifier of datatype to set.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t</em> <code>spos</code></td>
+ <td valign="top">Sign position, i.e., the bit offset of the floating-point
+ sign bit.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t</em> <code>epos</code></td>
+ <td valign="top">Exponent bit position.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t</em> <code>esize</code></td>
+ <td valign="top">Size of exponent in bits.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t</em> <code>mpos</code></td>
+ <td valign="top">Mantissa bit position.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t</em> <code>msize</code></td>
+ <td valign="top">Size of mantissa in bits.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -3078,12 +3180,14 @@ END SUBROUTINE h5tset_fields_f
<dd>Leave background alone.
</dl> </ul>
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of datatype to modify.
- <dt><em>H5T_pad_t</em> <code>pad</code>
- <dd>Padding type.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>type_id</code></td>
+ <td valign="top">Identifier of datatype to modify.</td></tr>
+ <tr>
+ <td valign="top"><em>H5T_pad_t</em>&nbsp;<code>pad&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Padding type.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -3135,12 +3239,14 @@ END SUBROUTINE h5tset_inpad_f
<dd>Mantissa is not normalized
</dl> </ul>
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of datatype to set.
- <dt><em>H5T_norm_t</em> <code>norm</code>
- <dd>Mantissa normalization type.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>type_id</code></td>
+ <td valign="top">Identifier of datatype to set.</td></tr>
+ <tr>
+ <td valign="top"><em>H5T_norm_t</em>&nbsp;<code>norm&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Mantissa normalization type.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -3240,12 +3346,14 @@ the value from hanging over the edge of the datatype.
<P>The offset of an H5T_STRING cannot be set to anything but
zero.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of datatype to set.
- <dt><em>size_t</em> <code>offset</code>
- <dd>Offset of first significant bit.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>type_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Identifier of datatype to set.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t</em> <code>offset</code></td>
+ <td valign="top">Offset of first significant bit.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -3292,12 +3400,14 @@ END SUBROUTINE h5tset_offset_f
<dd>VAX mixed byte ordering (not currently supported).
</dl> </ul>
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of datatype to set.
- <dt><em>H5T_order_t</em> <code>order</code>
- <dd>Byte ordering constant.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>type_id</code></td>
+ <td valign="top">Identifier of datatype to set.</td></tr>
+ <tr>
+ <td valign="top"><em>H5T_order_t</em>&nbsp;<code>order&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Byte ordering constant.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -3350,10 +3460,11 @@ END SUBROUTINE h5tset_order_f
<p>
The NULL pointer may be passed to remove the overflow handler.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>H5T_overflow_t</em> <code>func</code>
- <dd>Overflow function.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>H5T_overflow_t</em>&nbsp;<code>func&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Overflow function.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -3387,23 +3498,26 @@ SUBROUTINE
<dd>Sets the least and most-significant bits padding types.
<dt><strong>Description:</strong>
<dd><code>H5Tset_pad</code> sets the least and most-significant bits padding types.
- <ul> <dl>
+ <dl> <ul>
<dt>H5T_PAD_ZERO (<code>0</code>)
<dd>Set background to zeros.
<dt>H5T_PAD_ONE (<code>1</code>)
<dd>Set background to ones.
<dt>H5T_PAD_BACKGROUND (<code>2</code>)
<dd>Leave background alone.
- </dl> </ul>
+ </ul> </dl>
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of datatype to set.
- <dt><em>H5T_pad_t</em> <code>lsb</code>
- <dd>Padding type for least-significant bits.
- <dt><em>H5T_pad_t</em> <code>msb</code>
- <dd>Padding type for most-significant bits.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>type_id</code></td>
+ <td valign="top">Identifier of datatype to set.</td></tr>
+ <tr>
+ <td valign="top"><em>H5T_pad_t</em>&nbsp;<code>lsb&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Padding type for least-significant bits.</td></tr>
+ <tr>
+ <td valign="top"><em>H5T_pad_t</em> <code>msb</code></td>
+ <td valign="top">Padding type for most-significant bits.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -3460,12 +3574,14 @@ END SUBROUTINE h5tset_pad_f
locations and sizes of the sign, mantissa, and exponent fields
first.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of datatype to set.
- <dt><em>size_t</em> <code>precision</code>
- <dd>Number of bits of precision for datatype.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>type_id</code></td>
+ <td valign="top">Identifier of datatype to set.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t</em>&nbsp;<code>precision&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Number of bits of precision for datatype.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -3508,12 +3624,14 @@ END SUBROUTINE h5tset_precision_f
<dd>Two's complement signed integer type.
</dl>
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of datatype to set.
- <dt><em>H5T_sign_t</em> <code>sign</code>
- <dd>Sign type.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>type_id</code></td>
+ <td valign="top">Identifier of datatype to set.</td></tr>
+ <tr>
+ <td valign="top"><em>H5T_sign_t</em>&nbsp;<code>sign&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Sign type.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -3569,12 +3687,14 @@ END SUBROUTINE h5tset_sign_f
to 8*<code>size</code>. A compound datatype may increase in size,
but may not shrink. All datatypes must have a positive size.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of datatype to change size.
- <dt><em>size_t</em> <code>size</code>
- <dd>Size in bytes to modify datatype.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>type_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Identifier of datatype to change size.</td></tr>
+ <tr>
+ <td valign="top"><em>size_t</em> <code>size</code></td>
+ <td valign="top">Size in bytes to modify datatype.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -3641,12 +3761,14 @@ END SUBROUTINE h5tset_size_f
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>Identifier of datatype to modify.
- <dt><em>H5T_str_t</em> <code>strpad</code>
- <dd>String padding type.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>type_id</code></td>
+ <td valign="top">Identifier of datatype to modify.</td></tr>
+ <tr>
+ <td valign="top"><em>H5T_str_t</em>&nbsp;<code>strpad&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">String padding type.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -3660,7 +3782,7 @@ SUBROUTINE h5tset_strpad_f(type_id, strpad, hdferr)
INTEGER, INTENT(IN) :: strpad ! String padding method for a string datatype
! Possible values of padding type are:
! Pad with zeros (as C does):
- !r H5T_STR_NULLPAD_(0)
+ ! H5T_STR_NULLPAD_F(0)
! Pad with spaces (as FORTRAN does):
! H5T_STR_SPACEPAD_F(1)
INTEGER, INTENT(OUT) :: hdferr ! Error code
@@ -3690,13 +3812,15 @@ END SUBROUTINE h5tset_strpad_f
<dd><code>H5Tset_tag</code> tags an opaque datatype <code>type_id</code>
with a descriptive ASCII identifier,<code> tag</code>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>type_id</code>
- <dd>IN: Datatype identifier for the opaque datatype to be tagged.
- <dt><em>const char</em> *<code>tag</code>
- <dd>IN: Descriptive ASCII string with which the
- opaque datatype is to be tagged.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em> <code>type_id</code></td>
+ <td valign="top">IN: Datatype identifier for the opaque datatype to be tagged.</td></tr>
+ <tr>
+ <td valign="top"><em>const&nbsp;char</em>&nbsp;*<code>tag&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Descriptive ASCII string with which the
+ opaque datatype is to be tagged.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -3736,10 +3860,11 @@ END SUBROUTINE h5tset_tag_f
The conversion function pointer type declaration is described in
<a href="#Datatype-Register">H5Tregister</a>.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>H5T_conv_t</em> <code>func</code>
- <dd>Function to remove from conversion paths.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>H5T_conv_t</em>&nbsp;<code>func&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Function to remove from conversion paths.</td>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -3783,10 +3908,11 @@ SUBROUTINE
The datatype identifier returned from this function should be
released with <code>H5Tclose</code> or resource leaks will result.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>hid_t</em> <code>base_type_id</code>
- <dd>Base type of datatype to create.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>hid_t</em>&nbsp;<code>base_type_id&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">Base type of datatype to create.</td></tr>
+ </table></ul>
<dt><strong>See Also:</strong>
<dd><a href="RM_H5D.html#Dataset-GetVLBuf">H5Dget_vlen_buf_size</a>
<dd><a href="RM_H5D.html#Dataset-VLReclaim">H5Dvlen_reclaim</a>
diff --git a/doc/html/RM_H5Z.html b/doc/html/RM_H5Z.html
index 11506ce..44c67ca 100644
--- a/doc/html/RM_H5Z.html
+++ b/doc/html/RM_H5Z.html
@@ -105,7 +105,7 @@ as the corresponding C function.
</ul>
</td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td valign=top width="30%">
<ul>
-<!--<li><a href="#Compression-Register">h5zregister_f</a><br> -->
+<!--<li><a href="#Compression-Register">h5zregister_f</a><br> -->
<li><a href="#Compression-GetFilterInfo">h5zget_filter_info_f</a>
</ul>
</td><td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td><td valign=top width="30%">
@@ -129,10 +129,10 @@ The flexibility of the filter pipeline implementation enables the
definition of additional filters by a user application.
A filter
<ul>
- <li>is associated with a dataset when the dataset is created,<br>
- <li>can be used only with chunked data<br>
- (i.e., datasets stored in the <code>H5D_CHUNKED</code>
- storage layout), and
+ <li>is associated with a dataset when the dataset is created,
+ <li>can be used only with chunked data
+ <br>(i.e., datasets stored in the <code>H5D_CHUNKED</code>
+ storage layout), and
<li>is applied independently to each chunk of the dataset.
</ul>
<p>
@@ -179,12 +179,13 @@ data compression.
<dd><code>H5Zfilter_avail</code> determines whether the filter
specified in <code>filter</code> is available to the application.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>H5Z_filter_t</em> <code>filter</code>
- <dd>IN: Filter identifier.
- See the introduction to this section of the reference manual
- for a list of valid filter identifiers.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>H5Z_filter_t</em>&nbsp;<code>filter&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Filter identifier.
+ See the introduction to this section of the reference manual
+ for a list of valid filter identifiers.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -275,20 +276,20 @@ END SUBROUTINE h5zfilter_avail_f
the filter is not so configured.
<p>
If a filter is not encode-enabled, the corresponding
- <code>H5Pset_*</code> function will return an error if the
- filter is added to a dataset creation property list (which is
+ <code>H5Pset_*</code> function will return an error if the
+ filter is added to a dataset creation property list (which is
required if the filter is to be used to encode that dataset).
For example, if the <code>H5Z_FILTER_CONFIG_ENCODE_ENABLED</code>
- flag is not returned for the SZIP filter,
- <code>H5Z_FILTER_SZIP</code>, a call to <code>H5Pset_szip</code>
+ flag is not returned for the SZIP filter,
+ <code>H5Z_FILTER_SZIP</code>, a call to <code>H5Pset_szip</code>
will fail.
<p>
- If a filter is not decode-enabled, the application will not be
- able to read an existing file encoded with that filter.
+ If a filter is not decode-enabled, the application will not be
+ able to read an existing file encoded with that filter.
<p>
- This function should be called, and the returned
- <code>filter_config_flags</code> analyzed, before calling
- any other function, such as <code>H5Pset_szip</code>,
+ This function should be called, and the returned
+ <code>filter_config_flags</code> analyzed, before calling
+ any other function, such as <code>H5Pset_szip</code>,
that might require a particular filter configuration.
<dt><strong>Parameters:</strong>
@@ -301,24 +302,24 @@ END SUBROUTINE h5zfilter_avail_f
<dd>OUT: A bit field encoding the returned filter information
</dl>
<dt><strong>Returns:</strong>
- <dd>Returns a non-negative value on success,
+ <dd>Returns a non-negative value on success,
a negative value on failure.
<!-- NEW PAGE -->
<dt><strong>Fortran90 Interface:</strong>
<dd>
<pre>
-SUBROUTINE h5zget_filter_info_f(filter, config_flags, hdferr)
+SUBROUTINE h5zget_filter_info_f(filter, config_flags, hdferr)
IMPLICIT NONE
- INTEGER, INTENT(IN) :: filter ! Filter, may be one of the
+ INTEGER, INTENT(IN) :: filter ! Filter, may be one of the
! following:
! H5Z_FILTER_DEFLATE_F
! H5Z_FILTER_SHUFFLE_F
! H5Z_FILTER_FLETCHER32_F
! H5Z_FILTER_SZIP_F
- INTEGER, INTENT(OUT) :: config_flags ! Bit field indicating whether
- ! a filter's encoder and/or
+ INTEGER, INTENT(OUT) :: config_flags ! Bit field indicating whether
+ ! a filter's encoder and/or
! decoder are available
INTEGER, INTENT(OUT) :: hdferr ! Error code
@@ -326,8 +327,8 @@ END SUBROUTINE h5zfilter_avail_f
</pre>
<!--<dt><strong>Non-C API(s):</strong>
<dd>
-
- <img src="Graphics/Java.gif">
+
+ <img src="Graphics/Java.gif">
<img src="Graphics/C++.gif">
-->
</dl>
@@ -523,10 +524,11 @@ END SUBROUTINE h5zfilter_avail_f
the <i>set local</i> and <i>can apply</i> callback functions
first appeared in HDF5 Release 1.6.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>const H5Z_class_t</em> <code>filter_class</code>
- <dd>IN: Struct containing filter-definition information.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>const&nbsp;H5Z_class_t</em>&nbsp;<code>filter_class&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Struct containing filter-definition information.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
@@ -563,13 +565,14 @@ END SUBROUTINE h5zfilter_avail_f
specified in <code>filter</code> will no longer be
available to the application.
<dt><strong>Parameters:</strong>
- <dl>
- <dt><em>H5Z_filter_t</em> <code>filter</code>
- <dd>IN: Identifier of the filter to be unregistered.
- See the introduction to this section of the reference manual
- for a list of identifiers for standard filters distributed
- with the HDF5 Library.
- </dl>
+ <ul><table>
+ <tr>
+ <td valign="top"><em>H5Z_filter_t</em>&nbsp;<code>filter&nbsp;&nbsp;&nbsp;&nbsp;</code></td>
+ <td valign="top">IN: Identifier of the filter to be unregistered.
+ See the introduction to this section of the reference manual
+ for a list of identifiers for standard filters
+ distributed with the HDF5 Library.</td></tr>
+ </table></ul>
<dt><strong>Returns:</strong>
<dd>Returns a non-negative value if successful;
otherwise returns a negative value.
diff --git a/doc/html/References.html b/doc/html/References.html
index 2b7b4cf..766b92c 100644
--- a/doc/html/References.html
+++ b/doc/html/References.html
@@ -339,7 +339,7 @@ write the dataset to the file.
href_t data[10][10]; /* HDF5 reference type */
int rank;
size_t dimsf[2];
- hssize_t start[3],count[3];
+ hsize_t start[3],count[3];
int i, j;
/* Open the file */
diff --git a/doc/html/Tutor/examples/h5_copy.c b/doc/html/Tutor/examples/h5_copy.c
index b0a5e00..357596b 100644
--- a/doc/html/Tutor/examples/h5_copy.c
+++ b/doc/html/Tutor/examples/h5_copy.c
@@ -38,7 +38,7 @@ int main (void)
int bufnew[DIM1][DIM2];
int val[] = {53, 59};
hsize_t marray[] = {2};
- hssize_t coord[NUMP][RANK];
+ hsize_t coord[NUMP][RANK];
herr_t ret;
uint i, j;
@@ -95,7 +95,7 @@ int main (void)
coord[0][0] = 0; coord[0][1] = 3;
coord[1][0] = 0; coord[1][1] = 1;
- ret = H5Sselect_elements (fid1, H5S_SELECT_SET, NUMP, (const hssize_t **)coord);
+ ret = H5Sselect_elements (fid1, H5S_SELECT_SET, NUMP, (const hsize_t **)coord);
ret = H5Dwrite (dataset1, H5T_NATIVE_INT, mid1, fid1, H5P_DEFAULT, val);
diff --git a/doc/html/Tutor/examples/h5_extend.c b/doc/html/Tutor/examples/h5_extend.c
index ae26ed6..1f81827 100644
--- a/doc/html/Tutor/examples/h5_extend.c
+++ b/doc/html/Tutor/examples/h5_extend.c
@@ -32,7 +32,7 @@ main (void)
hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED};
hsize_t size[2];
- hssize_t offset[2];
+ hsize_t offset[2];
hsize_t i,j;
herr_t status, status_n;
int data1[3][3] = { {1, 1, 1}, /* data to write */
diff --git a/doc/html/Tutor/examples/h5_hyperslab.c b/doc/html/Tutor/examples/h5_hyperslab.c
index fc953d5..120e30d 100644
--- a/doc/html/Tutor/examples/h5_hyperslab.c
+++ b/doc/html/Tutor/examples/h5_hyperslab.c
@@ -40,9 +40,9 @@ main (void)
int data_out[NX][NY][NZ ]; /* output buffer */
hsize_t count[2]; /* size of the hyperslab in the file */
- hssize_t offset[2]; /* hyperslab offset in the file */
+ hsize_t offset[2]; /* hyperslab offset in the file */
hsize_t count_out[3]; /* size of the hyperslab in memory */
- hssize_t offset_out[3]; /* hyperslab offset in memory */
+ hsize_t offset_out[3]; /* hyperslab offset in memory */
int i, j, k, status_n, rank;
diff --git a/doc/html/Tutor/examples/h5_read.c b/doc/html/Tutor/examples/h5_read.c
index 31cb882..8f2f179 100644
--- a/doc/html/Tutor/examples/h5_read.c
+++ b/doc/html/Tutor/examples/h5_read.c
@@ -36,9 +36,9 @@ main (void)
int data_out[NX][NY][NZ ]; /* output buffer */
hsize_t count[2]; /* size of the hyperslab in the file */
- hssize_t offset[2]; /* hyperslab offset in the file */
+ hsize_t offset[2]; /* hyperslab offset in the file */
hsize_t count_out[3]; /* size of the hyperslab in memory */
- hssize_t offset_out[3]; /* hyperslab offset in memory */
+ hsize_t offset_out[3]; /* hyperslab offset in memory */
int i, j, k, status_n, rank;
for (j = 0; j < NX; j++) {
diff --git a/doc/html/Tutor/examples/h5_ref2regr.c b/doc/html/Tutor/examples/h5_ref2regr.c
index 26b5daf..9f747ae 100644
--- a/doc/html/Tutor/examples/h5_ref2regr.c
+++ b/doc/html/Tutor/examples/h5_ref2regr.c
@@ -24,8 +24,8 @@ main(void)
hid_t sid1, /* Dataspace ID #1 */
sid2; /* Dataspace ID #2 */
hsize_t * coords; /* Coordinate buffer */
- hssize_t low[SPACE2_RANK]; /* Selection bounds */
- hssize_t high[SPACE2_RANK]; /* Selection bounds */
+ hsize_t low[SPACE2_RANK]; /* Selection bounds */
+ hsize_t high[SPACE2_RANK]; /* Selection bounds */
hdset_reg_ref_t *rbuf; /* buffer to to read disk */
int *drbuf; /* Buffer for reading numeric data from disk */
int i, j; /* counting variables */
diff --git a/doc/html/Tutor/examples/h5_ref2regw.c b/doc/html/Tutor/examples/h5_ref2regw.c
index 5f27950..35352f8 100644
--- a/doc/html/Tutor/examples/h5_ref2regw.c
+++ b/doc/html/Tutor/examples/h5_ref2regw.c
@@ -18,18 +18,18 @@
int
main(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dset1, /* Dataset ID */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dset1, /* Dataset ID */
dset2; /* Dereferenced dataset ID */
- hid_t sid1, /* Dataspace ID #1 */
+ hid_t sid1, /* Dataspace ID #1 */
sid2; /* Dataspace ID #2 */
- hsize_t dims1[] = {SPACE1_DIM1},
+ hsize_t dims1[] = {SPACE1_DIM1},
dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
- hssize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
- hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */
- hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */
- hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */
- hssize_t coord1[POINT1_NPOINTS][SPACE2_RANK];
+ hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
+ hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */
+ hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */
+ hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */
+ hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK];
/* Coordinates for point selection */
hdset_reg_ref_t *wbuf; /* buffer to write to disk */
int *dwbuf; /* Buffer for writing numeric data to disk */
@@ -88,7 +88,7 @@ main(void)
coord1[7][0]=9; coord1[7][1]=0;
coord1[8][0]=7; coord1[8][1]=1;
coord1[9][0]=3; coord1[9][1]=3;
- ret = H5Sselect_elements(sid2,H5S_SELECT_SET,POINT1_NPOINTS,(const hssize_t **)coord1);
+ ret = H5Sselect_elements(sid2,H5S_SELECT_SET,POINT1_NPOINTS,(const hsize_t **)coord1);
/* Store second dataset region */
ret = H5Rcreate(&wbuf[1],fid1,"/Dataset2",H5R_DATASET_REGION,sid2);
diff --git a/doc/html/Tutor/examples/refregexample.f90 b/doc/html/Tutor/examples/refregexample.f90
index 05fcf3f..5d72f1e 100644
--- a/doc/html/Tutor/examples/refregexample.f90
+++ b/doc/html/Tutor/examples/refregexample.f90
@@ -27,13 +27,13 @@
TYPE(hdset_reg_ref_t_f) , DIMENSION(2) :: ref_out !
INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/2,9/) ! Datasets dimensions
INTEGER(HSIZE_T), DIMENSION(1) :: dimsr = (/2/) !
- INTEGER(HSSIZE_T), DIMENSION(2) :: start
+ INTEGER(HSIZE_T), DIMENSION(2) :: start
INTEGER(HSIZE_T), DIMENSION(2) :: count
INTEGER :: rankr = 1
INTEGER :: rank = 2
INTEGER , DIMENSION(2,9) :: data
INTEGER , DIMENSION(2,9) :: data_out = 0
- INTEGER(HSSIZE_T) , DIMENSION(2,3) :: coord
+ INTEGER(HSIZE_T) , DIMENSION(2,3) :: coord
INTEGER(SIZE_T) ::num_points = 3 ! Number of selected points
INTEGER :: i, j
INTEGER :: ref_size
diff --git a/doc/html/Tutor/examples/selectele.f90 b/doc/html/Tutor/examples/selectele.f90
index c75958c..8727bd9 100644
--- a/doc/html/Tutor/examples/selectele.f90
+++ b/doc/html/Tutor/examples/selectele.f90
@@ -38,7 +38,7 @@
! Memory dataspace dimensions
INTEGER(HSIZE_T), DIMENSION(2) :: dimsf = (/3,4/)
! File dataspace dimensions
- INTEGER(HSSIZE_T), DIMENSION(RANK,NUMP) :: coord ! Elements coordinates
+ INTEGER(HSIZE_T), DIMENSION(RANK,NUMP) :: coord ! Elements coordinates
! in the file
INTEGER, DIMENSION(3,4) :: buf1, buf2, bufnew ! Data buffers
diff --git a/doc/html/Tutor/select.html b/doc/html/Tutor/select.html
index b8381e5..b4109b0 100644
--- a/doc/html/Tutor/select.html
+++ b/doc/html/Tutor/select.html
@@ -195,7 +195,7 @@ add to the current selected region for a specified dataspace.
<I><B>C</B></I>:
<pre>
herr_t H5Sselect_hyperslab (hid_t space_id, H5S_seloper_t operator,
- const hssize_t *start, const hsize_t *stride,
+ const hsize_t *start, const hsize_t *stride,
const hsize_t *count, const hsize_t *block )
</pre>
<P>
@@ -206,7 +206,7 @@ add to the current selected region for a specified dataspace.
space_id IN: INTEGER(HID_T)
operator IN: INTEGER
- start IN: INTEGER(HSSIZE_T), DIMENSION(*)
+ start IN: INTEGER(HSIZE_T), DIMENSION(*)
count IN: INTEGER(HSIZE_T), DIMENSION(*)
hdferr OUT: INTEGER
stride IN: INTEGER(HSIZE_T), DIMENSION(*), OPTIONAL
diff --git a/doc/html/Tutor/selectc.html b/doc/html/Tutor/selectc.html
index c73b754..59c464c 100644
--- a/doc/html/Tutor/selectc.html
+++ b/doc/html/Tutor/selectc.html
@@ -71,7 +71,7 @@ included in the selection for a dataspace:
<pre>
herr_t H5Sselect_elements (hid_t space_id, H5S_seloper_t operator,
size_t num_elements,
- const hssize_t **coord )
+ const hsize_t **coord )
</pre>
<P>
<I><B>FORTRAN</B></I>:
@@ -81,7 +81,7 @@ included in the selection for a dataspace:
space_id IN: INTEGER(HID_T)
operator IN: INTEGER
num_elements IN: INTEGER
- coord IN: INTEGER(HSSIZE_T), DIMENSION(*,*)
+ coord IN: INTEGER(HSIZE_T), DIMENSION(*,*)
hdferr OUT: INTEGER
</pre>
<P>
diff --git a/doc/html/cpplus/CppInterfaces.html b/doc/html/cpplus/CppInterfaces.html
index e8fa070..4b22251 100644
--- a/doc/html/cpplus/CppInterfaces.html
+++ b/doc/html/cpplus/CppInterfaces.html
@@ -253,10 +253,10 @@ class CompType : public DataType
int getNmembers() const;
// Returns the name of a member of this compound datatype.
- string getMemberName( int member_num ) const;
+ string getMemberName( unsigned member_num ) const;
// Returns the offset of a member of this compound datatype.
- size_t getMemberOffset( int memb_no ) const;
+ size_t getMemberOffset( unsigned memb_no ) const;
// Returns the dimensionality of the specified member of this compound datatype.
int getMemberDims( int member_num, size_t* dims, int* perm ) const;
@@ -264,7 +264,7 @@ class CompType : public DataType
// Returns the type class of the specified member of this compound
// datatype. It provides to the user a way of knowing what type
// to create another datatype of the same class.
- H5T_class_t getMemberClass( int member_num ) const;
+ H5T_class_t getMemberClass( unsigned member_num ) const;
// Returns the generic datatype of the specified member in
// this compound datatype.
@@ -405,7 +405,7 @@ class DataSpace : public IdComponent
// Selects array elements to be included in the selection for
// this dataspace.
- void selectElements ( H5S_seloper_t op, const size_t num_elements, const hssize_t* coord[ ] ) const;
+ void selectElements ( H5S_seloper_t op, const size_t num_elements, const hsize_t* coord[ ] ) const;
// Selects the entire dataspace.
void selectAll () const;
@@ -417,7 +417,7 @@ class DataSpace : public IdComponent
bool selectValid () const;
// Selects a hyperslab region to add to the current selected region.
- void selectHyperslab( H5S_seloper_t op, const hsize_t *count, const hssize_t *start, const hsize_t *stride = NULL, const hsize_t *block = NULL ) const;
+ void selectHyperslab( H5S_seloper_t op, const hsize_t *count, const hsize_t *start, const hsize_t *stride = NULL, const hsize_t *block = NULL ) const;
// Default constructor
DataSpace();
@@ -560,7 +560,7 @@ class DSetCreatPropList : public PropList
int getExternalCount() const;
// Returns information about an external file
- void getExternal( int idx, size_t name_size, char* name, off_t& offset, hsize_t& size ) const;
+ void getExternal( unsigned idx, size_t name_size, char* name, off_t& offset, hsize_t& size ) const;
// Creates a copy of an existing dataset creation property list
// using the property list id
@@ -674,7 +674,7 @@ class EnumType : public DataType
void valueOf( const char* name, void *value ) const;
// Returns the value of an enumeration datatype member
- void getMemberValue( int memb_no, void *value ) const;
+ void getMemberValue( unsigned memb_no, void *value ) const;
// Default constructor
EnumType();
@@ -872,7 +872,7 @@ class FileCreatPropList : public PropList
FileCreatPropList& operator=( const FileCreatPropList& rhs );
// Retrieves version information for various parts of a file.
- void getVersion( int& boot, int& freelist, int& stab, int& shhdr ) const;
+ void getVersion( unsigned& boot, unsigned& freelist, unsigned& stab, unsigned& shhdr ) const;
// Sets the userblock size field of a file creation property list.
void setUserblock( hsize_t size ) const;
@@ -888,18 +888,18 @@ class FileCreatPropList : public PropList
void getSizes( size_t& sizeof_addr, size_t& sizeof_size ) const;
// Sets the size of parameters used to control the symbol table nodes.
- void setSymk( int int_nodes_k, int leaf_nodes_k ) const;
+ void setSymk( unsigned int_nodes_k, unsigned leaf_nodes_k ) const;
// Retrieves the size of the symbol table B-tree 1/2 rank and the
// symbol table leaf node 1/2 size.
- void getSymk( int& int_nodes_k, int& leaf_nodes_k ) const;
+ void getSymk( unsigned& int_nodes_k, unsigned& leaf_nodes_k ) const;
// Sets the size of parameter used to control the B-trees for
// indexing chunked datasets.
- void setIstorek( int ik ) const;
+ void setIstorek( unsigned ik ) const;
// Returns the 1/2 rank of an indexed storage B-tree.
- int getIstorek() const;
+ unsigned getIstorek() const;
// Creates a copy of an existing file create property list
// using the property list id.
diff --git a/doc/html/h5s.examples b/doc/html/h5s.examples
index e7a479f..688382f 100644
--- a/doc/html/h5s.examples
+++ b/doc/html/h5s.examples
@@ -51,7 +51,7 @@ Example 2: Create a simple fixed size 3-D dataspace in memory and on disk and
hid_t dataset; /* Dataset ID */
hid_t mem_space, file_space; /* Dataspaces for memory and the file */
uint8 *buf; /* Buffer for data */
- hssize_t start[3]={3,4,5}; /* Start of hyperslab */
+ hsize_t start[3]={3,4,5}; /* Start of hyperslab */
hsize_t stride[3]={1,2,2}; /* Stride for hyperslab */
hsize_t count[3]={3,3,3}; /* Hyperslab block count in each dimension */
hsize_t block[3]={2,2,2}; /* Hyperslab block size in each dimension */
@@ -169,7 +169,7 @@ Example 4: Create a simple fixed size 3-D dataspace in memory and on disk and
hid_t dataset; /* Dataset ID */
hid_t mem_space, file_space; /* Dataspaces for memory and the file */
uint8 *buf; /* Buffer for data */
- hssize_t start[3]; /* Start of hyperslab */
+ hsize_t start[3]; /* Start of hyperslab */
hsize_t stride[3]; /* Stride for hyperslab */
hsize_t count[3]; /* Hyperslab block count in each dimension */
hsize_t block[3]; /* Hyperslab block size in each dimension */
@@ -299,7 +299,7 @@ Example 6: Create a stored dataspace on disk and use the H5Ssubspace function
{
hid_t file; /* File ID */
hid_t space1, space2; /* Dataspace IDs */
- hssize_t start[3]; /* Start of hyperslab */
+ hsize_t start[3]; /* Start of hyperslab */
hsize_t count[3]; /* Hyperslab block count in each dimension */
hsize_t curr_dims[3]={13,14,15};/* Dimensions of the dataset */
diff --git a/doc/html/ph5example.c b/doc/html/ph5example.c
index 84f5ab7..a69f221 100644
--- a/doc/html/ph5example.c
+++ b/doc/html/ph5example.c
@@ -70,7 +70,7 @@ int dowrite=1; /* write test */
* Assume dimension rank is 2.
*/
void
-slab_set(hssize_t start[], hsize_t count[], hsize_t stride[], int mode)
+slab_set(hsize_t start[], hsize_t count[], hsize_t stride[], int mode)
{
switch (mode){
case BYROW:
@@ -110,7 +110,7 @@ slab_set(hssize_t start[], hsize_t count[], hsize_t stride[], int mode)
* Assume dimension rank is 2 and data is stored contiguous.
*/
void
-dataset_fill(hssize_t start[], hsize_t count[], hsize_t stride[], DATATYPE * dataset)
+dataset_fill(hsize_t start[], hsize_t count[], hsize_t stride[], DATATYPE * dataset)
{
DATATYPE *dataptr = dataset;
int i, j;
@@ -127,7 +127,7 @@ dataset_fill(hssize_t start[], hsize_t count[], hsize_t stride[], DATATYPE * dat
/*
* Print the content of the dataset.
*/
-void dataset_print(hssize_t start[], hsize_t count[], hsize_t stride[], DATATYPE * dataset)
+void dataset_print(hsize_t start[], hsize_t count[], hsize_t stride[], DATATYPE * dataset)
{
DATATYPE *dataptr = dataset;
int i, j;
@@ -146,7 +146,7 @@ void dataset_print(hssize_t start[], hsize_t count[], hsize_t stride[], DATATYPE
/*
* Print the content of the dataset.
*/
-int dataset_vrfy(hssize_t start[], hsize_t count[], hsize_t stride[], DATATYPE *dataset, DATATYPE *original)
+int dataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], DATATYPE *dataset, DATATYPE *original)
{
#define MAX_ERR_REPORT 10 /* Maximum number of errors reported */
DATATYPE *dataptr = dataset;
@@ -204,7 +204,7 @@ phdf5writeInd(char *filename)
{SPACE1_DIM1,SPACE1_DIM2}; /* local dataspace dim sizes */
DATATYPE data_array1[SPACE1_DIM1][SPACE1_DIM2]; /* data buffer */
- hssize_t start[SPACE1_RANK]; /* for hyperslab setting */
+ hsize_t start[SPACE1_RANK]; /* for hyperslab setting */
hsize_t count[SPACE1_RANK], stride[SPACE1_RANK]; /* for hyperslab setting */
herr_t ret; /* Generic return value */
@@ -342,7 +342,7 @@ phdf5readInd(char *filename)
DATATYPE data_array1[SPACE1_DIM1][SPACE1_DIM2]; /* data buffer */
DATATYPE data_origin1[SPACE1_DIM1][SPACE1_DIM2]; /* expected data buffer */
- hssize_t start[SPACE1_RANK]; /* for hyperslab setting */
+ hsize_t start[SPACE1_RANK]; /* for hyperslab setting */
hsize_t count[SPACE1_RANK], stride[SPACE1_RANK]; /* for hyperslab setting */
herr_t ret; /* Generic return value */
@@ -466,7 +466,7 @@ phdf5writeAll(char *filename)
{SPACE1_DIM1,SPACE1_DIM2}; /* dataspace dim sizes */
DATATYPE data_array1[SPACE1_DIM1][SPACE1_DIM2]; /* data buffer */
- hssize_t start[SPACE1_RANK]; /* for hyperslab setting */
+ hsize_t start[SPACE1_RANK]; /* for hyperslab setting */
hsize_t count[SPACE1_RANK], stride[SPACE1_RANK]; /* for hyperslab setting */
herr_t ret; /* Generic return value */
@@ -670,7 +670,7 @@ phdf5readAll(char *filename)
DATATYPE data_array1[SPACE1_DIM1][SPACE1_DIM2]; /* data buffer */
DATATYPE data_origin1[SPACE1_DIM1][SPACE1_DIM2]; /* expected data buffer */
- hssize_t start[SPACE1_RANK]; /* for hyperslab setting */
+ hsize_t start[SPACE1_RANK]; /* for hyperslab setting */
hsize_t count[SPACE1_RANK], stride[SPACE1_RANK]; /* for hyperslab setting */
herr_t ret; /* Generic return value */
diff --git a/examples/h5_chunk_read.c b/examples/h5_chunk_read.c
index c6bf728..af87c10 100644
--- a/examples/h5_chunk_read.c
+++ b/examples/h5_chunk_read.c
@@ -1,4 +1,3 @@
-
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
@@ -39,7 +38,7 @@ main (void)
hsize_t chunk_dims[2];
hsize_t col_dims[1];
hsize_t count[2];
- hssize_t offset[2];
+ hsize_t offset[2];
herr_t status, status_n;
@@ -68,24 +67,6 @@ main (void)
rank, (unsigned long)(dims[0]), (unsigned long)(dims[1]));
/*
- * Get creation properties list.
- */
- cparms = H5Dget_create_plist(dataset); /* Get properties handle first. */
-
- /*
- * Check if dataset is chunked.
- */
- if (H5D_CHUNKED == H5Pget_layout(cparms)) {
-
- /*
- * Get chunking information: rank and dimensions
- */
- rank_chunk = H5Pget_chunk(cparms, 2, chunk_dims);
- printf("chunk rank %d, dimensions %lu x %lu\n", rank_chunk,
- (unsigned long)(chunk_dims[0]), (unsigned long)(chunk_dims[1]));
- }
-
- /*
* Define the memory space to read dataset.
*/
memspace = H5Screate_simple(RANK,dims,NULL);
@@ -103,6 +84,11 @@ main (void)
}
/*
+ * Close/release resources.
+ */
+ H5Sclose(memspace);
+
+ /*
* dataset rank 2, dimensions 10 x 5
* chunk rank 2, dimensions 2 x 5
@@ -145,6 +131,11 @@ main (void)
}
/*
+ * Close/release resources.
+ */
+ H5Sclose(memspace);
+
+ /*
* Third column:
* 1
* 1
@@ -159,36 +150,56 @@ main (void)
*/
/*
- * Define the memory space to read a chunk.
+ * Get creation properties list.
*/
- memspace = H5Screate_simple(rank_chunk,chunk_dims,NULL);
+ cparms = H5Dget_create_plist(dataset); /* Get properties handle first. */
- /*
- * Define chunk in the file (hyperslab) to read.
- */
- offset[0] = 2;
- offset[1] = 0;
- count[0] = chunk_dims[0];
- count[1] = chunk_dims[1];
- status = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL,
- count, NULL);
+ if (H5D_CHUNKED == H5Pget_layout(cparms)) {
- /*
- * Read chunk back and display.
- */
- status = H5Dread(dataset, H5T_NATIVE_INT, memspace, filespace,
- H5P_DEFAULT, chunk_out);
- printf("\n");
- printf("Chunk: \n");
- 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
- */
+ /*
+ * Get chunking information: rank and dimensions
+ */
+ rank_chunk = H5Pget_chunk(cparms, 2, chunk_dims);
+ printf("chunk rank %d, dimensions %lu x %lu\n", rank_chunk,
+ (unsigned long)(chunk_dims[0]), (unsigned long)(chunk_dims[1]));
+
+ /*
+ * Define the memory space to read a chunk.
+ */
+ memspace = H5Screate_simple(rank_chunk,chunk_dims,NULL);
+
+ /*
+ * Define chunk in the file (hyperslab) to read.
+ */
+ offset[0] = 2;
+ offset[1] = 0;
+ count[0] = chunk_dims[0];
+ count[1] = chunk_dims[1];
+ status = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL,
+ count, NULL);
+
+ /*
+ * Read chunk back and display.
+ */
+ status = H5Dread(dataset, H5T_NATIVE_INT, memspace, filespace,
+ H5P_DEFAULT, chunk_out);
+ printf("\n");
+ printf("Chunk: \n");
+ 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
+ */
+
+ /*
+ * Close/release resources.
+ */
+ H5Sclose(memspace);
+ }
/*
* Close/release resources.
@@ -196,7 +207,6 @@ main (void)
H5Pclose(cparms);
H5Dclose(dataset);
H5Sclose(filespace);
- H5Sclose(memspace);
H5Fclose(file);
return 0;
diff --git a/examples/h5_compound.c b/examples/h5_compound.c
index 6cde056..1819734 100644
--- a/examples/h5_compound.c
+++ b/examples/h5_compound.c
@@ -1,4 +1,3 @@
-
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
diff --git a/examples/h5_drivers.c b/examples/h5_drivers.c
index 51c7657..ebe870b 100644
--- a/examples/h5_drivers.c
+++ b/examples/h5_drivers.c
@@ -1,4 +1,3 @@
-
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
diff --git a/examples/h5_extend_write.c b/examples/h5_extend_write.c
index f39fd3c..bcb9949 100644
--- a/examples/h5_extend_write.c
+++ b/examples/h5_extend_write.c
@@ -1,4 +1,3 @@
-
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
@@ -46,7 +45,7 @@ main (void)
hsize_t maxdims[2] = {H5S_UNLIMITED, H5S_UNLIMITED};
hsize_t chunk_dims[2] ={2, 5};
hsize_t size[2];
- hssize_t offset[2];
+ hsize_t offset[2];
herr_t status;
@@ -58,7 +57,7 @@ main (void)
int data3[2][2] = { {3, 3},
{3, 3} };
- int fill_val = 0;
+ int fillvalue = 0;
/*
* Create the data space with unlimited dimensions.
@@ -75,7 +74,7 @@ main (void)
*/
cparms = H5Pcreate(H5P_DATASET_CREATE);
status = H5Pset_chunk( cparms, RANK, chunk_dims);
- H5Pset_fill_value(cparms, H5T_NATIVE_INT, &fill_val);
+ status = H5Pset_fill_value (cparms, H5T_NATIVE_INT, &fillvalue );
/*
* Create a new dataset within the file using cparms
diff --git a/examples/h5_group.c b/examples/h5_group.c
index f82978d..4e3eac1 100644
--- a/examples/h5_group.c
+++ b/examples/h5_group.c
@@ -1,4 +1,3 @@
-
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
diff --git a/examples/h5_mount.c b/examples/h5_mount.c
index 0811a09..7075201 100644
--- a/examples/h5_mount.c
+++ b/examples/h5_mount.c
@@ -1,4 +1,3 @@
-
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
diff --git a/examples/h5_read.c b/examples/h5_read.c
index 213bf47..9d57351 100644
--- a/examples/h5_read.c
+++ b/examples/h5_read.c
@@ -1,4 +1,3 @@
-
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
@@ -51,9 +50,9 @@ main (void)
int data_out[NX][NY][NZ ]; /* output buffer */
hsize_t count[2]; /* size of the hyperslab in the file */
- hssize_t offset[2]; /* hyperslab offset in the file */
+ hsize_t offset[2]; /* hyperslab offset in the file */
hsize_t count_out[3]; /* size of the hyperslab in memory */
- hssize_t offset_out[3]; /* hyperslab offset in memory */
+ hsize_t offset_out[3]; /* hyperslab offset in memory */
int i, j, k, status_n, rank;
for (j = 0; j < NX; j++) {
diff --git a/examples/h5_reference.c b/examples/h5_reference.c
index 7e159d1..45f8850 100644
--- a/examples/h5_reference.c
+++ b/examples/h5_reference.c
@@ -1,4 +1,3 @@
-
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
diff --git a/examples/h5_select.c b/examples/h5_select.c
index 498795c..0c34b1a 100644
--- a/examples/h5_select.c
+++ b/examples/h5_select.c
@@ -1,4 +1,3 @@
-
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
@@ -67,12 +66,12 @@ main (void)
read selection from the
dataset on the disk */
- hssize_t start[2]; /* Start of hyperslab */
+ hsize_t start[2]; /* Start of hyperslab */
hsize_t stride[2]; /* Stride of hyperslab */
hsize_t count[2]; /* Block count */
hsize_t block[2]; /* Block sizes */
- hssize_t coord[NPOINTS][FSPACE_RANK]; /* Array to store selected points
+ hsize_t coord[NPOINTS][FSPACE_RANK]; /* Array to store selected points
from the file dataspace */
herr_t ret;
unsigned i,j;
@@ -171,7 +170,7 @@ main (void)
coord[3][0] = 5; coord[3][1] = 6;
ret = H5Sselect_elements(fid, H5S_SELECT_SET, NPOINTS,
- (const hssize_t **)coord);
+ (const hsize_t **)coord);
/*
* Write new selection of points to the dataset.
diff --git a/examples/h5_write.c b/examples/h5_write.c
index 2c52fa7..8cc4b8f 100644
--- a/examples/h5_write.c
+++ b/examples/h5_write.c
@@ -1,4 +1,3 @@
-
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
diff --git a/examples/ph5example.c b/examples/ph5example.c
index c79d0ee..b2929ab 100644
--- a/examples/ph5example.c
+++ b/examples/ph5example.c
@@ -1,4 +1,3 @@
-
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
@@ -96,10 +95,10 @@ int dowrite=1; /* write test */
int docleanup=1; /* cleanup */
/* Prototypes */
-void slab_set(hssize_t start[], hsize_t count[], hsize_t stride[], int mode);
-void dataset_fill(hssize_t start[], hsize_t count[], hsize_t stride[], DATATYPE * dataset);
-void dataset_print(hssize_t start[], hsize_t count[], hsize_t stride[], DATATYPE * dataset);
-int dataset_vrfy(hssize_t start[], hsize_t count[], hsize_t stride[], DATATYPE *dataset, DATATYPE *original);
+void slab_set(hsize_t start[], hsize_t count[], hsize_t stride[], int mode);
+void dataset_fill(hsize_t start[], hsize_t count[], hsize_t stride[], DATATYPE * dataset);
+void dataset_print(hsize_t start[], hsize_t count[], hsize_t stride[], DATATYPE * dataset);
+int dataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], DATATYPE *dataset, DATATYPE *original);
void phdf5writeInd(char *filename);
void phdf5readInd(char *filename);
void phdf5writeAll(char *filename);
@@ -117,7 +116,7 @@ void cleanup(void);
* Assume dimension rank is 2.
*/
void
-slab_set(hssize_t start[], hsize_t count[], hsize_t stride[], int mode)
+slab_set(hsize_t start[], hsize_t count[], hsize_t stride[], int mode)
{
switch (mode){
case BYROW:
@@ -157,10 +156,10 @@ slab_set(hssize_t start[], hsize_t count[], hsize_t stride[], int mode)
* Assume dimension rank is 2 and data is stored contiguous.
*/
void
-dataset_fill(hssize_t start[], hsize_t count[], hsize_t stride[], DATATYPE * dataset)
+dataset_fill(hsize_t start[], hsize_t count[], hsize_t stride[], DATATYPE * dataset)
{
DATATYPE *dataptr = dataset;
- int i, j;
+ hsize_t i, j;
/* put some trivial data in the data_array */
for (i=0; i < count[0]; i++){
@@ -174,14 +173,14 @@ dataset_fill(hssize_t start[], hsize_t count[], hsize_t stride[], DATATYPE * dat
/*
* Print the content of the dataset.
*/
-void dataset_print(hssize_t start[], hsize_t count[], hsize_t stride[], DATATYPE * dataset)
+void dataset_print(hsize_t start[], hsize_t count[], hsize_t stride[], DATATYPE * dataset)
{
DATATYPE *dataptr = dataset;
- int i, j;
+ hsize_t i, j;
/* print the slab read */
for (i=0; i < count[0]; i++){
- printf("Row %d: ", (int)(i*stride[0]+start[0]));
+ printf("Row %lu: ", (unsigned long)(i*stride[0]+start[0]));
for (j=0; j < count[1]; j++){
printf("%03d ", *dataptr++);
}
@@ -193,11 +192,12 @@ void dataset_print(hssize_t start[], hsize_t count[], hsize_t stride[], DATATYPE
/*
* Print the content of the dataset.
*/
-int dataset_vrfy(hssize_t start[], hsize_t count[], hsize_t stride[], DATATYPE *dataset, DATATYPE *original)
+int dataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], DATATYPE *dataset, DATATYPE *original)
{
#define MAX_ERR_REPORT 10 /* Maximum number of errors reported */
- int i, j, nerr;
+ hsize_t i, j;
+ int nerr;
/* print it if verbose */
if (verbose)
@@ -209,9 +209,9 @@ int dataset_vrfy(hssize_t start[], hsize_t count[], hsize_t stride[], DATATYPE *
if (*dataset++ != *original++){
nerr++;
if (nerr <= MAX_ERR_REPORT){
- printf("Dataset Verify failed at [%d][%d](row %d, col %d): expect %d, got %d\n",
- i, j,
- (int)(i*stride[0]+start[0]), (int)(j*stride[1]+start[1]),
+ 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*stride[0]+start[0]), (unsigned long)(j*stride[1]+start[1]),
*(dataset-1), *(original-1));
}
}
@@ -246,7 +246,7 @@ phdf5writeInd(char *filename)
{SPACE1_DIM1,SPACE1_DIM2}; /* dataspace dim sizes */
DATATYPE data_array1[SPACE1_DIM1][SPACE1_DIM2]; /* data buffer */
- hssize_t start[SPACE1_RANK]; /* for hyperslab setting */
+ hsize_t start[SPACE1_RANK]; /* for hyperslab setting */
hsize_t count[SPACE1_RANK], stride[SPACE1_RANK]; /* for hyperslab setting */
herr_t ret; /* Generic return value */
@@ -311,8 +311,10 @@ phdf5writeInd(char *filename)
stride[0] = 1;
stride[1] =1;
if (verbose)
- printf("start[]=(%d,%d), count[]=(%d,%d), total datapoints=%d\n",
- start[0], start[1], count[0], count[1], count[0]*count[1]);
+ printf("start[]=(%lu,%lu), count[]=(%lu,%lu), total datapoints=%lu\n",
+ (unsigned long)start[0], (unsigned long)start[1],
+ (unsigned long)count[0], (unsigned long)count[1],
+ (unsigned long)(count[0]*count[1]));
/* put some trivial data in the data_array */
dataset_fill(start, count, stride, &data_array1[0][0]);
@@ -373,7 +375,7 @@ phdf5readInd(char *filename)
DATATYPE data_array1[SPACE1_DIM1][SPACE1_DIM2]; /* data buffer */
DATATYPE data_origin1[SPACE1_DIM1][SPACE1_DIM2]; /* expected data buffer */
- hssize_t start[SPACE1_RANK]; /* for hyperslab setting */
+ hsize_t start[SPACE1_RANK]; /* for hyperslab setting */
hsize_t count[SPACE1_RANK], stride[SPACE1_RANK]; /* for hyperslab setting */
herr_t ret; /* Generic return value */
@@ -417,8 +419,10 @@ phdf5readInd(char *filename)
stride[0] = 1;
stride[1] =1;
if (verbose)
- printf("start[]=(%d,%d), count[]=(%d,%d), total datapoints=%d\n",
- start[0], start[1], count[0], count[1], count[0]*count[1]);
+ printf("start[]=(%lu,%lu), count[]=(%lu,%lu), total datapoints=%lu\n",
+ (unsigned long)start[0], (unsigned long)start[1],
+ (unsigned long)count[0], (unsigned long)count[1],
+ (unsigned long)(count[0]*count[1]));
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset1);
@@ -489,7 +493,7 @@ phdf5writeAll(char *filename)
{SPACE1_DIM1,SPACE1_DIM2}; /* dataspace dim sizes */
DATATYPE data_array1[SPACE1_DIM1][SPACE1_DIM2]; /* data buffer */
- hssize_t start[SPACE1_RANK]; /* for hyperslab setting */
+ hsize_t start[SPACE1_RANK]; /* for hyperslab setting */
hsize_t count[SPACE1_RANK], stride[SPACE1_RANK]; /* for hyperslab setting */
herr_t ret; /* Generic return value */
@@ -549,8 +553,10 @@ phdf5writeAll(char *filename)
/* Dataset1: each process takes a block of rows. */
slab_set(start, count, stride, BYROW);
if (verbose)
- printf("start[]=(%d,%d), count[]=(%d,%d), total datapoints=%d\n",
- start[0], start[1], count[0], count[1], count[0]*count[1]);
+ printf("start[]=(%lu,%lu), count[]=(%lu,%lu), total datapoints=%lu\n",
+ (unsigned long)start[0], (unsigned long)start[1],
+ (unsigned long)count[0], (unsigned long)count[1],
+ (unsigned long)(count[0]*count[1]));
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset1);
@@ -596,8 +602,10 @@ if (verbose)
/* Dataset2: each process takes a block of columns. */
slab_set(start, count, stride, BYCOL);
if (verbose)
- printf("start[]=(%d,%d), count[]=(%d,%d), total datapoints=%d\n",
- start[0], start[1], count[0], count[1], count[0]*count[1]);
+ printf("start[]=(%lu,%lu), count[]=(%lu,%lu), total datapoints=%lu\n",
+ (unsigned long)start[0], (unsigned long)start[1],
+ (unsigned long)count[0], (unsigned long)count[1],
+ (unsigned long)(count[0]*count[1]));
/* put some trivial data in the data_array */
dataset_fill(start, count, stride, &data_array1[0][0]);
@@ -685,7 +693,7 @@ phdf5readAll(char *filename)
DATATYPE data_array1[SPACE1_DIM1][SPACE1_DIM2]; /* data buffer */
DATATYPE data_origin1[SPACE1_DIM1][SPACE1_DIM2]; /* expected data buffer */
- hssize_t start[SPACE1_RANK]; /* for hyperslab setting */
+ hsize_t start[SPACE1_RANK]; /* for hyperslab setting */
hsize_t count[SPACE1_RANK], stride[SPACE1_RANK]; /* for hyperslab setting */
herr_t ret; /* Generic return value */
@@ -738,8 +746,10 @@ phdf5readAll(char *filename)
/* Dataset1: each process takes a block of columns. */
slab_set(start, count, stride, BYCOL);
if (verbose)
- printf("start[]=(%d,%d), count[]=(%d,%d), total datapoints=%d\n",
- start[0], start[1], count[0], count[1], count[0]*count[1]);
+ printf("start[]=(%lu,%lu), count[]=(%lu,%lu), total datapoints=%lu\n",
+ (unsigned long)start[0], (unsigned long)start[1],
+ (unsigned long)count[0], (unsigned long)count[1],
+ (unsigned long)(count[0]*count[1]));
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset1);
@@ -789,8 +799,10 @@ if (verbose)
/* Dataset2: each process takes a block of rows. */
slab_set(start, count, stride, BYROW);
if (verbose)
- printf("start[]=(%d,%d), count[]=(%d,%d), total datapoints=%d\n",
- start[0], start[1], count[0], count[1], count[0]*count[1]);
+ printf("start[]=(%lu,%lu), count[]=(%lu,%lu), total datapoints=%lu\n",
+ (unsigned long)start[0], (unsigned long)start[1],
+ (unsigned long)count[0], (unsigned long)count[1],
+ (unsigned long)(count[0]*count[1]));
/* create a file dataspace independently */
file_dataspace = H5Dget_space (dataset1);
@@ -918,7 +930,7 @@ test_split_comm_access(char filenames[][PATH_MAX])
* Show command usage
*/
void
-usage()
+usage(void)
{
printf("Usage: testphdf5 [-f <prefix>] [-r] [-w] [-v]\n");
printf("\t-f\tfile prefix for parallel test files.\n");
@@ -1111,7 +1123,7 @@ finish:
#else /* H5_HAVE_PARALLEL */
/* dummy program since H5_HAVE_PARALLE is not configured in */
int
-main()
+main(void)
{
printf("No PHDF5 example because parallel is not configured in\n");
return(0);
diff --git a/fortran/examples/refregexample.f90 b/fortran/examples/refregexample.f90
index 5367da8..ab0e0fd 100644
--- a/fortran/examples/refregexample.f90
+++ b/fortran/examples/refregexample.f90
@@ -41,13 +41,13 @@
TYPE(hdset_reg_ref_t_f) , DIMENSION(2) :: ref_out !
INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/2,9/) ! Datasets dimensions
INTEGER(HSIZE_T), DIMENSION(1) :: dimsr = (/2/) !
- INTEGER(HSSIZE_T), DIMENSION(2) :: start
+ INTEGER(HSIZE_T), DIMENSION(2) :: start
INTEGER(HSIZE_T), DIMENSION(2) :: count
INTEGER :: rankr = 1
INTEGER :: rank = 2
INTEGER , DIMENSION(2,9) :: data
INTEGER , DIMENSION(2,9) :: data_out = 0
- INTEGER(HSSIZE_T) , DIMENSION(2,3) :: coord
+ INTEGER(HSIZE_T) , DIMENSION(2,3) :: coord
INTEGER(SIZE_T) ::num_points = 3 ! Number of selected points
INTEGER :: i, j
INTEGER(HSIZE_T), DIMENSION(1) :: ref_size
diff --git a/fortran/examples/selectele.f90 b/fortran/examples/selectele.f90
index f476ec5..096bd3f 100644
--- a/fortran/examples/selectele.f90
+++ b/fortran/examples/selectele.f90
@@ -52,7 +52,7 @@
! Memory dataspace dimensions
INTEGER(HSIZE_T), DIMENSION(2) :: dimsf = (/3,4/)
! File dataspace dimensions
- INTEGER(HSSIZE_T), DIMENSION(RANK,NUMP) :: coord ! Elements coordinates
+ INTEGER(HSIZE_T), DIMENSION(RANK,NUMP) :: coord ! Elements coordinates
! in the file
INTEGER, DIMENSION(3,4) :: buf1, buf2, bufnew ! Data buffers
diff --git a/fortran/src/Dependencies b/fortran/src/Dependencies
index dabc30e..f82d56f 100644
--- a/fortran/src/Dependencies
+++ b/fortran/src/Dependencies
@@ -41,8 +41,7 @@ H5f90kit.lo: \
$(srcdir)/H5f90i.h \
$(top_srcdir)/src/H5private.h \
$(top_srcdir)/src/H5MPprivate.h \
- $(srcdir)/H5f90proto.h \
- $(srcdir)/H5Git.h
+ $(srcdir)/H5f90proto.h
H5_f.lo: \
$(srcdir)/H5_f.c \
$(srcdir)/H5f90.h \
@@ -83,47 +82,7 @@ H5_f.lo: \
$(srcdir)/H5f90i.h \
$(top_srcdir)/src/H5private.h \
$(top_srcdir)/src/H5MPprivate.h \
- $(srcdir)/H5f90proto.h \
- $(srcdir)/H5Git.h
-H5Git.lo: \
- $(srcdir)/H5Git.c \
- $(top_srcdir)/src/hdf5.h \
- $(top_srcdir)/src/H5public.h \
- $(top_builddir)/src/H5pubconf.h \
- $(top_srcdir)/src/H5api_adpt.h \
- $(top_srcdir)/src/H5Apublic.h \
- $(top_srcdir)/src/H5Ipublic.h \
- $(top_srcdir)/src/H5ACpublic.h \
- $(top_srcdir)/src/H5Bpublic.h \
- $(top_srcdir)/src/H5Dpublic.h \
- $(top_srcdir)/src/H5Epublic.h \
- $(top_srcdir)/src/H5Fpublic.h \
- $(top_srcdir)/src/H5FDpublic.h \
- $(top_srcdir)/src/H5Gpublic.h \
- $(top_srcdir)/src/H5Opublic.h \
- $(top_srcdir)/src/H5HGpublic.h \
- $(top_srcdir)/src/H5HLpublic.h \
- $(top_srcdir)/src/H5MMpublic.h \
- $(top_srcdir)/src/H5Ppublic.h \
- $(top_srcdir)/src/H5Zpublic.h \
- $(top_srcdir)/src/H5Rpublic.h \
- $(top_srcdir)/src/H5Spublic.h \
- $(top_srcdir)/src/H5Tpublic.h \
- $(top_srcdir)/src/H5FDcore.h \
- $(top_srcdir)/src/H5FDfamily.h \
- $(top_srcdir)/src/H5FDgass.h \
- $(top_srcdir)/src/H5FDlog.h \
- $(top_srcdir)/src/H5FDmpi.h \
- $(top_srcdir)/src/H5FDmpio.h \
- $(top_srcdir)/src/H5FDmpiposix.h \
- $(top_srcdir)/src/H5FDmulti.h \
- $(top_srcdir)/src/H5FDsec2.h \
- $(top_srcdir)/src/H5FDsrb.h \
- $(top_srcdir)/src/H5FDstdio.h \
- $(top_srcdir)/src/H5FDstream.h \
- $(top_srcdir)/src/H5private.h \
- $(top_srcdir)/src/H5MPprivate.h \
- $(srcdir)/H5Git.h
+ $(srcdir)/H5f90proto.h
H5Rf.lo: \
$(srcdir)/H5Rf.c \
$(srcdir)/H5f90.h \
@@ -164,8 +123,7 @@ H5Rf.lo: \
$(srcdir)/H5f90i.h \
$(top_srcdir)/src/H5private.h \
$(top_srcdir)/src/H5MPprivate.h \
- $(srcdir)/H5f90proto.h \
- $(srcdir)/H5Git.h
+ $(srcdir)/H5f90proto.h
H5Ff.lo: \
$(srcdir)/H5Ff.c \
$(srcdir)/H5f90.h \
@@ -207,7 +165,6 @@ H5Ff.lo: \
$(top_srcdir)/src/H5private.h \
$(top_srcdir)/src/H5MPprivate.h \
$(srcdir)/H5f90proto.h \
- $(srcdir)/H5Git.h \
$(top_srcdir)/src/H5Eprivate.h
H5Sf.lo: \
$(srcdir)/H5Sf.c \
@@ -249,8 +206,7 @@ H5Sf.lo: \
$(srcdir)/H5f90i.h \
$(top_srcdir)/src/H5private.h \
$(top_srcdir)/src/H5MPprivate.h \
- $(srcdir)/H5f90proto.h \
- $(srcdir)/H5Git.h
+ $(srcdir)/H5f90proto.h
H5Df.lo: \
$(srcdir)/H5Df.c \
$(srcdir)/H5f90.h \
@@ -291,8 +247,7 @@ H5Df.lo: \
$(srcdir)/H5f90i.h \
$(top_srcdir)/src/H5private.h \
$(top_srcdir)/src/H5MPprivate.h \
- $(srcdir)/H5f90proto.h \
- $(srcdir)/H5Git.h
+ $(srcdir)/H5f90proto.h
H5Gf.lo: \
$(srcdir)/H5Gf.c \
$(srcdir)/H5f90.h \
@@ -333,8 +288,7 @@ H5Gf.lo: \
$(srcdir)/H5f90i.h \
$(top_srcdir)/src/H5private.h \
$(top_srcdir)/src/H5MPprivate.h \
- $(srcdir)/H5f90proto.h \
- $(srcdir)/H5Git.h
+ $(srcdir)/H5f90proto.h
H5Af.lo: \
$(srcdir)/H5Af.c \
$(srcdir)/H5f90.h \
@@ -375,8 +329,7 @@ H5Af.lo: \
$(srcdir)/H5f90i.h \
$(top_srcdir)/src/H5private.h \
$(top_srcdir)/src/H5MPprivate.h \
- $(srcdir)/H5f90proto.h \
- $(srcdir)/H5Git.h
+ $(srcdir)/H5f90proto.h
H5Tf.lo: \
$(srcdir)/H5Tf.c \
$(srcdir)/H5f90.h \
@@ -417,8 +370,7 @@ H5Tf.lo: \
$(srcdir)/H5f90i.h \
$(top_srcdir)/src/H5private.h \
$(top_srcdir)/src/H5MPprivate.h \
- $(srcdir)/H5f90proto.h \
- $(srcdir)/H5Git.h
+ $(srcdir)/H5f90proto.h
H5Pf.lo: \
$(srcdir)/H5Pf.c \
$(srcdir)/H5f90.h \
@@ -459,8 +411,7 @@ H5Pf.lo: \
$(srcdir)/H5f90i.h \
$(top_srcdir)/src/H5private.h \
$(top_srcdir)/src/H5MPprivate.h \
- $(srcdir)/H5f90proto.h \
- $(srcdir)/H5Git.h
+ $(srcdir)/H5f90proto.h
H5If.lo: \
$(srcdir)/H5If.c \
$(srcdir)/H5f90.h \
@@ -502,7 +453,6 @@ H5If.lo: \
$(top_srcdir)/src/H5private.h \
$(top_srcdir)/src/H5MPprivate.h \
$(srcdir)/H5f90proto.h \
- $(srcdir)/H5Git.h \
$(top_srcdir)/src/H5Eprivate.h
H5Ef.lo: \
$(srcdir)/H5Ef.c \
@@ -544,8 +494,7 @@ H5Ef.lo: \
$(srcdir)/H5f90i.h \
$(top_srcdir)/src/H5private.h \
$(top_srcdir)/src/H5MPprivate.h \
- $(srcdir)/H5f90proto.h \
- $(srcdir)/H5Git.h
+ $(srcdir)/H5f90proto.h
H5Zf.lo: \
$(srcdir)/H5Zf.c \
$(srcdir)/H5f90.h \
@@ -586,5 +535,4 @@ H5Zf.lo: \
$(srcdir)/H5f90i.h \
$(top_srcdir)/src/H5private.h \
$(top_srcdir)/src/H5MPprivate.h \
- $(srcdir)/H5f90proto.h \
- $(srcdir)/H5Git.h
+ $(srcdir)/H5f90proto.h
diff --git a/fortran/src/H5Af.c b/fortran/src/H5Af.c
index c8422a7..7662d8b 100644
--- a/fortran/src/H5Af.c
+++ b/fortran/src/H5Af.c
@@ -15,6 +15,7 @@
/* This files contains C stubs for H5A Fortran APIs */
#include "H5f90.h"
+#include "H5Eprivate.h"
/*----------------------------------------------------------------------------
* Name: h5acreate_c
@@ -32,47 +33,26 @@
* Modifications:
*---------------------------------------------------------------------------*/
int_f
-nh5acreate_c (hid_t_f *obj_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *crt_prp, hid_t_f *attr_id)
+nh5acreate_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *crt_prp, hid_t_f *attr_id)
{
- int ret_value = -1;
- char *c_name;
- int c_namelen;
- hid_t c_obj_id;
- hid_t c_type_id;
- hid_t c_space_id;
- hid_t c_attr_id;
- hid_t c_crt_prp;
- /*
- * Define creation property
- */
- c_crt_prp = (hid_t)*crt_prp;
-/*
- if ( H5P_DEFAULT_F == c_crt_prp ) c_crt_prp = H5P_DEFAULT;
-*/
+ char *c_name=NULL; /* Buffer to hold C string */
+ int_f ret_value=0; /* Return value */
/*
* Convert FORTRAN name to C name
*/
- c_namelen = *namelen;
- c_name = (char *)HD5f2cstring(name, c_namelen);
- if (c_name == NULL) return ret_value;
+ if ((c_name = HD5f2cstring(name, (size_t)*namelen)) == NULL)
+ HGOTO_DONE(FAIL);
/*
* Call H5Acreate function.
*/
- c_obj_id = *obj_id;
- c_type_id = *type_id;
- c_space_id = *space_id;
- c_attr_id = H5Acreate(c_obj_id, c_name, c_type_id, c_space_id, c_crt_prp);
-
+ if((*attr_id = (hid_t_f)H5Acreate((hid_t)*obj_id, c_name, (hid_t)*type_id, (hid_t)*space_id, (hid_t)*crt_prp))<0)
+ HGOTO_DONE(FAIL);
- if (c_attr_id < 0) goto DONE;
- *attr_id = (hid_t_f)c_attr_id;
- ret_value = 0;
-
-DONE:
- HDfree(c_name);
- return ret_value;
+done:
+ if(c_name) HDfree(c_name);
+ return ret_value;
}
/*----------------------------------------------------------------------------
@@ -88,39 +68,31 @@ DONE:
* Modifications:
*---------------------------------------------------------------------------*/
int_f
-nh5aopen_name_c (hid_t_f *obj_id, _fcd name, int_f *namelen, hid_t_f *attr_id)
+nh5aopen_name_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *attr_id)
{
- int ret_value = -1;
- char *c_name;
- int c_namelen;
- hid_t c_obj_id;
- hid_t c_attr_id;
+ char *c_name=NULL; /* Buffer to hold C string */
+ int_f ret_value=0; /* Return value */
/*
* Convert FORTRAN name to C name
*/
- c_namelen = *namelen;
- c_name = (char *)HD5f2cstring(name, c_namelen);
- if (c_name == NULL) return ret_value;
+ if ((c_name = HD5f2cstring(name, (size_t)*namelen)) == NULL)
+ HGOTO_DONE(FAIL);
+
/*
* Call H5Aopen function.
*/
- c_obj_id = *obj_id;
- c_attr_id = H5Aopen_name(c_obj_id, c_name);
+ if ((*attr_id = (hid_t_f)H5Aopen_name((hid_t)*obj_id, c_name)) < 0)
+ HGOTO_DONE(FAIL);
- if (c_attr_id < 0) goto DONE;
- *attr_id = (hid_t_f)c_attr_id;
- ret_value = 0;
-
-DONE:
- HDfree(c_name);
- return ret_value;
+done:
+ if(c_name) HDfree(c_name);
+ return ret_value;
}
-
/*----------------------------------------------------------------------------
* Name: h5awritec_c
- * Purpose: Call h5awrite_c_b to write a character attribute
+ * Purpose: Call h5awrite_c to write a character attribute
* Inputs: attr_id - dataset identifier
* mem_type_id - memory datatype identifier
* buf - character data buffer
@@ -131,16 +103,12 @@ DONE:
* Tuesday, May 14, 2002
*---------------------------------------------------------------------------*/
int_f
-nh5awritec_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, hsize_t_f *dims)
+nh5awritec_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims)
{
- int ret_value = -1;
-
/*
* Call h5awrite_c function.
*/
- ret_value = nh5awrite_c(attr_id, mem_type_id, _fcdtocp(buf), dims);
-
- return ret_value;
+ return nh5awrite_c(attr_id, mem_type_id, _fcdtocp(buf), dims);
}
/*----------------------------------------------------------------------------
@@ -156,30 +124,23 @@ nh5awritec_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, hsize_t_f *dims)
* Tuesday, May 14, 2002
*---------------------------------------------------------------------------*/
int_f
-nh5awrite_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, hsize_t_f *dims)
+nh5awrite_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED *dims)
{
- int ret_value = -1;
- herr_t ret;
- hid_t c_attr_id;
- hid_t c_mem_type_id;
+ int_f ret_value=0; /* Return value */
/*
* Call H5Awrite function.
*/
- c_attr_id = *attr_id;
- c_mem_type_id = *mem_type_id;
- ret = H5Awrite(c_attr_id, c_mem_type_id, buf);
+ if (H5Awrite((hid_t)*attr_id, (hid_t)*mem_type_id, buf) < 0)
+ HGOTO_DONE(FAIL);
- if (ret < 0) return ret_value;
- ret_value = 0;
+done:
return ret_value;
}
-
-
/*----------------------------------------------------------------------------
* Name: h5areadc_c
- * Purpose: Call h5aread_c_b to read character attribute
+ * Purpose: Call h5aread_c to read character attribute
* Inputs: dset_id - dataset identifier
* mem_type_id - memory datatype identifier
* dims - array to store dimensions sizes of buf; used only
@@ -190,16 +151,12 @@ nh5awrite_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, hsize_t_f *dims)
* Tuesday, May 14, 2002
*---------------------------------------------------------------------------*/
int_f
-nh5areadc_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, hsize_t_f *dims)
+nh5areadc_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims)
{
- int ret_value = -1;
-
/*
* Call h5aread_c function.
*/
- ret_value = nh5aread_c(attr_id, mem_type_id, (_fcdtocp(buf)), dims);
-
- return ret_value;
+ return nh5aread_c(attr_id, mem_type_id, _fcdtocp(buf), dims);
}
/*----------------------------------------------------------------------------
@@ -215,26 +172,20 @@ nh5areadc_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, hsize_t_f *dims)
* Tuesday, May 14, 2002
*---------------------------------------------------------------------------*/
int_f
-nh5aread_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, hsize_t_f *dims)
+nh5aread_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void UNUSED * dims)
{
- int ret_value = -1;
- herr_t ret;
- hid_t c_attr_id;
- hid_t c_mem_type_id;
+ int_f ret_value=0; /* Return value */
/*
* Call H5Aread function.
*/
- c_attr_id = *attr_id;
- c_mem_type_id = *mem_type_id;
- ret = H5Aread(c_attr_id, c_mem_type_id, buf);
+ if (H5Aread((hid_t)*attr_id, (hid_t)*mem_type_id, buf) < 0)
+ HGOTO_DONE(FAIL);
- if (ret < 0) return ret_value;
- ret_value = 0;
+done:
return ret_value;
}
-
/*----------------------------------------------------------------------------
* Name: h5aclose_c
* Purpose: Call H5Aclose to close an attribute
@@ -248,11 +199,13 @@ nh5aread_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, hsize_t_f *dims)
int_f
nh5aclose_c ( hid_t_f *attr_id )
{
- int ret_value = 0;
- hid_t c_attr_id;
- c_attr_id = *attr_id;
- if ( H5Aclose(c_attr_id) < 0 ) ret_value = -1;
- return ret_value;
+ int_f ret_value=0; /* Return value */
+
+ if (H5Aclose((hid_t)*attr_id) < 0)
+ HGOTO_DONE(FAIL);
+
+done:
+ return ret_value;
}
/*----------------------------------------------------------------------------
@@ -267,33 +220,26 @@ nh5aclose_c ( hid_t_f *attr_id )
* Modifications:
*---------------------------------------------------------------------------*/
int_f
-nh5adelete_c (hid_t_f *obj_id, _fcd name, int_f *namelen)
+nh5adelete_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen)
{
- int ret_value = -1;
- herr_t status;
- hid_t c_obj_id;
- char *c_name;
- int c_namelen;
+ char *c_name=NULL; /* Buffer to hold C string */
+ int_f ret_value=0; /* Return value */
/*
* Convert FORTRAN name to C name
*/
- c_namelen = *namelen;
- c_name = (char *)HD5f2cstring(name, c_namelen);
- if (c_name == NULL) return ret_value;
+ if ((c_name = HD5f2cstring(name, (size_t)*namelen)) == NULL)
+ HGOTO_DONE(FAIL);
/*
* Call H5Adelete function.
*/
- c_obj_id = *obj_id;
- status = H5Adelete(c_obj_id, c_name);
-
- if (status < 0) goto DONE;
- ret_value = 0;
+ if (H5Adelete((hid_t)*obj_id, c_name) < 0)
+ HGOTO_DONE(FAIL);
-DONE:
- HDfree(c_name);
- return ret_value;
+done:
+ if(c_name) HDfree(c_name);
+ return ret_value;
}
@@ -311,21 +257,15 @@ DONE:
int_f
nh5aopen_idx_c (hid_t_f *obj_id, int_f *idx, hid_t_f *attr_id)
{
- int ret_value = -1;
- hid_t c_obj_id;
- hid_t c_attr_id;
- unsigned c_idx;
- c_idx = (unsigned)*idx;
+ int_f ret_value=0; /* Return value */
/*
* Call H5Aopen_idx function.
*/
- c_obj_id = *obj_id;
- c_attr_id = H5Aopen_idx(c_obj_id, c_idx);
+ if ((*attr_id = (hid_t_f)H5Aopen_idx((hid_t)*obj_id, (unsigned)*idx)) < 0)
+ HGOTO_DONE(FAIL);
- if (c_attr_id < 0) return ret_value;
- *attr_id = (hid_t_f)c_attr_id;
- ret_value = 0;
+done:
return ret_value;
}
@@ -343,19 +283,15 @@ nh5aopen_idx_c (hid_t_f *obj_id, int_f *idx, hid_t_f *attr_id)
int_f
nh5aget_space_c (hid_t_f *attr_id, hid_t_f *space_id)
{
- int ret_value = -1;
- hid_t c_attr_id;
- hid_t c_space_id;
+ int_f ret_value=0; /* Return value */
/*
* Call H5Aget_space function.
*/
- c_attr_id = *attr_id;
- c_space_id = H5Aget_space(c_attr_id);
+ if ((*space_id = (hid_t_f)H5Aget_space((hid_t)*attr_id)) < 0)
+ HGOTO_DONE(FAIL);
- if (c_space_id < 0) return ret_value;
- *space_id = (hid_t_f)c_space_id;
- ret_value = 0;
+done:
return ret_value;
}
@@ -372,19 +308,15 @@ nh5aget_space_c (hid_t_f *attr_id, hid_t_f *space_id)
int_f
nh5aget_type_c (hid_t_f *attr_id, hid_t_f *type_id)
{
- int ret_value = -1;
- hid_t c_attr_id;
- hid_t c_type_id;
+ int_f ret_value=0; /* Return value */
/*
* Call H5Aget_type function.
*/
- c_attr_id = *attr_id;
- c_type_id = H5Aget_type(c_attr_id);
+ if ((*type_id = (hid_t_f)H5Aget_type((hid_t)*attr_id)) < 0)
+ HGOTO_DONE(FAIL);
- if (c_type_id < 0) return ret_value;
- *type_id = (hid_t_f)c_type_id;
- ret_value = 0;
+done:
return ret_value;
}
@@ -402,23 +334,18 @@ nh5aget_type_c (hid_t_f *attr_id, hid_t_f *type_id)
int_f
nh5aget_num_attrs_c (hid_t_f *obj_id, int_f *attr_num)
{
- int ret_value = -1;
- hid_t c_obj_id;
- int c_attr_num;
+ int_f ret_value=0; /* Return value */
/*
* Call H5Aget_num_attrs function.
*/
- c_obj_id = *obj_id;
- c_attr_num = H5Aget_num_attrs(c_obj_id);
+ if ((*attr_num = (int_f)H5Aget_num_attrs((hid_t)*obj_id)) < 0)
+ HGOTO_DONE(FAIL);
- if (c_attr_num < 0) return ret_value;
- *attr_num = c_attr_num;
- ret_value = 0;
+done:
return ret_value;
}
-
/*----------------------------------------------------------------------------
* Name: h5aget_name_c
* Purpose: Call H5Aget_name to get attribute's name
@@ -433,33 +360,27 @@ nh5aget_num_attrs_c (hid_t_f *obj_id, int_f *attr_num)
int_f
nh5aget_name_c(hid_t_f *attr_id, size_t_f *bufsize, _fcd buf)
{
- int ret_value = -1;
- hid_t c_attr_id;
- ssize_t c_size;
- size_t c_bufsize;
- char *c_buf =NULL;
+ char *c_buf=NULL; /* Buffer to hold C string */
+ int_f ret_value=0; /* Return value */
/*
* Allocate buffer to hold name of an attribute
*/
- c_bufsize = *bufsize;
- c_buf = (char *)HDmalloc((int)c_bufsize +1);
- if (c_buf == NULL) return ret_value;
+ if ((c_buf = HDmalloc((size_t)*bufsize +1)) == NULL)
+ HGOTO_DONE(FAIL);
/*
* Call H5Aget_name function
*/
- c_attr_id = *attr_id;
- c_size = H5Aget_name(c_attr_id, c_bufsize, c_buf);
- if (c_size < 0) goto DONE;
+ if ((ret_value = (int_f)H5Aget_name((hid_t)*attr_id, (size_t)*bufsize, c_buf)) < 0)
+ HGOTO_DONE(FAIL);
/*
* Convert C name to FORTRAN and place it in the given buffer
*/
- HD5packFstring(c_buf, _fcdtocp(buf), (int)c_bufsize);
- ret_value = (int_f)c_size;
+ HD5packFstring(c_buf, _fcdtocp(buf), (size_t)*bufsize);
-DONE:
- HDfree(c_buf);
+done:
+ if(c_buf) HDfree(c_buf);
return ret_value;
}
diff --git a/fortran/src/H5Aff.f90 b/fortran/src/H5Aff.f90
index 50a6d9e..56d5782 100644
--- a/fortran/src/H5Aff.f90
+++ b/fortran/src/H5Aff.f90
@@ -51,7 +51,7 @@
MODULE PROCEDURE h5awrite_real_5
MODULE PROCEDURE h5awrite_real_6
MODULE PROCEDURE h5awrite_real_7
-! Comment if on T3E
+! Comment if on Crays
MODULE PROCEDURE h5awrite_double_scalar
MODULE PROCEDURE h5awrite_double_1
MODULE PROCEDURE h5awrite_double_2
@@ -60,7 +60,8 @@
MODULE PROCEDURE h5awrite_double_5
MODULE PROCEDURE h5awrite_double_6
MODULE PROCEDURE h5awrite_double_7
-! End commnet if on T3E
+! End commnet if on Crays
+
END INTERFACE
@@ -90,7 +91,7 @@
MODULE PROCEDURE h5aread_real_5
MODULE PROCEDURE h5aread_real_6
MODULE PROCEDURE h5aread_real_7
-! Comment if on T3E
+! Comment if on Crays
MODULE PROCEDURE h5aread_double_scalar
MODULE PROCEDURE h5aread_double_1
MODULE PROCEDURE h5aread_double_2
@@ -99,7 +100,7 @@
MODULE PROCEDURE h5aread_double_5
MODULE PROCEDURE h5aread_double_6
MODULE PROCEDURE h5aread_double_7
-! End commnet if on T3E
+! End commnet if on Crays
!
END INTERFACE
@@ -153,7 +154,7 @@
! Attribute creation property
! list identifier
INTEGER :: creation_prp_default
- INTEGER :: namelen
+ INTEGER(SIZE_T) :: namelen
! INTEGER, EXTERNAL :: h5acreate_c
! MS FORTRAN needs explicit interface for C functions called here.
!
@@ -167,7 +168,7 @@
!DEC$ATTRIBUTES reference :: name
INTEGER(HID_T), INTENT(IN) :: obj_id
CHARACTER(LEN=*), INTENT(IN) :: name
- INTEGER :: namelen
+ INTEGER(SIZE_T) :: namelen
INTEGER(HID_T), INTENT(IN) :: type_id
INTEGER(HID_T), INTENT(IN) :: space_id
INTEGER :: creation_prp_default
@@ -219,7 +220,7 @@
CHARACTER(LEN=*), INTENT(IN) :: name ! Attribute name
INTEGER(HID_T), INTENT(OUT) :: attr_id ! Attribute identifier
INTEGER, INTENT(OUT) :: hdferr ! Error code
- INTEGER :: namelen
+ INTEGER(SIZE_T) :: namelen
! INTEGER, EXTERNAL :: h5aopen_name_c
! MS FORTRAN needs explicit interface for C functions called here.
@@ -233,7 +234,7 @@
!DEC$ATTRIBUTES reference :: name
INTEGER(HID_T), INTENT(IN) :: obj_id
CHARACTER(LEN=*), INTENT(IN) :: name
- INTEGER :: namelen
+ INTEGER(SIZE_T) :: namelen
INTEGER(HID_T), INTENT(OUT) :: attr_id
END FUNCTION h5aopen_name_c
END INTERFACE
@@ -308,7 +309,7 @@
INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier
INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype
! identifier (in memory)
- INTEGER(HSIZE_T), DIMENSION(*) :: dims ! Array to story buf dimension sizes
+ INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes
INTEGER, INTENT(IN) :: buf ! Attribute data
INTEGER, INTENT(OUT) :: hdferr ! Error code
@@ -321,7 +322,7 @@
!DEC$ IF DEFINED(HDF5F90_WINDOWS)
!MS$ATTRIBUTES C,reference,alias:'_H5AWRITE_C'::h5awrite_c
!DEC$ ENDIF
- INTEGER(HSIZE_T), DIMENSION(*) :: dims ! Array to story buf dimension sizes
+ INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes
INTEGER(HID_T), INTENT(IN) :: attr_id
INTEGER(HID_T), INTENT(IN) :: memtype_id
INTEGER, INTENT(IN)::buf
@@ -340,7 +341,7 @@
INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier
INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype
! identifier (in memory)
- INTEGER(HSIZE_T), DIMENSION(*) :: dims ! Array to story buf dimension sizes
+ INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes
INTEGER, INTENT(IN) , &
DIMENSION(dims(1)) :: buf
! Attribute data
@@ -355,7 +356,7 @@
!DEC$ IF DEFINED(HDF5F90_WINDOWS)
!MS$ATTRIBUTES C,reference,alias:'_H5AWRITE_C'::h5awrite_c
!DEC$ ENDIF
- INTEGER(HSIZE_T), DIMENSION(*) :: dims ! Array to story buf dimension sizes
+ INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes
INTEGER(HID_T), INTENT(IN) :: attr_id
INTEGER(HID_T), INTENT(IN) :: memtype_id
INTEGER, INTENT(IN), &
@@ -376,7 +377,7 @@
INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier
INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype
! identifier (in memory)
- INTEGER(HSIZE_T), DIMENSION(*) :: dims ! Array to story buf dimension sizes
+ INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes
INTEGER, INTENT(IN) , &
DIMENSION(dims(1),dims(2)) :: buf
! Attribute data
@@ -391,7 +392,7 @@
!DEC$ IF DEFINED(HDF5F90_WINDOWS)
!MS$ATTRIBUTES C,reference,alias:'_H5AWRITE_C'::h5awrite_c
!DEC$ ENDIF
- INTEGER(HSIZE_T), DIMENSION(*) :: dims ! Array to story buf dimension sizes
+ INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes
INTEGER(HID_T), INTENT(IN) :: attr_id
INTEGER(HID_T), INTENT(IN) :: memtype_id
INTEGER, INTENT(IN), &
@@ -412,7 +413,7 @@
INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier
INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype
! identifier (in memory)
- INTEGER(HSIZE_T), DIMENSION(*) :: dims ! Array to story buf dimension sizes
+ INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes
INTEGER, INTENT(IN) , &
DIMENSION(dims(1),dims(2),dims(3)) :: buf
! Attribute data
@@ -427,7 +428,7 @@
!DEC$ IF DEFINED(HDF5F90_WINDOWS)
!MS$ATTRIBUTES C,reference,alias:'_H5AWRITE_C'::h5awrite_c
!DEC$ ENDIF
- INTEGER(HSIZE_T), DIMENSION(*) :: dims ! Array to story buf dimension sizes
+ INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes
INTEGER(HID_T), INTENT(IN) :: attr_id
INTEGER(HID_T), INTENT(IN) :: memtype_id
INTEGER, INTENT(IN), &
@@ -448,7 +449,7 @@
INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier
INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype
! identifier (in memory)
- INTEGER(HSIZE_T), DIMENSION(*) :: dims ! Array to story buf dimension sizes
+ INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes
INTEGER, INTENT(IN), &
DIMENSION(dims(1),dims(2),dims(3),dims(4)) :: buf
! Attribute data
@@ -463,7 +464,7 @@
!DEC$ IF DEFINED(HDF5F90_WINDOWS)
!MS$ATTRIBUTES C,reference,alias:'_H5AWRITE_C'::h5awrite_c
!DEC$ ENDIF
- INTEGER(HSIZE_T), DIMENSION(*) :: dims ! Array to story buf dimension sizes
+ INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes
INTEGER(HID_T), INTENT(IN) :: attr_id
INTEGER(HID_T), INTENT(IN) :: memtype_id
INTEGER, INTENT(IN), &
@@ -484,7 +485,7 @@
INTEGER(HID_T), INTENT(IN) :: attr_id ! Attribute identifier
INTEGER(HID_T), INTENT(IN) :: memtype_id ! Attribute datatype
! identifier (in memory)
- INTEGER(HSIZE_T), DIMENSION(*) :: dims ! Array to story buf dimension sizes
+ INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes
INTEGER, INTENT(IN), &
DIMENSION(dims(1),dims(2),dims(3),dims(4),dims(5)) :: buf
! Attribute data
@@ -499,7 +500,7 @@
!DEC$ IF DEFINED(HDF5F90_WINDOWS)
!MS$ATTRIBUTES C,reference,alias:'_H5AWRITE_C'::h5awrite_c
!DEC$ ENDIF
- INTEGER(HSIZE_T), DIMENSION(*) :: dims ! Array to story buf dimension sizes
+ INTEGER(HSIZE_T), INTENT(IN), DIMENSION(*) :: dims ! Array to story buf dimension sizes
INTEGER(HID_T), INTENT(IN) :: attr_id
INTEGER(HID_T), INTENT(IN) :: memtype_id
INTEGER, INTENT(IN), &
@@ -2314,6 +2315,7 @@
hdferr = h5aread_c(attr_id, memtype_id, buf, dims)
END SUBROUTINE h5aread_double_7
+
SUBROUTINE h5aread_char_scalar(attr_id, memtype_id, buf, dims, hdferr)
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
@@ -2348,7 +2350,6 @@
hdferr = h5areadc_c(attr_id, memtype_id, buf, dims)
END SUBROUTINE h5aread_char_scalar
-
SUBROUTINE h5aread_char_1(attr_id, memtype_id, buf, dims, hdferr)
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
@@ -2607,6 +2608,7 @@
hdferr = h5areadc_c(attr_id, memtype_id, buf, dims)
END SUBROUTINE h5aread_char_7
+
!----------------------------------------------------------------------
! Name: h5aget_space_f
!
@@ -2858,7 +2860,7 @@
INTEGER(HID_T), INTENT(IN) :: obj_id ! Object identifier
CHARACTER(LEN=*), INTENT(IN) :: name ! Attribute name
INTEGER, INTENT(OUT) :: hdferr ! Error code
- INTEGER :: namelen
+ INTEGER(SIZE_T) :: namelen
! INTEGER, EXTERNAL :: h5adelete_c
! MS FORTRAN needs explicit interface for C functions called here.
@@ -2872,7 +2874,7 @@
!DEC$ATTRIBUTES reference :: name
INTEGER(HID_T), INTENT(IN) :: obj_id
CHARACTER(LEN=*), INTENT(IN) :: name
- INTEGER :: namelen
+ INTEGER(SIZE_T) :: namelen
END FUNCTION h5adelete_c
END INTERFACE
diff --git a/fortran/src/H5Df.c b/fortran/src/H5Df.c
index 5ac7d60..b7f01f0 100644
--- a/fortran/src/H5Df.c
+++ b/fortran/src/H5Df.c
@@ -126,6 +126,8 @@ DONE:
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Tuesday, May 14, 2002
+ * Modifications: This function is added to accomodate oveloaded h5dwrite_f
+ * with the dims argument being of INTEGER(HSIZE_T) type
*---------------------------------------------------------------------------*/
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)
@@ -152,6 +154,8 @@ nh5dwritec_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Tuesday, May 14, 2002
+ * Modifications: This function is added to accomodate oveloaded h5dwrite_f
+ * with the dims argument being of INTEGER(HSIZE_T) type
*---------------------------------------------------------------------------*/
int_f
nh5dwrite_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, void *buf, hsize_t_f *dims)
@@ -197,6 +201,8 @@ nh5dwrite_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_
* Returns: 0 on success,e-1 on failure
* Programmer: Elena Pourmal
* Tuesday, May 14, 2002
+ * Modifications: This function was added to accomodate h5dwrite_f with the
+ * dims argumnet being of INTEGER(HSIZE_T) type.
*---------------------------------------------------------------------------*/
int_f
nh5dwrite_ref_obj_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)
@@ -208,7 +214,7 @@ nh5dwrite_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_
hid_t c_mem_space_id;
hid_t c_file_space_id;
hid_t c_xfer_prp;
- hobj_ref_t *buf_c = NULL;
+ hobj_ref_t *buf_c;
int i, n;
n = (int)*dims;
@@ -256,6 +262,8 @@ nh5dwrite_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Tuesday, May 14, 2002
+ * Modifications: This function was added to accomodate h5dwrite_f with the
+ * dims argument being of INTEGER(HSIZE_T) type
*---------------------------------------------------------------------------*/
int_f
nh5dwrite_ref_reg_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)
@@ -317,6 +325,8 @@ nh5dwrite_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, May 15, 2002
+ * Modifications: This function was added to accomodate h5dread_f subroutine
+ * with the dims parameter being of INTEGER(HSIZE_T_F) size.
*---------------------------------------------------------------------------*/
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)
@@ -343,6 +353,8 @@ nh5dreadc_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, May 15, 2002
+ * Modifications: This function was added to accomodate h5dread_f subroutine
+ * with the dims parameter being of INTEGER(HSIZE_T_F) size.
*---------------------------------------------------------------------------*/
int_f
nh5dread_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, void *buf, hsize_t_f *dims)
@@ -376,6 +388,7 @@ 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
* mem_type_id - memory datatype identifier
* mem_space_id - memory dataspace identifier
@@ -386,6 +399,8 @@ nh5dread_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_id, hid_t
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, May 15, 2002
+ * Modifications: This function was added to accomodate h5dread_f subroutine
+ * with the dims parameter being of INTEGER(HSIZE_T_F) size.
*---------------------------------------------------------------------------*/
int_f
nh5dread_ref_obj_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)
@@ -408,23 +423,23 @@ nh5dread_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i
/*
* Allocate temporary buffer.
*/
- buf_c = (hobj_ref_t*)HDmalloc(sizeof(hobj_ref_t)*(n));
+ buf_c = (hobj_ref_t*)HDmalloc(sizeof(hobj_ref_t)*(size_t)n);
if ( buf_c != NULL ) {
- /*
- * Call H5Dread function.
- */
- 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;
- c_file_space_id = (hid_t)*file_space_id;
- ret = H5Dread(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, buf_c);
- if (ret >=0) {
- for (i = 0; i < n; i++) {
- HDmemcpy(buf, &buf_c[i], H5R_OBJ_REF_BUF_SIZE);
- buf = buf + REF_OBJ_BUF_LEN_F;
- }
- }
- if ( buf_c != NULL ) HDfree(buf_c);
+ /*
+ * Call H5Dread function.
+ */
+ 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;
+ c_file_space_id = (hid_t)*file_space_id;
+ ret = H5Dread(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, buf_c);
+ if (ret >=0) {
+ for (i = 0; i < n; i++) {
+ HDmemcpy(buf, &buf_c[i], H5R_OBJ_REF_BUF_SIZE);
+ buf = buf + REF_OBJ_BUF_LEN_F;
+ }
+ }
+ if ( buf_c != NULL ) HDfree(buf_c);
}
if (ret < 0) return ret_value;
ret_value = 0;
@@ -444,6 +459,8 @@ nh5dread_ref_obj_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i
* Returns: 0 on success, -1 on failure
* Programmer: Elena Pourmal
* Wednesday, May 15, 2002
+ * Modifications: This function was added to accomodate h5dread_f subroutine
+ * with the dims parameter being of INTEGER(HSIZE_T_F) size.
*---------------------------------------------------------------------------*/
int_f
nh5dread_ref_reg_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)
@@ -466,23 +483,23 @@ nh5dread_ref_reg_c (hid_t_f *dset_id, hid_t_f *mem_type_id, hid_t_f *mem_space_i
/*
* Allocate temporary buffer.
*/
- buf_c = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t)*(n));
+ buf_c = (hdset_reg_ref_t *)HDmalloc(sizeof(hdset_reg_ref_t)*(size_t)n);
if ( buf_c != NULL ) {
- /*
- * Call H5Dread function.
- */
- 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;
- c_file_space_id = (hid_t)*file_space_id;
- ret = H5Dread(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, buf_c);
- if (ret >=0) {
- 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);
+ /*
+ * Call H5Dread function.
+ */
+ 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;
+ c_file_space_id = (hid_t)*file_space_id;
+ ret = H5Dread(c_dset_id, c_mem_type_id, c_mem_space_id, c_file_space_id, c_xfer_prp, buf_c);
+ if (ret >=0) {
+ 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;
@@ -700,7 +717,7 @@ nh5dvlen_get_max_len_c ( hid_t_f *dset_id , hid_t_f *type_id, hid_t_f *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)*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;
@@ -749,7 +766,7 @@ nh5dwrite_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_
size_t max_len;
hvl_t *c_buf;
- int i;
+ hsize_t i;
hsize_t num_elem;
max_len = (size_t)dims[0];
@@ -761,7 +778,7 @@ 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(num_elem * sizeof(hvl_t));
+ c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t));
if (c_buf == NULL) return ret_value;
tmp = (int *)buf;
for (i=0; i < num_elem; i++) {
@@ -826,7 +843,7 @@ nh5dread_vl_integer_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_s
num_elem = H5Sget_select_npoints(c_mem_space_id);
if(num_elem != dims[1]) return ret_value;
- c_buf = (hvl_t *)malloc(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.
@@ -876,7 +893,7 @@ nh5dwrite_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_sp
size_t max_len;
char **c_buf;
- int i;
+ hsize_t i;
hsize_t num_elem;
max_len = (size_t)dims[0];
@@ -891,11 +908,11 @@ 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(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 */
- tmp = (char *)HD5f2cstring(buf, max_len*num_elem);
+ tmp = (char *)HD5f2cstring(buf, (int)(max_len*num_elem));
if (tmp == NULL) { free(c_buf);
return ret_value;
}
@@ -904,8 +921,8 @@ nh5dwrite_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_sp
*/
tmp_p = tmp;
for (i=0; i < num_elem; i++) {
- c_buf[i] = (char *) malloc(len[i]+1);
- memcpy(c_buf[i], tmp_p, len[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';
tmp_p = tmp_p + max_len;
}
@@ -955,7 +972,7 @@ nh5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa
size_t max_len;
char **c_buf;
- int i;
+ hsize_t i;
hsize_t num_elem;
max_len = (size_t)dims[0];
@@ -970,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(num_elem * sizeof(char *));
+ c_buf = (char **)malloc((size_t)num_elem * sizeof(char *));
if (c_buf == NULL) return ret_value;
/*
@@ -981,7 +998,7 @@ nh5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa
return ret_value;
}
/* Copy data to long C string */
- tmp = (char *)malloc(max_len*num_elem +1);
+ tmp = (char *)malloc((size_t)(max_len*num_elem) +1);
tmp_p = tmp;
for (i=0; i<max_len*num_elem; i++) tmp[i] = ' ';
tmp[max_len*num_elem] = '\0';
@@ -990,7 +1007,7 @@ nh5dread_vl_string_c( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa
len[i] = (size_t_f)strlen(c_buf[i]);
tmp_p = tmp_p + max_len;
}
- HD5packFstring(tmp, _fcdtocp(buf), max_len*num_elem);
+ HD5packFstring(tmp, _fcdtocp(buf), (int)(max_len*num_elem));
ret_value = 0;
H5Dvlen_reclaim(c_mem_type_id, c_mem_space_id, H5P_DEFAULT, c_buf);
free(c_buf);
@@ -1027,15 +1044,11 @@ nh5dwrite_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spa
hid_t c_file_space_id;
hid_t c_xfer_prp;
herr_t status;
-#if defined (_UNICOS)
- double *tmp;
-#else
- float *tmp;
-#endif
+ real_f *tmp;
size_t max_len;
hvl_t *c_buf;
- int i;
+ hsize_t i;
hsize_t num_elem;
max_len = (size_t)dims[0];
@@ -1047,13 +1060,9 @@ 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(num_elem * sizeof(hvl_t));
+ c_buf = (hvl_t *)malloc((size_t)num_elem * sizeof(hvl_t));
if (c_buf == NULL) return ret_value;
-#if defined (_UNICOS)
- tmp = (double *)buf;
-#else
- tmp = (float *)buf;
-#endif
+ tmp = (real_f *)buf;
for (i=0; i < num_elem; i++) {
c_buf[i].len = (size_t)len[i];
c_buf[i].p = tmp;
@@ -1116,7 +1125,7 @@ nh5dread_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spac
num_elem = H5Sget_select_npoints(c_mem_space_id);
if(num_elem != dims[1]) return ret_value;
- c_buf = (hvl_t *)malloc(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.
@@ -1125,11 +1134,7 @@ nh5dread_vl_real_c ( hid_t_f *dset_id , hid_t_f *mem_type_id, hid_t_f *mem_spac
if ( status <0 ) goto DONE;
for (i=0; i < num_elem; i++) {
len[i] = (size_t_f)c_buf[i].len;
-#if defined (_UNICOS)
- memcpy(&buf[i*max_len], c_buf[i].p, c_buf[i].len*sizeof(double));
-#else
- memcpy(&buf[i*max_len], c_buf[i].p, c_buf[i].len*sizeof(float));
-#endif
+ 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);
diff --git a/fortran/src/H5Dff.f90 b/fortran/src/H5Dff.f90
index 53bbaef..0001aca 100644
--- a/fortran/src/H5Dff.f90
+++ b/fortran/src/H5Dff.f90
@@ -17,8 +17,7 @@
!
MODULE H5D
USE H5GLOBAL
-! USE H5R
-!
+
INTERFACE h5dwrite_f
MODULE PROCEDURE h5dwrite_reference_obj
@@ -47,7 +46,7 @@
MODULE PROCEDURE h5dwrite_real_5
MODULE PROCEDURE h5dwrite_real_6
MODULE PROCEDURE h5dwrite_real_7
-! Comment if on T3E
+! Comment if on Crays
MODULE PROCEDURE h5dwrite_double_scalar
MODULE PROCEDURE h5dwrite_double_1
MODULE PROCEDURE h5dwrite_double_2
@@ -56,9 +55,7 @@
MODULE PROCEDURE h5dwrite_double_5
MODULE PROCEDURE h5dwrite_double_6
MODULE PROCEDURE h5dwrite_double_7
-! End comment if on T3E
-!
-!
+! End comment if on Crays
END INTERFACE
INTERFACE h5dread_f
@@ -89,7 +86,7 @@
MODULE PROCEDURE h5dread_real_5
MODULE PROCEDURE h5dread_real_6
MODULE PROCEDURE h5dread_real_7
-! Comment if on T3E
+! Comment if on Crays
MODULE PROCEDURE h5dread_double_scalar
MODULE PROCEDURE h5dread_double_1
MODULE PROCEDURE h5dread_double_2
@@ -98,8 +95,8 @@
MODULE PROCEDURE h5dread_double_5
MODULE PROCEDURE h5dread_double_6
MODULE PROCEDURE h5dread_double_7
-! End comment if on T3E
-!
+! End comment if on Crays
+
END INTERFACE
INTERFACE h5dwrite_vl_f
diff --git a/fortran/src/H5FDmpiof.c b/fortran/src/H5FDmpiof.c
index e236a82..4f056c7 100644
--- a/fortran/src/H5FDmpiof.c
+++ b/fortran/src/H5FDmpiof.c
@@ -112,10 +112,7 @@ nh5pset_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode)
herr_t ret;
H5FD_mpio_xfer_t c_data_xfer_mode;
/*
- int CASE;
-
- CASE = *data_xfer_mode;
- switch (CASE) {
+ switch (*data_xfer_mode) {
case H5FD_MPIO_INDEPENDENT_F:
c_data_xfer_mode = H5FD_MPIO_INDEPENDENT;
@@ -157,7 +154,6 @@ nh5pget_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode)
hid_t c_prp_id;
herr_t ret;
H5FD_mpio_xfer_t c_data_xfer_mode;
- int CASE;
/*
* Call H5Pget_xfer function.
@@ -167,8 +163,7 @@ nh5pget_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode)
if (ret < 0) return ret_value;
*data_xfer_mode = (int_f)c_data_xfer_mode;
/*
- CASE = c_data_xfer_mode;
- switch (CASE) {
+ switch (c_data_xfer_mode) {
case H5FD_MPIO_INDEPENDENT:
*data_xfer_mode = H5FD_MPIO_INDEPENDENT_F;
diff --git a/fortran/src/H5Gf.c b/fortran/src/H5Gf.c
index 2fd2ca7..42f5658 100644
--- a/fortran/src/H5Gf.c
+++ b/fortran/src/H5Gf.c
@@ -128,46 +128,50 @@ 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 c_loc_id = (hid_t)*loc_id;
char *c_name;
int c_namelen;
- int c_obj_namelen;
+ size_t c_obj_namelen;
char *c_obj_name = NULL;
int type;
- int c_idx;
- herr_t c_ret_value;
+ hsize_t c_idx = *idx;
+ hid_t gid = (-1); /* Temporary group ID */
+
/*
* Convert FORTRAN name to C name
*/
c_namelen = *namelen;
+ c_obj_namelen = *obj_namelen;
c_name = (char *)HD5f2cstring(name, c_namelen);
if (c_name == NULL) return ret_value;
/*
* Allocate buffer to hold name of the object
*/
- if (*obj_namelen) c_obj_name = (char *)HDmalloc(*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;
}
- /*
- * Call H5Gget_obj_info_idx function.
- */
- c_loc_id = *loc_id;
- c_idx = *idx;
- c_ret_value = H5Gget_obj_info_idx(c_loc_id, c_name, c_idx, &c_obj_name, (size_t)*obj_namelen, &type);
- if (c_ret_value < 0) goto DONE;
+ /* Get a temporary group ID for the group to query */
+ if((gid=H5Gopen(c_loc_id,c_name))<0) goto DONE;
+
+ /* Query the object's information */
+ if(H5Gget_objname_by_idx(gid, c_idx, c_obj_name, c_obj_namelen)<0) goto DONE;
+ if((type=H5Gget_objtype_by_idx(gid, c_idx))==H5G_UNKNOWN) goto DONE;
*obj_type = type;
+
/*
* Convert C name to FORTRAN and place it in the given buffer
*/
- c_obj_namelen = *obj_namelen;
- HD5packFstring(c_obj_name, _fcdtocp(obj_name), c_obj_namelen);
+ HD5packFstring(c_obj_name, _fcdtocp(obj_name), (int)c_obj_namelen);
ret_value = 0;
DONE:
+ /* Close the temporary group, if it was opened */
+ if(gid>0) H5Gclose(gid);
+
HDfree(c_obj_name);
HDfree(c_name);
return ret_value;
@@ -189,10 +193,11 @@ int_f
nh5gn_members_c (hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *nmembers)
{
int ret_value = -1;
- hid_t c_loc_id;
+ hid_t c_loc_id=(hid_t)*loc_id;
char *c_name;
int c_namelen;
- int c_nmembers;
+ hsize_t c_nmembers;
+ hid_t gid = (-1);
/*
* Convert FORTRAN name to C name
@@ -201,17 +206,19 @@ nh5gn_members_c (hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *nmembers)
c_name = (char *)HD5f2cstring(name, c_namelen);
if (c_name == NULL) return ret_value;
- /*
- * Call H5Gn_members function.
- */
- c_loc_id = (hid_t)*loc_id;
- c_nmembers = H5Gn_members(c_loc_id, c_name);
+ /* Get a temporary group ID for the group to query */
+ if((gid=H5Gopen(c_loc_id,c_name))<0) goto DONE;
+
+ /* Call H5Gget_num_objs() for the number of objects in the group */
+ if(H5Gget_num_objs(gid,&c_nmembers)<0) goto DONE;
- if (c_nmembers < 0) goto DONE;
*nmembers = (int_f)c_nmembers;
ret_value = 0;
DONE:
+ /* Close the temporary group, if it was opened */
+ if(gid>0) H5Gclose(gid);
+
HDfree(c_name);
return ret_value;
}
@@ -521,7 +528,7 @@ nh5gget_linkval_c(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size, _f
/*
* Allocate buffer to hold name of the value
*/
- if(*size) c_value = (char *)HDmalloc(*size);
+ if(*size) c_value = (char *)HDmalloc((size_t)*size);
if(c_value == NULL) {
HDfree(c_name);
return ret_value;
diff --git a/fortran/src/H5Git.c b/fortran/src/H5Git.c
deleted file mode 100644
index 7b867fa..0000000
--- a/fortran/src/H5Git.c
+++ /dev/null
@@ -1,239 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the files COPYING and Copyright.html. COPYING can be found at the root *
- * of the source code distribution tree; Copyright.html can be found at the *
- * root level of an installed copy of the electronic HDF5 document set and *
- * is linked from the top-level documents page. It can also be found at *
- * 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. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-/* This files contains C stubs for H5G Fortran APIs */
-
-#include "hdf5.h"
-#include "H5private.h"
-#include "H5Git.h"
-#define FALSE 0
-
-static herr_t count_elems(hid_t loc_id, const char *name, void *opdata);
-static herr_t obj_info(hid_t loc_id, const char *name, void *opdata);
-
-typedef struct retval {
- char * name;
- int type;
-} retval_t;
-
-
-/*-------------------------------------------------------------------------
- * Function: H5Gn_members
- *
- * Purpose: Return the number of members of a group. The "members"
- * are the datasets, groups, and named datatypes in the
- * group.
- *
- * This function wraps the H5Ginterate() function in
- * a completely obvious way, uses the operator
- * function 'count_members()' below;
- *
- * See also: H5Giterate()
- *
- * IN: hid_t file: the file id
- * IN: char *group_name: the name of the group
- *
- * Errors:
- *
- * Return: Success: The object number of members of
- * the group.
- *
- * Failure: FAIL
- *
- * Programmer: REMcG
- * Monday, Aug 2, 1999
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-int
-H5Gn_members( hid_t loc_id, char *group_name )
-{
- int res;
- int nelems = 0;
-
- res = H5Giterate(loc_id, group_name, NULL, count_elems, (void *)&nelems);
- if (res < 0) {
- return res;
- } else {
- return( nelems );
- }
-}
-
-
-
-/*-------------------------------------------------------------------------
- * Function: H5Gget_obj_info_idx
- *
- * Purpose: Return the name and type of the member of the group
- * at index 'idx', as defined by the H5Giterator()
- * function.
- *
- * This function wraps the H5Ginterate() function in
- * a completely obvious way, uses the operator
- * function 'get_objinfo()' below;
- *
- * See also: H5Giterate()
- *
- * IN: hid_t file: the file id
- * IN: char *group_name: the name of the group
- * IN: int idx: the index of the member object (see
- * H5Giterate()
- * OUT: char **objname: the name of the member object
- * OUT: int *type: the type of the object (dataset,
- * group, or named datatype)
- *
- * Errors:
- *
- * Return: Success: The object number of members of
- * the group.
- *
- * Failure: FAIL
- *
- * Programmer: REMcG
- * Monday, Aug 2, 1999
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5Gget_obj_info_idx( hid_t loc_id, char *group_name, int idx, char **objname, size_t max_objname_len, int *type )
-{
- int res;
- retval_t retVal;
-
- res = H5Giterate(loc_id, group_name, &idx, obj_info, (void *)&retVal);
- if (res < 0) {
- return res;
- }
-
- /* Only play with the string if it was returned */
- if(retVal.name!=NULL) {
- /* Copy the name to return & truncate if necessary */
- strncpy(*objname,retVal.name,max_objname_len);
- (*objname)[max_objname_len]='\0';
-
- /* Free the name we strdup'ed in obj_info() */
- HDfree(retVal.name);
- } /* end if */
- else
- *(*objname)='\0';
-
- *type = retVal.type;
- return 0;
-}
-
-
-
-/*-------------------------------------------------------------------------
- * Function: count_elems
- *
- * Purpose: this is the operator function called by H5Gn_members().
- *
- * This function is passed to H5Ginterate().
- *
- * See also: H5Giterate()
- *
- * OUT: 'opdata' is returned as an integer with the
- * number of members in the group.
- *
- * Errors:
- *
- * Return: Success: The object number of members of
- * the group.
- *
- * Failure: FAIL
- *
- * Programmer: REMcG
- * Monday, Aug 2, 1999
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-
-static herr_t
-count_elems(hid_t loc_id, const char *name, void *opdata)
-{
- herr_t res;
- H5G_stat_t statbuf;
-
- res = H5Gget_objinfo(loc_id, name, FALSE, &statbuf);
- if (res < 0) {
- return 1;
- }
- switch (statbuf.type) {
- case H5G_GROUP:
- (*(int *)opdata)++;
- break;
- case H5G_DATASET:
- (*(int *)opdata)++;
- break;
- case H5G_TYPE:
- (*(int *)opdata)++;
- break;
- default:
- (*(int *)opdata)++; /* ???? count links or no? */
- break;
- }
- return 0;
- }
-
-
-/*-------------------------------------------------------------------------
- * Function: obj_info
- *
- * Purpose: this is the operator function called by H5Gn_members().
- *
- * This function is passed to H5Ginterate().
- *
- * See also: H5Giterate()
- *
- * OUT: 'opdata' is returned as a 'recvar_t', containing
- * the object name and type.
- *
- * Errors:
- *
- * Return: Success: The object number of members of
- * the group.
- *
- * Failure: FAIL
- *
- * Programmer: REMcG
- * Monday, Aug 2, 1999
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- * group, or named datatype)
- */
-static herr_t
-obj_info(hid_t loc_id, const char *name, void *opdata)
-{
- herr_t res;
- H5G_stat_t statbuf;
-
- res = H5Gget_objinfo(loc_id, name, FALSE, &statbuf);
- if (res < 0) {
- ((retval_t *)opdata)->type = 0;
- ((retval_t *)opdata)->name = NULL;
- return 1;
- } else {
- ((retval_t *)opdata)->type = statbuf.type;
- ((retval_t *)opdata)->name = strdup(name);
- return 1;
- }
- }
diff --git a/fortran/src/H5Git.h b/fortran/src/H5Git.h
deleted file mode 100644
index 9924bc8..0000000
--- a/fortran/src/H5Git.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- * Copyright by the Board of Trustees of the University of Illinois. *
- * All rights reserved. *
- * *
- * This file is part of HDF5. The full HDF5 copyright notice, including *
- * terms governing use, modification, and redistribution, is contained in *
- * the files COPYING and Copyright.html. COPYING can be found at the root *
- * of the source code distribution tree; Copyright.html can be found at the *
- * root level of an installed copy of the electronic HDF5 document set and *
- * is linked from the top-level documents page. It can also be found at *
- * 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. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-
-
-#ifndef _H5Git_H
-#define _H5Git_H
-
-#include "hdf5.h"
-
-int H5Gn_members( hid_t loc_id, char *group_name );
-
-herr_t H5Gget_obj_info_idx( hid_t loc_id, char *group_name, int idx, char **objname, size_t max_objname_len, int *type );
-
-#endif /*_H5Git_H*/
diff --git a/fortran/src/H5If.c b/fortran/src/H5If.c
index c5a3ac7..e739508 100644
--- a/fortran/src/H5If.c
+++ b/fortran/src/H5If.c
@@ -68,7 +68,7 @@ nh5iget_name_c(hid_t_f *obj_id, _fcd buf, size_t_f *buf_size, size_t_f *name_siz
* Allocate buffer to hold name of an attribute
*/
c_buf_size = (size_t)*buf_size;
- c_buf = (char *)HDmalloc((int)c_buf_size +1);
+ c_buf = (char *)HDmalloc(c_buf_size +1);
if (c_buf == NULL) return ret_value;
/*
@@ -176,6 +176,7 @@ nh5iget_ref_c(hid_t_f *obj_id, int_f *ref_count)
done:
return ret_value;
}
+
/*----------------------------------------------------------------------------
* Name: h5iget_file_id_c
* Purpose: Call H5Iget_file_id to obtain file identifier from object identifier
diff --git a/fortran/src/H5Iff.f90 b/fortran/src/H5Iff.f90
index f2d3334..91bcdae 100644
--- a/fortran/src/H5Iff.f90
+++ b/fortran/src/H5Iff.f90
@@ -292,6 +292,7 @@
END INTERFACE
hdferr = h5iget_ref_c(obj_id, ref_count)
END SUBROUTINE h5iget_ref_f
+
!----------------------------------------------------------------------
! Name: h5iget_file_id_f
!
@@ -338,6 +339,5 @@
hdferr = h5iget_file_id_c(obj_id, file_id)
END SUBROUTINE h5iget_file_id_f
-
END MODULE H5I
diff --git a/fortran/src/H5Pf.c b/fortran/src/H5Pf.c
index c965608..cb3f870 100644
--- a/fortran/src/H5Pf.c
+++ b/fortran/src/H5Pf.c
@@ -224,11 +224,11 @@ nh5pset_deflate_c ( hid_t_f *prp_id , int_f *level)
{
int ret_value = 0;
hid_t c_prp_id;
- int c_level;
+ unsigned c_level;
herr_t status;
c_prp_id = (hid_t)*prp_id;
- c_level = (int)*level;
+ c_level = (unsigned)*level;
status = H5Pset_deflate(c_prp_id, c_level);
if ( status < 0 ) ret_value = -1;
return ret_value;
@@ -456,10 +456,10 @@ nh5pget_version_c (hid_t_f *prp_id, int_f * boot,int_f * freelist, int_f * stab,
int ret_value = -1;
hid_t c_prp_id;
herr_t ret;
- int c_boot;
- int c_freelist;
- int c_stab;
- int c_shhdr;
+ unsigned c_boot;
+ unsigned c_freelist;
+ unsigned c_stab;
+ unsigned c_shhdr;
/*
* Call H5Pget_version function.
@@ -624,16 +624,16 @@ nh5pset_sym_k_c (hid_t_f *prp_id, int_f* ik, int_f* lk)
{
int ret_value = -1;
hid_t c_prp_id;
- int c_ik;
- int c_lk;
+ unsigned c_ik;
+ unsigned c_lk;
herr_t ret;
/*
* Call H5Pset_sym_k function.
*/
c_prp_id = (hid_t)*prp_id;
- c_ik = (int)*ik;
- c_lk = (int)*lk;
+ c_ik = (unsigned)*ik;
+ c_lk = (unsigned)*lk;
ret = H5Pset_sym_k(c_prp_id, c_ik, c_lk);
if (ret < 0) return ret_value;
@@ -659,12 +659,8 @@ nh5pget_sym_k_c (hid_t_f *prp_id, int_f* ik, int_f* lk)
int ret_value = -1;
hid_t c_prp_id;
herr_t ret;
- int c_ik;
-#ifdef H5_WANT_H5_V1_4_COMPAT
- int c_lk;
-#else /* H5_WANT_H5_V1_4_COMPAT */
+ unsigned c_ik;
unsigned c_lk;
-#endif /* H5_WANT_H5_V1_4_COMPAT */
/*
* Call H5Pget_sym_k function.
@@ -694,14 +690,14 @@ nh5pset_istore_k_c (hid_t_f *prp_id, int_f* ik)
{
int ret_value = -1;
hid_t c_prp_id;
- int c_ik;
+ unsigned c_ik;
herr_t ret;
/*
* Call H5Pset_istore_k function.
*/
c_prp_id = (hid_t)*prp_id;
- c_ik = (int)*ik;
+ c_ik = (unsigned)*ik;
ret = H5Pset_istore_k(c_prp_id, c_ik);
if (ret < 0) return ret_value;
@@ -726,7 +722,7 @@ nh5pget_istore_k_c (hid_t_f *prp_id, int_f* ik)
int ret_value = -1;
hid_t c_prp_id;
herr_t ret;
- int c_ik;
+ unsigned c_ik;
/*
* Call H5Pget_istore_k function.
@@ -753,21 +749,18 @@ int_f
nh5pget_driver_c (hid_t_f *prp_id, hid_t_f* driver)
{
int ret_value = -1;
- /*
- hid_t c_prp_id;
hid_t c_driver;
- */
/*
* Call H5Pget_driver function.
*/
- /*
- c_prp_id = *prp_id;
- c_driver = H5Pget_driver(c_prp_id);
+ c_driver = H5Pget_driver((hid_t)*prp_id);
+ if (c_driver < 0) goto DONE;
+
*driver = (hid_t_f) c_driver;
- if (c_driver < 0) return ret_value;
- */
ret_value = 0;
+
+DONE:
return ret_value;
}
@@ -1414,7 +1407,7 @@ nh5pset_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_nel
unsigned int c_flags;
H5Z_filter_t c_filter;
unsigned int * c_cd_values;
- int i;
+ unsigned i;
c_filter = (H5Z_filter_t)*filter;
c_flags = (unsigned)*flags;
@@ -1500,7 +1493,7 @@ nh5pget_filter_c(hid_t_f *prp_id, int_f* filter_number, int_f* flags, size_t_f*
H5Z_filter_t c_filter;
unsigned int * c_cd_values;
char* c_name;
- int i;
+ unsigned i;
c_cd_nelmts_in = (size_t)*cd_nelmts;
c_namelen = (size_t)*namelen;
@@ -1525,7 +1518,7 @@ 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), 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];
@@ -1581,7 +1574,7 @@ nh5pset_external_c (hid_t_f *prp_id, _fcd name, int_f* namelen, int_f* offset, h
ret_value = 0;
DONE:
- free(c_name);
+ HDfree(c_name);
return ret_value;
}
@@ -1633,7 +1626,7 @@ nh5pget_external_c(hid_t_f *prp_id, int_f *idx, size_t_f* name_size, _fcd name,
{
int ret_value = -1;
hid_t c_prp_id;
- int c_idx;
+ unsigned c_idx;
herr_t status;
size_t c_namelen;
char* c_name = NULL;
@@ -1651,14 +1644,14 @@ nh5pget_external_c(hid_t_f *prp_id, int_f *idx, size_t_f* name_size, _fcd name,
* Call H5Pget_external function.
*/
c_prp_id = (hid_t)*prp_id;
- c_idx = (int)*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), strlen(c_name));
+ HD5packFstring(c_name, _fcdtocp(name), (int)strlen(c_name));
ret_value = 0;
DONE:
@@ -1885,10 +1878,10 @@ nh5pset_buffer_c ( hid_t_f *prp_id , hsize_t_f *size)
{
int ret_value = 0;
hid_t c_prp_id;
- hsize_t c_size;
+ size_t c_size;
c_prp_id = (hid_t)*prp_id;
- c_size = (hsize_t)*size;
+ c_size = (size_t)*size;
if ( H5Pset_buffer(c_prp_id, c_size, NULL, NULL) < 0 ) ret_value = -1;
return ret_value;
}
@@ -1914,7 +1907,7 @@ nh5pget_buffer_c ( hid_t_f *prp_id , hsize_t_f *size)
c_prp_id = (hid_t)*prp_id;
c_size = H5Pget_buffer(c_prp_id, NULL, NULL);
if ( c_size == 0 ) return ret_value;
- *size = (hsize_t)c_size;
+ *size = (hsize_t_f)c_size;
ret_value = 0;
return ret_value;
}
@@ -2312,7 +2305,7 @@ nh5pregisterc_c(hid_t_f *class, _fcd name, int_f *name_len, size_t_f *size, _fcd
int_f
nh5pregister_c(hid_t_f *class, _fcd name, int_f *name_len, size_t_f *size, void *value)
{
- int ret_value = -1;
+ int_f ret_value = -1;
hid_t c_class;
char* c_name;
size_t c_size;
@@ -2348,7 +2341,7 @@ DONE:
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 ret_value = -1;
+ int_f ret_value = -1;
/*
* Call h5pinsert_c function
@@ -2373,7 +2366,7 @@ nh5pinsertc_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, _fcd v
int_f
nh5pinsert_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, void *value)
{
- int ret_value = -1;
+ int_f ret_value = -1;
hid_t c_plist;
char* c_name;
size_t c_size;
@@ -2409,7 +2402,7 @@ DONE:
int_f
nh5pexist_c(hid_t_f *class, _fcd name, int_f *name_len)
{
- int ret_value = -1;
+ int_f ret_value = -1;
hid_t c_class;
char* c_name;
htri_t status;
@@ -2442,7 +2435,7 @@ DONE:
int_f
nh5pisa_class_c(hid_t_f *plist, hid_t_f *class)
{
- int ret_value = -1;
+ int_f ret_value = -1;
hid_t c_class;
hid_t c_plist;
htri_t status;
@@ -2472,7 +2465,7 @@ nh5pisa_class_c(hid_t_f *plist, hid_t_f *class)
int_f
nh5pget_size_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size)
{
- int ret_value = -1;
+ int_f ret_value = -1;
hid_t c_plist;
char* c_name;
size_t c_size;
@@ -2505,7 +2498,7 @@ DONE:
int_f
nh5pget_nprops_c(hid_t_f *plist, size_t_f *nprops)
{
- int ret_value = -1;
+ int_f ret_value = -1;
hid_t c_plist;
size_t c_nprops;
@@ -2534,7 +2527,7 @@ nh5pget_nprops_c(hid_t_f *plist, size_t_f *nprops)
int_f
nh5pget_class_parent_c(hid_t_f *prp_id, hid_t_f *parent_id)
{
- int ret_value = -1;
+ int_f ret_value = -1;
hid_t c_prp_id;
hid_t c_parent_id;
@@ -2566,7 +2559,7 @@ nh5pget_class_parent_c(hid_t_f *prp_id, hid_t_f *parent_id)
int_f
nh5pcopy_prop_c(hid_t_f *dst_id, hid_t_f *src_id, _fcd name, int_f *name_len)
{
- int ret_value = -1;
+ int_f ret_value = -1;
hid_t c_dst_id, c_src_id;
char* c_name;
@@ -2599,7 +2592,7 @@ DONE:
int_f
nh5premove_c(hid_t_f *plid, _fcd name, int_f *name_len)
{
- int ret_value = -1;
+ int_f ret_value = -1;
hid_t c_plid;
char* c_name;
@@ -2631,7 +2624,7 @@ DONE:
int_f
nh5punregister_c(hid_t_f *class, _fcd name, int_f *name_len)
{
- int ret_value = -1;
+ int_f ret_value = -1;
hid_t c_class;
char* c_name;
@@ -2661,7 +2654,7 @@ DONE:
int_f
nh5pclose_class_c(hid_t_f *class)
{
- int ret_value = -1;
+ int_f ret_value = -1;
hid_t c_class;
c_class = (hid_t)*class;
@@ -2686,7 +2679,7 @@ nh5pclose_class_c(hid_t_f *class)
int_f
nh5pget_class_name_c(hid_t_f *class, _fcd name, int_f *name_len)
{
- int ret_value = -1;
+ int_f ret_value = -1;
hid_t c_class;
char* c_name;
@@ -2699,7 +2692,7 @@ nh5pget_class_name_c(hid_t_f *class, _fcd name, int_f *name_len)
if( c_name == NULL) goto DONE;
HD5packFstring(c_name, _fcdtocp(name), (int)*name_len);
- ret_value = strlen(c_name);
+ ret_value = (int_f)HDstrlen(c_name);
DONE:
HDfree(c_name);
@@ -2720,7 +2713,7 @@ DONE:
int_f
nh5psetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f *value_len)
{
- int ret_value = -1;
+ int_f ret_value = -1;
/*
* Call h5pset_c function
@@ -2744,7 +2737,7 @@ nh5psetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f *value_
int_f
nh5pset_c(hid_t_f *plist, _fcd name, int_f *name_len, void *value)
{
- int ret_value = -1;
+ int_f ret_value = -1;
hid_t c_plist;
char* c_name;
@@ -2777,7 +2770,7 @@ DONE:
int_f
nh5pgetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f *value_len)
{
- int ret_value = -1;
+ int_f ret_value = -1;
/*
* Call h5pget_c function
@@ -2801,7 +2794,7 @@ nh5pgetc_c(hid_t_f *plist, _fcd name, int_f *name_len, _fcd value, int_f *value_
int_f
nh5pget_c(hid_t_f *plist, _fcd name, int_f *name_len, void *value)
{
- int ret_value = -1;
+ int_f ret_value = -1;
hid_t c_plist;
char* c_name;
@@ -2833,7 +2826,7 @@ DONE:
int_f
nh5pset_shuffle_c ( hid_t_f *prp_id )
{
- int ret_value = 0;
+ int_f ret_value = 0;
hid_t c_prp_id;
herr_t status;
@@ -2855,7 +2848,7 @@ nh5pset_shuffle_c ( hid_t_f *prp_id )
int_f
nh5pset_fletcher32_c ( hid_t_f *prp_id )
{
- int ret_value = 0;
+ int_f ret_value = 0;
hid_t c_prp_id;
herr_t status;
@@ -2879,7 +2872,7 @@ nh5pset_fletcher32_c ( hid_t_f *prp_id )
int_f
nh5pset_edc_check_c ( hid_t_f *prp_id, int_f *flag )
{
- int ret_value = 0;
+ int_f ret_value = 0;
hid_t c_prp_id;
H5Z_EDC_t c_flag;
herr_t status;
@@ -2905,7 +2898,7 @@ nh5pset_edc_check_c ( hid_t_f *prp_id, int_f *flag )
int_f
nh5pget_edc_check_c ( hid_t_f *prp_id, int_f *flag )
{
- int ret_value = 0;
+ int_f ret_value = 0;
hid_t c_prp_id;
H5Z_EDC_t c_flag;
@@ -2929,7 +2922,7 @@ nh5pget_edc_check_c ( hid_t_f *prp_id, int_f *flag )
int_f
nh5pset_family_offset_c ( hid_t_f *prp_id , hsize_t_f *offset)
{
- int ret_value = 0;
+ int_f ret_value = 0;
hid_t c_prp_id;
hsize_t c_offset;
herr_t status;
@@ -2961,11 +2954,11 @@ 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)
{
- int ret_value = -1;
+ 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];
- const 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;
herr_t status;
@@ -2988,9 +2981,9 @@ nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f
if (tmp ==NULL) return ret_value;
tmp_p = tmp;
for (i=0; i < H5FD_MEM_NTYPES; i++) {
- c_memb_name[i] = (char *) malloc(len[i] + 1);
- memcpy((char *)c_memb_name[i], tmp_p, len[i]);
- tmp_pp = (char *)c_memb_name[i];
+ c_memb_name[i] = malloc((size_t)len[i] + 1);
+ memcpy(c_memb_name[i], tmp_p, (size_t)len[i]);
+ tmp_pp = c_memb_name[i];
tmp_pp[len[i]] = '\0';
tmp_p = tmp_p + c_lenmax;
/* printf(" %d \n", len[i]);
@@ -3021,7 +3014,7 @@ nh5pset_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f
DONE:
free(tmp);
- for (i=0; i < H5FD_MEM_NTYPES; i++) free((char *)c_memb_name[i]);
+ for (i=0; i < H5FD_MEM_NTYPES; i++) free(c_memb_name[i]);
return ret_value;
}
@@ -3038,7 +3031,7 @@ DONE:
int_f
nh5pset_fapl_multi_sc ( hid_t_f *prp_id , int_f *flag)
{
- int ret_value = -1;
+ int_f ret_value = -1;
hid_t c_prp_id;
hbool_t relax;
herr_t status;
@@ -3073,7 +3066,7 @@ nh5pset_fapl_multi_sc ( hid_t_f *prp_id , int_f *flag)
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 ret_value = -1;
+ 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];
@@ -3083,9 +3076,9 @@ nh5pget_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f
herr_t status;
char *tmp, *tmp_p;
int i;
- int c_lenmax;
- int length = 0;
- c_lenmax = (int)*lenmax;
+ size_t c_lenmax;
+ size_t length = 0;
+ c_lenmax = (size_t)*lenmax;
c_prp_id = (hid_t)*prp_id;
/*
@@ -3100,7 +3093,7 @@ nh5pget_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f
*/
tmp = (char *)malloc(c_lenmax*H5FD_MEM_NTYPES + 1);
tmp_p = tmp;
- for (i=0; i < c_lenmax*H5FD_MEM_NTYPES; i++) tmp[i] = ' ';
+ memset(tmp,' ', c_lenmax*H5FD_MEM_NTYPES);
tmp[c_lenmax*H5FD_MEM_NTYPES] = '\0';
for (i=0; i < H5FD_MEM_NTYPES; i++) {
memcpy(tmp_p, c_memb_name[i], strlen(c_memb_name[i]));
@@ -3108,7 +3101,7 @@ nh5pget_fapl_multi_c ( hid_t_f *prp_id , int_f *memb_map, hid_t_f *memb_fapl, _f
length = H5_MAX(length, strlen(c_memb_name[i]));
tmp_p = tmp_p + c_lenmax;
}
-HD5packFstring(tmp, _fcdtocp(memb_name), c_lenmax*H5FD_MEM_NTYPES);
+HD5packFstring(tmp, _fcdtocp(memb_name), (int)(c_lenmax*H5FD_MEM_NTYPES));
/*
* Take care of other arguments
@@ -3147,7 +3140,7 @@ HD5packFstring(tmp, _fcdtocp(memb_name), c_lenmax*H5FD_MEM_NTYPES);
int_f
nh5pset_szip_c ( hid_t_f *prp_id , int_f *options_mask, int_f *pixels_per_block)
{
- int ret_value = -1;
+ int_f ret_value = -1;
hid_t c_prp_id;
unsigned c_options_mask;
unsigned c_pixels_per_block;
@@ -3179,7 +3172,7 @@ nh5pset_szip_c ( hid_t_f *prp_id , int_f *options_mask, int_f *pixels_per_block)
int_f
nh5pall_filters_avail_c ( hid_t_f *prp_id , int_f *status)
{
- int ret_value = -1;
+ int_f ret_value = -1;
hid_t c_prp_id;
htri_t c_status;
@@ -3216,7 +3209,7 @@ nh5pall_filters_avail_c ( hid_t_f *prp_id , int_f *status)
int_f
nh5pget_filter_by_id_c(hid_t_f *prp_id, int_f* filter_id, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values, size_t_f *namelen, _fcd name)
{
- int ret_value = -1;
+ int_f ret_value = -1;
hid_t c_prp_id;
H5Z_filter_t c_filter_id;
unsigned int c_flags;
@@ -3224,7 +3217,7 @@ nh5pget_filter_by_id_c(hid_t_f *prp_id, int_f* filter_id, int_f* flags, size_t_f
size_t c_cd_nelmts_in;
unsigned int * c_cd_values;
char* c_name;
- int i;
+ unsigned i;
herr_t status;
c_cd_nelmts_in = (size_t)*cd_nelmts;
c_cd_nelmts = (size_t)*cd_nelmts;
@@ -3248,7 +3241,7 @@ 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), 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];
@@ -3278,14 +3271,14 @@ DONE:
int_f
nh5pmodify_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values )
{
- int ret_value = -1;
+ int_f ret_value = -1;
hid_t c_prp_id;
herr_t ret;
size_t c_cd_nelmts;
unsigned int c_flags;
H5Z_filter_t c_filter;
unsigned int * c_cd_values;
- int i;
+ unsigned i;
c_filter = (H5Z_filter_t)*filter;
c_flags = (unsigned)*flags;
@@ -3324,17 +3317,18 @@ nh5premove_filter_c (hid_t_f *prp_id, int_f* filter)
{
int_f ret_value = -1;
hid_t c_prp_id;
- herr_t ret;
H5Z_filter_t c_filter;
c_filter = (H5Z_filter_t)*filter;
c_prp_id = (hid_t)*prp_id;
+
/*
* Call H5Premove_filter function.
*/
- if((ret = H5Premove_filter(c_prp_id, c_filter)) < 0) goto DONE;
+ if(H5Premove_filter(c_prp_id, c_filter) < 0) goto DONE;
ret_value = 0;
DONE:
return ret_value;
}
+
diff --git a/fortran/src/H5Pff.f90 b/fortran/src/H5Pff.f90
index 206b1e2..2c65072 100644
--- a/fortran/src/H5Pff.f90
+++ b/fortran/src/H5Pff.f90
@@ -22,54 +22,54 @@
INTERFACE h5pset_fill_value_f
MODULE PROCEDURE h5pset_fill_value_integer
MODULE PROCEDURE h5pset_fill_value_real
-! Comment if on T3E
+! Comment if on Crays
MODULE PROCEDURE h5pset_fill_value_double
-! End comment if on T3E
+! End comment if on Crays
MODULE PROCEDURE h5pset_fill_value_char
END INTERFACE
INTERFACE h5pget_fill_value_f
MODULE PROCEDURE h5pget_fill_value_integer
MODULE PROCEDURE h5pget_fill_value_real
-! Comment if on T3E
+! Comment if on Crays
MODULE PROCEDURE h5pget_fill_value_double
-! End comment if on T3E
+! End comment if on Crays
MODULE PROCEDURE h5pget_fill_value_char
END INTERFACE
INTERFACE h5pset_f
MODULE PROCEDURE h5pset_integer
MODULE PROCEDURE h5pset_real
-! Comment if on T3E
+! Comment if on Crays
MODULE PROCEDURE h5pset_double
-! End comment if on T3E
+! End comment if on Crays
MODULE PROCEDURE h5pset_char
END INTERFACE
INTERFACE h5pget_f
MODULE PROCEDURE h5pget_integer
MODULE PROCEDURE h5pget_real
-! Comment if on T3E
+! Comment if on Crays
MODULE PROCEDURE h5pget_double
-! End comment if on T3E
+! End comment if on Crays
MODULE PROCEDURE h5pget_char
END INTERFACE
INTERFACE h5pregister_f
MODULE PROCEDURE h5pregister_integer
MODULE PROCEDURE h5pregister_real
-! Comment if on T3E
+! Comment if on Crays
MODULE PROCEDURE h5pregister_double
-! End comment if on T3E
+! End comment if on Crays
MODULE PROCEDURE h5pregister_char
END INTERFACE
INTERFACE h5pinsert_f
MODULE PROCEDURE h5pinsert_integer
MODULE PROCEDURE h5pinsert_real
-! Comment if on T3E
+! Comment if on Crays
MODULE PROCEDURE h5pinsert_double
-! End comment if on T3E
+! End comment if on Crays
MODULE PROCEDURE h5pinsert_char
END INTERFACE
@@ -6450,13 +6450,14 @@
hdferr = h5pmodify_filter_c(prp_id, filter, flags, cd_nelmts, cd_values )
END SUBROUTINE h5pmodify_filter_f
+
!----------------------------------------------------------------------
! Name: h5premove_filter_f
!
! Purpose: Removes filter from the dataset creation property list.
!
! Inputs:
-! prp_id - data creation property list
+! prp_id - data creation or transfer property list
! identifier
! filter - filter to be removed
! Outputs:
@@ -6474,7 +6475,7 @@
! Comment:
!----------------------------------------------------------------------
- SUBROUTINE h5premove_filter_f(prp_id, filter, hdferr)
+ SUBROUTINE h5premove_filter_f(prp_id, filter, hdferr)
!
!This definition is needed for Windows DLLs
!DEC$if defined(BUILD_HDF5_DLL)
@@ -6487,6 +6488,9 @@
INTEGER, INTENT(IN) :: filter ! Filter to be removed
INTEGER, INTENT(OUT) :: hdferr ! Error code
+! INTEGER, EXTERNAL :: h5premove_filter_c
+! MS FORTRAN needs explicit interface for C functions called here.
+!
INTERFACE
INTEGER FUNCTION h5premove_filter_c(prp_id, filter)
USE H5GLOBAL
@@ -6501,5 +6505,4 @@
hdferr = h5premove_filter_c(prp_id, filter)
END SUBROUTINE h5premove_filter_f
-
END MODULE H5P
diff --git a/fortran/src/H5Rf.c b/fortran/src/H5Rf.c
index 6e0d41a..070efdd 100644
--- a/fortran/src/H5Rf.c
+++ b/fortran/src/H5Rf.c
@@ -53,7 +53,7 @@ nh5rcreate_object_c (int_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen)
HDfree(c_name);
if (ret_value_c >= 0) {
- HDmemcpy(ref, &ref_c, H5R_OBJ_REF_BUF_SIZE);
+ *ref=(int_f)ref_c;
ret_value = 0;
}
@@ -160,7 +160,7 @@ nh5rdereference_object_c (hid_t_f *dset_id, int_f *ref, hid_t_f *obj_id)
hid_t c_obj_id;
hobj_ref_t ref_c;
- HDmemcpy (&ref_c, ref, H5R_OBJ_REF_BUF_SIZE);
+ ref_c=*ref;
/*
* Call H5Rdereference function.
@@ -225,7 +225,7 @@ nh5rget_object_type_obj_c (hid_t_f *dset_id, int_f *ref, int_f *obj_type)
int c_obj_type;
hobj_ref_t ref_c;
- HDmemcpy (&ref_c, ref, H5R_OBJ_REF_BUF_SIZE);
+ ref_c=*ref;
/*
* Call H5Rget_object_type function.
diff --git a/fortran/src/H5Sf.c b/fortran/src/H5Sf.c
index 25d8585..32080d4 100644
--- a/fortran/src/H5Sf.c
+++ b/fortran/src/H5Sf.c
@@ -13,6 +13,7 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#include "H5f90.h"
+
/*----------------------------------------------------------------------------
* Name: h5screate_simple_c
* Purpose: Call H5Screate_simple to create a dataspace
@@ -219,7 +220,8 @@ nh5sget_select_hyper_blocklist_c( hid_t_f *space_id ,hsize_t_f * startblock,
hid_t c_space_id;
hsize_t c_num_blocks;
- int i, rank;
+ hsize_t i;
+ int rank;
hsize_t c_startblock, *c_buf;
c_space_id = *space_id;
@@ -229,7 +231,7 @@ nh5sget_select_hyper_blocklist_c( hid_t_f *space_id ,hsize_t_f * startblock,
if (rank < 0 ) return ret_value;
c_startblock = (hsize_t)*startblock;
- c_buf = (hsize_t*)malloc(sizeof(hsize_t)*c_num_blocks*2*rank);
+ 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,
@@ -259,28 +261,28 @@ nh5sget_select_hyper_blocklist_c( hid_t_f *space_id ,hsize_t_f * startblock,
*---------------------------------------------------------------------------*/
int_f
-nh5sget_select_bounds_c( hid_t_f *space_id , hssize_t_f * start, hssize_t_f * end)
+nh5sget_select_bounds_c( hid_t_f *space_id , hsize_t_f * start, hsize_t_f * end)
{
int ret_value = -1;
hid_t c_space_id;
- hssize_t* c_start, *c_end;
+ hsize_t* c_start, *c_end;
int i, rank;
c_space_id = *space_id;
rank = H5Sget_simple_extent_ndims(c_space_id);
if (rank < 0 ) return ret_value;
- c_start =(hssize_t*) malloc(sizeof(hssize_t)*rank);
+ c_start =(hsize_t*) malloc(sizeof(hsize_t)*rank);
if (!c_start) return ret_value;
- c_end = (hssize_t*)malloc(sizeof(hssize_t)*rank);
+ c_end = (hsize_t*)malloc(sizeof(hsize_t)*rank);
if(!c_end) return ret_value;
ret_value = H5Sget_select_bounds(c_space_id, c_start, c_end);
for(i = 0; i < rank; i++)
{
- start[i] = (hssize_t_f)(c_start[i]+1);
- end[i] = (hssize_t_f)(c_end[i]+1);
+ start[i] = (hsize_t_f)(c_start[i]+1);
+ end[i] = (hsize_t_f)(c_end[i]+1);
}
if (ret_value >= 0 ) ret_value = 0;
@@ -327,7 +329,7 @@ nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint,
if (rank < 0 ) return ret_value;
c_startpoint = (hsize_t)*startpoint;
- c_buf = (hsize_t*)malloc(sizeof(hsize_t)*c_num_points*rank);
+ 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,
c_num_points, c_buf);
@@ -753,11 +755,11 @@ nh5sset_extent_none_c ( hid_t_f *space_id )
*---------------------------------------------------------------------------*/
int_f
-nh5sselect_hyperslab_c ( hid_t_f *space_id , int_f *op, hssize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block)
+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;
hid_t c_space_id;
- hssize_t *c_start = NULL;
+ hsize_t *c_start = NULL;
hsize_t *c_count = NULL;
hsize_t *c_stride = NULL;
hsize_t *c_block = NULL;
@@ -769,7 +771,7 @@ nh5sselect_hyperslab_c ( hid_t_f *space_id , int_f *op, hssize_t_f *start, hsize
rank = H5Sget_simple_extent_ndims(*space_id);
if (rank < 0 ) return ret_value;
- c_start = (hssize_t *)HDmalloc(sizeof(hssize_t)*rank);
+ c_start = (hsize_t *)HDmalloc(sizeof(hsize_t)*rank);
if (c_start == NULL) goto DONE;
c_count = (hsize_t *)HDmalloc(sizeof(hsize_t)*rank);
@@ -788,7 +790,7 @@ nh5sselect_hyperslab_c ( hid_t_f *space_id , int_f *op, hssize_t_f *start, hsize
for (i=0; i < rank; i++) {
int t= (rank - i) - 1;
- c_start[i] = (hssize_t)start[t];
+ c_start[i] = (hsize_t)start[t];
c_count[i] = (hsize_t)count[t];
c_stride[i] = (hsize_t)stride[t];
c_block[i] = (hsize_t)block[t];
@@ -853,7 +855,7 @@ nh5sget_select_type_c ( hid_t_f *space_id , int_f *type)
*---------------------------------------------------------------------------*/
int_f
-nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *nelements, hssize_t_f *coord)
+nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *nelements, hsize_t_f *coord)
{
int ret_value = -1;
hid_t c_space_id;
@@ -861,7 +863,7 @@ nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *nelements, hss
herr_t status;
int rank;
int i, j;
- hssize_t *c_coord;
+ hsize_t *c_coord;
size_t c_nelements;
/*
if (*op != H5S_SELECT_SET_F) return ret_value;
@@ -872,16 +874,16 @@ nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *nelements, hss
c_space_id = *space_id;
rank = H5Sget_simple_extent_ndims(c_space_id);
- c_coord = malloc(sizeof(hssize_t)*rank*(*nelements));
+ c_coord = malloc(sizeof(hsize_t)*rank*(*nelements));
if(!c_coord) return ret_value;
for (i=0; i< *nelements; i++) {
for (j = 0; j < rank; j++) {
- c_coord[j+i*rank] = (hssize_t)coord[j + i*rank];
+ c_coord[j+i*rank] = (hsize_t)coord[j + i*rank];
}
}
c_nelements = *nelements;
- status = H5Sselect_elements(c_space_id, c_op, c_nelements, (const hssize_t **)c_coord);
+ status = H5Sselect_elements(c_space_id, c_op, c_nelements, (const hsize_t **)c_coord);
if ( status >= 0 ) ret_value = 0;
HDfree(c_coord);
return ret_value;
diff --git a/fortran/src/H5Sff.f90 b/fortran/src/H5Sff.f90
index 9f96dc9..782b6da 100644
--- a/fortran/src/H5Sff.f90
+++ b/fortran/src/H5Sff.f90
@@ -435,9 +435,9 @@
IMPLICIT NONE
INTEGER(HID_T), INTENT(IN) :: space_id ! Dataspace identifier
- INTEGER(HSSIZE_T), DIMENSION(*), INTENT(OUT) :: start
+ INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: start
!Starting coordinates of the bounding box.
- INTEGER(HSSIZE_T), DIMENSION(*), INTENT(OUT) :: end
+ INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: end
!Ending coordinates of the bounding box,
!i.e., the coordinates of the diagonally
!opposite corner
@@ -453,8 +453,8 @@
!MS$ATTRIBUTES C,reference,alias:'_H5SGET_SELECT_BOUNDS_C'::h5sget_select_bounds_c
!DEC$ ENDIF
INTEGER(HID_T), INTENT(IN) :: space_id
- INTEGER(HSSIZE_T), DIMENSION(*), INTENT(OUT) :: start
- INTEGER(HSSIZE_T), DIMENSION(*), INTENT(OUT) :: end
+ INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: start
+ INTEGER(HSIZE_T), DIMENSION(*), INTENT(OUT) :: end
END FUNCTION h5sget_select_bounds_c
END INTERFACE
@@ -634,13 +634,13 @@
INTEGER, INTENT(IN) :: rank ! Number of dataspace dimensions
INTEGER(SIZE_T), INTENT(IN) :: num_elements ! Number of elements to be
! selected
- INTEGER(HSSIZE_T), &
+ INTEGER(HSIZE_T), &
DIMENSION(rank,num_elements), INTENT(IN) :: coord
! Array with the coordinates
! of the selected elements
! coord(rank, num_elements)
INTEGER, INTENT(OUT) :: hdferr ! Error code
- INTEGER(HSSIZE_T), ALLOCATABLE, DIMENSION(:,:) :: c_coord
+ INTEGER(HSIZE_T), ALLOCATABLE, DIMENSION(:,:) :: c_coord
INTEGER :: error, i,j
! INTEGER, EXTERNAL :: h5sselect_elements_c
@@ -656,7 +656,7 @@
INTEGER(HID_T), INTENT(IN) :: space_id
INTEGER, INTENT(IN) :: operator
INTEGER(SIZE_T), INTENT(IN) :: num_elements
- INTEGER(HSSIZE_T),DIMENSION(*) :: c_c_coord
+ INTEGER(HSIZE_T),DIMENSION(*) :: c_c_coord
END FUNCTION h5sselect_elements_c
END INTERFACE
@@ -1489,7 +1489,7 @@
! H5S_SELECT_SET_F (0)
! H5S_SELECT_OR_F (1)
!
- INTEGER(HSSIZE_T), DIMENSION(*), INTENT(IN) :: start
+ INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: start
! Starting coordinates of the hyperslab
INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: count
! Number of blocks to select
@@ -1517,7 +1517,7 @@
!DEC$ ENDIF
INTEGER(HID_T), INTENT(IN) :: space_id
INTEGER, INTENT(IN) :: operator
- INTEGER(HSSIZE_T), DIMENSION(*), INTENT(IN) :: start
+ INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: start
INTEGER(HSIZE_T), DIMENSION(*), INTENT(IN) :: count
INTEGER(HSIZE_T), DIMENSION(*), OPTIONAL, INTENT(IN) :: stride
INTEGER(HSIZE_T), DIMENSION(*), OPTIONAL, INTENT(IN) :: block
diff --git a/fortran/src/H5Tf.c b/fortran/src/H5Tf.c
index 51f66ba..cc4b279 100644
--- a/fortran/src/H5Tf.c
+++ b/fortran/src/H5Tf.c
@@ -726,7 +726,7 @@ nh5tget_norm_c ( hid_t_f *type_id , int_f *norm)
c_norm = H5Tget_norm(c_type_id);
if ( c_norm == 0 ) return ret_value;
- *norm = (size_t_f)c_norm;
+ *norm = (int_f)c_norm;
ret_value = 0;
return ret_value;
}
@@ -981,19 +981,19 @@ nh5tget_nmembers_c ( hid_t_f *type_id , int_f * num_members)
*---------------------------------------------------------------------------*/
int_f
-nh5tget_member_name_c ( hid_t_f *type_id ,int_f* index, _fcd member_name, int_f *namelen)
+nh5tget_member_name_c ( hid_t_f *type_id ,int_f* idx, _fcd member_name, int_f *namelen)
{
int ret_value = -1;
hid_t c_type_id;
- int c_index;
+ unsigned c_index;
char *c_name;
c_type_id = *type_id;
- c_index = *index;
+ c_index = *idx;
c_name = H5Tget_member_name(c_type_id, c_index);
if (c_name == NULL ) return ret_value;
- HD5packFstring(c_name, _fcdtocp(member_name), 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;
@@ -1013,7 +1013,7 @@ nh5tget_member_name_c ( hid_t_f *type_id ,int_f* index, _fcd member_name, int_f
* Modifications:
*---------------------------------------------------------------------------*/
int_f
-nh5tget_member_index_c (hid_t_f *type_id, _fcd name, int_f *namelen, int_f *index)
+nh5tget_member_index_c (hid_t_f *type_id, _fcd name, int_f *namelen, int_f *idx)
{
int ret_value = -1;
char *c_name;
@@ -1035,7 +1035,7 @@ nh5tget_member_index_c (hid_t_f *type_id, _fcd name, int_f *namelen, int_f *inde
c_index = H5Tget_member_index(c_type_id, c_name);
if (c_index < 0) goto DONE;
- *index = (int_f)c_index;
+ *idx = (int_f)c_index;
DONE:
HDfree(c_name);
ret_value = 0;
@@ -1064,7 +1064,7 @@ nh5tget_member_offset_c ( hid_t_f *type_id ,int_f* member_no, size_t_f * offset)
int ret_value = -1;
size_t c_offset;
hid_t c_type_id;
- int c_member_no;
+ unsigned c_member_no;
c_type_id = *type_id;
c_member_no = *member_no;
@@ -1193,7 +1193,7 @@ nh5tget_member_type_c ( hid_t_f *type_id ,int_f* field_idx, hid_t_f * datatype)
{
int ret_value = -1;
hid_t c_type_id;
- int c_field_idx;
+ unsigned c_field_idx;
c_type_id = *type_id;
c_field_idx = *field_idx;
@@ -1443,7 +1443,7 @@ nh5tenum_nameof_c(hid_t_f *type_id, int_f* value, _fcd name, size_t_f* namelen)
c_name = (char *)malloc(sizeof(char)*c_namelen);
c_type_id = *type_id;
error = H5Tenum_nameof(c_type_id, &c_value, c_name, c_namelen);
- HD5packFstring(c_name, _fcdtocp(name), strlen(c_name));
+ HD5packFstring(c_name, _fcdtocp(name), (int)strlen(c_name));
HDfree(c_name);
if(error < 0) return ret_value;
@@ -1506,7 +1506,7 @@ nh5tget_member_value_c(hid_t_f *type_id, int_f* member_no, int_f* value)
{
int ret_value = -1;
hid_t c_type_id;
- int c_member_no;
+ unsigned c_member_no;
int c_value;
herr_t error;
@@ -1577,8 +1577,8 @@ 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), strlen(c_tag));
- *taglen = strlen(c_tag);
+ HD5packFstring(c_tag, _fcdtocp(tag), (int)strlen(c_tag));
+ *taglen = (int_f)HDstrlen(c_tag);
HDfree(c_tag);
ret_value = 0;
return ret_value;
diff --git a/fortran/src/H5_f.c b/fortran/src/H5_f.c
index 24d5655..05def3e 100644
--- a/fortran/src/H5_f.c
+++ b/fortran/src/H5_f.c
@@ -44,11 +44,13 @@ nh5init_types_c( hid_t_f * types, hid_t_f * floatingtypes, hid_t_f * integertype
int ret_value = -1;
hid_t c_type_id;
if ((types[0] = (hid_t_f)H5Tcopy(H5T_NATIVE_INT)) < 0) return ret_value;
-#if defined(_UNICOS)
- if ((types[1] = (hid_t_f)H5Tcopy(H5T_NATIVE_DOUBLE)) < 0) return ret_value;
-#else
- if ((types[1] = (hid_t_f)H5Tcopy(H5T_NATIVE_FLOAT)) < 0) return ret_value;
-#endif
+ /* Accomodate Crays with this check */
+ if(sizeof(real_f)==sizeof(double)) {
+ if ((types[1] = (hid_t_f)H5Tcopy(H5T_NATIVE_DOUBLE)) < 0) return ret_value;
+ } /* end if */
+ else {
+ if ((types[1] = (hid_t_f)H5Tcopy(H5T_NATIVE_FLOAT)) < 0) return ret_value;
+ } /* end else */
if ((types[2] = (hid_t_f)H5Tcopy(H5T_NATIVE_DOUBLE)) < 0) return ret_value;
/*
if ((types[3] = H5Tcopy(H5T_NATIVE_UINT8)) < 0) return ret_value;
diff --git a/fortran/src/H5f90global.f90 b/fortran/src/H5f90global.f90
index 5199c6a..7e34b1e 100644
--- a/fortran/src/H5f90global.f90
+++ b/fortran/src/H5f90global.f90
@@ -13,7 +13,7 @@
! * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
!
MODULE H5GLOBAL
- USE H5FORTRAN_TYPES
+ USE H5FORTRAN_TYPES
!
! Definitions for reference datatypes.
! If you change the value of these parameters, do not forget to change corresponding
@@ -372,7 +372,7 @@
EQUIVALENCE(H5E_flags(24), H5E_TBBT_F)
!
-! H5E flags declaration
+! H5I flags declaration
!
INTEGER, PARAMETER :: H5I_FLAGS_LEN = 7
INTEGER H5I_flags(H5I_FLAGS_LEN)
@@ -572,7 +572,7 @@
!
! H5Z flags declaration
!
- INTEGER, PARAMETER :: H5Z_FLAGS_LEN = 14
+ INTEGER, PARAMETER :: H5Z_FLAGS_LEN = 14
INTEGER H5Z_flags(H5Z_FLAGS_LEN)
!DEC$if defined(BUILD_HDF5_DLL)
!DEC$ ATTRIBUTES DLLEXPORT :: /H5Z_FLAGS/
diff --git a/fortran/src/H5f90i.h b/fortran/src/H5f90i.h
index cb9d1ab..4dc1089 100644
--- a/fortran/src/H5f90i.h
+++ b/fortran/src/H5f90i.h
@@ -16,33 +16,15 @@
#ifndef _H5f90i_H
#define _H5f90i_H
-#ifdef GOT_MACHINE
-#undef GOT_MACHINE
-#endif
-
/*
* Standard header files needed all the time
*/
-#include <stdio.h>
-#include <stdlib.h>
-#include <limits.h>
-#include <string.h>
#include "H5private.h"
#if (defined (UNICOS) || (defined (_UNICOS)))
-#ifndef UNICOS
-#define UNICOS
-#endif
-
-#include <memory.h>
#include <fortran.h>
-#ifndef O_RDONLY
-#include <fcntl.h> /* for unbuffered i/o stuff */
-#define L_INCR 1
-#include <sys/stat.h>
-#endif /*O_RDONLY*/
/*typedef char* _fcd;*/
typedef long hsize_t_f;
@@ -58,23 +40,6 @@ typedef double real_f;
#if defined(IBM6000) || defined(_AIX)
-#ifndef IBM6000
-#define IBM6000
-#endif
-
-#ifdef GOT_MACHINE
-If you get an error on this line more than one machine type has been defined.
-Please check your Makefile.
-#endif
-#define GOT_MACHINE
-
-# define BSD
-
-#ifndef __GNUC__
-#include <memory.h>
-#endif /* __GNUC__ */
-#include <sys/file.h> /* for unbuffered i/o stuff */
-#include <sys/stat.h>
typedef char *_fcd;
typedef long long hsize_t_f;
typedef long long hssize_t_f;
@@ -114,18 +79,19 @@ typedef float real_f;
/* IA32 specific definitions */
#if (defined(i386) || defined(__i386) || defined(__i386__))
+
typedef long long hsize_t_f;
typedef long long hssize_t_f;
typedef int size_t_f;
#if defined H5_ABSOFT
#define DF_CAPFNAMES
-#define FNAME(x) x
#else
#define FNAME_POST_UNDERSCORE
#endif /*H5_ABSOFT*/
/* AMD64 specific definitions */
#elif defined __x86_64__
+
typedef long long hsize_t_f;
typedef long long hssize_t_f;
typedef int size_t_f;
@@ -133,6 +99,7 @@ typedef int size_t_f;
/* IA64 specific definitions */
#elif defined __ia64
+
typedef long hsize_t_f;
typedef long hssize_t_f;
typedef long size_t_f;
@@ -143,32 +110,7 @@ typedef long size_t_f;
#if defined(IRIX) || defined(IRIS4) || defined(sgi) || defined(__sgi__) || defined(__sgi)
-#ifndef IRIX
-#define IRIX
-#endif
-
-#if (_MIPS_SZLONG == 64)
-/* IRIX 64 bits objects. It is nearly the same as the conventional
- * 32 bits objects. Let them share IRIX definitions for now.
- */
-#define IRIX64
-#endif
-
-
-#ifdef GOT_MACHINE
-If you get an error on this line more than one machine type has been defined.
-Please check your Makefile.
-#endif
-#define GOT_MACHINE 1
-
-# define BSD
-#ifndef __GNUC__
-#include <memory.h>
-#endif /* __GNUC__ */
-#include <sys/file.h> /* for unbuffered i/o stuff */
-#include <sys/stat.h>
typedef char *_fcd;
-
typedef long hsize_t_f;
typedef long hssize_t_f;
typedef long size_t_f;
@@ -177,35 +119,10 @@ typedef int hid_t_f;
typedef float real_f;
#define FNAME_POST_UNDERSCORE
#define _fcdtocp(desc) (desc)
-#ifdef IRIX64
-#define BIG_LONGS
-#endif
#endif /* IRIX */
#if (defined(SUN) || defined(sun) || defined(__sun__) || defined(__SUNPRO_C)) & !defined(__i386)
-#ifdef __STDC__
-#define ANSISUN
-#else /* __STDC__ */
-#define KNRSUN
-#endif /* __STDC__ */
-#endif /* SUN || sun */
-
-#if defined(ANSISUN)
-
-#if !defined(SUN)
-#define SUN
-#endif
-
-#ifdef GOT_MACHINE
-If you get an error on this line more than one machine type has been defined.
-Please check your Makefile.
-#endif
-#define GOT_MACHINE
-#include <unistd.h> /* for some file I/O stuff */
-#include <sys/time.h>
-#include <sys/file.h> /* for unbuffered i/o stuff */
-#include <sys/stat.h>
typedef char *_fcd;
typedef long long hssize_t_f;
typedef long long hsize_t_f;
@@ -220,17 +137,6 @@ typedef float real_f;
#if defined DEC_ALPHA || (defined __alpha && defined __unix__ && !defined __linux__)
-#ifndef DEC_ALPHA
-#define DEC_ALPHA
-#endif
-
-#ifdef GOT_MACHINE
-If you get an error on this line more than one machine type has been defined.
-Please check your Makefile.
-#endif
-#define GOT_MACHINE
-#include <sys/file.h> /* for unbuffered i/o stuff */
-#include <sys/stat.h>
typedef char *_fcd;
typedef long hsize_t_f;
typedef long hssize_t_f;
@@ -243,20 +149,8 @@ typedef float real_f;
#endif /* DEC_ALPHA */
-#if defined __alpha__ && defined __linux__
-
-#ifndef DEC_ALPHA_LINUX
-#define DEC_ALPHA_LINUX
-#endif
-
-#ifdef GOT_MACHINE
-If you get an error on this line more than one machine type has been defined.
-Please check your Makefile.
-#endif
-#define GOT_MACHINE
+#if defined __alpha__ && defined __linux__
-#include <sys/file.h> /* for unbuffered i/o stuff */
-#include <sys/stat.h>
typedef char *_fcd;
typedef long long hsize_t_f;
typedef long long hssize_t_f;
@@ -271,22 +165,6 @@ typedef float real_f;
#if defined(HP9000) || (!defined(__convexc__) && (defined(hpux) || defined(__hpux)))
-#ifndef HP9000
-#define HP9000
-#endif
-
-#ifdef GOT_MACHINE
-If you get an error on this line more than one machine type has been defined.
-Please check your Makefile.
-#endif
-#define GOT_MACHINE
-
-# define BSD
-#ifndef __GNUC__
-#include <memory.h>
-#endif /* __GNUC__ */
-#include <sys/file.h> /* for unbuffered i/o stuff */
-#include <sys/stat.h>
typedef char *_fcd;
typedef long long hsize_t_f;
typedef long long hssize_t_f;
@@ -300,20 +178,6 @@ typedef float real_f;
#if defined _WINDOWS || defined WIN32
-#define GOT_MACHINE 1
-
-#pragma comment( lib, "oldnames" )
-#include <fcntl.h>
-#include <sys\types.h>
-#include <sys\stat.h>
-#include <io.h>
-#include <conio.h>
-#include <malloc.h>
-#include <ctype.h> /* for character macros */
-#ifdef __WATCOMC__
-#include <stddef.h> /* for the 'fortran' pragma */
-#endif
-
typedef char *_fcd;
typedef int hsize_t_f;
@@ -323,10 +187,6 @@ typedef int int_f;
typedef int hid_t_f;
typedef float real_f;
-#if defined _M_ALPHA
-#define FNAME_PRE_UNDERSCORE
-#endif
-
#define DF_CAPFNAMES
#define _fcdtocp(desc) (desc)
@@ -355,11 +215,5 @@ typedef float real_f;
#if !defined(FNAME_PRE_UNDERSCORE) && defined(FNAME_POST2_UNDERSCORE)
# define FNAME(x) x##__
#endif
-/*
-# define HDfree(p) (free((void*)p))
-# define HDmalloc(s) (malloc((size_t)s))
-# define HDstrlen(s) (strlen((const char *)(s)))
-# define HDmemcpy(dst,src,n) (memcpy((void *)(dst),(const void *)(src),(size_t)(n)))
-*/
#endif /* _H5f90i_H */
diff --git a/fortran/src/H5f90kit.c b/fortran/src/H5f90kit.c
index 0f8fed4..a25645b 100644
--- a/fortran/src/H5f90kit.c
+++ b/fortran/src/H5f90kit.c
@@ -21,36 +21,10 @@
/*
* Routines from HDF4 to deal with C-FORTRAN issues.
*
- * HD5c2fstr -- convert a C string into a Fortran string IN PLACE
* HD5f2cstring -- convert a Fortran string to a C string
+ * HD5packFstring -- convert a C string into a Fortran string
*/
-/* ------------------------------- HDc2fstr -------------------------------
-NAME
- HD5c2fstr -- convert a C string into a Fortran string IN PLACE
-USAGE
- int HD5c2fstr(str, len)
- char * str; IN: string to convert
- int len; IN: length of Fortran string
-RETURNS
- SUCCEED
-DESCRIPTION
- Change a C string (NULL terminated) into a Fortran string.
- Basically, all that is done is that the NULL is ripped out
- and the string is padded with spaces
-
----------------------------------------------------------------------------*/
-int
-HD5c2fstr(char *str, int len)
-{
- int i;
-
- i=(int)HDstrlen(str);
- for (; i < len; i++)
- str[i] = ' ';
- return 0;
-} /* HD5c2fstr */
-
/* ----------------------------- HDf2cstring ------------------------------ */
/*
NAME
@@ -68,20 +42,27 @@ DESCRIPTION
---------------------------------------------------------------------------*/
char *
-HD5f2cstring(_fcd fdesc, int len)
+HD5f2cstring(_fcd fdesc, size_t len)
{
- char *cstr = NULL;
- char *str;
- int i;
+ char *cstr; /* C string to return */
+ char *str; /* Pointer to FORTRAN string */
+ int i; /* Local index variable */
+ /* Search for the end of the string */
str = _fcdtocp(fdesc);
- /* This should be equivalent to the above test -QAK */
- for(i=len-1; i>=0 && !isgraph((int)str[i]); i--)
+ for(i=(int)len-1; i>=0 && !isgraph((int)str[i]); i--)
/*EMPTY*/;
- cstr = (char *) HDmalloc( (i + 2));
- if (cstr == NULL) return NULL;
+
+ /* Allocate C string */
+ if ((cstr = HDmalloc( (size_t)(i + 2))) == NULL)
+ return NULL;
+
+ /* Copy text from FORTRAN to C string */
+ HDmemcpy(cstr,str,(size_t)(i+1));
+
+ /* Terminate C string */
cstr[i + 1] = '\0';
- HDmemcpy(cstr,str,i+1);
+
return cstr;
} /* HD5f2cstring */
@@ -105,17 +86,17 @@ DESCRIPTION
support one of these.
---------------------------------------------------------------------------*/
-int
-HD5packFstring(char *src, char *dest, int len)
+void
+HD5packFstring(char *src, char *dest, size_t dst_len)
{
- int sofar;
-
- for (sofar = 0; (sofar < len) && (*src != '\0'); sofar++)
- *dest++ = *src++;
+ size_t src_len=HDstrlen(src);
- while (sofar++ < len)
- *dest++ = ' ';
+ /* Copy over the string information, up to the length of the src */
+ /* (Don't copy the NUL terminator from the C string to the FORTRAN string */
+ HDmemcpy(dest,src,MIN(src_len,dst_len));
- return 0;
-} /* HD5packFstring */
+ /* Pad out any remaining space in the FORTRAN string with ' 's */
+ if(src_len<dst_len)
+ HDmemset(&dest[src_len],' ',dst_len-src_len);
+} /* HD5packFstring */
diff --git a/fortran/src/H5f90proto.h b/fortran/src/H5f90proto.h
index 3cda458..d83ab92 100644
--- a/fortran/src/H5f90proto.h
+++ b/fortran/src/H5f90proto.h
@@ -1,4 +1,4 @@
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
@@ -16,10 +16,8 @@
#ifndef _H5f90proto_H
#define _H5f90proto_H
-#include "H5Git.h"
-H5_DLL int HD5c2fstr(char *str, int len);
-H5_DLL char * HD5f2cstring (_fcd fdesc, int len);
-H5_DLL int HD5packFstring(char *src, char *dest, int len);
+H5_FCDLL char * HD5f2cstring (_fcd fdesc, size_t len);
+H5_FCDLL void HD5packFstring(char *src, char *dest, size_t len);
/*
* Functions from H5Ff.c
@@ -42,7 +40,6 @@ H5_DLL int HD5packFstring(char *src, char *dest, int len);
# define nh5fget_freespace_c FNAME(H5FGET_FREESPACE_C)
# define nh5fget_name_c FNAME(H5FGET_NAME_C)
# define nh5fget_filesize_c FNAME(H5FGET_FILESIZE_C)
-
#else /* !DF_CAPFNAMES */
# define nh5fcreate_c FNAME(h5fcreate_c)
# define nh5fflush_c FNAME(h5fflush_c)
@@ -62,35 +59,21 @@ H5_DLL int HD5packFstring(char *src, char *dest, int len);
#endif /* DF_CAPFNAMES */
#endif /* H5Ff90_FNAMES */
-H5_DLL int_f nh5fcreate_c
-(_fcd name, int_f *namelen, int_f *access_flags, hid_t_f *crt_prp, hid_t_f *acc_prp, hid_t_f *file_id);
-
-H5_DLL int_f nh5fopen_c
-(_fcd name, int_f *namelen, int_f *access_flags, hid_t_f *acc_prp, hid_t_f *file_id);
-
-H5_DLL int_f nh5fis_hdf5_c
-(_fcd name, int_f *namelen, int_f *flag);
-
-H5_DLL int_f nh5fclose_c (hid_t_f *file_id);
-H5_DLL int_f nh5fmount_c
-(hid_t_f *loc_id, _fcd dsetname, int_f *namelen, hid_t_f *file_id, hid_t_f *acc_prp);
-H5_DLL int_f nh5funmount_c
-(hid_t_f *loc_id, _fcd dsetname, int_f *namelen);
-H5_DLL int_f nh5freopen_c (hid_t_f *file_id1, hid_t_f *file_id2);
-
-H5_DLL int_f nh5fget_create_plist_c (hid_t_f *file_id, hid_t_f *prop_id);
-
-H5_DLL int_f nh5fget_access_plist_c (hid_t_f *file_id, hid_t_f *access_id);
-
-H5_DLL int_f nh5fget_obj_count_c (hid_t_f *file_id, int_f *obj_type, int_f *obj_count);
-
-H5_DLL int_f nh5fget_obj_ids_c (hid_t_f *file_id, int_f *obj_type, int_f *max_objs, int_f *obj_ids);
-H5_DLL int_f nh5fget_freespace_c (hid_t_f *file_id, hssize_t_f *free_space);
-H5_DLL int_f nh5fflush_c (hid_t_f *obj_id, int_f *scope);
-H5_DLL int_f nh5fget_name_c(hid_t_f *obj_id, size_t_f *size, _fcd buf, size_t_f *buflen);
-H5_DLL int_f nh5fget_filesize_c(hid_t_f *file_id, hsize_t_f *size);
-
-
+H5_FCDLL int_f nh5fcreate_c (_fcd name, int_f *namelen, int_f *access_flags, hid_t_f *crt_prp, hid_t_f *acc_prp, hid_t_f *file_id);
+H5_FCDLL int_f nh5fopen_c (_fcd name, int_f *namelen, int_f *access_flags, hid_t_f *acc_prp, hid_t_f *file_id);
+H5_FCDLL int_f nh5fis_hdf5_c (_fcd name, int_f *namelen, int_f *flag);
+H5_FCDLL int_f nh5fclose_c (hid_t_f *file_id);
+H5_FCDLL int_f nh5fmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen, hid_t_f *file_id, hid_t_f *acc_prp);
+H5_FCDLL int_f nh5funmount_c (hid_t_f *loc_id, _fcd dsetname, int_f *namelen);
+H5_FCDLL int_f nh5freopen_c (hid_t_f *file_id1, hid_t_f *file_id2);
+H5_FCDLL int_f nh5fget_create_plist_c (hid_t_f *file_id, hid_t_f *prop_id);
+H5_FCDLL int_f nh5fget_access_plist_c (hid_t_f *file_id, hid_t_f *access_id);
+H5_FCDLL int_f nh5fget_obj_count_c (hid_t_f *file_id, int_f *obj_type, int_f *obj_count);
+H5_FCDLL int_f nh5fget_obj_ids_c (hid_t_f *file_id, int_f *obj_type, int_f *max_objs, int_f *obj_ids);
+H5_FCDLL int_f nh5fget_freespace_c (hid_t_f *file_id, hssize_t_f *free_space);
+H5_FCDLL int_f nh5fflush_c (hid_t_f *obj_id, int_f *scope);
+H5_FCDLL int_f nh5fget_name_c(hid_t_f *obj_id, size_t_f *size, _fcd buf, size_t_f *buflen);
+H5_FCDLL int_f nh5fget_filesize_c(hid_t_f *file_id, hsize_t_f *size);
/*
* Functions from H5Sf.c
@@ -154,61 +137,37 @@ H5_DLL int_f nh5fget_filesize_c(hid_t_f *file_id, hsize_t_f *size);
#endif /* DF_CAPFNAMES */
#endif
-H5_DLL int_f nh5screate_simple_c
-( int_f *rank, hsize_t_f *dims, hsize_t_f *maxdims, hid_t_f *space_id );
-
-H5_DLL int_f nh5sclose_c ( hid_t_f *space_id );
-
-H5_DLL int_f nh5screate_c ( int_f *classtype, hid_t_f *space_id );
-
-H5_DLL int_f nh5scopy_c ( hid_t_f *space_id , hid_t_f *new_space_id);
-H5_DLL int_f nh5sget_select_hyper_nblocks_c( hid_t_f *space_id , hssize_t_f * num_blocks);
-H5_DLL 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);
-
-H5_DLL int_f nh5sget_select_bounds_c( hid_t_f *space_id , hssize_t_f * start, hssize_t_f * end);
-
-H5_DLL int_f nh5sget_select_elem_npoints_c( hid_t_f *space_id , hssize_t_f * num_points);
-
-H5_DLL int_f nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint, hsize_t_f * numpoints, hsize_t_f * buf);
-H5_DLL int_f nh5sselect_all_c ( hid_t_f *space_id );
-
-H5_DLL int_f nh5sselect_none_c ( hid_t_f *space_id );
-
-H5_DLL int_f nh5sselect_valid_c ( hid_t_f *space_id , int_f *flag );
-
-H5_DLL int_f nh5sget_simple_extent_npoints_c ( hid_t_f *space_id , hsize_t_f *npoints );
-
-H5_DLL int_f nh5sget_select_npoints_c ( hid_t_f *space_id , hssize_t_f *npoints );
-
-H5_DLL int_f nh5sget_simple_extent_ndims_c ( hid_t_f *space_id , int_f *ndims );
-
-H5_DLL int_f nh5sget_simple_extent_type_c ( hid_t_f *space_id , int_f *classtype);
-
-H5_DLL int_f nh5soffset_simple_c ( hid_t_f *space_id , hssize_t_f *offset);
-
-H5_DLL int_f nh5sset_extent_simple_c ( hid_t_f *space_id , int_f *rank, hsize_t_f * current_size, hsize_t_f *maximum_size);
-
-H5_DLL int_f nh5sis_simple_c ( hid_t_f *space_id , int_f *flag );
-
-H5_DLL int_f nh5sextent_class_c ( hid_t_f *space_id , int_f *classtype);
-
-H5_DLL int_f nh5sget_simple_extent_dims_c ( hid_t_f *space_id , hsize_t_f *dims, hsize_t_f *maxdims);
-
-H5_DLL int_f nh5sextent_copy_c ( hid_t_f *dest_space_id , hid_t_f *source_space_id);
-
-H5_DLL int_f nh5sset_extent_none_c ( hid_t_f *space_id );
-
-H5_DLL int_f nh5sselect_hyperslab_c ( hid_t_f *space_id , int_f *op, hssize_t_f *start, hsize_t_f *count, hsize_t_f *stride, hsize_t_f *block);
-
-H5_DLL int_f nh5sget_select_type_c ( hid_t_f *space_id , int_f *op);
-
-H5_DLL int_f nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *nelements, hssize_t_f *coord);
+H5_FCDLL int_f nh5screate_simple_c ( int_f *rank, hsize_t_f *dims, hsize_t_f *maxdims, hid_t_f *space_id );
+H5_FCDLL int_f nh5sclose_c ( hid_t_f *space_id );
+H5_FCDLL int_f nh5screate_c ( int_f *classtype, hid_t_f *space_id );
+H5_FCDLL int_f nh5scopy_c ( hid_t_f *space_id , hid_t_f *new_space_id);
+H5_FCDLL int_f nh5sget_select_hyper_nblocks_c( hid_t_f *space_id , hssize_t_f * num_blocks);
+H5_FCDLL 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);
+H5_FCDLL int_f nh5sget_select_bounds_c( hid_t_f *space_id , hsize_t_f * start, hsize_t_f * end);
+H5_FCDLL int_f nh5sget_select_elem_npoints_c( hid_t_f *space_id , hssize_t_f * num_points);
+H5_FCDLL int_f nh5sget_select_elem_pointlist_c( hid_t_f *space_id ,hsize_t_f * startpoint, hsize_t_f * numpoints, hsize_t_f * buf);
+H5_FCDLL int_f nh5sselect_all_c ( hid_t_f *space_id );
+H5_FCDLL int_f nh5sselect_none_c ( hid_t_f *space_id );
+H5_FCDLL int_f nh5sselect_valid_c ( hid_t_f *space_id , int_f *flag );
+H5_FCDLL int_f nh5sget_simple_extent_npoints_c ( hid_t_f *space_id , hsize_t_f *npoints );
+H5_FCDLL int_f nh5sget_select_npoints_c ( hid_t_f *space_id , hssize_t_f *npoints );
+H5_FCDLL int_f nh5sget_simple_extent_ndims_c ( hid_t_f *space_id , int_f *ndims );
+H5_FCDLL int_f nh5sget_simple_extent_type_c ( hid_t_f *space_id , int_f *classtype);
+H5_FCDLL int_f nh5soffset_simple_c ( hid_t_f *space_id , hssize_t_f *offset);
+H5_FCDLL int_f nh5sset_extent_simple_c ( hid_t_f *space_id , int_f *rank, hsize_t_f * current_size, hsize_t_f *maximum_size);
+H5_FCDLL int_f nh5sis_simple_c ( hid_t_f *space_id , int_f *flag );
+H5_FCDLL int_f nh5sextent_class_c ( hid_t_f *space_id , int_f *classtype);
+H5_FCDLL int_f nh5sget_simple_extent_dims_c ( hid_t_f *space_id , hsize_t_f *dims, hsize_t_f *maxdims);
+H5_FCDLL int_f nh5sextent_copy_c ( hid_t_f *dest_space_id , hid_t_f *source_space_id);
+H5_FCDLL int_f nh5sset_extent_none_c ( hid_t_f *space_id );
+H5_FCDLL 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);
+H5_FCDLL int_f nh5sget_select_type_c ( hid_t_f *space_id , int_f *op);
+H5_FCDLL int_f nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *nelements, hsize_t_f *coord);
/*
* Functions from H5Df.c
*/
-
#ifndef H5Df90_FNAMES
# define H5Df90_FNAMES
#ifdef DF_CAPFNAMES
@@ -270,78 +229,36 @@ H5_DLL int_f nh5sselect_elements_c ( hid_t_f *space_id , int_f *op, size_t_f *ne
#endif /* DF_CAPFNAMES */
#endif
-H5_DLL int_f nh5dcreate_c
-(hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *crt_prp, hid_t_f *dset_id);
-
-H5_DLL int_f nh5dopen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *dset_id);
-
-H5_DLL int_f nh5dclose_c ( hid_t_f *dset_id );
-
-H5_DLL int_f nh5dwrite_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, void *buf, hsize_t_f *dims);
-
-
-H5_DLL 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);
-
-H5_DLL 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);
-
-H5_DLL 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);
-
-H5_DLL 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);
-
-H5_DLL 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);
-
-H5_DLL 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);
-
-H5_DLL int_f nh5dwrite_ref_obj_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);
-
-H5_DLL int_f nh5dwrite_ref_reg_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);
-
-H5_DLL 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);
-
-
-H5_DLL int_f nh5dread_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, void *buf, hsize_t_f *dims);
-
-
-H5_DLL int_f nh5dread_ref_obj_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);
-
-H5_DLL int_f nh5dread_ref_reg_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);
-
-H5_DLL 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);
-
-H5_DLL int_f nh5dget_space_c ( hid_t_f *dset_id , hid_t_f *space_id);
-
-H5_DLL int_f nh5dget_type_c ( hid_t_f *dset_id , hid_t_f *type_id);
-
-H5_DLL int_f nh5dget_create_plist_c ( hid_t_f *dset_id , hid_t_f *plist_id);
-
-H5_DLL int_f nh5dextend_c ( hid_t_f *dset_id , hsize_t_f *dims);
-
-H5_DLL int_f nh5dvlen_get_max_len_c(hid_t_f *dataset_id, hid_t_f *type_id, hid_t_f *space_id, size_t_f *len);
-
-H5_DLL int_f nh5dget_storage_size_c(hid_t_f *dataset_id, hsize_t_f *size);
-H5_DLL 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);
-H5_DLL int_f nh5dfill_c(void * fill_value, hid_t_f *fill_type_id, hid_t_f *space_id, void * buf, hid_t_f *mem_type_id);
-
-H5_DLL int_f nh5dget_space_status_c ( hid_t_f *dset_id, int_f *flag);
+H5_FCDLL int_f nh5dcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *crt_prp, hid_t_f *dset_id);
+H5_FCDLL int_f nh5dopen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *dset_id);
+H5_FCDLL int_f nh5dclose_c ( hid_t_f *dset_id );
+H5_FCDLL int_f nh5dwrite_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, void *buf, hsize_t_f *dims);
+H5_FCDLL 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);
+H5_FCDLL 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);
+H5_FCDLL 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);
+H5_FCDLL int_f nh5dwrite_ref_obj_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);
+H5_FCDLL int_f nh5dwrite_ref_reg_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);
+H5_FCDLL 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);
+H5_FCDLL int_f nh5dread_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, void *buf, hsize_t_f *dims);
+H5_FCDLL 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);
+H5_FCDLL 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);
+H5_FCDLL 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);
+H5_FCDLL int_f nh5dread_ref_obj_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);
+H5_FCDLL int_f nh5dread_ref_reg_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);
+H5_FCDLL 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);
+H5_FCDLL int_f nh5dget_space_c ( hid_t_f *dset_id , hid_t_f *space_id);
+H5_FCDLL int_f nh5dget_type_c ( hid_t_f *dset_id , hid_t_f *type_id);
+H5_FCDLL int_f nh5dget_create_plist_c ( hid_t_f *dset_id , hid_t_f *plist_id);
+H5_FCDLL int_f nh5dextend_c ( hid_t_f *dset_id , hsize_t_f *dims);
+H5_FCDLL int_f nh5dvlen_get_max_len_c(hid_t_f *dataset_id, hid_t_f *type_id, hid_t_f *space_id, size_t_f *len);
+H5_FCDLL int_f nh5dget_storage_size_c(hid_t_f *dataset_id, hsize_t_f *size);
+H5_FCDLL 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);
+H5_FCDLL int_f nh5dfill_c(void * fill_value, hid_t_f *fill_type_id, hid_t_f *space_id, void * buf, hid_t_f *mem_type_id);
+H5_FCDLL int_f nh5dget_space_status_c ( hid_t_f *dset_id, int_f *flag);
/*
* Functions from H5Gf.c
*/
-
#ifndef H5Gf90_FNAMES
# define H5Gf90_FNAMES
#ifdef DF_CAPFNAMES
@@ -375,48 +292,23 @@ H5_DLL int_f nh5dget_space_status_c ( hid_t_f *dset_id, int_f *flag);
#endif /* DF_CAPFNAMES */
#endif
-H5_DLL int_f nh5gcreate_c
-(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint, hid_t_f *grp_id);
-
-H5_DLL int_f nh5gopen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *grp_id);
-
-H5_DLL int_f nh5gclose_c ( hid_t_f *grp_id );
-
-H5_DLL 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);
-
-H5_DLL int_f nh5gn_members_c
-(hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *nmembers);
-
-H5_DLL int_f nh5glink_c
-(hid_t_f *loc_id, int_f *link_type, _fcd current_name, int_f *current_namelen, _fcd new_name, int_f *new_namelen);
-
-H5_DLL int_f nh5glink2_c
-(hid_t_f *cur_loc_id, _fcd cur_name, int_f *cur_namelen, int_f *link_type, hid_t_f *new_loc_id, _fcd new_name, int_f *new_namelen);
-
-H5_DLL int_f nh5gunlink_c
-(hid_t_f *loc_id, _fcd name, int_f *namelen);
-
-H5_DLL int_f nh5gmove_c
-(hid_t_f *loc_id, _fcd src_name, int_f *src_namelen, _fcd dst_name, int_f *dst_namelen);
-
-H5_DLL int_f nh5gmove2_c
-(hid_t_f *src_loc_id, _fcd src_name, int_f *src_namelen, hid_t_f *dst_loc_id,_fcd dst_name, int_f *dst_namelen);
-
-H5_DLL int_f nh5gget_linkval_c
-(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size, _fcd value );
-
-H5_DLL int_f nh5gset_comment_c
-(hid_t_f *loc_id, _fcd name, int_f *namelen, _fcd comment, int_f *commentlen);
-
-H5_DLL int_f nh5gget_comment_c
-(hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *bufsize, _fcd comment);
-
+H5_FCDLL int_f nh5gcreate_c (hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size_hint, hid_t_f *grp_id);
+H5_FCDLL int_f nh5gopen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *grp_id);
+H5_FCDLL int_f nh5gclose_c ( hid_t_f *grp_id );
+H5_FCDLL 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);
+H5_FCDLL int_f nh5gn_members_c (hid_t_f *loc_id, _fcd name, int_f *namelen, int_f *nmembers);
+H5_FCDLL int_f nh5glink_c (hid_t_f *loc_id, int_f *link_type, _fcd current_name, int_f *current_namelen, _fcd new_name, int_f *new_namelen);
+H5_FCDLL int_f nh5glink2_c (hid_t_f *cur_loc_id, _fcd cur_name, int_f *cur_namelen, int_f *link_type, hid_t_f *new_loc_id, _fcd new_name, int_f *new_namelen);
+H5_FCDLL int_f nh5gunlink_c (hid_t_f *loc_id, _fcd name, int_f *namelen);
+H5_FCDLL int_f nh5gmove_c (hid_t_f *loc_id, _fcd src_name, int_f *src_namelen, _fcd dst_name, int_f *dst_namelen);
+H5_FCDLL int_f nh5gmove2_c (hid_t_f *src_loc_id, _fcd src_name, int_f *src_namelen, hid_t_f *dst_loc_id,_fcd dst_name, int_f *dst_namelen);
+H5_FCDLL int_f nh5gget_linkval_c (hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *size, _fcd value );
+H5_FCDLL int_f nh5gset_comment_c (hid_t_f *loc_id, _fcd name, int_f *namelen, _fcd comment, int_f *commentlen);
+H5_FCDLL int_f nh5gget_comment_c (hid_t_f *loc_id, _fcd name, int_f *namelen, size_t_f *bufsize, _fcd comment);
/*
* Functions from H5Af.c
*/
-
#ifndef H5Af90_FNAMES
# define H5Af90_FNAMES
#ifdef DF_CAPFNAMES
@@ -450,35 +342,19 @@ H5_DLL int_f nh5gget_comment_c
#endif /* DF_CAPFNAMES */
#endif
-
-H5_DLL int_f nh5acreate_c (hid_t_f *obj_id, _fcd name, int_f *namelen, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *crt_prp, hid_t_f *attr_id);
-
-H5_DLL int_f
-nh5aopen_name_c (hid_t_f *obj_id, _fcd name, int_f *namelen, hid_t_f *attr_id);
-
-H5_DLL int_f nh5awritec_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, hsize_t_f *dims);
-
-H5_DLL int_f nh5awrite_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, hsize_t_f *dims);
-
-
-H5_DLL int_f nh5areadc_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, hsize_t_f *dims);
-
-H5_DLL int_f nh5aread_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, hsize_t_f *dims);
-
-
-H5_DLL int_f nh5aclose_c ( hid_t_f *attr_id );
-
-H5_DLL int_f nh5adelete_c (hid_t_f *obj_id, _fcd name, int_f *namelen);
-
-H5_DLL int_f nh5aopen_idx_c (hid_t_f *obj_id, int_f *idx, hid_t_f *attr_id);
-
-H5_DLL int_f nh5aget_space_c (hid_t_f *attr_id, hid_t_f *space_id);
-
-H5_DLL int_f nh5aget_type_c (hid_t_f *attr_id, hid_t_f *type_id);
-
-H5_DLL int_f nh5aget_num_attrs_c (hid_t_f *obj_id, int_f *attr_num);
-
-H5_DLL int_f nh5aget_name_c(hid_t_f *attr_id, size_t_f *size, _fcd buf);
+H5_FCDLL int_f nh5acreate_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *type_id, hid_t_f *space_id, hid_t_f *crt_prp, hid_t_f *attr_id);
+H5_FCDLL int_f nh5aopen_name_c (hid_t_f *obj_id, _fcd name, size_t_f *namelen, hid_t_f *attr_id);
+H5_FCDLL int_f nh5awritec_c (hid_t_f *attr_id, hid_t_f *mem_type_id, _fcd buf, void *dims);
+H5_FCDLL int_f nh5awrite_c (hid_t_f *attr_id, hid_t_f *mem_type_id, void *buf, void *dims);
+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 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
@@ -541,7 +417,6 @@ H5_DLL int_f nh5aget_name_c(hid_t_f *attr_id, size_t_f *size, _fcd buf);
# define nh5tget_super_c FNAME(H5TGET_SUPER_C)
# define nh5tvlen_create_c FNAME(H5TVLEN_CREATE_C)
# define nh5tis_variable_str_c FNAME(H5TIS_VARIABLE_STR_C)
-
#else
# define nh5topen_c FNAME(h5topen_c)
# define nh5tcommit_c FNAME(h5tcommit_c)
@@ -601,94 +476,65 @@ H5_DLL int_f nh5aget_name_c(hid_t_f *attr_id, size_t_f *size, _fcd buf);
#endif
#endif
-H5_DLL int_f nh5tcreate_c(int_f *class, size_t_f *size, hid_t_f *type_id);
-
-H5_DLL int_f nh5topen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id);
-
-H5_DLL int_f
-nh5tcommit_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id);
-
-H5_DLL int_f nh5tclose_c ( hid_t_f *type_id );
-
-H5_DLL int_f nh5tequal_c ( hid_t_f *type1_id , hid_t_f *type2_id, int_f *c_flag);
-
-H5_DLL int_f nh5tcopy_c ( hid_t_f *type_id , hid_t_f *new_type_id);
-
-H5_DLL int_f nh5tget_class_c ( hid_t_f *type_id , int_f *classtype);
-
-H5_DLL int_f nh5tget_order_c ( hid_t_f *type_id , int_f *order);
-
-H5_DLL int_f nh5tset_order_c ( hid_t_f *type_id , int_f *order);
-
-H5_DLL int_f nh5tget_size_c ( hid_t_f *type_id , size_t_f *size);
-
-H5_DLL int_f nh5tset_size_c ( hid_t_f *type_id , size_t_f *size);
-H5_DLL int_f nh5tcommitted_c (hid_t_f *type_id);
-H5_DLL int_f nh5tget_precision_c ( hid_t_f *type_id , size_t_f *precision);
-H5_DLL int_f nh5tset_precision_c ( hid_t_f *type_id , size_t_f *precision);
-H5_DLL int_f nh5tget_offset_c ( hid_t_f *type_id , size_t_f *offset);
-H5_DLL int_f nh5tset_offset_c ( hid_t_f *type_id , size_t_f *offset);
-H5_DLL int_f nh5tget_pad_c ( hid_t_f *type_id , int_f * lsbpad, int_f * msbpad);
-H5_DLL int_f nh5tset_pad_c ( hid_t_f *type_id, int_f * lsbpad, int_f * msbpad );
-H5_DLL int_f nh5tget_sign_c ( hid_t_f *type_id , int_f* sign);
-H5_DLL int_f nh5tset_sign_c ( hid_t_f *type_id , int_f *sign);
-H5_DLL 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);
-H5_DLL 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);
-H5_DLL int_f nh5tget_ebias_c ( hid_t_f *type_id , size_t_f *ebias);
-
-H5_DLL int_f nh5tset_ebias_c ( hid_t_f *type_id , size_t_f *ebias);
-H5_DLL int_f nh5tget_norm_c ( hid_t_f *type_id , int_f *norm);
-
-H5_DLL int_f nh5tset_norm_c ( hid_t_f *type_id , int_f *norm);
-H5_DLL int_f nh5tget_inpad_c ( hid_t_f *type_id, int_f * padtype);
-H5_DLL int_f nh5tset_inpad_c ( hid_t_f *type_id, int_f * padtype);
-H5_DLL int_f nh5tget_cset_c ( hid_t_f *type_id, int_f * cset);
-H5_DLL int_f nh5tset_cset_c ( hid_t_f *type_id, int_f * cset);
-H5_DLL int_f nh5tget_strpad_c ( hid_t_f *type_id, int_f * strpad);
-H5_DLL int_f nh5tset_strpad_c ( hid_t_f *type_id, int_f * strpad);
-H5_DLL int_f nh5tget_nmembers_c ( hid_t_f *type_id , int_f * num_members);
-H5_DLL int_f nh5tget_member_name_c ( hid_t_f *type_id ,int_f* idx, _fcd member_name, int_f *namelen);
-H5_DLL int_f nh5tget_member_dims_c ( hid_t_f *type_id ,int_f* field_idx, int_f * dims, size_t_f * field_dims, int_f * perm );
-H5_DLL int_f nh5tget_member_offset_c ( hid_t_f *type_id ,int_f* member_no, size_t_f* offset);
-H5_DLL int_f nh5tget_member_type_c ( hid_t_f *type_id ,int_f* field_idx, hid_t_f * datatype);
-H5_DLL int_f nh5tget_member_index_c ( hid_t_f *type_id ,_fcd name, int_f* namelen, int_f *idx);
-
-H5_DLL int_f nh5tinsert_c(hid_t_f *type_id, _fcd name, int_f* namelen, size_t_f *offset, hid_t_f * field_id);
-H5_DLL int_f nh5tpack_c(hid_t_f * type_id);
-
-H5_DLL int_f nh5tinsert_array_c(hid_t_f * parent_id, _fcd name, int_f* namelen, size_t_f* offset, int_f* ndims, size_t_f* dims, hid_t_f* member_id, int_f* perm );
-
-H5_DLL int_f nh5tinsert_array_c2(hid_t_f * parent_id, _fcd name, int_f* namelen, size_t_f* offset, int_f* ndims, size_t_f* dims, hid_t_f* member_id);
-
-H5_DLL int_f nh5tenum_create_c ( hid_t_f *parent_id , hid_t_f *new_type_id);
-
-H5_DLL int_f nh5tenum_insert_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value);
-H5_DLL int_f
-nh5tenum_nameof_c(hid_t_f *type_id, int_f* value, _fcd name, size_t_f* namelen);
-H5_DLL int_f
-nh5tenum_valueof_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value);
-H5_DLL int_f
-nh5tget_member_value_c(hid_t_f *type_id, int_f* member_no, int_f* value);
-H5_DLL int_f
-nh5tset_tag_c(hid_t_f* type_id, _fcd tag, int_f* namelen);
-H5_DLL int_f
-nh5tget_tag_c(hid_t_f* type_id, _fcd tag, int_f* namelen);
-H5_DLL int_f
-nh5tarray_create_c(hid_t_f * base_id, int_f *rank, hsize_t_f* dims, hid_t_f* type_id);
-H5_DLL int_f
-nh5tget_array_dims_c ( hid_t_f *type_id , hsize_t_f * dims);
-H5_DLL int_f
-nh5tget_array_ndims_c ( hid_t_f *type_id , int_f * ndims);
-H5_DLL int_f
-nh5tget_super_c ( hid_t_f *type_id , hid_t_f *base_type_id);
-H5_DLL int_f
-nh5tvlen_create_c ( hid_t_f *type_id , hid_t_f *vltype_id);
-H5_DLL int_f nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag );
+H5_FCDLL int_f nh5tcreate_c(int_f *class, size_t_f *size, hid_t_f *type_id);
+H5_FCDLL int_f nh5topen_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id);
+H5_FCDLL int_f nh5tcommit_c (hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *type_id);
+H5_FCDLL int_f nh5tclose_c ( hid_t_f *type_id );
+H5_FCDLL int_f nh5tequal_c ( hid_t_f *type1_id , hid_t_f *type2_id, int_f *c_flag);
+H5_FCDLL int_f nh5tcopy_c ( hid_t_f *type_id , hid_t_f *new_type_id);
+H5_FCDLL int_f nh5tget_class_c ( hid_t_f *type_id , int_f *classtype);
+H5_FCDLL int_f nh5tget_order_c ( hid_t_f *type_id , int_f *order);
+H5_FCDLL int_f nh5tset_order_c ( hid_t_f *type_id , int_f *order);
+H5_FCDLL int_f nh5tget_size_c ( hid_t_f *type_id , size_t_f *size);
+H5_FCDLL int_f nh5tset_size_c ( hid_t_f *type_id , size_t_f *size);
+H5_FCDLL int_f nh5tcommitted_c (hid_t_f *type_id);
+H5_FCDLL int_f nh5tget_precision_c ( hid_t_f *type_id , size_t_f *precision);
+H5_FCDLL int_f nh5tset_precision_c ( hid_t_f *type_id , size_t_f *precision);
+H5_FCDLL int_f nh5tget_offset_c ( hid_t_f *type_id , size_t_f *offset);
+H5_FCDLL int_f nh5tset_offset_c ( hid_t_f *type_id , size_t_f *offset);
+H5_FCDLL int_f nh5tget_pad_c ( hid_t_f *type_id , int_f * lsbpad, int_f * msbpad);
+H5_FCDLL int_f nh5tset_pad_c ( hid_t_f *type_id, int_f * lsbpad, int_f * msbpad );
+H5_FCDLL int_f nh5tget_sign_c ( hid_t_f *type_id , int_f* sign);
+H5_FCDLL int_f nh5tset_sign_c ( hid_t_f *type_id , int_f *sign);
+H5_FCDLL 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);
+H5_FCDLL 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);
+H5_FCDLL int_f nh5tget_ebias_c ( hid_t_f *type_id , size_t_f *ebias);
+H5_FCDLL int_f nh5tset_ebias_c ( hid_t_f *type_id , size_t_f *ebias);
+H5_FCDLL int_f nh5tget_norm_c ( hid_t_f *type_id , int_f *norm);
+H5_FCDLL int_f nh5tset_norm_c ( hid_t_f *type_id , int_f *norm);
+H5_FCDLL int_f nh5tget_inpad_c ( hid_t_f *type_id, int_f * padtype);
+H5_FCDLL int_f nh5tset_inpad_c ( hid_t_f *type_id, int_f * padtype);
+H5_FCDLL int_f nh5tget_cset_c ( hid_t_f *type_id, int_f * cset);
+H5_FCDLL int_f nh5tset_cset_c ( hid_t_f *type_id, int_f * cset);
+H5_FCDLL int_f nh5tget_strpad_c ( hid_t_f *type_id, int_f * strpad);
+H5_FCDLL int_f nh5tset_strpad_c ( hid_t_f *type_id, int_f * strpad);
+H5_FCDLL int_f nh5tget_nmembers_c ( hid_t_f *type_id , int_f * num_members);
+H5_FCDLL int_f nh5tget_member_name_c ( hid_t_f *type_id ,int_f* idx, _fcd member_name, int_f *namelen);
+H5_FCDLL int_f nh5tget_member_dims_c ( hid_t_f *type_id ,int_f* field_idx, int_f * dims, size_t_f * field_dims, int_f * perm );
+H5_FCDLL int_f nh5tget_member_offset_c ( hid_t_f *type_id ,int_f* member_no, size_t_f* offset);
+H5_FCDLL int_f nh5tget_member_type_c ( hid_t_f *type_id ,int_f* field_idx, hid_t_f * datatype);
+H5_FCDLL int_f nh5tget_member_index_c ( hid_t_f *type_id ,_fcd name, int_f* namelen, int_f *idx);
+H5_FCDLL int_f nh5tinsert_c(hid_t_f *type_id, _fcd name, int_f* namelen, size_t_f *offset, hid_t_f * field_id);
+H5_FCDLL int_f nh5tpack_c(hid_t_f * type_id);
+H5_FCDLL int_f nh5tinsert_array_c(hid_t_f * parent_id, _fcd name, int_f* namelen, size_t_f* offset, int_f* ndims, size_t_f* dims, hid_t_f* member_id, int_f* perm );
+H5_FCDLL int_f nh5tinsert_array_c2(hid_t_f * parent_id, _fcd name, int_f* namelen, size_t_f* offset, int_f* ndims, size_t_f* dims, hid_t_f* member_id);
+H5_FCDLL int_f nh5tenum_create_c ( hid_t_f *parent_id , hid_t_f *new_type_id);
+H5_FCDLL int_f nh5tenum_insert_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value);
+H5_FCDLL int_f nh5tenum_nameof_c(hid_t_f *type_id, int_f* value, _fcd name, size_t_f* namelen);
+H5_FCDLL int_f nh5tenum_valueof_c(hid_t_f *type_id, _fcd name, int_f* namelen, int_f* value);
+H5_FCDLL int_f nh5tget_member_value_c(hid_t_f *type_id, int_f* member_no, int_f* value);
+H5_FCDLL int_f nh5tset_tag_c(hid_t_f* type_id, _fcd tag, int_f* namelen);
+H5_FCDLL int_f nh5tget_tag_c(hid_t_f* type_id, _fcd tag, int_f* namelen);
+H5_FCDLL int_f nh5tarray_create_c(hid_t_f * base_id, int_f *rank, hsize_t_f* dims, hid_t_f* type_id);
+H5_FCDLL int_f nh5tget_array_dims_c ( hid_t_f *type_id , hsize_t_f * dims);
+H5_FCDLL int_f nh5tget_array_ndims_c ( hid_t_f *type_id , int_f * ndims);
+H5_FCDLL int_f nh5tget_super_c ( hid_t_f *type_id , hid_t_f *base_type_id);
+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 );
/*
* Functions from H5Pf.c
*/
-
#ifndef H5Pf90_FNAMES
# define H5Pf90_FNAMES
#ifdef DF_CAPFNAMES
@@ -735,6 +581,7 @@ H5_DLL int_f nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag );
# define nh5pset_layout_c FNAME(H5PSET_LAYOUT_C)
# define nh5pget_layout_c FNAME(H5PGET_LAYOUT_C)
# define nh5pset_filter_c FNAME(H5PSET_FILTER_C)
+# define nh5premove_filter_c FNAME(H5PREMOVE_FILTER_C)
# define nh5pmodify_filter_c FNAME(H5PMODIFY_FILTER_C)
# define nh5pget_nfilters_c FNAME(H5PGET_NFILTERS_C)
# define nh5pget_filter_c FNAME(H5PGET_FILTER_C)
@@ -798,7 +645,6 @@ H5_DLL int_f nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag );
# define nh5pset_fapl_multi_sc FNAME(H5PSET_FAPL_MULTI_SC)
# define nh5pset_szip_c FNAME(H5PSET_SZIP_C)
# define nh5pall_filters_avail_c FNAME(H5PALL_FILTERS_AVAIL_C)
-# define nh5premove_filter_c FNAME(H5PREMOVE_FILTER_C)
#else
# define nh5pcreate_c FNAME(h5pcreate_c)
@@ -844,6 +690,7 @@ H5_DLL int_f nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag );
# define nh5pset_layout_c FNAME(h5pset_layout_c)
# define nh5pget_layout_c FNAME(h5pget_layout_c)
# define nh5pset_filter_c FNAME(h5pset_filter_c)
+# define nh5premove_filter_c FNAME(h5premove_filter_c)
# define nh5pmodify_filter_c FNAME(h5pmodify_filter_c)
# define nh5pget_nfilters_c FNAME(h5pget_nfilters_c)
# define nh5pget_filter_c FNAME(h5pget_filter_c)
@@ -907,205 +754,117 @@ H5_DLL int_f nh5tis_variable_str_c ( hid_t_f *type_id , int_f *flag );
# define nh5pset_fapl_multi_sc FNAME(h5pset_fapl_multi_sc)
# define nh5pset_szip_c FNAME(h5pset_szip_c)
# define nh5pall_filters_avail_c FNAME(h5pall_filters_avail_c)
-# define nh5premove_filter_c FNAME(h5premove_filter_c)
-
-
#endif
#endif
-H5_DLL int_f nh5pcreate_c ( hid_t_f *class, hid_t_f *prp_id );
-
-H5_DLL int_f nh5pclose_c ( hid_t_f *prp_id );
-
-H5_DLL int_f nh5pcopy_c ( hid_t_f *prp_id , hid_t_f *new_prp_id);
-
-H5_DLL int_f nh5pequal_c ( hid_t_f *plist1_id , hid_t_f *plist2_id, int_f *c_flag);
-
-H5_DLL int_f nh5pget_class_c ( hid_t_f *prp_id , int_f *classtype);
-
-H5_DLL int_f nh5pset_deflate_c ( hid_t_f *prp_id , int_f *level);
-
-H5_DLL int_f nh5pset_chunk_c ( hid_t_f *prp_id, int_f *rank, hsize_t_f *dims );
-
-H5_DLL int_f nh5pget_chunk_c ( hid_t_f *prp_id, int_f *max_rank, hsize_t_f *dims );
-
-H5_DLL int_f
-nh5pset_fill_valuec_c (hid_t_f *prp_id, hid_t_f *type_id, _fcd fillvalue);
-
-H5_DLL int_f
-nh5pset_fill_value_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue);
-
-H5_DLL int_f
-nh5pget_fill_valuec_c (hid_t_f *prp_id, hid_t_f *type_id, _fcd fillvalue);
-
-H5_DLL int_f
-nh5pget_fill_value_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue);
-
-H5_DLL int_f
-nh5pset_preserve_c ( hid_t_f *prp_id , int_f *flag);
-
-H5_DLL int_f
-nh5pget_preserve_c ( hid_t_f *prp_id , int_f *flag);
-H5_DLL int_f
-nh5pget_version_c (hid_t_f *prp_id, int_f * boot,int_f * freelist, int_f * stab, int_f *shhdr);
-H5_DLL int_f
-nh5pset_userblock_c (hid_t_f *prp_id, hsize_t_f * size);
-H5_DLL int_f
-nh5pget_userblock_c (hid_t_f *prp_id, hsize_t_f * size);
-H5_DLL int_f
-nh5pget_sizes_c (hid_t_f *prp_id, size_t_f * sizeof_addr, size_t_f * sizeof_size);
-H5_DLL int_f
-nh5pset_sizes_c (hid_t_f *prp_id, size_t_f * sizeof_addr, size_t_f * sizeof_size);
-H5_DLL int_f
-nh5pset_sym_k_c (hid_t_f *prp_id, int_f* ik, int_f* lk);
-H5_DLL int_f
-nh5pget_sym_k_c (hid_t_f *prp_id, int_f* ik, int_f* lk);
-H5_DLL int_f
-nh5pset_istore_k_c (hid_t_f *prp_id, int_f* ik);
-H5_DLL int_f
-nh5pget_istore_k_c (hid_t_f *prp_id, int_f* ik);
-H5_DLL int_f
-nh5pget_driver_c (hid_t_f *prp_id, hid_t_f*driver);
-H5_DLL int_f
-nh5pset_fapl_stdio_c (hid_t_f *prp_id);
-H5_DLL int_f
-nh5pget_fapl_stdio_c (hid_t_f *prp_id, int_f* io);
-H5_DLL int_f
-nh5pset_fapl_sec2_c (hid_t_f *prp_id);
-H5_DLL int_f
-nh5pget_fapl_sec2_c (hid_t_f *prp_id, int_f* sec2);
-H5_DLL int_f
-nh5pset_alignment_c(hid_t_f *prp_id, hsize_t_f* threshold, hsize_t_f* alignment);
-H5_DLL int_f
-nh5pget_alignment_c(hid_t_f *prp_id, hsize_t_f* threshold, hsize_t_f* alignment);
-H5_DLL int_f
-nh5pget_fapl_core_c (hid_t_f *prp_id, size_t_f* increment, int_f *flag);
-H5_DLL int_f
-nh5pset_fapl_core_c (hid_t_f *prp_id, size_t_f* increment, int_f *flag);
-H5_DLL int_f
-nh5pset_fapl_family_c (hid_t_f *prp_id, hsize_t_f* memb_size, hid_t_f* memb_plist );
-H5_DLL int_f
-nh5pget_fapl_family_c (hid_t_f *prp_id, hsize_t_f* memb_size, hid_t_f* memb_plist );
-H5_DLL int_f
-nh5pset_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);
-H5_DLL 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);
-H5_DLL int_f
-nh5pget_fapl_split_c(hid_t_f *prp_id, size_t_f* meta_ext_size , _fcd meta_ext, hid_t_f* meta_plist, size_t_f* raw_ext_size, _fcd raw_ext, hid_t_f * raw_plist);
-H5_DLL int_f
-nh5pset_fapl_split_c(hid_t_f *prp_id, int_f* meta_len, _fcd meta_ext, hid_t_f* meta_plist, int_f* raw_len, _fcd raw_ext, hid_t_f * raw_plist);
-H5_DLL int_f
-nh5pset_gc_references_c(hid_t_f *prp_id, int_f* gc_references);
-H5_DLL int_f
-nh5pget_gc_references_c(hid_t_f *prp_id, int_f* gc_references);
-H5_DLL int_f
-nh5pset_layout_c (hid_t_f *prp_id, int_f* layout);
-H5_DLL int_f
-nh5pget_layout_c (hid_t_f *prp_id, int_f* layout);
-H5_DLL int_f
-nh5pset_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values );
-H5_DLL int_f
-nh5pmodify_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values );
-H5_DLL int_f
-nh5pget_nfilters_c (hid_t_f *prp_id, int_f* nfilters);
-H5_DLL int_f
-nh5pget_filter_c(hid_t_f *prp_id, int_f* filter_number, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values, size_t_f *namelen, _fcd name, int_f* filter_id);
-H5_DLL int_f
-nh5pget_filter_by_id_c(hid_t_f *prp_id, int_f* filter_id, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values, size_t_f *namelen, _fcd name);
-H5_DLL int_f
-nh5pset_external_c (hid_t_f *prp_id, _fcd name, int_f* namelen, int_f* offset, hsize_t_f*bytes);
-H5_DLL int_f
-nh5pget_external_count_c (hid_t_f *prp_id, int_f* count);
-H5_DLL int_f
-nh5pget_external_c(hid_t_f *prp_id, int_f *idx, size_t_f* name_size, _fcd name, int_f* offset, hsize_t_f*bytes);
-H5_DLL int_f
-nh5pset_hyper_cache_c(hid_t_f *prp_id, int_f* cache, int_f* limit);
-H5_DLL int_f
-nh5pget_hyper_cache_c(hid_t_f *prp_id, int_f* cache, int_f* limit);
-H5_DLL int_f
-nh5pget_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* right);
-H5_DLL int_f
-nh5pset_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* right);
-H5_DLL int_f
-nh5pget_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info);
-H5_DLL int_f
-nh5pset_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info);
-H5_DLL int_f
-nh5pget_fapl_mpiposix_c(hid_t_f *prp_id, int_f* comm, int_f* flag);
-H5_DLL int_f
-nh5pset_fapl_mpiposix_c(hid_t_f *prp_id, int_f* comm, int_f* flag);
-H5_DLL int_f
-nh5pget_dxpl_mpio_rc(hid_t_f *prp_id, int_f* data_xfer_mode);
-H5_DLL int_f
-nh5pset_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode);
-
-H5_DLL int_f nh5pset_fclose_degree_c(hid_t_f *fapl, int_f *degree);
-H5_DLL int_f nh5pget_fclose_degree_c(hid_t_f *fapl, int_f *degree);
-H5_DLL int_f nh5pget_buffer_c(hid_t_f *plist, hsize_t_f *size);
-H5_DLL int_f nh5pset_buffer_c(hid_t_f *plist, hsize_t_f *size);
-
-H5_DLL int_f nh5pfill_value_define_c(hid_t_f *plist, int_f *flag);
-H5_DLL int_f nh5pset_alloc_time_c(hid_t_f *plist, int_f *flag);
-H5_DLL int_f nh5pget_alloc_time_c(hid_t_f *plist, int_f *flag);
-H5_DLL int_f nh5pset_fill_time_c(hid_t_f *plist, int_f *flag);
-H5_DLL int_f nh5pget_fill_time_c(hid_t_f *plist, int_f *flag);
-
-H5_DLL int_f nh5pset_meta_block_size_c(hid_t_f *plist, hsize_t_f *size);
-H5_DLL int_f nh5pget_meta_block_size_c(hid_t_f *plist, hsize_t_f *size);
-H5_DLL int_f nh5pset_sieve_buf_size_c(hid_t_f *plist, size_t_f *size);
-H5_DLL int_f nh5pget_sieve_buf_size_c(hid_t_f *plist, size_t_f *size);
-H5_DLL int_f nh5pset_small_data_block_size_c(hid_t_f *plist, hsize_t_f *size);
-H5_DLL int_f nh5pget_small_data_block_size_c(hid_t_f *plist, hsize_t_f *size);
-H5_DLL int_f nh5pset_hyper_vector_size_c(hid_t_f *plist, size_t_f *size);
-H5_DLL int_f nh5pget_hyper_vector_size_c(hid_t_f *plist, size_t_f *size);
-
-H5_DLL int_f
-nh5pcreate_class_c(hid_t_f *parent, _fcd name, int_f *name_len, hid_t_f *class);
-
-H5_DLL int_f
-nh5pregister_c(hid_t_f *class, _fcd name, int_f * name_len, size_t_f *size, void *value);
-
-H5_DLL 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_DLL int_f
-nh5pinsert_c(hid_t_f *plist, _fcd name, int_f *name_len, size_t_f *size, void *value);
-
-H5_DLL 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_DLL int_f nh5pset_c(hid_t_f *prp_id, _fcd name, int_f *name_len, void *value);
-
-H5_DLL int_f
-nh5psetc_c(hid_t_f *prp_id, _fcd name, int_f *name_len, _fcd value, int_f *value_len);
-
-H5_DLL int_f nh5pget_c(hid_t_f *prp_id, _fcd name, int_f *name_len, void *value);
-
-H5_DLL int_f
-nh5pgetc_c(hid_t_f *prp_id, _fcd name, int_f *name_len, _fcd value, int_f *value_len);
-
-H5_DLL int_f nh5pexist_c(hid_t_f *prp_id, _fcd name, int_f *name_len);
-H5_DLL int_f nh5pget_size_c(hid_t_f *prp_id, _fcd name, int_f *name_len, size_t_f *size);
-H5_DLL int_f nh5pget_nprops_c(hid_t_f *prp_id, size_t_f *nprops);
-H5_DLL int_f nh5pget_class_parent_c(hid_t_f *prp_id, hid_t_f *parent_id);
-H5_DLL int_f nh5pisa_class_c(hid_t_f *plist, hid_t_f *pclass);
-H5_DLL int_f nh5pcopy_prop_c(hid_t_f *dst_id, hid_t_f *src_id, _fcd name, int_f *name_len);
-H5_DLL int_f nh5premove_c(hid_t_f *plid, _fcd name, int_f *name_len);
-H5_DLL int_f nh5punregister_c(hid_t_f *class, _fcd name, int_f *name_len);
-H5_DLL int_f nh5pclose_class_c(hid_t_f * class);
-H5_DLL int_f nh5pget_class_name_c(hid_t_f *prp_id, _fcd name, int_f *name_len);
-H5_DLL int_f nh5pset_shuffle_c ( hid_t_f *prp_id);
-H5_DLL int_f nh5pset_fletcher32_c ( hid_t_f *prp_id );
-H5_DLL int_f nh5pset_edc_check_c ( hid_t_f *prp_id, int_f *flag );
-H5_DLL int_f nh5pget_edc_check_c ( hid_t_f *prp_id, int_f *flag );
-H5_DLL int_f nh5pset_family_offset_c ( hid_t_f *prp_id , hsize_t_f *offset);
-H5_DLL int_f nh5pget_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, int_f *maxlen_out);
-H5_DLL 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_DLL int_f nh5pset_fapl_multi_sc ( hid_t_f *prp_id , int_f *flag);
-H5_DLL int_f nh5pset_szip_c ( hid_t_f *prp_id , int_f *options_mask, int_f *pixels_per_block);
-H5_DLL int_f nh5pall_filters_avail_c ( hid_t_f *prp_id , int_f *status);
-H5_DLL int_f nh5pfill_value_defined_c ( hid_t_f *prp_id , int_f *flag);
-H5_DLL int_f nh5premove_filter_c ( hid_t_f *prp_id , int_f *filter);
+H5_FCDLL int_f nh5pcreate_c ( hid_t_f *class, hid_t_f *prp_id );
+H5_FCDLL int_f nh5pclose_c ( hid_t_f *prp_id );
+H5_FCDLL int_f nh5pcopy_c ( hid_t_f *prp_id , hid_t_f *new_prp_id);
+H5_FCDLL int_f nh5pequal_c ( hid_t_f *plist1_id , hid_t_f *plist2_id, int_f *c_flag);
+H5_FCDLL int_f nh5pget_class_c ( hid_t_f *prp_id , int_f *classtype);
+H5_FCDLL int_f nh5pset_deflate_c ( hid_t_f *prp_id , int_f *level);
+H5_FCDLL int_f nh5pset_chunk_c ( hid_t_f *prp_id, int_f *rank, hsize_t_f *dims );
+H5_FCDLL int_f nh5pget_chunk_c ( hid_t_f *prp_id, int_f *max_rank, hsize_t_f *dims );
+H5_FCDLL int_f nh5pset_fill_valuec_c (hid_t_f *prp_id, hid_t_f *type_id, _fcd fillvalue);
+H5_FCDLL int_f nh5pset_fill_value_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue);
+H5_FCDLL int_f nh5pget_fill_valuec_c (hid_t_f *prp_id, hid_t_f *type_id, _fcd fillvalue);
+H5_FCDLL int_f nh5pget_fill_value_c (hid_t_f *prp_id, hid_t_f *type_id, void *fillvalue);
+H5_FCDLL int_f nh5pset_preserve_c ( hid_t_f *prp_id , int_f *flag);
+H5_FCDLL int_f nh5pget_preserve_c ( hid_t_f *prp_id , int_f *flag);
+H5_FCDLL int_f nh5pget_version_c (hid_t_f *prp_id, int_f * boot,int_f * freelist, int_f * stab, int_f *shhdr);
+H5_FCDLL int_f nh5pset_userblock_c (hid_t_f *prp_id, hsize_t_f * size);
+H5_FCDLL int_f nh5pget_userblock_c (hid_t_f *prp_id, hsize_t_f * size);
+H5_FCDLL int_f nh5pget_sizes_c (hid_t_f *prp_id, size_t_f * sizeof_addr, size_t_f * sizeof_size);
+H5_FCDLL int_f nh5pset_sizes_c (hid_t_f *prp_id, size_t_f * sizeof_addr, size_t_f * sizeof_size);
+H5_FCDLL int_f nh5pset_sym_k_c (hid_t_f *prp_id, int_f* ik, int_f* lk);
+H5_FCDLL int_f nh5pget_sym_k_c (hid_t_f *prp_id, int_f* ik, int_f* lk);
+H5_FCDLL int_f nh5pset_istore_k_c (hid_t_f *prp_id, int_f* ik);
+H5_FCDLL int_f nh5pget_istore_k_c (hid_t_f *prp_id, int_f* ik);
+H5_FCDLL int_f nh5pget_driver_c (hid_t_f *prp_id, hid_t_f*driver);
+H5_FCDLL int_f nh5pset_fapl_stdio_c (hid_t_f *prp_id);
+H5_FCDLL int_f nh5pget_fapl_stdio_c (hid_t_f *prp_id, int_f* io);
+H5_FCDLL int_f nh5pset_fapl_sec2_c (hid_t_f *prp_id);
+H5_FCDLL int_f nh5pget_fapl_sec2_c (hid_t_f *prp_id, int_f* sec2);
+H5_FCDLL int_f nh5pset_alignment_c(hid_t_f *prp_id, hsize_t_f* threshold, hsize_t_f* alignment);
+H5_FCDLL int_f nh5pget_alignment_c(hid_t_f *prp_id, hsize_t_f* threshold, hsize_t_f* alignment);
+H5_FCDLL int_f nh5pget_fapl_core_c (hid_t_f *prp_id, size_t_f* increment, int_f *flag);
+H5_FCDLL int_f nh5pset_fapl_core_c (hid_t_f *prp_id, size_t_f* increment, int_f *flag);
+H5_FCDLL int_f nh5pset_fapl_family_c (hid_t_f *prp_id, hsize_t_f* memb_size, hid_t_f* memb_plist );
+H5_FCDLL int_f nh5pget_fapl_family_c (hid_t_f *prp_id, hsize_t_f* memb_size, hid_t_f* memb_plist );
+H5_FCDLL int_f nh5pset_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);
+H5_FCDLL 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);
+H5_FCDLL int_f nh5pget_fapl_split_c(hid_t_f *prp_id, size_t_f* meta_ext_size , _fcd meta_ext, hid_t_f* meta_plist, size_t_f* raw_ext_size, _fcd raw_ext, hid_t_f * raw_plist);
+H5_FCDLL int_f nh5pset_fapl_split_c(hid_t_f *prp_id, int_f* meta_len, _fcd meta_ext, hid_t_f* meta_plist, int_f* raw_len, _fcd raw_ext, hid_t_f * raw_plist);
+H5_FCDLL int_f nh5pset_gc_references_c(hid_t_f *prp_id, int_f* gc_references);
+H5_FCDLL int_f nh5pget_gc_references_c(hid_t_f *prp_id, int_f* gc_references);
+H5_FCDLL int_f nh5pset_layout_c (hid_t_f *prp_id, int_f* layout);
+H5_FCDLL int_f nh5pget_layout_c (hid_t_f *prp_id, int_f* layout);
+H5_FCDLL int_f nh5pset_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values );
+H5_FCDLL int_f nh5premove_filter_c (hid_t_f *prp_id, int_f* filter);
+H5_FCDLL int_f nh5pmodify_filter_c (hid_t_f *prp_id, int_f* filter, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values );
+H5_FCDLL int_f nh5pget_nfilters_c (hid_t_f *prp_id, int_f* nfilters);
+H5_FCDLL int_f nh5pget_filter_c(hid_t_f *prp_id, int_f* filter_number, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values, size_t_f *namelen, _fcd name, int_f* filter_id);
+H5_FCDLL int_f nh5pget_filter_by_id_c(hid_t_f *prp_id, int_f* filter_id, int_f* flags, size_t_f* cd_nelmts, int_f* cd_values, size_t_f *namelen, _fcd name);
+H5_FCDLL int_f nh5pset_external_c (hid_t_f *prp_id, _fcd name, int_f* namelen, int_f* offset, hsize_t_f*bytes);
+H5_FCDLL int_f nh5pget_external_count_c (hid_t_f *prp_id, int_f* count);
+H5_FCDLL int_f nh5pget_external_c(hid_t_f *prp_id, int_f *idx, size_t_f* name_size, _fcd name, int_f* offset, hsize_t_f*bytes);
+H5_FCDLL int_f nh5pset_hyper_cache_c(hid_t_f *prp_id, int_f* cache, int_f* limit);
+H5_FCDLL int_f nh5pget_hyper_cache_c(hid_t_f *prp_id, int_f* cache, int_f* limit);
+H5_FCDLL int_f nh5pget_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* right);
+H5_FCDLL int_f nh5pset_btree_ratios_c(hid_t_f *prp_id, real_f* left, real_f* middle, real_f* right);
+H5_FCDLL int_f nh5pget_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info);
+H5_FCDLL int_f nh5pset_fapl_mpio_c(hid_t_f *prp_id, int_f* comm, int_f* info);
+H5_FCDLL int_f nh5pget_fapl_mpiposix_c(hid_t_f *prp_id, int_f* comm, int_f* flag);
+H5_FCDLL int_f nh5pset_fapl_mpiposix_c(hid_t_f *prp_id, int_f* comm, int_f* flag);
+H5_FCDLL int_f nh5pget_dxpl_mpio_rc(hid_t_f *prp_id, int_f* data_xfer_mode);
+H5_FCDLL int_f nh5pset_dxpl_mpio_c(hid_t_f *prp_id, int_f* data_xfer_mode);
+H5_FCDLL int_f nh5pset_fclose_degree_c(hid_t_f *fapl, int_f *degree);
+H5_FCDLL int_f nh5pget_fclose_degree_c(hid_t_f *fapl, int_f *degree);
+H5_FCDLL int_f nh5pget_buffer_c(hid_t_f *plist, hsize_t_f *size);
+H5_FCDLL int_f nh5pset_buffer_c(hid_t_f *plist, hsize_t_f *size);
+H5_FCDLL int_f nh5pfill_value_define_c(hid_t_f *plist, int_f *flag);
+H5_FCDLL int_f nh5pset_alloc_time_c(hid_t_f *plist, int_f *flag);
+H5_FCDLL int_f nh5pget_alloc_time_c(hid_t_f *plist, int_f *flag);
+H5_FCDLL int_f nh5pset_fill_time_c(hid_t_f *plist, int_f *flag);
+H5_FCDLL int_f nh5pget_fill_time_c(hid_t_f *plist, int_f *flag);
+H5_FCDLL int_f nh5pset_meta_block_size_c(hid_t_f *plist, hsize_t_f *size);
+H5_FCDLL int_f nh5pget_meta_block_size_c(hid_t_f *plist, hsize_t_f *size);
+H5_FCDLL int_f nh5pset_sieve_buf_size_c(hid_t_f *plist, size_t_f *size);
+H5_FCDLL int_f nh5pget_sieve_buf_size_c(hid_t_f *plist, size_t_f *size);
+H5_FCDLL int_f nh5pset_small_data_block_size_c(hid_t_f *plist, hsize_t_f *size);
+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 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 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 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 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 );
+H5_FCDLL int_f nh5pset_edc_check_c ( hid_t_f *prp_id, int_f *flag );
+H5_FCDLL int_f nh5pget_edc_check_c ( hid_t_f *prp_id, int_f *flag );
+H5_FCDLL int_f nh5pset_family_offset_c ( hid_t_f *prp_id , hsize_t_f *offset);
+H5_FCDLL int_f nh5pget_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, int_f *maxlen_out);
+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 nh5pfill_value_defined_c ( hid_t_f *prp_id , int_f *flag);
/*
* Functions frome H5Rf.c
@@ -1129,24 +888,12 @@ H5_DLL int_f nh5premove_filter_c ( hid_t_f *prp_id , int_f *filter);
#endif /* DF_CAPFNAMES */
#endif /* H5Rf90_FNAMES */
-H5_DLL int_f
-nh5rcreate_object_c (int_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen);
-
-
-H5_DLL int_f
-nh5rcreate_region_c (int_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *space_id);
-
-H5_DLL int_f
-nh5rdereference_region_c (hid_t_f *dset_id, int_f *ref, hid_t_f *obj_id);
-
-H5_DLL int_f
-nh5rdereference_object_c (hid_t_f *dset_id, int_f *ref, hid_t_f *obj_id);
-
-H5_DLL int_f
-nh5rget_region_region_c (hid_t_f *dset_id, int_f *ref, hid_t_f *space_id);
-
-H5_DLL int_f
-nh5rget_object_type_obj_c (hid_t_f *dset_id, int_f *ref, int_f *obj_type);
+H5_FCDLL int_f nh5rcreate_object_c (int_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen);
+H5_FCDLL int_f nh5rcreate_region_c (int_f *ref, hid_t_f *loc_id, _fcd name, int_f *namelen, hid_t_f *space_id);
+H5_FCDLL int_f nh5rdereference_region_c (hid_t_f *dset_id, int_f *ref, hid_t_f *obj_id);
+H5_FCDLL int_f nh5rdereference_object_c (hid_t_f *dset_id, int_f *ref, hid_t_f *obj_id);
+H5_FCDLL int_f nh5rget_region_region_c (hid_t_f *dset_id, int_f *ref, hid_t_f *space_id);
+H5_FCDLL int_f nh5rget_object_type_obj_c (hid_t_f *dset_id, int_f *ref, int_f *obj_type);
/*
* Functions from H5If.c
@@ -1170,13 +917,12 @@ nh5rget_object_type_obj_c (hid_t_f *dset_id, int_f *ref, int_f *obj_type);
#endif
#endif
-H5_DLL int_f nh5iget_type_c(hid_t_f *obj_id, int_f *type);
-H5_DLL int_f nh5iget_name_c(hid_t_f *obj_id, _fcd buf, size_t_f *buf_size, size_t_f *name_size);
-H5_DLL int_f nh5iinc_ref_c(hid_t_f *obj_id, int_f *ref_count);
-H5_DLL int_f nh5idec_ref_c(hid_t_f *obj_id, int_f *ref_count);
-H5_DLL int_f nh5iget_ref_c(hid_t_f *obj_id, int_f *ref_count);
-H5_DLL int_f nh5iget_file_id_c(hid_t_f *obj_id, hid_t_f *file_id);
-
+H5_FCDLL int_f nh5iget_type_c(hid_t_f *obj_id, int_f *type);
+H5_FCDLL int_f nh5iget_name_c(hid_t_f *obj_id, _fcd buf, size_t_f *buf_size, size_t_f *name_size);
+H5_FCDLL int_f nh5iinc_ref_c(hid_t_f *obj_id, int_f *ref_count);
+H5_FCDLL int_f nh5idec_ref_c(hid_t_f *obj_id, int_f *ref_count);
+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);
#ifndef H5Ef90_FNAMES
# define H5Ef90_FNAMES
@@ -1197,12 +943,12 @@ H5_DLL int_f nh5iget_file_id_c(hid_t_f *obj_id, hid_t_f *file_id);
#endif
#endif
-H5_DLL int_f nh5eclear_c(void);
-H5_DLL int_f nh5eprint_c1(_fcd name, int_f* namelen);
-H5_DLL int_f nh5eprint_c2(void);
-H5_DLL int_f nh5eget_major_c(int_f* error_no, _fcd name);
-H5_DLL int_f nh5eget_minor_c(int_f* error_no, _fcd name);
-H5_DLL int_f nh5eset_auto_c(int_f* printflag);
+H5_FCDLL int_f nh5eclear_c(void);
+H5_FCDLL int_f nh5eprint_c1(_fcd name, int_f* namelen);
+H5_FCDLL int_f nh5eprint_c2(void);
+H5_FCDLL int_f nh5eget_major_c(int_f* error_no, _fcd name);
+H5_FCDLL int_f nh5eget_minor_c(int_f* error_no, _fcd name);
+H5_FCDLL int_f nh5eset_auto_c(int_f* printflag);
/*
* Functions from H5f.c
@@ -1233,24 +979,20 @@ H5_DLL int_f nh5eset_auto_c(int_f* printflag);
# define nh5dont_atexit_c FNAME(h5dont_atexit_c)
#endif
#endif
-H5_DLL int_f nh5open_c(void);
-H5_DLL int_f nh5close_c(void);
-H5_DLL int_f nh5init_types_c(hid_t_f *types, hid_t_f * floatingtypes, hid_t_f * integertypes);
-H5_DLL int_f nh5close_types_c(hid_t_f *types, int_f *lentypes, hid_t_f * floatingtypes, int_f * floatinglen, hid_t_f * integertypes, int_f * integerlen);
-
-H5_DLL int_f nh5init_flags_c( int_f *h5d_flags, int_f *h5e_flags, int_f *h5f_flags,
+
+H5_FCDLL int_f nh5open_c(void);
+H5_FCDLL int_f nh5close_c(void);
+H5_FCDLL int_f nh5init_types_c(hid_t_f *types, hid_t_f * floatingtypes, hid_t_f * integertypes);
+H5_FCDLL int_f nh5close_types_c(hid_t_f *types, int_f *lentypes, hid_t_f * floatingtypes, int_f * floatinglen, hid_t_f * integertypes, int_f * integerlen);
+ H5_FCDLL int_f nh5init_flags_c( int_f *h5d_flags, int_f *h5e_flags, int_f *h5f_flags,
int_f *h5fd_flags, int_f *h5g_flags, int_f *h5i_flags,
int_f *h5p_flags, int_f *h5r_flags, int_f *h5s_flags,
int_f *h5t_flags, int_f *h5z_flags);
-H5_DLL int_f nh5init1_flags_c(int_f *h5lib_flags);
-
-H5_DLL int_f nh5get_libversion_c(int_f *majnum, int_f *minnum, int_f *relnum);
-
-H5_DLL int_f nh5check_version_c(int_f *majnum, int_f *minnum, int_f *relnum);
-
-H5_DLL int_f nh5garbage_collect_c(void);
-
-H5_DLL int_f nh5dont_atexit_c(void);
+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);
+H5_FCDLL int_f nh5dont_atexit_c(void);
/*
* Functions from H5Zf.c
@@ -1260,16 +1002,17 @@ H5_DLL int_f nh5dont_atexit_c(void);
#ifdef DF_CAPFNAMES
# define nh5zunregister_c FNAME(H5ZUNREGISTER_C)
# define nh5zfilter_avail_c FNAME(H5ZFILTER_AVAIL_C)
-# define nh5zget_filter_info_c FNAME(H5ZGET_FILTER_INFO_C)
+# define nh5zget_filter_info_c FNAME(H5ZGET_FILTER_INFO_C)
#else
# define nh5zunregister_c FNAME(h5zunregister_c)
# define nh5zfilter_avail_c FNAME(h5zfilter_avail_c)
-# define nh5zget_filter_info_c FNAME(h5zget_filter_info_c)
+# define nh5zget_filter_info_c FNAME(h5zget_filter_info_c)
#endif
#endif
-H5_DLL int_f nh5zunregister_c (int_f *filter);
-H5_DLL int_f nh5zfilter_avail_c ( int_f *filter , int_f *flag );
-H5_DLL int_f nh5zget_filter_info_c (int_f *filter, int_f *flag );
+
+H5_FCDLL int_f nh5zunregister_c (int_f *filter);
+H5_FCDLL int_f nh5zfilter_avail_c (int_f *filter, int_f *flag);
+H5_FCDLL int_f nh5zget_filter_info_c (int_f *filter, int_f *flag);
#endif /* _H5f90proto_H */
diff --git a/fortran/src/Makefile.in b/fortran/src/Makefile.in
index 80c9945..508870c 100644
--- a/fortran/src/Makefile.in
+++ b/fortran/src/Makefile.in
@@ -43,7 +43,7 @@ ADD_PARALLEL_FILES=@ADD_PARALLEL_FILES@
FPAR_MOD=${ADD_PARALLEL_FILES:yes=HDF5mpio.f90}
CPARALLEL=${ADD_PARALLEL_FILES:yes=H5FDmpiof.c}
-CLIB_SRC=H5f90kit.c H5_f.c H5Git.c H5Rf.c H5Ff.c H5Sf.c H5Df.c H5Gf.c \
+CLIB_SRC=H5f90kit.c H5_f.c H5Rf.c H5Ff.c H5Sf.c H5Df.c H5Gf.c \
H5Af.c H5Tf.c H5Pf.c H5If.c H5Ef.c H5Zf.c ${CPARALLEL:no=}
FPARALLEL=${ADD_PARALLEL_FILES:yes=H5FDmpioff.f90}
diff --git a/fortran/test/Makefile.in b/fortran/test/Makefile.in
index 920f06f..7359230 100644
--- a/fortran/test/Makefile.in
+++ b/fortran/test/Makefile.in
@@ -51,12 +51,12 @@ MOSTLYCLEAN=*.h5 *.tmp
$(TEST_PROGS): $(LIB) $(FLIB)
fortranlib_test: $(FORTLIBTEST_OBJ)
- @$(LT_LINK_FEXE) $(FFLAGS) -o $@ $(FORTLIBTEST_OBJ) $(LIB) $(TCLIB) $(FLIB) $(LIBS) $(HDF5LIB)
+ @$(LT_LINK_FEXE) $(FFLAGS) -o $@ $(FORTLIBTEST_OBJ) $(LIB) $(TCLIB) $(FLIB) $(LIBS) $(HDF5LIB)
fflush1: fflush1.lo
- @$(LT_LINK_FEXE) $(FFLAGS) -o $@ fflush1.lo $(LIB) $(TCLIB) $(FLIB) $(LIBS) $(HDF5LIB)
+ @$(LT_LINK_FEXE) $(FFLAGS) -o $@ fflush1.lo $(LIB) $(TCLIB) $(FLIB) $(LIBS) $(HDF5LIB)
fflush2: fflush2.lo
- @$(LT_LINK_FEXE) $(FFLAGS) -o $@ fflush2.lo $(LIB) $(TCLIB) $(FLIB) $(LIBS) $(HDF5LIB)
+ @$(LT_LINK_FEXE) $(FFLAGS) -o $@ fflush2.lo $(LIB) $(TCLIB) $(FLIB) $(LIBS) $(HDF5LIB)
@CONCLUDE@
diff --git a/fortran/test/fflush1.f90 b/fortran/test/fflush1.f90
index cede399..52efb21 100644
--- a/fortran/test/fflush1.f90
+++ b/fortran/test/fflush1.f90
@@ -82,7 +82,7 @@
!data buffers
!
INTEGER, DIMENSION(NX,NY) :: data_in, data_out
- INTEGER(HSIZE_T), DIMENSION(7) :: data_dims
+ INTEGER(HSIZE_T), DIMENSION(2) :: data_dims
data_dims(1) = NX
data_dims(2) = NY
@@ -145,7 +145,7 @@
! if errors detected, exit with non-zero code. This is not truly fortran
! standard but likely supported by most fortran compilers.
-! IF (total_error .ne. 0) CALL exit (total_error)
+ IF (total_error .ne. 0) CALL h5_exit_f (total_error)
001 STOP
diff --git a/fortran/test/fflush2.f90 b/fortran/test/fflush2.f90
index a04f56a..313a2a5 100644
--- a/fortran/test/fflush2.f90
+++ b/fortran/test/fflush2.f90
@@ -79,7 +79,7 @@
!data buffers
!
INTEGER, DIMENSION(NX,NY) :: data_out
- INTEGER(HSIZE_T), DIMENSION(7) :: data_dims
+ INTEGER(HSIZE_T), DIMENSION(2) :: data_dims
data_dims(1) = NX
data_dims(2) = NY
@@ -178,6 +178,6 @@
! if errors detected, exit with non-zero code. This is not truly fortran
! standard but likely supported by most fortran compilers.
-! IF (total_error .ne. 0) CALL exit (total_error)
+ IF (total_error .ne. 0) CALL h5_exit_f (total_error)
END PROGRAM FFLUSH2EXAMPLE
diff --git a/fortran/test/t.c b/fortran/test/t.c
index 4f19ea4..0299869 100644
--- a/fortran/test/t.c
+++ b/fortran/test/t.c
@@ -28,11 +28,10 @@
* Modifications:
*---------------------------------------------------------------------------*/
int_f
-nh5_fixname_c(_fcd base_name, int_f *base_namelen, hid_t_f* fapl, _fcd full_name, int_f *full_namelen)
+nh5_fixname_c(_fcd base_name, size_t_f *base_namelen, hid_t_f* fapl, _fcd full_name, size_t_f *full_namelen)
{
int ret_value = -1;
char *c_base_name;
- int c_base_namelen;
char *c_full_name;
hid_t c_fapl;
@@ -43,20 +42,20 @@ nh5_fixname_c(_fcd base_name, int_f *base_namelen, hid_t_f* fapl, _fcd full_name
/*
* Convert FORTRAN name to C name
*/
- c_base_namelen = *base_namelen;
- c_base_name = (char *)HD5f2cstring(base_name, c_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(*full_namelen + 1);
+ c_full_name = (char *) HDmalloc((size_t)*full_namelen + 1);
if (c_full_name == NULL) goto DONE;
/*
* Call h5_fixname function.
*/
- if (NULL != h5_fixname(c_base_name, c_fapl, c_full_name, *full_namelen + 1)) {
- HD5packFstring(c_full_name, _fcdtocp(full_name), *full_namelen);
- ret_value = 0;
- goto DONE;
+ 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);
+ ret_value = 0;
+ goto DONE;
}
+
DONE:
if (NULL != c_base_name) HDfree(c_base_name);
if (NULL != c_full_name) HDfree(c_full_name);
@@ -75,12 +74,11 @@ DONE:
* Modifications:
*---------------------------------------------------------------------------*/
int_f
-nh5_cleanup_c(_fcd base_name, int_f *base_namelen, hid_t_f* fapl)
+nh5_cleanup_c(_fcd base_name, size_t_f *base_namelen, hid_t_f* fapl)
{
char filename[1024];
int ret_value = -1;
char *c_base_name[1];
- int c_base_namelen;
hid_t c_fapl;
/*
@@ -91,8 +89,7 @@ nh5_cleanup_c(_fcd base_name, int_f *base_namelen, hid_t_f* fapl)
/*
* Convert FORTRAN name to C name
*/
- c_base_namelen = *base_namelen;
- c_base_name[0] = (char *)HD5f2cstring(base_name, c_base_namelen);
+ c_base_name[0] = (char *)HD5f2cstring(base_name, (size_t)*base_namelen);
if (c_base_name[0] == NULL) goto DONE;
/*
@@ -104,10 +101,27 @@ nh5_cleanup_c(_fcd base_name, int_f *base_namelen, hid_t_f* fapl)
}
*/
h5_fixname(c_base_name[0], c_fapl, filename, sizeof(filename));
- remove(filename);
+ HDremove(filename);
ret_value =0;
+
DONE:
if (NULL != c_base_name[0]) HDfree(c_base_name[0]);
return ret_value;
}
+
+/*----------------------------------------------------------------------------
+ * Name: h5_exit_c
+ * Purpose: Call 'exit()' to terminate application
+ * Inputs: status - status for exit() to return
+ * Returns: none
+ * Programmer: Quincey Koziol
+ * Tuesday, December 14, 2004
+ * Modifications:
+ *---------------------------------------------------------------------------*/
+void
+nh5_exit_c(int_f *status)
+{
+ HDexit((int)*status);
+} /* h5_exit_c */
+
diff --git a/fortran/test/t.h b/fortran/test/t.h
index 2dd5545..0286028 100644
--- a/fortran/test/t.h
+++ b/fortran/test/t.h
@@ -24,13 +24,19 @@ char *h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size)
#ifdef DF_CAPFNAMES
# define nh5_fixname_c FNAME(H5_FIXNAME_C)
# define nh5_cleanup_c FNAME(H5_CLEANUP_C)
+# define nh5_exit_c FNAME(H5_EXIT_C)
#else /* !DF_CAPFNAMES */
# define nh5_fixname_c FNAME(h5_fixname_c)
# define nh5_cleanup_c FNAME(h5_cleanup_c)
+# define nh5_exit_c FNAME(h5_exit_c)
#endif /* DF_CAPFNAMES */
- H5_FCTESTDLL int_f nh5_fixname_c
-(_fcd base_name, int_f *base_namelen, hid_t_f *fapl, _fcd full_name, int_f *full_namelen);
+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
+(_fcd base_name, size_t_f *base_namelen, hid_t_f *fapl);
+
+H5_FCTESTDLL void nh5_exit_c
+(int_f *status);
- H5_FCTESTDLL int_f nh5_cleanup_c
-(_fcd base_name, int_f *base_namelen, hid_t_f *fapl);
diff --git a/fortran/test/tH5A.f90 b/fortran/test/tH5A.f90
index 59036a5..7fcac8e 100644
--- a/fortran/test/tH5A.f90
+++ b/fortran/test/tH5A.f90
@@ -183,7 +183,7 @@
CALL h5tcopy_f(H5T_NATIVE_CHARACTER, atype2_id, error)
CALL check("h5tcopy_f",error,total_error)
!
- ! Create datatype for the DOulble attribute.
+ ! Create datatype for the Double attribute.
!
CALL h5tcopy_f(H5T_NATIVE_DOUBLE, atype3_id, error)
CALL check("h5tcopy_f",error,total_error)
diff --git a/fortran/test/tH5F.f90 b/fortran/test/tH5F.f90
index 8451205..d1e0064 100644
--- a/fortran/test/tH5F.f90
+++ b/fortran/test/tH5F.f90
@@ -407,7 +407,7 @@
!
CALL h5dopen_f(reopen_id, dsetname, dset_id, error)
CALL check("h5dopen_f",error,total_error)
-
+ !
!Get file name from the dataset identifier
!
CALL h5fget_name_f(dset_id, file_name, name_size, error)
diff --git a/fortran/test/tH5G.f90 b/fortran/test/tH5G.f90
index e22b4c7..ea8460c 100644
--- a/fortran/test/tH5G.f90
+++ b/fortran/test/tH5G.f90
@@ -58,7 +58,7 @@
CHARACTER(LEN=100) :: commentout !comment to the file
INTEGER :: nmembers
INTEGER :: obj_type
- INTEGER(HSIZE_T), DIMENSION(7) :: data_dims
+ INTEGER(HSIZE_T), DIMENSION(2) :: data_dims
!
! Create the file.
!
diff --git a/fortran/test/tH5I.f90 b/fortran/test/tH5I.f90
index 94b1698..8790bc3 100644
--- a/fortran/test/tH5I.f90
+++ b/fortran/test/tH5I.f90
@@ -51,7 +51,7 @@
INTEGER :: type !object identifier
INTEGER :: error ! Error flag
- INTEGER(HSIZE_T), DIMENSION(7) :: data_dims
+ INTEGER(HSIZE_T), DIMENSION(2) :: data_dims
CHARACTER(LEN=80) name_buf
CHARACTER(LEN=280) name_buf1
INTEGER(SIZE_T) buf_size
@@ -88,6 +88,9 @@
CALL h5dcreate_f(file_id, dsetname, H5T_NATIVE_INTEGER, dspace_id, &
dset_id, error)
CALL check("h5dcreate_f",error,total_error)
+ !
+ ! Get dataset name from dataset identifier
+ !
buf_size = 80
CALL h5iget_name_f(dset_id, name_buf, buf_size, name_size, error)
CALL check("h5iget_name_f",error,total_error)
@@ -114,7 +117,6 @@
total_error = total_error + 1
endif
-
!
! Write data_in to the dataset
!
diff --git a/fortran/test/tH5R.f90 b/fortran/test/tH5R.f90
index bc7818a..d4f2911 100644
--- a/fortran/test/tH5R.f90
+++ b/fortran/test/tH5R.f90
@@ -219,17 +219,17 @@
INTEGER :: error
TYPE(hdset_reg_ref_t_f) , DIMENSION(2) :: ref ! Buffers to store references
TYPE(hdset_reg_ref_t_f) , DIMENSION(2) :: ref_out !
- INTEGER(HSIZE_T), DIMENSION(7) :: ref_dim
- INTEGER(HSIZE_T), DIMENSION(7) :: data_dims
+ INTEGER(HSIZE_T), DIMENSION(2) :: ref_dim
+ INTEGER(HSIZE_T), DIMENSION(2) :: data_dims
INTEGER(HSIZE_T), DIMENSION(2) :: dims = (/2,9/) ! Datasets dimensions
INTEGER(HSIZE_T), DIMENSION(1) :: dimsr = (/2/) !
- INTEGER(HSSIZE_T), DIMENSION(2) :: start
+ INTEGER(HSIZE_T), DIMENSION(2) :: start
INTEGER(HSIZE_T), DIMENSION(2) :: count
INTEGER :: rankr = 1
INTEGER :: rank = 2
INTEGER , DIMENSION(2,9) :: data
INTEGER , DIMENSION(2,9) :: data_out = 0
- INTEGER(HSSIZE_T) , DIMENSION(2,3) :: coord
+ INTEGER(HSIZE_T) , DIMENSION(2,3) :: coord
INTEGER(SIZE_T) ::num_points = 3 ! Number of selected points
INTEGER :: i, j
coord = reshape((/1,1,2,7,1,9/), (/2,3/)) ! Coordinates of selected points
diff --git a/fortran/test/tH5Sselect.f90 b/fortran/test/tH5Sselect.f90
index ad95ecf..690e957 100644
--- a/fortran/test/tH5Sselect.f90
+++ b/fortran/test/tH5Sselect.f90
@@ -371,7 +371,7 @@
!
!Points positions in the file
!
- INTEGER(HSSIZE_T), DIMENSION(RANK,NUMP) :: coord
+ INTEGER(HSIZE_T), DIMENSION(RANK,NUMP) :: coord
!
!data buffers
@@ -760,7 +760,7 @@
!
!array to give selected points' coordinations
!
- INTEGER(HSSIZE_T), DIMENSION(RANK, NUMPS) :: coord
+ INTEGER(HSIZE_T), DIMENSION(RANK, NUMPS) :: coord
!
!Size of the hyperslab in memory
@@ -793,7 +793,7 @@
!
!start and end bounds in the current dataspace selection
!
- INTEGER(HSSIZE_T), DIMENSION(RANK) :: startout, endout
+ INTEGER(HSIZE_T), DIMENSION(RANK) :: startout, endout
!
!data to write
diff --git a/fortran/test/tH5Z.f90 b/fortran/test/tH5Z.f90
index 41bcfd6..c64d99b 100644
--- a/fortran/test/tH5Z.f90
+++ b/fortran/test/tH5Z.f90
@@ -23,8 +23,8 @@
INTEGER, INTENT(OUT) :: total_error
LOGICAL :: status, status1
INTEGER(HID_T) :: crtpr_id, xfer_id
- INTEGER :: error
INTEGER :: nfilters
+ INTEGER :: error
INTEGER(HSIZE_T) :: ch_dims(2)
INTEGER :: RANK = 2
INTEGER :: dlevel = 6
@@ -180,21 +180,20 @@
INTEGER :: num_errors = 0 ! Number of data errors
INTEGER :: i, j !general purpose integers
- INTEGER(HSIZE_T), DIMENSION(2) :: data_dims_b
INTEGER(HSIZE_T), DIMENSION(2) :: data_dims
INTEGER(HID_T) :: crp_list
INTEGER :: options_mask, pix_per_block
LOGICAL :: flag
CHARACTER(LEN=4) filter_name
-
+
INTEGER :: filter_flag = -1
INTEGER(SIZE_T) :: cd_nelemnts = 4
INTEGER(SIZE_T) :: filter_name_len = 4
INTEGER, DIMENSION(4) :: cd_values
- INTEGER :: config_flag = 0
+ INTEGER :: config_flag = 0 ! for h5zget_filter_info_f
!
- ! Make sure that Szip has an encoder available
+ ! Verify that SZIP exists and has an encoder
!
CALL h5zget_filter_info_f(H5Z_FILTER_SZIP_F, config_flag, error)
CALL check("h5zget_filter_info", error, total_error)
@@ -285,9 +284,9 @@
!
! Write the dataset.
!
- data_dims_b(1) = N
- data_dims_b(2) = M
- CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, dset_data, data_dims_b, error)
+ data_dims(1) = N
+ data_dims(2) = M
+ CALL h5dwrite_f(dset_id, H5T_NATIVE_INTEGER, dset_data, data_dims, error)
CALL check("h5dwrite_f", error, total_error)
@@ -338,7 +337,7 @@
!
! Read the dataset.
!
- CALL h5dread_f (dset_id, H5T_NATIVE_INTEGER, data_out, data_dims_b, error)
+ CALL h5dread_f (dset_id, H5T_NATIVE_INTEGER, data_out, data_dims, error)
CALL check("h5dread_f", error, total_error)
!
diff --git a/fortran/test/tf.f90 b/fortran/test/tf.f90
index 3a72571..057d47c 100644
--- a/fortran/test/tf.f90
+++ b/fortran/test/tf.f90
@@ -80,8 +80,8 @@
INTEGER, INTENT(OUT) :: hdferr ! Error code
INTEGER(HID_T), INTENT(IN) :: fapl ! file access property list
- INTEGER :: base_namelen ! Length of the base name character string
- INTEGER :: full_namelen ! Length of the full name character string
+ INTEGER(SIZE_T) :: base_namelen ! Length of the base name character string
+ INTEGER(SIZE_T) :: full_namelen ! Length of the full name character string
! INTEGER(HID_T) :: fapl_default
INTERFACE
@@ -94,10 +94,10 @@
!DEC$ATTRIBUTES reference :: base_name
!DEC$ATTRIBUTES reference :: full_name
CHARACTER(LEN=*), INTENT(IN) :: base_name
- INTEGER :: base_namelen
+ INTEGER(SIZE_T) :: base_namelen
INTEGER(HID_T), INTENT(IN) :: fapl
CHARACTER(LEN=*), INTENT(IN) :: full_name
- INTEGER :: full_namelen
+ INTEGER(SIZE_T) :: full_namelen
END FUNCTION h5_fixname_c
END INTERFACE
@@ -139,7 +139,7 @@
INTEGER, INTENT(OUT) :: hdferr ! Error code
INTEGER(HID_T), INTENT(IN) :: fapl ! file access property list
- INTEGER :: base_namelen ! Length of the base name character string
+ INTEGER(SIZE_T) :: base_namelen ! Length of the base name character string
INTERFACE
INTEGER FUNCTION h5_cleanup_c(base_name, base_namelen, fapl)
@@ -149,7 +149,7 @@
!DEC$ ENDIF
!DEC$ATTRIBUTES reference :: base_name
CHARACTER(LEN=*), INTENT(IN) :: base_name
- INTEGER :: base_namelen
+ INTEGER(SIZE_T) :: base_namelen
INTEGER(HID_T), INTENT(IN) :: fapl
END FUNCTION h5_cleanup_c
END INTERFACE
@@ -158,3 +158,43 @@
hdferr = h5_cleanup_c(base_name, base_namelen, fapl)
END SUBROUTINE h5_cleanup_f
+
+!----------------------------------------------------------------------
+! Name: h5_exit_f
+!
+! Purpose: Exit application
+! It is a fortran counterpart for the standard C 'exit()' routine
+!
+! Inputs:
+! status - Status to return from application
+!
+! Outputs:
+! none
+!
+! Programmer: Quincey Koziol
+! December 14, 2004
+!
+!
+!----------------------------------------------------------------------
+ SUBROUTINE h5_exit_f(status)
+!
+!This definition is needed for Windows DLLs
+!DEC$if defined(BUILD_HDF5_DLL)
+!DEC$attributes dllexport :: h5_exit_f
+!DEC$endif
+ IMPLICIT NONE
+ INTEGER, INTENT(IN) :: status ! Return code
+
+ INTERFACE
+ SUBROUTINE h5_exit_c(status)
+ !DEC$ IF DEFINED(HDF5F90_WINDOWS)
+ !MS$ATTRIBUTES C,reference,alias:'_H5_EXIT_C':: h5_exit_c
+ !DEC$ ENDIF
+ INTEGER, INTENT(IN) :: status
+ END SUBROUTINE h5_exit_c
+ END INTERFACE
+
+ CALL h5_exit_c(status)
+
+ END SUBROUTINE h5_exit_f
+
diff --git a/hl/src/H5IM.c b/hl/src/H5IM.c
index a2b8172..4d5ce75 100644
--- a/hl/src/H5IM.c
+++ b/hl/src/H5IM.c
@@ -535,10 +535,7 @@ herr_t H5IMlink_palette( hid_t loc_id,
hobj_ref_t *refbuf; /* buffer to read references */
hssize_t n_refs;
hsize_t dim_ref;
- int ok_pal, has_pal;
-
- /* Try to find the palette dataset */
- has_pal = H5LTfind_dataset( loc_id, pal_name );
+ int ok_pal;
/* 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.
@@ -888,7 +885,6 @@ herr_t H5IMget_palette_info( hid_t loc_id,
hsize_t dim_ref;
hobj_ref_t *refbuf; /* buffer to read references */
hid_t pal_id;
- int rank;
hid_t pal_space_id;
hsize_t pal_maxdims[2];
@@ -938,7 +934,7 @@ herr_t H5IMget_palette_info( hid_t loc_id,
if ( (pal_space_id = H5Dget_space( pal_id )) < 0 )
goto out;
- if ( (rank = H5Sget_simple_extent_ndims( pal_space_id )) < 0 )
+ if ( H5Sget_simple_extent_ndims( pal_space_id ) < 0 )
goto out;
if ( H5Sget_simple_extent_dims( pal_space_id, pal_dims, pal_maxdims ) < 0 )
@@ -1114,7 +1110,6 @@ herr_t H5IMis_image( hid_t loc_id,
int has_class;
hid_t attr_type;
hid_t attr_id;
- hid_t attr_class;
char attr_data[20];
herr_t ret;
@@ -1143,7 +1138,7 @@ herr_t H5IMis_image( hid_t loc_id,
if ( (attr_type = H5Aget_type( attr_id )) < 0 )
goto out;
- if ( (attr_class = H5Tget_class( attr_type )) < 0 )
+ if ( H5Tget_class( attr_type ) < 0 )
goto out;
if ( H5Aread( attr_id, attr_type, attr_data ) < 0 )
@@ -1203,7 +1198,6 @@ herr_t H5IMis_palette( hid_t loc_id,
int has_class;
hid_t attr_type;
hid_t attr_id;
- hid_t attr_class;
char attr_data[20];
herr_t ret;
@@ -1232,7 +1226,7 @@ herr_t H5IMis_palette( hid_t loc_id,
if ( (attr_type = H5Aget_type( attr_id )) < 0 )
goto out;
- if ( (attr_class = H5Tget_class( attr_type )) < 0 )
+ if ( H5Tget_class( attr_type ) < 0 )
goto out;
if ( H5Aread( attr_id, attr_type, attr_data ) < 0 )
diff --git a/hl/src/H5TA.c b/hl/src/H5TA.c
index 79a845b..f90819c 100644
--- a/hl/src/H5TA.c
+++ b/hl/src/H5TA.c
@@ -305,10 +305,9 @@ herr_t H5TBappend_records( hid_t loc_id,
hid_t tid=-1;
hid_t mem_type_id=-1;
hsize_t count[1];
- hssize_t offset[1];
+ hsize_t offset[1];
hid_t sid=-1;
hid_t mem_space_id=-1;
- int rank;
hsize_t dims[1];
hsize_t mem_dims[1];
hsize_t nrecords_orig;
@@ -346,7 +345,7 @@ herr_t H5TBappend_records( hid_t loc_id,
return -1;
/* Get the dimensions */
- if ( (rank = H5Sget_simple_extent_dims( sid, dims, NULL )) != 1 )
+ if ( H5Sget_simple_extent_dims( sid, dims, NULL ) != 1 )
goto out;
/* Define a hyperslab in the dataset */
@@ -426,7 +425,7 @@ herr_t H5TBwrite_records( hid_t loc_id,
hid_t did;
hid_t tid;
hsize_t count[1];
- hssize_t offset[1];
+ hsize_t offset[1];
hid_t sid=-1;
hid_t mem_space_id=-1;
hsize_t mem_size[1];
@@ -540,7 +539,7 @@ herr_t H5TBwrite_fields_name( hid_t loc_id,
hid_t member_type_id;
hid_t nmtype_id;
hsize_t count[1];
- hssize_t offset[1];
+ hsize_t offset[1];
hid_t sid=-1;
char *member_name;
hssize_t nfields;
@@ -710,10 +709,9 @@ herr_t H5TBwrite_fields_index( hid_t loc_id,
hid_t member_type_id;
hid_t nmtype_id;
hsize_t count[1];
- hssize_t offset[1];
+ hsize_t offset[1];
hid_t sid=-1;
char *member_name;
- int nmenbers;
hsize_t i, j;
hid_t PRESERVE;
size_t size_native;
@@ -733,7 +731,7 @@ herr_t H5TBwrite_fields_index( hid_t loc_id,
goto out;
/* Get the number of fields */
- if ( ( nmenbers = H5Tget_nmembers( tid )) < 0 )
+ if ( H5Tget_nmembers( tid ) < 0 )
goto out;
/* Create a write id */
@@ -954,7 +952,7 @@ herr_t H5TBread_records( hid_t loc_id,
hid_t ftype_id;
hid_t mem_type_id=-1;
hsize_t count[1];
- hssize_t offset[1];
+ hsize_t offset[1];
hid_t sid=-1;
hsize_t dims[1];
hid_t mem_space_id=-1;
@@ -1071,7 +1069,7 @@ herr_t H5TBread_fields_name( hid_t loc_id,
char *member_name;
hssize_t nfields;
hsize_t count[1];
- hssize_t offset[1];
+ hsize_t offset[1];
hid_t sid=-1;
hid_t mem_space_id=-1;
hsize_t mem_size[1];
@@ -1224,10 +1222,9 @@ herr_t H5TBread_fields_index( hid_t loc_id,
hid_t read_type_id=-1;
hid_t member_type_id;
hid_t nmtype_id;
- hssize_t member_size;
char *member_name;
hsize_t count[1];
- hssize_t offset[1];
+ hsize_t offset[1];
hid_t sid=-1;
hid_t mem_space_id=-1;
hsize_t mem_size[1];
@@ -1259,7 +1256,7 @@ herr_t H5TBread_fields_index( hid_t loc_id,
goto out;
/* Get the member size */
- if ( ( member_size = H5Tget_size( member_type_id )) < 0 )
+ if ( H5Tget_size( member_type_id ) == 0 )
goto out;
/* Convert to native type */
@@ -1387,7 +1384,7 @@ herr_t H5TBdelete_record( hid_t loc_id,
hid_t did;
hid_t tid;
hsize_t count[1];
- hssize_t offset[1];
+ hsize_t offset[1];
hid_t sid;
hid_t mem_space_id;
hsize_t mem_size[1];
@@ -1558,7 +1555,7 @@ herr_t H5TBinsert_record( hid_t loc_id,
hid_t tid=-1;
hid_t mem_type_id=-1;
hsize_t count[1];
- hssize_t offset[1];
+ hsize_t offset[1];
hid_t sid=-1;
hid_t mem_space_id=-1;
hsize_t dims[1];
@@ -1719,10 +1716,10 @@ herr_t H5TBadd_records_from( hid_t loc_id,
hid_t type_id1;
hid_t space_id1=-1;
hid_t mem_space_id1=-1;
- hssize_t type_size1;
+ size_t type_size1;
hsize_t count[1];
- hssize_t offset[1];
+ hsize_t offset[1];
hsize_t mem_size[1];
hsize_t nfields;
hsize_t ntotal_records;
@@ -1768,10 +1765,10 @@ herr_t H5TBadd_records_from( hid_t loc_id,
goto out;
/* Get the size of the datatype */
- if ( ( type_size1 = H5Tget_size( type_id1 )) < 0 )
+ if ( ( type_size1 = H5Tget_size( type_id1 )) == 0 )
goto out;
- tmp_buf = (unsigned char *)calloc((size_t)nrecords, (size_t)type_size1 );
+ tmp_buf = (unsigned char *)calloc((size_t)nrecords, type_size1 );
/* Define a hyperslab in the dataset of the size of the records */
offset[0] = start1;
@@ -1877,7 +1874,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1,
hid_t plist_id3;
hsize_t count[1];
- hssize_t offset[1];
+ hsize_t offset[1];
hid_t mem_space_id;
hsize_t mem_size[1];
hsize_t nfields;
@@ -1889,7 +1886,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1,
size_t type_size;
hid_t sid;
hid_t member_type_id;
- hssize_t member_offset;
+ size_t member_offset;
char attr_name[255];
hid_t attr_id;
char aux[255];
@@ -2012,8 +2009,7 @@ herr_t H5TBcombine_tables( hid_t loc_id1,
goto out;
/* Get the member offset */
- if ( ( member_offset = H5Tget_member_offset( type_id3, (unsigned) i )) < 0 )
- goto out;
+ member_offset = H5Tget_member_offset( type_id3, (unsigned) i );
strcpy( attr_name, "FIELD_" );
sprintf( aux, "%d", (int) i );
@@ -2260,15 +2256,14 @@ herr_t H5TBinsert_field( hid_t loc_id,
size_t member_size;
size_t new_member_size = 0;
char *member_name;
- hssize_t total_size;
+ size_t total_size;
hsize_t nfields;
hsize_t nrecords;
- int rank_chunk;
hsize_t dims_chunk[1];
hsize_t dims[1];
hsize_t maxdims[1] = { H5S_UNLIMITED };
hsize_t count[1];
- hssize_t offset[1];
+ hsize_t offset[1];
hsize_t mem_size[1];
hid_t write_type_id;
hid_t PRESERVE;
@@ -2276,7 +2271,7 @@ herr_t H5TBinsert_field( hid_t loc_id,
int inserted;
hsize_t idx;
char table_title[255];
- hssize_t member_offset;
+ size_t member_offset;
char attr_name[255];
hid_t attr_id;
char aux[255];
@@ -2306,7 +2301,7 @@ herr_t H5TBinsert_field( hid_t loc_id,
goto out;
/* Get the size of the datatype */
- if ( ( total_size = H5Tget_size( type_id1 )) < 0 )
+ if ( ( total_size = H5Tget_size( type_id1 )) == 0 )
goto out;
/* Get the dataspace handle */
@@ -2327,7 +2322,7 @@ herr_t H5TBinsert_field( hid_t loc_id,
goto out;
/* alloc fill value attribute buffer */
- tmp_fill_buf = (unsigned char *)malloc((size_t) total_size );
+ tmp_fill_buf = (unsigned char *)malloc(total_size );
/* Get the fill value attributes */
if ( (H5TBAget_fill( loc_id, dset_name, dataset_id1, tmp_fill_buf )) < 0 )
@@ -2405,7 +2400,7 @@ herr_t H5TBinsert_field( hid_t loc_id,
*/
/* Retrieve the size of chunk */
- if ( ( rank_chunk = H5Pget_chunk( plist_id1, 1, dims_chunk )) < 0 )
+ if ( H5Pget_chunk( plist_id1, 1, dims_chunk ) < 0 )
goto out;
/* Create a new simple data space with unlimited size, using the dimension */
@@ -2593,8 +2588,7 @@ herr_t H5TBinsert_field( hid_t loc_id,
goto out;
/* Get the member offset */
- if ( ( member_offset = H5Tget_member_offset( type_id1, (unsigned) i )) < 0 )
- goto out;
+ member_offset = H5Tget_member_offset( type_id1, (unsigned) i );
strcpy( attr_name, "FIELD_" );
sprintf( aux, "%d", (int)i );
@@ -2714,7 +2708,6 @@ herr_t H5TBdelete_field( hid_t loc_id,
size_t type_size2;
hsize_t nfields;
hsize_t nrecords;
- int rank_chunk;
hsize_t dims_chunk[1];
hsize_t dims[1];
hsize_t maxdims[1] = { H5S_UNLIMITED };
@@ -2892,7 +2885,7 @@ herr_t H5TBdelete_field( hid_t loc_id,
*/
/* Retrieve the size of chunk */
- if ( ( rank_chunk = H5Pget_chunk( plist_id1, 1, dims_chunk )) < 0 )
+ if ( H5Pget_chunk( plist_id1, 1, dims_chunk ) < 0 )
goto out;
/* Create a new simple data space with unlimited size, using the dimension */
diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in
index 07b8020..362c3ff 100644
--- a/hl/src/Makefile.in
+++ b/hl/src/Makefile.in
@@ -10,7 +10,7 @@ srcdir=@srcdir@
@COMMENCE@
## Add `-I.' to the C preprocessor flags.
-CPPFLAGS=-I. -I$(srcdir) -I$(top_builddir)/src -I$(top_srcdir)/src -I$(top_srcdir)/tools/lib @CPPFLAGS@
+CPPFLAGS=-I. -I$(srcdir) -I$(top_builddir)/src -I$(top_srcdir)/src -I$(top_srcdir)/hl/src @CPPFLAGS@
## This is our main target, but also remove the settings file when cleaning.
LIB=libhdf5_hl.la
diff --git a/hl/test/test_image.c b/hl/test/test_image.c
index d47cab1..c01dd0d 100644
--- a/hl/test/test_image.c
+++ b/hl/test/test_image.c
@@ -31,15 +31,12 @@ unsigned char image_out2[ WIDTH*HEIGHT*3 ];
int main( void )
{
hid_t file_id;
- herr_t status;
hsize_t width, height, planes;
hsize_t pal_dims[] = {9,3};
hsize_t pal_dims_out[2];
hsize_t i;
char interlace[20];
hssize_t npals;
- herr_t is_image;
- herr_t is_palette;
unsigned char pal_data_out[9*3];
/* create a 9 entry grey palette */
@@ -165,10 +162,10 @@ int main( void )
*-------------------------------------------------------------------------
*/
- if ( (is_image = H5IMis_image( file_id, "Image1" )) < 0 )
+ if ( H5IMis_image( file_id, "Image1" ) < 0 )
goto out;
- if ( (is_image = H5IMis_image( file_id, "Image2" )) < 0 )
+ if ( H5IMis_image( file_id, "Image2" ) < 0 )
goto out;
/*-------------------------------------------------------------------------
@@ -176,7 +173,7 @@ int main( void )
*-------------------------------------------------------------------------
*/
- if ( (is_palette = H5IMis_palette( file_id, "Pallete" )) < 0 )
+ if ( H5IMis_palette( file_id, "Pallete" ) < 0 )
goto out;
/*-------------------------------------------------------------------------
@@ -185,7 +182,7 @@ int main( void )
*/
/* Close the file. */
- status = H5Fclose( file_id );
+ if(H5Fclose( file_id ) < 0) goto out;
PASSED();
return 0;
diff --git a/hl/test/test_table.c b/hl/test/test_table.c
index b791fe1..57b3791 100644
--- a/hl/test/test_table.c
+++ b/hl/test/test_table.c
@@ -934,9 +934,9 @@ int test_table(hid_t fid, int write)
rbuf[i].longi != position_in[i].longi ||
rbuf[i].pressure != pressure_in[i] )
{
- fprintf(stderr,"%d %f %d\n",
+ fprintf(stderr,"%ld %f %d\n",
rbuf[i].longi,rbuf[i].pressure,rbuf[i].lati);
- fprintf(stderr,"%d %f %d\n",
+ fprintf(stderr,"%ld %f %d\n",
position_in[i].longi,pressure_in[i],position_in[i].lati);
goto out;
}
@@ -1560,9 +1560,9 @@ static int cmp_par(hsize_t i, hsize_t j, particle_t *rbuf, particle_t *wbuf )
rbuf[i].pressure != wbuf[j].pressure ||
rbuf[i].temperature != wbuf[j].temperature ) {
fprintf(stderr,"read and write buffers have differences\n");
- fprintf(stderr,"%s %d %f %f %d\n",
+ fprintf(stderr,"%s %ld %f %f %d\n",
rbuf[i].name,rbuf[i].longi,rbuf[i].pressure,rbuf[i].temperature,rbuf[i].lati);
- fprintf(stderr,"%s %d %f %f %d\n",
+ fprintf(stderr,"%s %ld %f %f %d\n",
wbuf[j].name,wbuf[j].longi,wbuf[j].pressure,wbuf[j].temperature,wbuf[j].lati);
return -1;
}
diff --git a/hl/tools/gif2h5/Makefile.in b/hl/tools/gif2h5/Makefile.in
index 1c5fd3c..79c3552 100644
--- a/hl/tools/gif2h5/Makefile.in
+++ b/hl/tools/gif2h5/Makefile.in
@@ -1,4 +1,3 @@
-## HDF5 Library Makefile(.in)
##
## Copyright by the Board of Trustees of the University of Illinois.
## All rights reserved.
@@ -12,6 +11,8 @@
## 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.
##
+## HDF5 Library Makefile(.in)
+##
top_srcdir=@top_srcdir@
top_builddir=../..
srcdir=@srcdir@
diff --git a/pablo/PabloHDF.c b/pablo/PabloHDF.c
index 537ed5a..f756381 100644
--- a/pablo/PabloHDF.c
+++ b/pablo/PabloHDF.c
@@ -138,7 +138,7 @@ extern void preInitIOTrace( void );
#define ID_timeStamp 9999
#define DUMMY_HDF 10000
-char HDFprocNames[][40] = {
+char HDFprocNames[][80] = {
"noName",
"noName",
"noName",
@@ -150,7 +150,7 @@ char HDFprocNames[][40] = {
void startHDFtraceEvent (int );
void endHDFtraceEvent (int , int , char *, int );
-void getHDFprocName( int, char[41] );
+void getHDFprocName( int, char[81] );
void setHDFcallLevel( int );
void resetHDFcallLevel( void );
@@ -169,7 +169,7 @@ void unixIObaseInit( int captureType, int procNum );
int hdfBaseInit( int captureType,
int procNum,
int numHDFentries,
- char HDFprocNames[][40] );
+ char HDFprocNames[][80] );
void timeStamp( void );
void hdfBaseEnd( void );
void unixIObaseEnd( void );
@@ -1219,7 +1219,7 @@ HDFtracePUTS( const char *s )
return( ret );
}
-void getHDFprocName ( int i, char buff[41] )
+void getHDFprocName ( int i, char buff[81] )
{
strcpy( buff, HDFprocNames[i] );
}
diff --git a/perform/Makefile.in b/perform/Makefile.in
index 55a1d48..7228919 100644
--- a/perform/Makefile.in
+++ b/perform/Makefile.in
@@ -1,4 +1,3 @@
-## HDF5 Library Performance Makefile(.in)
##
## Copyright by the Board of Trustees of the University of Illinois.
## All rights reserved.
@@ -12,6 +11,8 @@
## 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.
##
+## HDF5 Library Performance Makefile(.in)
+##
top_srcdir=@top_srcdir@
top_builddir=..
srcdir=@srcdir@
diff --git a/perform/chunk.c b/perform/chunk.c
index 0348e6d..3600bdb 100644
--- a/perform/chunk.c
+++ b/perform/chunk.c
@@ -197,7 +197,7 @@ test_rowmaj (int op, size_t cache_size, size_t io_size)
hid_t file, dset, mem_space, file_space;
signed char *buf = calloc (1, (size_t)(SQUARE(io_size)));
hsize_t i, j, hs_size[2];
- hssize_t hs_offset[2];
+ hsize_t hs_offset[2];
#ifdef H5_WANT_H5_V1_4_COMPAT
int mdc_nelmts, rdcc_nelmts;
#else /* H5_WANT_H5_V1_4_COMPAT */
@@ -277,7 +277,7 @@ test_diag (int op, size_t cache_size, size_t io_size, size_t offset)
hid_t file, dset, mem_space, file_space;
hsize_t i, hs_size[2];
hsize_t nio = 0;
- hssize_t hs_offset[2];
+ hsize_t hs_offset[2];
signed char *buf = calloc (1, (size_t)(SQUARE (io_size)));
#ifdef H5_WANT_H5_V1_4_COMPAT
int mdc_nelmts, rdcc_nelmts;
diff --git a/perform/iopipe.c b/perform/iopipe.c
index aa1ac77..92c85c3 100644
--- a/perform/iopipe.c
+++ b/perform/iopipe.c
@@ -203,7 +203,7 @@ main (void)
int i, fd;
hssize_t n;
off_t offset;
- hssize_t start[2];
+ hsize_t start[2];
hsize_t count[2];
diff --git a/perform/overhead.c b/perform/overhead.c
index 0066255..31211cb 100644
--- a/perform/overhead.c
+++ b/perform/overhead.c
@@ -194,7 +194,7 @@ test(fill_t fill_style, const double splits[],
hsize_t ch_size[1] = {1}; /*chunk size */
hsize_t cur_size[1] = {1000}; /*current dataset size */
hsize_t max_size[1] = {H5S_UNLIMITED}; /*maximum dataset size */
- hssize_t hs_start[1]; /*hyperslab start offset*/
+ hsize_t hs_start[1]; /*hyperslab start offset*/
hsize_t hs_count[1] = {1}; /*hyperslab nelmts */
int fd = (-1); /*h5 file direct */
static int *had = NULL; /*for random filling */
diff --git a/perform/perf_meta.c b/perform/perf_meta.c
index 55adc57..97775a8 100644
--- a/perform/perf_meta.c
+++ b/perform/perf_meta.c
@@ -170,10 +170,8 @@ parse_options(int argc, char **argv)
} /*while*/
/* Check valid values */
+#ifndef H5_HAVE_PARALLEL
if(facc_type == FACC_MPIO || facc_type == FACC_MPIPOSIX)
-#ifdef H5_HAVE_PARALLEL
- ;
-#else
{
nerrors++;
return(1);
diff --git a/perform/pio_engine.c b/perform/pio_engine.c
index 74e5f02..8a14f88 100644
--- a/perform/pio_engine.c
+++ b/perform/pio_engine.c
@@ -520,7 +520,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets,
hsize_t h5block[1]; /*dataspace selection */
hsize_t h5stride[1];
hsize_t h5count[1];
- hssize_t h5start[1];
+ hsize_t h5start[1];
hssize_t h5offset[1]; /* Selection offset within dataspace */
hid_t h5dcpl = -1; /* Dataset creation property list */
hid_t h5dxpl = -1; /* Dataset transfer property list */
@@ -1001,7 +1001,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets,
hsize_t h5block[1]; /*dataspace selection */
hsize_t h5stride[1];
hsize_t h5count[1];
- hssize_t h5start[1];
+ hsize_t h5start[1];
hssize_t h5offset[1]; /* Selection offset within dataspace */
hid_t h5dxpl = -1; /* Dataset transfer property list */
diff --git a/perform/zip_perf.c b/perform/zip_perf.c
index 37f264a..321d6e6 100644
--- a/perform/zip_perf.c
+++ b/perform/zip_perf.c
@@ -12,8 +12,6 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* @(#) $Id$ */
-
/* ===========================================================================
* Usage: zip_perf [-d] [-f] [-h] [-1 to -9] [files...]
* -d : decompress
diff --git a/src/H5.c b/src/H5.c
index 37beb7f..47f6907 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -32,8 +32,10 @@
#include "H5Tprivate.h" /* Datatypes */
#include "H5Zprivate.h" /* I/O pipeline filters */
+#ifdef H5_HAVE_PARALLEL
/* datatypes of predefined drivers needed by H5_trace() */
#include "H5FDmpio.h"
+#endif /* H5_HAVE_PARALLEL */
/* we need this for the struct rusage declaration */
#if defined(H5_HAVE_GETRUSAGE) && defined(H5_HAVE_SYS_RESOURCE_H)
@@ -53,14 +55,10 @@ hbool_t H5_MPEinit_g = FALSE; /* MPE Library hasn't been initialized */
#endif
char H5_lib_vers_info_g[] = H5_VERS_INFO;
-hbool_t dont_atexit_g = FALSE;
+static hbool_t H5_dont_atexit_g = FALSE;
H5_debug_t H5_debug_g; /*debugging info */
static void H5_debug_mask(const char*);
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
-
/*--------------------------------------------------------------------------
* NAME
* H5_init_library -- Initialize library-global information
@@ -125,12 +123,12 @@ H5_init_library(void)
/*
* Install atexit() library cleanup routine unless the H5dont_atexit()
* has been called. Once we add something to the atexit() list it stays
- * there permanently, so we set dont_atexit_g after we add it to prevent
+ * there permanently, so we set H5_dont_atexit_g after we add it to prevent
* adding it again later if the library is cosed and reopened.
*/
- if (!dont_atexit_g) {
+ if (!H5_dont_atexit_g) {
(void)HDatexit(H5_term_library);
- dont_atexit_g = TRUE;
+ H5_dont_atexit_g = TRUE;
}
/*
@@ -223,7 +221,6 @@ H5_term_library(void)
pending += DOWN(G);
pending += DOWN(A);
pending += DOWN(S);
- pending += DOWN(TN);
pending += DOWN(T);
/* Don't shut down the file code until objects in files are shut down */
if(pending==0)
@@ -319,10 +316,10 @@ H5dont_atexit(void)
FUNC_ENTER_API_NOINIT(H5dont_atexit)
H5TRACE0("e","");
- if (dont_atexit_g)
+ if (H5_dont_atexit_g)
ret_value=FAIL;
else
- dont_atexit_g = TRUE;
+ H5_dont_atexit_g = TRUE;
FUNC_LEAVE_API(ret_value)
}
@@ -360,7 +357,7 @@ H5garbage_collect(void)
/* Call the garbage collection routines in the library */
if(H5FL_garbage_coll()<0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't garbage collect objects")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, FAIL, "can't garbage collect objects")
done:
FUNC_LEAVE_API(ret_value)
@@ -464,9 +461,9 @@ H5_debug_mask(const char *s)
}
/* Get the name */
- for (i=0; HDisalpha(*s); i++, s++) {
- if (i<sizeof pkg_name) pkg_name[i] = *s;
- }
+ for (i=0; HDisalpha(*s); i++, s++)
+ if (i<sizeof pkg_name)
+ pkg_name[i] = *s;
pkg_name[MIN(sizeof(pkg_name)-1, i)] = '\0';
/* Trace, all, or one? */
@@ -479,26 +476,23 @@ H5_debug_mask(const char *s)
H5_debug_g.trace = stream;
H5_debug_g.ttimes = !clear;
} else if (!HDstrcmp(pkg_name, "all")) {
- for (i=0; i<H5_NPKGS; i++) {
+ for (i=0; i<(size_t)H5_NPKGS; i++)
H5_debug_g.pkg[i].stream = clear?NULL:stream;
- }
} else {
- for (i=0; i<H5_NPKGS; i++) {
+ for (i=0; i<(size_t)H5_NPKGS; i++) {
if (!HDstrcmp(H5_debug_g.pkg[i].name, pkg_name)) {
H5_debug_g.pkg[i].stream = clear?NULL:stream;
break;
}
}
- if (i>=H5_NPKGS) {
+ if (i>=(size_t)H5_NPKGS)
fprintf(stderr, "HDF5_DEBUG: ignored %s\n", pkg_name);
- }
}
} else if (HDisdigit(*s)) {
int fd = (int)HDstrtol (s, &rest, 0);
- if ((stream=HDfdopen(fd, "w"))) {
+ if ((stream=HDfdopen(fd, "w"))!=NULL)
(void)HDsetvbuf (stream, NULL, _IOLBF, 0);
- }
s = rest;
} else {
s++;
@@ -1014,13 +1008,13 @@ HDfprintf(FILE *stream, const char *fmt, ...)
unsigned short x = (unsigned short)va_arg (ap, unsigned int);
n = fprintf (stream, format_templ, x);
} else if (!*modifier) {
- unsigned int x = va_arg (ap, unsigned int);
+ unsigned int x = va_arg (ap, unsigned int); /*lint !e732 Loss of sign not really occuring */
n = fprintf (stream, format_templ, x);
} else if (!HDstrcmp (modifier, "l")) {
- unsigned long x = va_arg (ap, unsigned long);
+ unsigned long x = va_arg (ap, unsigned long); /*lint !e732 Loss of sign not really occuring */
n = fprintf (stream, format_templ, x);
} else {
- uint64_t x = va_arg(ap, uint64_t);
+ uint64_t x = va_arg(ap, uint64_t); /*lint !e732 Loss of sign not really occuring */
n = fprintf (stream, format_templ, x);
}
break;
@@ -1053,7 +1047,7 @@ HDfprintf(FILE *stream, const char *fmt, ...)
case 'a':
{
- haddr_t x = va_arg (ap, haddr_t);
+ haddr_t x = va_arg (ap, haddr_t); /*lint !e732 Loss of sign not really occuring */
if (H5F_addr_defined(x)) {
sprintf(format_templ, "%%%s%s%s%s%s",
leftjust?"-":"", plussign?"+":"",
@@ -1061,6 +1055,7 @@ HDfprintf(FILE *stream, const char *fmt, ...)
zerofill?"0":"");
if (fwidth>0)
sprintf(format_templ+HDstrlen(format_templ), "%d", fwidth);
+
/*lint --e{506} Don't issue warnings about constant value booleans */
/*lint --e{774} Don't issue warnings boolean within 'if' always evaluates false/true */
if (sizeof(x)==H5_SIZEOF_INT) {
@@ -1094,7 +1089,7 @@ HDfprintf(FILE *stream, const char *fmt, ...)
case 's':
case 'p':
{
- char *x = va_arg (ap, char*);
+ char *x = va_arg (ap, char*); /*lint !e64 Type mismatch not really occuring */
n = fprintf (stream, format_templ, x);
}
break;
@@ -1563,7 +1558,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
* name is the null pointer then don't print the argument or the
* following `='. This is used for return values.
*/
- argname = va_arg (ap, char*);
+ argname = va_arg (ap, char*); /*lint !e64 Type mismatch not really occuring */
if (argname) {
unsigned n = (unsigned)MAX (0, (int)HDstrlen(argname)-3); /*lint !e666 Allow expression with side effects */
if (!HDstrcmp (argname+n, "_id")) {
@@ -1577,7 +1572,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
}
/* The value */
- if (ptr) vp = va_arg (ap, void*);
+ if (ptr) vp = va_arg (ap, void*); /*lint !e64 Type mismatch not really occuring */
switch (type[0]) {
case 'a':
if (ptr) {
@@ -1587,7 +1582,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- haddr_t addr = va_arg(ap, haddr_t);
+ haddr_t addr = va_arg(ap, haddr_t); /*lint !e732 Loss of sign not really occuring */
HDfprintf(out, "%a", addr);
}
break;
@@ -1600,7 +1595,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- hbool_t bool_var = va_arg (ap, hbool_t);
+ hbool_t bool_var = va_arg (ap, hbool_t); /*lint !e732 Loss of sign not really occuring */
if (TRUE==bool_var) fprintf (out, "TRUE");
else if (!bool_var) fprintf (out, "FALSE");
else fprintf (out, "TRUE(%u)", (unsigned)bool_var);
@@ -1630,7 +1625,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- H5D_alloc_time_t alloc_time = va_arg (ap, H5D_alloc_time_t);
+ H5D_alloc_time_t alloc_time = va_arg (ap, H5D_alloc_time_t); /*lint !e64 Type mismatch not really occuring */
switch (alloc_time) {
case H5D_ALLOC_TIME_ERROR:
fprintf (out, "H5D_ALLOC_TIME_ERROR");
@@ -1659,7 +1654,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- H5D_fill_time_t fill_time = va_arg (ap, H5D_fill_time_t);
+ H5D_fill_time_t fill_time = va_arg (ap, H5D_fill_time_t); /*lint !e64 Type mismatch not really occuring */
switch (fill_time) {
case H5D_FILL_TIME_ERROR:
fprintf (out, "H5D_FILL_TIME_ERROR");
@@ -1685,7 +1680,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- H5D_fill_value_t fill_value = va_arg (ap, H5D_fill_value_t);
+ H5D_fill_value_t fill_value = va_arg (ap, H5D_fill_value_t); /*lint !e64 Type mismatch not really occuring */
switch (fill_value) {
case H5D_FILL_VALUE_ERROR:
fprintf (out, "H5D_FILL_VALUE_ERROR");
@@ -1711,7 +1706,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- H5D_layout_t layout = va_arg (ap, H5D_layout_t);
+ H5D_layout_t layout = va_arg (ap, H5D_layout_t); /*lint !e64 Type mismatch not really occuring */
switch (layout) {
case H5D_LAYOUT_ERROR:
fprintf (out, "H5D_LAYOUT_ERROR");
@@ -1725,6 +1720,9 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
case H5D_CHUNKED:
fprintf (out, "H5D_CHUNKED");
break;
+ case H5D_NLAYOUTS:
+ fprintf (out, "H5D_NLAYOUTS");
+ break;
default:
fprintf (out, "%ld", (long)layout);
break;
@@ -1740,7 +1738,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- H5D_space_status_t space_status = va_arg(ap, H5D_space_status_t);
+ H5D_space_status_t space_status = va_arg(ap, H5D_space_status_t); /*lint !e64 Type mismatch not really occuring */
switch (space_status) {
case H5D_SPACE_STATUS_NOT_ALLOCATED:
fprintf (out, "H5D_SPACE_STATUS_NOT_ALLOCATED");
@@ -1751,6 +1749,9 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
case H5D_SPACE_STATUS_ALLOCATED:
fprintf (out, "H5D_SPACE_STATUS_ALLOCATED");
break;
+ case H5D_SPACE_STATUS_ERROR:
+ fprintf (out, "H5D_SPACE_STATUS_ERROR");
+ break;
default:
fprintf (out, "%ld", (long)space_status);
break;
@@ -1766,7 +1767,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- H5FD_mpio_xfer_t transfer = va_arg(ap, H5FD_mpio_xfer_t);
+ H5FD_mpio_xfer_t transfer = va_arg(ap, H5FD_mpio_xfer_t); /*lint !e64 Type mismatch not really occuring */
switch (transfer) {
case H5FD_MPIO_INDEPENDENT:
fprintf (out, "H5FD_MPIO_INDEPENDENT");
@@ -1811,7 +1812,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- H5E_direction_t direction = va_arg (ap, H5E_direction_t);
+ H5E_direction_t direction = va_arg (ap, H5E_direction_t); /*lint !e64 Type mismatch not really occuring */
switch (direction) {
case H5E_WALK_UPWARD:
fprintf (out, "H5E_WALK_UPWARD");
@@ -1834,7 +1835,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- H5E_error_t *error = va_arg (ap, H5E_error_t*);
+ H5E_error_t *error = va_arg (ap, H5E_error_t*); /*lint !e64 Type mismatch not really occuring */
fprintf (out, "0x%lx", (unsigned long)error);
}
break;
@@ -1881,7 +1882,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- H5F_close_degree_t degree = va_arg(ap, H5F_close_degree_t);
+ H5F_close_degree_t degree = va_arg(ap, H5F_close_degree_t); /*lint !e64 Type mismatch not really occuring */
switch (degree) {
case H5F_CLOSE_DEFAULT:
fprintf(out, "H5F_CLOSE_DEFAULT");
@@ -1907,7 +1908,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- H5F_scope_t scope = va_arg(ap, H5F_scope_t);
+ H5F_scope_t scope = va_arg(ap, H5F_scope_t); /*lint !e64 Type mismatch not really occuring */
switch (scope) {
case H5F_SCOPE_LOCAL:
fprintf(out, "H5F_SCOPE_LOCAL");
@@ -1939,7 +1940,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- H5G_link_t link_type = va_arg (ap, H5G_link_t);
+ H5G_link_t link_type = va_arg (ap, H5G_link_t); /*lint !e64 Type mismatch not really occuring */
switch (link_type) {
case H5G_LINK_ERROR:
fprintf (out, "H5G_LINK_ERROR");
@@ -1965,7 +1966,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- H5G_stat_t *statbuf = va_arg (ap, H5G_stat_t*);
+ H5G_stat_t *statbuf = va_arg (ap, H5G_stat_t*); /*lint !e64 Type mismatch not really occuring */
fprintf (out, "0x%lx", (unsigned long)statbuf);
}
break;
@@ -1996,7 +1997,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- hsize_t hsize = va_arg (ap, hsize_t);
+ hsize_t hsize = va_arg (ap, hsize_t); /*lint !e732 Loss of sign not really occuring */
if (H5S_UNLIMITED==hsize) {
HDfprintf(out, "H5S_UNLIMITED");
} else {
@@ -2057,6 +2058,9 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
case H5I_FILE:
fprintf(out, "%ld (file)", (long)obj);
break;
+ case H5I_FILE_CLOSING:
+ fprintf(out, "%ld (file closing)", (long)obj);
+ break;
case H5I_GROUP:
fprintf(out, "%ld (group)", (long)obj);
break;
@@ -2168,18 +2172,21 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
case H5I_ATTR:
fprintf(out, "%ld (attr)", (long)obj);
break;
- case H5I_TEMPBUF:
- fprintf(out, "%ld", (long)obj);
- if (HDstrcmp(argname, "tbuf")) {
- fprintf(out, " (tbuf");
- }
- break;
case H5I_REFERENCE:
fprintf(out, "%ld (reference)", (long)obj);
break;
case H5I_VFL:
fprintf(out, "%ld (file driver)", (long)obj);
break;
+ case H5I_GENPROP_CLS:
+ fprintf(out, "%ld (genprop class)", (long)obj);
+ break;
+ case H5I_GENPROP_LST:
+ fprintf(out, "%ld (genprop list)", (long)obj);
+ break;
+ case H5I_NGROUPS:
+ fprintf (out, "%ld (ngroups - error)", (long)obj);
+ break;
default:
fprintf(out, "%ld (unknown class)", (long)obj);
break;
@@ -2228,7 +2235,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- unsigned iu = va_arg (ap, unsigned);
+ unsigned iu = va_arg (ap, unsigned); /*lint !e732 Loss of sign not really occuring */
fprintf (out, "%u", iu);
asize[argno] = iu;
}
@@ -2242,7 +2249,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- H5I_type_t id_type = va_arg (ap, H5I_type_t);
+ H5I_type_t id_type = va_arg (ap, H5I_type_t); /*lint !e64 Type mismatch not really occuring */
switch (id_type) {
case H5I_BADID:
fprintf (out, "H5I_BADID");
@@ -2250,6 +2257,9 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
case H5I_FILE:
fprintf (out, "H5I_FILE");
break;
+ case H5I_FILE_CLOSING:
+ fprintf (out, "H5I_FILE_CLOSING");
+ break;
case H5I_GROUP:
fprintf (out, "H5I_GROUP");
break;
@@ -2265,9 +2275,6 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
case H5I_ATTR:
fprintf (out, "H5I_ATTR");
break;
- case H5I_TEMPBUF:
- fprintf (out, "H5I_TEMPBUF");
- break;
case H5I_REFERENCE:
fprintf (out, "H5I_REFERENCE");
break;
@@ -2334,7 +2341,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- H5FD_mem_t mt = va_arg(ap, H5FD_mem_t);
+ H5FD_mem_t mt = va_arg(ap, H5FD_mem_t); /*lint !e64 Type mismatch not really occuring */
switch (mt) {
case H5FD_MEM_NOLIST:
fprintf(out, "H5FD_MEM_NOLIST");
@@ -2360,6 +2367,9 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
case H5FD_MEM_OHDR:
fprintf(out, "H5FD_MEM_OHDR");
break;
+ case H5FD_MEM_NTYPES:
+ fprintf(out, "H5FD_MEM_NTYPES");
+ break;
default:
fprintf(out, "%ld", (long)mt);
break;
@@ -2418,7 +2428,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- hobj_ref_t ref = va_arg (ap, hobj_ref_t);
+ hobj_ref_t ref = va_arg (ap, hobj_ref_t); /*lint !e732 Loss of sign not really occuring */
HDfprintf(out, "Reference Object=%a", ref);
}
break;
@@ -2433,7 +2443,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- H5R_type_t reftype = va_arg(ap, H5R_type_t);
+ H5R_type_t reftype = va_arg(ap, H5R_type_t); /*lint !e64 Type mismatch not really occuring */
switch (reftype) {
case H5R_BADTYPE:
fprintf(out, "H5R_BADTYPE");
@@ -2473,7 +2483,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- H5S_class_t cls = va_arg(ap, H5S_class_t);
+ H5S_class_t cls = va_arg(ap, H5S_class_t); /*lint !e64 Type mismatch not really occuring */
switch (cls) {
case H5S_NO_CLASS:
fprintf(out, "H5S_NO_CLASS");
@@ -2502,7 +2512,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- H5S_seloper_t so = va_arg(ap, H5S_seloper_t);
+ H5S_seloper_t so = va_arg(ap, H5S_seloper_t); /*lint !e64 Type mismatch not really occuring */
switch (so) {
case H5S_SELECT_NOOP:
fprintf(out, "H5S_NOOP");
@@ -2513,6 +2523,27 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
case H5S_SELECT_OR:
fprintf(out, "H5S_SELECT_OR");
break;
+ case H5S_SELECT_AND:
+ fprintf(out, "H5S_SELECT_AND");
+ break;
+ case H5S_SELECT_XOR:
+ fprintf(out, "H5S_SELECT_XOR");
+ break;
+ case H5S_SELECT_NOTB:
+ fprintf(out, "H5S_SELECT_NOTB");
+ break;
+ case H5S_SELECT_NOTA:
+ fprintf(out, "H5S_SELECT_NOTA");
+ break;
+ case H5S_SELECT_APPEND:
+ fprintf(out, "H5S_SELECT_APPEND");
+ break;
+ case H5S_SELECT_PREPEND:
+ fprintf(out, "H5S_SELECT_PREPEND");
+ break;
+ case H5S_SELECT_INVALID:
+ fprintf(out, "H5S_SELECT_INVALID");
+ break;
default:
fprintf(out, "%ld", (long)so);
break;
@@ -2528,7 +2559,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- H5S_sel_type st = va_arg(ap, H5S_sel_type);
+ H5S_sel_type st = va_arg(ap, H5S_sel_type); /*lint !e64 Type mismatch not really occuring */
switch (st) {
case H5S_SEL_ERROR:
fprintf(out, "H5S_SEL_ERROR");
@@ -2545,6 +2576,9 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
case H5S_SEL_ALL:
fprintf(out, "H5S_SEL_ALL");
break;
+ case H5S_SEL_N:
+ fprintf(out, "H5S_SEL_N");
+ break;
default:
fprintf(out, "%ld", (long)st);
break;
@@ -2566,7 +2600,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- const char *str = va_arg (ap, const char*);
+ const char *str = va_arg (ap, const char*); /*lint !e64 Type mismatch not really occuring */
fprintf (out, "\"%s\"", str);
}
break;
@@ -2581,7 +2615,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- H5T_cset_t cset = va_arg (ap, H5T_cset_t);
+ H5T_cset_t cset = va_arg (ap, H5T_cset_t); /*lint !e64 Type mismatch not really occuring */
switch (cset) {
case H5T_CSET_ERROR:
fprintf (out, "H5T_CSET_ERROR");
@@ -2589,6 +2623,23 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
case H5T_CSET_ASCII:
fprintf (out, "H5T_CSET_ASCII");
break;
+ case H5T_CSET_RESERVED_1:
+ case H5T_CSET_RESERVED_2:
+ case H5T_CSET_RESERVED_3:
+ case H5T_CSET_RESERVED_4:
+ case H5T_CSET_RESERVED_5:
+ case H5T_CSET_RESERVED_6:
+ case H5T_CSET_RESERVED_7:
+ case H5T_CSET_RESERVED_8:
+ case H5T_CSET_RESERVED_9:
+ case H5T_CSET_RESERVED_10:
+ case H5T_CSET_RESERVED_11:
+ case H5T_CSET_RESERVED_12:
+ case H5T_CSET_RESERVED_13:
+ case H5T_CSET_RESERVED_14:
+ case H5T_CSET_RESERVED_15:
+ fprintf (out, "H5T_CSET_RESERVED(%ld)",(long)cset);
+ break;
default:
fprintf (out, "%ld", (long)cset);
break;
@@ -2604,7 +2655,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- H5T_direction_t direct = va_arg (ap, H5T_direction_t);
+ H5T_direction_t direct = va_arg (ap, H5T_direction_t); /*lint !e64 Type mismatch not really occuring */
switch (direct) {
case H5T_DIR_DEFAULT:
fprintf (out, "H5T_DIR_DEFAULT");
@@ -2630,7 +2681,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- H5T_pers_t pers = va_arg(ap, H5T_pers_t);
+ H5T_pers_t pers = va_arg(ap, H5T_pers_t); /*lint !e64 Type mismatch not really occuring */
switch (pers) {
case H5T_PERS_DONTCARE:
fprintf(out, "H5T_PERS_DONTCARE");
@@ -2656,7 +2707,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- H5T_norm_t norm = va_arg (ap, H5T_norm_t);
+ H5T_norm_t norm = va_arg (ap, H5T_norm_t); /*lint !e64 Type mismatch not really occuring */
switch (norm) {
case H5T_NORM_ERROR:
fprintf (out, "H5T_NORM_ERROR");
@@ -2685,7 +2736,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- H5T_order_t order = va_arg (ap, H5T_order_t);
+ H5T_order_t order = va_arg (ap, H5T_order_t); /*lint !e64 Type mismatch not really occuring */
switch (order) {
case H5T_ORDER_ERROR:
fprintf (out, "H5T_ORDER_ERROR");
@@ -2717,7 +2768,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- H5T_pad_t pad = va_arg (ap, H5T_pad_t);
+ H5T_pad_t pad = va_arg (ap, H5T_pad_t); /*lint !e64 Type mismatch not really occuring */
switch (pad) {
case H5T_PAD_ERROR:
fprintf (out, "H5T_PAD_ERROR");
@@ -2731,6 +2782,9 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
case H5T_PAD_BACKGROUND:
fprintf (out, "H5T_PAD_BACKGROUND");
break;
+ case H5T_NPAD:
+ fprintf (out, "H5T_NPAD");
+ break;
default:
fprintf (out, "%ld", (long)pad);
break;
@@ -2746,7 +2800,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- H5T_sign_t sign = va_arg (ap, H5T_sign_t);
+ H5T_sign_t sign = va_arg (ap, H5T_sign_t); /*lint !e64 Type mismatch not really occuring */
switch (sign) {
case H5T_SGN_ERROR:
fprintf (out, "H5T_SGN_ERROR");
@@ -2757,6 +2811,9 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
case H5T_SGN_2:
fprintf (out, "H5T_SGN_2");
break;
+ case H5T_NSGN:
+ fprintf (out, "H5T_NSGN");
+ break;
default:
fprintf (out, "%ld", (long)sign);
break;
@@ -2772,7 +2829,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- H5T_class_t type_class = va_arg(ap, H5T_class_t);
+ H5T_class_t type_class = va_arg(ap, H5T_class_t); /*lint !e64 Type mismatch not really occuring */
switch (type_class) {
case H5T_NO_CLASS:
fprintf(out, "H5T_NO_CLASS");
@@ -2798,9 +2855,21 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
case H5T_COMPOUND:
fprintf(out, "H5T_COMPOUND");
break;
+ case H5T_REFERENCE:
+ fprintf(out, "H5T_REFERENCE");
+ break;
case H5T_ENUM:
fprintf(out, "H5T_ENUM");
break;
+ case H5T_VLEN:
+ fprintf(out, "H5T_VLEN");
+ break;
+ case H5T_ARRAY:
+ fprintf(out, "H5T_ARRAY");
+ break;
+ case H5T_NCLASSES:
+ fprintf(out, "H5T_NCLASSES");
+ break;
default:
fprintf(out, "%ld", (long)type_class);
break;
@@ -2816,7 +2885,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- H5T_str_t str = va_arg(ap, H5T_str_t);
+ H5T_str_t str = va_arg(ap, H5T_str_t); /*lint !e64 Type mismatch not really occuring */
switch (str) {
case H5T_STR_ERROR:
fprintf(out, "H5T_STR_ERROR");
@@ -2830,6 +2899,21 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
case H5T_STR_SPACEPAD:
fprintf(out, "H5T_STR_SPACEPAD");
break;
+ case H5T_STR_RESERVED_3:
+ case H5T_STR_RESERVED_4:
+ case H5T_STR_RESERVED_5:
+ case H5T_STR_RESERVED_6:
+ case H5T_STR_RESERVED_7:
+ case H5T_STR_RESERVED_8:
+ case H5T_STR_RESERVED_9:
+ case H5T_STR_RESERVED_10:
+ case H5T_STR_RESERVED_11:
+ case H5T_STR_RESERVED_12:
+ case H5T_STR_RESERVED_13:
+ case H5T_STR_RESERVED_14:
+ case H5T_STR_RESERVED_15:
+ fprintf(out, "H5T_STR_RESERVED(%ld)",(long)str);
+ break;
default:
fprintf(out, "%ld", (long)str);
break;
@@ -2879,7 +2963,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- vp = va_arg (ap, void*);
+ vp = va_arg (ap, void*); /*lint !e64 Type mismatch not really occuring */
if (vp) {
fprintf (out, "0x%lx", (unsigned long)vp);
} else {
@@ -2904,7 +2988,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- size_t size = va_arg (ap, size_t);
+ size_t size = va_arg (ap, size_t); /*lint !e732 Loss of sign not really occuring */
HDfprintf (out, "%Zu", size);
asize[argno] = (hssize_t)size;
@@ -2913,6 +2997,19 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
case 'Z':
switch (type[1]) {
+ case 'c':
+ if (ptr) {
+ if (vp) {
+ fprintf (out, "0x%lx", (unsigned long)vp);
+ } else {
+ fprintf(out, "NULL");
+ }
+ } else {
+ H5Z_class_t *filter = va_arg (ap, H5Z_class_t*); /*lint !e64 Type mismatch not really occuring */
+ fprintf (out, "0x%lx", (unsigned long)filter);
+ }
+ break;
+
case 'e':
if (ptr) {
if (vp) {
@@ -2921,7 +3018,7 @@ H5_trace (const double *returning, const char *func, const char *type, ...)
fprintf(out, "NULL");
}
} else {
- H5Z_EDC_t edc = va_arg (ap, H5Z_EDC_t);
+ H5Z_EDC_t edc = va_arg (ap, H5Z_EDC_t); /*lint !e64 Type mismatch not really occuring */
if (H5Z_DISABLE_EDC==edc) {
fprintf (out, "H5Z_DISABLE_EDC");
diff --git a/src/H5A.c b/src/H5A.c
index af55838..ebdca4f 100644
--- a/src/H5A.c
+++ b/src/H5A.c
@@ -13,7 +13,9 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#define H5A_PACKAGE /*suppress error about including H5Apkg */
-#define H5S_PACKAGE /*suppress error about including H5Spkg */
+
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5A_init_interface
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
@@ -26,12 +28,7 @@
#include "H5FLprivate.h" /* Free Lists */
#include "H5Iprivate.h" /* IDs */
#include "H5MMprivate.h" /* Memory management */
-#include "H5Spkg.h" /* Dataspace functions */
-
-/* Is the interface initialized? */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT H5A_init_interface
-static herr_t H5A_init_interface(void);
+#include "H5Sprivate.h" /* Dataspace functions */
/* PRIVATE PROTOTYPES */
static hid_t H5A_create(const H5G_entry_t *ent, const char *name,
@@ -114,12 +111,12 @@ H5A_term_interface(void)
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5A_term_interface)
- if (interface_initialize_g) {
- if ((n=H5I_nmembers(H5I_ATTR))) {
- H5I_clear_group(H5I_ATTR, FALSE);
+ if (H5_interface_initialize_g) {
+ if ((n=H5I_nmembers(H5I_ATTR))>0) {
+ (void)H5I_clear_group(H5I_ATTR, FALSE);
} else {
- H5I_destroy_group(H5I_ATTR);
- interface_initialize_g = 0;
+ (void)H5I_destroy_group(H5I_ATTR);
+ H5_interface_initialize_g = 0;
n = 1;
}
}
@@ -163,7 +160,7 @@ H5A_term_interface(void)
*
* Modifications:
* Robb Matzke, 5 Jun 1998
- * The LOC_ID can also be a committed data type.
+ * The LOC_ID can also be a committed datatype.
*
--------------------------------------------------------------------------*/
/* ARGSUSED */
@@ -293,7 +290,7 @@ H5A_create(const H5G_entry_t *ent, const char *name, const H5T_t *type,
else
attr->dt_size=H5O_raw_size(H5O_DTYPE_ID,attr->ent.file,type);
assert(attr->dt_size>0);
- attr->ds_size=H5O_raw_size(H5O_SDSPACE_ID,attr->ent.file,&(space->extent));
+ attr->ds_size=H5S_raw_size(attr->ent.file,space);
assert(attr->ds_size>0);
H5_ASSIGN_OVERFLOW(attr->data_size,H5S_GET_EXTENT_NPOINTS(attr->ds)*H5T_get_size(attr->dt),hssize_t,size_t);
@@ -438,7 +435,7 @@ done:
*
* Modifications:
* Robb Matzke, 5 Jun 1998
- * The LOC_ID can also be a named (committed) data type.
+ * The LOC_ID can also be a named (committed) datatype.
--------------------------------------------------------------------------*/
hid_t
H5Aopen_name(hid_t loc_id, const char *name)
@@ -495,7 +492,7 @@ done:
*
* Modifications:
* Robb Matzke, 5 Jun 1998
- * The LOC_ID can also be a named (committed) data type.
+ * The LOC_ID can also be a named (committed) datatype.
*
--------------------------------------------------------------------------*/
hid_t
@@ -616,7 +613,7 @@ H5Awrite(hid_t attr_id, hid_t type_id, const void *buf)
if (NULL == (attr = H5I_object_verify(attr_id, H5I_ATTR)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute")
if (NULL == (mem_type = H5I_object_verify(type_id, H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
if (NULL == buf)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null attribute buffer")
@@ -650,7 +647,7 @@ done:
static herr_t
H5A_write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id)
{
- uint8_t *tconv_buf = NULL; /* data type conv buffer */
+ uint8_t *tconv_buf = NULL; /* datatype conv buffer */
uint8_t *bkg_buf = NULL; /* temp conversion buffer */
hssize_t snelmts; /* elements in attribute */
size_t nelmts; /* elements in attribute */
@@ -681,7 +678,7 @@ H5A_write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id)
/* Convert memory buffer into disk buffer */
/* Set up type conversion function */
if (NULL == (tpath = H5T_path_find(mem_type, attr->dt, NULL, NULL, dxpl_id)))
- HGOTO_ERROR(H5E_ATTR, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest data types")
+ HGOTO_ERROR(H5E_ATTR, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dst datatypes")
/* Check for type conversion required */
if (!H5T_path_noop(tpath)) {
@@ -697,9 +694,9 @@ H5A_write(H5A_t *attr, const H5T_t *mem_type, const void *buf, hid_t dxpl_id)
/* Copy the user's data into the buffer for conversion */
HDmemcpy(tconv_buf,buf,(src_type_size*nelmts));
- /* Perform data type conversion */
+ /* Perform datatype conversion */
if (H5T_convert(tpath, src_id, dst_id, nelmts, 0, 0, tconv_buf, bkg_buf, dxpl_id)<0)
- HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "data type conversion failed")
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "datatype conversion failed")
/* Free the previous attribute data buffer, if there is one */
if(attr->data)
@@ -778,7 +775,7 @@ H5Aread(hid_t attr_id, hid_t type_id, void *buf)
if (NULL == (attr = H5I_object_verify(attr_id, H5I_ATTR)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute")
if (NULL == (mem_type = H5I_object_verify(type_id, H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
if (NULL == buf)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null attribute buffer")
@@ -812,7 +809,7 @@ done:
static herr_t
H5A_read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id)
{
- uint8_t *tconv_buf = NULL; /* data type conv buffer*/
+ uint8_t *tconv_buf = NULL; /* datatype conv buffer*/
uint8_t *bkg_buf = NULL; /* background buffer */
hssize_t snelmts; /* elements in attribute */
size_t nelmts; /* elements in attribute*/
@@ -847,7 +844,7 @@ H5A_read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id)
/* Convert memory buffer into disk buffer */
/* Set up type conversion function */
if (NULL == (tpath = H5T_path_find(attr->dt, mem_type, NULL, NULL, dxpl_id)))
- HGOTO_ERROR(H5E_ATTR, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dest data types")
+ HGOTO_ERROR(H5E_ATTR, H5E_UNSUPPORTED, FAIL, "unable to convert between src and dst datatypes")
/* Check for type conversion required */
if (!H5T_path_noop(tpath)) {
@@ -863,9 +860,9 @@ H5A_read(const H5A_t *attr, const H5T_t *mem_type, void *buf, hid_t dxpl_id)
/* Copy the attribute data into the buffer for conversion */
HDmemcpy(tconv_buf,attr->data,(src_type_size*nelmts));
- /* Perform data type conversion. */
+ /* Perform datatype conversion. */
if (H5T_convert(tpath, src_id, dst_id, nelmts, 0, 0, tconv_buf, bkg_buf, dxpl_id)<0)
- HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "data type conversion failed")
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTENCODE, FAIL, "datatype conversion failed")
/* Copy the converted data into the user's buffer */
HDmemcpy(buf,tconv_buf,(dst_type_size*nelmts));
@@ -960,10 +957,10 @@ done:
*
* Modifications:
* Robb Matzke, 4 Jun 1998
- * The data type is reopened if it's a named type before returning it to
- * the application. The data types returned by this function are always
- * read-only. If an error occurs when atomizing the return data type
- * then the data type is closed.
+ * The datatype is reopened if it's a named type before returning it to
+ * the application. The datatypes returned by this function are always
+ * read-only. If an error occurs when atomizing the return datatype
+ * then the datatype is closed.
--------------------------------------------------------------------------*/
hid_t
H5Aget_type(hid_t attr_id)
@@ -980,7 +977,7 @@ H5Aget_type(hid_t attr_id)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute")
/*
- * Copy the attribute's data type. If the type is a named type then
+ * Copy the attribute's datatype. If the type is a named type then
* reopen the type before returning it to the user. Make the type
* read-only.
*/
@@ -991,7 +988,7 @@ H5Aget_type(hid_t attr_id)
if (H5T_vlen_mark(dst, NULL, H5T_VLEN_MEMORY)<0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "invalid VL location")
if (H5T_lock(dst, FALSE)<0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to lock transient data type")
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to lock transient datatype")
/* Atomize */
if ((ret_value=H5I_register(H5I_DATATYPE, dst))<0)
@@ -1162,7 +1159,7 @@ H5A_get_storage_size(const H5A_t *attr)
*
* Modifications:
* Robb Matzke, 5 Jun 1998
- * The LOC_ID can also be a named (committed) data type.
+ * The LOC_ID can also be a named (committed) datatype.
--------------------------------------------------------------------------*/
int
H5Aget_num_attrs(hid_t loc_id)
@@ -1185,14 +1182,14 @@ H5Aget_num_attrs(hid_t loc_id)
break;
case H5I_DATATYPE:
if (NULL==(ent=H5T_entof ((H5T_t*)obj)))
- HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "target data type is not committed")
+ HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "target datatype is not committed")
break;
case H5I_GROUP:
ent = H5G_entof ((H5G_t*)obj);
break;
default:
HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "inappropriate attribute target")
- }
+ } /*lint !e788 All appropriate cases are covered */
/* Look up the attribute for the object */
ret_value=H5O_count(ent, H5O_ATTR_ID, H5AC_ind_dxpl_id);
@@ -1354,7 +1351,7 @@ done:
*
* Modifications:
* Robb Matzke, 5 Jun 1998
- * The LOC_ID can also be a named (committed) data type.
+ * The LOC_ID can also be a named (committed) datatype.
*
* Robb Matzke, 5 Jun 1998
* Like the group iterator, if ATTR_NUM is the null pointer then all
@@ -1435,7 +1432,7 @@ done:
*
* Modifications:
* Robb Matzke, 5 Jun 1998
- * The LOC_ID can also be a named (committed) data type.
+ * The LOC_ID can also be a named (committed) datatype.
*
--------------------------------------------------------------------------*/
herr_t
diff --git a/src/H5AC.c b/src/H5AC.c
index dced1ab..21b85c0 100644
--- a/src/H5AC.c
+++ b/src/H5AC.c
@@ -44,6 +44,9 @@
#define H5F_PACKAGE /*suppress error about including H5Fpkg */
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5AC_init_interface
+
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
#define PABLO_MASK H5AC_mask
@@ -57,10 +60,6 @@
#include "H5Iprivate.h" /* IDs */
#include "H5Pprivate.h" /* Property lists */
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT H5AC_init_interface
-static herr_t H5AC_init_interface(void);
/*
* Private file-scope variables.
@@ -86,7 +85,7 @@ hid_t H5AC_ind_dxpl_id=(-1);
* Private file-scope function declarations:
*/
-static herr_t H5AC_check_if_write_permitted(H5F_t *f,
+static herr_t H5AC_check_if_write_permitted(const H5F_t *f,
hid_t dxpl_id,
hbool_t * write_permitted_ptr);
@@ -262,7 +261,7 @@ H5AC_term_interface(void)
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5AC_term_interface)
- if (interface_initialize_g) {
+ if (H5_interface_initialize_g) {
#ifdef H5_HAVE_PARALLEL
if(H5AC_dxpl_id>0 || H5AC_noblock_dxpl_id>0 || H5AC_ind_dxpl_id>0) {
/* Indicate more work to do */
@@ -280,7 +279,7 @@ H5AC_term_interface(void)
H5AC_ind_dxpl_id=(-1);
/* Reset interface initialization flag */
- interface_initialize_g = 0;
+ H5_interface_initialize_g = 0;
} /* end else */
} /* end if */
else
@@ -292,7 +291,7 @@ H5AC_term_interface(void)
#endif /* H5_HAVE_PARALLEL */
/* Reset interface initialization flag */
- interface_initialize_g = 0;
+ H5_interface_initialize_g = 0;
} /* end if */
FUNC_LEAVE_NOAPI(n)
@@ -337,7 +336,7 @@ H5AC_term_interface(void)
*-------------------------------------------------------------------------
*/
-const char * H5AC_entry_type_names[H5AC_NTYPES] =
+static const char * H5AC_entry_type_names[H5AC_NTYPES] =
{
"B-tree nodes",
"symbol table nodes",
@@ -346,10 +345,9 @@ const char * H5AC_entry_type_names[H5AC_NTYPES] =
"object headers"
};
-int
+herr_t
H5AC_create(const H5F_t *f, int UNUSED size_hint)
{
- H5AC_t *cache = NULL;
int ret_value=SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5AC_create, FAIL)
@@ -361,35 +359,20 @@ H5AC_create(const H5F_t *f, int UNUSED size_hint)
* in proper size hints.
* -- JRM
*/
- cache = H5C_create(H5C__DEFAULT_MAX_CACHE_SIZE,
+ f->shared->cache = H5C_create(H5C__DEFAULT_MAX_CACHE_SIZE,
H5C__DEFAULT_MIN_CLEAN_SIZE,
(H5AC_NTYPES - 1),
(const char **)H5AC_entry_type_names,
H5AC_check_if_write_permitted);
- if ( NULL == cache ) {
+ if ( NULL == f->shared->cache ) {
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
- } else {
-
- f->shared->cache = cache;
-
}
done:
- if ( ret_value < 0 ) {
-
- if ( cache != NULL ) {
-
- H5C_dest_empty(cache);
- f->shared->cache = NULL;
-
- } /* end if */
-
- } /* end if */
-
FUNC_LEAVE_NOAPI(ret_value)
} /* H5AC_create() */
@@ -613,7 +596,7 @@ H5AC_set(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr, void *
if ( result < 0 ) {
- HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, FAIL, "H5C_insert_entry() failed")
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTINS, FAIL, "H5C_insert_entry() failed")
}
done:
@@ -654,8 +637,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5AC_rename(H5F_t *f, hid_t UNUSED dxpl_id, const H5AC_class_t *type, haddr_t old_addr,
- haddr_t new_addr)
+H5AC_rename(H5F_t *f, const H5AC_class_t *type, haddr_t old_addr, haddr_t new_addr)
{
herr_t result;
herr_t ret_value=SUCCEED; /* Return value */
@@ -669,15 +651,14 @@ H5AC_rename(H5F_t *f, hid_t UNUSED dxpl_id, const H5AC_class_t *type, haddr_t ol
HDassert(H5F_addr_defined(new_addr));
HDassert(H5F_addr_ne(old_addr, new_addr));
- result = H5C_rename_entry(f,
- f->shared->cache,
+ result = H5C_rename_entry(f->shared->cache,
type,
old_addr,
new_addr);
if ( result < 0 ) {
- HGOTO_ERROR(H5E_CACHE, H5E_CANTLOAD, FAIL, \
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTRENAME, FAIL, \
"H5C_rename_entry() failed.")
}
@@ -783,7 +764,7 @@ H5AC_protect(H5F_t *f,
if ( thing == NULL ) {
- HGOTO_ERROR(H5E_CACHE, H5E_PROTECT, NULL, "H5C_protect() failed.")
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTPROTECT, NULL, "H5C_protect() failed.")
}
/* Set return value */
@@ -886,7 +867,7 @@ H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr,
if ( result < 0 ) {
- HGOTO_ERROR(H5E_CACHE, H5E_NOTCACHED, FAIL, \
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTUNPROTECT, FAIL, \
"H5C_unprotect() failed.")
}
@@ -919,7 +900,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5AC_stats(H5F_t UNUSED *f)
+H5AC_stats(const H5F_t *f)
{
herr_t ret_value = SUCCEED; /* Return value */
@@ -928,7 +909,7 @@ H5AC_stats(H5F_t UNUSED *f)
HDassert(f);
HDassert(f->shared->cache);
- H5C_stats(f->shared->cache, f->name, FALSE); /* at present, this can't fail */
+ (void)H5C_stats(f->shared->cache, f->name, FALSE); /* at present, this can't fail */
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -964,12 +945,12 @@ done:
#ifdef H5_HAVE_PARALLEL
static herr_t
-H5AC_check_if_write_permitted(H5F_t *f,
+H5AC_check_if_write_permitted(const H5F_t *f,
hid_t dxpl_id,
hbool_t * write_permitted_ptr)
#else /* H5_HAVE_PARALLEL */
static herr_t
-H5AC_check_if_write_permitted(H5F_t UNUSED * f,
+H5AC_check_if_write_permitted(const H5F_t UNUSED * f,
hid_t UNUSED dxpl_id,
hbool_t * write_permitted_ptr)
#endif /* H5_HAVE_PARALLEL */
diff --git a/src/H5ACprivate.h b/src/H5ACprivate.h
index 214f38e..8c34d92 100644
--- a/src/H5ACprivate.h
+++ b/src/H5ACprivate.h
@@ -172,10 +172,10 @@ H5_DLL void *H5AC_protect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type,
H5_DLL herr_t H5AC_unprotect(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type, haddr_t addr,
void *thing, hbool_t deleted);
H5_DLL herr_t H5AC_flush(H5F_t *f, hid_t dxpl_id, unsigned flags);
-H5_DLL herr_t H5AC_rename(H5F_t *f, hid_t dxpl_id, const H5AC_class_t *type,
+H5_DLL herr_t H5AC_rename(H5F_t *f, const H5AC_class_t *type,
haddr_t old_addr, haddr_t new_addr);
H5_DLL herr_t H5AC_dest(H5F_t *f, hid_t dxpl_id);
-H5_DLL herr_t H5AC_stats(H5F_t *f);
+H5_DLL herr_t H5AC_stats(const H5F_t *f);
#endif /* !_H5ACprivate_H */
diff --git a/src/H5B.c b/src/H5B.c
index 1da136d..4626d0c 100644
--- a/src/H5B.c
+++ b/src/H5B.c
@@ -141,7 +141,7 @@ static herr_t H5B_split(H5F_t *f, hid_t dxpl_id, H5B_t *old_bt,
haddr_t old_addr, unsigned idx,
void *udata, haddr_t *new_addr/*out*/);
static H5B_t * H5B_copy(const H5B_t *old_bt);
-static herr_t H5B_serialize(H5F_t *f, H5B_t *bt);
+static herr_t H5B_serialize(const H5F_t *f, const H5B_t *bt);
#ifdef H5B_DEBUG
static herr_t H5B_assert(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type,
void *udata);
@@ -152,7 +152,7 @@ static H5B_t *H5B_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_type,
static herr_t H5B_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B_t *b);
static herr_t H5B_dest(H5F_t *f, H5B_t *b);
static herr_t H5B_clear(H5F_t *f, H5B_t *b, hbool_t destroy);
-static herr_t H5B_compute_size(H5F_t *f, H5B_t *bt, size_t *size_ptr);
+static herr_t H5B_compute_size(const H5F_t *f, const H5B_t *bt, size_t *size_ptr);
/* H5B inherits cache-like properties from H5AC */
static const H5AC_class_t H5AC_BT[1] = {{
@@ -164,10 +164,6 @@ static const H5AC_class_t H5AC_BT[1] = {{
(H5AC_size_func_t)H5B_compute_size,
}};
-/* Interface initialization? */
-#define INTERFACE_INIT NULL
-static int interface_initialize_g = 0;
-
/* Declare a PQ free list to manage the native block information */
H5FL_BLK_DEFINE_STATIC(native_block);
@@ -328,7 +324,7 @@ H5B_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_type, void *udata)
p += 4;
/* node type and level */
- if (*p++ != type->id)
+ if (*p++ != (uint8_t)type->id)
HGOTO_ERROR(H5E_BTREE, H5E_CANTLOAD, NULL, "incorrect B-tree node type")
bt->level = *p++;
@@ -387,7 +383,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5B_serialize(H5F_t *f, H5B_t *bt)
+H5B_serialize(const H5F_t *f, const H5B_t *bt)
{
H5B_shared_t *shared=NULL; /* Pointer to shared B-tree info */
unsigned u;
@@ -411,7 +407,7 @@ H5B_serialize(H5F_t *f, H5B_t *bt)
p += 4;
/* node type and level */
- *p++ = shared->type->id;
+ *p++ = (uint8_t)shared->type->id;
H5_CHECK_OVERFLOW(bt->level, unsigned, uint8_t);
*p++ = (uint8_t)bt->level;
@@ -492,7 +488,7 @@ H5B_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5B_t *bt)
if (bt->cache_info.is_dirty) {
if (H5B_serialize(f, bt) < 0)
- HGOTO_ERROR(H5E_BTREE, H5E_CANTFLUSH, FAIL, "unable to serialize B-tree")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTSERIALIZE, FAIL, "unable to serialize B-tree")
/*
* Write the disk page. We always write the header, but we don't
@@ -605,7 +601,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5B_compute_size(H5F_t *f, H5B_t *bt, size_t *size_ptr)
+H5B_compute_size(const H5F_t *f, const H5B_t *bt, size_t *size_ptr)
{
H5B_shared_t *shared; /* Pointer to shared B-tree info */
size_t size;
@@ -622,23 +618,15 @@ H5B_compute_size(H5F_t *f, H5B_t *bt, size_t *size_ptr)
HDassert(shared->type);
HDassert(size_ptr);
- size = H5B_nodesize(f, shared, NULL);
-
- if ( size == 0 ) {
-
- HGOTO_ERROR(H5E_RESOURCE, H5E_BADSIZE, FAIL, \
- "H5B_nodesize() failed");
-
- } else {
-
- *size_ptr = size;
+ /* Check node's size */
+ if ((size = H5B_nodesize(f, shared, NULL)) == 0)
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGETSIZE, FAIL, "H5B_nodesize() failed")
- }
+ /* Set size value */
+ *size_ptr = size;
done:
-
FUNC_LEAVE_NOAPI(ret_value)
-
} /* H5B_H5B_compute_size() */
@@ -737,7 +725,7 @@ H5B_find(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void *u
HGOTO_DONE(FAIL)
#endif /* OLD_WAY */
} else {
- if ((type->found) (f, dxpl_id, bt->child[idx], H5B_NKEY(bt,shared,idx), udata, H5B_NKEY(bt,shared,idx+1)) < 0)
+ if ((type->found) (f, dxpl_id, bt->child[idx], H5B_NKEY(bt,shared,idx), udata) < 0)
/* Note: don't push error on stack, leave that to next higher level,
* since many times the B-tree is searched in order to determine
* if an object exists in the B-tree or not. -QAK
@@ -815,7 +803,7 @@ H5B_split(H5F_t *f, hid_t dxpl_id, H5B_t *old_bt, haddr_t old_addr,
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset transfer property list")
/* Get B-tree split ratios */
- if(H5P_get(dx_plist, H5D_XFER_BTREE_SPLIT_RATIO_NAME, &split_ratios)<0)
+ if(H5P_get(dx_plist, H5D_XFER_BTREE_SPLIT_RATIO_NAME, &split_ratios[0])<0)
HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve B-tree split ratios")
#ifdef H5B_DEBUG
@@ -975,9 +963,8 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr,
assert(type->sizeof_nkey <= sizeof _lt_key);
assert(H5F_addr_defined(addr));
- if ((my_ins = H5B_insert_helper(f, dxpl_id, addr, type, lt_key,
- &lt_key_changed, md_key, udata, rt_key, &rt_key_changed, &child/*out*/))<0 ||
- my_ins<0)
+ if ((int)(my_ins = H5B_insert_helper(f, dxpl_id, addr, type, lt_key,
+ &lt_key_changed, md_key, udata, rt_key, &rt_key_changed, &child/*out*/))<0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTINIT, FAIL, "unable to insert key")
if (H5B_INS_NOOP == my_ins)
HGOTO_DONE(SUCCEED)
@@ -1060,7 +1047,7 @@ H5B_insert(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr,
bt=NULL; /* Make certain future references will be caught */
/* Move the location of the old root on the disk */
- if (H5AC_rename(f, dxpl_id, H5AC_BT, addr, old_root) < 0)
+ if (H5AC_rename(f, H5AC_BT, addr, old_root) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTSPLIT, FAIL, "unable to move B-tree root node")
/* clear the old root info at the old address (we already copied it) */
@@ -1282,7 +1269,7 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type
idx = 0;
if (type->follow_min) {
- if ((my_ins = (type->insert)(f, dxpl_id, bt->child[idx], H5B_NKEY(bt,shared,idx),
+ if ((int)(my_ins = (type->insert)(f, dxpl_id, bt->child[idx], H5B_NKEY(bt,shared,idx),
lt_key_changed, md_key, udata, H5B_NKEY(bt,shared,idx+1),
rt_key_changed, &child_addr/*out*/)) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "unable to insert first leaf node")
@@ -1295,7 +1282,7 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type
* The value being inserted is less than any value in this tree.
* Follow the minimum branch out of this node to a subtree.
*/
- if ((my_ins = H5B_insert_helper(f, dxpl_id, bt->child[idx], type,
+ if ((int)(my_ins = H5B_insert_helper(f, dxpl_id, bt->child[idx], type,
H5B_NKEY(bt,shared,idx), lt_key_changed, md_key,
udata, H5B_NKEY(bt,shared,idx+1), rt_key_changed,
&child_addr/*out*/))<0)
@@ -1306,7 +1293,7 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type
* current node. Follow the minimum branch to a leaf node and let the
* subclass handle the problem.
*/
- if ((my_ins = (type->insert)(f, dxpl_id, bt->child[idx], H5B_NKEY(bt,shared,idx),
+ if ((int)(my_ins = (type->insert)(f, dxpl_id, bt->child[idx], H5B_NKEY(bt,shared,idx),
lt_key_changed, md_key, udata, H5B_NKEY(bt,shared,idx+1),
rt_key_changed, &child_addr/*out*/)) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert minimum leaf node")
@@ -1329,7 +1316,7 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type
* Follow the maximum branch out of this node to a subtree.
*/
idx = bt->nchildren - 1;
- if ((my_ins = H5B_insert_helper(f, dxpl_id, bt->child[idx], type,
+ if ((int)(my_ins = H5B_insert_helper(f, dxpl_id, bt->child[idx], type,
H5B_NKEY(bt,shared,idx), lt_key_changed, md_key, udata,
H5B_NKEY(bt,shared,idx+1), rt_key_changed, &child_addr/*out*/)) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert maximum subtree")
@@ -1340,7 +1327,7 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type
* subclass handle the problem.
*/
idx = bt->nchildren - 1;
- if ((my_ins = (type->insert)(f, dxpl_id, bt->child[idx], H5B_NKEY(bt,shared,idx),
+ if ((int)(my_ins = (type->insert)(f, dxpl_id, bt->child[idx], H5B_NKEY(bt,shared,idx),
lt_key_changed, md_key, udata, H5B_NKEY(bt,shared,idx+1),
rt_key_changed, &child_addr/*out*/)) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert maximum leaf node")
@@ -1372,7 +1359,7 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type
* Follow a branch out of this node to another subtree.
*/
assert(idx < bt->nchildren);
- if ((my_ins = H5B_insert_helper(f, dxpl_id, bt->child[idx], type,
+ if ((int)(my_ins = H5B_insert_helper(f, dxpl_id, bt->child[idx], type,
H5B_NKEY(bt,shared,idx), lt_key_changed, md_key, udata,
H5B_NKEY(bt,shared,idx+1), rt_key_changed, &child_addr/*out*/)) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert subtree")
@@ -1381,12 +1368,12 @@ H5B_insert_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type
* Follow a branch out of this node to a leaf node of some other type.
*/
assert(idx < bt->nchildren);
- if ((my_ins = (type->insert)(f, dxpl_id, bt->child[idx], H5B_NKEY(bt,shared,idx),
+ if ((int)(my_ins = (type->insert)(f, dxpl_id, bt->child[idx], H5B_NKEY(bt,shared,idx),
lt_key_changed, md_key, udata, H5B_NKEY(bt,shared,idx+1),
rt_key_changed, &child_addr/*out*/)) < 0)
HGOTO_ERROR(H5E_BTREE, H5E_CANTINSERT, H5B_INS_ERROR, "can't insert leaf node")
}
- assert(my_ins >= 0);
+ assert((int)my_ins >= 0);
/*
* Update the left and right keys of the current node.
@@ -1623,10 +1610,9 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type
{
H5B_t *bt = NULL, *sibling = NULL;
H5B_shared_t *shared; /* Pointer to shared B-tree info */
- H5B_ins_t ret_value = H5B_INS_ERROR;
unsigned idx=0, lt=0, rt; /* Final, left & right indices */
int cmp=1; /* Key comparison value */
- size_t sizeof_rec;
+ H5B_ins_t ret_value = H5B_INS_ERROR;
FUNC_ENTER_NOAPI(H5B_remove_helper, H5B_INS_ERROR)
@@ -1635,7 +1621,6 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type
assert(type);
assert(type->decode);
assert(type->cmp3);
- assert(type->found);
assert(lt_key && lt_key_changed);
assert(udata);
assert(rt_key && rt_key_changed);
@@ -1669,7 +1654,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type
assert(idx<bt->nchildren);
if (bt->level>0) {
/* We're at an internal node -- call recursively */
- if ((ret_value=H5B_remove_helper(f, dxpl_id,
+ if ((int)(ret_value=H5B_remove_helper(f, dxpl_id,
bt->child[idx], type, level+1, H5B_NKEY(bt,shared,idx)/*out*/,
lt_key_changed/*out*/, udata, H5B_NKEY(bt,shared,idx+1)/*out*/,
rt_key_changed/*out*/))<0)
@@ -1680,7 +1665,7 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type
* has a removal method. Pass the removal request to the pointed-to
* object and let it decide how to progress.
*/
- if ((ret_value=(type->remove)(f, dxpl_id,
+ if ((int)(ret_value=(type->remove)(f, dxpl_id,
bt->child[idx], H5B_NKEY(bt,shared,idx), lt_key_changed, udata,
H5B_NKEY(bt,shared,idx+1), rt_key_changed))<0)
HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, H5B_INS_ERROR, "key not found in leaf node")
@@ -1746,7 +1731,6 @@ H5B_remove_helper(H5F_t *f, hid_t dxpl_id, haddr_t addr, const H5B_class_t *type
* If the subtree returned H5B_INS_REMOVE then we should remove the
* subtree entry from the current node. There are four cases:
*/
- sizeof_rec = shared->sizeof_rkey + H5F_SIZEOF_ADDR(f);
if (H5B_INS_REMOVE==ret_value && 1==bt->nchildren) {
/*
* The subtree is the only child of this node. Discard both
@@ -2001,7 +1985,7 @@ H5B_delete(H5F_t *f, hid_t dxpl_id, const H5B_class_t *type, haddr_t addr, void
/* Call user's callback for each entry */
if ((type->remove)(f, dxpl_id,
bt->child[u], H5B_NKEY(bt,shared,u), &lt_key_changed, udata,
- H5B_NKEY(bt,shared,u+1), &rt_key_changed)<0)
+ H5B_NKEY(bt,shared,u+1), &rt_key_changed)<H5B_INS_NOOP)
HGOTO_ERROR(H5E_BTREE, H5E_NOTFOUND, FAIL, "can't remove B-tree node")
} /* end for */
} /* end if */
diff --git a/src/H5Bprivate.h b/src/H5Bprivate.h
index 87e57f3..b4b1a97 100644
--- a/src/H5Bprivate.h
+++ b/src/H5Bprivate.h
@@ -67,8 +67,8 @@ typedef enum H5B_ins_t {
#define H5B_ITER_STOP (1)
/* Define the operator callback function pointer for H5B_iterate() */
-typedef int (*H5B_operator_t)(H5F_t *f, hid_t, void *_lt_key, haddr_t addr,
- void *_rt_key, void *_udata);
+typedef int (*H5B_operator_t)(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr,
+ const void *_rt_key, void *_udata);
/* Typedef for B-tree in memory (defined in H5Bpkg.h) */
typedef struct H5B_t H5B_t;
@@ -98,11 +98,11 @@ typedef struct H5B_class_t {
H5B_subid_t id; /*id as found in file*/
size_t sizeof_nkey; /*size of native (memory) key*/
size_t (*get_sizeof_rkey)(const H5F_t*, const void*); /*raw key size */
- H5RC_t * (*get_shared)(H5F_t*, const void*); /*shared info for node */
+ H5RC_t * (*get_shared)(const H5F_t*, const void*); /*shared info for node */
herr_t (*new_node)(H5F_t*, hid_t, H5B_ins_t, void*, void*, void*, haddr_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*, const void*);
+ 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*,
@@ -117,8 +117,8 @@ typedef struct H5B_class_t {
hbool_t*);
/* encode, decode, debug key values */
- herr_t (*decode)(H5F_t*, struct H5B_t*, uint8_t*, void*);
- herr_t (*encode)(H5F_t*, struct H5B_t*, uint8_t*, void*);
+ herr_t (*decode)(const H5F_t*, const struct H5B_t*, const uint8_t*, void*);
+ herr_t (*encode)(const H5F_t*, const struct H5B_t*, uint8_t*, void*);
herr_t (*debug_key)(FILE*, H5F_t*, hid_t, int, int, const void*, const void*);
} H5B_class_t;
diff --git a/src/H5C.c b/src/H5C.c
index 394ddde..a608505 100644
--- a/src/H5C.c
+++ b/src/H5C.c
@@ -99,10 +99,6 @@
#include "H5Pprivate.h" /* Property lists */
#include "H5SLprivate.h" /* Skip lists */
-/* Interface initialization? */
-#define INTERFACE_INIT NULL
-static int interface_initialize_g = 0;
-
/****************************************************************************
*
@@ -2800,8 +2796,7 @@ done:
*/
herr_t
-H5C_rename_entry(H5F_t * f,
- H5C_t * cache_ptr,
+H5C_rename_entry(H5C_t * cache_ptr,
const H5C_class_t * type,
haddr_t old_addr,
haddr_t new_addr)
@@ -2814,7 +2809,6 @@ H5C_rename_entry(H5F_t * f,
HDassert( cache_ptr );
HDassert( cache_ptr->magic == H5C__H5C_T_MAGIC );
- HDassert( cache_ptr->skip_file_checks || f );
HDassert( type );
HDassert( H5F_addr_defined(old_addr) );
HDassert( H5F_addr_defined(new_addr) );
diff --git a/src/H5Cprivate.h b/src/H5Cprivate.h
index 7ae6b58..affd433 100644
--- a/src/H5Cprivate.h
+++ b/src/H5Cprivate.h
@@ -124,8 +124,8 @@ typedef herr_t (*H5C_dest_func_t)(H5F_t *f,
typedef herr_t (*H5C_clear_func_t)(H5F_t *f,
void *thing,
hbool_t dest);
-typedef herr_t (*H5C_size_func_t)(H5F_t *f,
- 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 {
@@ -140,7 +140,7 @@ typedef struct H5C_class_t {
/* Type defintions of call back functions used by the cache as a whole */
-typedef herr_t (*H5C_write_permitted_func_t)(H5F_t *f,
+typedef herr_t (*H5C_write_permitted_func_t)(const H5F_t *f,
hid_t dxpl_id,
hbool_t * write_permitted_ptr);
@@ -377,8 +377,7 @@ H5_DLL herr_t H5C_insert_entry(H5F_t * f,
haddr_t addr,
void * thing);
-H5_DLL herr_t H5C_rename_entry(H5F_t * f,
- H5C_t * cache_ptr,
+H5_DLL herr_t H5C_rename_entry(H5C_t * cache_ptr,
const H5C_class_t * type,
haddr_t old_addr,
haddr_t new_addr);
diff --git a/src/H5D.c b/src/H5D.c
index 0e0e94b..ddf21d5 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -14,6 +14,9 @@
#define H5D_PACKAGE /*suppress error about including H5Dpkg */
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5D_init_interface
+
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
#define PABLO_MASK H5D_mask
@@ -31,12 +34,7 @@
/*#define H5D_DEBUG*/
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT H5D_init_interface
-
/* Local functions */
-static herr_t H5D_init_interface(void);
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,
@@ -47,7 +45,7 @@ static hsize_t H5D_get_storage_size(H5D_t *dset, hid_t dxpl_id);
static haddr_t H5D_get_offset(const H5D_t *dset);
static herr_t H5D_extend(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id);
static herr_t H5D_set_extent(H5D_t *dataset, const hsize_t *size, hid_t dxpl_id);
-static herr_t H5D_init_type(H5F_t *file, H5D_t *dset, hid_t type_id, const H5T_t *type);
+static herr_t H5D_init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type);
static int H5D_crt_fill_value_cmp(const void *value1, const void *value2, size_t size);
static int H5D_crt_ext_file_list_cmp(const void *value1, const void *value2, size_t size);
static int H5D_crt_data_pipeline_cmp(const void *value1, const void *value2, size_t size);
@@ -420,8 +418,8 @@ H5D_term_interface(void)
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_term_interface)
- if (interface_initialize_g) {
- if ((n=H5I_nmembers(H5I_DATASET))) {
+ if (H5_interface_initialize_g) {
+ if ((n=H5I_nmembers(H5I_DATASET))>0) {
/* The dataset API uses the "force" flag set to true because it
* is using the "file objects" (H5FO) API functions to track open
* objects in the file. Using the H5FO code means that dataset
@@ -447,7 +445,7 @@ H5D_term_interface(void)
H5I_clear_group(H5I_DATASET, TRUE);
} else {
H5I_destroy_group(H5I_DATASET);
- interface_initialize_g = 0;
+ H5_interface_initialize_g = 0;
n = 1; /*H5I*/
}
}
@@ -1640,7 +1638,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_init_type(H5F_t *file, H5D_t *dset, hid_t type_id, const H5T_t *type)
+H5D_init_type(H5F_t *file, const H5D_t *dset, hid_t type_id, const H5T_t *type)
{
htri_t relocatable; /* Flag whether the type is relocatable */
htri_t immutable; /* Flag whether the type is immutable */
@@ -1981,6 +1979,10 @@ done:
* whether we're working with an external file or not. Between the
* two, there is a conditional call to allocate space which isn't
* part of updating the cache.
+ *
+ * Nat Furrer and James Laird
+ * June 7, 2004
+ * Added checked_filters flag
*
*-------------------------------------------------------------------------
*/
@@ -2253,7 +2255,7 @@ H5D_create(H5G_entry_t *loc, const char *name, hid_t type_id, const H5S_t *space
default:
HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, NULL, "not implemented yet")
- } /* end switch */
+ } /* end switch */ /*lint !e788 All appropriate cases are covered */
/* Update the dataset's entry info. */
if (H5D_update_entry_info(file, dxpl_id, new_dset, dc_plist) != SUCCEED)
@@ -2386,7 +2388,7 @@ done:
*-------------------------------------------------------------------------
*/
H5D_t*
-H5D_open(H5G_entry_t *ent, hid_t dxpl_id)
+H5D_open(const H5G_entry_t *ent, hid_t dxpl_id)
{
H5D_shared_t *shared_fo=NULL;
H5D_t *dataset=NULL;
@@ -2399,7 +2401,6 @@ H5D_open(H5G_entry_t *ent, hid_t dxpl_id)
/* Check if dataset was already open */
if((shared_fo=H5FO_opened(ent->file,ent->header))==NULL) {
-
/* Clear any errors from H5FO_opened() */
H5E_clear();
@@ -2429,16 +2430,15 @@ H5D_open(H5G_entry_t *ent, hid_t dxpl_id)
ret_value = dataset;
done:
- if(ret_value==NULL) {
+ if(ret_value==NULL) {
if(dataset) {
- if(shared_fo==NULL) { /* Need to free shared fo */
+ if(shared_fo==NULL) /* Need to free shared fo */
H5FL_FREE(H5D_shared_t, dataset->shared);
- }
H5FL_FREE(H5D_t, dataset);
}
if(shared_fo)
shared_fo->fo_count--;
- }
+ } /* end if */
FUNC_LEAVE_NOAPI(ret_value)
}
@@ -2588,7 +2588,7 @@ H5D_open_oid(const H5G_entry_t *ent, hid_t dxpl_id)
default:
HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, NULL, "not implemented yet")
- } /* end switch */
+ } /* end switch */ /*lint !e788 All appropriate cases are covered */
/* Point at dataset's copy, to cache it for later */
fill_prop=&dataset->shared->fill;
@@ -2620,7 +2620,7 @@ H5D_open_oid(const H5G_entry_t *ent, hid_t dxpl_id)
default:
HGOTO_ERROR(H5E_DATASET, H5E_UNSUPPORTED, NULL, "not implemented yet")
- } /* end switch */
+ } /* end switch */ /*lint !e788 All appropriate cases are covered */
/* Set the default fill time */
fill.fill_time=H5D_CRT_FILL_TIME_DEF;
@@ -2795,7 +2795,7 @@ H5D_close(H5D_t *dataset)
#ifdef NDEBUG
HGOTO_ERROR (H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout")
#endif /* NDEBUG */
- } /* end switch */
+ } /* end switch */ /*lint !e788 All appropriate cases are covered */
/*
* Release datatype, dataspace and creation property list -- there isn't
@@ -3119,7 +3119,7 @@ H5D_alloc_storage (H5F_t *f, hid_t dxpl_id, H5D_t *dset/*in,out*/, H5D_time_allo
#ifdef NDEBUG
HGOTO_ERROR (H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout")
#endif /* NDEBUG */
- } /* end switch */
+ } /* end switch */ /*lint !e788 All appropriate cases are covered */
/* Check if we need to initialize the space */
if(init_space) {
@@ -3244,7 +3244,7 @@ H5D_init_storage(H5D_t *dset, hbool_t full_overwrite, hid_t dxpl_id)
#ifdef NDEBUG
HGOTO_ERROR (H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout")
#endif /* NDEBUG */
- } /* end switch */
+ } /* end switch */ /*lint !e788 All appropriate cases are covered */
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -3338,7 +3338,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)
@@ -3434,7 +3434,7 @@ H5D_get_offset(const H5D_t *dset)
#ifdef NDEBUG
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)
@@ -3469,14 +3469,14 @@ done:
* Operation information:
* H5D_operator_t is defined as:
* typedef herr_t (*H5D_operator_t)(void *elem, hid_t type_id,
- * hsize_t ndim, hssize_t *point, void *operator_data);
+ * unsigned ndim, const hsize_t *point, void *operator_data);
*
* H5D_operator_t parameters:
* void *elem; IN/OUT: Pointer to the element in memory containing
* the current point.
* hid_t type_id; IN: Datatype ID for the elements stored in ELEM.
- * hsize_t ndim; IN: Number of dimensions for POINT array
- * hssize_t *point; IN: Array containing the location of the element
+ * unsigned ndim; IN: Number of dimensions for POINT array
+ * const hsize_t *point; IN: Array containing the location of the element
* within the original dataspace.
* void *operator_data; IN/OUT: Pointer to any user-defined data
* associated with the operation.
@@ -3648,7 +3648,7 @@ done:
*/
/* ARGSUSED */
static herr_t
-H5D_vlen_get_buf_size(void UNUSED *elem, hid_t type_id, hsize_t UNUSED ndim, hssize_t *point, void *op_data)
+H5D_vlen_get_buf_size(void UNUSED *elem, hid_t type_id, unsigned UNUSED ndim, const hsize_t *point, void *op_data)
{
H5D_vlen_bufsize_t *vlen_bufsize=(H5D_vlen_bufsize_t *)op_data;
H5T_t *dt = NULL;
@@ -3668,7 +3668,7 @@ H5D_vlen_get_buf_size(void UNUSED *elem, hid_t type_id, hsize_t UNUSED ndim, hss
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't resize tbuf")
/* Select point to read in */
- if (H5Sselect_elements(vlen_bufsize->fspace_id,H5S_SELECT_SET,1,(const hssize_t **)point)<0)
+ if (H5Sselect_elements(vlen_bufsize->fspace_id,H5S_SELECT_SET,1,(const hsize_t **)point)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't select point")
/* Read in the point (with the custom VL memory allocator) */
@@ -3970,7 +3970,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5D_flush(H5F_t *f, hid_t dxpl_id, unsigned flags)
+H5D_flush(const H5F_t *f, hid_t dxpl_id, unsigned flags)
{
int num_dsets; /* Number of datasets in file */
hid_t *id_list=NULL; /* list of dataset IDs */
@@ -4035,7 +4035,7 @@ H5D_flush(H5F_t *f, hid_t dxpl_id, unsigned flags)
#ifdef NDEBUG
HGOTO_ERROR (H5E_IO, H5E_UNSUPPORTED, FAIL, "unsupported storage layout")
#endif /* NDEBUG */
- } /* end switch */
+ } /* end switch */ /*lint !e788 All appropriate cases are covered */
}
} /* end if */
@@ -4065,13 +4065,13 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Ddebug(hid_t dset_id, unsigned UNUSED flags)
+H5Ddebug(hid_t dset_id)
{
H5D_t *dset=NULL;
herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_API(H5Ddebug, FAIL)
- H5TRACE2("e","iIu",dset_id,flags);
+ H5TRACE1("e","i",dset_id);
/* Check args */
if (NULL==(dset=H5I_object_verify(dset_id, H5I_DATASET)))
diff --git a/src/H5Dcompact.c b/src/H5Dcompact.c
index bf56acc..8a032e3 100644
--- a/src/H5Dcompact.c
+++ b/src/H5Dcompact.c
@@ -35,10 +35,6 @@
#include "H5Oprivate.h" /* Object headers */
#include "H5Vprivate.h" /* Vector and array functions */
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
-
/*-------------------------------------------------------------------------
* Function: H5D_compact_readvv
@@ -61,23 +57,23 @@ static int interface_initialize_g = 0;
*-------------------------------------------------------------------------
*/
ssize_t
-H5D_compact_readvv(H5D_io_info_t *io_info,
+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[],
void *buf)
{
ssize_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5D_compact_readvv, FAIL);
+ FUNC_ENTER_NOAPI(H5D_compact_readvv, FAIL)
assert(io_info->dset);
/* Use the vectorized memory copy routine to do actual work */
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");
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "vectorized memcpy failed")
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_compact_readvv() */
@@ -105,23 +101,23 @@ done:
*-------------------------------------------------------------------------
*/
ssize_t
-H5D_compact_writevv(H5D_io_info_t *io_info,
+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[],
const void *buf)
{
ssize_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5D_compact_writevv, FAIL);
+ FUNC_ENTER_NOAPI(H5D_compact_writevv, FAIL)
assert(io_info->dset);
/* Use the vectorized memory copy routine to do actual work */
if((ret_value=H5V_memcpyvv(io_info->dset->shared->layout.u.compact.buf,dset_max_nseq,dset_curr_seq,dset_size_arr,dset_offset_arr,buf,mem_max_nseq,mem_curr_seq,mem_size_arr,mem_offset_arr))<0)
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "vectorized memcpy failed");
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "vectorized memcpy failed")
io_info->dset->shared->layout.u.compact.dirty = TRUE;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_compact_writevv() */
diff --git a/src/H5Dcontig.c b/src/H5Dcontig.c
index be2c45b..18c6677 100644
--- a/src/H5Dcontig.c
+++ b/src/H5Dcontig.c
@@ -44,10 +44,6 @@
static herr_t H5D_contig_write(H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache,
hid_t dxpl_id, const H5D_storage_t *store, hsize_t offset, size_t size, const void *buf);
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
-
/* Declare a PQ free list to manage the sieve buffer information */
H5FL_BLK_DEFINE(sieve_buf);
@@ -77,7 +73,7 @@ H5D_contig_create(H5F_t *f, hid_t dxpl_id, H5O_layout_t *layout /*out */ )
{
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5D_contig_create, FAIL);
+ FUNC_ENTER_NOAPI(H5D_contig_create, FAIL)
/* check args */
assert(f);
@@ -85,10 +81,10 @@ H5D_contig_create(H5F_t *f, hid_t dxpl_id, H5O_layout_t *layout /*out */ )
/* Allocate space for the contiguous data */
if (HADDR_UNDEF==(layout->u.contig.addr=H5MF_alloc(f, H5FD_MEM_DRAW, dxpl_id, layout->u.contig.size)))
- HGOTO_ERROR (H5E_IO, H5E_NOSPACE, FAIL, "unable to reserve file space");
+ HGOTO_ERROR (H5E_IO, H5E_NOSPACE, FAIL, "unable to reserve file space")
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_contig_create */
@@ -133,7 +129,7 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id)
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);
+ FUNC_ENTER_NOAPI(H5D_contig_fill, FAIL)
/* Check args */
assert(TRUE==H5P_isa_class(dxpl_id,H5P_DATASET_XFER));
@@ -147,11 +143,11 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id)
if(IS_H5FD_MPI(dset->ent.file)) {
/* Get the MPI communicator */
if (MPI_COMM_NULL == (mpi_comm=H5F_mpi_get_comm(dset->ent.file)))
- HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI communicator");
+ HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI communicator")
/* Get the MPI rank */
if ((mpi_rank=H5F_mpi_get_rank(dset->ent.file))<0)
- HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI rank");
+ HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI rank")
/* Set the MPI-capable file driver flag */
using_mpi=1;
@@ -198,7 +194,7 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id)
if(dset->shared->fill.buf) {
/* Allocate temporary buffer */
if ((buf=H5FL_BLK_MALLOC(non_zero_fill,bufsize))==NULL)
- HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for fill buffer");
+ HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for fill buffer")
H5V_array_fill(buf, dset->shared->fill.buf, elmt_size, ptsperbuf);
@@ -218,7 +214,7 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id)
else
buf=H5FL_BLK_MALLOC(zero_fill,bufsize);
if(buf==NULL)
- HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for fill buffer");
+ HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for fill buffer")
/* Indicate that a zero fill buffer was used */
non_zero_fill_f=0;
@@ -238,7 +234,7 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id)
/* !! Use the internal "independent" DXPL!! -QAK */
if(H5_PAR_META_WRITE==mpi_rank) {
if (H5D_contig_write(dset, dxpl_cache, H5AC_ind_dxpl_id, &store, offset, size, buf)<0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to write fill value to dataset");
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to write fill value to dataset")
} /* end if */
/* Indicate that blocks are being written */
@@ -248,7 +244,7 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id)
#endif /* H5_HAVE_PARALLEL */
H5_CHECK_OVERFLOW(size,size_t,hsize_t);
if (H5D_contig_write(dset, dxpl_cache, dxpl_id, &store, offset, size, buf)<0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to write fill value to dataset");
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to write fill value to dataset")
#ifdef H5_HAVE_PARALLEL
} /* end else */
#endif /* H5_HAVE_PARALLEL */
@@ -266,7 +262,7 @@ H5D_contig_fill(H5D_t *dset, hid_t dxpl_id)
* in, getting bogus data.
*/
if (MPI_SUCCESS != (mpi_code=MPI_Barrier(mpi_comm)))
- HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_code);
+ HMPI_GOTO_ERROR(FAIL, "MPI_Barrier failed", mpi_code)
} /* end if */
#endif /* H5_HAVE_PARALLEL */
@@ -280,7 +276,7 @@ done:
H5FL_BLK_FREE(zero_fill,buf);
} /* end if */
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_contig_fill() */
@@ -303,7 +299,7 @@ H5D_contig_delete(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout)
{
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5D_contig_delete, FAIL);
+ FUNC_ENTER_NOAPI(H5D_contig_delete, FAIL)
/* check args */
assert(f);
@@ -311,10 +307,10 @@ H5D_contig_delete(H5F_t *f, hid_t dxpl_id, const struct H5O_layout_t *layout)
/* Free the file space for the chunk */
if (H5MF_xfree(f, H5FD_MEM_DRAW, dxpl_id, layout->u.contig.addr, layout->u.contig.size)<0)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free object header");
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTFREE, FAIL, "unable to free object header")
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_contig_delete */
@@ -335,19 +331,13 @@ done:
haddr_t
H5D_contig_get_addr(const H5D_t *dset)
{
- haddr_t ret_value; /* Return value */
-
- FUNC_ENTER_NOAPI(H5D_contig_get_addr, HADDR_UNDEF);
+ FUNC_ENTER_NOAPI_NOFUNC(H5D_contig_get_addr)
/* check args */
assert(dset);
assert(dset->shared->layout.type==H5D_CONTIGUOUS);
- /* Get the address */
- ret_value=dset->shared->layout.u.contig.addr;
-
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(dset->shared->layout.u.contig.addr)
} /* end H5D_contig_get_addr */
@@ -382,7 +372,7 @@ H5D_contig_write(H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache,
size_t mem_curr_seq=0; /* "Current sequence" in memory */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5D_contig_write, FAIL);
+ FUNC_ENTER_NOAPI(H5D_contig_write, FAIL)
assert (dset);
assert (dxpl_cache);
@@ -392,10 +382,10 @@ H5D_contig_write(H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache,
H5D_BUILD_IO_INFO(&io_info,dset,dxpl_cache,dxpl_id,store);
if (H5D_contig_writevv(&io_info,
1, &dset_curr_seq, &dset_len, &dset_off, 1, &mem_curr_seq, &mem_len, &mem_off, buf)<0)
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "vector write failed");
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "vector write failed")
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_contig_write() */
@@ -420,7 +410,7 @@ done:
*-------------------------------------------------------------------------
*/
ssize_t
-H5D_contig_readvv(H5D_io_info_t *io_info,
+H5D_contig_readvv(const H5D_io_info_t *io_info,
size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[],
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[],
void *_buf)
@@ -430,12 +420,13 @@ H5D_contig_readvv(H5D_io_info_t *io_info,
const H5D_contig_storage_t *store_contig=&(io_info->store->contig); /* Contiguous storage info for this I/O operation */
unsigned char *buf=(unsigned char *)_buf; /* Pointer to buffer to fill */
haddr_t addr; /* Actual address to read */
+ size_t total_size=0; /* Total size of sequence in bytes */
size_t size; /* Size of sequence in bytes */
size_t u; /* Counting variable */
size_t v; /* Counting variable */
- ssize_t ret_value=0; /* Return value */
-
- FUNC_ENTER_NOAPI(H5D_contig_readvv, FAIL);
+ ssize_t ret_value; /* Return value */
+
+ FUNC_ENTER_NOAPI(H5D_contig_readvv, FAIL)
/* Check args */
assert(io_info);
@@ -482,19 +473,19 @@ H5D_contig_readvv(H5D_io_info_t *io_info,
/* Check if we can actually hold the I/O request in the sieve buffer */
if(size>dset_contig->sieve_buf_size) {
if (H5F_block_read(file, H5FD_MEM_DRAW, addr, size, io_info->dxpl_id, buf)<0)
- HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "block read failed");
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "block read failed")
} /* end if */
else {
/* Allocate room for the data sieve buffer */
if (NULL==(dset_contig->sieve_buf=H5FL_BLK_MALLOC(sieve_buf,dset_contig->sieve_buf_size)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
/* Determine the new sieve buffer size & location */
dset_contig->sieve_loc=addr;
/* Make certain we don't read off the end of the file */
if (HADDR_UNDEF==(abs_eoa=H5F_get_eoa(file)))
- HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to determine file size");
+ HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to determine file size")
/* Adjust absolute EOA address to relative EOA address */
rel_eoa=abs_eoa-H5F_get_base_addr(file);
@@ -507,7 +498,7 @@ H5D_contig_readvv(H5D_io_info_t *io_info,
/* Read the new sieve buffer */
if (H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, io_info->dxpl_id, dset_contig->sieve_buf)<0)
- HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "block read failed");
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "block read failed")
/* Grab the data out of the buffer (must be first piece of data in buffer ) */
HDmemcpy(buf,dset_contig->sieve_buf,size);
@@ -543,7 +534,7 @@ H5D_contig_readvv(H5D_io_info_t *io_info,
if(dset_contig->sieve_dirty) {
/* Write to file */
if (H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, io_info->dxpl_id, dset_contig->sieve_buf)<0)
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed");
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed")
/* Reset sieve buffer dirty flag */
dset_contig->sieve_dirty=0;
@@ -552,7 +543,7 @@ H5D_contig_readvv(H5D_io_info_t *io_info,
/* Read directly into the user's buffer */
if (H5F_block_read(file, H5FD_MEM_DRAW, addr, size, io_info->dxpl_id, buf)<0)
- HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "block read failed");
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "block read failed")
} /* end if */
/* Element size fits within the buffer size */
else {
@@ -560,7 +551,7 @@ H5D_contig_readvv(H5D_io_info_t *io_info,
if(dset_contig->sieve_dirty) {
/* Write to file */
if (H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, io_info->dxpl_id, dset_contig->sieve_buf)<0)
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed");
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed")
/* Reset sieve buffer dirty flag */
dset_contig->sieve_dirty=0;
@@ -571,7 +562,7 @@ H5D_contig_readvv(H5D_io_info_t *io_info,
/* Make certain we don't read off the end of the file */
if (HADDR_UNDEF==(abs_eoa=H5F_get_eoa(file)))
- HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to determine file size");
+ HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to determine file size")
/* Adjust absolute EOA address to relative EOA address */
rel_eoa=abs_eoa-H5F_get_base_addr(file);
@@ -590,7 +581,7 @@ H5D_contig_readvv(H5D_io_info_t *io_info,
/* Read the new sieve buffer */
if (H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, io_info->dxpl_id, dset_contig->sieve_buf)<0)
- HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "block read failed");
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "block read failed")
/* Grab the data out of the buffer (must be first piece of data in buffer ) */
HDmemcpy(buf,dset_contig->sieve_buf,size);
@@ -614,7 +605,7 @@ H5D_contig_readvv(H5D_io_info_t *io_info,
u++;
/* Increment number of bytes copied */
- ret_value+=size;
+ total_size+=size;
} /* end for */
} /* end if */
else {
@@ -634,7 +625,7 @@ H5D_contig_readvv(H5D_io_info_t *io_info,
/* Write data */
if (H5F_block_read(file, H5FD_MEM_DRAW, addr, size, io_info->dxpl_id, buf)<0)
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed");
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed")
/* Update memory information */
mem_len_arr[v]-=size;
@@ -649,7 +640,7 @@ H5D_contig_readvv(H5D_io_info_t *io_info,
u++;
/* Increment number of bytes copied */
- ret_value+=size;
+ total_size+=size;
} /* end for */
} /* end else */
@@ -657,8 +648,11 @@ H5D_contig_readvv(H5D_io_info_t *io_info,
*dset_curr_seq=u;
*mem_curr_seq=v;
+ /* Set return value */
+ H5_ASSIGN_OVERFLOW(ret_value,total_size,size_t,ssize_t);
+
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_contig_readvv() */
@@ -683,7 +677,7 @@ done:
*-------------------------------------------------------------------------
*/
ssize_t
-H5D_contig_writevv(H5D_io_info_t *io_info,
+H5D_contig_writevv(const H5D_io_info_t *io_info,
size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[],
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[],
const void *_buf)
@@ -693,12 +687,13 @@ H5D_contig_writevv(H5D_io_info_t *io_info,
const H5D_contig_storage_t *store_contig=&(io_info->store->contig); /* Contiguous storage info for this I/O operation */
const unsigned char *buf=_buf; /* Pointer to buffer to fill */
haddr_t addr; /* Actual address to read */
+ size_t total_size=0; /* Size of sequence in bytes */
size_t size; /* Size of sequence in bytes */
size_t u; /* Counting variable */
size_t v; /* Counting variable */
- ssize_t ret_value=0; /* Return value */
+ ssize_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5D_contig_writevv, FAIL);
+ FUNC_ENTER_NOAPI(H5D_contig_writevv, FAIL)
/* Check args */
assert(io_info);
@@ -745,19 +740,19 @@ H5D_contig_writevv(H5D_io_info_t *io_info,
/* Check if we can actually hold the I/O request in the sieve buffer */
if(size>dset_contig->sieve_buf_size) {
if (H5F_block_write(file, H5FD_MEM_DRAW, addr, size, io_info->dxpl_id, buf)<0)
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed");
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed")
} /* end if */
else {
/* Allocate room for the data sieve buffer */
if (NULL==(dset_contig->sieve_buf=H5FL_BLK_MALLOC(sieve_buf,dset_contig->sieve_buf_size)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
/* Determine the new sieve buffer size & location */
dset_contig->sieve_loc=addr;
/* Make certain we don't read off the end of the file */
if (HADDR_UNDEF==(abs_eoa=H5F_get_eoa(file)))
- HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to determine file size");
+ HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to determine file size")
/* Adjust absolute EOA address to relative EOA address */
rel_eoa=abs_eoa-H5F_get_base_addr(file);
@@ -772,7 +767,7 @@ H5D_contig_writevv(H5D_io_info_t *io_info,
if(dset_contig->sieve_size>size) {
/* Read the new sieve buffer */
if (H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, io_info->dxpl_id, dset_contig->sieve_buf)<0)
- HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "block read failed");
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "block read failed")
} /* end if */
/* Grab the data out of the buffer (must be first piece of data in buffer ) */
@@ -812,7 +807,7 @@ H5D_contig_writevv(H5D_io_info_t *io_info,
if(dset_contig->sieve_dirty) {
/* Write to file */
if (H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, io_info->dxpl_id, dset_contig->sieve_buf)<0)
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed");
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed")
/* Reset sieve buffer dirty flag */
dset_contig->sieve_dirty=0;
@@ -825,7 +820,7 @@ H5D_contig_writevv(H5D_io_info_t *io_info,
/* Write directly from the user's buffer */
if (H5F_block_write(file, H5FD_MEM_DRAW, addr, size, io_info->dxpl_id, buf)<0)
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed");
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed")
} /* end if */
/* Element size fits within the buffer size */
else {
@@ -836,7 +831,7 @@ H5D_contig_writevv(H5D_io_info_t *io_info,
/* Prepend to existing sieve buffer */
if((addr+size)==sieve_start) {
/* Move existing sieve information to correct location */
- HDmemmove(dset_contig->sieve_buf+size,dset_contig->sieve_buf,sieve_size);
+ HDmemmove(dset_contig->sieve_buf+size,dset_contig->sieve_buf,dset_contig->sieve_size);
/* Copy in new information (must be first in sieve buffer) */
HDmemcpy(dset_contig->sieve_buf,buf,size);
@@ -859,14 +854,13 @@ H5D_contig_writevv(H5D_io_info_t *io_info,
sieve_size=dset_contig->sieve_size;
sieve_end=sieve_start+sieve_size;
} /* end if */
-
/* Can't add the new data onto the existing sieve buffer */
else {
/* Flush the sieve buffer if it's dirty */
if(dset_contig->sieve_dirty) {
/* Write to file */
if (H5F_block_write(file, H5FD_MEM_DRAW, sieve_start, sieve_size, io_info->dxpl_id, dset_contig->sieve_buf)<0)
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed");
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed")
/* Reset sieve buffer dirty flag */
dset_contig->sieve_dirty=0;
@@ -877,7 +871,7 @@ H5D_contig_writevv(H5D_io_info_t *io_info,
/* Make certain we don't read off the end of the file */
if (HADDR_UNDEF==(abs_eoa=H5F_get_eoa(file)))
- HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to determine file size");
+ HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to determine file size")
/* Adjust absolute EOA address to relative EOA address */
rel_eoa=abs_eoa-H5F_get_base_addr(file);
@@ -898,7 +892,7 @@ H5D_contig_writevv(H5D_io_info_t *io_info,
if(dset_contig->sieve_size>size) {
/* Read the new sieve buffer */
if (H5F_block_read(file, H5FD_MEM_DRAW, dset_contig->sieve_loc, dset_contig->sieve_size, io_info->dxpl_id, dset_contig->sieve_buf)<0)
- HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "block read failed");
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "block read failed")
} /* end if */
/* Grab the data out of the buffer (must be first piece of data in buffer ) */
@@ -924,7 +918,7 @@ H5D_contig_writevv(H5D_io_info_t *io_info,
u++;
/* Increment number of bytes copied */
- ret_value+=size;
+ total_size+=size;
} /* end for */
} /* end if */
else {
@@ -944,7 +938,7 @@ H5D_contig_writevv(H5D_io_info_t *io_info,
/* Write data */
if (H5F_block_write(file, H5FD_MEM_DRAW, addr, size, io_info->dxpl_id, buf)<0)
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed");
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed")
/* Update memory information */
mem_len_arr[v]-=size;
@@ -959,7 +953,7 @@ H5D_contig_writevv(H5D_io_info_t *io_info,
u++;
/* Increment number of bytes copied */
- ret_value+=size;
+ total_size+=size;
} /* end for */
} /* end else */
@@ -967,7 +961,10 @@ H5D_contig_writevv(H5D_io_info_t *io_info,
*dset_curr_seq=u;
*mem_curr_seq=v;
+ /* Set return value */
+ H5_ASSIGN_OVERFLOW(ret_value,total_size,size_t,ssize_t);
+
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_contig_writevv() */
diff --git a/src/H5Defl.c b/src/H5Defl.c
index 474ac2f..3a7b079 100644
--- a/src/H5Defl.c
+++ b/src/H5Defl.c
@@ -34,10 +34,6 @@ static herr_t H5D_efl_read (const H5O_efl_t *efl, haddr_t addr, size_t size,
static herr_t H5D_efl_write(const H5O_efl_t *efl, haddr_t addr, size_t size,
const uint8_t *buf);
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
-
/*-------------------------------------------------------------------------
* Function: H5D_efl_read
@@ -71,7 +67,7 @@ H5D_efl_read (const H5O_efl_t *efl, haddr_t addr, size_t size, uint8_t *buf)
size_t u; /* Local index variable */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5D_efl_read);
+ FUNC_ENTER_NOAPI_NOINIT(H5D_efl_read)
/* Check args */
assert (efl && efl->nused>0);
@@ -90,14 +86,15 @@ H5D_efl_read (const H5O_efl_t *efl, haddr_t addr, size_t size, uint8_t *buf)
/* Read the data */
while (size) {
+ assert(buf);
if (u>=efl->nused)
- HGOTO_ERROR (H5E_EFL, H5E_OVERFLOW, FAIL, "read past logical end of file");
+ HGOTO_ERROR (H5E_EFL, H5E_OVERFLOW, FAIL, "read past logical end of file")
if (H5F_OVERFLOW_HSIZET2OFFT (efl->slot[u].offset+skip))
- HGOTO_ERROR (H5E_EFL, H5E_OVERFLOW, FAIL, "external file address overflowed");
+ HGOTO_ERROR (H5E_EFL, H5E_OVERFLOW, FAIL, "external file address overflowed")
if ((fd=HDopen (efl->slot[u].name, O_RDONLY, 0))<0)
- HGOTO_ERROR (H5E_EFL, H5E_CANTOPENFILE, FAIL, "unable to open external raw data file");
+ HGOTO_ERROR (H5E_EFL, H5E_CANTOPENFILE, FAIL, "unable to open external raw data file")
if (HDlseek (fd, (off_t)(efl->slot[u].offset+skip), SEEK_SET)<0)
- HGOTO_ERROR (H5E_EFL, H5E_SEEKERROR, FAIL, "unable to seek in external raw data file");
+ HGOTO_ERROR (H5E_EFL, H5E_SEEKERROR, FAIL, "unable to seek in external raw data file")
#ifndef NDEBUG
tempto_read = MIN(efl->slot[u].size-skip,(hsize_t)size);
H5_CHECK_OVERFLOW(tempto_read,hsize_t,size_t);
@@ -106,7 +103,7 @@ H5D_efl_read (const H5O_efl_t *efl, haddr_t addr, size_t size, uint8_t *buf)
to_read = MIN((size_t)(efl->slot[u].size-skip), size);
#endif /* NDEBUG */
if ((n=HDread (fd, buf, to_read))<0) {
- HGOTO_ERROR (H5E_EFL, H5E_READERROR, FAIL, "read error in external raw data file");
+ HGOTO_ERROR (H5E_EFL, H5E_READERROR, FAIL, "read error in external raw data file")
} else if ((size_t)n<to_read) {
HDmemset (buf+n, 0, to_read-n);
}
@@ -122,7 +119,7 @@ done:
if (fd>=0)
HDclose (fd);
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -157,7 +154,7 @@ H5D_efl_write (const H5O_efl_t *efl, haddr_t addr, size_t size, const uint8_t *b
size_t u; /* Local index variable */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5D_efl_write);
+ FUNC_ENTER_NOAPI_NOINIT(H5D_efl_write)
/* Check args */
assert (efl && efl->nused>0);
@@ -176,19 +173,20 @@ H5D_efl_write (const H5O_efl_t *efl, haddr_t addr, size_t size, const uint8_t *b
/* Write the data */
while (size) {
+ assert(buf);
if (u>=efl->nused)
- HGOTO_ERROR (H5E_EFL, H5E_OVERFLOW, FAIL, "write past logical end of file");
+ HGOTO_ERROR (H5E_EFL, H5E_OVERFLOW, FAIL, "write past logical end of file")
if (H5F_OVERFLOW_HSIZET2OFFT (efl->slot[u].offset+skip))
- HGOTO_ERROR (H5E_EFL, H5E_OVERFLOW, FAIL, "external file address overflowed");
+ HGOTO_ERROR (H5E_EFL, H5E_OVERFLOW, FAIL, "external file address overflowed")
if ((fd=HDopen (efl->slot[u].name, O_CREAT|O_RDWR, 0666))<0) {
if (HDaccess (efl->slot[u].name, F_OK)<0) {
- HGOTO_ERROR (H5E_EFL, H5E_CANTOPENFILE, FAIL, "external raw data file does not exist");
+ HGOTO_ERROR (H5E_EFL, H5E_CANTOPENFILE, FAIL, "external raw data file does not exist")
} else {
- HGOTO_ERROR (H5E_EFL, H5E_CANTOPENFILE, FAIL, "unable to open external raw data file");
+ HGOTO_ERROR (H5E_EFL, H5E_CANTOPENFILE, FAIL, "unable to open external raw data file")
}
}
if (HDlseek (fd, (off_t)(efl->slot[u].offset+skip), SEEK_SET)<0)
- HGOTO_ERROR (H5E_EFL, H5E_SEEKERROR, FAIL, "unable to seek in external raw data file");
+ HGOTO_ERROR (H5E_EFL, H5E_SEEKERROR, FAIL, "unable to seek in external raw data file")
#ifndef NDEBUG
tempto_write = MIN(efl->slot[u].size-skip,(hsize_t)size);
H5_CHECK_OVERFLOW(tempto_write,hsize_t,size_t);
@@ -197,7 +195,7 @@ H5D_efl_write (const H5O_efl_t *efl, haddr_t addr, size_t size, const uint8_t *b
to_write = MIN((size_t)(efl->slot[u].size-skip), size);
#endif /* NDEBUG */
if ((size_t)HDwrite (fd, buf, to_write)!=to_write)
- HGOTO_ERROR (H5E_EFL, H5E_READERROR, FAIL, "write error in external raw data file");
+ HGOTO_ERROR (H5E_EFL, H5E_READERROR, FAIL, "write error in external raw data file")
HDclose (fd);
fd = -1;
size -= to_write;
@@ -210,7 +208,7 @@ done:
if (fd>=0)
HDclose (fd);
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -232,7 +230,7 @@ done:
*-------------------------------------------------------------------------
*/
ssize_t
-H5D_efl_readvv(H5D_io_info_t *io_info,
+H5D_efl_readvv(const H5D_io_info_t *io_info,
size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[],
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[],
void *_buf)
@@ -240,12 +238,13 @@ H5D_efl_readvv(H5D_io_info_t *io_info,
const H5O_efl_t *efl=&(io_info->store->efl); /* Pointer to efl info */
unsigned char *buf; /* Pointer to buffer to write */
haddr_t addr; /* Actual address to read */
+ size_t total_size=0; /* Total size of sequence in bytes */
size_t size; /* Size of sequence in bytes */
size_t u; /* Counting variable */
size_t v; /* Counting variable */
- ssize_t ret_value=0; /* Return value */
+ ssize_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5D_efl_readvv, FAIL);
+ FUNC_ENTER_NOAPI(H5D_efl_readvv, FAIL)
/* Check args */
assert (efl && efl->nused>0);
@@ -267,7 +266,7 @@ H5D_efl_readvv(H5D_io_info_t *io_info,
/* Read data */
if (H5D_efl_read(efl, addr, size, buf)<0)
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed");
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed")
/* Update memory information */
mem_len_arr[v]-=size;
@@ -282,15 +281,18 @@ H5D_efl_readvv(H5D_io_info_t *io_info,
u++;
/* Increment number of bytes copied */
- ret_value+=size;
+ total_size+=size;
} /* end for */
/* Update current sequence vectors */
*dset_curr_seq=u;
*mem_curr_seq=v;
+ /* Set return value */
+ H5_ASSIGN_OVERFLOW(ret_value,total_size,size_t,ssize_t);
+
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_efl_readvv() */
@@ -312,7 +314,7 @@ done:
*-------------------------------------------------------------------------
*/
ssize_t
-H5D_efl_writevv(H5D_io_info_t *io_info,
+H5D_efl_writevv(const H5D_io_info_t *io_info,
size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[],
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[],
const void *_buf)
@@ -320,12 +322,13 @@ H5D_efl_writevv(H5D_io_info_t *io_info,
const H5O_efl_t *efl=&(io_info->store->efl); /* Pointer to efl info */
const unsigned char *buf; /* Pointer to buffer to write */
haddr_t addr; /* Actual address to read */
+ size_t total_size=0; /* Total size of sequence in bytes */
size_t size; /* Size of sequence in bytes */
size_t u; /* Counting variable */
size_t v; /* Counting variable */
- ssize_t ret_value=0; /* Return value */
+ ssize_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5D_efl_writevv, FAIL);
+ FUNC_ENTER_NOAPI(H5D_efl_writevv, FAIL)
/* Check args */
assert (efl && efl->nused>0);
@@ -347,7 +350,7 @@ H5D_efl_writevv(H5D_io_info_t *io_info,
/* Write data */
if (H5D_efl_write(efl, addr, size, buf)<0)
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed");
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "block write failed")
/* Update memory information */
mem_len_arr[v]-=size;
@@ -362,14 +365,17 @@ H5D_efl_writevv(H5D_io_info_t *io_info,
u++;
/* Increment number of bytes copied */
- ret_value+=size;
+ total_size+=size;
} /* end for */
/* Update current sequence vectors */
*dset_curr_seq=u;
*mem_curr_seq=v;
+ /* Set return value */
+ H5_ASSIGN_OVERFLOW(ret_value,total_size,size_t,ssize_t);
+
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_efl_writevv() */
diff --git a/src/H5Dio.c b/src/H5Dio.c
index f96d26e..c00e1b7 100644
--- a/src/H5Dio.c
+++ b/src/H5Dio.c
@@ -44,7 +44,7 @@ typedef struct H5D_chunk_info_t {
hsize_t index; /* "Index" of chunk in dataset (must be first for TBBT routines) */
size_t chunk_points; /* Number of elements selected in chunk */
H5S_t *fspace; /* Dataspace describing chunk & selection in it */
- hssize_t coords[H5O_LAYOUT_NDIMS]; /* Coordinates of chunk in file dataset's dataspace */
+ hsize_t coords[H5O_LAYOUT_NDIMS]; /* Coordinates of chunk in file dataset's dataspace */
H5S_t *mspace; /* Dataspace describing selection in memory corresponding to this chunk */
unsigned mspace_shared; /* Indicate that the memory space for a chunk is shared and shouldn't be freed */
} H5D_chunk_info_t;
@@ -69,10 +69,6 @@ typedef struct fm_map {
H5S_sel_type msel_type; /* Selection type in memory */
} fm_map;
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
-
/* Local functions */
static herr_t H5D_fill(const void *fill, const H5T_t *fill_type, void *buf,
const H5T_t *buf_type, const H5S_t *space, hid_t dxpl_id);
@@ -121,16 +117,16 @@ H5D_ioinfo_init(H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id,
unsigned flags, hbool_t *use_par_opt_io, H5D_io_info_t *io_info);
/* Chunk operations */
-static herr_t H5D_create_chunk_map(H5D_t *dataset, const H5T_t *mem_type,
+static herr_t H5D_create_chunk_map(const H5D_t *dataset, const H5T_t *mem_type,
const H5S_t *file_space, const H5S_t *mem_space, fm_map *fm);
static herr_t H5D_destroy_chunk_map(const fm_map *fm);
static void H5D_free_chunk_info(void *chunk_info);
-static herr_t H5D_create_chunk_file_map_hyper(fm_map *fm);
+static herr_t H5D_create_chunk_file_map_hyper(const fm_map *fm);
static herr_t H5D_create_chunk_mem_map_hyper(const fm_map *fm);
-static herr_t H5D_chunk_file_cb(void *elem, hid_t type_id, hsize_t ndims,
- hssize_t *coords, void *fm);
-static herr_t H5D_chunk_mem_cb(void *elem, hid_t type_id, hsize_t ndims,
- hssize_t *coords, void *fm);
+static herr_t H5D_chunk_file_cb(void *elem, hid_t type_id, unsigned ndims,
+ const hsize_t *coords, void *fm);
+static herr_t H5D_chunk_mem_cb(void *elem, hid_t type_id, unsigned ndims,
+ const hsize_t *coords, void *fm);
/* Declare a free list to manage blocks of single datatype element data */
H5FL_BLK_DEFINE(type_elem);
@@ -341,11 +337,7 @@ H5D_get_dxpl_cache_real(hid_t dxpl_id, H5D_dxpl_cache_t *cache)
/* Get B-tree split ratios */
if(H5P_get(dx_plist, H5D_XFER_BTREE_SPLIT_RATIO_NAME, &cache->btree_split_ratio)<0)
- HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve background buffer type")
-
- /* Get B-tree split ratios */
- if(H5P_get(dx_plist, H5D_XFER_BTREE_SPLIT_RATIO_NAME, &cache->btree_split_ratio)<0)
- HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve background buffer type")
+ HGOTO_ERROR (H5E_PLIST, H5E_CANTGET, FAIL, "Can't retrieve B-tree split ratios")
/* Get I/O vector size */
if(H5P_get(dx_plist, H5D_XFER_HYPER_VECTOR_SIZE_NAME, &cache->vec_size)<0)
@@ -2328,7 +2320,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_create_chunk_map(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *file_space,
+H5D_create_chunk_map(const H5D_t *dataset, const H5T_t *mem_type, const H5S_t *file_space,
const H5S_t *mem_space, fm_map *fm)
{
H5S_t *tmp_mspace=NULL; /* Temporary memory dataspace */
@@ -2407,9 +2399,9 @@ H5D_create_chunk_map(H5D_t *dataset, const H5T_t *mem_type, const H5S_t *file_sp
fm->mem_space_copy=equiv_mspace_init; /* Make certain to copy memory dataspace if necessary */
/* Get type of selection on disk & in memory */
- if((fsel_type=H5S_GET_SELECT_TYPE(file_space))<0)
+ if((fsel_type=H5S_GET_SELECT_TYPE(file_space))<H5S_SEL_NONE)
HGOTO_ERROR (H5E_DATASET, H5E_BADSELECT, FAIL, "unable to convert from file to memory data space")
- if((fm->msel_type=H5S_GET_SELECT_TYPE(equiv_mspace))<0)
+ if((fm->msel_type=H5S_GET_SELECT_TYPE(equiv_mspace))<H5S_SEL_NONE)
HGOTO_ERROR (H5E_DATASET, H5E_BADSELECT, FAIL, "unable to convert from file to memory data space")
/* Check if file selection is a point selection */
@@ -2636,14 +2628,15 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_create_chunk_file_map_hyper(fm_map *fm)
+H5D_create_chunk_file_map_hyper(const fm_map *fm)
{
- hssize_t sel_points; /* Number of elements in file selection */
- hssize_t sel_start[H5O_LAYOUT_NDIMS]; /* Offset of low bound of file selection */
- hssize_t sel_end[H5O_LAYOUT_NDIMS]; /* Offset of high bound of file selection */
- hssize_t start_coords[H5O_LAYOUT_NDIMS]; /* Starting coordinates of selection */
- hssize_t coords[H5O_LAYOUT_NDIMS]; /* Current coordinates of chunk */
- hssize_t end[H5O_LAYOUT_NDIMS]; /* Current coordinates of chunk */
+ hssize_t ssel_points; /* Number of elements in file selection */
+ hsize_t sel_points; /* Number of elements in file selection */
+ hsize_t sel_start[H5O_LAYOUT_NDIMS]; /* Offset of low bound of file selection */
+ hsize_t sel_end[H5O_LAYOUT_NDIMS]; /* Offset of high bound of file selection */
+ hsize_t start_coords[H5O_LAYOUT_NDIMS]; /* Starting coordinates of selection */
+ hsize_t coords[H5O_LAYOUT_NDIMS]; /* Current coordinates of chunk */
+ hsize_t end[H5O_LAYOUT_NDIMS]; /* Current coordinates of chunk */
hsize_t chunk_index; /* Index of chunk */
int curr_dim; /* Current dimension to increment */
unsigned u; /* Local index variable */
@@ -2655,8 +2648,9 @@ H5D_create_chunk_file_map_hyper(fm_map *fm)
assert(fm->f_ndims>0);
/* Get number of elements selected in file */
- if((sel_points=H5S_GET_SELECT_NPOINTS(fm->file_space))<0)
+ if((ssel_points=H5S_GET_SELECT_NPOINTS(fm->file_space))<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTGET, FAIL, "can't get file selection # of elements")
+ H5_ASSIGN_OVERFLOW(sel_points,ssel_points,hssize_t,hsize_t);
/* Get bounding box for selection (to reduce the number of chunks to iterate over) */
if(H5S_SELECT_BOUNDS(fm->file_space, sel_start, sel_end)<0)
@@ -2664,8 +2658,7 @@ H5D_create_chunk_file_map_hyper(fm_map *fm)
/* Set initial chunk location & hyperslab size */
for(u=0; u<fm->f_ndims; u++) {
- H5_CHECK_OVERFLOW(fm->layout->u.chunk.dim[u],hsize_t,hssize_t);
- start_coords[u]=(sel_start[u]/(hssize_t)fm->layout->u.chunk.dim[u])*(hssize_t)fm->layout->u.chunk.dim[u];
+ start_coords[u]=(sel_start[u]/fm->layout->u.chunk.dim[u])*fm->layout->u.chunk.dim[u];
coords[u]=start_coords[u];
end[u]=(coords[u]+fm->chunk_dim[u])-1;
} /* end for */
@@ -2688,12 +2681,16 @@ H5D_create_chunk_file_map_hyper(fm_map *fm)
HGOTO_ERROR (H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy memory space")
/* Make certain selections are stored in span tree form (not "optimized hyperslab" or "all") */
- if(H5S_hyper_convert(tmp_fchunk)<0)
+ if(H5S_hyper_convert(tmp_fchunk)<0) {
+ (void)H5S_close(tmp_fchunk);
HGOTO_ERROR (H5E_DATASPACE, H5E_CANTINIT, FAIL, "unable to convert selection to span trees")
+ } /* end if */
/* Normalize hyperslab selections by adjusting them by the offset */
- if(H5S_hyper_normalize_offset(tmp_fchunk)<0)
+ if(H5S_hyper_normalize_offset(tmp_fchunk)<0) {
+ (void)H5S_close(tmp_fchunk);
HGOTO_ERROR (H5E_DATASET, H5E_BADSELECT, FAIL, "unable to normalize dataspace by offset")
+ } /* end if */
/* "AND" temporary chunk and current chunk */
if(H5S_select_hyperslab(tmp_fchunk,H5S_SELECT_AND,coords,NULL,fm->chunk_dim,NULL)<0) {
@@ -2708,7 +2705,7 @@ H5D_create_chunk_file_map_hyper(fm_map *fm)
} /* end if */
/* Move selection back to have correct offset in chunk */
- if(H5S_hyper_adjust(tmp_fchunk,coords)<0) {
+ if(H5S_hyper_adjust_u(tmp_fchunk,coords)<0) {
(void)H5S_close(tmp_fchunk);
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSELECT, FAIL, "can't adjust chunk selection")
} /* end if */
@@ -2750,7 +2747,7 @@ H5D_create_chunk_file_map_hyper(fm_map *fm)
H5_ASSIGN_OVERFLOW(new_chunk_info->chunk_points,schunk_points,hssize_t,size_t);
/* Decrement # of points left in file selection */
- sel_points-=schunk_points;
+ sel_points-=(hsize_t)schunk_points;
/* Leave if we are done */
if(sel_points==0)
@@ -2766,8 +2763,8 @@ H5D_create_chunk_file_map_hyper(fm_map *fm)
/* Increment chunk location in fastest changing dimension */
H5_CHECK_OVERFLOW(fm->chunk_dim[curr_dim],hsize_t,hssize_t);
- coords[curr_dim]+=(hssize_t)fm->chunk_dim[curr_dim];
- end[curr_dim]+=(hssize_t)fm->chunk_dim[curr_dim];
+ coords[curr_dim]+=fm->chunk_dim[curr_dim];
+ end[curr_dim]+=fm->chunk_dim[curr_dim];
/* Bring chunk location back into bounds, if necessary */
if(coords[curr_dim]>sel_end[curr_dim]) {
@@ -2780,8 +2777,8 @@ H5D_create_chunk_file_map_hyper(fm_map *fm)
curr_dim--;
/* Increment chunk location in current dimension */
- coords[curr_dim]+=(hssize_t)fm->chunk_dim[curr_dim];
- end[curr_dim]=(coords[curr_dim]+(hssize_t)fm->chunk_dim[curr_dim])-1;
+ coords[curr_dim]+=fm->chunk_dim[curr_dim];
+ end[curr_dim]=(coords[curr_dim]+fm->chunk_dim[curr_dim])-1;
} while(coords[curr_dim]>sel_end[curr_dim]);
/* Re-Calculate the index of this chunk */
@@ -2817,10 +2814,10 @@ static herr_t
H5D_create_chunk_mem_map_hyper(const fm_map *fm)
{
H5TB_NODE *curr_node; /* Current node in TBBT */
- hssize_t file_sel_start[H5O_LAYOUT_NDIMS]; /* Offset of low bound of file selection */
- hssize_t file_sel_end[H5O_LAYOUT_NDIMS]; /* Offset of high bound of file selection */
- hssize_t mem_sel_start[H5O_LAYOUT_NDIMS]; /* Offset of low bound of file selection */
- hssize_t mem_sel_end[H5O_LAYOUT_NDIMS]; /* Offset of high bound of file selection */
+ hsize_t file_sel_start[H5O_LAYOUT_NDIMS]; /* Offset of low bound of file selection */
+ hsize_t file_sel_end[H5O_LAYOUT_NDIMS]; /* Offset of high bound of file selection */
+ hsize_t mem_sel_start[H5O_LAYOUT_NDIMS]; /* Offset of low bound of file selection */
+ hsize_t mem_sel_end[H5O_LAYOUT_NDIMS]; /* Offset of high bound of file selection */
hssize_t adjust[H5O_LAYOUT_NDIMS]; /* Adjustment to make to all file chunks */
hssize_t chunk_adjust[H5O_LAYOUT_NDIMS]; /* Adjustment to make to a particular chunk */
unsigned u; /* Local index variable */
@@ -2868,8 +2865,11 @@ H5D_create_chunk_mem_map_hyper(const fm_map *fm)
/* Calculate the adjustment for memory selection from file selection */
assert(fm->m_ndims==fm->f_ndims);
- for(u=0; u<fm->f_ndims; u++)
- adjust[u]=file_sel_start[u]-mem_sel_start[u];
+ for(u=0; u<fm->f_ndims; u++) {
+ H5_CHECK_OVERFLOW(file_sel_start[u],hsize_t,hssize_t);
+ H5_CHECK_OVERFLOW(mem_sel_start[u],hsize_t,hssize_t);
+ adjust[u]=(hssize_t)file_sel_start[u]-(hssize_t)mem_sel_start[u];
+ } /* end for */
/* Iterate over each chunk in the chunk list */
curr_node=H5TB_first(fm->fsel->root);
@@ -2895,11 +2895,13 @@ H5D_create_chunk_mem_map_hyper(const fm_map *fm)
HGOTO_ERROR (H5E_DATASPACE, H5E_CANTCOPY, FAIL, "unable to copy selection")
/* Compensate for the chunk offset */
- for(u=0; u<fm->f_ndims; u++)
- chunk_adjust[u]=adjust[u]-chunk_info->coords[u]; /*lint !e771 The adjust array will always be initialized */
+ for(u=0; u<fm->f_ndims; u++) {
+ H5_CHECK_OVERFLOW(chunk_info->coords[u],hsize_t,hssize_t);
+ chunk_adjust[u]=adjust[u]-(hssize_t)chunk_info->coords[u]; /*lint !e771 The adjust array will always be initialized */
+ } /* end for */
/* Adjust the selection */
- if(H5S_hyper_adjust(chunk_info->mspace,chunk_adjust)<0) /*lint !e772 The chunk_adjust array will always be initialized */
+ if(H5S_hyper_adjust_s(chunk_info->mspace,chunk_adjust)<0) /*lint !e772 The chunk_adjust array will always be initialized */
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTSELECT, FAIL, "can't adjust chunk selection")
/* Get the next chunk node in the TBBT */
@@ -2928,11 +2930,11 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, hsize_t ndims, hssize_t *coords, void *_fm)
+H5D_chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const hsize_t *coords, void *_fm)
{
fm_map *fm = (fm_map*)_fm; /* File<->memory chunk mapping info */
H5D_chunk_info_t *chunk_info; /* Chunk information for current chunk */
- hssize_t coords_in_chunk[H5O_LAYOUT_NDIMS]; /* Coordinates of element in chunk */
+ hsize_t coords_in_chunk[H5O_LAYOUT_NDIMS]; /* Coordinates of element in chunk */
hsize_t chunk_index; /* Chunk index */
unsigned u; /* Local index variable */
herr_t ret_value = SUCCEED; /* Return value */
@@ -2940,7 +2942,7 @@ H5D_chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, hsize_t ndims, hssize
FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_file_cb)
/* Calculate the index of this chunk */
- if(H5V_chunk_index((unsigned)ndims,coords,fm->layout->u.chunk.dim,fm->down_chunks,&chunk_index)<0)
+ if(H5V_chunk_index(ndims,coords,fm->layout->u.chunk.dim,fm->down_chunks,&chunk_index)<0)
HGOTO_ERROR (H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
/* Find correct chunk in file & memory TBBTs */
@@ -3023,7 +3025,7 @@ H5D_chunk_file_cb(void UNUSED *elem, hid_t UNUSED type_id, hsize_t ndims, hssize
coords_in_chunk[u]=coords[u]%fm->layout->u.chunk.dim[u];
/* Add point to file selection for chunk */
- if(H5S_select_elements(chunk_info->fspace,H5S_SELECT_APPEND,1,(const hssize_t **)coords_in_chunk)<0)
+ if(H5S_select_elements(chunk_info->fspace,H5S_SELECT_APPEND,1,(const hsize_t **)coords_in_chunk)<0)
HGOTO_ERROR (H5E_DATASPACE, H5E_CANTSELECT, FAIL, "unable to select element")
/* Increment the number of elemented selected in chunk */
@@ -3053,18 +3055,18 @@ done:
*/
/* ARGSUSED */
static herr_t
-H5D_chunk_mem_cb(void UNUSED *elem, hid_t UNUSED type_id, hsize_t ndims, hssize_t *coords, void *_fm)
+H5D_chunk_mem_cb(void UNUSED *elem, hid_t UNUSED type_id, unsigned ndims, const hsize_t *coords, void *_fm)
{
fm_map *fm = (fm_map*)_fm; /* File<->memory chunk mapping info */
H5D_chunk_info_t *chunk_info; /* Chunk information for current chunk */
- hssize_t coords_in_mem[H5O_LAYOUT_NDIMS]; /* Coordinates of element in memory */
+ hsize_t coords_in_mem[H5O_LAYOUT_NDIMS]; /* Coordinates of element in memory */
hsize_t chunk_index; /* Chunk index */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5D_chunk_mem_cb)
/* Calculate the index of this chunk */
- if(H5V_chunk_index((unsigned)ndims,coords,fm->layout->u.chunk.dim,fm->down_chunks,&chunk_index)<0)
+ if(H5V_chunk_index(ndims,coords,fm->layout->u.chunk.dim,fm->down_chunks,&chunk_index)<0)
HGOTO_ERROR (H5E_DATASPACE, H5E_BADRANGE, FAIL, "can't get chunk index")
/* Find correct chunk in file & memory TBBTs */
@@ -3105,7 +3107,7 @@ H5D_chunk_mem_cb(void UNUSED *elem, hid_t UNUSED type_id, hsize_t ndims, hssize_
/* Add point to memory selection for chunk */
if(fm->msel_type==H5S_SEL_POINTS) {
- if(H5S_select_elements(chunk_info->mspace,H5S_SELECT_APPEND,1,(const hssize_t **)coords_in_mem)<0)
+ if(H5S_select_elements(chunk_info->mspace,H5S_SELECT_APPEND,1,(const hsize_t **)coords_in_mem)<0)
HGOTO_ERROR (H5E_DATASPACE, H5E_CANTSELECT, FAIL, "unable to select element")
} /* end if */
else {
@@ -3123,7 +3125,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5S_get_collective_io_consensus
+ * Function: H5D_get_collective_io_consensus
*
* Purpose: Compare notes with all other processes involved in this I/O
* and see if all are go for collective I/O.
@@ -3220,7 +3222,7 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5D_chunk_mem_cb
+ * Function: H5D_ioinfo_init
*
* Purpose: Routine for determining correct I/O operations for
* each I/O action.
@@ -3236,15 +3238,34 @@ done:
*/
static herr_t
H5D_ioinfo_init(H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id,
- const H5S_t *mem_space, const H5S_t *file_space,
- unsigned flags, hbool_t *use_par_opt_io, H5D_io_info_t *io_info)
+ const H5S_t
+#if !(defined H5_HAVE_PARALLEL || defined H5S_DEBUG)
+ UNUSED
+#endif /* H5_HAVE_PARALLEL */
+ *mem_space, const H5S_t
+#if !(defined H5_HAVE_PARALLEL || defined H5S_DEBUG)
+ UNUSED
+#endif /* H5_HAVE_PARALLEL */
+ *file_space, unsigned
+#ifndef H5_HAVE_PARALLEL
+ UNUSED
+#endif /* H5_HAVE_PARALLEL */
+ flags, hbool_t
+#ifndef H5_HAVE_PARALLEL
+ UNUSED
+#endif /* H5_HAVE_PARALLEL */
+ *use_par_opt_io, H5D_io_info_t *io_info)
{
#ifdef H5_HAVE_PARALLEL
htri_t opt; /* Flag whether a selection is optimizable */
#endif /* H5_HAVE_PARALLEL */
herr_t ret_value = SUCCEED; /* Return value */
+#if defined H5_HAVE_PARALLEL || defined H5S_DEBUG
FUNC_ENTER_NOAPI_NOINIT(H5D_ioinfo_init)
+#else /* defined H5_HAVE_PARALLEL || defined H5S_DEBUG */
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_ioinfo_init)
+#endif /* defined H5_HAVE_PARALLEL || defined H5S_DEBUG */
/* check args */
HDassert(dset);
@@ -3280,21 +3301,32 @@ H5D_ioinfo_init(H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id,
/* Check if we can use the optimized parallel I/O routines */
if(opt==TRUE) {
/* Set the pointers to the MPI-specific routines */
+ if((H5S_SELECT_IS_REGULAR(file_space) == TRUE) &&
+ (H5S_SELECT_IS_REGULAR(mem_space) == TRUE)){
io_info->ops.read = H5D_mpio_spaces_read;
io_info->ops.write = H5D_mpio_spaces_write;
-
+ }
+
+ #ifdef KYANG
+ else {
+ io_info->ops.read = H5D_mpio_spaces_span_read;
+ io_info->ops.write = H5D_mpio_spaces_span_write;
+ }
+ #endif
/* Indicate that the I/O will be parallel */
*use_par_opt_io=TRUE;
} /* end if */
else {
/* Indicate that the I/O will _NOT_ be parallel */
*use_par_opt_io=FALSE;
-
-#endif /* H5_HAVE_PARALLEL */
io_info->ops.read = H5D_select_read;
io_info->ops.write = H5D_select_write;
-#ifdef H5_HAVE_PARALLEL
+
+
} /* end else */
+#else
+ io_info->ops.read = H5D_select_read;
+ io_info->ops.write = H5D_select_write;
#endif /* H5_HAVE_PARALLEL */
#ifdef H5S_DEBUG
@@ -3303,6 +3335,8 @@ H5D_ioinfo_init(H5D_t *dset, const H5D_dxpl_cache_t *dxpl_cache, hid_t dxpl_id,
HGOTO_ERROR(H5E_DATASET, H5E_BADSELECT, FAIL, "can't set up selection statistics");
#endif /* H5S_DEBUG */
+#if defined H5_HAVE_PARALLEL || defined H5S_DEBUG
done:
+#endif /* H5_HAVE_PARALLEL || H5S_DEBUG */
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_ioinfo_init() */
diff --git a/src/H5Distore.c b/src/H5Distore.c
index 22bba76..96d5a46 100644
--- a/src/H5Distore.c
+++ b/src/H5Distore.c
@@ -88,21 +88,17 @@
/*#define H5D_ISTORE_DEBUG */
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
-
/*
* Given a B-tree node return the dimensionality of the chunks pointed to by
* that node.
*/
-#define H5D_ISTORE_NDIMS(X) ((int)(((X)->sizeof_rkey-8)/8))
+#define H5D_ISTORE_NDIMS(X) (((X)->sizeof_rkey-8)/8)
/* Raw data chunks are cached. Each entry in the cache is: */
typedef struct H5D_rdcc_ent_t {
hbool_t locked; /*entry is locked in cache */
hbool_t dirty; /*needs to be written to disk? */
- hssize_t offset[H5O_LAYOUT_NDIMS]; /*chunk name */
+ hsize_t offset[H5O_LAYOUT_NDIMS]; /*chunk name */
size_t rd_count; /*bytes remaining to be read */
size_t wr_count; /*bytes remaining to be written */
size_t chunk_size; /*size of a chunk */
@@ -130,7 +126,7 @@ typedef H5D_rdcc_ent_t *H5D_rdcc_ent_ptr_t; /* For free lists */
*/
typedef struct H5D_istore_key_t {
size_t nbytes; /*size of stored data */
- hssize_t offset[H5O_LAYOUT_NDIMS]; /*logical offset to start*/
+ hsize_t offset[H5O_LAYOUT_NDIMS]; /*logical offset to start*/
unsigned filter_mask; /*excluded filters */
} H5D_istore_key_t;
@@ -152,16 +148,16 @@ static herr_t H5D_istore_shared_create (const H5F_t *f, H5O_layout_t *layout);
static herr_t H5D_istore_shared_free (void *page);
/* B-tree iterator callbacks */
-static int H5D_istore_iter_allocated(H5F_t *f, hid_t dxpl_id, void *left_key, haddr_t addr,
- void *right_key, void *_udata);
-static int H5D_istore_iter_dump(H5F_t *f, hid_t dxpl_id, void *left_key, haddr_t addr,
- void *right_key, void *_udata);
-static int H5D_istore_prune_extent(H5F_t *f, hid_t dxpl_id, void *_lt_key, haddr_t addr,
- void *_rt_key, void *_udata);
+static int H5D_istore_iter_allocated(H5F_t *f, hid_t dxpl_id, const void *left_key, haddr_t addr,
+ const void *right_key, void *_udata);
+static int H5D_istore_iter_dump(H5F_t *f, hid_t dxpl_id, const void *left_key, haddr_t addr,
+ const void *right_key, void *_udata);
+static int H5D_istore_prune_extent(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr,
+ const void *_rt_key, void *_udata);
/* B-tree callbacks */
static size_t H5D_istore_sizeof_rkey(const H5F_t *f, const void *_udata);
-static H5RC_t *H5D_istore_get_shared(H5F_t *f, const void *_udata);
+static H5RC_t *H5D_istore_get_shared(const H5F_t *f, const void *_udata);
static herr_t H5D_istore_new_node(H5F_t *f, hid_t dxpl_id, H5B_ins_t, void *_lt_key,
void *_udata, void *_rt_key,
haddr_t *addr_p /*out*/);
@@ -170,7 +166,7 @@ static int H5D_istore_cmp2(H5F_t *f, hid_t dxpl_id, void *_lt_key, void *_udata,
static int H5D_istore_cmp3(H5F_t *f, hid_t dxpl_id, void *_lt_key, void *_udata,
void *_rt_key);
static herr_t H5D_istore_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_lt_key,
- void *_udata, const void *_rt_key);
+ void *_udata);
static H5B_ins_t H5D_istore_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key,
hbool_t *lt_key_changed, void *_md_key,
void *_udata, void *_rt_key,
@@ -179,9 +175,9 @@ static H5B_ins_t H5D_istore_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *
static H5B_ins_t H5D_istore_remove( H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key,
hbool_t *lt_key_changed, void *_udata, void *_rt_key,
hbool_t *rt_key_changed);
-static herr_t H5D_istore_decode_key(H5F_t *f, H5B_t *bt, uint8_t *raw,
+static herr_t H5D_istore_decode_key(const H5F_t *f, const H5B_t *bt, const uint8_t *raw,
void *_key);
-static herr_t H5D_istore_encode_key(H5F_t *f, H5B_t *bt, uint8_t *raw,
+static herr_t H5D_istore_encode_key(const H5F_t *f, const H5B_t *bt, uint8_t *raw,
void *_key);
static herr_t H5D_istore_debug_key(FILE *stream, H5F_t *f, hid_t dxpl_id,
int indent, int fwidth, const void *key,
@@ -244,13 +240,14 @@ H5FL_BLK_DEFINE_STATIC(chunk_page);
*
*-------------------------------------------------------------------------
*/
+/* ARGSUSED */
static size_t
H5D_istore_sizeof_rkey(const H5F_t UNUSED *f, const void *_udata)
{
const H5D_istore_ud1_t *udata = (const H5D_istore_ud1_t *) _udata;
size_t nbytes;
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_sizeof_rkey);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_sizeof_rkey)
assert(udata);
assert(udata->mesg->u.chunk.ndims > 0 && udata->mesg->u.chunk.ndims <= H5O_LAYOUT_NDIMS);
@@ -259,7 +256,7 @@ H5D_istore_sizeof_rkey(const H5F_t UNUSED *f, const void *_udata)
4 + /*filter mask */
udata->mesg->u.chunk.ndims*8; /*dimension indices */
- FUNC_LEAVE_NOAPI(nbytes);
+ FUNC_LEAVE_NOAPI(nbytes)
} /* end H5D_istore_sizeof_rkey() */
@@ -279,12 +276,13 @@ H5D_istore_sizeof_rkey(const H5F_t UNUSED *f, const void *_udata)
*
*-------------------------------------------------------------------------
*/
+/* ARGSUSED */
static H5RC_t *
-H5D_istore_get_shared(H5F_t UNUSED *f, const void *_udata)
+H5D_istore_get_shared(const H5F_t UNUSED *f, const void *_udata)
{
const H5D_istore_ud1_t *udata = (const H5D_istore_ud1_t *) _udata;
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_get_shared);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_get_shared)
assert(udata);
assert(udata->mesg);
@@ -294,7 +292,7 @@ H5D_istore_get_shared(H5F_t UNUSED *f, const void *_udata)
H5RC_INC(udata->mesg->u.chunk.btree_shared);
/* Return the pointer to the ref-count object */
- FUNC_LEAVE_NOAPI(udata->mesg->u.chunk.btree_shared);
+ FUNC_LEAVE_NOAPI(udata->mesg->u.chunk.btree_shared)
} /* end H5D_istore_get_shared() */
@@ -313,14 +311,14 @@ H5D_istore_get_shared(H5F_t UNUSED *f, const void *_udata)
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_istore_decode_key(H5F_t UNUSED *f, H5B_t *bt, uint8_t *raw, void *_key)
+H5D_istore_decode_key(const H5F_t UNUSED *f, const H5B_t *bt, const uint8_t *raw, void *_key)
{
H5D_istore_key_t *key = (H5D_istore_key_t *) _key;
H5B_shared_t *shared; /* Pointer to shared B-tree info */
+ size_t ndims;
unsigned u;
- unsigned ndims;
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_decode_key);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_decode_key)
/* check args */
assert(f);
@@ -338,7 +336,7 @@ H5D_istore_decode_key(H5F_t UNUSED *f, H5B_t *bt, uint8_t *raw, void *_key)
for (u=0; u<ndims; u++)
UINT64DECODE(raw, key->offset[u]);
- FUNC_LEAVE_NOAPI(SUCCEED);
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D_istore_decode_key() */
@@ -357,14 +355,14 @@ H5D_istore_decode_key(H5F_t UNUSED *f, H5B_t *bt, uint8_t *raw, void *_key)
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_istore_encode_key(H5F_t UNUSED *f, H5B_t *bt, uint8_t *raw, void *_key)
+H5D_istore_encode_key(const H5F_t UNUSED *f, const H5B_t *bt, uint8_t *raw, void *_key)
{
H5D_istore_key_t *key = (H5D_istore_key_t *) _key;
H5B_shared_t *shared; /* Pointer to shared B-tree info */
- unsigned ndims;
+ size_t ndims;
unsigned u;
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_encode_key);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_encode_key)
/* check args */
assert(f);
@@ -382,7 +380,7 @@ H5D_istore_encode_key(H5F_t UNUSED *f, H5B_t *bt, uint8_t *raw, void *_key)
for (u=0; u<ndims; u++)
UINT64ENCODE(raw, key->offset[u]);
- FUNC_LEAVE_NOAPI(SUCCEED);
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D_istore_encode_key() */
@@ -400,6 +398,7 @@ H5D_istore_encode_key(H5F_t UNUSED *f, H5B_t *bt, uint8_t *raw, void *_key)
*
*-------------------------------------------------------------------------
*/
+/* ARGSUSED */
static herr_t
H5D_istore_debug_key (FILE *stream, H5F_t UNUSED *f, hid_t UNUSED dxpl_id, int indent, int fwidth,
const void *_key, const void *_udata)
@@ -408,7 +407,7 @@ H5D_istore_debug_key (FILE *stream, H5F_t UNUSED *f, hid_t UNUSED dxpl_id, int i
const H5D_istore_ud1_t *udata = (const H5D_istore_ud1_t *)_udata;
unsigned u;
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_debug_key);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_debug_key)
assert (key);
@@ -422,7 +421,7 @@ H5D_istore_debug_key (FILE *stream, H5F_t UNUSED *f, hid_t UNUSED dxpl_id, int i
HDfprintf (stream, "%s%Hd", u?", ":"", key->offset[u]);
HDfputs ("}\n", stream);
- FUNC_LEAVE_NOAPI(SUCCEED);
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5D_istore_debug_key() */
@@ -447,6 +446,7 @@ H5D_istore_debug_key (FILE *stream, H5F_t UNUSED *f, hid_t UNUSED dxpl_id, int i
*
*-------------------------------------------------------------------------
*/
+/* ARGSUSED */
static int
H5D_istore_cmp2(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_lt_key, void *_udata,
void *_rt_key)
@@ -456,7 +456,7 @@ H5D_istore_cmp2(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_lt_key, void *_uda
H5D_istore_ud1_t *udata = (H5D_istore_ud1_t *) _udata;
int ret_value;
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_cmp2);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_cmp2)
assert(lt_key);
assert(rt_key);
@@ -464,9 +464,9 @@ H5D_istore_cmp2(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_lt_key, void *_uda
assert(udata->mesg->u.chunk.ndims > 0 && udata->mesg->u.chunk.ndims <= H5O_LAYOUT_NDIMS);
/* Compare the offsets but ignore the other fields */
- ret_value = H5V_vector_cmp_s(udata->mesg->u.chunk.ndims, lt_key->offset, rt_key->offset);
+ ret_value = H5V_vector_cmp_u(udata->mesg->u.chunk.ndims, lt_key->offset, rt_key->offset);
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_istore_cmp2() */
@@ -499,6 +499,7 @@ H5D_istore_cmp2(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_lt_key, void *_uda
*
*-------------------------------------------------------------------------
*/
+/* ARGSUSED */
static int
H5D_istore_cmp3(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_lt_key, void *_udata,
void *_rt_key)
@@ -508,7 +509,7 @@ H5D_istore_cmp3(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_lt_key, void *_uda
H5D_istore_ud1_t *udata = (H5D_istore_ud1_t *) _udata;
int ret_value = 0;
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_cmp3);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_cmp3)
assert(lt_key);
assert(rt_key);
@@ -531,15 +532,15 @@ H5D_istore_cmp3(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_lt_key, void *_uda
ret_value=(-1);
} /* end if */
else {
- if (H5V_vector_ge_s(udata->mesg->u.chunk.ndims, udata->key.offset,
+ if (H5V_vector_ge_u(udata->mesg->u.chunk.ndims, udata->key.offset,
rt_key->offset))
ret_value = 1;
- else if (H5V_vector_lt_s(udata->mesg->u.chunk.ndims, udata->key.offset,
+ else if (H5V_vector_lt_u(udata->mesg->u.chunk.ndims, udata->key.offset,
lt_key->offset))
ret_value = -1;
} /* end else */
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_istore_cmp3() */
@@ -574,7 +575,7 @@ H5D_istore_new_node(H5F_t *f, hid_t dxpl_id, H5B_ins_t op,
unsigned u;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5D_istore_new_node);
+ FUNC_ENTER_NOAPI_NOINIT(H5D_istore_new_node)
/* check args */
assert(f);
@@ -588,7 +589,7 @@ H5D_istore_new_node(H5F_t *f, hid_t dxpl_id, H5B_ins_t op,
assert (udata->key.nbytes > 0);
H5_CHECK_OVERFLOW( udata->key.nbytes ,size_t, hsize_t);
if (HADDR_UNDEF==(*addr_p=H5MF_alloc(f, H5FD_MEM_DRAW, dxpl_id, (hsize_t)udata->key.nbytes)))
- HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "couldn't allocate new file storage");
+ HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "couldn't allocate new file storage")
udata->addr = *addr_p;
/*
@@ -608,15 +609,14 @@ H5D_istore_new_node(H5F_t *f, hid_t dxpl_id, H5B_ins_t op,
rt_key->nbytes = 0;
rt_key->filter_mask = 0;
for (u=0; u<udata->mesg->u.chunk.ndims; u++) {
- assert (udata->key.offset[u]+(hssize_t)(udata->mesg->u.chunk.dim[u]) >
+ assert (udata->key.offset[u]+udata->mesg->u.chunk.dim[u] >
udata->key.offset[u]);
- rt_key->offset[u] = udata->key.offset[u] +
- (hssize_t)(udata->mesg->u.chunk.dim[u]);
+ rt_key->offset[u] = udata->key.offset[u] + udata->mesg->u.chunk.dim[u];
}
}
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_istore_new_node() */
@@ -647,16 +647,17 @@ done:
* The ADDR argument is passed by value.
*-------------------------------------------------------------------------
*/
+/* ARGSUSED */
static herr_t
H5D_istore_found(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr, const void *_lt_key,
- void *_udata, const void UNUSED *_rt_key)
+ void *_udata)
{
H5D_istore_ud1_t *udata = (H5D_istore_ud1_t *) _udata;
const H5D_istore_key_t *lt_key = (const H5D_istore_key_t *) _lt_key;
unsigned u;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_found);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_found)
/* Check arguments */
assert(f);
@@ -665,10 +666,9 @@ H5D_istore_found(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr, const void
assert(lt_key);
/* Is this *really* the requested chunk? */
- for (u=0; u<udata->mesg->u.chunk.ndims; u++) {
- if (udata->key.offset[u] >= lt_key->offset[u]+(hssize_t)(udata->mesg->u.chunk.dim[u]))
- HGOTO_DONE(FAIL);
- }
+ for (u=0; u<udata->mesg->u.chunk.ndims; u++)
+ if (udata->key.offset[u] >= lt_key->offset[u]+udata->mesg->u.chunk.dim[u])
+ HGOTO_DONE(FAIL)
/* Initialize return values */
udata->addr = addr;
@@ -679,7 +679,7 @@ H5D_istore_found(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, haddr_t addr, const void
udata->key.offset[u] = lt_key->offset[u];
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_istore_found() */
@@ -715,6 +715,7 @@ done:
* is renamed NEW_NODE_P.
*-------------------------------------------------------------------------
*/
+/* ARGSUSED */
static H5B_ins_t
H5D_istore_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key,
hbool_t *lt_key_changed,
@@ -730,7 +731,7 @@ H5D_istore_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key,
unsigned u;
H5B_ins_t ret_value;
- FUNC_ENTER_NOAPI_NOINIT(H5D_istore_insert);
+ FUNC_ENTER_NOAPI_NOINIT(H5D_istore_insert)
/* check args */
assert(f);
@@ -740,7 +741,6 @@ H5D_istore_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key,
assert(md_key);
assert(udata);
assert(rt_key);
- assert(rt_key_changed);
assert(new_node_p);
cmp = H5D_istore_cmp3(f, dxpl_id, lt_key, udata, rt_key);
@@ -748,10 +748,9 @@ H5D_istore_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key,
if (cmp < 0) {
/* Negative indices not supported yet */
- assert("HDF5 INTERNAL ERROR -- see rpm" && 0);
- HGOTO_ERROR(H5E_STORAGE, H5E_UNSUPPORTED, H5B_INS_ERROR, "internal error");
+ HGOTO_ERROR(H5E_STORAGE, H5E_UNSUPPORTED, H5B_INS_ERROR, "internal error")
- } else if (H5V_vector_eq_s (udata->mesg->u.chunk.ndims,
+ } else if (H5V_vector_eq_u (udata->mesg->u.chunk.ndims,
udata->key.offset, lt_key->offset) &&
lt_key->nbytes>0) {
/*
@@ -771,14 +770,14 @@ H5D_istore_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key,
#ifdef OLD_WAY
if (HADDR_UNDEF==(*new_node_p=H5MF_realloc(f, H5FD_MEM_DRAW, addr,
(hsize_t)lt_key->nbytes, (hsize_t)udata->key.nbytes)))
- HGOTO_ERROR (H5E_STORAGE, H5E_NOSPACE, H5B_INS_ERROR, "unable to reallocate chunk storage");
+ HGOTO_ERROR (H5E_STORAGE, H5E_NOSPACE, H5B_INS_ERROR, "unable to reallocate chunk storage")
#else /* OLD_WAY */
H5_CHECK_OVERFLOW( lt_key->nbytes ,size_t, hsize_t);
if (H5MF_xfree(f, H5FD_MEM_DRAW, dxpl_id, addr, (hsize_t)lt_key->nbytes)<0)
- HGOTO_ERROR(H5E_STORAGE, H5E_CANTFREE, H5B_INS_ERROR, "unable to free chunk");
+ HGOTO_ERROR(H5E_STORAGE, H5E_CANTFREE, H5B_INS_ERROR, "unable to free chunk")
H5_CHECK_OVERFLOW( udata->key.nbytes ,size_t, hsize_t);
if (HADDR_UNDEF==(*new_node_p=H5MF_alloc(f, H5FD_MEM_DRAW, dxpl_id, (hsize_t)udata->key.nbytes)))
- HGOTO_ERROR(H5E_STORAGE, H5E_NOSPACE, H5B_INS_ERROR, "unable to reallocate chunk");
+ HGOTO_ERROR(H5E_STORAGE, H5E_NOSPACE, H5B_INS_ERROR, "unable to reallocate chunk")
#endif /* OLD_WAY */
lt_key->nbytes = udata->key.nbytes;
lt_key->filter_mask = udata->key.filter_mask;
@@ -812,17 +811,16 @@ H5D_istore_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key,
*/
H5_CHECK_OVERFLOW( udata->key.nbytes ,size_t, hsize_t);
if (HADDR_UNDEF==(*new_node_p=H5MF_alloc(f, H5FD_MEM_DRAW, dxpl_id, (hsize_t)udata->key.nbytes)))
- HGOTO_ERROR(H5E_STORAGE, H5E_NOSPACE, H5B_INS_ERROR, "file allocation failed");
+ HGOTO_ERROR(H5E_STORAGE, H5E_NOSPACE, H5B_INS_ERROR, "file allocation failed")
udata->addr = *new_node_p;
ret_value = H5B_INS_RIGHT;
} else {
- assert("HDF5 INTERNAL ERROR -- see rpm" && 0);
- HGOTO_ERROR(H5E_IO, H5E_UNSUPPORTED, H5B_INS_ERROR, "internal error");
+ HGOTO_ERROR(H5E_IO, H5E_UNSUPPORTED, H5B_INS_ERROR, "internal error")
}
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_istore_insert() */
@@ -846,18 +844,19 @@ done:
* Changed to callback from H5B_iterate
*-------------------------------------------------------------------------
*/
+/* ARGSUSED */
static int
-H5D_istore_iter_allocated (H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_lt_key, haddr_t UNUSED addr,
- void UNUSED *_rt_key, void *_udata)
+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)
{
H5D_istore_ud1_t *bt_udata = (H5D_istore_ud1_t *)_udata;
- H5D_istore_key_t *lt_key = (H5D_istore_key_t *)_lt_key;
+ const H5D_istore_key_t *lt_key = (const H5D_istore_key_t *)_lt_key;
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_iter_allocated);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_iter_allocated)
bt_udata->total_storage += lt_key->nbytes;
- FUNC_LEAVE_NOAPI(H5B_ITER_CONT);
+ FUNC_LEAVE_NOAPI(H5B_ITER_CONT)
} /* H5D_istore_iter_allocated() */
@@ -882,15 +881,16 @@ H5D_istore_iter_allocated (H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_lt_key,
* Changed to callback from H5B_iterate
*-------------------------------------------------------------------------
*/
+/* ARGSUSED */
static int
-H5D_istore_iter_dump (H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_lt_key, haddr_t UNUSED addr,
- void UNUSED *_rt_key, void *_udata)
+H5D_istore_iter_dump (H5F_t UNUSED *f, hid_t UNUSED dxpl_id, const void *_lt_key, haddr_t UNUSED addr,
+ const void UNUSED *_rt_key, void *_udata)
{
H5D_istore_ud1_t *bt_udata = (H5D_istore_ud1_t *)_udata;
- H5D_istore_key_t *lt_key = (H5D_istore_key_t *)_lt_key;
+ const H5D_istore_key_t *lt_key = (const H5D_istore_key_t *)_lt_key;
unsigned u;
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_iter_dump);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_iter_dump)
if (bt_udata->stream) {
if (0==bt_udata->total_storage) {
@@ -910,7 +910,7 @@ H5D_istore_iter_dump (H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_lt_key, hadd
bt_udata->total_storage++;
}
- FUNC_LEAVE_NOAPI(H5B_ITER_CONT);
+ FUNC_LEAVE_NOAPI(H5B_ITER_CONT)
} /* H5D_istore_iter_dump() */
@@ -930,26 +930,26 @@ H5D_istore_iter_dump (H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_lt_key, hadd
*-------------------------------------------------------------------------
*/
herr_t
-H5D_istore_init (const H5F_t *f, H5D_t *dset)
+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);
+ FUNC_ENTER_NOAPI(H5D_istore_init, FAIL)
if (H5F_RDCC_NBYTES(f)>0 && H5F_RDCC_NELMTS(f)>0) {
rdcc->nbytes=H5F_RDCC_NBYTES(f);
rdcc->nslots = H5F_RDCC_NELMTS(f);
rdcc->slot = H5FL_SEQ_CALLOC (H5D_rdcc_ent_ptr_t,rdcc->nslots);
if (NULL==rdcc->slot)
- HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed");
+ HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
} /* end if */
/* Allocate the shared structure */
if(H5D_istore_shared_create(f, &dset->shared->layout)<0)
HGOTO_ERROR (H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create wrapper for shared B-tree info")
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_istore_init() */
@@ -971,7 +971,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_istore_flush_entry(H5D_io_info_t *io_info, H5D_rdcc_ent_t *ent, hbool_t reset)
+H5D_istore_flush_entry(const H5D_io_info_t *io_info, H5D_rdcc_ent_t *ent, hbool_t reset)
{
herr_t ret_value=SUCCEED; /*return value */
unsigned u; /*counters */
@@ -979,7 +979,7 @@ H5D_istore_flush_entry(H5D_io_info_t *io_info, H5D_rdcc_ent_t *ent, hbool_t rese
size_t alloc; /*bytes allocated for BUF */
hbool_t point_of_no_return = FALSE;
- FUNC_ENTER_NOAPI_NOINIT(H5D_istore_flush_entry);
+ FUNC_ENTER_NOAPI_NOINIT(H5D_istore_flush_entry)
assert(io_info);
assert(io_info->dset);
@@ -1008,7 +1008,7 @@ H5D_istore_flush_entry(H5D_io_info_t *io_info, H5D_rdcc_ent_t *ent, hbool_t rese
*/
alloc = ent->chunk_size;
if (NULL==(buf = H5MM_malloc(alloc)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for pipeline");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for pipeline")
HDmemcpy(buf, ent->chunk, ent->chunk_size);
} else {
/*
@@ -1031,9 +1031,9 @@ H5D_istore_flush_entry(H5D_io_info_t *io_info, H5D_rdcc_ent_t *ent, hbool_t rese
* its size changed. Then write the data into the file.
*/
if (H5B_insert(io_info->dset->ent.file, io_info->dxpl_id, H5B_ISTORE, io_info->dset->shared->layout.u.chunk.addr, &udata)<0)
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to allocate chunk");
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to allocate chunk")
if (H5F_block_write(io_info->dset->ent.file, H5FD_MEM_DRAW, udata.addr, udata.key.nbytes, io_info->dxpl_id, buf)<0)
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to write raw data to file");
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to write raw data to file")
/* Mark cache entry as clean */
ent->dirty = FALSE;
@@ -1067,7 +1067,7 @@ done:
ent->chunk = H5D_istore_chunk_xfree(ent->chunk,&(io_info->dset->shared->dcpl_cache.pline));
} /* end if */
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_istore_flush_entry() */
@@ -1090,12 +1090,12 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_istore_preempt(H5D_io_info_t *io_info, H5D_rdcc_ent_t * ent, hbool_t flush)
+H5D_istore_preempt(const H5D_io_info_t *io_info, H5D_rdcc_ent_t * ent, hbool_t flush)
{
H5D_rdcc_t *rdcc = &(io_info->dset->shared->cache.chunk);
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5D_istore_preempt);
+ FUNC_ENTER_NOAPI_NOINIT(H5D_istore_preempt)
assert(io_info);
assert(ent);
@@ -1105,7 +1105,7 @@ H5D_istore_preempt(H5D_io_info_t *io_info, H5D_rdcc_ent_t * ent, hbool_t flush)
if(flush) {
/* Flush */
if(H5D_istore_flush_entry(io_info, ent, TRUE) < 0)
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "cannot flush indexed storage buffer");
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "cannot flush indexed storage buffer")
}
else {
/* Don't flush, just free chunk */
@@ -1134,7 +1134,7 @@ H5D_istore_preempt(H5D_io_info_t *io_info, H5D_rdcc_ent_t * ent, hbool_t flush)
H5FL_FREE(H5D_rdcc_ent_t, ent);
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_istore_preempt() */
@@ -1166,7 +1166,7 @@ H5D_istore_flush (H5D_t *dset, hid_t dxpl_id, unsigned flags)
H5D_rdcc_ent_t *ent=NULL, *next=NULL;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5D_istore_flush, FAIL);
+ FUNC_ENTER_NOAPI(H5D_istore_flush, FAIL)
/* Fill the DXPL cache values for later use */
if (H5D_get_dxpl_cache(dxpl_id,&dxpl_cache)<0)
@@ -1191,10 +1191,10 @@ H5D_istore_flush (H5D_t *dset, hid_t dxpl_id, unsigned flags)
} /* end for */
if (nerrors)
- HGOTO_ERROR (H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks");
+ HGOTO_ERROR (H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks")
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_istore_flush() */
@@ -1226,7 +1226,7 @@ H5D_istore_dest (H5D_t *dset, hid_t dxpl_id)
H5D_rdcc_ent_t *ent=NULL, *next=NULL;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5D_istore_dest, FAIL);
+ FUNC_ENTER_NOAPI(H5D_istore_dest, FAIL)
assert(dset);
@@ -1248,17 +1248,18 @@ H5D_istore_dest (H5D_t *dset, hid_t dxpl_id)
nerrors++;
}
if (nerrors)
- HGOTO_ERROR (H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks");
+ HGOTO_ERROR (H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks")
- H5FL_SEQ_FREE (H5D_rdcc_ent_ptr_t,rdcc->slot);
+ if(rdcc->slot)
+ H5FL_SEQ_FREE (H5D_rdcc_ent_ptr_t,rdcc->slot);
HDmemset (rdcc, 0, sizeof(H5D_rdcc_t));
/* Free the raw B-tree node buffer */
if(H5RC_DEC(dset->shared->layout.u.chunk.btree_shared)<0)
- HGOTO_ERROR (H5E_IO, H5E_CANTFREE, FAIL, "unable to decrement ref-counted page");
+ HGOTO_ERROR (H5E_IO, H5E_CANTFREE, FAIL, "unable to decrement ref-counted page")
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_istore_dest() */
@@ -1310,14 +1311,14 @@ HDmemset(shared->page,0,shared->sizeof_rnode);
/* Initialize the offsets into the native key buffer */
for(u=0; u<(2*H5F_KVALUE(f,H5B_ISTORE)+1); u++)
- shared->nkey[u]=u*H5B_ISTORE->sizeof_nkey;
+ shared->nkey[u]=u*H5B_ISTORE[0].sizeof_nkey;
/* Make shared B-tree info reference counted */
if(NULL==(layout->u.chunk.btree_shared=H5RC_create(shared,H5D_istore_shared_free)))
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't create ref-count wrapper for shared B-tree info")
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_istore_shared_create() */
@@ -1374,7 +1375,7 @@ H5D_istore_shared_free (void *_shared)
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_istore_prune (H5D_io_info_t *io_info, size_t size)
+H5D_istore_prune (const H5D_io_info_t *io_info, size_t size)
{
int i, j, nerrors=0;
const H5D_rdcc_t *rdcc = &(io_info->dset->shared->cache.chunk);
@@ -1385,7 +1386,7 @@ H5D_istore_prune (H5D_io_info_t *io_info, size_t size)
H5D_rdcc_ent_t *n[2]; /*list next pointers */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5D_istore_prune);
+ FUNC_ENTER_NOAPI_NOINIT(H5D_istore_prune)
/*
* Preemption is accomplished by having multiple pointers (currently two)
@@ -1466,10 +1467,10 @@ H5D_istore_prune (H5D_io_info_t *io_info, size_t size)
}
if (nerrors)
- HGOTO_ERROR (H5E_IO, H5E_CANTFLUSH, FAIL, "unable to preempt one or more raw data cache entry");
+ HGOTO_ERROR (H5E_IO, H5E_CANTFLUSH, FAIL, "unable to preempt one or more raw data cache entry")
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_istore_prune() */
@@ -1508,7 +1509,7 @@ done:
*-------------------------------------------------------------------------
*/
static void *
-H5D_istore_lock(H5D_io_info_t *io_info,
+H5D_istore_lock(const H5D_io_info_t *io_info,
H5D_istore_ud1_t *udata, hbool_t relax, unsigned *idx_hint/*in,out*/)
{
H5D_t *dset=io_info->dset; /* Local pointer to the dataset info */
@@ -1525,7 +1526,7 @@ H5D_istore_lock(H5D_io_info_t *io_info,
void *chunk=NULL; /*the file chunk */
void *ret_value; /*return value */
- FUNC_ENTER_NOAPI_NOINIT(H5D_istore_lock);
+ FUNC_ENTER_NOAPI_NOINIT(H5D_istore_lock)
assert(io_info);
assert(dset);
@@ -1560,7 +1561,7 @@ H5D_istore_lock(H5D_io_info_t *io_info,
rdcc->nhits++;
#endif /* H5D_ISTORE_DEBUG */
- } else if (!found && relax) {
+ } else if (relax) {
/*
* Not in the cache, but we're about to overwrite the whole thing
* anyway, so just allocate a buffer for it but don't initialize that
@@ -1573,7 +1574,7 @@ H5D_istore_lock(H5D_io_info_t *io_info,
rdcc->nhits++;
#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");
+ 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 */
@@ -1602,14 +1603,14 @@ H5D_istore_lock(H5D_io_info_t *io_info,
* size in memory, so allocate memory big enough. */
chunk_alloc = udata->key.nbytes;
if (NULL==(chunk = H5D_istore_chunk_alloc (chunk_alloc,pline)))
- HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for raw data chunk");
+ HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for raw data chunk")
if (H5F_block_read(dset->ent.file, H5FD_MEM_DRAW, chunk_addr, udata->key.nbytes, io_info->dxpl_id, chunk)<0)
- HGOTO_ERROR (H5E_IO, H5E_READERROR, NULL, "unable to read raw data chunk");
+ 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,
io_info->dxpl_cache->filter_cb, &(udata->key.nbytes), &chunk_alloc, &chunk)<0) {
- HGOTO_ERROR(H5E_PLINE, H5E_READERROR, NULL, "data pipeline read failed");
+ HGOTO_ERROR(H5E_PLINE, H5E_READERROR, NULL, "data pipeline read failed")
}
#ifdef H5D_ISTORE_DEBUG
rdcc->nmisses++;
@@ -1625,10 +1626,10 @@ H5D_istore_lock(H5D_io_info_t *io_info,
/* Chunk size on disk isn't [likely] the same size as the final chunk
* size in memory, so allocate memory big enough. */
if (NULL==(chunk = H5D_istore_chunk_alloc (chunk_size,pline)))
- HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for raw data chunk");
+ HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed for raw data chunk")
if (H5P_is_fill_value_defined(fill, &fill_status) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't tell if fill value defined");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't tell if fill value defined")
if(fill_time==H5D_FILL_TIME_ALLOC ||
(fill_time==H5D_FILL_TIME_IFSET && fill_status==H5D_FILL_VALUE_USER_DEFINED)) {
@@ -1670,10 +1671,10 @@ else
HDfflush(stderr);
#endif
if (H5D_istore_preempt(io_info, ent, TRUE)<0)
- HGOTO_ERROR(H5E_IO, H5E_CANTINIT, NULL, "unable to preempt chunk from cache");
+ HGOTO_ERROR(H5E_IO, H5E_CANTINIT, NULL, "unable to preempt chunk from cache")
}
if (H5D_istore_prune(io_info, chunk_size)<0)
- HGOTO_ERROR(H5E_IO, H5E_CANTINIT, NULL, "unable to preempt chunk(s) from cache");
+ HGOTO_ERROR(H5E_IO, H5E_CANTINIT, NULL, "unable to preempt chunk(s) from cache")
/* Create a new entry */
ent = H5FL_MALLOC(H5D_rdcc_ent_t);
@@ -1714,12 +1715,13 @@ else
ent = NULL;
idx = UINT_MAX;
- } else if (found) {
+ } else {
/*
* The chunk is not at the beginning of the cache; move it backward
* by one slot. This is how we implement the LRU preemption
* algorithm.
*/
+ assert(ent);
if (ent->next) {
if (ent->next->next)
ent->next->next->prev = ent;
@@ -1752,8 +1754,8 @@ else
done:
if (!ret_value)
if(chunk)
- H5D_istore_chunk_xfree (chunk,pline);
- FUNC_LEAVE_NOAPI(ret_value);
+ chunk=H5D_istore_chunk_xfree (chunk,pline);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_istore_lock() */
@@ -1784,29 +1786,20 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5D_istore_unlock(H5D_io_info_t *io_info,
+H5D_istore_unlock(const H5D_io_info_t *io_info,
hbool_t dirty, unsigned idx_hint, uint8_t *chunk, size_t naccessed)
{
const H5O_layout_t *layout=&(io_info->dset->shared->layout); /* Dataset layout */
const H5D_rdcc_t *rdcc = &(io_info->dset->shared->cache.chunk);
H5D_rdcc_ent_t *ent = NULL;
- int found = -1;
unsigned u;
+ herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_unlock);
+ FUNC_ENTER_NOAPI_NOINIT(H5D_istore_unlock)
assert(io_info);
if (UINT_MAX==idx_hint) {
- /*not in cache*/
- } else {
- assert(idx_hint<rdcc->nslots);
- assert(rdcc->slot[idx_hint]);
- assert(rdcc->slot[idx_hint]->chunk==chunk);
- found = idx_hint;
- }
-
- if (found<0) {
/*
* It's not in the cache, probably because it's too big. If it's
* dirty then flush it to disk. In any case, free the chunk.
@@ -1825,16 +1818,22 @@ H5D_istore_unlock(H5D_io_info_t *io_info,
x.alloc_size = x.chunk_size;
x.chunk = chunk;
- H5D_istore_flush_entry (io_info, &x, TRUE);
+ if (H5D_istore_flush_entry(io_info, &x, TRUE)<0)
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "cannot flush indexed storage buffer")
} else {
if(chunk)
- H5D_istore_chunk_xfree (chunk,&(io_info->dset->shared->dcpl_cache.pline));
+ chunk=H5D_istore_chunk_xfree (chunk,&(io_info->dset->shared->dcpl_cache.pline));
}
} else {
+ /* Sanity check */
+ assert(idx_hint<rdcc->nslots);
+ assert(rdcc->slot[idx_hint]);
+ assert(rdcc->slot[idx_hint]->chunk==chunk);
+
/*
* It's in the cache so unlock it.
*/
- ent = rdcc->slot[found];
+ ent = rdcc->slot[idx_hint];
assert (ent->locked);
if (dirty) {
ent->dirty = TRUE;
@@ -1845,7 +1844,8 @@ H5D_istore_unlock(H5D_io_info_t *io_info,
ent->locked = FALSE;
}
- FUNC_LEAVE_NOAPI(SUCCEED);
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_istore_unlock() */
@@ -1865,7 +1865,7 @@ H5D_istore_unlock(H5D_io_info_t *io_info,
*-------------------------------------------------------------------------
*/
ssize_t
-H5D_istore_readvv(H5D_io_info_t *io_info,
+H5D_istore_readvv(const H5D_io_info_t *io_info,
size_t chunk_max_nseq, size_t *chunk_curr_seq, size_t chunk_len_arr[], hsize_t chunk_offset_arr[],
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[],
void *buf)
@@ -1876,7 +1876,7 @@ H5D_istore_readvv(H5D_io_info_t *io_info,
size_t u; /* Local index variables */
ssize_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5D_istore_readvv, FAIL);
+ FUNC_ENTER_NOAPI(H5D_istore_readvv, FAIL)
/* Check args */
assert(io_info);
@@ -1890,11 +1890,6 @@ H5D_istore_readvv(H5D_io_info_t *io_info,
assert(mem_offset_arr);
assert(buf);
-#ifndef NDEBUG
- for (u=0; u<dset->shared->layout.u.chunk.ndims; u++)
- assert(io_info->store->chunk.offset[u]>=0); /*negative coordinates not supported (yet) */
-#endif
-
/* Get the address of this chunk on disk */
#ifdef QAK
HDfprintf(stderr,"%s: io_info->store->chunk.offset={",FUNC);
@@ -1936,7 +1931,7 @@ HDfprintf(stderr,"%s: buf=%p\n",FUNC,buf);
/* Do I/O directly on chunk without reading it into the cache */
if ((ret_value=H5D_contig_readvv(&chk_io_info, chunk_max_nseq, chunk_curr_seq, chunk_len_arr, chunk_offset_arr, mem_max_nseq, mem_curr_seq, mem_len_arr, mem_offset_arr, buf))<0)
- HGOTO_ERROR (H5E_IO, H5E_READERROR, FAIL, "unable to read raw data to file");
+ HGOTO_ERROR (H5E_IO, H5E_READERROR, FAIL, "unable to read raw data to file")
} /* end if */
else {
uint8_t *chunk; /* Pointer to cached chunk in memory */
@@ -1978,7 +1973,7 @@ HDfprintf(stderr,"%s: buf=%p\n",FUNC,buf);
if(!found) {
/* Check if the fill value is defined */
if (H5P_is_fill_value_defined(fill, &fill_status) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't tell if fill value defined");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't tell if fill value defined")
/* If we are never to return fill values, or if we would return them
* but they aren't set, process the entire set of I/O vectors and
@@ -2018,7 +2013,7 @@ HDfprintf(stderr,"%s: buf=%p\n",FUNC,buf);
*mem_curr_seq=u;
*chunk_curr_seq=v;
- HGOTO_DONE(bytes_processed);
+ HGOTO_DONE(bytes_processed)
} /* end if */
} /* end if */
} /* end if */
@@ -2028,22 +2023,22 @@ HDfprintf(stderr,"%s: buf=%p\n",FUNC,buf);
* chunk.
*/
if (NULL==(chunk=H5D_istore_lock(io_info, &udata, FALSE, &idx_hint)))
- HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk");
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to read raw data chunk")
/* Use the vectorized memory copy routine to do actual work */
if((naccessed=H5V_memcpyvv(buf,mem_max_nseq,mem_curr_seq,mem_len_arr,mem_offset_arr,chunk,chunk_max_nseq,chunk_curr_seq,chunk_len_arr,chunk_offset_arr))<0)
- HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "vectorized memcpy failed");
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "vectorized memcpy failed")
H5_CHECK_OVERFLOW(naccessed,ssize_t,size_t);
if (H5D_istore_unlock(io_info, FALSE, idx_hint, chunk, (size_t)naccessed)<0)
- HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk");
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL, "unable to unlock raw data chunk")
/* Set return value */
ret_value=naccessed;
} /* end else */
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* H5D_istore_readvv() */
@@ -2063,7 +2058,7 @@ done:
*-------------------------------------------------------------------------
*/
ssize_t
-H5D_istore_writevv(H5D_io_info_t *io_info,
+H5D_istore_writevv(const H5D_io_info_t *io_info,
size_t chunk_max_nseq, size_t *chunk_curr_seq, size_t chunk_len_arr[], hsize_t chunk_offset_arr[],
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[],
const void *buf)
@@ -2074,7 +2069,7 @@ H5D_istore_writevv(H5D_io_info_t *io_info,
size_t u; /* Local index variables */
ssize_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5D_istore_writevv, FAIL);
+ FUNC_ENTER_NOAPI(H5D_istore_writevv, FAIL)
/* Check args */
assert(io_info);
@@ -2088,11 +2083,6 @@ H5D_istore_writevv(H5D_io_info_t *io_info,
assert(mem_offset_arr);
assert(buf);
-#ifndef NDEBUG
- for (u=0; u<dset->shared->layout.u.chunk.ndims; u++)
- assert(io_info->store->chunk.offset[u]>=0); /*negative coordinates not supported (yet) */
-#endif
-
/* Get the address of this chunk on disk */
#ifdef QAK
HDfprintf(stderr,"%s: io_info->store->chunk.offset={",FUNC);
@@ -2123,9 +2113,9 @@ HDfprintf(stderr,"%s: mem_offset_arr[%Zu]=%Hu\n",FUNC,*mem_curr_seq,mem_offset_a
/* Additional sanity checks when operating in parallel */
if(IS_H5FD_MPI(dset->ent.file)) {
if (chunk_addr==HADDR_UNDEF)
- HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "unable to locate raw data chunk");
+ HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "unable to locate raw data chunk")
if (dset->shared->dcpl_cache.pline.nused>0)
- HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "cannot write to chunked storage with filters in parallel");
+ HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "cannot write to chunked storage with filters in parallel")
} /* end if */
#endif /* H5_HAVE_PARALLEL */
@@ -2143,7 +2133,7 @@ HDfprintf(stderr,"%s: mem_offset_arr[%Zu]=%Hu\n",FUNC,*mem_curr_seq,mem_offset_a
/* Do I/O directly on chunk without reading it into the cache */
if ((ret_value=H5D_contig_writevv(&chk_io_info, chunk_max_nseq, chunk_curr_seq, chunk_len_arr, chunk_offset_arr, mem_max_nseq, mem_curr_seq, mem_len_arr, mem_offset_arr, buf))<0)
- HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "unable to write raw data to file");
+ HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "unable to write raw data to file")
} /* end if */
else {
uint8_t *chunk; /* Pointer to cached chunk in memory */
@@ -2183,22 +2173,22 @@ HDfprintf(stderr,"%s: mem_offset_arr[%Zu]=%Hu\n",FUNC,*mem_curr_seq,mem_offset_a
#endif /* OLD_WAY */
if (NULL==(chunk=H5D_istore_lock(io_info, &udata, relax, &idx_hint)))
- HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "unable to read raw data chunk");
+ HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "unable to read raw data chunk")
/* Use the vectorized memory copy routine to do actual work */
if((naccessed=H5V_memcpyvv(chunk,chunk_max_nseq,chunk_curr_seq,chunk_len_arr,chunk_offset_arr,buf,mem_max_nseq,mem_curr_seq,mem_len_arr,mem_offset_arr))<0)
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "vectorized memcpy failed");
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "vectorized memcpy failed")
H5_CHECK_OVERFLOW(naccessed,ssize_t,size_t);
if (H5D_istore_unlock(io_info, TRUE, idx_hint, chunk, (size_t)naccessed)<0)
- HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "uanble to unlock raw data chunk");
+ HGOTO_ERROR (H5E_IO, H5E_WRITEERROR, FAIL, "uanble to unlock raw data chunk")
/* Set return value */
ret_value=naccessed;
} /* end else */
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* H5D_istore_writevv() */
@@ -2231,7 +2221,7 @@ H5D_istore_create(H5F_t *f, hid_t dxpl_id, H5O_layout_t *layout /*out */ )
#endif
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5D_istore_create, FAIL);
+ FUNC_ENTER_NOAPI(H5D_istore_create, FAIL)
/* Check args */
assert(f);
@@ -2246,10 +2236,10 @@ H5D_istore_create(H5F_t *f, hid_t dxpl_id, H5O_layout_t *layout /*out */ )
udata.mesg = layout;
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");
+ HGOTO_ERROR(H5E_IO, H5E_CANTINIT, FAIL, "can't create B-tree")
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_istore_create() */
@@ -2283,7 +2273,7 @@ H5D_istore_allocated(H5D_t *dset, hid_t dxpl_id)
H5D_istore_ud1_t udata;
hsize_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5D_istore_allocated, 0);
+ FUNC_ENTER_NOAPI(H5D_istore_allocated, 0)
assert(dset);
@@ -2298,19 +2288,19 @@ H5D_istore_allocated(H5D_t *dset, hid_t dxpl_id)
for(ent = rdcc->head; ent; ent = ent->next) {
/* Flush the chunk out to disk, to make certain the size is correct later */
if (H5D_istore_flush_entry(&io_info, ent, FALSE)<0)
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, 0, "cannot flush indexed storage buffer");
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, 0, "cannot flush indexed storage buffer")
} /* end for */
HDmemset(&udata, 0, sizeof udata);
udata.mesg = &dset->shared->layout;
if (H5B_iterate(dset->ent.file, dxpl_id, H5B_ISTORE, H5D_istore_iter_allocated, dset->shared->layout.u.chunk.addr, &udata)<0)
- HGOTO_ERROR(H5E_IO, H5E_CANTINIT, 0, "unable to iterate over chunk B-tree");
+ HGOTO_ERROR(H5E_IO, H5E_CANTINIT, 0, "unable to iterate over chunk B-tree")
/* Set return value */
ret_value=udata.total_storage;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_istore_allocated() */
@@ -2333,14 +2323,14 @@ done:
*-------------------------------------------------------------------------
*/
haddr_t
-H5D_istore_get_addr(H5D_io_info_t *io_info, H5D_istore_ud1_t *_udata)
+H5D_istore_get_addr(const H5D_io_info_t *io_info, H5D_istore_ud1_t *_udata)
{
H5D_istore_ud1_t tmp_udata; /* Information about a chunk */
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);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_get_addr)
assert(io_info);
assert(io_info->dset);
@@ -2365,7 +2355,7 @@ H5D_istore_get_addr(H5D_io_info_t *io_info, H5D_istore_ud1_t *_udata)
#ifdef OLD_WAY
H5E_clear();
- HGOTO_ERROR(H5E_BTREE,H5E_NOTFOUND,HADDR_UNDEF,"Can't locate chunk info");
+ HGOTO_ERROR(H5E_BTREE,H5E_NOTFOUND,HADDR_UNDEF,"Can't locate chunk info")
#else /* OLD_WAY */
HGOTO_DONE(HADDR_UNDEF)
#endif /* OLD_WAY */
@@ -2375,7 +2365,7 @@ H5D_istore_get_addr(H5D_io_info_t *io_info, H5D_istore_ud1_t *_udata)
ret_value=udata->addr;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* H5D_istore_get_addr() */
@@ -2400,7 +2390,7 @@ 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);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_chunk_alloc)
assert(size);
assert(pline);
@@ -2410,7 +2400,7 @@ H5D_istore_chunk_alloc(size_t size, const H5O_pline_t *pline)
else
ret_value=H5FL_BLK_MALLOC(chunk,size);
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* H5D_istore_chunk_alloc() */
@@ -2433,7 +2423,7 @@ H5D_istore_chunk_alloc(size_t size, const H5O_pline_t *pline)
static void *
H5D_istore_chunk_xfree(void *chk, const H5O_pline_t *pline)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_chunk_xfree);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_chunk_xfree)
assert(pline);
@@ -2444,7 +2434,7 @@ H5D_istore_chunk_xfree(void *chk, const H5O_pline_t *pline)
H5FL_BLK_FREE(chunk,chk);
} /* end if */
- FUNC_LEAVE_NOAPI(NULL);
+ FUNC_LEAVE_NOAPI(NULL)
} /* H5D_istore_chunk_xfree() */
@@ -2496,10 +2486,11 @@ H5D_istore_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite)
{
H5D_io_info_t io_info; /* Dataset I/O info */
H5D_storage_t store; /* Dataset storage information */
- hssize_t chunk_offset[H5O_LAYOUT_NDIMS]; /* Offset of current chunk */
+ hsize_t chunk_offset[H5O_LAYOUT_NDIMS]; /* Offset of current chunk */
hsize_t chunk_size; /* Size of chunk in bytes */
unsigned filter_mask=0; /* Filter mask for chunks that have them */
H5O_pline_t pline; /* I/O pipeline information */
+ hbool_t pline_initialized=FALSE; /* Flag to indicate that pline has valid info */
H5O_fill_t fill; /* Fill value information */
H5D_fill_time_t fill_time; /* When to write fill values */
H5D_fill_value_t fill_status; /* The fill value status */
@@ -2524,7 +2515,7 @@ H5D_istore_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite)
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);
+ FUNC_ENTER_NOAPI(H5D_istore_allocate, FAIL)
/* Check args */
assert(dset && H5D_CHUNKED==dset->shared->layout.type);
@@ -2543,11 +2534,12 @@ H5D_istore_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite)
/* Get necessary properties from dataset creation property list */
if(H5P_get(dc_plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0)
- HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "can't get fill value");
+ HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "can't get fill value")
if(H5P_get(dc_plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0)
- HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "can't get data pipeline");
+ HGOTO_ERROR(H5E_STORAGE, H5E_CANTGET, FAIL, "can't get data pipeline")
+ pline_initialized=TRUE;
if(H5P_get(dc_plist, H5D_CRT_FILL_TIME_NAME, &fill_time) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve fill time");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't retrieve fill time")
/* Fill the DXPL cache values for later use */
if (H5D_get_dxpl_cache(dxpl_id,&dxpl_cache)<0)
@@ -2558,11 +2550,11 @@ H5D_istore_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite)
if(IS_H5FD_MPI(dset->ent.file)) {
/* Get the MPI communicator */
if (MPI_COMM_NULL == (mpi_comm=H5F_mpi_get_comm(dset->ent.file)))
- HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI communicator");
+ HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI communicator")
/* Get the MPI rank */
if ((mpi_rank=H5F_mpi_get_rank(dset->ent.file))<0)
- HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI rank");
+ HGOTO_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "Can't retrieve MPI rank")
/* Set the MPI-capable file driver flag */
using_mpi=1;
@@ -2579,7 +2571,7 @@ H5D_istore_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite)
/* Check the dataset's fill-value status */
if (H5P_is_fill_value_defined(&fill, &fill_status) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't tell if fill value defined");
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't tell if fill value defined")
/* If we are filling the dataset on allocation or "if set" and
* the fill value _is_ set, _and_ we are not overwriting the new blocks,
@@ -2596,7 +2588,7 @@ H5D_istore_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite)
/* Allocate chunk buffer for processes to use when writing fill values */
H5_CHECK_OVERFLOW(chunk_size,hsize_t,size_t);
if (NULL==(chunk = H5D_istore_chunk_alloc((size_t)chunk_size,&pline)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for chunk");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed for chunk")
/* Fill the chunk with the proper values */
if(fill.buf) {
@@ -2619,7 +2611,7 @@ H5D_istore_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite)
/* Push the chunk through the filters */
if (H5Z_pipeline(&pline, 0, &filter_mask, dxpl_cache->err_detect, dxpl_cache->filter_cb, &nbytes, &buf_size, &chunk)<0)
- HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "output pipeline failed");
+ HGOTO_ERROR(H5E_PLINE, H5E_WRITEERROR, FAIL, "output pipeline failed")
/* Keep the number of bytes the chunk turned in to */
chunk_size=nbytes;
@@ -2665,7 +2657,7 @@ H5D_istore_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite)
/* Allocate the chunk with all processes */
if (H5B_insert(dset->ent.file, dxpl_id, H5B_ISTORE, dset->shared->layout.u.chunk.addr, &udata)<0)
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to allocate chunk");
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to allocate chunk")
/* Check if fill values should be written to blocks */
if(should_fill) {
@@ -2676,7 +2668,7 @@ H5D_istore_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite)
/* !! Use the internal "independent" DXPL!! -QAK */
if(H5_PAR_META_WRITE==mpi_rank) {
if (H5F_block_write(dset->ent.file, H5FD_MEM_DRAW, udata.addr, udata.key.nbytes, H5AC_ind_dxpl_id, chunk)<0)
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to write raw data to file");
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to write raw data to file")
} /* end if */
/* Indicate that blocks are being written */
@@ -2685,7 +2677,7 @@ H5D_istore_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite)
else {
#endif /* H5_HAVE_PARALLEL */
if (H5F_block_write(dset->ent.file, H5FD_MEM_DRAW, udata.addr, udata.key.nbytes, dxpl_id, chunk)<0)
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to write raw data to file");
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to write raw data to file")
#ifdef H5_HAVE_PARALLEL
} /* end else */
#endif /* H5_HAVE_PARALLEL */
@@ -2693,9 +2685,9 @@ H5D_istore_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite)
} /* end if */
/* Increment indices */
- for (i=dset->shared->layout.u.chunk.ndims-1, carry=1; i>=0 && carry; --i) {
+ 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];
- if (chunk_offset[i] >= (hssize_t)(space_dim[i]))
+ if (chunk_offset[i] >= space_dim[i])
chunk_offset[i] = 0;
else
carry = 0;
@@ -2717,10 +2709,10 @@ H5D_istore_allocate(H5D_t *dset, hid_t dxpl_id, hbool_t full_overwrite)
done:
/* Free the chunk for fill values */
- if(chunk!=NULL)
- H5D_istore_chunk_xfree(chunk,&pline);
+ if(chunk!=NULL && pline_initialized)
+ chunk=H5D_istore_chunk_xfree(chunk,&pline);
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_istore_allocate() */
@@ -2825,7 +2817,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5D_istore_prune_by_extent(H5D_io_info_t *io_info)
+H5D_istore_prune_by_extent(const H5D_io_info_t *io_info)
{
H5D_t *dset=io_info->dset; /* Local pointer to the dataset info */
const H5D_rdcc_t *rdcc = &(dset->shared->cache.chunk); /*raw data chunk cache */
@@ -2836,7 +2828,7 @@ H5D_istore_prune_by_extent(H5D_io_info_t *io_info)
hsize_t curr_dims[H5O_LAYOUT_NDIMS]; /*current dataspace dimensions */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5D_istore_prune_by_extent, FAIL);
+ FUNC_ENTER_NOAPI(H5D_istore_prune_by_extent, FAIL)
/* Check args */
assert(io_info);
@@ -2846,7 +2838,7 @@ H5D_istore_prune_by_extent(H5D_io_info_t *io_info)
/* Go get the rank & dimensions */
if(H5S_get_simple_extent_dims(dset->shared->space, curr_dims, NULL) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataset dimensions");
+ 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
@@ -2874,7 +2866,7 @@ H5D_istore_prune_by_extent(H5D_io_info_t *io_info)
/* Preempt the entry from the cache, but do not flush it to disk */
if(H5D_istore_preempt(io_info, ent, FALSE) < 0)
- HGOTO_ERROR(H5E_IO, H5E_CANTINIT, 0, "unable to preempt chunk");
+ HGOTO_ERROR(H5E_IO, H5E_CANTINIT, 0, "unable to preempt chunk")
found=0;
}
@@ -2891,10 +2883,10 @@ H5D_istore_prune_by_extent(H5D_io_info_t *io_info)
udata.dims = curr_dims;
if(H5B_iterate(dset->ent.file, io_info->dxpl_id, H5B_ISTORE, H5D_istore_prune_extent, dset->shared->layout.u.chunk.addr, &udata) < 0)
- HGOTO_ERROR(H5E_IO, H5E_CANTINIT, 0, "unable to iterate over B-tree");
+ HGOTO_ERROR(H5E_IO, H5E_CANTINIT, 0, "unable to iterate over B-tree")
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_istore_prune_by_extent() */
@@ -2915,12 +2907,13 @@ done:
*
*-------------------------------------------------------------------------
*/
+/* ARGSUSED */
static int
-H5D_istore_prune_extent(H5F_t *f, hid_t dxpl_id, void *_lt_key, haddr_t UNUSED addr,
- void UNUSED *_rt_key, void *_udata)
+H5D_istore_prune_extent(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t UNUSED addr,
+ const void UNUSED *_rt_key, void *_udata)
{
H5D_istore_ud1_t *bt_udata = (H5D_istore_ud1_t *)_udata;
- H5D_istore_key_t *lt_key = (H5D_istore_key_t *)_lt_key;
+ const H5D_istore_key_t *lt_key = (const H5D_istore_key_t *)_lt_key;
unsigned u;
H5D_istore_ud1_t udata;
int ret_value=H5B_ITER_CONT; /* Return value */
@@ -2929,7 +2922,7 @@ H5D_istore_prune_extent(H5F_t *f, hid_t dxpl_id, void *_lt_key, haddr_t UNUSED a
* storage that contains the beginning of the logical address space represented by UDATA.
*/
- FUNC_ENTER_NOAPI_NOINIT(H5D_istore_prune_extent);
+ FUNC_ENTER_NOAPI_NOINIT(H5D_istore_prune_extent)
/* Figure out what chunks are no longer in use for the specified extent and release them */
for(u = 0; u < bt_udata->mesg->u.chunk.ndims - 1; u++)
@@ -2947,12 +2940,12 @@ H5D_istore_prune_extent(H5F_t *f, hid_t dxpl_id, void *_lt_key, haddr_t UNUSED a
/* Remove */
if(H5B_remove(f, dxpl_id, H5B_ISTORE, bt_udata->mesg->u.chunk.addr, &udata) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5B_ITER_ERROR, "unable to remove entry");
+ HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, H5B_ITER_ERROR, "unable to remove entry")
break;
} /* end if */
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_istore_prune_extent() */
@@ -2974,6 +2967,7 @@ done:
*
*-------------------------------------------------------------------------
*/
+/* ARGSUSED */
static H5B_ins_t
H5D_istore_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key /*in,out */ ,
hbool_t *lt_key_changed /*out */ ,
@@ -2982,17 +2976,20 @@ H5D_istore_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key /*in,out
hbool_t *rt_key_changed /*out */ )
{
H5D_istore_key_t *lt_key = (H5D_istore_key_t *)_lt_key;
+ H5B_ins_t ret_value=H5B_INS_REMOVE; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5D_istore_remove);
+ FUNC_ENTER_NOAPI_NOINIT(H5D_istore_remove)
/* Remove raw data chunk from file */
- H5MF_xfree(f, H5FD_MEM_DRAW, dxpl_id, addr, (hsize_t)lt_key->nbytes);
+ if(H5MF_xfree(f, H5FD_MEM_DRAW, dxpl_id, addr, (hsize_t)lt_key->nbytes)<0)
+ HGOTO_ERROR(H5E_STORAGE, H5E_CANTFREE, H5B_INS_ERROR, "unable to free chunk")
/* Mark keys as unchanged */
*lt_key_changed = FALSE;
*rt_key_changed = FALSE;
- FUNC_LEAVE_NOAPI(H5B_INS_REMOVE);
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_istore_remove() */
@@ -3026,13 +3023,13 @@ H5D_istore_initialize_by_extent(H5D_io_info_t *io_info)
const H5O_layout_t *layout=&(io_info->dset->shared->layout); /* Dataset layout */
uint8_t *chunk = NULL; /*the file chunk */
unsigned idx_hint = 0; /*input value for H5F_istore_lock */
- hssize_t chunk_offset[H5O_LAYOUT_NDIMS]; /*logical location of the chunks */
+ hsize_t chunk_offset[H5O_LAYOUT_NDIMS]; /*logical location of the chunks */
hsize_t idx_cur[H5O_LAYOUT_NDIMS]; /*multi-dimensional counters */
hsize_t idx_max[H5O_LAYOUT_NDIMS];
hsize_t sub_size[H5O_LAYOUT_NDIMS];
hsize_t naccessed; /*bytes accessed in chunk */
hsize_t end_chunk; /*chunk position counter */
- hssize_t start[H5O_LAYOUT_NDIMS]; /*starting location of hyperslab */
+ hsize_t start[H5O_LAYOUT_NDIMS]; /*starting location of hyperslab */
hsize_t count[H5O_LAYOUT_NDIMS]; /*element count of hyperslab */
hsize_t size[H5O_LAYOUT_NDIMS]; /*current size of dimensions */
H5S_t *space_chunk = NULL; /*dataspace for a chunk */
@@ -3052,7 +3049,7 @@ H5D_istore_initialize_by_extent(H5D_io_info_t *io_info)
H5D_storage_t store; /* Dataset storage information */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5D_istore_initialize_by_extent, FAIL);
+ FUNC_ENTER_NOAPI(H5D_istore_initialize_by_extent, FAIL)
/* Check args */
assert(io_info);
@@ -3066,11 +3063,11 @@ H5D_istore_initialize_by_extent(H5D_io_info_t *io_info)
/* Get necessary properties from property list */
if(H5P_get(dc_plist, H5D_CRT_FILL_VALUE_NAME, &fill) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get fill value");
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get fill value")
if(H5P_get(dc_plist, H5D_CRT_FILL_TIME_NAME, &fill_time) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get fill time");
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get fill time")
if(H5P_get(dc_plist, H5D_CRT_DATA_PIPELINE_NAME, &pline) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get data pipeline");
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get data pipeline")
/* Reset start & count arrays */
HDmemset(start, 0, sizeof(start));
@@ -3098,7 +3095,7 @@ H5D_istore_initialize_by_extent(H5D_io_info_t *io_info)
for(u = 0; u < rank; u++)
chunk_dims[u] = layout->u.chunk.dim[u];
if(NULL == (space_chunk = H5S_create_simple(rank,chunk_dims,NULL)))
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace");
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCREATE, FAIL, "can't create simple dataspace")
/*
* Set up multi-dimensional counters (idx_max, and idx_cur) and
@@ -3119,7 +3116,7 @@ H5D_istore_initialize_by_extent(H5D_io_info_t *io_info)
while(carry==0) {
for(u = 0, naccessed = 1; u < layout->u.chunk.ndims; u++) {
/* The location and size of the chunk being accessed */
- chunk_offset[u] = idx_cur[u] * (hssize_t)(layout->u.chunk.dim[u]);
+ chunk_offset[u] = idx_cur[u] * layout->u.chunk.dim[u];
sub_size[u] = MIN((idx_cur[u] + 1) * layout->u.chunk.dim[u],
size[u]) - chunk_offset[u];
naccessed *= sub_size[u];
@@ -3129,7 +3126,7 @@ H5D_istore_initialize_by_extent(H5D_io_info_t *io_info)
* 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 < layout->u.chunk.ndims - 1; u++) {
+ for(u = 0, found = 0; u < rank; u++) {
end_chunk = chunk_offset[u] + layout->u.chunk.dim[u];
if(end_chunk > size[u]) {
found = 1;
@@ -3145,28 +3142,28 @@ H5D_istore_initialize_by_extent(H5D_io_info_t *io_info)
store.chunk.offset=chunk_offset;
if(NULL == (chunk = H5D_istore_lock(io_info, NULL, FALSE, &idx_hint)))
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to read raw data chunk");
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to read raw data chunk")
if(H5S_select_all(space_chunk,1) < 0)
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to select space");
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to select space")
for(u = 0; u < rank; u++)
count[u] = MIN((idx_cur[u] + 1) * layout->u.chunk.dim[u], size[u] - chunk_offset[u]);
#ifdef H5D_ISTORE_DEBUG
HDfputs("cache:initialize:offset:[", stdout);
- for(u = 0; u < layout->u.chunk.ndims - 1; u++)
+ for(u = 0; u < rank; u++)
HDfprintf(stdout, "%s%Hd", u ? ", " : "", chunk_offset[u]);
HDfputs("]", stdout);
HDfputs(":count:[", stdout);
- for(u = 0; u < layout->u.chunk.ndims - 1; u++)
+ for(u = 0; u < rank; u++)
HDfprintf(stdout, "%s%Hd", u ? ", " : "", count[u]);
HDfputs("]\n", stdout);
#endif
if(H5S_select_hyperslab(space_chunk, H5S_SELECT_NOTB, start, NULL,
count, NULL) < 0)
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to select hyperslab");
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to select hyperslab")
/* Fill the selection in the memory buffer */
/* Use the size of the elements in the chunk directly instead of */
@@ -3174,14 +3171,14 @@ H5D_istore_initialize_by_extent(H5D_io_info_t *io_info)
/* no fill-value defined for the dataset -QAK */
H5_CHECK_OVERFLOW(size[rank],hsize_t,size_t);
if(H5S_select_fill(fill.buf, (size_t)size[rank], space_chunk, chunk) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "filling selection failed");
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTENCODE, FAIL, "filling selection failed")
if(H5D_istore_unlock(io_info, TRUE, idx_hint, chunk, (size_t)naccessed) < 0)
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to unlock raw data chunk");
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to unlock raw data chunk")
} /*found */
/* Increment indices */
- for(i = layout->u.chunk.ndims - 1, carry = 1; i >= 0 && carry; --i) {
+ for(i = (int)rank, carry = 1; i >= 0 && carry; --i) {
if(++idx_cur[i] >= idx_max[i])
idx_cur[i] = 0;
else
@@ -3191,9 +3188,10 @@ H5D_istore_initialize_by_extent(H5D_io_info_t *io_info)
done:
if(space_chunk)
- H5S_close(space_chunk);
+ if(H5S_close(space_chunk)<0)
+ HDONE_ERROR(H5E_DATASET, H5E_CLOSEERROR, FAIL, "unable to release dataspace")
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_istore_initialize_by_extent() */
@@ -3217,7 +3215,7 @@ H5D_istore_delete(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout)
{
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5D_istore_delete, FAIL);
+ FUNC_ENTER_NOAPI(H5D_istore_delete, FAIL)
/* Check if the B-tree has been created in the file */
if(H5F_addr_defined(layout->u.chunk.addr)) {
@@ -3234,15 +3232,15 @@ H5D_istore_delete(H5F_t *f, hid_t dxpl_id, const H5O_layout_t *layout)
/* Delete entire B-tree */
if(H5B_delete(f, dxpl_id, H5B_ISTORE, tmp_layout.u.chunk.addr, &udata)<0)
- HGOTO_ERROR(H5E_IO, H5E_CANTDELETE, 0, "unable to delete chunk B-tree");
+ HGOTO_ERROR(H5E_IO, H5E_CANTDELETE, 0, "unable to delete chunk B-tree")
/* Free the raw B-tree node buffer */
if(H5RC_DEC(tmp_layout.u.chunk.btree_shared)<0)
- HGOTO_ERROR (H5E_IO, H5E_CANTFREE, FAIL, "unable to decrement ref-counted page");
+ HGOTO_ERROR (H5E_IO, H5E_CANTFREE, FAIL, "unable to decrement ref-counted page")
} /* end if */
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_istore_delete() */
@@ -3271,7 +3269,6 @@ H5D_istore_update_cache(H5D_t *dset, hid_t dxpl_id)
H5D_rdcc_ent_t *old_ent; /* Old cache entry */
H5D_dxpl_cache_t _dxpl_cache; /* Data transfer property cache buffer */
H5D_dxpl_cache_t *dxpl_cache=&_dxpl_cache; /* Data transfer property cache */
- int srank; /*current # of dimensions (signed) */
unsigned rank; /*current # of dimensions */
hsize_t curr_dims[H5O_LAYOUT_NDIMS]; /*current dataspace dimensions */
hsize_t chunks[H5O_LAYOUT_NDIMS]; /*current number of chunks in each dimension */
@@ -3281,16 +3278,16 @@ H5D_istore_update_cache(H5D_t *dset, hid_t dxpl_id)
unsigned u; /*counters */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5D_istore_update_cache, FAIL);
+ FUNC_ENTER_NOAPI(H5D_istore_update_cache, FAIL)
/* Check args */
assert(dset && H5D_CHUNKED == dset->shared->layout.type);
assert(dset->shared->layout.u.chunk.ndims > 0 && dset->shared->layout.u.chunk.ndims <= H5O_LAYOUT_NDIMS);
/* Go get the rank & dimensions */
- if((srank = H5S_get_simple_extent_dims(dset->shared->space, curr_dims, NULL)) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataset dimensions");
- H5_ASSIGN_OVERFLOW(rank,srank,int,unsigned);
+ rank = dset->shared->layout.u.chunk.ndims-1;
+ if(H5S_get_simple_extent_dims(dset->shared->space, curr_dims, NULL) < 0)
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get dataset dimensions")
/* Round up to the next integer # of chunks, to accomodate partial chunks */
for(u = 0; u < rank; u++)
@@ -3331,7 +3328,7 @@ H5D_istore_update_cache(H5D_t *dset, hid_t dxpl_id)
/* Remove the old entry from the cache */
if (H5D_istore_preempt(&io_info, old_ent, TRUE )<0)
- HGOTO_ERROR (H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks");
+ HGOTO_ERROR (H5E_IO, H5E_CANTFLUSH, FAIL, "unable to flush one or more raw data chunks")
} /* end if */
/* Insert this chunk into correct location in hash table */
@@ -3343,7 +3340,7 @@ H5D_istore_update_cache(H5D_t *dset, hid_t dxpl_id)
} /* end for */
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5F_istore_update_cache() */
@@ -3372,7 +3369,7 @@ H5D_istore_dump_btree(H5F_t *f, hid_t dxpl_id, FILE *stream, unsigned ndims, had
H5D_istore_ud1_t udata;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5D_istore_dump_btree, FAIL);
+ FUNC_ENTER_NOAPI(H5D_istore_dump_btree, FAIL)
HDmemset(&udata, 0, sizeof udata);
layout.u.chunk.ndims = ndims;
@@ -3381,10 +3378,10 @@ H5D_istore_dump_btree(H5F_t *f, hid_t dxpl_id, FILE *stream, unsigned ndims, had
if(stream)
HDfprintf(stream, " Address: %a\n",addr);
if(H5B_iterate(f, dxpl_id, H5B_ISTORE, H5D_istore_iter_dump, addr, &udata)<0)
- HGOTO_ERROR(H5E_IO, H5E_CANTINIT, 0, "unable to iterate over chunk B-tree");
+ HGOTO_ERROR(H5E_IO, H5E_CANTINIT, 0, "unable to iterate over chunk B-tree")
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_istore_dump_btree() */
#ifdef H5D_ISTORE_DEBUG
@@ -3413,10 +3410,10 @@ H5D_istore_stats (H5D_t *dset, hbool_t headers)
char ascii[32];
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5D_istore_stats, FAIL);
+ FUNC_ENTER_NOAPI(H5D_istore_stats, FAIL)
if (!H5DEBUG(AC))
- HGOTO_DONE(SUCCEED);
+ HGOTO_DONE(SUCCEED)
if (headers) {
fprintf(H5DEBUG(AC), "H5D: raw data cache statistics\n");
@@ -3449,7 +3446,7 @@ H5D_istore_stats (H5D_t *dset, hbool_t headers)
}
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_istore_stats() */
#endif /* H5D_ISTORE_DEBUG */
@@ -3471,13 +3468,13 @@ done:
*/
herr_t
H5D_istore_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int indent,
- int fwidth, int ndims)
+ int fwidth, unsigned ndims)
{
H5O_layout_t layout;
H5D_istore_ud1_t udata;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5D_istore_debug,FAIL);
+ FUNC_ENTER_NOAPI(H5D_istore_debug,FAIL)
layout.u.chunk.ndims = ndims;
HDmemset (&udata, 0, sizeof udata);
@@ -3487,12 +3484,12 @@ H5D_istore_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, int inden
if(H5D_istore_shared_create(f, &layout)<0)
HGOTO_ERROR (H5E_RESOURCE, H5E_CANTINIT, FAIL, "can't create wrapper for shared B-tree info")
- H5B_debug (f, dxpl_id, addr, stream, indent, fwidth, H5B_ISTORE, &udata);
+ (void)H5B_debug (f, dxpl_id, addr, stream, indent, fwidth, H5B_ISTORE, &udata);
/* Free the raw B-tree node buffer */
if(H5RC_DEC(layout.u.chunk.btree_shared)<0)
- HGOTO_ERROR (H5E_IO, H5E_CANTFREE, FAIL, "unable to decrement ref-counted page");
+ HGOTO_ERROR (H5E_IO, H5E_CANTFREE, FAIL, "unable to decrement ref-counted page")
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5D_istore_debug() */
diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c
index b96d32e..9d1f65c 100644
--- a/src/H5Dmpio.c
+++ b/src/H5Dmpio.c
@@ -39,16 +39,18 @@
#ifdef H5_HAVE_PARALLEL
-/* Interface initialization */
-#define INTERFACE_INIT NULL
-static int interface_initialize_g = 0;
-
static herr_t
H5D_mpio_spaces_xfer(H5D_io_info_t *io_info, size_t elmt_size,
const H5S_t *file_space, const H5S_t *mem_space,
void *buf/*out*/,
hbool_t do_write);
+
+static herr_t
+H5D_mpio_spaces_span_xfer(H5D_io_info_t *io_info, size_t elmt_size,
+ const H5S_t *file_space, const H5S_t *mem_space,
+ void *buf/*out*/,
+ hbool_t do_write);
/*-------------------------------------------------------------------------
* Function: H5D_mpio_opt_possible
@@ -89,13 +91,14 @@ H5D_mpio_opt_possible( const H5D_t *dset, const H5S_t *mem_space, const H5S_t *f
HGOTO_DONE(FALSE);
/* Check whether both selections are "regular" */
+#ifndef KYANG
c1=H5S_SELECT_IS_REGULAR(file_space);
c2=H5S_SELECT_IS_REGULAR(mem_space);
if(c1==FAIL || c2==FAIL)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "invalid check for single selection blocks");
if(c1==FALSE || c2==FALSE)
HGOTO_DONE(FALSE);
-
+#endif
/* Can't currently handle point selections */
if (H5S_SEL_POINTS==H5S_GET_SELECT_TYPE(mem_space) || H5S_SEL_POINTS==H5S_GET_SELECT_TYPE(file_space))
HGOTO_DONE(FALSE);
@@ -107,7 +110,7 @@ H5D_mpio_opt_possible( const H5D_t *dset, const H5S_t *mem_space, const H5S_t *f
if ((flags&H5S_CONV_STORAGE_MASK)==H5S_CONV_STORAGE_CHUNKED) {
hsize_t chunk_dim[H5O_LAYOUT_NDIMS]; /* Chunk dimensions */
- hssize_t startf[H5S_MAX_RANK], /* Selection start bounds */
+ hsize_t startf[H5S_MAX_RANK], /* Selection start bounds */
endf[H5S_MAX_RANK]; /* Selection end bounds */
unsigned dim_rankf; /* Number of dimensions of file dataspace */
int pcheck_hyper,check_hyper, /* Flags for checking if selection is in one chunk */
@@ -368,6 +371,129 @@ done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5D_mpio_spaces_xfer() */
+
+/** The following function has been tested, don't call this
+ function until you don't see this line. Nov. 11,2004, KY**/
+
+static herr_t
+H5D_mpio_spaces_span_xfer(H5D_io_info_t *io_info, size_t elmt_size,
+ const H5S_t *file_space, const H5S_t *mem_space,
+ void *_buf /*out*/, hbool_t do_write )
+{
+ haddr_t addr; /* Address of dataset (or selection) within file */
+ size_t mpi_buf_count, mpi_file_count; /* Number of "objects" to transfer */
+ hsize_t mpi_buf_offset, mpi_file_offset; /* Offset within dataset where selection (ie. MPI type) begins */
+ MPI_Datatype mpi_buf_type, mpi_file_type; /* MPI types for buffer (memory) and file */
+ hbool_t mbt_is_derived=0, /* Whether the buffer (memory) type is derived and needs to be free'd */
+ mft_is_derived=0; /* Whether the file type is derived and needs to be free'd */
+ hbool_t plist_is_setup=0; /* Whether the dxpl has been customized */
+ uint8_t *buf=(uint8_t *)_buf; /* Alias for pointer arithmetic */
+ int mpi_code; /* MPI return code */
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT(H5D_mpio_spaces_span_xfer);
+
+ /* Check args */
+ assert (io_info);
+ assert (io_info->dset);
+ assert (file_space);
+ assert (mem_space);
+ assert (buf);
+ assert (IS_H5FD_MPIO(io_info->dset->ent.file));
+ /* Make certain we have the correct type of property list */
+ assert(TRUE==H5P_isa_class(io_info->dxpl_id,H5P_DATASET_XFER));
+
+ printf("coming to span tree xfer \n");
+ /* create the MPI buffer type */
+ if(H5S_SELECT_IS_REGULAR(mem_space)==TRUE){
+ if (H5S_mpio_space_type( mem_space, elmt_size,
+ /* out: */
+ &mpi_buf_type,
+ &mpi_buf_count,
+ &mpi_buf_offset,
+ &mbt_is_derived )<0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't create MPI buf type");}
+ else {
+ if (H5S_mpio_space_span_type( mem_space, elmt_size,
+ /* out: */
+ &mpi_buf_type,
+ &mpi_buf_count,
+ &mpi_buf_offset,
+ &mbt_is_derived )<0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't create MPI buf type");
+ }
+ printf("mpi_buf_count %d\n",mpi_buf_count);
+ /* create the MPI file type */
+
+ if(H5S_SELECT_IS_REGULAR(file_space)== TRUE){
+ if ( H5S_mpio_space_type( file_space, elmt_size,
+ /* out: */
+ &mpi_file_type,
+ &mpi_file_count,
+ &mpi_file_offset,
+ &mft_is_derived )<0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't create MPI file type");
+ }
+ else {
+ if ( H5S_mpio_space_span_type( file_space, elmt_size,
+ /* out: */
+ &mpi_file_type,
+ &mpi_file_count,
+ &mpi_file_offset,
+ &mft_is_derived )<0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't create MPI file type");
+ }
+ /* Get the base address of the contiguous dataset or the chunk */
+ if(io_info->dset->shared->layout.type == H5D_CONTIGUOUS)
+ addr = H5D_contig_get_addr(io_info->dset) + mpi_file_offset;
+ else {
+ haddr_t chunk_addr; /* for collective chunk IO */
+
+ assert(io_info->dset->shared->layout.type == H5D_CHUNKED);
+ chunk_addr=H5D_istore_get_addr(io_info,NULL);
+ addr = H5F_BASE_ADDR(io_info->dset->ent.file) + chunk_addr + mpi_file_offset;
+ }
+
+ /*
+ * Pass buf type, file type to the file driver. Request an MPI type
+ * transfer (instead of an elementary byteblock transfer).
+ */
+ if(H5FD_mpi_setup_collective(io_info->dxpl_id, mpi_buf_type, mpi_file_type)<0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set MPI-I/O properties");
+ plist_is_setup=1;
+
+ /* Adjust the buffer pointer to the beginning of the selection */
+ buf+=mpi_buf_offset;
+
+ /* transfer the data */
+ if (do_write) {
+ if (H5F_block_write(io_info->dset->ent.file, H5FD_MEM_DRAW, addr, mpi_buf_count, io_info->dxpl_id, buf) <0)
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,"MPI write failed");
+ } else {
+ if (H5F_block_read (io_info->dset->ent.file, H5FD_MEM_DRAW, addr, mpi_buf_count, io_info->dxpl_id, buf) <0)
+ HGOTO_ERROR(H5E_IO, H5E_READERROR, FAIL,"MPI read failed");
+ }
+
+done:
+ /* Reset the dxpl settings */
+ if(plist_is_setup) {
+ if(H5FD_mpi_teardown_collective(io_info->dxpl_id)<0)
+ HDONE_ERROR(H5E_DATASPACE, H5E_CANTFREE, FAIL, "unable to reset dxpl values");
+ } /* end if */
+
+ /* free the MPI buf and file types */
+ if (mbt_is_derived) {
+ if (MPI_SUCCESS != (mpi_code= MPI_Type_free( &mpi_buf_type )))
+ HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code);
+ }
+ if (mft_is_derived) {
+ if (MPI_SUCCESS != (mpi_code= MPI_Type_free( &mpi_file_type )))
+ HMPI_DONE_ERROR(FAIL, "MPI_Type_free failed", mpi_code);
+ }
+
+ FUNC_LEAVE_NOAPI(ret_value);
+} /* end H5D_mpio_spaces_span_xfer() */
+
/*-------------------------------------------------------------------------
* Function: H5D_mpio_spaces_read
@@ -397,12 +523,11 @@ H5D_mpio_spaces_read(H5D_io_info_t *io_info,
{
herr_t ret_value;
- FUNC_ENTER_NOAPI(H5D_mpio_spaces_read, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5D_mpio_spaces_read);
ret_value = H5D_mpio_spaces_xfer(io_info, elmt_size, file_space,
mem_space, buf, 0/*read*/);
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5D_mpio_spaces_read() */
@@ -435,14 +560,97 @@ H5D_mpio_spaces_write(H5D_io_info_t *io_info,
{
herr_t ret_value;
- FUNC_ENTER_NOAPI(H5D_mpio_spaces_write, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5D_mpio_spaces_write);
/*OKAY: CAST DISCARDS CONST QUALIFIER*/
ret_value = H5D_mpio_spaces_xfer(io_info, elmt_size, file_space,
mem_space, (void*)buf, 1/*write*/);
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5D_mpio_spaces_write() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5D_mpio_spaces_span_read
+ *
+ * Purpose: MPI-IO function to read directly from app buffer to file for
+ span-tree
+ *
+ * Return: non-negative on success, negative on failure.
+ *
+ * Programmer: KY
+ * Note : Don't call this routine
+ * until you don't see this line. 11/11/2004, KY
+ *
+ * Modifications:
+ *
+ * rky 980918
+ * Added must_convert parameter to let caller know we can't optimize the xfer.
+ *
+ * QAK - 2002/04/02
+ * Removed the must_convert parameter and move preconditions to
+ * H5S_mpio_opt_possible() routine
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5D_mpio_spaces_span_read(H5D_io_info_t *io_info,
+ size_t UNUSED nelmts, size_t elmt_size,
+ const H5S_t *file_space, const H5S_t *mem_space,
+ void *buf/*out*/)
+{
+ herr_t ret_value;
+
+ FUNC_ENTER_NOAPI_NOFUNC(H5D_mpio_spaces_span_read);
+
+ ret_value = H5D_mpio_spaces_span_xfer(io_info, elmt_size, file_space,
+ mem_space, buf, 0/*read*/);
+
+ FUNC_LEAVE_NOAPI(ret_value);
+} /* end H5D_mpio_spaces_read() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5D_mpio_spaces_span_write
+ *
+ * Purpose: MPI-IO function to write directly from app buffer to file.
+ *
+ * Return: non-negative on success, negative on failure.
+ *
+ * Programmer: KY
+ * Note: Don't call this funtion until you don't see this line.
+ * KY, 11/11/04
+
+ *
+ * Modifications:
+ *
+ * rky 980918
+ * Added must_convert parameter to let caller know we can't optimize the xfer.
+ *
+ * QAK - 2002/04/02
+ * Removed the must_convert parameter and move preconditions to
+ * H5S_mpio_opt_possible() routine
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5D_mpio_spaces_span_write(H5D_io_info_t *io_info,
+ size_t UNUSED nelmts, size_t elmt_size,
+ const H5S_t *file_space, const H5S_t *mem_space,
+ const void *buf)
+{
+ herr_t ret_value;
+
+ FUNC_ENTER_NOAPI_NOFUNC(H5D_mpio_spaces_span_write);
+
+ printf(" coming to spaces_span_write function\n");
+ fflush(stdout);
+ /*OKAY: CAST DISCARDS CONST QUALIFIER*/
+ printf("element size %d\n",elmt_size);
+ ret_value = H5D_mpio_spaces_span_xfer(io_info, elmt_size, file_space,
+ mem_space, (void*)buf, 1/*write*/);
+
+ FUNC_LEAVE_NOAPI(ret_value);
+} /* end H5D_mpio_spaces_span_write() */
#endif /* H5_HAVE_PARALLEL */
diff --git a/src/H5Dpkg.h b/src/H5Dpkg.h
index 52664f3..a4b4574 100644
--- a/src/H5Dpkg.h
+++ b/src/H5Dpkg.h
@@ -78,11 +78,11 @@ typedef herr_t (*H5D_io_write_func_t)(struct H5D_io_info_t *io_info,
const void *buf);
/* Function pointers for I/O on particular types of dataset layouts */
-typedef ssize_t (*H5D_io_readvv_func_t)(struct H5D_io_info_t *io_info,
+typedef ssize_t (*H5D_io_readvv_func_t)(const struct H5D_io_info_t *io_info,
size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[],
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[],
void *buf);
-typedef ssize_t (*H5D_io_writevv_func_t)(struct H5D_io_info_t *io_info,
+typedef ssize_t (*H5D_io_writevv_func_t)(const struct H5D_io_info_t *io_info,
size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[],
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[],
const void *buf);
@@ -217,21 +217,21 @@ H5_DLL herr_t H5D_select_write(H5D_io_info_t *io_info,
H5_DLL herr_t H5D_contig_create(H5F_t *f, hid_t dxpl_id, H5O_layout_t *layout);
H5_DLL herr_t H5D_contig_fill(H5D_t *dset, hid_t dxpl_id);
H5_DLL haddr_t H5D_contig_get_addr(const H5D_t *dset);
-H5_DLL ssize_t H5D_contig_readvv(H5D_io_info_t *io_info,
+H5_DLL ssize_t H5D_contig_readvv(const H5D_io_info_t *io_info,
size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[],
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[],
void *buf);
-H5_DLL ssize_t H5D_contig_writevv(H5D_io_info_t *io_info,
+H5_DLL ssize_t H5D_contig_writevv(const H5D_io_info_t *io_info,
size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[],
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[],
const void *buf);
/* Functions that operate on compact dataset storage */
-H5_DLL ssize_t H5D_compact_readvv(H5D_io_info_t *io_info,
+H5_DLL ssize_t H5D_compact_readvv(const H5D_io_info_t *io_info,
size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[],
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[],
void *buf);
-H5_DLL ssize_t H5D_compact_writevv(H5D_io_info_t *io_info,
+H5_DLL ssize_t H5D_compact_writevv(const H5D_io_info_t *io_info,
size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_size_arr[], hsize_t dset_offset_arr[],
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_size_arr[], hsize_t mem_offset_arr[],
const void *buf);
@@ -239,14 +239,14 @@ H5_DLL ssize_t H5D_compact_writevv(H5D_io_info_t *io_info,
/* Functions that operate on indexed storage */
/* forward reference for collective-chunk IO use */
struct H5D_istore_ud1_t; /*define in H5Distore.c*/
-H5_DLL herr_t H5D_istore_init (const H5F_t *f, H5D_t *dset);
+H5_DLL herr_t H5D_istore_init (const H5F_t *f, const H5D_t *dset);
H5_DLL herr_t H5D_istore_flush (H5D_t *dset, hid_t dxpl_id, unsigned flags);
H5_DLL herr_t H5D_istore_create(H5F_t *f, hid_t dxpl_id, H5O_layout_t *layout);
H5_DLL herr_t H5D_istore_dest (H5D_t *dset, hid_t dxpl_id);
H5_DLL herr_t H5D_istore_allocate (H5D_t *dset, hid_t dxpl_id,
hbool_t full_overwrite);
H5_DLL hsize_t H5D_istore_allocated(H5D_t *dset, hid_t dxpl_id);
-H5_DLL herr_t H5D_istore_prune_by_extent(H5D_io_info_t *io_info);
+H5_DLL herr_t H5D_istore_prune_by_extent(const H5D_io_info_t *io_info);
H5_DLL herr_t H5D_istore_initialize_by_extent(H5D_io_info_t *io_info);
H5_DLL herr_t H5D_istore_update_cache(H5D_t *dset, hid_t dxpl_id);
H5_DLL herr_t H5D_istore_dump_btree(H5F_t *f, hid_t dxpl_id, FILE *stream, unsigned ndims,
@@ -254,23 +254,23 @@ H5_DLL herr_t H5D_istore_dump_btree(H5F_t *f, hid_t dxpl_id, FILE *stream, unsig
#ifdef H5D_ISTORE_DEBUG
H5_DLL herr_t H5D_istore_stats (H5D_t *dset, hbool_t headers);
#endif /* H5D_ISTORE_DEBUG */
-H5_DLL ssize_t H5D_istore_readvv(H5D_io_info_t *io_info,
+H5_DLL ssize_t H5D_istore_readvv(const H5D_io_info_t *io_info,
size_t chunk_max_nseq, size_t *chunk_curr_seq, size_t chunk_len_arr[], hsize_t chunk_offset_arr[],
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[],
void *buf);
-H5_DLL ssize_t H5D_istore_writevv(H5D_io_info_t *io_info,
+H5_DLL ssize_t H5D_istore_writevv(const H5D_io_info_t *io_info,
size_t chunk_max_nseq, size_t *chunk_curr_seq, size_t chunk_len_arr[], hsize_t chunk_offset_arr[],
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[],
const void *buf);
-H5_DLL haddr_t H5D_istore_get_addr(H5D_io_info_t *io_info,
+H5_DLL haddr_t H5D_istore_get_addr(const H5D_io_info_t *io_info,
struct H5D_istore_ud1_t *_udata);
/* Functions that operate on external file list (efl) storage */
-H5_DLL ssize_t H5D_efl_readvv(H5D_io_info_t *io_info,
+H5_DLL ssize_t H5D_efl_readvv(const H5D_io_info_t *io_info,
size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[],
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[],
void *buf);
-H5_DLL ssize_t H5D_efl_writevv(H5D_io_info_t *io_info,
+H5_DLL ssize_t H5D_efl_writevv(const H5D_io_info_t *io_info,
size_t dset_max_nseq, size_t *dset_curr_seq, size_t dset_len_arr[], hsize_t dset_offset_arr[],
size_t mem_max_nseq, size_t *mem_curr_seq, size_t mem_len_arr[], hsize_t mem_offset_arr[],
const void *buf);
@@ -288,6 +288,18 @@ H5_DLL herr_t H5D_mpio_spaces_write(H5D_io_info_t *io_info,
const struct H5S_t *file_space, const struct H5S_t *mem_space,
const void *buf);
+/* MPI-IO function to read directly from app buffer to file rky980813 */
+H5_DLL herr_t H5D_mpio_spaces_span_read(H5D_io_info_t *io_info,
+ size_t nelmts, size_t elmt_size,
+ const struct H5S_t *file_space, const struct H5S_t *mem_space,
+ void *buf/*out*/);
+
+/* MPI-IO function to write directly from app buffer to file rky980813 */
+H5_DLL herr_t H5D_mpio_spaces_span_write(H5D_io_info_t *io_info,
+ size_t nelmts, size_t elmt_size,
+ const struct H5S_t *file_space, const struct H5S_t *mem_space,
+ const void *buf);
+
/* MPI-IO function to check if a direct I/O transfer is possible between
* memory and the file */
H5_DLL htri_t H5D_mpio_opt_possible(const H5D_t *dset, const H5S_t *mem_space,
diff --git a/src/H5Dprivate.h b/src/H5Dprivate.h
index 82ba23c..d6708f1 100644
--- a/src/H5Dprivate.h
+++ b/src/H5Dprivate.h
@@ -174,7 +174,7 @@ typedef struct H5D_t H5D_t;
/* Typedef for dataset storage information */
typedef struct {
hsize_t index; /* "Index" of chunk in dataset (must be first for TBBT routines) */
- hssize_t *offset; /* Chunk's coordinates in elements */
+ hsize_t *offset; /* Chunk's coordinates in elements */
} H5D_chunk_storage_t;
typedef struct {
@@ -212,7 +212,7 @@ typedef struct H5D_dcpl_cache_t {
/* Library-private functions defined in H5D package */
H5_DLL herr_t H5D_init(void);
-H5_DLL H5D_t *H5D_open(H5G_entry_t *ent, hid_t dxpl_id);
+H5_DLL H5D_t *H5D_open(const H5G_entry_t *ent, hid_t dxpl_id);
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);
@@ -224,7 +224,7 @@ 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,
void *copy_data);
H5_DLL herr_t H5D_xfer_close(hid_t dxpl_id, void *close_data);
-H5_DLL herr_t H5D_flush(H5F_t *f, hid_t dxpl_id, unsigned flags);
+H5_DLL herr_t H5D_flush(const H5F_t *f, hid_t dxpl_id, unsigned flags);
H5_DLL herr_t H5D_get_dxpl_cache(hid_t dxpl_id, H5D_dxpl_cache_t **cache);
H5_DLL herr_t H5D_get_dxpl_cache_real(hid_t dxpl_id, H5D_dxpl_cache_t *cache);
@@ -236,6 +236,6 @@ H5_DLL herr_t H5D_contig_delete(H5F_t *f, hid_t dxpl_id,
H5_DLL herr_t H5D_istore_delete(H5F_t *f, hid_t dxpl_id,
const H5O_layout_t *layout);
H5_DLL herr_t H5D_istore_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream,
- int indent, int fwidth, int ndims);
+ int indent, int fwidth, unsigned ndims);
#endif
diff --git a/src/H5Dpublic.h b/src/H5Dpublic.h
index 5987b79..09556c2 100644
--- a/src/H5Dpublic.h
+++ b/src/H5Dpublic.h
@@ -70,8 +70,8 @@ extern "C" {
#endif
/* Define the operator function pointer for H5Diterate() */
-typedef herr_t (*H5D_operator_t)(void *elem, hid_t type_id, hsize_t ndim,
- hssize_t *point, void *operator_data);
+typedef herr_t (*H5D_operator_t)(void *elem, hid_t type_id, unsigned ndim,
+ const hsize_t *point, void *operator_data);
H5_DLL hid_t H5Dcreate (hid_t file_id, const char *name, hid_t type_id,
hid_t space_id, hid_t plist_id);
@@ -95,8 +95,8 @@ H5_DLL herr_t H5Dvlen_reclaim(hid_t type_id, hid_t space_id, hid_t plist_id, voi
H5_DLL herr_t H5Dvlen_get_buf_size(hid_t dataset_id, hid_t type_id, hid_t space_id, hsize_t *size);
H5_DLL herr_t H5Dfill(const void *fill, hid_t fill_type, void *buf,
hid_t buf_type, hid_t space);
-H5_DLL herr_t H5Ddebug(hid_t dset_id, unsigned int flags);
H5_DLL herr_t H5Dset_extent (hid_t dset_id, const hsize_t *size);
+H5_DLL herr_t H5Ddebug(hid_t dset_id);
#ifdef __cplusplus
diff --git a/src/H5Dselect.c b/src/H5Dselect.c
index a9b9228..a12823e 100644
--- a/src/H5Dselect.c
+++ b/src/H5Dselect.c
@@ -35,10 +35,6 @@ H5FL_SEQ_DEFINE_STATIC(size_t);
/* Declare a free list to manage sequences of hsize_t */
H5FL_SEQ_DEFINE_STATIC(hsize_t);
-/* Interface initialization */
-#define INTERFACE_INIT NULL
-static int interface_initialize_g = 0;
-
/*-------------------------------------------------------------------------
* Function: H5D_select_fscat
diff --git a/src/H5Dtest.c b/src/H5Dtest.c
index e22be5d..c155e95 100644
--- a/src/H5Dtest.c
+++ b/src/H5Dtest.c
@@ -30,10 +30,6 @@
#include "H5Eprivate.h" /* Error handling */
#include "H5Iprivate.h" /* ID Functions */
-/* Interface initialization */
-#define INTERFACE_INIT NULL
-static int interface_initialize_g = 0;
-
/*--------------------------------------------------------------------------
NAME
diff --git a/src/H5E.c b/src/H5E.c
index daf45ae..d0c5ea7 100644
--- a/src/H5E.c
+++ b/src/H5E.c
@@ -39,13 +39,19 @@
* errors within the H5E package.
*
*/
+
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5E_init_interface
+
+/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
+#define PABLO_MASK H5E_mask
+
#include "H5private.h" /* Generic Functions */
#include "H5Iprivate.h" /* IDs */
#include "H5Eprivate.h" /* Private error routines */
#include "H5MMprivate.h" /* Memory management */
-#define PABLO_MASK H5E_mask
-
static const H5E_major_mesg_t H5E_major_mesg_g[] = {
{H5E_NONE_MAJOR, "No error"},
{H5E_ARGS, "Function arguments"},
@@ -203,7 +209,6 @@ static const H5E_minor_mesg_t H5E_minor_mesg_g[] = {
/* Interface initialization? */
static int interface_initialize_g = 0;
#define INTERFACE_INIT H5E_init_interface
-static herr_t H5E_init_interface (void);
#ifdef H5_HAVE_THREADSAFE
/*
@@ -215,16 +220,16 @@ static herr_t H5E_init_interface (void);
* In order for this macro to work, H5E_get_my_stack() must be preceeded
* by "H5E_t *estack =".
*/
-H5E_t *H5E_get_stack(void);
+static H5E_t * H5E_get_stack(void);
#define H5E_get_my_stack() H5E_get_stack()
-#else
+#else /* H5_HAVE_THREADSAFE */
/*
- * The error stack. Eventually we'll have some sort of global table so each
- * thread has it's own stack. The stacks will be created on demand when the
- * thread first calls H5E_push(). */
+ * The current error stack.
+ */
H5E_t H5E_stack_g[1];
-#define H5E_get_my_stack() (H5E_stack_g+0)
-#endif
+#define H5E_get_my_stack() (H5E_stack_g+0)
+#endif /* H5_HAVE_THREADSAFE */
+
#ifdef H5_HAVE_PARALLEL
/*
@@ -244,9 +249,39 @@ void *H5E_auto_data_g = NULL;
/* Static function declarations */
+static herr_t H5E_walk (H5E_direction_t direction, H5E_walk_t func, void *client_data);
static herr_t H5E_walk_cb (int n, H5E_error_t *err_desc, void *client_data);
+/*-------------------------------------------------------------------------
+ * Function: H5E_init_interface
+ *
+ * Purpose: Initialize the H5E interface. `stderr' is an extern or
+ * function on some systems so we can't initialize
+ * H5E_auto_data_g statically.
+ *
+ * Return: Success: Non-negative
+ *
+ * Failure: Negative
+ *
+ * Programmer: Robb Matzke
+ * Friday, June 11, 1999
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5E_init_interface (void)
+{
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_init_interface)
+
+ H5E_auto_data_g = stderr;
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+}
+
+
#ifdef H5_HAVE_THREADSAFE
/*-------------------------------------------------------------------------
* Function: H5E_get_stack
@@ -265,15 +300,16 @@ static herr_t H5E_walk_cb (int n, H5E_error_t *err_desc, void *client_data);
*
*-------------------------------------------------------------------------
*/
-H5E_t *
+static H5E_t *
H5E_get_stack(void)
{
H5E_t *estack;
H5E_t *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5E_get_stack,NULL);
+ FUNC_ENTER_NOAPI(H5E_get_stack,NULL)
estack = pthread_getspecific(H5TS_errstk_key_g);
+
if (!estack) {
/* no associated value with current thread - create one */
estack = (H5E_t *)H5MM_malloc(sizeof(H5E_t));
@@ -284,41 +320,12 @@ H5E_get_stack(void)
ret_value=estack;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
#endif /* H5_HAVE_THREADSAFE */
/*-------------------------------------------------------------------------
- * Function: H5E_init_interface
- *
- * Purpose: Initialize the H5E interface. `stderr' is an extern or
- * function on some systems so we can't initialize
- * H5E_auto_data_g statically.
- *
- * Return: Success: Non-negative
- *
- * Failure: Negative
- *
- * Programmer: Robb Matzke
- * Friday, June 11, 1999
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5E_init_interface (void)
-{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_init_interface);
-
- H5E_auto_data_g = stderr;
-
- FUNC_LEAVE_NOAPI(SUCCEED);
-}
-
-
-/*-------------------------------------------------------------------------
* Function: H5Eset_auto
*
* Purpose: Turns on or off automatic printing of errors. When turned on
@@ -349,14 +356,14 @@ H5Eset_auto(H5E_auto_t func, void *client_data)
{
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_API(H5Eset_auto, FAIL);
+ FUNC_ENTER_API(H5Eset_auto, FAIL)
H5TRACE2("e","xx",func,client_data);
H5E_auto_g = func;
H5E_auto_data_g = client_data;
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -381,14 +388,14 @@ H5Eget_auto(H5E_auto_t *func, void **client_data)
{
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_API(H5Eget_auto, FAIL);
+ FUNC_ENTER_API(H5Eget_auto, FAIL)
H5TRACE2("e","*xx",func,client_data);
if (func) *func = H5E_auto_g;
if (client_data) *client_data = H5E_auto_data_g;
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -412,12 +419,12 @@ H5Eclear(void)
{
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_API(H5Eclear, FAIL);
+ FUNC_ENTER_API(H5Eclear, FAIL)
H5TRACE0("e","");
/* FUNC_ENTER() does all the work */
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -449,7 +456,7 @@ H5Eprint(FILE *stream)
herr_t ret_value = FAIL;
/* Don't clear the error stack! :-) */
- FUNC_ENTER_API_NOCLEAR(H5Eprint, FAIL);
+ FUNC_ENTER_API_NOCLEAR(H5Eprint, FAIL)
/*NO TRACE*/
if (!stream) stream = stderr;
@@ -475,7 +482,7 @@ H5Eprint(FILE *stream)
ret_value = H5E_walk (H5E_WALK_DOWNWARD, H5E_walk_cb, (void*)stream);
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -500,13 +507,13 @@ H5Ewalk(H5E_direction_t direction, H5E_walk_t func, void *client_data)
herr_t ret_value;
/* Don't clear the error stack! :-) */
- FUNC_ENTER_API_NOCLEAR(H5Ewalk, FAIL);
+ FUNC_ENTER_API_NOCLEAR(H5Ewalk, FAIL)
H5TRACE3("e","Edxx",direction,func,client_data);
ret_value = H5E_walk (direction, func, client_data);
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -551,7 +558,7 @@ H5E_walk_cb(int n, H5E_error_t *err_desc, void *client_data)
const char *min_str = NULL;
const int indent = 2;
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_walk_cb);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_walk_cb)
/*NO TRACE*/
/* Check arguments */
@@ -571,7 +578,7 @@ H5E_walk_cb(int n, H5E_error_t *err_desc, void *client_data)
fprintf (stream, "%*sminor(%02d): %s\n",
indent*2, "", err_desc->min_num, min_str);
- FUNC_LEAVE_NOAPI(SUCCEED);
+ FUNC_LEAVE_NOAPI(SUCCEED)
}
@@ -605,15 +612,14 @@ H5Eget_major (H5E_major_t n)
* traversal and adding/removing entries as the result of an
* error would most likely mess things up.
*/
- FUNC_ENTER_API_NOINIT(H5Eget_major);
+ FUNC_ENTER_API_NOINIT(H5Eget_major)
- for (i=0; i<NELMTS (H5E_major_mesg_g); i++) {
+ for (i=0; i<NELMTS (H5E_major_mesg_g); i++)
if (H5E_major_mesg_g[i].error_code==n)
- HGOTO_DONE(H5E_major_mesg_g[i].str);
- }
+ HGOTO_DONE(H5E_major_mesg_g[i].str)
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -647,15 +653,14 @@ H5Eget_minor (H5E_minor_t n)
* traversal and adding/removing entries as the result of an
* error would most likely mess things up.
*/
- FUNC_ENTER_API_NOINIT(H5Eget_minor);
+ FUNC_ENTER_API_NOINIT(H5Eget_minor)
- for (i=0; i<NELMTS (H5E_minor_mesg_g); i++) {
+ for (i=0; i<NELMTS (H5E_minor_mesg_g); i++)
if (H5E_minor_mesg_g[i].error_code==n)
- HGOTO_DONE(H5E_minor_mesg_g[i].str);
- }
+ HGOTO_DONE(H5E_minor_mesg_g[i].str)
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -694,7 +699,7 @@ H5E_push(H5E_major_t maj_num, H5E_minor_t min_num, const char *function_name,
* HERROR(). HERROR() is called by HRETURN_ERROR() which could
* be called by FUNC_ENTER().
*/
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_push);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5E_push)
/*
* Don't fail if arguments are bad. Instead, substitute some default
@@ -718,7 +723,7 @@ H5E_push(H5E_major_t maj_num, H5E_minor_t min_num, const char *function_name,
estack->nused++;
}
- FUNC_LEAVE_NOAPI(SUCCEED);
+ FUNC_LEAVE_NOAPI(SUCCEED)
}
@@ -750,13 +755,13 @@ H5Epush(const char *file, const char *func, unsigned line, H5E_major_t maj,
{
herr_t ret_value;
- FUNC_ENTER_API(H5Epush, FAIL);
+ FUNC_ENTER_API(H5Epush, FAIL)
H5TRACE6("e","ssIuEjEns",file,func,line,maj,min,str);
ret_value = H5E_push(maj, min, func, file, line, str);
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -780,12 +785,12 @@ H5E_clear(void)
H5E_t *estack = H5E_get_my_stack ();
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5E_clear, FAIL);
+ FUNC_ENTER_NOAPI(H5E_clear, FAIL)
if (estack) estack->nused = 0;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -815,7 +820,7 @@ done:
*
*-------------------------------------------------------------------------
*/
-herr_t
+static herr_t
H5E_walk (H5E_direction_t direction, H5E_walk_t func, void *client_data)
{
H5E_t *estack = H5E_get_my_stack ();
@@ -823,7 +828,7 @@ H5E_walk (H5E_direction_t direction, H5E_walk_t func, void *client_data)
herr_t status;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5E_walk, FAIL);
+ FUNC_ENTER_NOAPI(H5E_walk, FAIL)
/* check args, but rather than failing use some default value */
if (direction!=H5E_WALK_UPWARD && direction!=H5E_WALK_DOWNWARD) {
@@ -843,6 +848,6 @@ H5E_walk (H5E_direction_t direction, H5E_walk_t func, void *client_data)
}
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h
index ebfec54..df08fea 100644
--- a/src/H5Eprivate.h
+++ b/src/H5Eprivate.h
@@ -26,6 +26,27 @@
#define H5E_NSLOTS 32 /*number of slots in an error stack */
/*
+ * The list of error messages in the system is kept as an array of
+ * error_code/message pairs, one for major error numbers and another for
+ * minor error numbers.
+ */
+typedef struct H5E_major_mesg_t {
+ H5E_major_t error_code;
+ const char *str;
+} H5E_major_mesg_t;
+
+typedef struct H5E_minor_mesg_t {
+ H5E_minor_t error_code;
+ const char *str;
+} H5E_minor_mesg_t;
+
+/* An error stack */
+typedef struct H5E_t {
+ int nused; /*num slots currently used in stack */
+ H5E_error_t slot[H5E_NSLOTS]; /*array of error records */
+} H5E_t;
+
+/*
* HERROR macro, used to facilitate error reporting between a FUNC_ENTER()
* and a FUNC_LEAVE() within a function body. The arguments are the major
* error number, the minor error number, and a description of the error.
@@ -47,6 +68,8 @@
* "done:" label. The arguments are
* the major error number, the minor error number, a return value, and a
* description of the error.
+ * (This macro can also be used to push an error and set the return value
+ * without jumping to any labels)
*/
#define HDONE_ERROR(maj, min, ret_val, str) { \
HCOMMON_ERROR (maj, min, str); \
@@ -62,7 +85,7 @@
*/
#define HGOTO_ERROR(maj, min, ret_val, str) { \
HCOMMON_ERROR (maj, min, str); \
- HGOTO_DONE (ret_val); \
+ HGOTO_DONE (ret_val) \
}
/*
@@ -73,37 +96,15 @@
*/
#define HGOTO_DONE(ret_val) {ret_value = ret_val; goto done;}
-/*
- * The list of error messages in the system is kept as an array of
- * error_code/message pairs, one for major error numbers and another for
- * minor error numbers.
- */
-typedef struct H5E_major_mesg_t {
- H5E_major_t error_code;
- const char *str;
-} H5E_major_mesg_t;
-
-typedef struct H5E_minor_mesg_t {
- H5E_minor_t error_code;
- const char *str;
-} H5E_minor_mesg_t;
-
-/* An error stack */
-typedef struct H5E_t {
- int nused; /*num slots currently used in stack */
- H5E_error_t slot[H5E_NSLOTS]; /*array of error records */
-} H5E_t;
-
H5_DLLVAR const hbool_t H5E_clearable_g;/*safe to call H5E_clear() on enter?*/
H5_DLLVAR herr_t (*H5E_auto_g)(void *client_data);
H5_DLLVAR void *H5E_auto_data_g;
+/* Library-private functions defined in H5E package */
H5_DLL herr_t H5E_push (H5E_major_t maj_num, H5E_minor_t min_num,
const char *func_name, const char *file_name,
unsigned line, const char *desc);
H5_DLL herr_t H5E_clear (void);
-H5_DLL herr_t H5E_walk (H5E_direction_t dir, H5E_walk_t func,
- void *client_data);
#ifdef H5_HAVE_PARALLEL
/*
diff --git a/src/H5F.c b/src/H5F.c
index c68c83b..85d5c99 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -14,6 +14,9 @@
#define H5F_PACKAGE /*suppress error about including H5Fpkg */
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5F_init_interface
+
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
#define PABLO_MASK H5F_mask
@@ -45,11 +48,6 @@
#include "H5FDstdio.h" /* Standard C buffered I/O */
#include "H5FDstream.h" /*in-memory files streamed via sockets */
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT H5F_init_interface
-static herr_t H5F_init_interface(void);
-
/* Struct only used by functions H5F_get_objects and H5F_get_objects_cb */
typedef struct H5F_olist_t {
H5I_type_t obj_type; /* Type of object to look for */
@@ -64,13 +62,16 @@ typedef struct H5F_olist_t {
static H5F_t *H5F_open(const char *name, unsigned flags, hid_t fcpl_id,
hid_t fapl_id, hid_t dxpl_id);
static herr_t H5F_close(H5F_t *f);
-static herr_t H5F_close_all(void);
#ifdef NOT_YET
static herr_t H5F_flush_all(hbool_t invalidate);
static int H5F_flush_all_cb(void *f, hid_t fid, void *_invalidate);
#endif /* NOT_YET */
+static herr_t H5F_init_superblock(const H5F_t *f, hid_t dxpl_id);
+static herr_t H5F_write_superblock(H5F_t *f, hid_t dxpl_id);
+static herr_t H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent);
+
static H5F_t *H5F_new(H5F_file_t *shared, hid_t fcpl_id, hid_t fapl_id);
static herr_t H5F_dest(H5F_t *f, hid_t dxpl_id);
static herr_t H5F_flush(H5F_t *f, hid_t dxpl_id, H5F_scope_t scope, unsigned flags);
@@ -85,9 +86,6 @@ H5FL_DEFINE_STATIC(H5F_t);
/* Declare a free list to manage the H5F_file_t struct */
H5FL_DEFINE_STATIC(H5F_file_t);
-/* Declare the external free list for the H5G_t struct */
-H5FL_EXTERN(H5G_t);
-
/*-------------------------------------------------------------------------
* Function: H5F_init
@@ -426,13 +424,13 @@ H5F_term_interface(void)
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_term_interface)
- if (interface_initialize_g) {
- if ((n=H5I_nmembers(H5I_FILE))) {
- H5F_close_all();
+ if (H5_interface_initialize_g) {
+ if ((n=H5I_nmembers(H5I_FILE))!=0) {
+ H5I_clear_group(H5I_FILE, FALSE);
} else if (0==(n=H5I_nmembers(H5I_FILE_CLOSING))) {
H5I_destroy_group(H5I_FILE);
H5I_destroy_group(H5I_FILE_CLOSING);
- interface_initialize_g = 0;
+ H5_interface_initialize_g = 0;
n = 1; /*H5I*/
}
}
@@ -652,39 +650,6 @@ done:
}
#endif /* NOT_YET */
-
-/*-------------------------------------------------------------------------
- * Function: H5F_close_all
- *
- * Purpose: Close all open files. Any file which has open object headers
- * will be moved from the H5I_FILE group to the H5I_FILE_CLOSING
- * group.
- *
- * Return: Success: Non-negative
- *
- * Failure: Negative
- *
- * Programmer: Robb Matzke
- * Friday, February 19, 1999
- *
- * Modifications:
- *
- *-------------------------------------------------------------------------
- */
-static herr_t
-H5F_close_all(void)
-{
- herr_t ret_value=SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(H5F_close_all, FAIL);
-
- if (H5I_clear_group(H5I_FILE, FALSE)<0)
- HGOTO_ERROR(H5E_FILE, H5E_CLOSEERROR, FAIL, "unable to close one or more files");
-
-done:
- FUNC_LEAVE_NOAPI(ret_value);
-}
-
#ifdef NOT_YET
/*--------------------------------------------------------------------------
@@ -1595,7 +1560,10 @@ H5F_dest(H5F_t *f, hid_t dxpl_id)
} /* end if */
/* Free the memory for the root group */
- H5G_free(f->shared->root_grp);
+ if(H5G_free(f->shared->root_grp)<0) {
+ HERROR(H5E_FILE, H5E_CANTRELEASE, "problems closing file");
+ ret_value = FAIL; /*but keep going*/
+ } /* end if */
f->shared->root_grp=NULL;
}
if (H5AC_dest(f, dxpl_id)) {
@@ -1734,37 +1702,16 @@ done:
static H5F_t *
H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t dxpl_id)
{
- H5F_t *file=NULL; /*the success return value */
- H5F_t *ret_value; /*actual return value */
- H5F_file_t *shared=NULL; /*shared part of `file' */
- H5FD_t *lf=NULL; /*file driver part of `shared' */
- uint8_t buf[256]; /*temporary I/O buffer */
- const uint8_t *p; /*ptr into temp I/O buffer */
- uint8_t *q; /*ptr into temp I/O buffer */
- size_t fixed_size=24; /*fixed sizeof superblock */
- size_t variable_size; /*variable sizeof superblock */
- size_t driver_size; /*size of driver info block */
- H5G_entry_t root_ent; /*root symbol table entry */
- haddr_t eof; /*end of file address */
- haddr_t stored_eoa; /*relative end-of-addr in file */
- unsigned tent_flags; /*tentative flags */
- char driver_name[9]; /*file driver name/version */
- H5FD_class_t *drvr; /* File driver class info */
- hbool_t driver_has_cmp; /*`cmp' callback defined? */
- hsize_t userblock_size = 0;
- unsigned super_vers; /* Superblock version # */
- unsigned freespace_vers; /* File freespace version # */
- unsigned obj_dir_vers;
- unsigned share_head_vers;
- size_t sizeof_addr = 0;
- size_t sizeof_size = 0;
- unsigned sym_leaf_k = 0;
- unsigned btree_k[H5B_NUM_BTREE_ID]; /* B-tree internal node 'K' values */
- H5P_genplist_t *c_plist; /* File creation property list */
- H5P_genplist_t *a_plist; /* File access property list */
- H5F_close_degree_t fc_degree; /* File close degree */
- unsigned chksum; /* Checksum temporary variable */
- unsigned i; /* Index variable */
+ H5F_t *file = NULL; /*the success return value */
+ H5F_file_t *shared = NULL; /*shared part of `file' */
+ H5FD_t *lf = NULL; /*file driver part of `shared' */
+ H5G_entry_t root_ent; /*root symbol table entry */
+ unsigned tent_flags; /*tentative flags */
+ H5FD_class_t *drvr; /*file driver class info */
+ hbool_t driver_has_cmp; /*`cmp' callback defined? */
+ H5P_genplist_t *a_plist; /*file access property list */
+ H5F_close_degree_t fc_degree; /*file close degree */
+ H5F_t *ret_value; /*actual return value */
FUNC_ENTER_NOAPI(H5F_open, NULL)
@@ -1807,8 +1754,8 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d
} /* end if */
/* Is the file already open? */
- if ((file=H5I_search(H5I_FILE, H5F_equal, lf)) ||
- (file=H5I_search(H5I_FILE_CLOSING, H5F_equal, lf))) {
+ if ((file=H5I_search(H5I_FILE, H5F_equal, lf))!=NULL ||
+ (file=H5I_search(H5I_FILE_CLOSING, H5F_equal, lf))!=NULL) {
/*
* The file is already open, so use that one instead of the one we
* just opened. We only one one H5FD_t* per file so one doesn't
@@ -1882,10 +1829,6 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d
file->intent = flags;
file->name = H5MM_xstrdup(name);
- /* Get the shared file creation property list */
- if(NULL == (c_plist = H5I_object(shared->fcpl_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "can't get property list");
-
/*
* Read or write the file superblock, depending on whether the file is
* empty or not.
@@ -1896,232 +1839,29 @@ H5F_open(const char *name, unsigned flags, hid_t fcpl_id, hid_t fapl_id, hid_t d
* to create & write the superblock.
*/
- /*
- * The superblock starts immediately after the user-defined header,
- * which we have already insured is a proper size. The base address
- * is set to the same thing as the superblock for now.
- */
- if(H5P_get(c_plist, H5F_CRT_USER_BLOCK_NAME, &userblock_size) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTGET, NULL, "unable to get user block size");
- shared->super_addr = userblock_size;
- shared->base_addr = shared->super_addr;
- shared->consist_flags = 0x03;
-
- if (H5F_flush(file, dxpl_id, H5F_SCOPE_LOCAL, H5F_FLUSH_ALLOC_ONLY) < 0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to write file superblock");
+ /* Initialize information about the superblock and allocate space for it */
+ if (H5F_init_superblock(file, dxpl_id)<0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to allocate file superblock")
/* Create and open the root group */
if (H5G_mkroot(file, dxpl_id, NULL)<0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to create/open root group");
+ HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to create/open root group")
- } else if (1==shared->nrefs) {
- /* Read the superblock if it hasn't been read before. */
- if (HADDR_UNDEF==(shared->super_addr=H5F_locate_signature(lf,dxpl_id)))
- HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, NULL, "unable to find file signature");
- if (H5FD_set_eoa(lf, shared->super_addr+fixed_size)<0 ||
- H5FD_read(lf, H5FD_MEM_SUPER, dxpl_id, shared->super_addr, fixed_size, buf)<0)
- HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "unable to read superblock");
-
- /* Signature, already checked */
- p = buf + H5F_SIGNATURE_LEN;
-
- /* Superblock version */
- super_vers = *p++;
- if(super_vers>HDF5_SUPERBLOCK_VERSION_MAX)
- HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "bad superblock version number");
- if(H5P_set(c_plist, H5F_CRT_SUPER_VERS_NAME, &super_vers) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, NULL, "unable to set superblock version");
-
- /* Freespace version */
- freespace_vers = *p++;
- if(HDF5_FREESPACE_VERSION != freespace_vers)
- HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "bad free space version number");
- if(H5P_set(c_plist, H5F_CRT_FREESPACE_VERS_NAME, &freespace_vers)<0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, NULL, "unable to free space version");
-
- /* Root group version number */
- obj_dir_vers = *p++;
- if(HDF5_OBJECTDIR_VERSION != obj_dir_vers)
- HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "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, NULL, "unable to set object directory version");
-
- /* Skip over reserved byte */
- p++;
-
- /* Shared header version number */
- share_head_vers = *p++;
- if(HDF5_SHAREDHEADER_VERSION != share_head_vers)
- HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "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, NULL, "unable to set shared-header format version");
-
- /* Size of file addresses */
- sizeof_addr = *p++;
- if (sizeof_addr != 2 && sizeof_addr != 4 &&
- sizeof_addr != 8 && sizeof_addr != 16 && sizeof_addr != 32)
- HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "bad byte number in an address");
- if(H5P_set(c_plist, H5F_CRT_ADDR_BYTE_NUM_NAME,&sizeof_addr)<0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, NULL, "unable to set byte number in an address");
- shared->sizeof_addr=sizeof_addr; /* Keep a local copy also */
-
- /* Size of file sizes */
- sizeof_size = *p++;
- if (sizeof_size != 2 && sizeof_size != 4 &&
- sizeof_size != 8 && sizeof_size != 16 && sizeof_size != 32)
- HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, NULL, "bad byte number for object size");
- if(H5P_set(c_plist, H5F_CRT_OBJ_BYTE_NUM_NAME, &sizeof_size)<0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, NULL, "unable to set byte number for object size");
- shared->sizeof_size=sizeof_size; /* Keep a local copy also */
-
- /* Skip over reserved byte */
- p++;
-
- /* Various B-tree sizes */
- UINT16DECODE(p, sym_leaf_k);
- if(sym_leaf_k < 1)
- HGOTO_ERROR(H5E_FILE, H5E_BADRANGE, NULL, "bad symbol table leaf node 1/2 rank");
- if(H5P_set(c_plist, H5F_CRT_SYM_LEAF_NAME, &sym_leaf_k)<0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, NULL, "unable to set rank for symbol table leaf nodes");
- shared->sym_leaf_k=sym_leaf_k; /* Keep a local copy also */
-
- /* Need 'get' call to set other array values */
- if(H5P_get(c_plist, H5F_CRT_BTREE_RANK_NAME, btree_k)<0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "unable to get rank for btree internal nodes");
- UINT16DECODE(p, btree_k[H5B_SNODE_ID]);
- if(btree_k[H5B_SNODE_ID] < 1)
- HGOTO_ERROR(H5E_FILE, H5E_BADRANGE, NULL, "bad 1/2 rank for btree internal nodes");
- /* Delay setting the value in the property list until we've checked for
- * the indexed storage B-tree internal 'K' value later.
- */
-
- /* File consistency flags. Not really used yet */
- UINT32DECODE(p, shared->consist_flags);
- assert((hsize_t)(p-buf) == fixed_size);
-
- /* Decode the variable-length part of the superblock... */
- variable_size = (super_vers>0 ? 4 : 0) + /* Potential indexed storage B-tree internal 'K' value */
- H5F_SIZEOF_ADDR(file) + /*base addr*/
- H5F_SIZEOF_ADDR(file) + /*global free list*/
- H5F_SIZEOF_ADDR(file) + /*end-of-address*/
- H5F_SIZEOF_ADDR(file) + /*reserved address*/
- H5G_SIZEOF_ENTRY(file); /*root group ptr*/
- assert((fixed_size+variable_size)<=sizeof(buf));
- if (H5FD_set_eoa(lf, shared->super_addr+fixed_size+variable_size)<0 ||
- H5FD_read(lf, H5FD_MEM_SUPER, dxpl_id, shared->super_addr+fixed_size, variable_size, &buf[fixed_size])<0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to read superblock");
-
- /* If the superblock version # is greater than 0, read in the indexed storage B-tree internal 'K' value */
- if(super_vers>0) {
- UINT16DECODE(p, btree_k[H5B_ISTORE_ID]);
-
- /* Skip over reserved bytes */
- p+=2;
- } /* end if */
- else
- btree_k[H5B_ISTORE_ID]=HDF5_BTREE_ISTORE_IK_DEF;
-
- /* Set the B-tree internal node values, etc */
- if(H5P_set(c_plist, H5F_CRT_BTREE_RANK_NAME, btree_k)<0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, NULL, "unable to set rank for btree internal nodes");
- HDmemcpy(shared->btree_k,btree_k,sizeof(unsigned)*H5B_NUM_BTREE_ID); /* Keep a local copy also */
-
- H5F_addr_decode(file, &p, &(shared->base_addr)/*out*/);
- H5F_addr_decode(file, &p, &(shared->freespace_addr)/*out*/);
- H5F_addr_decode(file, &p, &stored_eoa/*out*/);
- H5F_addr_decode(file, &p, &(shared->driver_addr)/*out*/);
- if (H5G_ent_decode(file, &p, &root_ent/*out*/)<0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to read root symbol entry");
-
- /* Check if superblock address is different from base address and
- * adjust base address and "end of address" address if so.
+ /* Write the superblock to the file */
+ /* (This must be after the root group is created, since the root
+ * group's symbol table entry is part of the superblock)
*/
- if(!H5F_addr_eq(shared->super_addr,shared->base_addr)) {
- /* Check if the superblock moved earlier in the file */
- if(H5F_addr_lt(shared->super_addr,shared->base_addr))
- stored_eoa -= (shared->base_addr-shared->super_addr);
- /* The superblock moved later in the file */
- else
- stored_eoa += (shared->super_addr-shared->base_addr);
- shared->base_addr = shared->super_addr;
- } /* end if */
-
- /* Compute super block checksum */
- assert(sizeof(chksum)==sizeof(shared->super_chksum));
- for(q=(uint8_t *)&chksum, chksum=0, i=0; i<(fixed_size+variable_size); i++)
- q[i%sizeof(shared->super_chksum)] ^= buf[i];
-
- /* Set the super block checksum */
- shared->super_chksum=chksum;
-
- /* Decode the optional driver information block */
- if (H5F_addr_defined(shared->driver_addr)) {
- haddr_t drv_addr = shared->base_addr + shared->driver_addr;
+ if (H5F_write_superblock(file, dxpl_id) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, NULL, "unable to write file superblock")
- if (H5FD_set_eoa(lf, drv_addr+16)<0 ||
- H5FD_read(lf, H5FD_MEM_SUPER, dxpl_id, drv_addr, 16, buf)<0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to read driver information block");
- p = buf;
-
- /* Version number */
- if (HDF5_DRIVERINFO_VERSION!=*p++)
- HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "bad driver information block version number");
-
- /* Reserved */
- p += 3;
-
- /* Driver info size */
- UINT32DECODE(p, driver_size);
-
- /* Driver name and/or version */
- HDstrncpy(driver_name, (const char *)p, 8);
- driver_name[8] = '\0';
-
- /* Read driver information and decode */
- assert((driver_size+16)<=sizeof(buf));
- if (H5FD_set_eoa(lf, drv_addr+16+driver_size)<0 ||
- H5FD_read(lf, H5FD_MEM_SUPER, dxpl_id, drv_addr+16, driver_size, &buf[16])<0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to read file driver information");
- if (H5FD_sb_decode(lf, driver_name, &buf[16])<0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to decode driver information");
-
- /* Compute driver info block checksum */
- assert(sizeof(chksum)==sizeof(shared->drvr_chksum));
- for(q=(uint8_t *)&chksum, chksum=0, i=0; i<(driver_size+16); i++)
- q[i%sizeof(shared->drvr_chksum)] ^= buf[i];
-
- /* Set the driver info block checksum */
- shared->drvr_chksum=chksum;
+ } else if (1 == shared->nrefs) {
+ /* Read the superblock if it hasn't been read before. */
+ if (H5F_read_superblock(file, dxpl_id, &root_ent) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_READERROR, NULL, "unable to read superblock")
- } /* end if */
-
/* Make sure we can open the root group */
if (H5G_mkroot(file, dxpl_id, &root_ent)<0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to read root group");
-
- /*
- * The user-defined data is the area of the file before the base
- * address.
- */
- if(H5P_set(c_plist, H5F_CRT_USER_BLOCK_NAME, &(shared->base_addr)) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, NULL, "unable to set usr block size");
-
- /*
- * Make sure that the data is not truncated. One case where this is
- * possible is if the first file of a family of files was opened
- * individually.
- */
- if (HADDR_UNDEF==(eof=H5FD_get_eof(lf)))
- HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to determine file size");
- if (eof<stored_eoa)
- HGOTO_ERROR(H5E_FILE, H5E_TRUNCATED, NULL, "truncated file");
-
- /*
- * Tell the file driver how much address space has already been
- * allocated so that it knows how to allocate additional memory.
- */
- if (H5FD_set_eoa(lf, stored_eoa)<0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to set end-of-address marker for file");
+ HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, NULL, "unable to read root group")
}
/*
@@ -2443,6 +2183,537 @@ done:
/*-------------------------------------------------------------------------
+ * Function: H5F_read_superblock
+ *
+ * Purpose: Reads the superblock from the file or from the BUF. If
+ * ADDR is a valid address, then it reads it from the file.
+ * If not, then BUF must be non-NULL for it to read from the
+ * BUF.
+ *
+ * Return: Success: SUCCEED
+ * Failure: FAIL
+ *
+ * Programmer: Bill Wendling
+ * wendling@ncsa.uiuc.edu
+ * Sept 12, 2003
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5F_read_superblock(H5F_t *f, hid_t dxpl_id, H5G_entry_t *root_ent)
+{
+ haddr_t stored_eoa; /*relative end-of-addr in file */
+ haddr_t eof; /*end of file address */
+ uint8_t *q; /*ptr into temp I/O buffer */
+ size_t sizeof_addr = 0;
+ size_t sizeof_size = 0;
+ const size_t fixed_size = 24; /*fixed sizeof superblock */
+ unsigned sym_leaf_k = 0;
+ size_t variable_size; /*variable sizeof superblock */
+ unsigned btree_k[H5B_NUM_BTREE_ID]; /* B-tree internal node 'K' values */
+ H5F_file_t *shared = NULL; /* shared part of `file' */
+ H5FD_t *lf = NULL; /* file driver part of `shared' */
+ uint8_t *p; /* Temporary pointer into encoding buffers */
+ unsigned i; /* Index variable */
+ unsigned chksum; /* Checksum temporary variable */
+ size_t driver_size; /* Size of driver info block, in bytes */
+ char driver_name[9]; /* Name of driver, for driver info block */
+ unsigned super_vers; /* Super block version */
+ unsigned freespace_vers; /* Freespace info version */
+ unsigned obj_dir_vers; /* Object header info version */
+ unsigned share_head_vers; /* Shared header info version */
+ uint8_t buf[H5F_SUPERBLOCK_SIZE]; /* Local buffer */
+ H5P_genplist_t *c_plist; /* File creation property list */
+ herr_t ret_value = SUCCEED;
+
+ /* Decoding */
+ FUNC_ENTER_NOAPI(H5F_read_superblock, FAIL)
+
+ /* Short cuts */
+ shared = f->shared;
+ lf = shared->lf;
+
+ /* Get the shared file creation property list */
+ if (NULL == (c_plist = H5I_object(shared->fcpl_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "can't get property list")
+
+ /* Read the superblock if it hasn't been read before. */
+ if (HADDR_UNDEF == (shared->super_addr=H5F_locate_signature(lf,dxpl_id)))
+ HGOTO_ERROR(H5E_FILE, H5E_NOTHDF5, FAIL, "unable to find file signature")
+ if (H5FD_set_eoa(lf, shared->super_addr + fixed_size) < 0 ||
+ H5FD_read(lf, H5FD_MEM_SUPER, dxpl_id, shared->super_addr, fixed_size, buf) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_READERROR, FAIL, "unable to read superblock")
+
+ /* Signature, already checked */
+ p = buf + H5F_SIGNATURE_LEN;
+
+ /* Superblock version */
+ super_vers = *p++;
+ 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)
+ 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)
+ 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")
+
+ /* Skip over reserved byte */
+ p++;
+
+ /* Shared header version number */
+ share_head_vers = *p++;
+ 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")
+
+ /* Size of file addresses */
+ sizeof_addr = *p++;
+ if (sizeof_addr != 2 && sizeof_addr != 4 &&
+ sizeof_addr != 8 && sizeof_addr != 16 && sizeof_addr != 32)
+ HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "bad byte number in an address")
+ if (H5P_set(c_plist, H5F_CRT_ADDR_BYTE_NUM_NAME,&sizeof_addr) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set byte number in an address")
+ shared->sizeof_addr = sizeof_addr; /* Keep a local copy also */
+
+ /* Size of file sizes */
+ sizeof_size = *p++;
+ if (sizeof_size != 2 && sizeof_size != 4 &&
+ sizeof_size != 8 && sizeof_size != 16 && sizeof_size != 32)
+ HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "bad byte number for object size")
+ 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++;
+
+ /* Various B-tree sizes */
+ UINT16DECODE(p, sym_leaf_k);
+ if (sym_leaf_k == 0)
+ HGOTO_ERROR(H5E_FILE, H5E_BADRANGE, FAIL, "bad symbol table leaf node 1/2 rank")
+ if (H5P_set(c_plist, H5F_CRT_SYM_LEAF_NAME, &sym_leaf_k) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set rank for symbol table leaf nodes")
+ shared->sym_leaf_k = sym_leaf_k; /* Keep a local copy also */
+
+ /* Need 'get' call to set other array values */
+ if (H5P_get(c_plist, H5F_CRT_BTREE_RANK_NAME, btree_k) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get rank for btree internal nodes")
+ UINT16DECODE(p, btree_k[H5B_SNODE_ID]);
+ if (btree_k[H5B_SNODE_ID] == 0)
+ HGOTO_ERROR(H5E_FILE, H5E_BADRANGE, FAIL, "bad 1/2 rank for btree internal nodes")
+ /*
+ * Delay setting the value in the property list until we've checked
+ * for the indexed storage B-tree internal 'K' value later.
+ */
+
+ /* File consistency flags. Not really used yet */
+ UINT32DECODE(p, shared->consist_flags);
+ assert(((size_t)(p - buf)) == fixed_size);
+
+ /* Decode the variable-length part of the superblock... */
+ variable_size = (super_vers>0 ? 4 : 0) + /* Potential indexed storage B-tree internal 'K' value */
+ H5F_SIZEOF_ADDR(f) + /*base addr*/
+ H5F_SIZEOF_ADDR(f) + /*global free list*/
+ H5F_SIZEOF_ADDR(f) + /*end-of-address*/
+ H5F_SIZEOF_ADDR(f) + /*reserved address*/
+ H5G_SIZEOF_ENTRY(f); /*root group ptr*/
+ assert(fixed_size + variable_size <= sizeof(buf));
+ if (H5FD_set_eoa(lf, shared->super_addr + fixed_size+variable_size) < 0 ||
+ H5FD_read(lf, H5FD_MEM_SUPER, dxpl_id, shared->super_addr + fixed_size, variable_size, p) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to read superblock")
+
+ /*
+ * If the superblock version # is greater than 0, read in the indexed
+ * storage B-tree internal 'K' value
+ */
+ if (super_vers > 0) {
+ UINT16DECODE(p, btree_k[H5B_ISTORE_ID]);
+ p += 2; /* reserved */
+ }
+ else
+ btree_k[H5B_ISTORE_ID] = HDF5_BTREE_ISTORE_IK_DEF;
+
+ /* Set the B-tree internal node values, etc */
+ if (H5P_set(c_plist, H5F_CRT_BTREE_RANK_NAME, btree_k) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set rank for btree internal nodes")
+ HDmemcpy(shared->btree_k, btree_k, sizeof(unsigned) * (size_t)H5B_NUM_BTREE_ID); /* Keep a local copy also */
+
+ H5F_addr_decode(f, (const uint8_t **)&p, &shared->base_addr/*out*/);
+ H5F_addr_decode(f, (const uint8_t **)&p, &shared->freespace_addr/*out*/);
+ H5F_addr_decode(f, (const uint8_t **)&p, &stored_eoa/*out*/);
+ H5F_addr_decode(f, (const uint8_t **)&p, &shared->driver_addr/*out*/);
+ if (H5G_ent_decode(f, (const uint8_t **)&p, root_ent/*out*/) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to read root symbol entry")
+
+ /*
+ * Check if superblock address is different from base address and
+ * adjust base address and "end of address" address if so.
+ */
+ if (!H5F_addr_eq(shared->super_addr,shared->base_addr)) {
+ /* Check if the superblock moved earlier in the file */
+ if (H5F_addr_lt(shared->super_addr, shared->base_addr))
+ stored_eoa -= (shared->base_addr - shared->super_addr);
+ else
+ /* The superblock moved later in the file */
+ stored_eoa += (shared->super_addr - shared->base_addr);
+
+ shared->base_addr = shared->super_addr;
+ } /* end if */
+
+ /* Compute super block checksum */
+ assert(sizeof(chksum) == sizeof(shared->super_chksum));
+ for (q = (uint8_t *)&chksum, chksum = 0, i = 0; i < fixed_size + variable_size; ++i)
+ q[i % sizeof(shared->super_chksum)] ^= buf[i];
+
+ /* Set the super block checksum */
+ shared->super_chksum = chksum;
+
+ /* Decode the optional driver information block */
+ if (H5F_addr_defined(shared->driver_addr)) {
+ haddr_t drv_addr = shared->base_addr + shared->driver_addr;
+ uint8_t dbuf[H5F_DRVINFOBLOCK_SIZE]; /* Local buffer */
+
+ if (H5FD_set_eoa(lf, drv_addr + 16) < 0 ||
+ H5FD_read(lf, H5FD_MEM_SUPER, dxpl_id, drv_addr, 16, dbuf) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to read driver information block")
+ p = dbuf;
+
+ /* Version number */
+ if (HDF5_DRIVERINFO_VERSION != *p++)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "bad driver information block version number")
+
+ p += 3; /* reserved */
+
+ /* Driver info size */
+ UINT32DECODE(p, driver_size);
+
+ /* Driver name and/or version */
+ HDstrncpy(driver_name, (const char *)p, 8);
+ driver_name[8] = '\0';
+ p += 8; /* advance past name/version */
+
+ /* Read driver information and decode */
+ assert((driver_size + 16) <= sizeof(dbuf));
+ if (H5FD_set_eoa(lf, drv_addr + 16 + driver_size) < 0 ||
+ H5FD_read(lf, H5FD_MEM_SUPER, dxpl_id, drv_addr+16, driver_size, p) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to read file driver information")
+
+ if (H5FD_sb_decode(lf, driver_name, p) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to decode driver information")
+
+ /* Compute driver info block checksum */
+ assert(sizeof(chksum) == sizeof(shared->drvr_chksum));
+ for (q = (uint8_t *)&chksum, chksum = 0, i = 0; i < (driver_size + 16); ++i)
+ q[i % sizeof(shared->drvr_chksum)] ^= dbuf[i];
+
+ /* 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.
+ */
+ if (H5P_set(c_plist, H5F_CRT_USER_BLOCK_NAME, &shared->base_addr) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "unable to set usr block size")
+
+ /*
+ * Make sure that the data is not truncated. One case where this is
+ * possible is if the first file of a family of files was opened
+ * individually.
+ */
+ if (HADDR_UNDEF == (eof = H5FD_get_eof(lf)))
+ HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to determine file size")
+ if (eof < stored_eoa)
+ HGOTO_ERROR(H5E_FILE, H5E_TRUNCATED, FAIL, "truncated file")
+
+ /*
+ * Tell the file driver how much address space has already been
+ * allocated so that it knows how to allocate additional memory.
+ */
+ if (H5FD_set_eoa(lf, stored_eoa) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTOPENFILE, FAIL, "unable to set end-of-address marker for file")
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+}
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5F_init_superblock
+ *
+ * Purpose: Allocates the superblock for the file and initializes
+ * information about the superblock in memory. Does not write
+ * any superblock information to the file.
+ *
+ * Return: Success: SUCCEED
+ * Failure: FAIL
+ *
+ * Programmer: Quincey Koziol
+ * koziol@ncsa.uiuc.edu
+ * Sept 15, 2003
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5F_init_superblock(const H5F_t *f, hid_t dxpl_id)
+{
+ hsize_t userblock_size = 0; /* Size of userblock, in bytes */
+ size_t superblock_size; /* Size of superblock, in bytes */
+ size_t driver_size; /* Size of driver info block (bytes)*/
+ unsigned super_vers; /* Super block version */
+ haddr_t addr; /* Address of superblock */
+ H5P_genplist_t *plist; /* Property list */
+ herr_t ret_value=SUCCEED;
+
+ /* Encoding */
+ FUNC_ENTER_NOAPI(H5F_init_superblock, FAIL)
+
+ /* Get the shared file creation property list */
+ if (NULL == (plist = H5I_object(f->shared->fcpl_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
+
+ /*
+ * The superblock starts immediately after the user-defined
+ * header, which we have already insured is a proper size. The
+ * base address is set to the same thing as the superblock for
+ * now.
+ */
+ if(H5P_get(plist, H5F_CRT_USER_BLOCK_NAME, &userblock_size) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, FAIL, "unable to get user block size")
+ f->shared->super_addr = userblock_size;
+ f->shared->base_addr = f->shared->super_addr;
+ f->shared->consist_flags = 0x03;
+
+ /* Grab superblock version from property list */
+ if (H5P_get(plist, H5F_CRT_SUPER_VERS_NAME, &super_vers) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get super block version")
+
+ /* Compute the size of the superblock */
+ superblock_size=H5F_SIGNATURE_LEN /* Signature length (8 bytes) */
+ + 16 /* Length of required fixed-size portion */
+ + ((super_vers>0) ? 4 : 0) /* Version specific fixed-size portion */
+ + 4 * H5F_sizeof_addr(f) /* Variable-sized addresses */
+ + H5G_SIZEOF_ENTRY(f); /* Size of root group symbol table entry */
+
+ /* Compute the size of the driver information block. */
+ H5_ASSIGN_OVERFLOW(driver_size, H5FD_sb_size(f->shared->lf), hsize_t, size_t);
+ if (driver_size > 0)
+ driver_size += 16; /* Driver block header */
+
+ /*
+ * Allocate space for the userblock, superblock, and driver info
+ * block. We do it with one allocation request because the
+ * userblock and superblock need to be at the beginning of the
+ * file and only the first allocation request is required to
+ * return memory at format address zero.
+ */
+
+ H5_CHECK_OVERFLOW(f->shared->base_addr, haddr_t, hsize_t);
+ addr = H5FD_alloc(f->shared->lf, H5FD_MEM_SUPER, dxpl_id,
+ ((hsize_t)f->shared->base_addr + superblock_size + driver_size));
+
+ if (HADDR_UNDEF == addr)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL,
+ "unable to allocate file space for userblock and/or superblock")
+
+ if (0 != addr)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL,
+ "file driver failed to allocate userblock and/or superblock at address zero")
+
+ /*
+ * The file driver information block begins immediately after the
+ * superblock.
+ */
+ if (driver_size > 0)
+ f->shared->driver_addr = superblock_size;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* end H5F_init_superblock() */
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5F_write_superblock
+ *
+ * Purpose: Writes (and optionally allocates) the superblock for the file.
+ * If BUF is non-NULL, then write the serialized superblock
+ * information into it. It should be a buffer of size
+ * H5F_SUPERBLOCK_SIZE + H5F_DRVINFOBLOCK_SIZE or larger.
+ *
+ * Return: Success: SUCCEED
+ * Failure: FAIL
+ *
+ * Programmer: Bill Wendling
+ * wendling@ncsa.uiuc.edu
+ * Sept 12, 2003
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+H5F_write_superblock(H5F_t *f, hid_t dxpl_id)
+{
+ uint8_t sbuf[H5F_SUPERBLOCK_SIZE]; /* Superblock encoding buffer */
+ uint8_t dbuf[H5F_DRVINFOBLOCK_SIZE];/* Driver info block encoding buffer*/
+ uint8_t *p = NULL; /* Ptr into encoding buffers */
+ unsigned i; /* Index variable */
+ unsigned chksum; /* Checksum temporary variable */
+ size_t superblock_size; /* Size of superblock, in bytes */
+ size_t driver_size; /* Size of driver info block (bytes)*/
+ char driver_name[9]; /* Name of driver, for driver info block */
+ unsigned super_vers; /* Super block version */
+ unsigned freespace_vers; /* Freespace info version */
+ unsigned obj_dir_vers; /* Object header info version */
+ unsigned share_head_vers; /* Shared header info version */
+ H5P_genplist_t *plist; /* Property list */
+ herr_t ret_value = SUCCEED;
+
+ /* Encoding */
+ FUNC_ENTER_NOAPI(H5F_write_superblock, FAIL)
+
+ /* Get the shared file creation property list */
+ if (NULL == (plist = H5I_object(f->shared->fcpl_id)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list")
+
+ /* Grab values from property list */
+ if (H5P_get(plist, H5F_CRT_SUPER_VERS_NAME, &super_vers) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get super block version")
+ if (H5P_get(plist, H5F_CRT_FREESPACE_VERS_NAME, &freespace_vers) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get free space version")
+ if (H5P_get(plist, H5F_CRT_OBJ_DIR_VERS_NAME, &obj_dir_vers) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get object directory version")
+ if (H5P_get(plist, H5F_CRT_SHARE_HEAD_VERS_NAME, &share_head_vers) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get shared-header format version")
+
+ /* Encode the file super block */
+ p = sbuf;
+ HDmemcpy(p, H5F_SIGNATURE, H5F_SIGNATURE_LEN);
+ p += H5F_SIGNATURE_LEN;
+ *p++ = (uint8_t)super_vers;
+ *p++ = (uint8_t)freespace_vers;
+ *p++ = (uint8_t)obj_dir_vers;
+ *p++ = 0; /* reserved*/
+ *p++ = (uint8_t)share_head_vers;
+ assert (H5F_SIZEOF_ADDR(f) <= 255);
+ *p++ = (uint8_t)H5F_SIZEOF_ADDR(f);
+ assert (H5F_SIZEOF_SIZE(f) <= 255);
+ *p++ = (uint8_t)H5F_SIZEOF_SIZE(f);
+ *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);
+
+ /*
+ * Versions of the superblock >0 have the indexed storage B-tree
+ * internal 'K' value stored
+ */
+ if (super_vers > 0) {
+ UINT16ENCODE(p, f->shared->btree_k[H5B_ISTORE_ID]);
+ *p++ = 0; /*reserved */
+ *p++ = 0; /*reserved */
+ }
+
+ H5F_addr_encode(f, &p, f->shared->base_addr);
+ H5F_addr_encode(f, &p, f->shared->freespace_addr);
+ H5F_addr_encode(f, &p, H5FD_get_eoa(f->shared->lf));
+ H5F_addr_encode(f, &p, f->shared->driver_addr);
+ if(H5G_ent_encode(f, &p, H5G_entof(f->shared->root_grp))<0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to encode root group information")
+
+ H5_ASSIGN_OVERFLOW(superblock_size, p - sbuf, int, size_t);
+
+ /* Double check we didn't overrun the block (unlikely) */
+ assert(superblock_size <= sizeof(sbuf));
+
+ /* Encode the driver information block. */
+ H5_ASSIGN_OVERFLOW(driver_size, H5FD_sb_size(f->shared->lf), hsize_t, size_t);
+
+ if (driver_size > 0) {
+ driver_size += 16; /* Driver block header */
+
+ /* Double check we didn't overrun the block (unlikely) */
+ assert(driver_size <= sizeof(dbuf));
+
+ /* Encode the driver information block */
+ p = dbuf;
+
+ *p++ = HDF5_DRIVERINFO_VERSION; /* Version */
+ *p++ = 0; /* reserved */
+ *p++ = 0; /* reserved */
+ *p++ = 0; /* reserved */
+
+ /* Driver info size, excluding header */
+ UINT32ENCODE(p, driver_size - 16);
+
+ /* Encode driver-specific data */
+ if (H5FD_sb_encode(f->shared->lf, driver_name, dbuf + 16) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to encode driver information")
+
+ /* Driver name */
+ HDmemcpy(dbuf + 8, driver_name, 8);
+ } /* end if */
+
+ /* Compute super block checksum */
+ assert(sizeof(chksum) == sizeof(f->shared->super_chksum));
+
+ for (p = (uint8_t *)&chksum, chksum = 0, i = 0; i < superblock_size; ++i)
+ p[i % sizeof(f->shared->super_chksum)] ^= sbuf[i];
+
+ /* Compare with current checksums */
+ if (chksum != f->shared->super_chksum) {
+ /* Write superblock */
+ if (H5FD_write(f->shared->lf, H5FD_MEM_SUPER, dxpl_id,
+ f->shared->super_addr, superblock_size, sbuf) < 0)
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to write superblock")
+
+ /* Update checksum information if different */
+ f->shared->super_chksum = chksum;
+ } /* end if */
+
+ /* Check for driver info block */
+ if (HADDR_UNDEF != f->shared->driver_addr) {
+ /* Compute driver info block checksum */
+ assert(sizeof(chksum) == sizeof(f->shared->drvr_chksum));
+
+ for (p = (uint8_t *)&chksum, chksum = 0, i = 0; i < driver_size; ++i)
+ p[i % sizeof(f->shared->drvr_chksum)] ^= dbuf[i];
+
+ /* Compare with current checksums */
+ if (chksum != f->shared->drvr_chksum) {
+ /* Write driver information block */
+ if (H5FD_write(f->shared->lf, H5FD_MEM_SUPER, dxpl_id,
+ f->shared->base_addr + f->shared->driver_addr, driver_size, dbuf) < 0)
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to write driver information block")
+
+ /* Update checksum information if different */
+ f->shared->drvr_chksum = chksum;
+ } /* end if */
+ } /* end if */
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value)
+}
+
+
+/*-------------------------------------------------------------------------
* Function: H5F_flush
*
* Purpose: Flushes (and optionally invalidates) cached data plus the
@@ -2499,20 +2770,8 @@ done:
static herr_t
H5F_flush(H5F_t *f, hid_t dxpl_id, H5F_scope_t scope, unsigned flags)
{
- uint8_t sbuf[H5F_SUPERBLOCK_SIZE]; /* Superblock encoding buffer */
- uint8_t dbuf[H5F_DRVINFOBLOCK_SIZE]; /* Driver info block encoding buffer */
- uint8_t *p=NULL; /* Temporary pointer into encoding buffers */
unsigned nerrors = 0; /* Errors from nested flushes */
unsigned i; /* Index variable */
- unsigned chksum; /* Checksum temporary variable */
- size_t superblock_size;/* Size of superblock, in bytes */
- size_t driver_size; /* Size of driver info block, in bytes */
- char driver_name[9]; /* Name of driver, for driver info block */
- unsigned super_vers; /* Super block version */
- unsigned freespace_vers; /* Freespace info version */
- unsigned obj_dir_vers; /* Object header info version */
- unsigned share_head_vers;/* Shared header info version */
- H5P_genplist_t *plist; /* Property list */
herr_t ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5F_flush)
@@ -2540,220 +2799,57 @@ H5F_flush(H5F_t *f, hid_t dxpl_id, H5F_scope_t scope, unsigned flags)
if (H5F_SCOPE_DOWN == scope)
for (i = 0; i < f->mtab.nmounts; i++)
- /* Flush but don't pass down the ALLOC_ONLY flag if there */
- if (H5F_flush(f->mtab.child[i].file, dxpl_id, scope,
- flags & ~H5F_FLUSH_ALLOC_ONLY) < 0)
+ if (H5F_flush(f->mtab.child[i].file, dxpl_id, scope, flags) < 0)
nerrors++;
- /* Avoid flushing buffers & caches when alloc_only set */
- if ((flags & H5F_FLUSH_ALLOC_ONLY) == 0) {
- /* flush any cached dataset storage raw data */
- if (H5D_flush(f, dxpl_id, flags) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush dataset cache");
-
- /*
- * If we are invalidating everything (which only happens just
- * before the file closes), release the unused portion of the
- * metadata and "small data" blocks back to the free lists in the
- * file.
- */
- if (flags & H5F_FLUSH_INVALIDATE) {
-
- if (f->shared->lf->feature_flags & H5FD_FEAT_AGGREGATE_METADATA) {
- /* Return the unused portion of the metadata block to a free list */
- if (f->shared->lf->eoma != 0)
- if (H5FD_free(f->shared->lf, H5FD_MEM_DEFAULT, dxpl_id,
- f->shared->lf->eoma,
- f->shared->lf->cur_meta_block_size) < 0)
- HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL,
- "can't free metadata block");
-
- /* Reset metadata block information, just in case */
- f->shared->lf->eoma=0;
- f->shared->lf->cur_meta_block_size=0;
- } /* end if */
-
- if (f->shared->lf->feature_flags & H5FD_FEAT_AGGREGATE_SMALLDATA) {
- /* Return the unused portion of the "small data" block to a free list */
- if (f->shared->lf->eosda != 0)
- if (H5FD_free(f->shared->lf, H5FD_MEM_DRAW, dxpl_id,
- f->shared->lf->eosda,
- f->shared->lf->cur_sdata_block_size) < 0)
- HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL,
- "can't free 'small data' block");
-
- /* Reset "small data" block information, just in case */
- f->shared->lf->eosda=0;
- f->shared->lf->cur_sdata_block_size=0;
- } /* end if */
-
- } /* end if */
-
- /* flush (and invalidate) the entire meta data cache */
- if (H5AC_flush(f, dxpl_id, flags & (H5F_FLUSH_INVALIDATE|H5F_FLUSH_CLEAR_ONLY)) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush meta data cache");
- } /* end if */
-
- /* Get the shared file creation property list */
- if(NULL == (plist = H5I_object(f->shared->fcpl_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list");
-
- if(H5P_get(plist, H5F_CRT_SUPER_VERS_NAME, &super_vers) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get super block version");
- if(H5P_get(plist, H5F_CRT_FREESPACE_VERS_NAME, &freespace_vers) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get free space version");
- if(H5P_get(plist, H5F_CRT_OBJ_DIR_VERS_NAME, &obj_dir_vers) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get object directory version");
- if(H5P_get(plist, H5F_CRT_SHARE_HEAD_VERS_NAME, &share_head_vers) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "unable to get shared-header format version");
-
- /* encode the file super block */
- p = sbuf;
- HDmemcpy(p, H5F_SIGNATURE, H5F_SIGNATURE_LEN);
- p += H5F_SIGNATURE_LEN;
- *p++ = super_vers;
- *p++ = freespace_vers;
- *p++ = obj_dir_vers;
- *p++ = 0; /*reserved*/
- *p++ = share_head_vers;
- assert (H5F_SIZEOF_ADDR(f)<=255);
- *p++ = (uint8_t)H5F_SIZEOF_ADDR(f);
- assert (H5F_SIZEOF_SIZE(f)<=255);
- *p++ = (uint8_t)H5F_SIZEOF_SIZE(f);
- *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);
-
- /* Versions of the superblock >0 have the indexed storage B-tree internal 'K' value stored */
- if(super_vers>0) {
- UINT16ENCODE(p, f->shared->btree_k[H5B_ISTORE_ID]);
- *p++ = 0; /*reserved */
- *p++ = 0; /*reserved */
- } /* end if */
-
- H5F_addr_encode(f, &p, f->shared->base_addr);
- H5F_addr_encode(f, &p, f->shared->freespace_addr);
- H5F_addr_encode(f, &p, H5FD_get_eoa(f->shared->lf));
- H5F_addr_encode(f, &p, f->shared->driver_addr);
- H5G_ent_encode(f, &p, H5G_entof(f->shared->root_grp));
- superblock_size = p-sbuf;
-
- /* Double check we didn't overrun the block (unlikely) */
- assert(superblock_size<=sizeof(sbuf));
+ /* Flush any cached dataset storage raw data */
+ if (H5D_flush(f, dxpl_id, flags) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush dataset cache")
/*
- * Encode the driver information block.
+ * If we are invalidating everything (which only happens just before
+ * the file closes), release the unused portion of the metadata and
+ * "small data" blocks back to the free lists in the file.
*/
- H5_ASSIGN_OVERFLOW(driver_size,H5FD_sb_size(f->shared->lf),hsize_t,size_t);
-
- if (driver_size > 0) {
- driver_size += 16; /*driver block header */
-
- /* Double check we didn't overrun the block (unlikely) */
- assert(driver_size<=sizeof(dbuf));
-
- /* Encode the driver information block */
- p = dbuf;
-
- /* Version */
- *p++ = HDF5_DRIVERINFO_VERSION;
+ if (flags & H5F_FLUSH_INVALIDATE) {
+ if (f->shared->lf->feature_flags & H5FD_FEAT_AGGREGATE_METADATA) {
+ /* Return the unused portion of the metadata block to a free list */
+ if (f->shared->lf->eoma != 0)
+ if (H5FD_free(f->shared->lf, H5FD_MEM_DEFAULT, dxpl_id,
+ f->shared->lf->eoma, f->shared->lf->cur_meta_block_size) < 0)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "can't free metadata block")
+
+ /* Reset metadata block information, just in case */
+ f->shared->lf->eoma=0;
+ f->shared->lf->cur_meta_block_size=0;
+ } /* end if */
- /* Reserved*/
- p += 3;
+ if (f->shared->lf->feature_flags & H5FD_FEAT_AGGREGATE_SMALLDATA) {
+ /* Return the unused portion of the "small data" block to a free list */
+ if (f->shared->lf->eosda != 0)
+ if (H5FD_free(f->shared->lf, H5FD_MEM_DRAW, dxpl_id,
+ f->shared->lf->eosda, f->shared->lf->cur_sdata_block_size) < 0)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTFREE, FAIL, "can't free 'small data' block")
- /* Driver info size, excluding header */
- UINT32ENCODE(p, driver_size-16);
-
- /* Encode driver-specific data */
- if (H5FD_sb_encode(f->shared->lf, driver_name, dbuf+16)<0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL, "unable to encode driver information");
+ /* Reset "small data" block information, just in case */
+ f->shared->lf->eosda=0;
+ f->shared->lf->cur_sdata_block_size=0;
+ } /* end if */
- /* Driver name */
- HDmemcpy(dbuf+8, driver_name, 8);
} /* end if */
- if (flags & H5F_FLUSH_ALLOC_ONLY) {
- haddr_t addr;
+ /* flush (and invalidate) the entire meta data cache */
+ if (H5AC_flush(f, dxpl_id, flags & (H5F_FLUSH_INVALIDATE | H5F_FLUSH_CLEAR_ONLY)) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush meta data cache")
- /*
- * Allocate space for the userblock, superblock, and driver info
- * block. We do it with one allocation request because the
- * userblock and superblock need to be at the beginning of the
- * file and only the first allocation request is required to
- * return memory at format address zero.
- *
- * Note: This is safe for FPHDF5. We only set H5F_FLUSH_ALLOC_ONLY
- * from the H5F_open function. That function sets it so that only
- * the captain process will actually perform any allocations,
- * which is what we want here. In the H5FD_alloc function, the
- * allocated address is broadcast to the other processes.
- */
- H5_CHECK_OVERFLOW(f->shared->base_addr,haddr_t,hsize_t);
-
- addr = H5FD_alloc(f->shared->lf, H5FD_MEM_SUPER, dxpl_id,
- ((hsize_t)f->shared->base_addr + superblock_size + driver_size));
-
- if (HADDR_UNDEF == addr)
- HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL,
- "unable to allocate file space for userblock and/or superblock");
- if (0 != addr)
- HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, FAIL,
- "file driver failed to allocate userblock and/or superblock at address zero");
-
- /*
- * The file driver information block begins immediately after
- * the superblock.
- */
- if (driver_size > 0)
- f->shared->driver_addr = superblock_size;
- } else {
- /* Compute super block checksum */
- assert(sizeof(chksum)==sizeof(f->shared->super_chksum));
-
- for (p=(uint8_t *)&chksum, chksum=0, i=0; i<superblock_size; i++)
- p[i%sizeof(f->shared->super_chksum)] ^= sbuf[i];
+ /* Write the superblock to disk */
+ if (H5F_write_superblock(f, dxpl_id) != SUCCEED)
+ HGOTO_ERROR(H5E_CACHE, H5E_WRITEERROR, FAIL, "unable to write superblock to file")
- /* Compare with current checksums */
- if (chksum!=f->shared->super_chksum) {
- /* Write superblock */
- if (H5FD_write(f->shared->lf, H5FD_MEM_SUPER, dxpl_id,
- f->shared->super_addr, superblock_size, sbuf) < 0)
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "unable to write superblock");
-
- /* Update checksum information if different */
- f->shared->super_chksum=chksum;
- } /* end if */
-
- /* Check for driver info block */
- if (HADDR_UNDEF!=f->shared->driver_addr) {
- /* Compute driver info block checksum */
- assert(sizeof(chksum)==sizeof(f->shared->drvr_chksum));
-
- for(p=(uint8_t *)&chksum, chksum=0, i=0; i<driver_size; i++)
- p[i%sizeof(f->shared->drvr_chksum)] ^= dbuf[i];
-
- /* Compare with current checksums */
- if(chksum!=f->shared->drvr_chksum) {
- /* Write driver information block */
- if (H5FD_write(f->shared->lf, H5FD_MEM_SUPER, dxpl_id,
- f->shared->base_addr + f->shared->driver_addr,
- driver_size, dbuf) < 0)
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL,
- "unable to write driver information block");
-
- /* Update checksum information if different */
- f->shared->drvr_chksum=chksum;
- } /* end if */
- } /* end if */
- } /* end else */
-
- /* If we're not just allocating... */
- if ((flags & H5F_FLUSH_ALLOC_ONLY) == 0)
- /* ...flush file buffers to disk. */
- if (H5FD_flush(f->shared->lf, dxpl_id,
- (unsigned)((flags & H5F_FLUSH_CLOSING) > 0)) < 0)
- HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "low level flush failed")
+ /* Flush file buffers to disk. */
+ if (H5FD_flush(f->shared->lf, dxpl_id,
+ (unsigned)((flags & H5F_FLUSH_CLOSING) > 0)) < 0)
+ HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "low level flush failed")
/* Check flush errors for children - errors are already on the stack */
ret_value = (nerrors ? FAIL : SUCCEED);
@@ -2841,7 +2937,7 @@ H5F_close(H5F_t *f)
for (u=0; u<f->mtab.nmounts; u++) {
f->mtab.child[u].file->mtab.parent = NULL;
if(H5G_close(f->mtab.child[u].group)<0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close child group")
+ HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "can't close child group")
if(H5F_close(f->mtab.child[u].file)<0)
HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close child file")
} /* end if */
@@ -2937,7 +3033,7 @@ H5F_close(H5F_t *f)
int i; /* Local index variable */
/* Get the list of IDs of open dataset objects */
- while((obj_count=H5F_get_obj_ids(f, H5F_OBJ_DATASET, (sizeof(objs)/sizeof(objs[0])), objs))) {
+ while((obj_count=H5F_get_obj_ids(f, H5F_OBJ_DATASET, (sizeof(objs)/sizeof(objs[0])), objs))!=0) {
/* Try to close all the open objects */
for(i=0; i<obj_count; i++)
@@ -2946,7 +3042,7 @@ H5F_close(H5F_t *f)
} /* end while */
/* Get the list of IDs of open group objects */
- while((obj_count=H5F_get_obj_ids(f, H5F_OBJ_GROUP, (sizeof(objs)/sizeof(objs[0])), objs))) {
+ while((obj_count=H5F_get_obj_ids(f, H5F_OBJ_GROUP, (sizeof(objs)/sizeof(objs[0])), objs))!=0) {
/* Try to close all the open objects */
for(i=0; i<obj_count; i++)
@@ -2955,7 +3051,7 @@ H5F_close(H5F_t *f)
} /* end while */
/* Get the list of IDs of open named datatype objects */
- while((obj_count=H5F_get_obj_ids(f, H5F_OBJ_DATATYPE, (sizeof(objs)/sizeof(objs[0])), objs))) {
+ while((obj_count=H5F_get_obj_ids(f, H5F_OBJ_DATATYPE, (sizeof(objs)/sizeof(objs[0])), objs))!=0) {
/* Try to close all the open objects */
for(i=0; i<obj_count; i++)
@@ -2964,7 +3060,7 @@ H5F_close(H5F_t *f)
} /* end while */
/* Get the list of IDs of open attribute objects */
- while((obj_count=H5F_get_obj_ids(f, H5F_OBJ_ATTR, (sizeof(objs)/sizeof(objs[0])), objs))) {
+ while((obj_count=H5F_get_obj_ids(f, H5F_OBJ_ATTR, (sizeof(objs)/sizeof(objs[0])), objs))!=0) {
/* Try to close all the open objects */
for(i=0; i<obj_count; i++)
@@ -2985,21 +3081,18 @@ H5F_close(H5F_t *f)
f->file_id = -1;
/* Only flush at this point if the file will be closed */
- if (closing) {
- /* Dump debugging info */
+ assert(closing);
+ /* Dump debugging info */
#if H5AC_DUMP_STATS_ON_CLOSE
H5AC_stats(f);
#endif /* H5AC_DUMP_STATS_ON_CLOSE */
- /* Only try to flush the file if it was opened with write access */
- if(f->intent&H5F_ACC_RDWR) {
-
- /* Flush and destroy all caches */
- if (H5F_flush(f, H5AC_dxpl_id, H5F_SCOPE_LOCAL,
- H5F_FLUSH_INVALIDATE | H5F_FLUSH_CLOSING) < 0)
- HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache");
-
- } /* end if */
+ /* Only try to flush the file if it was opened with write access */
+ if(f->intent&H5F_ACC_RDWR) {
+ /* Flush and destroy all caches */
+ if (H5F_flush(f, H5AC_dxpl_id, H5F_SCOPE_LOCAL,
+ H5F_FLUSH_INVALIDATE | H5F_FLUSH_CLOSING) < 0)
+ HGOTO_ERROR(H5E_CACHE, H5E_CANTFLUSH, FAIL, "unable to flush cache")
} /* end if */
/*
@@ -3111,7 +3204,7 @@ H5F_mount(H5G_entry_t *loc, const char *name, H5F_t *child,
if (child->mtab.parent)
HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "file is already mounted")
if (H5G_find(loc, name, NULL, &mp_open_ent/*out*/, H5AC_dxpl_id) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group not found");
+ HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group not found")
if (NULL==(mount_point=H5G_open(&mp_open_ent, dxpl_id)))
HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "mount point not found")
@@ -3177,7 +3270,7 @@ H5F_mount(H5G_entry_t *loc, const char *name, H5F_t *child,
done:
if (ret_value<0 && mount_point)
if(H5G_close(mount_point)<0)
- HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "unable to close mounted group")
+ HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "unable to close mounted group")
FUNC_LEAVE_NOAPI(ret_value)
}
@@ -3234,7 +3327,7 @@ H5F_unmount(H5G_entry_t *loc, const char *name, hid_t dxpl_id)
* then we must have found the mount point.
*/
if (H5G_find(loc, name, NULL, &mnt_open_ent/*out*/, H5AC_dxpl_id) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group not found");
+ HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group not found")
if (NULL==(mounted=H5G_open(&mnt_open_ent, dxpl_id)))
HGOTO_ERROR(H5E_FILE, H5E_MOUNT, FAIL, "mount point not found")
child = H5G_fileof(mounted);
@@ -3257,7 +3350,7 @@ H5F_unmount(H5G_entry_t *loc, const char *name, hid_t dxpl_id)
/* Unmount the child */
parent->mtab.nmounts -= 1;
if(H5G_close(parent->mtab.child[i].group)<0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "unable to close unmounted group")
+ HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "unable to close unmounted group")
child->mtab.parent = NULL;
if(H5F_close(child)<0)
HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "unable to close unmounted file")
@@ -3293,7 +3386,7 @@ H5F_unmount(H5G_entry_t *loc, const char *name, hid_t dxpl_id)
/* Unmount the child */
parent->mtab.nmounts -= 1;
if(H5G_close(parent->mtab.child[md].group)<0)
- HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "unable to close unmounted group")
+ HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "unable to close unmounted group")
parent->mtab.child[md].file->mtab.parent = NULL;
if(H5F_close(parent->mtab.child[md].file)<0)
HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "unable to close unmounted file")
@@ -3305,7 +3398,7 @@ H5F_unmount(H5G_entry_t *loc, const char *name, hid_t dxpl_id)
done:
if (mounted)
if(H5G_close(mounted)<0 && ret_value>=0)
- HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, FAIL, "can't close group")
+ HDONE_ERROR(H5E_FILE, H5E_CANTCLOSEOBJ, FAIL, "can't close group")
FUNC_LEAVE_NOAPI(ret_value)
}
@@ -3880,7 +3973,7 @@ hbool_t H5F_has_feature(const H5F_t *f, unsigned feature)
assert(f);
assert(f->shared);
- FUNC_LEAVE_NOAPI(f->shared->lf->feature_flags&feature);
+ FUNC_LEAVE_NOAPI((hbool_t)(f->shared->lf->feature_flags&feature))
} /* end H5F_has_feature() */
@@ -3987,7 +4080,7 @@ H5F_get_id(H5F_t *file)
} else {
/* Increment reference count on atom. */
if (H5I_inc_ref(file->file_id)<0)
- HGOTO_ERROR (H5E_ATOM, H5E_CANTSET, FAIL, "incrementing file ID failed");
+ HGOTO_ERROR (H5E_ATOM, H5E_CANTSET, FAIL, "incrementing file ID failed")
}
ret_value = file->file_id;
@@ -4387,7 +4480,7 @@ H5F_addr_pack(H5F_t UNUSED *f, haddr_t *addr_p/*out*/,
const unsigned long objno[2])
{
/* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_addr_pack);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5F_addr_pack)
assert(f);
assert(objno);
@@ -4398,7 +4491,7 @@ H5F_addr_pack(H5F_t UNUSED *f, haddr_t *addr_p/*out*/,
*addr_p |= ((uint64_t)objno[1]) << (8*sizeof(long));
#endif
- FUNC_LEAVE_NOAPI(SUCCEED);
+ FUNC_LEAVE_NOAPI(SUCCEED)
}
@@ -4513,7 +4606,7 @@ H5Fget_name(hid_t obj_id, char *name/*out*/, size_t size)
size_t len=0;
ssize_t ret_value;
- FUNC_ENTER_API (H5Fget_name, FAIL);
+ FUNC_ENTER_API (H5Fget_name, FAIL)
H5TRACE3("Zs","ixz",obj_id,name,size);
/* get symbol table entry */
@@ -4532,120 +4625,6 @@ H5Fget_name(hid_t obj_id, char *name/*out*/, size_t size)
ret_value=(ssize_t)len;
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
} /* end H5Fget_name() */
-
-/*-------------------------------------------------------------------------
- * Function: H5F_debug
- *
- * Purpose: Prints a file header to the specified stream. Each line
- * is indented and the field name occupies the specified width
- * number of characters.
- *
- * Errors:
- *
- * Return: Non-negative on success/Negative on failure
- *
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Aug 1 1997
- *
- * 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.
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5F_debug(H5F_t *f, hid_t dxpl_id, haddr_t UNUSED addr, FILE * stream, int indent,
- int fwidth)
-{
- hsize_t userblock_size;
- int super_vers, freespace_vers, obj_dir_vers, share_head_vers;
- H5P_genplist_t *plist; /* Property list */
- herr_t ret_value=SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(H5F_debug, FAIL);
-
- /* check args */
- assert(f);
- assert(H5F_addr_defined(addr));
- assert(stream);
- assert(indent >= 0);
- assert(fwidth >= 0);
-
- /* Get property list */
- if(NULL == (plist = H5I_object(f->shared->fcpl_id)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a property list");
-
- if(H5P_get(plist, H5F_CRT_USER_BLOCK_NAME, &userblock_size)<0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get user block size");
- if(H5P_get(plist, H5F_CRT_SUPER_VERS_NAME, &super_vers)<0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get super block version");
- if(H5P_get(plist, H5F_CRT_FREESPACE_VERS_NAME, &freespace_vers)<0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get super block version");
- if(H5P_get(plist, H5F_CRT_OBJ_DIR_VERS_NAME, &obj_dir_vers)<0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get object directory version");
- if(H5P_get(plist, H5F_CRT_SHARE_HEAD_VERS_NAME, &share_head_vers)<0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get shared-header format version");
-
- /* debug */
- HDfprintf(stream, "%*sFile Super Block...\n", indent, "");
-
- HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
- "File name:",
- f->name);
- HDfprintf(stream, "%*s%-*s 0x%08x\n", indent, "", fwidth,
- "File access flags",
- (unsigned) (f->shared->flags));
- HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
- "File open reference count:",
- (unsigned) (f->shared->nrefs));
- HDfprintf(stream, "%*s%-*s %a (abs)\n", indent, "", fwidth,
- "Address of super block:", f->shared->super_addr);
- HDfprintf(stream, "%*s%-*s %lu bytes\n", indent, "", fwidth,
- "Size of user block:", (unsigned long) userblock_size);
-
- HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
- "Super block version number:", (unsigned) super_vers);
- HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
- "Free list version number:", (unsigned) freespace_vers);
- HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
- "Root group symbol table entry version number:", (unsigned) obj_dir_vers);
- HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
- "Shared header version number:", (unsigned) share_head_vers);
- HDfprintf(stream, "%*s%-*s %u bytes\n", indent, "", fwidth,
- "Size of file offsets (haddr_t type):", (unsigned) f->shared->sizeof_addr);
- HDfprintf(stream, "%*s%-*s %u bytes\n", indent, "", fwidth,
- "Size of file lengths (hsize_t type):", (unsigned) f->shared->sizeof_size);
- HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
- "Symbol table leaf node 1/2 rank:", f->shared->sym_leaf_k);
- HDfprintf(stream, "%*s%-*s %u\n", indent, "", fwidth,
- "Symbol table internal node 1/2 rank:",
- (unsigned) (f->shared->btree_k[H5B_SNODE_ID]));
- HDfprintf(stream, "%*s%-*s 0x%08lx\n", indent, "", fwidth,
- "File consistency flags:",
- (unsigned long) (f->shared->consist_flags));
- HDfprintf(stream, "%*s%-*s %a (abs)\n", indent, "", fwidth,
- "Base address:", f->shared->base_addr);
- HDfprintf(stream, "%*s%-*s %a (rel)\n", indent, "", fwidth,
- "Free list address:", f->shared->freespace_addr);
-
- HDfprintf(stream, "%*s%-*s %a (rel)\n", indent, "", fwidth,
- "Address of driver information block:", f->shared->driver_addr);
-
- HDfprintf(stream, "%*s%-*s %s\n", indent, "", fwidth,
- "Root group symbol table entry:",
- f->shared->root_grp ? "" : "(none)");
- if (f->shared->root_grp) {
- H5G_ent_debug(f, dxpl_id, H5G_entof(f->shared->root_grp), stream,
- indent+3, MAX(0, fwidth-3), HADDR_UNDEF);
- }
-
-done:
- FUNC_LEAVE_NOAPI(ret_value);
-}
diff --git a/src/H5FD.c b/src/H5FD.c
index ebf5af2..7a8869a 100644
--- a/src/H5FD.c
+++ b/src/H5FD.c
@@ -25,6 +25,9 @@
#define H5F_PACKAGE /*suppress error about including H5Fpkg */
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5FD_init_interface
+
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
#define PABLO_MASK H5FD_mask
@@ -50,12 +53,7 @@
#include "H5MMprivate.h" /* Memory management */
#include "H5Pprivate.h" /* Property lists */
-/* Interface initialization */
-#define INTERFACE_INIT H5FD_init_interface
-static int interface_initialize_g = 0;
-
/* static prototypes */
-static herr_t H5FD_init_interface(void);
static herr_t H5FD_pl_copy(void *(*copy_func)(const void *), size_t pl_size,
const void *old_pl, void **copied_pl);
static herr_t H5FD_pl_close(hid_t driver_id, herr_t (*free_func)(void *),
@@ -158,8 +156,8 @@ H5FD_term_interface(void)
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FD_term_interface)
- if (interface_initialize_g) {
- if ((n=H5I_nmembers(H5I_VFL))) {
+ if (H5_interface_initialize_g) {
+ if ((n=H5I_nmembers(H5I_VFL))!=0) {
H5I_clear_group(H5I_VFL, FALSE);
/* Reset the VFL drivers, if they've been closed */
@@ -186,7 +184,7 @@ H5FD_term_interface(void)
} /* end if */
} else {
H5I_destroy_group(H5I_VFL);
- interface_initialize_g = 0;
+ H5_interface_initialize_g = 0;
n = 1; /*H5I*/
}
}
@@ -630,7 +628,8 @@ H5FD_pl_close(hid_t driver_id, herr_t (*free_func)(void *), void *pl)
H5MM_xfree(pl);
/* Decrement reference count for driver */
- H5I_dec_ref(driver_id);
+ if(H5I_dec_ref(driver_id)<0)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTDEC, FAIL, "can't decrement reference count for driver")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1469,7 +1468,7 @@ H5FDalloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size)
/* Check args */
if (!file || !file->cls)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid file pointer")
- if (type<0 || type>=H5FD_MEM_NTYPES)
+ if (type<H5FD_MEM_DEFAULT || type>=H5FD_MEM_NTYPES)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "invalid request type")
if (size==0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, HADDR_UNDEF, "zero-size request")
@@ -1516,7 +1515,7 @@ H5FD_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size)
/* check args */
assert(file);
assert(file->cls);
- assert(type >= 0 && type < H5FD_MEM_NTYPES);
+ assert(type >= H5FD_MEM_DEFAULT && type < H5FD_MEM_NTYPES);
assert(size > 0);
@@ -1579,7 +1578,7 @@ H5FD_alloc_from_free_list(H5FD_t *file, H5FD_mem_t type,
FUNC_ENTER_NOAPI(H5FD_alloc_from_free_list, HADDR_UNDEF)
assert(file);
- assert(type >= 0 && type < H5FD_MEM_NTYPES);
+ assert(type >= H5FD_MEM_DEFAULT && type < H5FD_MEM_NTYPES);
assert(size > 0);
/*
@@ -1601,7 +1600,7 @@ H5FD_alloc_from_free_list(H5FD_t *file, H5FD_mem_t type,
* 2. block address is aligned with smallest size > requested size;
* 3. block address is not aligned with smallest size >= requested size.
*/
- if (mapped_type >= 0 && (file->maxsize == 0 || size <= file->maxsize)) {
+ if (mapped_type >= H5FD_MEM_DEFAULT && (file->maxsize == 0 || size <= file->maxsize)) {
H5FD_free_t *prev = NULL, *best = NULL;
H5FD_free_t *cur = file->fl[mapped_type];
int found_aligned = 0;
@@ -1757,7 +1756,7 @@ H5FD_alloc_from_free_list(H5FD_t *file, H5FD_mem_t type,
if((tmp = H5FL_MALLOC(H5FD_free_t))==NULL)
HGOTO_ERROR(H5E_VFL, H5E_NOSPACE, HADDR_UNDEF, "free block allocation failed")
- if ((tmp->size = (best->size - (head + size)))) {
+ if ((tmp->size = (best->size - (head + size)))!=0) {
tmp->addr = best->addr + (head + size);
tmp->next = best->next;
best->next = tmp;
@@ -1801,7 +1800,7 @@ H5FD_alloc_metadata(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size)
/* check args */
assert(file);
- assert(type >= 0 && type < H5FD_MEM_NTYPES);
+ assert(type >= H5FD_MEM_DEFAULT && type < H5FD_MEM_NTYPES);
assert(size > 0);
/*
@@ -1916,7 +1915,7 @@ H5FD_alloc_raw(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size)
/* check args */
assert(file);
- assert(type >= 0 && type < H5FD_MEM_NTYPES);
+ assert(type >= H5FD_MEM_DEFAULT && type < H5FD_MEM_NTYPES);
assert(size > 0);
/*
@@ -2033,7 +2032,7 @@ H5FD_real_alloc(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size)
/* check args */
assert(file);
assert(file->cls);
- assert(type >= 0 && type < H5FD_MEM_NTYPES);
+ assert(type >= H5FD_MEM_DEFAULT && type < H5FD_MEM_NTYPES);
assert(size > 0);
/*
@@ -2079,7 +2078,7 @@ H5FD_update_eoa(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size)
/* check args */
assert(file);
assert(file->cls);
- assert(type >= 0 && type < H5FD_MEM_NTYPES);
+ assert(type >= H5FD_MEM_DEFAULT && type < H5FD_MEM_NTYPES);
assert(size > 0);
eoa = file->cls->get_eoa(file);
@@ -2171,7 +2170,7 @@ H5FDfree(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t siz
/* Check args */
if (!file || !file->cls)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid file pointer")
- if (type<0 || type>=H5FD_MEM_NTYPES)
+ if (type<H5FD_MEM_DEFAULT || type>=H5FD_MEM_NTYPES)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid request type")
if (H5P_DEFAULT == dxpl_id)
dxpl_id= H5P_DATASET_XFER_DEFAULT;
@@ -2219,7 +2218,7 @@ H5FD_free(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t si
/* Check args */
assert(file);
assert(file->cls);
- assert(type >= 0 && type < H5FD_MEM_NTYPES);
+ assert(type >= H5FD_MEM_DEFAULT && type < H5FD_MEM_NTYPES);
if (!H5F_addr_defined(addr) || addr>file->maxaddr ||
H5F_addr_overflow(addr, size) || addr+size>file->maxaddr)
@@ -2241,7 +2240,7 @@ H5FD_free(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t si
* without ever telling the driver that it was freed. Otherwise let the
* driver deallocate the memory.
*/
- if (mapped_type>=0) {
+ if (mapped_type>=H5FD_MEM_DEFAULT) {
H5FD_free_t *last; /* Last merged node */
H5FD_free_t *last_prev=NULL;/* Pointer to node before merged node */
H5FD_free_t *curr; /* Current free block being inspected */
@@ -3696,7 +3695,7 @@ done:
*-------------------------------------------------------------------------
*/
hssize_t
-H5FD_get_freespace(H5FD_t *file)
+H5FD_get_freespace(const H5FD_t *file)
{
H5FD_free_t *free_node; /* Pointer to node on free list */
H5FD_mem_t type; /* Type of memory */
@@ -3716,7 +3715,7 @@ H5FD_get_freespace(H5FD_t *file)
/* Iterate through the free list, accumulating the amount of free space for this type */
free_node = file->fl[type];
while(free_node) {
- ret_value+=free_node->size;
+ ret_value+=(hssize_t)free_node->size;
free_node=free_node->next;
} /* end while */
} /* end for */
diff --git a/src/H5FDcore.c b/src/H5FDcore.c
index d34b5a5..1b3d877 100644
--- a/src/H5FDcore.c
+++ b/src/H5FDcore.c
@@ -21,6 +21,9 @@
* access to small, temporary hdf5 files.
*/
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5FD_core_init_interface
+
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
#define PABLO_MASK H5FD_core_mask
@@ -131,10 +134,6 @@ static const H5FD_class_t H5FD_core_g = {
H5FD_FLMAP_SINGLE /*fl_map */
};
-/* Interface initialization */
-#define INTERFACE_INIT H5FD_core_init_interface
-static int interface_initialize_g = 0;
-
/*--------------------------------------------------------------------------
NAME
diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c
index d6d2f3f..2e05203 100644
--- a/src/H5FDfamily.c
+++ b/src/H5FDfamily.c
@@ -33,6 +33,9 @@
*
*/
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5FD_family_init_interface
+
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
#define PABLO_MASK H5FD_family_mask
@@ -132,10 +135,6 @@ static const H5FD_class_t H5FD_family_g = {
H5FD_FLMAP_SINGLE /*fl_map */
};
-/* Interface initialization */
-#define INTERFACE_INIT H5FD_family_init_interface
-static int interface_initialize_g = 0;
-
/*--------------------------------------------------------------------------
NAME
@@ -568,6 +567,13 @@ done:
* Wednesday, August 4, 1999
*
* Modifications:
+ * 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
+ * the 1st member size.
*
*-------------------------------------------------------------------------
*/
@@ -578,10 +584,10 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id,
H5FD_family_t *file=NULL;
H5FD_t *ret_value=NULL;
char memb_name[4096], temp[4096];
- hsize_t eof;
+ hsize_t eof1=HADDR_UNDEF, eof2=HADDR_UNDEF;
unsigned t_flags = flags & ~H5F_ACC_CREAT;
H5P_genplist_t *plist; /* Property list pointer */
-
+
FUNC_ENTER_NOAPI(H5FD_family_open, NULL)
/* Check arguments */
@@ -631,7 +637,7 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id,
/* Enlarge member array */
if (file->nmembs>=file->amembs) {
- int n = MAX(64, 2*file->amembs);
+ unsigned n = MAX(64, 2*file->amembs);
H5FD_t **x = H5MM_realloc(file->memb, n*sizeof(H5FD_t*));
if (!x)
@@ -657,14 +663,28 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id,
}
file->nmembs++;
}
-
- /*
- * The size of the first member determines the size of all the members,
- * but if the size of the first member is zero then use the member size
- * from the file access property list.
+
+ /*
+ * Get file size of the first 2 member files if exist. Check if user sets
+ * reasonable member size.
*/
- if ((eof=H5FDget_eof(file->memb[0])))
- file->memb_size = eof;
+ if(HADDR_UNDEF==(eof1 = H5FD_get_eof(file->memb[0])))
+ HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, NULL, "file get eof1 request failed")
+ if(file->memb[1] && (HADDR_UNDEF==(eof2 = H5FD_get_eof(file->memb[1]))))
+ HGOTO_ERROR(H5E_VFL, H5E_CANTINIT, NULL, "file get eof2 request failed")
+
+ if(eof1 && (eof2==HADDR_UNDEF || !eof2)) {
+ /* If there is only 1 member file, new member size can't be smaller than
+ * current member size.
+ */
+ if(file->memb_size<eof1)
+ file->memb_size = eof1;
+ } else if(eof1 && eof2) {
+ /* If there are at least 2 member files, new member size can only be equal
+ * to the 1st member size
+ */
+ file->memb_size = eof1;
+ }
ret_value=(H5FD_t *)file;
@@ -676,7 +696,7 @@ done:
for (u=0; u<file->nmembs; u++)
if (file->memb[u])
- if (H5FDclose(file->memb[u])<0)
+ if (H5FD_close(file->memb[u])<0)
nerrors++;
if (nerrors)
HGOTO_ERROR(H5E_FILE, H5E_CANTCLOSEFILE, NULL, "unable to close member files")
@@ -813,7 +833,9 @@ 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 */
*flags|=H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */
}
@@ -888,7 +910,7 @@ H5FD_family_set_eoa(H5FD_t *_file, haddr_t eoa)
/* Enlarge member array */
if (u>=file->amembs) {
- int n = MAX(64, 2*file->amembs);
+ unsigned n = MAX(64, 2*file->amembs);
H5FD_t **x = H5MM_realloc(file->memb, n*sizeof(H5FD_t*));
if (!x)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "unable to allocate memory block")
@@ -966,7 +988,7 @@ H5FD_family_get_eof(H5FD_t *_file)
*/
assert(file->nmembs>0);
for (i=(int)file->nmembs-1; i>=0; --i) {
- if ((eof=H5FD_get_eof(file->memb[i])))
+ if ((eof=H5FD_get_eof(file->memb[i]))!=0)
break;
if (0==i)
break;
diff --git a/src/H5FDgass.c b/src/H5FDgass.c
index fb2c776..9da489c 100644
--- a/src/H5FDgass.c
+++ b/src/H5FDgass.c
@@ -20,6 +20,9 @@
*
*/
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5FD_gass_init_interface
+
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
#define PABLO_MASK H5FD_gass_mask
@@ -174,10 +177,6 @@ static const H5FD_class_t H5FD_gass_g = {
H5FD_FLMAP_SINGLE /*fl_map */
};
-/* Interface initialization */
-#define INTERFACE_INIT H5FD_gass_init_interface
-static int interface_initialize_g = 0;
-
/*--------------------------------------------------------------------------
NAME
diff --git a/src/H5FDlog.c b/src/H5FDlog.c
index 795ac65..541baaa 100644
--- a/src/H5FDlog.c
+++ b/src/H5FDlog.c
@@ -25,6 +25,8 @@
* With custom modifications...
*/
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5FD_log_init_interface
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
@@ -237,10 +239,6 @@ static const H5FD_class_t H5FD_log_g = {
H5FD_FLMAP_NOLIST /*fl_map */
};
-/* Interface initialization */
-#define INTERFACE_INIT H5FD_log_init_interface
-static int interface_initialize_g = 0;
-
/*--------------------------------------------------------------------------
NAME
@@ -910,7 +908,7 @@ H5FD_log_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, hsize_t siz
if(file->fa.flags&H5FD_LOG_FLAVOR) {
assert(addr<file->iosize);
H5_CHECK_OVERFLOW(size,hsize_t,size_t);
- HDmemset(&file->flavor[addr],type,(size_t)size);
+ HDmemset(&file->flavor[addr],(int)type,(size_t)size);
} /* end if */
if(file->fa.flags&H5FD_LOG_ALLOC)
@@ -1215,8 +1213,8 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t add
assert(buf);
/* Verify that we are writing out the type of data we allocated in this location */
- assert(type==H5FD_MEM_DEFAULT || type==file->flavor[addr] || file->flavor[addr]==H5FD_MEM_DEFAULT);
- assert(type==H5FD_MEM_DEFAULT || type==file->flavor[(addr+size)-1] || file->flavor[(addr+size)-1]==H5FD_MEM_DEFAULT);
+ assert(type==H5FD_MEM_DEFAULT || type==(H5FD_mem_t)file->flavor[addr] || (H5FD_mem_t)file->flavor[addr]==H5FD_MEM_DEFAULT);
+ 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)
@@ -1317,8 +1315,8 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t add
/* Check if this is the first write into a "default" section, grabbed by the metadata agregation algorithm */
if(file->fa.flags&H5FD_LOG_FLAVOR) {
- if(file->flavor[orig_addr]==H5FD_MEM_DEFAULT)
- HDmemset(&file->flavor[orig_addr],type,orig_size);
+ if((H5FD_mem_t)file->flavor[orig_addr]==H5FD_MEM_DEFAULT)
+ HDmemset(&file->flavor[orig_addr],(int)type,orig_size);
} /* end if */
#ifdef H5_HAVE_GETTIMEOFDAY
diff --git a/src/H5FDmpi.c b/src/H5FDmpi.c
index 6afc65c..e738a82 100644
--- a/src/H5FDmpi.c
+++ b/src/H5FDmpi.c
@@ -38,10 +38,6 @@ char H5FD_mpi_native_g[] = "native";
#ifdef H5_HAVE_PARALLEL
-/* Interface initialization */
-#define INTERFACE_INIT NULL
-static int interface_initialize_g = 0;
-
/*-------------------------------------------------------------------------
* Function: H5FD_mpi_get_rank
diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c
index 2fb7285..9d5c48a 100644
--- a/src/H5FDmpio.c
+++ b/src/H5FDmpio.c
@@ -20,6 +20,9 @@
*
*/
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5FD_mpio_init_interface
+
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
#define PABLO_MASK H5FD_mpio_mask
@@ -149,10 +152,6 @@ static int H5FD_mpio_Debug[256] =
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
#endif
-/* Interface initialization */
-#define INTERFACE_INIT H5FD_mpio_init_interface
-static int interface_initialize_g = 0;
-
/*--------------------------------------------------------------------------
NAME
diff --git a/src/H5FDmpiposix.c b/src/H5FDmpiposix.c
index baef534..6500a85 100644
--- a/src/H5FDmpiposix.c
+++ b/src/H5FDmpiposix.c
@@ -32,6 +32,9 @@
*
*/
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5FD_mpiposix_init_interface
+
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
#define PABLO_MASK H5FD_mpiposix_mask
@@ -237,10 +240,6 @@ static const H5FD_class_mpi_t H5FD_mpiposix_g = {
H5FD_mpiposix_communicator /*get_comm */
};
-/* Interface initialization */
-#define INTERFACE_INIT H5FD_mpiposix_init_interface
-static int interface_initialize_g = 0;
-
/*--------------------------------------------------------------------------
NAME
diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c
index b03248d..0289096 100644
--- a/src/H5FDmulti.c
+++ b/src/H5FDmulti.c
@@ -449,7 +449,7 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map,
/* Check arguments and supply default values */
if(H5I_GENPROP_LST != H5Iget_type(fapl_id) ||
TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS))
- H5Epush_ret(func, H5E_PLIST, H5E_BADVALUE, "not an access list", -1);
+ H5Epush_ret(func, H5E_PLIST, H5E_BADVALUE, "not an access list", -1)
if (!memb_map) {
for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1))
_memb_map[mt] = H5FD_MEM_DEFAULT;
@@ -478,7 +478,7 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map,
/* Map usage type */
mmt = memb_map[mt];
if (mmt<0 || mmt>=H5FD_MEM_NTYPES)
- H5Epush_ret(func, H5E_INTERNAL, H5E_BADRANGE, "file resource type out of range", -1);
+ H5Epush_ret(func, H5E_INTERNAL, H5E_BADRANGE, "file resource type out of range", -1)
if (H5FD_MEM_DEFAULT==mmt) mmt = mt;
/*
@@ -486,11 +486,11 @@ H5Pset_fapl_multi(hid_t fapl_id, const H5FD_mem_t *memb_map,
* access property lists.
*/
if (H5P_DEFAULT!=memb_fapl[mmt] && TRUE!=H5Pisa_class(memb_fapl[mmt], H5P_FILE_ACCESS))
- H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "file resource type incorrect", -1);
+ H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "file resource type incorrect", -1)
/* All names must be defined */
if (!memb_name[mmt] || !memb_name[mmt][0])
- H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "file resource type not set", -1);
+ H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "file resource type not set", -1)
}
/*
@@ -549,11 +549,11 @@ H5Pget_fapl_multi(hid_t fapl_id, H5FD_mem_t *memb_map/*out*/,
if(H5I_GENPROP_LST != H5Iget_type(fapl_id) ||
TRUE != H5Pisa_class(fapl_id, H5P_FILE_ACCESS))
- H5Epush_ret(func, H5E_PLIST, H5E_BADTYPE, "not an access list", -1);
+ H5Epush_ret(func, H5E_PLIST, H5E_BADTYPE, "not an access list", -1)
if (H5FD_MULTI!=H5Pget_driver(fapl_id))
- H5Epush_ret(func, H5E_PLIST, H5E_BADVALUE, "incorrect VFL driver", -1);
+ H5Epush_ret(func, H5E_PLIST, H5E_BADVALUE, "incorrect VFL driver", -1)
if (NULL==(fa=H5Pget_driver_info(fapl_id)))
- H5Epush_ret(func, H5E_PLIST, H5E_BADVALUE, "bad VFL driver info", -1);
+ H5Epush_ret(func, H5E_PLIST, H5E_BADVALUE, "bad VFL driver info", -1)
if (memb_map)
memcpy(memb_map, fa->memb_map, H5FD_MEM_NTYPES*sizeof(H5FD_mem_t));
@@ -616,12 +616,12 @@ H5Pset_dxpl_multi(hid_t dxpl_id, const hid_t *memb_dxpl)
/* Check arguments */
if (TRUE!=H5Pisa_class(dxpl_id, H5P_DATASET_XFER))
- H5Epush_ret(func, H5E_PLIST, H5E_BADTYPE, "not a data transfer property list", -1);
+ H5Epush_ret(func, H5E_PLIST, H5E_BADTYPE, "not a data transfer property list", -1)
if (!memb_dxpl)
- H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "invalid pointer", -1);
+ H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "invalid pointer", -1)
for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) {
if (memb_dxpl[mt]!=H5P_DEFAULT && TRUE!=H5Pisa_class(memb_dxpl[mt], H5P_DATASET_XFER))
- H5Epush_ret(func, H5E_PLIST, H5E_BADTYPE, "not a data transfer property list", -1);
+ H5Epush_ret(func, H5E_PLIST, H5E_BADTYPE, "not a data transfer property list", -1)
}
/* Initialize the data transfer property list */
@@ -667,11 +667,11 @@ H5Pget_dxpl_multi(hid_t dxpl_id, hid_t *memb_dxpl/*out*/)
H5Eclear();
if (TRUE!=H5Pisa_class(dxpl_id, H5P_DATASET_XFER))
- H5Epush_ret(func, H5E_PLIST, H5E_BADTYPE, "not a file access property list", -1);
+ H5Epush_ret(func, H5E_PLIST, H5E_BADTYPE, "not a file access property list", -1)
if (H5FD_MULTI!=H5Pget_driver(dxpl_id))
- H5Epush_ret(func, H5E_PLIST, H5E_BADVALUE, "incorrect VFL driver", -1);
+ H5Epush_ret(func, H5E_PLIST, H5E_BADVALUE, "incorrect VFL driver", -1)
if (NULL==(dx=H5Pget_driver_info(dxpl_id)))
- H5Epush_ret(func, H5E_PLIST, H5E_BADVALUE, "bad VFL driver info", -1);
+ H5Epush_ret(func, H5E_PLIST, H5E_BADVALUE, "bad VFL driver info", -1)
if (memb_dxpl) {
for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) {
@@ -800,7 +800,7 @@ H5FD_multi_sb_encode(H5FD_t *_file, char *name/*out*/,
} END_MEMBERS;
if (H5Tconvert(H5T_NATIVE_HADDR, H5T_STD_U64LE, nseen*2, buf+8, NULL,
H5P_DEFAULT)<0)
- H5Epush_ret(func, H5E_DATATYPE, H5E_CANTCONVERT, "can't convert superblock info", -1);
+ H5Epush_ret(func, H5E_DATATYPE, H5E_CANTCONVERT, "can't convert superblock info", -1)
/* Encode all name templates */
p = buf + 8 + nseen*2*8;
@@ -858,7 +858,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
/* Make sure the name/version number is correct */
if (strcmp(name, "NCSAmult"))
- H5Epush_ret(func, H5E_FILE, H5E_BADVALUE, "invalid multi superblock", -1);
+ H5Epush_ret(func, H5E_FILE, H5E_BADVALUE, "invalid multi superblock", -1)
/* Set default values */
ALL_MEMBERS(mt) {
@@ -886,7 +886,7 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
memcpy(x, buf, (nseen*2*8));
buf += nseen*2*8;
if (H5Tconvert(H5T_STD_U64LE, H5T_NATIVE_HADDR, nseen*2, x, NULL, H5P_DEFAULT)<0)
- H5Epush_ret(func, H5E_DATATYPE, H5E_CANTCONVERT, "can't convert superblock info", -1);
+ H5Epush_ret(func, H5E_DATATYPE, H5E_CANTCONVERT, "can't convert superblock info", -1)
ap = (haddr_t*)x;
UNIQUE_MEMBERS(map, mt) {
memb_addr[_unmapped] = *ap++;
@@ -954,17 +954,17 @@ H5FD_multi_sb_decode(H5FD_t *_file, const char *name, const unsigned char *buf)
}
} END_MEMBERS;
if (compute_next(file)<0)
- H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "compute_next() failed", -1);
+ H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "compute_next() failed", -1)
/* Open all necessary files */
if (open_members(file)<0)
- H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "open_members() failed", -1);
+ H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "open_members() failed", -1)
/* Set the EOA marker for all open files */
UNIQUE_MEMBERS(file->fa.memb_map, mt) {
if (file->memb[mt])
if(H5FDset_eoa(file->memb[mt], memb_eoa[mt])<0)
- H5Epush_ret(func, H5E_INTERNAL, H5E_CANTSET, "set_eoa() failed", -1);
+ H5Epush_ret(func, H5E_INTERNAL, H5E_CANTSET, "set_eoa() failed", -1)
} END_MEMBERS;
return 0;
@@ -1051,7 +1051,7 @@ H5FD_multi_fapl_copy(const void *_old_fa)
if (new_fa->memb_name[mt]) free(new_fa->memb_name[mt]);
}
free(new_fa);
- H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "invalid freespace objects", NULL);
+ H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "invalid freespace objects", NULL)
}
return new_fa;
}
@@ -1086,7 +1086,7 @@ H5FD_multi_fapl_free(void *_fa)
for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1)) {
if (fa->memb_fapl[mt]>=0)
if(H5Pclose(fa->memb_fapl[mt])<0)
- H5Epush_ret(func, H5E_FILE, H5E_CLOSEERROR, "can't close property list", -1);
+ H5Epush_ret(func, H5E_FILE, H5E_CANTCLOSEOBJ, "can't close property list", -1)
if (fa->memb_name[mt])
free(fa->memb_name[mt]);
}
@@ -1138,7 +1138,7 @@ H5FD_multi_dxpl_copy(const void *_old_dx)
for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1))
(void)H5Pclose(new_dx->memb_dxpl[mt]);
free(new_dx);
- H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "invalid freespace objects", NULL);
+ H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "invalid freespace objects", NULL)
}
return new_dx;
}
@@ -1173,7 +1173,7 @@ H5FD_multi_dxpl_free(void *_dx)
for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; mt=(H5FD_mem_t)(mt+1))
if (dx->memb_dxpl[mt]>=0)
if(H5Pclose(dx->memb_dxpl[mt])<0)
- H5Epush_ret(func, H5E_FILE, H5E_CLOSEERROR, "can't close property list", -1);
+ H5Epush_ret(func, H5E_FILE, H5E_CANTCLOSEOBJ, "can't close property list", -1)
free(dx);
return 0;
}
@@ -1212,20 +1212,20 @@ H5FD_multi_open(const char *name, unsigned flags, hid_t fapl_id,
/* Check arguments */
if (!name || !*name)
- H5Epush_ret(func, H5E_ARGS, H5E_BADVALUE, "invalid file name", NULL);
+ H5Epush_ret(func, H5E_ARGS, H5E_BADVALUE, "invalid file name", NULL)
if (0==maxaddr || HADDR_UNDEF==maxaddr)
- H5Epush_ret(func, H5E_ARGS, H5E_BADRANGE, "bogus maxaddr", NULL);
+ H5Epush_ret(func, H5E_ARGS, H5E_BADRANGE, "bogus maxaddr", NULL)
/*
* Initialize the file from the file access properties, using default
* values if necessary.
*/
if (NULL==(file=calloc(1, sizeof(H5FD_multi_t))))
- H5Epush_ret(func, H5E_RESOURCE, H5E_NOSPACE, "memory allocation failed", NULL);
+ H5Epush_ret(func, H5E_RESOURCE, H5E_NOSPACE, "memory allocation failed", NULL)
if (H5P_FILE_ACCESS_DEFAULT==fapl_id || H5FD_MULTI!=H5Pget_driver(fapl_id)) {
close_fapl = fapl_id = H5Pcreate(H5P_FILE_ACCESS);
if(H5Pset_fapl_multi(fapl_id, NULL, NULL, NULL, NULL, TRUE)<0)
- H5Epush_goto(func, H5E_FILE, H5E_CANTSET, "can't set property value", error);
+ H5Epush_goto(func, H5E_FILE, H5E_CANTSET, "can't set property value", error)
}
fa = H5Pget_driver_info(fapl_id);
assert(fa);
@@ -1246,13 +1246,13 @@ H5FD_multi_open(const char *name, unsigned flags, hid_t fapl_id,
file->name = my_strdup(name);
if (close_fapl>=0)
if(H5Pclose(close_fapl)<0)
- H5Epush_goto(func, H5E_FILE, H5E_CLOSEERROR, "can't close property list", error);
+ H5Epush_goto(func, H5E_FILE, H5E_CANTCLOSEOBJ, "can't close property list", error)
/* Compute derived properties and open member files */
if (compute_next(file)<0)
- H5Epush_goto(func, H5E_INTERNAL, H5E_BADVALUE, "compute_next() failed", error);
+ H5Epush_goto(func, H5E_INTERNAL, H5E_BADVALUE, "compute_next() failed", error)
if (open_members(file)<0)
- H5Epush_goto(func, H5E_INTERNAL, H5E_BADVALUE, "open_members() failed", error);
+ H5Epush_goto(func, H5E_INTERNAL, H5E_BADVALUE, "open_members() failed", error)
/* We must have opened at least the superblock file */
if (H5FD_MEM_DEFAULT==(m=file->fa.memb_map[H5FD_MEM_SUPER]))
@@ -1326,7 +1326,7 @@ H5FD_multi_close(H5FD_t *_file)
}
} END_MEMBERS;
if (nerrors)
- H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "error closing member files", -1);
+ H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "error closing member files", -1)
/* Clean up other stuff */
ALL_MEMBERS(mt) {
@@ -1497,7 +1497,7 @@ H5FD_multi_set_eoa(H5FD_t *_file, haddr_t eoa)
status = H5FDset_eoa(file->memb[mmt], eoa-file->fa.memb_addr[mmt]);
} H5E_END_TRY;
if (status<0)
- H5Epush_ret(func, H5E_FILE, H5E_BADVALUE, "member H5FDset_eoa failed", -1);
+ H5Epush_ret(func, H5E_FILE, H5E_BADVALUE, "member H5FDset_eoa failed", -1)
}
/* Save new eoa for return later */
@@ -1541,7 +1541,7 @@ H5FD_multi_get_eof(H5FD_t *_file)
tmp = H5FDget_eof(file->memb[mt]);
} H5E_END_TRY;
if (HADDR_UNDEF==tmp)
- H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eof", HADDR_UNDEF);
+ H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "member file has unknown eof", HADDR_UNDEF)
if (tmp>0) tmp += file->fa.memb_addr[mt];
} else if (file->fa.relax) {
@@ -1553,7 +1553,7 @@ H5FD_multi_get_eof(H5FD_t *_file)
assert(HADDR_UNDEF!=tmp);
} else {
- H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "bad eof", HADDR_UNDEF);
+ H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "bad eof", HADDR_UNDEF)
}
if (tmp>eof) eof = tmp;
@@ -1586,9 +1586,9 @@ H5FD_multi_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle)
/* Get data type for multi driver */
if(H5Pget_multi_type(fapl, &type) < 0)
- H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "can't get data type for multi driver", -1);
+ H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "can't get data type for multi driver", -1)
if(type<H5FD_MEM_DEFAULT || type>=H5FD_MEM_NTYPES)
- H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "data type is out of range", -1);
+ H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "data type is out of range", -1)
mmt = file->fa.memb_map[type];
if(H5FD_MEM_DEFAULT==mmt) mmt = type;
@@ -1623,9 +1623,8 @@ H5FD_multi_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size)
mmt = file->fa.memb_map[type];
if (H5FD_MEM_DEFAULT==mmt) mmt = type;
- if (HADDR_UNDEF==(addr=H5FDalloc(file->memb[mmt], type, dxpl_id, size))) {
- H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "member file can't alloc", HADDR_UNDEF);
- }
+ if (HADDR_UNDEF==(addr=H5FDalloc(file->memb[mmt], type, dxpl_id, size)))
+ H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "member file can't alloc", HADDR_UNDEF)
addr += file->fa.memb_addr[mmt];
if (addr+size>file->eoa) file->eoa = addr+size;
return addr;
@@ -1845,7 +1844,7 @@ H5FD_multi_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing)
}
}
if (nerrors)
- H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "error flushing member files", -1);
+ H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "error flushing member files", -1)
return 0;
}
@@ -1949,7 +1948,7 @@ open_members(H5FD_multi_t *file)
}
} END_MEMBERS;
if (nerrors)
- H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "error opening member files", -1);
+ H5Epush_ret(func, H5E_INTERNAL, H5E_BADVALUE, "error opening member files", -1)
return 0;
}
diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h
index cd8d4fe..2a412cc 100644
--- a/src/H5FDprivate.h
+++ b/src/H5FDprivate.h
@@ -69,7 +69,7 @@ H5_DLL herr_t H5FD_write(H5FD_t *file, H5FD_mem_t type, hid_t dxpl_id, haddr_t a
H5_DLL herr_t H5FD_flush(H5FD_t *file, hid_t dxpl_id, unsigned closing);
H5_DLL herr_t H5FD_get_fileno(const H5FD_t *file, unsigned long *filenum);
H5_DLL herr_t H5FD_get_vfd_handle(H5FD_t *file, hid_t fapl, void** file_handle);
-H5_DLL hssize_t H5FD_get_freespace(H5FD_t *file);
+H5_DLL hssize_t H5FD_get_freespace(const H5FD_t *file);
H5_DLL htri_t H5FD_can_extend(H5FD_t *file, H5FD_mem_t type, haddr_t addr,
hsize_t size, hsize_t extra_requested);
H5_DLL herr_t H5FD_extend(H5FD_t *file, H5FD_mem_t type, haddr_t addr,
diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c
index 36362fd..94babea 100644
--- a/src/H5FDsec2.c
+++ b/src/H5FDsec2.c
@@ -24,6 +24,9 @@
* application to the same file).
*/
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5FD_sec2_init_interface
+
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
#define PABLO_MASK H5FD_sec2_mask
@@ -187,10 +190,6 @@ static const H5FD_class_t H5FD_sec2_g = {
H5FD_FLMAP_SINGLE /*fl_map */
};
-/* Interface initialization */
-#define INTERFACE_INIT H5FD_sec2_init_interface
-static int interface_initialize_g = 0;
-
/* Declare a free list to manage the H5FD_sec2_t struct */
H5FL_DEFINE_STATIC(H5FD_sec2_t);
@@ -376,7 +375,6 @@ H5FD_sec2_open(const char *name, unsigned flags, hid_t UNUSED fapl_id,
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "unable to allocate file struct")
file->fd = fd;
-
H5_ASSIGN_OVERFLOW(file->eof,sb.st_size,h5_stat_size_t,haddr_t);
file->pos = HADDR_UNDEF;
file->op = OP_UNKNOWN;
diff --git a/src/H5FDsrb.c b/src/H5FDsrb.c
index 6ae7cbf..f739500 100644
--- a/src/H5FDsrb.c
+++ b/src/H5FDsrb.c
@@ -19,6 +19,9 @@
* Purpose: SRB I/O driver.
*/
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5FD_srb_init_interface
+
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
#define PABLO_MASK H5FD_srb_mask
@@ -157,10 +160,6 @@ static const H5FD_class_t H5FD_srb_g = {
H5FD_FLMAP_SINGLE /*fl_map */
};
-/* Interface initialization */
-#define INTERFACE_INIT H5FD_srb_init_interface
-static int interface_initialize_g = 0;
-
/*--------------------------------------------------------------------------
NAME
diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c
index 1e60d08..c144476 100644
--- a/src/H5FDstdio.c
+++ b/src/H5FDstdio.c
@@ -275,7 +275,7 @@ H5Pset_fapl_stdio(hid_t fapl_id)
H5Eclear();
if(0 == H5Pisa_class(fapl_id, H5P_FILE_ACCESS))
- H5Epush_ret(func, H5E_PLIST, H5E_BADTYPE, "not a file access property list", -1);
+ H5Epush_ret(func, H5E_PLIST, H5E_BADTYPE, "not a file access property list", -1)
return H5Pset_driver(fapl_id, H5FD_STDIO, NULL);
}
@@ -336,21 +336,21 @@ H5FD_stdio_open( const char *name, unsigned flags, hid_t fapl_id,
/* Check arguments */
if (!name || !*name)
- H5Epush_ret(func, H5E_ARGS, H5E_BADVALUE, "invalid file name", NULL);
+ H5Epush_ret(func, H5E_ARGS, H5E_BADVALUE, "invalid file name", NULL)
if (0==maxaddr || HADDR_UNDEF==maxaddr)
- H5Epush_ret(func, H5E_ARGS, H5E_BADRANGE, "bogus maxaddr", NULL);
+ H5Epush_ret(func, H5E_ARGS, H5E_BADRANGE, "bogus maxaddr", NULL)
if (ADDR_OVERFLOW(maxaddr))
- H5Epush_ret(func, H5E_ARGS, H5E_OVERFLOW, "maxaddr too large", NULL);
+ H5Epush_ret(func, H5E_ARGS, H5E_OVERFLOW, "maxaddr too large", NULL)
if (access(name, F_OK) < 0) {
if ((flags & H5F_ACC_CREAT) && (flags & H5F_ACC_RDWR)) {
f = fopen(name, "wb+");
write_access=1; /* Note the write access */
- } else {
- H5Epush_ret(func, H5E_IO, H5E_CANTOPENFILE, "file doesn't exist and CREAT wasn't specified", NULL);
}
+ else
+ H5Epush_ret(func, H5E_IO, H5E_CANTOPENFILE, "file doesn't exist and CREAT wasn't specified", NULL)
} else if ((flags & H5F_ACC_CREAT) && (flags & H5F_ACC_EXCL)) {
- H5Epush_ret(func, H5E_IO, H5E_FILEEXISTS, "file exists but CREAT and EXCL were specified", NULL);
+ H5Epush_ret(func, H5E_IO, H5E_FILEEXISTS, "file exists but CREAT and EXCL were specified", NULL)
} else if (flags & H5F_ACC_RDWR) {
if (flags & H5F_ACC_TRUNC)
f = fopen(name, "wb+");
@@ -361,11 +361,11 @@ H5FD_stdio_open( const char *name, unsigned flags, hid_t fapl_id,
f = fopen(name, "rb");
}
if (!f)
- H5Epush_ret(func, H5E_IO, H5E_CANTOPENFILE, "fopen failed", NULL);
+ H5Epush_ret(func, H5E_IO, H5E_CANTOPENFILE, "fopen failed", NULL)
/* Build the return value */
if (NULL==(file = calloc(1,sizeof(H5FD_stdio_t))))
- H5Epush_ret(func, H5E_RESOURCE, H5E_NOSPACE, "memory allocation failed", NULL);
+ H5Epush_ret(func, H5E_RESOURCE, H5E_NOSPACE, "memory allocation failed", NULL)
file->fp = f;
file->op = H5FD_STDIO_OP_SEEK;
file->pos = HADDR_UNDEF;
@@ -423,7 +423,7 @@ H5FD_stdio_close(H5FD_t *_file)
H5Eclear();
if (fclose(file->fp) < 0)
- H5Epush_ret(func, H5E_IO, H5E_CLOSEERROR, "fclose failed", -1);
+ H5Epush_ret(func, H5E_IO, H5E_CLOSEERROR, "fclose failed", -1)
free(file);
@@ -647,7 +647,7 @@ H5FD_stdio_get_handle(H5FD_t *_file, hid_t fapl, void** file_handle)
*file_handle = &(file->fp);
if(*file_handle==NULL)
- H5Epush_ret(func, H5E_IO, H5E_WRITEERROR, "get handle failed", -1);
+ H5Epush_ret(func, H5E_IO, H5E_WRITEERROR, "get handle failed", -1)
return(0);
}
@@ -693,11 +693,11 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz
/* Check for overflow */
if (HADDR_UNDEF==addr)
- H5Epush_ret (func, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1);
+ H5Epush_ret (func, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1)
if (REGION_OVERFLOW(addr, size))
- H5Epush_ret (func, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1);
+ H5Epush_ret (func, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1)
if (addr+size>file->eoa)
- H5Epush_ret (func, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1);
+ H5Epush_ret (func, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1)
/* Check easy cases */
if (0 == size)
@@ -715,7 +715,7 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz
if (fseek(file->fp, (long)addr, SEEK_SET) < 0) {
file->op = H5FD_STDIO_OP_UNKNOWN;
file->pos = HADDR_UNDEF;
- H5Epush_ret(func, H5E_IO, H5E_SEEKERROR, "fseek failed", -1);
+ H5Epush_ret(func, H5E_IO, H5E_SEEKERROR, "fseek failed", -1)
}
file->pos = addr;
}
@@ -738,7 +738,7 @@ H5FD_stdio_read(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, siz
if (n == 0 && ferror(file->fp)) {
file->op = H5FD_STDIO_OP_UNKNOWN;
file->pos = HADDR_UNDEF;
- H5Epush_ret(func, H5E_IO, H5E_READERROR, "fread failed", -1);
+ H5Epush_ret(func, H5E_IO, H5E_READERROR, "fread failed", -1)
} else if (n < size) {
memset((unsigned char *)buf + n, 0, (size - n));
}
@@ -791,11 +791,11 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
/* Check for overflow conditions */
if (HADDR_UNDEF==addr)
- H5Epush_ret (func, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1);
+ H5Epush_ret (func, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1)
if (REGION_OVERFLOW(addr, size))
- H5Epush_ret (func, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1);
+ H5Epush_ret (func, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1)
if (addr+size>file->eoa)
- H5Epush_ret (func, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1);
+ H5Epush_ret (func, H5E_IO, H5E_OVERFLOW, "file address overflowed", -1)
/*
* Seek to the correct file position.
@@ -805,7 +805,7 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
if (fseek(file->fp, (long)addr, SEEK_SET) < 0) {
file->op = H5FD_STDIO_OP_UNKNOWN;
file->pos = HADDR_UNDEF;
- H5Epush_ret(func, H5E_IO, H5E_SEEKERROR, "fseek failed", -1);
+ H5Epush_ret(func, H5E_IO, H5E_SEEKERROR, "fseek failed", -1)
}
file->pos = addr;
}
@@ -818,7 +818,7 @@ H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr,
if (size != fwrite(buf, 1, size, file->fp)) {
file->op = H5FD_STDIO_OP_UNKNOWN;
file->pos = HADDR_UNDEF;
- H5Epush_ret(func, H5E_IO, H5E_WRITEERROR, "fwrite failed", -1);
+ H5Epush_ret(func, H5E_IO, H5E_WRITEERROR, "fwrite failed", -1)
}
/*
@@ -883,13 +883,14 @@ H5FD_stdio_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing)
li.QuadPart = (LONGLONG)file->eoa;
(void)SetFilePointer((HANDLE)filehandle,li.LowPart,&li.HighPart,FILE_BEGIN);
if(SetEndOfFile((HANDLE)filehandle)==0)
- H5Epush_ret(func, H5E_IO, H5E_SEEKERROR, "unable to extend file properly", -1);
+ H5Epush_ret(func, H5E_IO, H5E_SEEKERROR, "unable to extend file properly", -1)
#else /* WIN32 */
int fd=fileno(file->fp); /* File descriptor for HDF5 file */
if (-1==file_truncate(fd, (file_offset_t)file->eoa))
- H5Epush_ret(func, H5E_IO, H5E_SEEKERROR, "unable to extend file properly", -1);
+ H5Epush_ret(func, H5E_IO, H5E_SEEKERROR, "unable to extend file properly", -1)
#endif /* WIN32 */
+
/* Update the eof value */
file->eof = file->eoa;
@@ -903,13 +904,13 @@ H5FD_stdio_flush(H5FD_t *_file, hid_t dxpl_id, unsigned closing)
*/
if(!closing) {
if (fflush(file->fp) < 0)
- H5Epush_ret(func, H5E_IO, H5E_WRITEERROR, "fflush failed", -1);
+ H5Epush_ret(func, H5E_IO, H5E_WRITEERROR, "fflush failed", -1)
} /* end if */
} /* end if */
else {
/* Double-check for problems */
if (file->eoa>file->eof)
- H5Epush_ret(func, H5E_IO, H5E_TRUNCATED, "eoa>eof!", -1);
+ H5Epush_ret(func, H5E_IO, H5E_TRUNCATED, "eoa>eof!", -1)
} /* end else */
return(0);
diff --git a/src/H5FDstream.c b/src/H5FDstream.c
index d3dad5e..5e02623 100644
--- a/src/H5FDstream.c
+++ b/src/H5FDstream.c
@@ -19,6 +19,8 @@
*
*/
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5FD_stream_init_interface
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
@@ -202,10 +204,6 @@ static const H5FD_class_t H5FD_stream_g = {
H5FD_FLMAP_SINGLE /*fl_map */
};
-/* Interface initialization */
-#define INTERFACE_INIT H5FD_stream_init_interface
-static int interface_initialize_g = 0;
-
/*--------------------------------------------------------------------------
NAME
diff --git a/src/H5FL.c b/src/H5FL.c
index 1d49064..b8fc9ab 100644
--- a/src/H5FL.c
+++ b/src/H5FL.c
@@ -26,6 +26,9 @@
* move frequently accessed free lists to the head of the queue.
*/
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5FL_init_interface
+
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
#define PABLO_MASK H5FL_mask
@@ -37,9 +40,6 @@
#include "H5FLprivate.h" /* Free Lists */
#include "H5MMprivate.h" /* Memory management */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
-
/*
* Private type definitions
*/
@@ -112,6 +112,31 @@ static herr_t H5FL_blk_gc_list(H5FL_blk_head_t *head);
H5FL_DEFINE(H5FL_blk_node_t);
+/*--------------------------------------------------------------------------
+NAME
+ H5FL_init_interface -- Initialize interface-specific information
+USAGE
+ herr_t H5FL_init_interface()
+
+RETURNS
+ Non-negative on success/Negative on failure
+DESCRIPTION
+ Initializes any interface-specific data or routines.
+
+--------------------------------------------------------------------------*/
+static herr_t
+H5FL_init_interface(void)
+{
+ herr_t ret_value=SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_init_interface)
+
+ /* Nothing currently... */
+
+ FUNC_LEAVE_NOAPI(ret_value)
+} /* H5FL_init_interface() */
+
+
/*-------------------------------------------------------------------------
* Function: H5FL_malloc
*
@@ -139,7 +164,7 @@ H5FL_malloc(size_t mem_size)
if(NULL==(ret_value=H5MM_malloc(mem_size))) {
/* If we can't allocate the memory now, try garbage collecting first */
if(H5FL_garbage_coll()<0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, NULL, "garbage collection failed during allocation")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, NULL, "garbage collection failed during allocation")
/* Now try allocating the memory again */
if(NULL==(ret_value=H5MM_malloc(mem_size)))
@@ -252,12 +277,12 @@ H5FL_reg_free(H5FL_reg_head_t *head, void *obj)
/* First check this particular list */
if(head->list_mem>H5FL_reg_lst_mem_lim)
if(H5FL_reg_gc_list(head)<0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, NULL, "garbage collection failed during free")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, NULL, "garbage collection failed during free")
/* Then check the global amount memory on regular free lists */
if(H5FL_reg_gc_head.mem_freed>H5FL_reg_glb_mem_lim)
if(H5FL_reg_gc()<0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, NULL, "garbage collection failed during free")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, NULL, "garbage collection failed during free")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -448,7 +473,7 @@ H5FL_reg_gc(void)
while(gc_node!=NULL) {
/* Release the free nodes on the list */
if(H5FL_reg_gc_list(gc_node->list)<0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "garbage collection of list failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, FAIL, "garbage collection of list failed")
/* Go on to the next free list to garbage collect */
gc_node=gc_node->next;
@@ -495,7 +520,7 @@ H5FL_reg_term(void)
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_reg_term)
- if (interface_initialize_g) {
+ if (H5_interface_initialize_g) {
/* Free the nodes on the garbage collection list, keeping nodes with allocations outstanding */
left=NULL;
while(H5FL_reg_gc_head.first!=NULL) {
@@ -525,7 +550,7 @@ H5FL_reg_term(void)
/* Point to the list of nodes left with allocations open, if any */
H5FL_reg_gc_head.first=left;
if (!left)
- interface_initialize_g = 0; /*this layer has reached its initial state*/
+ H5_interface_initialize_g = 0; /*this layer has reached its initial state*/
}
/* Terminating this layer never affects other layers; rather, other layers affect
@@ -911,12 +936,12 @@ H5FL_blk_free(H5FL_blk_head_t *head, void *block)
/* First check this particular list */
if(head->list_mem>H5FL_blk_lst_mem_lim)
if(H5FL_blk_gc_list(head)<0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, NULL, "garbage collection failed during free")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, NULL, "garbage collection failed during free")
/* Then check the global amount memory on block free lists */
if(H5FL_blk_gc_head.mem_freed>H5FL_blk_glb_mem_lim)
if(H5FL_blk_gc()<0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, NULL, "garbage collection failed during free")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, NULL, "garbage collection failed during free")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1072,7 +1097,7 @@ H5FL_blk_gc(void)
while(gc_node!=NULL) {
/* For each free list being garbage collected, walk through the nodes and free them */
if(H5FL_blk_gc_list(gc_node->pq)<0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "garbage collection of list failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, FAIL, "garbage collection of list failed")
/* Go on to the next free list to garbage collect */
gc_node=gc_node->next;
@@ -1263,12 +1288,12 @@ H5FL_arr_free(H5FL_arr_head_t *head, void *obj)
/* First check this particular list */
if(head->list_mem>H5FL_arr_lst_mem_lim)
if(H5FL_arr_gc_list(head)<0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, NULL, "garbage collection failed during free")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, NULL, "garbage collection failed during free")
/* Then check the global amount memory on array free lists */
if(H5FL_arr_gc_head.mem_freed>H5FL_arr_glb_mem_lim)
if(H5FL_arr_gc()<0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, NULL, "garbage collection failed during free")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, NULL, "garbage collection failed during free")
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1539,7 +1564,7 @@ H5FL_arr_gc(void)
while(gc_arr_node!=NULL) {
/* Release the free nodes on the list */
if(H5FL_arr_gc_list(gc_arr_node->list)<0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "garbage collection of list failed")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, FAIL, "garbage collection of list failed")
/* Go on to the next free list to garbage collect */
gc_arr_node=gc_arr_node->next;
@@ -1634,16 +1659,11 @@ printf("H5FL_arr_term: head->name=%s, head->allocated=%d\n", H5FL_arr_gc_head.fi
void *
H5FL_seq_free(H5FL_seq_head_t *head, void *obj)
{
- void *ret_value=NULL; /* Return value */
-
- FUNC_ENTER_NOAPI(H5FL_seq_free, NULL)
-
- /* The H5MM_xfree code allows obj to null */
- if (!obj)
- HGOTO_DONE (NULL)
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5FL_seq_free)
/* Double check parameters */
assert(head);
+ assert(obj);
/* Make certain that the free list is initialized */
assert(head->queue.init);
@@ -1651,8 +1671,7 @@ H5FL_seq_free(H5FL_seq_head_t *head, void *obj)
/* Use block routine */
H5FL_blk_free(&(head->queue),obj);
-done:
- FUNC_LEAVE_NOAPI(ret_value)
+ FUNC_LEAVE_NOAPI(NULL)
} /* end H5FL_seq_free() */
@@ -1782,15 +1801,15 @@ H5FL_garbage_coll(void)
/* Garbage collect the free lists for array objects */
if(H5FL_arr_gc()<0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't garbage collect array objects")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, FAIL, "can't garbage collect array objects")
/* Garbage collect free lists for blocks */
if(H5FL_blk_gc()<0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't garbage collect block objects")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, FAIL, "can't garbage collect block objects")
/* Garbage collect the free lists for regular objects */
if(H5FL_reg_gc()<0)
- HGOTO_ERROR(H5E_RESOURCE, H5E_CANTFREE, FAIL, "can't garbage collect regular objects")
+ HGOTO_ERROR(H5E_RESOURCE, H5E_CANTGC, FAIL, "can't garbage collect regular objects")
done:
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5FO.c b/src/H5FO.c
index 3eb6720..dbfdd58 100644
--- a/src/H5FO.c
+++ b/src/H5FO.c
@@ -32,10 +32,6 @@
#include "H5FOprivate.h" /* File objects */
#include "H5Oprivate.h" /* Object headers */
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
-
/* Private typedefs */
/* Information about object objects in a file */
@@ -113,7 +109,7 @@ H5FO_opened(const H5F_t *f, haddr_t addr)
H5FO_open_obj_t *open_obj; /* Information about open object */
void *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5FO_opened,NULL)
+ FUNC_ENTER_NOAPI_NOFUNC(H5FO_opened)
/* Sanity check */
assert(f);
@@ -129,7 +125,6 @@ H5FO_opened(const H5F_t *f, haddr_t addr)
else
ret_value=NULL;
-done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FO_opened() */
@@ -264,7 +259,7 @@ H5FO_mark(const H5F_t *f, haddr_t addr, hbool_t deleted)
H5FO_open_obj_t *open_obj; /* Information about open object */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5FO_mark,FAIL)
+ FUNC_ENTER_NOAPI_NOFUNC(H5FO_mark)
/* Sanity check */
assert(f);
@@ -278,7 +273,6 @@ H5FO_mark(const H5F_t *f, haddr_t addr, hbool_t deleted)
else
ret_value=FAIL;
-done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FO_mark() */
@@ -309,7 +303,7 @@ H5FO_marked(const H5F_t *f, haddr_t addr)
H5FO_open_obj_t *open_obj; /* Information about open object */
htri_t ret_value=FAIL; /* Return value */
- FUNC_ENTER_NOAPI(H5FO_marked,FAIL)
+ FUNC_ENTER_NOAPI_NOFUNC(H5FO_marked)
/* Sanity check */
assert(f);
@@ -321,7 +315,6 @@ H5FO_marked(const H5F_t *f, haddr_t addr)
if((open_obj=H5SL_search(f->shared->open_objs,&addr))!=NULL)
ret_value=open_obj->deleted;
-done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5FO_marked() */
diff --git a/src/H5FS.c b/src/H5FS.c
index 0c02034..6543fc5 100644
--- a/src/H5FS.c
+++ b/src/H5FS.c
@@ -25,16 +25,16 @@
* expected to be a rare condition.
*
*/
+
+/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
+#define PABLO_MASK H5FS_mask
+
#include "H5private.h" /* Generic Functions */
#include "H5FSprivate.h" /* Private function stack routines */
#ifdef H5_HAVE_FUNCSTACK
-#define PABLO_MASK H5FS_mask
-
-/* Interface initialization? */
-#define INTERFACE_INIT NULL
-
#ifdef H5_HAVE_THREADSAFE
/*
* The per-thread function stack. pthread_once() initializes a special
@@ -80,7 +80,7 @@ H5FS_get_stack(void)
{
H5FS_t *fstack;
- FUNC_ENTER_NOAPI_NOFS(H5FS_get_stack);
+ FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5FS_get_stack);
fstack = pthread_getspecific(H5TS_funcstk_key_g);
if (!fstack) {
@@ -116,7 +116,7 @@ H5FS_print(FILE *stream)
int i; /* Local index ariable */
/* Don't push this function on the function stack... :-) */
- FUNC_ENTER_NOAPI_NOFS(H5FS_print);
+ FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5FS_print);
/* Sanity check */
assert(fstack);
@@ -164,7 +164,7 @@ 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_NOFS(H5FS_push);
+ FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5FS_push);
/* Sanity check */
assert (fstack);
@@ -201,7 +201,7 @@ H5FS_pop(void)
H5FS_t *fstack = H5FS_get_my_stack ();
/* Don't push this function on the function stack... :-) */
- FUNC_ENTER_NOAPI_NOFS(H5FS_pop);
+ FUNC_ENTER_NOAPI_NOFUNC_NOFS(H5FS_pop);
/* Sanity check */
assert (fstack);
diff --git a/src/H5Fpkg.h b/src/H5Fpkg.h
index 87be161..7997524 100644
--- a/src/H5Fpkg.h
+++ b/src/H5Fpkg.h
@@ -159,8 +159,6 @@ union H5D_storage_t;
H5_DLL void H5F_encode_length_unusual(const H5F_t *f, uint8_t **p, uint8_t *l);
#endif /* NOT_YET */
H5_DLL herr_t H5F_mountpoint(struct H5G_entry_t *find/*in,out*/);
-H5_DLL herr_t H5F_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream,
- int indent, int fwidth);
#endif
diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h
index 8c369fb..5c1909f 100644
--- a/src/H5Fprivate.h
+++ b/src/H5Fprivate.h
@@ -43,9 +43,8 @@ typedef struct H5F_t H5F_t;
*/
#define H5F_FLUSH_NONE (0U) /* No flags specified */
#define H5F_FLUSH_INVALIDATE (1U << 0) /* Invalidate cached data */
-#define H5F_FLUSH_ALLOC_ONLY (1U << 1) /* Allocate space for user and super blocks */
-#define H5F_FLUSH_CLOSING (1U << 2) /* Closing the file */
-#define H5F_FLUSH_CLEAR_ONLY (1U << 3) /* Don't write, just clear dirty flags */
+#define H5F_FLUSH_CLOSING (1U << 1) /* Closing the file */
+#define H5F_FLUSH_CLEAR_ONLY (1U << 2) /* Don't write, just clear dirty flags */
/*
* Encode and decode macros for file meta-data.
@@ -459,4 +458,7 @@ 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,
void *close_data);
+/* Debugging functions */
+H5_DLL herr_t H5F_debug(H5F_t *f, hid_t dxpl_id, FILE * stream, int indent, int fwidth);
+
#endif
diff --git a/src/H5Fpublic.h b/src/H5Fpublic.h
index c83f12e..4718aa3 100644
--- a/src/H5Fpublic.h
+++ b/src/H5Fpublic.h
@@ -35,13 +35,13 @@
*
*/
-/* When this header is included from H5Fprivate.h, don't make calls to H5check() */
+/* When this header is included from a private header, don't make calls to H5check() */
#undef H5CHECK
-#ifndef _H5Fprivate_H
+#ifndef _H5private_H
#define H5CHECK H5check(),
-#else /* _H5Fprivate_H */
+#else /* _H5private_H */
#define H5CHECK
-#endif /* _H5Fprivate_H */
+#endif /* _H5private_H */
#define H5F_ACC_RDONLY (H5CHECK 0x0000u) /*absence of rdwr => rd-only */
#define H5F_ACC_RDWR (H5CHECK 0x0001u) /*open for read and write */
diff --git a/src/H5G.c b/src/H5G.c
index 5e473f8..04282de 100644
--- a/src/H5G.c
+++ b/src/H5G.c
@@ -88,6 +88,9 @@
#define H5G_PACKAGE /*suppress error message about including H5Gpkg.h */
#define H5F_PACKAGE /*suppress error about including H5Fpkg */
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5G_init_interface
+
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
#define PABLO_MASK H5G_mask
@@ -121,11 +124,6 @@
#define H5G_TARGET_SLINK 0x0001
#define H5G_TARGET_MOUNT 0x0002
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT H5G_init_interface
-static herr_t H5G_init_interface(void);
-
/* Local typedefs */
/* Struct only used by change name callback function */
@@ -287,7 +285,6 @@ H5Gopen(hid_t loc_id, const char *name)
H5G_t *grp = NULL;
H5G_entry_t *loc = NULL;
H5G_entry_t ent;
- hid_t dxpl_id = H5AC_dxpl_id; /* dxpl to use to open group */
FUNC_ENTER_API(H5Gopen, FAIL);
H5TRACE2("i","is",loc_id,name);
@@ -299,11 +296,11 @@ H5Gopen(hid_t loc_id, const char *name)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name");
/* Open the parent group, making sure it's a group */
- if (H5G_find(loc, name, NULL, &ent/*out*/, dxpl_id) < 0)
+ if (H5G_find(loc, name, NULL, &ent/*out*/, H5AC_dxpl_id) < 0)
HGOTO_ERROR(H5E_SYM, H5E_NOTFOUND, FAIL, "group not found");
/* Open the group */
- if ((grp = H5G_open(&ent, dxpl_id)) ==NULL)
+ if ((grp = H5G_open(&ent, H5AC_dxpl_id))==NULL)
HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open group");
/* Register an atom for the group */
@@ -620,7 +617,7 @@ H5Gget_objtype_by_idx(hid_t loc_id, hsize_t idx)
H5G_obj_t ret_value;
FUNC_ENTER_API(H5Gget_objtype_by_idx, H5G_UNKNOWN);
- H5TRACE2("Is","ih",loc_id,idx);
+ H5TRACE2("Go","ih",loc_id,idx);
/* Check args */
if (NULL==(loc=H5G_loc (loc_id)))
@@ -1067,7 +1064,7 @@ H5G_term_interface(void)
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_term_interface);
- if (interface_initialize_g) {
+ if (H5_interface_initialize_g) {
if ((n=H5I_nmembers(H5I_GROUP))) {
H5I_clear_group(H5I_GROUP, FALSE);
} else {
@@ -1085,7 +1082,7 @@ H5G_term_interface(void)
H5G_comp_alloc_g = 0;
/* Mark closed */
- interface_initialize_g = 0;
+ H5_interface_initialize_g = 0;
n = 1; /*H5I*/
}
}
@@ -2199,6 +2196,7 @@ herr_t
H5G_free(H5G_t *grp)
{
herr_t ret_value=SUCCEED; /* Return value */
+
FUNC_ENTER_NOAPI(H5G_free, FAIL);
assert(grp && grp->shared);
@@ -2469,8 +2467,8 @@ H5G_loc (hid_t loc_id)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "unable to get symbol table entry of attribute");
break;
- case H5I_TEMPBUF:
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "unable to get symbol table entry of buffer");
+ case H5I_REFERENCE:
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "unable to get symbol table entry of reference");
default:
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid object ID");
diff --git a/src/H5Gent.c b/src/H5Gent.c
index 4d9fe62..4aaaf70 100644
--- a/src/H5Gent.c
+++ b/src/H5Gent.c
@@ -30,9 +30,6 @@
#include "H5HLprivate.h" /* Local Heaps */
#include "H5MMprivate.h" /* Memory management */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
-
/* Private prototypes */
#ifdef NOT_YET
static herr_t H5G_ent_modified(H5G_entry_t *ent, H5G_type_t cache_type);
@@ -190,9 +187,8 @@ H5G_ent_decode(H5F_t *f, const uint8_t **pp, H5G_entry_t *ent)
{
const uint8_t *p_ret = *pp;
uint32_t tmp;
- herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5G_ent_decode, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5G_ent_decode);
/* check arguments */
assert(f);
@@ -229,8 +225,7 @@ H5G_ent_decode(H5F_t *f, const uint8_t **pp, H5G_entry_t *ent)
*pp = p_ret + H5G_SIZEOF_ENTRY(f);
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
}
@@ -310,9 +305,8 @@ herr_t
H5G_ent_encode(H5F_t *f, uint8_t **pp, const H5G_entry_t *ent)
{
uint8_t *p_ret = *pp + H5G_SIZEOF_ENTRY(f);
- herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5G_ent_encode, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5G_ent_encode);
/* check arguments */
assert(f);
@@ -354,8 +348,7 @@ H5G_ent_encode(H5F_t *f, uint8_t **pp, const H5G_entry_t *ent)
while (*pp < p_ret) *(*pp)++ = 0;
*pp = p_ret;
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
}
@@ -398,9 +391,8 @@ herr_t
H5G_ent_copy(H5G_entry_t *dst, const H5G_entry_t *src, H5G_ent_copy_depth_t depth)
{
H5RS_str_t *tmp_user_path_r=NULL; /* Temporary string pointer for entry's user path */
- herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5G_ent_copy, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5G_ent_copy);
/* Check arguments */
assert(src);
@@ -427,8 +419,7 @@ H5G_ent_copy(H5G_entry_t *dst, const H5G_entry_t *src, H5G_ent_copy_depth_t dept
dst->canon_path_r=NULL;
} /* end if */
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
}
@@ -456,9 +447,8 @@ 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;
- herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5G_ent_debug, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5G_ent_debug);
/* Calculate the indent & field width values for nested information */
nested_indent=indent+3;
@@ -519,6 +509,5 @@ H5G_ent_debug(H5F_t UNUSED *f, hid_t dxpl_id, const H5G_entry_t *ent, FILE * str
break;
}
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
}
diff --git a/src/H5Gnode.c b/src/H5Gnode.c
index 9fdcc5c..72893cd 100644
--- a/src/H5Gnode.c
+++ b/src/H5Gnode.c
@@ -65,7 +65,7 @@ typedef struct H5G_node_key_t {
/* PRIVATE PROTOTYPES */
static herr_t H5G_node_serialize(H5F_t *f, H5G_node_t *sym, size_t size, uint8_t *buf);
-static size_t H5G_node_size(H5F_t *f);
+static size_t H5G_node_size(const H5F_t *f);
static herr_t H5G_node_shared_free(void *shared);
/* Metadata cache callbacks */
@@ -75,11 +75,11 @@ static herr_t H5G_node_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t a
H5G_node_t *sym);
static herr_t H5G_node_dest(H5F_t *f, H5G_node_t *sym);
static herr_t H5G_node_clear(H5F_t *f, H5G_node_t *sym, hbool_t destroy);
-static herr_t H5G_compute_size(H5F_t *f, H5G_node_t *sym, size_t *size_ptr);
+static herr_t H5G_compute_size(const H5F_t *f, const H5G_node_t *sym, size_t *size_ptr);
/* B-tree callbacks */
static size_t H5G_node_sizeof_rkey(const H5F_t *f, const void *_udata);
-static H5RC_t *H5G_node_get_shared(H5F_t *f, const void *_udata);
+static H5RC_t *H5G_node_get_shared(const H5F_t *f, const void *_udata);
static herr_t H5G_node_create(H5F_t *f, hid_t dxpl_id, H5B_ins_t op, void *_lt_key,
void *_udata, void *_rt_key,
haddr_t *addr_p/*out*/);
@@ -88,7 +88,7 @@ static int H5G_node_cmp2(H5F_t *f, hid_t dxpl_id, void *_lt_key, void *_udata,
static int H5G_node_cmp3(H5F_t *f, hid_t dxpl_id, void *_lt_key, void *_udata,
void *_rt_key);
static herr_t H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_lt_key,
- void *_udata, const void *_rt_key);
+ void *_udata);
static H5B_ins_t H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_lt_key,
hbool_t *lt_key_changed, void *_md_key,
void *_udata, void *_rt_key,
@@ -97,9 +97,9 @@ static H5B_ins_t H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *_l
static H5B_ins_t H5G_node_remove(H5F_t *f, hid_t dxpl_id, haddr_t addr, void *lt_key,
hbool_t *lt_key_changed, void *udata,
void *rt_key, hbool_t *rt_key_changed);
-static herr_t H5G_node_decode_key(H5F_t *f, H5B_t *bt, uint8_t *raw,
+static herr_t H5G_node_decode_key(const H5F_t *f, const H5B_t *bt, const uint8_t *raw,
void *_key);
-static herr_t H5G_node_encode_key(H5F_t *f, H5B_t *bt, uint8_t *raw,
+static herr_t H5G_node_encode_key(const H5F_t *f, const H5B_t *bt, uint8_t *raw,
void *_key);
static herr_t H5G_node_debug_key(FILE *stream, H5F_t *f, hid_t dxpl_id,
int indent, int fwidth, const void *key,
@@ -134,10 +134,6 @@ H5B_class_t H5B_SNODE[1] = {{
H5G_node_debug_key, /*debug */
}};
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
-
/* Declare a free list to manage the H5B_shared_t struct */
H5FL_EXTERN(H5B_shared_t);
@@ -203,7 +199,7 @@ H5G_node_sizeof_rkey(const H5F_t *f, const void UNUSED * udata)
*-------------------------------------------------------------------------
*/
static H5RC_t *
-H5G_node_get_shared(H5F_t *f, const void UNUSED *_udata)
+H5G_node_get_shared(const H5F_t *f, const void UNUSED *_udata)
{
H5RC_t *rc;
@@ -236,7 +232,7 @@ H5G_node_get_shared(H5F_t *f, const void UNUSED *_udata)
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_node_decode_key(H5F_t *f, H5B_t UNUSED *bt, uint8_t *raw, void *_key)
+H5G_node_decode_key(const H5F_t *f, const H5B_t UNUSED *bt, const uint8_t *raw, void *_key)
{
H5G_node_key_t *key = (H5G_node_key_t *) _key;
@@ -268,7 +264,7 @@ H5G_node_decode_key(H5F_t *f, H5B_t UNUSED *bt, uint8_t *raw, void *_key)
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_node_encode_key(H5F_t *f, H5B_t UNUSED *bt, uint8_t *raw, void *_key)
+H5G_node_encode_key(const H5F_t *f, const H5B_t UNUSED *bt, uint8_t *raw, void *_key)
{
H5G_node_key_t *key = (H5G_node_key_t *) _key;
@@ -348,7 +344,7 @@ done:
*-------------------------------------------------------------------------
*/
static size_t
-H5G_node_size(H5F_t *f)
+H5G_node_size(const H5F_t *f)
{
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_node_size);
@@ -513,7 +509,7 @@ H5G_node_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5G_node_
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed");
if (H5G_node_serialize(f, sym, size, buf) < 0)
- HGOTO_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "node serialization failed");
+ HGOTO_ERROR(H5E_SYM, H5E_CANTSERIALIZE, FAIL, "node serialization failed");
if (H5F_block_write(f, H5FD_MEM_BTREE, addr, size, dxpl_id, buf) < 0)
HGOTO_ERROR(H5E_SYM, H5E_WRITEERROR, FAIL, "unable to write symbol table node to the file");
@@ -690,7 +686,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5G_compute_size(H5F_t *f, H5G_node_t UNUSED *sym, size_t *size_ptr)
+H5G_compute_size(const H5F_t *f, const H5G_node_t UNUSED *sym, size_t *size_ptr)
{
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5G_compute_size);
@@ -936,7 +932,7 @@ done:
*/
static herr_t
H5G_node_found(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void UNUSED *_lt_key,
- void *_udata, const void UNUSED *_rt_key)
+ void *_udata)
{
H5G_bt_ud1_t *bt_udata = (H5G_bt_ud1_t *) _udata;
H5G_node_t *sn = NULL;
@@ -1047,7 +1043,7 @@ done:
static H5B_ins_t
H5G_node_insert(H5F_t *f, hid_t dxpl_id, haddr_t addr, void UNUSED *_lt_key,
hbool_t UNUSED *lt_key_changed, void *_md_key,
- void *_udata, void *_rt_key, hbool_t UNUSED *rt_key_changed,
+ void *_udata, void *_rt_key, hbool_t *rt_key_changed,
haddr_t *new_node_p)
{
H5G_node_key_t *md_key = (H5G_node_key_t *) _md_key;
@@ -1462,8 +1458,8 @@ done:
*-------------------------------------------------------------------------
*/
int
-H5G_node_iterate (H5F_t *f, hid_t dxpl_id, void UNUSED *_lt_key, haddr_t addr,
- void UNUSED *_rt_key, void *_udata)
+H5G_node_iterate (H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr,
+ const void UNUSED *_rt_key, void *_udata)
{
H5G_bt_ud2_t *bt_udata = (H5G_bt_ud2_t *)_udata;
H5G_node_t *sn = NULL;
@@ -1490,7 +1486,7 @@ H5G_node_iterate (H5F_t *f, hid_t dxpl_id, 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");
nsyms = sn->nsyms;
- if (NULL==(name_off = H5FL_SEQ_MALLOC(size_t, nsyms)))
+ if (NULL==(name_off = H5FL_SEQ_MALLOC(size_t, (size_t)nsyms)))
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, H5B_ITER_ERROR, "memory allocation failed");
for (i=0; i<nsyms; i++)
name_off[i] = sn->entry[i].name_off;
@@ -1570,8 +1566,8 @@ done:
*-------------------------------------------------------------------------
*/
int
-H5G_node_sumup(H5F_t *f, hid_t dxpl_id, void UNUSED *_lt_key, haddr_t addr,
- void UNUSED *_rt_key, void *_udata)
+H5G_node_sumup(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr,
+ const void UNUSED *_rt_key, void *_udata)
{
hsize_t *num_objs = (hsize_t *)_udata;
H5G_node_t *sn = NULL;
@@ -1617,8 +1613,8 @@ done:
*-------------------------------------------------------------------------
*/
int
-H5G_node_name(H5F_t *f, hid_t dxpl_id, void UNUSED *_lt_key, haddr_t addr,
- void UNUSED *_rt_key, void *_udata)
+H5G_node_name(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr,
+ const void UNUSED *_rt_key, void *_udata)
{
H5G_bt_ud3_t *bt_udata = (H5G_bt_ud3_t *)_udata;
const H5HL_t *heap = NULL;
@@ -1686,8 +1682,8 @@ done:
*-------------------------------------------------------------------------
*/
int
-H5G_node_type(H5F_t *f, hid_t dxpl_id, void UNUSED *_lt_key, haddr_t addr,
- void UNUSED *_rt_key, void *_udata)
+H5G_node_type(H5F_t *f, hid_t dxpl_id, const void UNUSED *_lt_key, haddr_t addr,
+ const void UNUSED *_rt_key, void *_udata)
{
H5G_bt_ud3_t *bt_udata = (H5G_bt_ud3_t*)_udata;
hsize_t loc_idx;
diff --git a/src/H5Gpkg.h b/src/H5Gpkg.h
index 7010aa6..c0f00ee 100644
--- a/src/H5Gpkg.h
+++ b/src/H5Gpkg.h
@@ -58,8 +58,8 @@ struct H5G_shared_t {
* above the H5G layer.
*/
struct H5G_t {
- H5G_shared_t* shared; /*shared file object data */
- H5G_entry_t ent; /*info about the group */
+ H5G_shared_t* shared; /*shared file object data */
+ H5G_entry_t ent; /*info about the group */
};
/*
@@ -113,7 +113,7 @@ typedef struct H5G_bt_ud2_t {
typedef struct H5G_bt_ud3_t {
/* downward */
H5G_entry_t *ent; /*the entry of group being queried */
- hsize_t idx; /*index of group member to be querried */
+ hsize_t idx; /*index of group member to be queried */
hsize_t num_objs; /*the number of objects having been traversed*/
/* upward */
@@ -152,12 +152,12 @@ H5_DLL herr_t H5G_ent_encode_vec(H5F_t *f, uint8_t **pp,
const H5G_entry_t *ent, int n);
/* Functions that understand symbol table nodes */
-H5_DLL int H5G_node_iterate (H5F_t *f, hid_t dxpl_id, void *_lt_key, haddr_t addr,
- void *_rt_key, void *_udata);
-H5_DLL int H5G_node_sumup(H5F_t *f, hid_t dxpl_id, void *_lt_key, haddr_t addr,
- void *_rt_key, void *_udata);
-H5_DLL int H5G_node_name(H5F_t *f, hid_t dxpl_id, void *_lt_key, haddr_t addr,
- void *_rt_key, void *_udata);
-H5_DLL int H5G_node_type(H5F_t *f, hid_t dxpl_id, void *_lt_key, haddr_t addr,
- void *_rt_key, void *_udata);
+H5_DLL int H5G_node_iterate (H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr,
+ const void *_rt_key, void *_udata);
+H5_DLL int H5G_node_sumup(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr,
+ const void *_rt_key, void *_udata);
+H5_DLL int H5G_node_name(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr,
+ const void *_rt_key, void *_udata);
+H5_DLL int H5G_node_type(H5F_t *f, hid_t dxpl_id, const void *_lt_key, haddr_t addr,
+ const void *_rt_key, void *_udata);
#endif
diff --git a/src/H5Gstab.c b/src/H5Gstab.c
index fcfcb35..71b5603 100644
--- a/src/H5Gstab.c
+++ b/src/H5Gstab.c
@@ -19,6 +19,10 @@
#define H5F_PACKAGE /*suppress error about including H5Fpkg */
#define H5G_PACKAGE /*suppress error about including H5Gpkg */
+/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
+#define PABLO_MASK H5G_stab_mask
+
#include "H5private.h"
#include "H5Eprivate.h"
#include "H5Fpkg.h" /*file access */
@@ -28,10 +32,6 @@
#include "H5MMprivate.h"
#include "H5Oprivate.h"
-#define PABLO_MASK H5G_stab_mask
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
-
/* Declare extern the PQ free list for the wrapped strings */
H5FL_BLK_EXTERN(str_buf);
diff --git a/src/H5HG.c b/src/H5HG.c
index 42a38ab..5939369 100644
--- a/src/H5HG.c
+++ b/src/H5HG.c
@@ -132,7 +132,7 @@ static herr_t H5HG_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr,
H5HG_heap_t *heap);
static herr_t H5HG_dest(H5F_t *f, H5HG_heap_t *heap);
static herr_t H5HG_clear(H5F_t *f, H5HG_heap_t *heap, hbool_t destroy);
-static herr_t H5HG_compute_size(H5F_t *f, H5HG_heap_t *heap, size_t *size_ptr);
+static herr_t H5HG_compute_size(const H5F_t *f, const H5HG_heap_t *heap, size_t *size_ptr);
/*
* H5HG inherits cache-like properties from H5AC
@@ -146,10 +146,6 @@ const H5AC_class_t H5AC_GHEAP[1] = {{
(H5AC_size_func_t)H5HG_compute_size,
}};
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
-
/* Declare a free list to manage the H5HG_t struct */
H5FL_DEFINE_STATIC(H5HG_heap_t);
@@ -632,7 +628,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5HG_compute_size(H5F_t UNUSED *f, H5HG_heap_t *heap, size_t *size_ptr)
+H5HG_compute_size(const H5F_t UNUSED *f, const H5HG_heap_t *heap, size_t *size_ptr)
{
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HG_compute_size);
@@ -666,13 +662,13 @@ H5HG_compute_size(H5F_t UNUSED *f, H5HG_heap_t *heap, size_t *size_ptr)
*
*-------------------------------------------------------------------------
*/
-static unsigned
+static size_t
H5HG_alloc (H5F_t *f, H5HG_heap_t *heap, size_t size)
{
- unsigned idx;
+ size_t idx;
uint8_t *p = NULL;
size_t need = H5HG_SIZEOF_OBJHDR(f) + H5HG_ALIGN(size);
- unsigned ret_value; /* Return value */
+ size_t ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5HG_alloc);
@@ -901,7 +897,7 @@ H5HG_insert (H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out*
{
size_t need; /*total space needed for object */
int cwfsno;
- unsigned idx;
+ size_t idx;
haddr_t addr = HADDR_UNDEF;
H5HG_heap_t *heap = NULL;
hbool_t found=0; /* Flag to indicate a heap with enough space was found */
@@ -1008,7 +1004,6 @@ H5HG_insert (H5F_t *f, hid_t dxpl_id, size_t size, void *obj, H5HG_t *hobj/*out*
/* Split the free space to make room for the new object */
idx = H5HG_alloc (f, heap, size);
- assert (idx>0);
/* Copy data into the heap */
if(size>0) {
@@ -1071,7 +1066,7 @@ H5HG_read (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj, void *object/*out*/)
if (NULL == (heap = H5AC_protect(f, dxpl_id, H5AC_GHEAP, hobj->addr, NULL, NULL, H5AC_READ)))
HGOTO_ERROR (H5E_HEAP, H5E_CANTLOAD, NULL, "unable to load heap");
- assert (hobj->idx>0 && hobj->idx<heap->nused);
+ assert (hobj->idx<heap->nused);
assert (heap->obj[hobj->idx].begin);
size = heap->obj[hobj->idx].size;
p = heap->obj[hobj->idx].begin + H5HG_SIZEOF_OBJHDR (f);
@@ -1145,7 +1140,7 @@ H5HG_link (H5F_t *f, hid_t dxpl_id, const H5HG_t *hobj, int adjust)
if (NULL == (heap = H5AC_protect(f, dxpl_id, H5AC_GHEAP, hobj->addr, NULL, NULL, H5AC_WRITE)))
HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load heap");
- assert (hobj->idx>0 && hobj->idx<heap->nused);
+ assert (hobj->idx<heap->nused);
assert (heap->obj[hobj->idx].begin);
if (heap->obj[hobj->idx].nrefs+adjust<0)
HGOTO_ERROR (H5E_HEAP, H5E_BADRANGE, FAIL, "new link count would be out of range");
@@ -1203,7 +1198,7 @@ H5HG_remove (H5F_t *f, hid_t dxpl_id, H5HG_t *hobj)
if (NULL == (heap = H5AC_protect(f, dxpl_id, H5AC_GHEAP, hobj->addr, NULL, NULL, H5AC_WRITE)))
HGOTO_ERROR(H5E_HEAP, H5E_CANTLOAD, FAIL, "unable to load heap");
- assert (hobj->idx>0 && hobj->idx<heap->nused);
+ assert (hobj->idx<heap->nused);
assert (heap->obj[hobj->idx].begin);
obj_start = heap->obj[hobj->idx].begin;
/* Include object header size */
diff --git a/src/H5HGdbg.c b/src/H5HGdbg.c
index bb01709..68a3e85 100644
--- a/src/H5HGdbg.c
+++ b/src/H5HGdbg.c
@@ -29,10 +29,6 @@
#include "H5HGpkg.h" /* Global heaps */
#include "H5Iprivate.h" /* ID Functions */
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
-
/*-------------------------------------------------------------------------
* Function: H5HG_debug
diff --git a/src/H5HGprivate.h b/src/H5HGprivate.h
index 93e7793..2cfa773 100644
--- a/src/H5HGprivate.h
+++ b/src/H5HGprivate.h
@@ -34,10 +34,10 @@
/* Information to locate object in global heap */
typedef struct H5HG_t {
haddr_t addr; /*address of collection */
- unsigned idx; /*object ID within collection */
+ size_t idx; /*object ID within collection */
} H5HG_t;
-/* Typedef for heap in memory (defined in H5HG.c) */
+/* Typedef for heap in memory (defined in H5HGpkg.h) */
typedef struct H5HG_heap_t H5HG_heap_t;
H5_DLL herr_t H5HG_insert(H5F_t *f, hid_t dxpl_id, size_t size, void *obj,
diff --git a/src/H5HL.c b/src/H5HL.c
index f217eb5..10e7a6e 100644
--- a/src/H5HL.c
+++ b/src/H5HL.c
@@ -72,7 +72,7 @@ static H5HL_t *H5HL_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *udat
static herr_t H5HL_flush(H5F_t *f, hid_t dxpl_id, hbool_t dest, haddr_t addr, H5HL_t *heap);
static herr_t H5HL_dest(H5F_t *f, H5HL_t *heap);
static herr_t H5HL_clear(H5F_t *f, H5HL_t *heap, hbool_t destroy);
-static herr_t H5HL_compute_size(H5F_t *f, H5HL_t *heap, size_t *size_ptr);
+static herr_t H5HL_compute_size(const H5F_t *f, const H5HL_t *heap, size_t *size_ptr);
/*
* H5HL inherits cache-like properties from H5AC
@@ -86,10 +86,6 @@ const H5AC_class_t H5AC_LHEAP[1] = {{
(H5AC_size_func_t)H5HL_compute_size,
}};
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
-
/* Declare a free list to manage the H5HL_free_t struct */
H5FL_DEFINE_STATIC(H5HL_free_t);
@@ -572,7 +568,7 @@ H5HL_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5HL_t *heap)
/* Write the header */
if (H5HL_serialize(f, heap, heap->chunk) < 0)
- HGOTO_ERROR(H5E_BTREE, H5E_WRITEERROR, FAIL, "unable to serialize local heap")
+ HGOTO_ERROR(H5E_BTREE, H5E_CANTSERIALIZE, FAIL, "unable to serialize local heap")
/* Copy buffer to disk */
hdr_end_addr = addr + (hsize_t)sizeof_hdr;
@@ -699,7 +695,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5HL_compute_size(H5F_t *f, H5HL_t *heap, size_t *size_ptr)
+H5HL_compute_size(const H5F_t *f, const H5HL_t *heap, size_t *size_ptr)
{
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5HL_compute_size);
diff --git a/src/H5HLdbg.c b/src/H5HLdbg.c
index 8a81b9f..aefa7c1 100644
--- a/src/H5HLdbg.c
+++ b/src/H5HLdbg.c
@@ -30,10 +30,6 @@
#include "H5Iprivate.h" /* ID Functions */
#include "H5MMprivate.h" /* Memory management */
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
-
/*-------------------------------------------------------------------------
* Function: H5HL_debug
diff --git a/src/H5HLprivate.h b/src/H5HLprivate.h
index baf9561..5b56ad7 100644
--- a/src/H5HLprivate.h
+++ b/src/H5HLprivate.h
@@ -55,7 +55,7 @@
/* Library Private Typedefs */
/****************************/
-/* Typedef for local heap in memory (defined in H5HL.c) */
+/* Typedef for local heap in memory (defined in H5HLpkg.h) */
typedef struct H5HL_t H5HL_t;
/*
diff --git a/src/H5HP.c b/src/H5HP.c
index 26b6f39..5b35924 100644
--- a/src/H5HP.c
+++ b/src/H5HP.c
@@ -30,10 +30,6 @@
#include "H5HPprivate.h" /* Heap routines */
#include "H5FLprivate.h" /* Memory management functions */
-/* Interface initialization? */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
-
/* Local Macros */
#define H5HP_START_SIZE 16 /* Initial number of entries for heaps */
@@ -62,7 +58,7 @@ static herr_t H5HP_sink_min(H5HP_t *heap, size_t loc);
/* Declare a free list to manage the H5HP_t struct */
H5FL_DEFINE_STATIC(H5HP_t);
-/* Declare a free list to manage arrays of H5HP_ent_t */
+/* Declare a free list to manage sequences of H5HP_ent_t */
H5FL_SEQ_DEFINE_STATIC(H5HP_ent_t);
@@ -419,7 +415,7 @@ H5HP_count(const H5HP_t *heap)
{
ssize_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5HP_count,FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5HP_count);
/* Check args */
assert(heap);
@@ -436,9 +432,7 @@ H5HP_count(const H5HP_t *heap)
H5_CHECK_OVERFLOW(heap->nobjs,size_t,ssize_t);
ret_value=(ssize_t)heap->nobjs;
-done:
/* No post-condition check necessary, since heap is constant */
-
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5HP_count() */
@@ -547,9 +541,7 @@ done:
herr_t
H5HP_top(const H5HP_t *heap, int *val)
{
- herr_t ret_value=SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(H5HP_top,FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5HP_top);
/* Check args */
assert(heap);
@@ -566,11 +558,8 @@ H5HP_top(const H5HP_t *heap, int *val)
/* Get value of the top object in the heap */
*val=heap->heap[1].val;
-done:
-
/* No post-condition check necessary, since heap is constant */
-
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
} /* end H5HP_top() */
@@ -909,9 +898,7 @@ done:
herr_t
H5HP_close(H5HP_t *heap)
{
- herr_t ret_value=SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(H5HP_close,FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5HP_close);
/* Check args */
assert(heap);
@@ -930,7 +917,6 @@ H5HP_close(H5HP_t *heap)
/* Free actual heap object */
H5FL_FREE(H5HP_t,heap);
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
} /* end H5HP_close() */
diff --git a/src/H5I.c b/src/H5I.c
index aa342a7..3b17a3c 100644
--- a/src/H5I.c
+++ b/src/H5I.c
@@ -34,6 +34,13 @@
#define H5I_PACKAGE /*suppress error about including H5Ipkg */
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5I_init_interface
+
+/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
+#define PABLO_MASK H5I_mask
+
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5FLprivate.h" /* Free Lists */
@@ -51,13 +58,6 @@
#include "H5Tprivate.h" /* Datatypes */
#endif /* H5I_DEBUG_OUTPUT */
-/* Pablo information */
-#define PABLO_MASK H5I_mask
-
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT H5I_init_interface
-
/* Local Macros */
/*
@@ -115,7 +115,6 @@ static H5I_id_group_t *H5I_id_group_list_g[H5I_NGROUPS];
H5FL_DEFINE_STATIC(H5I_id_info_t);
/*--------------------- Local function prototypes ---------------------------*/
-static herr_t H5I_init_interface(void);
static H5I_id_info_t *H5I_find_id(hid_t id);
static hid_t H5I_get_file_id(hid_t obj_id);
static int H5I_get_ref(hid_t id);
@@ -181,7 +180,7 @@ H5I_term_interface(void)
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5I_term_interface);
- if (interface_initialize_g) {
+ if (H5_interface_initialize_g) {
/* How many groups are still being used? */
for (grp=(H5I_type_t)0; grp<H5I_NGROUPS; H5_INC_ENUM(H5I_type_t,grp)) {
if ((grp_ptr=H5I_id_group_list_g[grp]) && grp_ptr->id_list)
@@ -198,7 +197,7 @@ H5I_term_interface(void)
}
/* Mark interface closed */
- interface_initialize_g = 0;
+ H5_interface_initialize_g = 0;
}
FUNC_LEAVE_NOAPI(n);
}
@@ -1294,7 +1293,9 @@ done:
*
* Purpose: Gets a name of an object from its ID.
*
- * Return: Success: 0, Failure: -1
+ * Return: Success: The length of name.
+ *
+ * Failure: -1
*
* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
*
@@ -1435,7 +1436,6 @@ done:
}
#endif /* H5I_DEBUG_OUTPUT */
-
/*-------------------------------------------------------------------------
* Function: H5Iget_file_id
diff --git a/src/H5Iprivate.h b/src/H5Iprivate.h
index 766d7df..a244d31 100644
--- a/src/H5Iprivate.h
+++ b/src/H5Iprivate.h
@@ -37,7 +37,6 @@
#define H5I_OID_HASHSIZE 64
#define H5I_GROUPID_HASHSIZE 64
#define H5I_ATTRID_HASHSIZE 64
-#define H5I_TEMPBUFID_HASHSIZE 64
#define H5I_REFID_HASHSIZE 64
#define H5I_VFL_HASHSIZE 64
#define H5I_GENPROPCLS_HASHSIZE 64
diff --git a/src/H5Ipublic.h b/src/H5Ipublic.h
index 6069fd1..ce29be3 100644
--- a/src/H5Ipublic.h
+++ b/src/H5Ipublic.h
@@ -41,7 +41,6 @@ typedef enum {
H5I_DATASPACE, /*group ID for Dataspace objects */
H5I_DATASET, /*group ID for Dataset objects */
H5I_ATTR, /*group ID for Attribute objects */
- H5I_TEMPBUF, /*group ID for Temporary buffer objects */
H5I_REFERENCE, /*group ID for Reference objects */
H5I_VFL, /*group ID for virtual file layer */
H5I_GENPROP_CLS, /*group ID for generic property list classes */
diff --git a/src/H5MF.c b/src/H5MF.c
index 9da1a0f..3de5afe 100644
--- a/src/H5MF.c
+++ b/src/H5MF.c
@@ -42,10 +42,6 @@
#include "H5FDprivate.h"
#include "H5MFprivate.h"
-/* Is the interface initialized? */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
-
/*-------------------------------------------------------------------------
* Function: H5MF_alloc
@@ -127,7 +123,7 @@ H5MF_xfree(H5F_t *f, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size)
{
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5MF_xfree, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5MF_xfree);
/* check arguments */
assert(f);
@@ -281,9 +277,7 @@ done:
herr_t
H5MF_free_reserved(H5F_t *f, hsize_t size)
{
- herr_t ret_value = SUCCEED;
-
- FUNC_ENTER_NOAPI(H5MF_free_reserved,FAIL)
+ FUNC_ENTER_NOAPI_NOFUNC(H5MF_free_reserved)
/* Check arguments */
assert(f);
@@ -295,8 +289,7 @@ H5MF_free_reserved(H5F_t *f, hsize_t size)
f->shared->lf->reserved_alloc -= size;
-done:
- FUNC_LEAVE_NOAPI(ret_value)
+ FUNC_LEAVE_NOAPI(SUCCEED)
}
/*-------------------------------------------------------------------------
@@ -323,7 +316,7 @@ H5MF_alloc_overflow(H5F_t *f, hsize_t size)
size_t c; /* Local index variable */
hbool_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5MF_alloc_overflow,FALSE)
+ FUNC_ENTER_NOAPI_NOFUNC(H5MF_alloc_overflow)
/* Start with the current end of the file's address. */
space_needed = (hsize_t)H5F_get_eoa(f);
@@ -361,7 +354,6 @@ H5MF_alloc_overflow(H5F_t *f, hsize_t size)
else
ret_value=FALSE;
-done:
FUNC_LEAVE_NOAPI(ret_value)
}
diff --git a/src/H5MM.c b/src/H5MM.c
index 312c86e..5a191b3 100644
--- a/src/H5MM.c
+++ b/src/H5MM.c
@@ -33,10 +33,6 @@
#include "H5Eprivate.h"
#include "H5MMprivate.h"
-/* Interface initialization? */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
-
#ifndef NDEBUG
/*-------------------------------------------------------------------------
diff --git a/src/H5O.c b/src/H5O.c
index 326be7d..1ee6067 100644
--- a/src/H5O.c
+++ b/src/H5O.c
@@ -28,6 +28,9 @@
#define H5F_PACKAGE /*suppress error about including H5Fpkg */
#define H5O_PACKAGE /*suppress error about including H5Opkg */
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5O_init_interface
+
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
#define PABLO_MASK H5O_mask
@@ -88,7 +91,7 @@ static H5O_t *H5O_load(H5F_t *f, hid_t dxpl_id, haddr_t addr, const void *_udata
static herr_t H5O_flush(H5F_t *f, hid_t dxpl_id, hbool_t destroy, haddr_t addr, H5O_t *oh);
static herr_t H5O_dest(H5F_t *f, H5O_t *oh);
static herr_t H5O_clear(H5F_t *f, H5O_t *oh, hbool_t destroy);
-static herr_t H5O_compute_size(H5F_t *f, H5O_t *oh, size_t *size_ptr);
+static herr_t H5O_compute_size(const H5F_t *f, const H5O_t *oh, size_t *size_ptr);
/* H5O inherits cache-like properties from H5AC */
static const H5AC_class_t H5AC_OHDR[1] = {{
@@ -100,11 +103,6 @@ static const H5AC_class_t H5AC_OHDR[1] = {{
(H5AC_size_func_t)H5O_compute_size,
}};
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT H5O_init_interface
-static herr_t H5O_init_interface(void);
-
/* ID to type mapping */
static const H5O_class_t *const message_type_g[] = {
H5O_NULL, /*0x0000 Null */
@@ -835,7 +833,8 @@ H5O_dest(H5F_t UNUSED *f, H5O_t *oh)
oh->chunk[i].image = H5FL_BLK_FREE(chunk_image,oh->chunk[i].image);
}
- oh->chunk = H5FL_SEQ_FREE(H5O_chunk_t,oh->chunk);
+ if(oh->chunk)
+ oh->chunk = H5FL_SEQ_FREE(H5O_chunk_t,oh->chunk);
/* destroy messages */
for (i = 0; i < oh->nmesgs; i++) {
@@ -847,7 +846,8 @@ H5O_dest(H5F_t UNUSED *f, H5O_t *oh)
else
H5O_free_real(oh->mesg[i].type, oh->mesg[i].native);
}
- oh->mesg = H5FL_SEQ_FREE(H5O_mesg_t,oh->mesg);
+ if(oh->mesg)
+ oh->mesg = H5FL_SEQ_FREE(H5O_mesg_t,oh->mesg);
/* destroy object header */
H5FL_FREE(H5O_t,oh);
@@ -925,7 +925,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5O_compute_size(H5F_t *f, H5O_t *oh, size_t *size_ptr)
+H5O_compute_size(const H5F_t *f, const H5O_t *oh, size_t *size_ptr)
{
unsigned u;
size_t size;
@@ -940,9 +940,7 @@ H5O_compute_size(H5F_t *f, H5O_t *oh, size_t *size_ptr)
size = H5O_SIZEOF_HDR(f);
for (u = 0; u < oh->nchunks; u++)
- {
size += oh->chunk[u].size;
- }
HDassert(size >= H5O_SIZEOF_HDR(f));
@@ -3132,7 +3130,7 @@ done:
*-------------------------------------------------------------------------
*/
size_t
-H5O_raw_size(unsigned type_id, H5F_t *f, const void *mesg)
+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 */
diff --git a/src/H5Oattr.c b/src/H5Oattr.c
index c4ae58a..4487985 100644
--- a/src/H5Oattr.c
+++ b/src/H5Oattr.c
@@ -33,7 +33,7 @@
static herr_t H5O_attr_encode (H5F_t *f, uint8_t *p, const void *mesg);
static void *H5O_attr_decode (H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t *sh);
static void *H5O_attr_copy (const void *_mesg, void *_dest, unsigned update_flags);
-static size_t H5O_attr_size (H5F_t *f, const void *_mesg);
+static size_t H5O_attr_size (const H5F_t *f, const void *_mesg);
static herr_t H5O_attr_reset (void *_mesg);
static herr_t H5O_attr_free (void *mesg);
static herr_t H5O_attr_delete (H5F_t *f, hid_t dxpl_id, const void *_mesg);
@@ -68,9 +68,6 @@ const H5O_class_t H5O_ATTR[1] = {{
/* Flags for attribute flag encoding */
#define H5O_ATTR_FLAG_TYPE_SHARED 0x01
-/* Interface initialization */
-#define INTERFACE_INIT NULL
-
/* Declare extern the free list for H5A_t's */
H5FL_EXTERN(H5A_t);
@@ -415,7 +412,7 @@ done:
* Added padding between message parts for alignment.
--------------------------------------------------------------------------*/
static size_t
-H5O_attr_size(H5F_t UNUSED *f, const void *_mesg)
+H5O_attr_size(const H5F_t UNUSED *f, const void *_mesg)
{
const H5A_t *attr = (const H5A_t *)_mesg;
size_t name_len;
diff --git a/src/H5Obogus.c b/src/H5Obogus.c
index e1139c4..63b002b 100644
--- a/src/H5Obogus.c
+++ b/src/H5Obogus.c
@@ -42,7 +42,7 @@
/* PRIVATE PROTOTYPES */
static void *H5O_bogus_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t *sh);
static herr_t H5O_bogus_encode(H5F_t *f, uint8_t *p, const void *_mesg);
-static size_t H5O_bogus_size(H5F_t *f, const void *_mesg);
+static size_t H5O_bogus_size(const H5F_t *f, const void *_mesg);
static herr_t H5O_bogus_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream,
int indent, int fwidth);
@@ -64,10 +64,6 @@ const H5O_class_t H5O_BOGUS[1] = {{
H5O_bogus_debug, /*debug the message */
}};
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
-
/*-------------------------------------------------------------------------
* Function: H5O_bogus_decode
@@ -176,7 +172,7 @@ H5O_bogus_encode(H5F_t UNUSED *f, uint8_t *p, const void UNUSED *mesg)
*-------------------------------------------------------------------------
*/
static size_t
-H5O_bogus_size(H5F_t UNUSED *f, const void UNUSED *mesg)
+H5O_bogus_size(const H5F_t UNUSED *f, const void UNUSED *mesg)
{
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_bogus_size);
diff --git a/src/H5Ocont.c b/src/H5Ocont.c
index 47a1d03..79da2f7 100644
--- a/src/H5Ocont.c
+++ b/src/H5Ocont.c
@@ -63,9 +63,6 @@ const H5O_class_t H5O_CONT[1] = {{
H5O_cont_debug, /*debugging */
}};
-/* Interface initialization */
-#define INTERFACE_INIT NULL
-
/* Declare the free list for H5O_cont_t's */
H5FL_DEFINE(H5O_cont_t);
diff --git a/src/H5Odtype.c b/src/H5Odtype.c
index 7579d70..3df93b9 100644
--- a/src/H5Odtype.c
+++ b/src/H5Odtype.c
@@ -29,7 +29,7 @@
static herr_t H5O_dtype_encode (H5F_t *f, uint8_t *p, const void *mesg);
static void *H5O_dtype_decode (H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t *sh);
static void *H5O_dtype_copy (const void *_mesg, void *_dest, unsigned update_flags);
-static size_t H5O_dtype_size (H5F_t *f, const void *_mesg);
+static size_t H5O_dtype_size (const H5F_t *f, const void *_mesg);
static herr_t H5O_dtype_reset (void *_mesg);
static herr_t H5O_dtype_free (void *_mesg);
static herr_t H5O_dtype_get_share (H5F_t *f, const void *_mesg,
@@ -66,9 +66,6 @@ const H5O_class_t H5O_DTYPE[1] = {{
* class objects (array definitely, potentially compound & vlen sequences also) */
#define H5O_DTYPE_VERSION_UPDATED 2
-/* Interface initialization */
-#define INTERFACE_INIT NULL
-
/* Declare external the free list for H5T_t's */
H5FL_EXTERN(H5T_t);
H5FL_EXTERN(H5T_shared_t);
@@ -93,7 +90,7 @@ static herr_t
H5O_dtype_decode_helper(H5F_t *f, const uint8_t **pp, H5T_t *dt)
{
unsigned flags, version;
- int i, j;
+ unsigned i, j;
size_t z;
herr_t ret_value=SUCCEED; /* Return value */
@@ -195,7 +192,7 @@ H5O_dtype_decode_helper(H5F_t *f, const uint8_t **pp, H5T_t *dt)
if (NULL==dt->shared->u.compnd.memb)
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed");
for (i = 0; i < dt->shared->u.compnd.nmembs; i++) {
- int ndims=0; /* Number of dimensions of the array field */
+ unsigned ndims=0; /* Number of dimensions of the array field */
hsize_t dim[H5O_LAYOUT_NDIMS]; /* Dimensions of the array */
int perm[H5O_LAYOUT_NDIMS]; /* Dimension permutations */
unsigned perm_word=0; /* Dimension permutation information */
@@ -256,7 +253,7 @@ H5O_dtype_decode_helper(H5F_t *f, const uint8_t **pp, H5T_t *dt)
perm[j]=(perm_word>>(j*8))&0xff;
/* Create the array datatype for the field */
- if ((array_dt=H5T_array_create(temp_type,ndims,dim,perm))==NULL) {
+ if ((array_dt=H5T_array_create(temp_type,(int)ndims,dim,perm))==NULL) {
for (j=0; j<=i; j++)
H5MM_xfree(dt->shared->u.compnd.memb[j].name);
H5MM_xfree(dt->shared->u.compnd.memb);
@@ -314,7 +311,6 @@ H5O_dtype_decode_helper(H5F_t *f, const uint8_t **pp, H5T_t *dt)
* Enumeration data types...
*/
dt->shared->u.enumer.nmembs = dt->shared->u.enumer.nalloc = flags & 0xffff;
- assert(dt->shared->u.enumer.nmembs>=0);
if (NULL==(dt->shared->parent=H5FL_CALLOC(H5T_t)))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed");
if(NULL== (dt->shared->parent->shared= H5FL_CALLOC (H5T_shared_t))) {
@@ -408,13 +404,13 @@ H5O_dtype_decode_helper(H5F_t *f, const uint8_t **pp, H5T_t *dt)
*pp += 3;
/* Decode array dimension sizes & compute number of elements */
- for (j=0, dt->shared->u.array.nelem=1; j<dt->shared->u.array.ndims; j++) {
+ for (j=0, dt->shared->u.array.nelem=1; j<(unsigned)dt->shared->u.array.ndims; j++) {
UINT32DECODE(*pp, dt->shared->u.array.dim[j]);
dt->shared->u.array.nelem *= dt->shared->u.array.dim[j];
} /* end for */
/* Decode array dimension permutations (even though they are unused currently) */
- for (j=0; j<dt->shared->u.array.ndims; j++)
+ for (j=0; j<(unsigned)dt->shared->u.array.ndims; j++)
UINT32DECODE(*pp, dt->shared->u.array.perm[j]);
/* Decode base type of array */
@@ -432,7 +428,7 @@ H5O_dtype_decode_helper(H5F_t *f, const uint8_t **pp, H5T_t *dt)
* Set the "force conversion" flag if a VL base datatype is used or
* or if any components of the base datatype are VL types.
*/
- if(dt->shared->parent->shared->type==H5T_VLEN || dt->shared->parent->shared->force_conv==TRUE)
+ if(dt->shared->parent->shared->force_conv==TRUE)
dt->shared->force_conv=TRUE;
break;
@@ -473,7 +469,7 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt)
htri_t has_array=FALSE; /* Whether a compound datatype has an array inside it */
unsigned flags = 0;
char *hdr = (char *)*pp;
- int i, j;
+ unsigned i, j;
size_t n, z, aligned;
herr_t ret_value=SUCCEED; /* Return value */
@@ -790,11 +786,11 @@ H5O_dtype_encode_helper(uint8_t **pp, const H5T_t *dt)
*(*pp)++ = '\0';
/* Encode array dimensions */
- for (j=0; j<dt->shared->u.array.ndims; j++)
+ for (j=0; j<(unsigned)dt->shared->u.array.ndims; j++)
UINT32ENCODE(*pp, dt->shared->u.array.dim[j]);
/* Encode array dimension permutations */
- for (j=0; j<dt->shared->u.array.ndims; j++)
+ for (j=0; j<(unsigned)dt->shared->u.array.ndims; j++)
UINT32ENCODE(*pp, dt->shared->u.array.perm[j]);
/* Encode base type of array's information */
@@ -979,9 +975,9 @@ done:
sized "properties" field.
--------------------------------------------------------------------------*/
static size_t
-H5O_dtype_size(H5F_t *f, const void *mesg)
+H5O_dtype_size(const H5F_t *f, const void *mesg)
{
- int i;
+ unsigned i;
size_t ret_value = 8;
const H5T_t *dt = (const H5T_t *) mesg;
@@ -1218,7 +1214,7 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream,
const H5T_t *dt = (const H5T_t*)mesg;
const char *s;
char buf[256];
- int i;
+ unsigned i;
size_t k;
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_dtype_debug);
@@ -1353,12 +1349,12 @@ H5O_dtype_debug(H5F_t *f, hid_t dxpl_id, const void *mesg, FILE *stream,
"Rank:",
dt->shared->u.array.ndims);
fprintf(stream, "%*s%-*s {", indent, "", fwidth, "Dim Size:");
- for (i=0; i<dt->shared->u.array.ndims; i++) {
+ for (i=0; i<(unsigned)dt->shared->u.array.ndims; i++) {
fprintf (stream, "%s%u", i?", ":"", (unsigned)dt->shared->u.array.dim[i]);
}
fprintf (stream, "}\n");
fprintf(stream, "%*s%-*s {", indent, "", fwidth, "Dim Permutation:");
- for (i=0; i<dt->shared->u.array.ndims; i++) {
+ for (i=0; i<(unsigned)dt->shared->u.array.ndims; i++) {
fprintf (stream, "%s%d", i?", ":"", dt->shared->u.array.perm[i]);
}
fprintf (stream, "}\n");
diff --git a/src/H5Oefl.c b/src/H5Oefl.c
index 0f53058..2e8e365 100644
--- a/src/H5Oefl.c
+++ b/src/H5Oefl.c
@@ -34,7 +34,7 @@
static void *H5O_efl_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t *sh);
static herr_t H5O_efl_encode(H5F_t *f, uint8_t *p, const void *_mesg);
static void *H5O_efl_copy(const void *_mesg, void *_dest, unsigned update_flags);
-static size_t H5O_efl_size(H5F_t *f, const void *_mesg);
+static size_t H5O_efl_size(const H5F_t *f, const void *_mesg);
static herr_t H5O_efl_reset(void *_mesg);
static herr_t H5O_efl_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream,
int indent, int fwidth);
@@ -59,9 +59,6 @@ const H5O_class_t H5O_EFL[1] = {{
#define H5O_EFL_VERSION 1
-/* Interface initialization */
-#define INTERFACE_INIT NULL
-
/*-------------------------------------------------------------------------
* Function: H5O_efl_decode
@@ -317,7 +314,7 @@ done:
*-------------------------------------------------------------------------
*/
static size_t
-H5O_efl_size(H5F_t *f, const void *_mesg)
+H5O_efl_size(const H5F_t *f, const void *_mesg)
{
const H5O_efl_t *mesg = (const H5O_efl_t *) _mesg;
size_t ret_value = 0;
diff --git a/src/H5Ofill.c b/src/H5Ofill.c
index bf01af8..8599d82 100644
--- a/src/H5Ofill.c
+++ b/src/H5Ofill.c
@@ -34,7 +34,7 @@
static void *H5O_fill_new_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t *sh);
static herr_t H5O_fill_new_encode(H5F_t *f, uint8_t *p, const void *_mesg);
static void *H5O_fill_new_copy(const void *_mesg, void *_dest, unsigned update_flags);
-static size_t H5O_fill_new_size(H5F_t *f, const void *_mesg);
+static size_t H5O_fill_new_size(const H5F_t *f, const void *_mesg);
static herr_t H5O_fill_new_reset(void *_mesg);
static herr_t H5O_fill_new_free(void *_mesg);
static herr_t H5O_fill_new_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream,
@@ -43,7 +43,7 @@ static herr_t H5O_fill_new_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FIL
static void *H5O_fill_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t *sh);
static herr_t H5O_fill_encode(H5F_t *f, uint8_t *p, const void *_mesg);
static void *H5O_fill_copy(const void *_mesg, void *_dest, unsigned update_flags);
-static size_t H5O_fill_size(H5F_t *f, const void *_mesg);
+static size_t H5O_fill_size(const H5F_t *f, const void *_mesg);
static herr_t H5O_fill_reset(void *_mesg);
static herr_t H5O_fill_free(void *_mesg);
static herr_t H5O_fill_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream,
@@ -90,10 +90,6 @@ const H5O_class_t H5O_FILL_NEW[1] = {{
/* Revised version of the "new" fill value information */
#define H5O_FILL_VERSION_2 2
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
-
/* Declare a free list to manage the H5O_fill_new_t struct */
H5FL_DEFINE(H5O_fill_new_t);
@@ -469,7 +465,7 @@ done:
*-------------------------------------------------------------------------
*/
static size_t
-H5O_fill_new_size(H5F_t UNUSED *f, const void *_mesg)
+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;
@@ -509,7 +505,7 @@ H5O_fill_new_size(H5F_t UNUSED *f, const void *_mesg)
*-------------------------------------------------------------------------
*/
static size_t
-H5O_fill_size(H5F_t UNUSED *f, const void *_mesg)
+H5O_fill_size(const H5F_t UNUSED *f, const void *_mesg)
{
const H5O_fill_t *mesg = (const H5O_fill_t *)_mesg;
@@ -580,7 +576,6 @@ static herr_t
H5O_fill_reset(void *_mesg)
{
H5O_fill_t *mesg = (H5O_fill_t *)_mesg;
- herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_fill_reset);
@@ -594,7 +589,7 @@ H5O_fill_reset(void *_mesg)
mesg->type = NULL;
}
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
}
diff --git a/src/H5Olayout.c b/src/H5Olayout.c
index 4a19b5b..00fd2ab 100644
--- a/src/H5Olayout.c
+++ b/src/H5Olayout.c
@@ -36,7 +36,7 @@
static void *H5O_layout_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t *sh);
static herr_t H5O_layout_encode(H5F_t *f, uint8_t *p, const void *_mesg);
static void *H5O_layout_copy(const void *_mesg, void *_dest, unsigned update_flags);
-static size_t H5O_layout_size(H5F_t *f, const void *_mesg);
+static size_t H5O_layout_size(const H5F_t *f, const void *_mesg);
static herr_t H5O_layout_reset (void *_mesg);
static herr_t H5O_layout_free (void *_mesg);
static herr_t H5O_layout_delete(H5F_t *f, hid_t dxpl_id, const void *_mesg);
@@ -68,9 +68,6 @@ const H5O_class_t H5O_LAYOUT[1] = {{
#define H5O_LAYOUT_VERSION_2 2
#define H5O_LAYOUT_VERSION_3 3
-/* Interface initialization */
-#define INTERFACE_INIT NULL
-
/* Declare a free list to manage the H5O_layout_t struct */
H5FL_DEFINE(H5O_layout_t);
@@ -427,7 +424,7 @@ done:
*-------------------------------------------------------------------------
*/
size_t
-H5O_layout_meta_size(H5F_t *f, const void *_mesg)
+H5O_layout_meta_size(const H5F_t *f, const void *_mesg)
{
/* Casting away const OK - QAK */
H5O_layout_t *mesg = (H5O_layout_t *) _mesg;
@@ -536,7 +533,7 @@ done:
*-------------------------------------------------------------------------
*/
static size_t
-H5O_layout_size(H5F_t *f, const void *_mesg)
+H5O_layout_size(const H5F_t *f, const void *_mesg)
{
const H5O_layout_t *mesg = (const H5O_layout_t *) _mesg;
size_t ret_value;
diff --git a/src/H5Omtime.c b/src/H5Omtime.c
index c272d05..a6cc127 100644
--- a/src/H5Omtime.c
+++ b/src/H5Omtime.c
@@ -35,12 +35,12 @@
static void *H5O_mtime_new_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t *sh);
static herr_t H5O_mtime_new_encode(H5F_t *f, uint8_t *p, const void *_mesg);
-static size_t H5O_mtime_new_size(H5F_t *f, const void *_mesg);
+static size_t H5O_mtime_new_size(const H5F_t *f, const void *_mesg);
static void *H5O_mtime_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t *sh);
static herr_t H5O_mtime_encode(H5F_t *f, uint8_t *p, const void *_mesg);
static void *H5O_mtime_copy(const void *_mesg, void *_dest, unsigned update_flags);
-static size_t H5O_mtime_size(H5F_t *f, const void *_mesg);
+static size_t H5O_mtime_size(const H5F_t *f, const void *_mesg);
static herr_t H5O_mtime_reset(void *_mesg);
static herr_t H5O_mtime_free(void *_mesg);
static herr_t H5O_mtime_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE *stream,
@@ -83,9 +83,6 @@ const H5O_class_t H5O_MTIME_NEW[1] = {{
H5O_mtime_debug, /*debug the message */
}};
-/* Interface initialization */
-#define INTERFACE_INIT NULL
-
/* Current version of new mtime information */
#define H5O_MTIME_VERSION 1
@@ -434,7 +431,7 @@ done:
*-------------------------------------------------------------------------
*/
static size_t
-H5O_mtime_new_size(H5F_t UNUSED * f, const void UNUSED * mesg)
+H5O_mtime_new_size(const H5F_t UNUSED * f, const void UNUSED * mesg)
{
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_mtime_new_size);
@@ -467,7 +464,7 @@ H5O_mtime_new_size(H5F_t UNUSED * f, const void UNUSED * mesg)
*-------------------------------------------------------------------------
*/
static size_t
-H5O_mtime_size(H5F_t UNUSED * f, const void UNUSED * mesg)
+H5O_mtime_size(const H5F_t UNUSED * f, const void UNUSED * mesg)
{
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5O_mtime_size);
diff --git a/src/H5Oname.c b/src/H5Oname.c
index 04a5a03..a675eff 100644
--- a/src/H5Oname.c
+++ b/src/H5Oname.c
@@ -38,7 +38,7 @@
static void *H5O_name_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t *sh);
static herr_t H5O_name_encode(H5F_t *f, uint8_t *p, const void *_mesg);
static void *H5O_name_copy(const void *_mesg, void *_dest, unsigned update_flags);
-static size_t H5O_name_size(H5F_t *f, const void *_mesg);
+static size_t H5O_name_size(const H5F_t *f, const void *_mesg);
static herr_t H5O_name_reset(void *_mesg);
static herr_t H5O_name_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg, FILE * stream,
int indent, int fwidth);
@@ -61,9 +61,6 @@ const H5O_class_t H5O_NAME[1] = {{
H5O_name_debug, /*debug the message */
}};
-/* Interface initialization */
-#define INTERFACE_INIT NULL
-
/*-------------------------------------------------------------------------
* Function: H5O_name_decode
@@ -216,7 +213,7 @@ done:
*-------------------------------------------------------------------------
*/
static size_t
-H5O_name_size(H5F_t UNUSED *f, const void *_mesg)
+H5O_name_size(const H5F_t UNUSED *f, const void *_mesg)
{
const H5O_name_t *mesg = (const H5O_name_t *) _mesg;
size_t ret_value;
diff --git a/src/H5Opkg.h b/src/H5Opkg.h
index 6ddfd92..5735d9c 100644
--- a/src/H5Opkg.h
+++ b/src/H5Opkg.h
@@ -63,7 +63,7 @@ typedef struct H5O_class_t {
void *(*decode)(H5F_t*, hid_t, const uint8_t*, struct H5O_shared_t*);
herr_t (*encode)(H5F_t*, uint8_t*, const void*);
void *(*copy)(const void*, void*, unsigned); /*copy native value */
- size_t (*raw_size)(H5F_t*, const void*);/*sizeof raw val */
+ size_t (*raw_size)(const H5F_t*, const void*);/*sizeof raw val */
herr_t (*reset)(void *); /*free nested data structs */
herr_t (*free)(void *); /*free main data struct */
herr_t (*del)(H5F_t *, hid_t, const void *); /* Delete space in file referenced by this message */
diff --git a/src/H5Opline.c b/src/H5Opline.c
index e4101cd..1fa304f 100644
--- a/src/H5Opline.c
+++ b/src/H5Opline.c
@@ -30,15 +30,12 @@
/* Pablo mask */
#define PABLO_MASK H5O_pline_mask
-/* Interface initialization */
-#define INTERFACE_INIT NULL
-
#define H5O_PLINE_VERSION 1
static herr_t H5O_pline_encode (H5F_t *f, uint8_t *p, const void *mesg);
static void *H5O_pline_decode (H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t *sh);
static void *H5O_pline_copy (const void *_mesg, void *_dest, unsigned update_flags);
-static size_t H5O_pline_size (H5F_t *f, const void *_mesg);
+static size_t H5O_pline_size (const H5F_t *f, const void *_mesg);
static herr_t H5O_pline_reset (void *_mesg);
static herr_t H5O_pline_free (void *_mesg);
static herr_t H5O_pline_debug (H5F_t *f, hid_t dxpl_id, const void *_mesg,
@@ -324,7 +321,7 @@ done:
*-------------------------------------------------------------------------
*/
static size_t
-H5O_pline_size (H5F_t UNUSED *f, const void *mesg)
+H5O_pline_size (const H5F_t UNUSED *f, const void *mesg)
{
const H5O_pline_t *pline = (const H5O_pline_t*)mesg;
size_t i, name_len;
diff --git a/src/H5Oprivate.h b/src/H5Oprivate.h
index e32a734..e6f55cf 100644
--- a/src/H5Oprivate.h
+++ b/src/H5Oprivate.h
@@ -261,7 +261,7 @@ H5_DLL herr_t H5O_remove(H5G_entry_t *ent, unsigned type_id, int sequence,
H5_DLL herr_t H5O_reset(unsigned type_id, void *native);
H5_DLL void *H5O_free(unsigned type_id, void *mesg);
H5_DLL void *H5O_copy(unsigned type_id, const void *mesg, void *dst);
-H5_DLL size_t H5O_raw_size(unsigned type_id, H5F_t *f, const void *mesg);
+H5_DLL size_t H5O_raw_size(unsigned type_id, const H5F_t *f, const void *mesg);
H5_DLL herr_t H5O_get_share(unsigned type_id, H5F_t *f, const void *mesg, H5O_shared_t *share);
H5_DLL herr_t H5O_delete(H5F_t *f, hid_t dxpl_id, haddr_t addr);
H5_DLL herr_t H5O_get_info(H5G_entry_t *ent, H5O_stat_t *ostat, hid_t dxpl_id);
@@ -272,7 +272,7 @@ H5_DLL herr_t H5O_debug(H5F_t *f, hid_t dxpl_id, haddr_t addr, FILE * stream, in
int fwidth);
/* Layout operators */
-H5_DLL size_t H5O_layout_meta_size(H5F_t *f, const void *_mesg);
+H5_DLL size_t H5O_layout_meta_size(const H5F_t *f, const void *_mesg);
/* EFL operators */
H5_DLL hsize_t H5O_efl_total_size(H5O_efl_t *efl);
diff --git a/src/H5Osdspace.c b/src/H5Osdspace.c
index 8150a88..1b2e351 100644
--- a/src/H5Osdspace.c
+++ b/src/H5Osdspace.c
@@ -29,7 +29,7 @@
static void *H5O_sdspace_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t *sh);
static herr_t H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *_mesg);
static void *H5O_sdspace_copy(const void *_mesg, void *_dest, unsigned update_flags);
-static size_t H5O_sdspace_size(H5F_t *f, const void *_mesg);
+static size_t H5O_sdspace_size(const H5F_t *f, const void *_mesg);
static herr_t H5O_sdspace_reset(void *_mesg);
static herr_t H5O_sdspace_free (void *_mesg);
static herr_t H5O_sdspace_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg,
@@ -55,9 +55,6 @@ const H5O_class_t H5O_SDSPACE[1] = {{
#define H5O_SDSPACE_VERSION 1
-/* Is the interface initialized? */
-#define INTERFACE_INIT NULL
-
/* Declare external the free list for H5S_extent_t's */
H5FL_EXTERN(H5S_extent_t);
@@ -240,6 +237,11 @@ H5O_sdspace_encode(H5F_t *f, uint8_t *p, const void *mesg)
DESCRIPTION
This function copies a native (memory) simple dimensionality message,
allocating the destination structure if necessary.
+ MODIFICATIONS
+ Raymond Lu
+ April 8, 2004
+ Changed operation on H5S_simple_t to H5S_extent_t.
+
--------------------------------------------------------------------------*/
static void *
H5O_sdspace_copy(const void *mesg, void *dest, unsigned UNUSED update_flags)
@@ -289,7 +291,7 @@ done:
instead of just four bytes.
--------------------------------------------------------------------------*/
static size_t
-H5O_sdspace_size(H5F_t *f, const void *mesg)
+H5O_sdspace_size(const H5F_t *f, const void *mesg)
{
const H5S_extent_t *space = (const H5S_extent_t *) mesg;
diff --git a/src/H5Oshared.c b/src/H5Oshared.c
index 92d959b..2f30ae6 100644
--- a/src/H5Oshared.c
+++ b/src/H5Oshared.c
@@ -42,7 +42,7 @@
static void *H5O_shared_decode (H5F_t*, hid_t dxpl_id, const uint8_t*, H5O_shared_t *sh);
static herr_t H5O_shared_encode (H5F_t*, uint8_t*, const void*);
static void *H5O_shared_copy(const void *_mesg, void *_dest, unsigned update_flags);
-static size_t H5O_shared_size (H5F_t*, const void *_mesg);
+static size_t H5O_shared_size (const H5F_t*, const void *_mesg);
static herr_t H5O_shared_delete(H5F_t *f, hid_t dxpl_id, const void *_mesg);
static herr_t H5O_shared_link(H5F_t *f, hid_t dxpl_id, const void *_mesg);
static herr_t H5O_shared_debug (H5F_t*, hid_t dxpl_id, const void*, FILE*, int, int);
@@ -71,9 +71,6 @@ const H5O_class_t H5O_SHARED[1] = {{
/* New version, with just address of object as link for object header sharing */
#define H5O_SHARED_VERSION 2
-/* Interface initialization */
-#define INTERFACE_INIT NULL
-
/*-------------------------------------------------------------------------
* Function: H5O_shared_read
@@ -388,7 +385,7 @@ done:
*-------------------------------------------------------------------------
*/
static size_t
-H5O_shared_size (H5F_t *f, const void *_mesg)
+H5O_shared_size (const H5F_t *f, const void *_mesg)
{
const H5O_shared_t *shared = (const H5O_shared_t *) _mesg;
size_t ret_value;
diff --git a/src/H5Ostab.c b/src/H5Ostab.c
index cd34fcb..e880694 100644
--- a/src/H5Ostab.c
+++ b/src/H5Ostab.c
@@ -41,7 +41,7 @@
static void *H5O_stab_decode(H5F_t *f, hid_t dxpl_id, const uint8_t *p, H5O_shared_t *sh);
static herr_t H5O_stab_encode(H5F_t *f, uint8_t *p, const void *_mesg);
static void *H5O_stab_copy(const void *_mesg, void *_dest, unsigned update_flags);
-static size_t H5O_stab_size(H5F_t *f, const void *_mesg);
+static size_t H5O_stab_size(const H5F_t *f, const void *_mesg);
static herr_t H5O_stab_free (void *_mesg);
static herr_t H5O_stab_delete(H5F_t *f, hid_t dxpl_id, const void *_mesg);
static herr_t H5O_stab_debug(H5F_t *f, hid_t dxpl_id, const void *_mesg,
@@ -65,9 +65,6 @@ const H5O_class_t H5O_STAB[1] = {{
H5O_stab_debug, /*debug the message */
}};
-/* Interface initialization */
-#define INTERFACE_INIT NULL
-
/* Declare a free list to manage the H5O_stab_t struct */
H5FL_DEFINE_STATIC(H5O_stab_t);
@@ -267,7 +264,7 @@ done:
*-------------------------------------------------------------------------
*/
static size_t
-H5O_stab_size(H5F_t *f, const void UNUSED *_mesg)
+H5O_stab_size(const H5F_t *f, const void UNUSED *_mesg)
{
size_t ret_value; /* Return value */
diff --git a/src/H5P.c b/src/H5P.c
index f5a5ccd..c4d3289 100644
--- a/src/H5P.c
+++ b/src/H5P.c
@@ -19,6 +19,9 @@
#define H5P_PACKAGE /*suppress error about including H5Ppkg */
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5P_init_interface
+
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
#define PABLO_MASK H5P_mask
@@ -33,11 +36,6 @@
#include "H5MMprivate.h" /* Memory management */
#include "H5Ppkg.h" /* Property lists */
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT H5P_init_interface
-static herr_t H5P_init_interface(void);
-
/* Local variables */
/*
@@ -313,7 +311,7 @@ H5P_term_interface(void)
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5P_term_interface);
- if (interface_initialize_g) {
+ if (H5_interface_initialize_g) {
/* Destroy HDF5 library property classes & lists */
/* Check if there are any open property list classes or lists */
@@ -358,7 +356,7 @@ H5P_term_interface(void)
H5I_destroy_group(H5I_GENPROP_CLS);
n++; /*H5I*/
- interface_initialize_g = 0;
+ H5_interface_initialize_g = 0;
}
}
FUNC_LEAVE_NOAPI(n);
@@ -2201,6 +2199,7 @@ done:
size_t size, void *value);
where the parameters to the callback function are:
hid_t prop_id; IN: The ID of the property list being modified.
+ const char *name; IN: The name of the property being modified.
size_t size; IN: The size of the property value
void *new_value; IN/OUT: The value being set for the property.
The 'set' routine may modify the value to be set and those changes will be
@@ -2413,6 +2412,7 @@ done:
size_t size, void *value);
where the parameters to the callback function are:
hid_t prop_id; IN: The ID of the property list being modified.
+ const char *name; IN: The name of the property being modified.
size_t size; IN: The size of the property value
void *new_value; IN/OUT: The value being set for the property.
The 'set' routine may modify the value to be set and those changes will be
diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c
index b08577f..1751436 100644
--- a/src/H5Pdcpl.c
+++ b/src/H5Pdcpl.c
@@ -27,10 +27,6 @@
#include "H5Ppkg.h" /* Property lists */
#include "H5Zprivate.h" /* Data filters */
-/* Interface initialization */
-#define INTERFACE_INIT NULL
-static int interface_initialize_g = 0;
-
/* Local datatypes */
/* Static function prototypes */
@@ -495,7 +491,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_external(hid_t plist_id, int idx, size_t name_size, char *name/*out*/,
+H5Pget_external(hid_t plist_id, unsigned idx, size_t name_size, char *name/*out*/,
off_t *offset/*out*/, hsize_t *size/*out*/)
{
H5O_efl_t efl;
@@ -503,7 +499,7 @@ H5Pget_external(hid_t plist_id, int idx, size_t name_size, char *name/*out*/,
herr_t ret_value=SUCCEED; /* return value */
FUNC_ENTER_API(H5Pget_external, FAIL);
- H5TRACE6("e","iIszxxx",plist_id,idx,name_size,name,offset,size);
+ 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)))
@@ -513,7 +509,7 @@ H5Pget_external(hid_t plist_id, int idx, size_t name_size, char *name/*out*/,
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<0 || (size_t)idx>=efl.nused)
+ if (idx>=efl.nused)
HGOTO_ERROR (H5E_ARGS, H5E_BADRANGE, FAIL, "external file index is out of range");
/* Return values */
@@ -551,6 +547,8 @@ done:
* failed; the filter will not participate in the pipeline
* during an H5Dread() of the chunk. If this bit is clear and
* the filter fails then the entire I/O operation fails.
+ * If this bit is set but encoding is disabled for a filter,
+ * attempting to write will generate an error.
*
* Note: This function currently supports only the permanent filter
* pipeline. That is, PLIST_ID must be a dataset creation
@@ -627,6 +625,8 @@ done:
* failed; the filter will not participate in the pipeline
* during an H5Dread() of the chunk. If this bit is clear and
* the filter fails then the entire I/O operation fails.
+ * If this bit is set but encoding is disabled for a filter,
+ * attempting to write will generate an error.
*
* Note: This function currently supports only the permanent filter
* pipeline. That is, PLIST_ID must be a dataset creation
@@ -767,7 +767,7 @@ done:
*-------------------------------------------------------------------------
*/
H5Z_filter_t
-H5Pget_filter(hid_t plist_id, int idx, unsigned int *flags/*out*/,
+H5Pget_filter(hid_t plist_id, unsigned idx, unsigned int *flags/*out*/,
size_t *cd_nelmts/*in_out*/, unsigned cd_values[]/*out*/,
size_t namelen, char name[]/*out*/)
{
@@ -778,7 +778,7 @@ H5Pget_filter(hid_t plist_id, int idx, unsigned int *flags/*out*/,
H5Z_filter_t ret_value; /* return value */
FUNC_ENTER_API(H5Pget_filter, H5Z_FILTER_ERROR);
- H5TRACE7("Zf","iIsx*zxzx",plist_id,idx,flags,cd_nelmts,cd_values,namelen,
+ H5TRACE7("Zf","iIux*zxzx",plist_id,idx,flags,cd_nelmts,cd_values,namelen,
name);
/* Check args */
@@ -811,7 +811,7 @@ H5Pget_filter(hid_t plist_id, int idx, unsigned int *flags/*out*/,
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, H5Z_FILTER_ERROR, "can't get pipeline");
/* Check more args */
- if (idx<0 || (size_t)idx>=pline.nused)
+ if (idx>=pline.nused)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5Z_FILTER_ERROR, "filter number is invalid");
/* Set pointer to particular filter to query */
@@ -1434,45 +1434,6 @@ done:
/*-------------------------------------------------------------------------
- * Function: H5P_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
- * Wednesday, January 16, 2002
- *
- * Modifications:
- *
- *
- *-------------------------------------------------------------------------
- */
-herr_t
-H5P_fill_value_defined(H5P_genplist_t *plist, H5D_fill_value_t *status)
-{
- herr_t ret_value = SUCCEED;
- H5O_fill_t fill;
-
- FUNC_ENTER_NOAPI(H5P_fill_value_defined, FAIL);
-
- assert(plist);
- assert(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");
-
- /* 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");
-
-done:
- FUNC_LEAVE_NOAPI(ret_value);
-} /* end H5P_fill_value_defined() */
-
-
-/*-------------------------------------------------------------------------
* Function: H5Pfill_value_defined
*
* Purpose: Check if fill value is defined.
@@ -1491,6 +1452,7 @@ herr_t
H5Pfill_value_defined(hid_t plist_id, H5D_fill_value_t *status)
{
H5P_genplist_t *plist;
+ H5O_fill_t fill;
herr_t ret_value = SUCCEED;
FUNC_ENTER_API(H5Pfill_value_defined, FAIL);
@@ -1502,9 +1464,13 @@ H5Pfill_value_defined(hid_t plist_id, H5D_fill_value_t *status)
if(NULL == (plist = H5P_object_verify(plist_id,H5P_DATASET_CREATE)))
HGOTO_ERROR(H5E_ATOM, H5E_BADATOM, FAIL, "can't find object for ID");
- /* Call the internal function */
- if(H5P_fill_value_defined(plist, status) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get fill value info");
+ /* 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");
+
+ /* 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");
done:
FUNC_LEAVE_API(ret_value);
diff --git a/src/H5Pdxpl.c b/src/H5Pdxpl.c
index 6c042c8..3b8d12f 100644
--- a/src/H5Pdxpl.c
+++ b/src/H5Pdxpl.c
@@ -14,19 +14,16 @@
#define H5P_PACKAGE /*suppress error about including H5Ppkg */
+/* Pablo mask */
+/* (Put before include files to avoid problems with inline functions) */
+#define PABLO_MASK H5P_dxpl_mask
+
/* Private header files */
#include "H5private.h" /* Generic Functions */
#include "H5Dprivate.h" /* Datasets */
#include "H5Eprivate.h" /* Error handling */
#include "H5Ppkg.h" /* Property lists */
-/* Pablo mask */
-#define PABLO_MASK H5Pdxpl_mask
-
-/* Interface initialization */
-#define INTERFACE_INIT NULL
-static int interface_initialize_g = 0;
-
/* Local datatypes */
/* Static function prototypes */
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index 0d4a884..89a9004 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -12,10 +12,12 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* $Id$ */
-
#define H5P_PACKAGE /*suppress error about including H5Ppkg */
+/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
+#define PABLO_MASK H5P_fapl_mask
+
/* Private header files */
#include "H5private.h" /* Generic Functions */
#include "H5Dprivate.h" /* Datasets */
@@ -28,13 +30,6 @@
/* Default file driver - see H5Pget_driver() */
#include "H5FDsec2.h" /* Posix unbuffered I/O file driver */
-/* Pablo mask */
-#define PABLO_MASK H5Pfapl_mask
-
-/* Interface initialization */
-#define INTERFACE_INIT NULL
-static int interface_initialize_g = 0;
-
/* Local datatypes */
/* Static function prototypes */
diff --git a/src/H5Pfcpl.c b/src/H5Pfcpl.c
index 1567e53..76ca4ed 100644
--- a/src/H5Pfcpl.c
+++ b/src/H5Pfcpl.c
@@ -12,10 +12,12 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* $Id$ */
-
#define H5P_PACKAGE /*suppress error about including H5Ppkg */
+/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
+#define PABLO_MASK H5P_fcpl_mask
+
/* Private header files */
#include "H5private.h" /* Generic Functions */
#include "H5Bprivate.h" /* B-tree subclass names */
@@ -23,13 +25,6 @@
#include "H5Fprivate.h" /* Files */
#include "H5Ppkg.h" /* Property lists */
-/* Pablo mask */
-#define PABLO_MASK H5Pfcpl_mask
-
-/* Interface initialization */
-#define INTERFACE_INIT NULL
-static int interface_initialize_g = 0;
-
/* Local datatypes */
/* Static function prototypes */
@@ -65,8 +60,8 @@ static int interface_initialize_g = 0;
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_version(hid_t plist_id, int *super/*out*/, int *freelist/*out*/,
- int *stab/*out*/, int *shhdr/*out*/)
+H5Pget_version(hid_t plist_id, unsigned *super/*out*/, unsigned *freelist/*out*/,
+ unsigned *stab/*out*/, unsigned *shhdr/*out*/)
{
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value=SUCCEED; /* Return value */
@@ -432,14 +427,14 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pset_sym_k(hid_t plist_id, int ik, unsigned lk)
+H5Pset_sym_k(hid_t plist_id, unsigned ik, unsigned lk)
{
- int btree_k[H5B_NUM_BTREE_ID];
+ unsigned btree_k[H5B_NUM_BTREE_ID];
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_API(H5Pset_sym_k, FAIL);
- H5TRACE3("e","iIsIu",plist_id,ik,lk);
+ H5TRACE3("e","iIuIu",plist_id,ik,lk);
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_CREATE)))
@@ -483,9 +478,9 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_sym_k(hid_t plist_id, int *ik /*out */ , unsigned *lk /*out */ )
+H5Pget_sym_k(hid_t plist_id, unsigned *ik /*out */ , unsigned *lk /*out */ )
{
- int btree_k[H5B_NUM_BTREE_ID];
+ unsigned btree_k[H5B_NUM_BTREE_ID];
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value=SUCCEED; /* Return value */
@@ -532,17 +527,17 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pset_istore_k(hid_t plist_id, int ik)
+H5Pset_istore_k(hid_t plist_id, unsigned ik)
{
- int btree_k[H5B_NUM_BTREE_ID];
+ unsigned btree_k[H5B_NUM_BTREE_ID];
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_API(H5Pset_istore_k, FAIL);
- H5TRACE2("e","iIs",plist_id,ik);
+ H5TRACE2("e","iIu",plist_id,ik);
/* Check arguments */
- if (ik <= 0)
+ if (ik == 0)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "istore IK value must be positive");
/* Get the plist structure */
@@ -583,9 +578,9 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Pget_istore_k(hid_t plist_id, int *ik /*out */ )
+H5Pget_istore_k(hid_t plist_id, unsigned *ik /*out */ )
{
- int btree_k[H5B_NUM_BTREE_ID];
+ unsigned btree_k[H5B_NUM_BTREE_ID];
H5P_genplist_t *plist; /* Property list pointer */
herr_t ret_value=SUCCEED; /* return value */
diff --git a/src/H5Pprivate.h b/src/H5Pprivate.h
index e087624..69990e3 100644
--- a/src/H5Pprivate.h
+++ b/src/H5Pprivate.h
@@ -60,8 +60,6 @@ H5_DLL herr_t H5P_set_vlen_mem_manager(H5P_genplist_t *plist,
void *free_info);
H5_DLL herr_t H5P_is_fill_value_defined(const struct H5O_fill_t *fill,
H5D_fill_value_t *status);
-H5_DLL herr_t H5P_fill_value_defined(H5P_genplist_t *plist,
- H5D_fill_value_t *status);
/* *SPECIAL* Don't make more of these! -QAK */
H5_DLL htri_t H5P_isa_class(hid_t plist_id, hid_t pclass_id);
diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h
index 1c5fc0c..c13d8f8 100644
--- a/src/H5Ppublic.h
+++ b/src/H5Ppublic.h
@@ -87,9 +87,9 @@ typedef herr_t (*H5P_iterate_t)(hid_t id, const char *name, void *iter_data);
#undef H5OPEN
#ifndef _H5private_H
#define H5OPEN H5open(),
-#else /* _H5Pprivate_H */
+#else /* _H5private_H */
#define H5OPEN
-#endif /* _H5Pprivate_H */
+#endif /* _H5private_H */
#define H5P_NO_CLASS (H5OPEN H5P_CLS_NO_CLASS_g)
#define H5P_FILE_CREATE (H5OPEN H5P_CLS_FILE_CREATE_g)
@@ -159,9 +159,9 @@ H5_DLL herr_t H5Pclose_class(hid_t plist_id);
H5_DLL herr_t H5Pclose(hid_t plist_id);
H5_DLL hid_t H5Pcopy(hid_t plist_id);
-H5_DLL herr_t H5Pget_version(hid_t plist_id, int *boot/*out*/,
- int *freelist/*out*/, int *stab/*out*/,
- int *shhdr/*out*/);
+H5_DLL herr_t H5Pget_version(hid_t plist_id, unsigned *boot/*out*/,
+ unsigned *freelist/*out*/, unsigned *stab/*out*/,
+ unsigned *shhdr/*out*/);
H5_DLL herr_t H5Pset_userblock(hid_t plist_id, hsize_t size);
H5_DLL herr_t H5Pget_userblock(hid_t plist_id, hsize_t *size);
H5_DLL herr_t H5Pset_alignment(hid_t fapl_id, hsize_t threshold,
@@ -176,11 +176,11 @@ H5_DLL herr_t H5Pget_sizes(hid_t plist_id, size_t *sizeof_addr/*out*/,
H5_DLL herr_t H5Pset_sym_k(hid_t plist_id, int ik, int lk);
H5_DLL herr_t H5Pget_sym_k(hid_t plist_id, int *ik/*out*/, int *lk/*out*/);
#else /* H5_WANT_H5_V1_4_COMPAT */
-H5_DLL herr_t H5Pset_sym_k(hid_t plist_id, int ik, unsigned lk);
-H5_DLL herr_t H5Pget_sym_k(hid_t plist_id, int *ik/*out*/, unsigned *lk/*out*/);
+H5_DLL herr_t H5Pset_sym_k(hid_t plist_id, unsigned ik, unsigned lk);
+H5_DLL herr_t H5Pget_sym_k(hid_t plist_id, unsigned *ik/*out*/, unsigned *lk/*out*/);
#endif /* H5_WANT_H5_V1_4_COMPAT */
-H5_DLL herr_t H5Pset_istore_k(hid_t plist_id, int ik);
-H5_DLL herr_t H5Pget_istore_k(hid_t plist_id, int *ik/*out*/);
+H5_DLL herr_t H5Pset_istore_k(hid_t plist_id, unsigned ik);
+H5_DLL herr_t H5Pget_istore_k(hid_t plist_id, unsigned *ik/*out*/);
H5_DLL herr_t H5Pset_layout(hid_t plist_id, H5D_layout_t layout);
H5_DLL H5D_layout_t H5Pget_layout(hid_t plist_id);
H5_DLL herr_t H5Pset_chunk(hid_t plist_id, int ndims, const hsize_t dim[]);
@@ -188,7 +188,7 @@ H5_DLL int H5Pget_chunk(hid_t plist_id, int max_ndims, hsize_t dim[]/*out*/);
H5_DLL herr_t H5Pset_external(hid_t plist_id, const char *name, off_t offset,
hsize_t size);
H5_DLL int H5Pget_external_count(hid_t plist_id);
-H5_DLL herr_t H5Pget_external(hid_t plist_id, int idx, size_t name_size,
+H5_DLL herr_t H5Pget_external(hid_t plist_id, unsigned idx, size_t name_size,
char *name/*out*/, off_t *offset/*out*/,
hsize_t *size/*out*/);
H5_DLL herr_t H5Pset_driver(hid_t plist_id, hid_t driver_id,
@@ -219,7 +219,7 @@ H5_DLL herr_t H5Pset_filter(hid_t plist_id, H5Z_filter_t filter,
unsigned int flags, size_t cd_nelmts,
const unsigned int c_values[]);
H5_DLL int H5Pget_nfilters(hid_t plist_id);
-H5_DLL H5Z_filter_t H5Pget_filter(hid_t plist_id, int filter,
+H5_DLL H5Z_filter_t H5Pget_filter(hid_t plist_id, unsigned filter,
unsigned int *flags/*out*/,
size_t *cd_nelmts/*out*/,
unsigned cd_values[]/*out*/,
diff --git a/src/H5Ptest.c b/src/H5Ptest.c
index 56a5f1c..f92ee48 100644
--- a/src/H5Ptest.c
+++ b/src/H5Ptest.c
@@ -21,19 +21,16 @@
#define H5P_PACKAGE /*suppress error about including H5Ppkg */
#define H5P_TESTING /*suppress warning about H5P testing funcs*/
+/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
+#define PABLO_MASK H5P_test_mask
+
/* Private header files */
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5Iprivate.h" /* IDs */
#include "H5Ppkg.h" /* Property lists */
-/* Pablo mask */
-#define PABLO_MASK H5Ptest_mask
-
-/* Interface initialization */
-#define INTERFACE_INIT NULL
-static int interface_initialize_g = 0;
-
/* Local variables */
/* Local typedefs */
diff --git a/src/H5R.c b/src/H5R.c
index f23afa4..f8c2974 100644
--- a/src/H5R.c
+++ b/src/H5R.c
@@ -14,6 +14,13 @@
#define H5F_PACKAGE /*suppress error about including H5Fpkg */
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5R_init_interface
+
+/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
+#define PABLO_MASK H5R_mask
+
#include "H5private.h" /* Generic Functions */
#include "H5Iprivate.h" /* ID Functions */
#include "H5Dprivate.h" /* Datasets */
@@ -26,12 +33,6 @@
#include "H5Sprivate.h" /* Dataspace functions */
#include "H5Tprivate.h" /* Datatypes */
-/* Interface initialization */
-#define PABLO_MASK H5R_mask
-#define INTERFACE_INIT H5R_init_interface
-static int interface_initialize_g = 0;
-static herr_t H5R_init_interface(void);
-
/* Static functions */
static herr_t H5R_create(void *ref, H5G_entry_t *loc, const char *name,
H5R_type_t ref_type, H5S_t *space, hid_t dxpl_id);
@@ -93,12 +94,12 @@ H5R_term_interface(void)
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5R_term_interface);
- if (interface_initialize_g) {
+ if (H5_interface_initialize_g) {
if ((n=H5I_nmembers(H5I_REFERENCE))) {
H5I_clear_group(H5I_REFERENCE, FALSE);
} else {
H5I_destroy_group(H5I_REFERENCE);
- interface_initialize_g = 0;
+ H5_interface_initialize_g = 0;
n = 1; /*H5I*/
}
}
@@ -401,7 +402,7 @@ H5R_dereference(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, void *_ref)
if(H5O_link(&ent,0,dxpl_id)<=0)
HGOTO_ERROR(H5E_REFERENCE, H5E_LINKCOUNT, FAIL, "dereferencing deleted object");
- /* Open the dataset object */
+ /* Open the object */
oid_type=H5G_get_type(&ent,dxpl_id);
switch(oid_type) {
case H5G_GROUP:
@@ -416,7 +417,7 @@ H5R_dereference(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, void *_ref)
break;
case H5G_TYPE:
- if ((type=H5T_open(&ent, dxpl_id)) ==NULL)
+ if ((type=H5T_open(&ent, dxpl_id)) == NULL)
HGOTO_ERROR(H5E_DATATYPE, H5E_NOTFOUND, FAIL, "not found");
/* Create an atom for the datatype */
@@ -428,7 +429,7 @@ H5R_dereference(H5F_t *file, hid_t dxpl_id, H5R_type_t ref_type, void *_ref)
case H5G_DATASET:
/* Open the dataset */
- if ((dset=H5D_open(&ent,dxpl_id)) ==NULL)
+ if ((dset=H5D_open(&ent,dxpl_id))==NULL)
HGOTO_ERROR(H5E_DATASET, H5E_NOTFOUND, FAIL, "not found");
/* Create an atom for the dataset */
@@ -659,7 +660,7 @@ H5R_get_object_type(H5F_t *file, hid_t dxpl_id, void *_ref)
uint8_t *p; /* Pointer to OID to store */
int ret_value;
- FUNC_ENTER_NOAPI_NOINIT(H5R_get_object_type);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5R_get_object_type);
assert(ref);
assert(file);
diff --git a/src/H5RC.c b/src/H5RC.c
index 644ef3a..8ab1818 100644
--- a/src/H5RC.c
+++ b/src/H5RC.c
@@ -27,10 +27,6 @@
#include "H5FLprivate.h" /* Free lists */
#include "H5RCprivate.h" /* Reference-counted buffers */
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
-
/* Private typedefs & structs */
/* Declare a free list to manage the H5RC_t struct */
diff --git a/src/H5RS.c b/src/H5RS.c
index d55d725..1a7b332 100644
--- a/src/H5RS.c
+++ b/src/H5RS.c
@@ -19,16 +19,13 @@
*
*/
-#include "H5Eprivate.h" /* Error handling */
-#include "H5FLprivate.h" /* Free lists */
-#include "H5RSprivate.h" /* Reference-counted strings */
-
/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
#define PABLO_MASK H5RS_mask
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FLprivate.h" /* Free lists */
+#include "H5RSprivate.h" /* Reference-counted strings */
/* Private typedefs & structs */
struct H5RS_str_t {
@@ -226,9 +223,7 @@ done:
herr_t
H5RS_decr(H5RS_str_t *rs)
{
- herr_t ret_value=SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(H5RS_decr,FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5RS_decr);
/* Sanity check */
assert(rs);
@@ -241,8 +236,7 @@ H5RS_decr(H5RS_str_t *rs)
H5FL_FREE(H5RS_str_t,rs);
} /* end if */
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
} /* end H5RS_decr() */
@@ -267,9 +261,7 @@ done:
herr_t
H5RS_incr(H5RS_str_t *rs)
{
- herr_t ret_value=SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(H5RS_incr,FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5RS_incr);
/* Sanity check */
assert(rs);
@@ -287,8 +279,7 @@ H5RS_incr(H5RS_str_t *rs)
/* Increment reference count for string */
rs->n++;
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
} /* end H5RS_incr() */
@@ -314,14 +305,13 @@ done:
H5RS_str_t *
H5RS_dup(H5RS_str_t *ret_value)
{
- FUNC_ENTER_NOAPI(H5RS_dup,NULL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5RS_dup);
/* Check for valid reference counted string */
if(ret_value!=NULL)
/* Increment reference count for string */
ret_value->n++;
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5RS_dup() */
@@ -384,18 +374,13 @@ H5RS_cmp(const H5RS_str_t *rs1, const H5RS_str_t *rs2)
ssize_t
H5RS_len(const H5RS_str_t *rs)
{
- ssize_t ret_value; /* Return value */
-
- FUNC_ENTER_NOAPI(H5RS_len,FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5RS_len);
/* Sanity check */
assert(rs);
assert(rs->s);
- ret_value=(ssize_t)HDstrlen(rs->s);
-
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI((ssize_t)HDstrlen(rs->s));
} /* end H5RS_len() */
@@ -423,18 +408,13 @@ done:
char *
H5RS_get_str(const H5RS_str_t *rs)
{
- char *ret_value; /* Return value */
-
- FUNC_ENTER_NOAPI(H5RS_get_str,NULL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5RS_get_str);
/* Sanity check */
assert(rs);
assert(rs->s);
- ret_value=rs->s;
-
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(rs->s);
} /* end H5RS_get_str() */
@@ -460,17 +440,12 @@ done:
unsigned
H5RS_get_count(const H5RS_str_t *rs)
{
- unsigned ret_value; /* Return value */
-
- FUNC_ENTER_NOAPI(H5RS_get_count,0);
+ FUNC_ENTER_NOAPI_NOFUNC(H5RS_get_count);
/* Sanity check */
assert(rs);
assert(rs->n>0);
- ret_value=rs->n;
-
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(rs->n);
} /* end H5RS_get_count() */
diff --git a/src/H5Rpublic.h b/src/H5Rpublic.h
index 9cdd56e..006523e 100644
--- a/src/H5Rpublic.h
+++ b/src/H5Rpublic.h
@@ -49,8 +49,8 @@ typedef struct {
* them. -QAK
*/
#define H5R_OBJ_REF_BUF_SIZE sizeof(haddr_t)
-typedef haddr_t hobj_ref_t; /* Buffer to store OID of object referenced */
- /* Needs to be large enough to store largest haddr_t in a worst case machine (ie. 8 bytes currently) */
+/* Object reference structure for user's code */
+typedef haddr_t hobj_ref_t; /* Needs to be large enough to store largest haddr_t in a worst case machine (ie. 8 bytes currently) */
#define H5R_DSET_REG_REF_BUF_SIZE (sizeof(haddr_t)+4)
/* 4 is used instead of sizeof(int) to permit portability between
diff --git a/src/H5S.c b/src/H5S.c
index 273676a..09f5f8e 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -14,6 +14,9 @@
#define H5S_PACKAGE /*suppress error about including H5Spkg */
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5S_init_interface
+
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
#define PABLO_MASK H5S_mask
@@ -33,11 +36,6 @@ static herr_t H5S_set_extent_simple (H5S_t *space, unsigned rank,
const hsize_t *dims, const hsize_t *max);
static htri_t H5S_is_simple(const H5S_t *sdim);
-/* Interface initialization */
-#define INTERFACE_INIT H5S_init_interface
-static int interface_initialize_g = 0;
-static herr_t H5S_init_interface(void);
-
#ifdef H5S_DEBUG
/* Names of the selection names, for debugging */
static const char *H5S_sel_names[]={
@@ -64,9 +62,6 @@ H5FL_DEFINE(H5S_t);
/* Declare a free list to manage the array's of hsize_t's */
H5FL_ARR_DEFINE(hsize_t,H5S_MAX_RANK);
-/* Declare a free list to manage the array's of hssize_t's */
-H5FL_ARR_DEFINE(hssize_t,H5S_MAX_RANK);
-
/*--------------------------------------------------------------------------
NAME
@@ -132,11 +127,11 @@ H5S_term_interface(void)
int j, nprints=0;
H5S_iostats_t *path=NULL;
char buf[256];
-#endif
+#endif /* H5S_DEBUG */
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_term_interface);
- if (interface_initialize_g) {
+ if (H5_interface_initialize_g) {
if ((n=H5I_nmembers(H5I_DATASPACE))) {
H5I_clear_group(H5I_DATASPACE, FALSE);
} else {
@@ -269,7 +264,7 @@ H5S_term_interface(void)
#endif /* H5S_DEBUG */
/* Shut down interface */
- interface_initialize_g = 0;
+ H5_interface_initialize_g = 0;
n = 1; /*H5I*/
}
}
@@ -1653,6 +1648,37 @@ done:
/*-------------------------------------------------------------------------
+ * Function: H5S_raw_size
+ *
+ * Purpose: Compute the 'raw' size of the extent, as stored on disk.
+ *
+ * Return: Success: non-zero
+ * Failure: zero
+ *
+ * Programmer: Quincey Koziol
+ * koziol@ncsa.uiuc.edu
+ * October 14, 2004
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+size_t
+H5S_raw_size(const H5F_t *f, const H5S_t *space)
+{
+ size_t ret_value;
+
+ FUNC_ENTER_NOAPI(H5S_raw_size, 0);
+
+ /* Find out the size of buffer needed for extent */
+ ret_value=H5O_raw_size(H5O_SDSPACE_ID, f, &(space->extent));
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value);
+} /* end H5S_raw_size() */
+
+
+/*-------------------------------------------------------------------------
* Function: H5S_get_simple_extent_type
*
* Purpose: Internal function for retrieving the type of extent for a dataspace object
diff --git a/src/H5SL.c b/src/H5SL.c
index 96f09f2..85c1e37 100644
--- a/src/H5SL.c
+++ b/src/H5SL.c
@@ -146,12 +146,7 @@ struct H5SL_t {
H5SL_node_t *header; /* Header for nodes in skip list */
};
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT H5SL_init_interface
-
/* Static functions */
-static herr_t H5SL_init_interface(void);
static size_t H5SL_random_level(int p1, size_t max_level);
static H5SL_node_t * H5SL_new_node(size_t lvl, void *item, void *key);
@@ -369,7 +364,7 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-ssize_t
+size_t
H5SL_count(H5SL_t *slist)
{
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5SL_count);
diff --git a/src/H5SLprivate.h b/src/H5SLprivate.h
index 633e3e5..5ee6ac4 100644
--- a/src/H5SLprivate.h
+++ b/src/H5SLprivate.h
@@ -58,7 +58,7 @@ typedef herr_t (*H5SL_operator_t)(void *item, void *key,
/* Private routines */
/********************/
H5_DLL H5SL_t *H5SL_create(H5SL_type_t type, double p, size_t max_level);
-H5_DLL ssize_t H5SL_count(H5SL_t *slist);
+H5_DLL size_t H5SL_count(H5SL_t *slist);
H5_DLL herr_t H5SL_insert(H5SL_t *slist, void *item, void *key);
H5_DLL void *H5SL_remove(H5SL_t *slist, void *key);
H5_DLL void *H5SL_search(H5SL_t *slist, void *key);
diff --git a/src/H5ST.c b/src/H5ST.c
index 90d61a3..e88af28 100644
--- a/src/H5ST.c
+++ b/src/H5ST.c
@@ -25,10 +25,6 @@ Bentley and Robert Sedgewick in the April, 1998, Dr. Dobb's Journal.
#include "H5FLprivate.h" /* Free lists */
#include "H5STprivate.h" /* Ternary search trees */
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
-
/* Declare a free list to manage the H5ST_node_t struct */
H5FL_DEFINE_STATIC(H5ST_node_t);
@@ -253,7 +249,7 @@ H5ST_search(H5ST_tree_t *tree, const char *s)
H5ST_ptr_t p; /* Temporary pointer to TST node */
htri_t ret_value=FALSE; /* Return value */
- FUNC_ENTER_NOAPI(H5ST_search,FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5ST_search);
p = tree->root;
while (p) {
@@ -550,7 +546,7 @@ H5ST_findnext(H5ST_ptr_t p)
H5ST_ptr_t q; /* Temporary pointer to TST node */
H5ST_ptr_t ret_value=NULL; /* Return value */
- FUNC_ENTER_NOAPI(H5ST_findnext,NULL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5ST_findnext);
/* Find the next node at the current level, or go back up the tree */
do {
@@ -743,7 +739,7 @@ done:
herr_t
H5ST_dump_internal(H5ST_ptr_t p)
{
- FUNC_ENTER_NOAPI_NOINIT(H5ST_dump_internal);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5ST_dump_internal);
if (p) {
printf("p=%p\n",p);
@@ -762,7 +758,6 @@ H5ST_dump_internal(H5ST_ptr_t p)
H5ST_dump_internal(p->hikid);
} /* end if */
-done:
FUNC_LEAVE_NOAPI(SUCCEED);
} /* end H5ST_dump_internal() */
@@ -788,14 +783,11 @@ done:
herr_t
H5ST_dump(H5ST_tree_t *tree)
{
- herr_t ret_value=SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(H5ST_dump,NULL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5ST_dump,NULL);
/* Dump the tree */
H5ST_dump_internal(tree->root);
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
} /* end H5ST_dump() */
#endif /* H5ST_DEBUG */
diff --git a/src/H5Sall.c b/src/H5Sall.c
index e004800..5472d42 100644
--- a/src/H5Sall.c
+++ b/src/H5Sall.c
@@ -23,7 +23,7 @@
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
-#define PABLO_MASK H5Sall_mask
+#define PABLO_MASK H5S_all_mask
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
@@ -31,10 +31,6 @@
#include "H5Spkg.h" /* Dataspace functions */
#include "H5Vprivate.h" /* Vector functions */
-/* Interface initialization */
-#define INTERFACE_INIT NULL
-static int interface_initialize_g = 0;
-
/* Static function prototypes */
/* Selection callbacks */
@@ -47,15 +43,15 @@ static htri_t H5S_all_is_valid(const H5S_t *space);
static hssize_t H5S_all_serial_size(const H5S_t *space);
static herr_t H5S_all_serialize(const H5S_t *space, uint8_t *buf);
static herr_t H5S_all_deserialize(H5S_t *space, const uint8_t *buf);
-static herr_t H5S_all_bounds(const H5S_t *space, hssize_t *start, hssize_t *end);
+static herr_t H5S_all_bounds(const H5S_t *space, hsize_t *start, hsize_t *end);
static htri_t H5S_all_is_contiguous(const H5S_t *space);
static htri_t H5S_all_is_single(const H5S_t *space);
static htri_t H5S_all_is_regular(const H5S_t *space);
static herr_t H5S_all_iter_init(H5S_sel_iter_t *iter, const H5S_t *space);
/* Selection iteration callbacks */
-static herr_t H5S_all_iter_coords(const H5S_sel_iter_t *iter, hssize_t *coords);
-static herr_t H5S_all_iter_block(const H5S_sel_iter_t *iter, hssize_t *start, hssize_t *end);
+static herr_t H5S_all_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords);
+static herr_t H5S_all_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end);
static hsize_t H5S_all_iter_nelmts(const H5S_sel_iter_t *iter);
static htri_t H5S_all_iter_has_next_block(const H5S_sel_iter_t *iter);
static herr_t H5S_all_iter_next(H5S_sel_iter_t *sel_iter, size_t nelem);
@@ -113,9 +109,7 @@ static const H5S_sel_iter_class_t H5S_sel_iter_all[1] = {{
herr_t
H5S_all_iter_init (H5S_sel_iter_t *iter, const H5S_t *space)
{
- herr_t ret_value=SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(H5S_all_iter_init, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_all_iter_init);
/* Check args */
assert (space && H5S_SEL_ALL==H5S_GET_SELECT_TYPE(space));
@@ -131,8 +125,7 @@ H5S_all_iter_init (H5S_sel_iter_t *iter, const H5S_t *space)
/* Initialize type of selection iterator */
iter->type=H5S_sel_iter_all;
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
} /* H5S_all_iter_init() */
@@ -152,7 +145,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5S_all_iter_coords (const H5S_sel_iter_t *iter, hssize_t *coords)
+H5S_all_iter_coords (const H5S_sel_iter_t *iter, hsize_t *coords)
{
herr_t ret_value=SUCCEED; /* Return value */
@@ -187,7 +180,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5S_all_iter_block (const H5S_sel_iter_t *iter, hssize_t *start, hssize_t *end)
+H5S_all_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end)
{
unsigned u; /* Local index variable */
@@ -380,9 +373,7 @@ H5S_all_iter_release (H5S_sel_iter_t UNUSED * iter)
herr_t
H5S_all_release (H5S_t UNUSED * space)
{
- herr_t ret_value=SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(H5S_all_release, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_all_release);
/* Check args */
assert (space);
@@ -390,8 +381,7 @@ H5S_all_release (H5S_t UNUSED * space)
/* Reset the number of elements in the selection */
space->select.num_elem=0;
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
} /* H5S_all_release() */
@@ -417,9 +407,7 @@ done:
herr_t
H5S_all_copy(H5S_t *dst, const H5S_t UNUSED *src, hbool_t UNUSED share_selection)
{
- herr_t ret_value=SUCCEED; /* return value */
-
- FUNC_ENTER_NOAPI(H5S_all_copy, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_all_copy);
assert(src);
assert(dst);
@@ -427,8 +415,7 @@ H5S_all_copy(H5S_t *dst, const H5S_t UNUSED *src, hbool_t UNUSED share_selection
/* Set number of elements in selection */
dst->select.num_elem=(hsize_t)H5S_GET_EXTENT_NPOINTS(dst);
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
} /* end H5S_all_copy() */
@@ -455,14 +442,11 @@ done:
htri_t
H5S_all_is_valid (const H5S_t UNUSED *space)
{
- htri_t ret_value=TRUE; /* Return value */
-
- FUNC_ENTER_NOAPI(H5S_all_is_valid, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_all_is_valid);
assert(space);
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(TRUE);
} /* end H5S_all_is_valid() */
@@ -488,9 +472,7 @@ done:
hssize_t
H5S_all_serial_size (const H5S_t UNUSED *space)
{
- hssize_t ret_value=FAIL; /* return value */
-
- FUNC_ENTER_NOAPI(H5S_all_serial_size, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_all_serial_size);
assert(space);
@@ -498,10 +480,7 @@ H5S_all_serial_size (const H5S_t UNUSED *space)
* <type (4 bytes)> + <version (4 bytes)> + <padding (4 bytes)> +
* <length (4 bytes)> = 16 bytes
*/
- ret_value=16;
-
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(16);
} /* end H5S_all_serial_size() */
@@ -527,9 +506,7 @@ done:
herr_t
H5S_all_serialize (const H5S_t *space, uint8_t *buf)
{
- herr_t ret_value=FAIL; /* return value */
-
- FUNC_ENTER_NOAPI(H5S_all_serialize, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_all_serialize);
assert(space);
@@ -539,11 +516,7 @@ H5S_all_serialize (const H5S_t *space, uint8_t *buf)
UINT32ENCODE(buf, (uint32_t)0); /* Store the un-used padding */
UINT32ENCODE(buf, (uint32_t)0); /* Store the additional information length */
- /* Set success */
- ret_value=SUCCEED;
-
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
} /* H5S_all_serialize() */
@@ -592,8 +565,8 @@ done:
USAGE
herr_t H5S_all_bounds(space, start, end)
H5S_t *space; IN: Dataspace pointer of selection to query
- hssize_t *start; OUT: Starting coordinate of bounding box
- hssize_t *end; OUT: Opposite coordinate of bounding box
+ hsize_t *start; OUT: Starting coordinate of bounding box
+ hsize_t *end; OUT: Opposite coordinate of bounding box
RETURNS
Non-negative on success, negative on failure
DESCRIPTION
@@ -610,13 +583,12 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
herr_t
-H5S_all_bounds(const H5S_t *space, hssize_t *start, hssize_t *end)
+H5S_all_bounds(const H5S_t *space, hsize_t *start, hsize_t *end)
{
int rank; /* Dataspace rank */
int i; /* index variable */
- herr_t ret_value=SUCCEED; /* return value */
- FUNC_ENTER_NOAPI(H5S_all_bounds, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_all_bounds);
assert(space);
assert(start);
@@ -628,11 +600,10 @@ H5S_all_bounds(const H5S_t *space, hssize_t *start, hssize_t *end)
/* Just copy over the complete extent */
for(i=0; i<rank; i++) {
start[i]=0;
- H5_ASSIGN_OVERFLOW(end[i],space->extent.size[i]-1,hsize_t,hssize_t);
+ end[i]=space->extent.size[i]-1;
} /* end for */
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
} /* H5Sget_all_bounds() */
@@ -657,14 +628,11 @@ done:
htri_t
H5S_all_is_contiguous(const H5S_t UNUSED *space)
{
- htri_t ret_value=TRUE; /* Return value */
-
- FUNC_ENTER_NOAPI(H5S_all_is_contiguous, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_all_is_contiguous);
assert(space);
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(TRUE);
} /* H5S_all_is_contiguous() */
@@ -689,14 +657,11 @@ done:
htri_t
H5S_all_is_single(const H5S_t UNUSED *space)
{
- htri_t ret_value=TRUE; /* Return value */
-
- FUNC_ENTER_NOAPI(H5S_all_is_single, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_all_is_single);
assert(space);
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(TRUE);
} /* H5S_all_is_single() */
@@ -722,15 +687,12 @@ done:
htri_t
H5S_all_is_regular(const H5S_t UNUSED *space)
{
- htri_t ret_value=TRUE; /* Return value */
-
- FUNC_ENTER_NOAPI(H5S_all_is_regular, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_all_is_regular);
/* Check args */
assert(space);
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(TRUE);
} /* H5S_all_is_regular() */
@@ -852,9 +814,8 @@ H5S_all_get_seq_list(const H5S_t UNUSED *space, unsigned UNUSED flags, H5S_sel_i
hsize_t *off, size_t *len)
{
size_t elem_used; /* The number of elements used */
- herr_t ret_value=SUCCEED; /* return value */
- FUNC_ENTER_NOAPI (H5S_all_get_seq_list, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_all_get_seq_list);
/* Check args */
assert(space);
@@ -885,7 +846,6 @@ H5S_all_get_seq_list(const H5S_t UNUSED *space, unsigned UNUSED flags, H5S_sel_i
iter->u.all.elmt_offset+=elem_used;
iter->u.all.byte_offset+=len[0];
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
} /* end H5S_all_get_seq_list() */
diff --git a/src/H5Shyper.c b/src/H5Shyper.c
index 510f26d..eb25a8c 100644
--- a/src/H5Shyper.c
+++ b/src/H5Shyper.c
@@ -32,10 +32,6 @@
#include "H5Spkg.h" /* Dataspace functions */
#include "H5Vprivate.h" /* Vector functions */
-/* Interface initialization */
-#define INTERFACE_INIT NULL
-static int interface_initialize_g = 0;
-
/* Local datatypes */
/* Static function prototypes */
@@ -45,7 +41,7 @@ static H5S_hyper_span_info_t *H5S_hyper_copy_span (H5S_hyper_span_info_t *spans)
static herr_t H5S_hyper_span_scratch (H5S_hyper_span_info_t *spans, void *scr_value);
static herr_t H5S_hyper_span_precompute (H5S_hyper_span_info_t *spans, size_t elmt_size);
static herr_t H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
- const hssize_t start[], const hsize_t stride[], const hsize_t count[], const hsize_t block[]);
+ const hsize_t start[], const hsize_t stride[], const hsize_t count[], const hsize_t block[]);
static herr_t H5S_hyper_generate_spans(H5S_t *space);
/* Selection callbacks */
@@ -58,15 +54,15 @@ static htri_t H5S_hyper_is_valid(const H5S_t *space);
static hssize_t H5S_hyper_serial_size(const H5S_t *space);
static herr_t H5S_hyper_serialize(const H5S_t *space, uint8_t *buf);
static herr_t H5S_hyper_deserialize(H5S_t *space, const uint8_t *buf);
-static herr_t H5S_hyper_bounds(const H5S_t *space, hssize_t *start, hssize_t *end);
+static herr_t H5S_hyper_bounds(const H5S_t *space, hsize_t *start, hsize_t *end);
static htri_t H5S_hyper_is_contiguous(const H5S_t *space);
static htri_t H5S_hyper_is_single(const H5S_t *space);
static htri_t H5S_hyper_is_regular(const H5S_t *space);
static herr_t H5S_hyper_iter_init(H5S_sel_iter_t *iter, const H5S_t *space);
/* Selection iteration callbacks */
-static herr_t H5S_hyper_iter_coords(const H5S_sel_iter_t *iter, hssize_t *coords);
-static herr_t H5S_hyper_iter_block(const H5S_sel_iter_t *iter, hssize_t *start, hssize_t *end);
+static herr_t H5S_hyper_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords);
+static herr_t H5S_hyper_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end);
static hsize_t H5S_hyper_iter_nelmts(const H5S_sel_iter_t *iter);
static htri_t H5S_hyper_iter_has_next_block(const H5S_sel_iter_t *sel_iter);
static herr_t H5S_hyper_iter_next(H5S_sel_iter_t *sel_iter, size_t nelem);
@@ -132,7 +128,7 @@ H5FL_DEFINE_STATIC(H5S_hyper_span_info_t);
static herr_t
H5S_hyper_print_spans_helper(FILE *f, struct H5S_hyper_span_t *span,unsigned depth)
{
- FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_print_spans_helper);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_print_spans_helper);
while(span) {
HDfprintf(f,"%s: depth=%u, span=%p, (%d, %d), nelem=%u, pstride=%u\n",FUNC,depth,span,(int)span->low,(int)span->high,(unsigned)span->nelem,(unsigned)span->pstride);
@@ -149,7 +145,7 @@ H5S_hyper_print_spans_helper(FILE *f, struct H5S_hyper_span_t *span,unsigned dep
herr_t
H5S_hyper_print_spans(FILE *f, const struct H5S_hyper_span_info_t *span_lst)
{
- FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_print_spans);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_print_spans);
if(span_lst!=NULL) {
HDfprintf(f,"%s: spans=%p, count=%u, scratch=%p, head=%p\n",FUNC,span_lst,span_lst->count,span_lst->scratch,span_lst->head);
@@ -174,7 +170,7 @@ H5S_hyper_print_diminfo_helper(FILE *f, const char *field, unsigned ndims, const
{
unsigned u; /* Local index variable */
- FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_print_diminfo_helper);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_print_diminfo_helper);
if(dinfo!=NULL) {
HDfprintf(f,"%s: %s: start=[",FUNC,field);
@@ -236,9 +232,8 @@ H5S_hyper_iter_init(H5S_sel_iter_t *iter, const H5S_t *space)
unsigned rank; /* Dataspace's dimension rank */
unsigned u; /* Index variable */
int i; /* Index variable */
- herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5S_hyper_iter_init, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_iter_init);
/* Check args */
assert(space && H5S_SEL_HYPERSLABS==H5S_GET_SELECT_TYPE(space));
@@ -396,8 +391,7 @@ H5S_hyper_iter_init(H5S_sel_iter_t *iter, const H5S_t *space)
/* Initialize type of selection iterator */
iter->type=H5S_sel_iter_hyper;
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
} /* H5S_hyper_iter_init() */
@@ -417,7 +411,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5S_hyper_iter_coords (const H5S_sel_iter_t *iter, hssize_t *coords)
+H5S_hyper_iter_coords (const H5S_sel_iter_t *iter, hsize_t *coords)
{
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_iter_coords);
@@ -437,17 +431,16 @@ H5S_hyper_iter_coords (const H5S_sel_iter_t *iter, hssize_t *coords)
flat_dim=iter->u.hyp.iter_rank-1;
/* Copy the coordinates up to where things got flattened */
- HDmemcpy(coords,iter->u.hyp.off,sizeof(hssize_t)*flat_dim);
+ HDmemcpy(coords,iter->u.hyp.off,sizeof(hsize_t)*flat_dim);
/* Compute the coordinates for the flattened dimensions */
- H5_CHECK_OVERFLOW(iter->u.hyp.off[flat_dim],hssize_t,hsize_t);
- H5V_array_calc((hsize_t)iter->u.hyp.off[flat_dim],iter->rank-flat_dim,&(iter->dims[flat_dim]),&(coords[flat_dim]));
+ H5V_array_calc(iter->u.hyp.off[flat_dim],iter->rank-flat_dim,&(iter->dims[flat_dim]),&(coords[flat_dim]));
} /* end if */
else
- HDmemcpy(coords,iter->u.hyp.off,sizeof(hssize_t)*iter->rank);
+ HDmemcpy(coords,iter->u.hyp.off,sizeof(hsize_t)*iter->rank);
} /* end if */
else
- HDmemcpy(coords,iter->u.hyp.off,sizeof(hssize_t)*iter->rank);
+ HDmemcpy(coords,iter->u.hyp.off,sizeof(hsize_t)*iter->rank);
FUNC_LEAVE_NOAPI(SUCCEED);
} /* H5S_hyper_iter_coords() */
@@ -472,7 +465,7 @@ H5S_hyper_iter_coords (const H5S_sel_iter_t *iter, hssize_t *coords)
*-------------------------------------------------------------------------
*/
static herr_t
-H5S_hyper_iter_block (const H5S_sel_iter_t *iter, hssize_t *start, hssize_t *end)
+H5S_hyper_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end)
{
unsigned u; /* Local index variable */
@@ -564,7 +557,7 @@ H5S_hyper_iter_has_next_block(const H5S_sel_iter_t *iter)
/* Check for a single "regular" hyperslab */
if(iter->u.hyp.diminfo_valid) {
const H5S_hyper_dim_t *tdiminfo; /* Temporary pointer to diminfo information */
- const hssize_t *toff; /* Temporary offset in selection */
+ const hsize_t *toff; /* Temporary offset in selection */
/* Check if the offset of the iterator is at the last location in all dimensions */
tdiminfo=iter->u.hyp.diminfo;
@@ -573,8 +566,7 @@ H5S_hyper_iter_has_next_block(const H5S_sel_iter_t *iter)
/* If there is only one block, continue */
if(tdiminfo[u].count==1)
continue;
- H5_CHECK_OVERFLOW(tdiminfo[u].start+((tdiminfo[u].count-1)*tdiminfo[u].stride),hsize_t,hssize_t);
- if(toff[u]!=(hssize_t)(tdiminfo[u].start+((tdiminfo[u].count-1)*tdiminfo[u].stride)))
+ if(toff[u]!=(tdiminfo[u].start+((tdiminfo[u].count-1)*tdiminfo[u].stride)))
HGOTO_DONE(TRUE);
} /* end for */
} /* end if */
@@ -707,7 +699,7 @@ H5S_hyper_iter_next(H5S_sel_iter_t *iter, size_t nelem)
else {
H5S_hyper_span_t *curr_span; /* Current hyperslab span node */
H5S_hyper_span_t **ispan; /* Iterator's hyperslab span nodes */
- hssize_t *abs_arr; /* Absolute hyperslab span position */
+ hsize_t *abs_arr; /* Absolute hyperslab span position */
int curr_dim; /* Temporary rank holder */
/* Set the rank of the fastest changing dimension */
@@ -907,7 +899,7 @@ H5S_hyper_iter_next_block(H5S_sel_iter_t *iter)
else {
H5S_hyper_span_t *curr_span; /* Current hyperslab span node */
H5S_hyper_span_t **ispan; /* Iterator's hyperslab span nodes */
- hssize_t *abs_arr; /* Absolute hyperslab span position */
+ hsize_t *abs_arr; /* Absolute hyperslab span position */
int curr_dim; /* Temporary rank holder */
/* Set the rank of the fastest changing dimension */
@@ -1033,7 +1025,7 @@ H5S_hyper_iter_release (H5S_sel_iter_t *iter)
Make a new hyperslab span node
USAGE
H5S_hyper_span_t *H5S_hyper_new_span(low, high, down, next)
- hssize_t low, high; IN: Low and high bounds for new span node
+ hsize_t low, high; IN: Low and high bounds for new span node
H5S_hyper_span_info_t *down; IN: Down span tree for new node
H5S_hyper_span_t *next; IN: Next span for new node
RETURNS
@@ -1048,7 +1040,7 @@ H5S_hyper_iter_release (H5S_sel_iter_t *iter)
REVISION LOG
--------------------------------------------------------------------------*/
static H5S_hyper_span_t *
-H5S_hyper_new_span (hssize_t low, hssize_t high, H5S_hyper_span_info_t *down, H5S_hyper_span_t *next)
+H5S_hyper_new_span (hsize_t low, hsize_t high, H5S_hyper_span_info_t *down, H5S_hyper_span_t *next)
{
H5S_hyper_span_t *ret_value;
@@ -1667,10 +1659,10 @@ H5S_hyper_is_valid_helper (const H5S_hyper_span_info_t *spans, const hssize_t *o
while(curr!=NULL && ret_value==TRUE) {
/* Check if an offset has been defined */
/* Bounds check the selected point + offset against the extent */
- if(((curr->low+offset[rank])>=(hssize_t)size[rank])
- || ((curr->low+offset[rank])<0)
- || ((curr->high+offset[rank])>=(hssize_t)size[rank])
- || ((curr->high+offset[rank])<0)) {
+ if((((hssize_t)curr->low+offset[rank])>=(hssize_t)size[rank])
+ || (((hssize_t)curr->low+offset[rank])<0)
+ || (((hssize_t)curr->high+offset[rank])>=(hssize_t)size[rank])
+ || (((hssize_t)curr->high+offset[rank])<0)) {
ret_value=FALSE;
break;
} /* end if */
@@ -1717,7 +1709,7 @@ H5S_hyper_is_valid (const H5S_t *space)
unsigned u; /* Counter */
htri_t ret_value=TRUE; /* return value */
- FUNC_ENTER_NOAPI(H5S_hyper_is_valid, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_is_valid);
assert(space);
@@ -1732,12 +1724,12 @@ H5S_hyper_is_valid (const H5S_t *space)
/* no data point is chosen */
if (diminfo[u].count && diminfo[u].block) {
/* Bounds check the start point in this dimension */
- if((diminfo[u].start+space->select.offset[u])<0 ||
- (diminfo[u].start+space->select.offset[u])>=(hssize_t)space->extent.size[u])
+ if(((hssize_t)diminfo[u].start+space->select.offset[u])<0 ||
+ ((hssize_t)diminfo[u].start+space->select.offset[u])>=(hssize_t)space->extent.size[u])
HGOTO_DONE(FALSE)
/* Compute the largest location in this dimension */
- end=diminfo[u].start+diminfo[u].stride*(diminfo[u].count-1)+(diminfo[u].block-1)+space->select.offset[u];
+ end=(hssize_t)(diminfo[u].start+diminfo[u].stride*(diminfo[u].count-1)+(diminfo[u].block-1))+space->select.offset[u];
/* Bounds check the end point in this dimension */
if(end<0 || end>=(hssize_t)space->extent.size[u])
@@ -1908,7 +1900,7 @@ H5S_hyper_serial_size (const H5S_t *space)
hssize_t block_count; /* block counter for regular hyperslabs */
hssize_t ret_value; /* return value */
- FUNC_ENTER_NOAPI(H5S_hyper_serial_size, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_serial_size);
assert(space);
@@ -1931,7 +1923,6 @@ H5S_hyper_serial_size (const H5S_t *space)
ret_value+=8*space->extent.rank*block_count;
} /* end else */
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5S_hyper_serial_size() */
@@ -1959,7 +1950,7 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_hyper_serialize_helper (const H5S_hyper_span_info_t *spans, hssize_t *start, hssize_t *end, hsize_t rank, uint8_t **buf)
+H5S_hyper_serialize_helper (const H5S_hyper_span_info_t *spans, hsize_t *start, hsize_t *end, hsize_t rank, uint8_t **buf)
{
H5S_hyper_span_t *curr; /* Pointer to current hyperslab span */
hsize_t u; /* Index variable */
@@ -2038,10 +2029,10 @@ H5S_hyper_serialize (const H5S_t *space, uint8_t *buf)
{
const H5S_hyper_dim_t *diminfo; /* Alias for dataspace's diminfo information */
hsize_t tmp_count[H5O_LAYOUT_NDIMS]; /* Temporary hyperslab counts */
- hssize_t offset[H5O_LAYOUT_NDIMS]; /* Offset of element in dataspace */
- hssize_t start[H5O_LAYOUT_NDIMS]; /* Location of start of hyperslab */
- hssize_t end[H5O_LAYOUT_NDIMS]; /* Location of end of hyperslab */
- hssize_t temp_off; /* Offset in a given dimension */
+ hsize_t offset[H5O_LAYOUT_NDIMS]; /* Offset of element in dataspace */
+ hsize_t start[H5O_LAYOUT_NDIMS]; /* Location of start of hyperslab */
+ hsize_t end[H5O_LAYOUT_NDIMS]; /* Location of end of hyperslab */
+ hsize_t temp_off; /* Offset in a given dimension */
uint8_t *lenp; /* pointer to length location for later storage */
uint32_t len=0; /* number of bytes used */
int i; /* local counting variable */
@@ -2050,9 +2041,8 @@ H5S_hyper_serialize (const H5S_t *space, uint8_t *buf)
int temp_dim; /* Temporary rank holder */
int ndims; /* Rank of the dataspace */
int done; /* Whether we are done with the iteration */
- herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5S_hyper_serialize, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_serialize);
assert(space);
@@ -2170,8 +2160,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 */
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
} /* H5S_hyper_serialize() */
@@ -2199,13 +2188,13 @@ H5S_hyper_deserialize (H5S_t *space, const uint8_t *buf)
{
uint32_t rank; /* rank of points */
size_t num_elem=0; /* number of elements in selection */
- hssize_t start[H5O_LAYOUT_NDIMS]; /* hyperslab start information */
- hssize_t end[H5O_LAYOUT_NDIMS]; /* hyperslab end information */
+ hsize_t start[H5O_LAYOUT_NDIMS]; /* hyperslab start information */
+ hsize_t end[H5O_LAYOUT_NDIMS]; /* hyperslab end information */
hsize_t stride[H5O_LAYOUT_NDIMS]; /* hyperslab stride information */
hsize_t count[H5O_LAYOUT_NDIMS]; /* hyperslab count information */
hsize_t block[H5O_LAYOUT_NDIMS]; /* hyperslab block information */
- hssize_t *tstart=NULL; /* temporary hyperslab pointers */
- hssize_t *tend=NULL; /* temporary hyperslab pointers */
+ hsize_t *tstart=NULL; /* temporary hyperslab pointers */
+ hsize_t *tend=NULL; /* temporary hyperslab pointers */
hsize_t *tstride=NULL; /* temporary hyperslab pointers */
hsize_t *tcount=NULL; /* temporary hyperslab pointers */
hsize_t *tblock=NULL; /* temporary hyperslab pointers */
@@ -2263,8 +2252,8 @@ done:
USAGE
herr_t H5S_hyper_span_blocklist(spans, start, end, rank, startblock, numblocks, buf)
H5S_hyper_span_info_t *spans; IN: Dataspace pointer of selection to query
- hssize_t start[]; IN/OUT: Accumulated start points
- hssize_t end[]; IN/OUT: Accumulated end points
+ hsize_t start[]; IN/OUT: Accumulated start points
+ hsize_t end[]; IN/OUT: Accumulated end points
hsize_t rank; IN: Rank of dataspace
hsize_t *startblock; IN/OUT: Hyperslab block to start with
hsize_t *numblocks; IN/OUT: Number of hyperslab blocks to get
@@ -2289,7 +2278,7 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_hyper_span_blocklist(H5S_hyper_span_info_t *spans, hssize_t start[], hssize_t end[], hsize_t rank, hsize_t *startblock, hsize_t *numblocks, hsize_t **buf)
+H5S_hyper_span_blocklist(H5S_hyper_span_info_t *spans, hsize_t start[], hsize_t end[], hsize_t rank, hsize_t *startblock, hsize_t *numblocks, hsize_t **buf)
{
H5S_hyper_span_t *curr; /* Pointer to current hyperslab span */
hsize_t u; /* Index variable */
@@ -2394,10 +2383,10 @@ H5S_get_select_hyper_blocklist(H5S_t *space, hbool_t internal, hsize_t startbloc
{
H5S_hyper_dim_t *diminfo; /* Alias for dataspace's diminfo information */
hsize_t tmp_count[H5O_LAYOUT_NDIMS]; /* Temporary hyperslab counts */
- hssize_t offset[H5O_LAYOUT_NDIMS]; /* Offset of element in dataspace */
- hssize_t start[H5O_LAYOUT_NDIMS]; /* Location of start of hyperslab */
- hssize_t end[H5O_LAYOUT_NDIMS]; /* Location of end of hyperslab */
- hssize_t temp_off; /* Offset in a given dimension */
+ hsize_t offset[H5O_LAYOUT_NDIMS]; /* Offset of element in dataspace */
+ hsize_t start[H5O_LAYOUT_NDIMS]; /* Location of start of hyperslab */
+ hsize_t end[H5O_LAYOUT_NDIMS]; /* Location of end of hyperslab */
+ hsize_t temp_off; /* Offset in a given dimension */
int i; /* Counter */
int fast_dim; /* Rank of the fastest changing dimension for the dataspace */
int temp_dim; /* Temporary rank holder */
@@ -2597,12 +2586,12 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_hyper_bounds_helper (const H5S_hyper_span_info_t *spans, const hssize_t *offset, hsize_t rank, hssize_t *start, hssize_t *end)
+H5S_hyper_bounds_helper (const H5S_hyper_span_info_t *spans, const hssize_t *offset, hsize_t rank, hsize_t *start, hsize_t *end)
{
H5S_hyper_span_t *curr; /* Hyperslab information nodes */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_bounds_helper);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_bounds_helper)
assert(spans);
assert(offset);
@@ -2613,6 +2602,10 @@ H5S_hyper_bounds_helper (const H5S_hyper_span_info_t *spans, const hssize_t *off
/* Check each point to determine whether selection+offset is within extent */
curr=spans->head;
while(curr!=NULL) {
+ /* Check for offset moving selection negative */
+ if(((hssize_t)curr->low+offset[rank])<0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "offset moves selection out of bounds")
+
/* Check if the current span extends the bounding box */
if((curr->low+offset[rank])<start[rank])
start[rank]=curr->low+offset[rank];
@@ -2622,7 +2615,7 @@ H5S_hyper_bounds_helper (const H5S_hyper_span_info_t *spans, const hssize_t *off
/* Recurse if this node has down spans */
if(curr->down!=NULL) {
if(H5S_hyper_bounds_helper(curr->down,offset,rank+1,start,end)<0)
- HGOTO_DONE(FAIL)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "failure in lower dimension")
} /* end if */
/* Advance to next node */
@@ -2630,7 +2623,7 @@ H5S_hyper_bounds_helper (const H5S_hyper_span_info_t *spans, const hssize_t *off
} /* end while */
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5S_hyper_bounds_helper() */
@@ -2661,13 +2654,13 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
herr_t
-H5S_hyper_bounds(const H5S_t *space, hssize_t *start, hssize_t *end)
+H5S_hyper_bounds(const H5S_t *space, hsize_t *start, hsize_t *end)
{
int rank; /* Dataspace rank */
int i; /* index variable */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5S_hyper_bounds, FAIL);
+ FUNC_ENTER_NOAPI(H5S_hyper_bounds,FAIL)
assert(space);
assert(start);
@@ -2676,8 +2669,8 @@ H5S_hyper_bounds(const H5S_t *space, hssize_t *start, hssize_t *end)
/* Set the start and end arrays up */
rank=space->extent.rank;
for(i=0; i<rank; i++) {
- start[i]=HSSIZET_MAX;
- end[i]=HSSIZET_MIN;
+ start[i]=HSIZET_MAX;
+ end[i]=0;
} /* end for */
/* Check for a "regular" hyperslab selection */
@@ -2686,6 +2679,10 @@ H5S_hyper_bounds(const H5S_t *space, hssize_t *start, hssize_t *end)
/* Check each dimension */
for(i=0; i<rank; i++) {
+ /* Check for offset moving selection negative */
+ if((space->select.offset[i]+(hssize_t)diminfo[i].start)<0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "offset moves selection out of bounds")
+
/* Compute the smallest location in this dimension */
start[i]=diminfo[i].start+space->select.offset[i];
@@ -2699,7 +2696,7 @@ H5S_hyper_bounds(const H5S_t *space, hssize_t *start, hssize_t *end)
} /* end if */
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* H5S_hyper_bounds() */
@@ -2731,7 +2728,7 @@ H5S_hyper_is_contiguous(const H5S_t *space)
large_contiguous; /* Flag for large contiguous block */
htri_t ret_value=FALSE; /* return value */
- FUNC_ENTER_NOAPI(H5S_hyper_is_contiguous, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_is_contiguous);
assert(space);
@@ -2825,7 +2822,7 @@ H5S_hyper_is_contiguous(const H5S_t *space)
} /* end if */
else {
/* If this span doesn't cover the entire dimension, then this selection isn't contiguous */
- if(((span->high-span->low)+1)!=(hssize_t)space->extent.size[u]) {
+ if(((span->high-span->low)+1)!=space->extent.size[u]) {
large_contiguous=FALSE;
break;
} /* end if */
@@ -2883,7 +2880,6 @@ H5S_hyper_is_contiguous(const H5S_t *space)
ret_value=TRUE;
} /* end else */
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* H5S_hyper_is_contiguous() */
@@ -2914,7 +2910,7 @@ H5S_hyper_is_single(const H5S_t *space)
unsigned u; /* index variable */
htri_t ret_value=TRUE; /* return value */
- FUNC_ENTER_NOAPI(H5S_hyper_is_single, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_is_single);
assert(space);
@@ -2981,7 +2977,7 @@ H5S_hyper_is_regular(const H5S_t *space)
{
htri_t ret_value; /* return value */
- FUNC_ENTER_NOAPI(H5S_hyper_is_regular, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_hyper_is_regular);
/* Check args */
assert(space);
@@ -2992,7 +2988,6 @@ H5S_hyper_is_regular(const H5S_t *space)
else
ret_value=FALSE;
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* H5S_hyper_is_regular() */
@@ -3096,7 +3091,7 @@ H5S_hyper_recover_span (unsigned *recover, H5S_hyper_span_t **curr_span, H5S_hyp
USAGE
H5S_hyper_span_t *H5S_hyper_coord_to_span(rank, coords)
unsigned rank; IN: Number of dimensions of coordinate
- hssize_t *coords; IN: Location of element
+ hsize_t *coords; IN: Location of element
RETURNS
Non-negative on success, negative on failure
DESCRIPTION
@@ -3107,7 +3102,7 @@ H5S_hyper_recover_span (unsigned *recover, H5S_hyper_span_t **curr_span, H5S_hyp
REVISION LOG
--------------------------------------------------------------------------*/
static H5S_hyper_span_t *
-H5S_hyper_coord_to_span(unsigned rank, hssize_t *coords)
+H5S_hyper_coord_to_span(unsigned rank, hsize_t *coords)
{
H5S_hyper_span_t *new_span; /* Pointer to new span tree for coordinate */
H5S_hyper_span_info_t *down=NULL; /* Pointer to new span tree for next level down */
@@ -3161,7 +3156,7 @@ done:
herr_t H5S_hyper_add_span_element_helper(prev_span, span_tree, rank, coords)
H5S_hyper_span_info_t *span_tree; IN/OUT: Pointer to span tree to append to
unsigned rank; IN: Number of dimensions of coordinates
- hssize_t *coords; IN: Location of element to add to span tree
+ hsize_t *coords; IN: Location of element to add to span tree
RETURNS
Non-negative on success, negative on failure
DESCRIPTION
@@ -3173,7 +3168,7 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned rank, hssize_t *coords)
+H5S_hyper_add_span_element_helper(H5S_hyper_span_info_t *span_tree, unsigned rank, hsize_t *coords)
{
H5S_hyper_span_info_t *tspan_info; /* Temporary pointer to span info */
H5S_hyper_span_info_t *prev_span_info; /* Pointer to span info for level above current position */
@@ -3363,7 +3358,7 @@ done:
herr_t H5S_hyper_add_span_element(space, span_tree, rank, coords)
H5S_t *space; IN/OUT: Pointer to dataspace to add coordinate to
unsigned rank; IN: Number of dimensions of coordinates
- hssize_t *coords; IN: Location of element to add to span tree
+ hsize_t *coords; IN: Location of element to add to span tree
RETURNS
Non-negative on success, negative on failure
DESCRIPTION
@@ -3375,7 +3370,7 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
herr_t
-H5S_hyper_add_span_element(H5S_t *space, unsigned rank, hssize_t *coords)
+H5S_hyper_add_span_element(H5S_t *space, unsigned rank, hsize_t *coords)
{
herr_t ret_value=SUCCEED; /* Return value */
@@ -3504,7 +3499,7 @@ H5S_hyper_convert(H5S_t *space)
case H5S_SEL_ALL: /* All elements selected in dataspace */
/* Convert current "all" selection to "real" hyperslab selection */
{
- hssize_t tmp_start[H5O_LAYOUT_NDIMS]; /* Temporary start information */
+ hsize_t tmp_start[H5O_LAYOUT_NDIMS]; /* Temporary start information */
hsize_t tmp_stride[H5O_LAYOUT_NDIMS]; /* Temporary stride information */
hsize_t tmp_count[H5O_LAYOUT_NDIMS]; /* Temporary count information */
hsize_t tmp_block[H5O_LAYOUT_NDIMS]; /* Temporary block information */
@@ -3666,9 +3661,9 @@ done:
htri_t H5S_hyper_intersect_block_helper(spans, start, end)
H5S_hyper_span_info_t *spans; IN: First span tree to operate with
hssize_t *offset; IN: Selection offset coordinate
- hssize_t *start; IN: Starting coordinate for block
- hssize_t *end; IN: Ending coordinate for block
- RETURNS
+ hsize_t *start; IN: Starting coordinate for block
+ hsize_t *end; IN: Ending coordinate for block
+ RETURN
Non-negative on success, negative on failure
DESCRIPTION
Quickly detect intersections between span tree and block
@@ -3678,7 +3673,7 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static htri_t
-H5S_hyper_intersect_block_helper (const H5S_hyper_span_info_t *spans, hssize_t *offset, hssize_t *start, hssize_t *end)
+H5S_hyper_intersect_block_helper (const H5S_hyper_span_info_t *spans, hssize_t *offset, hsize_t *start, hsize_t *end)
{
H5S_hyper_span_t *curr; /* Pointer to current span in 1st span tree */
htri_t status; /* Status from recursive call */
@@ -3698,11 +3693,11 @@ H5S_hyper_intersect_block_helper (const H5S_hyper_span_info_t *spans, hssize_t *
/* Iterate over the spans in the tree */
while(curr!=NULL) {
/* Check for span entirely before block */
- if((curr->high+*offset)<*start)
+ if(((hssize_t)curr->high+*offset)<(hssize_t)*start)
/* Advance to next span in this dimension */
curr=curr->next;
/* If this span is past the end of the block, then we're done in this dimension */
- else if((curr->low+*offset)>*end)
+ else if(((hssize_t)curr->low+*offset)>(hssize_t)*end)
HGOTO_DONE(FALSE)
/* block & span overlap */
else {
@@ -3748,7 +3743,7 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
htri_t
-H5S_hyper_intersect_block (H5S_t *space, hssize_t *start, hssize_t *end)
+H5S_hyper_intersect_block (H5S_t *space, hsize_t *start, hsize_t *end)
{
htri_t ret_value=FAIL; /* Return value */
@@ -3764,7 +3759,7 @@ H5S_hyper_intersect_block (H5S_t *space, hssize_t *start, hssize_t *end)
if(H5S_GET_SELECT_TYPE(space)==H5S_SEL_ALL)
HGOTO_DONE(TRUE);
- /* Check that the space selections both have span trees */
+ /* Check that the space selection has a span tree */
if(space->select.sel_info.hslab->span_lst==NULL)
if(H5S_hyper_generate_spans(space)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_UNINITIALIZED, FAIL, "dataspace does not have span tree");
@@ -3780,11 +3775,120 @@ done:
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_adjust_helper
+ H5S_hyper_adjust_helper_u
+ PURPOSE
+ Helper routine to adjust offsets in span trees
+ USAGE
+ herr_t H5S_hyper_adjust_helper_u(spans, offset)
+ H5S_hyper_span_info_t *spans; IN: Span tree to operate with
+ const hsize_t *offset; IN: Offset to subtract
+ RETURNS
+ Non-negative on success, negative on failure
+ DESCRIPTION
+ Adjust the location of the spans in a span tree by subtracting an offset
+ GLOBAL VARIABLES
+ COMMENTS, BUGS, ASSUMPTIONS
+ EXAMPLES
+ REVISION LOG
+--------------------------------------------------------------------------*/
+static herr_t
+H5S_hyper_adjust_helper_u (H5S_hyper_span_info_t *spans, const hsize_t *offset)
+{
+ H5S_hyper_span_t *span; /* Pointer to current span in span tree */
+
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_adjust_helper_u);
+
+ /* Sanity check */
+ assert(spans);
+ assert(offset);
+
+ /* Check if we've already set this down span tree */
+ if(spans->scratch!=(H5S_hyper_span_info_t *)~((size_t)NULL)) {
+ /* Set the tree's scratch pointer */
+ spans->scratch=(H5S_hyper_span_info_t *)~((size_t)NULL);
+
+ /* Get the span lists for each span in this tree */
+ span=spans->head;
+
+ /* Iterate over the spans in tree */
+ while(span!=NULL) {
+ /* Adjust span offset */
+ assert(span->low>=*offset);
+ span->low-=*offset;
+ span->high-=*offset;
+
+ /* Recursively adjust spans in next dimension down */
+ if(span->down!=NULL)
+ H5S_hyper_adjust_helper_u(span->down,offset+1);
+
+ /* Advance to next span in this dimension */
+ span=span->next;
+ } /* end while */
+ } /* end if */
+
+ FUNC_LEAVE_NOAPI(SUCCEED);
+} /* H5S_hyper_adjust_helper_u() */
+
+
+/*--------------------------------------------------------------------------
+ NAME
+ H5S_hyper_adjust_u
+ PURPOSE
+ Adjust a hyperslab selection by subtracting an offset
+ USAGE
+ herr_t H5S_hyper_adjust_u(space,offset)
+ H5S_t *space; IN/OUT: Pointer to dataspace to adjust
+ const hsize_t *offset; IN: Offset to subtract
+ RETURNS
+ Non-negative on success, negative on failure
+ DESCRIPTION
+ Moves a hyperslab selection by subtracting an offset from it.
+ GLOBAL VARIABLES
+ COMMENTS, BUGS, ASSUMPTIONS
+ EXAMPLES
+ REVISION LOG
+--------------------------------------------------------------------------*/
+herr_t
+H5S_hyper_adjust_u(H5S_t *space, const hsize_t *offset)
+{
+ unsigned u; /* Local index variable */
+ herr_t ret_value=SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_adjust_u);
+
+ assert(space);
+ assert(offset);
+
+ /* Subtract the offset from the "regular" coordinates, if they exist */
+ if(space->select.sel_info.hslab->diminfo_valid) {
+ for(u=0; u<space->extent.rank; u++) {
+ assert(space->select.sel_info.hslab->opt_diminfo[u].start>=offset[u]);
+ space->select.sel_info.hslab->opt_diminfo[u].start-=offset[u];
+ } /* end for */
+ } /* end if */
+
+ /* Subtract the offset from the span tree coordinates, if they exist */
+ if(space->select.sel_info.hslab->span_lst) {
+ if(H5S_hyper_adjust_helper_u(space->select.sel_info.hslab->span_lst,offset)<0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab offset adjustment");
+
+ /* Reset the scratch pointers for the next routine which needs them */
+ if(H5S_hyper_span_scratch(space->select.sel_info.hslab->span_lst,NULL)==FAIL)
+ HGOTO_ERROR(H5E_INTERNAL, H5E_CANTFREE, FAIL, "can't reset hyperslab scratch pointer");
+ } /* end if */
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value);
+} /* H5S_hyper_adjust_u() */
+
+
+/*--------------------------------------------------------------------------
+ NAME
+ H5S_hyper_adjust_helper_s
PURPOSE
Helper routine to adjust offsets in span trees
USAGE
- herr_t H5S_hyper_adjust_helper(spans, offset)
+ herr_t H5S_hyper_adjust_helper_s(spans, offset)
H5S_hyper_span_info_t *spans; IN: Span tree to operate with
const hssize_t *offset; IN: Offset to subtract
RETURNS
@@ -3797,11 +3901,11 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_hyper_adjust_helper (H5S_hyper_span_info_t *spans, const hssize_t *offset)
+H5S_hyper_adjust_helper_s (H5S_hyper_span_info_t *spans, const hssize_t *offset)
{
H5S_hyper_span_t *span; /* Pointer to current span in span tree */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_adjust_helper);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_adjust_helper_s);
/* Sanity check */
assert(spans);
@@ -3818,14 +3922,13 @@ H5S_hyper_adjust_helper (H5S_hyper_span_info_t *spans, const hssize_t *offset)
/* Iterate over the spans in tree */
while(span!=NULL) {
/* Adjust span offset */
+ assert((hssize_t)span->low>=*offset);
span->low-=*offset;
- assert(span->low>=0);
span->high-=*offset;
- assert(span->high>=0);
/* Recursively adjust spans in next dimension down */
if(span->down!=NULL)
- H5S_hyper_adjust_helper(span->down,offset+1);
+ H5S_hyper_adjust_helper_s(span->down,offset+1);
/* Advance to next span in this dimension */
span=span->next;
@@ -3833,16 +3936,16 @@ H5S_hyper_adjust_helper (H5S_hyper_span_info_t *spans, const hssize_t *offset)
} /* end if */
FUNC_LEAVE_NOAPI(SUCCEED);
-} /* H5S_hyper_adjust_helper() */
+} /* H5S_hyper_adjust_helper_s() */
/*--------------------------------------------------------------------------
NAME
- H5S_hyper_adjust
+ H5S_hyper_adjust_s
PURPOSE
Adjust a hyperslab selection by subtracting an offset
USAGE
- herr_t H5S_hyper_adjust(space,offset)
+ herr_t H5S_hyper_adjust_s(space,offset)
H5S_t *space; IN/OUT: Pointer to dataspace to adjust
const hssize_t *offset; IN: Offset to subtract
RETURNS
@@ -3855,12 +3958,12 @@ H5S_hyper_adjust_helper (H5S_hyper_span_info_t *spans, const hssize_t *offset)
REVISION LOG
--------------------------------------------------------------------------*/
herr_t
-H5S_hyper_adjust(H5S_t *space, const hssize_t *offset)
+H5S_hyper_adjust_s(H5S_t *space, const hssize_t *offset)
{
unsigned u; /* Local index variable */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_adjust);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_hyper_adjust_s);
assert(space);
assert(offset);
@@ -3868,14 +3971,14 @@ H5S_hyper_adjust(H5S_t *space, const hssize_t *offset)
/* Subtract the offset from the "regular" coordinates, if they exist */
if(space->select.sel_info.hslab->diminfo_valid) {
for(u=0; u<space->extent.rank; u++) {
+ assert((hssize_t)space->select.sel_info.hslab->opt_diminfo[u].start>=offset[u]);
space->select.sel_info.hslab->opt_diminfo[u].start-=offset[u];
- assert(space->select.sel_info.hslab->opt_diminfo[u].start>=0);
} /* end for */
} /* end if */
/* Subtract the offset from the span tree coordinates, if they exist */
if(space->select.sel_info.hslab->span_lst) {
- if(H5S_hyper_adjust_helper(space->select.sel_info.hslab->span_lst,offset)<0)
+ if(H5S_hyper_adjust_helper_s(space->select.sel_info.hslab->span_lst,offset)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab offset adjustment");
/* Reset the scratch pointers for the next routine which needs them */
@@ -3885,7 +3988,7 @@ H5S_hyper_adjust(H5S_t *space, const hssize_t *offset)
done:
FUNC_LEAVE_NOAPI(ret_value);
-} /* H5S_hyper_adjust() */
+} /* H5S_hyper_adjust_s() */
/*--------------------------------------------------------------------------
@@ -3929,10 +4032,9 @@ H5S_hyper_move_helper (H5S_hyper_span_info_t *spans, const hssize_t *offset)
/* Iterate over the spans in tree */
while(span!=NULL) {
/* Adjust span location */
+ assert(*offset>=0);
span->high=*offset+(span->high-span->low);
- assert(span->high>=0);
span->low=*offset;
- assert(span->low>=0);
/* Recursively move spans in next dimension down */
if(span->down!=NULL)
@@ -3979,8 +4081,8 @@ H5S_hyper_move(H5S_t *space, const hssize_t *offset)
/* Move to the offset with the "regular" coordinates, if they exist */
if(space->select.sel_info.hslab->diminfo_valid) {
for(u=0; u<space->extent.rank; u++) {
+ assert(offset[u]>=0);
space->select.sel_info.hslab->opt_diminfo[u].start=offset[u];
- assert(space->select.sel_info.hslab->opt_diminfo[u].start>=0);
} /* end for */
} /* end if */
@@ -4036,7 +4138,7 @@ H5S_hyper_normalize_offset(H5S_t *space)
space->select.offset[u] =- space->select.offset[u];
/* Call the existing 'adjust' routine */
- if(H5S_hyper_adjust(space, space->select.offset)<0)
+ if(H5S_hyper_adjust_s(space, space->select.offset)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_BADSELECT, FAIL, "can't perform hyperslab normalization");
/* Zero out the selection offset */
@@ -4058,7 +4160,7 @@ done:
herr_t H5S_hyper_append_span(prev_span, span_tree, low, high, down, next)
H5S_hyper_span_t **prev_span; IN/OUT: Pointer to previous span in list
H5S_hyper_span_info_t **span_tree; IN/OUT: Pointer to span tree to append to
- hssize_t low, high; IN: Low and high bounds for new span node
+ hsize_t low, high; IN: Low and high bounds for new span node
H5S_hyper_span_info_t *down; IN: Down span tree for new node
H5S_hyper_span_t *next; IN: Next span for new node
RETURNS
@@ -4072,7 +4174,7 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_hyper_append_span (H5S_hyper_span_t **prev_span, H5S_hyper_span_info_t ** span_tree, hssize_t low, hssize_t high, H5S_hyper_span_info_t *down, H5S_hyper_span_t *next)
+H5S_hyper_append_span (H5S_hyper_span_t **prev_span, H5S_hyper_span_info_t ** span_tree, hsize_t low, hsize_t high, H5S_hyper_span_info_t *down, H5S_hyper_span_t *next)
{
H5S_hyper_span_t *new_span;
herr_t ret_value=SUCCEED; /* Return value */
@@ -5030,7 +5132,7 @@ H5S_hyper_merge_spans (H5S_t *space, H5S_hyper_span_info_t *new_spans, hbool_t c
PURPOSE
Count the number of elements in a span tree
USAGE
- hssize_t H5S_hyper_spans_nelem(spans)
+ hsize_t H5S_hyper_spans_nelem(spans)
const H5S_hyper_span_info_t *spans; IN: Hyperslan span tree to count elements of
RETURNS
Number of elements in span tree on success; negative on failure
@@ -5041,11 +5143,11 @@ H5S_hyper_merge_spans (H5S_t *space, H5S_hyper_span_info_t *new_spans, hbool_t c
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-static hssize_t
+static hsize_t
H5S_hyper_spans_nelem (H5S_hyper_span_info_t *spans)
{
H5S_hyper_span_t *span; /* Hyperslab span */
- hssize_t ret_value;
+ hsize_t ret_value;
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_hyper_spans_nelem);
@@ -5080,7 +5182,7 @@ H5S_hyper_spans_nelem (H5S_hyper_span_info_t *spans)
USAGE
H5S_hyper_span_t *H5S_hyper_make_spans(rank, start, stride, count, block)
unsigned rank; IN: # of dimensions of the space
- const hssize_t *start; IN: Starting location of the hyperslabs
+ const hsize_t *start; IN: Starting location of the hyperslabs
const hsize_t *stride; IN: Stride from the beginning of one block to
the next
const hsize_t *count; IN: Number of blocks
@@ -5098,7 +5200,7 @@ H5S_hyper_spans_nelem (H5S_hyper_span_info_t *spans)
REVISION LOG
--------------------------------------------------------------------------*/
static H5S_hyper_span_info_t *
-H5S_hyper_make_spans (unsigned rank, const hssize_t *start, const hsize_t *stride,
+H5S_hyper_make_spans (unsigned rank, const hsize_t *start, const hsize_t *stride,
const hsize_t *count, const hsize_t *block)
{
H5S_hyper_span_info_t *down;/* Pointer to spans in next dimension down */
@@ -5328,7 +5430,7 @@ H5S_hyper_rebuild (H5S_t *space)
static herr_t
H5S_hyper_generate_spans(H5S_t *space)
{
- hssize_t tmp_start[H5O_LAYOUT_NDIMS]; /* Temporary start information */
+ hsize_t tmp_start[H5O_LAYOUT_NDIMS]; /* Temporary start information */
hsize_t tmp_stride[H5O_LAYOUT_NDIMS]; /* Temporary stride information */
hsize_t tmp_count[H5O_LAYOUT_NDIMS]; /* Temporary count information */
hsize_t tmp_block[H5O_LAYOUT_NDIMS]; /* Temporary block information */
@@ -5373,7 +5475,7 @@ done:
*/
static herr_t
H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
- const hssize_t start[],
+ const hsize_t start[],
const hsize_t stride[],
const hsize_t count[],
const hsize_t block[])
@@ -5382,7 +5484,6 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
H5S_hyper_span_info_t *a_not_b=NULL; /* Span tree for hyperslab spans in old span tree and not in new span tree */
H5S_hyper_span_info_t *a_and_b=NULL; /* Span tree for hyperslab spans in both old and new span trees */
H5S_hyper_span_info_t *b_not_a=NULL; /* Span tree for hyperslab spans in new span tree and not in old span tree */
- hssize_t nelem; /* Number of elements in hyperslab span tree */
htri_t status; /* Status from internal calls */
herr_t ret_value=SUCCEED; /* Return value */
@@ -5407,9 +5508,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs");
/* Set the number of elements in current selection */
- if((nelem=H5S_hyper_spans_nelem(new_spans))<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOUNT, FAIL, "can't count hyperslab span elements");
- space->select.num_elem=nelem;
+ space->select.num_elem=H5S_hyper_spans_nelem(new_spans);
/* Indicate that the new_spans are owned */
new_spans=NULL;
@@ -5427,9 +5526,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs");
/* Update the number of elements in current selection */
- if((nelem=H5S_hyper_spans_nelem(b_not_a))<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOUNT, FAIL, "can't count hyperslab span elements");
- space->select.num_elem+=nelem;
+ space->select.num_elem+=H5S_hyper_spans_nelem(b_not_a);
} /* end if */
break;
@@ -5448,9 +5545,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs");
/* Update the number of elements in current selection */
- if((nelem=H5S_hyper_spans_nelem(a_and_b))<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOUNT, FAIL, "can't count hyperslab span elements");
- space->select.num_elem=nelem;
+ space->select.num_elem=H5S_hyper_spans_nelem(a_and_b);
/* Indicate that the a_and_b spans are owned */
a_and_b=NULL;
@@ -5472,18 +5567,14 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs");
/* Update the number of elements in current selection */
- if((nelem=H5S_hyper_spans_nelem(a_not_b))<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOUNT, FAIL, "can't count hyperslab span elements");
- space->select.num_elem=nelem;
+ space->select.num_elem=H5S_hyper_spans_nelem(a_not_b);
} /* end if */
if(b_not_a!=NULL) {
if(H5S_hyper_merge_spans(space,b_not_a,FALSE)<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs");
/* Update the number of elements in current selection */
- if((nelem=H5S_hyper_spans_nelem(b_not_a))<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOUNT, FAIL, "can't count hyperslab span elements");
- space->select.num_elem+=nelem;
+ space->select.num_elem+=H5S_hyper_spans_nelem(b_not_a);
} /* end if */
break;
@@ -5502,9 +5593,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs");
/* Update the number of elements in current selection */
- if((nelem=H5S_hyper_spans_nelem(a_not_b))<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOUNT, FAIL, "can't count hyperslab span elements");
- space->select.num_elem=nelem;
+ space->select.num_elem=H5S_hyper_spans_nelem(a_not_b);
/* Indicate that the a_not_b are owned */
a_not_b=NULL;
@@ -5526,9 +5615,7 @@ H5S_generate_hyperslab (H5S_t *space, H5S_seloper_t op,
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTINSERT, FAIL, "can't insert hyperslabs");
/* Update the number of elements in current selection */
- if((nelem=H5S_hyper_spans_nelem(b_not_a))<0)
- HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOUNT, FAIL, "can't count hyperslab span elements");
- space->select.num_elem=nelem;
+ space->select.num_elem=H5S_hyper_spans_nelem(b_not_a);
/* Indicate that the b_not_a are owned */
b_not_a=NULL;
@@ -5609,7 +5696,7 @@ done:
*/
herr_t
H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
- const hssize_t start[],
+ const hsize_t start[],
const hsize_t *stride,
const hsize_t count[],
const hsize_t *block)
@@ -5708,7 +5795,7 @@ H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op,
/* Convert current "all" selection to "real" hyperslab selection */
/* Then allow operation to proceed */
{
- hssize_t tmp_start[H5O_LAYOUT_NDIMS]; /* Temporary start information */
+ hsize_t tmp_start[H5O_LAYOUT_NDIMS]; /* Temporary start information */
hsize_t tmp_stride[H5O_LAYOUT_NDIMS]; /* Temporary stride information */
hsize_t tmp_count[H5O_LAYOUT_NDIMS]; /* Temporary count information */
hsize_t tmp_block[H5O_LAYOUT_NDIMS]; /* Temporary block information */
@@ -5817,10 +5904,10 @@ done:
herr_t H5Sselect_hyperslab(dsid, op, start, stride, count, block)
hid_t dsid; IN: Dataspace ID of selection to modify
H5S_seloper_t op; IN: Operation to perform on current selection
- const hssize_t *start; IN: Offset of start of hyperslab
- const hssize_t *stride; IN: Hyperslab stride
- const hssize_t *count; IN: Number of blocks included in hyperslab
- const hssize_t *block; IN: Size of block in hyperslab
+ const hsize_t *start; IN: Offset of start of hyperslab
+ const hsize_t *stride; IN: Hyperslab stride
+ const hsize_t *count; IN: Number of blocks included in hyperslab
+ const hsize_t *block; IN: Size of block in hyperslab
RETURNS
Non-negative on success/Negative on failure
DESCRIPTION
@@ -5835,7 +5922,7 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
herr_t
-H5Sselect_hyperslab(hid_t space_id, H5S_seloper_t op, const hssize_t start[],
+H5Sselect_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[],
const hsize_t stride[], const hsize_t count[], const hsize_t block[])
{
H5S_t *space = NULL; /* Dataspace to modify selection of */
@@ -5843,7 +5930,7 @@ H5Sselect_hyperslab(hid_t space_id, H5S_seloper_t op, const hssize_t start[],
herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_API(H5Sselect_hyperslab, FAIL);
- H5TRACE6("e","iSs*Hs*h*h*h",space_id,op,start,stride,count,block);
+ H5TRACE6("e","iSs*h*h*h*h",space_id,op,start,stride,count,block);
/* Check args */
if (NULL == (space=H5I_object_verify(space_id, H5I_DATASPACE)))
@@ -5911,7 +5998,7 @@ H5S_hyper_get_seq_list_gen(const H5S_t *space,H5S_sel_iter_t *iter,
hsize_t acc; /* Accumulator for computing cumulative sizes */
hsize_t loc_off; /* Element offset in the dataspace */
hsize_t last_span_end=0; /* The offset of the end of the last span */
- hssize_t *abs_arr; /* Absolute hyperslab span position */
+ hsize_t *abs_arr; /* Absolute hyperslab span position */
const hssize_t *off_arr; /* Offset within the dataspace extent */
size_t span_size=0; /* Number of bytes in current span to actually process */
size_t io_left; /* Number of elements left to process */
@@ -6340,16 +6427,16 @@ H5S_hyper_get_seq_list_opt(const H5S_t *space,H5S_sel_iter_t *iter,
hsize_t *mem_size; /* Size of the source buffer */
hsize_t slab[H5O_LAYOUT_NDIMS]; /* Hyperslab size */
const hssize_t *sel_off; /* Selection offset in dataspace */
- hssize_t offset[H5O_LAYOUT_NDIMS]; /* Coordinate offset in dataspace */
+ hsize_t offset[H5O_LAYOUT_NDIMS]; /* Coordinate offset in dataspace */
hsize_t tmp_count[H5O_LAYOUT_NDIMS];/* Temporary block count */
hsize_t tmp_block[H5O_LAYOUT_NDIMS];/* Temporary block offset */
- hssize_t wrap[H5O_LAYOUT_NDIMS]; /* Bytes to wrap around at the end of a row */
+ hsize_t wrap[H5O_LAYOUT_NDIMS]; /* Bytes to wrap around at the end of a row */
hsize_t skip[H5O_LAYOUT_NDIMS]; /* Bytes to skip between blocks */
const H5S_hyper_dim_t *tdiminfo; /* Temporary pointer to diminfo information */
- hssize_t fast_dim_start, /* Local copies of fastest changing dimension info */
+ hsize_t fast_dim_start, /* Local copies of fastest changing dimension info */
+ fast_dim_stride,
+ fast_dim_block,
fast_dim_offset;
- hsize_t fast_dim_stride, /* Local copies of fastest changing dimension info */
- fast_dim_block;
size_t fast_dim_buf_off; /* Local copy of amount to move fastest dimension buffer offset */
size_t fast_dim_count; /* Number of blocks left in fastest changing dimension */
size_t tot_blk_count; /* Total number of blocks left to output */
diff --git a/src/H5Smpio.c b/src/H5Smpio.c
index f1f171b..da285cd 100644
--- a/src/H5Smpio.c
+++ b/src/H5Smpio.c
@@ -39,10 +39,6 @@
#ifdef H5_HAVE_PARALLEL
-/* Interface initialization */
-#define INTERFACE_INIT NULL
-static int interface_initialize_g = 0;
-
static herr_t
H5S_mpio_all_type( const H5S_t *space, size_t elmt_size,
/* out: */
@@ -65,6 +61,18 @@ H5S_mpio_hyper_type( const H5S_t *space, size_t elmt_size,
hsize_t *extra_offset,
hbool_t *is_derived_type );
+static herr_t
+H5S_mpio_span_hyper_type( const H5S_t *space, size_t elmt_size,
+ /* out: */
+ MPI_Datatype *new_type,
+ size_t *count,
+ hsize_t *extra_offset,
+ hbool_t *is_derived_type );
+
+static herr_t obtain_datatype(const hsize_t size[],
+ H5S_hyper_span_t* span,MPI_Datatype *span_type,
+ size_t elmt_size,int dimindex);
+
/*-------------------------------------------------------------------------
* Function: H5S_mpio_all_type
@@ -542,4 +550,348 @@ H5S_mpio_space_type( const H5S_t *space, size_t elmt_size,
done:
FUNC_LEAVE_NOAPI(ret_value);
}
+
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5S_mpio_space_span_ type
+ *
+ * Purpose: Translate an HDF5 dataspace selection into a general
+ MPI derivewd datatype built with span-tree.
+ *
+ * Currently handle only hyperslab and "all" selections.
+ *
+ * Return: non-negative on success, negative on failure.
+ *
+ * Outputs: *new_type the MPI type corresponding to the selection
+ * *count how many objects of the new_type in selection
+ * (useful if this is the buffer type for xfer)
+ * *extra_offset Number of bytes of offset within dataset
+ * *is_derived_type 0 if MPI primitive type, 1 if derived
+ *
+ * Programmer: KY
+ *
+ * Modifications:
+ *
+ * Quincey Koziol, June 18, 2002
+ * Added 'extra_offset' parameter
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5S_mpio_space_span_type( const H5S_t *space, size_t elmt_size,
+ /* out: */
+ MPI_Datatype *new_type,
+ size_t *count,
+ hsize_t *extra_offset,
+ hbool_t *is_derived_type )
+{
+ herr_t ret_value = SUCCEED;
+
+ FUNC_ENTER_NOAPI_NOINIT(H5S_mpio_space_span_type);
+
+ /* Check args */
+ assert (space);
+
+ /* Creat MPI type based on the kind of selection */
+ switch (H5S_GET_EXTENT_TYPE(space)) {
+ case H5S_SCALAR:
+ case H5S_SIMPLE:
+ switch(H5S_GET_SELECT_TYPE(space)) {
+ case H5S_SEL_NONE:
+ if ( H5S_mpio_none_type( space, elmt_size,
+ /* out: */ new_type, count, extra_offset, is_derived_type ) <0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't convert \"all\" selection to MPI type");
+ break;
+
+ case H5S_SEL_ALL:
+ if ( H5S_mpio_all_type( space, elmt_size,
+ /* out: */ new_type, count, extra_offset, is_derived_type ) <0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't convert \"all\" selection to MPI type");
+ break;
+
+ case H5S_SEL_POINTS:
+ /* not yet implemented */
+ ret_value = FAIL;
+ break;
+
+ case H5S_SEL_HYPERSLABS:
+ if(H5S_mpio_span_hyper_type( space, elmt_size,
+ /* out: */ new_type, count, extra_offset, is_derived_type )<0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADTYPE, FAIL,"couldn't convert \"all\" selection to MPI type");
+ break;
+
+ default:
+ assert("unknown selection type" && 0);
+ break;
+ } /* end switch */
+ break;
+
+ case H5S_COMPLEX:
+ /* not yet implemented */
+ HGOTO_ERROR(H5E_DATASPACE, H5E_UNSUPPORTED, FAIL, "complex data spaces are not supported yet");
+
+ default:
+ assert("unknown data space type" && 0);
+ break;
+ }
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value);
+}
+
+
+/* The following codes have been used by Kent to test
+ general collective derived datatype functionality.
+ It should NOT be called by other routines except with
+ macro #ifdef KENT #endif
+ Nov. 11th, 2004 */
+
+
+static herr_t
+H5S_mpio_span_hyper_type( const H5S_t *space, size_t elmt_size,
+ /* out: */
+ MPI_Datatype *new_type,
+ size_t *count,
+ hsize_t *extra_offset,
+ hbool_t *is_derived_type ){
+
+ MPI_Datatype span_type;
+ H5S_hyper_span_t *ospan;
+ H5S_hyper_span_info_t *odown;
+ hsize_t *size;
+ int rank;
+ herr_t ret_value = SUCCEED;
+
+ MPI_Aint extent,lb;
+
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_mpio_span_hyper_type);
+
+ printf("coming to hyper type \n");
+ /* Check args */
+ assert (space);
+ /* assert(sizeof(MPI_Aint) >= sizeof(elmt_size));?? */
+
+ /* Only for simple extent
+ rank = space->extent.u.simple.rank;
+ */
+ rank = space->extent.rank;
+
+ /* size = HDcalloc((size_t)rank,sizeof(hsize_t)); */
+ if (0==elmt_size)
+ goto empty;
+ size = space->extent.size;
+
+
+ odown = space->select.sel_info.hslab->span_lst;
+ if(odown == NULL)
+ goto empty;
+ ospan = odown->head;
+ if(ospan == NULL)
+ goto empty;
+
+ obtain_datatype(space->extent.size,ospan,&span_type,elmt_size,rank);
+ MPI_Type_commit(&span_type);
+
+ MPI_Type_lb(span_type,&lb);
+ printf("lb %d\n",lb);
+ MPI_Type_extent(span_type,&extent);
+ printf("extent %d\n",extent);
+ *new_type = span_type;
+ /* fill in the remaining return values */
+ *count = 1;
+ *extra_offset = 0;
+ *is_derived_type = 1;
+ printf("before freeing size\n");
+ /* HDfree(size);*/
+ printf("after freeing size\n");
+ HGOTO_DONE(SUCCEED);
+
+empty:
+ /* special case: empty hyperslab */
+ *new_type = MPI_BYTE;
+ *count = 0;
+ *extra_offset = 0;
+ *is_derived_type = 0;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value);
+ }
+
+
+static herr_t obtain_datatype(const hsize_t size[], H5S_hyper_span_t* span,MPI_Datatype *span_type,
+ size_t elmt_size,int dimindex) {
+
+ int innercount,outercount;
+ MPI_Datatype bas_type;
+ MPI_Datatype temp_type;
+ MPI_Datatype tempinner_type;
+ MPI_Datatype *inner_type;
+ int *blocklen;
+ MPI_Aint *disp;
+ MPI_Aint stride;
+ MPI_Aint extent,lb;
+ H5S_hyper_span_info_t *down;
+ H5S_hyper_span_t *tspan;
+#ifdef H5_HAVE_MPI2
+ MPI_Aint sizeaint,sizedtype;
+#endif /* H5_HAVE_MPI2 */
+ hsize_t total_lowd,total_lowd1;
+ int i;
+ int ret;
+
+ assert(span);
+
+ inner_type = NULL;
+ down = NULL;
+ tspan= NULL;
+ down = span->down;
+ tspan = span;
+
+ outercount = 0;
+ while(tspan) {
+ if(tspan) {
+ HDfprintf(stdout, " span->low %Hd\n",tspan->low);
+ HDfprintf(stdout, " span->high %Hd\n",tspan->high);
+ HDfprintf(stdout, " span->nelm %Hu\n",tspan->nelem);
+ }
+ tspan = tspan->next;
+ outercount ++;
+ }
+
+ if(outercount == 0) {
+ span_type = NULL;
+ return 0;
+ }
+ printf("outercount %d\n",outercount);
+#ifdef H5_HAVE_MPI2
+ printf("coming into HAVE_MPI2\n");
+ fflush(stdout);
+
+ MPI_Type_extent(MPI_Aint,&sizeaint);
+ MPI_Type_extent(MPI_Datatype,&sizedtype);
+ printf("coming into HAVE_MPI2 type extent\n");
+ fflush(stdout);
+
+ blocklen = (int *)HDcalloc((size_t)outercount,sizeof(int));
+ disp = (MPI_Aint *)HDcalloc((size_t)outercount,sizeaint);
+ inner_type = (MPI_Datatype *)HDcalloc((size_t)outercount,sizedtype);
+#else
+ printf("coming to MPI2 else \n");
+ blocklen = (int *)HDcalloc((size_t)outercount,sizeof(int));
+ disp = (MPI_Aint *)HDcalloc((size_t)outercount,sizeof(int));
+ inner_type = (MPI_Datatype *)HDcalloc((size_t)outercount,sizeof(int));
+ printf("end of calloc \n");
+#endif
+
+
+ tspan = span;
+ outercount = 0;
+
+ if(down == NULL){
+ printf("coming to down = NULL \n");
+ if(dimindex > 1) printf("wrong area \n");
+ MPI_Type_contiguous((int)elmt_size,MPI_BYTE,&bas_type);
+ MPI_Type_commit(&bas_type);
+ printf("after type commit \n");
+ while(tspan){
+ disp[outercount] = (MPI_Aint)elmt_size * tspan->low;
+ blocklen[outercount] = tspan->nelem;
+ tspan = tspan->next;
+ outercount ++;
+ }
+ /* printf("outercount %d\n",outercount);
+ printf("after while loop \n");*/
+ ret = MPI_Type_hindexed(outercount,blocklen,disp,bas_type,span_type);
+ if(ret < 0) printf("type hindexed doesn't work\n");
+ printf("after hindexed \n");
+
+
+ }
+ else {/* dimindex is the rank of the dimension */
+
+ if(dimindex <2) printf("something is wrong \n");
+ /* Calculate the total bytes of the lower dimension */
+ total_lowd = 1; /* one dimension down */
+ total_lowd1 = 1; /* two dimensions down */
+
+ for ( i = dimindex-1; i > 0; i--)
+ total_lowd = total_lowd * size[i];
+
+ for ( i = dimindex-1; i > 1; i--)
+ total_lowd1 = total_lowd1 * size[i];
+
+ HDfprintf(stdout, " one dimension down size %Hu\n",total_lowd);
+ HDfprintf(stdout, " two dimension down size %Hu\n",total_lowd1);
+
+ while(tspan){
+/* Displacement should be in byte and should have dimension information */
+/* First using MPI Type vector to build derived data type for this span only */
+/* Need to calculate the disp in byte for this dimension. */
+ /* Calculate the total bytes of the lower dimension */
+
+ disp[outercount] = tspan->low*total_lowd*elmt_size;
+ blocklen[outercount] = 1;
+ printf("displacement the 0 rank %d\n",disp[0]);
+ /* generating inner derived datatype by using MPI_Type_hvector */
+ obtain_datatype(size,tspan->down->head,&temp_type,elmt_size,dimindex-1);
+ ret= MPI_Type_commit(&temp_type);
+ if(ret < 0) printf("cannot commit temp_type\n");
+/* inner_type[count] = temp_type; */
+
+#ifdef H5_HAVE_MPI2
+ MPI_Type_get_extent(temp_type,&lb,&extent);
+#else
+ MPI_Type_lb(temp_type,&lb);
+ printf("lb %d\n",lb);
+ MPI_Type_extent(temp_type,&extent);
+ printf("extent %d\n",extent);
+#endif
+ /* building the inner vector datatype */
+ /* The following calculation of stride is wrong since stride is calculated
+ from the first element of the block to the first element of the next
+ block. */
+ /*stride = total_lowd1 * (size[dimindex-1]*elmt_size-extent-lb);*/
+ stride = total_lowd*elmt_size;
+ innercount = tspan->nelem;
+ printf("stride %d\n",stride);
+ printf("innercount %d\n",innercount);
+ fflush(stdout);
+ ret = MPI_Type_hvector(innercount,1,stride,temp_type,&tempinner_type);
+
+ /* MPI_Type_contiguous(2,temp_type,&tempinner_type);*/
+ if(ret < 0) printf("wrong vector \n");
+ MPI_Type_commit(&tempinner_type);
+ printf("after tempinner_type commit\n");
+ MPI_Type_free(&temp_type);
+ printf("after free \n");
+ inner_type[outercount] = tempinner_type;
+ outercount ++;
+ tspan = tspan->next;
+ }
+
+ /* building the whole vector datatype */
+ MPI_Type_struct(outercount,blocklen,disp,inner_type,span_type);
+ printf("after type struct \n");
+ }
+
+
+ if(inner_type != NULL){
+ if(down != NULL) {
+ for(i=0;i<outercount;i++)
+ MPI_Type_free(&inner_type[i]);
+
+ }
+ }
+
+ if(inner_type != NULL)
+ HDfree(inner_type);
+ if(blocklen != NULL)
+ HDfree(blocklen);
+ if(disp != NULL)
+ HDfree(disp);
+ printf("after obtaining type \n");
+ return 0;
+}
+
#endif /* H5_HAVE_PARALLEL */
diff --git a/src/H5Snone.c b/src/H5Snone.c
index 6a07a47..2cc2a1e 100644
--- a/src/H5Snone.c
+++ b/src/H5Snone.c
@@ -23,7 +23,7 @@
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
-#define PABLO_MASK H5Snone_mask
+#define PABLO_MASK H5S_none_mask
#include "H5private.h"
#include "H5Eprivate.h"
@@ -32,10 +32,6 @@
#include "H5Vprivate.h"
#include "H5Dprivate.h"
-/* Interface initialization */
-#define INTERFACE_INIT NULL
-static int interface_initialize_g = 0;
-
/* Static function prototypes */
/* Selection callbacks */
@@ -48,15 +44,15 @@ static htri_t H5S_none_is_valid(const H5S_t *space);
static hssize_t H5S_none_serial_size(const H5S_t *space);
static herr_t H5S_none_serialize(const H5S_t *space, uint8_t *buf);
static herr_t H5S_none_deserialize(H5S_t *space, const uint8_t *buf);
-static herr_t H5S_none_bounds(const H5S_t *space, hssize_t *start, hssize_t *end);
+static herr_t H5S_none_bounds(const H5S_t *space, hsize_t *start, hsize_t *end);
static htri_t H5S_none_is_contiguous(const H5S_t *space);
static htri_t H5S_none_is_single(const H5S_t *space);
static htri_t H5S_none_is_regular(const H5S_t *space);
static herr_t H5S_none_iter_init(H5S_sel_iter_t *iter, const H5S_t *space);
/* Selection iteration callbacks */
-static herr_t H5S_none_iter_coords(const H5S_sel_iter_t *iter, hssize_t *coords);
-static herr_t H5S_none_iter_block(const H5S_sel_iter_t *iter, hssize_t *start, hssize_t *end);
+static herr_t H5S_none_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords);
+static herr_t H5S_none_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end);
static hsize_t H5S_none_iter_nelmts(const H5S_sel_iter_t *iter);
static htri_t H5S_none_iter_has_next_block(const H5S_sel_iter_t *iter);
static herr_t H5S_none_iter_next(H5S_sel_iter_t *sel_iter, size_t nelem);
@@ -114,9 +110,7 @@ static const H5S_sel_iter_class_t H5S_sel_iter_none[1] = {{
herr_t
H5S_none_iter_init (H5S_sel_iter_t *iter, const H5S_t UNUSED *space)
{
- herr_t ret_value=SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(H5S_none_iter_init, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_none_iter_init);
/* Check args */
assert (space && H5S_SEL_NONE==H5S_GET_SELECT_TYPE(space));
@@ -125,8 +119,7 @@ H5S_none_iter_init (H5S_sel_iter_t *iter, const H5S_t UNUSED *space)
/* Initialize type of selection iterator */
iter->type=H5S_sel_iter_none;
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
} /* H5S_none_iter_init() */
@@ -146,7 +139,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5S_none_iter_coords (const H5S_sel_iter_t UNUSED *iter, hssize_t UNUSED *coords)
+H5S_none_iter_coords (const H5S_sel_iter_t UNUSED *iter, hsize_t UNUSED *coords)
{
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_none_iter_coords);
@@ -174,7 +167,7 @@ H5S_none_iter_coords (const H5S_sel_iter_t UNUSED *iter, hssize_t UNUSED *coords
*-------------------------------------------------------------------------
*/
static herr_t
-H5S_none_iter_block (const H5S_sel_iter_t UNUSED *iter, hssize_t UNUSED *start, hssize_t UNUSED *end)
+H5S_none_iter_block (const H5S_sel_iter_t UNUSED *iter, hsize_t UNUSED *start, hsize_t UNUSED *end)
{
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_none_iter_block);
@@ -348,18 +341,15 @@ H5S_none_iter_release (H5S_sel_iter_t UNUSED * iter)
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-herr_t
+static herr_t
H5S_none_release (H5S_t UNUSED * space)
{
- herr_t ret_value=SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(H5S_none_release, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_none_release);
/* Check args */
assert (space);
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
} /* H5S_none_release() */
@@ -382,12 +372,10 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-herr_t
+static herr_t
H5S_none_copy(H5S_t *dst, const H5S_t UNUSED *src, hbool_t UNUSED share_selection)
{
- herr_t ret_value=SUCCEED; /* return value */
-
- FUNC_ENTER_NOAPI(H5S_none_copy, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_none_copy);
assert(src);
assert(dst);
@@ -395,8 +383,7 @@ H5S_none_copy(H5S_t *dst, const H5S_t UNUSED *src, hbool_t UNUSED share_selectio
/* Set number of elements in selection */
dst->select.num_elem=0;
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
} /* end H5S_none_copy() */
@@ -420,17 +407,14 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-htri_t
+static htri_t
H5S_none_is_valid (const H5S_t UNUSED *space)
{
- htri_t ret_value=TRUE; /* Return value */
-
- FUNC_ENTER_NOAPI(H5S_none_is_valid, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_none_is_valid);
assert(space);
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(TRUE);
} /* end H5S_none_is_valid() */
@@ -453,12 +437,10 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-hssize_t
+static hssize_t
H5S_none_serial_size (const H5S_t UNUSED *space)
{
- hssize_t ret_value; /* return value */
-
- FUNC_ENTER_NOAPI(H5S_none_serial_size, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_none_serial_size);
assert(space);
@@ -466,10 +448,7 @@ H5S_none_serial_size (const H5S_t UNUSED *space)
* <type (4 bytes)> + <version (4 bytes)> + <padding (4 bytes)> +
* <length (4 bytes)> = 16 bytes
*/
- ret_value=16;
-
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(16);
} /* end H5S_none_serial_size() */
@@ -492,12 +471,10 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-herr_t
+static herr_t
H5S_none_serialize (const H5S_t *space, uint8_t *buf)
{
- herr_t ret_value=SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(H5S_none_serialize, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_none_serialize);
assert(space);
@@ -507,8 +484,7 @@ H5S_none_serialize (const H5S_t *space, uint8_t *buf)
UINT32ENCODE(buf, (uint32_t)0); /* Store the un-used padding */
UINT32ENCODE(buf, (uint32_t)0); /* Store the additional information length */
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
} /* H5S_none_serialize() */
@@ -531,12 +507,12 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-herr_t
+static herr_t
H5S_none_deserialize (H5S_t *space, const uint8_t UNUSED *buf)
{
herr_t ret_value; /* return value */
- FUNC_ENTER_NOAPI(H5S_none_deserialize, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_none_deserialize);
assert(space);
@@ -557,8 +533,8 @@ done:
USAGE
herr_t H5S_none_bounds(space, start, end)
H5S_t *space; IN: Dataspace pointer of selection to query
- hssize_t *start; OUT: Starting coordinate of bounding box
- hssize_t *end; OUT: Opposite coordinate of bounding box
+ hsize_t *start; OUT: Starting coordinate of bounding box
+ hsize_t *end; OUT: Opposite coordinate of bounding box
RETURNS
Non-negative on success, negative on failure
DESCRIPTION
@@ -574,19 +550,16 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-herr_t
-H5S_none_bounds(const H5S_t UNUSED *space, hssize_t UNUSED *start, hssize_t UNUSED *end)
+static herr_t
+H5S_none_bounds(const H5S_t UNUSED *space, hsize_t UNUSED *start, hsize_t UNUSED *end)
{
- herr_t ret_value=FAIL; /* Return value */
-
- FUNC_ENTER_NOAPI(H5S_none_bounds, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_none_bounds);
assert(space);
assert(start);
assert(end);
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(FAIL);
} /* H5Sget_none_bounds() */
@@ -608,17 +581,14 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-htri_t
+static htri_t
H5S_none_is_contiguous(const H5S_t UNUSED *space)
{
- htri_t ret_value=FALSE; /* Return value */
-
- FUNC_ENTER_NOAPI(H5S_none_is_contiguous, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_none_is_contiguous);
assert(space);
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(FALSE);
} /* H5S_none_is_contiguous() */
@@ -640,17 +610,14 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-htri_t
+static htri_t
H5S_none_is_single(const H5S_t UNUSED *space)
{
- htri_t ret_value=FALSE; /* Return value */
-
- FUNC_ENTER_NOAPI(H5S_none_is_single, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_none_is_single);
assert(space);
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(FALSE);
} /* H5S_none_is_single() */
@@ -673,18 +640,15 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-htri_t
+static htri_t
H5S_none_is_regular(const H5S_t UNUSED *space)
{
- htri_t ret_value=TRUE; /* Return value */
-
- FUNC_ENTER_NOAPI(H5S_none_is_regular, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_none_is_regular);
/* Check args */
assert(space);
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(TRUE);
} /* H5S_none_is_regular() */
@@ -797,14 +761,12 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-herr_t
+static herr_t
H5S_none_get_seq_list(const H5S_t UNUSED *space, unsigned UNUSED flags, H5S_sel_iter_t UNUSED *iter,
size_t UNUSED maxseq, size_t UNUSED maxelem, size_t *nseq, size_t *nelem,
hsize_t UNUSED *off, size_t UNUSED *len)
{
- herr_t ret_value=SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI (H5S_none_get_seq_list, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_none_get_seq_list);
/* Check args */
assert(space);
@@ -822,6 +784,5 @@ H5S_none_get_seq_list(const H5S_t UNUSED *space, unsigned UNUSED flags, H5S_sel_
/* They don't use any elements, either */
*nelem=0;
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
} /* end H5S_all_get_seq_list() */
diff --git a/src/H5Spkg.h b/src/H5Spkg.h
index dc67f81..ce858a2 100644
--- a/src/H5Spkg.h
+++ b/src/H5Spkg.h
@@ -54,7 +54,7 @@ typedef struct {
*/
/* Node in point selection list (typedef'd in H5Sprivate.h) */
struct H5S_pnt_node_t {
- hssize_t *pnt; /* Pointer to a selected point */
+ hsize_t *pnt; /* Pointer to a selected point */
struct H5S_pnt_node_t *next; /* pointer to next point in list */
};
@@ -67,7 +67,7 @@ typedef struct {
/* Information a particular hyperslab span */
struct H5S_hyper_span_t {
- hssize_t low, high; /* Low & high bounds of span */
+ hsize_t low, high; /* Low & high bounds of span */
hsize_t nelem; /* Number of elements in span (only needed during I/O) */
hsize_t pstride; /* Pseudo-stride from start of previous span (only used during I/O) */
struct H5S_hyper_span_info_t *down; /* Pointer to list of spans in next dimension down */
@@ -118,7 +118,7 @@ typedef herr_t (*H5S_sel_serialize_func_t)(const H5S_t *space, uint8_t *buf);
/* Method to store create selection from "serialized" form (a byte sequence suitable for storing on disk) */
typedef herr_t (*H5S_sel_deserialize_func_t)(H5S_t *space, const uint8_t *buf);
/* Method to determine to smallest n-D bounding box containing the current selection */
-typedef herr_t (*H5S_sel_bounds_func_t)(const H5S_t *space, hssize_t *start, hssize_t *end);
+typedef herr_t (*H5S_sel_bounds_func_t)(const H5S_t *space, hsize_t *start, hsize_t *end);
/* Method to determine if current selection is contiguous */
typedef htri_t (*H5S_sel_is_contiguous_func_t)(const H5S_t *space);
/* Method to determine if current selection is a single block */
@@ -166,9 +166,9 @@ struct H5S_t {
/* Selection iteration methods */
/* Method to retrieve the current coordinates of iterator for current selection */
-typedef herr_t (*H5S_sel_iter_coords_func_t)(const H5S_sel_iter_t *iter, hssize_t *coords);
+typedef herr_t (*H5S_sel_iter_coords_func_t)(const H5S_sel_iter_t *iter, hsize_t *coords);
/* Method to retrieve the current block of iterator for current selection */
-typedef herr_t (*H5S_sel_iter_block_func_t)(const H5S_sel_iter_t *iter, hssize_t *start, hssize_t *end);
+typedef herr_t (*H5S_sel_iter_block_func_t)(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end);
/* Method to determine number of elements left in iterator for current selection */
typedef hsize_t (*H5S_sel_iter_nelmts_func_t)(const H5S_sel_iter_t *iter);
/* Method to determine if there are more blocks left in the current selection */
diff --git a/src/H5Spoint.c b/src/H5Spoint.c
index d34b8a8..a79bea7 100644
--- a/src/H5Spoint.c
+++ b/src/H5Spoint.c
@@ -23,7 +23,7 @@
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
-#define PABLO_MASK H5Spoint_mask
+#define PABLO_MASK H5S_point_mask
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
@@ -33,10 +33,6 @@
#include "H5Spkg.h" /* Dataspace functions */
#include "H5Vprivate.h" /* Vector functions */
-/* Interface initialization */
-#define INTERFACE_INIT NULL
-static int interface_initialize_g = 0;
-
/* Static function prototypes */
/* Selection callbacks */
@@ -49,15 +45,15 @@ static htri_t H5S_point_is_valid(const H5S_t *space);
static hssize_t H5S_point_serial_size(const H5S_t *space);
static herr_t H5S_point_serialize(const H5S_t *space, uint8_t *buf);
static herr_t H5S_point_deserialize(H5S_t *space, const uint8_t *buf);
-static herr_t H5S_point_bounds(const H5S_t *space, hssize_t *start, hssize_t *end);
+static herr_t H5S_point_bounds(const H5S_t *space, hsize_t *start, hsize_t *end);
static htri_t H5S_point_is_contiguous(const H5S_t *space);
static htri_t H5S_point_is_single(const H5S_t *space);
static htri_t H5S_point_is_regular(const H5S_t *space);
static herr_t H5S_point_iter_init(H5S_sel_iter_t *iter, const H5S_t *space);
/* Selection iteration callbacks */
-static herr_t H5S_point_iter_coords(const H5S_sel_iter_t *iter, hssize_t *coords);
-static herr_t H5S_point_iter_block(const H5S_sel_iter_t *iter, hssize_t *start, hssize_t *end);
+static herr_t H5S_point_iter_coords(const H5S_sel_iter_t *iter, hsize_t *coords);
+static herr_t H5S_point_iter_block(const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end);
static hsize_t H5S_point_iter_nelmts(const H5S_sel_iter_t *iter);
static htri_t H5S_point_iter_has_next_block(const H5S_sel_iter_t *iter);
static herr_t H5S_point_iter_next(H5S_sel_iter_t *sel_iter, size_t nelem);
@@ -121,9 +117,7 @@ H5FL_DEFINE_STATIC(H5S_pnt_list_t);
herr_t
H5S_point_iter_init(H5S_sel_iter_t *iter, const H5S_t *space)
{
- herr_t ret_value=SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(H5S_point_iter_init, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_point_iter_init);
/* Check args */
assert (space && H5S_SEL_POINTS==H5S_GET_SELECT_TYPE(space));
@@ -138,8 +132,7 @@ H5S_point_iter_init(H5S_sel_iter_t *iter, const H5S_t *space)
/* Initialize type of selection iterator */
iter->type=H5S_sel_iter_point;
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
} /* H5S_point_iter_init() */
@@ -159,7 +152,7 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5S_point_iter_coords (const H5S_sel_iter_t *iter, hssize_t *coords)
+H5S_point_iter_coords (const H5S_sel_iter_t *iter, hsize_t *coords)
{
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_point_iter_coords);
@@ -168,7 +161,7 @@ H5S_point_iter_coords (const H5S_sel_iter_t *iter, hssize_t *coords)
assert (coords);
/* Copy the offset of the current point */
- HDmemcpy(coords,iter->u.pnt.curr->pnt,sizeof(hssize_t)*iter->rank);
+ HDmemcpy(coords,iter->u.pnt.curr->pnt,sizeof(hsize_t)*iter->rank);
FUNC_LEAVE_NOAPI(SUCCEED);
} /* H5S_point_iter_coords() */
@@ -190,7 +183,7 @@ H5S_point_iter_coords (const H5S_sel_iter_t *iter, hssize_t *coords)
*-------------------------------------------------------------------------
*/
static herr_t
-H5S_point_iter_block (const H5S_sel_iter_t *iter, hssize_t *start, hssize_t *end)
+H5S_point_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end)
{
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_point_iter_block);
@@ -200,8 +193,8 @@ H5S_point_iter_block (const H5S_sel_iter_t *iter, hssize_t *start, hssize_t *end
assert (end);
/* Copy the current point as a block */
- HDmemcpy(start,iter->u.pnt.curr->pnt,sizeof(hssize_t)*iter->rank);
- HDmemcpy(end,iter->u.pnt.curr->pnt,sizeof(hssize_t)*iter->rank);
+ HDmemcpy(start,iter->u.pnt.curr->pnt,sizeof(hsize_t)*iter->rank);
+ HDmemcpy(end,iter->u.pnt.curr->pnt,sizeof(hsize_t)*iter->rank);
FUNC_LEAVE_NOAPI(SUCCEED);
} /* H5S_point_iter_block() */
@@ -376,7 +369,7 @@ H5S_point_iter_release (H5S_sel_iter_t UNUSED * iter)
herr_t H5S_point_add(space, num_elem, coord)
H5S_t *space; IN: Dataspace of selection to modify
size_t num_elem; IN: Number of elements in COORD array.
- const hssize_t *coord[]; IN: The location of each element selected
+ const hsize_t *coord[]; IN: The location of each element selected
RETURNS
Non-negative on success/Negative on failure
DESCRIPTION
@@ -387,14 +380,14 @@ H5S_point_iter_release (H5S_sel_iter_t UNUSED * iter)
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_point_add (H5S_t *space, H5S_seloper_t op, size_t num_elem, const hssize_t **_coord)
+H5S_point_add (H5S_t *space, H5S_seloper_t op, size_t num_elem, const hsize_t **_coord)
{
H5S_pnt_node_t *top, *curr, *new_node; /* Point selection nodes */
- const hssize_t *coord=(const hssize_t *)_coord; /* Pointer to the actual coordinates */
+ const hsize_t *coord=(const hsize_t *)_coord; /* Pointer to the actual coordinates */
unsigned i; /* Counter */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5S_point_add, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_point_add);
assert(space);
assert(num_elem>0);
@@ -407,11 +400,11 @@ H5S_point_add (H5S_t *space, H5S_seloper_t op, size_t num_elem, const hssize_t *
if((new_node = H5FL_MALLOC(H5S_pnt_node_t))==NULL)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate point node");
- if((new_node->pnt = H5MM_malloc(space->extent.rank*sizeof(hssize_t)))==NULL)
+ if((new_node->pnt = H5MM_malloc(space->extent.rank*sizeof(hsize_t)))==NULL)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate coordinate information");
/* Copy over the coordinates */
- HDmemcpy(new_node->pnt,coord+(i*space->extent.rank),(space->extent.rank*sizeof(hssize_t)));
+ HDmemcpy(new_node->pnt,coord+(i*space->extent.rank),(space->extent.rank*sizeof(hsize_t)));
/* Link into list */
new_node->next=NULL;
@@ -472,13 +465,12 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-herr_t
+static herr_t
H5S_point_release (H5S_t *space)
{
H5S_pnt_node_t *curr, *next; /* Point selection nodes */
- herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5S_point_release, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_point_release);
/* Check args */
assert (space);
@@ -499,8 +491,7 @@ H5S_point_release (H5S_t *space)
/* Reset the number of elements in the selection */
space->select.num_elem=0;
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
} /* H5S_point_release() */
@@ -514,7 +505,7 @@ done:
hid_t dsid; IN: Dataspace ID of selection to modify
H5S_seloper_t op; IN: Operation to perform on current selection
size_t num_elem; IN: Number of elements in COORD array.
- const hssize_t **coord; IN: The location of each element selected
+ const hsize_t **coord; IN: The location of each element selected
RETURNS
Non-negative on success/Negative on failure
DESCRIPTION
@@ -536,7 +527,7 @@ done:
--------------------------------------------------------------------------*/
herr_t
H5S_select_elements (H5S_t *space, H5S_seloper_t op, size_t num_elem,
- const hssize_t **coord)
+ const hsize_t **coord)
{
herr_t ret_value=SUCCEED; /* return value */
@@ -591,13 +582,13 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-herr_t
+static herr_t
H5S_point_copy(H5S_t *dst, const H5S_t *src, hbool_t UNUSED share_selection)
{
H5S_pnt_node_t *curr, *new_node, *new_head; /* Point information nodes */
herr_t ret_value=SUCCEED; /* return value */
- FUNC_ENTER_NOAPI(H5S_point_copy, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_point_copy);
assert(src);
assert(dst);
@@ -612,9 +603,9 @@ H5S_point_copy(H5S_t *dst, const H5S_t *src, hbool_t UNUSED share_selection)
/* Create each point */
if((new_node=H5FL_MALLOC(H5S_pnt_node_t))==NULL)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate point node");
- if((new_node->pnt = H5MM_malloc(src->extent.rank*sizeof(hssize_t)))==NULL)
+ if((new_node->pnt = H5MM_malloc(src->extent.rank*sizeof(hsize_t)))==NULL)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "can't allocate coordinate information");
- HDmemcpy(new_node->pnt,curr->pnt,(src->extent.rank*sizeof(hssize_t)));
+ HDmemcpy(new_node->pnt,curr->pnt,(src->extent.rank*sizeof(hsize_t)));
new_node->next=NULL;
/* Keep the order the same when copying */
@@ -653,14 +644,14 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-htri_t
+static htri_t
H5S_point_is_valid (const H5S_t *space)
{
H5S_pnt_node_t *curr; /* Point information nodes */
unsigned u; /* Counter */
htri_t ret_value=TRUE; /* return value */
- FUNC_ENTER_NOAPI(H5S_point_is_valid, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_point_is_valid);
assert(space);
@@ -671,11 +662,9 @@ H5S_point_is_valid (const H5S_t *space)
for(u=0; u<space->extent.rank; u++) {
/* Check if an offset has been defined */
/* Bounds check the selected point + offset against the extent */
- if(((curr->pnt[u]+space->select.offset[u])>(hssize_t)space->extent.size[u])
- || ((curr->pnt[u]+space->select.offset[u])<0)) {
- ret_value=FALSE;
- break;
- } /* end if */
+ if(((curr->pnt[u]+space->select.offset[u])>space->extent.size[u])
+ || (((hssize_t)curr->pnt[u]+space->select.offset[u])<0))
+ HGOTO_DONE(FALSE)
} /* end for */
curr=curr->next;
@@ -744,13 +733,13 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-hssize_t
+static hssize_t
H5S_point_serial_size (const H5S_t *space)
{
H5S_pnt_node_t *curr; /* Point information nodes */
hssize_t ret_value; /* return value */
- FUNC_ENTER_NOAPI(H5S_point_serial_size, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_point_serial_size);
assert(space);
@@ -768,7 +757,6 @@ H5S_point_serial_size (const H5S_t *space)
curr=curr->next;
} /* end while */
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5S_point_serial_size() */
@@ -792,16 +780,15 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-herr_t
+static herr_t
H5S_point_serialize (const H5S_t *space, uint8_t *buf)
{
H5S_pnt_node_t *curr; /* Point information nodes */
uint8_t *lenp; /* pointer to length location for later storage */
uint32_t len=0; /* number of bytes used */
unsigned u; /* local counting variable */
- herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5S_point_serialize, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_point_serialize);
assert(space);
@@ -836,8 +823,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 */
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
} /* H5S_point_serialize() */
@@ -860,17 +846,17 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-herr_t
+static herr_t
H5S_point_deserialize (H5S_t *space, const uint8_t *buf)
{
H5S_seloper_t op=H5S_SELECT_SET; /* Selection operation */
uint32_t rank; /* Rank of points */
size_t num_elem=0; /* Number of elements in selection */
- hssize_t *coord=NULL, *tcoord; /* Pointer to array of elements */
+ hsize_t *coord=NULL, *tcoord; /* Pointer to array of elements */
unsigned i,j; /* local counting variables */
herr_t ret_value; /* return value */
- FUNC_ENTER_NOAPI(H5S_point_deserialize, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_point_deserialize);
/* Check args */
assert(space);
@@ -884,7 +870,7 @@ H5S_point_deserialize (H5S_t *space, const uint8_t *buf)
UINT32DECODE(buf,num_elem); /* decode the number of points */
/* Allocate space for the coordinates */
- if((coord = H5MM_malloc(num_elem*rank*sizeof(hssize_t)))==NULL)
+ 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 */
@@ -893,7 +879,7 @@ H5S_point_deserialize (H5S_t *space, const uint8_t *buf)
UINT32DECODE(buf, *tcoord);
/* Select points */
- if((ret_value=H5S_select_elements(space,op,num_elem,(const hssize_t **)coord))<0)
+ if((ret_value=H5S_select_elements(space,op,num_elem,(const hsize_t **)coord))<0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection");
done:
@@ -959,7 +945,7 @@ H5S_get_select_elem_pointlist(H5S_t *space, hsize_t startpoint, hsize_t numpoint
/* Iterate through the node, copying each hyperslab's information */
while(node!=NULL && numpoints>0) {
- HDmemcpy(buf,node->pnt,sizeof(hssize_t)*rank);
+ HDmemcpy(buf,node->pnt,sizeof(hsize_t)*rank);
buf+=rank;
numpoints--;
node=node->next;
@@ -1030,8 +1016,8 @@ done:
USAGE
herr_t H5S_point_bounds(space, start, end)
H5S_t *space; IN: Dataspace pointer of selection to query
- hssize_t *start; OUT: Starting coordinate of bounding box
- hssize_t *end; OUT: Opposite coordinate of bounding box
+ hsize_t *start; OUT: Starting coordinate of bounding box
+ hsize_t *end; OUT: Opposite coordinate of bounding box
RETURNS
Non-negative on success, negative on failure
DESCRIPTION
@@ -1048,15 +1034,15 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-herr_t
-H5S_point_bounds(const H5S_t *space, hssize_t *start, hssize_t *end)
+static herr_t
+H5S_point_bounds(const H5S_t *space, hsize_t *start, hsize_t *end)
{
H5S_pnt_node_t *node; /* Point node */
int rank; /* Dataspace rank */
int i; /* index variable */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5S_point_bounds, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_point_bounds);
assert(space);
assert(start);
@@ -1067,14 +1053,18 @@ H5S_point_bounds(const H5S_t *space, hssize_t *start, hssize_t *end)
/* Set the start and end arrays up */
for(i=0; i<rank; i++) {
- start[i]=HSSIZET_MAX;
- end[i]=HSSIZET_MIN;
+ start[i]=HSIZET_MAX;
+ end[i]=0;
} /* end for */
/* Iterate through the node, checking the bounds on each element */
node=space->select.sel_info.pnt_lst->head;
while(node!=NULL) {
for(i=0; i<rank; i++) {
+ /* Check for offset moving selection negative */
+ if(((hssize_t)node->pnt[i]+space->select.offset[i])<0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_BADRANGE, FAIL, "offset moves selection out of bounds")
+
if(start[i]>(node->pnt[i]+space->select.offset[i]))
start[i]=node->pnt[i]+space->select.offset[i];
if(end[i]<(node->pnt[i]+space->select.offset[i]))
@@ -1109,12 +1099,12 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-htri_t
+static htri_t
H5S_point_is_contiguous(const H5S_t *space)
{
htri_t ret_value; /* return value */
- FUNC_ENTER_NOAPI(H5S_point_is_contiguous, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_point_is_contiguous);
assert(space);
@@ -1124,7 +1114,6 @@ H5S_point_is_contiguous(const H5S_t *space)
else /* More than one point might be contiguous, but it's complex to check and we don't need it right now */
ret_value=FALSE;
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* H5S_point_is_contiguous() */
@@ -1147,12 +1136,12 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-htri_t
+static htri_t
H5S_point_is_single(const H5S_t *space)
{
htri_t ret_value; /* return value */
- FUNC_ENTER_NOAPI(H5S_point_is_single, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_point_is_single);
assert(space);
@@ -1162,7 +1151,6 @@ H5S_point_is_single(const H5S_t *space)
else
ret_value=FALSE;
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* H5S_point_is_single() */
@@ -1188,12 +1176,12 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-htri_t
+static htri_t
H5S_point_is_regular(const H5S_t *space)
{
htri_t ret_value; /* return value */
- FUNC_ENTER_NOAPI(H5S_point_is_regular, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5S_point_is_regular);
/* Check args */
assert(space);
@@ -1204,7 +1192,6 @@ H5S_point_is_regular(const H5S_t *space)
else
ret_value=FALSE;
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* H5S_point_is_regular() */
@@ -1219,7 +1206,7 @@ done:
hid_t dsid; IN: Dataspace ID of selection to modify
H5S_seloper_t op; IN: Operation to perform on current selection
size_t num_elem; IN: Number of elements in COORD array.
- const hssize_t **coord; IN: The location of each element selected
+ const hsize_t **coord; IN: The location of each element selected
RETURNS
Non-negative on success/Negative on failure
DESCRIPTION
@@ -1241,13 +1228,13 @@ done:
--------------------------------------------------------------------------*/
herr_t
H5Sselect_elements(hid_t spaceid, H5S_seloper_t op, size_t num_elem,
- const hssize_t **coord)
+ const hsize_t **coord)
{
H5S_t *space = NULL; /* Dataspace to modify selection of */
herr_t ret_value; /* return value */
FUNC_ENTER_API(H5Sselect_elements, FAIL);
- H5TRACE4("e","iSsz**Hs",spaceid,op,num_elem,coord);
+ H5TRACE4("e","iSsz**h",spaceid,op,num_elem,coord);
/* Check args */
if (NULL == (space=H5I_object_verify(spaceid, H5I_DATASPACE)))
@@ -1299,7 +1286,7 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-herr_t
+static herr_t
H5S_point_get_seq_list(const H5S_t *space, unsigned flags, H5S_sel_iter_t *iter,
size_t maxseq, size_t maxelem, size_t *nseq, size_t *nelem,
hsize_t *off, size_t *len)
@@ -1315,7 +1302,7 @@ H5S_point_get_seq_list(const H5S_t *space, unsigned flags, H5S_sel_iter_t *iter,
int i; /* Local index variable */
herr_t ret_value=SUCCEED; /* return value */
- FUNC_ENTER_NOAPI (H5S_point_get_seq_list, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT(H5S_point_get_seq_list);
/* Check args */
assert(space);
diff --git a/src/H5Sprivate.h b/src/H5Sprivate.h
index a0fdf09..06c9f02 100644
--- a/src/H5Sprivate.h
+++ b/src/H5Sprivate.h
@@ -48,7 +48,7 @@ typedef struct H5S_hyper_span_info_t H5S_hyper_span_info_t;
/* Information about one dimension in a hyperslab selection */
typedef struct H5S_hyper_dim_t {
- hssize_t start;
+ hsize_t start;
hsize_t stride;
hsize_t count;
hsize_t block;
@@ -62,7 +62,7 @@ typedef struct {
/* Hyperslab selection iteration container */
typedef struct {
/* Common fields for all hyperslab selections */
- hssize_t off[H5S_MAX_RANK]; /* Offset in span node (used as position for regular hyperslabs) */
+ hsize_t off[H5S_MAX_RANK]; /* Offset in span node (used as position for regular hyperslabs) */
unsigned iter_rank; /* Rank of iterator information */
/* (This should always be the same as the dataspace
* rank, except for regular hyperslab selections in
@@ -201,6 +201,7 @@ H5_DLL int H5S_get_simple_extent_dims(const H5S_t *ds, hsize_t dims[]/*out*/,
H5_DLL herr_t H5S_modify(struct H5G_entry_t *ent, const H5S_t *space,
hbool_t update_time, hid_t dxpl_id);
H5_DLL herr_t H5S_append(H5F_t *f, hid_t dxpl_id, struct H5O_t *oh, const H5S_t *ds);
+H5_DLL size_t H5S_raw_size(const H5F_t *f, const H5S_t *space);
H5_DLL H5S_t *H5S_read(struct H5G_entry_t *ent, hid_t dxpl_id);
H5_DLL int H5S_extend(H5S_t *space, const hsize_t *size);
H5_DLL int H5S_set_extent(H5S_t *space, const hsize_t *size);
@@ -219,7 +220,7 @@ H5_DLL herr_t H5S_select_fill(void *fill, size_t fill_size,
const H5S_t *space, void *buf);
H5_DLL htri_t H5S_select_valid(const H5S_t *space);
H5_DLL hssize_t H5S_get_select_npoints(const H5S_t *space);
-H5_DLL herr_t H5S_get_select_bounds(const H5S_t *space, hssize_t *start, hssize_t *end);
+H5_DLL herr_t H5S_get_select_bounds(const H5S_t *space, hsize_t *start, hsize_t *end);
H5_DLL herr_t H5S_select_offset(H5S_t *space, const hssize_t *offset);
H5_DLL herr_t H5S_select_copy(H5S_t *dst, const H5S_t *src, hbool_t share_selection);
H5_DLL htri_t H5S_select_shape_same(const H5S_t *space1, const H5S_t *space2);
@@ -241,26 +242,27 @@ H5_DLL herr_t H5S_select_none(H5S_t *space);
/* Operations on point selections */
H5_DLL herr_t H5S_select_elements (H5S_t *space, H5S_seloper_t op,
- size_t num_elem, const hssize_t **coord);
+ size_t num_elem, const hsize_t **coord);
/* Operations on hyperslab selections */
-H5_DLL herr_t H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op, const hssize_t start[],
+H5_DLL herr_t H5S_select_hyperslab (H5S_t *space, H5S_seloper_t op, const hsize_t start[],
const hsize_t *stride, const hsize_t count[], const hsize_t *block);
H5_DLL herr_t H5S_hyper_add_span_element(H5S_t *space, unsigned rank,
- hssize_t *coords);
+ hsize_t *coords);
H5_DLL herr_t H5S_hyper_reset_scratch(H5S_t *space);
H5_DLL herr_t H5S_hyper_convert(H5S_t *space);
#ifdef LATER
H5_DLL htri_t H5S_hyper_intersect (H5S_t *space1, H5S_t *space2);
#endif /* LATER */
-H5_DLL htri_t H5S_hyper_intersect_block (H5S_t *space, hssize_t *start, hssize_t *end);
-H5_DLL herr_t H5S_hyper_adjust(H5S_t *space, const hssize_t *offset);
+H5_DLL htri_t H5S_hyper_intersect_block (H5S_t *space, hsize_t *start, hsize_t *end);
+H5_DLL herr_t H5S_hyper_adjust_u(H5S_t *space, const hsize_t *offset);
+H5_DLL herr_t H5S_hyper_adjust_s(H5S_t *space, const hssize_t *offset);
H5_DLL herr_t H5S_hyper_move(H5S_t *space, const hssize_t *offset);
H5_DLL herr_t H5S_hyper_normalize_offset(H5S_t *space);
/* Operations on selection iterators */
H5_DLL herr_t H5S_select_iter_init(H5S_sel_iter_t *iter, const H5S_t *space, size_t elmt_size);
-H5_DLL herr_t H5S_select_iter_coords(const H5S_sel_iter_t *sel_iter, hssize_t *coords);
+H5_DLL herr_t H5S_select_iter_coords(const H5S_sel_iter_t *sel_iter, hsize_t *coords);
H5_DLL hsize_t H5S_select_iter_nelmts(const H5S_sel_iter_t *sel_iter);
H5_DLL herr_t H5S_select_iter_next(H5S_sel_iter_t *sel_iter, size_t nelem);
H5_DLL herr_t H5S_select_iter_release(H5S_sel_iter_t *sel_iter);
@@ -279,6 +281,15 @@ H5S_mpio_space_type( const H5S_t *space, size_t elmt_size,
size_t *count,
hsize_t *extra_offset,
hbool_t *is_derived_type );
+
+H5_DLL herr_t
+H5S_mpio_space_span_type( const H5S_t *space, size_t elmt_size,
+ /* out: */
+ MPI_Datatype *new_type,
+ size_t *count,
+ hsize_t *extra_offset,
+ hbool_t *is_derived_type );
+
#endif /* H5_HAVE_PARALLEL */
#endif /* _H5Sprivate_H */
diff --git a/src/H5Spublic.h b/src/H5Spublic.h
index 8272dfa..704f1f4 100644
--- a/src/H5Spublic.h
+++ b/src/H5Spublic.h
@@ -107,24 +107,13 @@ H5_DLL htri_t H5Sis_simple(hid_t space_id);
H5_DLL herr_t H5Sset_space(hid_t space_id, int rank, const hsize_t *dims);
H5_DLL hssize_t H5Sget_select_npoints(hid_t spaceid);
H5_DLL herr_t H5Sselect_hyperslab(hid_t space_id, H5S_seloper_t op,
- const hssize_t start[],
+ const hsize_t start[],
const hsize_t _stride[],
const hsize_t count[],
const hsize_t _block[]);
-#ifdef NEW_HYPERSLAB_API
-H5_DLL hid_t H5Scombine_hyperslab(hid_t space_id, H5S_seloper_t op,
- const hssize_t start[],
- const hsize_t _stride[],
- const hsize_t count[],
- const hsize_t _block[]);
-H5_DLL herr_t H5Sselect_select(hid_t space1_id, H5S_seloper_t op,
- hid_t space2_id);
-H5_DLL hid_t H5Scombine_select(hid_t space1_id, H5S_seloper_t op,
- hid_t space2_id);
-#endif /* NEW_HYPERSLAB_API */
H5_DLL herr_t H5Sselect_elements(hid_t space_id, H5S_seloper_t op,
size_t num_elemn,
- const hssize_t **coord);
+ const hsize_t **coord);
H5_DLL H5S_class_t H5Sget_simple_extent_type(hid_t space_id);
H5_DLL herr_t H5Sset_extent_none(hid_t space_id);
H5_DLL herr_t H5Sextent_copy(hid_t dst_id,hid_t src_id);
@@ -136,11 +125,7 @@ H5_DLL hssize_t H5Sget_select_hyper_nblocks(hid_t spaceid);
H5_DLL hssize_t H5Sget_select_elem_npoints(hid_t spaceid);
H5_DLL herr_t H5Sget_select_hyper_blocklist(hid_t spaceid, hsize_t startblock, hsize_t numblocks, hsize_t *buf);
H5_DLL herr_t H5Sget_select_elem_pointlist(hid_t spaceid, hsize_t startpoint, hsize_t numpoints, hsize_t *buf);
-#ifdef H5_WANT_H5_V1_4_COMPAT
H5_DLL herr_t H5Sget_select_bounds(hid_t spaceid, hsize_t *start, hsize_t *end);
-#else /* H5_WANT_H5_V1_4_COMPAT */
-H5_DLL herr_t H5Sget_select_bounds(hid_t spaceid, hssize_t *start, hssize_t *end);
-#endif /* H5_WANT_H5_V1_4_COMPAT */
H5_DLL H5S_sel_type H5Sget_select_type(hid_t spaceid);
#ifdef __cplusplus
diff --git a/src/H5Sselect.c b/src/H5Sselect.c
index ea78fac..1d9e68e 100644
--- a/src/H5Sselect.c
+++ b/src/H5Sselect.c
@@ -31,13 +31,9 @@
#include "H5Spkg.h" /* Dataspaces */
#include "H5Vprivate.h" /* Vector and array functions */
-/* Interface initialization */
-#define INTERFACE_INIT NULL
-static int interface_initialize_g = 0;
-
/* Local functions */
#ifdef LATER
-static herr_t H5S_select_iter_block (const H5S_sel_iter_t *iter, hssize_t *start, hssize_t *end);
+static herr_t H5S_select_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end);
static htri_t H5S_select_iter_has_next_block (const H5S_sel_iter_t *iter);
static herr_t H5S_select_iter_next_block(H5S_sel_iter_t *iter);
#endif /* LATER */
@@ -68,9 +64,7 @@ H5FL_BLK_EXTERN(type_elem);
herr_t
H5S_select_offset(H5S_t *space, const hssize_t *offset)
{
- herr_t ret_value=SUCCEED; /* return value */
-
- FUNC_ENTER_NOAPI(H5S_select_offset, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_select_offset);
/* Check args */
assert(space);
@@ -80,8 +74,7 @@ H5S_select_offset(H5S_t *space, const hssize_t *offset)
/* Copy the offset over */
HDmemcpy(space->select.offset,offset,sizeof(hssize_t)*space->extent.rank);
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED);
} /* H5S_select_offset() */
@@ -155,14 +148,13 @@ H5S_select_release(H5S_t *ds)
{
herr_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5S_select_release, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_select_release);
assert(ds);
/* Call the selection type's release function */
ret_value=(*ds->select.type->release)(ds);
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5S_select_release() */
@@ -193,14 +185,13 @@ H5S_select_get_seq_list(const H5S_t *space, unsigned flags,
{
herr_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5S_select_get_seq_list, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_select_get_seq_list);
assert(space);
/* Call the selection type's get_seq_list function */
ret_value=(*space->select.type->get_seq_list)(space,flags,iter,maxseq,maxbytes,nseq,nbytes,off,len);
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5S_select_get_seq_list() */
@@ -229,14 +220,13 @@ H5S_select_serial_size(const H5S_t *space)
{
hssize_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5S_select_serial_size, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_select_serial_size);
assert(space);
/* Call the selection type's serial_size function */
ret_value=(*space->select.type->serial_size)(space);
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5S_select_serial_size() */
@@ -268,7 +258,7 @@ H5S_select_serialize(const H5S_t *space, uint8_t *buf)
{
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5S_select_serialize, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_select_serialize);
assert(space);
assert(buf);
@@ -276,7 +266,6 @@ H5S_select_serialize(const H5S_t *space, uint8_t *buf)
/* Call the selection type's serialize function */
ret_value=(*space->select.type->serialize)(space,buf);
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5S_select_serialize() */
@@ -341,18 +330,12 @@ done:
hssize_t
H5S_get_select_npoints(const H5S_t *space)
{
- hssize_t ret_value; /* return value */
-
- FUNC_ENTER_NOAPI(H5S_get_select_npoints, 0);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_get_select_npoints);
/* Check args */
assert(space);
- /* Set return value */
- ret_value=space->select.num_elem;
-
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(space->select.num_elem);
} /* H5S_get_select_npoints() */
@@ -424,13 +407,12 @@ H5S_select_valid(const H5S_t *space)
{
htri_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5S_select_valid, 0);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_select_valid);
assert(space);
ret_value = (*space->select.type->is_valid)(space);
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* H5S_select_valid() */
@@ -506,8 +488,8 @@ done:
USAGE
herr_t H5S_get_select_bounds(space, start, end)
hid_t dsid; IN: Dataspace ID of selection to query
- hssize_t *start; OUT: Starting coordinate of bounding box
- hssize_t *end; OUT: Opposite coordinate of bounding box
+ hsize_t *start; OUT: Starting coordinate of bounding box
+ hsize_t *end; OUT: Opposite coordinate of bounding box
RETURNS
Non-negative on success, negative on failure
DESCRIPTION
@@ -528,47 +510,14 @@ done:
EXAMPLES
REVISION LOG
--------------------------------------------------------------------------*/
-#ifdef H5_WANT_H5_V1_4_COMPAT
herr_t
H5Sget_select_bounds(hid_t spaceid, hsize_t *start, hsize_t *end)
{
- hssize_t tstart[H5O_LAYOUT_NDIMS]; /* Temporary starting coordinates */
- hssize_t tend[H5O_LAYOUT_NDIMS]; /* Temporary ending coordinates */
- H5S_t *space = NULL; /* Dataspace to modify selection of */
- unsigned u; /* Local index variable */
- herr_t ret_value; /* return value */
-
- FUNC_ENTER_API(H5Sget_select_bounds, FAIL);
- H5TRACE3("e","i*h*h",spaceid,start,end);
-
- /* Check args */
- if(start==NULL || end==NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid pointer");
- if (NULL == (space=H5I_object_verify(spaceid, H5I_DATASPACE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace");
-
- ret_value = H5S_SELECT_BOUNDS(space,tstart,tend);
-
- if(ret_value>=0) {
- /* Copy over the start & end values */
- for(u=0; u<space->extent.rank; u++) {
- H5_ASSIGN_OVERFLOW(start[u],tstart[u],hssize_t,hsize_t);
- H5_ASSIGN_OVERFLOW(end[u],tend[u],hssize_t,hsize_t);
- } /* end for */
- } /* end if */
-
-done:
- FUNC_LEAVE_API(ret_value);
-} /* H5Sget_select_bounds() */
-#else /* H5_WANT_H5_V1_4_COMPAT */
-herr_t
-H5Sget_select_bounds(hid_t spaceid, hssize_t *start, hssize_t *end)
-{
H5S_t *space = NULL; /* Dataspace to modify selection of */
herr_t ret_value; /* return value */
FUNC_ENTER_API(H5Sget_select_bounds, FAIL);
- H5TRACE3("e","i*Hs*Hs",spaceid,start,end);
+ H5TRACE3("e","i*h*h",spaceid,start,end);
/* Check args */
if(start==NULL || end==NULL)
@@ -581,7 +530,6 @@ H5Sget_select_bounds(hid_t spaceid, hssize_t *start, hssize_t *end)
done:
FUNC_LEAVE_API(ret_value);
} /* H5Sget_select_bounds() */
-#endif /* H5_WANT_H5_V1_4_COMPAT */
/*--------------------------------------------------------------------------
@@ -592,8 +540,8 @@ done:
USAGE
herr_t H5S_get_select_bounds(space, start, end)
H5S_t *space; IN: Dataspace ID of selection to query
- hssize_t *start; OUT: Starting coordinate of bounding box
- hssize_t *end; OUT: Opposite coordinate of bounding box
+ hsize_t *start; OUT: Starting coordinate of bounding box
+ hsize_t *end; OUT: Opposite coordinate of bounding box
RETURNS
Non-negative on success, negative on failure
DESCRIPTION
@@ -612,11 +560,11 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
herr_t
-H5S_get_select_bounds(const H5S_t *space, hssize_t *start, hssize_t *end)
+H5S_get_select_bounds(const H5S_t *space, hsize_t *start, hsize_t *end)
{
herr_t ret_value; /* return value */
- FUNC_ENTER_NOAPI(H5S_get_select_bounds, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_get_select_bounds);
/* Check args */
assert(space);
@@ -625,7 +573,6 @@ H5S_get_select_bounds(const H5S_t *space, hssize_t *start, hssize_t *end)
ret_value = (*space->select.type->bounds)(space,start,end);
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* H5S_get_select_bounds() */
@@ -656,14 +603,13 @@ H5S_select_is_contiguous(const H5S_t *space)
{
herr_t ret_value; /* return value */
- FUNC_ENTER_NOAPI(H5S_select_is_contiguous, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_select_is_contiguous);
/* Check args */
assert(space);
ret_value = (*space->select.type->is_contiguous)(space);
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* H5S_select_is_contiguous() */
@@ -694,14 +640,13 @@ H5S_select_is_single(const H5S_t *space)
{
herr_t ret_value; /* return value */
- FUNC_ENTER_NOAPI(H5S_select_is_single, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_select_is_single);
/* Check args */
assert(space);
ret_value = (*space->select.type->is_single)(space);
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* H5S_select_is_single() */
@@ -732,14 +677,13 @@ H5S_select_is_regular(const H5S_t *space)
{
herr_t ret_value; /* return value */
- FUNC_ENTER_NOAPI(H5S_select_is_regular, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_select_is_regular);
/* Check args */
assert(space);
ret_value = (*space->select.type->is_regular)(space);
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* H5S_select_is_regular() */
@@ -766,7 +710,7 @@ H5S_select_iter_init(H5S_sel_iter_t *sel_iter, const H5S_t *space, size_t elmt_s
{
herr_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5S_select_iter_init, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_select_iter_init);
/* Check args */
assert(sel_iter);
@@ -790,7 +734,6 @@ H5S_select_iter_init(H5S_sel_iter_t *sel_iter, const H5S_t *space, size_t elmt_s
/* Call initialization routine for selection type */
ret_value= (*space->select.type->iter_init)(sel_iter, space);
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* H5S_select_iter_init() */
@@ -803,7 +746,7 @@ done:
USAGE
herr_t H5S_select_iter_coords(sel_iter,coords)
H5S_sel_iter_t *sel_iter; IN: Selection iterator to query
- hssize_t *coords; OUT: Array to place iterator coordinates in
+ hsize_t *coords; OUT: Array to place iterator coordinates in
RETURNS
Non-negative on success, negative on failure.
DESCRIPTION
@@ -818,11 +761,11 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
herr_t
-H5S_select_iter_coords (const H5S_sel_iter_t *sel_iter, hssize_t *coords)
+H5S_select_iter_coords (const H5S_sel_iter_t *sel_iter, hsize_t *coords)
{
herr_t ret_value; /* return value */
- FUNC_ENTER_NOAPI(H5S_select_iter_coords, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_select_iter_coords);
/* Check args */
assert(sel_iter);
@@ -831,7 +774,6 @@ H5S_select_iter_coords (const H5S_sel_iter_t *sel_iter, hssize_t *coords)
/* Call iter_coords routine for selection type */
ret_value = (*sel_iter->type->iter_coords)(sel_iter,coords);
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* H5S_select_iter_coords() */
@@ -845,8 +787,8 @@ done:
USAGE
herr_t H5S_select_iter_block(sel_iter,start,end)
const H5S_sel_iter_t *sel_iter; IN: Selection iterator to query
- hssize_t *start; OUT: Array to place iterator start block coordinates
- hssize_t *end; OUT: Array to place iterator end block coordinates
+ hsize_t *start; OUT: Array to place iterator start block coordinates
+ hsize_t *end; OUT: Array to place iterator end block coordinates
RETURNS
Non-negative on success, negative on failure.
DESCRIPTION
@@ -861,7 +803,7 @@ done:
REVISION LOG
--------------------------------------------------------------------------*/
static herr_t
-H5S_select_iter_block (const H5S_sel_iter_t *iter, hssize_t *start, hssize_t *end)
+H5S_select_iter_block (const H5S_sel_iter_t *iter, hsize_t *start, hsize_t *end)
{
herr_t ret_value; /* return value */
@@ -905,7 +847,7 @@ H5S_select_iter_nelmts (const H5S_sel_iter_t *sel_iter)
{
hsize_t ret_value; /* return value */
- FUNC_ENTER_NOAPI(H5S_select_iter_nelmts, 0);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_select_iter_nelmts);
/* Check args */
assert(sel_iter);
@@ -913,7 +855,6 @@ H5S_select_iter_nelmts (const H5S_sel_iter_t *sel_iter)
/* Call iter_nelmts routine for selection type */
ret_value = (*sel_iter->type->iter_nelmts)(sel_iter);
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* H5S_select_iter_nelmts() */
@@ -985,7 +926,7 @@ H5S_select_iter_next(H5S_sel_iter_t *iter, size_t nelem)
{
herr_t ret_value; /* return value */
- FUNC_ENTER_NOAPI(H5S_select_iter_next, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_select_iter_next);
/* Check args */
assert(iter);
@@ -997,7 +938,6 @@ H5S_select_iter_next(H5S_sel_iter_t *iter, size_t nelem)
/* Decrement the number of elements left in selection */
iter->elmt_left-=nelem;
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* H5S_select_iter_next() */
@@ -1069,7 +1009,7 @@ H5S_select_iter_release(H5S_sel_iter_t *sel_iter)
{
herr_t ret_value; /* return value */
- FUNC_ENTER_NOAPI(H5S_select_iter_release, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_select_iter_release);
/* Check args */
assert(sel_iter);
@@ -1077,7 +1017,6 @@ H5S_select_iter_release(H5S_sel_iter_t *sel_iter)
/* Call selection type-specific release routine */
ret_value = (*sel_iter->type->iter_release)(sel_iter);
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* H5S_select_iter_release() */
@@ -1118,7 +1057,7 @@ H5S_select_iterate(void *buf, hid_t type_id, const H5S_t *space, H5D_operator_t
H5S_sel_iter_t iter; /* Selection iteration info */
hbool_t iter_init=0; /* Selection iteration info has been initialized */
uint8_t *loc; /* Current element location in buffer */
- hssize_t coords[H5O_LAYOUT_NDIMS]; /* Coordinates of element in dataspace */
+ hsize_t coords[H5O_LAYOUT_NDIMS]; /* Coordinates of element in dataspace */
hssize_t nelmts; /* Number of elements in selection */
hsize_t space_size[H5O_LAYOUT_NDIMS]; /* Dataspace size */
hsize_t off[H5D_XFER_HYPER_VECTOR_SIZE_DEF]; /* Array to store sequence offsets */
@@ -1131,7 +1070,7 @@ H5S_select_iterate(void *buf, hid_t type_id, const H5S_t *space, H5D_operator_t
size_t nelem; /* Number of elements used in sequences */
size_t max_elem; /* Maximum number of elements allowed in sequences */
size_t elmt_size; /* Datatype size */
- int ndims; /* Number of dimensions in dataspace */
+ unsigned ndims; /* Number of dimensions in dataspace */
int i; /* Local Index variable */
herr_t user_ret=0; /* User's return value */
herr_t ret_value=SUCCEED; /* Return value */
@@ -1198,7 +1137,7 @@ H5S_select_iterate(void *buf, hid_t type_id, const H5S_t *space, H5D_operator_t
loc=(unsigned char *)buf+curr_off;
/* Call user's callback routine */
- user_ret=(*op)(loc,type_id,(hsize_t)ndims,coords,operator_data);
+ user_ret=(*op)(loc,type_id,ndims,coords,operator_data);
/* Increment offset in dataspace */
curr_off+=elmt_size;
@@ -1286,7 +1225,7 @@ H5S_get_select_type(const H5S_t *space)
{
H5S_sel_type ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5S_get_select_type, H5S_SEL_ERROR);
+ FUNC_ENTER_NOAPI_NOFUNC(H5S_get_select_type);
/* Check args */
assert(space);
@@ -1294,7 +1233,6 @@ H5S_get_select_type(const H5S_t *space)
/* Set return value */
ret_value=H5S_GET_SELECT_TYPE(space);
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5S_get_select_type() */
@@ -1377,12 +1315,12 @@ H5S_select_shape_same(const H5S_t *space1, const H5S_t *space2)
} /* end if */
/* Iterate through all the blocks in the selection */
else {
- hssize_t start1[H5O_LAYOUT_NDIMS]; /* Start point of selection block in dataspace #1 */
- hssize_t start2[H5O_LAYOUT_NDIMS]; /* Start point of selection block in dataspace #2 */
- hssize_t end1[H5O_LAYOUT_NDIMS]; /* End point of selection block in dataspace #1 */
- hssize_t end2[H5O_LAYOUT_NDIMS]; /* End point of selection block in dataspace #2 */
- hssize_t off1[H5O_LAYOUT_NDIMS]; /* Offset of selection #1 blocks */
- hssize_t off2[H5O_LAYOUT_NDIMS]; /* Offset of selection #2 blocks */
+ hsize_t start1[H5O_LAYOUT_NDIMS]; /* Start point of selection block in dataspace #1 */
+ hsize_t start2[H5O_LAYOUT_NDIMS]; /* Start point of selection block in dataspace #2 */
+ hsize_t end1[H5O_LAYOUT_NDIMS]; /* End point of selection block in dataspace #1 */
+ hsize_t end2[H5O_LAYOUT_NDIMS]; /* End point of selection block in dataspace #2 */
+ hsize_t off1[H5O_LAYOUT_NDIMS]; /* Offset of selection #1 blocks */
+ hsize_t off2[H5O_LAYOUT_NDIMS]; /* Offset of selection #2 blocks */
htri_t status1,status2; /* Status from next block checks */
unsigned first_block=1; /* Flag to indicate the first block */
diff --git a/src/H5Stest.c b/src/H5Stest.c
index 9062565..7580a0f 100644
--- a/src/H5Stest.c
+++ b/src/H5Stest.c
@@ -23,17 +23,13 @@
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
-#define PABLO_MASK H5Stest_mask
+#define PABLO_MASK H5S_test_mask
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5Iprivate.h" /* ID Functions */
#include "H5Spkg.h" /* Dataspace functions */
-/* Interface initialization */
-#define INTERFACE_INIT NULL
-static int interface_initialize_g = 0;
-
/*--------------------------------------------------------------------------
NAME
diff --git a/src/H5T.c b/src/H5T.c
index 20eb663..ca14bb3 100644
--- a/src/H5T.c
+++ b/src/H5T.c
@@ -21,6 +21,9 @@
#define H5T_PACKAGE /*suppress error about including H5Tpkg */
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5T_init_interface
+
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
#define PABLO_MASK H5T_mask
@@ -41,10 +44,6 @@
#include <sys/fpu.h>
#endif /* H5_HAVE_SYS_FPU_H */
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT H5T_init_interface
-
/*
* Predefined data types. These are initialized at runtime in H5Tinit.c and
* by H5T_init_interface() in this source file.
@@ -245,7 +244,10 @@ static struct {
/* The overflow handler */
H5T_overflow_t H5T_overflow_g = NULL;
-/* Declare the free lists for H5T_t's and H5T_shared_t's */
+/* The native endianess of the platform */
+H5T_order_t H5T_native_order_g = H5T_ORDER_ERROR;
+
+/* Declare the free list for H5T_t's and H5T_shared_t's */
H5FL_DEFINE(H5T_t);
H5FL_DEFINE(H5T_shared_t);
@@ -518,7 +520,7 @@ H5T_init_inf(void)
dst = &dst_p->shared->u.atomic;
/* Check that we can re-order the bytes correctly */
- if (H5T_ORDER_LE!=dst->order && H5T_ORDER_BE!=dst->order)
+ if (H5T_ORDER_LE!=H5T_native_order_g && H5T_ORDER_BE!=H5T_native_order_g)
HGOTO_ERROR (H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unsupported byte order");
/* +Inf */
@@ -528,7 +530,7 @@ H5T_init_inf(void)
H5T_bit_set (d, dst->u.f.mpos, dst->u.f.msize, FALSE);
/* Swap the bytes if the machine architecture is big-endian */
- if (H5T_ORDER_BE==dst->order) {
+ if (H5T_ORDER_BE==H5T_native_order_g) {
half_size = dst_p->shared->size/2;
for (u=0; u<half_size; u++) {
uint8_t tmp = d[dst_p->shared->size-(u+1)];
@@ -544,7 +546,7 @@ H5T_init_inf(void)
H5T_bit_set (d, dst->u.f.mpos, dst->u.f.msize, FALSE);
/* Swap the bytes if the machine architecture is big-endian */
- if (H5T_ORDER_BE==dst->order) {
+ if (H5T_ORDER_BE==H5T_native_order_g) {
half_size = dst_p->shared->size/2;
for (u=0; u<half_size; u++) {
uint8_t tmp = d[dst_p->shared->size-(u+1)];
@@ -559,7 +561,7 @@ H5T_init_inf(void)
dst = &dst_p->shared->u.atomic;
/* Check that we can re-order the bytes correctly */
- if (H5T_ORDER_LE!=dst->order && H5T_ORDER_BE!=dst->order)
+ if (H5T_ORDER_LE!=H5T_native_order_g && H5T_ORDER_BE!=H5T_native_order_g)
HGOTO_ERROR (H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "unsupported byte order");
/* +Inf */
@@ -569,7 +571,7 @@ H5T_init_inf(void)
H5T_bit_set (d, dst->u.f.mpos, dst->u.f.msize, FALSE);
/* Swap the bytes if the machine architecture is big-endian */
- if (H5T_ORDER_BE==dst->order) {
+ if (H5T_ORDER_BE==H5T_native_order_g) {
half_size = dst_p->shared->size/2;
for (u=0; u<half_size; u++) {
uint8_t tmp = d[dst_p->shared->size-(u+1)];
@@ -585,7 +587,7 @@ H5T_init_inf(void)
H5T_bit_set (d, dst->u.f.mpos, dst->u.f.msize, FALSE);
/* Swap the bytes if the machine architecture is big-endian */
- if (H5T_ORDER_BE==dst->order) {
+ if (H5T_ORDER_BE==H5T_native_order_g) {
half_size = dst_p->shared->size/2;
for (u=0; u<half_size; u++) {
uint8_t tmp = d[dst_p->shared->size-(u+1)];
@@ -1183,7 +1185,7 @@ H5T_term_interface(void)
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_term_interface);
- if (interface_initialize_g) {
+ if (H5_interface_initialize_g) {
/* Unregister all conversion functions */
for (i=0; i<H5T_g.npaths; i++) {
path = H5T_g.path[i];
@@ -1318,7 +1320,7 @@ H5T_term_interface(void)
H5T_NATIVE_UINT_FAST64_g = FAIL;
/* Mark interface as closed */
- interface_initialize_g = 0;
+ H5_interface_initialize_g = 0;
n = 1; /*H5I*/
}
FUNC_LEAVE_NOAPI(n);
@@ -1760,7 +1762,7 @@ done:
htri_t
H5T_detect_class (const H5T_t *dt, H5T_class_t cls)
{
- int i;
+ unsigned i;
htri_t ret_value=FALSE; /* Return value */
FUNC_ENTER_NOAPI(H5T_detect_class, FAIL);
@@ -2564,7 +2566,6 @@ done:
FUNC_LEAVE_API(ret_value);
}
-
/*-------------------------------------------------------------------------
* API functions are above; library-private functions are below...
*-------------------------------------------------------------------------
@@ -2781,7 +2782,6 @@ done:
if(shared_fo)
shared_fo->fo_count--;
}
-
FUNC_LEAVE_NOAPI(ret_value);
}
@@ -2877,7 +2877,7 @@ H5T_copy(const H5T_t *old_dt, H5T_copy_t method)
{
H5T_t *new_dt=NULL, *tmp=NULL;
H5T_shared_t *reopened_fo;
- int i;
+ unsigned i;
char *s;
H5T_t *ret_value;
@@ -2972,7 +2972,7 @@ H5T_copy(const H5T_t *old_dt, H5T_copy_t method)
new_dt->shared->u.compnd.nmembs * sizeof(H5T_cmemb_t));
for (i=0; i<new_dt->shared->u.compnd.nmembs; i++) {
- int j;
+ unsigned j;
int old_match;
s = new_dt->shared->u.compnd.memb[i].name;
@@ -3060,7 +3060,7 @@ H5T_copy(const H5T_t *old_dt, H5T_copy_t method)
/* Deep copy of the symbol table entry, if there was one */
if (H5F_addr_defined(old_dt->ent.header))
- if (H5G_ent_copy(&(new_dt->ent), &(old_dt->ent), H5G_COPY_DEEP)<0)
+ if (H5G_ent_copy(&(new_dt->ent), &(old_dt->ent),H5G_COPY_DEEP)<0)
HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, NULL, "unable to copy entry");
/* Set return value */
@@ -3143,7 +3143,7 @@ done:
herr_t
H5T_free(H5T_t *dt)
{
- int i;
+ unsigned i;
herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(H5T_free, FAIL);
@@ -3503,9 +3503,11 @@ H5T_get_size(const H5T_t *dt)
int
H5T_cmp(const H5T_t *dt1, const H5T_t *dt2)
{
- int *idx1 = NULL, *idx2 = NULL;
+ unsigned *idx1 = NULL, *idx2 = NULL;
int ret_value = 0;
- int i, j, tmp;
+ int i, j;
+ unsigned u;
+ int tmp;
hbool_t swapped;
size_t base_size;
@@ -3542,11 +3544,11 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2)
HGOTO_DONE(1);
/* Build an index for each type so the names are sorted */
- if (NULL==(idx1 = H5MM_malloc(dt1->shared->u.compnd.nmembs * sizeof(int))) ||
- NULL==(idx2 = H5MM_malloc(dt1->shared->u.compnd.nmembs * sizeof(int))))
+ if (NULL==(idx1 = H5MM_malloc(dt1->shared->u.compnd.nmembs * sizeof(unsigned))) ||
+ NULL==(idx2 = H5MM_malloc(dt1->shared->u.compnd.nmembs * sizeof(unsigned))))
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed");
- for (i=0; i<dt1->shared->u.compnd.nmembs; i++)
- idx1[i] = idx2[i] = i;
+ for (u=0; u<dt1->shared->u.compnd.nmembs; u++)
+ idx1[u] = idx2[u] = u;
for (i=dt1->shared->u.compnd.nmembs-1, swapped=TRUE; swapped && i>=0; --i) {
for (j=0, swapped=FALSE; j<i; j++) {
if (HDstrcmp(dt1->shared->u.compnd.memb[idx1[j]].name,
@@ -3572,35 +3574,31 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2)
#ifdef H5T_DEBUG
/* I don't quite trust the code above yet :-) --RPM */
- for (i=0; i<dt1->shared->u.compnd.nmembs-1; i++) {
- assert(HDstrcmp(dt1->shared->u.compnd.memb[idx1[i]].name,
- dt1->shared->u.compnd.memb[idx1[i + 1]].name));
- assert(HDstrcmp(dt2->shared->u.compnd.memb[idx2[i]].name,
- dt2->shared->u.compnd.memb[idx2[i + 1]].name));
+ for (u=0; u<dt1->shared->u.compnd.nmembs-1; u++) {
+ assert(HDstrcmp(dt1->shared->u.compnd.memb[idx1[u]].name,
+ dt1->shared->u.compnd.memb[idx1[u + 1]].name));
+ assert(HDstrcmp(dt2->shared->u.compnd.memb[idx2[u]].name,
+ dt2->shared->u.compnd.memb[idx2[u + 1]].name));
}
#endif
/* Compare the members */
- for (i=0; i<dt1->shared->u.compnd.nmembs; i++) {
- tmp = HDstrcmp(dt1->shared->u.compnd.memb[idx1[i]].name,
- dt2->shared->u.compnd.memb[idx2[i]].name);
+ for (u=0; u<dt1->shared->u.compnd.nmembs; u++) {
+ tmp = HDstrcmp(dt1->shared->u.compnd.memb[idx1[u]].name,
+ dt2->shared->u.compnd.memb[idx2[u]].name);
if (tmp < 0)
HGOTO_DONE(-1);
if (tmp > 0)
HGOTO_DONE(1);
- if (dt1->shared->u.compnd.memb[idx1[i]].offset <
- dt2->shared->u.compnd.memb[idx2[i]].offset) HGOTO_DONE(-1);
- if (dt1->shared->u.compnd.memb[idx1[i]].offset >
- dt2->shared->u.compnd.memb[idx2[i]].offset) HGOTO_DONE(1);
+ if (dt1->shared->u.compnd.memb[idx1[u]].offset < dt2->shared->u.compnd.memb[idx2[u]].offset) HGOTO_DONE(-1);
+ if (dt1->shared->u.compnd.memb[idx1[u]].offset > dt2->shared->u.compnd.memb[idx2[u]].offset) HGOTO_DONE(1);
- if (dt1->shared->u.compnd.memb[idx1[i]].size <
- dt2->shared->u.compnd.memb[idx2[i]].size) HGOTO_DONE(-1);
- if (dt1->shared->u.compnd.memb[idx1[i]].size >
- dt2->shared->u.compnd.memb[idx2[i]].size) HGOTO_DONE(1);
+ if (dt1->shared->u.compnd.memb[idx1[u]].size < dt2->shared->u.compnd.memb[idx2[u]].size) HGOTO_DONE(-1);
+ if (dt1->shared->u.compnd.memb[idx1[u]].size > dt2->shared->u.compnd.memb[idx2[u]].size) HGOTO_DONE(1);
- tmp = H5T_cmp(dt1->shared->u.compnd.memb[idx1[i]].type,
- dt2->shared->u.compnd.memb[idx2[i]].type);
+ tmp = H5T_cmp(dt1->shared->u.compnd.memb[idx1[u]].type,
+ dt2->shared->u.compnd.memb[idx2[u]].type);
if (tmp < 0) HGOTO_DONE(-1);
if (tmp > 0) HGOTO_DONE(1);
}
@@ -3616,11 +3614,11 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2)
HGOTO_DONE(1);
/* Build an index for each type so the names are sorted */
- if (NULL==(idx1 = H5MM_malloc(dt1->shared->u.enumer.nmembs * sizeof(int))) ||
- NULL==(idx2 = H5MM_malloc(dt1->shared->u.enumer.nmembs * sizeof(int))))
+ if (NULL==(idx1 = H5MM_malloc(dt1->shared->u.enumer.nmembs * sizeof(unsigned))) ||
+ NULL==(idx2 = H5MM_malloc(dt1->shared->u.enumer.nmembs * sizeof(unsigned))))
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed");
- for (i=0; i<dt1->shared->u.enumer.nmembs; i++)
- idx1[i] = idx2[i] = i;
+ for (u=0; u<dt1->shared->u.enumer.nmembs; u++)
+ idx1[u] = idx2[u] = u;
for (i=dt1->shared->u.enumer.nmembs-1, swapped=TRUE; swapped && i>=0; --i) {
for (j=0, swapped=FALSE; j<i; j++) {
if (HDstrcmp(dt1->shared->u.enumer.name[idx1[j]],
@@ -3646,24 +3644,24 @@ H5T_cmp(const H5T_t *dt1, const H5T_t *dt2)
#ifdef H5T_DEBUG
/* I don't quite trust the code above yet :-) --RPM */
- for (i=0; i<dt1->shared->u.enumer.nmembs-1; i++) {
- assert(HDstrcmp(dt1->shared->u.enumer.name[idx1[i]],
- dt1->shared->u.enumer.name[idx1[i+1]]));
- assert(HDstrcmp(dt2->shared->u.enumer.name[idx2[i]],
- dt2->shared->u.enumer.name[idx2[i+1]]));
+ for (u=0; u<dt1->shared->u.enumer.nmembs-1; u++) {
+ assert(HDstrcmp(dt1->shared->u.enumer.name[idx1[u]],
+ dt1->shared->u.enumer.name[idx1[u+1]]));
+ assert(HDstrcmp(dt2->shared->u.enumer.name[idx2[u]],
+ dt2->shared->u.enumer.name[idx2[u+1]]));
}
#endif
/* Compare the members */
base_size = dt1->shared->parent->shared->size;
- for (i=0; i<dt1->shared->u.enumer.nmembs; i++) {
- tmp = HDstrcmp(dt1->shared->u.enumer.name[idx1[i]],
- dt2->shared->u.enumer.name[idx2[i]]);
+ for (u=0; u<dt1->shared->u.enumer.nmembs; u++) {
+ tmp = HDstrcmp(dt1->shared->u.enumer.name[idx1[u]],
+ dt2->shared->u.enumer.name[idx2[u]]);
if (tmp<0) HGOTO_DONE(-1);
if (tmp>0) HGOTO_DONE(1);
- tmp = HDmemcmp(dt1->shared->u.enumer.value+idx1[i]*base_size,
- dt2->shared->u.enumer.value+idx2[i]*base_size,
+ tmp = HDmemcmp(dt1->shared->u.enumer.value+idx1[u]*base_size,
+ dt2->shared->u.enumer.value+idx2[u]*base_size,
base_size);
if (tmp<0) HGOTO_DONE(-1);
if (tmp>0) HGOTO_DONE(1);
@@ -4573,7 +4571,7 @@ herr_t
H5T_debug(const H5T_t *dt, FILE *stream)
{
const char *s1="", *s2="";
- int i;
+ unsigned i;
size_t k, base_size;
uint64_t tmp;
herr_t ret_value=SUCCEED; /* Return value */
diff --git a/src/H5TB.c b/src/H5TB.c
index c2b3bed..7e6f946 100644
--- a/src/H5TB.c
+++ b/src/H5TB.c
@@ -119,9 +119,6 @@ H5FL_DEFINE_STATIC(H5TB_NODE);
/* Declare a free list to manage the H5TB_TREE struct */
H5FL_DEFINE_STATIC(H5TB_TREE);
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
-
/*-------------------------------------------------------------------------
* Function: H5TB_strcmp
@@ -424,7 +421,7 @@ H5TB_dfind(H5TB_TREE * tree, const void * key, H5TB_NODE ** pp)
{
H5TB_NODE *ret_value;
- FUNC_ENTER_NOAPI(H5TB_dfind, NULL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5TB_dfind);
assert(tree);
@@ -439,7 +436,6 @@ H5TB_dfind(H5TB_TREE * tree, const void * key, H5TB_NODE ** pp)
ret_value=NULL;
} /* end else */
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5TB_dfind() */
@@ -477,9 +473,9 @@ H5TB_find(H5TB_NODE * ptr, const void * key,
{
H5TB_NODE *parent = NULL;
int cmp = 1;
- H5TB_NODE *ret_value;
- FUNC_ENTER_NOAPI(H5TB_find, NULL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5TB_find);
+
if(ptr) {
while (0 != (cmp = KEYcmp(key, ptr->key, arg))) {
@@ -504,11 +500,7 @@ H5TB_find(H5TB_NODE * ptr, const void * key,
if (NULL != pp)
*pp = parent;
- /* Set return value */
- ret_value=ptr;
-
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ptr);
} /* end H5TB_find() */
@@ -543,14 +535,13 @@ H5TB_dless(H5TB_TREE * tree, void * key, H5TB_NODE ** pp)
{
H5TB_NODE *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5TB_dless,NULL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5TB_dless);
assert(tree);
/* Set return value */
ret_value= H5TB_less(tree->root, key, tree->compar, tree->cmparg, pp);
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5TB_dless() */
@@ -593,7 +584,7 @@ H5TB_less(H5TB_NODE * root, void * key, H5TB_cmp_t compar, int arg, H5TB_NODE **
int side;
H5TB_NODE *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5TB_less,NULL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5TB_less);
/* Try to find an exact match */
if (ptr) {
@@ -630,7 +621,6 @@ H5TB_less(H5TB_NODE * root, void * key, H5TB_cmp_t compar, int arg, H5TB_NODE **
/* Set return value */
ret_value= (0 == cmp) ? ptr : NULL;
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5TB_less */
@@ -662,7 +652,7 @@ H5TB_index(H5TB_NODE * root, unsigned indx)
H5TB_NODE *ptr = root;
H5TB_NODE *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5TB_index,NULL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5TB_index);
if (NULL != ptr) {
/* Termination condition is if the index equals the number of children on
@@ -688,7 +678,6 @@ H5TB_index(H5TB_NODE * root, unsigned indx)
/* Set return value */
ret_value=ptr;
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5TB_index() */
@@ -719,7 +708,7 @@ H5TB_dins(H5TB_TREE * tree, void * item, void * key)
{
H5TB_NODE *ret_value; /* the node to return */
- FUNC_ENTER_NOAPI(H5TB_dins,NULL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5TB_dins);
assert(tree);
@@ -730,7 +719,6 @@ H5TB_dins(H5TB_TREE * tree, void * item, void * key)
if (ret_value != NULL)
tree->count++;
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5TB_dins() */
@@ -1030,7 +1018,7 @@ H5TB_dfree(H5TB_TREE * tree, void(*fd) (void * /* item */), void(*fk) (void * /*
{
H5TB_TREE *ret_value=NULL; /* Return value */
- FUNC_ENTER_NOAPI(H5TB_dfree,NULL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5TB_dfree);
if (tree != NULL) {
/* Free the actual tree */
@@ -1040,7 +1028,6 @@ H5TB_dfree(H5TB_TREE * tree, void(*fd) (void * /* item */), void(*fk) (void * /*
H5FL_FREE(H5TB_TREE,tree);
} /* end if */
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5TB_dfree() */
@@ -1076,7 +1063,7 @@ H5TB_free(H5TB_NODE ** root, void(*fd) (void * /* item */), void(*fk) (void * /*
H5TB_NODE *par, *node = *root;
void *ret_value=NULL; /* Return value */
- FUNC_ENTER_NOAPI(H5TB_free,NULL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5TB_free);
/* While nodes left to be free()d */
while (NULL != *root) {
@@ -1112,7 +1099,6 @@ H5TB_free(H5TB_NODE ** root, void(*fd) (void * /* item */), void(*fk) (void * /*
} while (NULL != par); /* While moving back up tree */
} /* end while */
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5TB_free() */
@@ -1139,12 +1125,11 @@ H5TB_count(H5TB_TREE * tree)
{
long ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5TB_count,FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5TB_count);
/* Set return value */
ret_value= (tree==NULL) ? FAIL : (long)tree->count;
-done:
FUNC_LEAVE_NOAPI(ret_value);
} /* end H5TB_count() */
@@ -1174,7 +1159,7 @@ done:
herr_t
H5TB_dump(H5TB_TREE *tree, void (*key_dump)(void *,void *), int method)
{
- FUNC_ENTER_NOAPI(H5TB_dump,FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5TB_dump);
printf("H5TB-tree dump %p:\n",tree);
printf("capacity = %ld\n\n",(long)tree->count);
@@ -1205,7 +1190,7 @@ H5TB_printNode(H5TB_NODE * node, void(*key_dump)(void *,void *))
{
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5TB_printNode);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5TB_printNode);
if (node == NULL) {
printf("ERROR: null node pointer\n");
@@ -1249,7 +1234,7 @@ H5TB_dumpNode(H5TB_NODE *node, void (*key_dump)(void *,void *),
{
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5TB_dumpNode);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5TB_dumpNode);
if (node == NULL)
HGOTO_DONE(FAIL);
diff --git a/src/H5TS.c b/src/H5TS.c
index 943e21b..27ce315 100644
--- a/src/H5TS.c
+++ b/src/H5TS.c
@@ -12,8 +12,6 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* $Id$ */
-
/* private headers */
#include "H5private.h" /*library */
#include "H5Eprivate.h" /*error handling */
@@ -148,7 +146,7 @@ H5TS_mutex_lock(H5TS_mutex_t *mutex)
ret_value = pthread_mutex_lock(&mutex->atomic_lock);
if (ret_value)
- return ret_value;
+ return ret_value;
if (mutex->owner_thread && pthread_equal(pthread_self(), *mutex->owner_thread)) {
/* already owned by self - increment count */
@@ -284,7 +282,7 @@ H5TS_cancel_count_inc(void)
* First time thread calls library - create new counter and associate
* with key
*/
- cancel_counter = H5MM_malloc(sizeof(H5TS_cancel_t));
+ cancel_counter = H5MM_calloc(sizeof(H5TS_cancel_t));
if (!cancel_counter) {
H5E_push(H5E_RESOURCE, H5E_NOSPACE, "H5TS_cancel_count_inc",
@@ -292,7 +290,6 @@ H5TS_cancel_count_inc(void)
return FAIL;
}
- cancel_counter->cancel_count = 0;
ret_value = pthread_setspecific(H5TS_cancel_key_g,
(void *)cancel_counter);
}
diff --git a/src/H5Tarray.c b/src/H5Tarray.c
index a8c8de9..73675a7 100644
--- a/src/H5Tarray.c
+++ b/src/H5Tarray.c
@@ -19,6 +19,9 @@
#define H5T_PACKAGE /*suppress error about including H5Tpkg */
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5T_init_array_interface
+
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
#define PABLO_MASK H5T_array_mask
@@ -29,11 +32,6 @@
#include "H5Iprivate.h" /* IDs */
#include "H5Tpkg.h" /* Datatypes */
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT H5T_init_array_interface
-static herr_t H5T_init_array_interface(void);
-
/* Declare extern the free list for H5T_t's */
H5FL_EXTERN(H5T_t);
H5FL_EXTERN(H5T_shared_t);
diff --git a/src/H5Tbit.c b/src/H5Tbit.c
index a3537f1..440d8d1 100644
--- a/src/H5Tbit.c
+++ b/src/H5Tbit.c
@@ -22,17 +22,13 @@
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
-#define PABLO_MASK H5Tbit_mask
+#define PABLO_MASK H5T_bit_mask
#include "H5private.h" /*generic functions */
#include "H5Eprivate.h" /*error handling */
#include "H5Iprivate.h" /*ID functions */
#include "H5Tpkg.h" /*data-type functions */
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
-
/*-------------------------------------------------------------------------
* Function: H5T_bit_copy
@@ -163,7 +159,8 @@ H5T_bit_copy (uint8_t *dst, size_t dst_offset, const uint8_t *src,
/*-------------------------------------------------------------------------
* Function: H5T_bit_get_d
*
- * Purpose: Return a small bit sequence as a number.
+ * Purpose: Return a small bit sequence as a number. Bit vector starts
+ * at OFFSET and is SIZE bits long.
*
* Return: Success: The bit sequence interpretted as an unsigned
* integer.
@@ -184,12 +181,12 @@ H5T_bit_get_d (uint8_t *buf, size_t offset, size_t size)
size_t i, hs;
hsize_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5T_bit_get_d, 0);
+ FUNC_ENTER_NOAPI_NOFUNC(H5T_bit_get_d);
assert (8*sizeof(val)>=size);
H5T_bit_copy ((uint8_t*)&val, 0, buf, offset, size);
- switch (((H5T_t*)(H5I_object(H5T_NATIVE_INT_g)))->shared->u.atomic.order) {
+ switch (H5T_native_order_g) {
case H5T_ORDER_LE:
break;
@@ -208,7 +205,6 @@ H5T_bit_get_d (uint8_t *buf, size_t offset, size_t size)
/* Set return value */
ret_value=val;
-done:
FUNC_LEAVE_NOAPI(ret_value);
}
@@ -234,7 +230,7 @@ H5T_bit_set_d (uint8_t *buf, size_t offset, size_t size, hsize_t val)
assert (8*sizeof(val)>=size);
- switch (((H5T_t*)(H5I_object(H5T_NATIVE_INT_g)))->shared->u.atomic.order) {
+ switch (H5T_native_order_g) {
case H5T_ORDER_LE:
break;
@@ -313,7 +309,9 @@ H5T_bit_set (uint8_t *buf, size_t offset, size_t size, hbool_t value)
* Purpose: Finds the first bit with the specified VALUE within a region
* 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 with
+ * significat end toward the most significant end(H5T_BIT_LSB
+ * 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
* the offset.
@@ -417,10 +415,11 @@ done:
/*-------------------------------------------------------------------------
* Function: H5T_bit_inc
*
- * Purpose: Increment part of a bit field by adding 1.
+ * 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 overflow zero
- * otherwise.
+ * Return: Success: The carry-out value. One if overflows,
+ * zero otherwise.
*
* Failure: Negative
*
diff --git a/src/H5Tcommit.c b/src/H5Tcommit.c
index dfee616..26054d0 100644
--- a/src/H5Tcommit.c
+++ b/src/H5Tcommit.c
@@ -19,6 +19,9 @@
#define H5T_PACKAGE /*suppress error about including H5Tpkg */
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5T_init_commit_interface
+
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
#define PABLO_MASK H5T_commit_mask
@@ -27,14 +30,9 @@
#include "H5Eprivate.h" /* Error handling */
#include "H5FOprivate.h" /* File objects */
#include "H5Iprivate.h" /* IDs */
+#include "H5Oprivate.h" /* Object headers */
#include "H5Tpkg.h" /* Datatypes */
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT H5T_init_commit_interface
-static herr_t H5T_init_commit_interface(void);
-
-
/* Static local functions */
static herr_t H5T_commit(H5G_entry_t *loc, const char *name, H5T_t *type, hid_t dxpl_id);
@@ -55,16 +53,16 @@ DESCRIPTION
static herr_t
H5T_init_commit_interface(void)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_commit_interface);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_commit_interface)
- FUNC_LEAVE_NOAPI(H5T_init());
+ FUNC_LEAVE_NOAPI(H5T_init())
} /* H5T_init_commit_interface() */
/*-------------------------------------------------------------------------
* Function: H5Tcommit
*
- * Purpose: Save a transient data type to a file and turn the type handle
+ * Purpose: Save a transient datatype to a file and turn the type handle
* into a named, immutable type.
*
* Return: Non-negative on success/Negative on failure
@@ -83,23 +81,23 @@ H5Tcommit(hid_t loc_id, const char *name, hid_t type_id)
H5T_t *type = NULL;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_API(H5Tcommit, FAIL);
+ FUNC_ENTER_API(H5Tcommit, FAIL)
H5TRACE3("e","isi",loc_id,name,type_id);
/* Check arguments */
if (NULL==(loc=H5G_loc (loc_id)))
- HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a location");
+ HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a location")
if (!name || !*name)
- HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "no name");
+ HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "no name")
if (NULL==(type=H5I_object_verify(type_id, H5I_DATATYPE)))
- HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type");
+ HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
/* Commit the type */
if (H5T_commit (loc, name, type, H5AC_dxpl_id)<0)
- HGOTO_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit data type");
+ HGOTO_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to commit datatype")
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -124,11 +122,11 @@ H5T_commit (H5G_entry_t *loc, const char *name, H5T_t *type, hid_t dxpl_id)
H5F_t *file = NULL;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI_NOINIT(H5T_commit);
+ FUNC_ENTER_NOAPI_NOINIT(H5T_commit)
- assert (loc);
- assert (name && *name);
- assert (type);
+ HDassert (loc);
+ HDassert (name && *name);
+ HDassert (type);
/*
* Check arguments. We cannot commit an immutable type because H5Tclose()
@@ -136,17 +134,17 @@ H5T_commit (H5G_entry_t *loc, const char *name, H5T_t *type, hid_t dxpl_id)
* a named type should always succeed.
*/
if (H5T_STATE_NAMED==type->shared->state || H5T_STATE_OPEN==type->shared->state)
- HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "data type is already committed");
+ HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "datatype is already committed")
if (H5T_STATE_IMMUTABLE==type->shared->state)
- HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "data type is immutable");
+ HGOTO_ERROR (H5E_ARGS, H5E_BADVALUE, FAIL, "datatype is immutable")
/* Find the insertion file */
if (NULL==(file=H5G_insertion_file(loc, name, dxpl_id)))
- HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to find insertion point");
+ HGOTO_ERROR(H5E_SYM, H5E_CANTINIT, FAIL, "unable to find insertion point")
/* Check for a "sensible" datatype to store on disk */
- if(H5T_is_sensible(type)!=TRUE)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "datatype is not sensible");
+ if(H5T_is_sensible(type)<=0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "datatype is not sensible")
/* Mark datatype as being on disk now */
if (H5T_vlen_mark(type, file, H5T_VLEN_DISK)<0)
@@ -157,11 +155,11 @@ H5T_commit (H5G_entry_t *loc, const char *name, H5T_t *type, hid_t dxpl_id)
* type message and then give the object header a name.
*/
if (H5O_create (file, dxpl_id, 64, &(type->ent))<0)
- HGOTO_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to create data type object header");
+ HGOTO_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to create datatype object header")
if (H5O_modify (&(type->ent), H5O_DTYPE_ID, 0, H5O_FLAG_CONSTANT, H5O_UPDATE_TIME, type, dxpl_id)<0)
- HGOTO_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to update type header message");
+ HGOTO_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to update type header message")
if (H5G_insert (loc, name, &(type->ent), dxpl_id)<0)
- HGOTO_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to name data type");
+ HGOTO_ERROR (H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to name datatype")
type->shared->state = H5T_STATE_OPEN;
type->shared->fo_count=1;
@@ -178,21 +176,21 @@ done:
if (ret_value<0) {
if ((type->shared->state==H5T_STATE_TRANSIENT || type->shared->state==H5T_STATE_RDONLY) && H5F_addr_defined(type->ent.header)) {
if(H5O_close(&(type->ent))<0)
- HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to release object header");
+ HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to release object header")
if(H5O_delete(file, dxpl_id,type->ent.header)<0)
- HDONE_ERROR(H5E_DATATYPE, H5E_CANTDELETE, FAIL, "unable to delete object header");
+ HDONE_ERROR(H5E_DATATYPE, H5E_CANTDELETE, FAIL, "unable to delete object header")
type->ent.header = HADDR_UNDEF;
}
}
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
/*-------------------------------------------------------------------------
* Function: H5Tcommitted
*
- * Purpose: Determines if a data type is committed or not.
+ * Purpose: Determines if a datatype is committed or not.
*
* Return: Success: TRUE if committed, FALSE otherwise.
*
@@ -211,25 +209,25 @@ H5Tcommitted(hid_t type_id)
H5T_t *type = NULL;
htri_t ret_value; /* Return value */
- FUNC_ENTER_API(H5Tcommitted, FAIL);
+ FUNC_ENTER_API(H5Tcommitted, FAIL)
H5TRACE1("t","i",type_id);
/* Check arguments */
if (NULL==(type=H5I_object_verify(type_id,H5I_DATATYPE)))
- HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type");
+ HGOTO_ERROR (H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
/* Set return value */
ret_value= H5T_committed(type);
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
/*-------------------------------------------------------------------------
* Function: H5T_committed
*
- * Purpose: Determines if a data type is committed or not.
+ * Purpose: Determines if a datatype is committed or not.
*
* Return: Success: TRUE if committed, FALSE otherwise.
*
@@ -241,14 +239,14 @@ done:
*-------------------------------------------------------------------------
*/
htri_t
-H5T_committed(H5T_t *type)
+H5T_committed(const H5T_t *type)
{
/* Use no-init for efficiency */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_committed);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_committed)
assert (type);
- FUNC_LEAVE_NOAPI(H5T_STATE_OPEN==type->shared->state || H5T_STATE_NAMED==type->shared->state);
+ FUNC_LEAVE_NOAPI(H5T_STATE_OPEN==type->shared->state || H5T_STATE_NAMED==type->shared->state)
} /* end H5T_committed() */
@@ -275,15 +273,15 @@ H5T_link(const H5T_t *type, int adjust, hid_t dxpl_id)
int ret_value; /* Return value */
/* Use no-init for efficiency */
- FUNC_ENTER_NOAPI(H5T_link,FAIL);
+ FUNC_ENTER_NOAPI(H5T_link,FAIL)
assert (type);
/* Adjust the link count on the named datatype */
if((ret_value=H5O_link(&(type->ent),adjust,dxpl_id))<0)
- HGOTO_ERROR (H5E_DATATYPE, H5E_LINK, FAIL, "unable to adjust named datatype link count");
+ HGOTO_ERROR (H5E_DATATYPE, H5E_LINK, FAIL, "unable to adjust named datatype link count")
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_link() */
diff --git a/src/H5Tcompound.c b/src/H5Tcompound.c
index ee51989..467798f 100644
--- a/src/H5Tcompound.c
+++ b/src/H5Tcompound.c
@@ -19,6 +19,9 @@
#define H5T_PACKAGE /*suppress error about including H5Tpkg */
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5T_init_compound_interface
+
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
#define PABLO_MASK H5T_compound_mask
@@ -29,16 +32,11 @@
#include "H5MMprivate.h" /*memory management */
#include "H5Tpkg.h" /*data-type functions */
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT H5T_init_compound_interface
-static herr_t H5T_init_compound_interface(void);
-
/* Local macros */
#define H5T_COMPND_INC 64 /*typical max numb of members per struct */
/* Static local functions */
-static herr_t H5T_pack(H5T_t *dt);
+static herr_t H5T_pack(const H5T_t *dt);
/*--------------------------------------------------------------------------
@@ -84,18 +82,18 @@ H5T_init_compound_interface(void)
*-------------------------------------------------------------------------
*/
size_t
-H5Tget_member_offset(hid_t type_id, int membno)
+H5Tget_member_offset(hid_t type_id, unsigned membno)
{
H5T_t *dt = NULL;
size_t ret_value;
FUNC_ENTER_API(H5Tget_member_offset, 0)
- H5TRACE2("z","iIs",type_id,membno);
+ H5TRACE2("z","iIu",type_id,membno);
/* Check args */
if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE)) || H5T_COMPOUND != dt->shared->type)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a compound datatype")
- if (membno < 0 || membno >= dt->shared->u.compnd.nmembs)
+ if (membno >= dt->shared->u.compnd.nmembs)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid member number")
/* Value */
@@ -128,19 +126,18 @@ done:
*-------------------------------------------------------------------------
*/
size_t
-H5T_get_member_offset(const H5T_t *dt, int membno)
+H5T_get_member_offset(const H5T_t *dt, unsigned membno)
{
size_t ret_value;
- FUNC_ENTER_NOAPI(H5T_get_member_offset, 0)
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_get_member_offset)
assert(dt);
- assert(membno >= 0 && membno < dt->shared->u.compnd.nmembs);
+ assert(membno < dt->shared->u.compnd.nmembs);
/* Value */
ret_value = dt->shared->u.compnd.memb[membno].offset;
-done:
FUNC_LEAVE_NOAPI(ret_value)
}
@@ -162,18 +159,18 @@ done:
*-------------------------------------------------------------------------
*/
H5T_class_t
-H5Tget_member_class(hid_t type_id, int membno)
+H5Tget_member_class(hid_t type_id, unsigned membno)
{
H5T_t *dt = NULL;
H5T_class_t ret_value;
FUNC_ENTER_API(H5Tget_member_class, H5T_NO_CLASS)
- H5TRACE2("Tt","iIs",type_id,membno);
+ H5TRACE2("Tt","iIu",type_id,membno);
/* Check args */
if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE)) || H5T_COMPOUND != dt->shared->type)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_NO_CLASS, "not a compound datatype")
- if (membno < 0 || membno >= dt->shared->u.compnd.nmembs)
+ if (membno >= dt->shared->u.compnd.nmembs)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5T_NO_CLASS, "invalid member number")
/* Value */
@@ -209,18 +206,18 @@ done:
*-------------------------------------------------------------------------
*/
hid_t
-H5Tget_member_type(hid_t type_id, int membno)
+H5Tget_member_type(hid_t type_id, unsigned membno)
{
H5T_t *dt = NULL, *memb_dt = NULL;
hid_t ret_value;
FUNC_ENTER_API(H5Tget_member_type, FAIL)
- H5TRACE2("i","iIs",type_id,membno);
+ H5TRACE2("i","iIu",type_id,membno);
/* Check args */
if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE)) || H5T_COMPOUND != dt->shared->type)
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a compound datatype")
- if (membno < 0 || membno >= dt->shared->u.compnd.nmembs)
+ if (membno >= dt->shared->u.compnd.nmembs)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid member number")
if ((memb_dt=H5T_get_member_type(dt, membno))==NULL)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to retrieve member type")
@@ -231,7 +228,7 @@ done:
if(ret_value<0) {
if(memb_dt!=NULL)
if(H5T_close(memb_dt)<0)
- HDONE_ERROR(H5E_DATATYPE, H5E_CANTDEC, FAIL, "can't close datatype")
+ HDONE_ERROR(H5E_DATATYPE, H5E_CANTCLOSEOBJ, FAIL, "can't close datatype")
} /* end if */
FUNC_LEAVE_API(ret_value)
@@ -258,14 +255,14 @@ done:
*-------------------------------------------------------------------------
*/
H5T_t *
-H5T_get_member_type(const H5T_t *dt, int membno)
+H5T_get_member_type(const H5T_t *dt, unsigned membno)
{
H5T_t *ret_value = NULL;
FUNC_ENTER_NOAPI(H5T_get_member_type, NULL)
assert(dt);
- assert(membno >=0 && membno < dt->shared->u.compnd.nmembs);
+ 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)))
@@ -293,11 +290,11 @@ done:
*-------------------------------------------------------------------------
*/
size_t
-H5T_get_member_size(H5T_t *dt, unsigned membno)
+H5T_get_member_size(const H5T_t *dt, unsigned membno)
{
size_t ret_value = 0;
- FUNC_ENTER_NOAPI(H5T_get_member_size, 0);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_get_member_size)
assert(dt);
assert(membno < dt->shared->u.compnd.nmembs);
@@ -305,8 +302,7 @@ H5T_get_member_size(H5T_t *dt, unsigned membno)
/* Value */
ret_value = dt->shared->u.compnd.memb[membno].type->shared->size;
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -359,7 +355,7 @@ H5Tinsert(hid_t parent_id, const char *name, size_t offset, hid_t member_id)
/* Insert */
if (H5T_insert(parent, name, offset, member) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINSERT, FAIL, "unable to insert member")
-
+
done:
FUNC_LEAVE_API(ret_value)
}
@@ -396,7 +392,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)
}
@@ -421,9 +417,9 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5T_insert(H5T_t *parent, const char *name, size_t offset, const H5T_t *member)
+H5T_insert(const H5T_t *parent, const char *name, size_t offset, const H5T_t *member)
{
- int idx, i;
+ unsigned idx, i;
size_t total_size;
herr_t ret_value=SUCCEED; /* Return value */
@@ -458,13 +454,13 @@ H5T_insert(H5T_t *parent, const char *name, size_t offset, const H5T_t *member)
/* Increase member array if necessary */
if (parent->shared->u.compnd.nmembs >= parent->shared->u.compnd.nalloc) {
- size_t na = parent->shared->u.compnd.nalloc + H5T_COMPND_INC;
+ unsigned na = parent->shared->u.compnd.nalloc + H5T_COMPND_INC;
H5T_cmemb_t *x = H5MM_realloc (parent->shared->u.compnd.memb,
na * sizeof(H5T_cmemb_t));
if (!x)
HGOTO_ERROR (H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
- parent->shared->u.compnd.nalloc = (int)na;
+ parent->shared->u.compnd.nalloc = na;
parent->shared->u.compnd.memb = x;
}
@@ -528,9 +524,9 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5T_pack(H5T_t *dt)
+H5T_pack(const H5T_t *dt)
{
- int i;
+ unsigned i;
size_t offset;
herr_t ret_value=SUCCEED; /* Return value */
@@ -541,12 +537,12 @@ H5T_pack(H5T_t *dt)
if(H5T_detect_class(dt,H5T_COMPOUND)>0) {
/* If datatype has been packed, skip packing it and indicate success */
if(H5T_is_packed(dt)== TRUE)
- HGOTO_DONE(SUCCEED);
+ HGOTO_DONE(SUCCEED)
/* Check for packing unmodifiable datatype */
if (H5T_STATE_TRANSIENT!=dt->shared->state)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "datatype is read-only")
-
+
if(dt->shared->parent) {
if (H5T_pack(dt->shared->parent) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to pack parent of datatype")
@@ -604,7 +600,7 @@ H5T_is_packed(const H5T_t *dt)
{
htri_t ret_value=TRUE; /* Return value */
- FUNC_ENTER_NOAPI(H5T_is_packed,FAIL)
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_is_packed)
assert(dt);
@@ -614,9 +610,8 @@ H5T_is_packed(const H5T_t *dt)
/* If this is a compound datatype, check if it is packed */
if(dt->shared->type==H5T_COMPOUND)
- ret_value=dt->shared->u.compnd.packed;
+ ret_value=(htri_t)dt->shared->u.compnd.packed;
-done:
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5T_is_packed() */
diff --git a/src/H5Tconv.c b/src/H5Tconv.c
index 8e2433b..2cdfb2e 100644
--- a/src/H5Tconv.c
+++ b/src/H5Tconv.c
@@ -20,7 +20,7 @@
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
-#define PABLO_MASK H5Tconv_mask
+#define PABLO_MASK H5T_conv_mask
#include "H5private.h" /*generic functions */
#include "H5Eprivate.h" /*error handling */
@@ -51,10 +51,6 @@ typedef struct H5T_conv_hw_t {
size_t d_aligned; /*number destination elements aligned*/
} H5T_conv_hw_t;
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
-
/* Declare a free list to manage pieces of vlen data */
H5FL_BLK_DEFINE_STATIC(vlen_seq);
@@ -336,7 +332,7 @@ H5FL_BLK_DEFINE_STATIC(array_seq);
if (NULL==(st=H5I_object(src_id)) || NULL==(dt=H5I_object(dst_id))) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, \
"unable to dereference datatype object ID") \
- if (st->shared->size!=sizeof(ST) || dt->shared->size!=sizeof(DT)) \
+ if (st->shared->size!=sizeof(ST) || dt->shared->size!=sizeof(DT)) \
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, \
"disagreement about datatype size") \
CI_ALLOC_PRIV \
@@ -353,7 +349,8 @@ H5FL_BLK_DEFINE_STATIC(array_seq);
if (buf_stride) { \
assert(buf_stride>=sizeof(ST)); \
assert(buf_stride>=sizeof(DT)); \
- s_stride = d_stride = buf_stride; \
+ H5_CHECK_OVERFLOW(buf_stride,size_t,ssize_t); \
+ s_stride = d_stride = (ssize_t)buf_stride; \
} else { \
s_stride = sizeof(ST); \
d_stride = sizeof(DT); \
@@ -1306,7 +1303,8 @@ static herr_t
H5T_conv_struct_init (H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata, hid_t dxpl_id)
{
H5T_conv_struct_t *priv = (H5T_conv_struct_t*)(cdata->priv);
- int i, j, *src2dst = NULL;
+ int *src2dst = NULL;
+ unsigned i, j;
H5T_t *type = NULL;
hid_t tid;
herr_t ret_value=SUCCEED; /* Return value */
@@ -1463,6 +1461,7 @@ H5T_conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
size_t offset; /*byte offset wrt struct */
size_t src_delta; /*source stride */
size_t elmtno;
+ unsigned u; /*counters */
int i; /*counters */
H5T_conv_struct_t *priv = (H5T_conv_struct_t *)(cdata->priv);
herr_t ret_value=SUCCEED; /* Return value */
@@ -1545,14 +1544,14 @@ H5T_conv_struct(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
* data point as small as possible with all the free space on the
* right side.
*/
- for (i=0, offset=0; i<src->shared->u.compnd.nmembs; i++) {
- if (src2dst[i]<0) continue; /*subsetting*/
- src_memb = src->shared->u.compnd.memb + i;
- dst_memb = dst->shared->u.compnd.memb + src2dst[i];
+ for (u=0, offset=0; u<src->shared->u.compnd.nmembs; u++) {
+ if (src2dst[u]<0) continue; /*subsetting*/
+ src_memb = src->shared->u.compnd.memb + u;
+ dst_memb = dst->shared->u.compnd.memb + src2dst[u];
if (dst_memb->size <= src_memb->size) {
- if (H5T_convert(priv->memb_path[i], priv->src_memb_id[i],
- priv->dst_memb_id[src2dst[i]],
+ if (H5T_convert(priv->memb_path[u], priv->src_memb_id[u],
+ priv->dst_memb_id[src2dst[u]],
1, 0, 0, /*no striding (packed array)*/
xbuf+src_memb->offset, xbkg+dst_memb->offset,
dxpl_id)<0)
@@ -1695,6 +1694,7 @@ H5T_conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
H5T_cmemb_t *dst_memb = NULL; /*destination struct memb desc. */
size_t offset; /*byte offset wrt struct */
size_t elmtno; /*element counter */
+ unsigned u; /*counters */
int i; /*counters */
H5T_conv_struct_t *priv = NULL; /*private data */
herr_t ret_value=SUCCEED; /* Return value */
@@ -1732,11 +1732,11 @@ H5T_conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
* is room for each conversion instead of actually doing anything.
*/
if (dst->shared->size > src->shared->size) {
- for (i=0, offset=0; i<src->shared->u.compnd.nmembs; i++) {
- if (src2dst[i]<0)
+ for (u=0, offset=0; u<src->shared->u.compnd.nmembs; u++) {
+ if (src2dst[u]<0)
continue;
- src_memb = src->shared->u.compnd.memb + i;
- dst_memb = dst->shared->u.compnd.memb + src2dst[i];
+ src_memb = src->shared->u.compnd.memb + u;
+ dst_memb = dst->shared->u.compnd.memb + src2dst[u];
if (dst_memb->size > src_memb->size)
offset += src_memb->size;
}
@@ -1813,17 +1813,17 @@ H5T_conv_struct_opt(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata,
* destination in the bkg buffer. Otherwise move the element as far
* left as possible in the buffer.
*/
- for (i=0, offset=0; i<src->shared->u.compnd.nmembs; i++) {
- if (src2dst[i]<0) continue; /*subsetting*/
- src_memb = src->shared->u.compnd.memb + i;
- dst_memb = dst->shared->u.compnd.memb + src2dst[i];
+ for (u=0, offset=0; u<src->shared->u.compnd.nmembs; u++) {
+ if (src2dst[u]<0) continue; /*subsetting*/
+ src_memb = src->shared->u.compnd.memb + u;
+ dst_memb = dst->shared->u.compnd.memb + src2dst[u];
if (dst_memb->size <= src_memb->size) {
xbuf = buf + src_memb->offset;
xbkg = bkg + dst_memb->offset;
- if (H5T_convert(priv->memb_path[i],
- priv->src_memb_id[i],
- priv->dst_memb_id[src2dst[i]], nelmts,
+ if (H5T_convert(priv->memb_path[u],
+ priv->src_memb_id[u],
+ priv->dst_memb_id[src2dst[u]], nelmts,
buf_stride ? buf_stride : src->shared->size,
bkg_stride, xbuf, xbkg,
dxpl_id)<0)
@@ -1915,8 +1915,8 @@ H5T_conv_enum_init(H5T_t *src, H5T_t *dst, H5T_cdata_t *cdata)
int n; /*src value cast as native int */
int domain[2]; /*min and max source values */
int *map=NULL; /*map from src value to dst idx */
- int length; /*nelmts in map array */
- int i, j; /*counters */
+ 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);
@@ -2296,14 +2296,19 @@ H5T_conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
if (buf_stride) {
assert(buf_stride>=src->shared->size);
assert(buf_stride>=dst->shared->size);
- s_stride = d_stride = buf_stride;
+ H5_CHECK_OVERFLOW(buf_stride,size_t,ssize_t);
+ s_stride = d_stride = (ssize_t)buf_stride;
} else {
- s_stride = src->shared->size;
- d_stride = dst->shared->size;
+ H5_CHECK_OVERFLOW(src->shared->size,size_t,ssize_t);
+ H5_CHECK_OVERFLOW(dst->shared->size,size_t,ssize_t);
+ s_stride = (ssize_t)src->shared->size;
+ d_stride = (ssize_t)dst->shared->size;
}
if(bkg) {
- if(bkg_stride)
- b_stride=bkg_stride;
+ if(bkg_stride) {
+ H5_CHECK_OVERFLOW(bkg_stride,size_t,ssize_t);
+ b_stride=(ssize_t)bkg_stride;
+ } /* end if */
else
b_stride=d_stride;
} /* end if */
@@ -2509,8 +2514,7 @@ H5T_conv_vlen(hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
done:
/* If the conversion buffer doesn't need to be freed, reset its pointer */
if(write_to_file && noop_conv)
- conv_buf = NULL;
-
+ conv_buf=NULL;
/* Release the conversion buffer (always allocated, except on errors) */
if(conv_buf!=NULL)
H5FL_BLK_FREE(vlen_seq,conv_buf);
@@ -2893,7 +2897,6 @@ 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 (first+1 == src->shared->u.atomic.prec) {
/*
* Both the source and the destination are signed and the
@@ -3317,13 +3320,13 @@ H5T_conv_f_f (hid_t src_id, hid_t dst_id, H5T_cdata_t *cdata, size_t nelmts,
H5T_bit_set(d, dst.u.f.mpos, 1, TRUE);
} else if (mrsh==dst.u.f.msize) {
H5T_bit_set(d, dst.u.f.mpos, dst.u.f.msize, FALSE);
- H5T_bit_set_d(d, dst.u.f.mpos, MIN(2, dst.u.f.msize), implied);
+ H5T_bit_set_d(d, dst.u.f.mpos, MIN(2, dst.u.f.msize), (hsize_t)implied);
} else {
if (mrsh>0) {
H5T_bit_set(d, dst.u.f.mpos+dst.u.f.msize-mrsh, mrsh,
FALSE);
H5T_bit_set_d(d, dst.u.f.mpos+dst.u.f.msize-mrsh, 2,
- implied);
+ (hsize_t)implied);
}
if (mrsh+msize>=dst.u.f.msize) {
H5T_bit_copy(d, dst.u.f.mpos,
diff --git a/src/H5Tcset.c b/src/H5Tcset.c
index f9fe4e6..5d9c857 100644
--- a/src/H5Tcset.c
+++ b/src/H5Tcset.c
@@ -19,18 +19,18 @@
#define H5T_PACKAGE /*suppress error about including H5Tpkg */
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5T_init_cset_interface
+
+/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
+#define PABLO_MASK H5T_cset_mask
+
#include "H5private.h" /*generic functions */
#include "H5Eprivate.h" /*error handling */
#include "H5Iprivate.h" /*ID functions */
#include "H5Tpkg.h" /*data-type functions */
-#define PABLO_MASK H5Tcset_mask
-
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT H5T_init_cset_interface
-static herr_t H5T_init_cset_interface(void);
-
/*--------------------------------------------------------------------------
NAME
@@ -48,9 +48,9 @@ DESCRIPTION
static herr_t
H5T_init_cset_interface(void)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_cset_interface);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_cset_interface)
- FUNC_LEAVE_NOAPI(H5T_init());
+ FUNC_LEAVE_NOAPI(H5T_init())
} /* H5T_init_cset_interface() */
@@ -80,27 +80,25 @@ H5Tget_cset(hid_t type_id)
H5T_t *dt = NULL;
H5T_cset_t ret_value;
- FUNC_ENTER_API(H5Tget_cset, H5T_CSET_ERROR);
+ FUNC_ENTER_API(H5Tget_cset, H5T_CSET_ERROR)
H5TRACE1("Tc","i",type_id);
/* Check args */
if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_CSET_ERROR, "not a data type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_CSET_ERROR, "not a data type")
while (dt->shared->parent && !H5T_IS_STRING(dt->shared))
dt = dt->shared->parent; /*defer to parent*/
if (!H5T_IS_STRING(dt->shared))
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5T_CSET_ERROR, "operation not defined for data type class");
+ HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, H5T_CSET_ERROR, "operation not defined for data type class")
/* result */
- if(H5T_STRING == dt->shared->type)
+ if(H5T_IS_FIXED_STRING(dt->shared))
ret_value = dt->shared->u.atomic.u.s.cset;
- else if(H5T_VLEN == dt->shared->type && H5T_VLEN_STRING == dt->shared->u.vlen.type)
+ else
ret_value = dt->shared->u.vlen.cset;
- else
- HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, H5T_CSET_ERROR, "can't get cset info");
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -128,30 +126,28 @@ H5Tset_cset(hid_t type_id, H5T_cset_t cset)
H5T_t *dt = NULL;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_API(H5Tset_cset, FAIL);
+ FUNC_ENTER_API(H5Tset_cset, FAIL)
H5TRACE2("e","iTc",type_id,cset);
/* Check args */
if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type")
if (H5T_STATE_TRANSIENT!=dt->shared->state)
- HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "data type is read-only");
- if (cset < 0 || cset >= H5T_NCSET)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "illegal character set type");
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "data type is read-only")
+ if (cset < H5T_CSET_ASCII || cset >= H5T_NCSET)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "illegal character set type")
while (dt->shared->parent && !H5T_IS_STRING(dt->shared))
dt = dt->shared->parent; /*defer to parent*/
if (!H5T_IS_STRING(dt->shared))
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for data type class");
+ HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for data type class")
/* Commit */
- if(H5T_STRING == dt->shared->type)
+ if(H5T_IS_FIXED_STRING(dt->shared))
dt->shared->u.atomic.u.s.cset = cset;
- else if(H5T_VLEN == dt->shared->type && H5T_VLEN_STRING == dt->shared->u.vlen.type)
+ else
dt->shared->u.vlen.cset = cset;
- else
- HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, FAIL, "can't set cset info");
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
diff --git a/src/H5Tenum.c b/src/H5Tenum.c
index 945e728..db1daa4 100644
--- a/src/H5Tenum.c
+++ b/src/H5Tenum.c
@@ -19,6 +19,9 @@
#define H5T_PACKAGE /*suppress error about including H5Tpkg */
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5T_init_enum_interface
+
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
#define PABLO_MASK H5T_enum_mask
@@ -30,19 +33,14 @@
#include "H5MMprivate.h" /*memory management */
#include "H5Tpkg.h" /*data-type functions */
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT H5T_init_enum_interface
-static herr_t H5T_init_enum_interface(void);
-
/* Declare extern the free lists for H5T_t's and H5T_shared_t's */
H5FL_EXTERN(H5T_t);
H5FL_EXTERN(H5T_shared_t);
/* Static local functions */
-static char *H5T_enum_nameof(H5T_t *dt, const void *value, char *name/*out*/,
+static char *H5T_enum_nameof(const H5T_t *dt, const void *value, char *name/*out*/,
size_t size);
-static herr_t H5T_enum_valueof(H5T_t *dt, const char *name,
+static herr_t H5T_enum_valueof(const H5T_t *dt, const char *name,
void *value/*out*/);
@@ -143,7 +141,7 @@ H5T_enum_create(const H5T_t *parent)
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
if (NULL==(ret_value->shared=H5FL_CALLOC(H5T_shared_t))) {
H5FL_FREE(H5T_t, ret_value);
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
}
ret_value->shared->type = H5T_ENUM;
ret_value->shared->parent = H5T_copy(parent, H5T_COPY_ALL);
@@ -225,9 +223,9 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5T_enum_insert(H5T_t *dt, const char *name, const void *value)
+H5T_enum_insert(const H5T_t *dt, const char *name, const void *value)
{
- int i;
+ unsigned i;
char **names=NULL;
uint8_t *values=NULL;
herr_t ret_value=SUCCEED; /* Return value */
@@ -248,7 +246,7 @@ H5T_enum_insert(H5T_t *dt, const char *name, const void *value)
/* Increase table sizes */
if (dt->shared->u.enumer.nmembs >= dt->shared->u.enumer.nalloc) {
- int n = MAX(32, 2*dt->shared->u.enumer.nalloc);
+ unsigned n = MAX(32, 2*dt->shared->u.enumer.nalloc);
if (NULL==(names=H5MM_realloc(dt->shared->u.enumer.name, n*sizeof(char*))))
HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
dt->shared->u.enumer.name = names;
@@ -288,19 +286,19 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5Tget_member_value(hid_t type, int membno, void *value/*out*/)
+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","iIsx",type,membno,value);
+ H5TRACE3("e","iIux",type,membno,value);
if (NULL==(dt=H5I_object_verify(type,H5I_DATATYPE)))
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type")
if (H5T_ENUM!=dt->shared->type)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for data type class")
- if (membno<0 || membno>=dt->shared->u.enumer.nmembs)
+ if (membno>=dt->shared->u.enumer.nmembs)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid member number")
if (!value)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "null value buffer")
@@ -331,7 +329,7 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5T_get_member_value(const H5T_t *dt, int membno, void *value/*out*/)
+H5T_get_member_value(const H5T_t *dt, unsigned membno, void *value/*out*/)
{
herr_t ret_value=SUCCEED; /* Return value */
@@ -423,9 +421,9 @@ done:
*-------------------------------------------------------------------------
*/
static char *
-H5T_enum_nameof(H5T_t *dt, const void *value, char *name/*out*/, size_t size)
+H5T_enum_nameof(const H5T_t *dt, const void *value, char *name/*out*/, size_t size)
{
- int lt, md, rt; /*indices for binary search */
+ unsigned lt, md=0, rt; /*indices for binary search */
int cmp=(-1); /*comparison result */
char *ret_value; /* Return value */
@@ -446,7 +444,6 @@ H5T_enum_nameof(H5T_t *dt, const void *value, char *name/*out*/, size_t size)
HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOMPARE, NULL, "value sort failed")
lt = 0;
rt = dt->shared->u.enumer.nmembs;
- md = -1;
while (lt<rt) {
md = (lt+rt)/2;
@@ -544,9 +541,9 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5T_enum_valueof(H5T_t *dt, const char *name, void *value/*out*/)
+H5T_enum_valueof(const H5T_t *dt, const char *name, void *value/*out*/)
{
- int lt, md, rt; /*indices for binary search */
+ unsigned lt, md=0, rt; /*indices for binary search */
int cmp=(-1); /*comparison result */
herr_t ret_value=SUCCEED; /* Return value */
@@ -566,7 +563,6 @@ H5T_enum_valueof(H5T_t *dt, const char *name, void *value/*out*/)
HGOTO_ERROR(H5E_INTERNAL, H5E_CANTCOMPARE, FAIL, "value sort failed")
lt = 0;
rt = dt->shared->u.enumer.nmembs;
- md = -1;
while (lt<rt) {
md = (lt+rt)/2;
diff --git a/src/H5Tfields.c b/src/H5Tfields.c
index 674a16b..d2c2082 100644
--- a/src/H5Tfields.c
+++ b/src/H5Tfields.c
@@ -19,19 +19,19 @@
#define H5T_PACKAGE /*suppress error about including H5Tpkg */
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5T_init_fields_interface
+
+/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
+#define PABLO_MASK H5T_fields_mask
+
#include "H5private.h" /*generic functions */
#include "H5Eprivate.h" /*error handling */
#include "H5Iprivate.h" /*ID functions */
#include "H5MMprivate.h" /*memory management */
#include "H5Tpkg.h" /*data-type functions */
-#define PABLO_MASK H5Tfields_mask
-
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT H5T_init_fields_interface
-static herr_t H5T_init_fields_interface(void);
-
/*--------------------------------------------------------------------------
NAME
@@ -49,9 +49,9 @@ DESCRIPTION
static herr_t
H5T_init_fields_interface(void)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_fields_interface);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_fields_interface)
- FUNC_LEAVE_NOAPI(H5T_init());
+ FUNC_LEAVE_NOAPI(H5T_init())
} /* H5T_init_fields_interface() */
@@ -59,9 +59,9 @@ H5T_init_fields_interface(void)
* Function: H5Tget_nmembers
*
* Purpose: Determines how many members TYPE_ID has. The type must be
- * either a compound data type or an enumeration data type.
+ * either a compound datatype or an enumeration datatype.
*
- * Return: Success: Number of members defined in the data type.
+ * Return: Success: Number of members defined in the datatype.
*
* Failure: Negative
*
@@ -72,7 +72,7 @@ H5T_init_fields_interface(void)
*
* Modifications:
* Robb Matzke, 22 Dec 1998
- * Also works with enumeration data types.
+ * Also works with enumeration datatypes.
*-------------------------------------------------------------------------
*/
int
@@ -81,18 +81,18 @@ H5Tget_nmembers(hid_t type_id)
H5T_t *dt = NULL;
int ret_value;
- FUNC_ENTER_API(H5Tget_nmembers, FAIL);
+ FUNC_ENTER_API(H5Tget_nmembers, FAIL)
H5TRACE1("Is","i",type_id);
/* Check args */
if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
if((ret_value = H5T_get_nmembers(dt))<0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "cannot return member number");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "cannot return member number")
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -101,9 +101,9 @@ done:
*
* Purpose: Private function for H5Tget_nmembers. Determines how many
* members DTYPE has. The type must be either a compound data
- * type or an enumeration data type.
+ * type or an enumeration datatype.
*
- * Return: Success: Number of members defined in the data type.
+ * Return: Success: Number of members defined in the datatype.
*
* Failure: Negative
*
@@ -121,19 +121,19 @@ H5T_get_nmembers(const H5T_t *dt)
{
int ret_value;
- FUNC_ENTER_NOAPI(H5T_get_nmembers, FAIL);
+ FUNC_ENTER_NOAPI(H5T_get_nmembers, FAIL)
assert(dt);
if (H5T_COMPOUND==dt->shared->type)
- ret_value = dt->shared->u.compnd.nmembs;
+ ret_value = (int)dt->shared->u.compnd.nmembs;
else if (H5T_ENUM==dt->shared->type)
- ret_value = dt->shared->u.enumer.nmembs;
+ ret_value = (int)dt->shared->u.enumer.nmembs;
else
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "operation not supported for type class");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "operation not supported for type class")
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -141,7 +141,7 @@ done:
* Function: H5Tget_member_name
*
* Purpose: Returns the name of a member of a compound or enumeration
- * data type. Members are stored in no particular order with
+ * datatype. Members are stored in no particular order with
* numbers 0 through N-1 where N is the value returned by
* H5Tget_nmembers().
*
@@ -155,26 +155,26 @@ done:
*
* Modifications:
* Robb Matzke, 22 Dec 1998
- * Also works with enumeration data types.
+ * Also works with enumeration datatypes.
*-------------------------------------------------------------------------
*/
char *
-H5Tget_member_name(hid_t type_id, int membno)
+H5Tget_member_name(hid_t type_id, unsigned membno)
{
H5T_t *dt = NULL;
char *ret_value;
- FUNC_ENTER_API(H5Tget_member_name, NULL);
+ FUNC_ENTER_API(H5Tget_member_name, NULL)
/* Check args */
if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a datatype")
if((ret_value = H5T_get_member_name(dt, membno))==NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to get member name");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to get member name")
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -182,7 +182,7 @@ done:
* Function: H5T_get_member_name
*
* Purpose: Private function for H5Tget_member_name. Returns the name
- * of a member of a compound or enumeration data type. Members
+ * of a member of a compound or enumeration datatype. Members
* are stored in no particular order with numbers 0 through
* N-1 where N is the value returned by H5Tget_nmembers().
*
@@ -198,33 +198,33 @@ done:
*-------------------------------------------------------------------------
*/
char *
-H5T_get_member_name(H5T_t const *dt, int membno)
+H5T_get_member_name(H5T_t const *dt, unsigned membno)
{
char *ret_value;
- FUNC_ENTER_NOAPI(H5T_get_member_name, NULL);
+ FUNC_ENTER_NOAPI(H5T_get_member_name, NULL)
assert(dt);
switch (dt->shared->type) {
case H5T_COMPOUND:
- if (membno<0 || membno>=dt->shared->u.compnd.nmembs)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid member number");
+ if (membno>=dt->shared->u.compnd.nmembs)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid member number")
ret_value = H5MM_xstrdup(dt->shared->u.compnd.memb[membno].name);
break;
case H5T_ENUM:
- if (membno<0 || membno>=dt->shared->u.enumer.nmembs)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, NULL, "invalid member number");
+ if (membno>=dt->shared->u.enumer.nmembs)
+ 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");
- }
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "operation not supported for type class")
+ } /*lint !e788 All appropriate cases are covered */
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -232,7 +232,7 @@ done:
* Function: H5Tget_member_index
*
* Purpose: Returns the index of a member in a compound or enumeration
- * data type by given name.Members are stored in no particular
+ * 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().
*
@@ -251,47 +251,45 @@ H5Tget_member_index(hid_t type_id, const char *name)
{
H5T_t *dt = NULL;
int ret_value=FAIL;
- int nmembs, i;
+ unsigned i;
- FUNC_ENTER_API(H5Tget_member_index, FAIL);
+ FUNC_ENTER_API(H5Tget_member_index, FAIL)
H5TRACE2("Is","is",type_id,name);
/* Check arguments */
assert(name);
if(NULL==(dt=H5I_object_verify(type_id,H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
/* Locate member by name */
switch (dt->shared->type) {
case H5T_COMPOUND:
- nmembs = dt->shared->u.compnd.nmembs;
- for(i=0; i<nmembs; i++) {
+ for(i=0; i< dt->shared->u.compnd.nmembs; i++) {
if(!HDstrcmp(dt->shared->u.compnd.memb[i].name, name))
- HGOTO_DONE(i);
+ HGOTO_DONE((int)i)
}
break;
case H5T_ENUM:
- nmembs = dt->shared->u.enumer.nmembs;
- for(i=0; i<nmembs; i++) {
+ for(i=0; i< dt->shared->u.enumer.nmembs; i++) {
if(!HDstrcmp(dt->shared->u.enumer.name[i], name))
- HGOTO_DONE(i);
+ HGOTO_DONE((int)i)
}
break;
default:
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "operation not supported for this type");
- }
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "operation not supported for this type")
+ } /*lint !e788 All appropriate cases are covered */
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
/*-------------------------------------------------------------------------
* Function: H5T_sort_value
*
- * Purpose: Sorts the members of a compound data type by their offsets;
+ * Purpose: Sorts the members of a compound datatype by their offsets;
* sorts the members of an enum type by their values. This even
- * works for locked data types since it doesn't change the value
+ * works for locked datatypes since it doesn't change the value
* of the type. MAP is an optional parallel integer array which
* is also swapped along with members of DT.
*
@@ -305,15 +303,15 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5T_sort_value(H5T_t *dt, int *map)
+H5T_sort_value(const H5T_t *dt, int *map)
{
- int i, j, nmembs;
+ unsigned i, j, nmembs;
size_t size;
hbool_t swapped;
uint8_t tbuf[32];
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5T_sort_value, FAIL);
+ FUNC_ENTER_NOAPI(H5T_sort_value, FAIL)
/* Check args */
assert(dt);
@@ -393,15 +391,15 @@ H5T_sort_value(H5T_t *dt, int *map)
}
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
/*-------------------------------------------------------------------------
* Function: H5T_sort_name
*
- * Purpose: Sorts members of a compound or enumeration data type by their
- * names. This even works for locked data types since it doesn't
+ * Purpose: Sorts members of a compound or enumeration datatype by their
+ * names. This even works for locked datatypes since it doesn't
* change the value of the types.
*
* Return: Success: Non-negative
@@ -416,15 +414,15 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5T_sort_name(H5T_t *dt, int *map)
+H5T_sort_name(const H5T_t *dt, int *map)
{
- int i, j, nmembs;
+ unsigned i, j, nmembs;
size_t size;
hbool_t swapped;
uint8_t tbuf[32];
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5T_sort_name, FAIL);
+ FUNC_ENTER_NOAPI(H5T_sort_name, FAIL)
/* Check args */
assert(dt);
@@ -500,6 +498,6 @@ H5T_sort_name(H5T_t *dt, int *map)
}
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
diff --git a/src/H5Tfixed.c b/src/H5Tfixed.c
index 041c58f..99fc26a 100644
--- a/src/H5Tfixed.c
+++ b/src/H5Tfixed.c
@@ -19,18 +19,18 @@
#define H5T_PACKAGE /*suppress error about including H5Tpkg */
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5T_init_fixed_interface
+
+/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
+#define PABLO_MASK H5T_fixed_mask
+
#include "H5private.h" /*generic functions */
#include "H5Eprivate.h" /*error handling */
#include "H5Iprivate.h" /*ID functions */
#include "H5Tpkg.h" /*data-type functions */
-#define PABLO_MASK H5Tfixed_mask
-
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT H5T_init_fixed_interface
-static herr_t H5T_init_fixed_interface(void);
-
/*--------------------------------------------------------------------------
NAME
@@ -48,9 +48,9 @@ DESCRIPTION
static herr_t
H5T_init_fixed_interface(void)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_fixed_interface);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_fixed_interface)
- FUNC_LEAVE_NOAPI(H5T_init());
+ FUNC_LEAVE_NOAPI(H5T_init())
} /* H5T_init_fixed_interface() */
@@ -68,7 +68,7 @@ H5T_init_fixed_interface(void)
*
* Modifications:
* Robb Matzke, 22 Dec 1998
- * Also works with derived data types.
+ * Also works with derived datatypes.
*-------------------------------------------------------------------------
*/
H5T_sign_t
@@ -77,17 +77,17 @@ H5Tget_sign(hid_t type_id)
H5T_t *dt = NULL;
H5T_sign_t ret_value;
- FUNC_ENTER_API(H5Tget_sign, H5T_SGN_ERROR);
+ FUNC_ENTER_API(H5Tget_sign, H5T_SGN_ERROR)
H5TRACE1("Ts","i",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 data type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_SGN_ERROR, "not an integer datatype")
ret_value = H5T_get_sign(dt);
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -123,7 +123,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 data type class")
+ 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;
@@ -146,7 +146,7 @@ done:
*
* Modifications:
* Robb Matzke, 22 Dec 1998
- * Also works with derived data types.
+ * Also works with derived datatypes.
*
*-------------------------------------------------------------------------
*/
@@ -156,27 +156,27 @@ H5Tset_sign(hid_t type_id, H5T_sign_t sign)
H5T_t *dt = NULL;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_API(H5Tset_sign, FAIL);
+ FUNC_ENTER_API(H5Tset_sign, FAIL)
H5TRACE2("e","iTs",type_id,sign);
/* Check args */
if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an integer data type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an integer datatype")
if (H5T_STATE_TRANSIENT!=dt->shared->state)
- HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "data type is read-only");
- if (sign < 0 || sign >= H5T_NSGN)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "illegal sign type");
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "datatype is read-only")
+ if (sign < H5T_SGN_NONE || sign >= H5T_NSGN)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "illegal sign type")
if (H5T_ENUM==dt->shared->type && dt->shared->u.enumer.nmembs>0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not allowed after members are defined");
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not allowed after members are defined")
while (dt->shared->parent)
dt = dt->shared->parent; /*defer to parent*/
if (H5T_INTEGER!=dt->shared->type)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for data type class");
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for datatype class")
/* Commit */
dt->shared->u.atomic.u.i.sign = sign;
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
diff --git a/src/H5Tfloat.c b/src/H5Tfloat.c
index 7b7ac98..6be73da 100644
--- a/src/H5Tfloat.c
+++ b/src/H5Tfloat.c
@@ -19,18 +19,18 @@
#define H5T_PACKAGE /*suppress error about including H5Tpkg */
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5T_init_float_interface
+
+/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
+#define PABLO_MASK H5T_float_mask
+
#include "H5private.h" /*generic functions */
#include "H5Eprivate.h" /*error handling */
#include "H5Iprivate.h" /*ID functions */
#include "H5Tpkg.h" /*data-type functions */
-#define PABLO_MASK H5Tfloat_mask
-
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT H5T_init_float_interface
-static herr_t H5T_init_float_interface(void);
-
/*--------------------------------------------------------------------------
NAME
@@ -48,9 +48,9 @@ DESCRIPTION
static herr_t
H5T_init_float_interface(void)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_float_interface);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_float_interface)
- FUNC_LEAVE_NOAPI(H5T_init());
+ FUNC_LEAVE_NOAPI(H5T_init())
} /* H5T_init_float_interface() */
@@ -58,8 +58,8 @@ H5T_init_float_interface(void)
* Function: H5Tget_fields
*
* Purpose: Returns information about the locations of the various bit
- * fields of a floating point data type. The field positions
- * are bit positions in the significant region of the data type.
+ * fields of a floating point datatype. The field positions
+ * are bit positions in the significant region of the datatype.
* Bits are numbered with the least significant bit number zero.
*
* Any (or even all) of the arguments can be null pointers.
@@ -74,7 +74,7 @@ H5T_init_float_interface(void)
*
* Modifications:
* Robb Matzke, 22 Dec 1998
- * Also works with derived data types.
+ * Also works with derived datatypes.
*-------------------------------------------------------------------------
*/
herr_t
@@ -85,16 +85,16 @@ H5Tget_fields(hid_t type_id, size_t *spos/*out*/,
H5T_t *dt = NULL;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_API(H5Tget_fields, FAIL);
+ FUNC_ENTER_API(H5Tget_fields, FAIL)
H5TRACE6("e","ixxxxx",type_id,spos,epos,esize,mpos,msize);
/* Check args */
if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
while (dt->shared->parent)
dt = dt->shared->parent; /*defer to parent*/
if (H5T_FLOAT != dt->shared->type)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for data type class");
+ 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;
@@ -104,7 +104,7 @@ H5Tget_fields(hid_t type_id, size_t *spos/*out*/,
if (msize) *msize = dt->shared->u.atomic.u.f.msize;
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -113,7 +113,7 @@ done:
*
* Purpose: Sets the locations and sizes of the various floating point
* bit fields. The field positions are bit positions in the
- * significant region of the data type. Bits are numbered with
+ * significant region of the datatype. Bits are numbered with
* the least significant bit number zero.
*
* Fields are not allowed to extend beyond the number of bits of
@@ -126,7 +126,7 @@ done:
*
* Modifications:
* Robb Matzke, 22 Dec 1998
- * Also works for derived data types.
+ * Also works for derived datatypes.
*
*-------------------------------------------------------------------------
*/
@@ -137,33 +137,33 @@ H5Tset_fields(hid_t type_id, size_t spos, size_t epos, size_t esize,
H5T_t *dt = NULL;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_API(H5Tset_fields, FAIL);
+ FUNC_ENTER_API(H5Tset_fields, FAIL)
H5TRACE6("e","izzzzz",type_id,spos,epos,esize,mpos,msize);
/* Check args */
if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
if (H5T_STATE_TRANSIENT!=dt->shared->state)
- HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "data type is read-only");
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "datatype is read-only")
while (dt->shared->parent)
dt = dt->shared->parent; /*defer to parent*/
if (H5T_FLOAT != dt->shared->type)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for data type class");
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for datatype class")
if (epos + esize > dt->shared->u.atomic.prec)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "exponent bit field size/location is invalid");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "exponent bit field size/location is invalid")
if (mpos + msize > dt->shared->u.atomic.prec)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "mantissa bit field size/location is invalid");
+ 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");
+ 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");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "sign bit appears within exponent field")
if (spos >= mpos && spos < mpos + msize)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "sign bit appears within mantissa field");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "sign bit appears within mantissa field")
if ((mpos < epos && mpos + msize > epos) ||
(epos < mpos && epos + esize > mpos))
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "exponent and mantissa fields overlap");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "exponent and mantissa fields overlap")
/* Commit */
dt->shared->u.atomic.u.f.sign = spos;
@@ -173,7 +173,7 @@ H5Tset_fields(hid_t type_id, size_t spos, size_t epos, size_t esize,
dt->shared->u.atomic.u.f.msize = msize;
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -191,7 +191,7 @@ done:
*
* Modifications:
* Robb Matzke, 22 Dec 1998
- * Also works with derived data types.
+ * Also works with derived datatypes.
*-------------------------------------------------------------------------
*/
size_t
@@ -200,22 +200,22 @@ H5Tget_ebias(hid_t type_id)
H5T_t *dt = NULL;
size_t ret_value;
- FUNC_ENTER_API(H5Tget_ebias, 0);
+ FUNC_ENTER_API(H5Tget_ebias, 0)
H5TRACE1("z","i",type_id);
/* Check args */
if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a data type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a datatype")
while (dt->shared->parent)
dt = dt->shared->parent; /*defer to parent*/
if (H5T_FLOAT != dt->shared->type)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, 0, "operation not defined for data type class");
+ 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);
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -231,7 +231,7 @@ done:
*
* Modifications:
* Robb Matzke, 22 Dec 1998
- * Also works with derived data types.
+ * Also works with derived datatypes.
*
*-------------------------------------------------------------------------
*/
@@ -241,24 +241,24 @@ H5Tset_ebias(hid_t type_id, size_t ebias)
H5T_t *dt = NULL;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_API(H5Tset_ebias, FAIL);
+ FUNC_ENTER_API(H5Tset_ebias, FAIL)
H5TRACE2("e","iz",type_id,ebias);
/* Check args */
if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
if (H5T_STATE_TRANSIENT!=dt->shared->state)
- HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "data type is read-only");
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "datatype is read-only")
while (dt->shared->parent)
dt = dt->shared->parent; /*defer to parent*/
if (H5T_FLOAT != dt->shared->type)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for data type class");
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for datatype class")
/* Commit */
dt->shared->u.atomic.u.f.ebias = ebias;
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -277,7 +277,7 @@ done:
*
* Modifications:
* Robb Matzke, 22 Dec 1998
- * Also works with derived data types.
+ * Also works with derived datatypes.
*
*-------------------------------------------------------------------------
*/
@@ -287,22 +287,22 @@ H5Tget_norm(hid_t type_id)
H5T_t *dt = NULL;
H5T_norm_t ret_value;
- FUNC_ENTER_API(H5Tget_norm, H5T_NORM_ERROR);
+ FUNC_ENTER_API(H5Tget_norm, H5T_NORM_ERROR)
H5TRACE1("Tn","i",type_id);
/* Check args */
if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_NORM_ERROR, "not a data type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_NORM_ERROR, "not a datatype")
while (dt->shared->parent)
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 data type class");
+ 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;
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -310,7 +310,7 @@ done:
* Function: H5Tset_norm
*
* Purpose: Sets the mantissa normalization method for a floating point
- * data type.
+ * datatype.
*
* Return: Non-negative on success/Negative on failure
*
@@ -319,7 +319,7 @@ done:
*
* Modifications:
* Robb Matzke, 22 Dec 1998
- * Also works for derived data types.
+ * Also works for derived datatypes.
*
*-------------------------------------------------------------------------
*/
@@ -329,26 +329,26 @@ H5Tset_norm(hid_t type_id, H5T_norm_t norm)
H5T_t *dt = NULL;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_API(H5Tset_norm, FAIL);
+ FUNC_ENTER_API(H5Tset_norm, FAIL)
H5TRACE2("e","iTn",type_id,norm);
/* Check args */
if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
if (H5T_STATE_TRANSIENT!=dt->shared->state)
- HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "data type is read-only");
- if (norm < 0 || norm > H5T_NORM_NONE)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "illegal normalization");
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "datatype is read-only")
+ if (norm < H5T_NORM_IMPLIED || norm > H5T_NORM_NONE)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "illegal normalization")
while (dt->shared->parent)
dt = dt->shared->parent; /*defer to parent*/
if (H5T_FLOAT != dt->shared->type)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for data type class");
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for datatype class")
/* Commit */
dt->shared->u.atomic.u.f.norm = norm;
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -369,7 +369,7 @@ done:
*
* Modifications:
* Robb Matzke, 22 Dec 1998
- * Also works for derived data types.
+ * Also works for derived datatypes.
*
*-------------------------------------------------------------------------
*/
@@ -379,22 +379,22 @@ H5Tget_inpad(hid_t type_id)
H5T_t *dt = NULL;
H5T_pad_t ret_value;
- FUNC_ENTER_API(H5Tget_inpad, H5T_PAD_ERROR);
+ FUNC_ENTER_API(H5Tget_inpad, H5T_PAD_ERROR)
H5TRACE1("Tp","i",type_id);
/* Check args */
if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_PAD_ERROR, "not a data type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_PAD_ERROR, "not a datatype")
while (dt->shared->parent)
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 data type class");
+ 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;
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -413,7 +413,7 @@ done:
*
* Modifications:
* Robb Matzke, 22 Dec 1998
- * Also works for derived data types.
+ * Also works for derived datatypes.
*
*-------------------------------------------------------------------------
*/
@@ -423,25 +423,25 @@ H5Tset_inpad(hid_t type_id, H5T_pad_t pad)
H5T_t *dt = NULL;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_API(H5Tset_inpad, FAIL);
+ FUNC_ENTER_API(H5Tset_inpad, FAIL)
H5TRACE2("e","iTp",type_id,pad);
/* Check args */
if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
if (H5T_STATE_TRANSIENT!=dt->shared->state)
- HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "data type is read-only");
- if (pad < 0 || pad >= H5T_NPAD)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "illegal internal pad type");
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "datatype is read-only")
+ if (pad < H5T_PAD_ZERO || pad >= H5T_NPAD)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "illegal internal pad type")
while (dt->shared->parent)
dt = dt->shared->parent; /*defer to parent*/
if (H5T_FLOAT != dt->shared->type)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for data type class");
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for datatype class")
/* Commit */
dt->shared->u.atomic.u.f.pad = pad;
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
diff --git a/src/H5Tnative.c b/src/H5Tnative.c
index 992a2ab..291c41b 100644
--- a/src/H5Tnative.c
+++ b/src/H5Tnative.c
@@ -17,23 +17,21 @@
* a "native" datatype for the H5T interface.
*/
-#define H5T_PACKAGE /*suppress error about including H5Tpkg */
+#define H5T_PACKAGE /*suppress error about including H5Tpkg */
+
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5T_init_native_interface
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
-#define PABLO_MASK H5Tnative_mask
-
-#include "H5private.h" /*generic functions */
-#include "H5Eprivate.h" /*error handling */
-#include "H5Iprivate.h" /*ID functions */
-#include "H5Pprivate.h" /*property list */
-#include "H5MMprivate.h" /*memory management */
-#include "H5Tpkg.h" /*data-type functions */
+#define PABLO_MASK H5T_native_mask
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT H5T_init_native_interface
-static herr_t H5T_init_native_interface(void);
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Iprivate.h" /* IDs */
+#include "H5Pprivate.h" /* Property lists */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Tpkg.h" /* Datatypes */
/* Static local functions */
static H5T_t *H5T_get_native_type(H5T_t *dt, H5T_direction_t direction,
@@ -62,9 +60,9 @@ DESCRIPTION
static herr_t
H5T_init_native_interface(void)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_native_interface);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_native_interface)
- FUNC_LEAVE_NOAPI(H5T_init());
+ FUNC_LEAVE_NOAPI(H5T_init())
} /* H5T_init_native_interface() */
@@ -108,31 +106,32 @@ H5Tget_native_type(hid_t type_id, H5T_direction_t direction)
size_t comp_size=0; /* Compound datatype's size */
hid_t ret_value; /* Return value */
- FUNC_ENTER_API(H5Tget_native_type, FAIL);
+ FUNC_ENTER_API(H5Tget_native_type, FAIL)
H5TRACE2("i","iTd",type_id,direction);
/* check argument */
if(NULL==(dt=H5I_object_verify(type_id, H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type")
if(direction!=H5T_DIR_DEFAULT && direction!=H5T_DIR_ASCEND
&& direction!=H5T_DIR_DESCEND)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not valid direction value");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not valid direction value")
if((new_dt = H5T_get_native_type(dt, direction, NULL, NULL, &comp_size))==NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "cannot retrieve native type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "cannot retrieve native type")
if((ret_value=H5I_register(H5I_DATATYPE, new_dt)) < 0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register data type");
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTREGISTER, FAIL, "unable to register data type")
done:
/* Error cleanup */
if(ret_value<0) {
if(new_dt)
- H5T_close(new_dt);
+ if(H5T_close(new_dt)<0)
+ HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, FAIL, "unable to release datatype")
} /* end if */
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -148,7 +147,7 @@ done:
* Programmer: Raymond Lu
* Oct 3, 2002
*
- * Modifications:
+ * Modifications:
*
*-------------------------------------------------------------------------
*/
@@ -159,22 +158,23 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig
H5T_class_t h5_class; /* Class of datatype to make native */
size_t size; /* Size of datatype to make native */
size_t prec; /* Precision of datatype to make native */
- int nmemb; /* Number of members in compound & enum types */
+ int snmemb; /* Number of members in compound & enum types */
+ unsigned nmemb; /* Number of members in compound & enum types */
H5T_t *super_type; /* Super type of VL, array and enum datatypes */
H5T_t *nat_super_type; /* Native form of VL, array & enum super datatype */
H5T_t *new_type=NULL; /* New native datatype */
- int i; /* Local index variable */
+ unsigned i; /* Local index variable */
H5T_t *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5T_get_native_type, NULL);
+ FUNC_ENTER_NOAPI(H5T_get_native_type, NULL)
assert(dtype);
- if((h5_class = H5T_get_class(dtype))<0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a valid class");
+ if((h5_class = H5T_get_class(dtype))==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");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a valid size")
switch(h5_class) {
case H5T_INTEGER:
@@ -182,33 +182,33 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig
H5T_sign_t sign; /* Signedness of integer type */
if((sign = H5T_get_sign(dtype))==H5T_SGN_ERROR)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a valid signess");
+ 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");
+ 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");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot retrieve float type")
break;
case H5T_STRING:
if((ret_value=H5T_copy(dtype, H5T_COPY_TRANSIENT))==NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot retrieve float type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot retrieve float type")
if(H5T_IS_VL_STRING(dtype->shared)) {
/* 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");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset")
} 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");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset")
}
break;
@@ -236,11 +236,11 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig
int not_equal;
if((ret_value=H5T_copy(dtype, H5T_COPY_TRANSIENT))==NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot retrieve float type");
+ 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");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type")
not_equal = H5T_cmp(ret_value, dt);
/* Update size, offset and compound alignment for parent. */
@@ -253,7 +253,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig
}
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");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset")
}
break;
@@ -266,29 +266,30 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig
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((nmemb = H5T_get_nmembers(dtype))<=0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "compound data type doesn't have any member");
+ 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");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot allocate memory")
if((memb_offset = (size_t*)H5MM_calloc(nmemb*sizeof(size_t)))==NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot allocate memory");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot allocate memory")
if((comp_mname = (char**)H5MM_malloc(nmemb*sizeof(char*)))==NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot allocate memory");
+ 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. */
for(i=0; i<nmemb; i++) {
if((memb_type = H5T_get_member_type(dtype, i))==NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "member type retrieval failed");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "member type retrieval failed")
if((comp_mname[i] = H5T_get_member_name(dtype, i))==NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "member type retrieval failed");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "member type retrieval failed")
if((memb_list[i] = H5T_get_native_type(memb_type, direction, &children_st_align, &(memb_offset[i]), &children_size))==NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "member identifier retrieval failed");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "member identifier retrieval failed")
if(H5T_close(memb_type)<0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot close datatype");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot close datatype")
}
/* The alignment for whole compound type */
@@ -297,12 +298,12 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig
/* Construct new compound type based on native type */
if((new_type=H5T_create(H5T_COMPOUND, children_size))==NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot create a compound type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot create a compound type")
/* Insert members for the new compound type */
for(i=0; i<nmemb; i++) {
if(H5T_insert(new_type, comp_mname[i], memb_offset[i], memb_list[i])<0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot insert member to compound datatype");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot insert member to compound datatype")
}
/* Update size, offset and compound alignment for parent. */
@@ -315,7 +316,7 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig
/* Close member data type */
for(i=0; i<nmemb; i++) {
if(H5T_close(memb_list[i])<0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot close datatype");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot close datatype")
/* Free member names in list */
H5MM_xfree(comp_mname[i]);
@@ -340,40 +341,41 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig
/* Retrieve base type for enumarate type */
if((super_type=H5T_get_super(dtype))==NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to get base type for enumarate type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to get base type for enumarate type")
if((nat_super_type = H5T_get_native_type(super_type, direction, struct_align, offset, comp_size))==NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "base native type retrieval failed");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "base native type retrieval failed")
if((super_type_id=H5I_register(H5I_DATATYPE, super_type))<0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot register datatype");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot register datatype")
if((nat_super_type_id=H5I_register(H5I_DATATYPE, nat_super_type))<0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot register datatype");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot register datatype")
/* Allocate room for the enum values */
if((tmp_memb_value = H5MM_calloc(H5T_get_size(super_type)))==NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot allocate memory");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot allocate memory")
if((memb_value = H5MM_calloc(H5T_get_size(nat_super_type)))==NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot allocate memory");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot allocate memory")
/* Construct new enum type based on native type */
if((new_type=H5T_enum_create(nat_super_type))==NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to create enum type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to create enum type")
/* Retrieve member info and insert members into new enum type */
- if((nmemb = H5T_get_nmembers(dtype))<=0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "enumarate data type doesn't have any member");
+ if((snmemb = H5T_get_nmembers(dtype))<=0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "enumarate data type doesn't have any member")
+ H5_ASSIGN_OVERFLOW(nmemb,snmemb,int,unsigned);
for(i=0; i<nmemb; i++) {
if((memb_name=H5T_get_member_name(dtype, i))==NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot get member name");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot get member name")
if(H5T_get_member_value(dtype, i, tmp_memb_value)<0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot get member value");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot get member value")
HDmemcpy(memb_value, tmp_memb_value, H5T_get_size(super_type));
if(H5Tconvert(super_type_id, nat_super_type_id, 1, memb_value, NULL, H5P_DEFAULT)<0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot get member value");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot get member value")
if(H5T_enum_insert(new_type, memb_name, memb_value)<0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot insert member");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot insert member")
H5MM_xfree(memb_name);
}
H5MM_xfree(memb_value);
@@ -381,10 +383,10 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig
/* Close base type */
if(H5Tclose(nat_super_type_id)<0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot close datatype");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot close datatype")
/* Close super type */
if(H5Tclose(super_type_id)<0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot close datatype");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot close datatype")
ret_value = new_type;
}
@@ -392,7 +394,8 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig
case H5T_ARRAY:
{
- int array_rank; /* Array's rank */
+ int sarray_rank; /* Array's rank */
+ unsigned array_rank; /* Array's rank */
hsize_t *dims = NULL; /* Dimension sizes for array */
hsize_t nelems = 1;
size_t super_offset=0;
@@ -400,37 +403,38 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig
size_t super_align=0;
/* Retrieve dimension information for array data type */
- if((array_rank=H5T_get_array_ndims(dtype))<=0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot get dimension rank");
+ if((sarray_rank=H5T_get_array_ndims(dtype))<=0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot get dimension rank")
+ H5_ASSIGN_OVERFLOW(array_rank,sarray_rank,int,unsigned);
if((dims = (hsize_t*)H5MM_malloc(array_rank*sizeof(hsize_t)))==NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot allocate memory");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot allocate memory")
if(H5T_get_array_dims(dtype, dims, NULL)<0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot get dimension size");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot get dimension size")
/* Retrieve base type for array type */
if((super_type=H5T_get_super(dtype))==NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to get parent type for enumarate type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to get parent type for enumarate type")
if((nat_super_type = H5T_get_native_type(super_type, direction, &super_align,
&super_offset, &super_size))==NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "parent native type retrieval failed");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "parent native type retrieval failed")
/* Close super type */
if(H5T_close(super_type)<0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot close datatype");
+ HGOTO_ERROR(H5E_ARGS, H5E_CLOSEERROR, NULL, "cannot close datatype")
/* Create a new array type based on native type */
- if((new_type=H5T_array_create(nat_super_type, array_rank, dims, NULL))==NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to create array type");
+ if((new_type=H5T_array_create(nat_super_type, sarray_rank, dims, NULL))==NULL)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to create array type")
/* Close base type */
if(H5T_close(nat_super_type)<0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot close datatype");
+ HGOTO_ERROR(H5E_ARGS, H5E_CLOSEERROR, NULL, "cannot close datatype")
for(i=0; i<array_rank; i++)
nelems *= dims[i];
H5_CHECK_OVERFLOW(nelems,hsize_t,size_t);
if(H5T_cmp_offset(comp_size, offset, super_size, (size_t)nelems, super_align, struct_align)<0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset")
H5MM_xfree(dims);
ret_value = new_type;
@@ -445,47 +449,50 @@ H5T_get_native_type(H5T_t *dtype, H5T_direction_t direction, size_t *struct_alig
/* Retrieve base type for array type */
if((super_type=H5T_get_super(dtype))==NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to get parent type for enumarate type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to get parent type for enumarate type")
/* Don't need alignment, offset information if this VL isn't a field of compound type. If it
* is, go to a few steps below to compute the information directly. */
if((nat_super_type = H5T_get_native_type(super_type, direction, NULL, NULL, &super_size))==NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "parent native type retrieval failed");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "parent native type retrieval failed")
/* Close super type */
if(H5T_close(super_type)<0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot close datatype");
+ HGOTO_ERROR(H5E_ARGS, H5E_CLOSEERROR, NULL, "cannot close datatype")
/* Create a new array type based on native type */
if((new_type=H5T_vlen_create(nat_super_type))==NULL)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to create VL type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "unable to create VL type")
/* Close base type */
if(H5T_close(nat_super_type)<0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot close datatype");
+ HGOTO_ERROR(H5E_ARGS, H5E_CLOSEERROR, NULL, "cannot close datatype")
/* Update size, offset and compound alignment for parent compound type directly. */
vl_align = H5T_HVL_COMP_ALIGN_g;
vl_size = sizeof(hvl_t);
if(H5T_cmp_offset(comp_size, offset, vl_size, 1, vl_align, struct_align)<0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset")
ret_value = new_type;
}
break;
+ case H5T_NO_CLASS:
+ case H5T_NCLASSES:
default:
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "data type doesn't match any native type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "data type doesn't match any native type")
}
done:
/* Error cleanup */
if(ret_value==NULL) {
if(new_type)
- H5T_close(new_type);
+ if(H5T_close(new_type)<0)
+ HDONE_ERROR(H5E_DATATYPE, H5E_CLOSEERROR, NULL, "unable to release datatype")
} /* end if */
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -530,71 +537,70 @@ H5T_get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction,
FUNC_ENTER_NOAPI(H5T_get_native_integer, NULL);
- if(direction == H5T_DIR_DEFAULT || direction == H5T_DIR_ASCEND)
- {
- if(prec<=H5Tget_precision(H5T_NATIVE_SCHAR)) {
- match=H5T_NATIVE_INT_MATCH_CHAR;
- native_size = sizeof(char);
- } else if(prec<=H5Tget_precision(H5T_NATIVE_SHORT)) {
- match=H5T_NATIVE_INT_MATCH_SHORT;
- native_size = sizeof(short);
- } else if(prec<=H5Tget_precision(H5T_NATIVE_INT)) {
- match=H5T_NATIVE_INT_MATCH_INT;
- native_size = sizeof(int);
- } else if(prec<=H5Tget_precision(H5T_NATIVE_LONG)) {
- match=H5T_NATIVE_INT_MATCH_LONG;
- native_size = sizeof(long);
- } else if(prec<=H5Tget_precision(H5T_NATIVE_LLONG)) {
- match=H5T_NATIVE_INT_MATCH_LLONG;
- native_size = sizeof(long_long);
- } else { /* If no native type matches the querried datatype, simply choose the type of biggest size. */
- match=H5T_NATIVE_INT_MATCH_LLONG;
- native_size = sizeof(long_long);
- }
- } else if(direction == H5T_DIR_DESCEND) {
- if(prec>=H5Tget_precision(H5T_NATIVE_LLONG)) {
- match=H5T_NATIVE_INT_MATCH_LLONG;
- 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);
- } else {
- match=H5T_NATIVE_INT_MATCH_LLONG;
- 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);
- } else {
- match=H5T_NATIVE_INT_MATCH_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);
- } else {
- match=H5T_NATIVE_INT_MATCH_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);
- } else {
- match=H5T_NATIVE_INT_MATCH_SHORT;
- native_size = sizeof(short);
- }
- }
- else { /* If no native type matches the querried datatype, simple choose the type of smallest size. */
- match=H5T_NATIVE_INT_MATCH_CHAR;
- native_size = sizeof(char);
- }
+ if(direction == H5T_DIR_DEFAULT || direction == H5T_DIR_ASCEND) {
+ if(prec<=H5Tget_precision(H5T_NATIVE_SCHAR)) {
+ match=H5T_NATIVE_INT_MATCH_CHAR;
+ native_size = sizeof(char);
+ } else if(prec<=H5Tget_precision(H5T_NATIVE_SHORT)) {
+ match=H5T_NATIVE_INT_MATCH_SHORT;
+ native_size = sizeof(short);
+ } else if(prec<=H5Tget_precision(H5T_NATIVE_INT)) {
+ match=H5T_NATIVE_INT_MATCH_INT;
+ native_size = sizeof(int);
+ } else if(prec<=H5Tget_precision(H5T_NATIVE_LONG)) {
+ match=H5T_NATIVE_INT_MATCH_LONG;
+ native_size = sizeof(long);
+ } else if(prec<=H5Tget_precision(H5T_NATIVE_LLONG)) {
+ match=H5T_NATIVE_INT_MATCH_LLONG;
+ native_size = sizeof(long_long);
+ } else { /* If no native type matches the querried datatype, simply choose the type of biggest size. */
+ match=H5T_NATIVE_INT_MATCH_LLONG;
+ native_size = sizeof(long_long);
+ }
+ } else if(direction == H5T_DIR_DESCEND) {
+ if(prec>=H5Tget_precision(H5T_NATIVE_LLONG)) {
+ match=H5T_NATIVE_INT_MATCH_LLONG;
+ 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);
+ } else {
+ match=H5T_NATIVE_INT_MATCH_LLONG;
+ 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);
+ } else {
+ match=H5T_NATIVE_INT_MATCH_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);
+ } else {
+ match=H5T_NATIVE_INT_MATCH_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);
+ } else {
+ match=H5T_NATIVE_INT_MATCH_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);
+ }
}
/* Set the appropriate native datatype information */
@@ -643,25 +649,25 @@ H5T_get_native_integer(size_t prec, H5T_sign_t sign, H5T_direction_t direction,
align = H5T_NATIVE_LLONG_COMP_ALIGN_g;
break;
+ case H5T_NATIVE_INT_MATCH_UNKNOWN:
default:
- assert(0 && "Unknown native integer match!");
- break;
+ 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)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type");
+ 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 copy type");
+ 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");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset")
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -688,7 +694,7 @@ H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_alig
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 */
- size_t native_size=0; /* Datatype size of the native type */
+ size_t native_size=0; /* Datatype size of the native type */
enum match_type { /* The different kinds of floating point types we can match */
H5T_NATIVE_FLOAT_MATCH_FLOAT,
H5T_NATIVE_FLOAT_MATCH_DOUBLE,
@@ -697,50 +703,50 @@ H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_alig
} match=H5T_NATIVE_FLOAT_MATCH_UNKNOWN;
H5T_t *ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5T_get_native_float, NULL);
+ FUNC_ENTER_NOAPI(H5T_get_native_float, NULL)
assert(size>0);
if(direction == H5T_DIR_DEFAULT || direction == H5T_DIR_ASCEND) {
if(size<=sizeof(float)) {
match=H5T_NATIVE_FLOAT_MATCH_FLOAT;
- native_size = sizeof(float);
+ native_size = sizeof(float);
} else if(size<=sizeof(double)) {
match=H5T_NATIVE_FLOAT_MATCH_DOUBLE;
- native_size = sizeof(double);
+ native_size = sizeof(double);
} else if(size<=sizeof(long double)) {
match=H5T_NATIVE_FLOAT_MATCH_LDOUBLE;
- native_size = sizeof(long double);
+ native_size = sizeof(long double);
} else { /* If not match, return the biggest datatype */
match=H5T_NATIVE_FLOAT_MATCH_LDOUBLE;
- native_size = sizeof(long double);
- }
+ native_size = sizeof(long double);
+ }
} else {
if(size>=sizeof(long double)) {
match=H5T_NATIVE_FLOAT_MATCH_LDOUBLE;
- native_size = sizeof(long double);
+ native_size = sizeof(long double);
} else if(size>=sizeof(double)) {
if(size==sizeof(double)) {
match=H5T_NATIVE_FLOAT_MATCH_DOUBLE;
- native_size = sizeof(double);
+ native_size = sizeof(double);
} else {
match=H5T_NATIVE_FLOAT_MATCH_LDOUBLE;
- native_size = sizeof(long double);
- }
+ 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);
- }
+ native_size = sizeof(double);
+ }
}
else {
match=H5T_NATIVE_FLOAT_MATCH_FLOAT;
- native_size = sizeof(float);
- }
+ native_size = sizeof(float);
+ }
}
/* Set the appropriate native floating point information */
@@ -760,40 +766,40 @@ H5T_get_native_float(size_t size, H5T_direction_t direction, size_t *struct_alig
align = H5T_NATIVE_LDOUBLE_COMP_ALIGN_g;
break;
+ case H5T_NATIVE_FLOAT_MATCH_UNKNOWN:
default:
- assert(0 && "Unknown native floating-point match!");
- break;
+ 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");
+ 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");
+ 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");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "cannot compute compound offset")
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
/*-------------------------------------------------------------------------
- * Function: H5T_cmp_offset
+ * 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
+ * Programmer: Raymond Lu
+ * December 10, 2002
*
* Modifications:
*
@@ -805,7 +811,7 @@ H5T_cmp_offset(size_t *comp_size, size_t *offset, size_t elem_size,
{
herr_t ret_value = SUCCEED;
- FUNC_ENTER_NOAPI(H5T_cmp_offset, FAIL);
+ FUNC_ENTER_NOAPI(H5T_cmp_offset, FAIL)
if(offset && comp_size) {
if(align>1 && *comp_size%align) {
@@ -823,6 +829,6 @@ H5T_cmp_offset(size_t *comp_size, size_t *offset, size_t elem_size,
*struct_align = align;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
diff --git a/src/H5Toffset.c b/src/H5Toffset.c
index a3965ad..99046cf 100644
--- a/src/H5Toffset.c
+++ b/src/H5Toffset.c
@@ -19,20 +19,20 @@
#define H5T_PACKAGE /*suppress error about including H5Tpkg */
-#include "H5private.h" /*generic functions */
-#include "H5Eprivate.h" /*error handling */
-#include "H5Iprivate.h" /*ID functions */
-#include "H5Tpkg.h" /*data-type functions */
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5T_init_offset_interface
-#define PABLO_MASK H5Toffset_mask
+/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
+#define PABLO_MASK H5T_offset_mask
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT H5T_init_offset_interface
-static herr_t H5T_init_offset_interface(void);
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Iprivate.h" /* IDs */
+#include "H5Tpkg.h" /* Datatypes */
/* Static local functions */
-static herr_t H5T_set_offset(H5T_t *dt, size_t offset);
+static herr_t H5T_set_offset(const H5T_t *dt, size_t offset);
/*--------------------------------------------------------------------------
@@ -51,9 +51,9 @@ DESCRIPTION
static herr_t
H5T_init_offset_interface(void)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_offset_interface);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_offset_interface)
- FUNC_LEAVE_NOAPI(H5T_init());
+ FUNC_LEAVE_NOAPI(H5T_init())
} /* H5T_init_offset_interface() */
@@ -97,23 +97,22 @@ H5Tget_offset(hid_t type_id)
H5T_t *dt = NULL;
int ret_value;
- FUNC_ENTER_API(H5Tget_offset, -1);
+ FUNC_ENTER_API(H5Tget_offset, -1)
H5TRACE1("Is","i",type_id);
/* Check args */
if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an atomic data type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an atomic data type")
while (dt->shared->parent)
dt = dt->shared->parent; /*defer to parent*/
- if (H5T_COMPOUND==dt->shared->type || H5T_OPAQUE==dt->shared->type)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for specified data type");
+ if (!H5T_IS_ATOMIC(dt->shared))
+ HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for specified data type")
/* Offset */
- assert(H5T_IS_ATOMIC(dt->shared));
ret_value = (int)dt->shared->u.atomic.offset;
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -162,27 +161,27 @@ H5Tset_offset(hid_t type_id, size_t offset)
H5T_t *dt = NULL;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_API(H5Tset_offset, FAIL);
+ FUNC_ENTER_API(H5Tset_offset, FAIL)
H5TRACE2("e","iz",type_id,offset);
/* Check args */
if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an atomic data type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an atomic data type")
if (H5T_STATE_TRANSIENT!=dt->shared->state)
- HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "data type is read-only");
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "data type is read-only")
if (H5T_STRING == dt->shared->type && offset != 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "offset must be zero for this type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "offset must be zero for this type")
if (H5T_ENUM==dt->shared->type && dt->shared->u.enumer.nmembs>0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not allowed after members are defined");
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not allowed after members are defined")
if (H5T_COMPOUND==dt->shared->type || H5T_REFERENCE==dt->shared->type || H5T_OPAQUE==dt->shared->type)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for this datatype");
+ HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for this datatype")
/* Do the real work */
if (H5T_set_offset(dt, offset)<0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to set offset");
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to set offset")
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -226,11 +225,11 @@ done:
*-------------------------------------------------------------------------
*/
static herr_t
-H5T_set_offset(H5T_t *dt, size_t offset)
+H5T_set_offset(const H5T_t *dt, size_t offset)
{
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5T_set_offset, FAIL);
+ FUNC_ENTER_NOAPI(H5T_set_offset, FAIL)
/* Check args */
assert(dt);
@@ -242,7 +241,7 @@ H5T_set_offset(H5T_t *dt, size_t offset)
if (dt->shared->parent) {
if (H5T_set_offset(dt->shared->parent, offset)<0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to set offset for base type");
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to set offset for base type")
/* Adjust size of datatype appropriately */
if(dt->shared->type==H5T_ARRAY)
@@ -256,6 +255,6 @@ H5T_set_offset(H5T_t *dt, size_t offset)
}
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
diff --git a/src/H5Topaque.c b/src/H5Topaque.c
index d2a9df6..0bfed4b 100644
--- a/src/H5Topaque.c
+++ b/src/H5Topaque.c
@@ -19,18 +19,18 @@
#define H5T_PACKAGE /*suppress error about including H5Tpkg */
-#include "H5private.h" /*generic functions */
-#include "H5Eprivate.h" /*error handling */
-#include "H5Iprivate.h" /*ID functions */
-#include "H5MMprivate.h" /*memory management */
-#include "H5Tpkg.h" /*data-type functions */
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5T_init_opaque_interface
-#define PABLO_MASK H5Topaque_mask
+/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
+#define PABLO_MASK H5T_opaque_mask
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT H5T_init_opaque_interface
-static herr_t H5T_init_opaque_interface(void);
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Tpkg.h" /* Datatypes */
/*--------------------------------------------------------------------------
@@ -49,9 +49,9 @@ DESCRIPTION
static herr_t
H5T_init_opaque_interface(void)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_opaque_interface);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_opaque_interface)
- FUNC_LEAVE_NOAPI(H5T_init());
+ FUNC_LEAVE_NOAPI(H5T_init())
} /* H5T_init_opaque_interface() */
@@ -75,27 +75,27 @@ H5Tset_tag(hid_t type_id, const char *tag)
H5T_t *dt=NULL;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_API(H5Tset_tag, FAIL);
+ FUNC_ENTER_API(H5Tset_tag, FAIL)
H5TRACE2("e","is",type_id,tag);
/* Check args */
if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type")
if (H5T_STATE_TRANSIENT!=dt->shared->state)
- HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "data type is read-only");
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "data type is read-only")
while (dt->shared->parent)
dt = dt->shared->parent; /*defer to parent*/
if (H5T_OPAQUE!=dt->shared->type)
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an opaque data type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an opaque data type")
if (!tag)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no tag");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no tag")
/* Commit */
H5MM_xfree(dt->shared->u.opaque.tag);
dt->shared->u.opaque.tag = H5MM_strdup(tag);
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -120,21 +120,21 @@ H5Tget_tag(hid_t type_id)
H5T_t *dt=NULL;
char *ret_value;
- FUNC_ENTER_API(H5Tget_tag, NULL);
+ FUNC_ENTER_API(H5Tget_tag, NULL)
/* Check args */
if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, NULL, "not a data type")
while (dt->shared->parent)
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");
+ 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");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed")
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
diff --git a/src/H5Torder.c b/src/H5Torder.c
index 4bd1c9c..c43fc3c 100644
--- a/src/H5Torder.c
+++ b/src/H5Torder.c
@@ -19,17 +19,17 @@
#define H5T_PACKAGE /*suppress error about including H5Tpkg */
-#include "H5private.h" /*generic functions */
-#include "H5Eprivate.h" /*error handling */
-#include "H5Iprivate.h" /*ID functions */
-#include "H5Tpkg.h" /*data-type functions */
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5T_init_order_interface
-#define PABLO_MASK H5Torder_mask
+/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
+#define PABLO_MASK H5T_order_mask
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT H5T_init_order_interface
-static herr_t H5T_init_order_interface(void);
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Iprivate.h" /* IDs */
+#include "H5Tpkg.h" /* Datatypes */
/*--------------------------------------------------------------------------
@@ -48,9 +48,9 @@ DESCRIPTION
static herr_t
H5T_init_order_interface(void)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_order_interface);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_order_interface)
- FUNC_LEAVE_NOAPI(H5T_init());
+ FUNC_LEAVE_NOAPI(H5T_init())
} /* H5T_init_order_interface() */
@@ -78,23 +78,22 @@ H5Tget_order(hid_t type_id)
H5T_t *dt = NULL;
H5T_order_t ret_value;
- FUNC_ENTER_API(H5Tget_order, H5T_ORDER_ERROR);
+ FUNC_ENTER_API(H5Tget_order, H5T_ORDER_ERROR)
H5TRACE1("To","i",type_id);
/* Check args */
if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_ORDER_ERROR, "not a data type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_ORDER_ERROR, "not a data type")
while (dt->shared->parent)
dt = dt->shared->parent; /*defer to parent*/
- if (H5T_COMPOUND==dt->shared->type || H5T_OPAQUE==dt->shared->type)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5T_ORDER_ERROR, "operation not defined for specified data type");
+ if (!H5T_IS_ATOMIC(dt->shared))
+ HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, H5T_ORDER_ERROR, "operation not defined for specified data type")
/* Order */
- assert(H5T_IS_ATOMIC(dt->shared));
ret_value = dt->shared->u.atomic.order;
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -120,28 +119,27 @@ H5Tset_order(hid_t type_id, H5T_order_t order)
H5T_t *dt = NULL;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_API(H5Tset_order, FAIL);
+ FUNC_ENTER_API(H5Tset_order, FAIL)
H5TRACE2("e","iTo",type_id,order);
/* Check args */
if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type")
if (H5T_STATE_TRANSIENT!=dt->shared->state)
- HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "data type is read-only");
- if (order < 0 || order > H5T_ORDER_NONE)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "illegal byte order");
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "data type is read-only")
+ if (order < H5T_ORDER_LE || order > H5T_ORDER_NONE)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "illegal byte order")
if (H5T_ENUM==dt->shared->type && dt->shared->u.enumer.nmembs>0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not allowed after members are defined");
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not allowed after members are defined")
while (dt->shared->parent)
dt = dt->shared->parent; /*defer to parent*/
- if (H5T_COMPOUND==dt->shared->type || H5T_OPAQUE==dt->shared->type)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5T_ORDER_ERROR, "operation not defined for specified data type");
+ if (!H5T_IS_ATOMIC(dt->shared))
+ HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for specified data type")
/* Commit */
- assert(H5T_IS_ATOMIC(dt->shared));
dt->shared->u.atomic.order = order;
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
diff --git a/src/H5Tpad.c b/src/H5Tpad.c
index 4c84c7e4..254831e 100644
--- a/src/H5Tpad.c
+++ b/src/H5Tpad.c
@@ -19,17 +19,17 @@
#define H5T_PACKAGE /*suppress error about including H5Tpkg */
-#include "H5private.h" /*generic functions */
-#include "H5Eprivate.h" /*error handling */
-#include "H5Iprivate.h" /*ID functions */
-#include "H5Tpkg.h" /*data-type functions */
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5T_init_pad_interface
-#define PABLO_MASK H5Tpad_mask
+/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
+#define PABLO_MASK H5T_pad_mask
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT H5T_init_pad_interface
-static herr_t H5T_init_pad_interface(void);
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Iprivate.h" /* IDs */
+#include "H5Tpkg.h" /* Datatypes */
/*--------------------------------------------------------------------------
@@ -48,9 +48,9 @@ DESCRIPTION
static herr_t
H5T_init_pad_interface(void)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_pad_interface);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_pad_interface)
- FUNC_LEAVE_NOAPI(H5T_init());
+ FUNC_LEAVE_NOAPI(H5T_init())
} /* H5T_init_pad_interface() */
@@ -78,26 +78,25 @@ H5Tget_pad(hid_t type_id, H5T_pad_t *lsb/*out*/, H5T_pad_t *msb/*out*/)
H5T_t *dt = NULL;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_API(H5Tget_pad, FAIL);
+ FUNC_ENTER_API(H5Tget_pad, FAIL)
H5TRACE3("e","ixx",type_id,lsb,msb);
/* Check args */
if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type")
while (dt->shared->parent)
dt = dt->shared->parent; /*defer to parent*/
- if (H5T_COMPOUND==dt->shared->type || H5T_OPAQUE==dt->shared->type)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for specified data type");
+ if (!H5T_IS_ATOMIC(dt->shared))
+ HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for specified data type")
/* Get values */
- assert(H5T_IS_ATOMIC(dt->shared));
if (lsb)
*lsb = dt->shared->u.atomic.lsb_pad;
if (msb)
*msb = dt->shared->u.atomic.msb_pad;
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -123,29 +122,28 @@ H5Tset_pad(hid_t type_id, H5T_pad_t lsb, H5T_pad_t msb)
H5T_t *dt = NULL;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_API(H5Tset_pad, FAIL);
+ FUNC_ENTER_API(H5Tset_pad, FAIL)
H5TRACE3("e","iTpTp",type_id,lsb,msb);
/* Check args */
if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type")
if (H5T_STATE_TRANSIENT!=dt->shared->state)
- HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "data type is read-only");
- if (lsb < 0 || lsb >= H5T_NPAD || msb < 0 || msb >= H5T_NPAD)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid pad type");
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "data type is read-only")
+ if (lsb < H5T_PAD_ZERO || lsb >= H5T_NPAD || msb < H5T_PAD_ZERO || msb >= H5T_NPAD)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid pad type")
if (H5T_ENUM==dt->shared->type && dt->shared->u.enumer.nmembs>0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not allowed after members are defined");
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not allowed after members are defined")
while (dt->shared->parent)
dt = dt->shared->parent; /*defer to parent*/
- if (H5T_COMPOUND==dt->shared->type || H5T_OPAQUE==dt->shared->type)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for specified data type");
+ if (!H5T_IS_ATOMIC(dt->shared))
+ HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for specified data type")
/* Commit */
- assert(H5T_IS_ATOMIC(dt->shared));
dt->shared->u.atomic.lsb_pad = lsb;
dt->shared->u.atomic.msb_pad = msb;
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
diff --git a/src/H5Tpkg.h b/src/H5Tpkg.h
index 58fabca..6daef4f 100644
--- a/src/H5Tpkg.h
+++ b/src/H5Tpkg.h
@@ -38,9 +38,10 @@
#include "H5Tprivate.h"
/* Other private headers needed by this file */
-#include "H5Dprivate.h" /* Datasets */
#include "H5Fprivate.h" /* Files */
-#include "H5HGprivate.h" /* Global heaps */
+
+/* Other public headers needed by this file */
+#include "H5Spublic.h" /* Dataspace functions */
/* Number of reserved IDs in ID group */
#define H5T_RESERVED_ATOMS 8
@@ -124,8 +125,8 @@ typedef enum H5T_sort_t {
/* A compound datatype */
typedef struct H5T_compnd_t {
- int nalloc; /*num entries allocated in MEMB array*/
- int nmembs; /*number of members defined in struct*/
+ unsigned nalloc; /*num entries allocated in MEMB array*/
+ unsigned nmembs; /*number of members defined in struct*/
H5T_sort_t sorted; /*how are members sorted? */
hbool_t packed; /*are members packed together? */
struct H5T_cmemb_t *memb; /*array of struct members */
@@ -133,17 +134,17 @@ typedef struct H5T_compnd_t {
/* An enumeration datatype */
typedef struct H5T_enum_t {
- int nalloc; /*num entries allocated */
- int nmembs; /*number of members defined in enum */
+ unsigned nalloc; /*num entries allocated */
+ unsigned nmembs; /*number of members defined in enum */
H5T_sort_t sorted; /*how are members sorted? */
uint8_t *value; /*array of values */
char **name; /*array of symbol names */
} H5T_enum_t;
/* VL function pointers */
-typedef ssize_t (*H5T_vlen_getlenfunc_t)(void *vl_addr);
+typedef ssize_t (*H5T_vlen_getlenfunc_t)(const void *vl_addr);
typedef void * (*H5T_vlen_getptrfunc_t)(void *vl_addr);
-typedef htri_t (*H5T_vlen_isnullfunc_t)(H5F_t *f, void *vl_addr);
+typedef htri_t (*H5T_vlen_isnullfunc_t)(const H5F_t *f, void *vl_addr);
typedef herr_t (*H5T_vlen_readfunc_t)(H5F_t *f, hid_t dxpl_id, void *_vl, void *buf, size_t len);
typedef herr_t (*H5T_vlen_writefunc_t)(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *buf, void *_bg, size_t seq_len, size_t base_size);
typedef herr_t (*H5T_vlen_setnullfunc_t)(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg);
@@ -242,6 +243,9 @@ typedef enum H5T_sdir_t {
/* The overflow handler */
H5_DLLVAR H5T_overflow_t H5T_overflow_g;
+/* The native endianess of the platform */
+H5_DLLVAR H5T_order_t H5T_native_order_g;
+
/*
* Alignment information for native types. A value of N indicates that the
* data must be aligned on an address ADDR such that 0 == ADDR mod N. When
@@ -320,22 +324,21 @@ H5_DLLVAR double H5T_NATIVE_DOUBLE_POS_INF_g;
H5_DLLVAR double H5T_NATIVE_DOUBLE_NEG_INF_g;
/* Common functions */
-H5_DLL herr_t H5T_init_interface(void);
H5_DLL H5T_t *H5T_create(H5T_class_t type, size_t size);
H5_DLL herr_t H5T_free(H5T_t *dt);
H5_DLL H5T_sign_t H5T_get_sign(H5T_t const *dt);
H5_DLL H5T_t *H5T_get_super(H5T_t *dt);
-H5_DLL char *H5T_get_member_name(H5T_t const *dt, int membno);
-H5_DLL herr_t H5T_get_member_value(const H5T_t *dt, int membno, void *value);
+H5_DLL char *H5T_get_member_name(H5T_t const *dt, unsigned membno);
+H5_DLL herr_t H5T_get_member_value(const H5T_t *dt, unsigned membno, void *value);
H5_DLL int H5T_get_nmembers(const H5T_t *dt);
-H5_DLL herr_t H5T_insert(H5T_t *parent, const char *name, size_t offset,
+H5_DLL herr_t H5T_insert(const H5T_t *parent, const char *name, size_t offset,
const H5T_t *member);
H5_DLL H5T_t *H5T_enum_create(const H5T_t *parent);
-H5_DLL herr_t H5T_enum_insert(H5T_t *dt, const char *name, const void *value);
+H5_DLL herr_t H5T_enum_insert(const H5T_t *dt, const char *name, const void *value);
H5_DLL int H5T_get_array_ndims(H5T_t *dt);
H5_DLL int H5T_get_array_dims(H5T_t *dt, hsize_t dims[], int perm[]);
-H5_DLL herr_t H5T_sort_value(H5T_t *dt, int *map);
-H5_DLL herr_t H5T_sort_name(H5T_t *dt, int *map);
+H5_DLL herr_t H5T_sort_value(const H5T_t *dt, int *map);
+H5_DLL herr_t H5T_sort_name(const H5T_t *dt, int *map);
H5_DLL herr_t H5T_set_size(H5T_t *dt, size_t size);
/* Conversion functions */
@@ -882,9 +885,9 @@ H5_DLL H5T_t * H5T_array_create(H5T_t *base, int ndims,
const hsize_t dim[/* ndims */], const int perm[/* ndims */]);
/* Compound functions */
-H5_DLL H5T_t *H5T_get_member_type(const H5T_t *dt, int membno);
-H5_DLL size_t H5T_get_member_offset(const H5T_t *dt, int membno);
-H5_DLL size_t H5T_get_member_size(H5T_t *dt, unsigned membno);
+H5_DLL H5T_t *H5T_get_member_type(const H5T_t *dt, unsigned membno);
+H5_DLL size_t H5T_get_member_offset(const H5T_t *dt, unsigned membno);
+H5_DLL size_t H5T_get_member_size(const H5T_t *dt, unsigned membno);
H5_DLL htri_t H5T_is_packed(const H5T_t *dt);
#endif
diff --git a/src/H5Tprecis.c b/src/H5Tprecis.c
index 33a71e0..9728172 100644
--- a/src/H5Tprecis.c
+++ b/src/H5Tprecis.c
@@ -19,20 +19,20 @@
#define H5T_PACKAGE /*suppress error about including H5Tpkg */
-#include "H5private.h" /*generic functions */
-#include "H5Eprivate.h" /*error handling */
-#include "H5Iprivate.h" /*ID functions */
-#include "H5Tpkg.h" /*data-type functions */
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5T_init_precis_interface
-#define PABLO_MASK H5Tprecis_mask
+/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
+#define PABLO_MASK H5T_precis_mask
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT H5T_init_precis_interface
-static herr_t H5T_init_precis_interface(void);
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Iprivate.h" /* IDs */
+#include "H5Tpkg.h" /* Datatypes */
/* Static local functions */
-static herr_t H5T_set_precision(H5T_t *dt, size_t prec);
+static herr_t H5T_set_precision(const H5T_t *dt, size_t prec);
/*--------------------------------------------------------------------------
@@ -51,16 +51,16 @@ DESCRIPTION
static herr_t
H5T_init_precis_interface(void)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_precis_interface);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_precis_interface)
- FUNC_LEAVE_NOAPI(H5T_init());
+ FUNC_LEAVE_NOAPI(H5T_init())
} /* H5T_init_precis_interface() */
/*-------------------------------------------------------------------------
* Function: H5Tget_precision
*
- * Purpose: Gets the precision of a data type. The precision is
+ * Purpose: Gets the precision of a datatype. The precision is
* the number of significant bits which, unless padding is
* present, is 8 times larger than the value returned by
* H5Tget_size().
@@ -75,7 +75,7 @@ H5T_init_precis_interface(void)
*
* Modifications:
* Robb Matzke, 22 Dec 1998
- * Also works for derived data types.
+ * Also works for derived datatypes.
*
*-------------------------------------------------------------------------
*/
@@ -85,37 +85,36 @@ H5Tget_precision(hid_t type_id)
H5T_t *dt = NULL;
size_t ret_value;
- FUNC_ENTER_API(H5Tget_precision, 0);
+ FUNC_ENTER_API(H5Tget_precision, 0)
H5TRACE1("z","i",type_id);
/* Check args */
if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a data type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not a datatype")
while (dt->shared->parent)
dt = dt->shared->parent; /*defer to parent*/
- if (H5T_COMPOUND==dt->shared->type || H5T_OPAQUE==dt->shared->type)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, 0, "operation not defined for specified data type");
+ if (!H5T_IS_ATOMIC(dt->shared))
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, 0, "operation not defined for specified datatype")
/* Precision */
- assert(H5T_IS_ATOMIC(dt->shared));
ret_value = dt->shared->u.atomic.prec;
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
/*-------------------------------------------------------------------------
* Function: H5Tset_precision
*
- * Purpose: Sets the precision of a data type. The precision is
+ * Purpose: Sets the precision of a datatype. The precision is
* the number of significant bits which, unless padding is
* present, is 8 times larger than the value returned by
* H5Tget_size().
*
* If the precision is increased then the offset is decreased
* and then the size is increased to insure that significant
- * bits do not "hang over" the edge of the data type.
+ * bits do not "hang over" the edge of the datatype.
*
* The precision property of strings is read-only.
*
@@ -140,43 +139,43 @@ H5Tset_precision(hid_t type_id, size_t prec)
H5T_t *dt = NULL;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_API(H5Tset_precision, FAIL);
+ FUNC_ENTER_API(H5Tset_precision, FAIL)
H5TRACE2("e","iz",type_id,prec);
/* Check args */
if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
if (H5T_STATE_TRANSIENT!=dt->shared->state)
- HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "data type is read-only");
- if (prec <= 0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "precision must be positive");
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTSET, FAIL, "datatype is read-only")
+ if (prec == 0)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "precision must be positive")
if (H5T_ENUM==dt->shared->type && dt->shared->u.enumer.nmembs>0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not allowed after members are defined");
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "operation not allowed after members are defined")
if (H5T_STRING==dt->shared->type)
- HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "precision for this type is read-only");
+ HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "precision for this type is read-only")
if (H5T_COMPOUND==dt->shared->type || H5T_OPAQUE==dt->shared->type)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for specified data type");
+ HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for specified datatype")
/* Do the work */
if (H5T_set_precision(dt, prec)<0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to set precision");
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "unable to set precision")
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
/*-------------------------------------------------------------------------
* Function: H5T_set_precision
*
- * Purpose: Sets the precision of a data type. The precision is
+ * Purpose: Sets the precision of a datatype. The precision is
* the number of significant bits which, unless padding is
* present, is 8 times larger than the value returned by
* H5Tget_size().
*
* If the precision is increased then the offset is decreased
* and then the size is increased to insure that significant
- * bits do not "hang over" the edge of the data type.
+ * bits do not "hang over" the edge of the datatype.
*
* The precision property of strings is read-only.
*
@@ -191,17 +190,17 @@ done:
*
* Modifications:
* Robb Matzke, 22 Dec 1998
- * Also works for derived data types.
+ * Also works for derived datatypes.
*
*-------------------------------------------------------------------------
*/
static herr_t
-H5T_set_precision(H5T_t *dt, size_t prec)
+H5T_set_precision(const H5T_t *dt, size_t prec)
{
size_t offset, size;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5T_set_precision, FAIL);
+ FUNC_ENTER_NOAPI(H5T_set_precision, FAIL)
/* Check args */
assert(dt);
@@ -213,7 +212,7 @@ H5T_set_precision(H5T_t *dt, size_t prec)
if (dt->shared->parent) {
if (H5T_set_precision(dt->shared->parent, prec)<0)
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "unable to set precision for base type");
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTSET, FAIL, "unable to set precision for base type")
/* Adjust size of datatype appropriately */
if(dt->shared->type==H5T_ARRAY)
@@ -221,7 +220,7 @@ H5T_set_precision(H5T_t *dt, size_t prec)
else if(dt->shared->type!=H5T_VLEN)
dt->shared->size = dt->shared->parent->shared->size;
} else {
- if (H5T_IS_ATOMIC(dt->shared)) {
+ if (H5T_IS_ATOMIC(dt->shared)) {
/* Adjust the offset and size */
offset = dt->shared->u.atomic.offset;
size = dt->shared->size;
@@ -247,28 +246,25 @@ H5T_set_precision(H5T_t *dt, size_t prec)
* type.
*/
if (dt->shared->u.atomic.u.f.sign >= prec ||
- dt->shared->u.atomic.u.f.epos + dt->shared->u.atomic.u.f.esize > prec ||
- dt->shared->u.atomic.u.f.mpos + dt->shared->u.atomic.u.f.msize > prec) {
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "adjust sign, mantissa, and exponent fields first");
- }
+ dt->shared->u.atomic.u.f.epos + dt->shared->u.atomic.u.f.esize > prec ||
+ dt->shared->u.atomic.u.f.mpos + dt->shared->u.atomic.u.f.msize > prec)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "adjust sign, mantissa, and exponent fields first")
break;
default:
- assert("not implemented yet" && 0);
- }
+ HGOTO_ERROR(H5E_ARGS, H5E_UNSUPPORTED, FAIL, "operation not defined for datatype class")
+ } /* end switch */ /*lint !e788 All appropriate cases are covered */
/* Commit */
dt->shared->size = size;
- if (H5T_IS_ATOMIC(dt->shared)) {
- dt->shared->u.atomic.offset = offset;
- dt->shared->u.atomic.prec = prec;
- }
- }
+ dt->shared->u.atomic.offset = offset;
+ dt->shared->u.atomic.prec = prec;
+ } /* end if */
else
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for specified datatype");
- }
+ HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for specified datatype")
+ } /* end else */
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
diff --git a/src/H5Tprivate.h b/src/H5Tprivate.h
index 8b279e7..52b7d3b 100644
--- a/src/H5Tprivate.h
+++ b/src/H5Tprivate.h
@@ -81,11 +81,11 @@ H5_DLL H5T_bkg_t H5T_path_bkg(const H5T_path_t *p);
H5_DLL herr_t H5T_convert(H5T_path_t *tpath, hid_t src_id, hid_t dst_id,
size_t nelmts, size_t buf_stride, size_t bkg_stride,
void *buf, void *bkg, hid_t dset_xfer_plist);
-H5_DLL herr_t H5T_vlen_reclaim(void *elem, hid_t type_id, hsize_t ndim, hssize_t *point, void *_op_data);
+H5_DLL herr_t H5T_vlen_reclaim(void *elem, hid_t type_id, unsigned ndim, const hsize_t *point, void *_op_data);
H5_DLL herr_t H5T_vlen_get_alloc_info(hid_t dxpl_id, H5T_vlen_alloc_info_t **vl_alloc_info);
H5_DLL htri_t H5T_vlen_mark(H5T_t *dt, H5F_t *f, H5T_vlen_loc_t loc);
H5_DLL htri_t H5T_is_sensible(const H5T_t *dt);
-H5_DLL htri_t H5T_committed(H5T_t *type);
+H5_DLL htri_t H5T_committed(const H5T_t *type);
H5_DLL int H5T_link(const H5T_t *type, int adjust, hid_t dxpl_id);
/* Reference specific functions */
diff --git a/src/H5Tpublic.h b/src/H5Tpublic.h
index 83c118b..0212fd8 100644
--- a/src/H5Tpublic.h
+++ b/src/H5Tpublic.h
@@ -94,7 +94,7 @@ typedef enum H5T_cset_t {
H5T_CSET_RESERVED_14 = 14, /*reserved for later use */
H5T_CSET_RESERVED_15 = 15 /*reserved for later use */
} H5T_cset_t;
-#define H5T_NCSET 1 /*Number of character sets actually defined */
+#define H5T_NCSET H5T_CSET_RESERVED_1 /*Number of character sets actually defined */
/*
* Type of padding to use in character strings. Do not change these values
@@ -119,7 +119,7 @@ typedef enum H5T_str_t {
H5T_STR_RESERVED_14 = 14, /*reserved for later use */
H5T_STR_RESERVED_15 = 15 /*reserved for later use */
} H5T_str_t;
-#define H5T_NSTR 3 /*num H5T_str_t types actually defined */
+#define H5T_NSTR H5T_STR_RESERVED_3 /*num H5T_str_t types actually defined */
/* Type of padding to use in other atomic types */
typedef enum H5T_pad_t {
@@ -199,13 +199,13 @@ typedef herr_t (*H5T_overflow_t)(hid_t src_id, hid_t dst_id,
void *src_buf, void *dst_buf);
-/* When this header is included from H5Tprivate.h, don't make calls to H5open() */
+/* When this header is included from a private header, don't make calls to H5open() */
#undef H5OPEN
-#ifndef _H5Tprivate_H
+#ifndef _H5private_H
#define H5OPEN H5open(),
-#else /* _H5Tprivate_H */
+#else /* _H5private_H */
#define H5OPEN
-#endif /* _H5Tprivate_H */
+#endif /* _H5private_H */
/*
* The IEEE floating point types in various byte orders.
@@ -523,12 +523,12 @@ H5_DLL H5T_norm_t H5Tget_norm(hid_t type_id);
H5_DLL H5T_pad_t H5Tget_inpad(hid_t type_id);
H5_DLL H5T_str_t H5Tget_strpad(hid_t type_id);
H5_DLL int H5Tget_nmembers(hid_t type_id);
-H5_DLL char *H5Tget_member_name(hid_t type_id, int membno);
+H5_DLL char *H5Tget_member_name(hid_t type_id, unsigned membno);
H5_DLL int H5Tget_member_index(hid_t type_id, const char *name);
-H5_DLL size_t H5Tget_member_offset(hid_t type_id, int membno);
-H5_DLL H5T_class_t H5Tget_member_class(hid_t type_id, int membno);
-H5_DLL hid_t H5Tget_member_type(hid_t type_id, int membno);
-H5_DLL herr_t H5Tget_member_value(hid_t type_id, int membno, void *value/*out*/);
+H5_DLL size_t H5Tget_member_offset(hid_t type_id, unsigned membno);
+H5_DLL H5T_class_t H5Tget_member_class(hid_t type_id, unsigned membno);
+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);
diff --git a/src/H5Tstrpad.c b/src/H5Tstrpad.c
index 275f5c3..c79b60d 100644
--- a/src/H5Tstrpad.c
+++ b/src/H5Tstrpad.c
@@ -19,17 +19,17 @@
#define H5T_PACKAGE /*suppress error about including H5Tpkg */
-#include "H5private.h" /*generic functions */
-#include "H5Eprivate.h" /*error handling */
-#include "H5Iprivate.h" /*ID functions */
-#include "H5Tpkg.h" /*data-type functions */
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5T_init_strpad_interface
-#define PABLO_MASK H5Tstrpad_mask
+/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
+#define PABLO_MASK H5T_strpad_mask
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT H5T_init_strpad_interface
-static herr_t H5T_init_strpad_interface(void);
+#include "H5private.h" /* Generic Functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5Iprivate.h" /* IDs */
+#include "H5Tpkg.h" /* Datatypes */
/*--------------------------------------------------------------------------
@@ -48,9 +48,9 @@ DESCRIPTION
static herr_t
H5T_init_strpad_interface(void)
{
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_strpad_interface);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_init_strpad_interface)
- FUNC_LEAVE_NOAPI(H5T_init());
+ FUNC_LEAVE_NOAPI(H5T_init())
} /* H5T_init_strpad_interface() */
@@ -71,7 +71,7 @@ H5T_init_strpad_interface(void)
*
* Modifications:
* Robb Matzke, 22 Dec 1998
- * Also works for derived data types.
+ * Also works for derived datatypes.
*
*-------------------------------------------------------------------------
*/
@@ -81,27 +81,25 @@ H5Tget_strpad(hid_t type_id)
H5T_t *dt = NULL;
H5T_str_t ret_value;
- FUNC_ENTER_API(H5Tget_strpad, H5T_STR_ERROR);
+ FUNC_ENTER_API(H5Tget_strpad, H5T_STR_ERROR)
H5TRACE1("Tz","i",type_id);
/* Check args */
if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_STR_ERROR, "not a data type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5T_STR_ERROR, "not a datatype")
while (dt->shared->parent && !H5T_IS_STRING(dt->shared))
dt = dt->shared->parent; /*defer to parent*/
if (!H5T_IS_STRING(dt->shared))
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, H5T_STR_ERROR, "operation not defined for data type class");
+ HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, H5T_STR_ERROR, "operation not defined for datatype class")
/* result */
- if(H5T_STRING == dt->shared->type)
+ if(H5T_IS_FIXED_STRING(dt->shared))
ret_value = dt->shared->u.atomic.u.s.pad;
- else if(H5T_VLEN == dt->shared->type && H5T_VLEN_STRING == dt->shared->u.vlen.type)
- ret_value = dt->shared->u.vlen.pad;
else
- HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, H5T_STR_ERROR, "can't get strpad info");
+ ret_value = dt->shared->u.vlen.pad;
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
@@ -130,7 +128,7 @@ done:
*
* Modifications:
* Robb Matzke, 22 Dec 1998
- * Also works for derived data types.
+ * Also works for derived datatypes.
*
*-------------------------------------------------------------------------
*/
@@ -140,30 +138,28 @@ H5Tset_strpad(hid_t type_id, H5T_str_t strpad)
H5T_t *dt = NULL;
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_API(H5Tset_strpad, FAIL);
+ FUNC_ENTER_API(H5Tset_strpad, FAIL)
H5TRACE2("e","iTz",type_id,strpad);
/* Check args */
if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a data type");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
if (H5T_STATE_TRANSIENT!=dt->shared->state)
- HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "data type is read-only");
- if (strpad < 0 || strpad >= H5T_NSTR)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "illegal string pad type");
+ HGOTO_ERROR(H5E_ARGS, H5E_CANTINIT, FAIL, "datatype is read-only")
+ if (strpad < H5T_STR_NULLTERM || strpad >= H5T_NSTR)
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "illegal string pad type")
while (dt->shared->parent && !H5T_IS_STRING(dt->shared))
dt = dt->shared->parent; /*defer to parent*/
if (!H5T_IS_STRING(dt->shared))
- HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not defined for data type class");
+ HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for datatype class")
/* Commit */
- if(H5T_STRING == dt->shared->type)
+ if(H5T_IS_FIXED_STRING(dt->shared))
dt->shared->u.atomic.u.s.pad = strpad;
- else if(H5T_VLEN == dt->shared->type && H5T_VLEN_STRING == dt->shared->u.vlen.type)
- dt->shared->u.vlen.pad = strpad;
else
- HGOTO_ERROR(H5E_DATATYPE, H5E_BADVALUE, H5T_STR_ERROR, "can't set strpad info");
+ dt->shared->u.vlen.pad = strpad;
done:
- FUNC_LEAVE_API(ret_value);
+ FUNC_LEAVE_API(ret_value)
}
diff --git a/src/H5Tvlen.c b/src/H5Tvlen.c
index 643f36d..b20b0b3 100644
--- a/src/H5Tvlen.c
+++ b/src/H5Tvlen.c
@@ -19,42 +19,41 @@
#define H5T_PACKAGE /*suppress error about including H5Tpkg */
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5T_init_vlen_interface
+
/* Pablo information */
/* (Put before include files to avoid problems with inline functions) */
-#define PABLO_MASK H5Tvlen_mask
+#define PABLO_MASK H5T_vlen_mask
#include "H5private.h" /* Generic Functions */
-#include "H5Eprivate.h" /* Errors */
-#include "H5FLprivate.h" /* Free Lists */
-#include "H5HGprivate.h" /* Global Heaps */
-#include "H5Iprivate.h" /* IDs */
-#include "H5MMprivate.h" /* Memory Allocation */
-#include "H5Pprivate.h" /* Property Lists */
-#include "H5Tpkg.h" /* Datatypes */
-
-/* Interface initialization */
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT H5T_init_vlen_interface
-static herr_t H5T_init_vlen_interface(void);
+#include "H5Dprivate.h" /* Dataset functions */
+#include "H5Eprivate.h" /* Error handling */
+#include "H5FLprivate.h" /* Free Lists */
+#include "H5HGprivate.h" /* Global Heaps */
+#include "H5Iprivate.h" /* IDs */
+#include "H5MMprivate.h" /* Memory management */
+#include "H5Pprivate.h" /* Property lists */
+#include "H5Tpkg.h" /* Datatypes */
/* Local functions */
-static htri_t H5T_vlen_set_loc(H5T_t *dt, H5F_t *f, H5T_vlen_loc_t loc);
+static htri_t H5T_vlen_set_loc(const H5T_t *dt, H5F_t *f, H5T_vlen_loc_t loc);
static herr_t H5T_vlen_reclaim_recurse(void *elem, const H5T_t *dt, H5MM_free_t free_func, void *free_info);
-static ssize_t H5T_vlen_seq_mem_getlen(void *_vl);
+static ssize_t H5T_vlen_seq_mem_getlen(const void *_vl);
static void * H5T_vlen_seq_mem_getptr(void *_vl);
-static htri_t H5T_vlen_seq_mem_isnull(H5F_t *f, void *_vl);
+static htri_t H5T_vlen_seq_mem_isnull(const H5F_t *f, void *_vl);
static herr_t H5T_vlen_seq_mem_read(H5F_t *f, hid_t dxpl_id, void *_vl, void *_buf, size_t len);
static herr_t H5T_vlen_seq_mem_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *_buf, void *_bg, size_t seq_len, size_t base_size);
static herr_t H5T_vlen_seq_mem_setnull(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg);
-static ssize_t H5T_vlen_str_mem_getlen(void *_vl);
+static ssize_t H5T_vlen_str_mem_getlen(const void *_vl);
static void * H5T_vlen_str_mem_getptr(void *_vl);
-static htri_t H5T_vlen_str_mem_isnull(H5F_t *f, void *_vl);
+static htri_t H5T_vlen_str_mem_isnull(const H5F_t *f, void *_vl);
static herr_t H5T_vlen_str_mem_read(H5F_t *f, hid_t dxpl_id, void *_vl, void *_buf, size_t len);
static herr_t H5T_vlen_str_mem_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *_buf, void *_bg, size_t seq_len, size_t base_size);
static herr_t H5T_vlen_str_mem_setnull(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg);
-static ssize_t H5T_vlen_disk_getlen(void *_vl);
+static ssize_t H5T_vlen_disk_getlen(const void *_vl);
static void * H5T_vlen_disk_getptr(void *_vl);
-static htri_t H5T_vlen_disk_isnull(H5F_t *f, void *_vl);
+static htri_t H5T_vlen_disk_isnull(const H5F_t *f, void *_vl);
static herr_t H5T_vlen_disk_read(H5F_t *f, hid_t dxpl_id, void *_vl, void *_buf, size_t len);
static herr_t H5T_vlen_disk_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t *vl_alloc_info, void *_vl, void *_buf, void *_bg, size_t seq_len, size_t base_size);
static herr_t H5T_vlen_disk_setnull(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg);
@@ -69,7 +68,7 @@ static H5T_vlen_alloc_info_t H5T_vlen_def_vl_alloc_info ={
H5D_XFER_VLEN_FREE_INFO_DEF
};
-/* Declare extern the free list for H5T_t's */
+/* Declare extern the free lists for H5T_t's and H5T_shared_t's */
H5FL_EXTERN(H5T_t);
H5FL_EXTERN(H5T_shared_t);
@@ -219,7 +218,7 @@ done:
*-------------------------------------------------------------------------
*/
static htri_t
-H5T_vlen_set_loc(H5T_t *dt, H5F_t *f, H5T_vlen_loc_t loc)
+H5T_vlen_set_loc(const H5T_t *dt, H5F_t *f, H5T_vlen_loc_t loc)
{
htri_t ret_value = 0; /* Indicate that success, but no location change */
@@ -299,7 +298,7 @@ H5T_vlen_set_loc(H5T_t *dt, H5F_t *f, H5T_vlen_loc_t loc)
default:
HGOTO_ERROR (H5E_DATATYPE, H5E_BADRANGE, FAIL, "invalid VL datatype location")
- } /* end switch */
+ } /* end switch */ /*lint !e788 All appropriate cases are covered */
} /* end if */
done:
@@ -322,9 +321,9 @@ done:
*-------------------------------------------------------------------------
*/
static ssize_t
-H5T_vlen_seq_mem_getlen(void *_vl)
+H5T_vlen_seq_mem_getlen(const void *_vl)
{
- hvl_t *vl=(hvl_t *)_vl; /* Pointer to the user's hvl_t information */
+ const hvl_t *vl=(const hvl_t *)_vl; /* Pointer to the user's hvl_t information */
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_vlen_seq_mem_getlen)
@@ -379,7 +378,7 @@ H5T_vlen_seq_mem_getptr(void *_vl)
*/
/* ARGSUSED */
static htri_t
-H5T_vlen_seq_mem_isnull(H5F_t UNUSED *f, void *_vl)
+H5T_vlen_seq_mem_isnull(const H5F_t UNUSED *f, void *_vl)
{
hvl_t *vl=(hvl_t *)_vl; /* Pointer to the user's hvl_t information */
@@ -534,9 +533,9 @@ H5T_vlen_seq_mem_setnull(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_vl, void
*-------------------------------------------------------------------------
*/
static ssize_t
-H5T_vlen_str_mem_getlen(void *_vl)
+H5T_vlen_str_mem_getlen(const void *_vl)
{
- char *s=*(char **)_vl; /* Pointer to the user's string information */
+ const char *s=*(const char * const *)_vl; /* Pointer to the user's string information */
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_vlen_str_mem_getlen)
@@ -591,13 +590,13 @@ H5T_vlen_str_mem_getptr(void *_vl)
*/
/* ARGSUSED */
static htri_t
-H5T_vlen_str_mem_isnull(H5F_t UNUSED *f, void *_vl)
+H5T_vlen_str_mem_isnull(const H5F_t UNUSED *f, void *_vl)
{
char *s=*(char **)_vl; /* Pointer to the user's string information */
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_vlen_str_mem_isnull)
- FUNC_LEAVE_NOAPI(s==NULL ? TRUE : FALSE);
+ FUNC_LEAVE_NOAPI(s==NULL ? TRUE : FALSE)
} /* end H5T_vlen_str_mem_isnull() */
@@ -728,9 +727,9 @@ H5T_vlen_str_mem_setnull(H5F_t UNUSED *f, hid_t UNUSED dxpl_id, void *_vl, void
*-------------------------------------------------------------------------
*/
static ssize_t
-H5T_vlen_disk_getlen(void *_vl)
+H5T_vlen_disk_getlen(const void *_vl)
{
- uint8_t *vl=(uint8_t *)_vl; /* Pointer to the disk VL information */
+ const uint8_t *vl=(const uint8_t *)_vl; /* Pointer to the disk VL information */
size_t seq_len; /* Sequence length */
FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5T_vlen_disk_getlen)
@@ -758,6 +757,7 @@ H5T_vlen_disk_getlen(void *_vl)
*
*-------------------------------------------------------------------------
*/
+/* ARGSUSED */
static void *
H5T_vlen_disk_getptr(void UNUSED *vl)
{
@@ -785,7 +785,7 @@ H5T_vlen_disk_getptr(void UNUSED *vl)
*-------------------------------------------------------------------------
*/
static htri_t
-H5T_vlen_disk_isnull(H5F_t *f, void *_vl)
+H5T_vlen_disk_isnull(const H5F_t *f, void *_vl)
{
uint8_t *vl=(uint8_t *)_vl; /* Pointer to the disk VL information */
haddr_t addr; /* Sequence's heap address */
@@ -825,7 +825,6 @@ H5T_vlen_disk_read(H5F_t *f, hid_t dxpl_id, void *_vl, void *buf, size_t UNUSED
{
uint8_t *vl=(uint8_t *)_vl; /* Pointer to the user's hvl_t information */
H5HG_t hobjid;
- uint32_t seq_len;
herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_NOAPI_NOINIT(H5T_vlen_disk_read)
@@ -835,8 +834,8 @@ H5T_vlen_disk_read(H5F_t *f, hid_t dxpl_id, void *_vl, void *buf, size_t UNUSED
assert(buf);
assert(f);
- /* Get the length of the sequence */
- UINT32DECODE(vl, seq_len); /* Not used */
+ /* Skip the length of the sequence */
+ vl += 4;
/* Get the heap information */
H5F_addr_decode(f,(const uint8_t **)&vl,&(hobjid.addr));
@@ -872,6 +871,7 @@ done:
*
*-------------------------------------------------------------------------
*/
+/* ARGSUSED */
static herr_t
H5T_vlen_disk_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t UNUSED *vl_alloc_info, void *_vl, void *buf, void *_bg, size_t seq_len, size_t base_size)
{
@@ -890,11 +890,10 @@ H5T_vlen_disk_write(H5F_t *f, hid_t dxpl_id, const H5T_vlen_alloc_info_t UNUSED
/* Free heap object for old data. */
if(bg!=NULL) {
- size_t bg_seq_len; /* "Background" VL info sequence's length */
H5HG_t bg_hobjid; /* "Background" VL info sequence's ID info */
- /* Get the length of the sequence and heap object ID from background data. */
- UINT32DECODE(bg, bg_seq_len);
+ /* Skip the length of the sequence and heap object ID from background data. */
+ bg += 4;
/* Get heap information */
H5F_addr_decode(f, (const uint8_t **)&bg, &(bg_hobjid.addr));
@@ -955,11 +954,10 @@ H5T_vlen_disk_setnull(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg)
/* Free heap object for old data. */
if(bg!=NULL) {
- hsize_t bg_seq_len=0; /* "Background" VL info sequence's length */
H5HG_t bg_hobjid; /* "Background" VL info sequence's ID info */
- /* Get the length of the sequence and heap object ID from background data. */
- UINT32DECODE(bg, bg_seq_len);
+ /* Skip the length of the sequence and heap object ID from background data. */
+ bg += 4;
/* Get heap information */
H5F_addr_decode(f, (const uint8_t **)&bg, &(bg_hobjid.addr));
@@ -1035,7 +1033,7 @@ H5T_vlen_reclaim_recurse(void *elem, const H5T_t *dt, H5MM_free_t free_func, voi
case H5T_COMPOUND:
/* Check each field and recurse on VL, compound, enum or array ones */
- for (i=0; i<(unsigned)dt->shared->u.compnd.nmembs; i++) {
+ for (i=0; i<dt->shared->u.compnd.nmembs; i++) {
/* Recurse if it's VL, compound, enum or array */
if(H5T_IS_COMPLEX(dt->shared->u.compnd.memb[i].type->shared->type)) {
void *off; /* offset of field */
@@ -1087,7 +1085,7 @@ H5T_vlen_reclaim_recurse(void *elem, const H5T_t *dt, H5MM_free_t free_func, voi
default:
break;
- } /* end switch */
+ } /* end switch */ /*lint !e788 All appropriate cases are covered */
done:
FUNC_LEAVE_NOAPI(ret_value)
@@ -1103,8 +1101,8 @@ done:
herr_t H5T_vlen_reclaim(elem,type_id,ndim,point,op_data)
void *elem; IN/OUT: Pointer to the dataset element
hid_t type_id; IN: Datatype of dataset element
- hsize_t ndim; IN: Number of dimensions in dataspace
- hssize_t *point; IN: Coordinate location of element in dataspace
+ 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
@@ -1120,7 +1118,7 @@ done:
--------------------------------------------------------------------------*/
/* ARGSUSED */
herr_t
-H5T_vlen_reclaim(void *elem, hid_t type_id, hsize_t UNUSED ndim, hssize_t UNUSED *point, void *op_data)
+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 */
H5T_t *dt;
@@ -1231,8 +1229,8 @@ H5T_vlen_mark(H5T_t *dt, H5F_t *f, H5T_vlen_loc_t loc)
{
htri_t vlen_changed; /* Whether H5T_vlen_mark changed the type (even if the size didn't change) */
htri_t ret_value = 0; /* Indicate that success, but no location change */
- int i; /* Local index variable */
- int accum_change=0; /* Amount of change in the offset of the fields */
+ unsigned i; /* Local index variable */
+ int accum_change=0; /* Amount of change in the offset of the fields */
size_t old_size; /* Previous size of a field */
FUNC_ENTER_NOAPI(H5T_vlen_mark, FAIL);
diff --git a/src/H5V.c b/src/H5V.c
index 4163a6f..b2720f5 100644
--- a/src/H5V.c
+++ b/src/H5V.c
@@ -26,9 +26,22 @@
#include "H5Oprivate.h"
#include "H5Vprivate.h"
+/* Local macros */
#define H5V_HYPER_NDIMS H5O_LAYOUT_NDIMS
-static int interface_initialize_g = 0;
-#define INTERFACE_INIT NULL
+
+/* Local prototypes */
+static void
+H5V_stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/,
+ const hsize_t *size, hsize_t *stride1);
+static void
+H5V_stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/,
+ const hsize_t *size, hsize_t *stride1, hsize_t *stride2);
+#ifdef LATER
+static void
+H5V_stride_copy2(hsize_t nelmts, hsize_t elmt_size,
+ unsigned dst_n, const hsize_t *dst_size, const ssize_t *dst_stride, void *_dst,
+ unsigned src_n, const hsize_t *src_size, const ssize_t *src_stride, const void *_src);
+#endif /* LATER */
/*-------------------------------------------------------------------------
@@ -42,7 +55,7 @@ static int interface_initialize_g = 0;
* All arguments are passed by reference and their values may be
* modified by this function.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: None
*
* Programmer: Robb Matzke
* Saturday, October 11, 1997
@@ -51,13 +64,11 @@ static int interface_initialize_g = 0;
*
*-------------------------------------------------------------------------
*/
-herr_t
+static void
H5V_stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/,
- hsize_t *size, hssize_t *stride1)
+ const hsize_t *size, hsize_t *stride1)
{
- herr_t ret_value=SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(H5V_stride_optimize1, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5V_stride_optimize1);
/*
* This has to be true because if we optimize the dimensionality down to
@@ -71,13 +82,11 @@ H5V_stride_optimize1(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/,
while (*np && stride1[*np-1]>0 &&
(hsize_t)(stride1[*np-1])==*elmt_size) {
*elmt_size *= size[*np-1];
- if (--*np) {
+ if (--*np)
stride1[*np-1] += size[*np] * stride1[*np];
- }
}
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI_VOID
}
@@ -104,13 +113,11 @@ done:
*
*-------------------------------------------------------------------------
*/
-herr_t
+static void
H5V_stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/,
- hsize_t *size, hssize_t *stride1, hssize_t *stride2)
+ const hsize_t *size, hsize_t *stride1, hsize_t *stride2)
{
- herr_t ret_value=SUCCEED; /* Return value */
-
- FUNC_ENTER_NOAPI(H5V_stride_optimize2, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5V_stride_optimize2)
/*
* This has to be true because if we optimize the dimensionality down to
@@ -126,23 +133,20 @@ H5V_stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/,
/* Unroll loop for common cases */
switch(*np) {
case 1: /* For 0-D datasets (dunno if this ever gets used...) */
- if((hsize_t)(stride1[0]) == *elmt_size &&
- (hsize_t)(stride2[0]) == *elmt_size) {
+ if(stride1[0] == *elmt_size && stride2[0] == *elmt_size) {
*elmt_size *= size[0];
--*np; /* *np decrements to a value of 0 now */
} /* end if */
break;
case 2: /* For 1-D datasets */
- if((hsize_t)(stride1[1]) == *elmt_size &&
- (hsize_t)(stride2[1]) == *elmt_size) {
+ if(stride1[1] == *elmt_size && stride2[1] == *elmt_size) {
*elmt_size *= size[1];
--*np; /* *np decrements to a value of 1 now */
stride1[0] += size[1] * stride1[1];
stride2[0] += size[1] * stride2[1];
- if((hsize_t)(stride1[0]) == *elmt_size &&
- (hsize_t)(stride2[0]) == *elmt_size) {
+ if(stride1[0] == *elmt_size && stride2[0] == *elmt_size) {
*elmt_size *= size[0];
--*np; /* *np decrements to a value of 0 now */
} /* end if */
@@ -150,22 +154,19 @@ H5V_stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/,
break;
case 3: /* For 2-D datasets */
- if((hsize_t)(stride1[2]) == *elmt_size &&
- (hsize_t)(stride2[2]) == *elmt_size) {
+ if(stride1[2] == *elmt_size && stride2[2] == *elmt_size) {
*elmt_size *= size[2];
--*np; /* *np decrements to a value of 2 now */
stride1[1] += size[2] * stride1[2];
stride2[1] += size[2] * stride2[2];
- if((hsize_t)(stride1[1]) == *elmt_size &&
- (hsize_t)(stride2[1]) == *elmt_size) {
+ if(stride1[1] == *elmt_size && stride2[1] == *elmt_size) {
*elmt_size *= size[1];
--*np; /* *np decrements to a value of 1 now */
stride1[0] += size[1] * stride1[1];
stride2[0] += size[1] * stride2[1];
- if((hsize_t)(stride1[0]) == *elmt_size &&
- (hsize_t)(stride2[0]) == *elmt_size) {
+ if(stride1[0] == *elmt_size && stride2[0] == *elmt_size) {
*elmt_size *= size[0];
--*np; /* *np decrements to a value of 0 now */
} /* end if */
@@ -174,29 +175,25 @@ H5V_stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/,
break;
case 4: /* For 3-D datasets */
- if((hsize_t)(stride1[3]) == *elmt_size &&
- (hsize_t)(stride2[3]) == *elmt_size) {
+ if(stride1[3] == *elmt_size && stride2[3] == *elmt_size) {
*elmt_size *= size[3];
--*np; /* *np decrements to a value of 3 now */
stride1[2] += size[3] * stride1[3];
stride2[2] += size[3] * stride2[3];
- if((hsize_t)(stride1[2]) == *elmt_size &&
- (hsize_t)(stride2[2]) == *elmt_size) {
+ if(stride1[2] == *elmt_size && stride2[2] == *elmt_size) {
*elmt_size *= size[2];
--*np; /* *np decrements to a value of 2 now */
stride1[1] += size[2] * stride1[2];
stride2[1] += size[2] * stride2[2];
- if((hsize_t)(stride1[1]) == *elmt_size &&
- (hsize_t)(stride2[1]) == *elmt_size) {
+ if(stride1[1] == *elmt_size && stride2[1] == *elmt_size) {
*elmt_size *= size[1];
--*np; /* *np decrements to a value of 1 now */
stride1[0] += size[1] * stride1[1];
stride2[0] += size[1] * stride2[1];
- if((hsize_t)(stride1[0]) == *elmt_size &&
- (hsize_t)(stride2[0]) == *elmt_size) {
+ if(stride1[0] == *elmt_size && stride2[0] == *elmt_size) {
*elmt_size *= size[0];
--*np; /* *np decrements to a value of 0 now */
} /* end if */
@@ -207,8 +204,8 @@ H5V_stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/,
default:
while (*np &&
- (hsize_t)(stride1[*np-1]) == *elmt_size &&
- (hsize_t)(stride2[*np-1]) == *elmt_size) {
+ stride1[*np-1] == *elmt_size &&
+ stride2[*np-1] == *elmt_size) {
*elmt_size *= size[*np-1];
if (--*np) {
stride1[*np-1] += size[*np] * stride1[*np];
@@ -218,8 +215,7 @@ H5V_stride_optimize2(unsigned *np/*in,out*/, hsize_t *elmt_size/*in,out*/,
break;
} /* end switch */
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI_VOID
}
@@ -257,16 +253,15 @@ done:
*/
hsize_t
H5V_hyper_stride(unsigned n, const hsize_t *size,
- const hsize_t *total_size, const hssize_t *offset,
- hssize_t *stride/*out*/)
+ const hsize_t *total_size, const hsize_t *offset,
+ hsize_t *stride/*out*/)
{
hsize_t skip; /*starting point byte offset */
hsize_t acc; /*accumulator */
- hsize_t tmp;
int i; /*counter */
hsize_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5V_hyper_stride, (HDabort(), 0));
+ FUNC_ENTER_NOAPI_NOFUNC(H5V_hyper_stride)
assert(n <= H5V_HYPER_NDIMS);
assert(size);
@@ -274,60 +269,54 @@ H5V_hyper_stride(unsigned n, const hsize_t *size,
assert(stride);
/* init */
+ assert(n>0);
stride[n-1] = 1;
skip = offset ? offset[n-1] : 0;
switch(n) {
case 2: /* 1-D dataset */
- tmp = total_size[1] - size[1];
- assert (tmp<((hsize_t)1<<(8*sizeof(hssize_t)-1)));
- stride[0] = (hssize_t)tmp; /*overflow checked*/
+ assert (total_size[1]>=size[1]);
+ stride[0] = total_size[1]-size[1]; /*overflow checked*/
acc = total_size[1];
skip += acc * (offset ? offset[0] : 0);
break;
case 3: /* 2-D dataset */
- tmp = total_size[2] - size[2];
- assert (tmp<((hsize_t)1<<(8*sizeof(hssize_t)-1)));
- stride[1] = (hssize_t)tmp; /*overflow checked*/
+ assert (total_size[2]>=size[2]);
+ stride[1] = total_size[2]-size[2]; /*overflow checked*/
acc = total_size[2];
- skip += acc * (offset ? offset[1] : 0);
+ skip += acc * (offset ? (hsize_t)offset[1] : 0);
- tmp = acc * (total_size[1] - size[1]);
- assert (tmp<((hsize_t)1<<(8*sizeof(hssize_t)-1)));
- stride[0] = (hssize_t)tmp; /*overflow checked*/
+ assert (total_size[1]>=size[1]);
+ stride[0] = acc * (total_size[1] - size[1]); /*overflow checked*/
acc *= total_size[1];
- skip += acc * (offset ? offset[0] : 0);
+ skip += acc * (offset ? (hsize_t)offset[0] : 0);
break;
case 4: /* 3-D dataset */
- tmp = total_size[3] - size[3];
- assert (tmp<((hsize_t)1<<(8*sizeof(hssize_t)-1)));
- stride[2] = (hssize_t)tmp; /*overflow checked*/
+ assert (total_size[3]>=size[3]);
+ stride[2] = total_size[3]-size[3]; /*overflow checked*/
acc = total_size[3];
- skip += acc * (offset ? offset[2] : 0);
+ skip += acc * (offset ? (hsize_t)offset[2] : 0);
- tmp = acc * (total_size[2] - size[2]);
- assert (tmp<((hsize_t)1<<(8*sizeof(hssize_t)-1)));
- stride[1] = (hssize_t)tmp; /*overflow checked*/
+ assert (total_size[2]>=size[2]);
+ stride[1] = acc * (total_size[2] - size[2]); /*overflow checked*/
acc *= total_size[2];
- skip += acc * (offset ? offset[1] : 0);
+ skip += acc * (offset ? (hsize_t)offset[1] : 0);
- tmp = acc * (total_size[1] - size[1]);
- assert (tmp<((hsize_t)1<<(8*sizeof(hssize_t)-1)));
- stride[0] = (hssize_t)tmp; /*overflow checked*/
+ assert (total_size[1]>=size[1]);
+ stride[0] = acc * (total_size[1] - size[1]); /*overflow checked*/
acc *= total_size[1];
- skip += acc * (offset ? offset[0] : 0);
+ skip += acc * (offset ? (hsize_t)offset[0] : 0);
break;
default:
/* others */
for (i=(int)(n-2), acc=1; i>=0; --i) {
- tmp = acc * (total_size[i+1] - size[i+1]);
- assert (tmp<((hsize_t)1<<(8*sizeof(hssize_t)-1)));
- stride[i] = (hssize_t)tmp; /*overflow checked*/
+ assert (total_size[i+1]>=size[i+1]);
+ stride[i] = acc * (total_size[i+1] - size[i+1]); /*overflow checked*/
acc *= total_size[i+1];
- skip += acc * (offset ? offset[i] : 0);
+ skip += acc * (offset ? (hsize_t)offset[i] : 0);
}
break;
} /* end switch */
@@ -335,8 +324,7 @@ H5V_hyper_stride(unsigned n, const hsize_t *size,
/* Set return value */
ret_value=skip;
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -364,32 +352,32 @@ done:
*-------------------------------------------------------------------------
*/
htri_t
-H5V_hyper_eq(int n,
- const hssize_t *offset1, const hsize_t *size1,
- const hssize_t *offset2, const hsize_t *size2)
+H5V_hyper_eq(unsigned n,
+ const hsize_t *offset1, const hsize_t *size1,
+ const hsize_t *offset2, const hsize_t *size2)
{
hsize_t nelmts1 = 1, nelmts2 = 1;
- int i;
+ unsigned i;
htri_t ret_value=TRUE; /* Return value */
/* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5V_hyper_eq);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5V_hyper_eq)
- if (n <= 0) HGOTO_DONE(TRUE);
+ if (n == 0) HGOTO_DONE(TRUE)
for (i=0; i<n; i++) {
- if ((offset1 ? offset1[i] : 0) != (offset2 ? offset2[i] : 0)) {
- HGOTO_DONE(FALSE);
- }
- if ((size1 ? size1[i] : 0) != (size2 ? size2[i] : 0)) {
- HGOTO_DONE(FALSE);
- }
- if (0 == (nelmts1 *= (size1 ? size1[i] : 0))) HGOTO_DONE(FALSE);
- if (0 == (nelmts2 *= (size2 ? size2[i] : 0))) HGOTO_DONE(FALSE);
+ if ((offset1 ? offset1[i] : 0) != (offset2 ? offset2[i] : 0))
+ HGOTO_DONE(FALSE)
+ if ((size1 ? size1[i] : 0) != (size2 ? size2[i] : 0))
+ HGOTO_DONE(FALSE)
+ if (0 == (nelmts1 *= (size1 ? size1[i] : 0)))
+ HGOTO_DONE(FALSE)
+ if (0 == (nelmts2 *= (size2 ? size2[i] : 0)))
+ HGOTO_DONE(FALSE)
}
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -413,35 +401,32 @@ done:
*/
htri_t
H5V_hyper_disjointp(unsigned n,
- const hssize_t *offset1, const size_t *size1,
- const hssize_t *offset2, const size_t *size2)
+ const hsize_t *offset1, const size_t *size1,
+ const hsize_t *offset2, const size_t *size2)
{
unsigned u;
htri_t ret_value=FALSE; /* Return value */
/* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5V_hyper_disjointp);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5V_hyper_disjointp)
- if (!n || !size1 || !size2) HGOTO_DONE(TRUE);
+ if (!n || !size1 || !size2) HGOTO_DONE(TRUE)
for (u=0; u<n; u++) {
- assert (size1[u]<HSSIZET_MAX);
- assert (size2[u]<HSSIZET_MAX);
+ assert (size1[u]<HSIZET_MAX);
+ assert (size2[u]<HSIZET_MAX);
if (0==size1[u] || 0==size2[u])
- HGOTO_DONE(TRUE);
+ HGOTO_DONE(TRUE)
if (((offset1?offset1[u]:0) < (offset2?offset2[u]:0) &&
- ((offset1?offset1[u]:0) + (hssize_t)size1[u] <=
- (offset2?offset2[u]:0))) ||
+ ((offset1?offset1[u]:0) + size1[u] <= (offset2?offset2[u]:0))) ||
((offset2?offset2[u]:0) < (offset1?offset1[u]:0) &&
- ((offset2?offset2[u]:0) + (hssize_t)size2[u] <=
- (offset1?offset1[u]:0)))) {
- HGOTO_DONE(TRUE);
- }
+ ((offset2?offset2[u]:0) + size2[u] <= (offset1?offset1[u]:0))))
+ HGOTO_DONE(TRUE)
}
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -468,12 +453,12 @@ done:
*/
herr_t
H5V_hyper_fill(unsigned n, const hsize_t *_size,
- const hsize_t *total_size, const hssize_t *offset, void *_dst,
+ const hsize_t *total_size, const hsize_t *offset, void *_dst,
unsigned fill_value)
{
uint8_t *dst = (uint8_t*)_dst; /*cast for ptr arithmetic */
hsize_t size[H5V_HYPER_NDIMS]; /*a modifiable copy of _size */
- hssize_t dst_stride[H5V_HYPER_NDIMS]; /*destination stride info */
+ hsize_t dst_stride[H5V_HYPER_NDIMS]; /*destination stride info */
hsize_t dst_start; /*byte offset to start of stride*/
hsize_t elmt_size = 1; /*bytes per element */
herr_t ret_value; /*function return status */
@@ -481,7 +466,7 @@ H5V_hyper_fill(unsigned n, const hsize_t *_size,
unsigned u;
#endif
- FUNC_ENTER_NOAPI(H5V_hyper_fill, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5V_hyper_fill)
/* check args */
assert(n > 0 && n <= H5V_HYPER_NDIMS);
@@ -506,8 +491,7 @@ H5V_hyper_fill(unsigned n, const hsize_t *_size,
ret_value = H5V_stride_fill(n, elmt_size, size, dst_stride, dst+dst_start,
fill_value);
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -549,28 +533,26 @@ herr_t
H5V_hyper_copy(unsigned n, const hsize_t *_size,
/*destination*/
- const hsize_t *dst_size, const hssize_t *dst_offset,
+ const hsize_t *dst_size, const hsize_t *dst_offset,
void *_dst,
/*source*/
- const hsize_t *src_size, const hssize_t *src_offset,
+ const hsize_t *src_size, const hsize_t *src_offset,
const void *_src)
{
const uint8_t *src = (const uint8_t*)_src; /*cast for ptr arithmtc */
uint8_t *dst = (uint8_t*) _dst; /*cast for ptr arithmtc */
hsize_t size[H5V_HYPER_NDIMS]; /*a modifiable _size */
- hssize_t src_stride[H5V_HYPER_NDIMS]; /*source stride info */
- hssize_t dst_stride[H5V_HYPER_NDIMS]; /*dest stride info */
+ hsize_t src_stride[H5V_HYPER_NDIMS]; /*source stride info */
+ hsize_t dst_stride[H5V_HYPER_NDIMS]; /*dest stride info */
hsize_t dst_start, src_start; /*offset to start at */
hsize_t elmt_size = 1; /*element size in bytes */
- hsize_t tmp1;
- hsize_t tmp2;
herr_t ret_value; /*return status */
#ifndef NDEBUG
unsigned u;
#endif
- FUNC_ENTER_NOAPI(H5V_hyper_copy, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5V_hyper_copy)
/* check args */
assert(n > 0 && n <= H5V_HYPER_NDIMS);
@@ -602,6 +584,7 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size,
int ii; /*counter */
/* init */
+ assert(n>0);
dst_stride[n-1] = 1;
src_stride[n-1] = 1;
dst_start = dst_offset ? dst_offset[n-1] : 0;
@@ -610,12 +593,10 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size,
/* Unroll loop for common cases */
switch(n) {
case 2:
- tmp1 = (dst_size[1] - size[1]);
- tmp2 = (src_size[1] - size[1]);
- assert (tmp1<((hsize_t)1<<(8*sizeof(hssize_t)-1)));
- assert (tmp2<((hsize_t)1<<(8*sizeof(hssize_t)-1)));
- dst_stride[0] = (hssize_t)tmp1; /*overflow checked*/
- src_stride[0] = (hssize_t)tmp2; /*overflow checked*/
+ assert (dst_size[1]>=size[1]);
+ assert (src_size[1]>=size[1]);
+ dst_stride[0] = dst_size[1] - size[1]; /*overflow checked*/
+ src_stride[0] = src_size[1] - size[1]; /*overflow checked*/
dst_acc = dst_size[1];
src_acc = src_size[1];
dst_start += dst_acc * (dst_offset ? dst_offset[0] : 0);
@@ -623,23 +604,19 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size,
break;
case 3:
- tmp1 = (dst_size[2] - size[2]);
- tmp2 = (src_size[2] - size[2]);
- assert (tmp1<((hsize_t)1<<(8*sizeof(hssize_t)-1)));
- assert (tmp2<((hsize_t)1<<(8*sizeof(hssize_t)-1)));
- dst_stride[1] = (hssize_t)tmp1; /*overflow checked*/
- src_stride[1] = (hssize_t)tmp2; /*overflow checked*/
+ assert (dst_size[2]>=size[2]);
+ assert (src_size[2]>=size[2]);
+ dst_stride[1] = dst_size[2] - size[2]; /*overflow checked*/
+ src_stride[1] = src_size[2] - size[2]; /*overflow checked*/
dst_acc = dst_size[2];
src_acc = src_size[2];
dst_start += dst_acc * (dst_offset ? dst_offset[1] : 0);
src_start += src_acc * (src_offset ? src_offset[1] : 0);
- tmp1 = dst_acc * (dst_size[1] - size[1]);
- tmp2 = src_acc * (src_size[1] - size[1]);
- assert (tmp1<((hsize_t)1<<(8*sizeof(hssize_t)-1)));
- assert (tmp2<((hsize_t)1<<(8*sizeof(hssize_t)-1)));
- dst_stride[0] = (hssize_t)tmp1; /*overflow checked*/
- src_stride[0] = (hssize_t)tmp2; /*overflow checked*/
+ assert (dst_size[1]>=size[1]);
+ assert (src_size[1]>=size[1]);
+ dst_stride[0] = dst_acc * (dst_size[1] - size[1]); /*overflow checked*/
+ src_stride[0] = src_acc * (src_size[1] - size[1]); /*overflow checked*/
dst_acc *= dst_size[1];
src_acc *= src_size[1];
dst_start += dst_acc * (dst_offset ? dst_offset[0] : 0);
@@ -647,34 +624,28 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size,
break;
case 4:
- tmp1 = (dst_size[3] - size[3]);
- tmp2 = (src_size[3] - size[3]);
- assert (tmp1<((hsize_t)1<<(8*sizeof(hssize_t)-1)));
- assert (tmp2<((hsize_t)1<<(8*sizeof(hssize_t)-1)));
- dst_stride[2] = (hssize_t)tmp1; /*overflow checked*/
- src_stride[2] = (hssize_t)tmp2; /*overflow checked*/
+ assert (dst_size[3]>=size[3]);
+ assert (src_size[3]>=size[3]);
+ dst_stride[2] = dst_size[3] - size[3]; /*overflow checked*/
+ src_stride[2] = src_size[3] - size[3]; /*overflow checked*/
dst_acc = dst_size[3];
src_acc = src_size[3];
dst_start += dst_acc * (dst_offset ? dst_offset[2] : 0);
src_start += src_acc * (src_offset ? src_offset[2] : 0);
- tmp1 = dst_acc * (dst_size[2] - size[2]);
- tmp2 = src_acc * (src_size[2] - size[2]);
- assert (tmp1<((hsize_t)1<<(8*sizeof(hssize_t)-1)));
- assert (tmp2<((hsize_t)1<<(8*sizeof(hssize_t)-1)));
- dst_stride[1] = (hssize_t)tmp1; /*overflow checked*/
- src_stride[1] = (hssize_t)tmp2; /*overflow checked*/
+ assert (dst_size[2]>=size[2]);
+ assert (src_size[2]>=size[2]);
+ dst_stride[1] = dst_acc * (dst_size[2] - size[2]); /*overflow checked*/
+ src_stride[1] = src_acc * (src_size[2] - size[2]); /*overflow checked*/
dst_acc *= dst_size[2];
src_acc *= src_size[2];
dst_start += dst_acc * (dst_offset ? dst_offset[1] : 0);
src_start += src_acc * (src_offset ? src_offset[1] : 0);
- tmp1 = dst_acc * (dst_size[1] - size[1]);
- tmp2 = src_acc * (src_size[1] - size[1]);
- assert (tmp1<((hsize_t)1<<(8*sizeof(hssize_t)-1)));
- assert (tmp2<((hsize_t)1<<(8*sizeof(hssize_t)-1)));
- dst_stride[0] = (hssize_t)tmp1; /*overflow checked*/
- src_stride[0] = (hssize_t)tmp2; /*overflow checked*/
+ assert (dst_size[1]>=size[1]);
+ assert (src_size[1]>=size[1]);
+ dst_stride[0] = dst_acc * (dst_size[1] - size[1]); /*overflow checked*/
+ src_stride[0] = src_acc * (src_size[1] - size[1]); /*overflow checked*/
dst_acc *= dst_size[1];
src_acc *= src_size[1];
dst_start += dst_acc * (dst_offset ? dst_offset[0] : 0);
@@ -684,12 +655,10 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size,
default:
/* others */
for (ii=(int)(n-2), dst_acc=1, src_acc=1; ii>=0; --ii) {
- tmp1 = dst_acc * (dst_size[ii+1] - size[ii+1]);
- tmp2 = src_acc * (src_size[ii+1] - size[ii+1]);
- assert (tmp1<((hsize_t)1<<(8*sizeof(hssize_t)-1)));
- assert (tmp2<((hsize_t)1<<(8*sizeof(hssize_t)-1)));
- dst_stride[ii] = (hssize_t)tmp1; /*overflow checked*/
- src_stride[ii] = (hssize_t)tmp2; /*overflow checked*/
+ assert (dst_size[ii+1]>=size[ii+1]);
+ assert (src_size[ii+1]>=size[ii+1]);
+ dst_stride[ii] = dst_acc * (dst_size[ii+1] - size[ii+1]); /*overflow checked*/
+ src_stride[ii] = src_acc * (src_size[ii+1] - size[ii+1]); /*overflow checked*/
dst_acc *= dst_size[ii+1];
src_acc *= src_size[ii+1];
dst_start += dst_acc * (dst_offset ? dst_offset[ii] : 0);
@@ -707,8 +676,7 @@ H5V_hyper_copy(unsigned n, const hsize_t *_size,
ret_value = H5V_stride_copy(n, elmt_size, size,
dst_stride, dst+dst_start, src_stride, src+src_start);
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -729,7 +697,7 @@ done:
*/
herr_t
H5V_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size,
- const hssize_t *stride, void *_dst, unsigned fill_value)
+ const hsize_t *stride, void *_dst, unsigned fill_value)
{
uint8_t *dst = (uint8_t*)_dst; /*cast for ptr arithmetic */
hsize_t idx[H5V_HYPER_NDIMS]; /*1-origin indices */
@@ -737,16 +705,16 @@ H5V_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size,
hsize_t i; /*counter */
int j; /*counter */
hbool_t carry; /*subtraction carray value */
- herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5V_stride_fill, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5V_stride_fill)
assert (elmt_size < SIZET_MAX);
H5V_vector_cpy(n, idx, size);
nelmts = H5V_vector_reduce_product(n, size);
for (i=0; i<nelmts; i++) {
/* Copy an element */
- HDmemset(dst, (signed)fill_value, (size_t)elmt_size);
+ H5_CHECK_OVERFLOW(elmt_size,hsize_t,size_t);
+ HDmemset(dst, (int)fill_value, (size_t)elmt_size); /*lint !e671 The elmt_size will be OK */
/* Decrement indices and advance pointer */
for (j=(int)(n-1), carry=TRUE; j>=0 && carry; --j) {
@@ -754,13 +722,14 @@ H5V_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size,
if (--idx[j])
carry = FALSE;
- else
+ else {
+ assert(size);
idx[j] = size[j];
+ } /* end else */
}
}
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED)
}
@@ -787,6 +756,74 @@ done:
*/
herr_t
H5V_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *size,
+ const hsize_t *dst_stride, void *_dst,
+ const hsize_t *src_stride, const void *_src)
+{
+ uint8_t *dst = (uint8_t*)_dst; /*cast for ptr arithmetic*/
+ const uint8_t *src = (const uint8_t*) _src; /*cast for ptr arithmetic*/
+ hsize_t idx[H5V_HYPER_NDIMS]; /*1-origin indices */
+ hsize_t nelmts; /*num elements to copy */
+ hsize_t i; /*counter */
+ int j; /*counters */
+ hbool_t carry; /*carray for subtraction*/
+
+ FUNC_ENTER_NOAPI_NOFUNC(H5V_stride_copy)
+ assert (elmt_size<SIZET_MAX);
+
+ if (n) {
+ H5V_vector_cpy(n, idx, size);
+ nelmts = H5V_vector_reduce_product(n, size);
+ for (i=0; i<nelmts; i++) {
+
+ /* Copy an element */
+ H5_CHECK_OVERFLOW(elmt_size,hsize_t,size_t);
+ HDmemcpy(dst, src, (size_t)elmt_size); /*lint !e671 The elmt_size will be OK */
+
+ /* Decrement indices and advance pointers */
+ for (j=(int)(n-1), carry=TRUE; j>=0 && carry; --j) {
+ src += src_stride[j];
+ dst += dst_stride[j];
+
+ if (--idx[j])
+ carry = FALSE;
+ else {
+ assert(size);
+ idx[j] = size[j];
+ }
+ }
+ }
+ } else {
+ H5_CHECK_OVERFLOW(elmt_size,hsize_t,size_t);
+ HDmemcpy (dst, src, (size_t)elmt_size); /*lint !e671 The elmt_size will be OK */
+ }
+
+ FUNC_LEAVE_NOAPI(SUCCEED)
+}
+
+
+/*-------------------------------------------------------------------------
+ * Function: H5V_stride_copy_s
+ *
+ * Purpose: Uses DST_STRIDE and SRC_STRIDE to advance through the arrays
+ * DST and SRC while copying bytes from SRC to DST. This
+ * function minimizes the number of calls to memcpy() by
+ * combining various strides, but it will never touch memory
+ * outside the hyperslab defined by the strides.
+ *
+ * Note: If the src_stride is all zero and elmt_size is one, then it's
+ * probably more efficient to use H5V_stride_fill() instead.
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Robb Matzke
+ * Saturday, October 11, 1997
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5V_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *size,
const hssize_t *dst_stride, void *_dst,
const hssize_t *src_stride, const void *_src)
{
@@ -797,9 +834,8 @@ H5V_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *size,
hsize_t i; /*counter */
int j; /*counters */
hbool_t carry; /*carray for subtraction*/
- herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5V_stride_copy, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5V_stride_copy_s)
assert (elmt_size<SIZET_MAX);
if (n) {
@@ -809,7 +845,7 @@ H5V_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *size,
/* Copy an element */
H5_CHECK_OVERFLOW(elmt_size,hsize_t,size_t);
- HDmemcpy(dst, src, (size_t)elmt_size);
+ HDmemcpy(dst, src, (size_t)elmt_size); /*lint !e671 The elmt_size will be OK */
/* Decrement indices and advance pointers */
for (j=(int)(n-1), carry=TRUE; j>=0 && carry; --j) {
@@ -818,18 +854,21 @@ H5V_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *size,
if (--idx[j])
carry = FALSE;
- else
+ else {
+ assert(size);
idx[j] = size[j];
+ }
}
}
} else {
H5_CHECK_OVERFLOW(elmt_size,hsize_t,size_t);
- HDmemcpy (dst, src, (size_t)elmt_size);
+ HDmemcpy (dst, src, (size_t)elmt_size); /*lint !e671 The elmt_size will be OK */
}
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED)
}
+
+#ifdef LATER
/*-------------------------------------------------------------------------
* Function: H5V_stride_copy2
@@ -839,7 +878,7 @@ done:
* we copy exactly NELMTS elements each of size ELMT_SIZE. The
* size counters wrap if NELMTS is more than a size counter.
*
- * Return: Non-negative on success/Negative on failure
+ * Return: None
*
* Programmer: Robb Matzke
* Saturday, October 11, 1997
@@ -848,31 +887,32 @@ done:
*
*-------------------------------------------------------------------------
*/
-herr_t
+static void
H5V_stride_copy2(hsize_t nelmts, hsize_t elmt_size,
/* destination */
- int dst_n, const hsize_t *dst_size,
- const hssize_t *dst_stride,
+ unsigned dst_n, const hsize_t *dst_size,
+ const hsize_t *dst_stride,
void *_dst,
/* source */
- int src_n, const hsize_t *src_size,
- const hssize_t *src_stride,
+ unsigned src_n, const hsize_t *src_size,
+ const hsize_t *src_stride,
const void *_src)
{
uint8_t *dst = (uint8_t *) _dst;
const uint8_t *src = (const uint8_t *) _src;
hsize_t dst_idx[H5V_HYPER_NDIMS];
hsize_t src_idx[H5V_HYPER_NDIMS];
- hsize_t i;
- int j;
+ hsize_t i; /* Local index variable */
+ int j; /* Local index variable */
hbool_t carry;
- herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5V_stride_copy2, FAIL);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5V_stride_copy2)
assert (elmt_size < SIZET_MAX);
+ assert(dst_n>0);
+ assert(src_n>0);
H5V_vector_cpy(dst_n, dst_idx, dst_size);
H5V_vector_cpy(src_n, src_idx, src_size);
@@ -880,28 +920,34 @@ H5V_stride_copy2(hsize_t nelmts, hsize_t elmt_size,
for (i=0; i<nelmts; i++) {
/* Copy an element */
- HDmemcpy(dst, src, (size_t)elmt_size);
+ H5_CHECK_OVERFLOW(elmt_size,hsize_t,size_t);
+ HDmemcpy(dst, src, (size_t)elmt_size); /*lint !e671 The elmt_size will be OK */
/* Decrement indices and advance pointers */
- for (j=dst_n-1, carry=TRUE; j>=0 && carry; --j) {
+ for (j=(int)(dst_n-1), carry=TRUE; j>=0 && carry; --j) {
dst += dst_stride[j];
if (--dst_idx[j])
carry = FALSE;
- else
+ else {
+ assert(dst_size);
dst_idx[j] = dst_size[j];
+ } /* end else */
}
- for (j=src_n-1, carry=TRUE; j>=0 && carry; --j) {
+ for (j=(int)(src_n-1), carry=TRUE; j>=0 && carry; --j) {
src += src_stride[j];
if (--src_idx[j])
carry = FALSE;
- else
+ else {
+ assert(src_size);
src_idx[j] = src_size[j];
+ } /* end else */
}
}
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI_VOID
}
+#endif /* LATER */
+
/*-------------------------------------------------------------------------
* Function: H5V_array_fill
@@ -926,9 +972,8 @@ H5V_array_fill(void *_dst, const void *src, size_t size, size_t count)
size_t copy_items; /* number of items currently copying*/
size_t items_left; /* number of items left to copy */
uint8_t *dst=(uint8_t*)_dst;/* alias for pointer arithmetic */
- herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5V_array_fill, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5V_array_fill)
assert (dst);
assert (src);
@@ -956,8 +1001,7 @@ H5V_array_fill(void *_dst, const void *src, size_t size, size_t count)
if (items_left > 0) /* if there are any items left to copy */
HDmemcpy(dst, _dst, items_left * size);
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* H5V_array_fill() */
@@ -983,9 +1027,8 @@ H5V_array_down(unsigned n, const hsize_t *total_size, hsize_t *down)
{
hsize_t acc; /*accumulator */
int i; /*counter */
- herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5V_array_down, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5V_array_down)
assert(n <= H5V_HYPER_NDIMS);
assert(total_size);
@@ -993,13 +1036,12 @@ H5V_array_down(unsigned n, const hsize_t *total_size, hsize_t *down)
/* Build the sizes of each dimension in the array */
/* (From fastest to slowest) */
- for(i=n-1,acc=1; i>=0; i--) {
+ for(i=(int)(n-1),acc=1; i>=0; i--) {
down[i]=acc;
acc *= total_size[i];
} /* end for */
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5V_array_down() */
@@ -1027,27 +1069,22 @@ done:
*-------------------------------------------------------------------------
*/
hsize_t
-H5V_array_offset_pre(unsigned n, const hsize_t *acc, const hssize_t *offset)
+H5V_array_offset_pre(unsigned n, const hsize_t *acc, const hsize_t *offset)
{
- hsize_t skip; /*starting point byte offset */
int i; /*counter */
hsize_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5V_array_offset_pre, (HDabort(), 0));
+ FUNC_ENTER_NOAPI_NOFUNC(H5V_array_offset_pre)
assert(n <= H5V_HYPER_NDIMS);
assert(acc);
assert(offset);
/* Compute offset in array */
- for (i=(int)(n-1), skip=0; i>=0; --i)
- skip += acc[i] * offset[i];
-
- /* Set return value */
- ret_value=skip;
+ for (i=(int)(n-1), ret_value=0; i>=0; --i)
+ ret_value += acc[i] * offset[i];
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5V_array_offset_pre() */
@@ -1072,12 +1109,12 @@ done:
*-------------------------------------------------------------------------
*/
hsize_t
-H5V_array_offset(unsigned n, const hsize_t *total_size, const hssize_t *offset)
+H5V_array_offset(unsigned n, const hsize_t *total_size, const hsize_t *offset)
{
hsize_t acc_arr[H5V_HYPER_NDIMS]; /* Accumulated size of down dimensions */
hsize_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5V_array_offset, (HDabort(), 0));
+ FUNC_ENTER_NOAPI(H5V_array_offset, (HDabort(), 0)) /*lint !e527 Don't worry about unreachable statement */
assert(n <= H5V_HYPER_NDIMS);
assert(total_size);
@@ -1085,13 +1122,13 @@ H5V_array_offset(unsigned n, const hsize_t *total_size, const hssize_t *offset)
/* Build the sizes of each dimension in the array */
if(H5V_array_down(n,total_size,acc_arr)<0)
- HGOTO_ERROR(H5E_INTERNAL, H5E_BADVALUE, UFAIL, "can't compute down sizes");
+ HGOTO_ERROR(H5E_INTERNAL, H5E_BADVALUE, UFAIL, "can't compute down sizes")
/* Set return value */
ret_value=H5V_array_offset_pre(n,acc_arr,offset);
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5V_array_offset() */
@@ -1116,15 +1153,14 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5V_array_calc(hsize_t offset, unsigned n, const hsize_t *total_size, hssize_t *coords)
+H5V_array_calc(hsize_t offset, unsigned n, const hsize_t *total_size, hsize_t *coords)
{
hsize_t idx[H5V_HYPER_NDIMS]; /* Size of each dimension in bytes */
hsize_t acc; /* Size accumulator */
unsigned u; /* Local index variable */
int i; /* Local index variable */
- herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5V_array_calc, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5V_array_calc)
/* Sanity check */
assert(n <= H5V_HYPER_NDIMS);
@@ -1133,7 +1169,7 @@ H5V_array_calc(hsize_t offset, unsigned n, const hsize_t *total_size, hssize_t *
/* Build the sizes of each dimension in the array */
/* (From fastest to slowest) */
- for(i=n-1,acc=1; i>=0; i--) {
+ for(i=(int)(n-1),acc=1; i>=0; i--) {
idx[i]=acc;
acc *= total_size[i];
} /* end for */
@@ -1144,8 +1180,7 @@ H5V_array_calc(hsize_t offset, unsigned n, const hsize_t *total_size, hssize_t *
offset %= idx[u];
} /* end for */
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5V_array_calc() */
@@ -1192,14 +1227,13 @@ done:
*-------------------------------------------------------------------------
*/
herr_t
-H5V_chunk_index(unsigned ndims, const hssize_t *coord, const size_t *chunk,
+H5V_chunk_index(unsigned ndims, const hsize_t *coord, const size_t *chunk,
const hsize_t *down_nchunks, hsize_t *chunk_idx)
{
- hssize_t scaled_coord[H5V_HYPER_NDIMS]; /* Scaled, coordinates, in terms of chunks */
+ hsize_t scaled_coord[H5V_HYPER_NDIMS]; /* Scaled, coordinates, in terms of chunks */
unsigned u; /* Local index variable */
- herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5V_chunk_index, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5V_chunk_index)
/* Sanity check */
assert(ndims <= H5V_HYPER_NDIMS);
@@ -1208,16 +1242,13 @@ H5V_chunk_index(unsigned ndims, const hssize_t *coord, const size_t *chunk,
assert(chunk_idx);
/* Compute the scaled coordinates for actual coordinates */
- for(u=0; u<ndims; u++) {
- H5_CHECK_OVERFLOW(chunk[u],size_t,hssize_t);
- scaled_coord[u]=coord[u]/(hssize_t)chunk[u];
- } /* end for */
+ for(u=0; u<ndims; u++)
+ scaled_coord[u]=coord[u]/chunk[u];
/* Compute the chunk index */
- *chunk_idx=H5V_array_offset_pre(ndims,down_nchunks,scaled_coord);
+ *chunk_idx=H5V_array_offset_pre(ndims,down_nchunks,scaled_coord); /*lint !e772 scaled_coord will always be initialized */
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5V_chunk_index() */
@@ -1251,11 +1282,12 @@ H5V_memcpyvv(void *_dst,
{
unsigned char *dst; /* Destination buffer pointer */
const unsigned char *src; /* Source buffer pointer */
+ size_t total_size=0; /* Total size of sequence in bytes */
size_t size; /* Size of sequence in bytes */
size_t u,v; /* Local index variables */
- ssize_t ret_value=0; /* Return value */
+ ssize_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5V_memcpyvv, FAIL);
+ FUNC_ENTER_NOAPI_NOFUNC(H5V_memcpyvv)
/* Sanity check */
assert(_dst);
@@ -1299,14 +1331,16 @@ H5V_memcpyvv(void *_dst,
u++;
/* Increment number of bytes copied */
- ret_value+=size;
+ total_size+=size;
} /* end for */
/* Update current sequence vectors */
*dst_curr_seq=u;
*src_curr_seq=v;
-done:
- FUNC_LEAVE_NOAPI(ret_value);
+ /* Set return value */
+ H5_ASSIGN_OVERFLOW(ret_value,total_size,size_t,ssize_t);
+
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5V_memcpyvv() */
diff --git a/src/H5Vprivate.h b/src/H5Vprivate.h
index 71d9489..52f9d6b 100644
--- a/src/H5Vprivate.h
+++ b/src/H5Vprivate.h
@@ -47,51 +47,44 @@
H5_DLL hsize_t H5V_hyper_stride(unsigned n, const hsize_t *size,
const hsize_t *total_size,
- const hssize_t *offset,
- hssize_t *stride);
-H5_DLL htri_t H5V_hyper_disjointp(unsigned n, const hssize_t *offset1,
+ const hsize_t *offset,
+ hsize_t *stride);
+H5_DLL htri_t H5V_hyper_disjointp(unsigned n, const hsize_t *offset1,
const size_t *size1,
- const hssize_t *offset2,
+ const hsize_t *offset2,
const size_t *size2);
-H5_DLL htri_t H5V_hyper_eq(int n, const hssize_t *offset1,
- const hsize_t *size1, const hssize_t *offset2,
+H5_DLL htri_t H5V_hyper_eq(unsigned n, const hsize_t *offset1,
+ const hsize_t *size1, const hsize_t *offset2,
const hsize_t *size2);
H5_DLL herr_t H5V_hyper_fill(unsigned n, const hsize_t *_size,
const hsize_t *total_size,
- const hssize_t *offset, void *_dst,
+ const hsize_t *offset, void *_dst,
unsigned fill_value);
H5_DLL herr_t H5V_hyper_copy(unsigned n, const hsize_t *size,
const hsize_t *dst_total_size,
- const hssize_t *dst_offset, void *_dst,
+ const hsize_t *dst_offset, void *_dst,
const hsize_t *src_total_size,
- const hssize_t *src_offset, const void *_src);
+ const hsize_t *src_offset, const void *_src);
H5_DLL herr_t H5V_stride_fill(unsigned n, hsize_t elmt_size, const hsize_t *size,
- const hssize_t *stride, void *_dst,
+ const hsize_t *stride, void *_dst,
unsigned fill_value);
H5_DLL herr_t H5V_stride_copy(unsigned n, hsize_t elmt_size, const hsize_t *_size,
+ const hsize_t *dst_stride, void *_dst,
+ const hsize_t *src_stride, const void *_src);
+H5_DLL herr_t H5V_stride_copy_s(unsigned n, hsize_t elmt_size, const hsize_t *_size,
const hssize_t *dst_stride, void *_dst,
const hssize_t *src_stride, const void *_src);
-H5_DLL herr_t H5V_stride_copy2(hsize_t nelmts, hsize_t elmt_size, int dst_n,
- const hsize_t *dst_size,
- const hssize_t *dst_stride, void *_dst,
- int src_n, const hsize_t *src_size,
- const hssize_t *src_stride, const void *_src);
-H5_DLL herr_t H5V_stride_optimize1(unsigned *np, hsize_t *elmt_size,
- hsize_t *size, hssize_t *stride1);
-H5_DLL herr_t H5V_stride_optimize2(unsigned *np, hsize_t *elmt_size,
- hsize_t *size, hssize_t *stride1,
- hssize_t *stride2);
H5_DLL herr_t H5V_array_fill(void *_dst, const void *src, size_t size,
size_t count);
H5_DLL herr_t H5V_array_down(unsigned n, const hsize_t *total_size,
hsize_t *down);
H5_DLL hsize_t H5V_array_offset_pre(unsigned n,
- const hsize_t *acc, const hssize_t *offset);
+ const hsize_t *acc, const hsize_t *offset);
H5_DLL hsize_t H5V_array_offset(unsigned n, const hsize_t *total_size,
- const hssize_t *offset);
+ const hsize_t *offset);
H5_DLL herr_t H5V_array_calc(hsize_t offset, unsigned n,
- const hsize_t *total_size, hssize_t *coords);
-H5_DLL herr_t H5V_chunk_index(unsigned ndims, const hssize_t *coord,
+ const hsize_t *total_size, hsize_t *coords);
+H5_DLL herr_t H5V_chunk_index(unsigned ndims, const hsize_t *coord,
const size_t *chunk, const hsize_t *down_nchunks, hsize_t *chunk_idx);
H5_DLL ssize_t H5V_memcpyvv(void *_dst,
size_t dst_max_nseq, size_t *dst_curr_seq, size_t dst_len_arr[], hsize_t dst_off_arr[],
@@ -124,13 +117,13 @@ H5V_vector_reduce_product(unsigned n, const hsize_t *v)
hsize_t ret_value = 1;
/* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5V_vector_reduce_product);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5V_vector_reduce_product)
- if (n && !v) HGOTO_DONE(0);
+ if (n && !v) HGOTO_DONE(0)
while (n--) ret_value *= *v++;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
/*-------------------------------------------------------------------------
@@ -156,16 +149,16 @@ H5V_vector_zerop_u(int n, const hsize_t *v)
htri_t ret_value=TRUE; /* Return value */
/* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5V_vector_zerop_u);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5V_vector_zerop_u)
if (!v)
- HGOTO_DONE(TRUE);
+ HGOTO_DONE(TRUE)
while (n--)
if (*v++)
- HGOTO_DONE(FALSE);
+ HGOTO_DONE(FALSE)
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
/*-------------------------------------------------------------------------
@@ -191,16 +184,16 @@ H5V_vector_zerop_s(int n, const hssize_t *v)
htri_t ret_value=TRUE; /* Return value */
/* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5V_vector_zerop_s);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5V_vector_zerop_s)
if (!v)
- HGOTO_DONE(TRUE);
+ HGOTO_DONE(TRUE)
while (n--)
if (*v++)
- HGOTO_DONE(FALSE);
+ HGOTO_DONE(FALSE)
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
/*-------------------------------------------------------------------------
@@ -223,14 +216,14 @@ done:
*-------------------------------------------------------------------------
*/
static H5_inline int UNUSED
-H5V_vector_cmp_u (int n, const hsize_t *v1, const hsize_t *v2)
+H5V_vector_cmp_u (unsigned n, const hsize_t *v1, const hsize_t *v2)
{
int ret_value=0; /* Return value */
/* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5V_vector_cmp_u);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5V_vector_cmp_u)
- if (v1 == v2) HGOTO_DONE(0);
+ if (v1 == v2) HGOTO_DONE(0)
if (v1 == NULL) HGOTO_DONE(-1)
if (v2 == NULL) HGOTO_DONE(1)
while (n--) {
@@ -241,7 +234,7 @@ H5V_vector_cmp_u (int n, const hsize_t *v1, const hsize_t *v2)
}
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
@@ -270,9 +263,9 @@ H5V_vector_cmp_s (unsigned n, const hssize_t *v1, const hssize_t *v2)
int ret_value=0; /* Return value */
/* Use FUNC_ENTER_NOAPI_NOINIT_NOFUNC here to avoid performance issues */
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5V_vector_cmp_s);
+ FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5V_vector_cmp_s)
- if (v1 == v2) HGOTO_DONE(0);
+ if (v1 == v2) HGOTO_DONE(0)
if (v1 == NULL) HGOTO_DONE(-1)
if (v2 == NULL) HGOTO_DONE(1)
while (n--) {
@@ -283,7 +276,7 @@ H5V_vector_cmp_s (unsigned n, const hssize_t *v1, const hssize_t *v2)
}
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
diff --git a/src/H5Z.c b/src/H5Z.c
index 700cfc6..87fe166 100644
--- a/src/H5Z.c
+++ b/src/H5Z.c
@@ -14,6 +14,9 @@
#define H5Z_PACKAGE /*suppress error about including H5Zpkg */
+/* Interface initialization */
+#define H5_INTERFACE_INIT_FUNC H5Z_init_interface
+
/* Pablo mask */
/* (Put before include files to avoid problems with inline functions) */
#define PABLO_MASK H5Z_mask
@@ -28,11 +31,6 @@
#include "H5Sprivate.h" /* Dataspace functions */
#include "H5Zpkg.h" /* Data filters */
-/* Interface initialization */
-#define INTERFACE_INIT H5Z_init_interface
-static int interface_initialize_g = 0;
-static herr_t H5Z_init_interface (void);
-
/* Local typedefs */
#ifdef H5Z_DEBUG
typedef struct H5Z_stats_t {
@@ -130,7 +128,7 @@ H5Z_term_interface (void)
char comment[16], bandwidth[32];
#endif
- if (interface_initialize_g) {
+ if (H5_interface_initialize_g) {
#ifdef H5Z_DEBUG
if (H5DEBUG(Z)) {
for (i=0; i<H5Z_table_used_g; i++) {
@@ -185,7 +183,7 @@ H5Z_term_interface (void)
H5Z_stat_table_g = H5MM_xfree(H5Z_stat_table_g);
#endif /* H5Z_DEBUG */
H5Z_table_used_g = H5Z_table_alloc_g = 0;
- interface_initialize_g = 0;
+ H5_interface_initialize_g = 0;
}
return 0;
}
@@ -660,7 +658,7 @@ herr_t
H5Z_can_apply (hid_t dcpl_id, hid_t type_id)
{
herr_t ret_value=SUCCEED; /* Return value */
-
+
FUNC_ENTER_NOAPI(H5Z_can_apply,FAIL)
assert (H5I_GENPROP_LST==H5I_get_type(dcpl_id));
@@ -668,7 +666,7 @@ H5Z_can_apply (hid_t dcpl_id, hid_t type_id)
/* Make "can apply" callbacks for filters in pipeline */
if(H5Z_prelude_callback(dcpl_id, type_id, H5Z_PRELUDE_CAN_APPLY)<0)
- HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "filter parameters not appropriate")
+ HGOTO_ERROR(H5E_PLINE, H5E_CANAPPLY, FAIL, "unable to apply filter")
done:
FUNC_LEAVE_NOAPI(ret_value)
diff --git a/src/H5Zdeflate.c b/src/H5Zdeflate.c
index e83cd86..3202221 100644
--- a/src/H5Zdeflate.c
+++ b/src/H5Zdeflate.c
@@ -19,6 +19,10 @@
#define H5Z_PACKAGE /*suppress error about including H5Zpkg */
+/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
+#define PABLO_MASK H5Z_deflate_mask
+
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5MMprivate.h" /* Memory management */
@@ -30,11 +34,6 @@
# include "zlib.h"
#endif
-/* Interface initialization */
-#define PABLO_MASK H5Z_deflate_mask
-#define INTERFACE_INIT NULL
-static int interface_initialize_g = 0;
-
/* Local function prototypes */
static size_t H5Z_filter_deflate (unsigned flags, size_t cd_nelmts,
const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf);
@@ -76,11 +75,11 @@ H5Z_filter_deflate (unsigned flags, size_t cd_nelmts,
int status; /* Status from zlib operation */
size_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5Z_filter_deflate, 0);
+ FUNC_ENTER_NOAPI(H5Z_filter_deflate, 0)
/* Check arguments */
if (cd_nelmts!=1 || cd_values[0]>9)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid deflate aggression level");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid deflate aggression level")
if (flags & H5Z_FLAG_REVERSE) {
/* Input; uncompress */
@@ -89,7 +88,7 @@ H5Z_filter_deflate (unsigned flags, size_t cd_nelmts,
/* Allocate space for the compressed buffer */
if (NULL==(outbuf = H5MM_malloc(nalloc)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed for deflate uncompression");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed for deflate uncompression")
/* Set the uncompression parameters */
HDmemset(&z_strm, 0, sizeof(z_strm));
@@ -100,10 +99,10 @@ H5Z_filter_deflate (unsigned flags, size_t cd_nelmts,
/* Initialize the uncompression routines */
if (Z_OK!=inflateInit(&z_strm))
- HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, 0, "inflateInit() failed");
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, 0, "inflateInit() failed")
/* Loop to uncompress the buffer */
- while (1) {
+ do {
/* Uncompress some data */
status = inflate(&z_strm, Z_SYNC_FLUSH);
@@ -113,24 +112,25 @@ H5Z_filter_deflate (unsigned flags, size_t cd_nelmts,
/* Check for error */
if (Z_OK!=status) {
- inflateEnd(&z_strm);
- HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, 0, "inflate() failed");
+ (void)inflateEnd(&z_strm);
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, 0, "inflate() failed")
}
-
- /* If we're not done and just ran out of buffer space, get more */
- if (Z_OK==status && 0==z_strm.avail_out) {
- /* Allocate a buffer twice as big */
- nalloc *= 2;
- if (NULL==(outbuf = H5MM_realloc(outbuf, nalloc))) {
- inflateEnd(&z_strm);
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed for deflate uncompression");
- }
-
- /* Update pointers to buffer for next set of uncompressed data */
- z_strm.next_out = (unsigned char*)outbuf + z_strm.total_out;
- z_strm.avail_out = (uInt)(nalloc - z_strm.total_out);
- }
- }
+ else {
+ /* If we're not done and just ran out of buffer space, get more */
+ if (0==z_strm.avail_out) {
+ /* Allocate a buffer twice as big */
+ nalloc *= 2;
+ if (NULL==(outbuf = H5MM_realloc(outbuf, nalloc))) {
+ (void)inflateEnd(&z_strm);
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed for deflate uncompression")
+ }
+
+ /* Update pointers to buffer for next set of uncompressed data */
+ z_strm.next_out = (unsigned char*)outbuf + z_strm.total_out;
+ z_strm.avail_out = (uInt)(nalloc - z_strm.total_out);
+ }
+ } /* end else */
+ } while(status==Z_OK);
/* Free the input buffer */
H5MM_xfree(*buf);
@@ -142,7 +142,7 @@ H5Z_filter_deflate (unsigned flags, size_t cd_nelmts,
ret_value = z_strm.total_out;
/* Finish uncompressing the stream */
- inflateEnd(&z_strm);
+ (void)inflateEnd(&z_strm);
}
else {
/*
@@ -157,23 +157,22 @@ H5Z_filter_deflate (unsigned flags, size_t cd_nelmts,
int aggression; /* Compression aggression setting */
/* Set the compression aggression level */
- aggression = cd_values[0];
+ H5_ASSIGN_OVERFLOW(aggression,cd_values[0],unsigned,int);
/* Allocate output (compressed) buffer */
if (NULL==(z_dst=outbuf=H5MM_malloc(z_dst_nbytes)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "unable to allocate deflate destination buffer");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "unable to allocate deflate destination buffer")
/* Perform compression from the source to the destination buffer */
status = compress2 (z_dst, &z_dst_nbytes, z_src, z_src_nbytes, aggression);
/* Check for various zlib errors */
- if (Z_BUF_ERROR==status) {
- HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, 0, "overflow");
- } else if (Z_MEM_ERROR==status) {
- HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, 0, "deflate memory error");
- } else if (Z_OK!=status) {
- HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, 0, "other deflate error");
- }
+ if (Z_BUF_ERROR==status)
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, 0, "overflow")
+ else if (Z_MEM_ERROR==status)
+ HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, 0, "deflate memory error")
+ else if (Z_OK!=status)
+ HGOTO_ERROR (H5E_PLINE, H5E_CANTINIT, 0, "other deflate error")
/* Successfully uncompressed the buffer */
else {
/* Free the input buffer */
@@ -190,7 +189,7 @@ H5Z_filter_deflate (unsigned flags, size_t cd_nelmts,
done:
if(outbuf)
H5MM_xfree(outbuf);
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
#endif /* H5_HAVE_FILTER_DEFLATE */
diff --git a/src/H5Zfletcher32.c b/src/H5Zfletcher32.c
index 48e7aea..dfd69cf 100644
--- a/src/H5Zfletcher32.c
+++ b/src/H5Zfletcher32.c
@@ -19,6 +19,10 @@
#define H5Z_PACKAGE /*suppress error about including H5Zpkg */
+/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
+#define PABLO_MASK H5Z_fletcher32_mask
+
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5Fprivate.h" /* File access */
@@ -27,11 +31,6 @@
#ifdef H5_HAVE_FILTER_FLETCHER32
-/* Interface initialization */
-#define PABLO_MASK H5Z_fletcher32_mask
-#define INTERFACE_INIT NULL
-static int interface_initialize_g = 0;
-
/* Local function prototypes */
static size_t H5Z_filter_fletcher32 (unsigned flags, size_t cd_nelmts,
const unsigned cd_values[], size_t nbytes, size_t *buf_size, void **buf);
@@ -130,6 +129,7 @@ H5Z_filter_fletcher32_compute(void *_src, size_t len)
*
*-------------------------------------------------------------------------
*/
+/* ARGSUSED */
static size_t
H5Z_filter_fletcher32 (unsigned flags, size_t UNUSED cd_nelmts, const unsigned UNUSED cd_values[],
size_t nbytes, size_t *buf_size, void **buf)
@@ -139,7 +139,7 @@ H5Z_filter_fletcher32 (unsigned flags, size_t UNUSED cd_nelmts, const unsigned U
uint32_t fletcher; /* Checksum value */
size_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5Z_filter_fletcher32, 0);
+ FUNC_ENTER_NOAPI(H5Z_filter_fletcher32, 0)
assert(sizeof(uint32_t)>=4);
@@ -157,11 +157,11 @@ H5Z_filter_fletcher32 (unsigned flags, size_t UNUSED cd_nelmts, const unsigned U
UINT32DECODE(tmp_src, stored_fletcher);
/* Compute checksum (can't fail) */
- fletcher = H5Z_filter_fletcher32_compute((unsigned short*)src,src_nbytes);
+ fletcher = H5Z_filter_fletcher32_compute(src,src_nbytes);
/* Verify computed checksum matches stored checksum */
if(stored_fletcher != fletcher)
- HGOTO_ERROR(H5E_STORAGE, H5E_READERROR, 0, "data error detected by Fletcher32 checksum");
+ HGOTO_ERROR(H5E_STORAGE, H5E_READERROR, 0, "data error detected by Fletcher32 checksum")
}
/* Set return values */
@@ -171,10 +171,10 @@ H5Z_filter_fletcher32 (unsigned flags, size_t UNUSED cd_nelmts, const unsigned U
unsigned char *dst; /* Temporary pointer to destination buffer */
/* Compute checksum (can't fail) */
- fletcher = H5Z_filter_fletcher32_compute((unsigned short*)src,nbytes);
+ 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");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "unable to allocate Fletcher32 checksum destination buffer")
/* Copy raw data */
HDmemcpy((void*)dst, (void*)(*buf), nbytes);
@@ -196,7 +196,7 @@ H5Z_filter_fletcher32 (unsigned flags, size_t UNUSED cd_nelmts, const unsigned U
done:
if(outbuf)
H5MM_xfree(outbuf);
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
#endif /* H5_HAVE_FILTER_FLETCHER32 */
diff --git a/src/H5Zpublic.h b/src/H5Zpublic.h
index e4db1b0..f8189b2 100644
--- a/src/H5Zpublic.h
+++ b/src/H5Zpublic.h
@@ -81,7 +81,7 @@ typedef enum H5Z_cb_return_t {
/* Filter callback function definition */
typedef H5Z_cb_return_t (*H5Z_filter_func_t)(H5Z_filter_t filter, void* buf,
size_t buf_size, void* op_data);
-
+
/* Structure for filter callback property */
typedef struct H5Z_cb_t {
H5Z_filter_func_t func;
diff --git a/src/H5Zshuffle.c b/src/H5Zshuffle.c
index 60dad91..36b6f23 100644
--- a/src/H5Zshuffle.c
+++ b/src/H5Zshuffle.c
@@ -14,6 +14,10 @@
#define H5Z_PACKAGE /*suppress error about including H5Zpkg */
+/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
+#define PABLO_MASK H5Z_shuffle_mask
+
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5MMprivate.h" /* Memory management */
@@ -23,11 +27,6 @@
#ifdef H5_HAVE_FILTER_SHUFFLE
-/* Interface initialization */
-#define PABLO_MASK H5Z_shuffle_mask
-#define INTERFACE_INIT NULL
-static int interface_initialize_g = 0;
-
/* Local function prototypes */
static herr_t H5Z_set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t space_id);
static size_t H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts,
@@ -64,6 +63,7 @@ const H5Z_class_t H5Z_SHUFFLE[1] = {{
*
*-------------------------------------------------------------------------
*/
+/* ARGSUSED */
static herr_t
H5Z_set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t UNUSED space_id)
{
@@ -72,22 +72,22 @@ H5Z_set_local_shuffle(hid_t dcpl_id, hid_t type_id, hid_t UNUSED space_id)
unsigned cd_values[H5Z_SHUFFLE_TOTAL_NPARMS]; /* Filter parameters */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5Z_set_local_shuffle, FAIL);
+ FUNC_ENTER_NOAPI(H5Z_set_local_shuffle, FAIL)
/* Get the filter's current parameters */
if(H5Pget_filter_by_id(dcpl_id,H5Z_FILTER_SHUFFLE,&flags,&cd_nelmts, cd_values,0,NULL)<0)
- HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get shuffle parameters");
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "can't get shuffle parameters")
/* Set "local" parameter for this dataset */
if((cd_values[H5Z_SHUFFLE_PARM_SIZE]=(unsigned)H5Tget_size(type_id))==0)
- HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size");
+ HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size")
/* Modify the filter's parameters for this dataset */
if(H5Pmodify_filter(dcpl_id, H5Z_FILTER_SHUFFLE, flags, H5Z_SHUFFLE_TOTAL_NPARMS, cd_values)<0)
- HGOTO_ERROR(H5E_PLINE, H5E_CANTSET, FAIL, "can't set local shuffle parameters");
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTSET, FAIL, "can't set local shuffle parameters")
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5Z_set_local_shuffle() */
@@ -126,11 +126,11 @@ H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
size_t leftover; /* Extra bytes at end of buffer */
size_t ret_value; /* Return value */
- FUNC_ENTER_NOAPI(H5Z_filter_shuffle, 0);
+ FUNC_ENTER_NOAPI(H5Z_filter_shuffle, 0)
/* Check arguments */
if (cd_nelmts!=H5Z_SHUFFLE_TOTAL_NPARMS || cd_values[H5Z_SHUFFLE_PARM_SIZE]==0)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid shuffle parameters");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid shuffle parameters")
/* Get the number of bytes per element from the parameter block */
bytesoftype=cd_values[H5Z_SHUFFLE_PARM_SIZE];
@@ -145,7 +145,7 @@ H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
/* Allocate the destination buffer */
if (NULL==(dest = H5MM_malloc(nbytes)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed for shuffle buffer");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed for shuffle buffer")
if(flags & H5Z_FLAG_REVERSE) {
/* Get the pointer to the source buffer */
@@ -163,7 +163,7 @@ H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
/* Add leftover to the end of data */
if(leftover>0) {
/* Adjust back to end of shuffled bytes */
- _dest -= (bytesoftype - 1);
+ _dest -= (bytesoftype - 1); /*lint !e794 _dest is initialized */
HDmemcpy((void*)_dest, (void*)_src, leftover);
}
} /* end if */
@@ -183,7 +183,7 @@ H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
/* Add leftover to the end of data */
if(leftover>0) {
/* Adjust back to end of shuffled bytes */
- _src -= (bytesoftype - 1);
+ _src -= (bytesoftype - 1); /*lint !e794 _src is initialized */
HDmemcpy((void*)_dest, (void*)_src, leftover);
}
} /* end else */
@@ -200,7 +200,7 @@ H5Z_filter_shuffle(unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
ret_value = nbytes;
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
#endif /*H5_HAVE_FILTER_SHUFFLE */
diff --git a/src/H5Zszip.c b/src/H5Zszip.c
index 48efb81..64dbf70 100644
--- a/src/H5Zszip.c
+++ b/src/H5Zszip.c
@@ -14,6 +14,10 @@
#define H5Z_PACKAGE /*suppress error about including H5Zpkg */
+/* Pablo information */
+/* (Put before include files to avoid problems with inline functions) */
+#define PABLO_MASK H5Z_szip_mask
+
#include "H5private.h" /* Generic Functions */
#include "H5Eprivate.h" /* Error handling */
#include "H5Fprivate.h" /* File access */
@@ -29,11 +33,6 @@
# include "szlib.h"
#endif
-/* Interface initialization */
-#define PABLO_MASK H5Z_szip_mask
-#define INTERFACE_INIT NULL
-static int interface_initialize_g = 0;
-
/* Local function prototypes */
static herr_t H5Z_can_apply_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id);
static herr_t H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id);
@@ -84,31 +83,31 @@ const H5Z_class_t H5Z_SZIP[1] = {{
static herr_t
H5Z_can_apply_szip(hid_t UNUSED dcpl_id, hid_t type_id, hid_t UNUSED space_id)
{
- int dtype_size; /* Datatype's size (in bits) */
+ unsigned dtype_size; /* Datatype's size (in bits) */
H5T_order_t dtype_order; /* Datatype's endianness order */
herr_t ret_value=TRUE; /* Return value */
- FUNC_ENTER_NOAPI(H5Z_can_apply_szip, FAIL);
+ FUNC_ENTER_NOAPI(H5Z_can_apply_szip, FAIL)
/* Get datatype's size, for checking the "bits-per-pixel" */
if((dtype_size=(8*H5Tget_size(type_id)))==0)
- HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size");
+ HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype size")
/* Range check datatype's size */
if(dtype_size>32 && dtype_size!=64)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FALSE, "invalid datatype size");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FALSE, "invalid datatype size")
/* Get datatype's endianness order */
if((dtype_order=H5Tget_order(type_id))==H5T_ORDER_ERROR)
- HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "can't retrieve datatype endianness order");
+ HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "can't retrieve datatype endianness order")
/* Range check datatype's endianness order */
/* (Note: this may not handle non-atomic datatypes well) */
if(dtype_order != H5T_ORDER_LE && dtype_order != H5T_ORDER_BE)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FALSE, "invalid datatype endianness order");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FALSE, "invalid datatype endianness order")
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5Z_can_apply_szip() */
@@ -144,11 +143,11 @@ H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id)
H5T_order_t dtype_order; /* Datatype's endianness order */
int dtype_size; /* Datatype's size (in bits) */
size_t dtype_precision; /* Datatype's precision (in bits) */
- size_t dtype_offset; /* Datatype's precision (in bits) */
+ size_t dtype_offset; /* Datatype's offset (in bits) */
hsize_t scanline; /* Size of dataspace's fastest changing dimension */
herr_t ret_value=SUCCEED; /* Return value */
- FUNC_ENTER_NOAPI(H5Z_set_local_szip, FAIL);
+ FUNC_ENTER_NOAPI(H5Z_set_local_szip, FAIL)
/* Get the filter's current parameters */
if(H5Pget_filter_by_id(dcpl_id,H5Z_FILTER_SZIP,&flags,&cd_nelmts, cd_values,0,NULL)<0)
@@ -181,7 +180,7 @@ H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id)
/* Get dimensions for dataspace */
if ((ndims=H5Sget_simple_extent_dims(space_id, dims, NULL))<0)
- HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "unable to get dataspace dimensions");
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTGET, FAIL, "unable to get dataspace dimensions")
/* Set "local" parameter for this dataset's "pixels-per-scanline" */
/* (Use the chunk's fastest changing dimension size) */
@@ -216,7 +215,7 @@ H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id)
/* 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");
+ HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype endianness order")
/* Set the correct endianness flag for szip */
/* (Note: this may not handle non-atomic datatypes well) */
@@ -231,15 +230,15 @@ H5Z_set_local_szip(hid_t dcpl_id, hid_t type_id, hid_t space_id)
break;
default:
- HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype endianness order");
+ HGOTO_ERROR(H5E_PLINE, H5E_BADTYPE, FAIL, "bad datatype endianness order")
} /* end switch */
/* Modify the filter's parameters for this dataset */
if(H5Pmodify_filter(dcpl_id, H5Z_FILTER_SZIP, flags, H5Z_SZIP_TOTAL_NPARMS, cd_values)<0)
- HGOTO_ERROR(H5E_PLINE, H5E_CANTSET, FAIL, "can't set local szip parameters");
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTSET, FAIL, "can't set local szip parameters")
done:
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
} /* end H5Z_set_local_szip() */
@@ -271,7 +270,7 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
unsigned char *newbuf = NULL; /* Pointer to input buffer */
SZ_com_t sz_param; /* szip parameter block */
- FUNC_ENTER_NOAPI(H5Z_filter_szip, 0);
+ FUNC_ENTER_NOAPI(H5Z_filter_szip, 0)
/* Sanity check to make certain that we haven't drifted out of date with
* the mask options from the szlib.h header */
@@ -285,13 +284,13 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
/* Check arguments */
if (cd_nelmts!=4)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid deflate aggression level");
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, 0, "invalid deflate aggression level")
/* Copy the filter parameters into the szip parameter block */
- sz_param.options_mask = cd_values[H5Z_SZIP_PARM_MASK];
- sz_param.bits_per_pixel = cd_values[H5Z_SZIP_PARM_BPP];
- sz_param.pixels_per_block = cd_values[H5Z_SZIP_PARM_PPB];
- sz_param.pixels_per_scanline = cd_values[H5Z_SZIP_PARM_PPS];
+ H5_ASSIGN_OVERFLOW(sz_param.options_mask,cd_values[H5Z_SZIP_PARM_MASK],unsigned,int);
+ H5_ASSIGN_OVERFLOW(sz_param.bits_per_pixel,cd_values[H5Z_SZIP_PARM_BPP],unsigned,int);
+ H5_ASSIGN_OVERFLOW(sz_param.pixels_per_block,cd_values[H5Z_SZIP_PARM_PPB],unsigned,int);
+ H5_ASSIGN_OVERFLOW(sz_param.pixels_per_scanline,cd_values[H5Z_SZIP_PARM_PPS],unsigned,int);
/* Input; uncompress */
if (flags & H5Z_FLAG_REVERSE) {
@@ -305,12 +304,12 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
/* Allocate space for the uncompressed buffer */
if(NULL==(outbuf = H5MM_malloc(nalloc)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed for szip decompression");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "memory allocation failed for szip decompression")
/* Decompress the buffer */
size_out=nalloc;
if(SZ_BufftoBuffDecompress(outbuf, &size_out, newbuf, nbytes-4, &sz_param) != SZ_OK)
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "szip_filter: decompression failed");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "szip_filter: decompression failed")
assert(size_out==nalloc);
/* Free the input buffer */
@@ -328,7 +327,7 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
/* Allocate space for the compressed buffer & header (assume data won't get bigger) */
if(NULL==(dst=outbuf = H5MM_malloc(nbytes+4)))
- HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "unable to allocate szip destination buffer");
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, 0, "unable to allocate szip destination buffer")
/* Encode the uncompressed length */
H5_CHECK_OVERFLOW(nbytes,size_t,uint32_t);
@@ -337,7 +336,7 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
/* Compress the buffer */
size_out = nbytes;
if(SZ_OK!= SZ_BufftoBuffCompress(dst, &size_out, *buf, nbytes, &sz_param))
- HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, 0, "overflow");
+ HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, 0, "overflow")
assert(size_out<=nbytes);
/* Free the input buffer */
@@ -353,7 +352,7 @@ H5Z_filter_szip (unsigned flags, size_t cd_nelmts, const unsigned cd_values[],
done:
if(outbuf)
H5MM_xfree(outbuf);
- FUNC_LEAVE_NOAPI(ret_value);
+ FUNC_LEAVE_NOAPI(ret_value)
}
#endif /* H5_HAVE_FILTER_SZIP */
diff --git a/src/H5config.h.in b/src/H5config.h.in
index 365122d..dff3207 100644
--- a/src/H5config.h.in
+++ b/src/H5config.h.in
@@ -503,9 +503,6 @@
PTHREAD_SCOPE_SYSTEM) call. */
#undef SYSTEM_SCOPE_THREADS
-/* Define if szip encoder is present */
-#undef SZIP_CAN_ENCODE
-
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#undef TIME_WITH_SYS_TIME
diff --git a/src/H5detect.c b/src/H5detect.c
index 6cf519f..ec99b49 100644
--- a/src/H5detect.c
+++ b/src/H5detect.c
@@ -493,41 +493,26 @@ sigbus_handler(int UNUSED signo)
static void
print_results(int nd, detected_t *d, int na, malign_t *misc_align)
{
-
+ int byte_order=0;
int i, j;
/* Include files */
printf("\
#define H5T_PACKAGE /*suppress error about including H5Tpkg.h*/\n\
-#define PABLO_MASK H5Tinit_mask\n\
+#define PABLO_MASK H5T_init_mask\n\
\n\
#include \"H5private.h\"\n\
#include \"H5Iprivate.h\"\n\
#include \"H5Eprivate.h\"\n\
#include \"H5FLprivate.h\"\n\
-#include \"H5MMprivate.h\"\n\
#include \"H5Tpkg.h\"\n\
\n\
-static int interface_initialize_g = 0;\n\
-#define INTERFACE_INIT NULL\n\
-\n\
-/* Declare external the free list for H5T_t's */\n\
+/* Declare external the free lists for H5T_t's and H5T_shared_t's */\n\
H5FL_EXTERN(H5T_t);\n\
H5FL_EXTERN(H5T_shared_t);\n\
\n\
\n");
- /* The interface termination function */
- printf("\n\
-int\n\
-H5TN_term_interface(void)\n\
-{\n\
- interface_initialize_g = 0;\n\
- FUNC_ENTER_NOAPI_NOINIT_NOFUNC(H5TN_term_interface);\n\
- \n\
- FUNC_LEAVE_NOAPI(0);\n\
-}\n");
-
/* The interface initialization function */
printf("\n\
herr_t\n\
@@ -538,6 +523,18 @@ H5TN_init_interface(void)\n\
\n\
FUNC_ENTER_NOAPI(H5TN_init_interface, FAIL);\n");
+ /* The native endianess of this machine */
+ /* (Use the byte-order of a reasonably large type) */
+ for (i = 0; i < nd; i++)
+ if(d[i].size>1) {
+ byte_order=d[i].perm[0];
+ break;
+ } /* end if */
+ printf("\n\
+ /* Set the native order for this machine */\n\
+ H5T_native_order_g = H5T_ORDER_%s;\n",
+ byte_order ? "BE" : "LE"); /*byte order */
+
for (i = 0; i < nd; i++) {
/* Print a comment to describe this section of definitions. */
@@ -568,6 +565,7 @@ H5TN_init_interface(void)\n\
d[i].perm[0] ? "BE" : "LE", /*byte order */
d[i].offset, /*offset */
d[i].precision); /*precision */
+ assert(d[i].size<2 || (d[i].perm[0]>0)==(byte_order>0)); /* Double-check that byte-order doesn't change */
if (0 == d[i].msize) {
/* The part unique to fixed point types */
diff --git a/src/H5private.h b/src/H5private.h
index d8f7f15..526717c 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -289,7 +289,7 @@
# define FALSE 0
#endif
#ifndef TRUE
-# define TRUE (!FALSE)
+# define TRUE 1
#endif
/*
@@ -844,9 +844,9 @@ H5_DLL int64_t HDstrtoll (const char *s, const char **rest, int base);
#define HDuname(S) uname(S)
#define HDungetc(C,F) ungetc(C,F)
#ifdef WIN32
-#define HDunlink(S) _unlink(S)
+#define HDunlink(S) _unlink(S)
#else
-#define HDunlink(S) unlink(S)
+#define HDunlink(S) unlink(S)
#endif
#define HDutime(S,T) utime(S,T)
#define HDva_arg(A,T) va_arg(A,T)
@@ -1125,6 +1125,25 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */
assert(func_name)
#endif /* H5_HAVE_FUNCTION */
+/* Macros for defining interface initialization routines */
+#ifdef H5_INTERFACE_INIT_FUNC
+static int H5_interface_initialize_g = 0;
+static herr_t H5_INTERFACE_INIT_FUNC(void);
+#define H5_INTERFACE_INIT(err) \
+ /* Initialize this interface or bust */ \
+ if (!H5_interface_initialize_g) { \
+ H5_interface_initialize_g = 1; \
+ if (H5_INTERFACE_INIT_FUNC()<0) { \
+ H5_interface_initialize_g = 0; \
+ HGOTO_ERROR (H5E_FUNC, H5E_CANTINIT, err, \
+ "interface initialization failed") \
+ } \
+ }
+#else /* H5_INTERFACE_INIT_FUNC */
+#define H5_INTERFACE_INIT(err)
+#endif /* H5_INTERFACE_INIT_FUNC */
+
+
#define FUNC_ENTER_COMMON_NOFUNC(func_name,asrt) \
PABLO_SAVE (ID_ ## func_name) \
\
@@ -1165,7 +1184,7 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */
FUNC_ENTER_API_VARS(func_name) \
FUNC_ENTER_COMMON(func_name,H5_IS_API(#func_name)); \
FUNC_ENTER_API_THREADSAFE; \
- FUNC_ENTER_API_COMMON(func_name,INTERFACE_INIT,err); \
+ FUNC_ENTER_API_COMMON(func_name,err); \
/* Clear thread error stack entering public functions */ \
H5E_clear(); \
{
@@ -1178,7 +1197,7 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */
FUNC_ENTER_API_VARS(func_name) \
FUNC_ENTER_COMMON(func_name,H5_IS_API(#func_name)); \
FUNC_ENTER_API_THREADSAFE; \
- FUNC_ENTER_API_COMMON(func_name,INTERFACE_INIT,err); \
+ FUNC_ENTER_API_COMMON(func_name,err); \
{
/*
@@ -1198,7 +1217,13 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */
/* Use this macro for all "normal" non-API functions */
#define FUNC_ENTER_NOAPI(func_name,err) { \
FUNC_ENTER_COMMON(func_name,!H5_IS_API(#func_name)); \
- FUNC_ENTER_NOAPI_INIT(func_name,INTERFACE_INIT,err) \
+ FUNC_ENTER_NOAPI_INIT(func_name,err) \
+ {
+
+/* Use this macro for all non-API functions which don't issue errors */
+#define FUNC_ENTER_NOAPI_NOFUNC(func_name) { \
+ FUNC_ENTER_COMMON_NOFUNC(func_name,!H5_IS_API(#func_name)); \
+ FUNC_ENTER_NOAPI_INIT(func_name,err) \
{
/*
@@ -1235,12 +1260,16 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */
* 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_NOFS(func_name) { \
- FUNC_ENTER_COMMON(func_name,!H5_IS_API(#func_name)); \
+#define FUNC_ENTER_NOAPI_NOFUNC_NOFS(func_name) { \
+ FUNC_ENTER_COMMON_NOFUNC(func_name,!H5_IS_API(#func_name)); \
{
-#define FUNC_ENTER_API_COMMON(func_name,interface_init_func,err) \
+#define FUNC_ENTER_API_COMMON(func_name,err) \
/* Initialize the library */ \
if (!(H5_INIT_GLOBAL)) { \
H5_INIT_GLOBAL = TRUE; \
@@ -1249,33 +1278,17 @@ extern hbool_t H5_MPEinit_g; /* Has the MPE Library been initialized? */
"library initialization failed") \
} \
\
- /* Initialize this interface or bust */ \
- if (!interface_initialize_g) { \
- interface_initialize_g = 1; \
- if (interface_init_func && \
- ((herr_t(*)(void))interface_init_func)()<0) { \
- interface_initialize_g = 0; \
- HGOTO_ERROR (H5E_FUNC, H5E_CANTINIT, err, \
- "interface initialization failed"); \
- } \
- } \
+ /* Initialize the interface, if appropriate */ \
+ H5_INTERFACE_INIT(err) \
\
/* Push the name of this function on the function stack */ \
H5_PUSH_FUNC(func_name); \
\
BEGIN_MPE_LOG(func_name)
-#define FUNC_ENTER_NOAPI_INIT(func_name,interface_init_func,err) \
- /* Initialize this interface or bust */ \
- if (!interface_initialize_g) { \
- interface_initialize_g = 1; \
- if (interface_init_func && \
- ((herr_t(*)(void))interface_init_func)()<0) { \
- interface_initialize_g = 0; \
- HGOTO_ERROR (H5E_FUNC, H5E_CANTINIT, err, \
- "interface initialization failed"); \
- } \
- } \
+#define FUNC_ENTER_NOAPI_INIT(func_name,err) \
+ /* Initialize the interface, if appropriate */ \
+ H5_INTERFACE_INIT(err) \
\
/* Push the name of this function on the function stack */ \
H5_PUSH_FUNC(func_name);
@@ -1362,7 +1375,6 @@ H5_DLL int H5I_term_interface(void);
H5_DLL int H5P_term_interface(void);
H5_DLL int H5R_term_interface(void);
H5_DLL int H5S_term_interface(void);
-H5_DLL int H5TN_term_interface(void);
H5_DLL int H5T_term_interface(void);
H5_DLL int H5Z_term_interface(void);
diff --git a/src/H5public.h b/src/H5public.h
index d23cb0f..0753003 100644
--- a/src/H5public.h
+++ b/src/H5public.h
@@ -12,9 +12,6 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* $Id$ */
-
-
/*
* This file contains public declarations for the HDF5 module.
*/
@@ -165,36 +162,52 @@ typedef ssize_t hssize_t;
#if H5_SIZEOF_INT64_T>=8
typedef uint64_t haddr_t;
# define HADDR_UNDEF ((haddr_t)(int64_t)(-1))
+# define H5_SIZEOF_HADDR_T H5_SIZEOF_INT64_T
# ifdef H5_HAVE_PARALLEL
# define HADDR_AS_MPI_TYPE MPI_LONG_LONG_INT
# endif /* H5_HAVE_PARALLEL */
#elif H5_SIZEOF_INT>=8
typedef unsigned haddr_t;
# define HADDR_UNDEF ((haddr_t)(-1))
+# define H5_SIZEOF_HADDR_T H5_SIZEOF_INT
# ifdef H5_HAVE_PARALLEL
# define HADDR_AS_MPI_TYPE MPI_UNSIGNED
# endif /* H5_HAVE_PARALLEL */
#elif H5_SIZEOF_LONG>=8
typedef unsigned long haddr_t;
# define HADDR_UNDEF ((haddr_t)(long)(-1))
+# define H5_SIZEOF_HADDR_T H5_SIZEOF_LONG
# ifdef H5_HAVE_PARALLEL
# define HADDR_AS_MPI_TYPE MPI_UNSIGNED_LONG
# endif /* H5_HAVE_PARALLEL */
#elif H5_SIZEOF_LONG_LONG>=8
typedef unsigned long long haddr_t;
# define HADDR_UNDEF ((haddr_t)(long long)(-1))
+# define H5_SIZEOF_HADDR_T H5_SIZEOF_LONG_LONG
# ifdef H5_HAVE_PARALLEL
# define HADDR_AS_MPI_TYPE MPI_LONG_LONG_INT
# endif /* H5_HAVE_PARALLEL */
#elif H5_SIZEOF___INT64>=8
typedef unsigned __int64 haddr_t;
# define HADDR_UNDEF ((haddr_t)(__int64)(-1))
+# define H5_SIZEOF_HADDR_T H5_SIZEOF___INT64
# ifdef H5_HAVE_PARALLEL
# define HADDR_AS_MPI_TYPE MPI_LONG_LONG_INT
# endif /* H5_HAVE_PARALLEL */
#else
# error "nothing appropriate for haddr_t"
#endif
+#if H5_SIZEOF_HADDR_T ==H5_SIZEOF_INT
+# define H5_PRINTF_HADDR_FMT "%u"
+#elif H5_SIZEOF_HADDR_T ==H5_SIZEOF_LONG
+# define H5_PRINTF_HADDR_FMT "%lu"
+#elif H5_SIZEOF_HADDR_T ==H5_SIZEOF_LONG_LONG
+# define H5_PRINTF_HADDR_FMT "%"H5_PRINTF_LL_WIDTH"u"
+#elif H5_SIZEOF_HADDR_T ==H5_SIZEOF___INT64
+# define H5_PRINTF_HADDR_FMT "%"H5_PRINTF_LL_WIDTH"u"
+#else
+# error "nothing appropriate for H5_PRINTF_HADDR_FMT"
+#endif
#define HADDR_MAX (HADDR_UNDEF-1)
/* Functions in H5.c */
diff --git a/src/Makefile.in b/src/Makefile.in
index 9247513..8d5ed7a 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -32,7 +32,7 @@ DISTCLEAN=libhdf5.settings
## Source and object files for the library (lexicographically)...
LIB_SRC=H5.c H5A.c H5AC.c H5B.c H5C.c H5D.c H5Dcontig.c H5Dcompact.c H5Defl.c \
H5Dio.c H5Distore.c H5Dmpio.c H5Dselect.c H5Dtest.c H5E.c H5F.c \
- H5FD.c \
+ H5Fdbg.c H5FD.c \
H5FDcore.c H5FDfamily.c H5FDgass.c H5FDlog.c H5FDmpi.c H5FDmpio.c \
H5FDmpiposix.c H5FDmulti.c H5FDsec2.c H5FDsrb.c H5FDstdio.c \
H5FDstream.c H5FL.c H5FO.c H5FS.c H5G.c H5Gent.c H5Gnode.c H5Gstab.c \
diff --git a/test/big.c b/test/big.c
index 38e96c1..c28e047 100644
--- a/test/big.c
+++ b/test/big.c
@@ -187,7 +187,7 @@ writer (hid_t fapl, int wrt_n)
{
hsize_t size1[4] = {8, 1024, 1024, 1024};
hsize_t size2[1] = {GB8LL};
- hssize_t hs_start[1];
+ hsize_t hs_start[1];
hsize_t hs_size[1];
hid_t file=-1, space1=-1, space2=-1, mem_space=-1, d1=-1, d2=-1;
int *buf = malloc (sizeof(int) * WRT_SIZE);
@@ -299,7 +299,7 @@ reader (hid_t fapl)
FILE *script = NULL;
hid_t file=-1, mspace=-1, fspace=-1, d2=-1;
char ln[128], *s;
- hssize_t hs_offset[1];
+ hsize_t hs_offset[1];
hsize_t hs_size[1] = {WRT_SIZE};
int *buf = malloc (sizeof(int) * WRT_SIZE);
int i, j, zero, wrong, nerrors=0;
diff --git a/test/cache.c b/test/cache.c
index bdd27d1..e346699 100644
--- a/test/cache.c
+++ b/test/cache.c
@@ -408,7 +408,7 @@ const char * entry_type_names[NUMBER_OF_ENTRY_TYPES] =
/* call back function declarations: */
-static herr_t check_write_permitted(H5F_t UNUSED * f,
+static herr_t check_write_permitted(const H5F_t UNUSED * f,
hid_t UNUSED dxpl_id,
hbool_t * write_permitted_ptr);
@@ -842,7 +842,7 @@ type_and_index_to_addr(int32_t type,
*/
static herr_t
-check_write_permitted(H5F_t UNUSED * f,
+check_write_permitted(const H5F_t UNUSED * f,
hid_t UNUSED dxpl_id,
hbool_t * write_permitted_ptr)
{
@@ -1961,7 +1961,7 @@ rename_entry(H5C_t * cache_ptr,
if ( ! done ) {
- result = H5C_rename_entry(NULL, cache_ptr, &(types[type]),
+ result = H5C_rename_entry(cache_ptr, &(types[type]),
old_addr, new_addr);
}
@@ -3936,7 +3936,7 @@ check_rename_err(void)
if ( pass ) {
- result = H5C_rename_entry(NULL, cache_ptr, &(types[0]),
+ result = H5C_rename_entry(cache_ptr, &(types[0]),
entry_0_0_ptr->addr, entry_0_1_ptr->addr);
if ( result >= 0 ) {
@@ -3948,7 +3948,7 @@ check_rename_err(void)
if ( pass ) {
- result = H5C_rename_entry(NULL, cache_ptr, &(types[0]),
+ result = H5C_rename_entry(cache_ptr, &(types[0]),
entry_0_0_ptr->addr, entry_1_0_ptr->addr);
if ( result >= 0 ) {
diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c
index ddc8a83..c258b96 100644
--- a/test/cmpd_dset.c
+++ b/test/cmpd_dset.c
@@ -145,7 +145,7 @@ main (int argc, char *argv[])
hid_t file, dataset, space, PRESERVE, fapl;
hid_t array_dt;
static hsize_t dim[] = {NX, NY};
- hssize_t f_offset[2]; /*offset of hyperslab in file */
+ hsize_t f_offset[2]; /*offset of hyperslab in file */
hsize_t h_size[2]; /*size of hyperslab */
hsize_t memb_size[1] = {4};
char filename[256];
@@ -544,10 +544,10 @@ main (int argc, char *argv[])
for (j=0; j<NY; j++) {
s1_t *ps1 = s1 + i*NY + j;
s2_t *ps2 = s2 + i*NY + j;
- if ((hssize_t)i>=f_offset[0] &&
- (hsize_t)i<f_offset[0]+h_size[0] &&
- (hssize_t)j>=f_offset[1] &&
- (hsize_t)j<f_offset[1]+h_size[1]) {
+ if (i>=f_offset[0] &&
+ i<f_offset[0]+h_size[0] &&
+ j>=f_offset[1] &&
+ j<f_offset[1]+h_size[1]) {
if (ps2->a != ps1->a ||
ps2->b != ps1->b ||
ps2->c[0] != ps1->c[0] ||
@@ -602,10 +602,10 @@ main (int argc, char *argv[])
for (j=0; j<NY; j++) {
s1_t *ps1 = s1 + i*NY + j;
s5_t *ps5 = s5 + i*NY + j;
- if ((hssize_t)i>=f_offset[0] &&
- (hsize_t)i<f_offset[0]+h_size[0] &&
- (hssize_t)j>=f_offset[1] &&
- (hsize_t)j<f_offset[1]+h_size[1]) {
+ if (i>=f_offset[0] &&
+ i<f_offset[0]+h_size[0] &&
+ j>=f_offset[1] &&
+ j<f_offset[1]+h_size[1]) {
if (ps5->pre != (unsigned)(-1) ||
ps5->a != ps1->a ||
ps5->b != ps1->b ||
@@ -692,10 +692,10 @@ main (int argc, char *argv[])
goto error;
}
- if ((hssize_t)i>=f_offset[0] &&
- (hsize_t)i<f_offset[0]+h_size[0] &&
- (hssize_t)j>=f_offset[1] &&
- (hsize_t)j<f_offset[1]+h_size[1]) {
+ if (i>=f_offset[0] &&
+ i<f_offset[0]+h_size[0] &&
+ j>=f_offset[1] &&
+ j<f_offset[1]+h_size[1]) {
if (ps1->b != (unsigned)(-1) ||
ps1->d != (unsigned)(-1)) {
H5_FAILED();
diff --git a/test/dsets.c b/test/dsets.c
index d3e2e65..6731c5d 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -1300,7 +1300,7 @@ test_filter_internal(hid_t fid, const char *name, hid_t dcpl, int if_fletcher32,
hid_t write_dxpl; /* Dataset xfer property list ID for writing */
hid_t sid; /* Dataspace ID */
const hsize_t size[2] = {DSET_DIM1, DSET_DIM2}; /* Dataspace dimensions */
- const hssize_t hs_offset[2] = {FILTER_HS_OFFSET1, FILTER_HS_OFFSET2}; /* Hyperslab offset */
+ const hsize_t hs_offset[2] = {FILTER_HS_OFFSET1, FILTER_HS_OFFSET2}; /* Hyperslab offset */
const hsize_t hs_size[2] = {FILTER_HS_SIZE1, FILTER_HS_SIZE2}; /* Hyperslab size */
void *tconv_buf = NULL; /* Temporary conversion buffer */
hsize_t i, j, n; /* Local index variables */
@@ -1330,7 +1330,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();
@@ -1626,131 +1626,134 @@ error:
}
/*-------------------------------------------------------------------------
- * Function: test_filter_noencoder
+ * Function: test_filter_noencoder
*
- * Purpose: Tests filters with no encoder present. Ensures that data
- * can still be decoded correctly and that errors are thrown
- * when the application tries to write.
+ * Purpose: Tests filters with no encoder present. Ensures that data
+ * can still be decoded correctly and that errors are thrown
+ * when the application tries to write.
*
- * Return: Success: 0
- * Failure: -1
+ * Return: Success: 0
+ * Failure: -1
*
- * Programmer: Nat Furrer and James Laird
+ * Programmer: Nat Furrer and James Laird
* Monday, June 7, 2004
*
* Modifications:
*
*-------------------------------------------------------------------------
*/
+#ifdef H5_HAVE_FILTER_SZIP
static herr_t
test_filter_noencoder(const char *dset_name)
{
- hid_t file_id = -1;
- hid_t dset_id = -1;
- hid_t test_dset_id = -1;
- hid_t dcpl_id = -1;
- hid_t space_id = -1;
- hsize_t dims = 1;
- hsize_t read_dims = 10;
- herr_t err;
- int test_ints[10] = { 12 };
- int read_buf[10];
- int i;
- char * srcdir = HDgetenv("srcdir"); /* The source directory */
- char testfile[512]=""; /* Buffer to hold name of test file */
-
- /* Create the name of the file to open (in case we are using the --srcdir
- * option. */
- if (srcdir && ((HDstrlen(srcdir) + HDstrlen(NOENCODER_FILENAME) + 1) < sizeof(testfile)) )
- {
- HDstrcpy(testfile, srcdir);
- HDstrcat(testfile, "/");
- }
- HDstrcat(testfile, NOENCODER_FILENAME);
+ hid_t file_id = -1;
+ hid_t dset_id = -1;
+ hid_t test_dset_id = -1;
+ hid_t dcpl_id = -1;
+ hid_t space_id = -1;
+ hsize_t dims = 10;
+ herr_t err;
+ int test_ints[10] = { 12 };
+ int read_buf[10];
+ int i;
+ char * srcdir = HDgetenv("srcdir"); /* The source directory */
+ char testfile[512]=""; /* Buffer to hold name of test file */
- file_id = H5Fopen(testfile, H5F_ACC_RDWR, H5P_DEFAULT);
- if (file_id < 0) goto error;
+ /*
+ * Create the name of the file to open (in case we are using the --srcdir
+ * option and the file is in a different directory from this test).
+ */
+ if (srcdir && ((HDstrlen(srcdir) + HDstrlen(NOENCODER_FILENAME) + 1) < sizeof(testfile)) )
+ {
+ HDstrcpy(testfile, srcdir);
+ HDstrcat(testfile, "/");
+ }
+ HDstrcat(testfile, NOENCODER_FILENAME);
- dset_id = H5Dopen(file_id, dset_name);
- if (dset_id < 0) goto error;
+ file_id = H5Fopen(testfile, H5F_ACC_RDWR, H5P_DEFAULT);
+ if (file_id < 0) goto error;
- TESTING(" decoding without encoder");
+ dset_id = H5Dopen(file_id, dset_name);
+ if (dset_id < 0) goto error;
- space_id = H5Screate_simple(1, &read_dims, NULL);
- if (space_id < 0) goto error;
+ space_id = H5Screate_simple(1, &dims, NULL);
+ if (space_id < 0) goto error;
- /* Read the dataset and make sure the decoder is working correctly */
- err = H5Dread(dset_id, H5T_NATIVE_INT, space_id, space_id, H5P_DEFAULT, read_buf);
- if (err < 0) goto error;
+ TESTING(" decoding without encoder");
- for(i = 0; i < 10; i++)
- if ( read_buf[i] != i ) goto error;
+ /* Read the dataset and make sure the decoder is working correctly */
+ err = H5Dread(dset_id, H5T_NATIVE_INT, space_id, space_id, H5P_DEFAULT, read_buf);
+ if (err < 0) goto error;
- H5Sclose(space_id);
+ for(i = 0; i < 10; i++)
+ if ( read_buf[i] != i ) goto error;
- PASSED();
+ H5Sclose(space_id);
- /* Attempt to copy the DCPL and use it to create a new dataset.
- * Since the filter does not have an encoder, the creation
- * should fail.
- */
- TESTING(" trying to write without encoder");
+ PASSED();
- dcpl_id = H5Dget_create_plist(dset_id);
- if (dcpl_id < 0) goto error;
+ /* Attempt to copy the DCPL and use it to create a new dataset.
+ * Since the filter does not have an encoder, the creation
+ * should fail.
+ */
+ TESTING(" trying to write without encoder");
- space_id = H5Screate_simple(1, &dims, NULL);
- if (space_id < 0) goto error;
+ dcpl_id = H5Dget_create_plist(dset_id);
+ if (dcpl_id < 0) goto error;
- H5E_BEGIN_TRY{
- test_dset_id = H5Dcreate(file_id, NOENCODER_TEST_DATASET, H5T_NATIVE_INT, space_id , dcpl_id);
- }H5E_END_TRY
+ space_id = H5Screate_simple(1, &dims, NULL);
+ if (space_id < 0) goto error;
- if (test_dset_id >= 0) goto error;
+ H5E_BEGIN_TRY{
+ test_dset_id = H5Dcreate(file_id, NOENCODER_TEST_DATASET, H5T_NATIVE_INT, space_id , dcpl_id);
+ }H5E_END_TRY
- /* Attempt to extend the dataset. This should fail because
- * the dataset has a fill value and is instructed to fill on
- * allocation.
- */
- dims = 20; /* Dataset is originally of size 10 */
- H5E_BEGIN_TRY{
- err = H5Dextend(dset_id, &dims);
- }H5E_END_TRY
+ if (test_dset_id >= 0) goto error;
- if (err >= 0) goto error;
+ /* Attempt to extend the dataset. This should fail because
+ * the dataset has a fill value and is instructed to fill on
+ * allocation.
+ */
+ dims = 20; /* Dataset is originally of size 10 */
+ H5E_BEGIN_TRY{
+ err = H5Dextend(dset_id, &dims);
+ }H5E_END_TRY
- /* Attempt to write to the dataset. This should fail because
- * the filter does not have an encoder.
- */
- H5E_BEGIN_TRY{
- err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, test_ints);
- }H5E_END_TRY
+ if (err >= 0) goto error;
- if (err >= 0) goto error;
+ /* Attempt to write to the dataset. This should fail because
+ * the filter does not have an encoder.
+ */
+ H5E_BEGIN_TRY{
+ err = H5Dwrite(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, test_ints);
+ }H5E_END_TRY
- H5Fclose(file_id);
- H5Dclose(dset_id);
- H5Sclose(space_id);
- H5Pclose(dcpl_id);
+ if (err >= 0) goto error;
- PASSED();
+ H5Fclose(file_id);
+ H5Dclose(dset_id);
+ H5Sclose(space_id);
+ H5Pclose(dcpl_id);
- return 0;
+ PASSED();
+
+ return 0;
error:
- H5_FAILED();
- if (dset_id != -1)
- H5Dclose(dset_id);
- if (test_dset_id != -1)
- H5Dclose(test_dset_id);
- if (space_id != -1)
- H5Sclose(space_id);
- if (dcpl_id != -1)
- H5Pclose(dcpl_id);
- if (file_id != -1)
- H5Fclose(file_id);
- return -1;
+ H5_FAILED();
+ if (dset_id != -1)
+ H5Dclose(dset_id);
+ if (test_dset_id != -1)
+ H5Dclose(test_dset_id);
+ if (space_id != -1)
+ H5Sclose(space_id);
+ if (dcpl_id != -1)
+ H5Pclose(dcpl_id);
+ if (file_id != -1)
+ H5Fclose(file_id);
+ return -1;
}
+#endif /* H5_HAVE_FILTER_SZIP */
/*-------------------------------------------------------------------------
* Function: test_get_filter_info
@@ -1768,10 +1771,9 @@ error:
*-------------------------------------------------------------------------
*/
static herr_t
-test_get_filter_info()
+test_get_filter_info(void)
{
unsigned int flags; /* flags returned from H5Zget_filter_info */
- herr_t ret_value = -1;
herr_t err;
TESTING("H5Zget_filter_info");
@@ -1780,54 +1782,52 @@ test_get_filter_info()
* of encoder and decoder.
*/
#ifdef H5_HAVE_FILTER_FLETCHER32
- if(H5Zget_filter_info(H5Z_FILTER_FLETCHER32, &flags) < 0) goto error;
+ if(H5Zget_filter_info(H5Z_FILTER_FLETCHER32, &flags) < 0) TEST_ERROR
if(((flags & H5Z_FILTER_CONFIG_ENCODE_ENABLED) == 0) ||
((flags & H5Z_FILTER_CONFIG_DECODE_ENABLED) == 0))
- goto error;
+ TEST_ERROR
#endif
#ifdef H5_HAVE_FILTER_SHUFFLE
- if(H5Zget_filter_info(H5Z_FILTER_SHUFFLE, &flags) < 0) goto error;
+ if(H5Zget_filter_info(H5Z_FILTER_SHUFFLE, &flags) < 0) TEST_ERROR
if(((flags & H5Z_FILTER_CONFIG_ENCODE_ENABLED) == 0) ||
((flags & H5Z_FILTER_CONFIG_DECODE_ENABLED) == 0))
- goto error;
+ TEST_ERROR
#endif
#ifdef H5_HAVE_FILTER_DEFLATE
- if(H5Zget_filter_info(H5Z_FILTER_DEFLATE, &flags) < 0) goto error;
+ if(H5Zget_filter_info(H5Z_FILTER_DEFLATE, &flags) < 0) TEST_ERROR
if(((flags & H5Z_FILTER_CONFIG_ENCODE_ENABLED) == 0) ||
((flags & H5Z_FILTER_CONFIG_DECODE_ENABLED) == 0))
- goto error;
+ TEST_ERROR
#endif
#ifdef H5_HAVE_FILTER_SZIP
- if(H5Zget_filter_info(H5Z_FILTER_SZIP, &flags) < 0) goto error;
+ if(H5Zget_filter_info(H5Z_FILTER_SZIP, &flags) < 0) TEST_ERROR
#ifdef H5_SZIP_CAN_ENCODE
if(((flags & H5Z_FILTER_CONFIG_ENCODE_ENABLED) == 0) ||
((flags & H5Z_FILTER_CONFIG_DECODE_ENABLED) == 0))
- goto error;
+ TEST_ERROR
#else
if(((flags & H5Z_FILTER_CONFIG_ENCODE_ENABLED) != 0) ||
((flags & H5Z_FILTER_CONFIG_DECODE_ENABLED) == 0))
- goto error;
+ TEST_ERROR
#endif /* H5_SZIP_CAN_ENCODE */
#endif /* H5_HAVE_FILTER_SZIP */
- /* Verify that get_filter_info throws an error when given a bad filter */
- err = H5Zget_filter_info(-1, &flags);
-
- if (err < 0) goto error;
- if (flags != 0) goto error;
+ /* Verify that get_filter_info doesn't throw an error when given a bad filter */
+ /* (Different default behavior in post-1.6 code) */
+ if (H5Zget_filter_info(-1, &flags) < 0) TEST_ERROR
+ if (flags != 0) TEST_ERROR
PASSED();
return 0;
error:
- H5_FAILED();
return -1;
}
@@ -1983,27 +1983,27 @@ test_filters(hid_t file)
*/
#ifdef H5_HAVE_FILTER_SZIP
TESTING("szip filter (with encoder)");
- if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if (H5Pset_chunk (dc, 2, chunk_size)<0) goto error;
-
-#ifdef H5_SZIP_CAN_ENCODE
- puts("");
- if (H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block)<0) goto error;
-
- if(test_filter_internal(file,DSET_SZIP_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&szip_size)<0) goto error;
-#else
- SKIPPED();
-#endif /* H5_SZIP_CAN_ENCODE */
+ if ( h5_szip_can_encode() == 1) {
+ if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
+ if (H5Pset_chunk (dc, 2, chunk_size)<0) goto error;
+
+ puts("");
+ if (H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block)<0) goto error;
+ if(test_filter_internal(file,DSET_SZIP_NAME,dc,DISABLE_FLETCHER32,DATA_NOT_CORRUPTED,&szip_size)<0) goto error;
+ if (H5Pclose (dc)<0) goto error;
+ } else {
+ SKIPPED();
+ }
TESTING("szip filter (without encoder)");
-#ifndef H5_SZIP_CAN_ENCODE
- puts("");
- if(test_filter_noencoder(NOENCODER_SZIP_DATASET) < 0) goto error;
-#else
- SKIPPED();
-#endif /* H5_SZIP_CAN_ENCODE */
- if (H5Pclose (dc)<0) goto error;
+ if ( h5_szip_can_encode() != 1) {
+ puts("");
+ if(test_filter_noencoder(NOENCODER_SZIP_DATASET) < 0) goto error;
+ } else {
+ SKIPPED();
+ }
+
#else /* H5_HAVE_FILTER_SZIP */
TESTING("szip filter");
SKIPPED();
@@ -2081,44 +2081,46 @@ test_filters(hid_t file)
if (H5Pset_fletcher32 (dc)<0) goto error;
if (H5Pset_shuffle (dc)<0) goto error;
- /* Make sure encoding is enabled */
-#ifdef H5_SZIP_CAN_ENCODE
- puts("");
- if (H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block)<0) goto error;
-
- if(test_filter_internal(file,DSET_SHUF_SZIP_FLET_NAME,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size)<0) goto error;
-#else
- SKIPPED();
-#endif /* H5_SZIP_CAN_ENCODE */
+ /* Make sure encoding is enabled */
+ if ( h5_szip_can_encode() == 1) {
+ puts("");
+ if (H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block)<0) goto error;
+ if(test_filter_internal(file,DSET_SHUF_SZIP_FLET_NAME,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size)<0) goto error;
+ } else {
+ SKIPPED();
+ }
TESTING("shuffle+szip+checksum filters(checksum first, without encoder)");
-#ifndef H5_SZIP_CAN_ENCODE
- puts("");
- if (test_filter_noencoder(NOENCODER_SZIP_SHUFF_FLETCH_DATASET) < 0) goto error;
-#else
- SKIPPED();
-#endif /* H5_SZIP_CAN_ENCODE */
+
+ if ( h5_szip_can_encode() != 1) {
+ puts("");
+ if (test_filter_noencoder(NOENCODER_SZIP_SHUFF_FLETCH_DATASET) < 0) goto error;
+ } else {
+ SKIPPED();
+ }
/* Clean up objects used for this test */
if (H5Pclose (dc)<0) goto error;
-
+
TESTING("shuffle+szip+checksum filters(checksum last, with encoder)");
- /* Make sure encoding is enabled */
-#ifdef H5_SZIP_CAN_ENCODE
- puts("");
- if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
- if (H5Pset_chunk (dc, 2, chunk_size)<0) goto error;
- if (H5Pset_shuffle (dc)<0) goto error;
- if (H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block)<0) goto error;
- if (H5Pset_fletcher32 (dc)<0) goto error;
- if(test_filter_internal(file,DSET_SHUF_SZIP_FLET_NAME_2,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size)<0) goto error;
+ /* Make sure encoding is enabled */
+ if ( h5_szip_can_encode() == 1) {
+ puts("");
+ if((dc = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
+ if (H5Pset_chunk (dc, 2, chunk_size)<0) goto error;
+ if (H5Pset_shuffle (dc)<0) goto error;
+ if (H5Pset_szip(dc, szip_options_mask, szip_pixels_per_block)<0) goto error;
+ if (H5Pset_fletcher32 (dc)<0) goto error;
+
+ if(test_filter_internal(file,DSET_SHUF_SZIP_FLET_NAME_2,dc,ENABLE_FLETCHER32,DATA_NOT_CORRUPTED,&combo_size)<0) goto error;
+
+ /* Clean up objects used for this test */
+ if (H5Pclose (dc)<0) goto error;
- /* Clean up objects used for this test */
- if (H5Pclose (dc)<0) goto error;
-#else
- SKIPPED();
-#endif /* H5_SZIP_CAN_ENCODE */
+ } else {
+ SKIPPED();
+ }
#else /* H5_HAVE_FILTER_SZIP && H5_HAVE_FILTER_SHUFFLE && H5_HAVE_FILTER_FLETCHER32 */
TESTING("shuffle+szip+fletcher32 filters");
@@ -2852,7 +2854,7 @@ static herr_t
test_can_apply_szip(hid_t
#ifndef H5_HAVE_FILTER_SZIP
UNUSED
-#endif /* H5_HAVE_FILTER_SSZIP */
+#endif /* H5_HAVE_FILTER_SZIP */
file)
{
#ifdef H5_HAVE_FILTER_SZIP
@@ -2866,20 +2868,13 @@ file)
const hsize_t chunk_dims[2] = {250, 2048}; /* Chunk dimensions */
const hsize_t chunk_dims2[2] = {2, 1}; /* Chunk dimensions */
herr_t ret; /* Status value */
-#else /* H5_HAVE_FILTER_SZIP */
- const char *not_supported= " Szip filter is not enabled.";
-#endif /* H5_HAVE_FILTER_SSZIP */
+#endif /* H5_HAVE_FILTER_SZIP */
TESTING("dataset szip filter 'can apply' callback");
#ifdef H5_HAVE_FILTER_SZIP
- /* skip this test if the SZIP encoder is not enabled */
-#ifndef H5_SZIP_CAN_ENCODE
- SKIPPED();
- return 0;
-#endif /* H5_SZIP_CAN_ENCODE */
-
+ if (h5_szip_can_encode() == 1) {
/* Create the data space */
if ((sid = H5Screate_simple(2, dims, NULL))<0) {
H5_FAILED();
@@ -3017,11 +3012,14 @@ file)
PASSED();
+} else {
+ SKIPPED();
+ puts(" Szip encoding is not enabled.");
+}
#else /* H5_HAVE_FILTER_SZIP */
SKIPPED();
- puts(not_supported);
+ puts(" Szip filter is not enabled.");
#endif /* H5_HAVE_FILTER_SZIP */
-
return 0;
#ifdef H5_HAVE_FILTER_SZIP
@@ -3391,6 +3389,124 @@ error:
/*-------------------------------------------------------------------------
+ * Function: test_filter_delete
+ *
+ * Purpose: Tests deletion of filters from a dataset creation property list
+ *
+ * Return: Success: 0
+ * Failure: -1
+ *
+ * Programmer: Pedro Vicente
+ * Monday, January 26, 2004
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+static herr_t
+test_filter_delete(hid_t file)
+{
+ H5Z_filter_t filtn; /* filter identification number */
+ hid_t dsid=-1; /* dataset ID */
+ hid_t sid=-1; /* dataspace ID */
+ hid_t dcpl=-1; /* dataset creation property list ID */
+ hid_t dcpl1=-1; /* dataset creation property list ID */
+ hsize_t dims[2]={20,20}; /* dataspace dimensions */
+ hsize_t chunk_dims[2]={10,10}; /* chunk dimensions */
+ int nfilters; /* number of filters in DCPL */
+ herr_t ret; /* generic return value */
+ int i;
+
+ TESTING("filter deletion");
+
+#if defined H5_HAVE_FILTER_DEFLATE && defined H5_HAVE_FILTER_SHUFFLE && defined H5_HAVE_FILTER_FLETCHER32
+ /* create the data space */
+ if ((sid = H5Screate_simple(2, dims, NULL))<0) goto error;
+
+ /* create dcpl */
+ if((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
+ if(H5Pset_chunk(dcpl, 2, chunk_dims)<0) goto error;
+
+ if (H5Pset_fletcher32 (dcpl)<0) goto error;
+ if (H5Pset_deflate (dcpl, 6)<0) goto error;
+ if (H5Pset_shuffle (dcpl)<0) goto error;
+
+ /* create a dataset */
+ if ((dsid = H5Dcreate(file,"dsetdel", H5T_NATIVE_INT, sid, dcpl)) <0) goto error;
+
+ /* get copy of dataset's dataset creation property list */
+ if ((dcpl1=H5Dget_create_plist(dsid))<0) goto error;
+
+ /*----------------------------------------------------------------------
+ * delete the deflate filter
+ *----------------------------------------------------------------------
+ */
+ /* delete the deflate filter */
+ if (H5Premove_filter(dcpl1,H5Z_FILTER_DEFLATE)<0) goto error;
+
+ /* get information about filters */
+ if ((nfilters = H5Pget_nfilters(dcpl1))<0) goto error;
+
+ /* check if filter was deleted */
+ for (i=0; i<nfilters; i++) {
+ filtn = H5Pget_filter(dcpl1,(unsigned)i,0,0,0,0,0);
+ if (H5Z_FILTER_DEFLATE==filtn)
+ goto error;
+ }
+
+ /* try to delete the deflate filter again */
+ H5E_BEGIN_TRY {
+ ret=H5Premove_filter(dcpl1,H5Z_FILTER_DEFLATE);
+ } H5E_END_TRY;
+ if (ret >=0) {
+ H5_FAILED();
+ printf(" Line %d: Shouldn't have deleted filter!\n",__LINE__);
+ goto error;
+ } /* end if */
+
+ /*----------------------------------------------------------------------
+ * delete all filters
+ *----------------------------------------------------------------------
+ */
+ /* delete all filters */
+ if (H5Premove_filter(dcpl1,H5Z_FILTER_ALL)<0) goto error;
+
+ /* get information about filters */
+ if ((nfilters = H5Pget_nfilters(dcpl1))<0) goto error;
+
+ /* check if filters were deleted */
+ if (nfilters)goto error;
+
+ /*----------------------------------------------------------------------
+ * close
+ *----------------------------------------------------------------------
+ */
+
+ /* clean up objects used for this test */
+ if (H5Pclose (dcpl)<0) goto error;
+ if (H5Pclose (dcpl1)<0) goto error;
+ if (H5Dclose (dsid)<0) goto error;
+ if (H5Sclose (sid)<0) goto error;
+
+ PASSED();
+#else
+ SKIPPED();
+#endif
+ return 0;
+
+error:
+ H5E_BEGIN_TRY {
+ H5Pclose(dcpl);
+ H5Pclose(dcpl1);
+ H5Dclose(dsid);
+ H5Sclose(sid);
+ } H5E_END_TRY;
+ return -1;
+} /* end test_filter_delete() */
+
+
+
+/*-------------------------------------------------------------------------
* Function: auxread_fdata
*
* Purpose: reads a dataset "NAME" from FID
@@ -3513,6 +3629,7 @@ test_filters_endianess(void)
TESTING("filters with big-endian/little-endian data");
+#if defined H5_HAVE_FILTER_FLETCHER32
/*-------------------------------------------------------------------------
* step1: create a file
*-------------------------------------------------------------------------
@@ -3527,9 +3644,7 @@ test_filters_endianess(void)
if((dcpl = H5Pcreate(H5P_DATASET_CREATE))<0) goto error;
if(H5Pset_chunk(dcpl,rank,chunk_dims)<0) goto error;
-#if defined H5_HAVE_FILTER_FLETCHER32
if (H5Pset_fletcher32 (dcpl)<0) goto error;
-#endif
/* create a dataset */
if ((dsid = H5Dcreate(fid,"dset",H5T_NATIVE_INT,sid,dcpl)) <0) goto error;
@@ -3592,6 +3707,9 @@ test_filters_endianess(void)
if (H5Fclose(fid)<0) goto error;
PASSED();
+#else
+ SKIPPED();
+#endif
return 0;
error:
@@ -3673,7 +3791,7 @@ static herr_t
test_missing_chunk(hid_t file)
{
hid_t s=-1, d=-1, dcpl=-1;
- hssize_t hs_start[1];
+ hsize_t hs_start[1];
hsize_t hs_stride[1],
hs_count[1],
hs_block[1];
@@ -3821,6 +3939,7 @@ main(void)
#endif /* H5_WANT_H5_V1_4_COMPAT */
nerrors += test_can_apply_szip(file)<0 ?1:0;
nerrors += test_compare_dcpl(file)<0 ?1:0;
+ nerrors += test_filter_delete(file)<0 ?1:0;
nerrors += test_filters_endianess()<0 ?1:0;
nerrors += test_zero_dims(file)<0 ?1:0;
nerrors += test_missing_chunk(file)<0 ?1:0;
diff --git a/test/dtypes.c b/test/dtypes.c
index f91fcb0..b4c5691 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -120,11 +120,10 @@ static int num_opaque_conversions_g = 0;
#define aligned_free(M) HDfree((char*)(M)-ALIGNMENT)
void some_dummy_func(float x);
+static int my_isnan(flt_t type, void *val);
static int opaque_check(int tag_it);
-void *test_vltypes_alloc_custom(size_t size, void *info);
-void test_vltypes_free_custom(void *mem, void *info);
-static herr_t
-convert_opaque(hid_t UNUSED st, hid_t UNUSED dt, H5T_cdata_t *cdata,
+static herr_t convert_opaque(hid_t UNUSED st, hid_t UNUSED dt,
+ H5T_cdata_t *cdata,
size_t UNUSED nelmts, size_t UNUSED buf_stride,
size_t UNUSED bkg_stride, void UNUSED *_buf,
void UNUSED *bkg, hid_t UNUSED dset_xfer_plid);
@@ -1456,9 +1455,9 @@ static int
test_compound_9(void)
{
typedef struct cmpd_struct {
- int i1;
- char* str;
- int i2;
+ int i1;
+ char* str;
+ int i2;
} cmpd_struct;
cmpd_struct wdata = {11, "variable-length string", 22};
@@ -1561,7 +1560,7 @@ test_compound_9(void)
goto error;
} /* end if */
- if(rdata.i1!=wdata.i1 || rdata.i2!=wdata.i2 || strcmp(rdata.str, wdata.str)) {
+ if(rdata.i1!=wdata.i1 || rdata.i2!=wdata.i2 || HDstrcmp(rdata.str, wdata.str)) {
H5_FAILED(); AT();
printf("incorrect read data\n");
goto error;
@@ -2056,12 +2055,12 @@ test_compound_12(void)
{
hid_t complex_id;
size_t size = 0;
- size_t offset, new_size;
+ size_t offset, new_size, tmp_size;
herr_t ret;
TESTING("adjust size of compound data types");
- /* Create the empty compound type */
+ /* Create a compound type of minimal size */
if ((complex_id = H5Tcreate(H5T_COMPOUND, 1))<0) goto error;
/* Verify the size */
@@ -2070,22 +2069,26 @@ test_compound_12(void)
/* Add a couple fields and adjust the size */
offset = size;
- size+=H5Tget_size(H5T_NATIVE_DOUBLE);
+ if((tmp_size=H5Tget_size(H5T_NATIVE_DOUBLE))==0) goto error;
+ size+=tmp_size;
if (H5Tset_size(complex_id, size)<0) goto error;
if (H5Tinsert(complex_id, "real", offset,
H5T_NATIVE_DOUBLE)<0) goto error;
offset = size;
- size+=H5Tget_size(H5T_NATIVE_DOUBLE);
+ if((tmp_size=H5Tget_size(H5T_NATIVE_DOUBLE))==0) goto error;
+ size+=tmp_size;
if (H5Tset_size(complex_id, size)<0) goto error;
if (H5Tinsert(complex_id, "imaginary", offset,
H5T_NATIVE_DOUBLE)<0) goto error;
/* Increase and decrease the size. */
- size+=H5Tget_size(H5T_NATIVE_DOUBLE);
+ if((tmp_size=H5Tget_size(H5T_NATIVE_DOUBLE))==0) goto error;
+ size+=tmp_size;
if (H5Tset_size(complex_id, size)<0) goto error;
- size-=H5Tget_size(H5T_NATIVE_DOUBLE);
+ if((tmp_size=H5Tget_size(H5T_NATIVE_DOUBLE))==0) goto error;
+ size-=tmp_size;
if (H5Tset_size(complex_id, size)<0) goto error;
/* Verify the size */
@@ -2102,7 +2105,7 @@ test_compound_12(void)
puts(" Tries to cut off the last member. Should have failed.");
goto error;
}
-
+
if (H5Tclose (complex_id)<0) goto error;
PASSED();
return 0;
@@ -3542,6 +3545,8 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst)
unsigned char dst_bits[32]; /*dest value in LE order*/
size_t src_nbits; /*source length in bits */
size_t dst_nbits; /*dst length in bits */
+ H5T_sign_t src_sign; /*source sign type */
+ H5T_sign_t dst_sign; /*dst sign type */
void *aligned=NULL; /*aligned temp buffer */
signed char hw_char;
unsigned char hw_uchar;
@@ -3643,6 +3648,8 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst)
dst_size = H5Tget_size(dst);
src_nbits = H5Tget_precision(src); /* not 8*src_size, esp on J90 - QAK */
dst_nbits = H5Tget_precision(dst); /* not 8*dst_size, esp on J90 - QAK */
+ src_sign = H5Tget_sign(src);
+ dst_sign = H5Tget_sign(dst);
buf = aligned_malloc(nelmts*MAX(src_size, dst_size));
saved = aligned_malloc(nelmts*MAX(src_size, dst_size));
aligned = HDmalloc(sizeof(long_long));
@@ -4142,7 +4149,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst)
/* Make certain that there isn't some weird number of destination bits */
assert(dst_nbits%8==0);
- /* Are the two results the same? */
+ /* Are the two results the same? */
for (k=(dst_size-(dst_nbits/8)); k<dst_size; k++)
if (buf[j*dst_size+k]!=hw[k])
break;
@@ -4166,7 +4173,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst)
* hardware conversion result during overflows is usually garbage
* so we must handle those cases differetly when checking results.
*/
- if (H5T_SGN_2==H5Tget_sign(src) && H5T_SGN_2==H5Tget_sign(dst)) {
+ if (H5T_SGN_2==src_sign && H5T_SGN_2==dst_sign) {
if (src_nbits>dst_nbits) {
if(0==H5T_bit_get_d(src_bits, src_nbits-1, 1) &&
H5T_bit_find(src_bits, dst_nbits-1, (src_nbits-dst_nbits),
@@ -4211,7 +4218,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst)
continue; /*no error*/
}
}
- } else if (H5T_SGN_2==H5Tget_sign(src) && H5T_SGN_NONE==H5Tget_sign(dst)) {
+ } else if (H5T_SGN_2==src_sign && H5T_SGN_NONE==dst_sign) {
if (H5T_bit_get_d(src_bits, src_nbits-1, 1)) {
/*
* The source is negative so the result should be zero.
@@ -4231,7 +4238,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst)
if (H5T_bit_find(dst_bits, 0, dst_nbits, H5T_BIT_LSB, 0)<0)
continue; /*no error*/
}
- } else if (H5T_SGN_NONE==H5Tget_sign(src) && H5T_SGN_2==H5Tget_sign(dst)) {
+ } else if (H5T_SGN_NONE==src_sign && H5T_SGN_2==dst_sign) {
if (src_nbits>=dst_nbits &&
H5T_bit_find(src_bits, dst_nbits-1, (src_nbits-dst_nbits)+1,
H5T_BIT_LSB, 1)>=0) {
@@ -4690,22 +4697,22 @@ test_conv_flt_1 (const char *name, hid_t src, hid_t dst)
goto error;
}
- /* Allocate buffers */
- endian = H5Tget_order(H5T_NATIVE_FLOAT);
+ /* Get "interesting" values */
src_size = H5Tget_size(src);
dst_size = H5Tget_size(dst);
+ dst_ebias=H5Tget_ebias(dst);
+ H5Tget_fields(src,NULL,&src_epos,&src_esize,NULL,NULL);
+ H5Tget_fields(dst,NULL,&dst_epos,&dst_esize,NULL,&dst_msize);
+
+ /* Allocate buffers */
+ endian = H5Tget_order(H5T_NATIVE_FLOAT);
buf = aligned_malloc(nelmts*MAX(src_size, dst_size));
saved = aligned_malloc(nelmts*MAX(src_size, dst_size));
- aligned = malloc(16); /*should be big enough for any type*/
+ aligned = HDmalloc(32); /*should be big enough for any type*/
#ifdef SHOW_OVERFLOWS
noverflows_g = 0;
#endif
- /* Get "interesting" values */
- dst_ebias=H5Tget_ebias(dst);
- H5Tget_fields(src,NULL,&src_epos,&src_esize,NULL,NULL);
- H5Tget_fields(dst,NULL,&dst_epos,&dst_esize,NULL,&dst_msize);
-
for (i=0; i<ntests; i++) {
/*
@@ -4905,7 +4912,7 @@ test_conv_flt_1 (const char *name, hid_t src, hid_t dst)
/* Special check for denormalized values */
if(check_expo[0]<(-(int)dst_ebias) || check_expo[1]<(-(int)dst_ebias)) {
int expo_diff=check_expo[0]-check_expo[1];
- int valid_bits=((int)(dst_ebias+dst_msize)+MIN(check_expo[0],check_expo[1]))-1;
+ int valid_bits=(int)((dst_ebias+dst_msize)+MIN(check_expo[0],check_expo[1]))-1;
double epsilon=1.0;
/* Re-scale the mantissas based on any exponent difference */
diff --git a/test/extend.c b/test/extend.c
index 07c8dba..aaac754 100644
--- a/test/extend.c
+++ b/test/extend.c
@@ -55,7 +55,7 @@ write_data(const char *msg, hid_t file, const char *name, hid_t cparms, hid_t me
static const hsize_t dims[2] = {NX, NY};
static const hsize_t half_dims[2] = {NX/2, NY/2};
static hsize_t size[2];
- hssize_t offset[2];
+ hsize_t offset[2];
int i, j, k, m;
TESTING(msg);
diff --git a/test/external.c b/test/external.c
index 4dda40c..5921572 100644
--- a/test/external.c
+++ b/test/external.c
@@ -595,7 +595,7 @@ test_2 (hid_t fapl)
int part[25], whole[100]; /*raw data buffers */
hsize_t cur_size; /*current data space size */
hid_t hs_space; /*hyperslab data space */
- hssize_t hs_start = 30; /*hyperslab starting offset */
+ hsize_t hs_start = 30; /*hyperslab starting offset */
hsize_t hs_count = 25; /*hyperslab size */
int temparray[10] = {0x0f0f0f0f,0x0f0f0f0f,0x0f0f0f0f,0x0f0f0f0f,0x0f0f0f0f,0x0f0f0f0f,0x0f0f0f0f,0x0f0f0f0f,0x0f0f0f0f,0x0f0f0f0f};
@@ -721,7 +721,7 @@ test_3 (hid_t fapl)
int part[25],whole[100]; /*raw data buffers */
hsize_t cur_size=100; /*current data space size */
hsize_t max_size=200; /*maximum data space size */
- hssize_t hs_start=100; /*hyperslab starting offset */
+ hsize_t hs_start=100; /*hyperslab starting offset */
hsize_t hs_count=100; /*hyperslab size */
char filename[1024]; /*file name */
int temparray[10] = {0x0f0f0f0f,0x0f0f0f0f,0x0f0f0f0f,0x0f0f0f0f,0x0f0f0f0f,0x0f0f0f0f,0x0f0f0f0f,0x0f0f0f0f,0x0f0f0f0f,0x0f0f0f0f};
diff --git a/test/file_handle.c b/test/file_handle.c
index 787ce83..1db5e14 100644
--- a/test/file_handle.c
+++ b/test/file_handle.c
@@ -23,7 +23,7 @@
#define KB 1024
#define FAMILY_NUMBER 4
-#define FAMILY_SIZE 128
+#define FAMILY_SIZE 1024
#define MULTI_SIZE 128
#define CORE_INCREMENT 4096
@@ -174,10 +174,9 @@ test_core(void)
goto error;
/* There is no garantee the size of metadata in file is constant.
- * Just try to check if it's reasonable. Currently, this file size
- * is 976.
+ * Just try to check if it's reasonable. Why is this 4KB?
*/
- if(file_size<KB/2 || file_size>1*KB)
+ if(file_size<2*KB || file_size>6*KB)
goto error;
if(H5Fclose(file)<0)
@@ -239,12 +238,24 @@ test_family(void)
if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0)
goto error;
+ if(H5Fclose(file)<0)
+ goto error;
+
+ /* Tries to reopen the file with member file size smaller than
+ * actual 1st member file size(976 bytes). The library is
+ * supposed to adjust the member size to 976 bytes. */
+ if(H5Pset_fapl_family(fapl, (hsize_t)512, H5P_DEFAULT)<0)
+ goto error;
+
+ if((file=H5Fopen(filename, H5F_ACC_RDWR, fapl))<0)
+ goto error;
+
/* Check file size API */
if(H5Fget_filesize(file, &file_size) < 0)
goto error;
- /* The file size is supposed to be 2KB right now. */
- if(file_size<1*KB || file_size>4*KB)
+ /* The file size is supposed to be 976 bytes right now. */
+ if(file_size<KB/2 || file_size>4*KB)
goto error;
/* Create and write dataset */
@@ -290,10 +301,15 @@ test_family(void)
if(H5Fget_filesize(file, &file_size) < 0)
goto error;
- /* Some data has been written. The file size should be bigger(4KB) now. */
- if(file_size<2*KB || file_size>6*KB)
- goto error;
-
+ /* Some data has been written. The file size should be bigger(18KB+976 bytes if int size is 4 bytes) now. */
+ if(sizeof(int)<=4) {
+ if(file_size<18*KB || file_size>20*KB)
+ goto error;
+ } else if(sizeof(int)>=8) {
+ if(file_size<32*KB || file_size>40*KB)
+ goto error;
+ }
+
if(H5Sclose(space)<0)
goto error;
if(H5Dclose(dset)<0)
diff --git a/test/filename.c b/test/filename.c
index 79dd19e..32dfd63 100644
--- a/test/filename.c
+++ b/test/filename.c
@@ -19,7 +19,6 @@
* Purpose: Tests the "H5Fget_name" functionality
*/
-#include "h5test.h"
#include "testhdf5.h"
#define FILENAME "get_file_name"
@@ -50,7 +49,6 @@ typedef struct s1_t {
"in %s\n", where, val, x, (int)__LINE__, __FILE__); \
H5Eprint (stdout); \
} \
- strcmp(x, ""); \
} while(0)
int main( void )
diff --git a/test/fillval.c b/test/fillval.c
index 8161cd9..a5a2886 100644
--- a/test/fillval.c
+++ b/test/fillval.c
@@ -605,9 +605,10 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval,
hsize_t cur_size[5] = {2, 8, 8, 4, 2};
hsize_t one[5] = {1, 1, 1, 1, 1};
hsize_t hs_size[5], hs_stride[5];
- hssize_t hs_offset[5], nelmts;
+ hsize_t hs_offset[5], nelmts;
int fillval=(-1), val_rd, should_be;
int i, j, *buf=NULL, odd;
+ unsigned u;
comp_datatype rd_c, fill_c, should_be_c;
comp_datatype *buf_c=NULL;
H5D_space_status_t allocation;
@@ -646,11 +647,11 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval,
if (fill_time!=H5D_FILL_TIME_NEVER && val_rd!=fillval) {
H5_FAILED();
puts(" Value read was not a fill value.");
- printf(" Elmt={%ld,%ld,%ld,%ld,%ld}, read: %u, "
+ HDfprintf(stdout," Elmt={%Hu,%Hu,%Hu,%Hu,%Hu}, read: %u, "
"Fill value: %u\n",
- (long)hs_offset[0], (long)hs_offset[1],
- (long)hs_offset[2], (long)hs_offset[3],
- (long)hs_offset[4], val_rd, fillval);
+ hs_offset[0], hs_offset[1],
+ hs_offset[2], hs_offset[3],
+ hs_offset[4], val_rd, fillval);
goto error;
}
/* case for compound datatype */
@@ -662,11 +663,11 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval,
rd_c.z!=fill_c.z)) {
H5_FAILED();
puts(" Value read was not a fill value.");
- printf(" Elmt={%ld,%ld,%ld,%ld,%ld}, read: %f, %d, %f, %c"
+ HDfprintf(stdout," Elmt={%Hu,%Hu,%Hu,%Hu,%Hu}, read: %f, %d, %f, %c"
"Fill value: %f, %d, %f, %c\n",
- (long)hs_offset[0], (long)hs_offset[1],
- (long)hs_offset[2], (long)hs_offset[3],
- (long)hs_offset[4], rd_c.a, rd_c.x, rd_c.y, rd_c.z,
+ 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,
fill_c.a, fill_c.x, fill_c.y, fill_c.z);
goto error;
}
@@ -688,22 +689,22 @@ test_rdwr_cases(hid_t file, hid_t dcpl, const char *dname, void *_fillval,
/* case for atomic datatype */
if(datatype==H5T_INTEGER) {
/*check for overflow*/
- assert((nelmts*sizeof(int))==(hssize_t)((size_t)(nelmts*sizeof(int))));
+ assert((nelmts*sizeof(int))==(hsize_t)((size_t)(nelmts*sizeof(int))));
buf = malloc((size_t)(nelmts*sizeof(int)));
- for (i=0; i<nelmts; i++) buf[i] = 9999;
+ for (u=0; u<nelmts; u++) buf[u] = 9999;
if (H5Dwrite(dset1, H5T_NATIVE_INT, mspace, fspace, H5P_DEFAULT,
buf)<0) goto error;
}
/* case for compound datatype */
else if(datatype==H5T_COMPOUND) {
assert((nelmts*sizeof(comp_datatype))==
- (hssize_t)((size_t)(nelmts*sizeof(comp_datatype))));
+ (hsize_t)((size_t)(nelmts*sizeof(comp_datatype))));
buf_c = (comp_datatype*)calloc((size_t)nelmts,sizeof(comp_datatype));
- for (i=0; i<nelmts; i++) {
- buf_c[i].a = (float)1111.11;
- buf_c[i].x = 2222;
- buf_c[i].y = 3333.3333;
- buf_c[i].z = 'd';
+ for (u=0; u<nelmts; u++) {
+ buf_c[u].a = (float)1111.11;
+ buf_c[u].x = 2222;
+ buf_c[u].y = 3333.3333;
+ buf_c[u].z = 'd';
}
if (H5Dwrite(dset2, ctype_id, mspace, fspace, H5P_DEFAULT,
buf_c)<0) goto error;
@@ -1030,7 +1031,7 @@ test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout)
hsize_t ch_size[5] = {1, 16, 8, 4, 2};
hsize_t one[5] = {1, 1, 1, 1, 1};
hsize_t hs_size[5], hs_stride[5];
- hssize_t hs_offset[5], nelmts;
+ hsize_t hs_offset[5], nelmts;
#ifdef NO_FILLING
int fillval = 0;
#else
@@ -1038,6 +1039,7 @@ test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout)
#endif
int val_rd, should_be;
int i, j, *buf=NULL, odd, fd;
+ unsigned u;
char filename[1024];
if (H5D_CHUNKED==layout) {
@@ -1127,11 +1129,11 @@ test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout)
if (val_rd!=fillval) {
H5_FAILED();
puts(" Value read was not a fill value.");
- printf(" Elmt={%ld,%ld,%ld,%ld,%ld}, read: %u, "
+ HDfprintf(stdout," Elmt={%Hu,%Hu,%Hu,%Hu,%Hu}, read: %u, "
"Fill value: %u\n",
- (long)hs_offset[0], (long)hs_offset[1],
- (long)hs_offset[2], (long)hs_offset[3],
- (long)hs_offset[4], val_rd, fillval);
+ hs_offset[0], hs_offset[1],
+ hs_offset[2], hs_offset[3],
+ hs_offset[4], val_rd, fillval);
goto error;
}
}
@@ -1145,9 +1147,9 @@ test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout)
nelmts *= hs_size[i];
}
if ((mspace=H5Screate_simple(5, hs_size, hs_size))<0) goto error;
- assert((nelmts*sizeof(int))==(hssize_t)((size_t)(nelmts*sizeof(int)))); /*check for overflow*/
+ assert((nelmts*sizeof(int))==(hsize_t)((size_t)(nelmts*sizeof(int)))); /*check for overflow*/
buf = malloc((size_t)(nelmts*sizeof(int)));
- for (i=0; i<nelmts; i++) buf[i] = 9999;
+ for (u=0; u<nelmts; u++) buf[u] = 9999;
if (H5Sselect_hyperslab(fspace, H5S_SELECT_SET, hs_offset, hs_stride,
hs_size, NULL)<0) goto error;
if (H5Dwrite(dset, H5T_NATIVE_INT, mspace, fspace, H5P_DEFAULT,
@@ -1172,11 +1174,11 @@ test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout)
if (val_rd!=should_be) {
H5_FAILED();
puts(" Value read was not correct.");
- printf(" Elmt={%ld,%ld,%ld,%ld,%ld}, read: %u, "
+ HDfprintf(stdout," Elmt={%Hu,%Hu,%Hu,%Hu,%Hu}, read: %u, "
"should be: %u\n",
- (long)hs_offset[0], (long)hs_offset[1],
- (long)hs_offset[2], (long)hs_offset[3],
- (long)hs_offset[4], val_rd, should_be);
+ hs_offset[0], hs_offset[1],
+ hs_offset[2], hs_offset[3],
+ hs_offset[4], val_rd, should_be);
goto error;
}
}
@@ -1208,11 +1210,11 @@ test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout)
if (val_rd!=should_be) {
H5_FAILED();
puts(" Value read was not correct.");
- printf(" Elmt={%ld,%ld,%ld,%ld,%ld}, read: %u, "
+ HDfprintf(stdout," Elmt={%Hu,%Hu,%Hu,%Hu,%Hu}, read: %u, "
"should be: %u\n",
- (long)hs_offset[0], (long)hs_offset[1],
- (long)hs_offset[2], (long)hs_offset[3],
- (long)hs_offset[4], val_rd, should_be);
+ hs_offset[0], hs_offset[1],
+ hs_offset[2], hs_offset[3],
+ hs_offset[4], val_rd, should_be);
goto error;
}
}
@@ -1270,7 +1272,7 @@ test_compatible(void)
hid_t dcpl1=-1, dcpl2=-1, fspace=-1, mspace=-1;
int rd_fill=0, fill_val=4444, val_rd=0;
hsize_t dims[2], one[2]={1,1};
- hssize_t hs_offset[2]={3,4};
+ hsize_t hs_offset[2]={3,4};
H5D_fill_value_t status;
char *srcdir = getenv("srcdir"); /*where the src code is located*/
char testfile[512]=""; /* test file name */
diff --git a/test/getname.c b/test/getname.c
index 3e714f8..33b9141 100644
--- a/test/getname.c
+++ b/test/getname.c
@@ -1505,7 +1505,7 @@ PASSED();
if (H5Iget_name( type_id, name, size )<0) goto out;
if (check_name( name, "/g18/t2" )!=0) goto out;
- /* Get name for the IDs of the secondt file, should be "" */
+ /* Get name for the IDs of the second file, should be "" */
if (H5Iget_name( group6_id, name, size )<0) goto out;
if (check_name( name, "" )!=0) goto out;
diff --git a/test/h5test.c b/test/h5test.c
index 7c69e70..4e025888 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -148,7 +148,7 @@ h5_cleanup(const char *base_name[], hid_t fapl)
if (h5_fixname(base_name[i], fapl, filename, sizeof(filename)) == NULL)
continue;
- driver = H5Pget_driver(fapl);
+ driver = H5Pget_driver(fapl);
if (driver == H5FD_FAMILY) {
for (j = 0; /*void*/; j++) {
@@ -170,7 +170,7 @@ h5_cleanup(const char *base_name[], hid_t fapl)
} else if (driver == H5FD_MULTI) {
H5FD_mem_t mt;
- assert(strlen(multi_letters)==H5FD_MEM_NTYPES);
+ assert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES);
for (mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) {
HDsnprintf(temp, sizeof temp, "%s-%c.h5",
@@ -266,13 +266,10 @@ char *
h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size)
{
const char *prefix = NULL;
- const char *suffix = ".h5"; /* suffix has default */
+ const char *suffix = ".h5"; /* suffix has default */
char *ptr, last = '\0';
size_t i, j;
-#ifdef H5_HAVE_PARALLEL
- static int HDF5_PARAPREFIX_explained=0;
-#endif /* H5_HAVE_PARALLEL */
- hid_t driver=(-1);
+ hid_t driver = -1;
if (!base_name || !fullname || size < 1)
return NULL;
@@ -280,7 +277,7 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size)
memset(fullname, 0, size);
/* figure out the suffix */
- if (H5P_DEFAULT != fapl){
+ if (H5P_DEFAULT != fapl) {
if ((driver = H5Pget_driver(fapl)) < 0)
return NULL;
@@ -293,15 +290,21 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size)
/* Use different ones depending on parallel or serial driver used. */
if (H5P_DEFAULT != fapl && H5FD_MPIO == driver){
#ifdef H5_HAVE_PARALLEL
- /* For parallel:
- * First use command line option, then the environment variable,
- * then try the constant
+ /*
+ * For parallel:
+ * First use command line option, then the environment
+ * variable, then try the constant
*/
+ static int explained = 0;
+
prefix = (paraprefix ? paraprefix : getenv("HDF5_PARAPREFIX"));
- if (!prefix && !HDF5_PARAPREFIX_explained){
+
+ if (!prefix && !explained) {
/* print hint by process 0 once. */
int mpi_rank;
+
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
+
if (mpi_rank == 0)
printf("*** Hint ***\n"
"You can use environment variable HDF5_PARAPREFIX to "
@@ -310,15 +313,17 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size)
" HDF5_PARAPREFIX=pfs:/PFS/user/me\n"
" export HDF5_PARAPREFIX\n"
"*** End of Hint ***\n");
- HDF5_PARAPREFIX_explained++;
+
+ explained = TRUE;
#ifdef HDF5_PARAPREFIX
prefix = HDF5_PARAPREFIX;
#endif /* HDF5_PARAPREFIX */
}
-#endif
- }else{
- /* For serial:
- * First use the environment variable, then try the constant
+#endif /* H5_HAVE_PARALLEL */
+ } else {
+ /*
+ * For serial:
+ * First use the environment variable, then try the constant
*/
prefix = HDgetenv("HDF5_PREFIX");
@@ -335,9 +340,11 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size)
char *subdir;
if (!HDstrcmp(prefix, HDF5_PARAPREFIX)) {
- /* If the prefix specifies the HDF5_PARAPREFIX directory, then
+ /*
+ * If the prefix specifies the HDF5_PARAPREFIX directory, then
* default to using the "/tmp/$USER" or "/tmp/$LOGIN"
- * directory instead. */
+ * directory instead.
+ */
char *user, *login;
user = HDgetenv("USER");
@@ -350,7 +357,7 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size)
fullname[i++] = '/';
- for (j = 0; i < size && subdir[j]; i++, j++)
+ for (j = 0; i < size && subdir[j]; ++i, ++j)
fullname[i] = subdir[j];
}
}
@@ -360,17 +367,21 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size)
HDstrncpy(fullname, prefix, MIN(strlen(prefix), size));
if (HDstrlen(fullname) + HDstrlen(base_name) + 1 < size) {
- /* Append the base_name with a slash first. Multiple slashes are
- * handled below. */
+ /*
+ * Append the base_name with a slash first. Multiple
+ * slashes are handled below.
+ */
h5_stat_t buf;
if (HDstat(fullname, &buf) < 0)
/* The directory doesn't exist just yet */
- if (HDmkdir(fullname, (mode_t)0755) < 0 && errno != EEXIST) {
- /* We couldn't make the "/tmp/${USER,LOGIN}" subdirectory.
- * Default to PREFIX's original prefix value. */
+ if (HDmkdir(fullname, (mode_t)0755) < 0 && errno != EEXIST)
+ /*
+ * We couldn't make the "/tmp/${USER,LOGIN}"
+ * subdirectory. Default to PREFIX's original
+ * prefix value.
+ */
HDstrcpy(fullname, prefix);
- }
HDstrcat(fullname, "/");
HDstrcat(fullname, base_name);
@@ -435,13 +446,6 @@ h5_fileaccess(void)
const char *name;
char s[1024];
hid_t fapl = -1;
- hsize_t fam_size = 100*1024*1024; /*100 MB*/
-#ifdef H5_WANT_H5_V1_4_COMPAT
- long verbosity = 1;
-#else /* H5_WANT_H5_V1_4_COMPAT */
- long log_flags = H5FD_LOG_LOC_IO;
-#endif /* H5_WANT_H5_V1_4_COMPAT */
- H5FD_mem_t mt;
/* First use the environment variable, then the constant */
val = HDgetenv("HDF5_DRIVER");
@@ -478,6 +482,7 @@ h5_fileaccess(void)
const char *memb_name[H5FD_MEM_NTYPES];
char sv[H5FD_MEM_NTYPES][1024];
haddr_t memb_addr[H5FD_MEM_NTYPES];
+ H5FD_mem_t mt;
HDmemset(memb_map, 0, sizeof memb_map);
HDmemset(memb_fapl, 0, sizeof memb_fapl);
@@ -497,13 +502,17 @@ h5_fileaccess(void)
return -1;
}
} else if (!HDstrcmp(name, "family")) {
+ hsize_t fam_size = 100*1024*1024; /*100 MB*/
+
/* Family of files, each 1MB and using the default driver */
- if ((val=HDstrtok(NULL, " \t\n\r"))) {
+ if ((val=HDstrtok(NULL, " \t\n\r")))
fam_size = (hsize_t)(HDstrtod(val, NULL) * 1024*1024);
- }
- if (H5Pset_fapl_family(fapl, fam_size, H5P_DEFAULT)<0) return -1;
+ if (H5Pset_fapl_family(fapl, fam_size, H5P_DEFAULT)<0)
+ return -1;
} else if (!HDstrcmp(name, "log")) {
#ifdef H5_WANT_H5_V1_4_COMPAT
+ long verbosity = 1;
+
/* Log file access */
if ((val = strtok(NULL, " \t\n\r")))
verbosity = strtol(val, NULL, 0);
@@ -511,11 +520,13 @@ h5_fileaccess(void)
if (H5Pset_fapl_log(fapl, NULL, (int)verbosity) < 0)
return -1;
#else /* H5_WANT_H5_V1_4_COMPAT */
+ unsigned log_flags = H5FD_LOG_LOC_IO;
+
/* Log file access */
if ((val = HDstrtok(NULL, " \t\n\r")))
- log_flags = HDstrtol(val, NULL, 0);
+ log_flags = (unsigned)HDstrtol(val, NULL, 0);
- if (H5Pset_fapl_log(fapl, NULL, (unsigned)log_flags, 0) < 0)
+ if (H5Pset_fapl_log(fapl, NULL, log_flags, 0) < 0)
return -1;
#endif /* H5_WANT_H5_V1_4_COMPAT */
} else {
@@ -781,17 +792,64 @@ h5_get_file_size(const char *filename)
/*
* This routine is designed to provide equivalent functionality to 'printf'
* and allow easy replacement for environments which don't have stdin/stdout
- * available. (i.e. Windows & the Mac)
+ * available. (i.e. Windows & the Mac)
*/
int
-print_func(const char *format,...)
+print_func(const char *format, ...)
{
- va_list arglist;
- int ret_value;
+ va_list arglist;
+ int ret_value;
- va_start(arglist, format);
- ret_value = vprintf(format, arglist);
- va_end(arglist);
- return (ret_value);
+ va_start(arglist, format);
+ ret_value = vprintf(format, arglist);
+ va_end(arglist);
+ return ret_value;
}
+#ifdef H5_HAVE_FILTER_SZIP
+
+
+/*-------------------------------------------------------------------------
+ * Function: h5_szip_can_encode
+ *
+ * Purpose: Retrieve the filter config flags for szip, tell if
+ * encoder is available.
+ *
+ * Return: 1: decode+encode is enabled
+ * 0: only decode is enabled
+ * -1: other
+ *
+ * Programmer:
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+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 &
+ (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)) ==
+ 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)) ==
+ 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)) {
+ return 1;
+ }
+}
+#endif /* H5_HAVE_FILTER_SZIP */
diff --git a/test/h5test.h b/test/h5test.h
index 886a681..ac73506 100644
--- a/test/h5test.h
+++ b/test/h5test.h
@@ -140,6 +140,10 @@ H5TEST_DLL int TestErrPrintf(const char *format, ...);
H5TEST_DLL void SetTest(const char *testname, int action);
+#ifdef H5_HAVE_FILTER_SZIP
+H5TEST_DLL int h5_szip_can_encode(void);
+#endif /* H5_HAVE_FILTER_SZIP */
+
#ifdef H5_HAVE_PARALLEL
H5TEST_DLL int h5_set_info_object(void);
H5TEST_DLL void h5_dump_info_object(MPI_Info info);
diff --git a/test/hyperslab.c b/test/hyperslab.c
index 720dc0f..59a9e08 100644
--- a/test/hyperslab.c
+++ b/test/hyperslab.c
@@ -160,7 +160,7 @@ test_fill(size_t nx, size_t ny, size_t nz,
uint8_t *dst = NULL; /*destination array */
hsize_t hs_size[3]; /*hyperslab size */
hsize_t dst_size[3]; /*destination total size */
- hssize_t dst_offset[3]; /*offset of hyperslab in dest */
+ hsize_t dst_offset[3]; /*offset of hyperslab in dest */
unsigned ref_value; /*reference value */
unsigned acc; /*accumulator */
size_t i, j, k, dx, dy, dz; /*counters */
@@ -206,9 +206,9 @@ test_fill(size_t nx, size_t ny, size_t nz,
dst_size[0] = nx;
dst_size[1] = ny;
dst_size[2] = nz;
- dst_offset[0] = (hssize_t)i;
- dst_offset[1] = (hssize_t)j;
- dst_offset[2] = (hssize_t)k;
+ dst_offset[0] = i;
+ dst_offset[1] = j;
+ dst_offset[2] = k;
hs_size[0] = dx;
hs_size[1] = dy;
hs_size[2] = dz;
@@ -221,13 +221,13 @@ test_fill(size_t nx, size_t ny, size_t nz,
* original * fill values and add the new ones.
*/
ref_value = init_full(dst, nx, ny, nz);
- for (u=(size_t)dst_offset[0];
+ for (u=dst_offset[0];
u<dst_offset[0]+dx;
u++) {
- for (v = (size_t)dst_offset[1];
+ for (v = dst_offset[1];
v < dst_offset[1] + dy;
v++) {
- for (w = (size_t)dst_offset[2];
+ for (w = dst_offset[2];
w < dst_offset[2] + dz;
w++) {
ref_value -= dst[u*ny*nz+v*nz+w];
@@ -333,8 +333,8 @@ test_copy(int mode,
hsize_t hs_size[3]; /*hyperslab size */
hsize_t dst_size[3]; /*destination total size */
hsize_t src_size[3]; /*source total size */
- hssize_t dst_offset[3]; /*offset of hyperslab in dest */
- hssize_t src_offset[3]; /*offset of hyperslab in source */
+ hsize_t dst_offset[3]; /*offset of hyperslab in dest */
+ hsize_t src_offset[3]; /*offset of hyperslab in source */
unsigned ref_value; /*reference value */
unsigned acc; /*accumulator */
hsize_t i, j, k, dx, dy, dz; /*counters */
@@ -422,25 +422,25 @@ test_copy(int mode,
dst_offset[0] = 0;
dst_offset[1] = 0;
dst_offset[2] = 0;
- src_offset[0] = (hssize_t)i;
- src_offset[1] = (hssize_t)j;
- src_offset[2] = (hssize_t)k;
+ src_offset[0] = i;
+ src_offset[1] = j;
+ src_offset[2] = k;
break;
case VARIABLE_DST:
- dst_offset[0] = (hssize_t)i;
- dst_offset[1] = (hssize_t)j;
- dst_offset[2] = (hssize_t)k;
+ dst_offset[0] = i;
+ dst_offset[1] = j;
+ dst_offset[2] = k;
src_offset[0] = 0;
src_offset[1] = 0;
src_offset[2] = 0;
break;
case VARIABLE_BOTH:
- dst_offset[0] = (hssize_t)i;
- dst_offset[1] = (hssize_t)j;
- dst_offset[2] = (hssize_t)k;
- src_offset[0] = (hssize_t)i;
- src_offset[1] = (hssize_t)j;
- src_offset[2] = (hssize_t)k;
+ dst_offset[0] = i;
+ dst_offset[1] = j;
+ dst_offset[2] = k;
+ src_offset[0] = i;
+ src_offset[1] = j;
+ src_offset[2] = k;
break;
default:
abort();
@@ -608,8 +608,8 @@ test_multifill(size_t nx)
{
hsize_t i, j;
hsize_t size;
- hssize_t src_stride;
- hssize_t dst_stride;
+ hsize_t src_stride;
+ hsize_t dst_stride;
char s[64];
struct a_struct {
@@ -743,7 +743,7 @@ test_endian(size_t nx)
size[1] = 4;
/* Copy the array */
- H5V_stride_copy(2, (hsize_t)1, size, dst_stride, dst + 3, src_stride, src);
+ H5V_stride_copy_s(2, (hsize_t)1, size, dst_stride, dst + 3, src_stride, src);
/* Compare */
for (i = 0; i < nx; i++) {
@@ -802,7 +802,7 @@ test_transpose(size_t nx, size_t ny)
int *src = NULL;
int *dst = NULL;
hsize_t i, j;
- hssize_t src_stride[2], dst_stride[2];
+ hsize_t src_stride[2], dst_stride[2];
hsize_t size[2];
char s[256];
@@ -906,8 +906,8 @@ test_sub_super(size_t nx, size_t ny)
uint8_t *full = NULL; /*original image */
uint8_t *half = NULL; /*image at 1/2 resolution */
uint8_t *twice = NULL; /*2x2 pixels */
- hssize_t src_stride[4]; /*source stride info */
- hssize_t dst_stride[4]; /*destination stride info */
+ hsize_t src_stride[4]; /*source stride info */
+ hsize_t dst_stride[4]; /*destination stride info */
hsize_t size[4]; /*number of sample points */
hsize_t i, j;
char s[256];
@@ -1077,7 +1077,7 @@ test_array_fill(size_t lo, size_t hi)
/* Setup */
for(u=0; u<ARRAY_FILL_SIZE; u++)
- src[u]=(int)u;
+ src[u]=(char)u;
/* Fill */
for(w=lo; w<=hi; w++) {
@@ -1125,8 +1125,8 @@ test_array_offset_n_calc(size_t n, size_t x, size_t y, size_t z)
hsize_t off; /* Offset in array */
size_t u, v, w; /* Local index variables */
hsize_t dims[ARRAY_OFFSET_NDIMS]; /* X, Y & X coordinates of array to check */
- hssize_t coords[ARRAY_OFFSET_NDIMS]; /* X, Y & X coordinates to check offset of */
- hssize_t new_coords[ARRAY_OFFSET_NDIMS]; /* X, Y & X coordinates of offset */
+ hsize_t coords[ARRAY_OFFSET_NDIMS]; /* X, Y & X coordinates to check offset of */
+ hsize_t new_coords[ARRAY_OFFSET_NDIMS]; /* X, Y & X coordinates of offset */
char s[256];
sprintf(s, "array offset %4lux%4lux%4lu elements", (unsigned long)z,(unsigned long)y,(unsigned long)x);
diff --git a/test/istore.c b/test/istore.c
index f7baf31..2f3f907 100644
--- a/test/istore.c
+++ b/test/istore.c
@@ -53,7 +53,7 @@ const char *FILENAME[] = {
#endif /* H5_HAVE_LARGE_HSIZET */
hsize_t chunk_dims[H5O_LAYOUT_NDIMS];
-hssize_t zero[H5O_LAYOUT_NDIMS];
+hsize_t zero[H5O_LAYOUT_NDIMS];
/*-------------------------------------------------------------------------
@@ -228,8 +228,8 @@ test_extend(hid_t f, const char *prefix,
int ndims;
uint8_t *buf = NULL, *check = NULL, *whole = NULL;
char dims[64], s[256], name[256];
- hssize_t offset[3];
- hssize_t max_corner[3];
+ hsize_t offset[3];
+ hsize_t max_corner[3];
hsize_t size[3];
hsize_t whole_size[3];
hsize_t nelmts;
@@ -274,7 +274,7 @@ test_extend(hid_t f, const char *prefix,
if((fspace=H5Dget_space(dataset))<0) TEST_ERROR;
for (ctr = 0;
- H5V_vector_lt_s((unsigned)ndims, max_corner, (hssize_t*)whole_size);
+ H5V_vector_lt_u((unsigned)ndims, max_corner, whole_size);
ctr++) {
/* Size and location */
@@ -359,9 +359,8 @@ test_extend(hid_t f, const char *prefix,
size, H5V_ZERO, buf); /*src*/
/* Update max corner */
- for (i=0; i<(size_t)ndims; i++) {
- max_corner[i] = MAX(max_corner[i], offset[i]+(hssize_t)size[i]);
- }
+ for (i=0; i<(size_t)ndims; i++)
+ max_corner[i] = MAX(max_corner[i], offset[i]+size[i]);
}
/* Now read the entire array back out and check it */
@@ -442,7 +441,7 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks,
int ndims;
hsize_t ctr;
char dims[64], s[256], name[256];
- hssize_t offset[3];
+ hsize_t offset[3];
hsize_t size[3], total = 0;
uint8_t *buf = NULL;
hsize_t whole_size[3]; /* Size of dataset's dataspace */
@@ -492,9 +491,9 @@ test_sparse(hid_t f, const char *prefix, size_t nblocks,
if((mspace=H5Screate_simple(ndims,size,NULL))<0) TEST_ERROR;
for (ctr=0; ctr<nblocks; ctr++) {
- offset[0] = (hssize_t)(HDrandom() % (TEST_SPARSE_SIZE-nx));
- offset[1] = (hssize_t)(HDrandom() % (TEST_SPARSE_SIZE-ny));
- offset[2] = (hssize_t)(HDrandom() % (TEST_SPARSE_SIZE-nz));
+ offset[0] = (hsize_t)(HDrandom() % (TEST_SPARSE_SIZE-nx));
+ offset[1] = (hsize_t)(HDrandom() % (TEST_SPARSE_SIZE-ny));
+ offset[2] = (hsize_t)(HDrandom() % (TEST_SPARSE_SIZE-nz));
/* Select region in file dataspace */
if(H5Sselect_hyperslab(fspace,H5S_SELECT_SET,offset,NULL,size,NULL)<0) TEST_ERROR;
diff --git a/test/ntypes.c b/test/ntypes.c
index 6b7c827..bcbbcf8 100644
--- a/test/ntypes.c
+++ b/test/ntypes.c
@@ -13,10 +13,10 @@
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
- * Programmer: Raymond Lu
- * October 14, 2001
+ * Programmer: Raymond Lu
+ * October 14, 2001
*
- * Purpose: Tests the H5Tget_native_type function.
+ * Purpose: Tests the H5Tget_native_type function.
*/
#include "h5test.h"
@@ -30,23 +30,24 @@ const char *FILENAME[] = {
#define DIM1 200
#define DIM3 20
-int ipoints2[DIM0][DIM1], icheck2[DIM0][DIM1];
-short spoints2[DIM0][DIM1], scheck2[DIM0][DIM1];
-int ipoints3[DIM0][DIM1][5], icheck3[DIM0][DIM1][5];
-#define DSET_ATOMIC_NAME_1 "atomic_type_1"
-#define DSET_ATOMIC_NAME_2 "atomic_type_2"
-#define DSET_ATOMIC_NAME_3 "atomic_type_3"
-#define DSET_ATOMIC_NAME_4 "atomic_type_4"
-#define DSET_ATOMIC_NAME_5 "atomic_type_5"
+int ipoints2[DIM0][DIM1], icheck2[DIM0][DIM1];
+short spoints2[DIM0][DIM1], scheck2[DIM0][DIM1];
+int ipoints3[DIM0][DIM1][5], icheck3[DIM0][DIM1][5];
+
+#define DSET_ATOMIC_NAME_1 "atomic_type_1"
+#define DSET_ATOMIC_NAME_2 "atomic_type_2"
+#define DSET_ATOMIC_NAME_3 "atomic_type_3"
+#define DSET_ATOMIC_NAME_4 "atomic_type_4"
+#define DSET_ATOMIC_NAME_5 "atomic_type_5"
#define DSET_COMPOUND_NAME "compound_type"
#define DSET_COMPOUND_NAME_2 "compound_type_2"
#define DSET_COMPOUND_NAME_3 "compound_type_3"
#define DSET_COMPOUND_NAME_4 "compound_type_4"
-#define DSET_ENUM_NAME "enum_type"
-#define DSET_ARRAY_NAME "array_type"
-#define DSET_ARRAY2_NAME "array_type_2"
-#define DSET_VL_NAME "vl_type"
+#define DSET_ENUM_NAME "enum_type"
+#define DSET_ARRAY_NAME "array_type"
+#define DSET_ARRAY2_NAME "array_type_2"
+#define DSET_VL_NAME "vl_type"
#define DSET_VLSTR_NAME "vlstr_type"
#define DSET_STR_NAME "str_type"
#define DSET_OPAQUE_NAME "opaque_type"
@@ -54,22 +55,22 @@ int ipoints3[DIM0][DIM1][5], icheck3[DIM0][DIM1][5];
#define SPACE1_DIM1 4
#define SPACE1_RANK 1
-#define SPACE2_RANK 2
-#define SPACE2_DIM1 10
-#define SPACE2_DIM2 10
+#define SPACE2_RANK 2
+#define SPACE2_DIM1 10
+#define SPACE2_DIM2 10
/*-------------------------------------------------------------------------
- * Function: test_atomic_dtype
+ * Function: test_atomic_dtype
*
- * Purpose: Test H5Tget_native_type for atomic datatype
+ * Purpose: Test H5Tget_native_type for atomic datatype
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * October 15, 2002
+ * Programmer: Raymond Lu
+ * October 15, 2002
*
* Modifications:
*
@@ -78,19 +79,19 @@ int ipoints3[DIM0][DIM1][5], icheck3[DIM0][DIM1][5];
static herr_t
test_atomic_dtype(hid_t file)
{
- hid_t dataset, space;
+ hid_t dataset, space;
hid_t dtype, native_type;
- int i, j, n;
- hsize_t dims[2];
+ int i, j, n;
+ hsize_t dims[2];
void *tmp;
TESTING("atomic datatype");
/* Initialize the dataset */
for (i = n = 0; i < DIM0; i++) {
- for (j = 0; j < DIM1; j++) {
- ipoints2[i][j] = n++;
- }
+ for (j = 0; j < DIM1; j++) {
+ ipoints2[i][j] = n++;
+ }
}
/* Create the data space */
@@ -101,11 +102,11 @@ test_atomic_dtype(hid_t file)
/*------------------- Test data values ------------------------*/
/* Create the dataset */
if ((dataset = H5Dcreate(file, DSET_ATOMIC_NAME_1, H5T_STD_I32BE, space,
- H5P_DEFAULT))<0) TEST_ERROR;
+ H5P_DEFAULT))<0) TEST_ERROR;
/* Write the data to the dataset */
if (H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, ipoints2)<0)
- TEST_ERROR;
+ TEST_ERROR;
/* Close dataset */
if(H5Dclose(dataset)<0) TEST_ERROR;
@@ -131,7 +132,7 @@ test_atomic_dtype(hid_t file)
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;
+ TEST_ERROR;
/* Copy data from temporary buffer to destination buffer */
memcpy(icheck2, tmp, (size_t)(DIM0*DIM1*H5Tget_size(native_type)));
@@ -143,14 +144,14 @@ test_atomic_dtype(hid_t file)
/* Check that the values read are the same as the values written */
for (i = 0; i < DIM0; i++) {
- for (j = 0; j < DIM1; j++) {
- if (ipoints2[i][j] != icheck2[i][j]) {
- H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %d,%d\n", i, j);
- goto error;
- }
- }
+ for (j = 0; j < DIM1; j++) {
+ if (ipoints2[i][j] != icheck2[i][j]) {
+ H5_FAILED();
+ printf(" Read different values than written.\n");
+ printf(" At index %d,%d\n", i, j);
+ goto error;
+ }
+ }
}
if(H5Dclose(dataset)<0) TEST_ERROR;
@@ -161,7 +162,7 @@ test_atomic_dtype(hid_t file)
/* Create the dataset of H5T_STD_I64LE */
if ((dataset = H5Dcreate(file, DSET_ATOMIC_NAME_2, H5T_STD_I64LE, space,
- H5P_DEFAULT))<0) TEST_ERROR;
+ H5P_DEFAULT))<0) TEST_ERROR;
if((dtype=H5Dget_type(dataset))<0) TEST_ERROR;
@@ -183,7 +184,7 @@ test_atomic_dtype(hid_t file)
/* Create the dataset of H5T_STD_I8LE */
if ((dataset = H5Dcreate(file, DSET_ATOMIC_NAME_3, H5T_STD_I8LE, space,
- H5P_DEFAULT))<0) TEST_ERROR;
+ H5P_DEFAULT))<0) TEST_ERROR;
if((dtype=H5Dget_type(dataset))<0) TEST_ERROR;
@@ -205,7 +206,7 @@ test_atomic_dtype(hid_t file)
/* Create the dataset of H5T_IEEE_F32BE */
if ((dataset = H5Dcreate(file, DSET_ATOMIC_NAME_4, H5T_IEEE_F32BE, space,
- H5P_DEFAULT))<0) TEST_ERROR;
+ H5P_DEFAULT))<0) TEST_ERROR;
if((dtype=H5Dget_type(dataset))<0) TEST_ERROR;
@@ -227,7 +228,7 @@ test_atomic_dtype(hid_t file)
/* Create the dataset of H5T_IEEE_F64BE */
if ((dataset = H5Dcreate(file, DSET_ATOMIC_NAME_5, H5T_IEEE_F64BE, space,
- H5P_DEFAULT))<0) TEST_ERROR;
+ H5P_DEFAULT))<0) TEST_ERROR;
if((dtype=H5Dget_type(dataset))<0) TEST_ERROR;
@@ -259,16 +260,16 @@ test_atomic_dtype(hid_t file)
/*-------------------------------------------------------------------------
- * Function: test_compound_dtype2
+ * Function: test_compound_dtype2
*
- * Purpose: Test H5Tget_native_type for compound datatype
+ * Purpose: Test H5Tget_native_type for compound datatype
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * October 15, 2002
+ * Programmer: Raymond Lu
+ * October 15, 2002
*
* Modifications:
*
@@ -287,13 +288,13 @@ test_compound_dtype2(hid_t file)
s2 st;
unsigned long_long l;
} s1;
- hid_t dataset, space;
+ hid_t dataset, space;
hid_t dtype, native_type, tid, tid2, tid_m, tid_m2,
mem_id, nest_mem_id;
- int i, j, n;
- hsize_t dims[2];
+ int i, j, n;
+ hsize_t dims[2];
s1 *temp_point, *temp_check;
- s1 *points=NULL, *check=NULL;
+ s1 *points=NULL, *check=NULL;
void *tmp, *bkg;
TESTING("nested compound datatype");
@@ -306,13 +307,13 @@ test_compound_dtype2(hid_t file)
/* Initialize the dataset */
for (i = n = 0, temp_point=points; i < DIM0; i++) {
- for (j = 0; j < DIM1; j++,temp_point++) {
- temp_point->c = 't';
- temp_point->i = n++;
- temp_point->st.c2 = i+j;
- temp_point->st.l2 = (i*5+j*50)*n;
- temp_point->l = (i*10+j*100)*n;
- }
+ for (j = 0; j < DIM1; j++,temp_point++) {
+ temp_point->c = 't';
+ temp_point->i = n++;
+ temp_point->st.c2 = i+j;
+ temp_point->st.l2 = (i*5+j*50)*n;
+ temp_point->l = (i*10+j*100)*n;
+ }
}
/* Create the data space */
@@ -354,7 +355,7 @@ test_compound_dtype2(hid_t file)
/* Create the dataset */
if ((dataset = H5Dcreate(file, DSET_COMPOUND_NAME_2, tid, space,
- H5P_DEFAULT))<0) TEST_ERROR;
+ H5P_DEFAULT))<0) TEST_ERROR;
/* Create compound datatype for memory */
if((tid_m2=H5Tcreate(H5T_COMPOUND, sizeof(s2)))<0) TEST_ERROR;
@@ -370,7 +371,7 @@ test_compound_dtype2(hid_t file)
/* Write the data to the dataset */
if (H5Dwrite(dataset, tid_m, H5S_ALL, H5S_ALL, H5P_DEFAULT, points)<0)
- TEST_ERROR;
+ TEST_ERROR;
/* Close dataset */
if(H5Dclose(dataset)<0) TEST_ERROR;
@@ -457,7 +458,7 @@ test_compound_dtype2(hid_t file)
TEST_ERROR;
if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp)<0)
- TEST_ERROR;
+ TEST_ERROR;
memcpy(check, tmp, DIM0*DIM1*H5Tget_size(native_type));
free(tmp);
@@ -469,18 +470,18 @@ test_compound_dtype2(hid_t file)
/* 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++) {
- if (temp_point->c != temp_check->c ||
- temp_point->i != temp_check->i ||
- temp_point->st.c2 != temp_check->st.c2 ||
- temp_point->st.l2 != temp_check->st.l2 ||
- temp_point->l != temp_check->l ) {
- H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %d,%d\n", i, j);
- goto error;
- }
- }
+ for (j = 0; j < DIM1; j++, temp_point++,temp_check++) {
+ if (temp_point->c != temp_check->c ||
+ temp_point->i != temp_check->i ||
+ temp_point->st.c2 != temp_check->st.c2 ||
+ temp_point->st.l2 != temp_check->st.l2 ||
+ temp_point->l != temp_check->l ) {
+ H5_FAILED();
+ printf(" Read different values than written.\n");
+ printf(" At index %d,%d\n", i, j);
+ goto error;
+ }
+ }
}
/* Close temporary datatypes */
@@ -511,16 +512,16 @@ error:
/*-------------------------------------------------------------------------
- * Function: test_compound_dtype
+ * Function: test_compound_dtype
*
- * Purpose: Test H5Tget_native_type for compound datatype
+ * Purpose: Test H5Tget_native_type for compound datatype
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * October 15, 2002
+ * Programmer: Raymond Lu
+ * October 15, 2002
*
* Modifications:
*
@@ -534,12 +535,12 @@ test_compound_dtype(hid_t file)
unsigned int i;
long_long l;
} s1;
- hid_t dataset, space;
+ hid_t dataset, space;
hid_t dtype, native_type, tid, tid2, mem_id;
- int i, j, n;
- hsize_t dims[2];
+ int i, j, n;
+ hsize_t dims[2];
s1 *temp_point, *temp_check;
- s1 *points, *check;
+ s1 *points, *check;
void *tmp, *bkg;
TESTING("compound datatype");
@@ -553,11 +554,11 @@ test_compound_dtype(hid_t file)
/* Initialize the dataset */
for (i = n = 0, temp_point=points; i < DIM0; i++) {
- for (j = 0; j < DIM1; j++,temp_point++) {
- temp_point->c = 't';
- temp_point->i = n++;
- temp_point->l = (i*10+j*100)*n;
- }
+ for (j = 0; j < DIM1; j++,temp_point++) {
+ temp_point->c = 't';
+ temp_point->i = n++;
+ temp_point->l = (i*10+j*100)*n;
+ }
}
/* Create the data space */
@@ -575,7 +576,7 @@ test_compound_dtype(hid_t file)
/* Create the dataset */
if ((dataset = H5Dcreate(file, DSET_COMPOUND_NAME, tid, space,
- H5P_DEFAULT))<0) TEST_ERROR;
+ H5P_DEFAULT))<0) TEST_ERROR;
/* Create compound datatype for datatype in memory */
if((tid2=H5Tcreate(H5T_COMPOUND, sizeof(s1)))<0) TEST_ERROR;
@@ -585,7 +586,7 @@ test_compound_dtype(hid_t file)
/* Write the data to the dataset */
if (H5Dwrite(dataset, tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, points)<0)
- TEST_ERROR;
+ TEST_ERROR;
/* Close dataset */
if(H5Dclose(dataset)<0) TEST_ERROR;
@@ -639,7 +640,7 @@ test_compound_dtype(hid_t file)
bkg = calloc(sizeof(s1),DIM0*DIM1);
if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp)<0)
- TEST_ERROR;
+ TEST_ERROR;
memcpy(check, tmp, DIM0*DIM1*H5Tget_size(native_type));
free(tmp);
@@ -651,16 +652,16 @@ test_compound_dtype(hid_t file)
/* 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++) {
- if (temp_point->c != temp_check->c ||
- temp_point->i != temp_check->i ||
- temp_point->l != temp_check->l ) {
- H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %d,%d\n", i, j);
- goto error;
- }
- }
+ for (j = 0; j < DIM1; j++, temp_point++,temp_check++) {
+ if (temp_point->c != temp_check->c ||
+ temp_point->i != temp_check->i ||
+ temp_point->l != temp_check->l ) {
+ H5_FAILED();
+ printf(" Read different values than written.\n");
+ printf(" At index %d,%d\n", i, j);
+ goto error;
+ }
+ }
}
/* Close datatype */
@@ -684,16 +685,16 @@ test_compound_dtype(hid_t file)
/*-------------------------------------------------------------------------
- * Function: test_compound_dtype3
+ * Function: test_compound_dtype3
*
- * Purpose: Test H5Tget_native_type for compound datatype
+ * Purpose: Test H5Tget_native_type for compound datatype
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * October 15, 2002
+ * Programmer: Raymond Lu
+ * October 15, 2002
*
* Modifications:
*
@@ -707,14 +708,14 @@ test_compound_dtype3(hid_t file)
int a[5];
long_long l;
} s1;
- hid_t dataset, space;
+ hid_t dataset, space;
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;
- hsize_t dims[2];
+ int i, j, k, n;
+ hsize_t dims[2];
s1 *temp_point, *temp_check;
- s1 *points=NULL, *check=NULL;
+ s1 *points=NULL, *check=NULL;
void *tmp, *bkg;
TESTING("compound datatype with array as field");
@@ -727,12 +728,12 @@ test_compound_dtype3(hid_t file)
/* Initialize the dataset */
for (i = n = 0, temp_point=points; i < DIM0; i++) {
- for (j = 0; j < DIM1; j++,temp_point++) {
- temp_point->c = 't';
- temp_point->l = (i*10+j*100)*n;
- for (k = 0; k < 5; k++)
- (temp_point->a)[k] = n++;
- }
+ for (j = 0; j < DIM1; j++,temp_point++) {
+ temp_point->c = 't';
+ temp_point->l = (i*10+j*100)*n;
+ for (k = 0; k < 5; k++)
+ (temp_point->a)[k] = n++;
+ }
}
/* Create the data space */
@@ -753,7 +754,7 @@ test_compound_dtype3(hid_t file)
/* Create the dataset */
if ((dataset = H5Dcreate(file, DSET_COMPOUND_NAME_3, tid, space,
- H5P_DEFAULT))<0) TEST_ERROR;
+ H5P_DEFAULT))<0) TEST_ERROR;
/* Create array datatype */
if((tid_m2=H5Tarray_create(H5T_NATIVE_INT, 1, array_dims, NULL))<0) TEST_ERROR;
@@ -766,7 +767,7 @@ test_compound_dtype3(hid_t file)
/* Write the data to the dataset */
if (H5Dwrite(dataset, tid_m, H5S_ALL, H5S_ALL, H5P_DEFAULT, points)<0)
- TEST_ERROR;
+ TEST_ERROR;
/* Close dataset */
if(H5Dclose(dataset)<0) TEST_ERROR;
@@ -833,7 +834,7 @@ test_compound_dtype3(hid_t file)
TEST_ERROR;
if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp)<0)
- TEST_ERROR;
+ TEST_ERROR;
memcpy(check, tmp, DIM0*DIM1*H5Tget_size(native_type));
free(tmp);
@@ -845,24 +846,24 @@ test_compound_dtype3(hid_t file)
/* 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++) {
- if (temp_point->c != temp_check->c ||
- temp_point->l != temp_check->l ) {
- H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %d,%d\n", i, j);
- goto error;
- }
-
- for (k = 0; k < 5; k++) {
+ for (j = 0; j < DIM1; j++, temp_point++,temp_check++) {
+ if (temp_point->c != temp_check->c ||
+ temp_point->l != temp_check->l ) {
+ H5_FAILED();
+ printf(" Read different values than written.\n");
+ printf(" At index %d,%d\n", i, j);
+ goto error;
+ }
+
+ for (k = 0; k < 5; k++) {
if(temp_point->a[k] != temp_check->a[k]) {
- H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %d,%d,%d\n", i, j, k);
- goto error;
+ H5_FAILED();
+ printf(" Read different values than written.\n");
+ printf(" At index %d,%d,%d\n", i, j, k);
+ goto error;
}
}
- }
+ }
}
H5Dclose(dataset);
@@ -884,16 +885,16 @@ test_compound_dtype3(hid_t file)
/*-------------------------------------------------------------------------
- * Function: test_compound_opaque
+ * Function: test_compound_opaque
*
- * Purpose: Test H5Tget_native_type for compound datatype with opaque field
+ * Purpose: Test H5Tget_native_type for compound datatype with opaque field
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Quincey Koziol
- * January 31, 2004
+ * Programmer: Quincey Koziol
+ * January 31, 2004
*
* Modifications:
*
@@ -907,13 +908,13 @@ test_compound_opaque(hid_t file)
unsigned char o[5];
long_long l;
} s1;
- hid_t dataset, space;
+ hid_t dataset, space;
hid_t dtype, native_type, tid, tid2, tid_m,
mem_id;
- int i, j, k, n;
- hsize_t dims[2];
+ int i, j, k, n;
+ hsize_t dims[2];
s1 *temp_point, *temp_check;
- s1 *points=NULL, *check=NULL;
+ s1 *points=NULL, *check=NULL;
void *tmp, *bkg;
TESTING("compound datatype with opaque field");
@@ -926,12 +927,12 @@ test_compound_opaque(hid_t file)
/* Initialize the dataset */
for (i = n = 0, temp_point=points; i < DIM0; i++) {
- for (j = 0; j < DIM1; j++,temp_point++) {
- temp_point->c = 't';
- temp_point->l = (i*10+j*100)*n;
- for (k = 0; k < 5; k++)
- (temp_point->o)[k] = n++;
- }
+ for (j = 0; j < DIM1; j++,temp_point++) {
+ temp_point->c = 't';
+ temp_point->l = (i*10+j*100)*n;
+ for (k = 0; k < 5; k++)
+ (temp_point->o)[k] = n++;
+ }
}
/* Create the data space */
@@ -953,7 +954,7 @@ test_compound_opaque(hid_t file)
/* Create the dataset */
if ((dataset = H5Dcreate(file, DSET_COMPOUND_NAME_4, tid, space,
- H5P_DEFAULT))<0) TEST_ERROR;
+ H5P_DEFAULT))<0) TEST_ERROR;
/* Create compound datatype for datatype in memory */
if((tid_m=H5Tcreate(H5T_COMPOUND, sizeof(s1)))<0) TEST_ERROR;
@@ -963,7 +964,7 @@ test_compound_opaque(hid_t file)
/* Write the data to the dataset */
if (H5Dwrite(dataset, tid_m, H5S_ALL, H5S_ALL, H5P_DEFAULT, points)<0)
- TEST_ERROR;
+ TEST_ERROR;
/* Close dataset */
if(H5Dclose(dataset)<0) TEST_ERROR;
@@ -1023,7 +1024,7 @@ test_compound_opaque(hid_t file)
TEST_ERROR;
if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp)<0)
- TEST_ERROR;
+ TEST_ERROR;
HDmemcpy(check, tmp, DIM0*DIM1*H5Tget_size(native_type));
HDfree(tmp);
@@ -1035,24 +1036,24 @@ test_compound_opaque(hid_t file)
/* 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++) {
- if (temp_point->c != temp_check->c ||
- temp_point->l != temp_check->l ) {
- H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %d,%d\n", i, j);
- goto error;
- }
-
- for (k = 0; k < 5; k++) {
+ for (j = 0; j < DIM1; j++, temp_point++,temp_check++) {
+ if (temp_point->c != temp_check->c ||
+ temp_point->l != temp_check->l ) {
+ H5_FAILED();
+ printf(" Read different values than written.\n");
+ printf(" At index %d,%d\n", i, j);
+ goto error;
+ }
+
+ for (k = 0; k < 5; k++) {
if(temp_point->o[k] != temp_check->o[k]) {
- H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %d,%d,%d\n", i, j, k);
- goto error;
+ H5_FAILED();
+ printf(" Read different values than written.\n");
+ printf(" At index %d,%d,%d\n", i, j, k);
+ goto error;
}
}
- }
+ }
}
H5Dclose(dataset);
@@ -1073,16 +1074,16 @@ test_compound_opaque(hid_t file)
/*-------------------------------------------------------------------------
- * Function: test_enum_dtype
+ * Function: test_enum_dtype
*
- * Purpose: Test H5Tget_native_type for enumerate datatype
+ * Purpose: Test H5Tget_native_type for enumerate datatype
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * October 15, 2002
+ * Programmer: Raymond Lu
+ * October 15, 2002
*
* Modifications:
*
@@ -1091,10 +1092,10 @@ test_compound_opaque(hid_t file)
static herr_t
test_enum_dtype(hid_t file)
{
- hid_t dataset, space;
+ hid_t dataset, space;
hid_t tid, tid_m, dtype, native_type;
- int i, j, n;
- hsize_t dims[2];
+ int i, j, n;
+ hsize_t dims[2];
void *tmp;
short colors[8];
unsigned char sub_colors[16];
@@ -1112,7 +1113,7 @@ test_enum_dtype(hid_t file)
/* Initialize the dataset */
for (i = 0; i < DIM0; i++) {
for (j=0, n=0; j < DIM1; j++, n++)
- spoints2[i][j] = (i*10+j*100+n)%8;
+ spoints2[i][j] = (i*10+j*100+n)%8;
}
/* Create the data space */
@@ -1131,7 +1132,7 @@ test_enum_dtype(hid_t file)
/* Create the dataset */
if ((dataset = H5Dcreate(file, DSET_ENUM_NAME, tid, space,
- H5P_DEFAULT))<0) TEST_ERROR;
+ H5P_DEFAULT))<0) TEST_ERROR;
/* Construct enum type based on native type in memory */
if((tid_m=H5Tenum_create(H5T_NATIVE_SHORT))<0) TEST_ERROR;
@@ -1143,7 +1144,7 @@ test_enum_dtype(hid_t file)
/* Write the data to the dataset */
if (H5Dwrite(dataset, tid_m, H5S_ALL, H5S_ALL, H5P_DEFAULT, spoints2)<0)
- TEST_ERROR;
+ TEST_ERROR;
/* Close dataset */
if(H5Dclose(dataset)<0) TEST_ERROR;
@@ -1167,7 +1168,7 @@ test_enum_dtype(hid_t file)
tmp = malloc(DIM0*DIM1*H5Tget_size(native_type));
if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp)<0)
- TEST_ERROR;
+ TEST_ERROR;
memcpy(scheck2, tmp, DIM0*DIM1*H5Tget_size(native_type));
free(tmp);
@@ -1177,16 +1178,16 @@ test_enum_dtype(hid_t file)
/* Check that the values read are the same as the values written */
for (i = 0; i < DIM0; i++) {
- for (j = 0; j < DIM1; j++) {
- if (spoints2[i][j] != scheck2[i][j]) {
- H5_FAILED();
- printf(" Read different values than written.\n");
- printf(" At index %d,%d\n", i, j);
+ for (j = 0; j < DIM1; j++) {
+ if (spoints2[i][j] != scheck2[i][j]) {
+ 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],
scheck2[i][j]);
- goto error;
- }
- }
+ goto error;
+ }
+ }
}
H5Dclose(dataset);
@@ -1202,16 +1203,16 @@ test_enum_dtype(hid_t file)
/*-------------------------------------------------------------------------
- * Function: test_array_dtype
+ * Function: test_array_dtype
*
- * Purpose: Test H5Tget_native_type for array datatype
+ * Purpose: Test H5Tget_native_type for array datatype
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * October 15, 2002
+ * Programmer: Raymond Lu
+ * October 15, 2002
*
* Modifications:
*
@@ -1225,12 +1226,12 @@ test_array_dtype(hid_t file)
int i;
long_long l;
} s1;
- hid_t dataset, space;
+ hid_t dataset, space;
hid_t dtype, native_type, tid, tid2, tid3, tid_m;
- int i, j, k, n;
- hsize_t space_dims[2], array_dims[1]={5};
+ int i, j, k, n;
+ hsize_t space_dims[2], array_dims[1]={5};
s1 *temp_point, *temp_check;
- s1 *points=NULL, *check=NULL;
+ s1 *points=NULL, *check=NULL;
void *tmp;
TESTING("array of compound datatype");
@@ -1243,7 +1244,7 @@ test_array_dtype(hid_t file)
/* Initialize the dataset */
for(i = n = 0, temp_point=points; i < DIM0; i++)
- for(j = 0; j < DIM1; j++)
+ for(j = 0; j < DIM1; j++)
for(k = 0; k < 5; k++,temp_point++) {
temp_point->c= 't';
temp_point->i= n++;
@@ -1268,7 +1269,7 @@ test_array_dtype(hid_t file)
/* Create the dataset */
if ((dataset = H5Dcreate(file, DSET_ARRAY_NAME, tid, space,
- H5P_DEFAULT))<0) TEST_ERROR;
+ H5P_DEFAULT))<0) TEST_ERROR;
/* Create compound datatype for datatype in memory */
if((tid3=H5Tcreate(H5T_COMPOUND, sizeof(s1)))<0) TEST_ERROR;
@@ -1281,7 +1282,7 @@ test_array_dtype(hid_t file)
/* Write the data to the dataset */
if (H5Dwrite(dataset, tid_m, H5S_ALL, H5S_ALL, H5P_DEFAULT, points)<0)
- TEST_ERROR;
+ TEST_ERROR;
/* Close dataset */
if(H5Dclose(dataset)<0) TEST_ERROR;
@@ -1306,7 +1307,7 @@ test_array_dtype(hid_t file)
tmp = malloc(DIM0*DIM1*H5Tget_size(native_type));
if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp)<0)
- TEST_ERROR;
+ TEST_ERROR;
memcpy(check, tmp, DIM0*DIM1*H5Tget_size(native_type));
free(tmp);
@@ -1316,18 +1317,18 @@ test_array_dtype(hid_t file)
/* 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++) {
+ for (j = 0; j < DIM1; j++) {
for (k = 0; k < 5; k++, temp_point++,temp_check++) {
if (temp_point->c != temp_check->c ||
- temp_point->i != temp_check->i ||
- temp_point->l != temp_check->l ) {
+ temp_point->i != temp_check->i ||
+ temp_point->l != temp_check->l ) {
H5_FAILED();
printf(" Read different values than written.\n");
printf(" At index %d,%d\n", i, j);
goto error;
}
- }
- }
+ }
+ }
}
/* Close HDF5 objects */
@@ -1354,16 +1355,16 @@ error:
/*-------------------------------------------------------------------------
- * Function: test_array_dtype2
+ * Function: test_array_dtype2
*
- * Purpose: Test H5Tget_native_type for array datatype
+ * Purpose: Test H5Tget_native_type for array datatype
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * October 15, 2002
+ * Programmer: Raymond Lu
+ * October 15, 2002
*
* Modifications:
*
@@ -1372,17 +1373,17 @@ error:
static herr_t
test_array_dtype2(hid_t file)
{
- hid_t dataset, space;
+ hid_t dataset, space;
hid_t dtype, native_type, tid, tid_m;
- int i, j, k, n;
- hsize_t space_dims[2], array_dims[1]={5};
+ int i, j, k, n;
+ hsize_t space_dims[2], array_dims[1]={5};
void *tmp;
TESTING("array of atomic datatype");
/* Initialize the dataset */
for(i = n = 0;i < DIM0; i++)
- for(j = 0; j < DIM1; j++)
+ for(j = 0; j < DIM1; j++)
for(k = 0; k < 5; k++)
ipoints3[i][j][k] = n++;
@@ -1396,14 +1397,14 @@ test_array_dtype2(hid_t file)
/* Create the dataset */
if ((dataset = H5Dcreate(file, DSET_ARRAY2_NAME, tid, space,
- H5P_DEFAULT))<0) TEST_ERROR;
+ 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;
+ TEST_ERROR;
/* Close dataset */
if(H5Dclose(dataset)<0) TEST_ERROR;
@@ -1428,7 +1429,7 @@ test_array_dtype2(hid_t file)
tmp = malloc(DIM0*DIM1*H5Tget_size(native_type));
if (H5Dread(dataset, native_type, H5S_ALL, H5S_ALL, H5P_DEFAULT, tmp)<0)
- TEST_ERROR;
+ TEST_ERROR;
memcpy(icheck3, tmp, DIM0*DIM1*H5Tget_size(native_type));
free(tmp);
@@ -1438,7 +1439,7 @@ test_array_dtype2(hid_t file)
/* Check that the values read are the same as the values written */
for (i = 0; i < DIM0; i++) {
- for (j = 0; j < DIM1; j++) {
+ for (j = 0; j < DIM1; j++) {
for (k = 0; k < 5; k++) {
if(icheck3[i][j][k] != ipoints3[i][j][k]) {
H5_FAILED();
@@ -1446,8 +1447,8 @@ test_array_dtype2(hid_t file)
printf(" At index %d,%d\n", i, j);
goto error;
}
- }
- }
+ }
+ }
}
/* Close HDF5 objects */
@@ -1465,16 +1466,16 @@ error:
/*-------------------------------------------------------------------------
- * Function: test_vl_dtype
+ * Function: test_vl_dtype
*
- * Purpose: Test H5Tget_native_type for variable length datatype
+ * Purpose: Test H5Tget_native_type for variable length datatype
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * October 15, 2002
+ * Programmer: Raymond Lu
+ * October 15, 2002
*
* Modifications:
*
@@ -1486,10 +1487,10 @@ test_vl_dtype(hid_t file)
hvl_t wdata[SPACE1_DIM1]; /* Information to write */
hvl_t rdata[SPACE1_DIM1]; /* Information read in */
hvl_t *t1, *t2; /* Temporary pointer to VL information */
- hsize_t dims1[] = {SPACE1_DIM1};
- hid_t dataset, space;
+ hsize_t dims1[] = {SPACE1_DIM1};
+ hid_t dataset, space;
hid_t dtype, native_type, nat_super_type, tid, tid2, tid_m, tid_m2;
- size_t i, j, k;
+ size_t i, j, k;
void* *tmp;
TESTING("variable length datatype");
@@ -1627,16 +1628,16 @@ test_vl_dtype(hid_t file)
/*-------------------------------------------------------------------------
- * Function: test_vlstr_dtype
+ * Function: test_vlstr_dtype
*
- * Purpose: Test H5Tget_native_type for variable length string datatype
+ * Purpose: Test H5Tget_native_type for variable length string datatype
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * October 15, 2002
+ * Programmer: Raymond Lu
+ * October 15, 2002
*
* Modifications:
*
@@ -1652,10 +1653,10 @@ test_vlstr_dtype(hid_t file)
"testing whether that nation or any nation so conceived and so dedicated can long endure."
}; /* Information to write */
char *rdata[SPACE1_DIM1]; /* Information read in */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
- hid_t tid1,dtype,native_type; /* Datatype ID */
- hsize_t dims1[] = {SPACE1_DIM1};
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ hid_t tid1,dtype,native_type; /* Datatype ID */
+ hsize_t dims1[] = {SPACE1_DIM1};
unsigned i; /* counting variable */
/* Output message about test being performed */
@@ -1737,16 +1738,16 @@ error:
/*-------------------------------------------------------------------------
- * Function: test_str_dtype
+ * Function: test_str_dtype
*
- * Purpose: Test H5Tget_native_type for fixed-length string datatype
+ * Purpose: Test H5Tget_native_type for fixed-length string datatype
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * October 15, 2002
+ * Programmer: Raymond Lu
+ * October 15, 2002
*
* Modifications:
*
@@ -1762,10 +1763,10 @@ test_str_dtype(hid_t file)
"4th"
}; /* Information to write */
char rdata[SPACE1_DIM1][4]; /* Information read in */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
- hid_t tid1,dtype,native_type; /* Datatype ID */
- hsize_t dims1[] = {SPACE1_DIM1};
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ hid_t tid1,dtype,native_type; /* Datatype ID */
+ hsize_t dims1[] = {SPACE1_DIM1};
unsigned i; /* counting variable */
/* Output message about test being performed */
@@ -1844,16 +1845,16 @@ error:
/*-------------------------------------------------------------------------
- * Function: test_refer_dtype
+ * Function: test_refer_dtype
*
- * Purpose: Test H5Tget_native_type for reference datatype
+ * Purpose: Test H5Tget_native_type for reference datatype
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * October 15, 2002
+ * Programmer: Raymond Lu
+ * October 15, 2002
*
* Modifications:
*
@@ -1870,11 +1871,11 @@ test_refer_dtype(hid_t file)
float c;
} s1_t;
- hid_t dataset; /* Dataset ID */
- hid_t group; /* Group ID */
- hid_t sid1; /* Dataspace ID */
- hid_t tid1, dtype, native_type; /* Datatype ID */
- hsize_t dims1[] = {1};
+ hid_t dataset; /* Dataset ID */
+ hid_t group; /* Group ID */
+ hid_t sid1; /* Dataspace ID */
+ hid_t tid1, dtype, native_type; /* Datatype ID */
+ hsize_t dims1[] = {1};
hobj_ref_t *wbuf, /* buffer to write to disk */
*rbuf; /* buffer read from disk */
@@ -1999,16 +2000,16 @@ error:
/*-------------------------------------------------------------------------
- * Function: test_refer_dtype2
+ * Function: test_refer_dtype2
*
- * Purpose: Test H5Tget_native_type for reference
+ * Purpose: Test H5Tget_native_type for reference
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * October 15, 2002
+ * Programmer: Raymond Lu
+ * October 15, 2002
*
* Modifications:
*
@@ -2017,17 +2018,17 @@ error:
static herr_t
test_refer_dtype2(hid_t file)
{
- hid_t dset1, /* Dataset ID */
+ hid_t dset1, /* Dataset ID */
dset2; /* Dereferenced dataset ID */
- hid_t sid1, /* Dataspace ID #1 */
- sid2; /* Dataspace ID #2 */
+ hid_t sid1, /* Dataspace ID #1 */
+ sid2; /* Dataspace ID #2 */
hid_t dtype, native_type;
- hsize_t dims1[] = {1},
- dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
- hssize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
- hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */
- hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */
- hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */
+ hsize_t dims1[] = {1},
+ dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
+ hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
+ hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */
+ hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */
+ hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */
hdset_reg_ref_t wbuf, /* buffer to write to disk */
rbuf; /* buffer read from disk */
uint8_t *dwbuf, /* Buffer for writing numeric data to disk */
@@ -2190,16 +2191,16 @@ error:
/*-------------------------------------------------------------------------
- * Function: test_opaque_dtype
+ * Function: test_opaque_dtype
*
- * Purpose: Test H5Tget_native_type for opaque datatype
+ * Purpose: Test H5Tget_native_type for opaque datatype
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * October 15, 2002
+ * Programmer: Raymond Lu
+ * October 15, 2002
*
* Modifications:
*
@@ -2208,11 +2209,11 @@ error:
static herr_t
test_opaque_dtype(hid_t file)
{
- hid_t type=-1, space=-1, dset=-1;
+ hid_t type=-1, space=-1, dset=-1;
hid_t dataset, dtype, native_type;
size_t i;
- unsigned char wbuf[32], rbuf[32];
- hsize_t nelmts;
+ unsigned char wbuf[32], rbuf[32];
+ hsize_t nelmts;
TESTING("opaque datatype");
@@ -2222,13 +2223,13 @@ test_opaque_dtype(hid_t file)
H5Tset_tag(type, "testing 1-byte opaque type")<0 ||
(space=H5Screate_simple(1, &nelmts, NULL))<0 ||
(dset=H5Dcreate(file, DSET_OPAQUE_NAME, type, space, H5P_DEFAULT))<0)
- TEST_ERROR;
+ TEST_ERROR;
for (i=0; i<sizeof(wbuf); i++)
wbuf[i] = (unsigned char)0xff ^ (unsigned char)i;
if (H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf)<0)
- TEST_ERROR;
+ TEST_ERROR;
if (H5Sclose(space)<0) TEST_ERROR;
if (H5Dclose(dset)<0) TEST_ERROR;
@@ -2247,11 +2248,11 @@ test_opaque_dtype(hid_t file)
TEST_ERROR;
for(i=0; i<sizeof(rbuf); i++) {
- if (rbuf[i] != wbuf[i]) {
- H5_FAILED();
- printf(" Read different values than written.\n");
+ if (rbuf[i] != wbuf[i]) {
+ H5_FAILED();
+ printf(" Read different values than written.\n");
printf(" At index %u\n", (unsigned)i);
- goto error;
+ goto error;
}
}
@@ -2269,16 +2270,16 @@ error:
/*-------------------------------------------------------------------------
- * Function: test_bitfield_dtype
+ * Function: test_bitfield_dtype
*
- * Purpose: Test H5Tget_native_type for bitfield datatype
+ * Purpose: Test H5Tget_native_type for bitfield datatype
*
- * Return: Success: 0
+ * Return: Success: 0
*
- * Failure: -1
+ * Failure: -1
*
- * Programmer: Raymond Lu
- * October 15, 2002
+ * Programmer: Raymond Lu
+ * October 15, 2002
*
* Modifications:
*
@@ -2287,11 +2288,11 @@ error:
static herr_t
test_bitfield_dtype(hid_t file)
{
- hid_t type=-1, space=-1, dset=-1;
+ hid_t type=-1, space=-1, dset=-1;
hid_t dataset, dtype, native_type;
- size_t i;
- unsigned char wbuf[32], rbuf[32];
- hsize_t nelmts;
+ size_t i;
+ unsigned char wbuf[32];
+ hsize_t nelmts;
TESTING("bitfield datatype");
@@ -2300,13 +2301,13 @@ test_bitfield_dtype(hid_t file)
if ((type=H5Tcopy(H5T_STD_B8LE))<0 ||
(space=H5Screate_simple(1, &nelmts, NULL))<0 ||
(dset=H5Dcreate(file, DSET_BITFIELD_NAME, type, space, H5P_DEFAULT))<0)
- TEST_ERROR;
+ TEST_ERROR;
for (i=0; i<sizeof(wbuf); i++)
wbuf[i] = (unsigned char)0xff ^ (unsigned char)i;
if (H5Dwrite(dset, type, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf)<0)
- TEST_ERROR;
+ TEST_ERROR;
if (H5Sclose(space)<0) TEST_ERROR;
if (H5Dclose(dset)<0) TEST_ERROR;
@@ -2324,7 +2325,7 @@ test_bitfield_dtype(hid_t file)
puts(" Bit field isn't supported. Should have failed.");
TEST_ERROR;
}
-
+
if (H5Tclose(type)<0) TEST_ERROR;
if (H5Tclose(dtype)<0) TEST_ERROR;
if (H5Dclose(dataset)<0) TEST_ERROR;
@@ -2359,21 +2360,18 @@ error:
static herr_t
test_ninteger(void)
{
- hid_t fid1; /* file ID */
- hid_t fid2; /* file ID */
- hid_t did1; /* dataset ID */
- hid_t did2; /* dataset ID */
- hid_t sid1; /* dataspace ID */
- hid_t dcpl1; /* dataset creation property list ID */
- hid_t dcpl2; /* dataset creation property list ID */
- hid_t tid1; /* file datatype */
- hid_t tid2; /* file datatype */
- hid_t nid1; /* native datatype */
- hid_t nid2; /* native datatype */
- size_t prec1; /* precision */
- size_t prec2; /* precision */
+ hid_t fid1=(-1); /* file ID */
+ hid_t fid2=(-1); /* file ID */
+ hid_t did1=(-1); /* dataset ID */
+ hid_t did2=(-1); /* dataset ID */
+ hid_t sid1=(-1); /* dataspace ID */
+ hid_t dcpl1=(-1); /* dataset creation property list ID */
+ hid_t dcpl2=(-1); /* dataset creation property list ID */
+ hid_t tid1=(-1); /* file datatype */
+ hid_t tid2=(-1); /* file datatype */
+ hid_t nid1=(-1); /* native datatype */
+ hid_t nid2=(-1); /* native datatype */
hsize_t dims[1]={DIM3}; /* dataspace dimensions */
- size_t nsize; /* size of native type */
hsize_t nelmts; /* number of elements in dataset */
int rank=1; /* rank of dataset */
int buf[DIM3];
@@ -2442,7 +2440,7 @@ test_ninteger(void)
goto error;
/* get size */
- if ((nsize=H5Tget_size(nid1))==0)
+ if (H5Tget_size(nid1)==0)
goto error;
/* get rank */
@@ -2485,7 +2483,7 @@ test_ninteger(void)
goto error;
/* check */
- if ((prec1=H5Tget_precision(nid1))!=(prec2=H5Tget_precision(nid2))) {
+ if (H5Tget_precision(nid1)!=H5Tget_precision(nid2)) {
printf(" Precision differ.\n");
goto error;
}
@@ -2540,16 +2538,15 @@ error:
return -1;
} /* end test_ninteger() */
-
/*-------------------------------------------------------------------------
- * Function: main
+ * Function: main
*
- * Purpose: Test H5Tget_native_type for different datatype
+ * Purpose: Test H5Tget_native_type for different datatype
*
- * Programmer: Raymond Lu
- * October 15, 2002
+ * Programmer: Raymond Lu
+ * October 15, 2002
*
* Modifications:
*
@@ -2558,32 +2555,32 @@ error:
int
main(void)
{
- hid_t file, fapl;
- int nerrors=0;
- char filename[1024];
+ hid_t file, fapl;
+ int nerrors=0;
+ char filename[1024];
h5_reset();
fapl = h5_fileaccess();
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0)
- goto error;
-
- nerrors += test_atomic_dtype(file)<0 ?1:0;
- nerrors += test_compound_dtype(file)<0 ?1:0;
- nerrors += test_compound_dtype2(file)<0 ?1:0;
- nerrors += test_compound_dtype3(file)<0 ?1:0;
- nerrors += test_compound_opaque(file)<0 ?1:0;
- nerrors += test_enum_dtype(file)<0 ?1:0;
- nerrors += test_array_dtype(file)<0 ?1:0;
- nerrors += test_array_dtype2(file)<0 ?1:0;
- nerrors += test_vl_dtype(file)<0 ?1:0;
- nerrors += test_vlstr_dtype(file)<0 ?1:0;
+ goto error;
+
+ nerrors += test_atomic_dtype(file)<0 ?1:0;
+ nerrors += test_compound_dtype(file)<0 ?1:0;
+ nerrors += test_compound_dtype2(file)<0 ?1:0;
+ nerrors += test_compound_dtype3(file)<0 ?1:0;
+ nerrors += test_compound_opaque(file)<0 ?1:0;
+ nerrors += test_enum_dtype(file)<0 ?1:0;
+ nerrors += test_array_dtype(file)<0 ?1:0;
+ nerrors += test_array_dtype2(file)<0 ?1:0;
+ nerrors += test_vl_dtype(file)<0 ?1:0;
+ nerrors += test_vlstr_dtype(file)<0 ?1:0;
nerrors += test_str_dtype(file)<0 ?1:0;
- nerrors += test_refer_dtype(file)<0 ?1:0;
- nerrors += test_refer_dtype2(file)<0 ?1:0;
- nerrors += test_opaque_dtype(file)<0 ?1:0;
- nerrors += test_bitfield_dtype(file)<0 ?1:0;
+ nerrors += test_refer_dtype(file)<0 ?1:0;
+ nerrors += test_refer_dtype2(file)<0 ?1:0;
+ nerrors += test_opaque_dtype(file)<0 ?1:0;
+ nerrors += test_bitfield_dtype(file)<0 ?1:0;
nerrors += test_ninteger()<0 ?1:0;
if (H5Fclose(file)<0) goto error;
@@ -2595,6 +2592,6 @@ main(void)
error:
nerrors = MAX(1, nerrors);
printf("***** %d DATASET TEST%s FAILED! *****\n",
- nerrors, 1 == nerrors ? "" : "S");
+ nerrors, 1 == nerrors ? "" : "S");
return 1;
}
diff --git a/test/ohdr.c b/test/ohdr.c
index 261ae68..4813260 100644
--- a/test/ohdr.c
+++ b/test/ohdr.c
@@ -309,12 +309,12 @@ main(void)
}
PASSED();
- h5_cleanup(FILENAME, fapl);
-
puts("All object header tests passed.");
+ h5_cleanup(FILENAME, fapl);
return 0;
error:
+ puts("*** TESTS FAILED ***");
H5E_BEGIN_TRY {
H5Fclose(file);
} H5E_END_TRY;
diff --git a/test/reserved.c b/test/reserved.c
index 2a9739a..d08c02d 100755
--- a/test/reserved.c
+++ b/test/reserved.c
@@ -43,8 +43,8 @@ const char *FILENAME[] = {
static herr_t
rsrv_heap(void)
{
- hid_t file_id, dataset_id, dataspace_id;
- hid_t fapl, fcpl;
+ hid_t file_id=(-1), dataset_id=(-1), dataspace_id=(-1);
+ hid_t fapl=(-1), fcpl=(-1);
hsize_t dims[1] = {1};
char filename[1024], dset_name[10];
int i;
@@ -54,10 +54,6 @@ rsrv_heap(void)
/* Create a new file. */
fapl = h5_fileaccess();
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
-/* H5Pset_userblock(fapl, (hsize_t)0);
- H5Pset_sym_k(fapl, 1, 1);
- H5Pset_istore_k(fapl, 1);
-*/
/* Set file address sizes to be very small. */
fcpl = H5Pcreate(H5P_FILE_CREATE);
if(fcpl < 0) TEST_ERROR;
@@ -160,8 +156,8 @@ rsrv_heap(void)
static herr_t
rsrv_ohdr(void)
{
- hid_t file_id, dataset_id, dataspace_id;
- hid_t fapl, fcpl, aid, attr_id;
+ hid_t file_id=(-1), dataset_id=(-1), dataspace_id=(-1);
+ hid_t fapl=(-1), fcpl=(-1), aid, attr_id;
hsize_t dims[2];
herr_t status;
int attrval[4][6];
@@ -176,9 +172,6 @@ rsrv_ohdr(void)
fcpl = H5Pcreate(H5P_FILE_CREATE);
if(fcpl < 0) TEST_ERROR;
-/* H5Pset_userblock(pfc_id, (hsize_t)0);
- H5Pset_sym_k(pfc_id, 1, 1);
- H5Pset_istore_k(pfc_id, 1); */
if( H5Pset_sizes(fcpl, (size_t)2,(size_t)2) < 0) TEST_ERROR;
file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl);
@@ -289,10 +282,10 @@ rsrv_ohdr(void)
static herr_t
rsrv_vlen(void)
{
- hid_t file_id, dataset_id, dataspace_id, type_id;
- hid_t fapl, fcpl, mem_space_id;
+ hid_t file_id=(-1), dataset_id=(-1), dataspace_id=(-1), type_id=(-1);
+ hid_t fapl=(-1), fcpl=(-1), mem_space_id=(-1);
hssize_t offset[1];
- hssize_t start[1];
+ hsize_t start[1];
hsize_t dims[1], count[1];
herr_t status;
int i;
@@ -309,11 +302,6 @@ rsrv_vlen(void)
/* Make file address space very small */
fcpl = H5Pcreate(H5P_FILE_CREATE);
if( fcpl < 0) TEST_ERROR;
-/*
- H5Pset_userblock(pfc_id, (hsize_t)0);
- H5Pset_sym_k(pfc_id, 1, 1);
- H5Pset_istore_k(pfc_id, 1);
-*/
if( H5Pset_sizes(fcpl, (size_t)2,(size_t)2) < 0) TEST_ERROR;
file_id = H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl);
diff --git a/test/stab.c b/test/stab.c
index 6ce9871..68c7630 100644
--- a/test/stab.c
+++ b/test/stab.c
@@ -86,10 +86,10 @@ test_misc(hid_t file)
g1=H5Gcreate(file, "/", 0);
} H5E_END_TRY
if(g1 >= 0) goto error;
-
+
H5E_BEGIN_TRY {
g1=H5Gcreate(file, "./././", 0);
- } H5E_END_TRY
+ } H5E_END_TRY
if(g1 >= 0) goto error;
PASSED();
diff --git a/test/stream_test.c b/test/stream_test.c
index aecf656..a69d78e 100644
--- a/test/stream_test.c
+++ b/test/stream_test.c
@@ -6,8 +6,6 @@
* Author: Thomas Radke <tradke@aei-potsdam.mpg.de>
* Tuesday, September 12, 2000
*
- * Version: $Id$
- *
* Modifications:
* Thomas Radke, Thursday, October 26, 2000
* Made it compiling under Windows.
diff --git a/test/tarray.c b/test/tarray.c
index aa6e767..871ff9c 100644
--- a/test/tarray.c
+++ b/test/tarray.c
@@ -12,8 +12,6 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* $Id$ */
-
/***********************************************************
*
* Test program: tarray
@@ -596,9 +594,8 @@ test_array_compound_atomic(void)
/* Check the 1st field's name */
mname=H5Tget_member_name(tid2,0);
CHECK(mname, NULL, "H5Tget_member_name");
- if(HDstrcmp(mname,"i")!=0) {
+ if(HDstrcmp(mname,"i")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
- } /* end if */
free(mname);
/* Check the 1st field's offset */
@@ -608,18 +605,16 @@ test_array_compound_atomic(void)
/* Check the 1st field's datatype */
mtid=H5Tget_member_type(tid2,0);
CHECK(mtid, FAIL, "H5Tget_member_type");
- if((ret=H5Tequal(mtid,H5T_NATIVE_INT))<=0) {
+ if((ret=H5Tequal(mtid,H5T_NATIVE_INT))<=0)
TestErrPrintf("Compound data type is incorrect!, ret=%d\n",(int)ret);
- } /* end if */
ret=H5Tclose(mtid);
CHECK(mtid, FAIL, "H5Tclose");
/* Check the 2nd field's name */
mname=H5Tget_member_name(tid2,1);
CHECK(mname, NULL, "H5Tget_member_name");
- if(HDstrcmp(mname,"f")!=0) {
+ if(HDstrcmp(mname,"f")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
- } /* end if */
free(mname);
/* Check the 2nd field's offset */
@@ -629,9 +624,8 @@ test_array_compound_atomic(void)
/* Check the 2nd field's datatype */
mtid=H5Tget_member_type(tid2,1);
CHECK(mtid, FAIL, "H5Tget_member_type");
- if((ret=H5Tequal(mtid,H5T_NATIVE_FLOAT))<=0) {
+ if((ret=H5Tequal(mtid,H5T_NATIVE_FLOAT))<=0)
TestErrPrintf("Compound data type is incorrect!, ret=%d\n",(int)ret);
- } /* end if */
ret=H5Tclose(mtid);
CHECK(mtid, FAIL, "H5Tclose");
@@ -814,9 +808,8 @@ test_array_compound_array(void)
/* Check the 1st field's name */
mname=H5Tget_member_name(tid2,0);
CHECK(mname, NULL, "H5Tget_member_name");
- if(HDstrcmp(mname,"i")!=0) {
+ if(HDstrcmp(mname,"i")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
- } /* end if */
free(mname);
/* Check the 1st field's offset */
@@ -826,18 +819,16 @@ test_array_compound_array(void)
/* Check the 1st field's datatype */
mtid=H5Tget_member_type(tid2,0);
CHECK(mtid, FAIL, "H5Tget_member_type");
- if((ret=H5Tequal(mtid,H5T_NATIVE_INT))<=0) {
+ if((ret=H5Tequal(mtid,H5T_NATIVE_INT))<=0)
TestErrPrintf("Compound data type is incorrect!, ret=%d\n",(int)ret);
- } /* end if */
ret=H5Tclose(mtid);
CHECK(mtid, FAIL, "H5Tclose");
/* Check the 2nd field's name */
mname=H5Tget_member_name(tid2,1);
CHECK(mname, NULL, "H5Tget_member_name");
- if(HDstrcmp(mname,"f")!=0) {
+ if(HDstrcmp(mname,"f")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
- } /* end if */
free(mname);
/* Check the 2nd field's offset */
@@ -871,9 +862,8 @@ test_array_compound_array(void)
tid3=H5Tget_super(mtid);
CHECK(tid3, FAIL, "H5Tget_super");
- if((ret=H5Tequal(tid3,H5T_NATIVE_FLOAT))<=0) {
+ if((ret=H5Tequal(tid3,H5T_NATIVE_FLOAT))<=0)
TestErrPrintf("Compound data type is incorrect!, ret=%d\n",(int)ret);
- } /* end if */
/* Close the array's base type datatype */
ret=H5Tclose(tid3);
@@ -1106,9 +1096,8 @@ test_array_vlen_atomic(void)
tid3=H5Tget_super(tid2);
CHECK(tid3, FAIL, "H5Tget_super");
- if((ret=H5Tequal(tid3,H5T_NATIVE_UINT))<=0) {
+ if((ret=H5Tequal(tid3,H5T_NATIVE_UINT))<=0)
TestErrPrintf("VL base datatype is incorrect!, ret=%d\n",(int)ret);
- } /* end if */
/* Close the array's base type datatype */
ret=H5Tclose(tid3);
@@ -1351,9 +1340,8 @@ test_array_vlen_array(void)
CHECK(tid4, FAIL, "H5Tget_super");
- if((ret=H5Tequal(tid4,H5T_NATIVE_UINT))<=0) {
+ if((ret=H5Tequal(tid4,H5T_NATIVE_UINT))<=0)
TestErrPrintf("VL base datatype is incorrect!, ret=%d\n",(int)ret);
- } /* end if */
/* Close the array's base type datatype */
ret=H5Tclose(tid4);
@@ -1586,7 +1574,7 @@ test_array_bkg(void)
/* Verify correct data */
/* ------------------- */
for (i = 0; i < LENGTH; i++) {
- for (j = 0; j < ALEN; j++) {
+ for (j = 0; j < ALEN; j++) {
if(cf[i].a[j]!=cfr[i].a[j]) {
TestErrPrintf("Field a data doesn't match, cf[%d].a[%d]=%d, cfr[%d].a[%d]=%d\n",(int)i,(int)j,(int)cf[i].a[j],(int)i,(int)j,(int)cfr[i].a[j]);
continue;
@@ -1606,7 +1594,7 @@ test_array_bkg(void)
/* Release memory resources */
/* ------------------------ */
for (i = 0; i < dtsinfo.nsubfields; i++)
- free(dtsinfo.name[i]);
+ free(dtsinfo.name[i]);
/* Release IDs */
@@ -1679,7 +1667,7 @@ test_array_bkg(void)
/* Verify correct data */
/* ------------------- */
for (i = 0; i < LENGTH; i++) {
- for (j = 0; j < ALEN; j++) {
+ for (j = 0; j < ALEN; j++) {
if(cf[i].a[j]!=cfr[i].a[j]) {
TestErrPrintf("Field a data doesn't match, cf[%d].a[%d]=%d, cfr[%d].a[%d]=%d\n",(int)i,(int)j,(int)cf[i].a[j],(int)i,(int)j,(int)cfr[i].a[j]);
continue;
@@ -1728,7 +1716,7 @@ test_array_bkg(void)
/* Verify correct data */
/* ------------------- */
for (i = 0; i < LENGTH; i++) {
- for (j = 0; j < ALEN; j++) {
+ for (j = 0; j < ALEN; j++) {
if(cf[i].a[j]!=cfr[i].a[j]) {
TestErrPrintf("Field a data doesn't match, cf[%d].a[%d]=%d, cfr[%d].a[%d]=%d\n",(int)i,(int)j,(int)cf[i].a[j],(int)i,(int)j,(int)cfr[i].a[j]);
continue;
@@ -1837,9 +1825,8 @@ test_compat(void)
/* Check the 1st field's name */
mname=H5Tget_member_name(tid1,0);
CHECK(mname, NULL, "H5Tget_member_name");
- if(HDstrcmp(mname,"i")!=0) {
+ if(HDstrcmp(mname,"i")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
- } /* end if */
free(mname);
/* Check the 1st field's offset */
@@ -1849,18 +1836,16 @@ test_compat(void)
/* Check the 1st field's datatype */
mtid=H5Tget_member_type(tid1,0);
CHECK(mtid, FAIL, "H5Tget_member_type");
- if((ret=H5Tequal(mtid,H5T_STD_I16LE))<=0) {
+ if((ret=H5Tequal(mtid,H5T_STD_I16LE))<=0)
TestErrPrintf("Compound data type is incorrect!, ret=%d\n",(int)ret);
- } /* end if */
ret=H5Tclose(mtid);
CHECK(mtid, FAIL, "H5Tclose");
/* Check the 2nd field's name */
mname=H5Tget_member_name(tid1,1);
CHECK(mname, NULL, "H5Tget_member_name");
- if(HDstrcmp(mname,"f")!=0) {
+ if(HDstrcmp(mname,"f")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
- } /* end if */
free(mname);
/* Check the 2nd field's offset */
@@ -1870,18 +1855,16 @@ test_compat(void)
/* Check the 2nd field's datatype */
mtid=H5Tget_member_type(tid1,1);
CHECK(mtid, FAIL, "H5Tget_member_type");
- if((ret=H5Tequal(mtid,H5T_IEEE_F32LE))<=0) {
+ if((ret=H5Tequal(mtid,H5T_IEEE_F32LE))<=0)
TestErrPrintf("Compound data type is incorrect!, ret=%d\n",(int)ret);
- } /* end if */
ret=H5Tclose(mtid);
CHECK(mtid, FAIL, "H5Tclose");
/* Check the 3rd field's name */
mname=H5Tget_member_name(tid1,2);
CHECK(mname, NULL, "H5Tget_member_name");
- if(HDstrcmp(mname,"l")!=0) {
+ if(HDstrcmp(mname,"l")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
- } /* end if */
free(mname);
/* Check the 3rd field's offset */
@@ -1891,9 +1874,8 @@ test_compat(void)
/* Check the 3rd field's datatype */
mtid=H5Tget_member_type(tid1,2);
CHECK(mtid, FAIL, "H5Tget_member_type");
- if((ret=H5Tequal(mtid,H5T_STD_I32LE))<=0) {
+ if((ret=H5Tequal(mtid,H5T_STD_I32LE))<=0)
TestErrPrintf("Compound data type is incorrect!, ret=%d\n",(int)ret);
- } /* end if */
ret=H5Tclose(mtid);
CHECK(mtid, FAIL, "H5Tclose");
@@ -1925,9 +1907,8 @@ test_compat(void)
/* Check the 1st field's name */
mname=H5Tget_member_name(tid1,0);
CHECK(mname, NULL, "H5Tget_member_name");
- if(HDstrcmp(mname,"i")!=0) {
+ if(HDstrcmp(mname,"i")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
- } /* end if */
free(mname);
/* Check the 1st field's offset */
@@ -1937,18 +1918,16 @@ test_compat(void)
/* Check the 1st field's datatype */
mtid=H5Tget_member_type(tid1,0);
CHECK(mtid, FAIL, "H5Tget_member_type");
- if((ret=H5Tequal(mtid,H5T_STD_I16LE))<=0) {
+ if((ret=H5Tequal(mtid,H5T_STD_I16LE))<=0)
TestErrPrintf("Compound data type is incorrect!, ret=%d\n",(int)ret);
- } /* end if */
ret=H5Tclose(mtid);
CHECK(mtid, FAIL, "H5Tclose");
/* Check the 2nd field's name */
mname=H5Tget_member_name(tid1,1);
CHECK(mname, NULL, "H5Tget_member_name");
- if(HDstrcmp(mname,"f")!=0) {
+ if(HDstrcmp(mname,"f")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
- } /* end if */
free(mname);
/* Check the 2nd field's offset */
@@ -1980,11 +1959,10 @@ test_compat(void)
/* Check the array's base datatype */
tid2=H5Tget_super(mtid);
- CHECK(tid2, FAIL, "H5Tget_member_type");
+ CHECK(tid2, FAIL, "H5Tget_super");
- if((ret=H5Tequal(tid2,H5T_IEEE_F32LE))<=0) {
+ if((ret=H5Tequal(tid2,H5T_IEEE_F32LE))<=0)
TestErrPrintf("Compound data type is incorrect!, ret=%d\n",(int)ret);
- } /* end if */
ret=H5Tclose(tid2);
CHECK(ret, FAIL, "H5Tclose");
ret=H5Tclose(mtid);
@@ -1993,9 +1971,8 @@ test_compat(void)
/* Check the 3rd field's name */
mname=H5Tget_member_name(tid1,2);
CHECK(mname, NULL, "H5Tget_member_name");
- if(HDstrcmp(mname,"l")!=0) {
+ if(HDstrcmp(mname,"l")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
- } /* end if */
free(mname);
/* Check the 3rd field's offset */
@@ -2027,11 +2004,10 @@ test_compat(void)
/* Check the array's base datatype */
tid2=H5Tget_super(mtid);
- CHECK(tid2, FAIL, "H5Tget_member_type");
+ CHECK(tid2, FAIL, "H5Tget_super");
- if((ret=H5Tequal(tid2,H5T_STD_I32LE))<=0) {
+ if((ret=H5Tequal(tid2,H5T_STD_I32LE))<=0)
TestErrPrintf("Compound data type is incorrect!, ret=%d\n",(int)ret);
- } /* end if */
ret=H5Tclose(tid2);
CHECK(ret, FAIL, "H5Tclose");
ret=H5Tclose(mtid);
@@ -2040,9 +2016,8 @@ test_compat(void)
/* Check the 4th field's name */
mname=H5Tget_member_name(tid1,3);
CHECK(mname, NULL, "H5Tget_member_name");
- if(HDstrcmp(mname,"d")!=0) {
+ if(HDstrcmp(mname,"d")!=0)
TestErrPrintf("Compound field name doesn't match!, mname=%s\n",mname);
- } /* end if */
free(mname);
/* Check the 4th field's offset */
@@ -2052,9 +2027,8 @@ test_compat(void)
/* Check the 4th field's datatype */
mtid=H5Tget_member_type(tid1,3);
CHECK(mtid, FAIL, "H5Tget_member_type");
- if((ret=H5Tequal(mtid,H5T_IEEE_F64LE))<=0) {
+ if((ret=H5Tequal(mtid,H5T_IEEE_F64LE))<=0)
TestErrPrintf("Compound data type is incorrect!, ret=%d\n",(int)ret);
- } /* end if */
ret=H5Tclose(mtid);
CHECK(mtid, FAIL, "H5Tclose");
diff --git a/test/tattr.c b/test/tattr.c
index c303171..6727442 100644
--- a/test/tattr.c
+++ b/test/tattr.c
@@ -615,7 +615,7 @@ test_attr_compound_read(void)
fields=H5Tget_nmembers(type);
VERIFY(fields, 3, "H5Tget_nmembers");
for(i=0; i<fields; i++) {
- fieldname=H5Tget_member_name(type,i);
+ fieldname=H5Tget_member_name(type,(unsigned)i);
if(!(HDstrcmp(fieldname,ATTR4_FIELDNAME1) ||
HDstrcmp(fieldname,ATTR4_FIELDNAME2) ||
HDstrcmp(fieldname,ATTR4_FIELDNAME3)))
diff --git a/test/testhdf5.h b/test/testhdf5.h
index fd3976f..e148362 100644
--- a/test/testhdf5.h
+++ b/test/testhdf5.h
@@ -32,36 +32,36 @@
/* Use %ld to print the value because long should cover most cases. */
/* Used to make certain a return value _is_not_ a value */
#define CHECK(ret, val, where) do { \
- if (GetTestVerbosity()>=VERBO_HI) print_func(" Call to routine: %15s at line %4d " \
+ if (GetTestVerbosity()>=VERBO_HI) print_func(" Call to routine: %15s at line %4d " \
"in %s returned %ld \n", \
where, (int)__LINE__, __FILE__, \
(long)(ret)); \
- if ((ret) == (val)) { \
- TestErrPrintf("*** UNEXPECTED RETURN from %s is %ld at line %4d " \
- "in %s\n", where, (long)(ret), (int)__LINE__, __FILE__); \
+ if ((ret) == (val)) { \
+ TestErrPrintf("*** UNEXPECTED RETURN from %s is %ld at line %4d " \
+ "in %s\n", where, (long)(ret), (int)__LINE__, __FILE__); \
H5Eprint (stdout); \
} \
} while(0)
#define CHECK_I(ret,where) { \
- if (GetTestVerbosity()>=VERBO_HI) { \
+ if (GetTestVerbosity()>=VERBO_HI) { \
print_func(" Call to routine: %15s at line %4d in %s returned %ld\n", \
(where), (int)__LINE__, __FILE__, (long)(ret)); \
} \
if ((ret)<0) { \
- TestErrPrintf ("*** UNEXPECTED RETURN from %s is %ld line %4d in %s\n", \
+ TestErrPrintf ("*** UNEXPECTED RETURN from %s is %ld line %4d in %s\n", \
(where), (long)(ret), (int)__LINE__, __FILE__); \
H5Eprint (stdout); \
} \
}
#define CHECK_PTR(ret,where) { \
- if (GetTestVerbosity()>=VERBO_HI) { \
+ if (GetTestVerbosity()>=VERBO_HI) { \
print_func(" Call to routine: %15s at line %4d in %s returned %p\n", \
(where), (int)__LINE__, __FILE__, (ret)); \
} \
if (!(ret)) { \
- TestErrPrintf ("*** UNEXPECTED RETURN from %s is NULL line %4d in %s\n", \
+ TestErrPrintf ("*** UNEXPECTED RETURN from %s is NULL line %4d in %s\n", \
(where), (int)__LINE__, __FILE__); \
H5Eprint (stdout); \
} \
@@ -69,27 +69,28 @@
/* Used to make certain a return value _is_ a value */
#define VERIFY(x, val, where) do { \
- if (GetTestVerbosity()>=VERBO_HI) { \
+ if (GetTestVerbosity()>=VERBO_HI) { \
print_func(" Call to routine: %15s at line %4d in %s had value " \
- "%ld \n", (where), (int)__LINE__, __FILE__, (long)(x)); \
+ "%ld \n", (where), (int)__LINE__, __FILE__, (long)(x)); \
} \
if ((x) != (val)) { \
- TestErrPrintf("*** UNEXPECTED VALUE from %s should be %ld, but is %ld at line %4d " \
- "in %s\n", (where), (long)(val), (long)(x), (int)__LINE__, __FILE__); \
+ TestErrPrintf("*** UNEXPECTED VALUE from %s should be %ld, but is %ld at line %4d " \
+ "in %s\n", (where), (long)(val), (long)(x), (int)__LINE__, __FILE__); \
H5Eprint (stdout); \
} \
} while(0)
/* Used to document process through a test and to check for errors */
#define RESULT(ret,func) do { \
- if (GetTestVerbosity()>VERBO_MED) { \
+ if (GetTestVerbosity()>VERBO_MED) { \
print_func(" Call to routine: %15s at line %4d in %s returned " \
- "%ld\n", func, (int)__LINE__, __FILE__, (long)(ret)); \
+ "%ld\n", func, (int)__LINE__, __FILE__, (long)(ret)); \
} \
- if (GetTestVerbosity()>=VERBO_HI) H5Eprint(stdout); \
- if ((ret) == FAIL) { \
- TestErrPrintf("*** UNEXPECTED RETURN from %s is %ld at line %4d " \
- "in %s\n", func, (long)(ret), (int)__LINE__, __FILE__); \
+ if (GetTestVerbosity()>=VERBO_HI) \
+ H5Eprint(stdout); \
+ if ((ret) == FAIL) { \
+ TestErrPrintf("*** UNEXPECTED RETURN from %s is %ld at line %4d " \
+ "in %s\n", func, (long)(ret), (int)__LINE__, __FILE__); \
H5Eprint (stdout); \
} \
} while(0)
diff --git a/test/tfile.c b/test/tfile.c
index d2ff1c3..ed691dc 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -12,8 +12,6 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* $Id$ */
-
/***********************************************************
*
* Test program: tfile
@@ -53,6 +51,12 @@
#define F3_SYM_INTERN_K F2_SYM_INTERN_K
#define FILE3 "tfile3.h5"
+#define GRP_NAME "/group"
+#define DSET_NAME "dataset"
+#define ATTR_NAME "attr"
+#define TYPE_NAME "type"
+#define FILE4 "tfile4.h5"
+
#define OBJ_ID_COUNT_0 0
#define OBJ_ID_COUNT_1 1
#define OBJ_ID_COUNT_2 2
@@ -65,6 +69,8 @@ static void
create_objects(hid_t, hid_t, hid_t *, hid_t *, hid_t *, hid_t *);
static void
test_obj_count_and_id(hid_t, hid_t, hid_t, hid_t, hid_t, hid_t);
+static void
+check_file_id(hid_t, hid_t);
/****************************************************************
**
@@ -79,7 +85,7 @@ test_file_create(void)
hsize_t ublock; /*sizeof userblock */
size_t parm; /*file-creation parameters */
size_t parm2; /*file-creation parameters */
- int iparm;
+ unsigned iparm;
#ifdef H5_WANT_H5_V1_4_COMPAT
int iparm2;
#else /* H5_WANT_H5_V1_4_COMPAT */
@@ -318,7 +324,7 @@ test_file_open(void)
hsize_t ublock; /*sizeof user block */
size_t parm; /*file-creation parameters */
size_t parm2; /*file-creation parameters */
- int iparm;
+ unsigned iparm;
#ifdef H5_WANT_H5_V1_4_COMPAT
int iparm2;
#else /* H5_WANT_H5_V1_4_COMPAT */
@@ -817,6 +823,158 @@ create_objects(hid_t fid1, hid_t fid2, hid_t *ret_did, hid_t *ret_gid1,
/****************************************************************
**
+** test_get_file_id(): Test H5Iget_file_id()
+**
+*****************************************************************/
+static void
+test_get_file_id(void)
+{
+ hid_t fid, fid2, fid3;
+ hid_t datatype_id, dataset_id, dataspace_id, group_id, attr_id;
+ hid_t plist;
+ hsize_t dims[F2_RANK];
+ herr_t ret;
+
+ /* Create a file */
+ fid = H5Fcreate(FILE4, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ CHECK(fid, FAIL, "H5Fcreate");
+
+ /* Test H5Iget_file_id() */
+ check_file_id(fid, fid);
+
+ /* Create a group in the file. Make a duplicated file ID from the group.
+ * And close this duplicated ID
+ */
+ group_id = H5Gcreate(fid, GRP_NAME, 0);
+ CHECK(group_id, FAIL, "H5Gcreate");
+
+ /* Test H5Iget_file_id() */
+ check_file_id(fid, group_id);
+
+ /* Close the file and get file ID from the group ID */
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Test H5Iget_file_id() */
+ check_file_id(-1, group_id);
+
+ ret = H5Gclose(group_id);
+ CHECK(ret, FAIL, "H5Gclose");
+
+ /* Open the file again. Test H5Iget_file_id() */
+ fid = H5Fopen(FILE4, H5F_ACC_RDWR, H5P_DEFAULT);
+ CHECK(fid, FAIL, "H5Fcreate");
+
+ group_id = H5Gopen(fid, GRP_NAME);
+ CHECK(group_id, FAIL, "H5Gcreate");
+
+ /* Test H5Iget_file_id() */
+ check_file_id(fid, group_id);
+
+ /* Open the file for second time. Test H5Iget_file_id() */
+ fid3 = H5Freopen(fid);
+ CHECK(fid3, FAIL, "H5Freopen");
+
+ /* Test H5Iget_file_id() */
+ check_file_id(fid3, fid3);
+
+ ret = H5Fclose(fid3);
+ CHECK(ret, FAIL, "H5Fclose");
+
+ /* Create a dataset in the group. Make a duplicated file ID from the
+ * dataset. And close this duplicated ID.
+ */
+ dims[0] = F2_DIM0;
+ dims[1] = F2_DIM1;
+ dataspace_id = H5Screate_simple(F2_RANK, dims, NULL);
+ CHECK(dataspace_id, FAIL, "H5Screate_simple");
+
+ dataset_id = H5Dcreate(group_id, DSET_NAME, H5T_NATIVE_INT, dataspace_id,
+ H5P_DEFAULT);
+ CHECK(dataset_id, FAIL, "H5Dcreate");
+
+ /* Test H5Iget_file_id() */
+ check_file_id(fid, dataset_id);
+
+ /* Create an attribute for the dataset. Make a duplicated file ID from
+ * this attribute. And close it.
+ */
+ attr_id=H5Acreate(dataset_id,ATTR_NAME,H5T_NATIVE_INT,dataspace_id,H5P_DEFAULT);
+ CHECK(ret, FAIL, "H5Acreate");
+
+ /* Test H5Iget_file_id() */
+ check_file_id(fid, attr_id);
+
+ /* Create a named datatype. Make a duplicated file ID from
+ * this attribute. And close it.
+ */
+ datatype_id=H5Tcopy(H5T_NATIVE_INT);
+ CHECK(ret, FAIL, "H5Acreate");
+
+ ret = H5Tcommit(fid, TYPE_NAME, datatype_id);
+ CHECK(ret, FAIL, "H5Tcommit");
+
+ /* Test H5Iget_file_id() */
+ check_file_id(fid, datatype_id);
+
+ /* Create a property list and try to get file ID from it.
+ * Supposed to fail.
+ */
+ plist = H5Pcreate(H5P_FILE_ACCESS);
+ CHECK(plist, FAIL, "H5Pcreate");
+
+ H5E_BEGIN_TRY {
+ fid2 = H5Iget_file_id(plist);
+ } H5E_END_TRY;
+ VERIFY(fid2, FAIL, "H5Iget_file_id");
+
+ /* Close objects */
+ ret = H5Tclose(datatype_id);
+ CHECK(ret, FAIL, "H5Tclose");
+
+ ret = H5Aclose(attr_id);
+ CHECK(ret, FAIL, "H5Aclose");
+
+ ret = H5Sclose(dataspace_id);
+ CHECK(ret, FAIL, "H5Sclose");
+
+ ret = H5Dclose(dataset_id);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ ret = H5Gclose(group_id);
+ CHECK(ret, FAIL, "H5Gclose");
+
+ ret = H5Fclose(fid);
+ CHECK(ret, FAIL, "H5Fclose");
+}
+
+/****************************************************************
+**
+** check_file_id(): Internal function of test_get_file_id()
+**
+*****************************************************************/
+static void
+check_file_id(hid_t fid, hid_t object_id)
+{
+ hid_t new_fid;
+ herr_t ret;
+
+ /* Return a duplicated file ID even not expecting user to do it.
+ * And close this duplicated ID
+ */
+ new_fid = H5Iget_file_id(object_id);
+
+ if(fid >=0)
+ VERIFY(new_fid, fid, "H5Iget_file_id");
+ else
+ CHECK(new_fid, FAIL, "H5Iget_file_id");
+
+ ret = H5Fclose(new_fid);
+ CHECK(ret, FAIL, "H5Fclose");
+}
+
+/****************************************************************
+**
** test_obj_count_and_id(): test object count and ID list functions.
**
****************************************************************/
@@ -1078,6 +1236,7 @@ test_file(void)
#ifndef H5_NO_SHARED_WRITING
test_file_close(); /* Test file close behavior */
#endif /* H5_NO_SHARED_WRITING */
+ test_get_file_id(); /* Test H5Iget_file_id */
test_file_perm(); /* Test file access permissions */
test_file_freespace(); /* Test file free space information */
} /* test_file() */
@@ -1103,4 +1262,5 @@ cleanup_file(void)
remove(FILE1);
remove(FILE2);
remove(FILE3);
+ remove(FILE4);
}
diff --git a/test/tgenprop.c b/test/tgenprop.c
index 4a6e99c..bf35440 100644
--- a/test/tgenprop.c
+++ b/test/tgenprop.c
@@ -12,8 +12,6 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* $Id$ */
-
/***********************************************************
*
* Test program: tgenprop
@@ -87,9 +85,8 @@ test_genprop_basic_class(void)
/* Check class name */
name = H5Pget_class_name(cid1);
CHECK_PTR(name, "H5Pget_class_name");
- if(HDstrcmp(name,CLASS1_NAME)!=0) {
+ if(HDstrcmp(name,CLASS1_NAME)!=0)
TestErrPrintf("Class names don't match!, name=%s, CLASS1_NAME=%s\n",name,CLASS1_NAME);
- } /* end if */
free(name);
/* Check class parent */
@@ -119,9 +116,8 @@ test_genprop_basic_class(void)
/* Check class name */
name = H5Pget_class_name(cid1);
CHECK_PTR(name, "H5Pget_class_name");
- if(HDstrcmp(name,CLASS2_NAME)!=0) {
+ if(HDstrcmp(name,CLASS2_NAME)!=0)
TestErrPrintf("Class names don't match!, name=%s, CLASS2_NAME=%s\n",name,CLASS2_NAME);
- } /* end if */
free(name);
/* Check class parent */
@@ -682,9 +678,8 @@ test_genprop_basic_list_prop(void)
/* Check values of temporary properties (set with regular values) */
ret = H5Pget(lid1,PROP3_NAME,&prop3_value);
CHECK_I(ret, "H5Pget");
- if(memcmp(&prop3_value,PROP3_DEF_VALUE,PROP3_SIZE)!=0) {
+ if(HDmemcmp(&prop3_value,PROP3_DEF_VALUE,PROP3_SIZE)!=0)
TestErrPrintf("Property #3 doesn't match!, line=%d\n",__LINE__);
- } /* end if */
ret = H5Pget(lid1,PROP4_NAME,&prop4_value);
CHECK_I(ret, "H5Pget");
VERIFY(prop4_value, *PROP4_DEF_VALUE, "H5Pget");
@@ -1058,12 +1053,10 @@ test_genprop_list_callback(void)
/* Verify creation callback information for properties tracked */
VERIFY(prop1_cb_info.crt_count, 1, "H5Pcreate");
- if(HDstrcmp(prop1_cb_info.crt_name,PROP1_NAME)!=0) {
+ if(HDstrcmp(prop1_cb_info.crt_name,PROP1_NAME)!=0)
TestErrPrintf("Property #1 name doesn't match!, line=%d\n",__LINE__);
- } /* end if */
- if(HDmemcmp(prop1_cb_info.crt_value,PROP1_DEF_VALUE,PROP1_SIZE)!=0) {
+ if(HDmemcmp(prop1_cb_info.crt_value,PROP1_DEF_VALUE,PROP1_SIZE)!=0)
TestErrPrintf("Property #1 value doesn't match!, line=%d\n",__LINE__);
- } /* end if */
/* Check values of permanent properties (set with default values) */
ret = H5Pget(lid1,PROP1_NAME,&prop1_value);
@@ -1076,9 +1069,8 @@ test_genprop_list_callback(void)
/* Check values of temporary properties (set with regular values) */
ret = H5Pget(lid1,PROP3_NAME,&prop3_value);
CHECK_I(ret, "H5Pget");
- if(memcmp(&prop3_value,PROP3_DEF_VALUE,PROP3_SIZE)!=0) {
+ if(HDmemcmp(&prop3_value,PROP3_DEF_VALUE,PROP3_SIZE)!=0)
TestErrPrintf("Property #3 doesn't match!, line=%d\n",__LINE__);
- } /* end if */
ret = H5Pget(lid1,PROP4_NAME,&prop4_value);
CHECK_I(ret, "H5Pget");
VERIFY(prop4_value, *PROP4_DEF_VALUE, "H5Pget");
@@ -1086,12 +1078,10 @@ test_genprop_list_callback(void)
/* Verify get callback information for properties tracked */
VERIFY(prop1_cb_info.get_count, 1, "H5Pget");
VERIFY(prop1_cb_info.get_plist_id, lid1, "H5Pget");
- if(HDstrcmp(prop1_cb_info.get_name,PROP1_NAME)!=0) {
+ if(HDstrcmp(prop1_cb_info.get_name,PROP1_NAME)!=0)
TestErrPrintf("Property #1 name doesn't match!, line=%d\n",__LINE__);
- } /* end if */
- if(HDmemcmp(prop1_cb_info.get_value,PROP1_DEF_VALUE,PROP1_SIZE)!=0) {
+ if(HDmemcmp(prop1_cb_info.get_value,PROP1_DEF_VALUE,PROP1_SIZE)!=0)
TestErrPrintf("Property #1 value doesn't match!, line=%d\n",__LINE__);
- } /* end if */
/* Set value of property #1 to different value */
ret = H5Pset(lid1,PROP1_NAME,&prop1_new_value);
@@ -1100,12 +1090,10 @@ test_genprop_list_callback(void)
/* Verify set callback information for properties tracked */
VERIFY(prop1_cb_info.set_count, 1, "H5Pset");
VERIFY(prop1_cb_info.set_plist_id, lid1, "H5Pset");
- if(HDstrcmp(prop1_cb_info.set_name,PROP1_NAME)!=0) {
+ if(HDstrcmp(prop1_cb_info.set_name,PROP1_NAME)!=0)
TestErrPrintf("Property #1 name doesn't match!, line=%d\n",__LINE__);
- } /* end if */
- if(HDmemcmp(prop1_cb_info.set_value,&prop1_new_value,PROP1_SIZE)!=0) {
+ if(HDmemcmp(prop1_cb_info.set_value,&prop1_new_value,PROP1_SIZE)!=0)
TestErrPrintf("Property #1 value doesn't match!, line=%d\n",__LINE__);
- } /* end if */
/* Check new value of tracked properties */
ret = H5Pget(lid1,PROP1_NAME,&prop1_value);
@@ -1115,12 +1103,10 @@ test_genprop_list_callback(void)
/* Verify get callback information again for properties tracked */
VERIFY(prop1_cb_info.get_count, 2, "H5Pget");
VERIFY(prop1_cb_info.get_plist_id, lid1, "H5Pget");
- if(HDstrcmp(prop1_cb_info.get_name,PROP1_NAME)!=0) {
+ if(HDstrcmp(prop1_cb_info.get_name,PROP1_NAME)!=0)
TestErrPrintf("Property #1 name doesn't match!, line=%d\n",__LINE__);
- } /* end if */
- if(HDmemcmp(prop1_cb_info.get_value,&prop1_new_value,PROP1_SIZE)!=0) {
+ if(HDmemcmp(prop1_cb_info.get_value,&prop1_new_value,PROP1_SIZE)!=0)
TestErrPrintf("Property #1 value doesn't match!, line=%d\n",__LINE__);
- } /* end if */
/* Delete property #2 */
ret = H5Premove(lid1,PROP2_NAME);
@@ -1129,12 +1115,10 @@ test_genprop_list_callback(void)
/* Verify delete callback information for properties tracked */
VERIFY(prop2_cb_info.del_count, 1, "H5Premove");
VERIFY(prop2_cb_info.del_plist_id, lid1, "H5Premove");
- if(HDstrcmp(prop2_cb_info.del_name,PROP2_NAME)!=0) {
+ if(HDstrcmp(prop2_cb_info.del_name,PROP2_NAME)!=0)
TestErrPrintf("Property #2 name doesn't match!, line=%d\n",__LINE__);
- } /* end if */
- if(HDmemcmp(prop2_cb_info.del_value,PROP2_DEF_VALUE,PROP2_SIZE)!=0) {
+ if(HDmemcmp(prop2_cb_info.del_value,PROP2_DEF_VALUE,PROP2_SIZE)!=0)
TestErrPrintf("Property #2 value doesn't match!, line=%d\n",__LINE__);
- } /* end if */
/* Copy first list */
lid2 = H5Pcopy(lid1);
@@ -1142,12 +1126,10 @@ test_genprop_list_callback(void)
/* Verify copy callback information for properties tracked */
VERIFY(prop1_cb_info.cop_count, 1, "H5Pcopy");
- if(HDstrcmp(prop1_cb_info.cop_name,PROP1_NAME)!=0) {
+ if(HDstrcmp(prop1_cb_info.cop_name,PROP1_NAME)!=0)
TestErrPrintf("Property #1 name doesn't match!, line=%d\n",__LINE__);
- } /* end if */
- if(HDmemcmp(prop1_cb_info.cop_value,&prop1_new_value,PROP1_SIZE)!=0) {
+ if(HDmemcmp(prop1_cb_info.cop_value,&prop1_new_value,PROP1_SIZE)!=0)
TestErrPrintf("Property #1 value doesn't match!, line=%d\n",__LINE__);
- } /* end if */
/* Verify that the class creation callback occurred */
VERIFY(cop_cb_struct.count, 1, "H5Pcopy");
@@ -1159,12 +1141,10 @@ test_genprop_list_callback(void)
/* Verify close callback information for properties tracked */
VERIFY(prop1_cb_info.cls_count, 1, "H5Pclose");
- if(HDstrcmp(prop1_cb_info.cls_name,PROP1_NAME)!=0) {
+ if(HDstrcmp(prop1_cb_info.cls_name,PROP1_NAME)!=0)
TestErrPrintf("Property #1 name doesn't match!, line=%d\n",__LINE__);
- } /* end if */
- if(HDmemcmp(prop1_cb_info.cls_value,&prop1_new_value,PROP1_SIZE)!=0) {
+ if(HDmemcmp(prop1_cb_info.cls_value,&prop1_new_value,PROP1_SIZE)!=0)
TestErrPrintf("Property #1 value doesn't match!, line=%d\n",__LINE__);
- } /* end if */
/* Close second list */
ret = H5Pclose(lid2);
@@ -1432,10 +1412,9 @@ test_genprop_path(void)
/* Get full path for first class */
path=H5P_get_class_path_test(cid1);
CHECK_PTR(path, "H5P_get_class_path_test");
- if(HDstrcmp(path,CLASS1_PATH)!=0) {
+ if(HDstrcmp(path,CLASS1_PATH)!=0)
TestErrPrintf("Class names don't match!, path=%s, CLASS1_PATH=%s\n",path,CLASS1_PATH);
- } /* end if */
- free(path);
+ HDfree(path);
/* Create another new generic class, derived from first class */
cid2 = H5Pcreate_class(cid1,CLASS2_NAME,NULL,NULL,NULL,NULL,NULL,NULL);
@@ -1448,9 +1427,8 @@ test_genprop_path(void)
/* Get full path for second class */
path=H5P_get_class_path_test(cid2);
CHECK_PTR(path, "H5P_get_class_path_test");
- if(HDstrcmp(path,CLASS2_PATH)!=0) {
+ if(HDstrcmp(path,CLASS2_PATH)!=0)
TestErrPrintf("Class names don't match!, path=%s, CLASS2_PATH=%s\n",path,CLASS2_PATH);
- } /* end if */
/* Open a copy of the class with the path name */
cid3 = H5P_open_class_path_test(path);
@@ -1509,10 +1487,9 @@ test_genprop_refcount(void)
/* Check class name */
name = H5Pget_class_name(cid1);
CHECK_PTR(name, "H5Pget_class_name");
- if(HDstrcmp(name,CLASS1_NAME)!=0) {
+ if(HDstrcmp(name,CLASS1_NAME)!=0)
TestErrPrintf("Class names don't match!, name=%s, CLASS1_NAME=%s\n",name,CLASS1_NAME);
- } /* end if */
- free(name);
+ HDfree(name);
/* Close class */
ret = H5Pclose_class(cid1);
@@ -1529,10 +1506,9 @@ test_genprop_refcount(void)
/* Check class name */
name = H5Pget_class_name(cid1);
CHECK_PTR(name, "H5Pget_class_name");
- if(HDstrcmp(name,CLASS1_NAME)!=0) {
+ if(HDstrcmp(name,CLASS1_NAME)!=0)
TestErrPrintf("Class names don't match!, name=%s, CLASS1_NAME=%s\n",name,CLASS1_NAME);
- } /* end if */
- free(name);
+ HDfree(name);
/* Close list */
ret = H5Pclose(lid1);
@@ -1541,10 +1517,9 @@ test_genprop_refcount(void)
/* Check class name */
name = H5Pget_class_name(cid1);
CHECK_PTR(name, "H5Pget_class_name");
- if(HDstrcmp(name,CLASS1_NAME)!=0) {
+ if(HDstrcmp(name,CLASS1_NAME)!=0)
TestErrPrintf("Class names don't match!, name=%s, CLASS1_NAME=%s\n",name,CLASS1_NAME);
- } /* end if */
- free(name);
+ HDfree(name);
/* Close class */
ret = H5Pclose_class(cid1);
diff --git a/test/th5s.c b/test/th5s.c
index 4ba4088..ae92179 100644
--- a/test/th5s.c
+++ b/test/th5s.c
@@ -92,7 +92,7 @@ test_h5s_basic(void)
hid_t fid1; /* HDF5 File IDs */
hid_t sid1, sid2; /* Dataspace ID */
hid_t dset1; /* Dataset ID */
- hid_t aid1; /* Attribute ID */
+ hid_t aid1; /* Attribute ID */
int rank; /* Logical rank of dataspace */
hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2, SPACE2_DIM3,
@@ -152,9 +152,9 @@ test_h5s_basic(void)
rank = H5Sget_simple_extent_dims(sid1, tdims, tmax);
CHECK(rank, FAIL, "H5Sget_simple_extent_dims");
VERIFY(HDmemcmp(tdims, dims1, SPACE1_RANK * sizeof(hsize_t)), 0,
- "H5Sget_simple_extent_dims");
+ "H5Sget_simple_extent_dims");
VERIFY(HDmemcmp(tmax, dims1, SPACE1_RANK * sizeof(hsize_t)), 0,
- "H5Sget_simple_extent_dims");
+ "H5Sget_simple_extent_dims");
ret = H5Sclose(sid1);
CHECK(ret, FAIL, "H5Sclose");
@@ -654,9 +654,8 @@ test_h5s_chunk(void)
for(i=0; i<50000; i++) {
for(j=0; j<3; j++) {
- if(chunk_data_dbl[i][j]!=chunk_data_flt[i][j]) {
+ if(chunk_data_dbl[i][j]!=chunk_data_flt[i][j])
TestErrPrintf("chunk_data_dbl[%d][%d]=%f, chunk_data_flt[%d][%d]=%f\n",i,j,chunk_data_dbl[i][j],i,j,chunk_data_flt[i][j]);
- } /* end if */
} /* end for */
} /* end for */
} /* test_h5s_chunk() */
diff --git a/test/theap.c b/test/theap.c
index 87c4836..8e5105a 100644
--- a/test/theap.c
+++ b/test/theap.c
@@ -87,10 +87,12 @@ static int tst_inc_sort(const void *_i1, const void *_i2)
static void
test_heap_init(void)
{
+ time_t curr_time; /* Current time, for seeding random number generator */
size_t u; /* Local index variables */
/* Create randomized set of numbers */
- HDsrandom((unsigned long)HDtime(NULL));
+ curr_time=time(NULL);
+ HDsrandom((unsigned long)curr_time);
for(u=0; u<NUM_ELEMS; u++)
/* Generate random numbers from -1000 to 1000 */
rand_num[u].val=(int)(HDrandom()%2001)-1001;
@@ -591,14 +593,12 @@ static void test_heap_remove_many_core(H5HP_type_t heap_type, test_obj *arr, siz
/* Check that the value is correct, based on the heap type */
if(heap_type==H5HP_MAX_HEAP) {
- if(val>last_val) {
+ if(val>last_val)
TestErrPrintf("Error on line %d: incorrect value from heap=%d, last_val=%d\n",__LINE__,val,last_val);
- } /* end if */
} /* end if */
else {
- if(val<last_val) {
+ if(val<last_val)
TestErrPrintf("Error on line %d: incorrect value from heap=%d, last_val=%d\n",__LINE__,val,last_val);
- } /* end if */
} /* end else */
/* Update last value */
@@ -636,14 +636,12 @@ static void test_heap_remove_many_core(H5HP_type_t heap_type, test_obj *arr, siz
/* Check that the value is correct, based on the heap type */
if(heap_type==H5HP_MAX_HEAP) {
- if(val>last_val) {
+ if(val>last_val)
TestErrPrintf("Error on line %d: incorrect value from heap=%d, last_val=%d\n",__LINE__,val,last_val);
- } /* end if */
} /* end if */
else {
- if(val<last_val) {
+ if(val<last_val)
TestErrPrintf("Error on line %d: incorrect value from heap=%d, last_val=%d\n",__LINE__,val,last_val);
- } /* end if */
} /* end else */
/* Update last value */
diff --git a/test/titerate.c b/test/titerate.c
index 18a7246..4f9d15c 100644
--- a/test/titerate.c
+++ b/test/titerate.c
@@ -197,11 +197,17 @@ static void test_iter_group(void)
VERIFY(num_membs,NDATASETS+2,"H5Gget_num_objs");
for(i=0; i< (int)num_membs; i++) {
+#ifdef H5_WANT_H5_V1_4_COMPAT
+ int obj_type; /* Type of object in file */
+#else /*H5_WANT_H5_V1_4_COMPAT*/
+ H5G_obj_t obj_type; /* Type of object in file */
+#endif /*H5_WANT_H5_V1_4_COMPAT*/
+
ret = (herr_t)H5Gget_objname_by_idx(root_group, (hsize_t)i, dataset_name, NAMELEN);
CHECK(ret, FAIL, "H5Gget_objname_by_idx");
- ret = (herr_t)H5Gget_objtype_by_idx(root_group, (hsize_t)i);
- CHECK(ret, FAIL, "H5Gget_objtype_by_idx");
+ obj_type = H5Gget_objtype_by_idx(root_group, (hsize_t)i);
+ CHECK(obj_type, H5G_UNKNOWN, "H5Gget_objtype_by_idx");
}
H5E_BEGIN_TRY {
@@ -775,11 +781,17 @@ static void test_grp_memb_funcs(void)
VERIFY(num_membs,NDATASETS+2,"H5Gget_num_objs");
for(i=0; i< (int)num_membs; i++) {
+#ifdef H5_WANT_H5_V1_4_COMPAT
+ int obj_type; /* Type of object in file */
+#else /*H5_WANT_H5_V1_4_COMPAT*/
+ H5G_obj_t obj_type; /* Type of object in file */
+#endif /*H5_WANT_H5_V1_4_COMPAT*/
+
/* Test with NULL for name, to query length */
name_len = H5Gget_objname_by_idx(root_group, (hsize_t)i, NULL, NAMELEN);
CHECK(name_len, FAIL, "H5Gget_objname_by_idx");
- ret = (herr_t)H5Gget_objname_by_idx(root_group, (hsize_t)i, dataset_name, name_len+1);
+ ret = (herr_t)H5Gget_objname_by_idx(root_group, (hsize_t)i, dataset_name, (size_t)(name_len+1));
CHECK(ret, FAIL, "H5Gget_objname_by_idx");
/* Double-check that the length is the same */
@@ -787,17 +799,17 @@ static void test_grp_memb_funcs(void)
/* Keep a copy of the dataset names around for later */
obj_names[i]=HDstrdup(dataset_name);
- CHECK(obj_names[i], NULL, "strdup");
+ CHECK(obj_names[i], NULL, "strdup");
- ret = (herr_t)H5Gget_objtype_by_idx(root_group, (hsize_t)i);
- CHECK(ret, FAIL, "H5Gget_objtype_by_idx");
+ obj_type = H5Gget_objtype_by_idx(root_group, (hsize_t)i);
+ CHECK(obj_type, H5G_UNKNOWN, "H5Gget_objtype_by_idx");
if(!HDstrcmp(dataset_name, "grp"))
- VERIFY(ret, H5G_GROUP, "H5Gget_objname_by_idx");
+ VERIFY(obj_type, H5G_GROUP, "H5Gget_objname_by_idx");
if(!HDstrcmp(dataset_name, "dtype"))
- VERIFY(ret, H5G_TYPE, "H5Gget_objname_by_idx");
+ VERIFY(obj_type, H5G_TYPE, "H5Gget_objname_by_idx");
if(!HDstrncmp(dataset_name, "Dataset", 7))
- VERIFY(ret, H5G_DATASET, "H5Gget_objname_by_idx");
+ VERIFY(obj_type, H5G_DATASET, "H5Gget_objname_by_idx");
}
H5E_BEGIN_TRY {
@@ -841,7 +853,7 @@ static void test_links(void)
ssize_t name_len; /* Length of object's name */
herr_t ret; /* Generic return value */
hid_t gid, gid1;
- int i;
+ hsize_t i;
#ifdef H5_WANT_H5_V1_4_COMPAT
int obj_type; /* Type of object */
#else /*H5_WANT_H5_V1_4_COMPAT*/
@@ -877,10 +889,10 @@ static void test_links(void)
/* Test these two functions, H5Gget_num_objs and H5Gget_objname_by_idx */
for(i=0; i<nobjs; i++) {
/* Get object name */
- name_len = H5Gget_objname_by_idx(gid, (hsize_t)i, obj_name, NAMELEN);
+ name_len = H5Gget_objname_by_idx(gid, i, obj_name, NAMELEN);
CHECK(name_len, FAIL, "H5Gget_objname_by_idx");
- obj_type = H5Gget_objtype_by_idx(gid, (hsize_t)i);
+ obj_type = H5Gget_objtype_by_idx(gid, i);
CHECK(obj_type, H5G_UNKNOWN, "H5Gget_objtype_by_idx");
if(!HDstrcmp(obj_name, "g1.1"))
diff --git a/test/tmeta.c b/test/tmeta.c
index 07c67bc..87fd4fd 100644
--- a/test/tmeta.c
+++ b/test/tmeta.c
@@ -12,8 +12,6 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* $Id$ */
-
/***********************************************************
*
* Test program: tmeta
@@ -81,9 +79,8 @@ test_metadata(void)
unsigned u; /* local counting variable */
for (u = 0; u < sizeof(compar_buffer); u++) {
- if (compar_buffer[u] != encode_buffer[u]) {
+ if (compar_buffer[u] != encode_buffer[u])
TestErrPrintf("Error encoding meta-data at offset %u, wanted: %u, got: %u\n", (unsigned) u, (unsigned) compar_buffer[u], (unsigned) encode_buffer[u]);
- } /* end if */
} /* end for */
} /* end if */
/* Test decoding macros */
@@ -94,26 +91,22 @@ test_metadata(void)
UINT32DECODE(p, du32); /* Decode the uint32 value */
/* Check the values decoded */
- if (di16 != TEST_INT16_VALUE) {
+ if (di16 != TEST_INT16_VALUE)
TestErrPrintf("Error decoding int16 meta-data wanted: %d, got: %d "
"at %s:%d\n", (int) TEST_INT16_VALUE, (int) di16,
__FILE__, __LINE__);
- } /* end if */
- if (du16 != TEST_UINT16_VALUE) {
+ if (du16 != TEST_UINT16_VALUE)
TestErrPrintf("Error decoding uint16 meta-data wanted: %u, got: %u "
"at %s:%d\n", (unsigned) TEST_UINT16_VALUE, (unsigned) du16,
__FILE__, __LINE__);
- } /* end if */
- if (di32 != TEST_INT32_VALUE) {
+ if (di32 != TEST_INT32_VALUE)
TestErrPrintf("Error decoding int32 meta-data wanted: %ld, got: %ld "
"at %s:%d\n", (long) TEST_INT32_VALUE, (long) di32,
__FILE__, __LINE__);
- } /* end if */
- if (du32 != TEST_UINT32_VALUE) {
+ if (du32 != TEST_UINT32_VALUE)
TestErrPrintf("Error decoding uint32 meta-data wanted: %lu, got: %lu "
"at %s:%d\n", (unsigned long) TEST_UINT32_VALUE, (unsigned long) du32,
__FILE__, __LINE__);
- } /* end if */
} /* test_metadata() */
diff --git a/test/tmisc.c b/test/tmisc.c
index 943152f..a564375 100644
--- a/test/tmisc.c
+++ b/test/tmisc.c
@@ -1172,7 +1172,7 @@ test_misc8(void)
#endif /* H5_WANT_H5_V1_4_COMPAT */
size_t rdcc_nbytes; /* Raw data number of bytes */
double rdcc_w0; /* Raw data write percentage */
- hssize_t start[MISC8_RANK]; /* Hyperslab start */
+ hsize_t start[MISC8_RANK]; /* Hyperslab start */
hsize_t count[MISC8_RANK]; /* Hyperslab block count */
herr_t ret;
@@ -1439,9 +1439,8 @@ test_misc8(void)
tdata2=rdata;
for(u=0; u<MISC8_DIM0; u++)
for(v=0; v<MISC8_DIM1; v++,tdata++,tdata2++)
- if(*tdata!=*tdata2) {
+ if(*tdata!=*tdata2)
TestErrPrintf("Error on line %d: u=%u, v=%d, *tdata=%d, *tdata2=%d\n",__LINE__,(unsigned)u,(unsigned)v,(int)*tdata,(int)*tdata2);
- }
#endif /* VERIFY_DATA */
/* Check the storage size after data is written */
@@ -1750,17 +1749,17 @@ test_misc11(void)
hsize_t userblock; /* Userblock size retrieved from FCPL */
size_t off_size; /* Size of offsets in the file */
size_t len_size; /* Size of lengths in the file */
- int sym_ik; /* Symbol table B-tree initial 'K' value */
- int istore_ik; /* Indexed storage B-tree initial 'K' value */
+ unsigned sym_ik; /* Symbol table B-tree initial 'K' value */
+ unsigned istore_ik; /* Indexed storage B-tree initial 'K' value */
#ifdef H5_WANT_H5_V1_4_COMPAT
int sym_lk; /* Symbol table B-tree leaf 'K' value */
#else /* H5_WANT_H5_V1_4_COMPAT */
unsigned sym_lk; /* Symbol table B-tree leaf 'K' value */
#endif /* H5_WANT_H5_V1_4_COMPAT */
- int super; /* Superblock version # */
- int freelist; /* Free list version # */
- int stab; /* Symbol table entry version # */
- int shhdr; /* Shared object header version # */
+ unsigned super; /* Superblock version # */
+ unsigned freelist; /* Free list version # */
+ unsigned stab; /* Symbol table entry version # */
+ unsigned shhdr; /* Shared object header version # */
herr_t ret; /* Generic return value */
/* Output message about test being performed */
@@ -1920,7 +1919,7 @@ test_misc12(void)
hsize_t maxdims1[1] = {H5S_UNLIMITED};
hsize_t chkdims1[1] = {MISC12_CHUNK_SIZE};
hsize_t newsize[1] = {MISC12_SPACE1_DIM1+MISC12_APPEND_SIZE};
- hssize_t offset[1] = {MISC12_SPACE1_DIM1};
+ hsize_t offset[1] = {MISC12_SPACE1_DIM1};
hsize_t count[1] = {MISC12_APPEND_SIZE};
int i; /* counting variable */
herr_t ret; /* Generic return value */
@@ -3386,13 +3385,14 @@ test_misc20(void)
CHECK(ret, FAIL, "H5Fclose");
} /* end test_misc20() */
-
-/*
- test_misc21 and test_misc22 should be executed only when SZIP is present
- and encoder is available
- EIP 2004/8/04
-*/
-#if defined H5_HAVE_FILTER_SZIP & defined H5_SZIP_CAN_ENCODE
+
+/*
+ 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
+
/****************************************************************
**
** test_misc21(): Test that late allocation time is treated the same
@@ -3410,6 +3410,7 @@ test_misc21(void)
chunk_size[2]={MISC21_CHUNK_DIM0,MISC21_CHUNK_DIM1};
herr_t ret; /* Generic return value */
+ if (h5_szip_can_encode() != 1) return;
/* Output message about test being performed */
MESSAGE(5, ("Testing late allocation time w/chunks & filters\n"));
@@ -3488,6 +3489,7 @@ test_misc22(void)
unsigned int cd_values[32];
int correct;
+ if (h5_szip_can_encode() != 1) return;
idts[0]=H5Tcopy(H5T_NATIVE_UINT8);
idts[1]=H5Tcopy(H5T_NATIVE_UINT16);
idts[2]=H5Tcopy(H5T_NATIVE_UINT32);
@@ -3538,7 +3540,7 @@ test_misc22(void)
/* compute the correct PPB that should be set by SZIP */
if (offsets[k] == 0) {
- correct=prec[j];
+ correct=prec[j];
} else {
correct=H5Tget_size(idts[i])*8;
}
@@ -3601,7 +3603,7 @@ test_misc22(void)
HDfree(buf);
} /* end test_misc22() */
-#endif /* H5_SZIP_CAN_ENCODE & H5_HAVE_FILTER_SZIP */
+#endif /* H5_HAVE_FILTER_SZIP */
/****************************************************************
**
@@ -3634,10 +3636,11 @@ 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 & defined H5_SZIP_CAN_ENCODE
+#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_SZIP_CAN_ENCODE & H5_HAVE_FILTER_SZIP */
+#endif /* H5_HAVE_FILTER_SZIP */
+
} /* test_misc() */
@@ -3681,8 +3684,9 @@ cleanup_misc(void)
HDremove(MISC18_FILE);
HDremove(MISC19_FILE);
HDremove(MISC20_FILE);
-#if defined H5_HAVE_FILTER_SZIP & defined H5_SZIP_CAN_ENCODE
+#if defined H5_HAVE_FILTER_SZIP
HDremove(MISC21_FILE);
HDremove(MISC22_FILE);
-#endif /* H5_SZIP_CAN_ENCODE & H5_HAVE_FILTER_SZIP */
+#endif /* H5_HAVE_FILTER_SZIP */
}
+
diff --git a/test/trefer.c b/test/trefer.c
index f911a32..46c702e 100644
--- a/test/trefer.c
+++ b/test/trefer.c
@@ -12,8 +12,6 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* $Id$ */
-
/***********************************************************
*
* Test program: trefer
@@ -262,9 +260,8 @@ test_reference_obj(void)
CHECK(ret, FAIL, "H5Gget_comment");
/* Check for correct comment value */
- if(HDstrcmp(write_comment,read_comment)!=0) {
+ if(HDstrcmp(write_comment,read_comment)!=0)
TestErrPrintf("Error! Incorrect group comment, wanted: %s, got: %s\n",write_comment,read_comment);
- }
/* Close group */
ret = H5Gclose(group);
@@ -312,33 +309,28 @@ test_reference_obj(void)
static void
test_reference_region(void)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dset1, /* Dataset ID */
- dset2; /* Dereferenced dataset ID */
- hid_t sid1, /* Dataspace ID #1 */
- sid2; /* Dataspace ID #2 */
- hsize_t dims1[] = {SPACE1_DIM1},
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dset1, /* Dataset ID */
+ dset2; /* Dereferenced dataset ID */
+ hid_t sid1, /* Dataspace ID #1 */
+ sid2; /* Dataspace ID #2 */
+ hsize_t dims1[] = {SPACE1_DIM1},
dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
- hssize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
- hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */
- hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */
- hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */
- hssize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */
- hsize_t * coords; /* Coordinate buffer */
-#ifdef H5_WANT_H5_V1_4_COMPAT
- hsize_t low[SPACE2_RANK]; /* Selection bounds */
- hsize_t high[SPACE2_RANK]; /* Selection bounds */
-#else /* H5_WANT_H5_V1_4_COMPAT */
- hssize_t low[SPACE2_RANK]; /* Selection bounds */
- hssize_t high[SPACE2_RANK]; /* Selection bounds */
-#endif /* H5_WANT_H5_V1_4_COMPAT */
- hdset_reg_ref_t *wbuf, /* buffer to write to disk */
+ hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
+ hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */
+ hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */
+ hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */
+ hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */
+ hsize_t * coords; /* Coordinate buffer */
+ hsize_t low[SPACE2_RANK]; /* Selection bounds */
+ hsize_t high[SPACE2_RANK]; /* Selection bounds */
+ hdset_reg_ref_t *wbuf, /* buffer to write to disk */
*rbuf; /* buffer read from disk */
uint8_t *dwbuf, /* Buffer for writing numeric data to disk */
*drbuf; /* Buffer for reading numeric data from disk */
uint8_t *tu8; /* Temporary pointer to uint8 data */
- int i; /* counting variables */
- herr_t ret; /* Generic return value */
+ int i; /* counting variables */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Dataset Region Reference Functions\n"));
@@ -410,7 +402,7 @@ test_reference_region(void)
coord1[7][0]=9; coord1[7][1]=0;
coord1[8][0]=7; coord1[8][1]=1;
coord1[9][0]=3; coord1[9][1]=3;
- ret = H5Sselect_elements(sid2,H5S_SELECT_SET,POINT1_NPOINTS,(const hssize_t **)coord1);
+ ret = H5Sselect_elements(sid2,H5S_SELECT_SET,POINT1_NPOINTS,(const hsize_t **)coord1);
CHECK(ret, FAIL, "H5Sselect_elements");
ret = (int)H5Sget_select_npoints(sid2);
@@ -514,26 +506,26 @@ test_reference_region(void)
coords=HDmalloc(ret*SPACE2_RANK*sizeof(hsize_t)); /* allocate space for the element points */
ret = H5Sget_select_elem_pointlist(sid2,(hsize_t)0,(hsize_t)ret,coords);
CHECK(ret, FAIL, "H5Sget_select_elem_pointlist");
- VERIFY((hssize_t)coords[0], coord1[0][0], "Element Coordinates");
- VERIFY((hssize_t)coords[1], coord1[0][1], "Element Coordinates");
- VERIFY((hssize_t)coords[2], coord1[1][0], "Element Coordinates");
- VERIFY((hssize_t)coords[3], coord1[1][1], "Element Coordinates");
- VERIFY((hssize_t)coords[4], coord1[2][0], "Element Coordinates");
- VERIFY((hssize_t)coords[5], coord1[2][1], "Element Coordinates");
- VERIFY((hssize_t)coords[6], coord1[3][0], "Element Coordinates");
- VERIFY((hssize_t)coords[7], coord1[3][1], "Element Coordinates");
- VERIFY((hssize_t)coords[8], coord1[4][0], "Element Coordinates");
- VERIFY((hssize_t)coords[9], coord1[4][1], "Element Coordinates");
- VERIFY((hssize_t)coords[10], coord1[5][0], "Element Coordinates");
- VERIFY((hssize_t)coords[11], coord1[5][1], "Element Coordinates");
- VERIFY((hssize_t)coords[12], coord1[6][0], "Element Coordinates");
- VERIFY((hssize_t)coords[13], coord1[6][1], "Element Coordinates");
- VERIFY((hssize_t)coords[14], coord1[7][0], "Element Coordinates");
- VERIFY((hssize_t)coords[15], coord1[7][1], "Element Coordinates");
- VERIFY((hssize_t)coords[16], coord1[8][0], "Element Coordinates");
- VERIFY((hssize_t)coords[17], coord1[8][1], "Element Coordinates");
- VERIFY((hssize_t)coords[18], coord1[9][0], "Element Coordinates");
- VERIFY((hssize_t)coords[19], coord1[9][1], "Element Coordinates");
+ VERIFY(coords[0], coord1[0][0], "Element Coordinates");
+ VERIFY(coords[1], coord1[0][1], "Element Coordinates");
+ VERIFY(coords[2], coord1[1][0], "Element Coordinates");
+ VERIFY(coords[3], coord1[1][1], "Element Coordinates");
+ VERIFY(coords[4], coord1[2][0], "Element Coordinates");
+ VERIFY(coords[5], coord1[2][1], "Element Coordinates");
+ VERIFY(coords[6], coord1[3][0], "Element Coordinates");
+ VERIFY(coords[7], coord1[3][1], "Element Coordinates");
+ VERIFY(coords[8], coord1[4][0], "Element Coordinates");
+ VERIFY(coords[9], coord1[4][1], "Element Coordinates");
+ VERIFY(coords[10], coord1[5][0], "Element Coordinates");
+ VERIFY(coords[11], coord1[5][1], "Element Coordinates");
+ VERIFY(coords[12], coord1[6][0], "Element Coordinates");
+ VERIFY(coords[13], coord1[6][1], "Element Coordinates");
+ VERIFY(coords[14], coord1[7][0], "Element Coordinates");
+ VERIFY(coords[15], coord1[7][1], "Element Coordinates");
+ VERIFY(coords[16], coord1[8][0], "Element Coordinates");
+ VERIFY(coords[17], coord1[8][1], "Element Coordinates");
+ VERIFY(coords[18], coord1[9][0], "Element Coordinates");
+ VERIFY(coords[19], coord1[9][1], "Element Coordinates");
HDfree(coords);
ret = H5Sget_select_bounds(sid2,low,high);
CHECK(ret, FAIL, "H5Sget_select_bounds");
@@ -585,14 +577,14 @@ test_reference_region_1D(void)
sid3; /* Dataspace ID #3 */
hsize_t dims1[] = {SPACE1_DIM1},
dims3[] = {SPACE3_DIM1};
- hssize_t start[SPACE3_RANK]; /* Starting location of hyperslab */
+ hsize_t start[SPACE3_RANK]; /* Starting location of hyperslab */
hsize_t stride[SPACE3_RANK]; /* Stride of hyperslab */
hsize_t count[SPACE3_RANK]; /* Element count of hyperslab */
hsize_t block[SPACE3_RANK]; /* Block size of hyperslab */
- hssize_t coord1[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */
+ hsize_t coord1[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */
hsize_t * coords; /* Coordinate buffer */
- hssize_t low[SPACE3_RANK]; /* Selection bounds */
- hssize_t high[SPACE3_RANK]; /* Selection bounds */
+ hsize_t low[SPACE3_RANK]; /* Selection bounds */
+ hsize_t high[SPACE3_RANK]; /* Selection bounds */
hdset_reg_ref_t *wbuf, /* buffer to write to disk */
*rbuf; /* buffer read from disk */
uint8_t *dwbuf, /* Buffer for writing numeric data to disk */
@@ -671,7 +663,7 @@ test_reference_region_1D(void)
coord1[7][0]=89;
coord1[8][0]=97;
coord1[9][0]=03;
- ret = H5Sselect_elements(sid3,H5S_SELECT_SET,POINT1_NPOINTS,(const hssize_t **)coord1);
+ ret = H5Sselect_elements(sid3,H5S_SELECT_SET,POINT1_NPOINTS,(const hsize_t **)coord1);
CHECK(ret, FAIL, "H5Sselect_elements");
ret = (int)H5Sget_select_npoints(sid3);
@@ -799,16 +791,16 @@ test_reference_region_1D(void)
coords=HDmalloc(ret*SPACE3_RANK*sizeof(hsize_t)); /* allocate space for the element points */
ret = H5Sget_select_elem_pointlist(sid3,(hsize_t)0,(hsize_t)ret,coords);
CHECK(ret, FAIL, "H5Sget_select_elem_pointlist");
- VERIFY((hssize_t)coords[0], coord1[0][0], "Element Coordinates");
- VERIFY((hssize_t)coords[1], coord1[1][0], "Element Coordinates");
- VERIFY((hssize_t)coords[2], coord1[2][0], "Element Coordinates");
- VERIFY((hssize_t)coords[3], coord1[3][0], "Element Coordinates");
- VERIFY((hssize_t)coords[4], coord1[4][0], "Element Coordinates");
- VERIFY((hssize_t)coords[5], coord1[5][0], "Element Coordinates");
- VERIFY((hssize_t)coords[6], coord1[6][0], "Element Coordinates");
- VERIFY((hssize_t)coords[7], coord1[7][0], "Element Coordinates");
- VERIFY((hssize_t)coords[8], coord1[8][0], "Element Coordinates");
- VERIFY((hssize_t)coords[9], coord1[9][0], "Element Coordinates");
+ VERIFY(coords[0], coord1[0][0], "Element Coordinates");
+ VERIFY(coords[1], coord1[1][0], "Element Coordinates");
+ VERIFY(coords[2], coord1[2][0], "Element Coordinates");
+ VERIFY(coords[3], coord1[3][0], "Element Coordinates");
+ VERIFY(coords[4], coord1[4][0], "Element Coordinates");
+ VERIFY(coords[5], coord1[5][0], "Element Coordinates");
+ VERIFY(coords[6], coord1[6][0], "Element Coordinates");
+ VERIFY(coords[7], coord1[7][0], "Element Coordinates");
+ VERIFY(coords[8], coord1[8][0], "Element Coordinates");
+ VERIFY(coords[9], coord1[9][0], "Element Coordinates");
HDfree(coords);
ret = H5Sget_select_bounds(sid3,low,high);
CHECK(ret, FAIL, "H5Sget_select_bounds");
diff --git a/test/trefstr.c b/test/trefstr.c
index 2ca8839..a278ebc 100644
--- a/test/trefstr.c
+++ b/test/trefstr.c
@@ -207,9 +207,8 @@ test_refstr_cmp(void)
cmp=H5RS_cmp(rs2,rs2);
VERIFY(cmp, 0, "H5RS_cmp");
cmp=H5RS_cmp(rs1,rs2);
- if(cmp>=0) {
+ if(cmp>=0)
TestErrPrintf("%d: string comparison incorrect!\n",__LINE__);
- } /* end if */
/* Check the lengths of the strings also */
len=H5RS_len(rs1);
@@ -269,9 +268,8 @@ test_refstr_wrap(void)
CHECK(s, NULL, "H5RS_get_str");
CHECK(s, buf, "wrapping");
cmp=HDstrcmp(s,buf);
- if(cmp<=0) {
+ if(cmp<=0)
TestErrPrintf("%d: string comparison incorrect!\n",__LINE__);
- } /* end if */
/* Decrement reference count for string */
ret=H5RS_decr(rs);
diff --git a/test/tselect.c b/test/tselect.c
index cdec45e..7586d90 100644
--- a/test/tselect.c
+++ b/test/tselect.c
@@ -127,15 +127,21 @@
#define SPACE10_DIM1 180
#define SPACE10_CHUNK_SIZE 12
+/* Information for bounds checking test */
+#define SPACE11_RANK 2
+#define SPACE11_DIM1 100
+#define SPACE11_DIM2 100
+#define SPACE11_NPOINTS 4
+
/* Location comparison function */
int compare_size_t(const void *s1, const void *s2);
-herr_t test_select_hyper_iter1(void *elem,hid_t type_id, hsize_t ndim, hssize_t *point, void *operator_data);
-herr_t test_select_point_iter1(void *elem,hid_t type_id, hsize_t ndim, hssize_t *point, void *operator_data);
-herr_t test_select_all_iter1(void *elem,hid_t type_id, hsize_t ndim, hssize_t *point, void *operator_data);
-herr_t test_select_none_iter1(void *elem,hid_t type_id, hsize_t ndim, hssize_t *point, void *operator_data);
-herr_t test_select_hyper_iter2(void *_elem, hid_t type_id, hsize_t ndim, hssize_t *point, void *_operator_data);
-herr_t test_select_hyper_iter3(void *elem,hid_t type_id, hsize_t ndim, hssize_t *point, void *operator_data);
+herr_t test_select_hyper_iter1(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data);
+herr_t test_select_point_iter1(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data);
+herr_t test_select_all_iter1(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data);
+herr_t test_select_none_iter1(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data);
+herr_t test_select_hyper_iter2(void *_elem, hid_t type_id, unsigned ndim, const hsize_t *point, void *_operator_data);
+herr_t test_select_hyper_iter3(void *elem,hid_t type_id, unsigned ndim, const hsize_t *point, void *operator_data);
/****************************************************************
**
@@ -143,7 +149,7 @@ herr_t test_select_hyper_iter3(void *elem,hid_t type_id, hsize_t ndim, hssize_t
**
****************************************************************/
herr_t
-test_select_hyper_iter1(void *_elem,hid_t UNUSED type_id, hsize_t UNUSED ndim, hssize_t UNUSED *point, void *_operator_data)
+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 */
**tbuf2=(uint8_t **)_operator_data; /* temporary buffer handle */
@@ -165,16 +171,16 @@ test_select_hyper_iter1(void *_elem,hid_t UNUSED type_id, hsize_t UNUSED ndim, h
static void
test_select_hyper(hid_t xfer_plist)
{
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1,sid2; /* Dataspace ID */
- hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
- hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
- hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
- hssize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
- hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */
- hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */
- hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1,sid2; /* Dataspace ID */
+ hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
+ hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
+ hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
+ hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
+ hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */
+ hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */
+ hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */
uint8_t *wbuf, /* buffer to write to disk */
*rbuf, /* buffer read from disk */
*tbuf; /* temporary buffer pointer */
@@ -312,7 +318,7 @@ test_select_hyper(hid_t xfer_plist)
} /* test_select_hyper() */
struct pnt_iter {
- hssize_t coord[POINT1_NPOINTS*2][SPACE2_RANK]; /* Coordinates for point selection */
+ hsize_t coord[POINT1_NPOINTS*2][SPACE2_RANK]; /* Coordinates for point selection */
uint8_t *buf; /* Buffer the points are in */
int offset; /* Which point we are looking at */
};
@@ -324,7 +330,7 @@ struct pnt_iter {
**
****************************************************************/
herr_t
-test_select_point_iter1(void *_elem,hid_t UNUSED type_id, hsize_t UNUSED ndim, hssize_t UNUSED *point, void *_operator_data)
+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 */
@@ -337,7 +343,7 @@ test_select_point_iter1(void *_elem,hid_t UNUSED type_id, hsize_t UNUSED ndim, h
pnt_info->offset++;
return(0);
}
-} /* end test_select_hyper_iter1() */
+} /* end test_select_point_iter1() */
/****************************************************************
**
@@ -355,12 +361,12 @@ test_select_point(hid_t xfer_plist)
hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
- hssize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */
- hssize_t temp_coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */
- hssize_t coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */
- hssize_t temp_coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */
- hssize_t coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */
- hssize_t temp_coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */
+ hsize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */
+ hsize_t temp_coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */
+ hsize_t coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */
+ hsize_t temp_coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */
+ hsize_t coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */
+ hsize_t temp_coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */
uint8_t *wbuf, /* buffer to write to disk */
*rbuf, /* buffer read from disk */
*tbuf; /* temporary buffer pointer */
@@ -403,7 +409,7 @@ test_select_point(hid_t xfer_plist)
coord1[7][0]=1; coord1[7][1]= 0; coord1[7][2]= 4;
coord1[8][0]=2; coord1[8][1]= 1; coord1[8][2]= 6;
coord1[9][0]=0; coord1[9][1]= 3; coord1[9][2]= 8;
- ret = H5Sselect_elements(sid1,H5S_SELECT_SET,POINT1_NPOINTS,(const hssize_t **)coord1);
+ ret = H5Sselect_elements(sid1,H5S_SELECT_SET,POINT1_NPOINTS,(const hsize_t **)coord1);
CHECK(ret, FAIL, "H5Sselect_elements");
/* Verify correct elements selected */
@@ -428,7 +434,7 @@ test_select_point(hid_t xfer_plist)
coord1[7][0]=1; coord1[7][1]=14; coord1[7][2]= 6;
coord1[8][0]=2; coord1[8][1]= 2; coord1[8][2]= 5;
coord1[9][0]=0; coord1[9][1]= 6; coord1[9][2]=13;
- ret = H5Sselect_elements(sid1,H5S_SELECT_APPEND,POINT1_NPOINTS,(const hssize_t **)coord1);
+ ret = H5Sselect_elements(sid1,H5S_SELECT_APPEND,POINT1_NPOINTS,(const hsize_t **)coord1);
CHECK(ret, FAIL, "H5Sselect_elements");
/* Verify correct elements selected */
@@ -453,7 +459,7 @@ test_select_point(hid_t xfer_plist)
coord2[7][0]=29; coord2[7][1]= 4;
coord2[8][0]= 8; coord2[8][1]= 8;
coord2[9][0]=19; coord2[9][1]=17;
- ret = H5Sselect_elements(sid2,H5S_SELECT_SET,POINT1_NPOINTS,(const hssize_t **)coord2);
+ ret = H5Sselect_elements(sid2,H5S_SELECT_SET,POINT1_NPOINTS,(const hsize_t **)coord2);
CHECK(ret, FAIL, "H5Sselect_elements");
/* Verify correct elements selected */
@@ -482,7 +488,7 @@ test_select_point(hid_t xfer_plist)
coord2[7][0]=12; coord2[7][1]= 2;
coord2[8][0]=21; coord2[8][1]=12;
coord2[9][0]= 9; coord2[9][1]=18;
- ret = H5Sselect_elements(sid2,H5S_SELECT_PREPEND,POINT1_NPOINTS,(const hssize_t **)coord2);
+ ret = H5Sselect_elements(sid2,H5S_SELECT_PREPEND,POINT1_NPOINTS,(const hsize_t **)coord2);
CHECK(ret, FAIL, "H5Sselect_elements");
/* Verify correct elements selected */
@@ -524,7 +530,7 @@ test_select_point(hid_t xfer_plist)
coord3[7][0]= 1; coord3[7][1]=22;
coord3[8][0]=12; coord3[8][1]=21;
coord3[9][0]=11; coord3[9][1]= 6;
- ret = H5Sselect_elements(sid2,H5S_SELECT_SET,POINT1_NPOINTS,(const hssize_t **)coord3);
+ ret = H5Sselect_elements(sid2,H5S_SELECT_SET,POINT1_NPOINTS,(const hsize_t **)coord3);
CHECK(ret, FAIL, "H5Sselect_elements");
/* Verify correct elements selected */
@@ -548,7 +554,7 @@ test_select_point(hid_t xfer_plist)
coord3[7][0]= 9; coord3[7][1]=16;
coord3[8][0]=12; coord3[8][1]=22;
coord3[9][0]=13; coord3[9][1]= 9;
- ret = H5Sselect_elements(sid2,H5S_SELECT_APPEND,POINT1_NPOINTS,(const hssize_t **)coord3);
+ ret = H5Sselect_elements(sid2,H5S_SELECT_APPEND,POINT1_NPOINTS,(const hsize_t **)coord3);
CHECK(ret, FAIL, "H5Sselect_elements");
/* Verify correct elements selected */
@@ -598,7 +604,7 @@ test_select_point(hid_t xfer_plist)
**
****************************************************************/
herr_t
-test_select_all_iter1(void *_elem,hid_t UNUSED type_id, hsize_t UNUSED ndim, hssize_t UNUSED *point, void *_operator_data)
+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 */
**tbuf2=(uint8_t **)_operator_data; /* temporary buffer handle */
@@ -618,7 +624,7 @@ test_select_all_iter1(void *_elem,hid_t UNUSED type_id, hsize_t UNUSED ndim, hss
**
****************************************************************/
herr_t
-test_select_none_iter1(void UNUSED *_elem,hid_t UNUSED type_id, hsize_t UNUSED ndim, hssize_t UNUSED *point, void UNUSED *_operator_data)
+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);
} /* end test_select_none_iter1() */
@@ -716,7 +722,7 @@ test_select_all_hyper(hid_t xfer_plist)
hsize_t dims1[] = {SPACE3_DIM1, SPACE3_DIM2};
hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
- hssize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
+ hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */
hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */
hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */
@@ -854,8 +860,8 @@ test_select_combo(void)
hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
- hssize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */
- hssize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
+ hsize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */
+ hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */
hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */
hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */
@@ -901,7 +907,7 @@ test_select_combo(void)
coord1[7][0]=1; coord1[7][1]= 0; coord1[7][2]= 4;
coord1[8][0]=2; coord1[8][1]= 1; coord1[8][2]= 6;
coord1[9][0]=0; coord1[9][1]= 3; coord1[9][2]= 8;
- ret = H5Sselect_elements(sid1,H5S_SELECT_SET,POINT1_NPOINTS,(const hssize_t **)coord1);
+ ret = H5Sselect_elements(sid1,H5S_SELECT_SET,POINT1_NPOINTS,(const hsize_t **)coord1);
CHECK(ret, FAIL, "H5Sselect_elements");
/* Select 1x10 hyperslab for writing memory dataset */
@@ -995,7 +1001,7 @@ test_select_hyper_stride(hid_t xfer_plist)
hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
- hssize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
+ hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */
hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */
hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */
@@ -1145,7 +1151,7 @@ test_select_hyper_contig(hid_t dset_type, hid_t xfer_plist)
hid_t dataset; /* Dataset ID */
hid_t sid1,sid2; /* Dataspace ID */
hsize_t dims2[] = {SPACE2_DIM2, SPACE2_DIM1};
- hssize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
+ hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */
hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */
hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */
@@ -1274,7 +1280,7 @@ test_select_hyper_contig2(hid_t dset_type, hid_t xfer_plist)
hid_t dataset; /* Dataset ID */
hid_t sid1,sid2; /* Dataspace ID */
hsize_t dims2[] = {SPACE8_DIM4, SPACE8_DIM3, SPACE8_DIM2, SPACE8_DIM1};
- hssize_t start[SPACE8_RANK]; /* Starting location of hyperslab */
+ hsize_t start[SPACE8_RANK]; /* Starting location of hyperslab */
hsize_t count[SPACE8_RANK]; /* Element count of hyperslab */
uint16_t *wbuf, /* buffer to write to disk */
*rbuf, /* buffer read from disk */
@@ -1398,12 +1404,12 @@ test_select_hyper_contig3(hid_t dset_type, hid_t xfer_plist)
hid_t dataset; /* Dataset ID */
hid_t sid1,sid2; /* Dataspace ID */
hsize_t dims2[] = {SPACE8_DIM4, SPACE8_DIM3, SPACE8_DIM2, SPACE8_DIM1};
- hssize_t start[SPACE8_RANK]; /* Starting location of hyperslab */
+ hsize_t start[SPACE8_RANK]; /* Starting location of hyperslab */
hsize_t count[SPACE8_RANK]; /* Element count of hyperslab */
uint16_t *wbuf, /* Buffer to write to disk */
*rbuf, /* Buffer read from disk */
*tbuf, *tbuf2; /* Temporary buffer pointers */
- int i,j,k,l; /* Counters */
+ unsigned i,j,k,l; /* Counters */
herr_t ret; /* Generic return value */
/* Output message about test being performed */
@@ -1480,19 +1486,19 @@ test_select_hyper_contig3(hid_t dset_type, hid_t xfer_plist)
for(j=0; j<SPACE8_DIM3; j++)
for(k=0; k<SPACE8_DIM2; k++)
for(l=0; l<SPACE8_DIM1; l++,tbuf++,tbuf2++)
- if( (i>=start[0] && i<(int)(start[0]+count[0])) &&
- (j>=start[1] && j<(int)(start[1]+count[1])) &&
- (k>=start[2] && k<(int)(start[2]+count[2])) &&
- (l>=start[3] && l<(int)(start[3]+count[3])) ) {
+ if( (i>=start[0] && i<(start[0]+count[0])) &&
+ (j>=start[1] && j<(start[1]+count[1])) &&
+ (k>=start[2] && k<(start[2]+count[2])) &&
+ (l>=start[3] && l<(start[3]+count[3])) ) {
if(*tbuf!=*tbuf2) {
printf("Error: hyperslab values don't match!\n");
- TestErrPrintf("Line: %d, i=%d, j=%d, k=%d, l=%d, *tbuf=%u,*tbuf2=%u\n",__LINE__,i,j,k,l,(unsigned)*tbuf,(unsigned)*tbuf2);
+ TestErrPrintf("Line: %d, i=%u, j=%u, k=%u, l=%u, *tbuf=%u,*tbuf2=%u\n",__LINE__,i,j,k,l,(unsigned)*tbuf,(unsigned)*tbuf2);
} /* end if */
} /* end if */
else {
if(*tbuf2!=0) {
printf("Error: invalid data in read buffer!\n");
- TestErrPrintf("Line: %d, i=%d, j=%d, k=%d, l=%d, *tbuf=%u,*tbuf2=%u\n",__LINE__,i,j,k,l,(unsigned)*tbuf,(unsigned)*tbuf2);
+ TestErrPrintf("Line: %d, i=%u, j=%u, k=%u, l=%u, *tbuf=%u,*tbuf2=%u\n",__LINE__,i,j,k,l,(unsigned)*tbuf,(unsigned)*tbuf2);
} /* end if */
} /* end else */
@@ -1532,7 +1538,7 @@ test_select_hyper_copy(void)
hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
- hssize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
+ hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */
hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */
hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */
@@ -1690,9 +1696,9 @@ test_select_point_copy(void)
hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
- hssize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */
- hssize_t coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */
- hssize_t coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */
+ hsize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */
+ hsize_t coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */
+ hsize_t coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */
uint16_t *wbuf, /* buffer to write to disk */
*rbuf, /* 1st buffer read from disk */
*rbuf2, /* 2nd buffer read from disk */
@@ -1736,7 +1742,7 @@ test_select_point_copy(void)
coord1[7][0]=1; coord1[7][1]= 0; coord1[7][2]= 4;
coord1[8][0]=2; coord1[8][1]= 1; coord1[8][2]= 6;
coord1[9][0]=0; coord1[9][1]= 3; coord1[9][2]= 8;
- ret = H5Sselect_elements(sid1,H5S_SELECT_SET,POINT1_NPOINTS,(const hssize_t **)coord1);
+ ret = H5Sselect_elements(sid1,H5S_SELECT_SET,POINT1_NPOINTS,(const hsize_t **)coord1);
CHECK(ret, FAIL, "H5Sselect_elements");
/* Select sequence of ten points for write dataset */
@@ -1750,7 +1756,7 @@ test_select_point_copy(void)
coord2[7][0]=29; coord2[7][1]= 4;
coord2[8][0]= 8; coord2[8][1]= 8;
coord2[9][0]=19; coord2[9][1]=17;
- ret = H5Sselect_elements(sid2,H5S_SELECT_SET,POINT1_NPOINTS,(const hssize_t **)coord2);
+ ret = H5Sselect_elements(sid2,H5S_SELECT_SET,POINT1_NPOINTS,(const hsize_t **)coord2);
CHECK(ret, FAIL, "H5Sselect_elements");
/* Make a copy of the dataspace to write */
@@ -1794,7 +1800,7 @@ test_select_point_copy(void)
coord3[7][0]= 1; coord3[7][1]=22;
coord3[8][0]=12; coord3[8][1]=21;
coord3[9][0]=11; coord3[9][1]= 6;
- ret = H5Sselect_elements(sid2,H5S_SELECT_SET,POINT1_NPOINTS,(const hssize_t **)coord3);
+ ret = H5Sselect_elements(sid2,H5S_SELECT_SET,POINT1_NPOINTS,(const hsize_t **)coord3);
CHECK(ret, FAIL, "H5Sselect_elements");
/* Make a copy of the dataspace to read */
@@ -1859,7 +1865,7 @@ test_select_hyper_offset(void)
hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
- hssize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
+ hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */
hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */
hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */
@@ -2017,7 +2023,7 @@ test_select_hyper_offset2(void)
hid_t sid1,sid2; /* Dataspace ID */
hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2};
hsize_t dims2[] = {SPACE7_DIM1, SPACE7_DIM2};
- hssize_t start[SPACE7_RANK]; /* Starting location of hyperslab */
+ hsize_t start[SPACE7_RANK]; /* Starting location of hyperslab */
hsize_t count[SPACE7_RANK]; /* Element count of hyperslab */
hssize_t offset[SPACE7_RANK]; /* Offset of selection */
uint8_t *wbuf, /* buffer to write to disk */
@@ -2136,9 +2142,9 @@ test_select_point_offset(void)
hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
- hssize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */
- hssize_t coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */
- hssize_t coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */
+ hsize_t coord1[POINT1_NPOINTS][SPACE1_RANK]; /* Coordinates for point selection */
+ hsize_t coord2[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */
+ hsize_t coord3[POINT1_NPOINTS][SPACE3_RANK]; /* Coordinates for point selection */
hssize_t offset[SPACE1_RANK]; /* Offset of selection */
uint8_t *wbuf, /* buffer to write to disk */
*rbuf, /* buffer read from disk */
@@ -2183,7 +2189,7 @@ test_select_point_offset(void)
coord1[7][0]=1; coord1[7][1]= 0; coord1[7][2]= 4;
coord1[8][0]=2; coord1[8][1]= 1; coord1[8][2]= 6;
coord1[9][0]=0; coord1[9][1]= 3; coord1[9][2]= 8;
- ret = H5Sselect_elements(sid1,H5S_SELECT_SET,POINT1_NPOINTS,(const hssize_t **)coord1);
+ ret = H5Sselect_elements(sid1,H5S_SELECT_SET,POINT1_NPOINTS,(const hsize_t **)coord1);
CHECK(ret, FAIL, "H5Sselect_elements");
/* Check a valid offset */
@@ -2218,7 +2224,7 @@ test_select_point_offset(void)
coord2[7][0]=23; coord2[7][1]= 4;
coord2[8][0]= 8; coord2[8][1]= 8;
coord2[9][0]=19; coord2[9][1]=17;
- ret = H5Sselect_elements(sid2,H5S_SELECT_SET,POINT1_NPOINTS,(const hssize_t **)coord2);
+ ret = H5Sselect_elements(sid2,H5S_SELECT_SET,POINT1_NPOINTS,(const hsize_t **)coord2);
CHECK(ret, FAIL, "H5Sselect_elements");
/* Choose a valid offset for the memory dataspace */
@@ -2254,7 +2260,7 @@ test_select_point_offset(void)
coord3[7][0]= 1; coord3[7][1]=22;
coord3[8][0]=12; coord3[8][1]=21;
coord3[9][0]=11; coord3[9][1]= 6;
- ret = H5Sselect_elements(sid2,H5S_SELECT_SET,POINT1_NPOINTS,(const hssize_t **)coord3);
+ ret = H5Sselect_elements(sid2,H5S_SELECT_SET,POINT1_NPOINTS,(const hsize_t **)coord3);
CHECK(ret, FAIL, "H5Sselect_elements");
/* Read selection from disk */
@@ -2306,7 +2312,7 @@ test_select_hyper_union(void)
hsize_t dims1[] = {SPACE1_DIM1, SPACE1_DIM2, SPACE1_DIM3};
hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
hsize_t dims3[] = {SPACE3_DIM1, SPACE3_DIM2};
- hssize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
+ hsize_t start[SPACE1_RANK]; /* Starting location of hyperslab */
hsize_t stride[SPACE1_RANK]; /* Stride of hyperslab */
hsize_t count[SPACE1_RANK]; /* Element count of hyperslab */
hsize_t block[SPACE1_RANK]; /* Block size of hyperslab */
@@ -2820,7 +2826,7 @@ test_select_hyper_and_2d(void)
hid_t sid1,sid2; /* Dataspace ID */
hsize_t dims1[] = {SPACE2_DIM1, SPACE2_DIM2};
hsize_t dims2[] = {SPACE2A_DIM1};
- hssize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
+ hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */
hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */
hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */
@@ -2946,7 +2952,7 @@ test_select_hyper_xor_2d(void)
hid_t sid1,sid2; /* Dataspace ID */
hsize_t dims1[] = {SPACE2_DIM1, SPACE2_DIM2};
hsize_t dims2[] = {SPACE2A_DIM1};
- hssize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
+ hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */
hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */
hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */
@@ -3074,7 +3080,7 @@ test_select_hyper_notb_2d(void)
hid_t sid1,sid2; /* Dataspace ID */
hsize_t dims1[] = {SPACE2_DIM1, SPACE2_DIM2};
hsize_t dims2[] = {SPACE2A_DIM1};
- hssize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
+ hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */
hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */
hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */
@@ -3201,7 +3207,7 @@ test_select_hyper_nota_2d(void)
hid_t sid1,sid2; /* Dataspace ID */
hsize_t dims1[] = {SPACE2_DIM1, SPACE2_DIM2};
hsize_t dims2[] = {SPACE2A_DIM1};
- hssize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
+ hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */
hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */
hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */
@@ -3320,7 +3326,7 @@ test_select_hyper_nota_2d(void)
**
****************************************************************/
herr_t
-test_select_hyper_iter2(void *_elem, hid_t UNUSED type_id, hsize_t ndim, hssize_t *point, void *_operator_data)
+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 */
**tbuf2=(int **)_operator_data; /* temporary buffer handle */
@@ -3329,9 +3335,9 @@ test_select_hyper_iter2(void *_elem, hid_t UNUSED type_id, hsize_t ndim, hssize_
if(*tbuf!=**tbuf2) {
TestErrPrintf("Error in hyperslab iteration!\n");
printf("location: { ");
- for(u=0; u<(unsigned)ndim; u++) {
+ for(u=0; u<ndim; u++) {
printf("%2d",(int)point[u]);
- if(u<(unsigned)(ndim-1))
+ if(u<(ndim-1))
printf(", ");
} /* end for */
printf("}\n");
@@ -3342,7 +3348,7 @@ test_select_hyper_iter2(void *_elem, hid_t UNUSED type_id, hsize_t ndim, hssize_
(*tbuf2)++;
return(0);
}
-} /* end test_select_hyper_iter1() */
+} /* end test_select_hyper_iter2() */
/****************************************************************
**
@@ -3358,7 +3364,7 @@ test_select_hyper_union_random_5d(hid_t read_plist)
hid_t sid1,sid2; /* Dataspace ID */
hsize_t dims1[] = {SPACE5_DIM1, SPACE5_DIM2, SPACE5_DIM3, SPACE5_DIM4, SPACE5_DIM5};
hsize_t dims2[] = {SPACE6_DIM1};
- hssize_t start[SPACE5_RANK]; /* Starting location of hyperslab */
+ hsize_t start[SPACE5_RANK]; /* Starting location of hyperslab */
hsize_t count[SPACE5_RANK]; /* Element count of hyperslab */
int *wbuf, /* buffer to write to disk */
*rbuf, /* buffer read from disk */
@@ -3555,9 +3561,9 @@ test_select_hyper_chunk(hid_t fapl_plist, hid_t xfer_plist)
short *tmpdata_out; /* output buffer */
hsize_t count[3]; /* size of the hyperslab in the file */
- hssize_t offset[3]; /* hyperslab offset in the file */
+ hsize_t offset[3]; /* hyperslab offset in the file */
hsize_t count_out[3]; /* size of the hyperslab in memory */
- hssize_t offset_out[3]; /* hyperslab offset in memory */
+ hsize_t offset_out[3]; /* hyperslab offset in memory */
int i, j, k, status_n, rank;
/* Output message about test being performed */
@@ -3788,9 +3794,9 @@ test_select_point_chunk(void)
unsigned *tmpdata_out; /* output buffer */
#endif /* LATER */
- hssize_t start[SPACE7_RANK]; /* hyperslab offset */
+ hsize_t start[SPACE7_RANK]; /* hyperslab offset */
hsize_t count[SPACE7_RANK]; /* size of the hyperslab */
- hssize_t points[SPACE7_NPOINTS][SPACE7_RANK]; /* points for selection */
+ hsize_t points[SPACE7_NPOINTS][SPACE7_RANK]; /* points for selection */
unsigned i, j; /* Local index variables */
/* Output message about test being performed */
@@ -3853,7 +3859,7 @@ test_select_point_chunk(void)
points[6][1]=1;
points[7][0]=6; /* In same chunk as point #3, but "earlier" in chunk */
points[7][1]=6;
- ret = H5Sselect_elements(pnt1_space,H5S_SELECT_SET,SPACE7_NPOINTS,(const hssize_t **)points);
+ ret = H5Sselect_elements(pnt1_space,H5S_SELECT_SET,SPACE7_NPOINTS,(const hsize_t **)points);
CHECK(ret, FAIL, "H5Sselect_elements");
/* Create 1st hyperslab selection */
@@ -3889,7 +3895,7 @@ test_select_point_chunk(void)
points[6][1]=2;
points[7][0]=7; /* In same chunk as point #3, but "earlier" in chunk */
points[7][1]=7;
- ret = H5Sselect_elements(pnt2_space,H5S_SELECT_SET,SPACE7_NPOINTS,(const hssize_t **)points);
+ ret = H5Sselect_elements(pnt2_space,H5S_SELECT_SET,SPACE7_NPOINTS,(const hsize_t **)points);
CHECK(ret, FAIL, "H5Sselect_elements");
/* Create 2nd hyperslab selection */
@@ -3967,7 +3973,7 @@ test_select_scalar_chunk(void)
hid_t m_sid; /* Memory dataspace */
hsize_t dims[] = {2}; /* Dataset dimensions */
hsize_t maxdims[] = {H5S_UNLIMITED}; /* Dataset maximum dimensions */
- hssize_t offset[] = {0}; /* Hyperslab start */
+ hsize_t offset[] = {0}; /* Hyperslab start */
hsize_t count[] = {1}; /* Hyperslab count */
unsigned data = 2; /* Data to write */
herr_t ret;
@@ -4029,9 +4035,9 @@ test_select_valid(void)
herr_t error;
htri_t valid;
hid_t main_space, sub_space;
- hssize_t safe_start[2]={1,1};
+ hsize_t safe_start[2]={1,1};
hsize_t safe_count[2]={1,1};
- hssize_t start[2];
+ hsize_t start[2];
hsize_t dims[2],maxdims[2],size[2],count[2];
/* Output message about test being performed */
@@ -4126,7 +4132,7 @@ test_select_combine(void)
hid_t all_id; /* Dataspace for "all" selection */
hid_t none_id; /* Dataspace for "none" selection */
hid_t space1; /* Temporary dataspace #1 */
- hssize_t start[SPACE7_RANK]; /* Hyperslab start */
+ hsize_t start[SPACE7_RANK]; /* Hyperslab start */
hsize_t stride[SPACE7_RANK]; /* Hyperslab stride */
hsize_t count[SPACE7_RANK]; /* Hyperslab count */
hsize_t block[SPACE7_RANK]; /* Hyperslab block */
@@ -4477,7 +4483,7 @@ test_select_combine(void)
typedef struct {
unsigned short fill_value; /* The fill value to check */
size_t curr_coord; /* Current coordinate to examine */
- hssize_t *coords; /* Pointer to selection's coordinates */
+ hsize_t *coords; /* Pointer to selection's coordinates */
} fill_iter_info;
/****************************************************************
@@ -4486,11 +4492,11 @@ typedef struct {
**
****************************************************************/
herr_t
-test_select_hyper_iter3(void *_elem,hid_t UNUSED type_id, hsize_t ndim, hssize_t *point, void *_operator_data)
+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 */
fill_iter_info *iter_info=(fill_iter_info *)_operator_data; /* Get the pointer to the iterator information */
- hssize_t *coord_ptr; /* Pointer to the coordinate information for a point*/
+ hsize_t *coord_ptr; /* Pointer to the coordinate information for a point*/
/* Check value in current buffer location */
if(*tbuf!=iter_info->fill_value)
@@ -4526,7 +4532,7 @@ test_select_fill_all(void)
hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2};
int fill_value; /* Fill value */
fill_iter_info iter_info; /* Iterator information structure */
- hssize_t points[SPACE7_DIM1*SPACE7_DIM2][SPACE7_RANK]; /* Coordinates of selection */
+ hsize_t points[SPACE7_DIM1*SPACE7_DIM2][SPACE7_RANK]; /* Coordinates of selection */
unsigned short *wbuf, /* buffer to write to disk */
*tbuf; /* temporary buffer pointer */
int i,j; /* Counters */
@@ -4572,7 +4578,7 @@ test_select_fill_all(void)
/* Initialize the iterator structure */
iter_info.fill_value=SPACE7_FILL;
iter_info.curr_coord=0;
- iter_info.coords=(hssize_t *)points;
+ iter_info.coords=(hsize_t *)points;
/* Iterate through selection, verifying correct data */
ret = H5Diterate(wbuf,H5T_NATIVE_USHORT,sid1,test_select_hyper_iter3,&iter_info);
@@ -4598,7 +4604,7 @@ test_select_fill_point(hssize_t *offset)
hid_t sid1; /* Dataspace ID */
hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2};
hssize_t real_offset[SPACE7_RANK]; /* Actual offset to use */
- hssize_t points[5][SPACE7_RANK] = {{2,4}, {3,8}, {8,4}, {7,5}, {7,7}};
+ hsize_t points[5][SPACE7_RANK] = {{2,4}, {3,8}, {8,4}, {7,5}, {7,7}};
size_t num_points=5; /* Number of points selected */
int fill_value; /* Fill value */
fill_iter_info iter_info; /* Iterator information structure */
@@ -4623,7 +4629,7 @@ test_select_fill_point(hssize_t *offset)
CHECK(sid1, FAIL, "H5Screate_simple");
/* Select "point" selection */
- ret = H5Sselect_elements(sid1, H5S_SELECT_SET,num_points,(const hssize_t **)points);
+ ret = H5Sselect_elements(sid1, H5S_SELECT_SET,num_points,(const hsize_t **)points);
CHECK(ret, FAIL, "H5Sselect_elements");
if(offset!=NULL) {
@@ -4647,7 +4653,7 @@ test_select_fill_point(hssize_t *offset)
for(i=0, tbuf=wbuf; i<SPACE7_DIM1; i++)
for(j=0; j<SPACE7_DIM2; j++, tbuf++) {
for(k=0; k<(int)num_points; k++) {
- if(i==(points[k][0]+real_offset[0]) && j==(points[k][1]+real_offset[1])) {
+ if(i==(int)(points[k][0]+real_offset[0]) && j==(int)(points[k][1]+real_offset[1])) {
if(*tbuf!=(unsigned short)fill_value)
TestErrPrintf("Error! j=%d, i=%d, *tbuf=%u, fill_value=%u\n",j,i,(unsigned)*tbuf,(unsigned)fill_value);
break;
@@ -4660,7 +4666,7 @@ test_select_fill_point(hssize_t *offset)
/* Initialize the iterator structure */
iter_info.fill_value=SPACE7_FILL;
iter_info.curr_coord=0;
- iter_info.coords=(hssize_t *)points;
+ iter_info.coords=(hsize_t *)points;
/* Add in the offset */
for(i=0; i<(int)num_points; i++) {
@@ -4692,10 +4698,10 @@ test_select_fill_hyper_simple(hssize_t *offset)
hid_t sid1; /* Dataspace ID */
hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2};
hssize_t real_offset[SPACE7_RANK]; /* Actual offset to use */
- hssize_t start[SPACE7_RANK]; /* Hyperslab start */
+ hsize_t start[SPACE7_RANK]; /* Hyperslab start */
hsize_t count[SPACE7_RANK]; /* Hyperslab block size */
size_t num_points; /* Number of points in selection */
- hssize_t points[16][SPACE7_RANK]; /* Coordinates selected */
+ hsize_t points[16][SPACE7_RANK]; /* Coordinates selected */
int fill_value; /* Fill value */
fill_iter_info iter_info; /* Iterator information structure */
unsigned short *wbuf, /* buffer to write to disk */
@@ -4758,7 +4764,7 @@ test_select_fill_hyper_simple(hssize_t *offset)
/* Initialize the iterator structure */
iter_info.fill_value=SPACE7_FILL;
iter_info.curr_coord=0;
- iter_info.coords=(hssize_t *)points;
+ iter_info.coords=(hsize_t *)points;
/* Set the coordinates of the selection (with the offset) */
for(i=0, num_points=0; i<(int)count[0]; i++)
@@ -4791,11 +4797,11 @@ test_select_fill_hyper_regular(hssize_t *offset)
hid_t sid1; /* Dataspace ID */
hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2};
hssize_t real_offset[SPACE7_RANK]; /* Actual offset to use */
- hssize_t start[SPACE7_RANK]; /* Hyperslab start */
+ hsize_t start[SPACE7_RANK]; /* Hyperslab start */
hsize_t stride[SPACE7_RANK]; /* Hyperslab stride size */
hsize_t count[SPACE7_RANK]; /* Hyperslab block count */
hsize_t block[SPACE7_RANK]; /* Hyperslab block size */
- hssize_t points[16][SPACE7_RANK] = {
+ hsize_t points[16][SPACE7_RANK] = {
{2,2}, {2,3}, {2,6}, {2,7},
{3,2}, {3,3}, {3,6}, {3,7},
{6,2}, {6,3}, {6,6}, {6,7},
@@ -4853,7 +4859,7 @@ test_select_fill_hyper_regular(hssize_t *offset)
for(i=0, tbuf=wbuf; i<SPACE7_DIM1; i++)
for(j=0; j<SPACE7_DIM2; j++, tbuf++) {
for(k=0; k<(int)num_points; k++) {
- if(i==(points[k][0]+real_offset[0]) && j==(points[k][1]+real_offset[1])) {
+ if(i==(int)(points[k][0]+real_offset[0]) && j==(int)(points[k][1]+real_offset[1])) {
if(*tbuf!=(unsigned short)fill_value)
TestErrPrintf("Error! j=%d, i=%d, *tbuf=%u, fill_value=%u\n",j,i,(unsigned)*tbuf,(unsigned)fill_value);
break;
@@ -4866,7 +4872,7 @@ test_select_fill_hyper_regular(hssize_t *offset)
/* Initialize the iterator structure */
iter_info.fill_value=SPACE7_FILL;
iter_info.curr_coord=0;
- iter_info.coords=(hssize_t *)points;
+ iter_info.coords=(hsize_t *)points;
/* Add in the offset */
for(i=0; i<(int)num_points; i++) {
@@ -4898,9 +4904,9 @@ test_select_fill_hyper_irregular(hssize_t *offset)
hid_t sid1; /* Dataspace ID */
hsize_t dims1[] = {SPACE7_DIM1, SPACE7_DIM2};
hssize_t real_offset[SPACE7_RANK]; /* Actual offset to use */
- hssize_t start[SPACE7_RANK]; /* Hyperslab start */
+ hsize_t start[SPACE7_RANK]; /* Hyperslab start */
hsize_t count[SPACE7_RANK]; /* Hyperslab block count */
- hssize_t points[32][SPACE7_RANK] = { /* Yes, some of the are duplicated.. */
+ hsize_t points[32][SPACE7_RANK] = { /* Yes, some of the are duplicated.. */
{2,2}, {2,3}, {2,4}, {2,5},
{3,2}, {3,3}, {3,4}, {3,5},
{4,2}, {4,3}, {4,4}, {4,5},
@@ -4910,7 +4916,7 @@ test_select_fill_hyper_irregular(hssize_t *offset)
{6,4}, {6,5}, {6,6}, {6,7},
{7,4}, {7,5}, {7,6}, {7,7},
};
- hssize_t iter_points[28][SPACE7_RANK] = { /* Coordinates, as iterated through */
+ hsize_t iter_points[28][SPACE7_RANK] = { /* Coordinates, as iterated through */
{2,2}, {2,3}, {2,4}, {2,5},
{3,2}, {3,3}, {3,4}, {3,5},
{4,2}, {4,3}, {4,4}, {4,5}, {4,6}, {4,7},
@@ -4975,7 +4981,7 @@ test_select_fill_hyper_irregular(hssize_t *offset)
for(i=0, tbuf=wbuf; i<SPACE7_DIM1; i++)
for(j=0; j<SPACE7_DIM2; j++, tbuf++) {
for(k=0; k<(int)num_points; k++) {
- if(i==(points[k][0]+real_offset[0]) && j==(points[k][1]+real_offset[1])) {
+ if(i==(int)(points[k][0]+real_offset[0]) && j==(int)(points[k][1]+real_offset[1])) {
if(*tbuf!=(unsigned short)fill_value)
TestErrPrintf("Error! j=%d, i=%d, *tbuf=%u, fill_value=%u\n",j,i,(unsigned)*tbuf,(unsigned)fill_value);
break;
@@ -4988,7 +4994,7 @@ test_select_fill_hyper_irregular(hssize_t *offset)
/* Initialize the iterator structure */
iter_info.fill_value=SPACE7_FILL;
iter_info.curr_coord=0;
- iter_info.coords=(hssize_t *)iter_points;
+ iter_info.coords=(hsize_t *)iter_points;
/* Add in the offset */
for(i=0; i<(int)num_iter_points; i++) {
@@ -5117,8 +5123,8 @@ test_scalar_select(void)
hid_t dataset; /* Dataset ID */
hid_t sid1,sid2; /* Dataspace ID */
hsize_t dims2[] = {SPACE7_DIM1, SPACE7_DIM2};
- hssize_t coord1[SPACE7_RANK]; /* Coordinates for point selection */
- hssize_t start[SPACE7_RANK]; /* Hyperslab start */
+ hsize_t coord1[SPACE7_RANK]; /* Coordinates for point selection */
+ hsize_t start[SPACE7_RANK]; /* Hyperslab start */
hsize_t count[SPACE7_RANK]; /* Hyperslab block count */
uint8_t *wbuf_uint8, /* buffer to write to disk */
rval_uint8, /* value read back in */
@@ -5161,7 +5167,7 @@ test_scalar_select(void)
/* Select one element in memory with a point selection */
coord1[0]=0; coord1[1]= 2;
- ret = H5Sselect_elements(sid2,H5S_SELECT_SET,1,(const hssize_t **)&coord1);
+ ret = H5Sselect_elements(sid2,H5S_SELECT_SET,1,(const hsize_t **)&coord1);
CHECK(ret, FAIL, "H5Sselect_elements");
/* Write single point to disk */
@@ -5265,8 +5271,8 @@ static void
test_scalar_select2(void)
{
hid_t sid; /* Dataspace ID */
- hssize_t coord1[1]; /* Coordinates for point selection */
- hssize_t start[1]; /* Hyperslab start */
+ hsize_t coord1[1]; /* Coordinates for point selection */
+ hsize_t start[1]; /* Hyperslab start */
hsize_t count[1]; /* Hyperslab block count */
herr_t ret; /* Generic return value */
@@ -5280,7 +5286,7 @@ test_scalar_select2(void)
/* Select one element in memory with a point selection */
coord1[0]=0;
H5E_BEGIN_TRY {
- ret = H5Sselect_elements(sid,H5S_SELECT_SET,1,(const hssize_t **)&coord1);
+ ret = H5Sselect_elements(sid,H5S_SELECT_SET,1,(const hsize_t **)&coord1);
} H5E_END_TRY;
VERIFY(ret, FAIL, "H5Sselect_elements");
@@ -5331,9 +5337,9 @@ test_shape_same(void)
hid_t none_hyper_sid; /* Dataspace ID with "no hyperslabs" selection */
hid_t tmp_sid; /* Temporary dataspace ID */
hsize_t dims[] = {SPACE9_DIM1, SPACE9_DIM2};
- hssize_t coord1[1][SPACE2_RANK]; /* Coordinates for single point selection */
- hssize_t coord2[SPACE9_DIM2][SPACE9_RANK]; /* Coordinates for multiple point selection */
- hssize_t start[SPACE9_RANK]; /* Hyperslab start */
+ hsize_t coord1[1][SPACE2_RANK]; /* Coordinates for single point selection */
+ hsize_t coord2[SPACE9_DIM2][SPACE9_RANK]; /* Coordinates for multiple point selection */
+ hsize_t start[SPACE9_RANK]; /* Hyperslab start */
hsize_t stride[SPACE9_RANK]; /* Hyperslab stride */
hsize_t count[SPACE9_RANK]; /* Hyperslab block count */
hsize_t block[SPACE9_RANK]; /* Hyperslab block size */
@@ -5367,7 +5373,7 @@ test_shape_same(void)
/* Select sequence of ten points for multiple point selection */
coord1[0][0]=2; coord1[0][1]=2;
- ret = H5Sselect_elements(single_pt_sid,H5S_SELECT_SET,1,(const hssize_t **)coord1);
+ ret = H5Sselect_elements(single_pt_sid,H5S_SELECT_SET,1,(const hsize_t **)coord1);
CHECK(ret, FAIL, "H5Sselect_elements");
/* Create dataspace for multiple point selection */
@@ -5385,7 +5391,7 @@ test_shape_same(void)
coord2[7][0]=1; coord2[7][1]=0;
coord2[8][0]=5; coord2[8][1]=1;
coord2[9][0]=9; coord2[9][1]=3;
- ret = H5Sselect_elements(mult_pt_sid,H5S_SELECT_SET,POINT1_NPOINTS,(const hssize_t **)coord2);
+ ret = H5Sselect_elements(mult_pt_sid,H5S_SELECT_SET,POINT1_NPOINTS,(const hsize_t **)coord2);
CHECK(ret, FAIL, "H5Sselect_elements");
/* Create dataspace for single hyperslab selection */
@@ -5742,7 +5748,7 @@ test_shape_same(void)
for(v=1; v<(SPACE9_DIM2-1); v++) {
coord2[v-1][0]=u; coord2[v-1][1]=v;
} /* end for */
- ret = H5Sselect_elements(tmp_sid,H5S_SELECT_APPEND,(SPACE9_DIM2-2),(const hssize_t **)coord2);
+ ret = H5Sselect_elements(tmp_sid,H5S_SELECT_APPEND,(SPACE9_DIM2-2),(const hsize_t **)coord2);
CHECK(ret, FAIL, "H5Sselect_elements");
} /* end for */
@@ -5848,7 +5854,7 @@ test_shape_same(void)
for(v=0; v<SPACE9_DIM2; v++) {
coord2[v][0]=u; coord2[v][1]=v;
} /* end for */
- ret = H5Sselect_elements(tmp_sid,H5S_SELECT_APPEND,SPACE9_DIM2,(const hssize_t **)coord2);
+ ret = H5Sselect_elements(tmp_sid,H5S_SELECT_APPEND,SPACE9_DIM2,(const hsize_t **)coord2);
CHECK(ret, FAIL, "H5Sselect_elements");
} /* end for */
@@ -5998,7 +6004,7 @@ test_shape_same(void)
for(v=0; v<2; v++) {
coord2[v][0]=u; coord2[v][1]=(v*2)+2;
} /* end for */
- ret = H5Sselect_elements(tmp_sid,H5S_SELECT_APPEND,2,(const hssize_t **)coord2);
+ ret = H5Sselect_elements(tmp_sid,H5S_SELECT_APPEND,2,(const hsize_t **)coord2);
CHECK(ret, FAIL, "H5Sselect_elements");
} /* end for */
@@ -6180,7 +6186,7 @@ test_select_hyper_chunk_offset(void)
int *rbuf; /* Buffer for reading data */
hid_t dcpl; /* Dataset creation property list ID */
hsize_t chunks[1]={SPACE10_CHUNK_SIZE }; /* Chunk size */
- hssize_t start[1] = { 0 }; /* The start of the hyperslab */
+ hsize_t start[1] = { 0 }; /* The start of the hyperslab */
hsize_t count[1] = { SPACE10_CHUNK_SIZE }; /* The size of the hyperslab */
int i,j; /* Local index */
herr_t ret; /* Generic return value */
@@ -6376,6 +6382,210 @@ test_select_hyper_chunk_offset(void)
/****************************************************************
**
+** test_select_bounds(): Tests selection bounds on dataspaces,
+** both with and without offsets.
+**
+****************************************************************/
+static void
+test_select_bounds(void)
+{
+ hid_t sid; /* Dataspace ID */
+ const hsize_t dims[SPACE11_RANK] = { SPACE11_DIM1, SPACE11_DIM2 }; /* Dataspace dimensions */
+ hsize_t coord[SPACE11_NPOINTS][SPACE11_RANK]; /* Coordinates for point selection */
+ hsize_t start[SPACE11_RANK]; /* The start of the hyperslab */
+ hsize_t stride[SPACE11_RANK]; /* The stride between block starts for the hyperslab */
+ hsize_t count[SPACE11_RANK]; /* The number of blocks for the hyperslab */
+ hsize_t block[SPACE11_RANK]; /* The size of each block for the hyperslab */
+ hssize_t offset[SPACE11_RANK]; /* Offset amount for selection */
+ hsize_t low_bounds[SPACE11_RANK]; /* The low bounds for the selection */
+ hsize_t high_bounds[SPACE11_RANK]; /* The high bounds for the selection */
+ herr_t ret; /* Generic return value */
+
+ /* Output message about test being performed */
+ MESSAGE(6, ("Testing selection bounds\n"));
+
+ /* Create dataspace */
+ sid = H5Screate_simple (SPACE11_RANK, dims, NULL);
+ CHECK(sid, FAIL, "H5Screate_simple");
+
+ /* Get bounds for 'all' selection */
+ ret = H5Sget_select_bounds(sid,low_bounds,high_bounds);
+ CHECK(ret, FAIL, "H5Sget_select_bounds");
+ VERIFY(low_bounds[0],0,"H5Sget_select_bounds");
+ VERIFY(low_bounds[1],0,"H5Sget_select_bounds");
+ VERIFY(high_bounds[0],SPACE11_DIM1-1,"H5Sget_select_bounds");
+ VERIFY(high_bounds[1],SPACE11_DIM2-1,"H5Sget_select_bounds");
+
+ /* Set offset for selection */
+ offset[0]=1; offset[1]=1;
+ ret=H5Soffset_simple(sid, offset);
+ CHECK(ret, FAIL, "H5Soffset_simple");
+
+ /* Get bounds for 'all' selection with offset (which should be ignored) */
+ ret = H5Sget_select_bounds(sid,low_bounds,high_bounds);
+ CHECK(ret, FAIL, "H5Sget_select_bounds");
+ VERIFY(low_bounds[0],0,"H5Sget_select_bounds");
+ VERIFY(low_bounds[1],0,"H5Sget_select_bounds");
+ VERIFY(high_bounds[0],SPACE11_DIM1-1,"H5Sget_select_bounds");
+ VERIFY(high_bounds[1],SPACE11_DIM2-1,"H5Sget_select_bounds");
+
+ /* Reset offset for selection */
+ offset[0]=0; offset[1]=0;
+ ret=H5Soffset_simple(sid, offset);
+ CHECK(ret, FAIL, "H5Soffset_simple");
+
+ /* Set 'none' selection */
+ ret=H5Sselect_none(sid);
+ CHECK(ret, FAIL, "H5Sselect_none");
+
+ /* Get bounds for 'none' selection */
+ H5E_BEGIN_TRY {
+ ret = H5Sget_select_bounds(sid,low_bounds,high_bounds);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Sget_select_bounds");
+
+ /* Set point selection */
+ coord[0][0]= 3; coord[0][1]= 3;
+ coord[1][0]= 3; coord[1][1]= 96;
+ coord[2][0]= 96; coord[2][1]= 3;
+ coord[3][0]= 96; coord[3][1]= 96;
+ ret = H5Sselect_elements(sid,H5S_SELECT_SET,SPACE11_NPOINTS,(const hsize_t **)coord);
+ CHECK(ret, FAIL, "H5Sselect_elements");
+
+ /* Get bounds for point selection */
+ ret = H5Sget_select_bounds(sid,low_bounds,high_bounds);
+ CHECK(ret, FAIL, "H5Sget_select_bounds");
+ VERIFY(low_bounds[0],3,"H5Sget_select_bounds");
+ VERIFY(low_bounds[1],3,"H5Sget_select_bounds");
+ VERIFY(high_bounds[0],SPACE11_DIM1-4,"H5Sget_select_bounds");
+ VERIFY(high_bounds[1],SPACE11_DIM2-4,"H5Sget_select_bounds");
+
+ /* Set bad offset for selection */
+ offset[0]=5; offset[1]=-5;
+ ret=H5Soffset_simple(sid, offset);
+ CHECK(ret, FAIL, "H5Soffset_simple");
+
+ /* Get bounds for hyperslab selection with negative offset */
+ H5E_BEGIN_TRY {
+ ret = H5Sget_select_bounds(sid,low_bounds,high_bounds);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Sget_select_bounds");
+
+ /* Set valid offset for selection */
+ offset[0]=2; offset[1]=-2;
+ ret=H5Soffset_simple(sid, offset);
+ CHECK(ret, FAIL, "H5Soffset_simple");
+
+ /* Get bounds for point selection with offset */
+ ret = H5Sget_select_bounds(sid,low_bounds,high_bounds);
+ CHECK(ret, FAIL, "H5Sget_select_bounds");
+ VERIFY(low_bounds[0],5,"H5Sget_select_bounds");
+ VERIFY(low_bounds[1],1,"H5Sget_select_bounds");
+ VERIFY(high_bounds[0],SPACE11_DIM1-2,"H5Sget_select_bounds");
+ VERIFY(high_bounds[1],SPACE11_DIM2-6,"H5Sget_select_bounds");
+
+ /* Reset offset for selection */
+ offset[0]=0; offset[1]=0;
+ ret=H5Soffset_simple(sid, offset);
+ CHECK(ret, FAIL, "H5Soffset_simple");
+
+ /* Set "regular" hyperslab selection */
+ start[0]= 2; start[1]= 2;
+ stride[0]= 10; stride[1]= 10;
+ count[0]= 4; count[1]= 4;
+ block[0]= 5; block[1]= 5;
+ ret = H5Sselect_hyperslab(sid,H5S_SELECT_SET,start,stride,count,block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* Get bounds for hyperslab selection */
+ ret = H5Sget_select_bounds(sid,low_bounds,high_bounds);
+ CHECK(ret, FAIL, "H5Sget_select_bounds");
+ VERIFY(low_bounds[0],2,"H5Sget_select_bounds");
+ VERIFY(low_bounds[1],2,"H5Sget_select_bounds");
+ VERIFY(high_bounds[0],36,"H5Sget_select_bounds");
+ VERIFY(high_bounds[1],36,"H5Sget_select_bounds");
+
+ /* Set bad offset for selection */
+ offset[0]=5; offset[1]=-5;
+ ret=H5Soffset_simple(sid, offset);
+ CHECK(ret, FAIL, "H5Soffset_simple");
+
+ /* Get bounds for hyperslab selection with negative offset */
+ H5E_BEGIN_TRY {
+ ret = H5Sget_select_bounds(sid,low_bounds,high_bounds);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Sget_select_bounds");
+
+ /* Set valid offset for selection */
+ offset[0]=5; offset[1]=-2;
+ ret=H5Soffset_simple(sid, offset);
+ CHECK(ret, FAIL, "H5Soffset_simple");
+
+ /* Get bounds for hyperslab selection with offset */
+ ret = H5Sget_select_bounds(sid,low_bounds,high_bounds);
+ CHECK(ret, FAIL, "H5Sget_select_bounds");
+ VERIFY(low_bounds[0],7,"H5Sget_select_bounds");
+ VERIFY(low_bounds[1],0,"H5Sget_select_bounds");
+ VERIFY(high_bounds[0],41,"H5Sget_select_bounds");
+ VERIFY(high_bounds[1],34,"H5Sget_select_bounds");
+
+ /* Reset offset for selection */
+ offset[0]=0; offset[1]=0;
+ ret=H5Soffset_simple(sid, offset);
+ CHECK(ret, FAIL, "H5Soffset_simple");
+
+ /* Make "irregular" hyperslab selection */
+ start[0]= 20; start[1]= 20;
+ stride[0]= 20; stride[1]= 20;
+ count[0]= 2; count[1]= 2;
+ block[0]= 10; block[1]= 10;
+ ret = H5Sselect_hyperslab(sid,H5S_SELECT_OR,start,stride,count,block);
+ CHECK(ret, FAIL, "H5Sselect_hyperslab");
+
+ /* Get bounds for hyperslab selection */
+ ret = H5Sget_select_bounds(sid,low_bounds,high_bounds);
+ CHECK(ret, FAIL, "H5Sget_select_bounds");
+ VERIFY(low_bounds[0],2,"H5Sget_select_bounds");
+ VERIFY(low_bounds[1],2,"H5Sget_select_bounds");
+ VERIFY(high_bounds[0],49,"H5Sget_select_bounds");
+ VERIFY(high_bounds[1],49,"H5Sget_select_bounds");
+
+ /* Set bad offset for selection */
+ offset[0]=5; offset[1]=-5;
+ ret=H5Soffset_simple(sid, offset);
+ CHECK(ret, FAIL, "H5Soffset_simple");
+
+ /* Get bounds for hyperslab selection with negative offset */
+ H5E_BEGIN_TRY {
+ ret = H5Sget_select_bounds(sid,low_bounds,high_bounds);
+ } H5E_END_TRY;
+ VERIFY(ret, FAIL, "H5Sget_select_bounds");
+
+ /* Set valid offset for selection */
+ offset[0]=5; offset[1]=-2;
+ ret=H5Soffset_simple(sid, offset);
+ CHECK(ret, FAIL, "H5Soffset_simple");
+
+ /* Get bounds for hyperslab selection with offset */
+ ret = H5Sget_select_bounds(sid,low_bounds,high_bounds);
+ CHECK(ret, FAIL, "H5Sget_select_bounds");
+ VERIFY(low_bounds[0],7,"H5Sget_select_bounds");
+ VERIFY(low_bounds[1],0,"H5Sget_select_bounds");
+ VERIFY(high_bounds[0],54,"H5Sget_select_bounds");
+ VERIFY(high_bounds[1],47,"H5Sget_select_bounds");
+
+ /* Reset offset for selection */
+ offset[0]=0; offset[1]=0;
+ ret=H5Soffset_simple(sid, offset);
+ CHECK(ret, FAIL, "H5Soffset_simple");
+
+ /* Close the dataspace */
+ ret=H5Sclose (sid);
+ CHECK(ret, FAIL, "H5Sclose");
+} /* test_select_bounds() */
+
+/****************************************************************
+**
** test_select(): Main H5S selection testing routine.
**
****************************************************************/
@@ -6519,6 +6729,9 @@ test_select(void)
/* Test using selection offset on hyperslab in chunked dataset */
test_select_hyper_chunk_offset();
+ /* Test selection bounds with & without offsets */
+ test_select_bounds();
+
} /* test_select() */
diff --git a/test/tskiplist.c b/test/tskiplist.c
index 4d527af..0a02da3 100644
--- a/test/tskiplist.c
+++ b/test/tskiplist.c
@@ -143,7 +143,7 @@ test_skiplist_insert(void)
item; /* Item to insert */
int search_key; /* Key of item to search for in skip list */
int *found_item; /* Item found in skip list */
- ssize_t num; /* Number of elements in skip list */
+ size_t num; /* Number of elements in skip list */
herr_t ret; /* Generic return value */
/* Output message about test being performed */
@@ -202,7 +202,7 @@ static void
test_skiplist_insert_many(void)
{
H5SL_t *slist; /* Skip list created */
- ssize_t num; /* Number of elements in skip list */
+ size_t num; /* Number of elements in skip list */
size_t u; /* Local index variable */
int *found_item; /* Item found in skip list */
herr_t ret; /* Generic return value */
@@ -278,7 +278,7 @@ test_skiplist_remove(void)
key3; /* Key of 3rd item to insert */
int search_key; /* Key of item to search for in skip list */
int *found_item; /* Item found in skip list */
- ssize_t num; /* Number of elements in skip list */
+ size_t num; /* Number of elements in skip list */
herr_t ret; /* Generic return value */
/* Output message about test being performed */
@@ -355,7 +355,7 @@ static void
test_skiplist_remove_many(void)
{
H5SL_t *slist; /* Skip list created */
- ssize_t num; /* Number of elements in skip list */
+ size_t num; /* Number of elements in skip list */
size_t u; /* Local index variable */
int *found_item; /* Item found in skip list */
herr_t ret; /* Generic return value */
@@ -455,7 +455,7 @@ test_skiplist_firstnext(void)
{
H5SL_t *slist; /* Skip list created */
H5SL_node_t *node; /* Skip list node */
- ssize_t num; /* Number of elements in skip list */
+ size_t num; /* Number of elements in skip list */
size_t u; /* Local index variable */
int *found_item; /* Item found in skip list */
herr_t ret; /* Generic return value */
@@ -508,7 +508,7 @@ test_skiplist_string(void)
{
H5SL_t *slist; /* Skip list created */
H5SL_node_t *node; /* Skip list node */
- ssize_t num; /* Number of elements in skip list */
+ size_t num; /* Number of elements in skip list */
size_t u; /* Local index variable */
typedef struct string_node {
int i;
@@ -597,7 +597,7 @@ static void
test_skiplist_iterate(void)
{
H5SL_t *slist; /* Skip list created */
- ssize_t num; /* Number of elements in skip list */
+ size_t num; /* Number of elements in skip list */
size_t u; /* Local index variable */
herr_t ret; /* Generic return value */
@@ -653,7 +653,7 @@ test_skiplist(void)
test_skiplist_insert_many(); /* Test insertion of many items into skip list */
test_skiplist_remove(); /* Test basic skip list removal */
test_skiplist_remove_many(); /* Test removal of many items from skip list */
- test_skiplist_firstnext(); /* Test iteration over skip list nodes */
+ test_skiplist_firstnext(); /* Test iteration over skip list nodes with first/next */
test_skiplist_string(); /* Test skip list string keys */
test_skiplist_iterate(); /* Test iteration over skip list nodes with callback */
diff --git a/test/ttbbt.c b/test/ttbbt.c
index 09f3f58..fa34c84 100644
--- a/test/ttbbt.c
+++ b/test/ttbbt.c
@@ -12,8 +12,6 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* $Id$ */
-
/*
FILE
tbbt.c
diff --git a/test/ttime.c b/test/ttime.c
index 664fcdf..5f9b5e7 100644
--- a/test/ttime.c
+++ b/test/ttime.c
@@ -12,8 +12,6 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* $Id$ */
-
/***********************************************************
*
* Test program: ttime
@@ -85,9 +83,8 @@ test_time_commit(void)
tid = H5Topen(file_id, "Committed D32LE type");
CHECK(tid, FAIL, "H5Topen");
- if(!H5Tequal(tid, H5T_UNIX_D32LE)) {
+ if(!H5Tequal(tid, H5T_UNIX_D32LE))
TestErrPrintf("H5T_UNIX_D32LE datatype not found\n");
- } /* end if */
status = H5Tclose (tid);
CHECK(status, FAIL, "H5Tclose");
@@ -95,9 +92,8 @@ test_time_commit(void)
tid = H5Topen(file_id, "Committed D32BE type");
CHECK(tid, FAIL, "H5Topen");
- if(!H5Tequal(tid, H5T_UNIX_D32BE)) {
+ if(!H5Tequal(tid, H5T_UNIX_D32BE))
TestErrPrintf("H5T_UNIX_D32BE datatype not found\n");
- } /* end if */
status = H5Tclose (tid);
CHECK(status, FAIL, "H5Tclose");
@@ -105,9 +101,8 @@ test_time_commit(void)
tid = H5Topen(file_id, "Committed D64LE type");
CHECK(tid, FAIL, "H5Topen");
- if(!H5Tequal(tid, H5T_UNIX_D64LE)) {
- TestErrPrintf("H5T_UNIX_D64LE datatype not found\n");
- } /* end if */
+ if(!H5Tequal(tid, H5T_UNIX_D64LE))
+ TestErrPrintf("H5T_UNIX_D64LE datatype not found");
status = H5Tclose (tid);
CHECK(status, FAIL, "H5Tclose");
@@ -115,9 +110,8 @@ test_time_commit(void)
tid = H5Topen(file_id, "Committed D64BE type");
CHECK(tid, FAIL, "H5Topen");
- if(!H5Tequal(tid, H5T_UNIX_D64BE)) {
- TestErrPrintf("H5T_UNIX_D64BE datatype not found\n");
- } /* end if */
+ if(!H5Tequal(tid, H5T_UNIX_D64BE))
+ TestErrPrintf("H5T_UNIX_D64BE datatype not found");
status = H5Tclose (tid);
CHECK(status, FAIL, "H5Tclose");
diff --git a/test/ttsafe_acreate.c b/test/ttsafe_acreate.c
index d5ed7b7..f535541 100644
--- a/test/ttsafe_acreate.c
+++ b/test/ttsafe_acreate.c
@@ -41,7 +41,7 @@
*
* 19 May 2000, Bill Wendling
* Changed so that it creates its own HDF5 file and removes it at cleanup
- * time. Added num_errs flag.
+ * time.
*
********************************************************************/
@@ -67,114 +67,109 @@ typedef struct acreate_data_struct {
void tts_acreate(void)
{
- /* Pthread declarations */
- pthread_t threads[NUM_THREADS];
-
- /* HDF5 data declarations */
- hid_t file, dataset;
- hid_t dataspace, datatype;
- hid_t attribute;
- hsize_t dimsf[1]; /* dataset dimensions */
-
- /* data declarations */
- int data; /* data to write */
- int buffer, ret, i;
-
- ttsafe_name_data_t *attrib_data;
-
- /*
- * Create an HDF5 file using H5F_ACC_TRUNC access, default file
- * creation plist and default file access plist
- */
- file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
-
- /* create a simple dataspace for the dataset */
- dimsf[0] = 1;
- dataspace = H5Screate_simple(1, dimsf, NULL);
-
- /* define datatype for the data using native little endian integers */
- datatype = H5Tcopy(H5T_NATIVE_INT);
- H5Tset_order(datatype, H5T_ORDER_LE);
-
- /* create a new dataset within the file */
- dataset = H5Dcreate(file, DATASETNAME, datatype, dataspace,
- H5P_DEFAULT);
-
- /* initialize data for dataset and write value to dataset */
- data = NUM_THREADS;
- H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, &data);
-
- /*
- * Simultaneously create a large number of attributes to be associated
- * with the dataset
- */
- for (i = 0; i < NUM_THREADS; i++) {
- attrib_data = malloc(sizeof(ttsafe_name_data_t));
- attrib_data->dataset = dataset;
- attrib_data->datatype = datatype;
- attrib_data->dataspace = dataspace;
- attrib_data->current_index = i;
- pthread_create(&threads[i], NULL, tts_acreate_thread,
- attrib_data);
- }
-
- for (i = 0; i < NUM_THREADS; i++)
- pthread_join(threads[i], NULL);
-
- /* verify the correctness of the test */
- for (i = 0; i < NUM_THREADS; i++) {
- attribute = H5Aopen_name(dataset,gen_name(i));
-
- if (attribute < 0) {
- TestErrPrintf(
- "unable to open appropriate attribute. "
- "Test failed!\n");
- } else {
- ret = H5Aread(attribute, H5T_NATIVE_INT, &buffer);
-
- if (ret < 0 || buffer != i) {
- TestErrPrintf("wrong data values. Test failed!\n");
- }
-
- H5Aclose(attribute);
- }
- }
-
- /* close remaining resources */
- H5Sclose(dataspace);
- H5Tclose(datatype);
- H5Dclose(dataset);
- H5Fclose(file);
+ /* Pthread declarations */
+ pthread_t threads[NUM_THREADS];
+
+ /* HDF5 data declarations */
+ hid_t file, dataset;
+ hid_t dataspace, datatype;
+ hid_t attribute;
+ hsize_t dimsf[1]; /* dataset dimensions */
+
+ /* data declarations */
+ int data; /* data to write */
+ int buffer, ret, i;
+
+ ttsafe_name_data_t *attrib_data;
+
+ /*
+ * Create an HDF5 file using H5F_ACC_TRUNC access, default file
+ * creation plist and default file access plist
+ */
+ file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+
+ /* create a simple dataspace for the dataset */
+ dimsf[0] = 1;
+ dataspace = H5Screate_simple(1, dimsf, NULL);
+
+ /* define datatype for the data using native little endian integers */
+ datatype = H5Tcopy(H5T_NATIVE_INT);
+ H5Tset_order(datatype, H5T_ORDER_LE);
+
+ /* create a new dataset within the file */
+ dataset = H5Dcreate(file, DATASETNAME, datatype, dataspace, H5P_DEFAULT);
+
+ /* initialize data for dataset and write value to dataset */
+ data = NUM_THREADS;
+ H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
+ H5P_DEFAULT, &data);
+
+ /*
+ * Simultaneously create a large number of attributes to be associated
+ * with the dataset
+ */
+ for (i = 0; i < NUM_THREADS; i++) {
+ attrib_data = malloc(sizeof(ttsafe_name_data_t));
+ attrib_data->dataset = dataset;
+ attrib_data->datatype = datatype;
+ attrib_data->dataspace = dataspace;
+ attrib_data->current_index = i;
+ pthread_create(&threads[i], NULL, tts_acreate_thread, attrib_data);
+ }
+
+ for (i = 0; i < NUM_THREADS; i++)
+ pthread_join(threads[i], NULL);
+
+ /* verify the correctness of the test */
+ for (i = 0; i < NUM_THREADS; i++) {
+ attribute = H5Aopen_name(dataset,gen_name(i));
+
+ if (attribute < 0)
+ TestErrPrintf("unable to open appropriate attribute. Test failed!\n");
+ else {
+ ret = H5Aread(attribute, H5T_NATIVE_INT, &buffer);
+
+ if (ret < 0 || buffer != i)
+ TestErrPrintf("wrong data values. Test failed!\n");
+
+ H5Aclose(attribute);
+ }
+ }
+
+ /* close remaining resources */
+ H5Sclose(dataspace);
+ H5Tclose(datatype);
+ H5Dclose(dataset);
+ H5Fclose(file);
}
void *tts_acreate_thread(void *client_data)
{
- hid_t attribute;
- char *attribute_name;
- int *attribute_data; /* data for attributes */
-
- ttsafe_name_data_t *attrib_data;
-
- attrib_data = (ttsafe_name_data_t *)client_data;
-
- /* Create attribute */
- attribute_name = gen_name(attrib_data->current_index);
- attribute = H5Acreate(attrib_data->dataset, attribute_name,
- attrib_data->datatype, attrib_data->dataspace,
- H5P_DEFAULT);
-
- /* Write data to the attribute */
- attribute_data = malloc(sizeof(int));
- *attribute_data = attrib_data->current_index;
- H5Awrite(attribute, H5T_NATIVE_INT, attribute_data);
- H5Aclose(attribute);
- return NULL;
+ hid_t attribute;
+ char *attribute_name;
+ int *attribute_data; /* data for attributes */
+
+ ttsafe_name_data_t *attrib_data;
+
+ attrib_data = (ttsafe_name_data_t *)client_data;
+
+ /* Create attribute */
+ attribute_name = gen_name(attrib_data->current_index);
+ attribute = H5Acreate(attrib_data->dataset, attribute_name,
+ attrib_data->datatype, attrib_data->dataspace,
+ H5P_DEFAULT);
+
+ /* Write data to the attribute */
+ attribute_data = malloc(sizeof(int));
+ *attribute_data = attrib_data->current_index;
+ H5Awrite(attribute, H5T_NATIVE_INT, attribute_data);
+ H5Aclose(attribute);
+ return NULL;
}
void cleanup_acreate(void)
{
- HDunlink(FILENAME);
+ HDunlink(FILENAME);
}
#endif /*H5_HAVE_THREADSAFE*/
diff --git a/test/ttsafe_cancel.c b/test/ttsafe_cancel.c
index dd1f74a..052e970 100644
--- a/test/ttsafe_cancel.c
+++ b/test/ttsafe_cancel.c
@@ -40,7 +40,7 @@
*
* 19 May 2000, Bill Wendling
* Changed so that it creates its own HDF5 file and removes it at cleanup
- * time. Added num_errs flag.
+ * time.
*
********************************************************************/
#include "ttsafe.h"
@@ -52,7 +52,7 @@
void *tts_cancel_thread(void *);
void tts_cancel_barrier(void);
-herr_t tts_cancel_callback(void *, hid_t, hsize_t, hssize_t *, void *);
+herr_t tts_cancel_callback(void *, hid_t, unsigned, const hsize_t *, void *);
void cancellation_cleanup(void *);
hid_t cancel_file;
@@ -68,114 +68,104 @@ pthread_cond_t cond;
void tts_cancel(void)
{
- pthread_attr_t attribute;
- hid_t dataset;
- int buffer;
+ pthread_attr_t attribute;
+ hid_t dataset;
+ int buffer;
- /* make thread scheduling global */
- pthread_attr_init(&attribute);
+ /* make thread scheduling global */
+ pthread_attr_init(&attribute);
#ifdef H5_HAVE_SYSTEM_SCOPE_THREADS
- pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM);
+ pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM);
#endif /* H5_HAVE_SYSTEM_SCOPE_THREADS */
- /*
- * Create a hdf5 file using H5F_ACC_TRUNC access, default file
- * creation plist and default file access plist
- */
- cancel_file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- pthread_create(&childthread, &attribute, tts_cancel_thread, NULL);
- tts_cancel_barrier();
- pthread_cancel(childthread);
-
- dataset = H5Dopen(cancel_file, DATASETNAME);
- H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- &buffer);
-
- if (buffer != 11) {
- TestErrPrintf("operation unsuccessful with value at %d instead of 11\n",
- buffer);
- }
-
- H5Dclose(dataset);
- H5Fclose(cancel_file);
-
- /* Destroy the thread attribute */
- pthread_attr_destroy(&attribute);
+ /*
+ * Create a hdf5 file using H5F_ACC_TRUNC access, default file
+ * creation plist and default file access plist
+ */
+ cancel_file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ pthread_create(&childthread, &attribute, tts_cancel_thread, NULL);
+ tts_cancel_barrier();
+ pthread_cancel(childthread);
+
+ dataset = H5Dopen(cancel_file, DATASETNAME);
+ H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &buffer);
+
+ if (buffer != 11)
+ TestErrPrintf("operation unsuccessful with value at %d instead of 11\n", buffer);
+
+ H5Dclose(dataset);
+ H5Fclose(cancel_file);
+
+ /* Destroy the thread attribute */
+ pthread_attr_destroy(&attribute);
}
void *tts_cancel_thread(void UNUSED *arg)
{
- int datavalue;
- int *buffer;
- hid_t dataspace, datatype, dataset;
- hsize_t dimsf[1]; /* dataset dimensions */
- cancel_cleanup_t *cleanup_structure;
-
- /* define dataspace for dataset */
- dimsf[0] = 1;
- dataspace = H5Screate_simple(1,dimsf,NULL);
-
- /* define datatype for the data using native little endian integers */
- datatype = H5Tcopy(H5T_NATIVE_INT);
- H5Tset_order(datatype, H5T_ORDER_LE);
-
- /* create a new dataset within the file */
- dataset = H5Dcreate(cancel_file, DATASETNAME, datatype, dataspace,
- H5P_DEFAULT);
-
- /* If thread is cancelled, make cleanup call */
- cleanup_structure = (cancel_cleanup_t*)malloc(sizeof(cancel_cleanup_t));
- cleanup_structure->dataset = dataset;
- cleanup_structure->datatype = datatype;
- cleanup_structure->dataspace = dataspace;
- pthread_cleanup_push(cancellation_cleanup, cleanup_structure);
-
- datavalue = 1;
- H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- &datavalue);
-
- buffer = malloc(sizeof(int));
- H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- buffer);
- H5Diterate(buffer, H5T_NATIVE_INT, dataspace, tts_cancel_callback,
- &dataset);
-
- sleep(3);
-
- datavalue = 100;
- H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- &datavalue);
- H5Dclose(dataset);
- H5Tclose(datatype);
- H5Sclose(dataspace);
-
- /*
- * Required by pthreads. The argument 0 pops the stack but does not
- * execute the cleanup routine.
- */
- pthread_cleanup_pop(0);
- return NULL;
+ int datavalue;
+ int *buffer;
+ hid_t dataspace, datatype, dataset;
+ hsize_t dimsf[1]; /* dataset dimensions */
+ cancel_cleanup_t *cleanup_structure;
+
+ /* define dataspace for dataset */
+ dimsf[0] = 1;
+ dataspace = H5Screate_simple(1,dimsf,NULL);
+
+ /* define datatype for the data using native little endian integers */
+ datatype = H5Tcopy(H5T_NATIVE_INT);
+ H5Tset_order(datatype, H5T_ORDER_LE);
+
+ /* create a new dataset within the file */
+ dataset = H5Dcreate(cancel_file, DATASETNAME, datatype, dataspace, H5P_DEFAULT);
+
+ /* If thread is cancelled, make cleanup call */
+ cleanup_structure = (cancel_cleanup_t*)malloc(sizeof(cancel_cleanup_t));
+ cleanup_structure->dataset = dataset;
+ cleanup_structure->datatype = datatype;
+ cleanup_structure->dataspace = dataspace;
+ pthread_cleanup_push(cancellation_cleanup, cleanup_structure);
+
+ datavalue = 1;
+ H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &datavalue);
+
+ buffer = malloc(sizeof(int));
+ H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buffer);
+ H5Diterate(buffer, H5T_NATIVE_INT, dataspace, tts_cancel_callback, &dataset);
+
+ sleep(3);
+
+ datavalue = 100;
+ H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &datavalue);
+ H5Dclose(dataset);
+ H5Tclose(datatype);
+ H5Sclose(dataspace);
+
+ /*
+ * Required by pthreads. The argument 0 pops the stack but does not
+ * execute the cleanup routine.
+ */
+ pthread_cleanup_pop(0);
+ return NULL;
}
-herr_t tts_cancel_callback(void *elem, hid_t UNUSED type_id, hsize_t UNUSED ndim,
- hssize_t UNUSED *point, void *operator_data)
+herr_t tts_cancel_callback(void *elem, hid_t UNUSED type_id, unsigned UNUSED ndim,
+ const hsize_t UNUSED *point, void *operator_data)
{
- int value = *(int *)elem;
- hid_t dataset = *(hid_t *)operator_data;
-
- tts_cancel_barrier();
- sleep(3);
-
- if (value != 1) {
- TestErrPrintf("Error! Element value should be 1 and not %d\n",
- value);
- return -1;
- }
-
- value += 10;
- H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT,
- &value);
- return 0;
+ int value = *(int *)elem;
+ hid_t dataset = *(hid_t *)operator_data;
+
+ tts_cancel_barrier();
+ sleep(3);
+
+ if (value != 1) {
+ TestErrPrintf("Error! Element value should be 1 and not %d\n", value);
+ return -1;
+ }
+
+ value += 10;
+ H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &value);
+ return 0;
}
/*
@@ -184,13 +174,13 @@ herr_t tts_cancel_callback(void *elem, hid_t UNUSED type_id, hsize_t UNUSED ndim
*/
void cancellation_cleanup(void *arg)
{
- cancel_cleanup_t *cleanup_structure = (cancel_cleanup_t *)arg;
- H5Dclose(cleanup_structure->dataset);
- H5Tclose(cleanup_structure->datatype);
- H5Sclose(cleanup_structure->dataspace);
+ cancel_cleanup_t *cleanup_structure = (cancel_cleanup_t *)arg;
+ H5Dclose(cleanup_structure->dataset);
+ H5Tclose(cleanup_structure->datatype);
+ H5Sclose(cleanup_structure->dataspace);
- /* retained for debugging */
- /* print_func("cancellation noted, cleaning up ... \n"); */
+ /* retained for debugging */
+ /* print_func("cancellation noted, cleaning up ... \n"); */
}
/*
@@ -199,18 +189,18 @@ void cancellation_cleanup(void *arg)
*/
void tts_cancel_barrier(void)
{
- static int count = 2;
+ static int count = 2;
- pthread_mutex_lock(&mutex);
+ pthread_mutex_lock(&mutex);
- if (count != 1) {
- count--;
- pthread_cond_wait(&cond, &mutex);
- } else {
- pthread_cond_signal(&cond);
- }
+ if (count != 1) {
+ count--;
+ pthread_cond_wait(&cond, &mutex);
+ } else {
+ pthread_cond_signal(&cond);
+ }
- pthread_mutex_unlock(&mutex);
+ pthread_mutex_unlock(&mutex);
}
void cleanup_cancel(void)
diff --git a/test/ttsafe_dcreate.c b/test/ttsafe_dcreate.c
index f7552c6..8a4b38c 100644
--- a/test/ttsafe_dcreate.c
+++ b/test/ttsafe_dcreate.c
@@ -36,7 +36,7 @@
*
* 19 May 2000, Bill Wendling
* Changed so that it creates its own HDF5 file and removes it at cleanup
- * time. Added num_errs flag.
+ * time.
*
********************************************************************/
#include "ttsafe.h"
diff --git a/test/ttsafe_error.c b/test/ttsafe_error.c
index 4b3444e..07d9e7d 100644
--- a/test/ttsafe_error.c
+++ b/test/ttsafe_error.c
@@ -39,8 +39,7 @@
*
* 19 May 2000, Bill Wendling
* Modified so that it creates a unique HDF5 file and removes it on
- * cleanup. Also added the num_errs flag and increment it when necessary
- * to report the errors.
+ * cleanup.
*
********************************************************************/
#include "ttsafe.h"
@@ -84,130 +83,122 @@ pthread_mutex_t error_mutex;
void tts_error(void)
{
- pthread_t threads[NUM_THREAD];
- pthread_attr_t attribute;
- H5E_auto_t old_error_cb;
- void *old_error_client_data;
- hid_t dataset;
- int value, i;
+ pthread_t threads[NUM_THREAD];
+ pthread_attr_t attribute;
+ hid_t dataset;
+ int value, i;
- /* set up mutex for global count of errors */
- pthread_mutex_init(&error_mutex, NULL);
+ /* set up mutex for global count of errors */
+ pthread_mutex_init(&error_mutex, NULL);
- /* preserve previous error stack handler */
- H5Eget_auto(&old_error_cb, &old_error_client_data);
-
- /* set our own auto error stack handler */
- H5Eset_auto(error_callback, NULL);
-
- /* make thread scheduling global */
- pthread_attr_init(&attribute);
+ /* make thread scheduling global */
+ pthread_attr_init(&attribute);
#ifdef H5_HAVE_SYSTEM_SCOPE_THREADS
- pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM);
+ pthread_attr_setscope(&attribute, PTHREAD_SCOPE_SYSTEM);
#endif /* H5_HAVE_SYSTEM_SCOPE_THREADS */
- /*
- * Create a hdf5 file using H5F_ACC_TRUNC access, default file
- * creation plist and default file access plist
- */
- error_file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
+ /*
+ * Create a hdf5 file using H5F_ACC_TRUNC access, default file
+ * creation plist and default file access plist
+ */
+ error_file = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT);
- for (i = 0; i < NUM_THREAD; i++)
- pthread_create(&threads[i], &attribute, tts_error_thread, NULL);
+ for (i = 0; i < NUM_THREAD; i++)
+ pthread_create(&threads[i], &attribute, tts_error_thread, NULL);
- for (i = 0; i < NUM_THREAD; i++)
- pthread_join(threads[i],NULL);
+ for (i = 0; i < NUM_THREAD; i++)
+ pthread_join(threads[i],NULL);
- if (error_flag) {
- TestErrPrintf("Threads reporting different error values!\n");
- }
+ if (error_flag)
+ TestErrPrintf("Threads reporting different error values!\n");
- if (error_count != NUM_THREAD - 1) {
- TestErrPrintf("Error: %d threads failed instead of %d\n",
- error_count, NUM_THREAD-1);
- }
+ if (error_count != NUM_THREAD - 1)
+ TestErrPrintf("Error: %d threads failed instead of %d\n", error_count, NUM_THREAD-1);
- dataset = H5Dopen(error_file, DATASETNAME);
- H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &value);
+ dataset = H5Dopen(error_file, DATASETNAME);
+ H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &value);
- if (value != WRITE_NUMBER) {
- TestErrPrintf("Error: Successful thread wrote value %d instead of %d\n",
- value, WRITE_NUMBER);
- }
+ if (value != WRITE_NUMBER)
+ TestErrPrintf("Error: Successful thread wrote value %d instead of %d\n", value, WRITE_NUMBER);
- H5Dclose(dataset);
- H5Fclose(error_file);
+ H5Dclose(dataset);
+ H5Fclose(error_file);
- /* turn our error stack handler off */
- H5Eset_auto(old_error_cb, old_error_client_data);
-
- /* Destroy the thread attribute */
- pthread_attr_destroy(&attribute);
+ /* Destroy the thread attribute */
+ pthread_attr_destroy(&attribute);
}
static
-void *tts_error_thread(void *arg)
+void *tts_error_thread(void UNUSED *arg)
{
- hid_t dataspace, datatype, dataset;
- hsize_t dimsf[1]; /* dataset dimensions */
- int value;
-
- /* define dataspace for dataset */
- dimsf[0] = 1;
- dataspace = H5Screate_simple(1,dimsf,NULL);
-
- /* define datatype for the data using native little endian integers */
- datatype = H5Tcopy(H5T_NATIVE_INT);
- H5Tset_order(datatype, H5T_ORDER_LE);
-
- /* create a new dataset within the file */
- dataset = H5Dcreate(error_file, DATASETNAME, datatype, dataspace,
- H5P_DEFAULT);
- if (dataset >= 0) { /* not an error */
- value = WRITE_NUMBER;
- H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL,
- H5P_DEFAULT, &value);
- H5Dclose(dataset);
- }
-
- H5Tclose(datatype);
- H5Sclose(dataspace);
- arg = arg; /* gets rid of annoying warning message */
- return NULL;
+ hid_t dataspace, datatype, dataset;
+ hsize_t dimsf[1]; /* dataset dimensions */
+ H5E_auto_t old_error_cb;
+ void *old_error_client_data;
+ int value;
+
+ /* preserve previous error stack handler */
+ H5Eget_auto(&old_error_cb, &old_error_client_data);
+
+ /* set each thread's error stack handler */
+ H5Eset_auto(error_callback, NULL);
+
+ /* define dataspace for dataset */
+ dimsf[0] = 1;
+ dataspace = H5Screate_simple(1,dimsf,NULL);
+
+ /* define datatype for the data using native little endian integers */
+ datatype = H5Tcopy(H5T_NATIVE_INT);
+ H5Tset_order(datatype, H5T_ORDER_LE);
+
+ /* create a new dataset within the file */
+ dataset = H5Dcreate(error_file, DATASETNAME, datatype, dataspace, H5P_DEFAULT);
+ if (dataset >= 0) { /* not an error */
+ value = WRITE_NUMBER;
+ H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &value);
+ H5Dclose(dataset);
+ }
+
+ H5Tclose(datatype);
+ H5Sclose(dataspace);
+
+ /* turn our error stack handler off */
+ H5Eset_auto(old_error_cb, old_error_client_data);
+
+ return NULL;
}
static
herr_t error_callback(void *client_data)
{
- pthread_mutex_lock(&error_mutex);
- error_count++;
- pthread_mutex_unlock(&error_mutex);
- client_data = client_data; /* gets rid of annoying warning message */
- return H5Ewalk(H5E_WALK_DOWNWARD, walk_error_callback, NULL);
+ pthread_mutex_lock(&error_mutex);
+ error_count++;
+ pthread_mutex_unlock(&error_mutex);
+
+ return H5Ewalk(H5E_WALK_DOWNWARD, walk_error_callback, client_data);
}
static
-herr_t walk_error_callback(int n, H5E_error_t *err_desc, void *client_data)
+herr_t walk_error_callback(int n, H5E_error_t *err_desc, void UNUSED *client_data)
{
- int maj_num, min_num;
-
- 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;
- }
-
- error_flag = -1;
- client_data = client_data; /* gets rid of annoying warning message */
- return SUCCEED;
+ int maj_num, min_num;
+
+ 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;
+ }
+
+ error_flag = -1;
+ return SUCCEED;
}
void cleanup_error(void)
{
- HDunlink(FILENAME);
+ HDunlink(FILENAME);
}
#endif /*H5_HAVE_THREADSAFE*/
diff --git a/test/ttst.c b/test/ttst.c
index 517c9b6..5663050 100644
--- a/test/ttst.c
+++ b/test/ttst.c
@@ -60,7 +60,7 @@ char **sort_uniq_words;
static int tst_strcmp(const void *_s1, const void *_s2)
{
- return(HDstrcmp(*(const char **)_s1,*(const char **)_s2));
+ return(HDstrcmp(*(const char * const *)_s1,*(const char * const *)_s2));
}
/****************************************************************
@@ -73,7 +73,7 @@ static void
test_tst_init(void)
{
time_t curr_time; /* Current time, for seeding random number generator */
- char *tmp_word=NULL;/* Temporary pointer to word in word set */
+ char *tmp_word;/* Temporary pointer to word in word set */
size_t u,v,w; /* Local index variables */
/* Compute the number of words in the test set */
@@ -208,16 +208,14 @@ test_tst_insert(void)
found=H5ST_find(tree,uniq_words[u]);
CHECK(found, NULL, "H5ST_find");
- if(HDstrcmp((const char *)found->eqkid,uniq_words[u])) {
+ if(HDstrcmp((const char *)found->eqkid,uniq_words[u]))
TestErrPrintf("%d: TST node values don't match!, found->eqkid=%s, uniq_words[%u]=%s\n",__LINE__,(char *)found->eqkid,(unsigned)u,uniq_words[u]);
- } /* end if */
obj=H5ST_locate(tree,uniq_words[u]);
CHECK(obj, NULL, "H5ST_locate");
- if(HDstrcmp((const char *)obj,uniq_words[u])) {
+ if(HDstrcmp((const char *)obj,uniq_words[u]))
TestErrPrintf("%d: TST objects don't match!, obj=%s, uniq_words[%u]=%s\n",__LINE__,(char *)obj,(unsigned)u,uniq_words[u]);
- } /* end if */
} /* end for */
/* Verify that words not in the TST aren't found */
@@ -266,9 +264,8 @@ test_tst_iterate(void)
u=0;
do {
/* Check that the strings in the TST are in the correct order */
- if(HDstrcmp((const char *)found->eqkid,sort_uniq_words[u])) {
+ if(HDstrcmp((const char *)found->eqkid,sort_uniq_words[u]))
TestErrPrintf("%d: TST node values don't match!, found->eqkid=%s, sort_uniq_words[%u]=%s\n",__LINE__,(char *)found->eqkid,(unsigned)u,sort_uniq_words[u]);
- } /* end if */
/* Advance to next string in TST */
found=H5ST_findnext(found);
@@ -315,9 +312,8 @@ test_tst_remove(void)
CHECK(obj, NULL, "H5ST_remove");
/* Check that the correct string was removed from TST */
- if(HDstrcmp((const char *)obj,rand_uniq_words[u])) {
+ if(HDstrcmp((const char *)obj,rand_uniq_words[u]))
TestErrPrintf("%d: TST node values don't match!, obj=%s, rand_uniq_words[%u]=%s\n",__LINE__,(char *)obj,(unsigned)u,rand_uniq_words[u]);
- } /* end if */
/* Check that the string can't be found in the TST any longer */
check=H5ST_search(tree,rand_uniq_words[u]);
@@ -337,9 +333,8 @@ test_tst_remove(void)
CHECK(found, NULL, "H5ST_find");
/* Check that the correct object will be removed from TST */
- if(HDstrcmp((const char *)found->eqkid,rand_uniq_words[u])) {
+ if(HDstrcmp((const char *)found->eqkid,rand_uniq_words[u]))
TestErrPrintf("%d: TST node values don't match!, found->eqkid=%s, rand_uniq_words[%u]=%s\n",__LINE__,(char *)found->eqkid,(unsigned)u,rand_uniq_words[u]);
- } /* end if */
/* Remove the node */
ret=H5ST_delete(tree,found);
diff --git a/test/tvlstr.c b/test/tvlstr.c
index 60773f1..52d883b 100644
--- a/test/tvlstr.c
+++ b/test/tvlstr.c
@@ -12,8 +12,6 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* $Id$ */
-
/***********************************************************
*
* Test program: tvlstr
@@ -195,7 +193,7 @@ test_vlstrings_basic(void)
/* Count the actual number of bytes used by the strings */
for(i=0,str_used=0; i<SPACE1_DIM1; i++)
- str_used+=strlen(wdata[i])+1;
+ str_used+=HDstrlen(wdata[i])+1;
/* Compare against the strings actually written */
VERIFY(size,(hsize_t)str_used,"H5Dvlen_get_buf_size");
@@ -209,11 +207,11 @@ test_vlstrings_basic(void)
/* Compare data read in */
for(i=0; i<SPACE1_DIM1; i++) {
- if(strlen(wdata[i])!=strlen(rdata[i])) {
+ if(HDstrlen(wdata[i])!=strlen(rdata[i])) {
TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)strlen(rdata[i]));
continue;
} /* end if */
- if( strcmp(wdata[i],rdata[i]) != 0 ) {
+ if( HDstrcmp(wdata[i],rdata[i]) != 0 ) {
TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n",(int)i,wdata[i],(int)i,rdata[i]);
continue;
} /* end if */
@@ -297,11 +295,9 @@ test_vlstrings_special(void)
CHECK(ret, FAIL, "H5Dread");
/* Check data read in */
- for(i=0; i<SPACE1_DIM1; i++) {
- if(rdata[i]!=NULL) {
+ for(i=0; i<SPACE1_DIM1; i++)
+ if(rdata[i]!=NULL)
TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n",(int)i,rdata[i]);
- } /* end if */
- } /* end for */
/* Write dataset to disk */
ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata);
@@ -313,11 +309,11 @@ test_vlstrings_special(void)
/* Compare data read in */
for(i=0; i<SPACE1_DIM1; i++) {
- if(strlen(wdata[i])!=strlen(rdata[i])) {
+ if(HDstrlen(wdata[i])!=strlen(rdata[i])) {
TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)strlen(rdata[i]));
continue;
} /* end if */
- if( strcmp(wdata[i],rdata[i]) != 0 ) {
+ if( HDstrcmp(wdata[i],rdata[i]) != 0 ) {
TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n",(int)i,wdata[i],(int)i,rdata[i]);
continue;
} /* end if */
@@ -352,11 +348,9 @@ test_vlstrings_special(void)
CHECK(ret, FAIL, "H5Dread");
/* Check data read in */
- for(i=0; i<SPACE1_DIM1; i++) {
- if(rdata[i]!=NULL) {
+ for(i=0; i<SPACE1_DIM1; i++)
+ if(rdata[i]!=NULL)
TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n",(int)i,rdata[i]);
- } /* end if */
- } /* end for */
/* Try to write nil strings to disk. */
ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata2);
@@ -367,11 +361,9 @@ test_vlstrings_special(void)
CHECK(ret, FAIL, "H5Dread");
/* Check data read in */
- for(i=0; i<SPACE1_DIM1; i++) {
- if(rdata[i]!=NULL) {
+ for(i=0; i<SPACE1_DIM1; i++)
+ if(rdata[i]!=NULL)
TestErrPrintf("VL doesn't match!, rdata[%d]=%p\n",(int)i,rdata[i]);
- } /* end if */
- } /* end for */
/* Close Dataset */
ret = H5Dclose(dataset);
@@ -534,11 +526,11 @@ test_compact_vlstring(void)
/* Compare data read in */
for(i=0; i<SPACE1_DIM1; i++) {
- if(strlen(wdata[i])!=strlen(rdata[i])) {
+ if(HDstrlen(wdata[i])!=strlen(rdata[i])) {
TestErrPrintf("VL data length don't match!, strlen(wdata[%d])=%d, strlen(rdata[%d])=%d\n",(int)i,(int)strlen(wdata[i]),(int)i,(int)strlen(rdata[i]));
continue;
} /* end if */
- if( strcmp(wdata[i],rdata[i]) != 0 ) {
+ if( HDstrcmp(wdata[i],rdata[i]) != 0 ) {
TestErrPrintf("VL data values don't match!, wdata[%d]=%s, rdata[%d]=%s\n",(int)i,wdata[i],(int)i,rdata[i]);
continue;
} /* end if */
@@ -609,9 +601,8 @@ static void test_write_vl_string_attribute(void)
ret = H5Aread(att, type, &string_att_check);
CHECK(ret, FAIL, "H5Aread");
- if(HDstrcmp(string_att_check,string_att)!=0) {
+ if(HDstrcmp(string_att_check,string_att)!=0)
TestErrPrintf("VL string attributes don't match!, string_att=%s, string_att_check=%s\n",string_att,string_att_check);
- } /* end if */
HDfree(string_att_check);
@@ -631,9 +622,8 @@ static void test_write_vl_string_attribute(void)
ret = H5Aread(att, type, &string_att_check);
CHECK(ret, FAIL, "H5Aread");
- if(HDstrcmp(string_att_check,string_att_write)!=0) {
+ if(HDstrcmp(string_att_check,string_att_write)!=0)
TestErrPrintf("VL string attributes don't match!, string_att_write=%s, string_att_check=%s\n",string_att_write,string_att_check);
- } /* end if */
HDfree(string_att_check);
/* The attribute string written is freed below, in the test_read_vl_string_attribute() test */
@@ -691,9 +681,8 @@ static void test_read_vl_string_attribute(void)
ret = H5Aread(att, type, &string_att_check);
CHECK(ret, FAIL, "H5Aread");
- if(HDstrcmp(string_att_check,string_att)!=0) {
+ if(HDstrcmp(string_att_check,string_att)!=0)
TestErrPrintf("VL string attributes don't match!, string_att=%s, string_att_check=%s\n",string_att,string_att_check);
- } /* end if */
HDfree(string_att_check);
@@ -707,9 +696,8 @@ static void test_read_vl_string_attribute(void)
ret = H5Aread(att, type, &string_att_check);
CHECK(ret, FAIL, "H5Aread");
- if(HDstrcmp(string_att_check,string_att_write)!=0) {
+ if(HDstrcmp(string_att_check,string_att_write)!=0)
TestErrPrintf("VL string attributes don't match!, string_att_write=%s, string_att_check=%s\n",string_att_write,string_att_check);
- } /* end if */
HDfree(string_att_check);
HDfree(string_att_write); /* Free string allocated in test_write_vl_string_attribute */
@@ -861,7 +849,7 @@ test_vlstrings(void)
/* Output message about test being performed */
MESSAGE(5, ("Testing Variable-Length Strings\n"));
-/* These tests use the same file */
+ /* These tests use the same file */
/* Test basic VL string datatype */
test_vlstrings_basic();
test_vlstrings_special();
diff --git a/test/tvltypes.c b/test/tvltypes.c
index f2f95de..f510230 100644
--- a/test/tvltypes.c
+++ b/test/tvltypes.c
@@ -12,8 +12,6 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-/* $Id$ */
-
/***********************************************************
*
* Test program: tvltypes
@@ -177,25 +175,25 @@ test_vltypes_vlen_atomic(void)
hvl_t wdata2[SPACE1_DIM1]; /* Information to write */
hvl_t rdata[SPACE1_DIM1]; /* Information read in */
hvl_t fill; /* Fill value */
- hid_t fid1; /* HDF5 File IDs */
- hid_t dataset; /* Dataset ID */
- hid_t sid1; /* Dataspace ID */
- hid_t sid2; /* ID of bad dataspace (no extent set */
- hid_t tid1; /* Datatype ID */
- hid_t dcpl_pid; /* Dataset creation property list ID */
- hid_t xfer_pid; /* Dataset transfer property list ID */
- hsize_t dims1[] = {SPACE1_DIM1};
- hsize_t size; /* Number of bytes which will be used */
- unsigned i,j; /* counting variables */
- size_t mem_used=0; /* Memory used during allocation */
- herr_t ret; /* Generic return value */
+ hid_t fid1; /* HDF5 File IDs */
+ hid_t dataset; /* Dataset ID */
+ hid_t sid1; /* Dataspace ID */
+ hid_t sid2; /* ID of bad dataspace (no extent set) */
+ hid_t tid1; /* Datatype ID */
+ hid_t dcpl_pid; /* Dataset creation property list ID */
+ hid_t xfer_pid; /* Dataset transfer property list ID */
+ hsize_t dims1[] = {SPACE1_DIM1};
+ hsize_t size; /* Number of bytes which will be used */
+ unsigned i,j; /* counting variables */
+ size_t mem_used=0; /* Memory used during allocation */
+ herr_t ret; /* Generic return value */
/* Output message about test being performed */
MESSAGE(5, ("Testing Basic Atomic VL Datatype Functionality\n"));
/* Allocate and initialize VL data to write */
for(i=0; i<SPACE1_DIM1; i++) {
- wdata[i].p=malloc((i+1)*sizeof(unsigned int));
+ wdata[i].p=HDmalloc((i+1)*sizeof(unsigned int));
wdata[i].len=i+1;
for(j=0; j<(i+1); j++)
((unsigned int *)wdata[i].p)[j]=i*10+j;
@@ -225,11 +223,9 @@ test_vltypes_vlen_atomic(void)
CHECK(ret, FAIL, "H5Dread");
/* Check data read in */
- for(i=0; i<SPACE1_DIM1; i++) {
- if(rdata[i].len!=0 || rdata[i].p!=NULL) {
+ for(i=0; i<SPACE1_DIM1; i++)
+ if(rdata[i].len!=0 || rdata[i].p!=NULL)
TestErrPrintf("VL doesn't match!, rdata[%d].len=%u, rdata[%d].p=%p\n",(int)i,(unsigned)rdata[i].len,(int)i,rdata[i].p);
- } /* end if */
- } /* end for */
/* Write "nil" data to disk */
ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata2);
@@ -240,11 +236,9 @@ test_vltypes_vlen_atomic(void)
CHECK(ret, FAIL, "H5Dread");
/* Check data read in */
- for(i=0; i<SPACE1_DIM1; i++) {
- if(rdata[i].len!=0 || rdata[i].p!=NULL) {
+ for(i=0; i<SPACE1_DIM1; i++)
+ if(rdata[i].len!=0 || rdata[i].p!=NULL)
TestErrPrintf("VL doesn't match!, rdata[%d].len=%u, rdata[%d].p=%p\n",(int)i,(unsigned)rdata[i].len,(int)i,rdata[i].p);
- } /* end if */
- } /* end for */
/* Write dataset to disk */
ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata);
@@ -276,11 +270,9 @@ test_vltypes_vlen_atomic(void)
CHECK(ret, FAIL, "H5Dread");
/* Check data read in */
- for(i=0; i<SPACE1_DIM1; i++) {
- if(rdata[i].len!=0 || rdata[i].p!=NULL) {
+ for(i=0; i<SPACE1_DIM1; i++)
+ if(rdata[i].len!=0 || rdata[i].p!=NULL)
TestErrPrintf("VL doesn't match!, rdata[%d].len=%u, rdata[%d].p=%p\n",(int)i,(unsigned)rdata[i].len,(int)i,rdata[i].p);
- } /* end if */
- } /* end for */
/* Write "nil" data to disk */
ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata2);
@@ -291,11 +283,9 @@ test_vltypes_vlen_atomic(void)
CHECK(ret, FAIL, "H5Dread");
/* Check data read in */
- for(i=0; i<SPACE1_DIM1; i++) {
- if(rdata[i].len!=0 || rdata[i].p!=NULL) {
+ for(i=0; i<SPACE1_DIM1; i++)
+ if(rdata[i].len!=0 || rdata[i].p!=NULL)
TestErrPrintf("VL doesn't match!, rdata[%d].len=%u, rdata[%d].p=%p\n",(int)i,(unsigned)rdata[i].len,(int)i,rdata[i].p);
- } /* end if */
- } /* end for */
/* Write data to disk */
ret=H5Dwrite(dataset,tid1,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata);
@@ -519,7 +509,7 @@ rewrite_vltypes_vlen_atomic(void)
/* Allocate and initialize VL data to write */
for(i=0; i<SPACE1_DIM1; i++) {
- wdata[i].p=malloc((i+increment)*sizeof(unsigned int));
+ wdata[i].p=HDmalloc((i+increment)*sizeof(unsigned int));
wdata[i].len=i+increment;
for(j=0; j<(i+increment); j++)
((unsigned int *)wdata[i].p)[j]=i*20+j;
@@ -680,7 +670,7 @@ test_vltypes_vlen_compound(void)
/* Allocate and initialize VL data to write */
for(i=0; i<SPACE1_DIM1; i++) {
- wdata[i].p=malloc((i+1)*sizeof(s1));
+ wdata[i].p=HDmalloc((i+1)*sizeof(s1));
wdata[i].len=i+1;
for(j=0; j<(i+1); j++) {
((s1 *)wdata[i].p)[j].i=i*10+j;
@@ -826,7 +816,7 @@ rewrite_vltypes_vlen_compound(void)
/* Allocate and initialize VL data to write */
for(i=0; i<SPACE1_DIM1; i++) {
- wdata[i].p=malloc((i+increment)*sizeof(s1));
+ wdata[i].p=HDmalloc((i+increment)*sizeof(s1));
wdata[i].len=i+increment;
for(j=0; j<(i+increment); j++) {
((s1 *)wdata[i].p)[j].i=i*40+j;
@@ -972,10 +962,10 @@ test_vltypes_compound_vlen_vlen(void)
for(i=0; i<SPACE3_DIM1; i++) {
wdata[i].i=i*10;
wdata[i].f=(float)((i*20)/3.0);
- wdata[i].v.p=malloc((i+L1_INCM)*sizeof(hvl_t));
+ wdata[i].v.p=HDmalloc((i+L1_INCM)*sizeof(hvl_t));
wdata[i].v.len=i+L1_INCM;
for(t1=(wdata[i].v).p,j=0; j<(i+L1_INCM); j++, t1++) {
- t1->p=malloc((j+L2_INCM)*sizeof(unsigned int));
+ t1->p=HDmalloc((j+L2_INCM)*sizeof(unsigned int));
t1->len=j+L2_INCM;
for(k=0; k<j+L2_INCM; k++)
((unsigned int*)t1->p)[k] = i*100 + j*10 + k;
@@ -1138,7 +1128,7 @@ test_vltypes_compound_vlen_atomic(void)
for(i=0; i<SPACE1_DIM1; i++) {
wdata[i].i=i*10;
wdata[i].f=(float)((i*20)/3.0);
- wdata[i].v.p=malloc((i+1)*sizeof(unsigned int));
+ wdata[i].v.p=HDmalloc((i+1)*sizeof(unsigned int));
wdata[i].v.len=i+1;
for(j=0; j<(i+1); j++)
((unsigned int *)wdata[i].v.p)[j]=i*10+j;
@@ -1252,11 +1242,9 @@ test_vltypes_compound_vlen_atomic(void)
CHECK(ret, FAIL, "H5Dread");
/* Check data read in */
- for(i=0; i<SPACE1_DIM1; i++) {
- if(rdata[i].i!=0 || rdata[i].f!=0.0 || rdata[i].v.len!=0 || rdata[i].v.p!=NULL) {
+ for(i=0; i<SPACE1_DIM1; i++)
+ if(rdata[i].i!=0 || rdata[i].f!=0.0 || rdata[i].v.len!=0 || rdata[i].v.p!=NULL)
TestErrPrintf("VL doesn't match!, rdata[%d].i=%d, rdata[%d].f=%f, rdata[%d].v.len=%u, rdata[%d].v.p=%p\n",(int)i,rdata[i].i,(int)i,rdata[i].f,(int)i,(unsigned)rdata[i].v.len,(int)i,rdata[i].v.p);
- } /* end if */
- } /* end for */
/* Write dataset to disk */
ret=H5Dwrite(dataset,tid2,H5S_ALL,H5S_ALL,H5P_DEFAULT,wdata);
@@ -1358,7 +1346,7 @@ rewrite_vltypes_compound_vlen_atomic(void)
for(i=0; i<SPACE1_DIM1; i++) {
wdata[i].i=i*40;
wdata[i].f=(float)((i*50)/3.0);
- wdata[i].v.p=malloc((i+increment)*sizeof(unsigned int));
+ wdata[i].v.p=HDmalloc((i+increment)*sizeof(unsigned int));
wdata[i].v.len=i+increment;
for(j=0; j<(i+increment); j++)
((unsigned int *)wdata[i].v.p)[j]=i*60+j;
@@ -1525,14 +1513,14 @@ test_vltypes_vlen_vlen_atomic(void)
/* Allocate and initialize VL data to write */
for(i=0; i<SPACE1_DIM1; i++) {
- wdata[i].p=malloc((i+1)*sizeof(hvl_t));
+ wdata[i].p=HDmalloc((i+1)*sizeof(hvl_t));
if(wdata[i].p==NULL) {
TestErrPrintf("Cannot allocate memory for VL data! i=%u\n",i);
return;
} /* end if */
wdata[i].len=i+1;
for(t1=wdata[i].p,j=0; j<(i+1); j++, t1++) {
- t1->p=malloc((j+1)*sizeof(unsigned int));
+ t1->p=HDmalloc((j+1)*sizeof(unsigned int));
if(t1->p==NULL) {
TestErrPrintf("Cannot allocate memory for VL data! i=%u, j=%u\n",i,j);
return;
@@ -1716,14 +1704,14 @@ rewrite_longer_vltypes_vlen_vlen_atomic(void)
/* Allocate and initialize VL data to write */
for(i=0; i<SPACE1_DIM1; i++) {
- wdata[i].p=malloc((i+increment)*sizeof(hvl_t));
+ wdata[i].p=HDmalloc((i+increment)*sizeof(hvl_t));
if(wdata[i].p==NULL) {
TestErrPrintf("Cannot allocate memory for VL data! i=%u\n",i);
return;
} /* end if */
wdata[i].len=i+increment;
for(t1=wdata[i].p,j=0; j<(i+increment); j++, t1++) {
- t1->p=malloc((j+1)*sizeof(unsigned int));
+ t1->p=HDmalloc((j+1)*sizeof(unsigned int));
if(t1->p==NULL) {
TestErrPrintf("Cannot allocate memory for VL data! i=%u, j=%u\n",i,j);
return;
@@ -1892,14 +1880,14 @@ rewrite_shorter_vltypes_vlen_vlen_atomic(void)
/* Allocate and initialize VL data to write */
for(i=0; i<SPACE1_DIM1; i++) {
- wdata[i].p=malloc((i+increment)*sizeof(hvl_t));
+ wdata[i].p=HDmalloc((i+increment)*sizeof(hvl_t));
if(wdata[i].p==NULL) {
TestErrPrintf("Cannot allocate memory for VL data! i=%u\n",i);
return;
} /* end if */
wdata[i].len=i+increment;
for(t1=wdata[i].p,j=0; j<(i+increment); j++, t1++) {
- t1->p=malloc((j+1)*sizeof(unsigned int));
+ t1->p=HDmalloc((j+1)*sizeof(unsigned int));
if(t1->p==NULL) {
TestErrPrintf("Cannot allocate memory for VL data! i=%u, j=%u\n",i,j);
return;
diff --git a/test/unlink.c b/test/unlink.c
index d0cfbaa..4888521 100644
--- a/test/unlink.c
+++ b/test/unlink.c
@@ -1899,7 +1899,7 @@ error:
static int
test_resurrect_datatype(void)
{
- hid_t file=-1, type=-1, fapl=-1, loc_id=-1;
+ hid_t file=-1, type=-1, fapl=-1;
char filename[1024];
TESTING("Resurrecting datatype after deletion");
@@ -2017,8 +2017,8 @@ error:
} H5E_END_TRY;
return 1;
} /* end test_resurrect_group() */
-
+
/*-------------------------------------------------------------------------
* Function: test_unlink_chunked_dataset
*
diff --git a/testpar/Makefile.in b/testpar/Makefile.in
index 20fbb5d..31850b6 100644
--- a/testpar/Makefile.in
+++ b/testpar/Makefile.in
@@ -43,7 +43,7 @@ MOSTLYCLEAN=MPItest.h5 Para*.h5 *.clog
DISTCLEAN=go Makefile testph5.sh
## Test source files
-TEST_PHDF5_SRC=testphdf5.c t_dset.c t_file.c t_mdset.c t_ph5basic.c t_coll_chunk.c
+TEST_PHDF5_SRC=testphdf5.c t_dset.c t_file.c t_mdset.c t_ph5basic.c t_coll_chunk.c t_span_tree.c
TEST_PHDF5_OBJ=$(TEST_PHDF5_SRC:.c=.lo)
TEST_SRC=t_mpi.c $(TEST_PHDF5_SRC)
TEST_OBJ=$(TEST_SRC:.c=.lo)
diff --git a/testpar/t_coll_chunk.c b/testpar/t_coll_chunk.c
index c7d4bef..3176741 100644
--- a/testpar/t_coll_chunk.c
+++ b/testpar/t_coll_chunk.c
@@ -23,18 +23,18 @@
*/
/* some commonly used routines for collective chunk IO tests*/
-static void ccslab_set(int mpi_rank,int mpi_size,hssize_t start[],hsize_t count[],
+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(hssize_t start[],hsize_t count[],
+static void ccdataset_fill(hsize_t start[],hsize_t count[],
hsize_t stride[],hsize_t block[],DATATYPE*dataset);
-static void ccdataset_print(hssize_t start[],hsize_t block[],DATATYPE*dataset);
+static void ccdataset_print(hsize_t start[],hsize_t block[],DATATYPE*dataset);
-static int ccdataset_vrfy(hssize_t start[], hsize_t count[], hsize_t stride[],
+static int ccdataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[],
hsize_t block[], DATATYPE *dataset, DATATYPE *original);
-static void coll_chunktest(char* filename,int chunk_factor,int select_factor);
+static void coll_chunktest(const char* filename,int chunk_factor,int select_factor);
/*-------------------------------------------------------------------------
* Function: coll_chunk1
@@ -56,8 +56,8 @@ void
coll_chunk1(void)
{
- char *filename;
- filename = (char *) GetTestParameters();
+ const char *filename;
+ filename = GetTestParameters();
coll_chunktest(filename,1,BYROW_CONT);
}
@@ -66,8 +66,8 @@ void
coll_chunk2(void)
{
- char *filename;
- filename = (char *) GetTestParameters();
+ const char *filename;
+ filename = GetTestParameters();
coll_chunktest(filename,1,BYROW_DISCONT);
}
@@ -77,11 +77,11 @@ void
coll_chunk3(void)
{
- char *filename;
+ const char *filename;
int mpi_size;
MPI_Comm comm = MPI_COMM_WORLD;
MPI_Comm_size(comm,&mpi_size);
- filename = (char *) GetTestParameters();
+ filename = GetTestParameters();
coll_chunktest(filename,mpi_size,BYROW_CONT);
}
@@ -90,17 +90,17 @@ void
coll_chunk4(void)
{
- char *filename;
+ const char *filename;
int mpi_size;
MPI_Comm comm = MPI_COMM_WORLD;
MPI_Comm_size(comm,&mpi_size);
- filename = (char *) GetTestParameters();
+ filename = GetTestParameters();
coll_chunktest(filename,mpi_size*2,BYROW_DISCONT);
}
static void
-coll_chunktest(char* filename,int chunk_factor,int select_factor) {
+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;
@@ -108,7 +108,7 @@ coll_chunktest(char* filename,int chunk_factor,int select_factor) {
int* data_array1 = NULL;
int* data_origin1 = NULL;
herr_t status;
- hssize_t start[RANK];
+ hsize_t start[RANK];
hsize_t count[RANK],stride[RANK],block[RANK];
#ifdef H5_HAVE_INSTRUMENTED_LIBRARY
unsigned prop_value;
@@ -320,7 +320,7 @@ coll_chunktest(char* filename,int chunk_factor,int select_factor) {
static void
-ccslab_set(int mpi_rank, int mpi_size, hssize_t start[], hsize_t count[],
+ccslab_set(int mpi_rank, int mpi_size, hsize_t start[], hsize_t count[],
hsize_t stride[], hsize_t block[], int mode)
{
switch (mode){
@@ -364,8 +364,8 @@ if (VERBOSE_MED) printf("slab_set wholeset\n");
break;
}
if (VERBOSE_MED){
- printf("start[]=(%ld,%ld), count[]=(%lu,%lu), stride[]=(%lu,%lu), block[]=(%lu,%lu), total datapoints=%lu\n",
- (long)start[0], (long)start[1], (unsigned long)count[0], (unsigned long)count[1],
+ printf("start[]=(%lu,%lu), count[]=(%lu,%lu), stride[]=(%lu,%lu), block[]=(%lu,%lu), total datapoints=%lu\n",
+ (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1],
(unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1],
(unsigned long)(block[0]*block[1]*count[0]*count[1]));
}
@@ -377,7 +377,7 @@ if (VERBOSE_MED){
* Assume dimension rank is 2 and data is stored contiguous.
*/
static void
-ccdataset_fill(hssize_t start[], hsize_t stride[], hsize_t count[], hsize_t block[], DATATYPE * dataset)
+ccdataset_fill(hsize_t start[], hsize_t stride[], hsize_t count[], hsize_t block[], DATATYPE * dataset)
{
DATATYPE *dataptr = dataset;
DATATYPE *tmptr;
@@ -408,7 +408,7 @@ ccdataset_fill(hssize_t start[], hsize_t stride[], hsize_t count[], hsize_t bloc
* Print the first block of the content of the dataset.
*/
static void
-ccdataset_print(hssize_t start[], hsize_t block[], DATATYPE * dataset)
+ccdataset_print(hsize_t start[], hsize_t block[], DATATYPE * dataset)
{
DATATYPE *dataptr = dataset;
hsize_t i, j;
@@ -417,13 +417,13 @@ ccdataset_print(hssize_t start[], hsize_t block[], DATATYPE * dataset)
printf("Print only the first block of the dataset\n");
printf("%-8s", "Cols:");
for (j=0; j < block[1]; j++){
- printf("%3ld ", (long)(start[1]+j));
+ printf("%3lu ", (unsigned long)(start[1]+j));
}
printf("\n");
/* print the slab data */
for (i=0; i < block[0]; i++){
- printf("Row %2ld: ", (long)(i+start[0]));
+ printf("Row %2lu: ", (unsigned long)(i+start[0]));
for (j=0; j < block[1]; j++){
printf("%03d ", *dataptr++);
}
@@ -436,7 +436,7 @@ ccdataset_print(hssize_t start[], hsize_t block[], DATATYPE * dataset)
* Print the content of the dataset.
*/
static int
-ccdataset_vrfy(hssize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[], DATATYPE *dataset, DATATYPE *original)
+ccdataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[], DATATYPE *dataset, DATATYPE *original)
{
hsize_t i, j,k1,k2;
int vrfyerrs;
@@ -445,8 +445,8 @@ ccdataset_vrfy(hssize_t start[], hsize_t count[], hsize_t stride[], hsize_t bloc
/* print it if VERBOSE_MED */
if (VERBOSE_MED) {
printf("dataset_vrfy dumping:::\n");
- printf("start(%ld, %ld), count(%lu, %lu), stride(%lu, %lu), block(%lu, %lu)\n",
- (long)start[0], (long)start[1], (unsigned long)count[0], (unsigned long)count[1],
+ printf("start(%lu, %lu), count(%lu, %lu), stride(%lu, %lu), block(%lu, %lu)\n",
+ (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1],
(unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1]);
printf("original values:\n");
ccdataset_print(start, block, original);
@@ -468,8 +468,8 @@ ccdataset_vrfy(hssize_t start[], hsize_t count[], hsize_t stride[], hsize_t bloc
if (*dataptr != *oriptr){
if (vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED){
- printf("Dataset Verify failed at [%ld][%ld]: expect %d, got %d\n",
- (long)i, (long)j,
+ printf("Dataset Verify failed at [%lu][%lu]: expect %d, got %d\n",
+ (unsigned long)i, (unsigned long)j,
*(original), *(dataset));
}
}
diff --git a/testpar/t_dset.c b/testpar/t_dset.c
index b45fdb3..962a6f4 100644
--- a/testpar/t_dset.c
+++ b/testpar/t_dset.c
@@ -43,7 +43,7 @@
* ZCOL same as BYCOL except process 0 gets 0 columns
*/
static void
-slab_set(int mpi_rank, int mpi_size, hssize_t start[], hsize_t count[],
+slab_set(int mpi_rank, int mpi_size, hsize_t start[], hsize_t count[],
hsize_t stride[], hsize_t block[], int mode)
{
switch (mode){
@@ -110,8 +110,8 @@ if (VERBOSE_MED) printf("slab_set wholeset\n");
break;
}
if (VERBOSE_MED){
- printf("start[]=(%ld,%ld), count[]=(%lu,%lu), stride[]=(%lu,%lu), block[]=(%lu,%lu), total datapoints=%lu\n",
- (long)start[0], (long)start[1], (unsigned long)count[0], (unsigned long)count[1],
+ printf("start[]=(%lu,%lu), count[]=(%lu,%lu), stride[]=(%lu,%lu), block[]=(%lu,%lu), total datapoints=%lu\n",
+ (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1],
(unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1],
(unsigned long)(block[0]*block[1]*count[0]*count[1]));
}
@@ -123,7 +123,7 @@ if (VERBOSE_MED){
* Assume dimension rank is 2 and data is stored contiguous.
*/
static void
-dataset_fill(hssize_t start[], hsize_t block[], DATATYPE * dataset)
+dataset_fill(hsize_t start[], hsize_t block[], DATATYPE * dataset)
{
DATATYPE *dataptr = dataset;
hsize_t i, j;
@@ -142,7 +142,7 @@ dataset_fill(hssize_t start[], hsize_t block[], DATATYPE * dataset)
* Print the content of the dataset.
*/
static void
-dataset_print(hssize_t start[], hsize_t block[], DATATYPE * dataset)
+dataset_print(hsize_t start[], hsize_t block[], DATATYPE * dataset)
{
DATATYPE *dataptr = dataset;
hsize_t i, j;
@@ -150,13 +150,13 @@ dataset_print(hssize_t start[], hsize_t block[], DATATYPE * dataset)
/* print the column heading */
printf("%-8s", "Cols:");
for (j=0; j < block[1]; j++){
- printf("%3ld ", (long)(start[1]+j));
+ printf("%3lu ", (unsigned long)(start[1]+j));
}
printf("\n");
/* print the slab data */
for (i=0; i < block[0]; i++){
- printf("Row %2ld: ", (long)(i+start[0]));
+ printf("Row %2lu: ", (unsigned long)(i+start[0]));
for (j=0; j < block[1]; j++){
printf("%03d ", *dataptr++);
}
@@ -168,7 +168,8 @@ dataset_print(hssize_t start[], hsize_t block[], DATATYPE * dataset)
/*
* Print the content of the dataset.
*/
-int dataset_vrfy(hssize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[], DATATYPE *dataset, DATATYPE *original)
+int
+dataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[], hsize_t block[], DATATYPE *dataset, DATATYPE *original)
{
hsize_t i, j;
int vrfyerrs;
@@ -176,8 +177,8 @@ int dataset_vrfy(hssize_t start[], hsize_t count[], hsize_t stride[], hsize_t bl
/* print it if VERBOSE_MED */
if (VERBOSE_MED) {
printf("dataset_vrfy dumping:::\n");
- printf("start(%ld, %ld), count(%lu, %lu), stride(%lu, %lu), block(%lu, %lu)\n",
- (long)start[0], (long)start[1], (unsigned long)count[0], (unsigned long)count[1],
+ printf("start(%lu, %lu), count(%lu, %lu), stride(%lu, %lu), block(%lu, %lu)\n",
+ (unsigned long)start[0], (unsigned long)start[1], (unsigned long)count[0], (unsigned long)count[1],
(unsigned long)stride[0], (unsigned long)stride[1], (unsigned long)block[0], (unsigned long)block[1]);
printf("original values:\n");
dataset_print(start, block, original);
@@ -190,9 +191,9 @@ int dataset_vrfy(hssize_t start[], hsize_t count[], hsize_t stride[], hsize_t bl
for (j=0; j < block[1]; j++){
if (*dataset != *original){
if (vrfyerrs++ < MAX_ERR_REPORT || VERBOSE_MED){
- printf("Dataset Verify failed at [%ld][%ld](row %ld, col %ld): expect %d, got %d\n",
- (long)i, (long)j,
- (long)(i+start[0]), (long)(j+start[1]),
+ 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+start[0]), (unsigned long)(j+start[1]),
*(original), *(dataset));
}
dataset++;
@@ -234,7 +235,7 @@ dataset_writeInd(void)
DATATYPE *data_array1 = NULL; /* data buffer */
const char *filename;
- hssize_t start[RANK]; /* for hyperslab setting */
+ hsize_t start[RANK]; /* for hyperslab setting */
hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
hsize_t block[RANK]; /* for hyperslab setting */
@@ -380,7 +381,7 @@ dataset_readInd(void)
DATATYPE *data_origin1 = NULL; /* expected data buffer */
const char *filename;
- hssize_t start[RANK]; /* for hyperslab setting */
+ hsize_t start[RANK]; /* for hyperslab setting */
hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
hsize_t block[RANK]; /* for hyperslab setting */
@@ -506,7 +507,7 @@ dataset_writeAll(void)
DATATYPE *data_array1 = NULL; /* data buffer */
const char *filename;
- hssize_t start[RANK]; /* for hyperslab setting */
+ hsize_t start[RANK]; /* for hyperslab setting */
hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
hsize_t block[RANK]; /* for hyperslab setting */
@@ -865,7 +866,7 @@ dataset_readAll(void)
DATATYPE *data_origin1 = NULL; /* expected data buffer */
const char *filename;
- hssize_t start[RANK]; /* for hyperslab setting */
+ hsize_t start[RANK]; /* for hyperslab setting */
hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
hsize_t block[RANK]; /* for hyperslab setting */
@@ -1092,7 +1093,7 @@ extend_writeInd(void)
hsize_t chunk_dims[RANK]; /* chunk sizes */
hid_t dataset_pl; /* dataset create prop. list */
- hssize_t start[RANK]; /* for hyperslab setting */
+ hsize_t start[RANK]; /* for hyperslab setting */
hsize_t count[RANK]; /* for hyperslab setting */
hsize_t stride[RANK]; /* for hyperslab setting */
hsize_t block[RANK]; /* for hyperslab setting */
@@ -1438,7 +1439,7 @@ extend_writeInd2(void)
printf("%s%d", i?", ":"", written[i]);
printf("\n");
}
- ret = H5Sselect_hyperslab(fs, H5S_SELECT_SET, (hssize_t *)&orig_size, NULL, &one, &orig_size);
+ ret = H5Sselect_hyperslab(fs, H5S_SELECT_SET, &orig_size, NULL, &one, &orig_size);
VRFY((ret >= 0), "H5Sselect_hyperslab succeeded");
ret = H5Dwrite(dataset, H5T_NATIVE_INT, ms, fs, H5P_DEFAULT, written);
VRFY((ret >= 0), "H5Dwrite succeeded");
@@ -1487,7 +1488,7 @@ extend_readInd(void)
DATATYPE *data_origin1 = NULL; /* expected data buffer */
const char *filename;
- hssize_t start[RANK]; /* for hyperslab setting */
+ hsize_t start[RANK]; /* for hyperslab setting */
hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
hsize_t block[RANK]; /* for hyperslab setting */
@@ -1670,7 +1671,7 @@ extend_writeAll(void)
hsize_t chunk_dims[RANK]; /* chunk sizes */
hid_t dataset_pl; /* dataset create prop. list */
- hssize_t start[RANK]; /* for hyperslab setting */
+ hsize_t start[RANK]; /* for hyperslab setting */
hsize_t count[RANK]; /* for hyperslab setting */
hsize_t stride[RANK]; /* for hyperslab setting */
hsize_t block[RANK]; /* for hyperslab setting */
@@ -1913,7 +1914,7 @@ extend_readAll(void)
DATATYPE *data_array2 = NULL; /* data buffer */
DATATYPE *data_origin1 = NULL; /* expected data buffer */
- hssize_t start[RANK]; /* for hyperslab setting */
+ hsize_t start[RANK]; /* for hyperslab setting */
hsize_t count[RANK], stride[RANK]; /* for hyperslab setting */
hsize_t block[RANK]; /* for hyperslab setting */
diff --git a/testpar/t_file.c b/testpar/t_file.c
index 6fcde32..7f703a5 100644
--- a/testpar/t_file.c
+++ b/testpar/t_file.c
@@ -41,9 +41,9 @@ test_split_comm_access(void)
hid_t acc_tpl; /* File access properties */
hbool_t use_gpfs = FALSE; /* Use GPFS hints */
herr_t ret; /* generic return value */
- char *filename;
+ const char *filename;
- filename = (char *) GetTestParameters();
+ filename = GetTestParameters();
if (VERBOSE_MED)
printf("Split Communicator access test on file %s\n",
filename);
@@ -82,9 +82,9 @@ test_split_comm_access(void)
ret=H5Fclose(fid);
VRFY((ret >= 0), "");
- /* detele the test file */
+ /* delete the test file */
if (sub_mpi_rank == 0){
- mrc = MPI_File_delete(filename, info);
+ mrc = MPI_File_delete((char *)filename, info);
/*VRFY((mrc==MPI_SUCCESS), ""); */
}
}
diff --git a/testpar/t_mdset.c b/testpar/t_mdset.c
index 191a1f8..d99cbc3 100644
--- a/testpar/t_mdset.c
+++ b/testpar/t_mdset.c
@@ -30,7 +30,7 @@ void group_dataset_read(hid_t fid, int mpi_rank, int m);
void write_attribute(hid_t, int, int);
int read_attribute(hid_t, int, int);
int check_value(DATATYPE *, DATATYPE *, int);
-void get_slab(hssize_t[], hsize_t[], hsize_t[], hsize_t[], int);
+void get_slab(hsize_t[], hsize_t[], hsize_t[], hsize_t[], int);
/*
@@ -87,18 +87,18 @@ void multiple_dset_write(void)
hid_t iof, plist, dataset, memspace, filespace;
hid_t dcpl; /* Dataset creation property list */
hbool_t use_gpfs = FALSE; /* Use GPFS hints */
- hssize_t chunk_origin [DIM];
+ hsize_t chunk_origin [DIM];
hsize_t chunk_dims [DIM], file_dims [DIM];
hsize_t count[DIM]={1,1};
double * outme = NULL;
double fill=1.0; /* Fill value */
char dname [100];
herr_t ret;
- H5Ptest_param_t *pt;
+ const H5Ptest_param_t *pt;
char *filename;
int ndatasets;
- pt = (H5Ptest_param_t *) GetTestParameters();
+ pt = GetTestParameters();
filename = pt->name;
ndatasets = pt->count;
@@ -180,7 +180,7 @@ void compact_dataset(void)
double * inme;
char dname[]="dataset";
herr_t ret;
- char *filename;
+ const char *filename;
size = get_size();
@@ -198,7 +198,7 @@ void compact_dataset(void)
inme = HDmalloc((size_t)(size * size * sizeof(double)));
VRFY((outme != NULL), "HDmalloc succeeded for inme");
- filename = (char *) GetTestParameters();
+ filename = GetTestParameters();
VRFY((mpi_size <= size), "mpi_size <= size");
plist = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs);
@@ -295,7 +295,7 @@ void big_dataset(void)
char dname[]="dataset"; /* Name of dataset */
MPI_Offset file_size; /* Size of file on disk */
herr_t ret; /* Generic return value */
- char *filename;
+ const char *filename;
MPI_Comm_rank (MPI_COMM_WORLD, &mpi_rank);
MPI_Comm_size (MPI_COMM_WORLD, &mpi_size);
@@ -303,7 +303,7 @@ void big_dataset(void)
/* Verify MPI_Offset can handle larger than 2GB sizes */
VRFY((sizeof(MPI_Offset)>4), "sizeof(MPI_Offset)>4");
- filename = (char *) GetTestParameters();
+ filename = GetTestParameters();
fapl = create_faccess_plist(MPI_COMM_WORLD, MPI_INFO_NULL, facc_type, use_gpfs);
VRFY((fapl >= 0), "create_faccess_plist succeeded");
@@ -427,19 +427,19 @@ void dataset_fillvalue(void)
filespace; /* Dataset's dataspace ID */
char dname[]="dataset"; /* Name of dataset */
hsize_t dset_dims[4] = {0, 6, 7, 8};
- hssize_t req_start[4] = {0, 0, 0, 0};
+ hsize_t req_start[4] = {0, 0, 0, 0};
hsize_t req_count[4] = {1, 6, 7, 8};
hsize_t dset_size; /* Dataset size */
int *rdata, *wdata; /* Buffers for data to read and write */
int *twdata, *trdata; /* Temporary pointer into buffer */
int acc, i, j, k, l; /* Local index variables */
herr_t ret; /* Generic return value */
- char *filename;
+ const char *filename;
MPI_Comm_rank (MPI_COMM_WORLD, &mpi_rank);
MPI_Comm_size (MPI_COMM_WORLD, &mpi_size);
- filename = (char *) GetTestParameters();
+ filename = GetTestParameters();
/* Set the dataset dimension to be one row more than number of processes */
/* and calculate the actual dataset size. */
@@ -607,15 +607,15 @@ void collective_group_write(void)
char gname[64], dname[32];
hid_t fid, gid, did, plist, dcpl, memspace, filespace;
DATATYPE * outme = NULL;
- hssize_t chunk_origin[DIM];
+ hsize_t chunk_origin[DIM];
hsize_t chunk_dims[DIM], file_dims[DIM], count[DIM];
hsize_t chunk_size[2]; /* Chunk dimensions - computed shortly */
herr_t ret1, ret2;
- H5Ptest_param_t *pt;
+ const H5Ptest_param_t *pt;
char *filename;
int ngroups;
- pt = (H5Ptest_param_t *) GetTestParameters();
+ pt = GetTestParameters();
filename = pt->name;
ngroups = pt->count;
@@ -700,11 +700,11 @@ void independent_group_read(void)
int mpi_rank, m;
hid_t plist, fid;
hbool_t use_gpfs = FALSE;
- H5Ptest_param_t *pt;
+ const H5Ptest_param_t *pt;
char *filename;
int ngroups;
- pt = (H5Ptest_param_t *) GetTestParameters();
+ pt = GetTestParameters();
filename = pt->name;
ngroups = pt->count;
@@ -824,14 +824,14 @@ void multiple_group_write(void)
hbool_t use_gpfs = FALSE;
char gname[64];
hid_t fid, gid, plist, memspace, filespace;
- hssize_t chunk_origin[DIM];
+ hsize_t chunk_origin[DIM];
hsize_t chunk_dims[DIM], file_dims[DIM], count[DIM];
herr_t ret;
- H5Ptest_param_t *pt;
+ const H5Ptest_param_t *pt;
char *filename;
int ngroups;
- pt = (H5Ptest_param_t *) GetTestParameters();
+ pt = GetTestParameters();
filename = pt->name;
ngroups = pt->count;
@@ -995,13 +995,13 @@ void multiple_group_read(void)
hbool_t use_gpfs = FALSE;
char gname[64];
hid_t plist, fid, gid, memspace, filespace;
- hssize_t chunk_origin[DIM];
+ hsize_t chunk_origin[DIM];
hsize_t chunk_dims[DIM], file_dims[DIM], count[DIM];
- H5Ptest_param_t *pt;
+ const H5Ptest_param_t *pt;
char *filename;
int ngroups;
- pt = (H5Ptest_param_t *) GetTestParameters();
+ pt = GetTestParameters();
filename = pt->name;
ngroups = pt->count;
@@ -1232,7 +1232,7 @@ int check_value(DATATYPE *indata, DATATYPE *outdata, int size)
{
int mpi_rank, mpi_size, err_num=0;
hsize_t i, j;
- hssize_t chunk_origin[DIM];
+ hsize_t chunk_origin[DIM];
hsize_t chunk_dims[DIM], count[DIM];
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
@@ -1246,7 +1246,7 @@ int check_value(DATATYPE *indata, DATATYPE *outdata, int size)
for(j=chunk_origin[1]; j<(chunk_origin[1]+chunk_dims[1]); j++) {
if( *indata != *outdata )
if(err_num++ < MAX_ERR_REPORT || VERBOSE_MED)
- printf("Dataset Verify failed at [%ld][%ld](row %ld, col%ld): expect %d, got %d\n", (long)i, (long)j, (long)i, (long)j, *outdata, *indata);
+ printf("Dataset Verify failed at [%lu][%lu](row %lu, col%lu): expect %d, got %d\n", (unsigned long)i, (unsigned long)j, (unsigned long)i, (unsigned long)j, *outdata, *indata);
}
if(err_num > MAX_ERR_REPORT && !VERBOSE_MED)
printf("[more errors ...]\n");
@@ -1264,7 +1264,7 @@ int check_value(DATATYPE *indata, DATATYPE *outdata, int size)
* JRM - 8/11/04
*/
-void get_slab(hssize_t chunk_origin[],
+void get_slab(hsize_t chunk_origin[],
hsize_t chunk_dims[],
hsize_t count[],
hsize_t file_dims[],
@@ -1326,13 +1326,12 @@ void io_mode_confusion(void)
/* identifiers */
hsize_t dimsf[1]; /* dataset dimensions */
int data[N] = {1}; /* pointer to data buffer to write */
- hssize_t select[N] = {0L,1L,2L,3L};
- hssize_t start[1];
- hsize_t stride[1];
- hsize_t count[1];
- hsize_t block[1];
+ hsize_t coord[N] = {0L,1L,2L,3L};
+ hsize_t start[1];
+ hsize_t stride[1];
+ hsize_t count[1];
+ hsize_t block[1];
hid_t plist_id; /* property list identifier */
- int i;
herr_t status;
@@ -1347,13 +1346,13 @@ void io_mode_confusion(void)
* test bed related variables
*/
- char * fcn_name = "io_mode_confusion";
+ const char * fcn_name = "io_mode_confusion";
const hbool_t verbose = FALSE;
- H5Ptest_param_t * pt;
+ const H5Ptest_param_t * pt;
char * filename;
- pt = (H5Ptest_param_t *) GetTestParameters();
+ pt = GetTestParameters();
filename = pt->name;
MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
@@ -1489,7 +1488,7 @@ void io_mode_confusion(void)
mpi_rank, fcn_name);
status = H5Sselect_elements(filespace, H5S_SELECT_SET, N,
- (const hssize_t **)&select);
+ (const hsize_t **)&coord);
VRFY(( status >= 0 ), "H5Sselect_elements() failed");
diff --git a/testpar/t_mpi.c b/testpar/t_mpi.c
index 71494d4..7b7a96b 100644
--- a/testpar/t_mpi.c
+++ b/testpar/t_mpi.c
@@ -37,10 +37,11 @@ int nerrors = 0;
hid_t fapl; /* file access property list */
/* protocols */
+static int errors_sum(int nerrs);
#define MPIO_TEST_WRITE_SIZE 1024*1024 /* 1 MB */
-int
+static int
test_mpio_overlap_writes(char *filename)
{
int mpi_size, mpi_rank;
@@ -186,7 +187,7 @@ test_mpio_overlap_writes(char *filename)
* Then reads the file back in by reverse order, that is process 0
* reads the data of process n-1 and vice versa.
*/
-int
+static int
test_mpio_gb_file(char *filename)
{
int mpi_size, mpi_rank;
@@ -407,7 +408,8 @@ finish:
#define USEFSYNC 2 /* request file_sync */
-int test_mpio_1wMr(char *filename, int special_request)
+static int
+test_mpio_1wMr(char *filename, int special_request)
{
char hostname[128];
int mpi_size, mpi_rank;
@@ -593,7 +595,7 @@ if (special_request & USEFSYNC){
/*
* parse the command line options
*/
-int
+static int
parse_options(int argc, char **argv)
{
while (--argc){
@@ -655,7 +657,7 @@ parse_options(int argc, char **argv)
/*
* Show command usage
*/
-void
+static void
usage(void)
{
printf("Usage: t_mpi [-v<verbosity>] [-f <prefix>]\n");
@@ -667,7 +669,8 @@ usage(void)
/*
* return the sum of all errors.
*/
-int errors_sum(nerrs)
+static int
+errors_sum(int nerrs)
{
int temp;
MPI_Allreduce(&nerrs, &temp, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c
index d8fb74b..8121c9b 100644
--- a/testpar/testphdf5.c
+++ b/testpar/testphdf5.c
@@ -438,6 +438,24 @@ int main(int argc, char **argv)
"collective to independent chunk io",PARATESTFILE);
}
+#ifdef KYANG
+ AddTest("ccontw",coll_irregular_cont_write,NULL,
+ "collective irregular contiguous write",PARATESTFILE);
+ AddTest("ccontr",coll_irregular_cont_read,NULL,
+ "collective irregular contiguous read",PARATESTFILE);
+
+ AddTest("cschunkw",coll_irregular_simple_chunk_write,NULL,
+ "collective irregular simple chunk write",PARATESTFILE);
+ AddTest("cschunkr",coll_irregular_simple_chunk_read,NULL,
+ "collective irregular simple chunk read",PARATESTFILE);
+
+ AddTest("ccchunkw",coll_irregular_complex_chunk_write,NULL,
+ "collective irregular complex chunk write",PARATESTFILE);
+
+ AddTest("ccchunkr",coll_irregular_complex_chunk_read,NULL,
+ "collective irregular complex chunk read",PARATESTFILE);
+#endif
+
io_mode_confusion_params.name = PARATESTFILE;
io_mode_confusion_params.count = 0; /* value not used */
@@ -455,14 +473,6 @@ int main(int argc, char **argv)
/* Parse command line arguments */
TestParseCmdLine(argc, argv);
- /*
- if (parse_options(argc, argv) != 0){
- if (MAINPROCESS)
- usage();
- goto finish;
- }
- */
-
if (facc_type == FACC_MPIPOSIX && MAINPROCESS){
printf("===================================\n"
" Using MPIPOSIX driver\n"
@@ -472,7 +482,6 @@ int main(int argc, char **argv)
/* Perform requested testing */
PerformTests();
-finish:
/* make sure all processes are finished before final report, cleanup
* and exit.
*/
diff --git a/testpar/testphdf5.h b/testpar/testphdf5.h
index a01c62e..9121ef3 100644
--- a/testpar/testphdf5.h
+++ b/testpar/testphdf5.h
@@ -119,6 +119,100 @@
#define BYROW_DISCONT 2
#define DSET_COLLECTIVE_CHUNK_NAME "coll_chunk_name"
+
+/*Constants for MPI derived data type generated from span tree */
+
+#define MSPACE1_RANK 1 /* Rank of the first dataset in memory */
+#define MSPACE1_DIM 19000 /* Dataset size in memory */
+#define FSPACE_RANK 2 /* Dataset rank as it is stored in the file */
+#define FSPACE_DIM1 9 /* Dimension sizes of the dataset as it is stored in the file */
+#define FSPACE_DIM2 2400 /* We will read dataset back from the file to the dataset in memory with these dataspace parameters. */
+#define MSPACE_RANK 2
+#define MSPACE_DIM1 9
+#define MSPACE_DIM2 2400
+#define FHCOUNT0 1 /* Count of the first dimension of the first hyperslab selection*/
+#define FHCOUNT1 512 /* Count of the second dimension of the first hyperslab selection*/
+#define FHSTRIDE0 4 /* Stride of the first dimension of the first hyperslab selection*/
+#define FHSTRIDE1 3 /* Stride of the second dimension of the first hyperslab selection*/
+#define FHBLOCK0 3 /* Block of the first dimension of the first hyperslab selection*/
+#define FHBLOCK1 2 /* Block of the second dimension of the first hyperslab selection*/
+#define FHSTART0 0 /* start of the first dimension of the first hyperslab selection*/
+#define FHSTART1 1 /* start of the second dimension of the first hyperslab selection*/
+
+#define SHCOUNT0 1 /* Count of the first dimension of the first hyperslab selection*/
+#define SHCOUNT1 1 /* Count of the second dimension of the first hyperslab selection*/
+#define SHSTRIDE0 1 /* Stride of the first dimension of the first hyperslab selection*/
+#define SHSTRIDE1 1 /* Stride of the second dimension of the first hyperslab selection*/
+#define SHBLOCK0 3 /* Block of the first dimension of the first hyperslab selection*/
+#define SHBLOCK1 512 /* Block of the second dimension of the first hyperslab selection*/
+#define SHSTART0 4 /* start of the first dimension of the first hyperslab selection*/
+#define SHSTART1 0 /* start of the second dimension of the first hyperslab selection*/
+
+#define MHCOUNT0 4608 /* Count of the first dimension of the first hyperslab selection*/
+#define MHSTRIDE0 1 /* Stride of the first dimension of the first hyperslab selection*/
+#define MHBLOCK0 1 /* Block of the first dimension of the first hyperslab selection*/
+#define MHSTART0 1 /* start of the first dimension of the first hyperslab selection*/
+
+
+
+#define RFFHCOUNT0 3 /* Count of the first dimension of the first hyperslab selection*/
+#define RFFHCOUNT1 512 /* Count of the second dimension of the first hyperslab selection*/
+#define RFFHSTRIDE0 1 /* Stride of the first dimension of the first hyperslab selection*/
+#define RFFHSTRIDE1 1 /* Stride of the second dimension of the first hyperslab selection*/
+#define RFFHBLOCK0 1 /* Block of the first dimension of the first hyperslab selection*/
+#define RFFHBLOCK1 1 /* Block of the second dimension of the first hyperslab selection*/
+#define RFFHSTART0 1 /* start of the first dimension of the first hyperslab selection*/
+#define RFFHSTART1 2 /* start of the second dimension of the first hyperslab selection*/
+
+
+#define RFSHCOUNT0 3 /* Count of the first dimension of the first hyperslab selection*/
+#define RFSHCOUNT1 1024 /* Count of the second dimension of the first hyperslab selection*/
+#define RFSHSTRIDE0 1 /* Stride of the first dimension of the first hyperslab selection*/
+#define RFSHSTRIDE1 1 /* Stride of the second dimension of the first hyperslab selection*/
+#define RFSHBLOCK0 1 /* Block of the first dimension of the first hyperslab selection*/
+#define RFSHBLOCK1 1 /* Block of the second dimension of the first hyperslab selection*/
+#define RFSHSTART0 2 /* start of the first dimension of the first hyperslab selection*/
+#define RFSHSTART1 4 /* start of the second dimension of the first hyperslab selection*/
+
+
+#define RMFHCOUNT0 3 /* Count of the first dimension of the first hyperslab selection*/
+#define RMFHCOUNT1 512 /* Count of the second dimension of the first hyperslab selection*/
+#define RMFHSTRIDE0 1 /* Stride of the first dimension of the first hyperslab selection*/
+#define RMFHSTRIDE1 1 /* Stride of the second dimension of the first hyperslab selection*/
+#define RMFHBLOCK0 1 /* Block of the first dimension of the first hyperslab selection*/
+#define RMFHBLOCK1 1 /* Block of the second dimension of the first hyperslab selection*/
+#define RMFHSTART0 0 /* start of the first dimension of the first hyperslab selection*/
+#define RMFHSTART1 0 /* start of the second dimension of the first hyperslab selection*/
+
+#define RMSHCOUNT0 3 /* Count of the first dimension of the first hyperslab selection*/
+#define RMSHCOUNT1 1024 /* Count of the second dimension of the first hyperslab selection*/
+#define RMSHSTRIDE0 1 /* Stride of the first dimension of the first hyperslab selection*/
+#define RMSHSTRIDE1 1 /* Stride of the second dimension of the first hyperslab selection*/
+#define RMSHBLOCK0 1 /* Block of the first dimension of the first hyperslab selection*/
+#define RMSHBLOCK1 1 /* Block of the second dimension of the first hyperslab selection*/
+#define RMSHSTART0 1 /* start of the first dimension of the first hyperslab selection*/
+#define RMSHSTART1 2 /* start of the second dimension of the first hyperslab selection*/
+
+
+#define NPOINTS 4 /* Number of points that will be selected
+ and overwritten */
+
+/* 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
+
+
+*/ /* end of debugging macro */
/* type definitions */
typedef struct H5Ptest_param_t /* holds extra test parameters */
{
@@ -162,6 +256,12 @@ void coll_chunk1(void);
void coll_chunk2(void);
void coll_chunk3(void);
void coll_chunk4(void);
+void coll_irregular_cont_read(void);
+void coll_irregular_cont_write(void);
+void coll_irregular_simple_chunk_read(void);
+void coll_irregular_simple_chunk_write(void);
+void coll_irregular_complex_chunk_read(void);
+void coll_irregular_complex_chunk_write(void);
void io_mode_confusion(void);
#ifdef H5_HAVE_FILTER_DEFLATE
void compress_readAll(void);
@@ -170,7 +270,7 @@ void compress_readAll(void);
/* commonly used prototypes */
hid_t create_faccess_plist(MPI_Comm comm, MPI_Info info, int l_facc_type, hbool_t use_gpfs);
MPI_Offset h5_mpi_get_file_size(const char *filename, MPI_Comm comm, MPI_Info info);
-int dataset_vrfy(hssize_t start[], hsize_t count[], hsize_t stride[],
+int dataset_vrfy(hsize_t start[], hsize_t count[], hsize_t stride[],
hsize_t block[], DATATYPE *dataset, DATATYPE *original);
#endif /* PHDF5TEST_H */
diff --git a/tools/gifconv/Makefile.in b/tools/gifconv/Makefile.in
index 1c5fd3c..79c3552 100644
--- a/tools/gifconv/Makefile.in
+++ b/tools/gifconv/Makefile.in
@@ -1,4 +1,3 @@
-## HDF5 Library Makefile(.in)
##
## Copyright by the Board of Trustees of the University of Illinois.
## All rights reserved.
@@ -12,6 +11,8 @@
## 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.
##
+## HDF5 Library Makefile(.in)
+##
top_srcdir=@top_srcdir@
top_builddir=../..
srcdir=@srcdir@
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index e9803b3..0a7f408 100644
--- a/tools/h5dump/h5dump.c
+++ b/tools/h5dump/h5dump.c
@@ -22,7 +22,6 @@
#include "h5trav.h"
-
/* module-scoped variables */
const char *progname = "h5dump";
@@ -56,7 +55,6 @@ 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 **
**/
@@ -78,6 +76,9 @@ static hid_t h5_fileaccess(void);
static void dump_oid(hid_t oid);
static void print_enum(hid_t type);
static herr_t dump_all(hid_t group, const char *name, void *op_data);
+#ifdef LATER
+static void check_compression(hid_t);
+#endif /* LATER */
static int xml_name_to_XID(const char *, char *, int , int );
static h5dump_t dataformat = {
@@ -467,7 +468,6 @@ static void dump_comment(hid_t obj_id);
static void dump_fcpl(hid_t fid);
static void dump_fcontents(hid_t fid);
-
/* XML format: same interface, alternative output */
static void xml_dump_group(hid_t, const char *);
@@ -1007,20 +1007,22 @@ dump_dataspace(hid_t space)
hsize_t size[H5DUMP_MAX_RANK];
hsize_t maxsize[H5DUMP_MAX_RANK];
int ndims = H5Sget_simple_extent_dims(space, size, maxsize);
+ H5S_class_t space_type = H5Sget_simple_extent_type(space);
int i;
indentation(indent + COL);
printf("%s ", dump_header_format->dataspacebegin);
- if (H5Sis_simple(space)) {
- if (ndims == 0) {
+ switch (space_type) {
+ case H5S_SCALAR:
/* scalar dataspace */
HDfprintf(stdout, "%s %s",
- dump_header_format->dataspacedescriptionbegin, SCALAR);
- } else {
+ dump_header_format->dataspacedescriptionbegin, S_SCALAR);
+ break;
+ case H5S_SIMPLE:
/* simple dataspace */
HDfprintf(stdout, "%s %s { %s %Hu",
- dump_header_format->dataspacedescriptionbegin, SIMPLE,
+ dump_header_format->dataspacedescriptionbegin, S_SIMPLE,
dump_header_format->dataspacedimbegin, size[0]);
for (i = 1; i < ndims; i++)
@@ -1043,9 +1045,14 @@ dump_dataspace(hid_t space)
HDfprintf(stdout, ", %Hu", maxsize[i]);
printf(" %s }", dump_header_format->dataspacedimend);
- }
- } else {
- printf("%s not yet implemented %s\n", BEGIN, END);
+
+ break;
+ case H5S_COMPLEX:
+ printf("%s not yet implemented %s\n", BEGIN, END);
+ break;
+ case H5S_NO_CLASS:
+ default:
+ printf("%s unknown dataspace %s\n", BEGIN, END);
}
end_obj(dump_header_format->dataspaceend,
@@ -1544,7 +1551,6 @@ dump_named_datatype(hid_t type, const char *name)
dump_header_format->datatypeblockend);
}
-
/*-------------------------------------------------------------------------
* Function: dump_group
*
@@ -1851,6 +1857,7 @@ dump_data(hid_t obj_id, int obj_data, struct subset_t *sset, int pindex)
int status = -1;
void *buf;
hid_t space, type, p_type;
+ H5S_class_t space_type;
int ndims, i;
hsize_t size[64], nelmts = 1, alloc_size;
int depth;
@@ -1929,61 +1936,65 @@ 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 {
- char string_prefix[64];
- h5dump_t string_dataformat;
-
/* need to call h5tools_dump_mem for the attribute data */
- type = H5Aget_type(obj_id);
- p_type = h5tools_get_native_type(type);
-
space = H5Aget_space(obj_id);
- ndims = H5Sget_simple_extent_dims(space, size, NULL);
+ space_type = H5Sget_simple_extent_type(space);
+ if(space_type == H5S_NO_CLASS || space_type == H5S_COMPLEX) {
+ status = SUCCEED;
+ } else {
+ char string_prefix[64];
+ h5dump_t string_dataformat;
- for (i = 0; i < ndims; i++)
- nelmts *= size[i];
+ type = H5Aget_type(obj_id);
+ p_type = h5tools_get_native_type(type);
- 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);
-
- if (H5Aread(obj_id, p_type, buf) >= 0){
- if (display_char && H5Tget_size(type) == 1 && H5Tget_class(type) == H5T_INTEGER) {
- /*
- * Print 1-byte integer data as an ASCII character string
- * instead of integers if the `-r' or `--string' command-line
- * option was given.
- *
- * We don't want to modify the global dataformat, so make a
- * copy of it instead.
- */
- string_dataformat = *outputformat;
- string_dataformat.idx_fmt = " ";
- string_dataformat.line_multi_new = 1;
- string_dataformat.line_1st = " %s\"";
- string_dataformat.line_pre = " %s";
- string_dataformat.line_cont = " %s";
- string_dataformat.str_repeat = 8;
- string_dataformat.ascii = TRUE;
- string_dataformat.elmt_suf1 = "";
- string_dataformat.elmt_suf2 = "";
- string_dataformat.line_indent = "";
- strcpy(string_prefix, string_dataformat.line_pre);
- strcat(string_prefix, "\"");
- string_dataformat.line_pre = string_prefix;
- string_dataformat.line_suf = "\"";
- outputformat = &string_dataformat;
- }
+ ndims = H5Sget_simple_extent_dims(space, size, NULL);
- status = h5tools_dump_mem(stdout, outputformat, obj_id, p_type,
- space, buf, depth);
- }
-
- free(buf);
- H5Tclose(p_type);
+ for (i = 0; i < ndims; i++)
+ nelmts *= size[i];
+
+ 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);
+
+ if (H5Aread(obj_id, p_type, buf) >= 0)
+ if (display_char && H5Tget_size(type) == 1 && H5Tget_class(type) == H5T_INTEGER) {
+ /*
+ * Print 1-byte integer data as an ASCII character string
+ * instead of integers if the `-r' or `--string' command-line
+ * option was given.
+ *
+ * We don't want to modify the global dataformat, so make a
+ * copy of it instead.
+ */
+ string_dataformat = *outputformat;
+ string_dataformat.idx_fmt = " ";
+ string_dataformat.line_multi_new = 1;
+ string_dataformat.line_1st = " %s\"";
+ string_dataformat.line_pre = " %s";
+ string_dataformat.line_cont = " %s";
+ string_dataformat.str_repeat = 8;
+ string_dataformat.ascii = TRUE;
+ string_dataformat.elmt_suf1 = "";
+ string_dataformat.elmt_suf2 = "";
+ string_dataformat.line_indent = "";
+ strcpy(string_prefix, string_dataformat.line_pre);
+ strcat(string_prefix, "\"");
+ string_dataformat.line_pre = string_prefix;
+ string_dataformat.line_suf = "\"";
+ outputformat = &string_dataformat;
+ }
+
+ status = h5tools_dump_mem(stdout, outputformat, obj_id, p_type,
+ space, buf, depth);
+
+ free(buf);
+ H5Tclose(p_type);
+ H5Tclose(type);
+ }
H5Sclose(space);
- H5Tclose(type);
}
if (status == FAIL) {
@@ -2071,7 +2082,7 @@ static void dump_fill_value(hid_t dcpl,hid_t type_id, hid_t obj_id)
h5tools_context_t ctx; /*print context */
size_t size;
void *buf=NULL;
- int nelmts=1;
+ hsize_t nelmts=1;
h5dump_t *outputformat = &dataformat;
hid_t n_type;
@@ -2189,8 +2200,8 @@ dump_dcpl(hid_t dcpl_id,hid_t type_id, hid_t obj_id)
printf("%s %s\n", EXTERNAL, BEGIN);
/*start indent */
indent += COL;
- for ( i=0; i<next; i++) {
- H5Pget_external(dcpl_id,i,sizeof(name),name,&offset,&size);
+ for ( j=0; j<(unsigned)next; j++) {
+ H5Pget_external(dcpl_id,j,sizeof(name),name,&offset,&size);
indentation(indent + COL);
HDfprintf(stdout,"FILENAME %s SIZE %Hu OFFSET %ld\n",name,size,offset);
}
@@ -2345,15 +2356,18 @@ dump_dcpl(hid_t dcpl_id,hid_t type_id, hid_t obj_id)
H5Pget_fill_time(dcpl_id, &ft);
switch ( ft )
{
- case H5D_FILL_TIME_ALLOC:
- printf("%s", "H5D_FILL_TIME_ALLOC\n");
- break;
- case H5D_FILL_TIME_NEVER:
- printf("%s", "H5D_FILL_TIME_NEVER\n");
- break;
- case H5D_FILL_TIME_IFSET:
- printf("%s", "H5D_FILL_TIME_IFSET\n");
- break;
+ case H5D_FILL_TIME_ALLOC:
+ printf("%s", "H5D_FILL_TIME_ALLOC\n");
+ break;
+ case H5D_FILL_TIME_NEVER:
+ printf("%s", "H5D_FILL_TIME_NEVER\n");
+ break;
+ case H5D_FILL_TIME_IFSET:
+ printf("%s", "H5D_FILL_TIME_IFSET\n");
+ break;
+ default:
+ assert(0);
+ break;
}
indentation(indent + COL);
printf("%s ", "VALUE ");
@@ -2385,15 +2399,18 @@ dump_dcpl(hid_t dcpl_id,hid_t type_id, hid_t obj_id)
H5Pget_alloc_time(dcpl_id, &at);
switch (at)
{
- case H5D_ALLOC_TIME_EARLY:
- printf("%s", "H5D_ALLOC_TIME_EARLY\n");
- break;
- case H5D_ALLOC_TIME_INCR:
- printf("%s", "H5D_ALLOC_TIME_INCR\n");
- break;
- case H5D_ALLOC_TIME_LATE:
- printf("%s", "H5D_ALLOC_TIME_LATE\n");
- break;
+ case H5D_ALLOC_TIME_EARLY:
+ printf("%s", "H5D_ALLOC_TIME_EARLY\n");
+ break;
+ case H5D_ALLOC_TIME_INCR:
+ printf("%s", "H5D_ALLOC_TIME_INCR\n");
+ break;
+ case H5D_ALLOC_TIME_LATE:
+ printf("%s", "H5D_ALLOC_TIME_LATE\n");
+ break;
+ default:
+ assert(0);
+ break;
}
/* end indent */
indent -= COL;
@@ -2417,24 +2434,25 @@ dump_dcpl(hid_t dcpl_id,hid_t type_id, hid_t obj_id)
static void
dump_fcpl(hid_t fid)
{
-#ifdef H5_WANT_H5_V1_4_COMPAT
- int sym_lk;
-#else
- unsigned sym_lk; /* symbol table B-tree leaf 'K' value */
-#endif
- int istore_ik; /* indexed storage B-tree initial 'K' value */
hid_t fcpl; /* file creation property list ID */
hid_t fapl; /* file access property list ID */
hsize_t userblock; /* userblock size retrieved from FCPL */
size_t off_size; /* size of offsets in the file */
size_t len_size; /* size of lengths in the file */
- int sym_ik; /* symbol table B-tree initial 'K' value */
- int super; /* superblock version # */
- int freelist; /* free list version # */
- int stab; /* symbol table entry version # */
- int shhdr; /* shared object header version # */
+ unsigned super; /* superblock version # */
+ unsigned freelist; /* free list version # */
+ unsigned stab; /* symbol table entry version # */
+ unsigned shhdr; /* shared object header version # */
hid_t fdriver; /* file driver */
char dname[15]; /* buffer to store driver name */
+#ifdef H5_WANT_H5_V1_4_COMPAT
+ int sym_lk;
+ int sym_ik; /* symbol table B-tree internal 'K' value */
+#else
+ unsigned sym_lk; /* symbol table B-tree leaf 'K' value */
+ unsigned sym_ik; /* symbol table B-tree internal 'K' value */
+#endif
+ unsigned istore_ik; /* indexed storage B-tree internal 'K' value */
fcpl=H5Fget_create_plist(fid);
H5Pget_version(fcpl, &super, &freelist, &stab, &shhdr);
@@ -2453,19 +2471,19 @@ dump_fcpl(hid_t fid)
*/
printf("%s %s\n",SUPER_BLOCK, BEGIN);
indentation(indent + COL);
- printf("%s %d\n","SUPERBLOCK_VERSION", super);
+ printf("%s %u\n","SUPERBLOCK_VERSION", super);
indentation(indent + COL);
- printf("%s %d\n","FREELIST_VERSION", freelist);
+ printf("%s %u\n","FREELIST_VERSION", freelist);
indentation(indent + COL);
- printf("%s %d\n","SYMBOLTABLE_VERSION", stab);
+ printf("%s %u\n","SYMBOLTABLE_VERSION", stab);
indentation(indent + COL);
- printf("%s %d\n","OBJECTHEADER_VERSION", shhdr);
+ printf("%s %u\n","OBJECTHEADER_VERSION", shhdr);
indentation(indent + COL);
HDfprintf(stdout,"%s %Hd\n","OFFSET_SIZE", (long_long)off_size);
indentation(indent + COL);
HDfprintf(stdout,"%s %Hd\n","LENGTH_SIZE", (long_long)len_size);
indentation(indent + COL);
- printf("%s %d\n","BTREE_RANK", sym_ik);
+ printf("%s %u\n","BTREE_RANK", sym_ik);
indentation(indent + COL);
printf("%s %d\n","BTREE_LEAF", sym_lk);
@@ -2511,7 +2529,7 @@ dump_fcpl(hid_t fid)
indentation(indent + COL);
printf("%s %s\n","FILE_DRIVER", dname);
indentation(indent + COL);
- printf("%s %d\n","ISTORE_K", istore_ik);
+ printf("%s %u\n","ISTORE_K", istore_ik);
printf("%s\n",END);
/*-------------------------------------------------------------------------
@@ -2715,7 +2733,7 @@ parse_subset_params(char *dset)
*brace++ = '\0';
s = calloc(1, sizeof(struct subset_t));
- s->start = (hssize_t *)parse_hsize_list(brace);
+ s->start = parse_hsize_list(brace);
while (*brace && *brace != ';')
brace++;
@@ -3248,7 +3266,7 @@ parse_start:
*/
do {
switch ((char)opt) {
- case 's': free(s->start); s->start = (hssize_t *)parse_hsize_list(opt_arg); break;
+ case 's': free(s->start); s->start = parse_hsize_list(opt_arg); break;
case 'S': free(s->stride); s->stride = parse_hsize_list(opt_arg); break;
case 'c': free(s->count); s->count = parse_hsize_list(opt_arg); break;
case 'k': free(s->block); s->block = parse_hsize_list(opt_arg); break;
@@ -3717,21 +3735,17 @@ int
xml_name_to_XID(const char *str , char *outstr, int outlen, int gen)
{
ref_path_table_entry_t *r;
- char *os;
if (outlen < 22) return 1;
- os = outstr;
-
r = ref_path_table_lookup(str);
if (r == NULL) {
if (strlen(str) == 0) {
r = ref_path_table_lookup("/");
if (r == NULL) {
if (gen) {
- sprintf(os," "); /* ?? */
r = ref_path_table_gen_fake(str);
- sprintf(os,"xid_%lu-%lu",r->statbuf.objno[0],r->statbuf.objno[1]);
+ sprintf(outstr,"xid_%lu-%lu",r->statbuf.objno[0],r->statbuf.objno[1]);
return 0;
} else {
return 1;
@@ -3739,9 +3753,8 @@ xml_name_to_XID(const char *str , char *outstr, int outlen, int gen)
}
} else {
if (gen) {
- sprintf(os," "); /* ?? */
r = ref_path_table_gen_fake(str);
- sprintf(os,"xid_%lu-%lu",r->statbuf.objno[0],r->statbuf.objno[1]);
+ sprintf(outstr,"xid_%lu-%lu",r->statbuf.objno[0],r->statbuf.objno[1]);
return 0;
} else {
return 1;
@@ -3749,7 +3762,7 @@ xml_name_to_XID(const char *str , char *outstr, int outlen, int gen)
}
}
- sprintf(os,"xid_%lu-%lu",r->statbuf.objno[0],r->statbuf.objno[1]);
+ sprintf(outstr,"xid_%lu-%lu",r->statbuf.objno[0],r->statbuf.objno[1]);
return(0);
}
@@ -4415,17 +4428,20 @@ xml_dump_dataspace(hid_t space)
hsize_t maxsize[H5DUMP_MAX_RANK];
int ndims =
H5Sget_simple_extent_dims(space, size, maxsize);
+ H5S_class_t space_type = H5Sget_simple_extent_type(space);
int i;
indentation(indent + COL);
printf("<%sDataspace>\n", xmlnsprefix);
- if (H5Sis_simple(space)) {
- indentation(indent + COL + COL);
+ indentation(indent + COL + COL);
- if (ndims == 0) {
+ switch (space_type) {
+ case H5S_SCALAR:
/* scalar dataspace (just a tag, no XML attrs. defined */
printf("<%sScalarDataspace />\n",xmlnsprefix);
- } else {
+
+ break;
+ case H5S_SIMPLE:
/* simple dataspace */
/* <hdf5:SimpleDataspace Ndims="nd"> */
printf("<%sSimpleDataspace Ndims=\"%d\">\n",xmlnsprefix, ndims);
@@ -4449,14 +4465,19 @@ xml_dump_dataspace(hid_t space)
}
indentation(indent + COL + COL);
printf("</%sSimpleDataspace>\n", xmlnsprefix );
- }
- } else {
- printf("<!-- not yet implemented -->\n");
+
+ break;
+ case H5S_COMPLEX:
+ printf("<!-- not yet implemented -->\n");
+
+ break;
+ case H5S_NO_CLASS:
+ default:
+ printf("<!-- unknown dataspace -->\n");
}
indentation(indent + COL);
printf("</%sDataspace>\n", xmlnsprefix);
-
}
/*-------------------------------------------------------------------------
@@ -5069,7 +5090,7 @@ xml_print_refs(hid_t did, int source)
ssiz = H5Sget_simple_extent_npoints(space);
for (i = 0; i < ssiz; i++) {
- path = lookup_ref_path(refbuf);
+ path = lookup_ref_path(*refbuf);
indentation(indent + COL);
if (!path) {
@@ -5276,7 +5297,7 @@ check_filters(hid_t dcpl)
if (nfilt <= 0)
return;
for (i = 0; i < nfilt; i++) {
- filter = H5Pget_filter(dcpl, i, &flags,
+ filter = H5Pget_filter(dcpl, (unsigned)i, &flags,
(size_t *) &cd_nelmts,
cd_values, 120, namebuf);
if (filter == H5Z_FILTER_DEFLATE) {
@@ -5356,7 +5377,7 @@ char * name;
H5Pget_fill_value(dcpl, type, buf);
if (H5Tget_class(type) == H5T_REFERENCE) {
- path = lookup_ref_path(buf);
+ path = lookup_ref_path(*(hobj_ref_t *)buf);
indentation(indent);
printf("<%sDataFromFile>\n",xmlnsprefix);
@@ -5413,7 +5434,7 @@ char * name;
case H5T_ENUM:
indentation(indent);
printf("<%sDataFromFile>\n",xmlnsprefix);
- name = H5Tget_member_name(type, *(int *)buf);
+ name = H5Tget_member_name(type, *(unsigned *)buf);
indentation(indent);
printf("\"%s\"\n",name);
indentation(indent);
@@ -5846,9 +5867,6 @@ xml_print_enum(hid_t type)
}
-
-
-
/*-------------------------------------------------------------------------
* Function: h5_fileaccess
*
diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c
index ef4cddd..55fa489 100644
--- a/tools/h5dump/h5dumpgentest.c
+++ b/tools/h5dump/h5dumpgentest.c
@@ -1,4 +1,4 @@
- /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
@@ -92,7 +92,6 @@ 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,
@@ -1357,7 +1356,7 @@ static void gent_str2(void)
hid_t fid, group, attr, dataset, space, space2, mem_space, hyper_space;
hid_t fxdlenstr, fxdlenstr2, memtype;
hsize_t dims[1], size[1], stride[1], count[1], block[1];
-hssize_t start[1];
+hsize_t start[1];
int i;
@@ -1656,11 +1655,11 @@ static void gent_datareg(void)
sid2; /* Dataspace ID #2 */
hsize_t dims1[] = {SPACE1_DIM1},
dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
- hssize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
+ hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */
hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */
hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */
- hssize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */
+ hsize_t coord1[POINT1_NPOINTS][SPACE2_RANK]; /* Coordinates for point selection */
hdset_reg_ref_t *wbuf, /* buffer to write to disk */
*rbuf; /* buffer read from disk */
uint8_t *dwbuf, /* Buffer for writing numeric data to disk */
@@ -1723,7 +1722,7 @@ static void gent_datareg(void)
coord1[7][0]=9; coord1[7][1]=0;
coord1[8][0]=7; coord1[8][1]=1;
coord1[9][0]=3; coord1[9][1]=3;
- H5Sselect_elements(sid2,H5S_SELECT_SET,POINT1_NPOINTS,(const hssize_t **)coord1);
+ H5Sselect_elements(sid2,H5S_SELECT_SET,POINT1_NPOINTS,(const hsize_t **)coord1);
H5Sget_select_npoints(sid2);
@@ -4079,6 +4078,8 @@ 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:
+ *
* Programmer: pvn@ncsa.uiuc.edu
*
* Date: May 27, 2003
@@ -4099,23 +4100,16 @@ 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);
- assert (dset_id >= 0);
/* Write the buf */
if ( buf )
- {
status = H5Dwrite(dset_id,type_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf);
- assert (status >= 0);
- }
/* Close */
status = H5Dclose(dset_id);
- assert (status >= 0);
-
status = H5Sclose(space_id);
- assert (status >= 0);
- return 1;
+ return status;
}
@@ -4443,6 +4437,7 @@ make_external(hid_t fid)
H5Pclose(dcpl);
assert(ret>=0);
}
+
/*-------------------------------------------------------------------------
* Function: gent_filters
*
@@ -4456,10 +4451,10 @@ static void gent_filters(void)
hid_t dcpl; /* dataset creation property list */
hid_t sid; /* dataspace ID */
hid_t tid; /* datatype ID */
-#if defined (H5_HAVE_FILTER_SZIP)
+#ifdef H5_HAVE_FILTER_SZIP
unsigned szip_options_mask=H5_SZIP_ALLOW_K13_OPTION_MASK|H5_SZIP_NN_OPTION_MASK;
unsigned szip_pixels_per_block=4;
-#endif
+#endif /* H5_HAVE_FILTER_SZIP */
hsize_t dims1[RANK] = {DIM1,DIM2};
hsize_t chunk_dims[RANK] = {CDIM1,CDIM2};
int buf1[DIM1][DIM2];
@@ -4529,7 +4524,8 @@ static void gent_filters(void)
* SZIP
*-------------------------------------------------------------------------
*/
-#if defined (H5_HAVE_FILTER_SZIP) && defined (H5_SZIP_CAN_ENCODE)
+#ifdef H5_HAVE_FILTER_SZIP
+ if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) {
/* remove the filters from the dcpl */
ret=H5Premove_filter(dcpl,H5Z_FILTER_ALL);
assert(ret>=0);
@@ -4540,7 +4536,8 @@ static void gent_filters(void)
ret=make_dset(fid,"szip",sid,H5T_NATIVE_INT,dcpl,buf1);
assert(ret>=0);
-#endif
+ }
+#endif /* H5_HAVE_FILTER_SZIP */
/*-------------------------------------------------------------------------
* GZIP
@@ -4609,12 +4606,14 @@ static void gent_filters(void)
assert(ret>=0);
#endif
-#if defined (H5_HAVE_FILTER_SZIP) && defined (H5_SZIP_CAN_ENCODE)
+#ifdef H5_HAVE_FILTER_SZIP
+ if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) {
szip_options_mask=H5_SZIP_CHIP_OPTION_MASK | H5_SZIP_EC_OPTION_MASK;
/* set szip data */
ret=H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block);
assert(ret>=0);
-#endif
+ }
+#endif /* H5_HAVE_FILTER_SZIP */
#if defined (H5_HAVE_FILTER_DEFLATE)
/* set deflate data */
@@ -5054,7 +5053,7 @@ static void gent_string(void)
hid_t str_tid; /* datatype ID */
hid_t did; /* dataset ID */
char buf1[]={"quote \" backspace\b form feed\f new line\n tab\t new line\n carriage return\r"};
- char *buf2[SPACE1_DIM1]= {
+ const char *buf2[SPACE1_DIM1]= {
"Four score and seven\n years ago our forefathers brought forth on this continent a new nation,",
"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,",
@@ -5204,9 +5203,7 @@ static void gent_aindices(void)
write_dset(gid[5],3,dims3,"3d",H5T_NATIVE_INT,buf3);
for (i=0; i<6; i++)
H5Gclose(gid[i]);
-
-
-
+
/*-------------------------------------------------------------------------
* close
*-------------------------------------------------------------------------
@@ -5233,32 +5230,23 @@ int main(void)
gent_compound_dt();
gent_all();
gent_loop();
-
gent_dataset2();
gent_compound_dt2();
gent_loop2();
gent_many();
-
gent_str();
gent_str2();
-
gent_enum();
-
gent_objref();
gent_datareg();
-
gent_nestcomp();
-
gent_opaque();
-
gent_bitfields();
-
gent_vldatatypes();
gent_vldatatypes2();
gent_vldatatypes3();
gent_vldatatypes4();
gent_vldatatypes5();
-
gent_array1();
gent_array2();
gent_array3();
@@ -5266,19 +5254,15 @@ int main(void)
gent_array5();
gent_array6();
gent_array7();
-
gent_empty();
gent_group_comments();
gent_split_file();
gent_family();
gent_multi();
-
gent_large_objname();
gent_vlstr();
gent_char();
-
gent_attr_all();
-
gent_compound_complex();
gent_named_dtype_attr();
diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in
index 2414e04..ccb3f31 100644
--- a/tools/h5dump/testh5dump.sh.in
+++ b/tools/h5dump/testh5dump.sh.in
@@ -90,13 +90,13 @@ TOOLTEST() {
}
-
# Print a "SKIP" message
SKIP() {
- TESTING $DUMPER $@
- echo " -SKIP-"
+ TESTING $DUMPER $@
+ echo " -SKIP-"
}
-
+
+
##############################################################################
##############################################################################
@@ -253,46 +253,45 @@ TOOLTEST tindicesyes.ddl taindices.h5
TOOLTEST tindicesno.ddl -y taindices.h5
-
# tests for filters
# SZIP
option="-H -p -d szip tfilters.h5"
if test $USE_FILTER_SZIP != "yes"; then
- SKIP $option
+ SKIP $option
else
- TOOLTEST tszip.ddl $option
+TOOLTEST tszip.ddl $option
fi
# deflate
option="-H -p -d deflate tfilters.h5"
if test $USE_FILTER_DEFLATE != "yes"; then
- SKIP $option
+ SKIP $option
else
- TOOLTEST tdeflate.ddl $option
+ TOOLTEST tdeflate.ddl $option
fi
# shuffle
option="-H -p -d shuffle tfilters.h5"
if test $USE_FILTER_SHUFFLE != "yes"; then
- SKIP $option
+ SKIP $option
else
- TOOLTEST tshuffle.ddl $option
+ TOOLTEST tshuffle.ddl $option
fi
# fletcher32
option="-H -p -d fletcher32 tfilters.h5"
if test $USE_FILTER_FLETCHER32 != "yes"; then
- SKIP $option
+ SKIP $option
else
- TOOLTEST tfletcher32.ddl $option
+ TOOLTEST tfletcher32.ddl $option
fi
# all
option="-H -p -d all tfilters.h5"
-if test $USE_FILTER_FLETCHER32 != "yes" -o $USE_FILTER_SZIP != "yes" -o $USE_FILTER_DEFLATE != "yes" -o $USE_FILTER_SHUFFLE != "yes"; then SKIP $option
+if test $USE_FILTER_FLETCHER32 != "yes" -o $USE_FILTER_SZIP != "yes" -o $USE_FILTER_DEFLATE != "yes" -o $USE_FILTER_SHUFFLE != "yes" ; then
+ SKIP $option
else
TOOLTEST tallfilters.ddl $option
fi
# user defined
TOOLTEST tuserfilter.ddl -H -p -d myfilter tfilters.h5
-
if test $nerrors -eq 0 ; then
echo "All $DUMPER tests passed."
diff --git a/tools/h5import/Makefile.in b/tools/h5import/Makefile.in
index 73d4f13..cd16af8 100755
--- a/tools/h5import/Makefile.in
+++ b/tools/h5import/Makefile.in
@@ -1,4 +1,3 @@
-## HDF5 Library Makefile(.in)
##
## Copyright by the Board of Trustees of the University of Illinois.
## All rights reserved.
@@ -12,6 +11,7 @@
## 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.
##
+## HDF5 Library Makefile(.in)
##
top_srcdir=@top_srcdir@
top_builddir=../..
diff --git a/tools/h5import/h5import.c b/tools/h5import/h5import.c
index 28020d5..ff1622d 100755
--- a/tools/h5import/h5import.c
+++ b/tools/h5import/h5import.c
@@ -1837,18 +1837,18 @@ setDefaultValues(struct Input *in, int count)
}
hid_t
-createOutputDataType(struct Input in)
+createOutputDataType(struct Input *in)
{
hid_t new_type = (-1);
const char *err1 = "Invalid value for output class.\n";
- switch (in.outputClass)
+ switch (in->outputClass)
{
case 0:
- switch (in.outputArchitecture)
+ switch (in->outputArchitecture)
{
case 0: /* NATIVE */
- switch(in.outputSize)
+ switch(in->outputSize)
{
case 8:
new_type = H5Tcopy (H5T_NATIVE_CHAR);
@@ -1869,10 +1869,10 @@ createOutputDataType(struct Input in)
break;
case 1: /* STD */
- switch(in.outputSize)
+ switch(in->outputSize)
{
case 8:
- switch(in.outputByteOrder)
+ switch(in->outputByteOrder)
{
case 0:
new_type = H5Tcopy (H5T_STD_I8BE);
@@ -1885,7 +1885,7 @@ createOutputDataType(struct Input in)
break;
case 16:
- switch(in.outputByteOrder)
+ switch(in->outputByteOrder)
{
case 0:
new_type = H5Tcopy (H5T_STD_I16BE);
@@ -1898,7 +1898,7 @@ createOutputDataType(struct Input in)
break;
case 32:
- switch(in.outputByteOrder)
+ switch(in->outputByteOrder)
{
case 0:
new_type = H5Tcopy (H5T_STD_I32BE);
@@ -1911,7 +1911,7 @@ createOutputDataType(struct Input in)
break;
case 64:
- switch(in.outputByteOrder)
+ switch(in->outputByteOrder)
{
case 0:
new_type = H5Tcopy (H5T_STD_I64BE);
@@ -1929,10 +1929,10 @@ createOutputDataType(struct Input in)
break;
case 1:
- switch (in.outputArchitecture)
+ switch (in->outputArchitecture)
{
case 0:
- switch(in.outputSize)
+ switch(in->outputSize)
{
case 32:
new_type = H5Tcopy (H5T_NATIVE_FLOAT);
@@ -1949,10 +1949,10 @@ createOutputDataType(struct Input in)
break;
case 2:
- switch(in.outputSize)
+ switch(in->outputSize)
{
case 32:
- switch(in.outputByteOrder)
+ switch(in->outputByteOrder)
{
case 0:
new_type = H5Tcopy (H5T_IEEE_F32BE);
@@ -1965,7 +1965,7 @@ createOutputDataType(struct Input in)
break;
case 64:
- switch(in.outputByteOrder)
+ switch(in->outputByteOrder)
{
case 0:
new_type = H5Tcopy (H5T_IEEE_F64BE);
@@ -1983,10 +1983,10 @@ createOutputDataType(struct Input in)
break;
case 2:
- switch (in.outputArchitecture)
+ switch (in->outputArchitecture)
{
case 0:
- switch(in.outputSize)
+ switch(in->outputSize)
{
case 8:
new_type = H5Tcopy (H5T_NATIVE_UCHAR);
@@ -2007,10 +2007,10 @@ createOutputDataType(struct Input in)
break;
case 1:
- switch(in.outputSize)
+ switch(in->outputSize)
{
case 8:
- switch(in.outputByteOrder)
+ switch(in->outputByteOrder)
{
case 0:
new_type = H5Tcopy (H5T_STD_U8BE);
@@ -2023,7 +2023,7 @@ createOutputDataType(struct Input in)
break;
case 16:
- switch(in.outputByteOrder)
+ switch(in->outputByteOrder)
{
case 0:
new_type = H5Tcopy (H5T_STD_U16BE);
@@ -2036,7 +2036,7 @@ createOutputDataType(struct Input in)
break;
case 32:
- switch(in.outputByteOrder)
+ switch(in->outputByteOrder)
{
case 0:
new_type = H5Tcopy (H5T_STD_U32BE);
@@ -2049,7 +2049,7 @@ createOutputDataType(struct Input in)
break;
case 64:
- switch(in.outputByteOrder)
+ switch(in->outputByteOrder)
{
case 0:
new_type = H5Tcopy (H5T_STD_U64BE);
@@ -2079,16 +2079,16 @@ createOutputDataType(struct Input in)
}
hid_t
-createInputDataType(struct Input in)
+createInputDataType(struct Input *in)
{
hid_t new_type = (-1);
const char *err1 = "Invalid value for input class.\n";
- switch (in.inputClass)
+ switch (in->inputClass)
{
case 0:
case 4:
- switch(in.inputSize)
+ switch(in->inputSize)
{
case 8:
new_type = H5Tcopy (H5T_NATIVE_CHAR);
@@ -2111,7 +2111,7 @@ createInputDataType(struct Input in)
case 1:
case 2:
case 3:
- switch(in.inputSize)
+ switch(in->inputSize)
{
case 32:
new_type = H5Tcopy (H5T_NATIVE_FLOAT);
@@ -2128,7 +2128,7 @@ createInputDataType(struct Input in)
case 6:
case 7:
- switch(in.inputSize)
+ switch(in->inputSize)
{
case 8:
new_type = H5Tcopy (H5T_NATIVE_UCHAR);
@@ -2165,8 +2165,6 @@ process(struct Options *opt)
hid_t intype, outtype;
hid_t proplist;
hsize_t numOfElements = 1;
- H5E_auto_t func;
- void *client_data;
int j,k;
const char *err1 = "Error creating HDF output file: %s.\n";
@@ -2175,18 +2173,16 @@ process(struct Options *opt)
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";
- H5Eget_auto(&func, &client_data);
-
- /* disable error reporting */
- H5Eset_auto(NULL, NULL);
- 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)
- {
- (void) fprintf(stderr, err1, opt->outfile);
- return (-1);
- }
- /*enable error reporting */
- H5Eset_auto(func, client_data);
+
+ 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)
+ {
+ (void) fprintf(stderr, err1, opt->outfile);
+ return (-1);
+ }
+ }
+ } H5E_END_TRY;
for (k = 0; k < opt->fcount; k++)
{
@@ -2209,11 +2205,8 @@ process(struct Options *opt)
for (j=0; j<in->rank;j++)
numOfElements *= in->sizeOfDimension[j];
- /* store error reporting parameters */
- H5Eget_auto(&func, &client_data);
-
/* disable error reporting */
- H5Eset_auto(NULL, NULL);
+ H5E_BEGIN_TRY {
/* create parent groups */
if (in->path.count > 1)
@@ -2241,11 +2234,11 @@ process(struct Options *opt)
}
/*enable error reporting */
- H5Eset_auto(func, client_data);
+ } H5E_END_TRY;
/*create data type */
- intype = createInputDataType(*in);
- outtype = createOutputDataType(*in);
+ intype = createInputDataType(in);
+ outtype = createOutputDataType(in);
/* create property list */
proplist = H5Pcreate (H5P_DATASET_CREATE);
@@ -2285,10 +2278,9 @@ process(struct Options *opt)
{
dataspace = H5Screate_simple(in->rank, in->sizeOfDimension, NULL);
}
- H5Eget_auto(&func, &client_data);
/* disable error reporting */
- H5Eset_auto(NULL, NULL);
+ H5E_BEGIN_TRY {
/* create data set */
if ((dataset = H5Dcreate(handle, in->path.group[j], outtype, dataspace, proplist)) < 0)
{
@@ -2300,7 +2292,7 @@ process(struct Options *opt)
}
/*enable error reporting */
- H5Eset_auto(func, client_data);
+ } H5E_END_TRY;
/* write dataset */
if (H5Dwrite(dataset, intype, H5S_ALL, H5S_ALL, H5P_DEFAULT, (VOIDP)in->data) < 0)
diff --git a/tools/h5import/h5import.h b/tools/h5import/h5import.h
index 2f968b7..353e548 100755
--- a/tools/h5import/h5import.h
+++ b/tools/h5import/h5import.h
@@ -215,8 +215,8 @@ static int readIntegerData(FILE **strm, struct Input *in);
static int readFloatData(FILE **strm, struct Input *in);
static int allocateIntegerStorage(struct Input *in);
static int allocateFloatStorage(struct Input *in);
-hid_t createOutputDataType(struct Input in);
-hid_t createInputDataType(struct Input in);
+hid_t createOutputDataType(struct Input *in);
+hid_t createInputDataType(struct Input *in);
static int readUIntegerData(FILE **strm, struct Input *in);
static int allocateUIntegerStorage(struct Input *in);
static int validateConfigurationParameters(struct Input * in);
diff --git a/tools/h5jam/getub.c b/tools/h5jam/getub.c
index 58e9fe8..01756a5 100644
--- a/tools/h5jam/getub.c
+++ b/tools/h5jam/getub.c
@@ -27,7 +27,7 @@ void parse_command_line (int argc, const char *argv[]);
#define TRUE 1
#define FALSE 0
-static char *progname="getub";
+static const char *progname="getub";
char *nbytes = NULL;
static const char *s_opts = "c:"; /* add more later ? */
@@ -153,7 +153,7 @@ main (int argc, const char *argv[])
res = HDread (fd, buf, (unsigned)size);
- if (res < size)
+ if (res < (long)size)
{
if (buf)
free (buf);
diff --git a/tools/h5jam/h5jam.c b/tools/h5jam/h5jam.c
index 487a0a4..783434b 100644
--- a/tools/h5jam/h5jam.c
+++ b/tools/h5jam/h5jam.c
@@ -442,7 +442,7 @@ copy_some_to_file (int infid, int outfid, hsize_t startin, hsize_t startout,
}
else
{
- nchars = HDread (infid, buf, howmuch);
+ nchars = HDread (infid, buf, (unsigned)howmuch);
}
if (nchars <= 0)
@@ -498,7 +498,7 @@ copy_some_to_file (int infid, int outfid, hsize_t startin, hsize_t startout,
hsize_t
compute_user_block_size (hsize_t ublock_size)
{
- ssize_t where = 512;
+ hsize_t where = 512;
if (ublock_size == 0)
return 0;
diff --git a/tools/h5jam/h5jamgentest.c b/tools/h5jam/h5jamgentest.c
index 7f6342f..2d5f253 100644
--- a/tools/h5jam/h5jamgentest.c
+++ b/tools/h5jam/h5jamgentest.c
@@ -262,12 +262,13 @@ hsize_t dims[2];
int data[2][2], dset1[10][10], dset2[20];
char buf[512];
int i, j;
+unsigned u;
float dset2_1[10], dset2_2[3][5];
int fd;
char *bp;
create_plist = H5Pcreate(H5P_FILE_CREATE);
- H5Pset_userblock(create_plist,512);
+ H5Pset_userblock(create_plist,(hsize_t)512);
fid = H5Fcreate(FILE8, H5F_ACC_TRUNC, create_plist, H5P_DEFAULT);
/* create groups */
@@ -390,8 +391,8 @@ char *bp;
/* fill buf with pattern */
memset(buf,'\0',512);
bp = buf;
- for (i = 0; i < strlen(pattern); i++) {
- *bp++ = pattern[i%10];
+ for (u = 0; u < strlen(pattern); u++) {
+ *bp++ = pattern[u%10];
}
HDwrite(fd,buf,512);
@@ -411,7 +412,7 @@ int fd;
char *bp;
create_plist = H5Pcreate(H5P_FILE_CREATE);
- H5Pset_userblock(create_plist,1024);
+ H5Pset_userblock(create_plist,(hsize_t)1024);
fid = H5Fcreate(FILE9, H5F_ACC_TRUNC, create_plist, H5P_DEFAULT);
/* create groups */
@@ -543,14 +544,14 @@ char *bp;
close(fd);
}
-void
-create_textfile(char *name, off_t size) {
+static void
+create_textfile(const char *name, size_t size) {
char *buf;
int fd;
-int i;
+size_t i;
char *bp;
- fd = creat(name,0777);
+ fd = creat(name,(mode_t)0777);
if (fd < 0) {
/* panic */
}
diff --git a/tools/h5jam/h5unjam.c b/tools/h5jam/h5unjam.c
index 05ef606..a22bb03 100644
--- a/tools/h5jam/h5unjam.c
+++ b/tools/h5jam/h5unjam.c
@@ -100,7 +100,7 @@ usage(const char *prog)
*-------------------------------------------------------------------------
*/
-void
+static void
parse_command_line(int argc, const char *argv[])
{
int opt = FALSE;
@@ -268,7 +268,7 @@ main(int argc, const char *argv[])
/* 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, (fsize - (ssize_t)usize) );
+ copy_to_file( ifid, h5fid, (ssize_t) usize, (ssize_t)(fsize - (ssize_t)usize) );
close(ufid);
diff --git a/tools/h5jam/tellub.c b/tools/h5jam/tellub.c
index 3b21aff..24a04d4 100644
--- a/tools/h5jam/tellub.c
+++ b/tools/h5jam/tellub.c
@@ -79,7 +79,7 @@ usage (const char *prog)
*-------------------------------------------------------------------------
*/
-void
+static void
parse_command_line (int argc, const char *argv[])
{
int opt = FALSE;
@@ -122,7 +122,7 @@ parse_command_line (int argc, const char *argv[])
*
*-------------------------------------------------------------------------
*/
-void
+int
main (int argc, const char *argv[])
{
char *ifname;
@@ -144,7 +144,7 @@ main (int argc, const char *argv[])
{
error_msg (progname, "missing file name\n");
usage (progname);
- exit (EXIT_FAILURE);
+ return (EXIT_FAILURE);
}
ifname = strdup (argv[opt_ind]);
@@ -154,7 +154,7 @@ main (int argc, const char *argv[])
if (testval <= 0)
{
error_msg (progname, "Input HDF5 file is not HDF \"%s\"\n", ifname);
- exit (EXIT_FAILURE);
+ return (EXIT_FAILURE);
}
ifile = H5Fopen (ifname, H5F_ACC_RDONLY, H5P_DEFAULT);
@@ -162,7 +162,7 @@ main (int argc, const char *argv[])
if (ifile < 0)
{
error_msg (progname, "Can't open input HDF5 file \"%s\"\n", ifname);
- exit (EXIT_FAILURE);
+ return (EXIT_FAILURE);
}
plist = H5Fget_create_plist (ifile);
@@ -170,14 +170,14 @@ main (int argc, const char *argv[])
{
error_msg (progname, "Can't get file creation plist for file \"%s\"\n",
ifname);
- exit (EXIT_FAILURE);
+ return (EXIT_FAILURE);
}
status = H5Pget_userblock (plist, &usize);
if (status < 0)
{
error_msg (progname, "Can't get user block for file \"%s\"\n", ifname);
- exit (EXIT_FAILURE);
+ return (EXIT_FAILURE);
}
printf ("%ld\n", (long) usize);
@@ -185,5 +185,5 @@ main (int argc, const char *argv[])
H5Pclose (plist);
H5Fclose (ifile);
- exit (EXIT_SUCCESS);
+ return (EXIT_SUCCESS);
}
diff --git a/tools/h5ls/Makefile.in b/tools/h5ls/Makefile.in
index 0ecf657..40fd20a 100644
--- a/tools/h5ls/Makefile.in
+++ b/tools/h5ls/Makefile.in
@@ -1,4 +1,3 @@
-## HDF5 Library Makefile(.in)
##
## Copyright by the Board of Trustees of the University of Illinois.
## All rights reserved.
@@ -12,6 +11,8 @@
## 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.
##
+## HDF5 Library Makefile(.in)
+##
top_srcdir=@top_srcdir@
top_builddir=../..
srcdir=@srcdir@
diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c
index a77a3bc..f3b5d3a 100644
--- a/tools/h5ls/h5ls.c
+++ b/tools/h5ls/h5ls.c
@@ -80,7 +80,7 @@ static char *fix_name(const char *path, const char *base);
hid_t thefile;
char *prefix;
-char *progname;
+const char *progname="h5ls";
int d_status;
@@ -99,7 +99,7 @@ int d_status;
*-------------------------------------------------------------------------
*/
static void
-usage (const char *progname)
+usage (void)
{
fprintf(stderr, "\
usage: %s [OPTIONS] [OBJECTS...]\n\
@@ -117,6 +117,7 @@ usage: %s [OPTIONS] [OBJECTS...]\n\
-wN, --width=N Set the number of columns of output\n\
-v, --verbose Generate more verbose output\n\
-V, --version Print version number and exit\n\
+ --vfd=DRIVER Use the specified virtual file driver\n\
-x, --hexdump Show raw data in hexadecimal format\n\
\n\
OBJECTS\n\
@@ -1328,26 +1329,38 @@ list_attr (hid_t obj, const char *attr_name, void UNUSED *op_data)
hsize_t temp_need;
void *buf;
h5dump_t info;
+ H5S_class_t space_type;
printf(" Attribute: ");
n = display_string(stdout, attr_name, TRUE);
printf("%*s", MAX(0, 9-n), "");
+
if ((attr = H5Aopen_name(obj, attr_name))) {
space = H5Aget_space(attr);
type = H5Aget_type(attr);
/* Data space */
ndims = H5Sget_simple_extent_dims(space, size, NULL);
- if (0==ndims) {
- puts(" scalar");
- } else {
- printf(" {");
- for (i=0; i<ndims; i++) {
- HDfprintf(stdout, "%s%Hu", i?", ":"", size[i]);
- nelmts *= size[i];
- }
- puts("}");
- }
+ space_type = H5Sget_simple_extent_type(space);
+ switch (space_type) {
+ case H5S_SCALAR:
+ /* scalar dataspace */
+ puts(" scalar");
+ break;
+ case H5S_SIMPLE:
+ /* simple dataspace */
+ printf(" {");
+ for (i=0; i<ndims; i++) {
+ HDfprintf(stdout, "%s%Hu", i?", ":"", size[i]);
+ nelmts *= size[i];
+ }
+ puts("}");
+ break;
+ default:
+ /* Unknown dataspace type */
+ puts(" unknown");
+ break;
+ }
/* Data type */
printf(" Type: ");
@@ -1441,11 +1454,13 @@ dataset_list1(hid_t dset)
hsize_t max_size[64]; /* maximum dataset dimensions */
hid_t space; /* data space */
int ndims; /* dimensionality */
+ H5S_class_t space_type; /* type of dataspace */
int i;
/* Information that goes on the same row as the name. The name has
* already been printed. */
space = H5Dget_space(dset);
+ space_type = H5Sget_simple_extent_type(space);
ndims = H5Sget_simple_extent_dims(space, cur_size, max_size);
printf (" {");
for (i=0; i<ndims; i++) {
@@ -1456,7 +1471,7 @@ dataset_list1(hid_t dset)
HDfprintf(stdout, "/%Hu", max_size[i]);
}
}
- if (0==ndims) printf("SCALAR");
+ if (space_type==H5S_SCALAR) printf("SCALAR");
putchar('}');
H5Sclose (space);
@@ -1541,7 +1556,7 @@ dataset_list2(hid_t dset, const char UNUSED *name)
/* Print information about external strorage */
if ((nf = H5Pget_external_count(dcpl))>0) {
for (i=0, max_len=0; i<nf; i++) {
- H5Pget_external(dcpl, i, sizeof(f_name), f_name, NULL, NULL);
+ H5Pget_external(dcpl, (unsigned)i, sizeof(f_name), f_name, NULL, NULL);
n = display_string(NULL, f_name, TRUE);
max_len = MAX(max_len, n);
}
@@ -1554,7 +1569,7 @@ dataset_list2(hid_t dset, const char UNUSED *name)
for (i=0; i<max_len; i++) putchar('-');
putchar('\n');
for (i=0, total=0; i<nf; i++) {
- if (H5Pget_external(dcpl, i, sizeof(f_name), f_name, &f_offset,
+ if (H5Pget_external(dcpl, (unsigned)i, sizeof(f_name), f_name, &f_offset,
&f_size)<0) {
HDfprintf(stdout,
" #%03d %10Hu %10s %10s ***ERROR*** %s\n",
@@ -1582,7 +1597,7 @@ dataset_list2(hid_t dset, const char UNUSED *name)
if ((nf = H5Pget_nfilters(dcpl))>0) {
for (i=0; i<nf; i++) {
cd_nelmts = NELMTS(cd_values);
- filt_id = H5Pget_filter(dcpl, i, &filt_flags, &cd_nelmts,
+ filt_id = H5Pget_filter(dcpl, (unsigned)i, &filt_flags, &cd_nelmts,
cd_values, sizeof(f_name), f_name);
f_name[sizeof(f_name)-1] = '\0';
sprintf(s, "Filter-%d:", i);
@@ -1603,7 +1618,7 @@ dataset_list2(hid_t dset, const char UNUSED *name)
printf("\n");
/* Print address information */
- if (address_g) H5Ddebug(dset, 0);
+ if (address_g) H5Ddebug(dset);
/* Close stuff */
H5Tclose(type);
@@ -2005,7 +2020,6 @@ main (int argc, const char *argv[])
{
hid_t file=-1, root=-1;
char *fname=NULL, *oname=NULL, *x;
- const char *progname="h5ls";
const char *s = NULL;
char *rest, *container=NULL;
int argno;
@@ -2013,6 +2027,7 @@ main (int argc, const char *argv[])
iter_t iter;
static char root_name[] = "/";
char drivername[50];
+ const char *preferred_driver=NULL;
/* Initialize h5tools lib */
h5tools_init();
@@ -2043,7 +2058,7 @@ main (int argc, const char *argv[])
argno++;
break;
} else if (!strcmp(argv[argno], "--help")) {
- usage(progname);
+ usage();
leave(0);
} else if (!strcmp(argv[argno], "--address")) {
address_g = TRUE;
@@ -2064,22 +2079,24 @@ main (int argc, const char *argv[])
simple_output_g = TRUE;
} else if (!strcmp(argv[argno], "--string")) {
string_g = TRUE;
+ } else if (!strncmp(argv[argno], "--vfd=", 6)) {
+ preferred_driver = argv[argno]+6;
} else if (!strncmp(argv[argno], "--width=", 8)) {
width_g = (int)strtol(argv[argno]+8, &rest, 0);
if (width_g<=0 || *rest) {
- usage(progname);
+ usage();
leave(1);
}
} else if (!strcmp(argv[argno], "--width")) {
if (argno+1>=argc) {
- usage(progname);
+ usage();
leave(1);
} else {
s = argv[++argno];
}
width_g = (int)strtol(s, &rest, 0);
if (width_g<=0 || *rest) {
- usage(progname);
+ usage();
leave(1);
}
} else if (!strcmp(argv[argno], "--verbose")) {
@@ -2093,14 +2110,14 @@ main (int argc, const char *argv[])
if (argv[argno][2]) {
s = argv[argno]+2;
} else if (argno+1>=argc) {
- usage(progname);
+ usage();
leave(1);
} else {
s = argv[++argno];
}
width_g = (int)strtol(s, &rest, 0);
if (width_g<=0 || *rest) {
- usage(progname);
+ usage();
leave(1);
}
} else if ('-'!=argv[argno][1]) {
@@ -2109,7 +2126,7 @@ main (int argc, const char *argv[])
switch (*s) {
case '?':
case 'h': /* --help */
- usage(progname);
+ usage();
leave(0);
case 'a': /* --address */
address_g = TRUE;
@@ -2149,12 +2166,12 @@ main (int argc, const char *argv[])
hexdump_g = TRUE;
break;
default:
- usage(progname);
+ usage();
leave(1);
}
}
} else {
- usage(progname);
+ usage();
leave(1);
}
}
@@ -2162,7 +2179,7 @@ main (int argc, const char *argv[])
/* If no arguments remain then print a usage message (instead of doing
* absolutely nothing ;-) */
if (argno>=argc) {
- usage(progname);
+ usage();
leave(1);
}
@@ -2189,7 +2206,7 @@ main (int argc, const char *argv[])
file = -1;
while (fname && *fname) {
- file = h5tools_fopen(fname, NULL, drivername, sizeof drivername, argc, argv);
+ file = h5tools_fopen(fname, preferred_driver, drivername, sizeof drivername, argc, argv);
if (file>=0) {
if (verbose_g) {
diff --git a/tools/h5repack/Makefile.in b/tools/h5repack/Makefile.in
index 73601d4..5d6a9c3 100644
--- a/tools/h5repack/Makefile.in
+++ b/tools/h5repack/Makefile.in
@@ -29,7 +29,7 @@ CPPFLAGS=-I. -I$(srcdir) -I$(top_builddir)/src -I$(top_srcdir)/src \
##
TEST_PROGS=h5repacktst
TEST_SCRIPTS=./h5repack.sh
-
+PRIV_PROGS=testh5repack_detect_szip
## These are our main targets: library and tools.
##
@@ -37,7 +37,7 @@ LIBHDF5=$(top_builddir)/src/libhdf5.la
LIBTOOLS=../lib/libh5tools.la
PUB_PROGS=h5repack
-PROGS=$(PUB_PROGS) $(TEST_PROGS)
+PROGS=$(PUB_PROGS) $(TEST_PROGS) $(PRIV_PROGS)
## Source and object files for the library; do not install
##
@@ -53,9 +53,10 @@ DISTCLEAN=h5repack.sh
## Source and object files for programs...
##
PROG_SRC=h5repack.c h5repack_copy.c h5repack_filters.c h5repack_refs.c h5repack_list.c h5repack_main.c h5repack_opttable.c h5repack_parse.c h5repack_verify.c testh5repack_attr.c testh5repack_dset.c testh5repack_main.c testh5repack_make.c testh5repack_util.c
-PROG_OBJ=$(PROG_SRC:.c=.lo)
OBJS=h5repack.lo h5repack_filters.lo h5repack_copy.lo h5repack_refs.lo h5repack_list.lo h5repack_main.lo h5repack_opttable.lo h5repack_parse.lo h5repack_verify.lo
TEST_OBJS=h5repack.lo h5repack_filters.lo h5repack_copy.lo h5repack_refs.lo h5repack_list.lo h5repack_opttable.lo h5repack_parse.lo h5repack_verify.lo testh5repack_attr.lo testh5repack_dset.lo testh5repack_main.lo testh5repack_make.lo testh5repack_util.lo
+DETECT_OBJS=testh5repack_detect_szip.lo
+PROG_OBJ=$(PROG_SRC:.c=.lo) $(DETECT_OBJS)
PRIVATE_HDR=
@@ -79,5 +80,8 @@ h5repack: $(OBJS)
h5repacktst: $(TEST_OBJS)
@$(LT_LINK_EXE) $(CFLAGS) -o $@ $(TEST_OBJS) $(LIBTOOLS) $(LIBHDF5) $(LDFLAGS) $(LIBS)
+testh5repack_detect_szip: $(DETECT_OBJS)
+ @$(LT_LINK_EXE) $(CFLAGS) -o $@ $(DETECT_OBJS) $(LIBTOOLS) $(LIBHDF5) $(LDFLAGS) $(LIBS)
+
@CONCLUDE@
diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c
index 2710226..09d83b9 100644
--- a/tools/h5repack/h5repack.c
+++ b/tools/h5repack/h5repack.c
@@ -264,6 +264,9 @@ static int check_options(pack_opt_t *options)
case H5D_CHUNKED:
strcpy(slayout,"chunked");
break;
+ default:
+ strcpy(slayout,"unknown");
+ break;
}
printf(" Apply %s layout to all\n", slayout);
if (H5D_CHUNKED==options->layout_g) {
diff --git a/tools/h5repack/h5repack.h b/tools/h5repack/h5repack.h
index e99888e..e4de4d3 100644
--- a/tools/h5repack/h5repack.h
+++ b/tools/h5repack/h5repack.h
@@ -21,7 +21,6 @@
#include "h5diff.h"
#include "h5tools.h"
-
#define H5FOPENERROR "unable to open file"
#define PFORMAT "%-7s %-7s %-7s\n" /*chunk info, compression info, name*/
@@ -252,6 +251,7 @@ int parse_number(char *str);
* tests
*-------------------------------------------------------------------------
*/
+
#define FNAME0 "test0.h5"
#define FNAME0OUT "test0.out.h5"
#define FNAME1 "test1.h5"
diff --git a/tools/h5repack/h5repack.sh.in b/tools/h5repack/h5repack.sh.in
index a65cb37..a21d608 100755
--- a/tools/h5repack/h5repack.sh.in
+++ b/tools/h5repack/h5repack.sh.in
@@ -14,8 +14,6 @@
#
# Tests for the h5repack tool
-# Determine if SZIP has the encoder available
-USE_FILTER_SZIP_ENCODER="@USE_FILTER_SZIP_ENCODER@"
USE_FILTER_SZIP="@USE_FILTER_SZIP@"
USE_FILTER_DEFLATE="@USE_FILTER_DEFLATE@"
USE_FILTER_SHUFFLE="@USE_FILTER_SHUFFLE@"
@@ -28,6 +26,9 @@ H5REPACK_BIN=`pwd`/$H5REPACK # The path of the tool binary
H5DIFF=../h5diff/h5diff # The h5diff tool name
H5DIFF_BIN=`pwd`/$H5DIFF # The path of the h5diff tool binary
+H5DETECTSZIP=testh5repack_detect_szip # The tool name
+H5DETECTSZIP_BIN=`pwd`/$H5DETECTSZIP # The path of the tool binary
+
nerrors=0
verbose=yes
@@ -123,8 +124,12 @@ TOOLTEST()
# See which filters are usable (and skip tests for filters we
# don't have). Do this by searching H5pubconf.h to see which
# filters are defined.
-# A filter value of 3 means the filter can read and write, 2
-# is read-only, 1 is write-only, and 0 is not present.
+
+# detect whether the encoder is present.
+USE_FILTER_SZIP_ENCODER="no";
+if test $USE_FILTER_SZIP = "yes"; then
+USE_FILTER_SZIP_ENCODER=`$RUNSERIAL $H5DETECTSZIP_BIN`
+fi
# copy files (these files have no filters; test2.h5 has copied references that h5diff detects)
TOOLTEST test0.h5
diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c
index a0fd1c9..c1ae54a 100644
--- a/tools/h5repack/h5repack_copy.c
+++ b/tools/h5repack/h5repack_copy.c
@@ -128,7 +128,7 @@ int copy_objects(const char* fnamein,
pack_opt_t *options)
{
hid_t fidin;
- hid_t fidout;
+ hid_t fidout=(-1);
trav_table_t *travt=NULL;
/*-------------------------------------------------------------------------
@@ -222,17 +222,17 @@ int do_copy_objects(hid_t fidin,
trav_table_t *travt,
pack_opt_t *options) /* repack options */
{
- hid_t grp_in; /* group ID */
- hid_t grp_out; /* group ID */
- hid_t dset_in; /* read dataset ID */
- hid_t dset_out; /* write dataset ID */
- hid_t type_in; /* named type ID */
- hid_t type_out; /* named type ID */
- hid_t dcpl_id; /* dataset creation property list ID */
- hid_t dcpl_out; /* dataset creation property list ID */
- hid_t space_id; /* space ID */
- hid_t ftype_id; /* file data type ID */
- hid_t mtype_id; /* memory data type ID */
+ hid_t grp_in=(-1); /* group ID */
+ hid_t grp_out=(-1); /* group ID */
+ hid_t dset_in=(-1); /* read dataset ID */
+ hid_t dset_out=(-1); /* write dataset ID */
+ hid_t type_in=(-1); /* named type ID */
+ hid_t type_out=(-1); /* named type ID */
+ hid_t dcpl_id=(-1); /* dataset creation property list ID */
+ hid_t dcpl_out=(-1); /* dataset creation property list 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 memory type */
void *buf=NULL; /* data buffer */
hsize_t nelmts; /* number of elements in dataset */
@@ -241,7 +241,6 @@ int do_copy_objects(hid_t fidin,
hsize_t dsize_in; /* input dataset size before filter */
int next; /* external files */
int i, j;
- int wrote=0;
/*-------------------------------------------------------------------------
* copy the suppplied object list
@@ -401,7 +400,6 @@ int do_copy_objects(hid_t fidin,
if (dsize_in && nelmts) {
if (H5Dwrite(dset_out,mtype_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf)<0)
goto error;
- wrote=1;
}
/*-------------------------------------------------------------------------
* copy attrs
@@ -557,7 +555,6 @@ error:
}
-
/*-------------------------------------------------------------------------
* Function: copy_attr
*
diff --git a/tools/h5repack/h5repack_filters.c b/tools/h5repack/h5repack_filters.c
index 844ee5e..5d815c9 100644
--- a/tools/h5repack/h5repack_filters.c
+++ b/tools/h5repack/h5repack_filters.c
@@ -73,15 +73,15 @@ int aux_assign_obj(const char* name, /* object name from traverse lis
pack_info_t *obj /*OUT*/) /* info about object to filter */
{
- int index, i;
+ int idx, i;
pack_info_t tmp;
init_packobject(&tmp);
- index = aux_find_obj(name,options,&tmp);
+ idx = aux_find_obj(name,options,&tmp);
/* name was on input */
- if (index>=0)
+ if (idx>=0)
{
/* applying to all objects */
@@ -102,13 +102,13 @@ int aux_assign_obj(const char* name, /* object name from traverse lis
}
else
{
- tmp.layout = options->op_tbl->objs[index].layout;
+ tmp.layout = options->op_tbl->objs[idx].layout;
switch (tmp.layout)
{
case H5D_CHUNKED:
- tmp.chunk.rank = options->op_tbl->objs[index].chunk.rank;
+ tmp.chunk.rank = options->op_tbl->objs[idx].chunk.rank;
for ( i=0; i<tmp.chunk.rank; i++)
- tmp.chunk.chunk_lengths[i]=options->op_tbl->objs[index].chunk.chunk_lengths[i];
+ tmp.chunk.chunk_lengths[i]=options->op_tbl->objs[idx].chunk.chunk_lengths[i];
break;
default:
break;
@@ -125,15 +125,15 @@ int aux_assign_obj(const char* name, /* object name from traverse lis
} /* if all */
else
{
- tmp.nfilters=options->op_tbl->objs[index].nfilters;
+ tmp.nfilters=options->op_tbl->objs[idx].nfilters;
for ( i=0; i<tmp.nfilters; i++)
{
- tmp.filter[i] = options->op_tbl->objs[index].filter[i];
+ tmp.filter[i] = options->op_tbl->objs[idx].filter[i];
}
}
- } /* if index */
+ } /* if idx */
/* no input name */
diff --git a/tools/h5repack/h5repack_refs.c b/tools/h5repack/h5repack_refs.c
index dedad6b..748eca4 100644
--- a/tools/h5repack/h5repack_refs.c
+++ b/tools/h5repack/h5repack_refs.c
@@ -52,15 +52,15 @@ int do_copy_refobjs(hid_t fidin,
trav_table_t *travt,
pack_opt_t *options) /* repack options */
{
- hid_t grp_in; /* read group ID */
- hid_t grp_out; /* write group ID */
- hid_t dset_in; /* read dataset ID */
- hid_t dset_out; /* write dataset ID */
- hid_t type_in; /* named type ID */
- hid_t dcpl_id; /* dataset creation property list ID */
- hid_t space_id; /* space ID */
- hid_t ftype_id; /* file data type ID */
- hid_t mtype_id; /* memory data type ID */
+ hid_t grp_in=(-1); /* read group ID */
+ hid_t grp_out=(-1); /* write group ID */
+ hid_t dset_in=(-1); /* read dataset ID */
+ hid_t dset_out=(-1); /* write dataset ID */
+ hid_t type_in=(-1); /* named type ID */
+ hid_t dcpl_id=(-1); /* dataset creation property list 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 memory type */
hsize_t nelmts; /* number of elements in dataset */
int rank; /* rank of dataset */
diff --git a/tools/h5repack/testh5repack_dset.c b/tools/h5repack/testh5repack_dset.c
index 4666753..299c044 100644
--- a/tools/h5repack/testh5repack_dset.c
+++ b/tools/h5repack/testh5repack_dset.c
@@ -638,7 +638,7 @@ static void make_dset_reg_ref(hid_t loc_id)
hid_t sid2; /* Dataspace ID #2 */
hsize_t dims1[] = {SPACE1_DIM1};
hsize_t dims2[] = {SPACE2_DIM1, SPACE2_DIM2};
- hssize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
+ hsize_t start[SPACE2_RANK]; /* Starting location of hyperslab */
hsize_t stride[SPACE2_RANK]; /* Stride of hyperslab */
hsize_t count[SPACE2_RANK]; /* Element count of hyperslab */
hsize_t block[SPACE2_RANK]; /* Block size of hyperslab */
diff --git a/tools/h5repack/testh5repack_main.c b/tools/h5repack/testh5repack_main.c
index caa4ac9..6729174 100644
--- a/tools/h5repack/testh5repack_main.c
+++ b/tools/h5repack/testh5repack_main.c
@@ -40,6 +40,9 @@ int main (void)
{
pack_opt_t pack_options;
diff_opt_t diff_options;
+#if defined (H5_HAVE_FILTER_SZIP)
+ int szip_can_encode = 0;
+#endif
memset(&diff_options, 0, sizeof (diff_opt_t));
memset(&pack_options, 0, sizeof (pack_opt_t));
@@ -229,13 +232,17 @@ int main (void)
TESTING(" adding szip filter");
-#if defined (H5_HAVE_FILTER_SZIP) && defined (H5_SZIP_CAN_ENCODE)
+#if defined (H5_HAVE_FILTER_SZIP)
+if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) {
+ szip_can_encode = 1;
+}
/*-------------------------------------------------------------------------
* test an individual object option
*-------------------------------------------------------------------------
*/
+if (szip_can_encode) {
if (h5repack_init (&pack_options, 0)<0)
TEST_ERROR;
if (h5repack_addfilter("dset2:SZIP=8,EC",&pack_options)<0)
@@ -252,6 +259,9 @@ int main (void)
TEST_ERROR;
PASSED();
+} else {
+ SKIPPED();
+}
#else
SKIPPED();
#endif
@@ -263,7 +273,8 @@ int main (void)
*/
TESTING(" adding szip filter to all");
-#if defined (H5_HAVE_FILTER_SZIP) && defined (H5_SZIP_CAN_ENCODE)
+#if defined (H5_HAVE_FILTER_SZIP)
+if (szip_can_encode) {
if (h5repack_init (&pack_options, 0)<0)
TEST_ERROR;
if (h5repack_addfilter("SZIP=8,NN",&pack_options)<0)
@@ -278,6 +289,9 @@ TESTING(" adding szip filter to all");
TEST_ERROR;
PASSED();
+} else {
+ SKIPPED();
+}
#else
SKIPPED();
#endif
@@ -425,9 +439,11 @@ TESTING(" addding shuffle filter to all");
TEST_ERROR;
#endif
-#if defined (H5_SZIP_CAN_ENCODE) && defined (H5_HAVE_FILTER_SZIP)
+#if defined (H5_HAVE_FILTER_SZIP)
+if (szip_can_encode) {
if (h5repack_addfilter("dset1:SZIP=8,NN",&pack_options)<0)
TEST_ERROR;
+}
#endif
#ifdef H5_HAVE_FILTER_DEFLATE
@@ -765,7 +781,8 @@ TESTING(" addding shuffle filter to all");
TESTING(" copy of szip filter");
-#if defined (H5_HAVE_FILTER_SZIP) && defined (H5_SZIP_CAN_ENCODE)
+#if defined (H5_HAVE_FILTER_SZIP)
+if (szip_can_encode) {
if (h5repack_init (&pack_options, 0)<0)
TEST_ERROR;
if (h5repack(FNAME7,FNAME7OUT,&pack_options)<0)
@@ -778,13 +795,17 @@ TESTING(" addding shuffle filter to all");
TEST_ERROR;
PASSED();
+} else {
+ SKIPPED();
+}
#else
SKIPPED();
#endif
TESTING(" removing szip filter");
-#if defined (H5_HAVE_FILTER_SZIP) && defined (H5_SZIP_CAN_ENCODE)
+#if defined (H5_HAVE_FILTER_SZIP)
+if (szip_can_encode) {
if (h5repack_init (&pack_options, 0)<0)
TEST_ERROR;
if (h5repack_addfilter("dset_szip:NONE",&pack_options)<0)
@@ -799,6 +820,9 @@ TESTING(" addding shuffle filter to all");
TEST_ERROR;
PASSED();
+} else {
+ SKIPPED();
+}
#else
SKIPPED();
#endif
@@ -941,10 +965,11 @@ TESTING(" addding shuffle filter to all");
TESTING(" filter conversion from deflate to szip");
-#if defined (H5_HAVE_FILTER_SZIP) && defined (H5_SZIP_CAN_ENCODE) \
+#if defined (H5_HAVE_FILTER_SZIP) \
&& defined (H5_HAVE_FILTER_DEFLATE) \
&& defined (H5_HAVE_FILTER_FLETCHER32) && defined (H5_HAVE_FILTER_SHUFFLE)
+if (szip_can_encode) {
if (h5repack_init (&pack_options, 0)<0)
TEST_ERROR;
if (h5repack_addfilter("dset_deflate:SZIP=8,NN",&pack_options)<0)
@@ -959,16 +984,20 @@ TESTING(" addding shuffle filter to all");
TEST_ERROR;
PASSED();
+} else {
+ SKIPPED();
+}
#else
SKIPPED();
#endif
TESTING(" filter conversion from szip to deflate");
-#if defined (H5_HAVE_FILTER_SZIP) && defined (H5_SZIP_CAN_ENCODE) \
+#if defined (H5_HAVE_FILTER_SZIP) \
&& defined (H5_HAVE_FILTER_DEFLATE) \
&& defined (H5_HAVE_FILTER_FLETCHER32) && defined (H5_HAVE_FILTER_SHUFFLE)
+if (szip_can_encode) {
if (h5repack_init (&pack_options, 0)<0)
TEST_ERROR;
if (h5repack_addfilter("dset_szip:GZIP=1",&pack_options)<0)
@@ -983,6 +1012,9 @@ TESTING(" addding shuffle filter to all");
TEST_ERROR;
PASSED();
+} else {
+ SKIPPED();
+}
#else
SKIPPED();
#endif
diff --git a/tools/h5repack/testh5repack_make.c b/tools/h5repack/testh5repack_make.c
index 3cf7c11..65a1c4a 100644
--- a/tools/h5repack/testh5repack_make.c
+++ b/tools/h5repack/testh5repack_make.c
@@ -27,7 +27,9 @@ int make_attributes(hid_t loc_id);
int make_hlinks(hid_t loc_id);
int make_early(void);
int make_layout(hid_t loc_id);
+#ifdef H5_HAVE_FILTER_SZIP
int make_szip(hid_t loc_id);
+#endif /* H5_HAVE_FILTER_SZIP */
int make_deflate(hid_t loc_id);
int make_shuffle(hid_t loc_id);
int make_fletcher32(hid_t loc_id);
@@ -113,12 +115,14 @@ int make_testfiles(void)
* create a file with the SZIP filter
*-------------------------------------------------------------------------
*/
+#ifdef H5_HAVE_FILTER_SZIP
if((loc_id = H5Fcreate(FNAME7,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0)
return -1;
if (make_szip(loc_id)<0)
goto out;
if(H5Fclose(loc_id)<0)
return -1;
+#endif /* H5_HAVE_FILTER_SZIP */
/*-------------------------------------------------------------------------
* create a file with the deflate filter
@@ -362,6 +366,7 @@ int make_hlinks(hid_t loc_id)
*
*-------------------------------------------------------------------------
*/
+#ifdef H5_HAVE_FILTER_SZIP
int make_szip(hid_t loc_id)
{
hid_t dcpl; /* dataset creation property list */
@@ -372,6 +377,7 @@ int make_szip(hid_t loc_id)
hsize_t chunk_dims[RANK]={CDIM1,CDIM2};
int buf[DIM1][DIM2];
int i, j, n;
+ int szip_can_encode = 0;
for (i=n=0; i<DIM1; i++){
for (j=0; j<DIM2; j++){
@@ -393,13 +399,18 @@ int make_szip(hid_t loc_id)
*-------------------------------------------------------------------------
*/
/* Make sure encoding is enabled */
-#if defined (H5_SZIP_CAN_ENCODE) && defined (H5_HAVE_FILTER_SZIP)
+if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) {
+ szip_can_encode = 1;
+}
+if (szip_can_encode) {
/* set szip data */
if(H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block)<0)
goto out;
if (make_dset(loc_id,"dset_szip",sid,dcpl,buf)<0)
goto out;
-#endif
+} else {
+ /* WARNING? SZIP is decoder only, can't generate test files */
+}
if(H5Sclose(sid)<0)
goto out;
@@ -415,6 +426,7 @@ out:
} H5E_END_TRY;
return -1;
}
+#endif /* H5_HAVE_FILTER_SZIP */
@@ -623,12 +635,17 @@ int make_all(hid_t loc_id)
{
hid_t dcpl; /* dataset creation property list */
hid_t sid; /* dataspace ID */
+#if defined (H5_HAVE_FILTER_SZIP)
unsigned szip_options_mask=H5_SZIP_ALLOW_K13_OPTION_MASK|H5_SZIP_NN_OPTION_MASK;
unsigned szip_pixels_per_block=8;
+#endif /* H5_HAVE_FILTER_SZIP */
hsize_t dims[RANK]={DIM1,DIM2};
hsize_t chunk_dims[RANK]={CDIM1,CDIM2};
int buf[DIM1][DIM2];
int i, j, n;
+#if defined (H5_HAVE_FILTER_SZIP)
+ int szip_can_encode = 0;
+#endif
for (i=n=0; i<DIM1; i++){
for (j=0; j<DIM2; j++){
@@ -657,10 +674,17 @@ int make_all(hid_t loc_id)
goto out;
#endif
-#if defined (H5_SZIP_CAN_ENCODE) && defined (H5_HAVE_FILTER_SZIP)
+#if defined (H5_HAVE_FILTER_SZIP)
+if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) {
+ szip_can_encode = 1;
+}
+if (szip_can_encode) {
/* set szip data */
if(H5Pset_szip (dcpl,szip_options_mask,szip_pixels_per_block)<0)
goto out;
+} else {
+ /* WARNING? SZIP is decoder only, can't generate test data using szip */
+}
#endif
#if defined (H5_HAVE_FILTER_DEFLATE)
@@ -692,7 +716,8 @@ int make_all(hid_t loc_id)
*-------------------------------------------------------------------------
*/
/* Make sure encoding is enabled */
-#if defined (H5_SZIP_CAN_ENCODE) && defined (H5_HAVE_FILTER_SZIP)
+#if defined (H5_HAVE_FILTER_SZIP)
+if (szip_can_encode) {
/* remove the filters from the dcpl */
if (H5Premove_filter(dcpl,H5Z_FILTER_ALL)<0)
goto out;
@@ -701,6 +726,9 @@ int make_all(hid_t loc_id)
goto out;
if (make_dset(loc_id,"dset_szip",sid,dcpl,buf)<0)
goto out;
+} else {
+ /* WARNING? SZIP is decoder only, can't generate test dataset */
+}
#endif
/*-------------------------------------------------------------------------
diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c
index f5ba995..c48998f 100644
--- a/tools/lib/h5diff.c
+++ b/tools/lib/h5diff.c
@@ -55,7 +55,7 @@ hsize_t h5diff(const char *fname1,
int nobjects1, nobjects2;
trav_info_t *info1=NULL;
trav_info_t *info2=NULL;
- hid_t file1_id, file2_id;
+ hid_t file1_id=(-1), file2_id=(-1);
hsize_t nfound=0;
if (options->m_quiet &&
@@ -414,10 +414,10 @@ hsize_t diff( hid_t file1_id,
diff_opt_t *options,
H5G_obj_t1 type )
{
- hid_t type1_id;
- hid_t type2_id;
- hid_t grp1_id;
- hid_t grp2_id;
+ hid_t type1_id=(-1);
+ hid_t type2_id=(-1);
+ hid_t grp1_id=(-1);
+ hid_t grp2_id=(-1);
int ret;
H5G_stat_t sb1;
H5G_stat_t sb2;
@@ -436,7 +436,7 @@ hsize_t diff( hid_t file1_id,
/* always print name */
if (options->m_verbose)
{
- if (print_objname(options,1))
+ if (print_objname(options,(hsize_t)1))
printf( "Dataset: <%s> and <%s>\n",path1,path2);
nfound=diff_dataset(file1_id,file2_id,path1,path2,options);
diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h
index 4caf60f..bb24fe0 100644
--- a/tools/lib/h5diff.h
+++ b/tools/lib/h5diff.h
@@ -337,7 +337,6 @@ hsize_t diff_long(unsigned char *mem1,
const char *obj2,
int *ph);
-
hsize_t diff_ulong(unsigned char *mem1,
unsigned char *mem2,
hsize_t nelmts,
diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c
index 1265864..0e222dd 100644
--- a/tools/lib/h5diff_array.c
+++ b/tools/lib/h5diff_array.c
@@ -18,11 +18,7 @@
/* local functions */
-#ifdef H5_WANT_H5_V1_4_COMPAT
-static void close_obj(int obj_type, hid_t obj_id);
-#else /* H5_WANT_H5_V1_4_COMPAT */
-static void close_obj(H5G_obj_t obj_type, hid_t obj_id);
-#endif /* H5_WANT_H5_V1_4_COMPAT */
+static void close_obj(H5G_obj_t1 obj_type, hid_t obj_id);
static int diff_region(hid_t region1_id, hid_t region2_id);
static hbool_t is_zero(const void *_mem, size_t size);
@@ -258,13 +254,8 @@ hsize_t diff_datum(void *_mem1,
size_t size;
int iszero1;
int iszero2;
-#ifdef H5_WANT_H5_V1_4_COMPAT
- int obj1_type;
- int obj2_type;
-#else /* H5_WANT_H5_V1_4_COMPAT */
- H5G_obj_t obj1_type;
- H5G_obj_t obj2_type;
-#endif /* H5_WANT_H5_V1_4_COMPAT */
+ H5G_obj_t1 obj1_type;
+ H5G_obj_t1 obj2_type;
hid_t obj1_id;
hid_t obj2_id;
H5G_stat_t sb1;
@@ -1723,13 +1714,8 @@ is_zero(const void *_mem, size_t size)
*-------------------------------------------------------------------------
*/
-#ifdef H5_WANT_H5_V1_4_COMPAT
static
-void close_obj(int obj_type, hid_t obj_id)
-#else /* H5_WANT_H5_V1_4_COMPAT */
-static
-void close_obj(H5G_obj_t obj_type, hid_t obj_id)
-#endif /* H5_WANT_H5_V1_4_COMPAT */
+void close_obj(H5G_obj_t1 obj_type, hid_t obj_id)
{
switch (obj_type) {
@@ -3041,7 +3027,7 @@ hsize_t diff_long(unsigned char *mem1,
memcpy(&temp1_long, mem1, sizeof(long));
memcpy(&temp2_long, mem2, sizeof(long));
- if (labs(temp1_long-temp2_long) > options->delta)
+ if (labs(temp1_long-temp2_long) > (long)options->delta)
{
if ( print_data(options) )
{
@@ -3098,7 +3084,7 @@ hsize_t diff_long(unsigned char *mem1,
memcpy(&temp2_long, mem2, sizeof(long));
if ( temp1_long!=0 && labs(1-temp2_long/temp1_long) > options->percent &&
- labs(temp1_long-temp2_long) > options->delta )
+ labs(temp1_long-temp2_long) > (long)options->delta )
{
if ( print_data(options) )
{
@@ -3184,7 +3170,7 @@ hsize_t diff_ulong(unsigned char *mem1,
memcpy(&temp1_ulong, mem1, sizeof(unsigned long));
memcpy(&temp2_ulong, mem2, sizeof(unsigned long));
- if (labs(temp1_ulong-temp2_ulong) > options->delta)
+ if (labs((long)(temp1_ulong-temp2_ulong)) > (long)options->delta)
{
if ( print_data(options) )
{
diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c
index 675f3a1..fb4343f 100644
--- a/tools/lib/h5diff_attr.c
+++ b/tools/lib/h5diff_attr.c
@@ -12,9 +12,9 @@
* access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+#include "h5tools.h"
#include "h5diff.h"
#include "H5private.h"
-#include "h5tools.h"
/*-------------------------------------------------------------------------
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index 74e4e8c..60377c0 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -168,7 +168,13 @@ h5tools_close(void)
*-------------------------------------------------------------------------
*/
static hid_t
-h5tools_get_fapl(const char *driver, unsigned *drivernum, int argc, const char *argv[])
+h5tools_get_fapl(const char *driver, unsigned *drivernum,
+#ifdef H5_HAVE_PARALLEL
+int argc, const char *argv[]
+#else /* H5_HAVE_PARALLEL */
+int UNUSED argc, const char UNUSED *argv[]
+#endif /* H5_HAVE_PARALLEL */
+)
{
hid_t fapl = H5P_DEFAULT;
@@ -180,6 +186,9 @@ h5tools_get_fapl(const char *driver, unsigned *drivernum, int argc, const char *
} 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.
+ */
H5Pset_fapl_family(fapl, (hsize_t)0, H5P_DEFAULT);
if(drivernum)
@@ -689,7 +698,7 @@ h5tools_dump_simple_subset(FILE *stream, const h5dump_t *info, hid_t dset,
herr_t ret; /*the value to return */
hid_t f_space; /*file data space */
int i; /*counters */
- hssize_t zero = 0; /*vector of zeros */
+ hsize_t zero = 0; /*vector of zeros */
unsigned int flags; /*buffer extent flags */
hsize_t total_size[H5S_MAX_RANK];/*total size of dataset*/
@@ -741,10 +750,10 @@ h5tools_dump_simple_subset(FILE *stream, const h5dump_t *info, hid_t dset,
count--) {
/* calculate the potential number of elements we're going to print */
H5Sselect_hyperslab(f_space, H5S_SELECT_SET,
- (hssize_t*)sset->start,
- (hsize_t*)sset->stride,
- (hsize_t*)sset->count,
- (hsize_t*)sset->block);
+ sset->start,
+ sset->stride,
+ sset->count,
+ sset->block);
sm_nelmts = H5Sget_select_npoints(f_space);
/*
@@ -850,10 +859,10 @@ h5tools_dump_simple_dset(FILE *stream, const h5dump_t *info, hid_t dset,
hid_t p_type, int indentlevel)
{
hid_t f_space; /*file data space */
- hsize_t elmtno; /*counter */
- int i; /*counter */
+ hsize_t elmtno; /*counter */
+ int i; /*counter */
int carry; /*counter carry value */
- hssize_t zero[8]; /*vector of zeros */
+ hsize_t zero[8]; /*vector of zeros */
unsigned int flags; /*buffer extent flags */
hsize_t total_size[H5S_MAX_RANK];/*total size of dataset*/
@@ -870,7 +879,7 @@ h5tools_dump_simple_dset(FILE *stream, const h5dump_t *info, hid_t dset,
hid_t sm_space; /*stripmine data space */
/* Hyperslab info */
- hssize_t hs_offset[H5S_MAX_RANK];/*starting offset */
+ hsize_t hs_offset[H5S_MAX_RANK];/*starting offset */
hsize_t hs_size[H5S_MAX_RANK]; /*size this pass */
hsize_t hs_nelmts; /*elements in request */
@@ -987,12 +996,11 @@ h5tools_dump_simple_dset(FILE *stream, const h5dump_t *info, hid_t dset,
H5Dvlen_reclaim(p_type, sm_space, H5P_DEFAULT, sm_buf);
/* Calculate the next hyperslab offset */
-
for (i = ctx.ndims, carry = 1; i > 0 && carry; --i) {
ctx.p_min_idx[i - 1] = ctx.p_max_idx[i - 1];
hs_offset[i - 1] += hs_size[i - 1];
- if (hs_offset[i - 1] == (hssize_t)total_size[i - 1])
+ if (hs_offset[i - 1] == total_size[i - 1])
hs_offset[i - 1] = 0;
else
carry = 0;
@@ -1037,7 +1045,7 @@ static int
h5tools_dump_simple_mem(FILE *stream, const h5dump_t *info, hid_t obj_id,
hid_t type, hid_t space, void *mem, int indentlevel)
{
- int i; /*counters */
+ int i; /*counters */
hsize_t nelmts; /*total selected elmts */
h5tools_context_t ctx; /*printing context */
@@ -1126,6 +1134,7 @@ h5tools_dump_dset(FILE *stream, const h5dump_t *info, hid_t dset, hid_t _p_type,
hid_t f_space;
hid_t p_type = _p_type;
hid_t f_type;
+ H5S_class_t space_type;
int status = FAIL;
h5dump_t info_dflt;
@@ -1155,15 +1164,18 @@ h5tools_dump_dset(FILE *stream, const h5dump_t *info, hid_t dset, hid_t _p_type,
/* Check the data space */
f_space = H5Dget_space(dset);
+ space_type = H5Sget_simple_extent_type(f_space);
+
/* Print the data */
- if (H5Sis_simple(f_space) > 0) {
+ if (space_type == H5S_SIMPLE || space_type == H5S_SCALAR) {
if (!sset)
status = h5tools_dump_simple_dset(rawdatastream, info, dset, p_type,
indentlevel);
else
status = h5tools_dump_simple_subset(rawdatastream, info, dset, p_type,
sset, indentlevel);
- }
+ } else /* space is H5S_NULL */
+ status = SUCCEED;
/* Close the dataspace */
H5Sclose(f_space);
@@ -1215,3 +1227,4 @@ h5tools_dump_mem(FILE *stream, const h5dump_t *info, hid_t obj_id, hid_t type,
return h5tools_dump_simple_mem(stream, info, obj_id, type, space, mem,
indentlevel);
}
+
diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h
index f43941f..d5603f7 100644
--- a/tools/lib/h5tools.h
+++ b/tools/lib/h5tools.h
@@ -419,7 +419,7 @@ typedef struct h5tools_context_t {
/* a structure to hold the subsetting particulars for a dataset */
struct subset_t {
- hssize_t *start;
+ hsize_t *start;
hsize_t *stride;
hsize_t *count;
hsize_t *block;
@@ -463,8 +463,8 @@ extern FILE *rawdatastream; /*output stream for raw data */
#define NLINK "NLINK"
#define OBJID "OBJECTID"
#define OBJNO "OBJNO"
-#define SCALAR "SCALAR"
-#define SIMPLE "SIMPLE"
+#define S_SCALAR "SCALAR"
+#define S_SIMPLE "SIMPLE"
#define SOFTLINK "SOFTLINK"
#define STORAGELAYOUT "STORAGELAYOUT"
#define START "START"
@@ -508,5 +508,6 @@ extern void h5tools_dump_simple_data(FILE *stream, const h5dump_t *info, hid
extern int h5tools_canreadf(const char* name,
hid_t dcpl_id);
+extern int h5tools_can_encode(H5Z_filter_t filtn);
#endif /* H5TOOLS_H__ */
diff --git a/tools/lib/h5tools_filters.c b/tools/lib/h5tools_filters.c
index 3c0cb25..11ebae7 100644
--- a/tools/lib/h5tools_filters.c
+++ b/tools/lib/h5tools_filters.c
@@ -82,7 +82,6 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr
switch (filtn)
{
-
/*-------------------------------------------------------------------------
* user defined filter
*-------------------------------------------------------------------------
@@ -91,7 +90,7 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr
if (name)
print_warning(name,"user defined");
return 0;
- break;
+
/*-------------------------------------------------------------------------
* H5Z_FILTER_DEFLATE 1 , deflation like gzip
*-------------------------------------------------------------------------
@@ -147,5 +146,95 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr
}
+/*-------------------------------------------------------------------------
+ * Function: h5tools_canwritef
+ *
+ * Purpose: check if the filter is available and can write data.
+ * At this time, all filters that are available can write data,
+ * except SZIP, which may be configured decoder-only.
+ *
+ * Return: 1, can write, 0, cannot, -1 error
+ *
+ * Programmer:
+ *
+ * Date: October 5, 2004
+ *
+ *-------------------------------------------------------------------------
+ */
+int h5tools_can_encode( H5Z_filter_t filtn)
+{
-
+ int have_deflate=0; /* assume initially we do not have filters */
+ int have_szip=0;
+ int have_shuffle=0;
+ int have_fletcher=0;
+ unsigned int filter_config_flags;
+
+#ifdef H5_HAVE_FILTER_DEFLATE
+ have_deflate=1;
+#endif
+#ifdef H5_HAVE_FILTER_SZIP
+ have_szip=1;
+#endif
+#ifdef H5_HAVE_FILTER_SHUFFLE
+ have_shuffle=1;
+#endif
+#ifdef H5_HAVE_FILTER_FLETCHER32
+ have_fletcher=1;
+#endif
+
+ switch (filtn)
+ {
+ /* user defined filter */
+ default:
+ return 0;
+
+ case H5Z_FILTER_DEFLATE:
+ if (!have_deflate)
+ {
+ return 0;
+ }
+ break;
+ case H5Z_FILTER_SZIP:
+ if (!have_szip)
+ {
+ return 0;
+ }
+ if(H5Zget_filter_info(filtn, &filter_config_flags)<0)
+ return -1;
+ 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)) ==
+ 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)) ==
+ 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)) {
+ return 1;
+ }
+ break;
+ case H5Z_FILTER_SHUFFLE:
+ if (!have_shuffle)
+ {
+ return 0;
+ }
+ break;
+ case H5Z_FILTER_FLETCHER32:
+ if (!have_fletcher)
+ {
+ return 0;
+ }
+ break;
+ }/*switch*/
+
+ return 1;
+}
diff --git a/tools/lib/h5tools_ref.c b/tools/lib/h5tools_ref.c
index 4506994..87df63e 100644
--- a/tools/lib/h5tools_ref.c
+++ b/tools/lib/h5tools_ref.c
@@ -41,8 +41,7 @@ extern char *progname;
extern int d_status;
-struct ref_path_table_entry_t *ref_path_table = NULL; /* the table */
-int npte = 0; /* number of entries in the table */
+ref_path_table_entry_t *ref_path_table = NULL; /* the table */
/*-------------------------------------------------------------------------
* Function: ref_path_table_lookup
@@ -59,36 +58,22 @@ int npte = 0; /* number of entries in the table */
*
*-------------------------------------------------------------------------
*/
-struct ref_path_table_entry_t *
+ref_path_table_entry_t *
ref_path_table_lookup(const char *thepath)
{
- int i;
- hobj_ref_t *ref;
- herr_t status;
- struct ref_path_table_entry_t *pte = ref_path_table;
+ hobj_ref_t ref;
+ ref_path_table_entry_t *pte = ref_path_table;
if (ref_path_table == NULL)
return NULL;
- ref = (hobj_ref_t *) malloc(sizeof(hobj_ref_t));
-
- if (ref == NULL) {
+ if ( H5Rcreate(&ref, thefile, thepath, H5R_OBJECT, -1) < 0)
/* fatal error ? */
return NULL;
- }
-
- status = H5Rcreate(ref, thefile, thepath, H5R_OBJECT, -1);
- if (status < 0) {
- /* fatal error ? */
- return NULL;
- }
-
- for (i = 0; i < npte; i++) {
- if (memcmp(ref, pte->obj_ref, sizeof(hobj_ref_t)) == 0) {
+ while(pte!=NULL) {
+ if(ref==pte->obj_ref)
return pte;
- }
-
pte = pte->next;
}
@@ -111,64 +96,43 @@ ref_path_table_lookup(const char *thepath)
*
*-------------------------------------------------------------------------
*/
-hobj_ref_t *
+ref_path_table_entry_t *
ref_path_table_put(hid_t obj, const char *path)
{
- hobj_ref_t *ref;
- H5G_stat_t *sb;
- herr_t status;
- struct ref_path_table_entry_t *pte;
+ ref_path_table_entry_t *pte;
/* look up 'obj'. If already in table, return */
pte = ref_path_table_lookup(path);
if (pte != NULL)
- return pte->obj_ref;
+ return pte;
/* if not found, then make new entry */
- pte = (struct ref_path_table_entry_t *)
- malloc(sizeof(struct ref_path_table_entry_t));
- if (pte == NULL) {
+ pte = (ref_path_table_entry_t *) malloc(sizeof(ref_path_table_entry_t));
+ if (pte == NULL)
/* fatal error? */
return NULL;
- }
pte->obj = obj;
- ref = (hobj_ref_t *) malloc(sizeof(hobj_ref_t));
- if (ref == NULL) {
- /* fatal error? */
- free(pte);
- return NULL;
- }
- status = H5Rcreate(ref, thefile, path, H5R_OBJECT, -1);
- if (status < 0) {
+ if ( H5Rcreate(&pte->obj_ref, thefile, path, H5R_OBJECT, -1) < 0) {
/* fatal error? */
- free(ref);
free(pte);
return NULL;
}
- pte->obj_ref = ref;
-
pte->apath = HDstrdup(path);
- sb = (H5G_stat_t *) malloc(sizeof(H5G_stat_t));
- if (sb == NULL) {
+ if(H5Gget_objinfo(thefile, path, TRUE, &pte->statbuf)<0) {
/* fatal error? */
free(pte);
return NULL;
}
- H5Gget_objinfo(thefile, path, TRUE, sb);
-
- memcpy((char *)&(pte->statbuf),(char *)sb,sizeof(H5G_stat_t));
pte->next = ref_path_table;
ref_path_table = pte;
- npte++;
-
- return ref;
+ return pte;
}
/*
@@ -197,66 +161,46 @@ get_fake_xid () {
* create a table entry with a fake object id as the key.
*/
-struct ref_path_table_entry_t *
+ref_path_table_entry_t *
ref_path_table_gen_fake(const char *path)
{
- union {
- hobj_ref_t rr;
- char cc[16];
- unsigned long ll[2];
- } uu;
- hobj_ref_t *ref;
- H5G_stat_t *sb;
- struct ref_path_table_entry_t *pte;
+ union {
+ hobj_ref_t rr;
+ char cc[16];
+ unsigned long ll[2];
+ } uu;
+ H5G_stat_t sb;
+ ref_path_table_entry_t *pte;
/* look up 'obj'. If already in table, return */
pte = ref_path_table_lookup(path);
- if (pte != NULL) {
+ if (pte != NULL)
return pte;
- }
/* if not found, then make new entry */
- pte = (struct ref_path_table_entry_t *)
- malloc(sizeof(struct ref_path_table_entry_t));
- if (pte == NULL) {
+ pte = (ref_path_table_entry_t *) malloc(sizeof(ref_path_table_entry_t));
+ if (pte == NULL)
/* fatal error? */
return NULL;
- }
pte->obj = (hid_t)-1;
- sb = (H5G_stat_t *) malloc(sizeof(H5G_stat_t));
- if (sb == NULL) {
- /* fatal error? */
- free(pte);
- return NULL;
- }
- sb->objno[0] = (unsigned long)get_fake_xid();
- sb->objno[1] = (unsigned long)get_fake_xid();
+ sb.objno[0] = (unsigned long)get_fake_xid();
+ sb.objno[1] = (unsigned long)get_fake_xid();
- memcpy((char *)&(pte->statbuf),(char *)sb,sizeof(H5G_stat_t));
+ memcpy(&pte->statbuf,&sb,sizeof(H5G_stat_t));
- ref = (hobj_ref_t *) malloc(sizeof(hobj_ref_t));
- if (ref == NULL) {
- free(pte);
- return NULL;
- }
-
- uu.ll[0] = sb->objno[0];
- uu.ll[1] = sb->objno[1];
-
- memcpy((char *)ref,(char *)&uu.rr,sizeof(ref));
+ uu.ll[0] = sb.objno[0];
+ uu.ll[1] = sb.objno[1];
- pte->obj_ref = ref;
+ memcpy(&pte->obj_ref,(char *)&uu.rr,sizeof(pte->obj_ref));
pte->apath = HDstrdup(path);
pte->next = ref_path_table;
ref_path_table = pte;
- npte++;
-
return pte;
}
@@ -273,24 +217,14 @@ ref_path_table_gen_fake(const char *path)
*
*-------------------------------------------------------------------------
*/
-char*
-lookup_ref_path(hobj_ref_t * ref)
+char *
+lookup_ref_path(hobj_ref_t ref)
{
- int i;
- struct ref_path_table_entry_t *pte = NULL;
+ ref_path_table_entry_t *pte = ref_path_table;
- if (ref_path_table == NULL)
- return NULL;
-
- pte = ref_path_table;
- if (pte == NULL) {
- /* fatal -- not initialized? */
- return NULL;
- }
- for (i = 0; i < npte; i++) {
- if (memcmp(ref, pte->obj_ref, sizeof(hobj_ref_t)) == 0) {
+ while(pte!=NULL) {
+ if (ref==pte->obj_ref)
return pte->apath;
- }
pte = pte->next;
}
return NULL;
@@ -316,7 +250,7 @@ fill_ref_path_table(hid_t group, const char *name, void UNUSED * op_data)
hid_t obj;
char *tmp;
H5G_stat_t statbuf;
- struct ref_path_table_entry_t *pte;
+ ref_path_table_entry_t *pte;
char *thepath;
H5Gget_objinfo(group, name, FALSE, &statbuf);
@@ -342,12 +276,11 @@ fill_ref_path_table(hid_t group, const char *name, void UNUSED * op_data)
case H5G_DATASET:
if ((obj = H5Dopen(group, name)) >= 0) {
pte = ref_path_table_lookup(thepath);
- if (pte == NULL) {
+ if (pte == NULL)
ref_path_table_put(obj, thepath);
- }
H5Dclose(obj);
} else {
- error_msg(progname, "unable to get dataset \"%s\"\n", name);
+ error_msg(progname, "unable to get dataset \"%s\"\n", name);
d_status = EXIT_FAILURE;
}
break;
@@ -369,9 +302,8 @@ fill_ref_path_table(hid_t group, const char *name, void UNUSED * op_data)
case H5G_TYPE:
if ((obj = H5Topen(group, name)) >= 0) {
pte = ref_path_table_lookup(thepath);
- if (pte == NULL) {
+ if (pte == NULL)
ref_path_table_put(obj, thepath);
- }
H5Tclose(obj);
} else {
error_msg(progname, "unable to get dataset \"%s\"\n", name);
diff --git a/tools/lib/h5tools_ref.h b/tools/lib/h5tools_ref.h
index 5df2d38..35c1ce3 100644
--- a/tools/lib/h5tools_ref.h
+++ b/tools/lib/h5tools_ref.h
@@ -19,7 +19,7 @@
typedef struct ref_path_table_entry_t {
hid_t obj;
- hobj_ref_t *obj_ref;
+ hobj_ref_t obj_ref;
char *apath;
H5G_stat_t statbuf;
struct ref_path_table_entry_t *next;
@@ -29,12 +29,12 @@ typedef struct ref_path_table_entry_t {
extern "C" {
#endif
-char* lookup_ref_path(hobj_ref_t * ref);
+char* lookup_ref_path(hobj_ref_t ref);
herr_t fill_ref_path_table(hid_t, const char *, void *);
int get_next_xid(void);
haddr_t get_fake_xid (void);
struct ref_path_table_entry_t *ref_path_table_lookup(const char *);
-hobj_ref_t *ref_path_table_put(hid_t, const char *);
+ref_path_table_entry_t *ref_path_table_put(hid_t obj, const char *path);
struct ref_path_table_entry_t *ref_path_table_gen_fake(const char *);
#ifdef __cplusplus
diff --git a/tools/lib/h5tools_str.c b/tools/lib/h5tools_str.c
index 1bf3ec0..6e48190 100644
--- a/tools/lib/h5tools_str.c
+++ b/tools/lib/h5tools_str.c
@@ -885,8 +885,8 @@ h5tools_str_sprint(h5tools_str_t *str, const h5dump_t *info, hid_t container,
h5tools_str_append(str, info->obj_format,
sb.fileno[1], sb.fileno[0], sb.objno[1], sb.objno[0]);
- /* Print name */
- path = lookup_ref_path(vp);
+ /* Print name */
+ path = lookup_ref_path(*(hobj_ref_t *)vp);
if (path) {
h5tools_str_append(str, " ");
h5tools_str_append(str, path);
diff --git a/tools/lib/h5trav.c b/tools/lib/h5trav.c
index babbac0..52916d7 100644
--- a/tools/lib/h5trav.c
+++ b/tools/lib/h5trav.c
@@ -511,7 +511,6 @@ int traverse( hid_t loc_id,
default:
- printf(" %-10s %s\n", "User defined object", path );
break;
}
diff --git a/tools/misc/Makefile.in b/tools/misc/Makefile.in
index 4028d57..11a1806 100644
--- a/tools/misc/Makefile.in
+++ b/tools/misc/Makefile.in
@@ -1,4 +1,3 @@
-## HDF5 Library Makefile(.in)
##
## Copyright by the Board of Trustees of the University of Illinois.
## All rights reserved.
@@ -12,6 +11,7 @@
## 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.
##
+## HDF5 Library Makefile(.in)
##
top_srcdir=@top_srcdir@
top_builddir=../..
@@ -35,7 +35,7 @@ LIBTOOLS=../lib/libh5tools.la
LIBHDF5=$(top_builddir)/src/libhdf5.la
## h5cc is generated by configure. Remove it only when distclean.
-BUILD_PROGS=h5debug h5redeploy h5repart @PDB2HDF@
+BUILD_PROGS=h5debug h5redeploy h5repart @PDB2HDF@
PUB_PROGS=h5cc $(BUILD_PROGS)
PROGS=$(BUILD_PROGS) $(TEST_PROGS)
DISTCLEAN=h5cc
@@ -48,7 +48,7 @@ PUB_LIB=
## Source and object files for programs...
##
-PROG_SRC=h5debug.c h5repart.c pdb2hdf.c
+PROG_SRC=h5debug.c h5repart.c pdb2hdf.c
PROG_OBJ=$(PROG_SRC:.c=.lo)
PRIVATE_HDR=
diff --git a/tools/misc/h5cc.in b/tools/misc/h5cc.in
index 5a157b1..9257bb3 100755
--- a/tools/misc/h5cc.in
+++ b/tools/misc/h5cc.in
@@ -278,8 +278,8 @@ if test "x$do_link" = "xyes"; then
fi
if test "x$USE_SHARED_LIB" != "xyes"; then
- # The "-lhdf5" & "-lhdf5_hl" flag is in here already...This is a static compile,
- # though, so change it to the static version (.a) of the library.
+ # The "-lhdf5" & "-lhdf5_hl" flags are in here already...This is a static
+ # compile though, so change it to the static version (.a) of the library.
new_libraries=""
for lib in $libraries; do
case "$lib" in
@@ -288,8 +288,8 @@ if test "x$do_link" = "xyes"; then
;;
-lhdf5_hl)
new_libraries="$new_libraries ${libdir}/libhdf5_hl.a"
- ;;
- *)
+ ;;
+ *)
new_libraries="$new_libraries $lib"
;;
esac
diff --git a/tools/misc/h5debug.c b/tools/misc/h5debug.c
index e215036..466279c 100644
--- a/tools/misc/h5debug.c
+++ b/tools/misc/h5debug.c
@@ -69,7 +69,8 @@ main(int argc, char *argv[])
H5F_t *f;
haddr_t addr=0, extra=0;
uint8_t sig[16];
- int i, ndims;
+ int i;
+ unsigned ndims;
herr_t status = SUCCEED;
if (argc == 1) {
@@ -129,7 +130,7 @@ main(int argc, char *argv[])
/*
* Debug the boot block.
*/
- status = H5F_debug(f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL);
+ status = H5F_debug(f, H5P_DATASET_XFER_DEFAULT, stdout, 0, VCOL);
} else if (!HDmemcmp(sig, H5HL_MAGIC, H5HL_SIZEOF_MAGIC)) {
/*
@@ -163,7 +164,7 @@ main(int argc, char *argv[])
break;
case H5B_ISTORE_ID:
- ndims = (int)extra;
+ ndims = (unsigned)extra;
status = H5D_istore_debug (f, H5P_DATASET_XFER_DEFAULT, addr, stdout, 0, VCOL, ndims);
break;
diff --git a/tools/testfiles/help-1.ls b/tools/testfiles/help-1.ls
index 3fc1a7d..94a9976 100644
--- a/tools/testfiles/help-1.ls
+++ b/tools/testfiles/help-1.ls
@@ -16,6 +16,7 @@ usage: h5ls [OPTIONS] [OBJECTS...]
-wN, --width=N Set the number of columns of output
-v, --verbose Generate more verbose output
-V, --version Print version number and exit
+ --vfd=DRIVER Use the specified virtual file driver
-x, --hexdump Show raw data in hexadecimal format
OBJECTS
diff --git a/tools/testfiles/help-2.ls b/tools/testfiles/help-2.ls
index 5b68c4d..ee7de9e 100644
--- a/tools/testfiles/help-2.ls
+++ b/tools/testfiles/help-2.ls
@@ -16,6 +16,7 @@ usage: h5ls [OPTIONS] [OBJECTS...]
-wN, --width=N Set the number of columns of output
-v, --verbose Generate more verbose output
-V, --version Print version number and exit
+ --vfd=DRIVER Use the specified virtual file driver
-x, --hexdump Show raw data in hexadecimal format
OBJECTS
diff --git a/tools/testfiles/help-3.ls b/tools/testfiles/help-3.ls
index 4d1e103..65c0bd8 100644
--- a/tools/testfiles/help-3.ls
+++ b/tools/testfiles/help-3.ls
@@ -16,6 +16,7 @@ usage: h5ls [OPTIONS] [OBJECTS...]
-wN, --width=N Set the number of columns of output
-v, --verbose Generate more verbose output
-V, --version Print version number and exit
+ --vfd=DRIVER Use the specified virtual file driver
-x, --hexdump Show raw data in hexadecimal format
OBJECTS