bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Delete ffs and strrchr prototypes.


From: Samuel Thibault
Subject: Re: [PATCH] Delete ffs and strrchr prototypes.
Date: Sun, 15 Jan 2023 14:42:12 +0100
User-agent: NeoMutt/20170609 (1.8.3)

Applied, thanks!

Flavio Cruz, le sam. 14 janv. 2023 19:52:45 -0500, a ecrit:
> We use __builtin_ffs instead of ffs. strrchr is not used.
> 
> Also removed the commented out memset implementation since it is
> implemented in arch-specific code.
> ---
>  include/string.h |  4 ----
>  kern/strings.c   | 21 ---------------------
>  2 files changed, 25 deletions(-)
> 
> diff --git a/include/string.h b/include/string.h
> index cddcbeb9..91c5fe46 100644
> --- a/include/string.h
> +++ b/include/string.h
> @@ -42,8 +42,6 @@ extern char *strcpy (char *dest, const char *src);
>  
>  extern char *strncpy (char *dest, const char *src, size_t n);
>  
> -extern char *strrchr (const char *s, int c);
> -
>  extern char *strsep (char **strp, const char *delim);
>  
>  extern int strcmp (const char *s1, const char *s2) __attribute__ ((pure));
> @@ -54,6 +52,4 @@ extern size_t strlen (const char *s) __attribute__ ((pure));
>  
>  extern char *strstr(const char *haystack, const char *needle);
>  
> -extern int ffs(int i);
> -
>  #endif /* _MACH_SA_SYS_STRING_H_ */
> diff --git a/kern/strings.c b/kern/strings.c
> index 71c99050..7e7fda02 100644
> --- a/kern/strings.c
> +++ b/kern/strings.c
> @@ -173,27 +173,6 @@ strlen(
>       return string - 1 - ret;
>  }
>  
> -/*
> - * Abstract:
> - *   memset writes value "c" in the "n" bytes starting at address "s".
> - *   The return value is a pointer to the "s" string.
> - */
> -
> -#if 0
> -void *
> -memset(
> -     void *_s, int c, size_t n)
> -{
> -     char *s = _s;
> -     size_t i;
> -
> -     for (i = 0; i < n ; i++)
> -             s[i] = c;
> -
> -     return _s;
> -}
> -#endif
> -
>  /*
>   * Abstract:
>   *   strchr returns a pointer to the first occurrence of the character
> -- 
> 2.39.0
> 
> 

-- 
Samuel
---
Pour une évaluation indépendante, transparente et rigoureuse !
Je soutiens la Commission d'Évaluation de l'Inria.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]