From 2721c9054f96693a77cb522358beb9021038edc7 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Mon, 15 Dec 2008 17:10:09 +0000 Subject: Provide GPL disclaimers with all sources - Add GPL disclaimers to all sources - Suppress gcc-4.2 warnings --- src/recode.c | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) (limited to 'src/recode.c') 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 + + 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 #include #include @@ -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)) { -- cgit v1.2.3