From 2167c3061d73b1fa99b2e8f009a916752350c88d Mon Sep 17 00:00:00 2001 From: malc Date: Sat, 19 May 2018 08:22:20 +0300 Subject: [PATCH] Not generic enough --- cutils.c | 6 ------ cutils.h | 1 - link.c | 10 ++++++++-- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/cutils.c b/cutils.c index 1f3d1cc..13a176e 100644 --- a/cutils.c +++ b/cutils.c @@ -77,12 +77,6 @@ void fmt_linkn (char *s, unsigned int u) s[len] = 0; } -int uninteresting_char (int c) -{ - return c == ' ' || c == '\n' || c == '\t' || c == '\n' || c == '\r' - || ispunct (c); -} - char *ystrdup (const char *s) { size_t len = strlen (s); diff --git a/cutils.h b/cutils.h index 3c35951..71cf46d 100644 --- a/cutils.h +++ b/cutils.h @@ -27,7 +27,6 @@ extern void NORETURN_ATTR GCC_FMT_ATTR (2, 3) extern void *parse_pointer (const char *cap, const char *s); extern double now (void); extern void fmt_linkn (char *s, unsigned int u); -extern int uninteresting_char (int c); extern char *ystrdup (const char *s); #endif diff --git a/link.c b/link.c index 1a51315..99b2acb 100644 --- a/link.c +++ b/link.c @@ -2982,6 +2982,12 @@ CAMLprim void ml_clearmark (value ptr_v) CAMLreturn0; } +static int uninteresting (int c) +{ + return c == ' ' || c == '\n' || c == '\t' || c == '\n' || c == '\r' + || ispunct (c); +} + CAMLprim value ml_markunder (value ptr_v, value x_v, value y_v, value mark_v) { CAMLparam4 (ptr_v, x_v, y_v, mark_v); @@ -3047,11 +3053,11 @@ CAMLprim value ml_markunder (value ptr_v, value x_v, value y_v, value mark_v) b = &ch->bbox; if (x >= b->x0 && x <= b->x1 && y >= b->y0 && y <= b->y1) { for (ch2 = line->first_char; ch2 != ch; ch2 = ch2->next) { - if (uninteresting_char (ch2->c)) first = NULL; + if (uninteresting (ch2->c)) first = NULL; else if (!first) first = ch2; } for (ch2 = ch; ch2; ch2 = ch2->next) { - if (uninteresting_char (ch2->c)) break; + if (uninteresting (ch2->c)) break; last = ch2; } -- 2.11.4.GIT