Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Sep 2011 14:37:51 +0000 (UTC)
From:      Gabor Kovesdan <gabor@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r225439 - user/gabor/grep/trunk/regex
Message-ID:  <201109071437.p87Ebpgk043181@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gabor
Date: Wed Sep  7 14:37:51 2011
New Revision: 225439
URL: http://svn.freebsd.org/changeset/base/225439

Log:
  - Fix warnings

Modified:
  user/gabor/grep/trunk/regex/fastmatch.h
  user/gabor/grep/trunk/regex/tre-fastmatch.c

Modified: user/gabor/grep/trunk/regex/fastmatch.h
==============================================================================
--- user/gabor/grep/trunk/regex/fastmatch.h	Wed Sep  7 14:20:36 2011	(r225438)
+++ user/gabor/grep/trunk/regex/fastmatch.h	Wed Sep  7 14:37:51 2011	(r225439)
@@ -15,12 +15,12 @@ typedef struct {
   bool		*wescmap;
   unsigned int	 hasdot;
   int		 qsBc[UCHAR_MAX + 1];
-  int		*bmGs;
+  unsigned int	*bmGs;
   char		*pattern;
   bool		*escmap;
   int		 defBc;
   void		*qsBc_table;
-  int		*sbmGs;
+  unsigned int	*sbmGs;
   const char	*re_endp;
 
   /* flags */

Modified: user/gabor/grep/trunk/regex/tre-fastmatch.c
==============================================================================
--- user/gabor/grep/trunk/regex/tre-fastmatch.c	Wed Sep  7 14:20:36 2011	(r225438)
+++ user/gabor/grep/trunk/regex/tre-fastmatch.c	Wed Sep  7 14:37:51 2011	(r225439)
@@ -315,7 +315,7 @@ static int	fastcmp(const void *, const b
 	    wp = xmalloc(plen * sizeof(tre_char_t));			\
 	    if (wp == NULL)						\
 	      return REG_ESPACE;					\
-	    for (int i = 0; i < plen; i++)				\
+	    for (unsigned int i = 0; i < plen; i++)			\
 	      wp[i] = towlower(pat[i]);					\
 	    _CALC_BMGS(arr, wp, plen);					\
 	    xfree(wp);							\
@@ -330,7 +330,7 @@ static int	fastcmp(const void *, const b
 	    p = xmalloc(plen);						\
 	    if (p == NULL)						\
 	      return REG_ESPACE;					\
-	    for (int i = 0; i < plen; i++)				\
+	    for (unsigned int i = 0; i < plen; i++)			\
 	      p[i] = tolower(pat[i]);					\
 	    _CALC_BMGS(arr, p, plen);					\
 	    xfree(p);							\
@@ -365,15 +365,15 @@ static int	fastcmp(const void *, const b
 	  }								\
       }									\
 									\
-    for (int i = 0; i < plen; i++)					\
+    for (unsigned int i = 0; i < plen; i++)				\
       arr[i] = plen;							\
     g = 0;								\
     for (int i = plen - 1; i >= 0; i--)					\
       if (suff[i] == i + 1)						\
-	for(; g < plen - 1 - i; g++)					\
+	for(; (unsigned long)g < plen - 1 - i; g++)			\
 	  if (arr[g] == plen)						\
 	    arr[g] = plen - 1 - i;					\
-    for (int i = 0; i <= plen - 2; i++)					\
+    for (unsigned int i = 0; i <= plen - 2; i++)			\
       arr[plen - 1 - suff[i]] = plen - 1 - i;				\
 									\
     xfree(suff);							\
@@ -506,7 +506,7 @@ tre_compile_fast(fastmatch_t *fg, const 
       continue;								\
     } while (0)
 
-  for (int i = 0; i < n; i++)
+  for (unsigned int i = 0; i < n; i++)
     {
       switch (pat[i])
 	{
@@ -622,7 +622,7 @@ badpat:
 	  return REG_ESPACE;
 	}
 
-      for (int i = 0; i < fg->len; i++)
+      for (unsigned int i = 0; i < fg->len; i++)
 	if (fg->pattern[i] == '\\')
 	  escaped = ! escaped;
 	else if (fg->pattern[i] == '.' && escaped)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201109071437.p87Ebpgk043181>