nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nano-devel] [PATCH 06/10] drop isblank/iswblank fallback functions


From: Mike Frysinger
Subject: [Nano-devel] [PATCH 06/10] drop isblank/iswblank fallback functions
Date: Mon, 18 Apr 2016 02:17:41 -0400

Switch over to gnulib for these.
---
 autogen.sh   |  2 ++
 configure.ac |  4 ++--
 src/chars.c  | 17 -----------------
 src/nano.h   | 10 ----------
 src/proto.h  |  6 ------
 5 files changed, 4 insertions(+), 35 deletions(-)

diff --git a/autogen.sh b/autogen.sh
index 45c5bac..c32b9b9 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -7,6 +7,8 @@ gnulib_hash="730c5249cc17a4ebb7afcb3f2f4e73664eeff5ce"
 modules="
        getdelim
        getline
+       isblank
+       iswblank
        strcase
        strcasestr-simple
        strnlen
diff --git a/configure.ac b/configure.ac
index 069c0a6..3df1234 100644
--- a/configure.ac
+++ b/configure.ac
@@ -432,10 +432,10 @@ int main(void)
 
 dnl Checks for functions.
 
-AC_CHECK_FUNCS(isblank snprintf vsnprintf)
+AC_CHECK_FUNCS(snprintf vsnprintf)
 
 if test "x$enable_utf8" != xno; then
-    AC_CHECK_FUNCS(iswalnum iswblank iswpunct iswspace nl_langinfo mblen 
mbstowcs mbtowc wctomb wcwidth)
+    AC_CHECK_FUNCS(iswalnum iswpunct iswspace nl_langinfo mblen mbstowcs 
mbtowc wctomb wcwidth)
 fi
 
 if test x$ac_cv_func_snprintf = xno; then
diff --git a/src/chars.c b/src/chars.c
index e7ee07a..8fd31fb 100644
--- a/src/chars.c
+++ b/src/chars.c
@@ -66,23 +66,6 @@ char *addstrings(char* str1, size_t len1, char* str2, size_t 
len2)
     return str1;
 }
 
-
-#ifndef HAVE_ISBLANK
-/* This function is equivalent to isblank(). */
-bool nisblank(int c)
-{
-    return isspace(c) && (c == '\t' || !is_cntrl_char(c));
-}
-#endif
-
-#if !defined(HAVE_ISWBLANK) && defined(ENABLE_UTF8)
-/* This function is equivalent to iswblank(). */
-bool niswblank(wchar_t wc)
-{
-    return iswspace(wc) && (wc == '\t' || !is_cntrl_wchar(wc));
-}
-#endif
-
 /* Return TRUE if the value of c is in byte range, and FALSE
  * otherwise. */
 bool is_byte(int c)
diff --git a/src/nano.h b/src/nano.h
index 4b2abe0..44c7c1f 100644
--- a/src/nano.h
+++ b/src/nano.h
@@ -124,16 +124,6 @@
 #define vsnprintf g_vsnprintf
 #endif
 
-/* If no isblank(), iswblank(), strcasecmp(), strncasecmp(),
- * strcasestr(), strnlen(), getdelim(), or getline(), use the versions
- * we have. */
-#ifndef HAVE_ISBLANK
-#define isblank nisblank
-#endif
-#ifndef HAVE_ISWBLANK
-#define iswblank niswblank
-#endif
-
 /* If we aren't using ncurses with mouse support, turn the mouse support
  * off, as it's useless then. */
 #ifndef NCURSES_MOUSE_VERSION
diff --git a/src/proto.h b/src/proto.h
index b186927..2eec5ae 100644
--- a/src/proto.h
+++ b/src/proto.h
@@ -168,12 +168,6 @@ void utf8_init(void);
 bool using_utf8(void);
 #endif
 char *addstrings(char* str1, size_t len1, char* str2, size_t len2);
-#ifndef HAVE_ISBLANK
-bool nisblank(int c);
-#endif
-#if !defined(HAVE_ISWBLANK) && defined(ENABLE_UTF8)
-bool niswblank(wchar_t wc);
-#endif
 bool is_byte(int c);
 bool is_alnum_mbchar(const char *c);
 bool is_blank_mbchar(const char *c);
-- 
2.7.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]