From c47fdb8c80bc02d54bb45d0980538e8f9f868dd6 Mon Sep 17 00:00:00 2001 From: Vincent Torri Date: Mon, 9 Oct 2017 05:04:26 +0200 Subject: [PATCH] evil: remove strrstr and ffs - not used in the EFL on Windows Signed-off-by: Cedric Bail --- src/lib/evil/evil_string.c | 28 ---------------------------- src/lib/evil/evil_string.h | 36 ------------------------------------ 2 files changed, 64 deletions(-) diff --git a/src/lib/evil/evil_string.c b/src/lib/evil/evil_string.c index 4534b72..08ab2d7 100644 --- a/src/lib/evil/evil_string.c +++ b/src/lib/evil/evil_string.c @@ -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; diff --git a/src/lib/evil/evil_string.h b/src/lib/evil/evil_string.h index e1bf65b..6dbdb34 100644 --- a/src/lib/evil/evil_string.h +++ b/src/lib/evil/evil_string.h @@ -38,42 +38,6 @@ 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. -- 2.7.4