From a9a59e5d289b128405c9e73acd79153dfb97e8f3 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Wed, 25 Feb 2009 00:22:31 +0100 Subject: [PATCH] move the custom defined memrchr to the right place And make it static, as tailhead.c is the only user of it. --- src/conky.c | 14 -------------- src/tailhead.c | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/conky.c b/src/conky.c index a7e1fd0d..17380405 100644 --- a/src/conky.c +++ b/src/conky.c @@ -418,20 +418,6 @@ static char *text_buffer; static unsigned int special_index; /* used when drawing */ #endif /* X11 */ -#ifndef HAVE_MEMRCHR -void *memrchr(const void *buffer, char c, size_t n) -{ - const unsigned char *p = buffer; - - for (p += n; n; n--) { - if (*--p == c) { - return (void *) p; - } - } - return NULL; -} -#endif - /* quite boring functions */ static inline void for_each_line(char *b, void f(char *)) diff --git a/src/tailhead.c b/src/tailhead.c index ab89d48e..01bdfcb2 100644 --- a/src/tailhead.c +++ b/src/tailhead.c @@ -36,6 +36,20 @@ #include #include +#ifndef HAVE_MEMRCHR +static void *memrchr(const void *buffer, char c, size_t n) +{ + const unsigned char *p = buffer; + + for (p += n; n; n--) { + if (*--p == c) { + return (void *) p; + } + } + return NULL; +} +#endif + int init_tailhead_object(enum tailhead_type type, struct text_object *obj, const char *arg) {