X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=functions%2Fstring%2Fmemcmp.c;h=c16d50a0f5e5fe7e4f988bf84263f767af9800f2;hp=43b7e585f348f3d112ef817009b94e38d97758ac;hb=0a5395faab237ba9008352b0f4bee9659bbd3d5f;hpb=34893ecc2200dc7017c36a54cb6c5f4c2378b5ec 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); +} +*/