[sword-svn] r2167 - in trunk: . src/modules src/modules/common src/modules/filters tests

scribe at www.crosswire.org scribe at www.crosswire.org
Fri May 16 16:23:41 MST 2008


Author: scribe
Date: 2008-05-16 16:23:39 -0700 (Fri, 16 May 2008)
New Revision: 2167

Modified:
   trunk/configure.ac
   trunk/src/modules/common/entriesblk.cpp
   trunk/src/modules/filters/swbasicfilter.cpp
   trunk/src/modules/filters/swoptfilter.cpp
   trunk/src/modules/swmodule.cpp
   trunk/tests/icutest.cpp
   trunk/tests/swbuftest.cpp
   trunk/tests/testblocks.cpp
   trunk/tests/translittest.cpp
Log:
Fixed some compile errors and a few warnings on newer versions of gcc
	patch from charcoal


Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2008-05-15 19:58:43 UTC (rev 2166)
+++ trunk/configure.ac	2008-05-16 23:23:39 UTC (rev 2167)
@@ -159,7 +159,8 @@
 	else
 	   ICU_VER=`$ICU_CONFIG --version`
 	   ICU_LIBS=`$ICU_CONFIG --ldflags`
-	   ICU_IOLIBS=`if test $(echo "$ICU_VER >= 3.0"|bc) -eq 1; then $ICU_CONFIG --ldflags-icuio; else $ICU_CONFIG --ldflags-ustdio; fi;`
+	   #ICU_IOLIBS=`if test $(echo "$ICU_VER >= 3.0"|bc) -eq 1; then $ICU_CONFIG --ldflags-icuio; else $ICU_CONFIG --ldflags-ustdio; fi;`
+	   ICU_IOLIBS=`$ICU_CONFIG --ldflags-icuio`
 	fi
      AM_CXXFLAGS="$AM_CXXFLAGS -D_ICU_"
      AM_CFLAGS="$AM_CFLAGS -D_ICU_"

