[sword-svn] r2011 - trunk/src/modules/filters

dglassey at www.crosswire.org dglassey at www.crosswire.org
Sat Nov 25 14:29:46 MST 2006


Author: dglassey
Date: 2006-11-25 14:29:46 -0700 (Sat, 25 Nov 2006)
New Revision: 2011

Modified:
   trunk/src/modules/filters/gbfheadings.cpp
   trunk/src/modules/filters/gbfhtmlhref.cpp
   trunk/src/modules/filters/gbfmorph.cpp
   trunk/src/modules/filters/gbfosis.cpp
   trunk/src/modules/filters/gbfredletterwords.cpp
   trunk/src/modules/filters/gbfrtf.cpp
   trunk/src/modules/filters/gbfstrongs.cpp
   trunk/src/modules/filters/gbfthml.cpp
   trunk/src/modules/filters/gbfwordjs.cpp
   trunk/src/modules/filters/greeklexattribs.cpp
   trunk/src/modules/filters/latin1utf16.cpp
   trunk/src/modules/filters/osishtmlhref.cpp
   trunk/src/modules/filters/osisredletterwords.cpp
   trunk/src/modules/filters/osisrtf.cpp
   trunk/src/modules/filters/osisscripref.cpp
   trunk/src/modules/filters/osisstrongs.cpp
   trunk/src/modules/filters/osisvariants.cpp
   trunk/src/modules/filters/osiswebif.cpp
   trunk/src/modules/filters/osiswordjs.cpp
   trunk/src/modules/filters/teiplain.cpp
   trunk/src/modules/filters/teirtf.cpp
   trunk/src/modules/filters/thmlgbf.cpp
   trunk/src/modules/filters/thmlhtmlhref.cpp
   trunk/src/modules/filters/thmlosis.cpp
   trunk/src/modules/filters/thmlrtf.cpp
   trunk/src/modules/filters/thmlstrongs.cpp
   trunk/src/modules/filters/thmlwebif.cpp
   trunk/src/modules/filters/thmlwordjs.cpp
   trunk/src/modules/filters/utf8html.cpp
   trunk/src/modules/filters/utf8utf16.cpp
Log:
compiler warnings in filters such as:
signed v unsigned comparison
brackets around assignments advisable in if statements
unused variables
initialising variables
indexes of arrays should be int not char
longs in formatted text should be %ld


Modified: trunk/src/modules/filters/gbfheadings.cpp
===================================================================
--- trunk/src/modules/filters/gbfheadings.cpp	2006-11-25 21:26:57 UTC (rev 2010)
+++ trunk/src/modules/filters/gbfheadings.cpp	2006-11-25 21:29:46 UTC (rev 2011)
@@ -31,7 +31,6 @@
 		char token[2048]; // cheese.  Fix.
 		int tokpos = 0;
 		bool intoken = false;
-		int len;
 		bool hide = false;
 
 	const char *from;

