[sword-svn] r2012 - in trunk/src/modules: . comments comments/rawfiles common texts

dglassey at www.crosswire.org dglassey at www.crosswire.org
Sat Nov 25 14:30:56 MST 2006


Author: dglassey
Date: 2006-11-25 14:30:56 -0700 (Sat, 25 Nov 2006)
New Revision: 2012

Modified:
   trunk/src/modules/comments/rawfiles/rawfiles.cpp
   trunk/src/modules/comments/swcom.cpp
   trunk/src/modules/common/entriesblk.cpp
   trunk/src/modules/common/rawstr.cpp
   trunk/src/modules/common/rawstr4.cpp
   trunk/src/modules/common/zstr.cpp
   trunk/src/modules/common/zverse.cpp
   trunk/src/modules/swmodule.cpp
   trunk/src/modules/texts/swtext.cpp
Log:
compilers warnings in modules/ 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


Modified: trunk/src/modules/comments/rawfiles/rawfiles.cpp
===================================================================
--- trunk/src/modules/comments/rawfiles/rawfiles.cpp	2006-11-25 21:29:46 UTC (rev 2011)
+++ trunk/src/modules/comments/rawfiles/rawfiles.cpp	2006-11-25 21:30:56 UTC (rev 2012)
@@ -57,7 +57,6 @@
 	FileDesc *datafile;
 	long  start = 0;
 	unsigned short size = 0;
