summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2000-09-26 05:46:01 (GMT)
committerFred Drake <fdrake@acm.org>2000-09-26 05:46:01 (GMT)
commitd5fadf75e4d18df61db41205ace0cda28d98eeaa (patch)
tree1b82c40e9bacf707cc8411fb9f0b6816c6f857d4 /Objects
parent1b6185941ee5ccbfb7bb79ef2fcd55e279ade902 (diff)
downloadcpython-d5fadf75e4d18df61db41205ace0cda28d98eeaa.zip
cpython-d5fadf75e4d18df61db41205ace0cda28d98eeaa.tar.gz
cpython-d5fadf75e4d18df61db41205ace0cda28d98eeaa.tar.bz2
Rationalize use of limits.h, moving the inclusion to Python.h.
Add definitions of INT_MAX and LONG_MAX to pyport.h. Remove includes of limits.h and conditional definitions of INT_MAX and LONG_MAX elsewhere. This closes SourceForge patch #101659 and bug #115323.
Diffstat (limited to 'Objects')
-rw-r--r--Objects/complexobject.c4
-rw-r--r--Objects/fileobject.c4
-rw-r--r--Objects/floatobject.c30
-rw-r--r--Objects/intobject.c12
-rw-r--r--Objects/listobject.c3
-rw-r--r--Objects/object.c3
-rw-r--r--Objects/stringobject.c6
-rw-r--r--Objects/unicodeobject.c6
8 files changed, 1 insertions, 67 deletions
diff --git a/Objects/complexobject.c b/Objects/complexobject.c
index 3c9830f..dc1d837 100644
--- a/Objects/complexobject.c
+++ b/Objects/complexobject.c
@@ -9,10 +9,6 @@
#include "Python.h"
-#ifdef HAVE_LIMITS_H
-#include <limits.h>
-#endif
-
/* elementary operations on complex numbers */
diff --git a/Objects/fileobject.c b/Objects/fileobject.c
index 88e6027..2978d25 100644
--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -4,10 +4,6 @@
#include "Python.h"
#include "structmember.h"
-#ifdef HAVE_LIMITS_H
-#include <limits.h>
-#endif
-
#ifndef DONT_HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif /* DONT_HAVE_SYS_TYPES_H */
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index 004cf57..17f70b2 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -23,36 +23,6 @@
#define CHECK(x) /* Don't know how to check */
#endif
-#ifdef HAVE_LIMITS_H
-#include <limits.h>
-#endif
-
-#ifndef LONG_MAX
-#if SIZEOF_LONG == 4
-#define LONG_MAX 0X7FFFFFFFL
-#elif SIZEOF_LONG == 8
-#define LONG_MAX 0X7FFFFFFFFFFFFFFFL
-#else
-#error "could not set LONG_MAX"
-#endif
-#endif
-
-#ifndef LONG_MIN
-#define LONG_MIN (-LONG_MAX-1)
-#endif
-
-#ifdef __NeXT__
-#ifdef __sparc__
-/*
- * This works around a bug in the NS/Sparc 3.3 pre-release
- * limits.h header file.
- * 10-Feb-1995 bwarsaw@cnri.reston.va.us
- */
-#undef LONG_MIN
-#define LONG_MIN (-LONG_MAX-1)
-#endif
-#endif
-
#if !defined(__STDC__) && !defined(macintosh)
extern double fmod(double, double);
extern double pow(double, double);
diff --git a/Objects/intobject.c b/Objects/intobject.c
index 411e4dd..8477a02 100644
--- a/Objects/intobject.c
+++ b/Objects/intobject.c
@@ -4,18 +4,6 @@
#include "Python.h"
#include <ctype.h>
-#ifdef HAVE_LIMITS_H
-#include <limits.h>
-#endif
-
-#ifndef LONG_MAX
-#define LONG_MAX 0X7FFFFFFFL
-#endif
-
-#ifndef LONG_MIN
-#define LONG_MIN (-LONG_MAX-1)
-#endif
-
#ifndef CHAR_BIT
#define CHAR_BIT 8
#endif
diff --git a/Objects/listobject.c b/Objects/listobject.c
index 3d02b5f..b874af9 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -8,9 +8,6 @@
#else
#include <sys/types.h> /* For size_t */
#endif
-#ifdef HAVE_LIMITS_H
-#include <limits.h>
-#endif
#define ROUNDUP(n, PyTryBlock) \
((((n)+(PyTryBlock)-1)/(PyTryBlock))*(PyTryBlock))
diff --git a/Objects/object.c b/Objects/object.c
index 4f395ff..9b7c551 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -2,9 +2,6 @@
/* Generic object operations; and implementation of None (NoObject) */
#include "Python.h"
-#ifdef HAVE_LIMITS_H
-#include <limits.h>
-#endif
#ifdef macintosh
#include "macglue.h"
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index acae880..ec7eb90 100644
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -9,13 +9,9 @@
int null_strings, one_strings;
#endif
-#ifdef HAVE_LIMITS_H
-#include <limits.h>
-#else
-#ifndef UCHAR_MAX
+#if !defined(HAVE_LIMITS_H) && !defined(UCHAR_MAX)
#define UCHAR_MAX 255
#endif
-#endif
static PyStringObject *characters[UCHAR_MAX + 1];
#ifndef DONT_SHARE_SHORT_STRINGS
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
index 1559542..b096faa 100644
--- a/Objects/unicodeobject.c
+++ b/Objects/unicodeobject.c
@@ -67,12 +67,6 @@ Copyright (c) Corporation for National Research Initiatives.
#include "unicodeobject.h"
#include "ucnhash.h"
-#if defined(HAVE_LIMITS_H)
-#include <limits.h>
-#else
-#define INT_MAX 2147483647
-#endif
-
#ifdef MS_WIN32
#include <windows.h>
#endif