summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2001-06-29 18:53:29 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2001-06-29 18:53:29 (GMT)
commit955ef79577044849f77e718011fe1a525971ac92 (patch)
tree403241392023c64f1f7bbf518d66c7ba4cc9e829 /src
parentaca104be974d9857a47b2c6b877c694693870b8b (diff)
downloadhdf5-955ef79577044849f77e718011fe1a525971ac92.zip
hdf5-955ef79577044849f77e718011fe1a525971ac92.tar.gz
hdf5-955ef79577044849f77e718011fe1a525971ac92.tar.bz2
[svn-r4086] Purpose:
Code Cleanup Description: CodeWarrior checkin broke the unix build in a couple of ways... Solution: Various tweaks and cleanups. Platforms tested: FreeBSD 4.3 (hawkwind)
Diffstat (limited to 'src')
-rw-r--r--src/H5FDdpss.c19
-rw-r--r--src/H5FDgass.c19
-rw-r--r--src/H5FDlog.c21
-rw-r--r--src/H5FDsec2.c26
-rw-r--r--src/H5FDsrb.c8
-rw-r--r--src/H5Oefl.c2
-rw-r--r--src/H5Ppublic.h1
-rw-r--r--src/H5private.h44
8 files changed, 98 insertions, 42 deletions
diff --git a/src/H5FDdpss.c b/src/H5FDdpss.c
index 31e576e..beb8964 100644
--- a/src/H5FDdpss.c
+++ b/src/H5FDdpss.c
@@ -54,6 +54,25 @@ typedef struct H5FD_dpss_t {
/*
+ * This driver supports systems that have the lseek64() function by defining
+ * some macros here so we don't have to have conditional compilations later
+ * throughout the code.
+ *
+ * file_offset_t: The datatype for file offsets, the second argument of
+ * the lseek() or lseek64() call.
+ *
+ * file_seek: The function which adjusts the current file position,
+ * either lseek() or lseek64().
+ */
+#ifdef H5_HAVE_LSEEK64
+# define file_offset_t off64_t
+# define file_seek lseek64
+#else
+# define file_offset_t off_t
+# define file_seek lseek
+#endif
+
+/*
* These macros check for overflow of various quantities. These macros
* assume that file_offset_t is signed and haddr_t and size_t are unsigned.
*
diff --git a/src/H5FDgass.c b/src/H5FDgass.c
index 9a31822..6b264a2 100644
--- a/src/H5FDgass.c
+++ b/src/H5FDgass.c
@@ -56,6 +56,25 @@ typedef struct H5FD_gass_t {
/*
+ * This driver supports systems that have the lseek64() function by defining
+ * some macros here so we don't have to have conditional compilations later
+ * throughout the code.
+ *
+ * file_offset_t: The datatype for file offsets, the second argument of
+ * the lseek() or lseek64() call.
+ *
+ * file_seek: The function which adjusts the current file position,
+ * either lseek() or lseek64().
+ */
+#ifdef H5_HAVE_LSEEK64
+# define file_offset_t off64_t
+# define file_seek lseek64
+#else
+# define file_offset_t off_t
+# define file_seek lseek
+#endif
+
+/*
* These macros check for overflow of various quantities. These macros
* assume that file_offset_t is signed and haddr_t and size_t are unsigned.
*
diff --git a/src/H5FDlog.c b/src/H5FDlog.c
index 6454e24..e7b663c 100644
--- a/src/H5FDlog.c
+++ b/src/H5FDlog.c
@@ -103,7 +103,24 @@ typedef struct H5FD_log_t {
#endif
} H5FD_log_t;
-
+/*
+ * This driver supports systems that have the lseek64() function by defining
+ * some macros here so we don't have to have conditional compilations later
+ * throughout the code.
+ *
+ * file_offset_t: The datatype for file offsets, the second argument of
+ * the lseek() or lseek64() call.
+ *
+ * file_seek: The function which adjusts the current file position,
+ * either lseek() or lseek64().
+ */
+#ifdef H5_HAVE_LSEEK64
+# define file_offset_t off64_t
+# define file_seek lseek64
+#else
+# define file_offset_t off_t
+# define file_seek lseek
+#endif
/*
* These macros check for overflow of various quantities. These macros
@@ -941,7 +958,7 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, hadd
while (size>0) {
do {
assert(size==(hsize_t)((size_t)size)); /*check for overflow*/
- nbytes = HDwrite(file->fd, (void*)buf, (size_t)size);
+ nbytes = HDwrite(file->fd, buf, (size_t)size);
} while (-1==nbytes && EINTR==errno);
if (-1==nbytes) {
/* error */
diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c
index 847b8fd..4c9f967 100644
--- a/src/H5FDsec2.c
+++ b/src/H5FDsec2.c
@@ -75,6 +75,30 @@ typedef struct H5FD_sec2_t {
#endif
} H5FD_sec2_t;
+/*
+ * This driver supports systems that have the lseek64() function by defining
+ * some macros here so we don't have to have conditional compilations later
+ * throughout the code.
+ *
+ * file_offset_t: The datatype for file offsets, the second argument of
+ * the lseek() or lseek64() call.
+ *
+ * file_seek: The function which adjusts the current file position,
+ * either lseek() or lseek64().
+ */
+/* adding for windows NT file system support. */
+
+#ifdef H5_HAVE_LSEEK64
+# define file_offset_t off64_t
+# define file_seek lseek64
+#elif defined WIN32
+# define file_offset_t __int64
+# define file_seek _lseeki64
+#else
+# define file_offset_t off_t
+# define file_seek lseek
+#endif
+
/*
* These macros check for overflow of various quantities. These macros
@@ -635,7 +659,7 @@ H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, had
while (size>0) {
do {
assert(size==(hsize_t)((size_t)size)); /*check for overflow*/
- nbytes = HDwrite(file->fd, (void*) buf, (size_t)size);
+ nbytes = HDwrite(file->fd, buf, (size_t)size);
} while (-1==nbytes && EINTR==errno);
if (-1==nbytes) {
/* error */
diff --git a/src/H5FDsrb.c b/src/H5FDsrb.c
index a345b39..ac38b65 100644
--- a/src/H5FDsrb.c
+++ b/src/H5FDsrb.c
@@ -20,7 +20,13 @@ static hid_t H5FD_SRB_g = 0;
#ifdef H5_HAVE_SRB
-
+#ifdef H5_HAVE_LSEEK64
+# define file_offset_t off64_t
+# define file_seek lseek64
+#else
+# define file_offset_t off_t
+# define file_seek lseek
+#endif
/*
* These macros check for overflow of various quantities. These macros
diff --git a/src/H5Oefl.c b/src/H5Oefl.c
index 7288ec6..b16a267 100644
--- a/src/H5Oefl.c
+++ b/src/H5Oefl.c
@@ -537,7 +537,7 @@ H5O_efl_write (H5F_t UNUSED *f, const H5O_efl_t *efl, haddr_t addr,
"unable to seek in external raw data file");
}
to_write = MIN(efl->slot[i].size-skip, size);
- if ((size_t)HDwrite (fd, (void*)buf, to_write)!=to_write) {
+ if ((size_t)HDwrite (fd, buf, to_write)!=to_write) {
HGOTO_ERROR (H5E_EFL, H5E_READERROR, FAIL,
"write error in external raw data file");
}
diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h
index 8d5d8da..5b3731c 100644
--- a/src/H5Ppublic.h
+++ b/src/H5Ppublic.h
@@ -20,7 +20,6 @@
/* Default Template for creation, access, etc. templates */
#define H5P_DEFAULT 0
-#include <H5private.h>
/* Public headers needed by this file */
#include "H5public.h"
#include "H5Ipublic.h"
diff --git a/src/H5private.h b/src/H5private.h
index 256a22c..0b1e3ff 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -133,6 +133,9 @@
#ifdef H5_HAVE_SYS_PROC_H
# include <sys/proc.h>
#endif
+#ifdef H5_HAVE_IO_H
+# include <io.h>
+#endif
#ifdef WIN32
@@ -150,7 +153,6 @@
#include <windef.h>
#include <winbase.h>
-#include <io.h>
/* H5_inline */
@@ -182,45 +184,12 @@ typedef long off_t;
#endif
/*WIN32*/
-/*
- * This driver supports systems that have the lseek64() function by defining
- * some macros here so we don't have to have conditional compilations later
- * throughout the code.
- *
- * file_offset_t: The datatype for file offsets, the second argument of
- * the lseek() or lseek64() call.
- *
- * file_seek: The function which adjusts the current file position,
- * either lseek() or lseek64().
- */
-/* adding for windows NT file system support. */
-/* pvn: added __MWERKS__ support. */
-
-#ifdef H5_HAVE_LSEEK64
-# define file_offset_t off64_t
-# define file_seek lseek64
-#elif defined (WIN32)
-# ifdef __MWERKS__
-# define file_offset_t off_t
-# define file_seek lseek
-# else /*MSVC*/
-# define file_offset_t __int64
-# define file_seek _lseeki64
-# endif
-#else
-# define file_offset_t off_t
-# define file_seek lseek
-#endif
-
#ifndef F_OK
# define F_OK 00
# define W_OK 02
# define R_OK 04
#endif
-
-
-
/*
* Pablo support files.
*/
@@ -575,7 +544,12 @@ __DLL__ void H5_bandwidth(char *buf/*out*/, double nbytes, double nseconds);
#define HDexecve(S,AV,E) execve(S,AV,E)
#define HDexecvp(S,AV) execvp(S,AV)
#define HDexit(N) exit(N)
+#if defined __MWERKS__
+#include <abort_exit.h>
+#define HD_exit(N) __exit(N)
+#else
#define HD_exit(N) _exit(N)
+#endif
#define HDexp(X) exp(X)
#define HDfabs(X) fabs(X)
#define HDfclose(F) fclose(F)
@@ -1130,5 +1104,3 @@ __DLL__ intn H5T_term_interface(void);
__DLL__ intn H5Z_term_interface(void);
#endif
-
-