]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - string/memcmp.c
Prefer https to http for gnu.org and fsf.org URLs
[thirdparty/glibc.git] / string / memcmp.c
index d2ec1c279ccb6a2f5f51e9cedabdff205e1d29e4..062a06f9369bcdf968080e181788f78e472f9b35 100644 (file)
@@ -1,5 +1,4 @@
-/* Copyright (C) 1991,1993,1995,1997,1998,2003,2004,2012
-   Free Software Foundation, Inc.
+/* Copyright (C) 1991-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Torbjorn Granlund (tege@sics.se).
 
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
 
-#undef __ptr_t
-#define __ptr_t        void *
-
 #if defined HAVE_STRING_H || defined _LIBC
 # include <string.h>
 #endif
 
 #undef memcmp
 
+#ifndef MEMCMP
+# define MEMCMP memcmp
+#endif
+
 #ifdef _LIBC
 
 # include <memcopy.h>
@@ -48,7 +47,7 @@
    This should normally be the biggest type supported by a single load
    and store.  Must be an unsigned type.  */
 # define op_t  unsigned long int
-# define OPSIZ (sizeof(op_t))
+# define OPSIZ (sizeof (op_t))
 
 /* Threshold value for when to enter the unrolled loops.  */
 # define OP_T_THRES    16
@@ -90,12 +89,8 @@ typedef unsigned char byte;
 
 static int memcmp_bytes (op_t, op_t) __THROW;
 
-# ifdef  __GNUC__
-__inline
-# endif
 static int
-memcmp_bytes (a, b)
-     op_t a, b;
+memcmp_bytes (op_t a, op_t b)
 {
   long int srcp1 = (long int) &a;
   long int srcp2 = (long int) &b;
@@ -119,10 +114,7 @@ static int memcmp_common_alignment (long, long, size_t) __THROW;
    objects (not LEN bytes!).  Both SRCP1 and SRCP2 should be aligned for
    memory operations on `op_t's.  */
 static int
-memcmp_common_alignment (srcp1, srcp2, len)
-     long int srcp1;
-     long int srcp2;
-     size_t len;
+memcmp_common_alignment (long int srcp1, long int srcp2, size_t len)
 {
   op_t a0, a1;
   op_t b0, b1;
@@ -206,10 +198,7 @@ static int memcmp_not_common_alignment (long, long, size_t) __THROW;
    `op_t' objects (not LEN bytes!).  SRCP2 should be aligned for memory
    operations on `op_t', but SRCP1 *should be unaligned*.  */
 static int
-memcmp_not_common_alignment (srcp1, srcp2, len)
-     long int srcp1;
-     long int srcp2;
-     size_t len;
+memcmp_not_common_alignment (long int srcp1, long int srcp2, size_t len)
 {
   op_t a0, a1, a2, a3;
   op_t b0, b1, b2, b3;
@@ -309,10 +298,7 @@ memcmp_not_common_alignment (srcp1, srcp2, len)
 }
 
 int
-memcmp (s1, s2, len)
-     const __ptr_t s1;
-     const __ptr_t s2;
-     size_t len;
+MEMCMP (const void *s1, const void *s2, size_t len)
 {
   op_t a0;
   op_t b0;