Modified: trunk/src/modules/common/entriesblk.cpp
===================================================================
--- trunk/src/modules/common/entriesblk.cpp	2008-05-15 19:58:43 UTC (rev 2166)
+++ trunk/src/modules/common/entriesblk.cpp	2008-05-16 23:23:39 UTC (rev 2167)
@@ -125,7 +125,7 @@
 const char *EntriesBlock::getEntry(int entryIndex) {
 	unsigned long offset;
 	unsigned long size;
-	static char *empty = "";
+	static const char *empty = "";
 
 	getMetaEntry(entryIndex, &offset, &size);
 	return (offset) ? block+offset : empty;

Modified: trunk/src/modules/filters/swbasicfilter.cpp
===================================================================
--- trunk/src/modules/filters/swbasicfilter.cpp	2008-05-15 19:58:43 UTC (rev 2166)
+++ trunk/src/modules/filters/swbasicfilter.cpp	2008-05-16 23:23:39 UTC (rev 2167)
@@ -289,8 +289,8 @@
 	int tokpos = 0;
 	bool intoken = false;
 	bool inEsc = false;
-	char escStartPos = 0, escEndPos = 0;
-	char tokenStartPos = 0, tokenEndPos = 0;
+	int escStartPos = 0, escEndPos = 0;
+	int tokenStartPos = 0, tokenEndPos = 0;
 	SWBuf lastTextNode;
 	BasicFilterUserData *userData = createUserData(module, key);
 

Modified: trunk/src/modules/filters/swoptfilter.cpp
===================================================================
--- trunk/src/modules/filters/swoptfilter.cpp	2008-05-15 19:58:43 UTC (rev 2166)
+++ trunk/src/modules/filters/swoptfilter.cpp	2008-05-16 23:23:39 UTC (rev 2167)
@@ -12,7 +12,7 @@
 
 SWOptionFilter::SWOptionFilter() {
 	static StringList empty;
-	static char *empty2 = "";
+	static const char *empty2 = "";
 	optName   = empty2;
 	optTip    = empty2;
 	optValues = ∅

Modified: trunk/src/modules/swmodule.cpp
===================================================================
--- trunk/src/modules/swmodule.cpp	2008-05-15 19:58:43 UTC (rev 2166)
+++ trunk/src/modules/swmodule.cpp	2008-05-16 23:23:39 UTC (rev 2167)
@@ -780,7 +780,7 @@
 
 	SWBuf &tmpbuf = (buf) ? local : getRawEntryBuf();
 	SWKey *key = 0;
-	static char *null = "";
+	static const char *null = "";
 
 	if (tmpbuf) {
 		unsigned long size = (len < 0) ? ((getEntrySize()<0) ? strlen(tmpbuf) : getEntrySize()) : len;

Modified: trunk/tests/icutest.cpp
===================================================================
--- trunk/tests/icutest.cpp	2008-05-15 19:58:43 UTC (rev 2166)
+++ trunk/tests/icutest.cpp	2008-05-16 23:23:39 UTC (rev 2167)
@@ -1,5 +1,7 @@
 #include <iostream>
 #include <string>
+#include <malloc.h>
+#include <string.h>
 
 #include "unicode/utypes.h"   /* Basic ICU data types */
 #include "unicode/ucnv.h"     /* C   Converter API    */
@@ -17,7 +19,7 @@
   UErrorCode status = U_ZERO_ERROR;
   int32_t uBufSize = 0, uLength = 0;
   
-  char * samplestring = "If this compiles and runs without errors, apparently ICU is working.";
+  const char * samplestring = "If this compiles and runs without errors, apparently ICU is working.";
 
   uLength = strlen(samplestring);
   conv = ucnv_open("utf-8", &status);		

Modified: trunk/tests/swbuftest.cpp
===================================================================
--- trunk/tests/swbuftest.cpp	2008-05-15 19:58:43 UTC (rev 2166)
+++ trunk/tests/swbuftest.cpp	2008-05-16 23:23:39 UTC (rev 2167)
@@ -85,10 +85,14 @@
 	StringType first =  "firsttestAfirst";
 	StringType second = "firsttestBsecond";
 	for (unsigned long i = (unsigned long)(BASEI/1.5); i; i--) {
-		if (first != second)
-			if (first <= second)
-				if (first > second);
-				else if (!(BASEI%10000)) first[0] = 'f';	// keep us from being optimized out
+		if (first != second) {
+			if (first <= second) {
+				if (first > second) {;}
+				else if (!(BASEI%10000)) {
+					first[0] = 'f';	// keep us from being optimized out
+				}
+			}
+		}
 	}
 	cerr << "\nEND: compare test -------\n";
 	cerr.flush();

Modified: trunk/tests/testblocks.cpp
===================================================================
--- trunk/tests/testblocks.cpp	2008-05-15 19:58:43 UTC (rev 2166)
+++ trunk/tests/testblocks.cpp	2008-05-16 23:23:39 UTC (rev 2167)
@@ -2,6 +2,7 @@
 #include <iostream>
 #include <string>
 #include <stdio.h>
+#include <stdlib.h>
 
 using namespace std;
 #ifndef NO_SWORD_NAMESPACE

Modified: trunk/tests/translittest.cpp
===================================================================
--- trunk/tests/translittest.cpp	2008-05-15 19:58:43 UTC (rev 2166)
+++ trunk/tests/translittest.cpp	2008-05-16 23:23:39 UTC (rev 2167)
@@ -48,7 +48,7 @@
   //UParseError perr = U_ZERO_ERROR;
   int32_t uBufSize = 0, uLength = 0;
 //  void * pAppData=NULL;
-  char * samplestring = "If this compiles and runs without errors, apparently ICU is working.";
+  const char * samplestring = "If this compiles and runs without errors, apparently ICU is working.";
   //ures_open("/usr/local/lib/sword/swicu.dat", 
  // 	NULL, &status);
   //UDataMemory *pappData = udata_open("/usr/local/lib/sword/swicu", 




More information about the sword-cvs mailing list