summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1998-01-10 22:12:03 +0000
committerJim Meyering <jim@meyering.net>1998-01-10 22:12:03 +0000
commitdba300a0d019933bd2b25006006db95688fb9ea3 (patch)
tree7a658cab1b601be0ca8a8bacea1d23f1446bd7f5 /src
parentb9ed71e46e4b3b2f3f366d6eeaa9b54d32d00317 (diff)
downloadcoreutils-dba300a0d019933bd2b25006006db95688fb9ea3.tar.xz
CHAR_BIT SCHAR_MAX UCHAR_MAX SHRT_MAX INT_MAX UINT_MAX LONG_MAX ULONG_MAX
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.
Diffstat (limited to 'src')
-rw-r--r--src/csplit.c15
-rw-r--r--src/fmt.c14
-rw-r--r--src/fold.c14
-rw-r--r--src/join.c14
-rw-r--r--src/nl.c17
-rw-r--r--src/od.c27
-rw-r--r--src/pr.c14
-rw-r--r--src/sort.c8
-rw-r--r--src/split.c14
-rw-r--r--src/tac.c6
-rw-r--r--src/tail.c14
-rw-r--r--src/tr.c26
-rw-r--r--src/unexpand.c14
-rw-r--r--src/uniq.c14
14 files changed, 22 insertions, 189 deletions
diff --git a/src/csplit.c b/src/csplit.c
index b923ed457..691ec38eb 100644
--- a/src/csplit.c
+++ b/src/csplit.c
@@ -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
@@ -29,24 +29,15 @@
#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"
diff --git a/src/fmt.c b/src/fmt.c
index 7067a5ed0..613cf5186 100644
--- 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
@@ -22,18 +22,6 @@
#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
diff --git a/src/fold.c b/src/fold.c
index cb6547758..7e4cb57aa 100644
--- a/src/fold.c
+++ b/src/fold.c
@@ -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
@@ -26,18 +26,6 @@
#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"
diff --git a/src/join.c b/src/join.c
index 2b0e8c0d1..0c1207ddf 100644
--- a/src/join.c
+++ b/src/join.c
@@ -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
@@ -28,18 +28,6 @@
#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
diff --git a/src/nl.c b/src/nl.c
index ae48da482..f8edb8fe2 100644
--- 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>
@@ -34,16 +33,6 @@
# 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"
diff --git a/src/od.c b/src/od.c
index 25fc1af9f..5cf92e77f 100644
--- 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
diff --git a/src/pr.c b/src/pr.c
index b05e26640..a7e69e92a 100644
--- 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
@@ -178,18 +178,6 @@
#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
diff --git a/src/sort.c b/src/sort.c
index 20c8c533c..8d14a4b5d 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -43,14 +43,6 @@
# 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. */
diff --git a/src/split.c b/src/split.c
index 1917735b6..c82192138 100644
--- a/src/split.c
+++ b/src/split.c
@@ -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
@@ -27,18 +27,6 @@
#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"
diff --git a/src/tac.c b/src/tac.c
index 95cd30a3e..f55fb6ffb 100644
--- 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
diff --git a/src/tail.c b/src/tail.c
index d985cc5ab..949d8c292 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -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
@@ -49,25 +49,17 @@
#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. */
diff --git a/src/tr.c b/src/tr.c
index bf10aac07..14f834329 100644
--- 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
@@ -29,33 +29,9 @@
#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. */
diff --git a/src/unexpand.c b/src/unexpand.c
index e86702c53..22acbe6b8 100644
--- a/src/unexpand.c
+++ b/src/unexpand.c
@@ -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
@@ -45,18 +45,6 @@
#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
diff --git a/src/uniq.c b/src/uniq.c
index b8a6420e6..176c86571 100644
--- a/src/uniq.c
+++ b/src/uniq.c
@@ -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
@@ -26,18 +26,6 @@
#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"