[sword-svn] r3097 - in trunk: bindings examples/classes
scribe at crosswire.org
scribe at crosswire.org
Tue Mar 11 04:40:13 MST 2014
Author: scribe
Date: 2014-03-11 04:40:13 -0700 (Tue, 11 Mar 2014)
New Revision: 3097
Modified:
trunk/bindings/flatapi.cpp
trunk/examples/classes/Makefile
trunk/examples/classes/flatapilookup.c
trunk/examples/classes/flatapiparsekey.c
Log:
fixed flatapi search
fixed previous flatapi examples to include the correct header
Modified: trunk/bindings/flatapi.cpp
===================================================================
--- trunk/bindings/flatapi.cpp 2014-03-11 11:39:41 UTC (rev 3096)
+++ trunk/bindings/flatapi.cpp 2014-03-11 11:40:13 UTC (rev 3097)
@@ -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: trunk/examples/classes/Makefile
===================================================================
--- trunk/examples/classes/Makefile 2014-03-11 11:39:41 UTC (rev 3096)
+++ trunk/examples/classes/Makefile 2014-03-11 11:40:13 UTC (rev 3097)
@@ -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: trunk/examples/classes/flatapilookup.c
===================================================================
--- trunk/examples/classes/flatapilookup.c 2014-03-11 11:39:41 UTC (rev 3096)
+++ trunk/examples/classes/flatapilookup.c 2014-03-11 11:40:13 UTC (rev 3097)
@@ -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: trunk/examples/classes/flatapiparsekey.c
===================================================================
--- trunk/examples/classes/flatapiparsekey.c 2014-03-11 11:39:41 UTC (rev 3096)
+++ trunk/examples/classes/flatapiparsekey.c 2014-03-11 11:40:13 UTC (rev 3097)
@@ -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