Modified: trunk/src/modules/filters/gbfhtmlhref.cpp
===================================================================
--- trunk/src/modules/filters/gbfhtmlhref.cpp	2006-11-25 21:26:57 UTC (rev 2010)
+++ trunk/src/modules/filters/gbfhtmlhref.cpp	2006-11-25 21:29:46 UTC (rev 2011)
@@ -72,9 +72,6 @@
 
 bool GBFHTMLHREF::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) {
 	const char *tok;
-	char val[128];
-	char *valto;
-	const char *num;
 	MyUserData *u = (MyUserData *)userData;
 
 	if (!substituteToken(buf, token)) {
@@ -227,7 +224,7 @@
 		else if (!strcmp(tag.getName(), "RF")) {
 			SWBuf type = tag.getAttribute("type");
 			SWBuf footnoteNumber = tag.getAttribute("swordFootnote");
-			VerseKey *vkey;
+			VerseKey *vkey = NULL;
 			// see if we have a VerseKey * or descendant
 			SWTRY {
 				vkey = SWDYNAMIC_CAST(VerseKey, u->key);

Modified: trunk/src/modules/filters/gbfmorph.cpp
===================================================================
--- trunk/src/modules/filters/gbfmorph.cpp	2006-11-25 21:26:57 UTC (rev 2010)
+++ trunk/src/modules/filters/gbfmorph.cpp	2006-11-25 21:29:46 UTC (rev 2011)
@@ -31,7 +31,6 @@
 		char token[2048]; // cheese.  Fix.
 		int tokpos = 0;
 		bool intoken = false;
-		int len;
 		bool lastspace = false;
 
 		SWBuf orig = text;

Modified: trunk/src/modules/filters/gbfosis.cpp
===================================================================
--- trunk/src/modules/filters/gbfosis.cpp	2006-11-25 21:26:57 UTC (rev 2010)
+++ trunk/src/modules/filters/gbfosis.cpp	2006-11-25 21:29:46 UTC (rev 2011)
@@ -36,8 +36,6 @@
 	SWBuf tmp;
 	SWBuf value;
 	
-	bool newtext = false;
-	
 	bool suspendTextPassThru = false;
 	bool handled = false;
 	bool newWord = false;
@@ -45,15 +43,13 @@
 	bool lastspace = false;
 	
 	const char *wordStart = text.c_str();
-	const char *wordEnd;
+	const char *wordEnd = NULL;
 	
-	const char *textStart;
-	const char *textEnd;
+	const char *textStart = NULL;
+	const char *textEnd = NULL;
 	
 	SWBuf textNode = "";
 
-	char wordstr[5];
-	
 	SWBuf buf;
 		
 	text = "";

Modified: trunk/src/modules/filters/gbfredletterwords.cpp
===================================================================
--- trunk/src/modules/filters/gbfredletterwords.cpp	2006-11-25 21:26:57 UTC (rev 2010)
+++ trunk/src/modules/filters/gbfredletterwords.cpp	2006-11-25 21:29:46 UTC (rev 2011)
@@ -35,7 +35,6 @@
 		char token[4096]; // cheese.  Fix.
 		int tokpos = 0;
 		bool intoken = false;
-		int len;
 		bool hide = false;
 
 	const char *from;

Modified: trunk/src/modules/filters/gbfrtf.cpp
===================================================================
--- trunk/src/modules/filters/gbfrtf.cpp	2006-11-25 21:26:57 UTC (rev 2010)
+++ trunk/src/modules/filters/gbfrtf.cpp	2006-11-25 21:29:46 UTC (rev 2011)
@@ -23,14 +23,12 @@
 	char *num;
 	int tokpos = 0;
 	bool intoken = false;
-	int len;
 	const char *tok;
 	SWBuf strongnum;
 	SWBuf strongtense;
 	bool hideText = false;
 	int wordLen = 0;
 	int wordCount = 0;
-	int i;
 
 	const char *from;
 	SWBuf orig = text;

Modified: trunk/src/modules/filters/gbfstrongs.cpp
===================================================================
--- trunk/src/modules/filters/gbfstrongs.cpp	2006-11-25 21:26:57 UTC (rev 2010)
+++ trunk/src/modules/filters/gbfstrongs.cpp	2006-11-25 21:29:46 UTC (rev 2011)
@@ -32,13 +32,11 @@
 	char token[2048]; // cheese.  Fix.
 	int tokpos = 0;
 	bool intoken = false;
-	int len;
 	bool lastspace = false;
 	int word = 1;
 	char val[128];
 	char wordstr[5];
 	char *valto;
-	char *ch;
 	unsigned int textStart = 0, textEnd = 0;
 	bool newText = false;
 	SWBuf tmp;

Modified: trunk/src/modules/filters/gbfthml.cpp
===================================================================
--- trunk/src/modules/filters/gbfthml.cpp	2006-11-25 21:26:57 UTC (rev 2010)
+++ trunk/src/modules/filters/gbfthml.cpp	2006-11-25 21:29:46 UTC (rev 2011)
@@ -30,7 +30,6 @@
 	char token[2048];
 	int tokpos = 0;
 	bool intoken 	= false;
-	int len;
 	const char *tok;
 
 	SWBuf orig = text;

Modified: trunk/src/modules/filters/gbfwordjs.cpp
===================================================================
--- trunk/src/modules/filters/gbfwordjs.cpp	2006-11-25 21:26:57 UTC (rev 2010)
+++ trunk/src/modules/filters/gbfwordjs.cpp	2006-11-25 21:29:46 UTC (rev 2011)
@@ -44,11 +44,8 @@
 		bool lastspace = false;
 		int word = 1;
 		char val[128];
-		char *valto;
-		char *ch;
 		char wordstr[5];
 		unsigned int textStart = 0, lastAppendLen = 0, textEnd = 0;
-		char gh = 0;
 		SWBuf tmp;
 		bool newText = false;
 		bool needWordOut = false;
@@ -166,7 +163,7 @@
 						else {
 							wordID = key->getText();
 						}
-						for (int i = 0; i < wordID.size(); i++) {
+						for (unsigned int i = 0; i < wordID.size(); i++) {
 							if ((!isdigit(wordID[i])) && (!isalpha(wordID[i]))) {
 								wordID[i] = '_';
 							}
@@ -258,7 +255,7 @@
 			else {
 				wordID = key->getText();
 			}
-			for (int i = 0; i < wordID.size(); i++) {
+			for (unsigned int i = 0; i < wordID.size(); i++) {
 				if ((!isdigit(wordID[i])) && (!isalpha(wordID[i]))) {
 					wordID[i] = '_';
 				}

Modified: trunk/src/modules/filters/greeklexattribs.cpp
===================================================================
--- trunk/src/modules/filters/greeklexattribs.cpp	2006-11-25 21:26:57 UTC (rev 2010)
+++ trunk/src/modules/filters/greeklexattribs.cpp	2006-11-25 21:29:46 UTC (rev 2011)
@@ -29,7 +29,7 @@
 		string freq;
 		char val[128], *valto;
 		char wordstr[7];
-		const char *currentPhrase = 0, *ch = 0;
+		const char *currentPhrase = 0;
 		const char *currentPhraseEnd = 0;
 		int number = 0;
 

Modified: trunk/src/modules/filters/latin1utf16.cpp
===================================================================
--- trunk/src/modules/filters/latin1utf16.cpp	2006-11-25 21:26:57 UTC (rev 2010)
+++ trunk/src/modules/filters/latin1utf16.cpp	2006-11-25 21:29:46 UTC (rev 2011)
@@ -18,7 +18,6 @@
 
 char Latin1UTF16::processText(SWBuf &text, const SWKey *key, const SWModule *module) {
     const unsigned char *from;
-    int len;
 	 if ((unsigned long)key < 2)	// hack, we're en(1)/de(0)ciphering
 		return (char)-1;
    

Modified: trunk/src/modules/filters/osishtmlhref.cpp
===================================================================
--- trunk/src/modules/filters/osishtmlhref.cpp	2006-11-25 21:26:57 UTC (rev 2010)
+++ trunk/src/modules/filters/osishtmlhref.cpp	2006-11-25 21:29:46 UTC (rev 2011)
@@ -112,19 +112,19 @@
 
 				const char *attrib;
 				const char *val;
-				if (attrib = tag.getAttribute("xlit")) {
+				if ((attrib = tag.getAttribute("xlit"))) {
 					val = strchr(attrib, ':');
 					val = (val) ? (val + 1) : attrib;
 					outText(" ", buf, u);
 					outText(val, buf, u);
 				}
-				if (attrib = tag.getAttribute("gloss")) {
+				if ((attrib = tag.getAttribute("gloss"))) {
 					val = strchr(attrib, ':');
 					val = (val) ? (val + 1) : attrib;
 					outText(" ", buf, u);
 					outText(val, buf, u);
 				}
-				if (attrib = tag.getAttribute("lemma")) {
+				if ((attrib = tag.getAttribute("lemma"))) {
 					int count = tag.getAttributePartCount("lemma", ' ');
 					int i = (count > 1) ? 0 : -1;		// -1 for whole value cuz it's faster, but does the same thing as 0
 					do {
@@ -153,7 +153,7 @@
 						
 					} while (++i < count);
 				}
-				if (attrib = tag.getAttribute("morph")) { // && (show)) {
+				if ((attrib = tag.getAttribute("morph"))) { // && (show)) {
 					SWBuf savelemma = tag.getAttribute("savlm");
 					//if ((strstr(savelemma.c_str(), "3588")) && (lastText.length() < 1))
 					//	show = false;
@@ -177,7 +177,7 @@
 						} while (++i < count);
 					//}
 				}
-				if (attrib = tag.getAttribute("POS")) {
+				if ((attrib = tag.getAttribute("POS"))) {
 					val = strchr(attrib, ':');
 					val = (val) ? (val + 1) : attrib;
 					outText(" ", buf, u);
@@ -202,7 +202,7 @@
 
 					if (!strongsMarkup) {	// leave strong's markup notes out, in the future we'll probably have different option filters to turn different note types on or off
 						SWBuf footnoteNumber = tag.getAttribute("swordFootnote");
-						VerseKey *vkey;
+						VerseKey *vkey = NULL;
 						// see if we have a VerseKey * or descendant
 						SWTRY {
 							vkey = SWDYNAMIC_CAST(VerseKey, u->key);

Modified: trunk/src/modules/filters/osisredletterwords.cpp
===================================================================
--- trunk/src/modules/filters/osisredletterwords.cpp	2006-11-25 21:26:57 UTC (rev 2010)
+++ trunk/src/modules/filters/osisredletterwords.cpp	2006-11-25 21:29:46 UTC (rev 2011)
@@ -33,7 +33,6 @@
 	
 	SWBuf token;
 	bool intoken    = false;
-	char buf[254];
 
 	SWBuf orig = text;
 	const char *from = orig.c_str();

Modified: trunk/src/modules/filters/osisrtf.cpp
===================================================================
--- trunk/src/modules/filters/osisrtf.cpp	2006-11-25 21:26:57 UTC (rev 2010)
+++ trunk/src/modules/filters/osisrtf.cpp	2006-11-25 21:29:46 UTC (rev 2011)
@@ -162,19 +162,19 @@
 
 				const char *attrib;
 				const char *val;
-				if (attrib = tag.getAttribute("xlit")) {
+				if ((attrib = tag.getAttribute("xlit"))) {
 					val = strchr(attrib, ':');
 					val = (val) ? (val + 1) : attrib;
 					scratch.setFormatted(" {\\fs15 <%s>}", val);
 					outText(scratch.c_str(), buf, u);
 				}
-				if (attrib = tag.getAttribute("gloss")) {
+				if ((attrib = tag.getAttribute("gloss"))) {
 					val = strchr(attrib, ':');
 					val = (val) ? (val + 1) : attrib;
 					scratch.setFormatted(" {\\fs15 <%s>}", val);
 					outText(scratch.c_str(), buf, u);
 				}
-				if (attrib = tag.getAttribute("lemma")) {
+				if ((attrib = tag.getAttribute("lemma"))) {
 					int count = tag.getAttributePartCount("lemma", ' ');
 					int i = (count > 1) ? 0 : -1;		// -1 for whole value cuz it's faster, but does the same thing as 0
 					do {
@@ -213,7 +213,7 @@
 						} while (++i < count);
 					}
 				}
-				if (attrib = tag.getAttribute("POS")) {
+				if ((attrib = tag.getAttribute("POS"))) {
 					val = strchr(attrib, ':');
 					val = (val) ? (val + 1) : attrib;
 					scratch.setFormatted(" {\\fs15 <%s>}", val);
@@ -235,7 +235,7 @@
 							&& (type != "strongsMarkup")		// deprecated
 							) {
 						SWBuf footnoteNumber = tag.getAttribute("swordFootnote");
-						VerseKey *vkey;
+						VerseKey *vkey = NULL;
 						// see if we have a VerseKey * or descendant
 						SWTRY {
 							vkey = SWDYNAMIC_CAST(VerseKey, u->key);

Modified: trunk/src/modules/filters/osisscripref.cpp
===================================================================
--- trunk/src/modules/filters/osisscripref.cpp	2006-11-25 21:26:57 UTC (rev 2010)
+++ trunk/src/modules/filters/osisscripref.cpp	2006-11-25 21:29:46 UTC (rev 2011)
@@ -33,9 +33,6 @@
 	bool hide       = false;
 	SWBuf tagText;
 	XMLTag startTag;
-	int tagTextNum  = 1;
-	int footnoteNum = 1;
-	char buf[254];
 
 	SWBuf orig = text;
 	const char *from = orig.c_str();

Modified: trunk/src/modules/filters/osisstrongs.cpp
===================================================================
--- trunk/src/modules/filters/osisstrongs.cpp	2006-11-25 21:26:57 UTC (rev 2010)
+++ trunk/src/modules/filters/osisstrongs.cpp	2006-11-25 21:29:46 UTC (rev 2011)
@@ -38,8 +38,6 @@
 	bool lastspace = false;
 	int wordNum = 1;
 	char wordstr[5];
-	char *valto;
-	char *ch;
 	const char *wordStart = 0;
 
 	const SWBuf orig = text;
@@ -72,9 +70,8 @@
 					SWBuf lemmaClass = "";
 
 					const char *attrib;
-					const char *val;
 					sprintf(wordstr, "%03d", wordNum);
-					if (attrib = wtag.getAttribute("morph")) {
+					if ((attrib = wtag.getAttribute("morph"))) {
 						int count = wtag.getAttributePartCount("morph", ' ');
 						int i = (count > 1) ? 0 : -1;		// -1 for whole value cuz it's faster, but does the same thing as 0
 						do {
@@ -106,7 +103,7 @@
 						} while (++i < count);
 					}
 
-					if (attrib = wtag.getAttribute("lemma")) {
+					if ((attrib = wtag.getAttribute("lemma"))) {
 						int count = wtag.getAttributePartCount("lemma", ' ');
 						int i = (count > 1) ? 0 : -1;		// -1 for whole value cuz it's faster, but does the same thing as 0
 						do {
@@ -147,7 +144,7 @@
 						module->getEntryAttributes()["Word"][wordstr]["PartCount"].setFormatted("%d", count);
 					}
 
-					if (attrib = wtag.getAttribute("src")) {
+					if ((attrib = wtag.getAttribute("src"))) {
 						int count = wtag.getAttributePartCount("src", ' ');
 						int i = (count > 1) ? 0 : -1;		// -1 for whole value cuz it's faster, but does the same thing as 0
 						do {

Modified: trunk/src/modules/filters/osisvariants.cpp
===================================================================
--- trunk/src/modules/filters/osisvariants.cpp	2006-11-25 21:26:57 UTC (rev 2010)
+++ trunk/src/modules/filters/osisvariants.cpp	2006-11-25 21:29:46 UTC (rev 2011)
@@ -62,7 +62,7 @@
 		const char *from = orig.c_str();
 
 		//we use a fixed comparision string to make sure the loop is as fast as the original two blocks with almost the same code
-		const char* variantCompareString = (option == 0) ? "div type=\"variant\" class=\"1\"" : "div type=\"variant\" class=\"2\"";
+		//const char* variantCompareString = (option == 0) ? "div type=\"variant\" class=\"1\"" : "div type=\"variant\" class=\"2\"";
 		
 		for (text = ""; *from; from++) {
 			if (*from == '<') {

Modified: trunk/src/modules/filters/osiswebif.cpp
===================================================================
--- trunk/src/modules/filters/osiswebif.cpp	2006-11-25 21:26:57 UTC (rev 2010)
+++ trunk/src/modules/filters/osiswebif.cpp	2006-11-25 21:29:46 UTC (rev 2011)
@@ -69,17 +69,17 @@
 
 				const char *attrib;
 				const char *val;
-				if (attrib = tag.getAttribute("xlit")) {
+				if ((attrib = tag.getAttribute("xlit"))) {
 					val = strchr(attrib, ':');
 					val = (val) ? (val + 1) : attrib;
 //					buf.appendFormatted(" %s", val);
 				}
-				if (attrib = tag.getAttribute("gloss")) {
+				if ((attrib = tag.getAttribute("gloss"))) {
 					val = strchr(attrib, ':');
 					val = (val) ? (val + 1) : attrib;
 					buf.appendFormatted(" %s", val);
 				}
-				if (attrib = tag.getAttribute("lemma")) {
+				if ((attrib = tag.getAttribute("lemma"))) {
 					int count = tag.getAttributePartCount("lemma", ' ');
 					int i = (count > 1) ? 0 : -1;		// -1 for whole value cuz it's faster, but does the same thing as 0
 					do {
@@ -114,7 +114,7 @@
 						} while (++i < count);
 					}
 				}
-				if (attrib = tag.getAttribute("POS")) {
+				if ((attrib = tag.getAttribute("POS"))) {
 					val = strchr(attrib, ':');
 					val = (val) ? (val + 1) : attrib;
 					buf.appendFormatted(" %s", val);
@@ -138,7 +138,7 @@
 					if (!strongsMarkup) {	// leave strong's markup notes out, in the future we'll probably have different option filters to turn different note types on or off
 						SWBuf footnoteNumber = tag.getAttribute("swordFootnote");
 						SWBuf modName = (u->module) ? u->module->Name() : "";
-						VerseKey *vkey;
+						VerseKey *vkey = NULL;
 						// see if we have a VerseKey * or descendant
 						SWTRY {
 							vkey = SWDYNAMIC_CAST(VerseKey, u->key);

Modified: trunk/src/modules/filters/osiswordjs.cpp
===================================================================
--- trunk/src/modules/filters/osiswordjs.cpp	2006-11-25 21:26:57 UTC (rev 2010)
+++ trunk/src/modules/filters/osiswordjs.cpp	2006-11-25 21:29:46 UTC (rev 2011)
@@ -47,9 +47,6 @@
 		bool lastspace = false;
 		int wordNum = 1;
 		char wordstr[5];
-		char val[128];
-		char *valto;
-		char *ch;
 		SWBuf modName = (module)?module->Name():"";
 		// add TR to w src in KJV then remove this next line
 		SWBuf wordSrcPrefix = (modName == "KJV")?SWBuf("TR"):modName;
@@ -143,7 +140,7 @@
 					}
 					wordID.appendFormatted("_%s", src.c_str());
 					// clean up our word ID for XHTML
-					for (int i = 0; i < wordID.size(); i++) {
+					for (unsigned int i = 0; i < wordID.size(); i++) {
 						if ((!isdigit(wordID[i])) && (!isalpha(wordID[i]))) {
 							wordID[i] = '_';
 						}

Modified: trunk/src/modules/filters/teiplain.cpp
===================================================================
--- trunk/src/modules/filters/teiplain.cpp	2006-11-25 21:26:57 UTC (rev 2010)
+++ trunk/src/modules/filters/teiplain.cpp	2006-11-25 21:29:46 UTC (rev 2011)
@@ -42,7 +42,7 @@
 bool TEIPlain::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) {
   // manually process if it wasn't a simple substitution
 	if (!substituteToken(buf, token)) {
-		MyUserData *u = (MyUserData *)userData;
+		//MyUserData *u = (MyUserData *)userData;
 		XMLTag tag(token);
 
 		// <p> paragraph tag

Modified: trunk/src/modules/filters/teirtf.cpp
===================================================================
--- trunk/src/modules/filters/teirtf.cpp	2006-11-25 21:26:57 UTC (rev 2010)
+++ trunk/src/modules/filters/teirtf.cpp	2006-11-25 21:29:46 UTC (rev 2011)
@@ -54,7 +54,7 @@
 bool TEIRTF::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) {
   // manually process if it wasn't a simple substitution
 	if (!substituteToken(buf, token)) {
-		MyUserData *u = (MyUserData *)userData;
+		//MyUserData *u = (MyUserData *)userData;
 		XMLTag tag(token);
 
 		// <p> paragraph tag

Modified: trunk/src/modules/filters/thmlgbf.cpp
===================================================================
--- trunk/src/modules/filters/thmlgbf.cpp	2006-11-25 21:26:57 UTC (rev 2010)
+++ trunk/src/modules/filters/thmlgbf.cpp	2006-11-25 21:29:46 UTC (rev 2011)
@@ -31,7 +31,6 @@
 	char token[2048];
 	int tokpos = 0;
 	bool intoken 	= false;
-	int len;
 	bool ampersand = false;
 	bool sechead = false;
 	bool title = false;  

Modified: trunk/src/modules/filters/thmlhtmlhref.cpp
===================================================================
--- trunk/src/modules/filters/thmlhtmlhref.cpp	2006-11-25 21:26:57 UTC (rev 2010)
+++ trunk/src/modules/filters/thmlhtmlhref.cpp	2006-11-25 21:29:46 UTC (rev 2011)
@@ -157,7 +157,6 @@
 
 
 bool ThMLHTMLHREF::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) {
-	const char *tok;
 	if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution
 		MyUserData *u = (MyUserData *)userData;		
 
@@ -200,7 +199,7 @@
 				if (!tag.isEmpty()) {
 					SWBuf type = tag.getAttribute("type");
 					SWBuf footnoteNumber = tag.getAttribute("swordFootnote");
-					VerseKey *vkey;
+					VerseKey *vkey = NULL;
 					// see if we have a VerseKey * or descendant
 					SWTRY {
 						vkey = SWDYNAMIC_CAST(VerseKey, u->key);
@@ -245,7 +244,7 @@
 				}
 				else {
 					SWBuf footnoteNumber = u->startTag.getAttribute("swordFootnote");
-					VerseKey *vkey;
+					VerseKey *vkey = NULL;
 					// see if we have a VerseKey * or descendant
 					SWTRY {
 						vkey = SWDYNAMIC_CAST(VerseKey, u->key);

Modified: trunk/src/modules/filters/thmlosis.cpp
===================================================================
--- trunk/src/modules/filters/thmlosis.cpp	2006-11-25 21:26:57 UTC (rev 2010)
+++ trunk/src/modules/filters/thmlosis.cpp	2006-11-25 21:29:46 UTC (rev 2011)
@@ -37,17 +37,16 @@
 //	static QuoteStack quoteStack;
 	
 	bool lastspace = false;
-	int word = 1;
 	char val[128];
 	SWBuf buf;
 	char *valto;
 	char *ch;
 	
 	const char *wordStart = text.c_str();
-	const char *wordEnd;
+	const char *wordEnd = NULL;
 	
-	const char *textStart;
-	const char *textEnd;
+	const char *textStart = NULL;
+	const char *textEnd = NULL;
 		
 	bool suspendTextPassThru = false;
 	bool handled = false;

Modified: trunk/src/modules/filters/thmlrtf.cpp
===================================================================
--- trunk/src/modules/filters/thmlrtf.cpp	2006-11-25 21:26:57 UTC (rev 2010)
+++ trunk/src/modules/filters/thmlrtf.cpp	2006-11-25 21:29:46 UTC (rev 2011)
@@ -213,7 +213,6 @@
 
 
 bool ThMLRTF::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) {
-	const char *tok;
 	if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution
 		MyUserData *u = (MyUserData *)userData;		
 		XMLTag tag(token);
@@ -246,7 +245,7 @@
 				if (!tag.isEmpty()) {
 					SWBuf type = tag.getAttribute("type");
 					SWBuf footnoteNumber = tag.getAttribute("swordFootnote");
-					VerseKey *vkey;
+					VerseKey *vkey = NULL;
 					// see if we have a VerseKey * or descendant
 					SWTRY {
 						vkey = SWDYNAMIC_CAST(VerseKey, u->key);
@@ -285,7 +284,7 @@
 				}
 				else {
 					SWBuf footnoteNumber = u->startTag.getAttribute("swordFootnote");
-					VerseKey *vkey;
+					VerseKey *vkey = NULL;
 					// see if we have a VerseKey * or descendant
 					SWTRY {
 						vkey = SWDYNAMIC_CAST(VerseKey, u->key);

Modified: trunk/src/modules/filters/thmlstrongs.cpp
===================================================================
--- trunk/src/modules/filters/thmlstrongs.cpp	2006-11-25 21:26:57 UTC (rev 2010)
+++ trunk/src/modules/filters/thmlstrongs.cpp	2006-11-25 21:29:46 UTC (rev 2011)
@@ -34,7 +34,6 @@
 	const char *from;
 	int tokpos = 0;
 	bool intoken = false;
-	int len;
 	bool lastspace = false;
 	int word = 1;
 	char val[128];

Modified: trunk/src/modules/filters/thmlwebif.cpp
===================================================================
--- trunk/src/modules/filters/thmlwebif.cpp	2006-11-25 21:26:57 UTC (rev 2010)
+++ trunk/src/modules/filters/thmlwebif.cpp	2006-11-25 21:29:46 UTC (rev 2011)
@@ -28,7 +28,6 @@
 }
 
 bool ThMLWEBIF::handleToken(SWBuf &buf, const char *token, BasicFilterUserData *userData) {
-	const char *tok;
 
 	if (!substituteToken(buf, token)) { // manually process if it wasn't a simple substitution
 		MyUserData *u = (MyUserData *)userData;

Modified: trunk/src/modules/filters/thmlwordjs.cpp
===================================================================
--- trunk/src/modules/filters/thmlwordjs.cpp	2006-11-25 21:26:57 UTC (rev 2010)
+++ trunk/src/modules/filters/thmlwordjs.cpp	2006-11-25 21:29:46 UTC (rev 2011)
@@ -50,7 +50,6 @@
 		char *ch;
 		char wordstr[5];
 		unsigned int textStart = 0, lastAppendLen = 0, textEnd = 0;
-		char gh = 0;
 		SWBuf tmp;
 		bool newText = false;
 		bool needWordOut = false;
@@ -179,7 +178,7 @@
 						else {
 							wordID = key->getText();
 						}
-						for (int i = 0; i < wordID.size(); i++) {
+						for (unsigned int i = 0; i < wordID.size(); i++) {
 							if ((!isdigit(wordID[i])) && (!isalpha(wordID[i]))) {
 								wordID[i] = '_';
 							}
@@ -271,7 +270,7 @@
 			else {
 				wordID = key->getText();
 			}
-			for (int i = 0; i < wordID.size(); i++) {
+			for (unsigned int i = 0; i < wordID.size(); i++) {
 				if ((!isdigit(wordID[i])) && (!isalpha(wordID[i]))) {
 					wordID[i] = '_';
 				}

Modified: trunk/src/modules/filters/utf8html.cpp
===================================================================
--- trunk/src/modules/filters/utf8html.cpp	2006-11-25 21:26:57 UTC (rev 2010)
+++ trunk/src/modules/filters/utf8html.cpp	2006-11-25 21:29:46 UTC (rev 2011)
@@ -59,7 +59,7 @@
           from += subsequent;
           text += '&';
           text += '#';
-	  sprintf(digit, "%d", ch);
+	  sprintf(digit, "%ld", ch);
 		for (char *dig = digit; *dig; dig++)
 			text += *dig;
 		text += ';';

Modified: trunk/src/modules/filters/utf8utf16.cpp
===================================================================
--- trunk/src/modules/filters/utf8utf16.cpp	2006-11-25 21:26:57 UTC (rev 2010)
+++ trunk/src/modules/filters/utf8utf16.cpp	2006-11-25 21:29:46 UTC (rev 2011)
@@ -17,7 +17,6 @@
 
 char UTF8UTF16::processText(SWBuf &text, const SWKey *key, const SWModule *module) {
 	const unsigned char *from;
-	char digit[10];
 	unsigned long ch;
         signed short utf16;
 	unsigned char from2[7];




More information about the sword-cvs mailing list