bug-diffutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-diffutils] [PATCH 19/19] maint: remove hard-coded macro definitions


From: Jim Meyering
Subject: [bug-diffutils] [PATCH 19/19] maint: remove hard-coded macro definitions provided by intprops.h
Date: Fri, 20 Nov 2009 10:12:28 +0100

From: Jim Meyering <address@hidden>

* lib/cmpbuf.c: Include "intprops.h" rather than open-coding macros
like TYPE_SIGNED and TYPE_MINIMUM.
---
 lib/cmpbuf.c |   18 +-----------------
 1 files changed, 1 insertions(+), 17 deletions(-)

diff --git a/lib/cmpbuf.c b/lib/cmpbuf.c
index 63a5175..2de579f 100644
--- a/lib/cmpbuf.c
+++ b/lib/cmpbuf.c
@@ -40,23 +40,7 @@

 #include <sys/types.h>
 #include "cmpbuf.h"
-
-/* Determine whether an integer type is signed, and its bounds.
-   This code assumes two's (or one's!) complement with no holes.  */
-
-/* The extra casts work around common compiler bugs,
-   e.g. Cray C 5.0.3.0 when t == time_t.  */
-#ifndef TYPE_SIGNED
-# define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
-#endif
-#ifndef TYPE_MINIMUM
-# define TYPE_MINIMUM(t) ((t) (TYPE_SIGNED (t) \
-                              ? ~ (t) 0 << (sizeof (t) * CHAR_BIT - 1) \
-                              : (t) 0))
-#endif
-#ifndef TYPE_MAXIMUM
-# define TYPE_MAXIMUM(t) ((t) (~ (t) 0 - TYPE_MINIMUM (t)))
-#endif
+#include "intprops.h"

 #ifndef PTRDIFF_MAX
 # define PTRDIFF_MAX TYPE_MAXIMUM (ptrdiff_t)
-- 
1.6.5.3.433.g11067





reply via email to

[Prev in Thread] Current Thread [Next in Thread]