[sword-svn] r3222 - in trunk: . src/modules/lexdict/rawld src/modules/lexdict/rawld4 src/modules/lexdict/zld tests tests/testsuite utilities
scribe at crosswire.org
scribe at crosswire.org
Wed Apr 30 22:39:51 MST 2014
Author: scribe
Date: 2014-04-30 22:39:51 -0700 (Wed, 30 Apr 2014)
New Revision: 3222
Removed:
trunk/platforms/
Modified:
trunk/src/modules/lexdict/rawld/rawld.cpp
trunk/src/modules/lexdict/rawld4/rawld4.cpp
trunk/src/modules/lexdict/zld/zld.cpp
trunk/tests/ldtest.cpp
trunk/tests/testsuite/ldr12n.good
trunk/tests/testsuite/ldr12n.sh
trunk/utilities/imp2ld.cpp
Log:
reverting a 3209-3221 as bad commits from git-svn
Modified: trunk/src/modules/lexdict/rawld/rawld.cpp
===================================================================
--- trunk/src/modules/lexdict/rawld/rawld.cpp 2014-05-01 05:15:08 UTC (rev 3221)
+++ trunk/src/modules/lexdict/rawld/rawld.cpp 2014-05-01 05:39:51 UTC (rev 3222)
@@ -147,26 +147,12 @@
void RawLD::setEntry(const char *inbuf, long len) {
- char *buf = new char [ strlen(*key) + 6 ];
- strcpy(buf, *key);
-
- if (strongsPadding) strongsPad(buf);
-
- doSetText(buf, inbuf, len);
-
- delete [] buf;
+ doSetText(*key, inbuf, len);
}
void RawLD::linkEntry(const SWKey *inkey) {
- char *buf = new char [ strlen(*key) + 6 ];
- strcpy(buf, *key);
-
- if (strongsPadding) strongsPad(buf);
-
- doLinkEntry(buf, *inkey);
-
- delete [] buf;
+ doLinkEntry(*key, *inkey);
}
@@ -177,14 +163,7 @@
*/
void RawLD::deleteEntry() {
- char *buf = new char [ strlen(*key) + 6 ];
- strcpy(buf, *key);
-
- if (strongsPadding) strongsPad(buf);
-
- doSetText(buf, "");
-
- delete [] buf;
+ doSetText(*key, "");
}
Modified: trunk/src/modules/lexdict/rawld4/rawld4.cpp
===================================================================
--- trunk/src/modules/lexdict/rawld4/rawld4.cpp 2014-05-01 05:15:08 UTC (rev 3221)
+++ trunk/src/modules/lexdict/rawld4/rawld4.cpp 2014-05-01 05:39:51 UTC (rev 3222)
@@ -145,26 +145,12 @@
void RawLD4::setEntry(const char *inbuf, long len) {
- char *buf = new char [ strlen(*key) + 6 ];
- strcpy(buf, *key);
-
- if (strongsPadding) strongsPad(buf);
-
- doSetText(buf, inbuf, len);
-
- delete [] buf;
+ doSetText(*key, inbuf, len);
}
void RawLD4::linkEntry(const SWKey *inkey) {
- char *buf = new char [ strlen(*key) + 6 ];
- strcpy(buf, *key);
-
- if (strongsPadding) strongsPad(buf);
-
- doLinkEntry(buf, *inkey);
-
- delete [] buf;
+ doLinkEntry(*key, *inkey);
}
@@ -175,14 +161,7 @@
*/
void RawLD4::deleteEntry() {
- char *buf = new char [ strlen(*key) + 6 ];
- strcpy(buf, *key);
-
- if (strongsPadding) strongsPad(buf);
-
- doSetText(buf, "");
-
- delete [] buf;
+ doSetText(*key, "");
}
Modified: trunk/src/modules/lexdict/zld/zld.cpp
===================================================================
--- trunk/src/modules/lexdict/zld/zld.cpp 2014-05-01 05:15:08 UTC (rev 3221)
+++ trunk/src/modules/lexdict/zld/zld.cpp 2014-05-01 05:39:51 UTC (rev 3222)
@@ -144,26 +144,12 @@
void zLD::setEntry(const char *inbuf, long len) {
- char *buf = new char [ strlen(*key) + 6 ];
- strcpy(buf, *key);
-
- if (strongsPadding) strongsPad(buf);
-
- setText(buf, inbuf, len);
-
- delete [] buf;
+ setText(*key, inbuf, len);
}
void zLD::linkEntry(const SWKey *inkey) {
- char *buf = new char [ strlen(*key) + 6 ];
- strcpy(buf, *key);
-
- if (strongsPadding) strongsPad(buf);
-
- zStr::linkEntry(buf, *inkey);
-
- delete [] buf;
+ zStr::linkEntry(*key, *inkey);
}
@@ -174,14 +160,7 @@
*/
void zLD::deleteEntry() {
- char *buf = new char [ strlen(*key) + 6 ];
- strcpy(buf, *key);
-
- if (strongsPadding) strongsPad(buf);
-
- setText(buf, "");
-
- delete [] buf;
+ setText(*key, "");
}
Modified: trunk/tests/ldtest.cpp
===================================================================
--- trunk/tests/ldtest.cpp 2014-05-01 05:15:08 UTC (rev 3221)
+++ trunk/tests/ldtest.cpp 2014-05-01 05:39:51 UTC (rev 3222)
@@ -1,20 +1,14 @@
#include <swmodule.h>
#include <swmgr.h>
#include <iostream>
-#include <stdio.h>
using namespace sword;
using namespace std;
int main(int argc, char **argv) {
- if (argc < 2) {
- fprintf(stderr, "usage: %s <lexdict_name>\n", *argv);
- exit(-1);
- }
-
SWMgr library;
- SWModule *module = library.getModule(argv[1]);
+ SWModule *module = library.getModule("ldr12n");
if (!module) {
cerr << "\nCouldn't find module: " << argv[1] << "\n" << endl;
exit(-2);
Modified: trunk/tests/testsuite/ldr12n.good
===================================================================
--- trunk/tests/testsuite/ldr12n.good 2014-05-01 05:15:08 UTC (rev 3221)
+++ trunk/tests/testsuite/ldr12n.good 2014-05-01 05:39:51 UTC (rev 3222)
@@ -4,21 +4,9 @@
4
0005
0006
-0001
-0002
-0003
-4
-0005
-0006
0001: Body of 1
0002: Body of 2
0003: Body of 3
0005: Body of 5
0006: Body of 6
4: Body of 4
-00001: Body of 1
-00002: Body of 2
-00003: Body of 3
-00004: Body of 4
-00005: Body of 5
-00006: Body of 6
Modified: trunk/tests/testsuite/ldr12n.sh
===================================================================
--- trunk/tests/testsuite/ldr12n.sh 2014-05-01 05:15:08 UTC (rev 3221)
+++ trunk/tests/testsuite/ldr12n.sh 2014-05-01 05:39:51 UTC (rev 3222)
@@ -11,20 +11,8 @@
Encoding=UTF-8
SourceType=Plain
Lang=en
-StrongsPadding=false
!
-cat > ldr12n/mods.d/ldr12np.conf <<!
-[ldr12np]
-DataPath=./modules/ldr12np
-ModDrv=RawLD
-Encoding=UTF-8
-SourceType=Plain
-Lang=en
-StrongsPadding=true
-!
+../../utilities/imp2ld ldr12n.imp -o ldr12n/modules/ldr12n 2>&1 | grep -v \$Rev
-../../utilities/imp2ld ldr12n.imp -P -o ldr12n/modules/ldr12n 2>&1 | grep -v \$Rev
-../../utilities/imp2ld ldr12n.imp -o ldr12n/modules/ldr12np 2>&1 | grep -v \$Rev
-
-cd ldr12n && ../../ldtest ldr12n && ../../ldtest ldr12np
+cd ldr12n && ../../ldtest ldr12n
Modified: trunk/utilities/imp2ld.cpp
===================================================================
--- trunk/utilities/imp2ld.cpp 2014-05-01 05:15:08 UTC (rev 3221)
+++ trunk/utilities/imp2ld.cpp 2014-05-01 05:39:51 UTC (rev 3222)
@@ -56,11 +56,10 @@
fprintf(stderr, " -a\t\t\t augment module if exists (default is to create new)\n");
fprintf(stderr, " -z <l|z|b|x>\t\t use compression (default: none)\n");
fprintf(stderr, "\t\t\t\t l - LZSS; z - ZIP; b - bzip2; x - xz\n");
- fprintf(stderr, " -o <output_path>\t\t where to write data files.\n");
+ fprintf(stderr, " -o <output_path>\t where to write data files.\n");
fprintf(stderr, " -4\t\t\t use 4 byte size entries (default: 2).\n");
fprintf(stderr, " -b <entry_count>\t\t compression block size (default 30 entries)\n");
fprintf(stderr, " -s\t\t\t case sensitive keys (default is not case sensitive)\n");
- fprintf(stderr, " -P\t\t\t disable key Strong's number padding (by defalut keys will be padded).");
fprintf(stderr, "\n");
fprintf(stderr, "'imp' format is a simple standard for importing data into SWORD modules.\n"
"Required is a plain text file containing $$$key lines followed by content.\n\n"
@@ -88,7 +87,6 @@
SWCompress *compressor = 0;
SWBuf compType = "";
bool fourByteSize = false;
- bool strongsPadding = true;
if (argc < 2) usage(*argv);
@@ -119,9 +117,6 @@
else if (!strcmp(argv[i], "-4")) {
fourByteSize = true;
}
- else if (!strcmp(argv[i], "-P")) {
- strongsPadding = false;
- }
else if (!strcmp(argv[i], "-b")) {
if (i+1 < argc) {
blockCount = atoi(argv[++i]);
@@ -153,6 +148,7 @@
exit(-2);
}
+
SWModule *mod = 0;
SWKey *key, *linkKey;
@@ -200,12 +196,12 @@
if (compressor) {
// Create a compressed text module allowing very large entries
// Taking defaults except for first, fourth, fifth and last argument
- mod = new zLD(outPath, 0, 0, blockCount, compressor, 0, ENC_UNKNOWN, DIRECTION_LTR, FMT_UNKNOWN, 0, caseSensitive, strongsPadding);
+ mod = new zLD(outPath, 0, 0, blockCount, compressor, 0, ENC_UNKNOWN, DIRECTION_LTR, FMT_UNKNOWN, 0, caseSensitive);
}
else {
mod = (!fourByteSize)
- ? (SWModule *)new RawLD (outPath, 0, 0, 0, ENC_UNKNOWN, DIRECTION_LTR, FMT_UNKNOWN, 0, caseSensitive, strongsPadding)
- : (SWModule *)new RawLD4(outPath, 0, 0, 0, ENC_UNKNOWN, DIRECTION_LTR, FMT_UNKNOWN, 0, caseSensitive, strongsPadding);
+ ? (SWModule *)new RawLD (outPath, 0, 0, 0, ENC_UNKNOWN, DIRECTION_LTR, FMT_UNKNOWN, 0, caseSensitive)
+ : (SWModule *)new RawLD4(outPath, 0, 0, 0, ENC_UNKNOWN, DIRECTION_LTR, FMT_UNKNOWN, 0, caseSensitive);
}
@@ -262,6 +258,7 @@
infile.close();
delete linkKey;
+ delete key;
delete mod;
return 0;
More information about the sword-cvs
mailing list