summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2016-09-06 20:24:00 (GMT)
committerBenjamin Peterson <benjamin@python.org>2016-09-06 20:24:00 (GMT)
commit9b3d77052f58858ebe1f6ff0dd8dc1caf933cd62 (patch)
tree8a2fc78befc25702a9bf1f474644ef2ed2367138 /Include
parent88bd3edb3e533ca426d633b97fad91d82aeb2b34 (diff)
downloadcpython-9b3d77052f58858ebe1f6ff0dd8dc1caf933cd62.zip
cpython-9b3d77052f58858ebe1f6ff0dd8dc1caf933cd62.tar.gz
cpython-9b3d77052f58858ebe1f6ff0dd8dc1caf933cd62.tar.bz2
replace Python aliases for standard integer types with the standard integer types (#17884)
Diffstat (limited to 'Include')
-rw-r--r--Include/longintrepr.h8
-rw-r--r--Include/pyhash.h16
-rw-r--r--Include/pytime.h6
3 files changed, 11 insertions, 19 deletions
diff --git a/Include/longintrepr.h b/Include/longintrepr.h
index 1296849..a3b74b4 100644
--- a/Include/longintrepr.h
+++ b/Include/longintrepr.h
@@ -42,10 +42,10 @@ extern "C" {
*/
#if PYLONG_BITS_IN_DIGIT == 30
-typedef PY_UINT32_T digit;
-typedef PY_INT32_T sdigit; /* signed variant of digit */
-typedef PY_UINT64_T twodigits;
-typedef PY_INT64_T stwodigits; /* signed variant of twodigits */
+typedef uint32_t digit;
+typedef int32_t sdigit; /* signed variant of digit */
+typedef uint64_t twodigits;
+typedef int64_t stwodigits; /* signed variant of twodigits */
#define PyLong_SHIFT 30
#define _PyLong_DECIMAL_SHIFT 9 /* max(e such that 10**e fits in a digit) */
#define _PyLong_DECIMAL_BASE ((digit)1000000000) /* 10 ** DECIMAL_SHIFT */
diff --git a/Include/pyhash.h b/Include/pyhash.h
index a7ca937..a814af6 100644
--- a/Include/pyhash.h
+++ b/Include/pyhash.h
@@ -36,14 +36,14 @@ PyAPI_FUNC(Py_hash_t) _Py_HashBytes(const void*, Py_ssize_t);
* memory layout on 64 bit systems
* cccccccc cccccccc cccccccc uc -- unsigned char[24]
* pppppppp ssssssss ........ fnv -- two Py_hash_t
- * k0k0k0k0 k1k1k1k1 ........ siphash -- two PY_UINT64_T
+ * k0k0k0k0 k1k1k1k1 ........ siphash -- two uint64_t
* ........ ........ ssssssss djbx33a -- 16 bytes padding + one Py_hash_t
* ........ ........ eeeeeeee pyexpat XML hash salt
*
* memory layout on 32 bit systems
* cccccccc cccccccc cccccccc uc
* ppppssss ........ ........ fnv -- two Py_hash_t
- * k0k0k0k0 k1k1k1k1 ........ siphash -- two PY_UINT64_T (*)
+ * k0k0k0k0 k1k1k1k1 ........ siphash -- two uint64_t (*)
* ........ ........ ssss.... djbx33a -- 16 bytes padding + one Py_hash_t
* ........ ........ eeee.... pyexpat XML hash salt
*
@@ -59,13 +59,11 @@ typedef union {
Py_hash_t prefix;
Py_hash_t suffix;
} fnv;
-#ifdef PY_UINT64_T
/* two uint64 for SipHash24 */
struct {
- PY_UINT64_T k0;
- PY_UINT64_T k1;
+ uint64_t k0;
+ uint64_t k1;
} siphash;
-#endif
/* a different (!) Py_hash_t for small string optimization */
struct {
unsigned char padding[16];
@@ -121,8 +119,7 @@ PyAPI_FUNC(PyHash_FuncDef*) PyHash_GetFuncDef(void);
* configure script.
*
* - FNV is available on all platforms and architectures.
- * - SIPHASH24 only works on plaforms that provide PY_UINT64_T and doesn't
- * require aligned memory for integers.
+ * - SIPHASH24 only works on plaforms that don't require aligned memory for integers.
* - With EXTERNAL embedders can provide an alternative implementation with::
*
* PyHash_FuncDef PyHash_Func = {...};
@@ -134,8 +131,7 @@ PyAPI_FUNC(PyHash_FuncDef*) PyHash_GetFuncDef(void);
#define Py_HASH_FNV 2
#ifndef Py_HASH_ALGORITHM
-# if (defined(PY_UINT64_T) && defined(PY_UINT32_T) \
- && !defined(HAVE_ALIGNED_REQUIRED))
+# ifndef HAVE_ALIGNED_REQUIRED
# define Py_HASH_ALGORITHM Py_HASH_SIPHASH24
# else
# define Py_HASH_ALGORITHM Py_HASH_FNV
diff --git a/Include/pytime.h b/Include/pytime.h
index 859321b..595fafc 100644
--- a/Include/pytime.h
+++ b/Include/pytime.h
@@ -13,16 +13,12 @@ functions and constants
extern "C" {
#endif
-#ifdef PY_INT64_T
/* _PyTime_t: Python timestamp with subsecond precision. It can be used to
store a duration, and so indirectly a date (related to another date, like
UNIX epoch). */
-typedef PY_INT64_T _PyTime_t;
+typedef int64_t _PyTime_t;
#define _PyTime_MIN PY_LLONG_MIN
#define _PyTime_MAX PY_LLONG_MAX
-#else
-# error "_PyTime_t need signed 64-bit integer type"
-#endif
typedef enum {
/* Round towards minus infinity (-inf).