svn commit: r225439 - user/gabor/grep/trunk/regex
Gabor Kovesdan
gabor at FreeBSD.org
Wed Sep 7 14:37:52 UTC 2011
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)
More information about the svn-src-user
mailing list