[sword-svn] r1999 - in trunk/utilities: . diatheke
dglassey at www.crosswire.org
dglassey at www.crosswire.org
Sat Nov 25 08:20:51 MST 2006
Author: dglassey
Date: 2006-11-25 08:20:51 -0700 (Sat, 25 Nov 2006)
New Revision: 1999
Modified:
trunk/utilities/cipherraw.cpp
trunk/utilities/diatheke/osiscgi.cpp
trunk/utilities/gbfidx.cpp
trunk/utilities/imp2ld.cpp
trunk/utilities/imp2vs.cpp
trunk/utilities/osis2mod.cpp
trunk/utilities/xml2gbs.cpp
Log:
fix copmiler warnings in utilities
things such as potentially undefined variables
unused variables
comparing signed and unsigned
Modified: trunk/utilities/cipherraw.cpp
===================================================================
--- trunk/utilities/cipherraw.cpp 2006-11-25 15:17:42 UTC (rev 1998)
+++ trunk/utilities/cipherraw.cpp 2006-11-25 15:20:51 UTC (rev 1999)
@@ -65,10 +65,10 @@
key.Headings(1);
for (key.Index(0); (!key.Error()); key++) {
rawdrv->findOffset(key.Testament(), key.Index(), &offset, &size);
- printf("%s: OLD offset: %d; size: %d\n", (const char *)key, offset, size);
+ printf("%s: OLD offset: %ld; size: %d\n", (const char *)key, offset, size);
if ((offset == loffset) && (size == lsize)) {
- printf("using previous offset,size\n", size);
+ printf("using previous offset,size %d\n", size);
offset = lseek(oxfd[key.Testament() - 1], 0, SEEK_CUR);
printf("%ld %ld %d \n", offset, lzoffset, lzsize);
write(oxfd[key.Testament() - 1], &lzoffset, 4);
Modified: trunk/utilities/diatheke/osiscgi.cpp
===================================================================
--- trunk/utilities/diatheke/osiscgi.cpp 2006-11-25 15:17:42 UTC (rev 1998)
+++ trunk/utilities/diatheke/osiscgi.cpp 2006-11-25 15:20:51 UTC (rev 1999)
@@ -80,17 +80,17 @@
const char *attrib;
const char *val;
- if (attrib = tag.getAttribute("xlit")) {
+ if ((attrib = tag.getAttribute("xlit"))) {
val = strchr(attrib, ':');
val = (val) ? (val + 1) : attrib;
buf.appendFormatted(" %s", val);
}
- if (attrib = tag.getAttribute("gloss")) {
+ if ((attrib = tag.getAttribute("gloss"))) {
val = strchr(attrib, ':');
val = (val) ? (val + 1) : attrib;
buf.appendFormatted(" %s", val);
}
- if (attrib = tag.getAttribute("lemma")) {
+ if ((attrib = tag.getAttribute("lemma"))) {
int count = tag.getAttributePartCount("lemma");
int i = (count > 1) ? 0 : -1; // -1 for whole value cuz it's faster, but does the same thing as 0
do {
@@ -140,7 +140,7 @@
} while (++i < count);
}
}
- if (attrib = tag.getAttribute("POS")) {
+ if ((attrib = tag.getAttribute("POS"))) {
val = strchr(attrib, ':');
val = (val) ? (val + 1) : attrib;
buf.appendFormatted(" %s", val);
@@ -160,7 +160,7 @@
if (type != "x-strongsMarkup" && // leave strong's markup notes out, in the future we'll probably have different option filters to turn different note types on or off
type != "strongsMarkup") { // deprecated
SWBuf footnoteNumber = tag.getAttribute("swordFootnote");
- VerseKey *vkey;
+ VerseKey *vkey = NULL;
// see if we have a VerseKey * or descendant
SWTRY {
vkey = SWDYNAMIC_CAST(VerseKey, u->key);
@@ -201,7 +201,7 @@
if ((!tag.isEndTag()) && (!tag.isEmpty())) {
buf += "<a href=\"!DIATHEKE_URL!verse=";
- if (attrib = tag.getAttribute("osisRef")) {
+ if ((attrib = tag.getAttribute("osisRef"))) {
val = strchr(attrib, ':');
val = (val) ? (val + 1) : attrib;
buf.appendFormatted("%s", val);
Modified: trunk/utilities/gbfidx.cpp
===================================================================
--- trunk/utilities/gbfidx.cpp 2006-11-25 15:17:42 UTC (rev 1998)
+++ trunk/utilities/gbfidx.cpp 2006-11-25 15:20:51 UTC (rev 1999)
@@ -32,12 +32,12 @@
char testmnt;
-main(int argc, char **argv)
+int main(int argc, char **argv)
{
long pos, offset;
- int num1, num2, rangemax, curbook = 0, curchap = 0, curverse = 0;
- char buf[127], startflag = 0;
- short size, tmp;
+ int num1, num2, rangemax;
+ char startflag = 0;
+ short size;
checkparams(argc, argv);
@@ -90,6 +90,7 @@
close(cfp);
close(bfp);
close(fp);
+ return 0;
}
@@ -135,8 +136,6 @@
char startchap(char *buf)
{
- char loop;
-
if (buf[0] != '<')
return 0;
if (buf[1] != 'S')
@@ -159,8 +158,6 @@
char startentry(char *buf)
{
- char loop;
-
if (buf[0] != '<')
return 0;
if (buf[1] != 'S')
@@ -184,9 +181,7 @@
char findbreak(int fp, long *offset, int *num1, int *num2, int *rangemax, short *size)
{
char buf[7];
- char buf2[20];
- char ch;
- char loop;
+ int loop;
long offset2;
int ch2, vs2, rm2;
bool flag;
Modified: trunk/utilities/imp2ld.cpp
===================================================================
--- trunk/utilities/imp2ld.cpp 2006-11-25 15:17:42 UTC (rev 1998)
+++ trunk/utilities/imp2ld.cpp 2006-11-25 15:20:51 UTC (rev 1999)
@@ -61,9 +61,9 @@
}
}
- zLD* modZ;
- RawLD* mod2;
- RawLD4* mod4;
+ zLD* modZ = NULL;
+ RawLD* mod2 = NULL;
+ RawLD4* mod4 = NULL;
SWKey* key;
if (mode == 3) {
Modified: trunk/utilities/imp2vs.cpp
===================================================================
--- trunk/utilities/imp2vs.cpp 2006-11-25 15:17:42 UTC (rev 1998)
+++ trunk/utilities/imp2vs.cpp 2006-11-25 15:20:51 UTC (rev 1999)
@@ -23,7 +23,6 @@
const string helptext ="imp2vs 1.0 Bible/Commentary module creation tool for the SWORD Project\n usage:\n %s <filename> [output dir] \n";
- signed long i = 0;
string keybuffer = "";
string entbuffer = "";
string linebuffer = "";
Modified: trunk/utilities/osis2mod.cpp
===================================================================
--- trunk/utilities/osis2mod.cpp 2006-11-25 15:17:42 UTC (rev 1998)
+++ trunk/utilities/osis2mod.cpp 2006-11-25 15:20:51 UTC (rev 1999)
@@ -165,8 +165,8 @@
static bool inChapterHeader = false;
// Flags to indicate whether we are in a book, chapter and/or verse
- static bool inBook = false;
- static bool inChapter = false;
+ //static bool inBook = false;
+ //static bool inChapter = false;
static bool inVerse = true;
static SWBuf header = "";
Modified: trunk/utilities/xml2gbs.cpp
===================================================================
--- trunk/utilities/xml2gbs.cpp 2006-11-25 15:17:42 UTC (rev 1998)
+++ trunk/utilities/xml2gbs.cpp 2006-11-25 15:20:51 UTC (rev 1999)
@@ -73,7 +73,7 @@
}
TreeKeyIdx * treeKey;
- RawGenBook * book;
+ RawGenBook * book = NULL;
std::string divs[32];
@@ -288,7 +288,7 @@
}
int main(int argc, char **argv) {
- unsigned long i = 0;
+ int i = 0;
char modname[256];
*modname = 0;
More information about the sword-cvs
mailing list