diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2008-12-15 17:10:09 +0000 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2008-12-15 17:10:09 +0000 |
commit | 2721c9054f96693a77cb522358beb9021038edc7 (patch) | |
tree | 5839af331351c274b1de1f852d6c2c6747a31e3c /src/recode.c | |
parent | 161a683873dc52a7a72242d1a006faed0f92ad3f (diff) | |
download | librcc-2721c9054f96693a77cb522358beb9021038edc7.tar.gz librcc-2721c9054f96693a77cb522358beb9021038edc7.tar.bz2 librcc-2721c9054f96693a77cb522358beb9021038edc7.tar.xz librcc-2721c9054f96693a77cb522358beb9021038edc7.zip |
Provide GPL disclaimers with all sources
- Add GPL disclaimers to all sources
- Suppress gcc-4.2 warnings
Diffstat (limited to 'src/recode.c')
-rw-r--r-- | src/recode.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/src/recode.c b/src/recode.c index 1d98306..e4a2051 100644 --- a/src/recode.c +++ b/src/recode.c @@ -1,3 +1,22 @@ +/* + LibRCC - module providing language autodetection and recoding + + Copyright (C) 2005-2008 Suren A. Chilingaryan <csa@dside.dyndns.org> + + This program is free software; you can redistribute it and/or modify it + under the terms of version 2 of the GNU General Public License as published + by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. +*/ + #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -125,17 +144,17 @@ static rcc_language_id rccDetectLanguageInternal(rcc_context ctx, rcc_class_id c if (!strcasecmp(config->language->sn, rcc_english_language_sn)) english_mode = 1; else english_mode = 0; - utf8 = (char*)rccStringGetString(recoded); + utf8 = (unsigned char*)rccStringGetString(recoded); for (result=0,own=0,words=0,ownlongest=0,longest=0,mode=0,j=0;utf8[j];j++) { if (isSpace(utf8[j])) { if (mode) { if ((english_mode)&&(!english_word)) is_english_string = 0; - spres = rccSpellerSized(speller, utf8 + mode - 1, j - mode + 1, 1); + spres = rccSpellerSized(speller, (char*)utf8 + mode - 1, j - mode + 1, 1); if (rccSpellerResultIsCorrect(spres)) { result++; - chars = rccStringSizedGetChars(utf8 + mode - 1, j - mode + 1); + chars = rccStringSizedGetChars((char*)utf8 + mode - 1, j - mode + 1); if (chars > longest) longest = chars; } if (rccSpellerResultIsOwn(spres)) { @@ -161,10 +180,10 @@ static rcc_language_id rccDetectLanguageInternal(rcc_context ctx, rcc_class_id c if (mode) { if ((english_mode)&&(!english_word)) is_english_string = 0; - spres = rccSpeller(speller, utf8 + mode - 1); + spres = rccSpeller(speller, (char*)utf8 + mode - 1); if (rccSpellerResultIsCorrect(spres)) { result++; - chars = rccStringSizedGetChars(utf8 + mode - 1, 0); + chars = rccStringSizedGetChars((char*)utf8 + mode - 1, 0); if (chars > longest) longest = chars; } if (rccSpellerResultIsOwn(spres)) { |