From b35fdaaa1a8439b9437190287ed1ed17edf02efd Mon Sep 17 00:00:00 2001
From: Tom Lane <tgl@sss.pgh.pa.us>
Date: Fri, 10 Feb 2006 15:57:58 +0000
Subject: [PATCH] Clean up some signedness warnings.

---
 contrib/tsearch2/ispell/regis.c | 14 ++++++++------
 contrib/tsearch2/ts_locale.c    |  4 ++--
 contrib/tsearch2/ts_locale.h    |  4 ++--
 3 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/contrib/tsearch2/ispell/regis.c b/contrib/tsearch2/ispell/regis.c
index db6f1873f33..20b6bddecf6 100644
--- a/contrib/tsearch2/ispell/regis.c
+++ b/contrib/tsearch2/ispell/regis.c
@@ -9,14 +9,16 @@
 bool
 RS_isRegis(const char *str)
 {
-	unsigned char *ptr = (unsigned char *) str;
-
-	while (ptr && *ptr)
-		if (t_isalpha(ptr) || t_iseq(ptr,'[') || t_iseq(ptr,']') || t_iseq(ptr, '^'))
-			ptr+=pg_mblen(ptr);
+	while (str && *str)
+	{
+		if (t_isalpha(str) ||
+			t_iseq(str, '[') ||
+			t_iseq(str,']') ||
+			t_iseq(str, '^'))
+			str += pg_mblen(str);
 		else
 			return false;
-
+	}
 	return true;
 }
 
diff --git a/contrib/tsearch2/ts_locale.c b/contrib/tsearch2/ts_locale.c
index 29c07c0eab6..e8be69f4586 100644
--- a/contrib/tsearch2/ts_locale.c
+++ b/contrib/tsearch2/ts_locale.c
@@ -74,7 +74,7 @@ char2wchar(wchar_t *to, const char *from, size_t len)
 #endif /* WIN32 */
 
 int
-_t_isalpha( char *ptr ) {
+_t_isalpha( const char *ptr ) {
 	wchar_t	character;
 
 	char2wchar(&character, ptr, 1);
@@ -83,7 +83,7 @@ _t_isalpha( char *ptr ) {
 }
 
 int
-_t_isprint( char *ptr ) {
+_t_isprint( const char *ptr ) {
 	wchar_t	character;
 
 	char2wchar(&character, ptr, 1);
diff --git a/contrib/tsearch2/ts_locale.h b/contrib/tsearch2/ts_locale.h
index 8695b27a0eb..2c0c52b23f9 100644
--- a/contrib/tsearch2/ts_locale.h
+++ b/contrib/tsearch2/ts_locale.h
@@ -44,9 +44,9 @@ size_t		char2wchar(wchar_t *to, const char *from, size_t len);
 
 #define	t_isdigit(x)	( pg_mblen(x)==1 && isdigit( TOUCHAR(x) ) )
 #define	t_isspace(x)	( pg_mblen(x)==1 && isspace( TOUCHAR(x) ) )
-int _t_isalpha( char *ptr );
+extern int _t_isalpha( const char *ptr );
 #define	t_isalpha(x)	( (pg_mblen(x)==1) ? isalpha( TOUCHAR(x) ) : _t_isalpha(x) )
-int _t_isprint( char *ptr );
+extern int _t_isprint( const char *ptr );
 #define	t_isprint(x)	( (pg_mblen(x)==1) ? isprint( TOUCHAR(x) ) : _t_isprint(x) )
 /*
  * t_iseq() should be called only for ASCII symbols 
-- 
GitLab