mirror of
https://github.com/Ladebeze66/cub3D.git
synced 2026-11-09 13:47:10 +01:00
versiontexturecouleur
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/01/11 22:21:26 by fgras-ca #+# #+# */
|
||||
/* Updated: 2024/01/11 22:23:53 by fgras-ca ### ########.fr */
|
||||
/* Updated: 2024/01/16 16:46:23 by fgras-ca ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -59,3 +59,45 @@ char *ft_itoa(int nb)
|
||||
}
|
||||
return (dst);
|
||||
}
|
||||
|
||||
int ft_strcmp(const char *s1, const char *s2)
|
||||
{
|
||||
while (*s1 && (*s1 == *s2))
|
||||
{
|
||||
s1++;
|
||||
s2++;
|
||||
}
|
||||
return (*(const unsigned char *)s1 - *(const unsigned char *)s2);
|
||||
}
|
||||
|
||||
void *ft_memcpy(void *dest, const void *src, size_t n)
|
||||
{
|
||||
char *destmov;
|
||||
char *srcmov;
|
||||
size_t i;
|
||||
|
||||
destmov = (char *)dest;
|
||||
srcmov = (char *)src;
|
||||
if (!dest && !src)
|
||||
return (0);
|
||||
i = 0;
|
||||
while (i < n)
|
||||
{
|
||||
destmov[i] = srcmov[i];
|
||||
i++;
|
||||
}
|
||||
return (dest);
|
||||
}
|
||||
|
||||
void *ft_memset(void *s, int c, size_t n)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
i = 0;
|
||||
while (i < n)
|
||||
{
|
||||
*(unsigned char *)(s + i) = (unsigned char)c;
|
||||
i++;
|
||||
}
|
||||
return (s);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/01/11 22:21:44 by fgras-ca #+# #+# */
|
||||
/* Updated: 2024/01/11 22:24:01 by fgras-ca ### ########.fr */
|
||||
/* Updated: 2024/01/15 20:59:19 by fgras-ca ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/01/11 22:22:01 by fgras-ca #+# #+# */
|
||||
/* Updated: 2024/01/11 22:24:10 by fgras-ca ### ########.fr */
|
||||
/* Updated: 2024/01/16 13:36:33 by fgras-ca ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -86,3 +86,19 @@ char *ft_strchr(const char *s, int c)
|
||||
}
|
||||
return (0);
|
||||
}
|
||||
|
||||
int ft_strncmp(const char *s1, const char *s2, size_t n)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
i = 0;
|
||||
if (n == 0)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
while (s1[i] == s2[i] && (s1[i] != '\0' || s2[i] != '\0') && i < (n - 1))
|
||||
{
|
||||
i++;
|
||||
}
|
||||
return ((unsigned char)s1[i] - (unsigned char)s2[i]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user