diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-04-01 21:51:51 +0200 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-04-01 21:58:05 +0200 |
| commit | 65c5d5157e890e9f9445a94fb2d7f660e5492d8e (patch) | |
| tree | 78613f26bdc531104c3e32d76ffcaf3c2f7013f5 /src/mem | |
| parent | c128213daa677d548bfc2905496257fe4a4faf79 (diff) | |
| parent | a1675f56b35f5521a91851bae8ca650706374ae6 (diff) | |
| download | libft-65c5d5157e890e9f9445a94fb2d7f660e5492d8e.tar.gz libft-65c5d5157e890e9f9445a94fb2d7f660e5492d8e.tar.bz2 libft-65c5d5157e890e9f9445a94fb2d7f660e5492d8e.zip | |
Merge branch 'minishell'
Diffstat (limited to 'src/mem')
| -rw-r--r-- | src/mem/ft_memccpy.c | 18 | ||||
| -rw-r--r-- | src/mem/ft_memchr.c | 4 | ||||
| -rw-r--r-- | src/mem/ft_memset.c | 4 |
3 files changed, 13 insertions, 13 deletions
diff --git a/src/mem/ft_memccpy.c b/src/mem/ft_memccpy.c index 0f52242..2f6525a 100644 --- a/src/mem/ft_memccpy.c +++ b/src/mem/ft_memccpy.c @@ -6,7 +6,7 @@ /* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/10/07 10:01:53 by cacharle #+# #+# */ -/* Updated: 2020/01/17 10:54:03 by cacharle ### ########.fr */ +/* Updated: 2020/04/01 21:50:29 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -40,21 +40,21 @@ void *ft_memccpy(void *dest, const void *src, int c, size_t n) lw = *(uint64_t*)src ^ buf; if ((lw - LOMAGIC) & ~lw & HIMAGIC) { - if ( (((uint8_t*)dest)[0] = ((uint8_t*)src)[0]) == (uint8_t)c) + if ((((uint8_t*)dest)[0] = ((uint8_t*)src)[0]) == (uint8_t)c) return ((uint8_t*)dest + 1); - if ( (((uint8_t*)dest)[1] = ((uint8_t*)src)[1]) == (uint8_t)c) + if ((((uint8_t*)dest)[1] = ((uint8_t*)src)[1]) == (uint8_t)c) return ((uint8_t*)dest + 2); - if ( (((uint8_t*)dest)[2] = ((uint8_t*)src)[2]) == (uint8_t)c) + if ((((uint8_t*)dest)[2] = ((uint8_t*)src)[2]) == (uint8_t)c) return ((uint8_t*)dest + 3); - if ( (((uint8_t*)dest)[3] = ((uint8_t*)src)[3]) == (uint8_t)c) + if ((((uint8_t*)dest)[3] = ((uint8_t*)src)[3]) == (uint8_t)c) return ((uint8_t*)dest + 4); - if ( (((uint8_t*)dest)[4] = ((uint8_t*)src)[4]) == (uint8_t)c) + if ((((uint8_t*)dest)[4] = ((uint8_t*)src)[4]) == (uint8_t)c) return ((uint8_t*)dest + 5); - if ( (((uint8_t*)dest)[5] = ((uint8_t*)src)[5]) == (uint8_t)c) + if ((((uint8_t*)dest)[5] = ((uint8_t*)src)[5]) == (uint8_t)c) return ((uint8_t*)dest + 6); - if ( (((uint8_t*)dest)[6] = ((uint8_t*)src)[6]) == (uint8_t)c) + if ((((uint8_t*)dest)[6] = ((uint8_t*)src)[6]) == (uint8_t)c) return ((uint8_t*)dest + 7); - if ( (((uint8_t*)dest)[7] = ((uint8_t*)src)[7]) == (uint8_t)c) + if ((((uint8_t*)dest)[7] = ((uint8_t*)src)[7]) == (uint8_t)c) return ((uint8_t*)dest + 8); } else diff --git a/src/mem/ft_memchr.c b/src/mem/ft_memchr.c index 54780fe..e0266af 100644 --- a/src/mem/ft_memchr.c +++ b/src/mem/ft_memchr.c @@ -6,7 +6,7 @@ /* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/10/07 09:55:31 by cacharle #+# #+# */ -/* Updated: 2020/02/13 04:28:00 by cacharle ### ########.fr */ +/* Updated: 2020/04/01 21:50:49 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -41,7 +41,7 @@ void *ft_memchr(const void *s, int c, size_t n) { lw = *(uint64_t*)s ^ buf; if ((lw - LOMAGIC) & ~lw & HIMAGIC) - break; + break ; n -= 8; s += 8; } diff --git a/src/mem/ft_memset.c b/src/mem/ft_memset.c index ce471a5..9005947 100644 --- a/src/mem/ft_memset.c +++ b/src/mem/ft_memset.c @@ -6,7 +6,7 @@ /* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/10/07 10:01:23 by cacharle #+# #+# */ -/* Updated: 2020/01/17 10:39:10 by cacharle ### ########.fr */ +/* Updated: 2020/04/01 21:49:42 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -16,7 +16,7 @@ void *ft_memset(void *s, int c, size_t n) { uint64_t buf; - void *cpy; + void *cpy; cpy = s; c = (uint8_t)c; |
