summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorScott Wegner <swegner@hdfgroup.org>2008-06-09 18:41:29 (GMT)
committerScott Wegner <swegner@hdfgroup.org>2008-06-09 18:41:29 (GMT)
commit7a92820e35582fc94f0dd46e5039547fddd3d98d (patch)
tree4edab170ada903be86940f82c306a2aa738afcb8 /tools
parenta97fa671eb16f7b12ed87c46c86501d0282aa364 (diff)
downloadhdf5-7a92820e35582fc94f0dd46e5039547fddd3d98d.zip
hdf5-7a92820e35582fc94f0dd46e5039547fddd3d98d.tar.gz
hdf5-7a92820e35582fc94f0dd46e5039547fddd3d98d.tar.bz2
[svn-r15183] Purpose: _WIN32 macro cleanup
Description: As part of our Windows cleanup, we try to remove windows-specific tweaks in the source code. There are many instances where Windows code is introduces via ifdef's. We re-evaluate whether they are still required, and found that many of them are not. Others we change to "feature"-specific code, rather than Windows-specific. Tested: VS2005 on WinXP VS.NET on WinXP h5committest (kagisopp, smirom, linew)
Diffstat (limited to 'tools')
-rw-r--r--tools/h5dump/h5dumpgentest.c4
-rw-r--r--tools/h5jam/h5jamgentest.c6
-rw-r--r--tools/h5ls/h5ls.c4
-rw-r--r--tools/lib/h5tools_utils.c5
-rw-r--r--tools/misc/h5repart.c14
5 files changed, 1 insertions, 32 deletions
diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c
index 8f48e89..0646536 100644
--- a/tools/h5dump/h5dumpgentest.c
+++ b/tools/h5dump/h5dumpgentest.c
@@ -1199,11 +1199,7 @@ static void gent_many(void)
for(i0 = 0; i0 < 2; i0++) {
dset1[j].a[i3][i2][i1][i0] = i0+j;
dset1[j].b[i3][i2][i1][i0] = (double)(i0+j);
-#ifdef _WIN32
- dset1[j].c[i3][i2][i1][i0] = (double)(i0+j+(signed __int64)sdim);
-#else
dset1[j].c[i3][i2][i1][i0] = (double)(i0+j+sdim);
-#endif
}
}
}
diff --git a/tools/h5jam/h5jamgentest.c b/tools/h5jam/h5jamgentest.c
index 0599552..7b7e648 100644
--- a/tools/h5jam/h5jamgentest.c
+++ b/tools/h5jam/h5jamgentest.c
@@ -333,11 +333,7 @@ create_textfile(const char *name, size_t size)
size_t i;
char *bp;
-#ifdef _WIN32
- fd = _creat(name, _S_IREAD | _S_IWRITE);
-#else /* _WIN32 */
- fd = creat(name,(mode_t)0777);
-#endif /* _WIN32 */
+ fd = HDcreat(name,0777);
assert(fd >= 0);
buf = calloc(size, (size_t)1);
assert(buf);
diff --git a/tools/h5ls/h5ls.c b/tools/h5ls/h5ls.c
index 6f07050..6545368 100644
--- a/tools/h5ls/h5ls.c
+++ b/tools/h5ls/h5ls.c
@@ -1526,11 +1526,7 @@ dataset_list2(hid_t dset, const char UNUSED *name)
(unsigned long)total, 1==total?"":"s",
(unsigned long)used, 1==used?"":"s");
if (used>0) {
-#ifdef _WIN32
- utilization = (hssize_t)total * 100.0 / (hssize_t)used;
-#else
utilization = (total*100.0)/used;
-#endif
printf(", %1.2f%% utilization", utilization);
}
putchar('\n');
diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c
index 512a3fb..0be3a91 100644
--- a/tools/lib/h5tools_utils.c
+++ b/tools/lib/h5tools_utils.c
@@ -99,13 +99,8 @@ warn_msg(const char *progname, const char *fmt, ...)
va_start(ap, fmt);
HDfflush(stdout);
-#ifdef _WIN32
- HDfprintf(stdout, "%s warning: ", progname);
- HDvfprintf(stdout, fmt, ap);
-#else /* _WIN32 */
HDfprintf(stderr, "%s warning: ", progname);
HDvfprintf(stderr, fmt, ap);
-#endif /* _WIN32 */
va_end(ap);
}
diff --git a/tools/misc/h5repart.c b/tools/misc/h5repart.c
index f107e31..91df7b6 100644
--- a/tools/misc/h5repart.c
+++ b/tools/misc/h5repart.c
@@ -45,11 +45,6 @@
# include <sys/stat.h>
#endif
-#ifdef _WIN32
-# include <io.h>
-# include <fcntl.h>
-#endif
-
#ifndef FALSE
# define FALSE 0
#endif
@@ -216,21 +211,12 @@ main (int argc, char *argv[])
int dst_is_family; /*is dst name a family name? */
int dst_membno=0; /*destination member number */
-#if defined(_WIN32) && ! defined (__MWERKS__)
- __int64 left_overs=0; /*amount of zeros left over */
- __int64 src_offset=0; /*offset in source member */
- __int64 dst_offset=0; /*offset in destination member */
- __int64 src_size; /*source logical member size */
- __int64 src_act_size; /*source actual member size */
- __int64 dst_size=1 GB; /*destination logical memb size */
-#else
off_t left_overs=0; /*amount of zeros left over */
off_t src_offset=0; /*offset in source member */
off_t dst_offset=0; /*offset in destination member */
off_t src_size; /*source logical member size */
off_t src_act_size; /*source actual member size */
off_t dst_size=1 GB; /*destination logical memb size */
-#endif
hid_t fapl; /*file access property list */
hid_t file;
hsize_t hdsize; /*destination logical memb size */