-	char *tmpbuf;
 	VerseKey *key = 0;
 
 	SWTRY {
@@ -155,7 +154,6 @@
 
 	long  start;
 	unsigned short size;
-	char *tmpbuf;
 	const VerseKey *key = 0;
 
 	SWTRY {

Modified: trunk/src/modules/comments/swcom.cpp
===================================================================
--- trunk/src/modules/comments/swcom.cpp	2006-11-25 21:29:46 UTC (rev 2011)
+++ trunk/src/modules/comments/swcom.cpp	2006-11-25 21:30:56 UTC (rev 2012)
@@ -75,7 +75,7 @@
 
 
 VerseKey &SWCom::getVerseKey() const {
-	VerseKey *key;
+	VerseKey *key = NULL;
 	// see if we have a VerseKey * or decendant
 	SWTRY {
 		key = SWDYNAMIC_CAST(VerseKey, this->key);

Modified: trunk/src/modules/common/entriesblk.cpp
===================================================================
--- trunk/src/modules/common/entriesblk.cpp	2006-11-25 21:29:46 UTC (rev 2011)
+++ trunk/src/modules/common/entriesblk.cpp	2006-11-25 21:30:56 UTC (rev 2012)
@@ -142,9 +142,7 @@
 	unsigned long dataSize;
 	getRawData(&dataSize);
 	getMetaEntry(entryIndex, &offset, &size);
-	unsigned long len = size - 1;
 	int count = getCount();
-	unsigned long dataStart = METAHEADERSIZE + (count * METAENTRYSIZE);
 
 	if (!offset)	// already deleted
 		return;

Modified: trunk/src/modules/common/rawstr.cpp
===================================================================
--- trunk/src/modules/common/rawstr.cpp	2006-11-25 21:29:46 UTC (rev 2011)
+++ trunk/src/modules/common/rawstr.cpp	2006-11-25 21:30:56 UTC (rev 2012)
@@ -124,7 +124,6 @@
 
 void RawStr::getIDXBuf(long ioffset, char **buf)
 {
-	char *trybuf, *targetbuf;
 	long offset;
 	
 	if (idxfd > 0) {
@@ -152,7 +151,7 @@
 
 signed char RawStr::findOffset(const char *ikey, long *start, unsigned short *size, long away, long *idxoff)
 {
-	char *trybuf, *targetbuf, *key = 0, quitflag = 0;
+	char *trybuf, *key = 0, quitflag = 0;
 	signed char retval = -1;
 	long headoff, tailoff, tryoff = 0, maxoff = 0;
 

Modified: trunk/src/modules/common/rawstr4.cpp
===================================================================
--- trunk/src/modules/common/rawstr4.cpp	2006-11-25 21:29:46 UTC (rev 2011)
+++ trunk/src/modules/common/rawstr4.cpp	2006-11-25 21:30:56 UTC (rev 2012)
@@ -123,7 +123,6 @@
 
 void RawStr4::getIDXBuf(long ioffset, char **buf)
 {
-	char *trybuf, *targetbuf;
 	long offset;
 	
 	if (idxfd > 0) {
@@ -160,7 +159,7 @@
 
 signed char RawStr4::findOffset(const char *ikey, long *start, unsigned long *size, long away, long *idxoff)
 {
-	char *trybuf, *targetbuf, *key = 0, quitflag = 0;
+	char *trybuf, *key = 0, quitflag = 0;
 	signed char retval = -1;
 	long headoff, tailoff, tryoff = 0, maxoff = 0;
 
@@ -372,7 +371,7 @@
 	while (true);	// while we're resolving links
 
 	if (idxbuflocal) {
-		int localsize = strlen(idxbuflocal);
+		unsigned int localsize = strlen(idxbuflocal);
 		localsize = (localsize < (*isize - 1)) ? localsize : (*isize - 1);
 		strncpy(*idxbuf, idxbuflocal, localsize);
 		(*idxbuf)[localsize] = 0;

Modified: trunk/src/modules/common/zstr.cpp
===================================================================
--- trunk/src/modules/common/zstr.cpp	2006-11-25 21:29:46 UTC (rev 2011)
+++ trunk/src/modules/common/zstr.cpp	2006-11-25 21:30:56 UTC (rev 2012)
@@ -619,7 +619,7 @@
 			rawZFilter(buf, 1); // 1 = encipher
 
 			long zdxSize = zdxfd->seek(0, SEEK_END);
-			long zdtSize = zdtfd->seek(0, SEEK_END);
+			unsigned long zdtSize = zdtfd->seek(0, SEEK_END);
 
 			if ((cacheBlockIndex * ZDXENTRYSIZE) > (zdxSize - ZDXENTRYSIZE)) {	// New Block
 				start = zdtSize;

Modified: trunk/src/modules/common/zverse.cpp
===================================================================
--- trunk/src/modules/common/zverse.cpp	2006-11-25 21:29:46 UTC (rev 2011)
+++ trunk/src/modules/common/zverse.cpp	2006-11-25 21:30:56 UTC (rev 2012)
@@ -140,7 +140,6 @@
 	unsigned long ulCompOffset=0;	       // compressed buffer start
 	unsigned long ulCompSize=0;	             // buffer size compressed
 	unsigned long ulUnCompSize=0;	          // buffer size uncompressed
-	char *pcCompText=NULL;					 // compressed text
 
 	*start = *size = 0;
 	//printf ("Finding offset %ld\n", idxoff);

Modified: trunk/src/modules/swmodule.cpp
===================================================================
--- trunk/src/modules/swmodule.cpp	2006-11-25 21:29:46 UTC (rev 2011)
+++ trunk/src/modules/swmodule.cpp	2006-11-25 21:30:56 UTC (rev 2012)
@@ -680,7 +680,6 @@
 
 		// entry attributes
 		else if (searchType == -3) {
-			int i;
 			RenderText();	// force parse
 			AttributeTypeList &entryAttribs = getEntryAttributes();
 			AttributeTypeList::iterator i1Start, i1End;

Modified: trunk/src/modules/texts/swtext.cpp
===================================================================
--- trunk/src/modules/texts/swtext.cpp	2006-11-25 21:29:46 UTC (rev 2011)
+++ trunk/src/modules/texts/swtext.cpp	2006-11-25 21:30:56 UTC (rev 2012)
@@ -82,7 +82,7 @@
 
 
 VerseKey &SWText::getVerseKey() const {
-	VerseKey *key;
+	VerseKey *key = NULL;
 	// see if we have a VerseKey * or decendant
 	SWTRY {
 		key = SWDYNAMIC_CAST(VerseKey, this->key);




More information about the sword-cvs mailing list