summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/.distdep444
-rw-r--r--test/dtypes.c553
-rw-r--r--test/hyperslab.c45
3 files changed, 538 insertions, 504 deletions
diff --git a/test/.distdep b/test/.distdep
index 7e65416..581ae53 100644
--- a/test/.distdep
+++ b/test/.distdep
@@ -30,8 +30,8 @@ h5test.o: \
../src/H5Fprivate.h \
../src/H5Rprivate.h \
../src/H5Tprivate.h
-bittests.o: \
- bittests.c \
+big.o: \
+ big.c \
h5test.h \
../src/hdf5.h \
../src/H5public.h \
@@ -62,8 +62,9 @@ bittests.o: \
../src/H5Fprivate.h \
../src/H5Rprivate.h \
../src/H5Tprivate.h
-chunk.o: \
- chunk.c \
+bittests.o: \
+ bittests.c \
+ h5test.h \
../src/hdf5.h \
../src/H5public.h \
../src/H5config.h \
@@ -86,10 +87,15 @@ chunk.o: \
../src/H5Rpublic.h \
../src/H5RApublic.h \
../src/H5Spublic.h \
- ../src/H5Tpublic.h
-extend.o: \
- extend.c \
- h5test.h \
+ ../src/H5Tpublic.h \
+ ../src/H5private.h \
+ ../src/H5Tpkg.h \
+ ../src/H5HGprivate.h \
+ ../src/H5Fprivate.h \
+ ../src/H5Rprivate.h \
+ ../src/H5Tprivate.h
+chunk.o: \
+ chunk.c \
../src/hdf5.h \
../src/H5public.h \
../src/H5config.h \
@@ -112,15 +118,9 @@ extend.o: \
../src/H5Rpublic.h \
../src/H5RApublic.h \
../src/H5Spublic.h \
- ../src/H5Tpublic.h \
- ../src/H5private.h \
- ../src/H5Tpkg.h \
- ../src/H5HGprivate.h \
- ../src/H5Fprivate.h \
- ../src/H5Rprivate.h \
- ../src/H5Tprivate.h
-fillval.o: \
- fillval.c \
+ ../src/H5Tpublic.h
+cmpd_dset.o: \
+ cmpd_dset.c \
h5test.h \
../src/hdf5.h \
../src/H5public.h \
@@ -151,8 +151,8 @@ fillval.o: \
../src/H5Fprivate.h \
../src/H5Rprivate.h \
../src/H5Tprivate.h
-flush1.o: \
- flush1.c \
+dsets.o: \
+ dsets.c \
h5test.h \
../src/hdf5.h \
../src/H5public.h \
@@ -183,8 +183,8 @@ flush1.o: \
../src/H5Fprivate.h \
../src/H5Rprivate.h \
../src/H5Tprivate.h
-flush2.o: \
- flush2.c \
+dtypes.o: \
+ dtypes.c \
h5test.h \
../src/hdf5.h \
../src/H5public.h \
@@ -215,8 +215,8 @@ flush2.o: \
../src/H5Fprivate.h \
../src/H5Rprivate.h \
../src/H5Tprivate.h
-gheap.o: \
- gheap.c \
+extend.o: \
+ extend.c \
h5test.h \
../src/hdf5.h \
../src/H5public.h \
@@ -246,18 +246,10 @@ gheap.o: \
../src/H5HGprivate.h \
../src/H5Fprivate.h \
../src/H5Rprivate.h \
- ../src/H5Tprivate.h \
- ../src/H5Gprivate.h \
- ../src/H5Bprivate.h \
- ../src/H5Eprivate.h
-hyperslab.o: \
- hyperslab.c \
- ../src/H5private.h \
- ../src/H5public.h \
- ../src/H5config.h \
- ../src/H5api_adpt.h
-iopipe.o: \
- iopipe.c \
+ ../src/H5Tprivate.h
+external.o: \
+ external.c \
+ h5test.h \
../src/hdf5.h \
../src/H5public.h \
../src/H5config.h \
@@ -280,9 +272,15 @@ iopipe.o: \
../src/H5Rpublic.h \
../src/H5RApublic.h \
../src/H5Spublic.h \
- ../src/H5Tpublic.h
-istore.o: \
- istore.c \
+ ../src/H5Tpublic.h \
+ ../src/H5private.h \
+ ../src/H5Tpkg.h \
+ ../src/H5HGprivate.h \
+ ../src/H5Fprivate.h \
+ ../src/H5Rprivate.h \
+ ../src/H5Tprivate.h
+fillval.o: \
+ fillval.c \
h5test.h \
../src/hdf5.h \
../src/H5public.h \
@@ -312,18 +310,9 @@ istore.o: \
../src/H5HGprivate.h \
../src/H5Fprivate.h \
../src/H5Rprivate.h \
- ../src/H5Tprivate.h \
- ../src/H5Gprivate.h \
- ../src/H5Bprivate.h \
- ../src/H5Dprivate.h \
- ../src/H5Oprivate.h \
- ../src/H5Sprivate.h \
- ../src/H5Zprivate.h \
- ../src/H5Iprivate.h \
- ../src/H5Pprivate.h \
- ../src/H5MMprivate.h
-lheap.o: \
- lheap.c \
+ ../src/H5Tprivate.h
+flush1.o: \
+ flush1.c \
h5test.h \
../src/hdf5.h \
../src/H5public.h \
@@ -353,12 +342,9 @@ lheap.o: \
../src/H5HGprivate.h \
../src/H5Fprivate.h \
../src/H5Rprivate.h \
- ../src/H5Tprivate.h \
- ../src/H5Gprivate.h \
- ../src/H5Bprivate.h \
- ../src/H5HLprivate.h
-links.o: \
- links.c \
+ ../src/H5Tprivate.h
+flush2.o: \
+ flush2.c \
h5test.h \
../src/hdf5.h \
../src/H5public.h \
@@ -389,8 +375,8 @@ links.o: \
../src/H5Fprivate.h \
../src/H5Rprivate.h \
../src/H5Tprivate.h
-mount.o: \
- mount.c \
+gheap.o: \
+ gheap.c \
h5test.h \
../src/hdf5.h \
../src/H5public.h \
@@ -420,9 +406,12 @@ mount.o: \
../src/H5HGprivate.h \
../src/H5Fprivate.h \
../src/H5Rprivate.h \
- ../src/H5Tprivate.h
-overhead.o: \
- overhead.c \
+ ../src/H5Tprivate.h \
+ ../src/H5Gprivate.h \
+ ../src/H5Bprivate.h \
+ ../src/H5Eprivate.h
+iopipe.o: \
+ iopipe.c \
../src/hdf5.h \
../src/H5public.h \
../src/H5config.h \
@@ -446,8 +435,9 @@ overhead.o: \
../src/H5RApublic.h \
../src/H5Spublic.h \
../src/H5Tpublic.h
-ragged.o: \
- ragged.c \
+istore.o: \
+ istore.c \
+ h5test.h \
../src/hdf5.h \
../src/H5public.h \
../src/H5config.h \
@@ -471,9 +461,23 @@ ragged.o: \
../src/H5RApublic.h \
../src/H5Spublic.h \
../src/H5Tpublic.h \
- ../src/H5private.h
-stab.o: \
- stab.c \
+ ../src/H5private.h \
+ ../src/H5Tpkg.h \
+ ../src/H5HGprivate.h \
+ ../src/H5Fprivate.h \
+ ../src/H5Rprivate.h \
+ ../src/H5Tprivate.h \
+ ../src/H5Gprivate.h \
+ ../src/H5Bprivate.h \
+ ../src/H5Dprivate.h \
+ ../src/H5Oprivate.h \
+ ../src/H5Sprivate.h \
+ ../src/H5Zprivate.h \
+ ../src/H5Iprivate.h \
+ ../src/H5Pprivate.h \
+ ../src/H5MMprivate.h
+lheap.o: \
+ lheap.c \
h5test.h \
../src/hdf5.h \
../src/H5public.h \
@@ -506,22 +510,20 @@ stab.o: \
../src/H5Tprivate.h \
../src/H5Gprivate.h \
../src/H5Bprivate.h \
- ../src/H5Gpkg.h
-tattr.o: \
- tattr.c \
- testhdf5.h \
- ../src/H5private.h \
+ ../src/H5HLprivate.h
+links.o: \
+ links.c \
+ h5test.h \
+ ../src/hdf5.h \
../src/H5public.h \
../src/H5config.h \
../src/H5api_adpt.h \
- ../src/H5Eprivate.h \
- ../src/H5Epublic.h \
../src/H5Ipublic.h \
- ../src/hdf5.h \
../src/H5Apublic.h \
../src/H5ACpublic.h \
../src/H5Bpublic.h \
../src/H5Dpublic.h \
+ ../src/H5Epublic.h \
../src/H5Fpublic.h \
../src/H5Gpublic.h \
../src/H5HGpublic.h \
@@ -531,83 +533,29 @@ tattr.o: \
../src/H5Opublic.h \
../src/H5Ppublic.h \
../src/H5Zpublic.h \
- ../src/H5Rpublic.h
-testhdf5.o: \
- testhdf5.c \
- testhdf5.h \
- ../src/H5private.h \
- ../src/H5public.h \
- ../src/H5config.h \
- ../src/H5api_adpt.h
-tfile.o: \
- tfile.c \
- testhdf5.h \
- ../src/H5private.h \
- ../src/H5public.h \
- ../src/H5config.h \
- ../src/H5api_adpt.h \
- ../src/H5Eprivate.h \
- ../src/H5Epublic.h \
- ../src/H5Ipublic.h \
- ../src/H5Bprivate.h \
- ../src/H5Bpublic.h \
- ../src/H5Fprivate.h \
- ../src/H5Fpublic.h \
- ../src/H5Dpublic.h \
- ../src/H5Pprivate.h
-th5s.o: \
- th5s.c \
- testhdf5.h \
- ../src/H5private.h \
- ../src/H5public.h \
- ../src/H5config.h \
- ../src/H5api_adpt.h \
- ../src/H5Eprivate.h \
- ../src/H5Epublic.h \
- ../src/H5Ipublic.h \
- ../src/H5Bprivate.h \
- ../src/H5Bpublic.h \
- ../src/H5Fprivate.h \
- ../src/H5Fpublic.h \
- ../src/H5Dpublic.h \
- ../src/H5Sprivate.h \
+ ../src/H5Rpublic.h \
+ ../src/H5RApublic.h \
../src/H5Spublic.h \
- ../src/H5Gprivate.h \
- ../src/H5Gpublic.h \
- ../src/H5Oprivate.h \
- ../src/H5Opublic.h \
- ../src/H5HGprivate.h \
- ../src/H5HGpublic.h \
- ../src/H5Tprivate.h \
../src/H5Tpublic.h \
- ../src/H5Zprivate.h \
- ../src/H5Zpublic.h \
- ../src/H5Pprivate.h
-tmeta.o: \
- tmeta.c \
- testhdf5.h \
- ../src/H5private.h \
- ../src/H5public.h \
- ../src/H5config.h \
- ../src/H5api_adpt.h \
- ../src/H5Eprivate.h \
- ../src/H5Epublic.h \
- ../src/H5Ipublic.h
-trefer.o: \
- trefer.c \
- testhdf5.h \
../src/H5private.h \
+ ../src/H5Tpkg.h \
+ ../src/H5HGprivate.h \
+ ../src/H5Fprivate.h \
+ ../src/H5Rprivate.h \
+ ../src/H5Tprivate.h
+mount.o: \
+ mount.c \
+ h5test.h \
+ ../src/hdf5.h \
../src/H5public.h \
../src/H5config.h \
../src/H5api_adpt.h \
- ../src/H5Eprivate.h \
- ../src/H5Epublic.h \
../src/H5Ipublic.h \
- ../src/hdf5.h \
../src/H5Apublic.h \
../src/H5ACpublic.h \
../src/H5Bpublic.h \
../src/H5Dpublic.h \
+ ../src/H5Epublic.h \
../src/H5Fpublic.h \
../src/H5Gpublic.h \
../src/H5HGpublic.h \
@@ -617,22 +565,29 @@ trefer.o: \
../src/H5Opublic.h \
../src/H5Ppublic.h \
../src/H5Zpublic.h \
- ../src/H5Rpublic.h
-tselect.o: \
- tselect.c \
- testhdf5.h \
+ ../src/H5Rpublic.h \
+ ../src/H5RApublic.h \
+ ../src/H5Spublic.h \
+ ../src/H5Tpublic.h \
../src/H5private.h \
+ ../src/H5Tpkg.h \
+ ../src/H5HGprivate.h \
+ ../src/H5Fprivate.h \
+ ../src/H5Rprivate.h \
+ ../src/H5Tprivate.h
+mtime.o: \
+ mtime.c \
+ h5test.h \
+ ../src/hdf5.h \
../src/H5public.h \
../src/H5config.h \
../src/H5api_adpt.h \
- ../src/H5Eprivate.h \
- ../src/H5Epublic.h \
../src/H5Ipublic.h \
- ../src/hdf5.h \
../src/H5Apublic.h \
../src/H5ACpublic.h \
../src/H5Bpublic.h \
../src/H5Dpublic.h \
+ ../src/H5Epublic.h \
../src/H5Fpublic.h \
../src/H5Gpublic.h \
../src/H5HGpublic.h \
@@ -642,9 +597,18 @@ tselect.o: \
../src/H5Opublic.h \
../src/H5Ppublic.h \
../src/H5Zpublic.h \
- ../src/H5Rpublic.h
-unlink.o: \
- unlink.c \
+ ../src/H5Rpublic.h \
+ ../src/H5RApublic.h \
+ ../src/H5Spublic.h \
+ ../src/H5Tpublic.h \
+ ../src/H5private.h \
+ ../src/H5Tpkg.h \
+ ../src/H5HGprivate.h \
+ ../src/H5Fprivate.h \
+ ../src/H5Rprivate.h \
+ ../src/H5Tprivate.h
+ohdr.o: \
+ ohdr.c \
h5test.h \
../src/hdf5.h \
../src/H5public.h \
@@ -674,10 +638,15 @@ unlink.o: \
../src/H5HGprivate.h \
../src/H5Fprivate.h \
../src/H5Rprivate.h \
- ../src/H5Tprivate.h
-external.o: \
- external.c \
- h5test.h \
+ ../src/H5Tprivate.h \
+ ../src/H5Gprivate.h \
+ ../src/H5Bprivate.h \
+ ../src/H5Iprivate.h \
+ ../src/H5Oprivate.h \
+ ../src/H5Sprivate.h \
+ ../src/H5Zprivate.h
+overhead.o: \
+ overhead.c \
../src/hdf5.h \
../src/H5public.h \
../src/H5config.h \
@@ -700,16 +669,9 @@ external.o: \
../src/H5Rpublic.h \
../src/H5RApublic.h \
../src/H5Spublic.h \
- ../src/H5Tpublic.h \
- ../src/H5private.h \
- ../src/H5Tpkg.h \
- ../src/H5HGprivate.h \
- ../src/H5Fprivate.h \
- ../src/H5Rprivate.h \
- ../src/H5Tprivate.h
-big.o: \
- big.c \
- h5test.h \
+ ../src/H5Tpublic.h
+ragged.o: \
+ ragged.c \
../src/hdf5.h \
../src/H5public.h \
../src/H5config.h \
@@ -733,14 +695,9 @@ big.o: \
../src/H5RApublic.h \
../src/H5Spublic.h \
../src/H5Tpublic.h \
- ../src/H5private.h \
- ../src/H5Tpkg.h \
- ../src/H5HGprivate.h \
- ../src/H5Fprivate.h \
- ../src/H5Rprivate.h \
- ../src/H5Tprivate.h
-cmpd_dset.o: \
- cmpd_dset.c \
+ ../src/H5private.h
+stab.o: \
+ stab.c \
h5test.h \
../src/hdf5.h \
../src/H5public.h \
@@ -770,20 +727,25 @@ cmpd_dset.o: \
../src/H5HGprivate.h \
../src/H5Fprivate.h \
../src/H5Rprivate.h \
- ../src/H5Tprivate.h
-mtime.o: \
- mtime.c \
- h5test.h \
- ../src/hdf5.h \
+ ../src/H5Tprivate.h \
+ ../src/H5Gprivate.h \
+ ../src/H5Bprivate.h \
+ ../src/H5Gpkg.h
+tattr.o: \
+ tattr.c \
+ testhdf5.h \
+ ../src/H5private.h \
../src/H5public.h \
../src/H5config.h \
../src/H5api_adpt.h \
+ ../src/H5Eprivate.h \
+ ../src/H5Epublic.h \
../src/H5Ipublic.h \
+ ../src/hdf5.h \
../src/H5Apublic.h \
../src/H5ACpublic.h \
../src/H5Bpublic.h \
../src/H5Dpublic.h \
- ../src/H5Epublic.h \
../src/H5Fpublic.h \
../src/H5Gpublic.h \
../src/H5HGpublic.h \
@@ -795,27 +757,85 @@ mtime.o: \
../src/H5Zpublic.h \
../src/H5Rpublic.h \
../src/H5RApublic.h \
+ ../src/H5Spublic.h
+testhdf5.o: \
+ testhdf5.c \
+ testhdf5.h \
+ ../src/H5private.h \
+ ../src/H5public.h \
+ ../src/H5config.h \
+ ../src/H5api_adpt.h \
+ ../src/H5Eprivate.h \
+ ../src/H5Epublic.h
+tfile.o: \
+ tfile.c \
+ testhdf5.h \
+ ../src/H5private.h \
+ ../src/H5public.h \
+ ../src/H5config.h \
+ ../src/H5api_adpt.h \
+ ../src/H5Eprivate.h \
+ ../src/H5Epublic.h \
+ ../src/H5Ipublic.h \
+ ../src/H5Bprivate.h \
+ ../src/H5Bpublic.h \
+ ../src/H5Fprivate.h \
+ ../src/H5Fpublic.h \
+ ../src/H5Dpublic.h
+th5s.o: \
+ th5s.c \
+ testhdf5.h \
+ ../src/H5private.h \
+ ../src/H5public.h \
+ ../src/H5config.h \
+ ../src/H5api_adpt.h \
+ ../src/H5Eprivate.h \
+ ../src/H5Epublic.h \
+ ../src/H5Ipublic.h \
+ ../src/H5Bprivate.h \
+ ../src/H5Bpublic.h \
+ ../src/H5Fprivate.h \
+ ../src/H5Fpublic.h \
+ ../src/H5Dpublic.h \
+ ../src/H5Sprivate.h \
../src/H5Spublic.h \
+ ../src/H5Gprivate.h \
+ ../src/H5Gpublic.h \
+ ../src/H5Oprivate.h \
+ ../src/H5Opublic.h \
+ ../src/H5HGprivate.h \
+ ../src/H5HGpublic.h \
+ ../src/H5Tprivate.h \
../src/H5Tpublic.h \
+ ../src/H5Zprivate.h \
+ ../src/H5Zpublic.h
+tmeta.o: \
+ tmeta.c \
+ testhdf5.h \
../src/H5private.h \
- ../src/H5Tpkg.h \
- ../src/H5HGprivate.h \
+ ../src/H5public.h \
+ ../src/H5config.h \
+ ../src/H5api_adpt.h \
+ ../src/H5Eprivate.h \
+ ../src/H5Epublic.h \
+ ../src/H5Ipublic.h \
../src/H5Fprivate.h \
- ../src/H5Rprivate.h \
- ../src/H5Tprivate.h
-ohdr.o: \
- ohdr.c \
- h5test.h \
- ../src/hdf5.h \
+ ../src/H5Fpublic.h
+trefer.o: \
+ trefer.c \
+ testhdf5.h \
+ ../src/H5private.h \
../src/H5public.h \
../src/H5config.h \
../src/H5api_adpt.h \
+ ../src/H5Eprivate.h \
+ ../src/H5Epublic.h \
../src/H5Ipublic.h \
+ ../src/hdf5.h \
../src/H5Apublic.h \
../src/H5ACpublic.h \
../src/H5Bpublic.h \
../src/H5Dpublic.h \
- ../src/H5Epublic.h \
../src/H5Fpublic.h \
../src/H5Gpublic.h \
../src/H5HGpublic.h \
@@ -827,33 +847,22 @@ ohdr.o: \
../src/H5Zpublic.h \
../src/H5Rpublic.h \
../src/H5RApublic.h \
- ../src/H5Spublic.h \
- ../src/H5Tpublic.h \
+ ../src/H5Spublic.h
+tselect.o: \
+ tselect.c \
+ testhdf5.h \
../src/H5private.h \
- ../src/H5Tpkg.h \
- ../src/H5HGprivate.h \
- ../src/H5Fprivate.h \
- ../src/H5Rprivate.h \
- ../src/H5Tprivate.h \
- ../src/H5Gprivate.h \
- ../src/H5Bprivate.h \
- ../src/H5Iprivate.h \
- ../src/H5Oprivate.h \
- ../src/H5Sprivate.h \
- ../src/H5Zprivate.h
-enum.o: \
- enum.c \
- h5test.h \
- ../src/hdf5.h \
../src/H5public.h \
../src/H5config.h \
../src/H5api_adpt.h \
+ ../src/H5Eprivate.h \
+ ../src/H5Epublic.h \
../src/H5Ipublic.h \
+ ../src/hdf5.h \
../src/H5Apublic.h \
../src/H5ACpublic.h \
../src/H5Bpublic.h \
../src/H5Dpublic.h \
- ../src/H5Epublic.h \
../src/H5Fpublic.h \
../src/H5Gpublic.h \
../src/H5HGpublic.h \
@@ -865,16 +874,9 @@ enum.o: \
../src/H5Zpublic.h \
../src/H5Rpublic.h \
../src/H5RApublic.h \
- ../src/H5Spublic.h \
- ../src/H5Tpublic.h \
- ../src/H5private.h \
- ../src/H5Tpkg.h \
- ../src/H5HGprivate.h \
- ../src/H5Fprivate.h \
- ../src/H5Rprivate.h \
- ../src/H5Tprivate.h
-dsets.o: \
- dsets.c \
+ ../src/H5Spublic.h
+unlink.o: \
+ unlink.c \
h5test.h \
../src/hdf5.h \
../src/H5public.h \
@@ -905,8 +907,8 @@ dsets.o: \
../src/H5Fprivate.h \
../src/H5Rprivate.h \
../src/H5Tprivate.h
-dtypes.o: \
- dtypes.c \
+enum.o: \
+ enum.c \
h5test.h \
../src/hdf5.h \
../src/H5public.h \
@@ -937,3 +939,11 @@ dtypes.o: \
../src/H5Fprivate.h \
../src/H5Rprivate.h \
../src/H5Tprivate.h
+hyperslab.o: \
+ hyperslab.c \
+ ../src/H5private.h \
+ ../src/H5public.h \
+ ../src/H5config.h \
+ ../src/H5api_adpt.h \
+ ../src/H5MMprivate.h \
+ ../src/H5MMpublic.h
diff --git a/test/dtypes.c b/test/dtypes.c
index 588815e..0047560 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -1294,7 +1294,7 @@ 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 */
- long_long aligned; /*restrictive alignment */
+ void *aligned=NULL; /*aligned temp buffer */
signed char hw_char;
unsigned char hw_uchar;
short hw_short;
@@ -1395,6 +1395,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst)
dst_size = H5Tget_size(dst);
buf = aligned_malloc(nelmts*MAX(src_size, dst_size));
saved = aligned_malloc(nelmts*MAX(src_size, dst_size));
+ aligned = malloc(sizeof(long_long));
#ifdef SHOW_OVERFLOWS
noverflows_g = 0;
#endif
@@ -1428,47 +1429,49 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst)
hw = (unsigned char*)&hw_char;
switch (src_type) {
case INT_CHAR:
- memcpy(&aligned, (signed char*)saved+j, sizeof(char));
- hw_char = (char)(*((signed char*)&aligned));
+ memcpy(aligned, saved+j*sizeof(char), sizeof(char));
+ hw_char = (char)(*((signed char*)aligned));
break;
case INT_UCHAR:
- memcpy(&aligned, (unsigned char*)saved+j, sizeof(char));
- hw_char = (char)(*((unsigned char*)&aligned));
+ memcpy(aligned, saved+j*sizeof(char), sizeof(char));
+ hw_char = (char)(*((unsigned char*)aligned));
break;
case INT_SHORT:
- memcpy(&aligned, (short*)saved+j, sizeof(short));
- hw_char = (char)(*((short*)&aligned));
+ memcpy(aligned, saved+j*sizeof(short), sizeof(short));
+ hw_char = (char)(*((short*)aligned));
break;
case INT_USHORT:
- memcpy(&aligned, (unsigned short*)saved+j,
+ memcpy(aligned, saved+j*sizeof(short),
sizeof(unsigned short));
- hw_char = (char)(*((unsigned short*)&aligned));
+ hw_char = (char)(*((unsigned short*)aligned));
break;
case INT_INT:
- memcpy(&aligned, (int*)saved+j, sizeof(int));
- hw_char = (char)(*((int*)&aligned));
+ memcpy(aligned, saved+j*sizeof(int), sizeof(int));
+ hw_char = (char)(*((int*)aligned));
break;
case INT_UINT:
- memcpy(&aligned, (unsigned*)saved+j, sizeof(unsigned));
- hw_char = (char)(*((unsigned*)&aligned));
+ memcpy(aligned, saved+j*sizeof(unsigned),
+ sizeof(unsigned));
+ hw_char = (char)(*((unsigned*)aligned));
break;
case INT_LONG:
- memcpy(&aligned, (long*)saved+j, sizeof(long));
- hw_char = (char)(*((long*)&aligned));
+ memcpy(aligned, saved+j*sizeof(long), sizeof(long));
+ hw_char = (char)(*((long*)aligned));
break;
case INT_ULONG:
- memcpy(&aligned, (unsigned long*)saved+j,
+ memcpy(aligned, saved+j*sizeof(long),
sizeof(unsigned long));
- hw_char = (char)(*((unsigned long*)&aligned));
+ hw_char = (char)(*((unsigned long*)aligned));
break;
case INT_LLONG:
- memcpy(&aligned, (long_long*)saved+j, sizeof(long_long));
- hw_char = (char)(*((long_long*)&aligned));
+ memcpy(aligned, saved+j*sizeof(long_long),
+ sizeof(long_long));
+ hw_char = (char)(*((long_long*)aligned));
break;
case INT_ULLONG:
- memcpy(&aligned, (unsigned long_long*)saved+j,
+ memcpy(aligned, saved+j*sizeof(long_long),
sizeof(unsigned long_long));
- hw_char = (char)(*((unsigned long_long*)&aligned));
+ hw_char = (char)(*((unsigned long_long*)aligned));
break;
case INT_OTHER:
break;
@@ -1477,50 +1480,52 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst)
hw = (unsigned char*)&hw_uchar;
switch (src_type) {
case INT_CHAR:
- memcpy(&aligned, (signed char*)saved+j,
+ memcpy(aligned, saved+j*sizeof(char),
sizeof(signed char));
- hw_uchar = (unsigned char)(*((signed char*)&aligned));
+ hw_uchar = (unsigned char)(*((signed char*)aligned));
break;
case INT_UCHAR:
- memcpy(&aligned, (unsigned char*)saved+j,
+ memcpy(aligned, saved+j*sizeof(char),
sizeof(unsigned char));
- hw_uchar = (unsigned char)(*((unsigned char*)&aligned));
+ hw_uchar = (unsigned char)(*((unsigned char*)aligned));
break;
case INT_SHORT:
- memcpy(&aligned, (short*)saved+j, sizeof(short));
- hw_uchar = (unsigned char)(*((short*)&aligned));
+ memcpy(aligned, saved+j*sizeof(short), sizeof(short));
+ hw_uchar = (unsigned char)(*((short*)aligned));
break;
case INT_USHORT:
- memcpy(&aligned, (unsigned short*)saved+j,
+ memcpy(aligned, saved+j*sizeof(short),
sizeof(unsigned short));
- hw_uchar = (unsigned char)(*((unsigned short*)&aligned));
+ hw_uchar = (unsigned char)(*((unsigned short*)aligned));
break;
case INT_INT:
- memcpy(&aligned, (int*)saved+j, sizeof(int));
- hw_uchar = (unsigned char)(*((int*)&aligned));
+ memcpy(aligned, saved+j*sizeof(int), sizeof(int));
+ hw_uchar = (unsigned char)(*((int*)aligned));
break;
case INT_UINT:
- memcpy(&aligned, (unsigned*)saved+j, sizeof(unsigned));
- hw_uchar = (unsigned char)(*((unsigned*)&aligned));
+ memcpy(aligned, saved+j*sizeof(unsigned),
+ sizeof(unsigned));
+ hw_uchar = (unsigned char)(*((unsigned*)aligned));
break;
case INT_LONG:
- memcpy(&aligned, (long*)saved+j, sizeof(long));
- hw_uchar = (unsigned char)(*((long*)&aligned));
+ memcpy(aligned, saved+j*sizeof(long), sizeof(long));
+ hw_uchar = (unsigned char)(*((long*)aligned));
break;
case INT_ULONG:
- memcpy(&aligned, (unsigned long*)saved+j,
+ memcpy(aligned, saved+j*sizeof(long),
sizeof(unsigned long));
- hw_uchar = (unsigned char)(*((unsigned long*)&aligned));
+ hw_uchar = (unsigned char)(*((unsigned long*)aligned));
break;
case INT_LLONG:
- memcpy(&aligned, (long_long*)saved+j, sizeof(long_long));
- hw_uchar = (unsigned char)(*((long_long*)&aligned));
+ memcpy(aligned, saved+j*sizeof(long_long),
+ sizeof(long_long));
+ hw_uchar = (unsigned char)(*((long_long*)aligned));
break;
case INT_ULLONG:
- memcpy(&aligned, (unsigned long_long*)saved+j,
+ memcpy(aligned, saved+j*sizeof(long_long),
sizeof(unsigned long_long));
hw_uchar = (unsigned char)(*((unsigned long_long*)
- &aligned));
+ aligned));
break;
case INT_OTHER:
break;
@@ -1529,49 +1534,50 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst)
hw = (unsigned char*)&hw_short;
switch (src_type) {
case INT_CHAR:
- memcpy(&aligned, (signed char*)saved+j,
- sizeof(signed char));
- hw_short = (short)(*((signed char*)&aligned));
+ memcpy(aligned, saved+j*sizeof(char), sizeof(signed char));
+ hw_short = (short)(*((signed char*)aligned));
break;
case INT_UCHAR:
- memcpy(&aligned, (unsigned char*)saved+j,
+ memcpy(aligned, saved+j*sizeof(char),
sizeof(unsigned char));
- hw_short = (short)(*((unsigned char*)&aligned));
+ hw_short = (short)(*((unsigned char*)aligned));
break;
case INT_SHORT:
- memcpy(&aligned, (short*)saved+j, sizeof(short));
- hw_short = (short)(*((short*)&aligned));
+ memcpy(aligned, saved+j*sizeof(short), sizeof(short));
+ hw_short = (short)(*((short*)aligned));
break;
case INT_USHORT:
- memcpy(&aligned, (unsigned short*)saved+j,
+ memcpy(aligned, saved+j*sizeof(short),
sizeof(unsigned short));
- hw_short = (short)(*((unsigned short*)&aligned));
+ hw_short = (short)(*((unsigned short*)aligned));
break;
case INT_INT:
- memcpy(&aligned, (int*)saved+j, sizeof(int));
- hw_short = (short)(*((int*)&aligned));
+ memcpy(aligned, saved+j*sizeof(int), sizeof(int));
+ hw_short = (short)(*((int*)aligned));
break;
case INT_UINT:
- memcpy(&aligned, (unsigned*)saved+j, sizeof(unsigned));
- hw_short = (short)(*((unsigned*)&aligned));
+ memcpy(aligned, saved+j*sizeof(unsigned),
+ sizeof(unsigned));
+ hw_short = (short)(*((unsigned*)aligned));
break;
case INT_LONG:
- memcpy(&aligned, (long*)saved+j, sizeof(long));
- hw_short = (short)(*((long*)&aligned));
+ memcpy(aligned, saved+j*sizeof(long), sizeof(long));
+ hw_short = (short)(*((long*)aligned));
break;
case INT_ULONG:
- memcpy(&aligned, (unsigned long*)saved+j,
+ memcpy(aligned, saved+j*sizeof(long),
sizeof(unsigned long));
- hw_short = (short)(*((unsigned long*)&aligned));
+ hw_short = (short)(*((unsigned long*)aligned));
break;
case INT_LLONG:
- memcpy(&aligned, (long_long*)saved+j, sizeof(long_long));
- hw_short = (short)(*((long_long*)&aligned));
+ memcpy(aligned, saved+j*sizeof(long_long),
+ sizeof(long_long));
+ hw_short = (short)(*((long_long*)aligned));
break;
case INT_ULLONG:
- memcpy(&aligned, (unsigned long_long*)saved+j,
+ memcpy(aligned, saved+j*sizeof(long_long),
sizeof(unsigned long_long));
- hw_short = (short)(*((unsigned long_long*)&aligned));
+ hw_short = (short)(*((unsigned long_long*)aligned));
break;
case INT_OTHER:
break;
@@ -1580,50 +1586,51 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst)
hw = (unsigned char*)&hw_ushort;
switch (src_type) {
case INT_CHAR:
- memcpy(&aligned, (signed char*)saved+j,
- sizeof(signed char));
- hw_ushort = (unsigned short)(*((signed char*)&aligned));
+ memcpy(aligned, saved+j*sizeof(char), sizeof(signed char));
+ hw_ushort = (unsigned short)(*((signed char*)aligned));
break;
case INT_UCHAR:
- memcpy(&aligned, (unsigned char*)saved+j,
+ memcpy(aligned, saved+j*sizeof(char),
sizeof(unsigned char));
- hw_ushort = (unsigned short)(*((unsigned char*)&aligned));
+ hw_ushort = (unsigned short)(*((unsigned char*)aligned));
break;
case INT_SHORT:
- memcpy(&aligned, (short*)saved+j, sizeof(short));
- hw_ushort = (unsigned short)(*((short*)&aligned));
+ memcpy(aligned, saved+j*sizeof(short), sizeof(short));
+ hw_ushort = (unsigned short)(*((short*)aligned));
break;
case INT_USHORT:
- memcpy(&aligned, (unsigned short*)saved+j,
+ memcpy(aligned, saved+j*sizeof(short),
sizeof(unsigned short));
- hw_ushort = (unsigned short)(*((unsigned short*)&aligned));
+ hw_ushort = (unsigned short)(*((unsigned short*)aligned));
break;
case INT_INT:
- memcpy(&aligned, (int*)saved+j, sizeof(int));
- hw_ushort = (unsigned short)(*((int*)&aligned));
+ memcpy(aligned, saved+j*sizeof(int), sizeof(int));
+ hw_ushort = (unsigned short)(*((int*)aligned));
break;
case INT_UINT:
- memcpy(&aligned, (unsigned*)saved+j, sizeof(unsigned));
- hw_ushort = (unsigned short)(*((unsigned*)&aligned));
+ memcpy(aligned, saved+j*sizeof(unsigned),
+ sizeof(unsigned));
+ hw_ushort = (unsigned short)(*((unsigned*)aligned));
break;
case INT_LONG:
- memcpy(&aligned, (long*)saved+j, sizeof(long));
- hw_ushort = (unsigned short)(*((long*)&aligned));
+ memcpy(aligned, saved+j*sizeof(long), sizeof(long));
+ hw_ushort = (unsigned short)(*((long*)aligned));
break;
case INT_ULONG:
- memcpy(&aligned, (unsigned long*)saved+j,
+ memcpy(aligned, saved+j*sizeof(long),
sizeof(unsigned long));
- hw_ushort = (unsigned short)(*((unsigned long*)&aligned));
+ hw_ushort = (unsigned short)(*((unsigned long*)aligned));
break;
case INT_LLONG:
- memcpy(&aligned, (long_long*)saved+j, sizeof(long_long));
- hw_ushort = (unsigned short)(*((long_long*)&aligned));
+ memcpy(aligned, saved+j*sizeof(long_long),
+ sizeof(long_long));
+ hw_ushort = (unsigned short)(*((long_long*)aligned));
break;
case INT_ULLONG:
- memcpy(&aligned, (unsigned long_long*)saved+j,
+ memcpy(aligned, saved+j*sizeof(long_long),
sizeof(unsigned long_long));
hw_ushort = (unsigned short)(*((unsigned long_long*)
- &aligned));
+ aligned));
break;
case INT_OTHER:
break;
@@ -1632,49 +1639,50 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst)
hw = (unsigned char*)&hw_int;
switch (src_type) {
case INT_CHAR:
- memcpy(&aligned, (signed char*)saved+j,
- sizeof(signed char));
- hw_int = (int)(*((signed char*)&aligned));
+ memcpy(aligned, saved+j*sizeof(char), sizeof(signed char));
+ hw_int = (int)(*((signed char*)aligned));
break;
case INT_UCHAR:
- memcpy(&aligned, (unsigned char*)saved+j,
+ memcpy(aligned, saved+j*sizeof(char),
sizeof(unsigned char));
- hw_int = (int)(*((unsigned char*)&aligned));
+ hw_int = (int)(*((unsigned char*)aligned));
break;
case INT_SHORT:
- memcpy(&aligned, (short*)saved+j, sizeof(short));
- hw_int = (int)(*((short*)&aligned));
+ memcpy(aligned, saved+j*sizeof(short), sizeof(short));
+ hw_int = (int)(*((short*)aligned));
break;
case INT_USHORT:
- memcpy(&aligned, (unsigned short*)saved+j,
+ memcpy(aligned, saved+j*sizeof(short),
sizeof(unsigned short));
- hw_int = (int)(*((unsigned short*)&aligned));
+ hw_int = (int)(*((unsigned short*)aligned));
break;
case INT_INT:
- memcpy(&aligned, (int*)saved+j, sizeof(int));
- hw_int = (int)(*((int*)&aligned));
+ memcpy(aligned, saved+j*sizeof(int), sizeof(int));
+ hw_int = (int)(*((int*)aligned));
break;
case INT_UINT:
- memcpy(&aligned, (unsigned*)saved+j, sizeof(unsigned));
- hw_int = (int)(*((unsigned*)&aligned));
+ memcpy(aligned, saved+j*sizeof(unsigned),
+ sizeof(unsigned));
+ hw_int = (int)(*((unsigned*)aligned));
break;
case INT_LONG:
- memcpy(&aligned, (long*)saved+j, sizeof(long));
- hw_int = (int)(*((long*)&aligned));
+ memcpy(aligned, saved+j*sizeof(long), sizeof(long));
+ hw_int = (int)(*((long*)aligned));
break;
case INT_ULONG:
- memcpy(&aligned, (unsigned long*)saved+j,
+ memcpy(aligned, saved+j*sizeof(long),
sizeof(unsigned long));
- hw_int = (int)(*((unsigned long*)&aligned));
+ hw_int = (int)(*((unsigned long*)aligned));
break;
case INT_LLONG:
- memcpy(&aligned, (long_long*)saved+j, sizeof(long_long));
- hw_int = (int)(*((long_long*)&aligned));
+ memcpy(aligned, saved+j*sizeof(long_long),
+ sizeof(long_long));
+ hw_int = (int)(*((long_long*)aligned));
break;
case INT_ULLONG:
- memcpy(&aligned, (unsigned long_long*)saved+j,
+ memcpy(aligned, saved+j*sizeof(long_long),
sizeof(unsigned long_long));
- hw_int = (int)(*((unsigned long_long*)&aligned));
+ hw_int = (int)(*((unsigned long_long*)aligned));
break;
case INT_OTHER:
break;
@@ -1683,49 +1691,51 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst)
hw = (unsigned char*)&hw_uint;
switch (src_type) {
case INT_CHAR:
- memcpy(&aligned, (signed char*)saved+j,
+ memcpy(aligned, saved+j*sizeof(char),
sizeof(signed char));
- hw_uint = (unsigned int)(*((signed char*)&aligned));
+ hw_uint = (unsigned int)(*((signed char*)aligned));
break;
case INT_UCHAR:
- memcpy(&aligned, (unsigned char*)saved+j,
+ memcpy(aligned, saved+j*sizeof(char),
sizeof(unsigned char));
- hw_uint = (unsigned int)(*((unsigned char*)&aligned));
+ hw_uint = (unsigned int)(*((unsigned char*)aligned));
break;
case INT_SHORT:
- memcpy(&aligned, (short*)saved+j, sizeof(short));
- hw_uint = (unsigned int)(*((short*)&aligned));
+ memcpy(aligned, saved+j*sizeof(short), sizeof(short));
+ hw_uint = (unsigned int)(*((short*)aligned));
break;
case INT_USHORT:
- memcpy(&aligned, (unsigned short*)saved+j,
+ memcpy(aligned, saved+j*sizeof(short),
sizeof(unsigned short));
- hw_uint = (unsigned int)(*((unsigned short*)&aligned));
+ hw_uint = (unsigned int)(*((unsigned short*)aligned));
break;
case INT_INT:
- memcpy(&aligned, (int*)saved+j, sizeof(int));
- hw_uint = (unsigned int)(*((int*)&aligned));
+ memcpy(aligned, saved+j*sizeof(int), sizeof(int));
+ hw_uint = (unsigned int)(*((int*)aligned));
break;
case INT_UINT:
- memcpy(&aligned, (unsigned*)saved+j, sizeof(unsigned));
- hw_uint = (unsigned int)(*((unsigned*)&aligned));
+ memcpy(aligned, saved+j*sizeof(unsigned),
+ sizeof(unsigned));
+ hw_uint = (unsigned int)(*((unsigned*)aligned));
break;
case INT_LONG:
- memcpy(&aligned, (long*)saved+j, sizeof(long));
- hw_uint = (unsigned int)(*((long*)&aligned));
+ memcpy(aligned, saved+j*sizeof(long), sizeof(long));
+ hw_uint = (unsigned int)(*((long*)aligned));
break;
case INT_ULONG:
- memcpy(&aligned, (unsigned long*)saved+j,
+ memcpy(aligned, saved+j*sizeof(long),
sizeof(unsigned long));
- hw_uint = (unsigned int)(*((unsigned long*)&aligned));
+ hw_uint = (unsigned int)(*((unsigned long*)aligned));
break;
case INT_LLONG:
- memcpy(&aligned, (long_long*)saved+j, sizeof(long_long));
- hw_uint = (unsigned int)(*((long_long*)&aligned));
+ memcpy(aligned, saved+j*sizeof(long_long),
+ sizeof(long_long));
+ hw_uint = (unsigned int)(*((long_long*)aligned));
break;
case INT_ULLONG:
- memcpy(&aligned, (unsigned long_long*)saved+j,
+ memcpy(aligned, saved+j*sizeof(long_long),
sizeof(unsigned long_long));
- hw_uint = (unsigned int)(*((unsigned long_long*)&aligned));
+ hw_uint = (unsigned int)(*((unsigned long_long*)aligned));
break;
case INT_OTHER:
break;
@@ -1734,49 +1744,51 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst)
hw = (unsigned char*)&hw_long;
switch (src_type) {
case INT_CHAR:
- memcpy(&aligned, (signed char*)saved+j,
+ memcpy(aligned, saved+j*sizeof(char),
sizeof(signed char));
- hw_long = (long int)(*((signed char*)&aligned));
+ hw_long = (long int)(*((signed char*)aligned));
break;
case INT_UCHAR:
- memcpy(&aligned, (unsigned char*)saved+j,
+ memcpy(aligned, saved+j*sizeof(char),
sizeof(unsigned char));
- hw_long = (long int)(*((unsigned char*)&aligned));
+ hw_long = (long int)(*((unsigned char*)aligned));
break;
case INT_SHORT:
- memcpy(&aligned, (short*)saved+j, sizeof(short));
- hw_long = (long int)(*((short*)&aligned));
+ memcpy(aligned, saved+j*sizeof(short), sizeof(short));
+ hw_long = (long int)(*((short*)aligned));
break;
case INT_USHORT:
- memcpy(&aligned, (unsigned short*)saved+j,
+ memcpy(aligned, saved+j*sizeof(short),
sizeof(unsigned short));
- hw_long = (long int)(*((unsigned short*)&aligned));
+ hw_long = (long int)(*((unsigned short*)aligned));
break;
case INT_INT:
- memcpy(&aligned, (int*)saved+j, sizeof(int));
- hw_long = (long int)(*((int*)&aligned));
+ memcpy(aligned, saved+j*sizeof(int), sizeof(int));
+ hw_long = (long int)(*((int*)aligned));
break;
case INT_UINT:
- memcpy(&aligned, (unsigned*)saved+j, sizeof(unsigned));
- hw_long = (long int)(*((unsigned*)&aligned));
+ memcpy(aligned, saved+j*sizeof(unsigned),
+ sizeof(unsigned));
+ hw_long = (long int)(*((unsigned*)aligned));
break;
case INT_LONG:
- memcpy(&aligned, (long*)saved+j, sizeof(long));
- hw_long = (long int)(*((long*)&aligned));
+ memcpy(aligned, saved+j*sizeof(long), sizeof(long));
+ hw_long = (long int)(*((long*)aligned));
break;
case INT_ULONG:
- memcpy(&aligned, (unsigned long*)saved+j,
+ memcpy(aligned, saved+j*sizeof(long),
sizeof(unsigned long));
- hw_long = (long int)(*((unsigned long*)&aligned));
+ hw_long = (long int)(*((unsigned long*)aligned));
break;
case INT_LLONG:
- memcpy(&aligned, (long_long*)saved+j, sizeof(long_long));
- hw_long = (long int)(*((long_long*)&aligned));
+ memcpy(aligned, saved+j*sizeof(long_long),
+ sizeof(long_long));
+ hw_long = (long int)(*((long_long*)aligned));
break;
case INT_ULLONG:
- memcpy(&aligned, (unsigned long_long*)saved+j,
+ memcpy(aligned, saved+j*sizeof(long_long),
sizeof(unsigned long_long));
- hw_long = (long int)(*((unsigned long_long*)&aligned));
+ hw_long = (long int)(*((unsigned long_long*)aligned));
break;
case INT_OTHER:
break;
@@ -1785,50 +1797,52 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst)
hw = (unsigned char*)&hw_ulong;
switch (src_type) {
case INT_CHAR:
- memcpy(&aligned, (signed char*)saved+j,
+ memcpy(aligned, saved+j*sizeof(char),
sizeof(signed char));
- hw_ulong = (unsigned long)(*((signed char*)&aligned));
+ hw_ulong = (unsigned long)(*((signed char*)aligned));
break;
case INT_UCHAR:
- memcpy(&aligned, (unsigned char*)saved+j,
+ memcpy(aligned, saved+j*sizeof(char),
sizeof(unsigned char));
- hw_ulong = (unsigned long)(*((unsigned char*)&aligned));
+ hw_ulong = (unsigned long)(*((unsigned char*)aligned));
break;
case INT_SHORT:
- memcpy(&aligned, (short*)saved+j, sizeof(short));
- hw_ulong = (unsigned long)(*((short*)&aligned));
+ memcpy(aligned, saved+j*sizeof(short), sizeof(short));
+ hw_ulong = (unsigned long)(*((short*)aligned));
break;
case INT_USHORT:
- memcpy(&aligned, (unsigned short*)saved+j,
+ memcpy(aligned, saved+j*sizeof(short),
sizeof(unsigned short));
- hw_ulong = (unsigned long)(*((unsigned short*)&aligned));
+ hw_ulong = (unsigned long)(*((unsigned short*)aligned));
break;
case INT_INT:
- memcpy(&aligned, (int*)saved+j, sizeof(int));
- hw_ulong = (unsigned long)(*((int*)&aligned));
+ memcpy(aligned, saved+j*sizeof(int), sizeof(int));
+ hw_ulong = (unsigned long)(*((int*)aligned));
break;
case INT_UINT:
- memcpy(&aligned, (unsigned*)saved+j, sizeof(unsigned));
- hw_ulong = (unsigned long)(*((unsigned*)&aligned));
+ memcpy(aligned, saved+j*sizeof(unsigned),
+ sizeof(unsigned));
+ hw_ulong = (unsigned long)(*((unsigned*)aligned));
break;
case INT_LONG:
- memcpy(&aligned, (long*)saved+j, sizeof(long));
- hw_ulong = (unsigned long)(*((long*)&aligned));
+ memcpy(aligned, saved+j*sizeof(long), sizeof(long));
+ hw_ulong = (unsigned long)(*((long*)aligned));
break;
case INT_ULONG:
- memcpy(&aligned, (unsigned long*)saved+j,
+ memcpy(aligned, saved+j*sizeof(long),
sizeof(unsigned long));
- hw_ulong = (unsigned long)(*((unsigned long*)&aligned));
+ hw_ulong = (unsigned long)(*((unsigned long*)aligned));
break;
case INT_LLONG:
- memcpy(&aligned, (long_long*)saved+j, sizeof(long_long));
- hw_ulong = (unsigned long)(*((long_long*)&aligned));
+ memcpy(aligned, saved+j*sizeof(long_long),
+ sizeof(long_long));
+ hw_ulong = (unsigned long)(*((long_long*)aligned));
break;
case INT_ULLONG:
- memcpy(&aligned, (unsigned long_long*)saved+j,
+ memcpy(aligned, saved+j*sizeof(long_long),
sizeof(unsigned long_long));
hw_ulong = (unsigned long)(*((unsigned long_long*)
- &aligned));
+ aligned));
break;
case INT_OTHER:
break;
@@ -1837,49 +1851,51 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst)
hw = (unsigned char*)&hw_llong;
switch (src_type) {
case INT_CHAR:
- memcpy(&aligned, (signed char*)saved+j,
+ memcpy(aligned, saved+j*sizeof(char),
sizeof(signed char));
- hw_llong = (long_long)(*((signed char*)&aligned));
+ hw_llong = (long_long)(*((signed char*)aligned));
break;
case INT_UCHAR:
- memcpy(&aligned, (unsigned char*)saved+j,
+ memcpy(aligned, saved+j*sizeof(char),
sizeof(unsigned char));
- hw_llong = (long_long)(*((unsigned char*)&aligned));
+ hw_llong = (long_long)(*((unsigned char*)aligned));
break;
case INT_SHORT:
- memcpy(&aligned, (short*)saved+j, sizeof(short));
- hw_llong = (long_long)(*((short*)&aligned));
+ memcpy(aligned, saved+j*sizeof(short), sizeof(short));
+ hw_llong = (long_long)(*((short*)aligned));
break;
case INT_USHORT:
- memcpy(&aligned, (unsigned short*)saved+j,
+ memcpy(aligned, saved+j*sizeof(short),
sizeof(unsigned short));
- hw_llong = (long_long)(*((unsigned short*)&aligned));
+ hw_llong = (long_long)(*((unsigned short*)aligned));
break;
case INT_INT:
- memcpy(&aligned, (int*)saved+j, sizeof(int));
- hw_llong = (long_long)(*((int*)&aligned));
+ memcpy(aligned, saved+j*sizeof(int), sizeof(int));
+ hw_llong = (long_long)(*((int*)aligned));
break;
case INT_UINT:
- memcpy(&aligned, (unsigned*)saved+j, sizeof(unsigned));
- hw_llong = (long_long)(*((unsigned*)&aligned));
+ memcpy(aligned, saved+j*sizeof(unsigned),
+ sizeof(unsigned));
+ hw_llong = (long_long)(*((unsigned*)aligned));
break;
case INT_LONG:
- memcpy(&aligned, (long*)saved+j, sizeof(long));
- hw_llong = (long_long)(*((long*)&aligned));
+ memcpy(aligned, saved+j*sizeof(long), sizeof(long));
+ hw_llong = (long_long)(*((long*)aligned));
break;
case INT_ULONG:
- memcpy(&aligned, (unsigned long*)saved+j,
+ memcpy(aligned, saved+j*sizeof(long),
sizeof(unsigned long));
- hw_llong = (long_long)(*((unsigned long*)&aligned));
+ hw_llong = (long_long)(*((unsigned long*)aligned));
break;
case INT_LLONG:
- memcpy(&aligned, (long_long*)saved+j, sizeof(long_long));
- hw_llong = (long_long)(*((long_long*)&aligned));
+ memcpy(aligned, saved+j*sizeof(long_long),
+ sizeof(long_long));
+ hw_llong = (long_long)(*((long_long*)aligned));
break;
case INT_ULLONG:
- memcpy(&aligned, (unsigned long_long*)saved+j,
+ memcpy(aligned, saved+j*sizeof(long_long),
sizeof(unsigned long_long));
- hw_llong = (long_long)(*((unsigned long_long*)&aligned));
+ hw_llong = (long_long)(*((unsigned long_long*)aligned));
break;
case INT_OTHER:
break;
@@ -1888,54 +1904,56 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst)
hw = (unsigned char*)&hw_ullong;
switch (src_type) {
case INT_CHAR:
- memcpy(&aligned, (signed char*)saved+j,
+ memcpy(aligned, saved+j*sizeof(char),
sizeof(signed char));
hw_ullong = (unsigned long_long)(*((signed char*)
- &aligned));
+ aligned));
break;
case INT_UCHAR:
- memcpy(&aligned, (unsigned char*)saved+j,
+ memcpy(aligned, saved+j*sizeof(char),
sizeof(unsigned char));
hw_ullong = (unsigned long_long)(*((unsigned char*)
- &aligned));
+ aligned));
break;
case INT_SHORT:
- memcpy(&aligned, (short*)saved+j, sizeof(short));
- hw_ullong = (unsigned long_long)(*((short*)&aligned));
+ memcpy(aligned, saved+j*sizeof(short), sizeof(short));
+ hw_ullong = (unsigned long_long)(*((short*)aligned));
break;
case INT_USHORT:
- memcpy(&aligned, (unsigned short*)saved+j,
+ memcpy(aligned, saved+j*sizeof(short),
sizeof(unsigned short));
hw_ullong = (unsigned long_long)(*((unsigned short*)
- &aligned));
+ aligned));
break;
case INT_INT:
- memcpy(&aligned, (int*)saved+j, sizeof(int));
- hw_ullong = (unsigned long_long)(*((int*)&aligned));
+ memcpy(aligned, saved+j*sizeof(int), sizeof(int));
+ hw_ullong = (unsigned long_long)(*((int*)aligned));
break;
case INT_UINT:
- memcpy(&aligned, (unsigned*)saved+j, sizeof(unsigned));
- hw_ullong = (unsigned long_long)(*((unsigned*)&aligned));
+ memcpy(aligned, saved+j*sizeof(unsigned),
+ sizeof(unsigned));
+ hw_ullong = (unsigned long_long)(*((unsigned*)aligned));
break;
case INT_LONG:
- memcpy(&aligned, (long*)saved+j, sizeof(long));
- hw_ullong = (unsigned long_long)(*((long*)&aligned));
+ memcpy(aligned, saved+j*sizeof(long), sizeof(long));
+ hw_ullong = (unsigned long_long)(*((long*)aligned));
break;
case INT_ULONG:
- memcpy(&aligned, (unsigned long*)saved+j,
+ memcpy(aligned, saved+j*sizeof(long),
sizeof(unsigned long));
hw_ullong = (unsigned long_long)(*((unsigned long*)
- &aligned));
+ aligned));
break;
case INT_LLONG:
- memcpy(&aligned, (long_long*)saved+j, sizeof(long_long));
- hw_ullong = (unsigned long_long)(*((long_long*)&aligned));
+ memcpy(aligned, saved+j*sizeof(long_long),
+ sizeof(long_long));
+ hw_ullong = (unsigned long_long)(*((long_long*)aligned));
break;
case INT_ULLONG:
- memcpy(&aligned, (unsigned long_long*)saved+j,
+ memcpy(aligned, saved+j*sizeof(long_long),
sizeof(unsigned long_long));
hw_ullong = (unsigned long_long)(*((unsigned long_long*)
- &aligned));
+ aligned));
break;
case INT_OTHER:
break;
@@ -2073,49 +2091,47 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst)
printf("%*s", 3*MAX(0, (ssize_t)dst_size-(ssize_t)src_size), "");
switch (src_type) {
case INT_CHAR:
- memcpy(&aligned, (signed char*)saved+j, sizeof(signed char));
- printf(" %29d\n", *((signed char*)&aligned));
+ memcpy(aligned, saved+j*sizeof(char), sizeof(signed char));
+ printf(" %29d\n", *((signed char*)aligned));
break;
case INT_UCHAR:
- memcpy(&aligned, (unsigned char*)saved+j,
- sizeof(unsigned char));
- printf(" %29u\n", *((unsigned char*)&aligned));
+ memcpy(aligned, saved+j*sizeof(char), sizeof(unsigned char));
+ printf(" %29u\n", *((unsigned char*)aligned));
break;
case INT_SHORT:
- memcpy(&aligned, (short*)saved+j, sizeof(short));
- printf(" %29d\n", *((short*)&aligned));
+ memcpy(aligned, saved+j*sizeof(short), sizeof(short));
+ printf(" %29d\n", *((short*)aligned));
break;
case INT_USHORT:
- memcpy(&aligned, (unsigned short*)saved+j,
+ memcpy(aligned, saved+j*sizeof(short),
sizeof(unsigned short));
- printf(" %29u\n", *((unsigned short*)&aligned));
+ printf(" %29u\n", *((unsigned short*)aligned));
break;
case INT_INT:
- memcpy(&aligned, (int*)saved+j, sizeof(int));
- printf(" %29d\n", *((int*)&aligned));
+ memcpy(aligned, saved+j*sizeof(int), sizeof(int));
+ printf(" %29d\n", *((int*)aligned));
break;
case INT_UINT:
- memcpy(&aligned, (unsigned*)saved+j, sizeof(unsigned));
- printf(" %29u\n", *((unsigned*)&aligned));
+ memcpy(aligned, saved+j*sizeof(unsigned), sizeof(unsigned));
+ printf(" %29u\n", *((unsigned*)aligned));
break;
case INT_LONG:
- memcpy(&aligned, (long*)saved+j, sizeof(long));
- printf(" %29ld\n", *((long*)&aligned));
+ memcpy(aligned, saved+j*sizeof(long), sizeof(long));
+ printf(" %29ld\n", *((long*)aligned));
break;
case INT_ULONG:
- memcpy(&aligned, (unsigned long*)saved+j,
- sizeof(unsigned long));
- printf(" %29lu\n", *((unsigned long*)&aligned));
+ memcpy(aligned, saved+j*sizeof(long), sizeof(unsigned long));
+ printf(" %29lu\n", *((unsigned long*)aligned));
break;
case INT_LLONG:
- memcpy(&aligned, (long_long*)saved+j, sizeof(long_long));
- printf(" %29"PRINTF_LL_WIDTH"d\n", *((long_long*)&aligned));
+ memcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long));
+ printf(" %29"PRINTF_LL_WIDTH"d\n", *((long_long*)aligned));
break;
case INT_ULLONG:
- memcpy(&aligned, (unsigned long_long*)saved+j,
+ memcpy(aligned, saved+j*sizeof(long_long),
sizeof(unsigned long_long));
printf(" %29"PRINTF_LL_WIDTH"u\n",
- *((unsigned long_long*)&aligned));
+ *((unsigned long_long*)aligned));
break;
case INT_OTHER:
break;
@@ -2128,49 +2144,46 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst)
printf("%*s", 3*MAX(0, (ssize_t)src_size-(ssize_t)dst_size), "");
switch (dst_type) {
case INT_CHAR:
- memcpy(&aligned, (signed char*)saved+j, sizeof(signed char));
- printf(" %29d\n", *((signed char*)&aligned));
+ memcpy(aligned, saved+j*sizeof(char), sizeof(signed char));
+ printf(" %29d\n", *((signed char*)aligned));
break;
case INT_UCHAR:
- memcpy(&aligned, (unsigned char*)saved+j,
- sizeof(unsigned char));
- printf(" %29u\n", *((unsigned char*)&aligned));
+ memcpy(aligned, saved+j*sizeof(char), sizeof(unsigned char));
+ printf(" %29u\n", *((unsigned char*)aligned));
break;
case INT_SHORT:
- memcpy(&aligned, (short*)saved+j, sizeof(short));
- printf(" %29d\n", *((short*)&aligned));
+ memcpy(aligned, saved+j*sizeof(short), sizeof(short));
+ printf(" %29d\n", *((short*)aligned));
break;
case INT_USHORT:
- memcpy(&aligned, (unsigned short*)saved+j,
- sizeof(unsigned short));
- printf(" %29u\n", *((unsigned short*)&aligned));
+ memcpy(aligned, saved+j*sizeof(short), sizeof(unsigned short));
+ printf(" %29u\n", *((unsigned short*)aligned));
break;
case INT_INT:
- memcpy(&aligned, (int*)saved+j, sizeof(int));
- printf(" %29d\n", *((int*)&aligned));
+ memcpy(aligned, saved+j*sizeof(int), sizeof(int));
+ printf(" %29d\n", *((int*)aligned));
break;
case INT_UINT:
- memcpy(&aligned, (unsigned*)saved+j, sizeof(unsigned));
- printf(" %29u\n", *((unsigned*)&aligned));
+ memcpy(aligned, saved+j*sizeof(unsigned), sizeof(unsigned));
+ printf(" %29u\n", *((unsigned*)aligned));
break;
case INT_LONG:
- memcpy(&aligned, (long*)saved+j, sizeof(long));
- printf(" %29ld\n", *((long*)&aligned));
+ memcpy(aligned, saved+j*sizeof(long), sizeof(long));
+ printf(" %29ld\n", *((long*)aligned));
break;
case INT_ULONG:
- memcpy(&aligned, (unsigned long*)saved+j,
- sizeof(unsigned long));
- printf(" %29lu\n", *((unsigned long*)&aligned));
+ memcpy(aligned, saved+j*sizeof(long), sizeof(unsigned long));
+ printf(" %29lu\n", *((unsigned long*)aligned));
break;
case INT_LLONG:
- memcpy(&aligned, (long_long*)saved+j, sizeof(long_long));
- printf(" %29"PRINTF_LL_WIDTH"d\n", *((long_long*)&aligned));
+ memcpy(aligned, saved+j*sizeof(long_long), sizeof(long_long));
+ printf(" %29"PRINTF_LL_WIDTH"d\n", *((long_long*)aligned));
break;
case INT_ULLONG:
- memcpy(&aligned, (unsigned long_long*)saved+j,
+ memcpy(aligned, saved+j*sizeof(long_long),
sizeof(unsigned long_long));
printf(" %29"PRINTF_LL_WIDTH"u\n",
- *((unsigned long_long*)&aligned));
+ *((unsigned long_long*)aligned));
break;
case INT_OTHER:
break;
@@ -2233,6 +2246,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst)
done:
if (buf) aligned_free(buf);
if (saved) aligned_free(saved);
+ if (aligned) free(aligned);
fflush(stdout);
reset_hdf5(); /*print statistics*/
return (int)fails_all_tests;
@@ -2240,6 +2254,7 @@ test_conv_int_1(const char *name, hid_t src, hid_t dst)
error:
if (buf) aligned_free(buf);
if (saved) aligned_free(saved);
+ if (aligned) free(aligned);
fflush(stdout);
reset_hdf5(); /*print statistics*/
return MAX((int)fails_all_tests, 1);
@@ -2350,11 +2365,9 @@ test_conv_flt_1 (const char *name, hid_t src, hid_t dst)
char str[256]; /*hello string */
float hw_f; /*hardware-converted */
double hw_d; /*hardware-converted */
+ void *aligned=NULL; /*aligned buffer */
#if SIZEOF_LONG_DOUBLE!=SIZEOF_DOUBLE
long double hw_ld; /*hardware-converted */
- long double aligned; /*aligned value */
-#else
- double aligned; /*aligned value */
#endif
unsigned char *hw=NULL; /*ptr to hardware-conv'd*/
size_t i, j, k; /*counters */
@@ -2444,6 +2457,7 @@ test_conv_flt_1 (const char *name, hid_t src, hid_t dst)
dst_size = H5Tget_size(dst);
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*/
#ifdef SHOW_OVERFLOWS
noverflows_g = 0;
#endif
@@ -2516,44 +2530,45 @@ test_conv_flt_1 (const char *name, hid_t src, hid_t dst)
/* The hardware conversion */
if (FLT_FLOAT==src_type) {
- memcpy(&aligned, (float*)saved+j, sizeof(float));
+ memcpy(aligned, saved+j*sizeof(float), sizeof(float));
if (FLT_FLOAT==dst_type) {
- hw_f = *((float*)&aligned);
+ hw_f = *((float*)aligned);
hw = (unsigned char*)&hw_f;
} else if (FLT_DOUBLE==dst_type) {
- hw_d = *((float*)&aligned);
+ hw_d = *((float*)aligned);
hw = (unsigned char*)&hw_d;
#if SIZEOF_LONG_DOUBLE!=SIZEOF_DOUBLE
} else {
- hw_ld = *((float*)&aligned);
+ hw_ld = *((float*)aligned);
hw = (unsigned char*)&hw_ld;
#endif
}
} else if (FLT_DOUBLE==src_type) {
- memcpy(&aligned, (double*)saved+j, sizeof(double));
+ memcpy(aligned, saved+j*sizeof(double), sizeof(double));
if (FLT_FLOAT==dst_type) {
- hw_f = *((double*)&aligned);
+ hw_f = *((double*)aligned);
hw = (unsigned char*)&hw_f;
} else if (FLT_DOUBLE==dst_type) {
- hw_d = *((double*)&aligned);
+ hw_d = *((double*)aligned);
hw = (unsigned char*)&hw_d;
#if SIZEOF_LONG_DOUBLE!=SIZEOF_DOUBLE
} else {
- hw_ld = *((double*)&aligned);
+ hw_ld = *((double*)aligned);
hw = (unsigned char*)&hw_ld;
#endif
}
#if SIZEOF_LONG_DOUBLE!=SIZEOF_DOUBLE
} else {
- memcpy(&aligned, (long double*)saved+j, sizeof(long double));
+ memcpy(aligned, saved+j*sizeof(long double),
+ sizeof(long double));
if (FLT_FLOAT==dst_type) {
- hw_f = *((long double*)&aligned);
+ hw_f = *((long double*)aligned);
hw = (unsigned char*)&hw_f;
} else if (FLT_DOUBLE==dst_type) {
- hw_d = *((long double*)&aligned);
+ hw_d = *((long double*)aligned);
hw = (unsigned char*)&hw_d;
} else {
- hw_ld = *((long double*)&aligned);
+ hw_ld = *((long double*)aligned);
hw = (unsigned char*)&hw_ld;
}
#endif
@@ -2709,8 +2724,9 @@ test_conv_flt_1 (const char *name, hid_t src, hid_t dst)
#endif
done:
- if (buf) aligned_free (buf);
- if (saved) aligned_free (saved);
+ if (buf) aligned_free(buf);
+ if (saved) aligned_free(saved);
+ if (aligned) free(aligned);
fflush(stdout);
#ifdef HANDLE_SIGFPE
exit(MIN((int)fails_all_tests, 254));
@@ -2720,8 +2736,9 @@ test_conv_flt_1 (const char *name, hid_t src, hid_t dst)
#endif
error:
- if (buf) aligned_free (buf);
- if (saved) aligned_free (saved);
+ if (buf) aligned_free(buf);
+ if (saved) aligned_free(saved);
+ if (aligned) free(aligned);
fflush(stdout);
#ifdef HANDLE_SIGFPE
exit(MIN(MAX((int)fails_all_tests, 1), 254));
diff --git a/test/hyperslab.c b/test/hyperslab.c
index 6fdfaa5..01e092c 100644
--- a/test/hyperslab.c
+++ b/test/hyperslab.c
@@ -284,7 +284,7 @@ test_fill(size_t nx, size_t ny, size_t nz,
* Purpose: Tests H5V_hyper_copy().
*
* The NX, NY, and NZ arguments are the size for the source and
- * destination arrays. You map pass zero for NZ or for NY and
+ * destination arrays. You may pass zero for NZ or for NY and
* NZ to test the 2-d and 1-d cases respectively.
*
* A hyperslab is copied from/to (depending on MODE) various
@@ -384,12 +384,12 @@ test_copy(int mode,
dst = H5MM_calloc(nx*ny*nz);
init_full(src, nx, ny, nz);
- for (i = 0; i < nx; i += di) {
- for (j = 0; j < ny; j += dj) {
- for (k = 0; k < nz; k += dk) {
- for (dx = 1; dx <= nx - i; dx += ddx) {
- for (dy = 1; dy <= ny - j; dy += ddy) {
- for (dz = 1; dz <= nz - k; dz += ddz) {
+ for (i=0; i<nx; i+=di) {
+ for (j=0; j<ny; j+=dj) {
+ for (k=0; k<nz; k+=dk) {
+ for (dx=1; dx<=nx-i; dx+=ddx) {
+ for (dy=1; dy<=ny-j; dy+=ddy) {
+ for (dz=1; dz<=nz-k; dz+=ddz) {
/*
* Describe the source and destination hyperslabs
@@ -451,10 +451,10 @@ test_copy(int mode,
* Set all loc values to 1 so we can detect writing
* outside the hyperslab.
*/
- for (u = 0; u < nx; u++) {
- for (v = 0; v < ny; v++) {
- for (w = 0; w < nz; w++) {
- dst[u * ny * nz + v * nz + w] = 1;
+ for (u=0; u<nx; u++) {
+ for (v=0; v<ny; v++) {
+ for (w=0; w<nz; w++) {
+ dst[u*ny*nz + v*nz + w] = 1;
}
}
}
@@ -476,10 +476,10 @@ test_copy(int mode,
for (v=dst_offset[1];
v<dst_offset[1]+dy;
v++) {
- for (w = dst_offset[2];
- w < dst_offset[2] + dz;
+ for (w=dst_offset[2];
+ w<dst_offset[2]+dz;
w++) {
- acc += dst[u * ny * nz + v * nz + w];
+ acc += dst[u*ny*nz + v*nz + w];
}
}
}
@@ -512,14 +512,21 @@ test_copy(int mode,
* we added the border of 1's to the hyperslab.
*/
acc = 0;
- for (u = 0; u < nx; u++) {
- for (v = 0; v < ny; v++) {
- for (w = 0; w < nz; w++) {
- acc += dst[u * ny * nz + v * nz + w];
+ for (u=0; u<nx; u++) {
+ for (v=0; v<ny; v++) {
+ for (w=0; w<nz; w++) {
+ acc += dst[u*ny*nz + v*nz + w];
}
}
}
- if (acc != ref_value + nx*ny*nz - dx*dy*dz) {
+
+ /*
+ * The following casts are to work around an
+ * optimization bug in the Mongoose 7.20 Irix64
+ * compiler.
+ */
+ if (acc+(unsigned)dx*(unsigned)dy*(unsigned)dz !=
+ ref_value + nx*ny*nz) {
puts("*FAILED*");
if (!isatty(1)) {
/*