[sword-svn] r2659 - in trunk: include src/mgr src/modules/filters src/utilfuns tests utilities

scribe at crosswire.org scribe at crosswire.org
Tue Oct 25 10:35:20 MST 2011


Author: scribe
Date: 2011-10-25 10:35:20 -0700 (Tue, 25 Oct 2011)
New Revision: 2659

Modified:
   trunk/include/config.h
   trunk/include/swbuf.h
   trunk/src/mgr/swmgr.cpp
   trunk/src/modules/filters/gbfrtf.cpp
   trunk/src/modules/filters/gbfwordjs.cpp
   trunk/src/modules/filters/osislemma.cpp
   trunk/src/modules/filters/osismorph.cpp
   trunk/src/modules/filters/osisruby.cpp
   trunk/src/modules/filters/osisstrongs.cpp
   trunk/src/modules/filters/osiswordjs.cpp
   trunk/src/modules/filters/thmlwordjs.cpp
   trunk/src/modules/filters/utf8html.cpp
   trunk/src/modules/filters/utf8latin1.cpp
   trunk/src/utilfuns/url.cpp
   trunk/tests/ciphertest.cpp
   trunk/utilities/osis2mod.cpp
Log:
cleaned up new warning for unused variables
Add a new method SWBuf::indexOf


Modified: trunk/include/config.h
===================================================================
--- trunk/include/config.h	2011-09-29 18:40:23 UTC (rev 2658)
+++ trunk/include/config.h	2011-10-25 17:35:20 UTC (rev 2659)
@@ -1,6 +1,9 @@
-/* include/config.h.  Generated by configure.  */
+/* include/config.h.  Generated from config.h.in by configure.  */
 /* include/config.h.in.  Generated from configure.ac by autoheader.  */
 
+/* Define if building universal (internal helper macro) */
+/* #undef AC_APPLE_UNIVERSAL_BUILD */
+
 /* Define to 1 if you have the <dlfcn.h> header file. */
 #define HAVE_DLFCN_H 1
 
@@ -37,6 +40,10 @@
 /* Define to 1 if you have the `vsnprintf' function. */
 #define HAVE_VSNPRINTF 1
 
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#define LT_OBJDIR ".libs/"
+
 /* Name of package */
 #define PACKAGE "sword"
 
@@ -52,6 +59,9 @@
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "sword"
 
+/* Define to the home page for this package. */
+#define PACKAGE_URL "http://crosswire.org/sword"
+
 /* Define to the version of this package. */
 #define PACKAGE_VERSION "1.6.2"
 
@@ -61,6 +71,14 @@
 /* Version number of package */
 #define VERSION "1.6.2"
 
-/* Define to 1 if your processor stores words with the most significant byte
-   first (like Motorola and SPARC, unlike Intel and VAX). */
-/* #undef WORDS_BIGENDIAN */
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+   significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+#  define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+/* #  undef WORDS_BIGENDIAN */
+# endif
+#endif

Modified: trunk/include/swbuf.h
===================================================================
--- trunk/include/swbuf.h	2011-09-29 18:40:23 UTC (rev 2658)
+++ trunk/include/swbuf.h	2011-10-25 17:35:20 UTC (rev 2659)
@@ -415,6 +415,11 @@
 	 */
 	inline bool endsWith(const SWBuf &postfix) const { return (size() >= postfix.size())?!strncmp(end-postfix.size(), postfix.c_str(), postfix.size()):false; }
 
+	/**
+	 * @return returns the index of a substring if it is found in this buffer; otherwise, returns < 0
+	 */
+	inline long indexOf(const SWBuf &needle) const { const char *ch = strstr(buf, needle.c_str()); return (ch) ? ch - buf : -1; }
+	
 	inline int compare(const SWBuf &other) const { return strcmp(c_str(), other.c_str()); }
 	inline bool operator ==(const SWBuf &other) const { return compare(other) == 0; }
 	inline bool operator !=(const SWBuf &other) const { return compare(other) != 0; }

