Module Name:    src
Committed By:   ad
Date:           Mon Jan 27 22:22:03 UTC 2020

Modified Files:
        src/common/lib/libc/string: bcmp.c memcmp.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/common/lib/libc/string/bcmp.c
cvs rdiff -u -r1.6 -r1.7 src/common/lib/libc/string/memcmp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/common/lib/libc/string/bcmp.c
diff -u src/common/lib/libc/string/bcmp.c:1.8 src/common/lib/libc/string/bcmp.c:1.9
--- src/common/lib/libc/string/bcmp.c:1.8	Mon Jan 27 22:13:39 2020
+++ src/common/lib/libc/string/bcmp.c	Mon Jan 27 22:22:03 2020
@@ -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 @@ bcmp(const void *s1, const void *s2, siz
 	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;

Index: src/common/lib/libc/string/memcmp.c
diff -u src/common/lib/libc/string/memcmp.c:1.6 src/common/lib/libc/string/memcmp.c:1.7
--- src/common/lib/libc/string/memcmp.c:1.6	Mon Jan 27 22:13:39 2020
+++ src/common/lib/libc/string/memcmp.c	Mon Jan 27 22:22:03 2020
@@ -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 @@ memcmp(const void *s1, const void *s2, s
 	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;

Reply via email to