diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2016-12-21 22:47:21 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2016-12-21 22:47:21 (GMT) |
commit | 5514e37335c012cc70f5b9aee3cedfe3d57f583f (patch) | |
tree | 4ba7d8aad13735e52f59bdce7ca5ba3151ebd7e3 /tcl8.6/compat/memcmp.c | |
parent | 768f87f613cc9789fcf8073018fa02178c8c91df (diff) | |
download | blt-5514e37335c012cc70f5b9aee3cedfe3d57f583f.zip blt-5514e37335c012cc70f5b9aee3cedfe3d57f583f.tar.gz blt-5514e37335c012cc70f5b9aee3cedfe3d57f583f.tar.bz2 |
undo subtree
Diffstat (limited to 'tcl8.6/compat/memcmp.c')
-rw-r--r-- | tcl8.6/compat/memcmp.c | 64 |
1 files changed, 0 insertions, 64 deletions
diff --git a/tcl8.6/compat/memcmp.c b/tcl8.6/compat/memcmp.c deleted file mode 100644 index c4e25a8..0000000 --- a/tcl8.6/compat/memcmp.c +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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. - */ - -#include "tclPort.h" - -/* - * Here is the prototype just in case it is not included in tclPort.h. - */ - -int memcmp(const void *s1, const void *s2, size_t n); - -/* - *---------------------------------------------------------------------- - * - * memcmp -- - * - * 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, according as s1 is less than, equal to, or greater - * than s2 when taken to be unsigned 8 bit numbers. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -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; - - for ( ; n-- ; ptr1++, ptr2++) { - unsigned char u1 = *ptr1, u2 = *ptr2; - - if (u1 != u2) { - return (u1-u2); - } - } - return 0; -} - -/* - * Local Variables: - * mode: c - * c-basic-offset: 4 - * fill-column: 78 - * End: - */ |