aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/ragel-char-signedness.patch
blob: b3b2bf958a13d1dce0b2ee6a76874619f6f5ec54 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From 2e638fccd81e96ce09841adc4b295b5ce694ea73 Mon Sep 17 00:00:00 2001
From: Adrian Thurston <thurston@colm.net>
Date: Sat, 6 Nov 2021 12:20:05 -0700
Subject: [PATCH] C char type: decide signedness of char based on CHAR_MIN

Previously had char fixed to signed char, this is not useful on ARM as it does
not align with the host type. Instead, decide at runtime (or probably compile
time) if char is signed or not.
---
 ragel/common.cpp | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/ragel/common.cpp b/ragel/common.cpp
index 8e9f8ed0..55875c06 100644
--- a/ragel/common.cpp
+++ b/ragel/common.cpp
@@ -27,14 +27,14 @@
 
 HostType hostTypesC[] =
 {
-	{ "char",     0,       "char",    true,   true,  false,  CHAR_MIN,  CHAR_MAX,   0, 0,              sizeof(char) },
-	{ "unsigned", "char",  "uchar",   false,  true,  false,  0, 0,                  0,     UCHAR_MAX,  sizeof(unsigned char) },
-	{ "short",    0,       "short",   true,   true,  false,  SHRT_MIN,  SHRT_MAX,   0, 0,              sizeof(short) },
-	{ "unsigned", "short", "ushort",  false,  true,  false,  0, 0,                  0,     USHRT_MAX,  sizeof(unsigned short) },
-	{ "int",      0,       "int",     true,   true,  false,  INT_MIN,   INT_MAX,    0, 0,              sizeof(int) },
-	{ "unsigned", "int",   "uint",    false,  true,  false,  0, 0,                  0,     UINT_MAX,   sizeof(unsigned int) },
-	{ "long",     0,       "long",    true,   true,  false,  LONG_MIN,  LONG_MAX,   0, 0,              sizeof(long) },
-	{ "unsigned", "long",  "ulong",   false,  true,  false,  0, 0,                  0,     ULONG_MAX,  sizeof(unsigned long) }
+	{ "char",     0,       "char",    (CHAR_MIN != 0), true,  false,  SCHAR_MIN, SCHAR_MAX,  0, UCHAR_MAX, sizeof(char) },
+	{ "unsigned", "char",  "uchar",   false,           true,  false,  0, 0,                  0, UCHAR_MAX, sizeof(unsigned char) },
+	{ "short",    0,       "short",   true,            true,  false,  SHRT_MIN,  SHRT_MAX,   0, 0,         sizeof(short) },
+	{ "unsigned", "short", "ushort",  false,           true,  false,  0, 0,                  0, USHRT_MAX, sizeof(unsigned short) },
+	{ "int",      0,       "int",     true,            true,  false,  INT_MIN,   INT_MAX,    0, 0,         sizeof(int) },
+	{ "unsigned", "int",   "uint",    false,           true,  false,  0, 0,                  0, UINT_MAX,  sizeof(unsigned int) },
+	{ "long",     0,       "long",    true,            true,  false,  LONG_MIN,  LONG_MAX,   0, 0,         sizeof(long) },
+	{ "unsigned", "long",  "ulong",   false,           true,  false,  0, 0,                  0, ULONG_MAX, sizeof(unsigned long) }
 };
 
 #define S8BIT_MIN  -128
-- 
2.33.1

installer: Turn passwords into opaque records....Josselin Poiret 2022-02-02installer: Add error page when running external commands....Josselin Poiret 2022-02-02installer: Use named prompt to abort or break installer steps....Josselin Poiret 2022-02-02installer: Replace run-command by invoke in newt/page.scm....Josselin Poiret 2022-02-02installer: Fix run-file-textbox-page when edit-button is #f....Josselin Poiret 2022-02-02installer: Use new installer-log-line everywhere....Josselin Poiret 2022-02-02installer: Add crash dump upload support....Mathieu Othacehe 2022-01-14installer: Check if ci.guix.gnu.org can be reached....Mathieu Othacehe 2022-01-14installer: Ignore small devices....Mathieu Othacehe 2021-12-28installer: Recommend 'ntp-service-type' for non-graphical systems....Leo Famulari 2021-12-28installer: Offer the CUPS printing service on a dedicated page....Leo Famulari 2021-10-21installer: Reorder file system type listbox....Tobias Geerinckx-Rice 2021-09-23installer: Support XFS....Tobias Geerinckx-Rice 2021-06-30installer: Offer the CUPS printing service....Tobias Geerinckx-Rice 2021-06-29installer: Fix crash when deleting a free space partition....Mathieu Othacehe 2021-06-12installer: Check partitions UUIDs....Mathieu Othacehe 2021-06-12installer: Print user partitions....Mathieu Othacehe 2021-04-28installer: Force GPT disk label when UEFI is supported....Mathieu Othacehe 2021-01-31installer: Edit desktop selection prompt....Tobias Geerinckx-Rice 2021-01-12installer: Fix crash in parameters menu....Mathieu Othacehe 2020-12-11install: Discover local substitute servers....Mathieu Othacehe