[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] binary-io: always define SET_BINARY as an expression
From: |
Jim Meyering |
Subject: |
[PATCH] binary-io: always define SET_BINARY as an expression |
Date: |
Thu, 24 Dec 2009 19:12:26 +0100 |
Hi Bruno,
Without the patch below, a use like this:
if (expr)
SET_BINARY (fd);
would evoke a warning from gcc on most systems.
Ok to commit?
>From 9d0a1847b9288fb45b244cef1f1e1cceddaeebe5 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Thu, 24 Dec 2009 19:09:58 +0100
Subject: [PATCH] binary-io: always define SET_BINARY as an expression
* lib/binary-io.h (SET_BINARY): Define to an expression (0),
rather than to nothing, on "reasonable" systems. This permits
warning-free use like "if (expr) SET_BINARY (fd);".
---
ChangeLog | 7 +++++++
lib/binary-io.h | 2 +-
2 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 7c8f7da..be72e31 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-12-24 Jim Meyering <address@hidden>
+
+ binary-io: always define SET_BINARY as an expression
+ * lib/binary-io.h (SET_BINARY): Define to an expression (0),
+ rather than to nothing, on "reasonable" systems. This permits
+ warning-free use like "if (expr) SET_BINARY (fd);".
+
2009-12-24 Bruno Haible <address@hidden>
Reduce namespace pollution on glibc systems.
diff --git a/lib/binary-io.h b/lib/binary-io.h
index 9851511..879d196 100644
--- a/lib/binary-io.h
+++ b/lib/binary-io.h
@@ -57,7 +57,7 @@
/* On reasonable systems, binary I/O is the default. */
# undef O_BINARY
# define O_BINARY 0
-# define SET_BINARY(fd) /* nothing */
+# define SET_BINARY(fd) 0
#endif
#endif /* _BINARY_H */
--
1.6.6.274.gdcca7
- [PATCH] binary-io: always define SET_BINARY as an expression,
Jim Meyering <=