diff options
author | Maciej W. Rozycki <macro@embecosm.com> | 2023-02-10 23:49:19 +0000 |
---|---|---|
committer | Maciej W. Rozycki <macro@embecosm.com> | 2023-02-10 23:49:19 +0000 |
commit | 4a9efa5d63b2253a595ff9d6944415bf8cbfe408 (patch) | |
tree | 1641613dc4ca1ca92ebbee9fc1b2ec89532e9cc7 /gdbsupport | |
parent | 5036bde964bc1a18282dde536a95aecd0d2c08fb (diff) | |
download | gdb-4a9efa5d63b2253a595ff9d6944415bf8cbfe408.zip gdb-4a9efa5d63b2253a595ff9d6944415bf8cbfe408.tar.gz gdb-4a9efa5d63b2253a595ff9d6944415bf8cbfe408.tar.bz2 |
GDB: Switch to using C++ standard integer type limits
Use <climits> instead of <limits.h> and ditch local fallback definitions
for minimum and maximum value macros provided by C++11. Add LONGEST_MAX
and LONGEST_MIN definitions.
Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdbsupport')
-rw-r--r-- | gdbsupport/common-types.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gdbsupport/common-types.h b/gdbsupport/common-types.h index e863d65..4156021 100644 --- a/gdbsupport/common-types.h +++ b/gdbsupport/common-types.h @@ -36,9 +36,15 @@ typedef uint64_t ULONGEST; /* * The largest CORE_ADDR value. */ #define CORE_ADDR_MAX (~(CORE_ADDR) 0) -/* * The largest ULONGEST value. */ +/* * The largest ULONGEST value, 0xFFFFFFFFFFFFFFFF for 64-bits. */ #define ULONGEST_MAX (~(ULONGEST) 0) +/* * The largest LONGEST value, 0x7FFFFFFFFFFFFFFF for 64-bits. */ +#define LONGEST_MAX ((LONGEST) (ULONGEST_MAX >> 1)) + +/* * The smallest LONGEST value, 0x8000000000000000 for 64-bits. */ +#define LONGEST_MIN ((LONGEST) (~(LONGEST) 0 ^ LONGEST_MAX)) + enum tribool { TRIBOOL_UNKNOWN = -1, TRIBOOL_FALSE = 0, TRIBOOL_TRUE = 1 }; #endif /* COMMON_COMMON_TYPES_H */ |