summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpgen <p.gen.progs@gmail.com>2018-07-21 14:43:07 +0200
committerpgen <p.gen.progs@gmail.com>2018-07-21 18:24:00 +0200
commit6554f26c8f153e3e6841b68f6b5a7dac3d6a29dc (patch)
treec204730ac96517e8b44c613711bbf1126df141e0
parent7f24151a0ccf05d7dcf8959ee143b3653718d9cd (diff)
Remove unused functions my_memmem and my_memrmem
-rw-r--r--config.h.in6
-rwxr-xr-xconfigure12
-rw-r--r--configure.ac1
-rw-r--r--smenu.c59
-rw-r--r--tests/tagging/t0010.tst.out0
5 files changed, 0 insertions, 78 deletions
diff --git a/config.h.in b/config.h.in
index 78f7faa..71054f3 100644
--- a/config.h.in
+++ b/config.h.in
@@ -22,15 +22,9 @@
/* Define to 1 if you have the `mblen' function. */
#undef HAVE_MBLEN
-/* Define to 1 if you have the `memmem' function. */
-#undef HAVE_MEMMEM
-
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
-/* Define to 1 if you have the `memrmem' function. */
-#undef HAVE_MEMRMEM
-
/* Define to 1 if you have the `memset' function. */
#undef HAVE_MEMSET
diff --git a/configure b/configure
index c3dd96d..abddc21 100755
--- a/configure
+++ b/configure
@@ -4993,18 +4993,6 @@ _ACEOF
fi
done
-for ac_func in memmem memrmem
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
# Make sure we can run config.sub.
$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
diff --git a/configure.ac b/configure.ac
index ff321fa..7a92b8f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,7 +36,6 @@ AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_CHECK_FUNCS([mblen memset nl_langinfo pathconf regcomp setlocale])
AC_CHECK_FUNCS([strchr strrchr strspn strcasecmp])
-AC_CHECK_FUNCS([memmem memrmem])
AC_CANONICAL_HOST
# OS-specific tests
diff --git a/smenu.c b/smenu.c
index 9aa9504..3905965 100644
--- a/smenu.c
+++ b/smenu.c
@@ -191,12 +191,6 @@ isempty(const char * str);
static int
my_strcasecmp(const char * str1, const char * str2);
-static void *
-my_memmem(void * buf, size_t buflen, void * pattern, size_t patlen);
-
-static void *
-my_memrmem(void * buf, size_t buflen, void * pattern, size_t patlen);
-
static sub_tst_t *
sub_tst_new(void);
@@ -2874,59 +2868,6 @@ my_strcasecmp(const char * str1, const char * str2)
#endif
}
-static void *
-my_memmem(void * buf, size_t buflen, void * pattern, size_t patlen)
-{
-#ifdef HAVE_MEMMEM
- return memmem(buf, buflen, pattern, patlen);
-#else
- char * bf = (char *)buf;
- char * pt = (char *)pattern;
- char * p = bf;
-
- while (patlen <= (buflen - (p - bf)))
- {
- if ((p = memchr(p, (size_t)(*pt), buflen - (p - bf))) != NULL)
- {
- static if (memcmp(p, pattern, patlen) == 0) return p;
- else ++p;
- }
- else
- break;
- }
- return NULL;
-#endif
-}
-
-static void *
-my_memrmem(void * buf, size_t buflen, void * pattern, size_t patlen)
-{
-#ifdef HAVE_MEMRMEM
- return memrmem(buf, buflen, pattern, patlen);
-#else
- char * bf = (char *)buf;
- char * pt = (char *)pattern;
- char * p;
-
- size_t i = buflen - patlen + 1;
-
- if (pt - 1 >= bf)
- return NULL;
-
- bf += buflen - 1;
- while ((p = memrchr(bf - i + 1, pt[patlen - 1], i)))
- {
- if ((memcmp(p - patlen + 1, pt, patlen - 1)) == 0)
- return p;
-
- i -= bf - p + 1;
- bf = p - 1;
- }
-
- return NULL;
-#endif
-}
-
/* ======================================================================== */
/* Parse a regular expression based selector. */
/* The string to parse is bounded by a delimiter so we must parse something */
diff --git a/tests/tagging/t0010.tst.out b/tests/tagging/t0010.tst.out
deleted file mode 100644
index e69de29..0000000
--- a/tests/tagging/t0010.tst.out
+++ /dev/null