CHAR_BIT SCHAR_MAX UCHAR_MAX SHRT_MAX INT_MAX UINT_MAX LONG_MAX ULONG_MAX
authorJim Meyering <jim@meyering.net>
Sat, 10 Jan 1998 22:12:03 +0000 (22:12 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 10 Jan 1998 22:12:03 +0000 (22:12 +0000)
Remove definitions of those symbols.
* src/csplit.c: Move inclusion of regex.h/rx.h to follow system.h
since it now includes limit.h which defines RE_DUP_MAX.
* src/nl.c: Likewise.
* src/tac.c: Likewise.

14 files changed:
src/csplit.c
src/fmt.c
src/fold.c
src/join.c
src/nl.c
src/od.c
src/pr.c
src/sort.c
src/split.c
src/tac.c
src/tail.c
src/tr.c
src/unexpand.c
src/uniq.c

index b923ed4..691ec38 100644 (file)
@@ -1,5 +1,5 @@
 /* csplit - split a file into sections determined by context lines
-   Copyright (C) 91, 95, 96, 1997 Free Software Foundation, Inc.
+   Copyright (C) 91, 95, 96, 1997, 1998 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 #include <getopt.h>
 #include <sys/types.h>
 #include <signal.h>
-#ifdef HAVE_LIMITS_H
-# include <limits.h>
-#endif /* HAVE_LIMITS_H */
 
-#ifndef UINT_MAX
-# define UINT_MAX ((unsigned int) ~(unsigned int) 0)
-#endif
-
-#ifndef INT_MAX
-# define INT_MAX ((int) (UINT_MAX >> 1))
-#endif
+#include "system.h"
 
 #if WITH_REGEX
 # include <regex.h>
 #else
 # include <rx.h>
 #endif
-#include "system.h"
+
 #include "error.h"
 #include "xstrtoul.h"
 #include "xalloc.h"
index 7067a5e..613cf51 100644 (file)
--- a/src/fmt.c
+++ b/src/fmt.c
@@ -1,5 +1,5 @@
 /* GNU fmt -- simple text formatter.
-   Copyright (C) 94, 95, 96, 1997 Free Software Foundation, Inc.
+   Copyright (C) 94, 95, 96, 1997, 1998 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 #include <sys/types.h>
 #include <getopt.h>
 
-#if HAVE_LIMITS_H
-# include <limits.h>
-#endif
-
-#ifndef UINT_MAX
-# define UINT_MAX ((unsigned int) ~(unsigned int) 0)
-#endif
-
-#ifndef INT_MAX
-# define INT_MAX ((int) (UINT_MAX >> 1))
-#endif
-
 /* Redefine.  Otherwise, systems (Unicos for one) with headers that define
    it to be a type get syntax errors for the variable declaration below.  */
 #define word unused_word_type
index cb65477..7e4cb57 100644 (file)
@@ -1,5 +1,5 @@
 /* fold -- wrap each input line to fit in specified width.
-   Copyright (C) 91, 95, 96, 1997 Free Software Foundation, Inc.
+   Copyright (C) 91, 95, 96, 1997, 1998 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 #include <getopt.h>
 #include <sys/types.h>
 
-#if HAVE_LIMITS_H
-# include <limits.h>
-#endif
-
-#ifndef UINT_MAX
-# define UINT_MAX ((unsigned int) ~(unsigned int) 0)
-#endif
-
-#ifndef INT_MAX
-# define INT_MAX ((int) (UINT_MAX >> 1))
-#endif
-
 #include "system.h"
 #include "xstrtol.h"
 #include "error.h"
index 2b0e8c0..0c1207d 100644 (file)
@@ -1,5 +1,5 @@
 /* join - join lines of two files on a common field
-   Copyright (C) 91, 95, 96, 1997 Free Software Foundation, Inc.
+   Copyright (C) 91, 95, 96, 1997, 1998 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 #include <sys/types.h>
 #include <getopt.h>
 
-#if HAVE_LIMITS_H
-# include <limits.h>
-#endif
-
-#ifndef UINT_MAX
-# define UINT_MAX ((unsigned int) ~(unsigned int) 0)
-#endif
-
-#ifndef INT_MAX
-# define INT_MAX ((int) (UINT_MAX >> 1))
-#endif
-
 #if _LIBC || STDC_HEADERS
 # define TOLOWER(c) tolower (c)
 #else
index ae48da4..f8edb8f 100644 (file)
--- a/src/nl.c
+++ b/src/nl.c
@@ -1,5 +1,5 @@
 /* nl -- number lines of files
-   Copyright (C) 89, 92, 95, 96, 1997 Free Software Foundation, Inc.
+   Copyright (C) 89, 92, 95, 96, 1997, 1998 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -24,9 +24,8 @@
 #include <sys/types.h>
 #include <getopt.h>
 
-#if HAVE_LIMITS_H
-# include <limits.h>
-#endif
+#include "linebuffer.h"
+#include "system.h"
 
 #if WITH_REGEX
 # include <regex.h>
 # include <rx.h>
 #endif
 
-#ifndef UINT_MAX
-# define UINT_MAX ((unsigned int) ~(unsigned int) 0)
-#endif
-
-#ifndef INT_MAX
-# define INT_MAX ((int) (UINT_MAX >> 1))
-#endif
-
-#include "linebuffer.h"
-#include "system.h"
 #include "error.h"
 #include "xstrtol.h"
 
index 25fc1af..5cf92e7 100644 (file)
--- a/src/od.c
+++ b/src/od.c
@@ -1,5 +1,5 @@
 /* od -- dump files in octal and other formats
-   Copyright (C) 92, 95, 96, 1997 Free Software Foundation, Inc.
+   Copyright (C) 92, 95, 96, 1997, 1998 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -37,36 +37,11 @@ typedef long double LONG_DOUBLE;
 typedef double LONG_DOUBLE;
 #endif
 
-#if HAVE_LIMITS_H
-# include <limits.h>
-#endif
-#ifndef SCHAR_MAX
-# define SCHAR_MAX 127
-#endif
-#ifndef SCHAR_MIN
-# define SCHAR_MIN (-128)
-#endif
-#ifndef SHRT_MAX
-# define SHRT_MAX 32767
-#endif
-#ifndef SHRT_MIN
-# define SHRT_MIN (-32768)
-#endif
-#ifndef ULONG_MAX
-# define ULONG_MAX ((unsigned long) ~(unsigned long) 0)
-#endif
-#ifndef LONG_MAX
-# define LONG_MAX ((long int) (ULONG_MAX >> 1))
-#endif
 
 #if HAVE_VALUES_H
 # include <values.h>
 #endif
 
-#ifndef BITSPERBYTE
-# define BITSPERBYTE 8
-#endif
-
 #ifndef MAX
 # define MAX(a, b) ((a) > (b) ? (a) : (b))
 #endif
index b05e266..a7e69e9 100644 (file)
--- a/src/pr.c
+++ b/src/pr.c
@@ -1,5 +1,5 @@
 /* pr -- convert text files for printing.
-   Copyright (C) 88, 91, 95, 96, 1997 Free Software Foundation, Inc.
+   Copyright (C) 88, 91, 95, 96, 1997, 1998 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 #include "error.h"
 #include "xstrtol.h"
 
-#if HAVE_LIMITS_H
-# include <limits.h>
-#endif
-
-#ifndef UINT_MAX
-# define UINT_MAX ((unsigned int) ~(unsigned int) 0)
-#endif
-
-#ifndef INT_MAX
-# define INT_MAX ((int) (UINT_MAX >> 1))
-#endif
-
 #ifndef TRUE
 # define TRUE  1
 # define FALSE 0
index 20c8c53..8d14a4b 100644 (file)
 # include <langinfo.h>
 #endif
 
-#ifdef HAVE_LIMITS_H
-# include <limits.h>
-#else
-# ifndef UCHAR_MAX
-#  define UCHAR_MAX 255
-# endif
-#endif
-
 char *xstrdup ();
 
 /* Undefine, to avoid warning about redefinition on some systems.  */
index 1917735..c821921 100644 (file)
@@ -1,5 +1,5 @@
 /* split.c -- split a file into pieces.
-   Copyright (C) 88, 91, 95, 96, 1997 Free Software Foundation, Inc.
+   Copyright (C) 88, 91, 95, 96, 1997, 1998 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 #include <getopt.h>
 #include <sys/types.h>
 
-#if HAVE_LIMITS_H
-# include <limits.h>
-#endif
-
-#ifndef UINT_MAX
-# define UINT_MAX ((unsigned int) ~(unsigned int) 0)
-#endif
-
-#ifndef INT_MAX
-# define INT_MAX ((int) (UINT_MAX >> 1))
-#endif
-
 #include "system.h"
 #include "error.h"
 #include "xstrtol.h"
index 95cd30a..f55fb6f 100644 (file)
--- a/src/tac.c
+++ b/src/tac.c
@@ -1,5 +1,5 @@
 /* tac - concatenate and print files in reverse
-   Copyright (C) 88, 89, 90, 91, 95, 96, 1997 Free Software Foundation, Inc.
+   Copyright (C) 88, 89, 90, 91, 95, 96, 1997, 1998 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -40,12 +40,14 @@ tac -r -s '.\|
 #include <stdio.h>
 #include <getopt.h>
 #include <sys/types.h>
+#include "system.h"
+
 #if WITH_REGEX
 # include <regex.h>
 #else
 # include <rx.h>
 #endif
-#include "system.h"
+
 #include "error.h"
 
 #ifndef DEFAULT_TMPDIR
index d985cc5..949d8c2 100644 (file)
@@ -1,5 +1,5 @@
 /* tail -- output the last part of file(s)
-   Copyright (C) 89, 90, 91, 95, 96, 1997 Free Software Foundation, Inc.
+   Copyright (C) 89, 90, 91, 95, 96, 1997, 1998 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 #include <assert.h>
 #include <getopt.h>
 #include <sys/types.h>
-#if HAVE_LIMITS_H
-# include <limits.h>
-#endif
 
 #include "system.h"
 #include "xstrtoul.h"
 #include "error.h"
 
-#ifndef CHAR_BIT
-# define CHAR_BIT 8
-#endif
-
 #ifndef OFF_T_MIN
-# define OFF_T_MIN (0 < (off_t) -1 ? (off_t) 0 \
-                   : ~ (off_t) 0 << (sizeof (off_t) * CHAR_BIT - 1))
+# define OFF_T_MIN TYPE_MINIMUM (off_t)
 #endif
 
 #ifndef OFF_T_MAX
-# define OFF_T_MAX (~ (off_t) 0 - OFF_T_MIN)
+# define OFF_T_MAX TYPE_MAXIMUM (off_t)
 #endif
 
 /* Disable assertions.  Some systems have broken assert macros.  */
index bf10aac..14f8343 100644 (file)
--- a/src/tr.c
+++ b/src/tr.c
@@ -1,5 +1,5 @@
 /* tr -- a filter to translate characters
-   Copyright (C) 91, 95, 96, 1997 Free Software Foundation, Inc.
+   Copyright (C) 91, 95, 96, 1997, 1998 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 #include <sys/types.h>
 #include <getopt.h>
 
-#if HAVE_LIMITS_H
-# include <limits.h>
-#endif
-
 #include "system.h"
 #include "error.h"
 
-#ifndef ULONG_MAX
-# define ULONG_MAX ((unsigned long) ~(unsigned long) 0)
-#endif
-
-#ifndef LONG_MAX
-# define LONG_MAX ((long int) (ULONG_MAX >> 1))
-#endif
-
-#ifndef UINT_MAX
-# define UINT_MAX ((unsigned int) ~(unsigned int) 0)
-#endif
-
-#ifndef INT_MAX
-# define INT_MAX ((int) (UINT_MAX >> 1))
-#endif
-
-#ifndef UCHAR_MAX
-# define UCHAR_MAX 0xFF
-#endif
-
 #define N_CHARS (UCHAR_MAX + 1)
 
 /* A pointer to a function that returns an int.  */
index e86702c..22acbe6 100644 (file)
@@ -1,5 +1,5 @@
 /* unexpand - convert spaces to tabs
-   Copyright (C) 89, 91, 95, 96, 1997 Free Software Foundation, Inc.
+   Copyright (C) 89, 91, 95, 96, 1997, 1998 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 #include <sys/types.h>
 #include "system.h"
 
-#ifdef HAVE_LIMITS_H
-# include <limits.h>
-#endif
-
-#ifndef UINT_MAX
-# define UINT_MAX ((unsigned int) ~(unsigned int) 0)
-#endif
-
-#ifndef INT_MAX
-# define INT_MAX ((int) (UINT_MAX >> 1))
-#endif
-
 #include "error.h"
 
 /* The number of bytes added at a time to the amount of memory
index b8a6420..176c865 100644 (file)
@@ -1,5 +1,5 @@
 /* uniq -- remove duplicate lines from a sorted file
-   Copyright (C) 86, 91, 95, 96, 1997 Free Software Foundation, Inc.
+   Copyright (C) 86, 91, 95, 96, 1997, 1998 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 #include <getopt.h>
 #include <sys/types.h>
 
-#if HAVE_LIMITS_H
-# include <limits.h>
-#endif
-
-#ifndef UINT_MAX
-# define UINT_MAX ((unsigned int) ~(unsigned int) 0)
-#endif
-
-#ifndef INT_MAX
-# define INT_MAX ((int) (UINT_MAX >> 1))
-#endif
-
 #include "system.h"
 #include "linebuffer.h"
 #include "error.h"