[sword-svn] r3162 - in branches/sword-1-7-x: . bindings examples/classes

greg.hellings at crosswire.org greg.hellings at crosswire.org
Wed Apr 16 21:05:54 MST 2014


Author: greg.hellings
Date: 2014-04-16 21:05:54 -0700 (Wed, 16 Apr 2014)
New Revision: 3162

Modified:
   branches/sword-1-7-x/
   branches/sword-1-7-x/bindings/flatapi.cpp
   branches/sword-1-7-x/examples/classes/Makefile
   branches/sword-1-7-x/examples/classes/flatapilookup.c
   branches/sword-1-7-x/examples/classes/flatapiparsekey.c
Log:
Merging r3097 - fixed search in flatapi



Property changes on: branches/sword-1-7-x
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk:2989-2991,2997,3001-3004,3006,3010-3013,3015-3020,3026-3039,3045-3046,3048,3056,3058-3062,3067,3073,3077-3081,3085-3086,3091,3094
   + /trunk:2989-2991,2997,3001-3004,3006,3010-3013,3015-3020,3026-3039,3045-3046,3048,3056,3058-3062,3067,3073,3077-3081,3085-3086,3091,3094,3097

Modified: branches/sword-1-7-x/bindings/flatapi.cpp
===================================================================
--- branches/sword-1-7-x/bindings/flatapi.cpp	2014-04-17 04:04:03 UTC (rev 3161)
+++ branches/sword-1-7-x/bindings/flatapi.cpp	2014-04-17 04:05:54 UTC (rev 3162)
@@ -103,7 +103,6 @@
 		if (searchHits) {
 			for (int i = 0; true; ++i) {
 				if (searchHits[i].modName) {
-					delete [] searchHits[i].modName;
 					delete [] searchHits[i].key;
 				}
 				else break;
@@ -286,7 +285,7 @@
 		// don't alloc this; we have a persistent const char * in SWModule we can just reference
 		retVal[i].modName = module->getName();
 		stdstr(&(retVal[i].key), assureValidUTF8(result.getShortText()));
-		retVal[i].score = (long)result.getElement()->userData;
+		retVal[i++].score = (long)result.getElement()->userData;
 		// in case we limit count to a max number of hits
 		if (i >= count) break;
 	}
@@ -383,7 +382,7 @@
 	}
 
 	const char **retVal = (const char **)calloc(results.size()+1, sizeof(const char *));
-	for (int i = 0; i < results.size(); i++) {
+	for (int i = 0; i < (int)results.size(); i++) {
 		if (filteredBool) {
 			stdstr((char **)&(retVal[i]), assureValidUTF8(module->renderText(results[i].c_str())));
 		}
@@ -979,6 +978,7 @@
 //	mgr->setGlobalOption("Greek Accents", "Off");
 
 	char errStatus = mgr->filterText(filterName, hmgr->filterBuf);
+	(void)errStatus;
 	return hmgr->filterBuf.c_str();
 }
 

Modified: branches/sword-1-7-x/examples/classes/Makefile
===================================================================
--- branches/sword-1-7-x/examples/classes/Makefile	2014-04-17 04:04:03 UTC (rev 3161)
+++ branches/sword-1-7-x/examples/classes/Makefile	2014-04-17 04:05:54 UTC (rev 3162)
@@ -1,4 +1,4 @@
-TARGETS= ciphercng swmgrex verseranges lastVerseInChapter verseposition simplechapter flatapilookup flatapiparsekey
+TARGETS= ciphercng swmgrex verseranges lastVerseInChapter verseposition simplechapter flatapilookup flatapiparsekey flatapisearch
 all: $(TARGETS)
 
 clean:

Modified: branches/sword-1-7-x/examples/classes/flatapilookup.c
===================================================================
--- branches/sword-1-7-x/examples/classes/flatapilookup.c	2014-04-17 04:04:03 UTC (rev 3161)
+++ branches/sword-1-7-x/examples/classes/flatapilookup.c	2014-04-17 04:05:54 UTC (rev 3162)
@@ -23,7 +23,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include <swordminflat.h>
+#include <flatapi.h>
 
 int main(int argc, char **argv) {
 	if (argc != 3) {

Modified: branches/sword-1-7-x/examples/classes/flatapiparsekey.c
===================================================================
--- branches/sword-1-7-x/examples/classes/flatapiparsekey.c	2014-04-17 04:04:03 UTC (rev 3161)
+++ branches/sword-1-7-x/examples/classes/flatapiparsekey.c	2014-04-17 04:05:54 UTC (rev 3162)
@@ -23,7 +23,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include <swordminflat.h>
+#include <flatapi.h>
 
 int main(int argc, char **argv) {
 	if (argc != 3) {




More information about the sword-cvs mailing list