summaryrefslogtreecommitdiff
path: root/ft_memcmp.c
diff options
context:
space:
mode:
authoryctct <yctct@yctct.com>2026-02-05 12:18:33 +0100
committeryctct <yctct@yctct.com>2026-02-05 12:18:33 +0100
commit472b8f20c0f74d20dbb434abce10ee86054b9975 (patch)
tree95625c0ba5a7f999c9add7f9bd55bb0f0b4dc173 /ft_memcmp.c
parent8403fab94b17bc63bc193037c8777b9074707287 (diff)
Remove testsHEADmain
Diffstat (limited to 'ft_memcmp.c')
-rw-r--r--ft_memcmp.c87
1 files changed, 0 insertions, 87 deletions
diff --git a/ft_memcmp.c b/ft_memcmp.c
index 32f8eec..0993493 100644
--- a/ft_memcmp.c
+++ b/ft_memcmp.c
@@ -33,90 +33,3 @@ int ft_memcmp(const void *s1, const void *s2, size_t n)
return (cs1[i] - cs2[i]);
}
-/*
-#include <string.h>
-
-int main(void)
-{
- char s[] = {-128, 0, 127, 0};
- char sCpy[] = {-128, 0, 127, 0};
-
- printf("%i\n", ft_memcmp(s, sCpy, 4));
- printf("%i\n", memcmp(s, sCpy, 4));
- printf("%i\n", ft_memcmp("abcdefghij", "abcdefgxyz", 7));
- printf("%i\n", memcmp("abcdefghij", "abcdefgxyz", 7));
-}
-int ft_memcmp(const void *s1, const void *s2, size_t n)
-{
- size_t i;
- unsigned char *a;
- unsigned char *b;
-
- i = 0;
- a = (unsigned char *)s1;
- b = (unsigned char *)s2;
- if (s1 == s2 || n == 0)
- return (0);
- while (*a == *b && i < n - 1)
- {
- a++;
- b++;
- i++;
- }
- return (*a - *b);
-}
-*/
-/*
-int main(void)
-{
- char s[] = {-128, 0, 127, 0};
- char sCpy[] = {-128, 0, 127, 0};
- char s2[] = {0, 0, 127, 0};
- char s3[] = {0, 0, 42, 0};
-
- printf("\n");
- printf("%i\n", ft_memcmp(s, sCpy, 4));
- printf("%i\n", memcmp(s, sCpy, 4));
- printf("\n");
- printf("%i\n", ft_memcmp(s, s2, 0));
- printf("%i\n", memcmp(s, s2, 0));
- printf("\n");
- printf("%i\n", ft_memcmp(s, s2, 1));
- printf("%i\n", memcmp(s, s2, 1));
- printf("\n");
- printf("%i\n", ft_memcmp(s2, s, 1));
- printf("%i\n", memcmp(s2, s, 1));
- printf("\n");
- printf("%i\n", ft_memcmp(s2, s3, 4));
- printf("%i\n", memcmp(s2, s3, 4));
- printf("\n");
- printf("\n");
- printf("%i\n", ft_memcmp("salut", "salut", 5));
- printf("%i\n", memcmp("salut", "salut", 5));
- printf("\n");
- printf("%i\n", ft_memcmp("t\200", "t\0", 2));
- printf("%i\n", memcmp("t\200", "t\0", 2));
- printf("\n");
- printf("%i\n", ft_memcmp("testss", "test", 5));
- printf("%i\n", memcmp("testss", "test", 5));
- printf("\n");
- printf("%i\n", ft_memcmp("test", "tEst", 4));
- printf("%i\n", memcmp("test", "tEst", 4));
- printf("\n");
- printf("%i\n", ft_memcmp("", "test", 4));
- printf("%i\n", memcmp("", "test", 4));
- printf("\n");
- printf("%i\n", ft_memcmp("test", "", 4));
- printf("%i\n", memcmp("test", "", 4));
- printf("\n");
- printf("%i\n", ft_memcmp("abcdefghij", "abcdefgxyz", 7));
- printf("%i\n", memcmp("abcdefghij", "abcdefgxyz", 7));
- printf("\n");
- printf("%i\n", ft_memcmp("abcdefgh", "abcdwxyz", 6));
- printf("%i\n", memcmp("abcdefgh", "abcdwxyz", 6));
- printf("\n");
- printf("%i\n", ft_memcmp("zyxbcdefgh", "abcdefgxyz", 0));
- printf("%i\n", memcmp("zyxbcdefgh", "abcdefgxyz", 0));
- return (0);
-}
-*/