From owner-svn-src-user@FreeBSD.ORG Wed Sep 7 14:37:52 2011 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27573106566B; Wed, 7 Sep 2011 14:37:52 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F1D438FC0A; Wed, 7 Sep 2011 14:37:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p87EbpiX043184; Wed, 7 Sep 2011 14:37:51 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p87Ebpgk043181; Wed, 7 Sep 2011 14:37:51 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201109071437.p87Ebpgk043181@svn.freebsd.org> From: Gabor Kovesdan Date: Wed, 7 Sep 2011 14:37:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r225439 - user/gabor/grep/trunk/regex X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Sep 2011 14:37:52 -0000 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)