summaryrefslogtreecommitdiff
path: root/tests/win32_test.c
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2004-02-29 22:36:24 +0000
committerErik de Castro Lopo <erikd@mega-nerd.com>2004-02-29 22:36:24 +0000
commit0a6b0aa4a9aaf9a884d24ad2c2f58ff437dd04c8 (patch)
tree320ba1606a907af276fcf350ec3c4b6c74df525d /tests/win32_test.c
parentfbebccc190d7f0ae9463616201a239b33be4bdcf (diff)
Fix warnings on ia64 Linux.
Diffstat (limited to 'tests/win32_test.c')
-rw-r--r--tests/win32_test.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/tests/win32_test.c b/tests/win32_test.c
index 7813510..bead425 100644
--- a/tests/win32_test.c
+++ b/tests/win32_test.c
@@ -36,6 +36,8 @@
#include <sys/types.h>
#include <sys/stat.h>
+#define SIGNED_SIZEOF(x) ((int) sizeof (x))
+
#if defined (__CYGWIN__)
#define LSEEK lseek
@@ -109,7 +111,7 @@ show_fstat_error (void)
puts ("\n64 bit fstat() test.\n--------------------") ;
- printf ("0) Create a file, write %d bytes and close it.\n", sizeof (data)) ;
+ printf ("0) Create a file, write %d bytes and close it.\n", SIGNED_SIZEOF (data)) ;
mode = O_WRONLY | O_CREAT | O_TRUNC | O_BINARY ;
flags = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH ;
if ((fd = open (filename, mode, flags)) < 0)
@@ -119,7 +121,7 @@ show_fstat_error (void)
write (fd, data, sizeof (data)) ;
close (fd) ;
- printf ("1) Re-open file in read/write mode and write another %d bytes at the end.\n", sizeof (data)) ;
+ printf ("1) Re-open file in read/write mode and write another %d bytes at the end.\n", SIGNED_SIZEOF (data)) ;
mode = O_RDWR | O_BINARY ;
flags = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH ;
if ((fd = open (filename, mode, flags)) < 0)
@@ -163,7 +165,7 @@ show_lseek_error (void)
puts ("\n64 bit lseek() test.\n--------------------") ;
- printf ("0) Create a file, write %d bytes and close it.\n", sizeof (data)) ;
+ printf ("0) Create a file, write %d bytes and close it.\n", SIGNED_SIZEOF (data)) ;
mode = O_WRONLY | O_CREAT | O_TRUNC | O_BINARY ;
flags = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH ;
if ((fd = open (filename, mode, flags)) < 0)
@@ -173,7 +175,7 @@ show_lseek_error (void)
write (fd, data, sizeof (data)) ;
close (fd) ;
- printf ("1) Re-open file in read/write mode and write another %d bytes at the end.\n", sizeof (data)) ;
+ printf ("1) Re-open file in read/write mode and write another %d bytes at the end.\n", SIGNED_SIZEOF (data)) ;
mode = O_RDWR | O_BINARY ;
flags = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH ;
if ((fd = open (filename, mode, flags)) < 0)