summaryrefslogtreecommitdiffstats
path: root/compat/memcmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'compat/memcmp.c')
-rw-r--r--compat/memcmp.c40
1 files changed, 22 insertions, 18 deletions
diff --git a/compat/memcmp.c b/compat/memcmp.c
index 3a4974b..5fce528 100644
--- a/compat/memcmp.c
+++ b/compat/memcmp.c
@@ -1,24 +1,21 @@
-/*
+/*
* memcmp.c --
*
* Source code for the "memcmp" library routine.
*
* Copyright (c) 1998 Sun Microsystems, Inc.
*
- * See the file "license.terms" for information on usage and redistribution
- * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
+ * See the file "license.terms" for information on usage and redistribution of
+ * this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#include "tcl.h"
#include "tclPort.h"
/*
- * Here is the prototype just in case it is not included
- * in tclPort.h.
+ * Here is the prototype just in case it is not included in tclPort.h.
*/
-int memcmp _ANSI_ARGS_((CONST VOID *s1,
- CONST VOID *s2, size_t n));
+int memcmp(CONST VOID *s1, CONST VOID *s2, size_t n);
/*
*----------------------------------------------------------------------
@@ -28,11 +25,10 @@ int memcmp _ANSI_ARGS_((CONST VOID *s1,
* Compares two bytes sequences.
*
* Results:
- * compares its arguments, looking at the first n
- * bytes (each interpreted as an unsigned char), and returns
- * an integer less than, equal to, or greater than 0, accord-
- * ing as s1 is less than, equal to, or
- * greater than s2 when taken to be unsigned 8 bit numbers.
+ * Compares its arguments, looking at the first n bytes (each interpreted
+ * as an unsigned char), and returns an integer less than, equal to, or
+ * greater than 0, according as s1 is less than, equal to, or greater
+ * than s2 when taken to be unsigned 8 bit numbers.
*
* Side effects:
* None.
@@ -41,10 +37,10 @@ int memcmp _ANSI_ARGS_((CONST VOID *s1,
*/
int
-memcmp(s1, s2, n)
- CONST VOID *s1; /* First string. */
- CONST VOID *s2; /* Second string. */
- size_t n; /* Length to compare. */
+memcmp(
+ CONST VOID *s1, /* First string. */
+ CONST VOID *s2, /* Second string. */
+ size_t n) /* Length to compare. */
{
CONST unsigned char *ptr1 = (CONST unsigned char *) s1;
CONST unsigned char *ptr2 = (CONST unsigned char *) s2;
@@ -52,9 +48,17 @@ memcmp(s1, s2, n)
for ( ; n-- ; ptr1++, ptr2++) {
unsigned char u1 = *ptr1, u2 = *ptr2;
- if ( u1 != u2) {
+ if (u1 != u2) {
return (u1-u2);
}
}
return 0;
}
+
+/*
+ * Local Variables:
+ * mode: c
+ * c-basic-offset: 4
+ * fill-column: 78
+ * End:
+ */