summaryrefslogtreecommitdiffstats
path: root/src/H5private.h
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-06-16 19:38:26 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-06-16 19:38:26 (GMT)
commit53916f4e5935ae7c36d7dd6e04d1c5e51b7e78ea (patch)
tree76c6163d98ac715ddec1dfe4fa69f8f2753636a0 /src/H5private.h
parenta639a5998c7bc5d9f00f95e0ee4157950b5e49eb (diff)
downloadhdf5-53916f4e5935ae7c36d7dd6e04d1c5e51b7e78ea.zip
hdf5-53916f4e5935ae7c36d7dd6e04d1c5e51b7e78ea.tar.gz
hdf5-53916f4e5935ae7c36d7dd6e04d1c5e51b7e78ea.tar.bz2
[svn-r428] Changes since 19980612
---------------------- ./src/H5Tbit.c ./MANIFEST ./test/Makefile.in ./test/bittests.c NEW Finished the bit vector operations and added test cases. ./src/H5Tconv.c ./test/dtypes.c Finished integer->integer general conversion and added test cases. Overflows and underflows are handled by substituting the closest possible value. Examples: (unsigned)0xffff -> (unsigned) 0xff ( signed)0xffff -> (unsigned)0x0000 (unsigned)0xffff -> ( signed)0x7fff ( signed)0x7fff -> ( signed) 0x7f ( signed)0xbfff -> ( signed) 0xbf ( signed)0x8000 -> ( signed) 0x80 ./src/H5private.h Added definitions for MIN and MAX that take 3 or 4 arguments: MIN3(), MIN4(), MAX3(), MAX4(). Also added MIN2() and MAX2() as aliases for MIN() and MAX(). ./test/tattr.c Removed some redundant `&' operators. ./configure.in ./src/H5config.h.in [regenerated] ./src/H5.c Fixed warnings on DEC where long double is the same as double.
Diffstat (limited to 'src/H5private.h')
-rw-r--r--src/H5private.h25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/H5private.h b/src/H5private.h
index 3d3ca3d..db7ca1e 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -64,32 +64,33 @@
/* number of members in an array */
#ifndef NELMTS
-# define NELMTS(X) (sizeof(X)/sizeof(X[0]))
+# define NELMTS(X) (sizeof(X)/sizeof(X[0]))
#endif
-/* minimum of two values */
+/* minimum of two, three, or four values */
#ifndef MIN
-# define MIN(a,b) (((a)<(b)) ? (a) : (b))
+# define MIN(a,b) (((a)<(b)) ? (a) : (b))
+# define MIN2(a,b) MIN(a,b)
+# define MIN3(a,b,c) MIN(a,MIN(b,c))
+# define MIN4(a,b,c,d) MIN(MIN(a,b),MIN(c,d))
#endif
-/* maximum of two values */
+/* maximum of two, three, or four values */
#ifndef MAX
-# define MAX(a,b) (((a)>(b)) ? (a) : (b))
+# define MAX(a,b) (((a)>(b)) ? (a) : (b))
+# define MAX2(a,b) MAX(a,b)
+# define MAX3(a,b,c) MAX(a,MAX(b,c))
+# define MAX4(a,b,c,d) MAX(MAX(a,b),MAX(c,d))
#endif
/* absolute value */
#ifndef ABS
-# define ABS(a) (((a)>=0) ? (a) : -(a))
+# define ABS(a) (((a)>=0) ? (a) : -(a))
#endif
/* sign of argument */
#ifndef SIGN
-# define SIGN(a) ((a)>0 ? 1 : (a)<0 ? -1 : 0)
-#endif
-
-/* maximum of three values */
-#ifndef MAX3
-# define MAX3(a,b,c) MAX(MAX(a,b),c)
+# define SIGN(a) ((a)>0 ? 1 : (a)<0 ? -1 : 0)
#endif
/* maximum value of various types */