Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/common/lib/libc/string Drop the alignment check if __NO_STRI...



details:   https://anonhg.NetBSD.org/src/rev/c77d3a3e7481
branches:  trunk
changeset: 1006800:c77d3a3e7481
user:      ad <ad%NetBSD.org@localhost>
date:      Mon Jan 27 22:22:03 2020 +0000

description:
Drop the alignment check if __NO_STRICT_ALIGNMENT (x86, m68k, vax).

diffstat:

 common/lib/libc/string/bcmp.c   |  9 ++++++---
 common/lib/libc/string/memcmp.c |  9 ++++++---
 2 files changed, 12 insertions(+), 6 deletions(-)

diffs (60 lines):

diff -r 5deaadab423a -r c77d3a3e7481 common/lib/libc/string/bcmp.c
--- a/common/lib/libc/string/bcmp.c     Mon Jan 27 22:13:39 2020 +0000
+++ b/common/lib/libc/string/bcmp.c     Mon Jan 27 22:22:03 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bcmp.c,v 1.8 2020/01/27 22:13:39 ad Exp $      */
+/*     $NetBSD: bcmp.c,v 1.9 2020/01/27 22:22:03 ad Exp $      */
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
 #if 0
 static char sccsid[] = "@(#)bcmp.c     8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: bcmp.c,v 1.8 2020/01/27 22:13:39 ad Exp $");
+__RCSID("$NetBSD: bcmp.c,v 1.9 2020/01/27 22:22:03 ad Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -92,7 +92,10 @@
        b1 = s1;
        b2 = s2;
 
-       if ((((uintptr_t)b1 | (uintptr_t)b2) & (sizeof(uintptr_t) - 1)) == 0) {
+#ifndef __NO_STRICT_ALIGNMENT
+       if ((((uintptr_t)b1 | (uintptr_t)b2) & (sizeof(uintptr_t) - 1)) == 0)
+#endif
+       {
                while (n >= sizeof(uintptr_t)) {
                        if (*b1++ != *b2++)
                                return 1;
diff -r 5deaadab423a -r c77d3a3e7481 common/lib/libc/string/memcmp.c
--- a/common/lib/libc/string/memcmp.c   Mon Jan 27 22:13:39 2020 +0000
+++ b/common/lib/libc/string/memcmp.c   Mon Jan 27 22:22:03 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: memcmp.c,v 1.6 2020/01/27 22:13:39 ad Exp $    */
+/*     $NetBSD: memcmp.c,v 1.7 2020/01/27 22:22:03 ad Exp $    */
 
 /*-
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
 #if 0
 static char sccsid[] = "@(#)memcmp.c   8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: memcmp.c,v 1.6 2020/01/27 22:13:39 ad Exp $");
+__RCSID("$NetBSD: memcmp.c,v 1.7 2020/01/27 22:22:03 ad Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -92,7 +92,10 @@
        b1 = s1;
        b2 = s2;
 
-       if ((((uintptr_t)b1 | (uintptr_t)b2) & (sizeof(uintptr_t) - 1)) == 0) {
+#ifndef __NO_STRICT_ALIGNMENT
+       if ((((uintptr_t)b1 | (uintptr_t)b2) & (sizeof(uintptr_t) - 1)) == 0)
+#endif
+       {
                while (n >= sizeof(uintptr_t)) {
                        if (*b1 != *b2)
                                break;



Home | Main Index | Thread Index | Old Index