X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2Fstring%2Fmemcmp.c;h=c16d50a0f5e5fe7e4f988bf84263f767af9800f2;hb=e5456e3c2697c4e17fc9aa3439f2e305517b4d96;hp=43b7e585f348f3d112ef817009b94e38d97758ac;hpb=dcc8a8e99f69e090a03b7b868443addbc0817820;p=pdclib.old diff --git a/functions/string/memcmp.c b/functions/string/memcmp.c index 43b7e58..c16d50a 100644 --- a/functions/string/memcmp.c +++ b/functions/string/memcmp.c @@ -6,3 +6,21 @@ // ---------------------------------------------------------------------------- int memcmp( const void * s1, const void * s2, size_t n ) { /* TODO */ }; + +/* PDPC code - unreviewed +{ + const unsigned char *p1; + const unsigned char *p2; + size_t x = 0; + + p1 = (const unsigned char *)s1; + p2 = (const unsigned char *)s2; + while (x < n) + { + if (p1[x] < p2[x]) return (-1); + else if (p1[x] > p2[x]) return (1); + x++; + } + return (0); +} +*/