[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master f5891da70aa: ; * src/fns.c: Use if instead of #ifdef
From: |
Mattias Engdegård |
Subject: |
master f5891da70aa: ; * src/fns.c: Use if instead of #ifdef |
Date: |
Sat, 1 Apr 2023 06:27:18 -0400 (EDT) |
branch: master
commit f5891da70aae4deb465e8f193a172fbad0b4485f
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>
; * src/fns.c: Use if instead of #ifdef
* src/fns.c (HAVE_FAST_UNALIGNED_ACCESS, load_unaligned_size_t):
Always define these.
(Fstring_lessp): Use if instead of #ifdef.
---
src/fns.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/src/fns.c b/src/fns.c
index 47def5c43b4..e92ef7e4c81 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -452,6 +452,9 @@ If string STR1 is greater, the value is a positive number N;
|| defined __s390__ || defined __s390x__) \
&& defined __OPTIMIZE__
#define HAVE_FAST_UNALIGNED_ACCESS 1
+#else
+#define HAVE_FAST_UNALIGNED_ACCESS 0
+#endif
/* Load a word from a possibly unaligned address. */
static inline size_t
@@ -462,8 +465,6 @@ load_unaligned_size_t (const void *p)
return x;
}
-#endif
-
DEFUN ("string-lessp", Fstring_lessp, Sstring_lessp, 2, 2, 0,
doc: /* Return non-nil if STRING1 is less than STRING2 in lexicographic
order.
Case is significant.
@@ -504,18 +505,16 @@ Symbols are also allowed; their print names are used
instead. */)
/* String data is normally allocated with word alignment, but
there are exceptions (notably pure strings) so we restrict the
wordwise skipping to safe architectures. */
-#ifdef HAVE_FAST_UNALIGNED_ACCESS
+ if (HAVE_FAST_UNALIGNED_ACCESS)
{
/* First compare entire machine words. */
int ws = sizeof (size_t);
const char *w1 = SSDATA (string1);
const char *w2 = SSDATA (string2);
- while (b < nb - ws + 1
- && (load_unaligned_size_t (w1 + b)
- == load_unaligned_size_t (w2 + b)))
+ while (b < nb - ws + 1 && load_unaligned_size_t (w1 + b)
+ == load_unaligned_size_t (w2 + b))
b += ws;
}
-#endif
/* Scan forward to the differing byte. */
while (b < nb && SREF (string1, b) == SREF (string2, b))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master f5891da70aa: ; * src/fns.c: Use if instead of #ifdef,
Mattias Engdegård <=