summaryrefslogtreecommitdiffstats
path: root/src/H5private.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2001-01-09 21:22:30 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2001-01-09 21:22:30 (GMT)
commit35bc545296209684a5c46db0cde11beb9403a4dc (patch)
tree98b5a037ed928085b98abc1fee71fc62f81073c1 /src/H5private.h
parent1290c4808d3e9890c765b1445f66b823c9026734 (diff)
downloadhdf5-35bc545296209684a5c46db0cde11beb9403a4dc.zip
hdf5-35bc545296209684a5c46db0cde11beb9403a4dc.tar.gz
hdf5-35bc545296209684a5c46db0cde11beb9403a4dc.tar.bz2
[svn-r3252] Purpose:
Code cleanup. Description: Fixed _lots_ (I mean _tons_) of warnings spit out by the gcc with the extra warnings. Including a few show-stoppers for compression on IRIX machines. Solution: Changed lots of variables' types to more sensible and consistent types, more range-checking, more variable typecasts, etc. Platforms tested: FreeBSD 4.2 (hawkwind), IRIX64-64 (modi4)
Diffstat (limited to 'src/H5private.h')
-rw-r--r--src/H5private.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/H5private.h b/src/H5private.h
index 93f0f9e..9d5c933 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -427,6 +427,19 @@ typedef unsigned uintn;
#endif
/*
+ * A macro for detecting over/under-flow when casting between types
+ */
+#ifndef NDEBUG
+#define H5_CHECK_OVERFLOW(var,vartype,casttype) \
+{ \
+ casttype _tmp_overflow=(casttype)(var); \
+ assert((var)==(vartype)_tmp_overflow); \
+}
+#else /* NDEBUG */
+#define H5_CHECK_OVERFLOW(var,vartype,casttype)
+#endif /* NDEBUG */
+
+/*
* Data types and functions for timing certain parts of the library.
*/
typedef struct {
@@ -708,7 +721,7 @@ __DLL__ int64_t HDstrtoll (const char *s, const char **rest, int base);
* And now for a couple non-Posix functions... Watch out for systems that
* define these in terms of macros.
*/
-#ifndef strdup
+#if !defined strdup && !defined HAVE_STRDUP
char *strdup(const char *s);
#endif
#define HDstrdup(S) strdup(S)