Modified: trunk/src/mgr/swmgr.cpp
===================================================================
--- trunk/src/mgr/swmgr.cpp	2011-09-29 18:40:23 UTC (rev 2658)
+++ trunk/src/mgr/swmgr.cpp	2011-10-25 17:35:20 UTC (rev 2659)
@@ -899,7 +899,6 @@
 	if ((!stricmp(driver, "zText")) || (!stricmp(driver, "zCom"))) {
 		SWCompress *compress = 0;
 		int blockType = CHAPTERBLOCKS;
-		int blockNum = 1;
 		misc1 = ((entry = section.find("BlockType")) != section.end()) ? (*entry).second : (SWBuf)"CHAPTER";
 		if (!stricmp(misc1.c_str(), "VERSE"))
 			blockType = VERSEBLOCKS;
@@ -908,9 +907,6 @@
 		else if (!stricmp(misc1.c_str(), "BOOK"))
 			blockType = BOOKBLOCKS;
 		
-		misc1 = ((entry = section.find("BlockNumber")) != section.end()) ? (*entry).second : (SWBuf)"1";
-		blockNum = atoi(misc1.c_str());
-
 		misc1 = ((entry = section.find("CompressType")) != section.end()) ? (*entry).second : (SWBuf)"LZSS";
 #ifndef EXCLUDEZLIB
 		if (!stricmp(misc1.c_str(), "ZIP"))

Modified: trunk/src/modules/filters/gbfrtf.cpp
===================================================================
--- trunk/src/modules/filters/gbfrtf.cpp	2011-09-29 18:40:23 UTC (rev 2658)
+++ trunk/src/modules/filters/gbfrtf.cpp	2011-10-25 17:35:20 UTC (rev 2659)
@@ -42,7 +42,6 @@
 	SWBuf strongnum;
 	SWBuf strongtense;
 	bool hideText = false;
-	int wordLen = 0;
 	int wordCount = 0;
 
 	const char *from;
@@ -50,7 +49,6 @@
 	from = orig.c_str();
 	for (text = ""; *from; from++) {
 		if (*from == '<') {
-			wordLen = wordCount;
 			wordCount = 0;
 			intoken = true;
 			tokpos = 0;

Modified: trunk/src/modules/filters/gbfwordjs.cpp
===================================================================
--- trunk/src/modules/filters/gbfwordjs.cpp	2011-09-29 18:40:23 UTC (rev 2658)
+++ trunk/src/modules/filters/gbfwordjs.cpp	2011-10-25 17:35:20 UTC (rev 2659)
@@ -57,7 +57,6 @@
 		char token[2112]; // cheese.  Fix.
 		int tokpos = 0;
 		bool intoken = false;
-		bool lastspace = false;
 		int word = 1;
 		char val[128];
 		char wordstr[5];
@@ -192,6 +191,7 @@
 
 
 
+							if (!sMorph) sMorph = 0;	// to pass unused warning for now
 /*
 							if (sMorph) {
 								SWBuf popMorph = "<a onclick=\"";
@@ -223,7 +223,6 @@
 			}
 			else	{
 				text += *from;
-				lastspace = (*from == ' ');
 			}
 		}
 

Modified: trunk/src/modules/filters/osislemma.cpp
===================================================================
--- trunk/src/modules/filters/osislemma.cpp	2011-09-29 18:40:23 UTC (rev 2658)
+++ trunk/src/modules/filters/osislemma.cpp	2011-10-25 17:35:20 UTC (rev 2659)
@@ -44,7 +44,6 @@
 char OSISLemma::processText(SWBuf &text, const SWKey *key, const SWModule *module) {
 	SWBuf token;
 	bool intoken = false;
-	bool lastspace = false;
 
 	const SWBuf orig = text;
 	const char * from = orig.c_str();
@@ -90,7 +89,6 @@
 			}
 			else	{
 				text.append(*from);
-				lastspace = (*from == ' ');
 			}
 		}
 	}

Modified: trunk/src/modules/filters/osismorph.cpp
===================================================================
--- trunk/src/modules/filters/osismorph.cpp	2011-09-29 18:40:23 UTC (rev 2658)
+++ trunk/src/modules/filters/osismorph.cpp	2011-10-25 17:35:20 UTC (rev 2659)
@@ -45,7 +45,6 @@
 		char token[2048]; // cheese.  Fix.
 		int tokpos = 0;
 		bool intoken = false;
-		bool lastspace = false;
 		SWBuf orig = text;
 		const char *from = orig.c_str();
 		
@@ -90,7 +89,6 @@
 			}
 			else	{
 				text.append(*from);
-				lastspace = (*from == ' ');
 			}
 		}
 	}

Modified: trunk/src/modules/filters/osisruby.cpp
===================================================================
--- trunk/src/modules/filters/osisruby.cpp	2011-09-29 18:40:23 UTC (rev 2658)
+++ trunk/src/modules/filters/osisruby.cpp	2011-10-25 17:35:20 UTC (rev 2659)
@@ -44,7 +44,6 @@
 char OSISRuby::processText(SWBuf &text, const SWKey *key, const SWModule *module) {
 	SWBuf token;
 	bool intoken = false;
-	bool lastspace = false;
 
 	const SWBuf orig = text;
 	const char * from = orig.c_str();
@@ -83,7 +82,6 @@
 			}
 			else	{
 				text.append(*from);
-				lastspace = (*from == ' ');
 			}
 		}
 	}

Modified: trunk/src/modules/filters/osisstrongs.cpp
===================================================================
--- trunk/src/modules/filters/osisstrongs.cpp	2011-09-29 18:40:23 UTC (rev 2658)
+++ trunk/src/modules/filters/osisstrongs.cpp	2011-10-25 17:35:20 UTC (rev 2659)
@@ -49,7 +49,6 @@
 char OSISStrongs::processText(SWBuf &text, const SWKey *key, const SWModule *module) {
 	SWBuf token;
 	bool intoken = false;
-	bool lastspace = false;
 	int wordNum = 1;
 	char wordstr[5];
 	const char *wordStart = 0;
@@ -280,7 +279,6 @@
 		}
 		else	{
 			text.append(*from);
-			lastspace = (*from == ' ');
 		}
 	}
 	return 0;

Modified: trunk/src/modules/filters/osiswordjs.cpp
===================================================================
--- trunk/src/modules/filters/osiswordjs.cpp	2011-09-29 18:40:23 UTC (rev 2658)
+++ trunk/src/modules/filters/osiswordjs.cpp	2011-10-25 17:35:20 UTC (rev 2659)
@@ -59,7 +59,6 @@
 		char token[2112]; // cheese.  Fix.
 		int tokpos = 0;
 		bool intoken = false;
-		bool lastspace = false;
 		int wordNum = 1;
 		char wordstr[5];
 		SWBuf modName = (module)?module->Name():"";
@@ -186,7 +185,6 @@
 			}
 			else	{
 				text.append(*from);
-				lastspace = (*from == ' ');
 			}
 		}
 	}

Modified: trunk/src/modules/filters/thmlwordjs.cpp
===================================================================
--- trunk/src/modules/filters/thmlwordjs.cpp	2011-09-29 18:40:23 UTC (rev 2658)
+++ trunk/src/modules/filters/thmlwordjs.cpp	2011-10-25 17:35:20 UTC (rev 2659)
@@ -58,7 +58,6 @@
 		char token[2112]; // cheese.  Fix.
 		int tokpos = 0;
 		bool intoken = false;
-		bool lastspace = false;
 		int word = 1;
 		char val[128];
 		char *valto;
@@ -206,6 +205,7 @@
 
 
 
+							if (!sMorph) sMorph = 0;	// avoid unused warnings for now
 /*
 							if (sMorph) {
 								SWBuf popMorph = "<a onclick=\"";
@@ -237,7 +237,6 @@
 			}
 			else	{
 				text += *from;
-				lastspace = (*from == ' ');
 			}
 		}
 

Modified: trunk/src/modules/filters/utf8html.cpp
===================================================================
--- trunk/src/modules/filters/utf8html.cpp	2011-09-29 18:40:23 UTC (rev 2658)
+++ trunk/src/modules/filters/utf8html.cpp	2011-10-25 17:35:20 UTC (rev 2659)
@@ -34,14 +34,11 @@
 char UTF8HTML::processText(SWBuf &text, const SWKey *key, const SWModule *module)
 {
 	unsigned char *from;
-	int len;
         char digit[10];
         unsigned long ch;
 	 if ((unsigned long)key < 2)	// hack, we're en(1)/de(0)ciphering
 		return (char)-1;
 
-	len = strlen(text.c_str()) + 2;						// shift string to right of buffer
-
 	SWBuf orig = text;
   	from = (unsigned char *)orig.c_str();
 

Modified: trunk/src/modules/filters/utf8latin1.cpp
===================================================================
--- trunk/src/modules/filters/utf8latin1.cpp	2011-09-29 18:40:23 UTC (rev 2658)
+++ trunk/src/modules/filters/utf8latin1.cpp	2011-10-25 17:35:20 UTC (rev 2659)
@@ -36,14 +36,12 @@
 {
   unsigned char *from;
 
-  int len;
   unsigned long uchar;
   unsigned char significantFirstBits, subsequent;
   
   if ((unsigned long)key < 2) {// hack, we're en(1)/de(0)ciphering
 	return (char)-1;
   }
-  len = strlen(text.c_str()) + 1;						// shift string to right of buffer
 
   SWBuf orig = text;
   from = (unsigned char*)orig.c_str();

Modified: trunk/src/utilfuns/url.cpp
===================================================================
--- trunk/src/utilfuns/url.cpp	2011-09-29 18:40:23 UTC (rev 2658)
+++ trunk/src/utilfuns/url.cpp	2011-10-25 17:35:20 UTC (rev 2659)
@@ -174,6 +174,7 @@
 		SWBuf paramName;
 		SWBuf paramValue;
 				
+		if (checkAnchor) checkAnchor = false;
 /*
 		end = strchr(urlPtr, '#');
 		if (!end) {

Modified: trunk/tests/ciphertest.cpp
===================================================================
--- trunk/tests/ciphertest.cpp	2011-09-29 18:40:23 UTC (rev 2658)
+++ trunk/tests/ciphertest.cpp	2011-10-25 17:35:20 UTC (rev 2659)
@@ -30,7 +30,7 @@
 	}
 
 	
-	int encipher = atoi(argv[2]);
+	long encipher = atoi(argv[2]);
 
 	SWFilter *filter = new CipherFilter(argv[1]);
 

Modified: trunk/utilities/osis2mod.cpp
===================================================================
--- trunk/utilities/osis2mod.cpp	2011-09-29 18:40:23 UTC (rev 2658)
+++ trunk/utilities/osis2mod.cpp	2011-10-25 17:35:20 UTC (rev 2659)
@@ -1476,6 +1476,8 @@
 		else usage(*argv, (((SWBuf)"Unknown argument: ")+ argv[i]).c_str());
 	}
 
+	if (isCommentary) isCommentary = true;	// avoid unused warning for now
+
 	if (compType == "ZIP") {
 #ifndef EXCLUDEZLIB
 		compressor = new ZipCompress();




More information about the sword-cvs mailing list