evil: remove strrstr and ffs - not used in the EFL on Windows
authorVincent Torri <vincent.torri@gmail.com>
Mon, 9 Oct 2017 03:04:26 +0000 (05:04 +0200)
committerCedric Bail <cedric@osg.samsung.com>
Fri, 13 Oct 2017 18:40:10 +0000 (11:40 -0700)
Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
src/lib/evil/evil_string.c
src/lib/evil/evil_string.h

index 4534b72..08ab2d7 100644 (file)
@@ -29,34 +29,6 @@ strndup(const char *str, size_t n)
    return ret;
 }
 
-int ffs(int i)
-{
-   int size;
-   int x;
-
-   if (!i) return 1;
-
-   /* remove the sign bit */
-   x = i & -i;
-   size = sizeof(int) << 3;
-   for (i = size; i > 0; --i, x <<= 1)
-     if (x & (1 << (size - 1))) return i;
-
-   return x;
-}
-
-char *
-strrstr (const char *str, const char *substr)
-{
-  char *it;
-  char *ret = NULL;
-
-  while ((it = strstr(str, substr)))
-    ret = it;
-
-  return ret;
-}
-
 char *strcasestr(const char *haystack, const char *needle)
 {
    size_t length_needle;
index e1bf65b..6dbdb34 100644 (file)
 EAPI char *strndup(const char *str, size_t n);
 
 /**
- * @brief Return the position of the first (least significant) bit set in a word
- *
- * @param i Word to take the first bit.
- * @return The position of the first bit set, or 0 if no bits are set.
- *
- * This function returns the position of the first (least significant)
- * bit set in @p i. The least significant bit is position 1 and the
- * most significant position e.g. 32 or 64. The function returns 0 if
- * no bits are set in @p i, or the position of the first bit set
- * otherwise.
- *
- * Conformity: BSD
- *
- * Supported OS: Windows XP.
- */
-EAPI int ffs(int i);
-
-
-/**
- * @brief Get the last substring occurence.
- *
- * @param str The string to search from.
- * @param substr The substring to search.
- * @return The last occurrence of the substring if found, @c NULL otherwise.
- *
- * This function retrieves the last occurrence of @p substring in the
- * string @p str. If @p str or @p substr are @c NULL, of if @p substr
- * is not found in @p str, @c NULL is returned.
- *
- * Conformity: Non applicable.
- *
- * Supported OS: Windows XP.
- */
-EAPI char *strrstr (const char *str, const char *substr);
-
-/**
  * @brief Locate a substring into a string, ignoring case.
  *
  * @param haystack The string to search in.