Date: Wed, 10 Aug 2011 21:32:13 +0000 (UTC) From: Gabor Kovesdan <gabor@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r224766 - user/gabor/tre-integration/contrib/tre/lib Message-ID: <201108102132.p7ALWDvr062203@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: gabor Date: Wed Aug 10 21:32:13 2011 New Revision: 224766 URL: http://svn.freebsd.org/changeset/base/224766 Log: - TRE-specific changes to support better those systems that do not have wchar-support Modified: user/gabor/tre-integration/contrib/tre/lib/fastmatch.c Modified: user/gabor/tre-integration/contrib/tre/lib/fastmatch.c ============================================================================== --- user/gabor/tre-integration/contrib/tre/lib/fastmatch.c Wed Aug 10 20:52:02 2011 (r224765) +++ user/gabor/tre-integration/contrib/tre/lib/fastmatch.c Wed Aug 10 21:32:13 2011 (r224766) @@ -32,8 +32,10 @@ #include <stdbool.h> #include <stdlib.h> #include <string.h> +#ifdef TRE_WCHAR #include <wchar.h> #include <wctype.h> +#endif #include "fastmatch.h" #include "hashtable.h" @@ -138,7 +140,7 @@ static int fastcmp(const void *, const v mismatch -= u; \ v = fg->wlen - 1 - mismatch; \ r = hashtable_get(fg->qsBc_table, \ - &((wchar_t *)startptr)[mismatch + 1], &bc); \ + &((tre_char_t *)startptr)[mismatch + 1], &bc); \ gs = fg->bmGs[mismatch]; \ } \ bc = (r == 0) ? bc : fg->defBc; \ @@ -228,7 +230,7 @@ static int fastcmp(const void *, const v hashtable_put(fg->qsBc_table, &fg->wpattern[i], &k); \ if (fg->icase) \ { \ - wint_t wc = iswlower(fg->wpattern[i]) ? \ + tre_char_t wc = iswlower(fg->wpattern[i]) ? \ towupper(fg->wpattern[i]) : towlower(fg->wpattern[i]); \ hashtable_put(fg->qsBc_table, &wc, &k); \ } \ @@ -251,13 +253,13 @@ static int fastcmp(const void *, const v #define _FILL_BMGS(arr, pat, plen, wide) \ { \ char *p; \ - wchar_t *wp; \ + tre_char_t *wp; \ \ if (wide) \ { \ if (fg->icase) \ { \ - wp = alloca(plen * sizeof(wint_t)); \ + wp = alloca(plen * sizeof(tre_char_t)); \ for (int i = 0; i < plen; i++) \ wp[i] = towlower(pat[i]); \ _CALC_BMGS(arr, wp, plen); \ @@ -446,9 +448,7 @@ tre_fastexec(const fastmatch_t *fg, cons int mismatch, shift, u = 0, v; const char *str_byte = data; const void *startptr = NULL; -#ifdef TRE_WCHAR - const wchar_t *str_wide = data; -#endif + const tre_char_t *str_wide = data; if (len == (unsigned)-1) switch (type) @@ -532,10 +532,8 @@ fastcmp(const void *pat, const void *dat const char *str_byte = data; const char *pat_byte = pat; int ret = REG_OK; -#ifdef TRE_WCHAR - const wchar_t *str_wide = data; - const wchar_t *pat_wide = pat; -#endif + const tre_char_t *str_wide = data; + const tre_char_t *pat_wide = pat; for (int i = len - 1; i >= 0; i--) { switch (type)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201108102132.p7ALWDvr062203>