[sword-svn] r3439 - in trunk: include src/keys src/mgr src/modules/comments/rawcom4 src/modules/common src/modules/filters src/modules/genbook/rawgenbook src/modules/lexdict src/modules/lexdict/zld src/modules/texts/rawtext4 src/modules/texts/ztext4 src/utilfuns src/utilfuns/zlib
scribe at crosswire.org
scribe at crosswire.org
Sun Oct 23 01:32:03 MST 2016
Author: scribe
Date: 2016-10-23 01:32:02 -0700 (Sun, 23 Oct 2016)
New Revision: 3439
Modified:
trunk/include/listkey.h
trunk/include/swbuf.h
trunk/src/keys/treekeyidx.cpp
trunk/src/keys/versekey.cpp
trunk/src/mgr/curlftpt.cpp
trunk/src/mgr/curlhttpt.cpp
trunk/src/mgr/filemgr.cpp
trunk/src/mgr/ftplibftpt.cpp
trunk/src/mgr/installmgr.cpp
trunk/src/mgr/localemgr.cpp
trunk/src/mgr/remotetrans.cpp
trunk/src/mgr/stringmgr.cpp
trunk/src/mgr/swlocale.cpp
trunk/src/mgr/swmgr.cpp
trunk/src/mgr/versificationmgr.cpp
trunk/src/modules/comments/rawcom4/rawcom4.cpp
trunk/src/modules/common/bz2comprs.cpp
trunk/src/modules/common/entriesblk.cpp
trunk/src/modules/common/rawstr.cpp
trunk/src/modules/common/rawstr4.cpp
trunk/src/modules/common/rawverse.cpp
trunk/src/modules/common/rawverse4.cpp
trunk/src/modules/common/zipcomprs.cpp
trunk/src/modules/common/zstr.cpp
trunk/src/modules/common/zverse.cpp
trunk/src/modules/common/zverse4.cpp
trunk/src/modules/filters/gbfstrongs.cpp
trunk/src/modules/filters/gbfwordjs.cpp
trunk/src/modules/filters/osishtmlhref.cpp
trunk/src/modules/filters/osislatex.cpp
trunk/src/modules/filters/osisstrongs.cpp
trunk/src/modules/filters/teihtmlhref.cpp
trunk/src/modules/filters/thmlstrongs.cpp
trunk/src/modules/filters/thmlwordjs.cpp
trunk/src/modules/filters/utf8arabicpoints.cpp
trunk/src/modules/genbook/rawgenbook/rawgenbook.cpp
trunk/src/modules/lexdict/swld.cpp
trunk/src/modules/lexdict/zld/zld.cpp
trunk/src/modules/texts/rawtext4/rawtext4.cpp
trunk/src/modules/texts/ztext4/ztext4.cpp
trunk/src/utilfuns/ftplib.c
trunk/src/utilfuns/roman.cpp
trunk/src/utilfuns/swbuf.cpp
trunk/src/utilfuns/url.cpp
trunk/src/utilfuns/utilstr.cpp
trunk/src/utilfuns/utilxml.cpp
trunk/src/utilfuns/zlib/gzread.c
trunk/src/utilfuns/zlib/gzwrite.c
trunk/src/utilfuns/zlib/untgz.c
Log:
Reviewed implicit cast warnings to determine safe casting and added
explicit casts where safe or updated receiving variable to match datatype.
Modified: trunk/include/listkey.h
===================================================================
--- trunk/include/listkey.h 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/include/listkey.h 2016-10-23 08:32:02 UTC (rev 3439)
@@ -144,7 +144,7 @@
* Returns the index for the new one given as as parameter.
* The first parameter is the new index.
*/
- virtual void setIndex(long index) { setToElement(index); }
+ virtual void setIndex(long index) { setToElement((int)index); }
virtual const char *getText() const;
virtual void setText(const char *ikey);
virtual void sort();
Modified: trunk/include/swbuf.h
===================================================================
--- trunk/include/swbuf.h 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/include/swbuf.h 2016-10-23 08:32:02 UTC (rev 3439)
@@ -402,7 +402,7 @@
*
* @return prefix if separator character found; otherwise, null and leaves buffer unmodified
*/
- inline const char *stripPrefix(char separator, bool endOfStringAsSeparator = false) { const char *m = strchr(buf, separator); if (!m && endOfStringAsSeparator) { if (*buf) { operator >>(1); *buf=0; end = buf; return buf + 1;} else return buf; } if (m) { int len = m-buf; char *hold = new char[len]; memcpy(hold, buf, len); *this << (len+1); memcpy(end+1, hold, len); delete [] hold; end[len+1] = 0; } return (m) ? end+1 : 0; } // safe. we know we don't actually realloc and shrink buffer when shifting, so we can place our return val at end.
+ inline const char *stripPrefix(char separator, bool endOfStringAsSeparator = false) { const char *m = strchr(buf, separator); if (!m && endOfStringAsSeparator) { if (*buf) { operator >>(1); *buf=0; end = buf; return buf + 1;} else return buf; } if (m) { int len = (int)(m-buf); char *hold = new char[len]; memcpy(hold, buf, len); *this << (len+1); memcpy(end+1, hold, len); delete [] hold; end[len+1] = 0; } return (m) ? end+1 : 0; } // safe. we know we don't actually realloc and shrink buffer when shifting, so we can place our return val at end.
// this could be nicer, like replacing a contiguous series of target bytes with single replacement; offering replacement const char *
/**
@@ -445,7 +445,7 @@
/**
* @return returns true if this buffer ends with the specified postfix
*/
- inline bool endsWith(const char *postfix) const { unsigned int psize = strlen(postfix); return (size() >= psize)?!strncmp(end-psize, postfix, psize):false; }
+ inline bool endsWith(const char *postfix) const { unsigned int psize = (int)strlen(postfix); return (size() >= psize)?!strncmp(end-psize, postfix, psize):false; }
// be sure we've been given a valid pointer to compare. If not, we return !=; specifically less-than, for lack of better options
inline int compare(const char *other) const { return (other?strcmp(c_str(), other):-1); }
Modified: trunk/src/keys/treekeyidx.cpp
===================================================================
--- trunk/src/keys/treekeyidx.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/keys/treekeyidx.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -106,7 +106,7 @@
delete currentNode.userData;
if (!size)
- size = strlen(userData) + 1;
+ size = (int)strlen(userData) + 1;
currentNode.userData = new char [ size ];
memcpy(currentNode.userData, userData, size);
@@ -204,7 +204,7 @@
while (lastSib.next > -1) {
getTreeNodeFromIdxOffset(lastSib.next, &lastSib);
}
- __u32 idxOffset = idxfd->seek(0, SEEK_END);
+ __u32 idxOffset = (__u32)idxfd->seek(0, SEEK_END);
lastSib.next = idxOffset;
saveTreeNodeOffsets(&lastSib);
__u32 parent = currentNode.parent;
@@ -221,7 +221,7 @@
append();
}
else {
- __u32 idxOffset = idxfd->seek(0, SEEK_END);
+ __u32 idxOffset = (__u32)idxfd->seek(0, SEEK_END);
currentNode.firstChild = idxOffset;
saveTreeNodeOffsets(¤tNode);
__u32 parent = currentNode.offset;
@@ -385,7 +385,7 @@
error = 77; // out of bounds but still position to 0;
}
- node->offset = ioffset;
+ node->offset = (__s32)ioffset;
if (idxfd > 0) {
if (idxfd->getFd() > 0) {
idxfd->seek(ioffset, SEEK_SET);
@@ -427,7 +427,7 @@
idxfd->seek(node->offset, SEEK_SET);
if (idxfd->read(&tmp, 4) != 4) {
datOffset = datfd->seek(0, SEEK_END);
- tmp = archtosword32(datOffset);
+ tmp = (__s32)archtosword32(datOffset);
idxfd->write(&tmp, 4);
}
else {
@@ -435,13 +435,13 @@
datfd->seek(datOffset, SEEK_SET);
}
- tmp = archtosword32(node->parent);
+ tmp = (__s32)archtosword32(node->parent);
datfd->write(&tmp, 4);
- tmp = archtosword32(node->next);
+ tmp = (__s32)archtosword32(node->next);
datfd->write(&tmp, 4);
- tmp = archtosword32(node->firstChild);
+ tmp = (__s32)archtosword32(node->firstChild);
datfd->write(&tmp, 4);
}
}
@@ -493,7 +493,7 @@
idxfd->seek(node->offset, SEEK_SET);
datOffset = datfd->seek(0, SEEK_END);
- tmp = archtosword32(datOffset);
+ tmp = (__s32)archtosword32(datOffset);
idxfd->write(&tmp, 4);
saveTreeNodeOffsets(node);
@@ -568,7 +568,7 @@
int TreeKeyIdx::_compare (const TreeKeyIdx & ikey) {
- return (getOffset() - ikey.getOffset());
+ return (int)(getOffset() - ikey.getOffset());
}
Modified: trunk/src/keys/versekey.cpp
===================================================================
--- trunk/src/keys/versekey.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/keys/versekey.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -418,14 +418,14 @@
if (!i) {
if (hasUTF8Support) { //we have support for UTF-8 handling; we expect UTF-8 encoded locales
- stringMgr->upperUTF8(abbr, strlen(abbr)*2);
+ stringMgr->upperUTF8(abbr, (unsigned int)(strlen(abbr)*2));
}
else {
stringMgr->upperLatin1(abbr);
}
}
- abLen = strlen(abbr);
+ abLen = (int)strlen(abbr);
if (abLen) {
min = 0;
@@ -483,7 +483,7 @@
StringMgr* stringMgr = StringMgr::getSystemStringMgr();
const bool hasUTF8Support = StringMgr::hasUTF8Support();
if (hasUTF8Support) { //we have support for UTF-8 handling; we expect UTF-8 encoded locales
- stringMgr->upperUTF8(abbr, strlen(abbr)*2);
+ stringMgr->upperUTF8(abbr, (unsigned int)(strlen(abbr)*2));
}
else {
stringMgr->upperLatin1(abbr);
@@ -644,7 +644,7 @@
tobook = 0;
bookno = -1;
if (*book) {
- loop = strlen(book) - 1;
+ loop = (int)strlen(book) - 1;
for (; loop+1; loop--) { if (book[loop] == ' ') book[loop] = 0; else break; }
@@ -667,7 +667,7 @@
break;
}
- for (loop = strlen(book) - 1; loop+1; loop--) {
+ for (loop = (int)strlen(book) - 1; loop+1; loop--) {
if (book[loop] == ' ') {
// "PS C" is ok, but "II C" is not ok
if (isroman(&book[loop+1]) && !isroman(book,loop)) {
@@ -682,14 +682,14 @@
}
// check for special inscriptio and subscriptio which are saved as book intro and chap 1 intro (for INTF)
- for (loop = strlen(book) - 1; loop+1; loop--) {
+ for (loop = (int)strlen(book) - 1; loop+1; loop--) {
if (book[loop] == ' ') {
- if (!strnicmp(&book[loop+1], "inscriptio", strlen(&book[loop+1]))) {
+ if (!strnicmp(&book[loop+1], "inscriptio", (int)strlen(&book[loop+1]))) {
book[loop] = 0;
verse = 0;
chap = 0;
}
- else if (!strnicmp(&book[loop+1], "subscriptio", strlen(&book[loop+1]))) {
+ else if (!strnicmp(&book[loop+1], "subscriptio", (int)strlen(&book[loop+1]))) {
book[loop] = 0;
verse = 0;
chap = 1;
@@ -915,7 +915,7 @@
book[tobook] = 0;
tobook = 0;
if (*book) {
- loop = strlen(book) - 1;
+ loop = (int)strlen(book) - 1;
// strip trailing spaces
for (; loop+1; loop--) { if (book[loop] == ' ') book[loop] = 0; else break; }
@@ -944,7 +944,7 @@
}
// check for roman numeral chapter
- for (loop = strlen(book) - 1; loop+1; loop--) {
+ for (loop = (int)strlen(book) - 1; loop+1; loop--) {
if (book[loop] == ' ') {
// "PS C" is ok, but "II C" is not ok
if (isroman(&book[loop+1]) && !isroman(book,loop)) {
@@ -958,19 +958,19 @@
}
}
// check for special inscriptio and subscriptio which are saved as book intro and chap 1 intro (for INTF)
- for (loop = strlen(book) - 1; loop+1; loop--) {
+ for (loop = (int)strlen(book) - 1; loop+1; loop--) {
if (book[loop] == ' ') {
- if (!strnicmp(&book[loop+1], "inscriptio", strlen(&book[loop+1]))) {
+ if (!strnicmp(&book[loop+1], "inscriptio", (int)strlen(&book[loop+1]))) {
book[loop] = 0;
verse = 0;
chap = 0;
suffix = 0;
}
- else if (!strnicmp(&book[loop+1], "subscriptio", strlen(&book[loop+1]))) {
+ else if (!strnicmp(&book[loop+1], "subscriptio", (int)strlen(&book[loop+1]))) {
book[loop] = 0;
verse = 0;
chap = 1;
- suffix = 0;
+ suffix = 0;
}
break;
}
@@ -1805,7 +1805,7 @@
keyval1 += (int)getSuffix();
keyval2 += (int)ivkey.getSuffix();
keyval1 = (keyval1 != keyval2) ? ((keyval1 > keyval2) ? 1 : -1) : 0; // -1 | 0 | 1
- return keyval1;
+ return (int)keyval1;
}
@@ -1884,7 +1884,7 @@
outRef += *startFrag;
startFrag++;
}
- memmove(frag, startFrag, ((const char *)element->userData - startFrag) + 1);
+ memmove(frag, startFrag, (size_t)((const char *)element->userData - startFrag) + 1);
frag[((const char *)element->userData - startFrag) + 1] = 0;
int j;
for (j = strlen(frag)-1; j && (strchr(" {}:;,()[].", frag[j])); j--);
Modified: trunk/src/mgr/curlftpt.cpp
===================================================================
--- trunk/src/mgr/curlftpt.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/mgr/curlftpt.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -63,12 +63,12 @@
return -1; /* failure, can't open file to write */
}
if (out->destBuf) {
- int s = out->destBuf->size();
+ int s = (int)out->destBuf->size();
out->destBuf->size(s+(size*nmemb));
memcpy(out->destBuf->getRawData()+s, buffer, size*nmemb);
- return nmemb;
+ return (int)nmemb;
}
- return fwrite(buffer, size, nmemb, out->stream);
+ return (int)fwrite(buffer, size, nmemb, out->stream);
}
Modified: trunk/src/mgr/curlhttpt.cpp
===================================================================
--- trunk/src/mgr/curlhttpt.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/mgr/curlhttpt.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -55,12 +55,12 @@
return -1; /* failure, can't open file to write */
}
if (out->destBuf) {
- int s = out->destBuf->size();
+ int s = (int)out->destBuf->size();
out->destBuf->size(s+(size*nmemb));
memcpy(out->destBuf->getRawData()+s, buffer, size*nmemb);
- return nmemb;
+ return (int)nmemb;
}
- return fwrite(buffer, size, nmemb, out->stream);
+ return (int)fwrite(buffer, size, nmemb, out->stream);
}
@@ -215,7 +215,7 @@
pBufRes = (char *)strchr(pBuf, '\"');//Find the end of the possible file name
if (!pBufRes)
break;
- possibleNameLength = pBufRes - pBuf;
+ possibleNameLength = (int)(pBufRes - pBuf);
possibleName.setFormatted("%.*s", possibleNameLength, pBuf);
if (isalnum(possibleName[0])) {
SWLog::getSystemLog()->logDebug("getDirListHTTP: Found a file: %s", possibleName.c_str());
Modified: trunk/src/mgr/filemgr.cpp
===================================================================
--- trunk/src/mgr/filemgr.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/mgr/filemgr.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -282,8 +282,8 @@
file->seek(0, SEEK_SET);
while (size > 0) {
- bytes = file->read(nibble, 32767);
- bytes = (bytes < size)?bytes:size;
+ bytes = (int)file->read(nibble, 32767);
+ bytes = (bytes < size)?bytes:(int)size;
if (write(fd, nibble, bytes) != bytes) { break; }
size -= bytes;
}
@@ -296,7 +296,7 @@
// copy tmp file back (dumb, but must preserve file permissions)
lseek(fd, 0, SEEK_SET);
do {
- bytes = read(fd, nibble, 32767);
+ bytes = (int)read(fd, nibble, 32767);
file->write(nibble, bytes);
} while (bytes == 32767);
}
@@ -316,7 +316,7 @@
signed char FileMgr::existsFile(const char *ipath, const char *ifileName)
{
- int len = strlen(ipath) + ((ifileName)?strlen(ifileName):0) + 3;
+ int len = (int)strlen(ipath) + ((ifileName)?strlen(ifileName):0) + 3;
char *ch;
char *path = new char [ len ];
strcpy(path, ipath);
@@ -337,7 +337,7 @@
signed char FileMgr::existsDir(const char *ipath, const char *idirName)
{
char *ch;
- int len = strlen(ipath) + ((idirName)?strlen(idirName):0) + 1;
+ int len = (int)strlen(ipath) + ((idirName)?strlen(idirName):0) + 1;
if (idirName)
len += strlen(idirName);
char *path = new char [ len ];
@@ -361,7 +361,7 @@
int retCode = 0;
strcpy(buf, pName);
- int end = strlen(buf) - 1;
+ int end = (int)strlen(buf) - 1;
while (end) {
if ((buf[end] == '/') || (buf[end] == '\\'))
break;
@@ -418,7 +418,7 @@
return -1;
do {
- len = read(sfd, buf, 4096);
+ len = (int)read(sfd, buf, 4096);
if (write(dfd, buf, len) != len) break;
}
while(len == 4096);
@@ -447,7 +447,7 @@
while (more) {
more = false;
long index = fDesc->seek(0, SEEK_CUR);
- len = fDesc->read(chunk, 254);
+ len = (int)fDesc->read(chunk, 254);
// assert we have a readable file (not a directory)
if (len < 1)
Modified: trunk/src/mgr/ftplibftpt.cpp
===================================================================
--- trunk/src/mgr/ftplibftpt.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/mgr/ftplibftpt.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -42,10 +42,10 @@
static int my_swbufwriter(netbuf *nControl, void *buffer, size_t size, void *swbuf) {
SWBuf &output = *(SWBuf *)swbuf;
- int s = output.size();
+ int s = (int)output.size();
output.size(s+size);
memcpy(output.getRawData()+s, buffer, size);
- return size;
+ return (int)size;
}
#if defined(__GNUC__)
Modified: trunk/src/mgr/installmgr.cpp
===================================================================
--- trunk/src/mgr/installmgr.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/mgr/installmgr.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -59,7 +59,7 @@
namespace {
static void removeTrailingSlash(SWBuf &buf) {
- int len = buf.size();
+ int len = (int)buf.size();
if ((buf[len-1] == '/')
|| (buf[len-1] == '\\'))
buf.size(len-1);
@@ -109,7 +109,7 @@
installConf = 0;
stdstr(&(this->privatePath), privatePath);
if (this->privatePath) {
- int len = strlen(this->privatePath);
+ int len = (int)strlen(this->privatePath);
if ((this->privatePath[len-1] == '/')
|| (this->privatePath[len-1] == '\\'))
this->privatePath[len-1] = 0;
Modified: trunk/src/mgr/localemgr.cpp
===================================================================
--- trunk/src/mgr/localemgr.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/mgr/localemgr.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -101,7 +101,7 @@
switch (configType) {
case 2:
int i;
- for (i = strlen(configPath)-1; ((i) && (configPath[i] != '/') && (configPath[i] != '\\')); i--);
+ for (i = (int)strlen(configPath)-1; ((i) && (configPath[i] != '/') && (configPath[i] != '\\')); i--);
configPath[i] = 0;
path = configPath;
path += "/";
Modified: trunk/src/mgr/remotetrans.cpp
===================================================================
--- trunk/src/mgr/remotetrans.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/mgr/remotetrans.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -102,7 +102,7 @@
break;
}
SWLog::getSystemLog()->logDebug("getDirList: parsing item %s(%d)\n", start, end-start);
- int status = ftpparse(&item, start, end - start);
+ int status = ftpparse(&item, start, (int)(end - start));
// in ftpparse.h, there is a warning that name is not necessarily null terminated
SWBuf name;
name.append(item.name, item.namelen);
Modified: trunk/src/mgr/stringmgr.cpp
===================================================================
--- trunk/src/mgr/stringmgr.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/mgr/stringmgr.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -248,7 +248,7 @@
char *ICUStringMgr::upperUTF8(char *buf, unsigned int maxlen) const {
char *ret = buf;
- int max = (maxlen) ? maxlen : strlen(buf);
+ int max = (int)((maxlen) ? maxlen : strlen(buf));
UErrorCode err = U_ZERO_ERROR;
Modified: trunk/src/mgr/swlocale.cpp
===================================================================
--- trunk/src/mgr/swlocale.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/mgr/swlocale.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -174,7 +174,7 @@
for (; it != end; it++) {
p->mergedAbbrevs[it->first.c_str()] = it->second.c_str();
}
- int size = p->mergedAbbrevs.size();
+ int size = (int)p->mergedAbbrevs.size();
bookAbbrevs = new struct abbrev[size + 1];
int i = 0;
for (LookupMap::iterator it = p->mergedAbbrevs.begin(); it != p->mergedAbbrevs.end(); it++, i++) {
Modified: trunk/src/mgr/swmgr.cpp
===================================================================
--- trunk/src/mgr/swmgr.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/mgr/swmgr.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -367,7 +367,7 @@
this->augmentHome = augmentHome;
path = iConfigPath;
- int len = path.length();
+ int len = (int)path.length();
if ((len < 1) || ((iConfigPath[len-1] != '\\') && (iConfigPath[len-1] != '/')))
path += "/";
if (FileMgr::existsFile(path.c_str(), "mods.conf")) {
@@ -1071,7 +1071,7 @@
if (pos == 1) {
SWBuf &dp = section["AbsoluteDataPath"];
- for (int i = dp.length() - 1; i; i--) {
+ for (int i = (int)dp.length() - 1; i; i--) {
if (dp[i] == '/') {
dp.setSize(i);
break;
Modified: trunk/src/mgr/versificationmgr.cpp
===================================================================
--- trunk/src/mgr/versificationmgr.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/mgr/versificationmgr.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -134,7 +134,7 @@
}
VersificationMgr::Book::Private &operator =(const VersificationMgr::Book::Private &other) {
verseMax.clear();
- int s = other.verseMax.size();
+ int s = (int)other.verseMax.size();
if (s) verseMax = other.verseMax;
offsetPrecomputed = other.offsetPrecomputed;
return *this;
@@ -208,7 +208,7 @@
p->books.push_back(Book(ot->name, ot->osis, ot->prefAbbrev, ot->chapmax));
offset++; // book heading
Book &b = p->books[p->books.size()-1];
- p->osisLookup[b.getOSISName()] = p->books.size();
+ p->osisLookup[b.getOSISName()] = (int)p->books.size();
for (int i = 0; i < ot->chapmax; i++) {
b.p->verseMax.push_back(chMax[chap]);
offset++; // chapter heading
@@ -226,7 +226,7 @@
p->books.push_back(Book(nt->name, nt->osis, nt->prefAbbrev, nt->chapmax));
offset++; // book heading
Book &b = p->books[p->books.size()-1];
- p->osisLookup[b.getOSISName()] = p->books.size();
+ p->osisLookup[b.getOSISName()] = (int)p->books.size();
for (int i = 0; i < nt->chapmax; i++) {
b.p->verseMax.push_back(chMax[chap]);
offset++; // chapter heading
@@ -292,7 +292,7 @@
int VersificationMgr::System::getBookCount() const {
- return (p ? p->books.size() : 0);
+ return (int)(p ? p->books.size() : 0);
}
@@ -445,7 +445,7 @@
for (int i=0; i<(int)dstSys->p->mappingsExtraBooks.size(); ++i) {
SWLog::getSystemLog()->logDebug("\t%s %s.\n", *book, dstSys->p->mappingsExtraBooks[i]);
if (!strcmp(*book, dstSys->p->mappingsExtraBooks[i])) {
- b = p->books.size()+i-2;
+ b = (int)p->books.size()+i-2;
break;
}
}
@@ -529,7 +529,7 @@
if (b >= (int)p->mappings.size())
return;
// forward mapping should use reversed search for item
- for (int i=p->mappings[b].size()-1; i>=0; --i) {
+ for (int i = (int)p->mappings[b].size()-1; i>=0; --i) {
const unsigned char *m = p->mappings[b][i];
if (m[1] < *chapter) {
SWLog::getSystemLog()->logWarning("There is no mapping for this chapter.\n");
Modified: trunk/src/modules/comments/rawcom4/rawcom4.cpp
===================================================================
--- trunk/src/modules/comments/rawcom4/rawcom4.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/modules/comments/rawcom4/rawcom4.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -72,7 +72,7 @@
VerseKey *key = &getVerseKey();
findOffset(key->getTestament(), key->getTestamentIndex(), &start, &size);
- entrySize = size; // support getEntrySize call
+ entrySize = (int)size; // support getEntrySize call
entryBuf = "";
readText(key->getTestament(), start, size, entryBuf);
Modified: trunk/src/modules/common/bz2comprs.cpp
===================================================================
--- trunk/src/modules/common/bz2comprs.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/modules/common/bz2comprs.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -83,7 +83,7 @@
if (len)
{
//printf("Doing compress\n");
- if (BZ2_bzBuffToBuffCompress(zbuf, (unsigned int*)&zlen, buf, len, level, 0, 0) != BZ_OK)
+ if (BZ2_bzBuffToBuffCompress(zbuf, (unsigned int*)&zlen, buf, (unsigned int)len, level, 0, 0) != BZ_OK)
{
printf("ERROR in compression\n");
}
@@ -118,7 +118,7 @@
char *chunkbuf = zbuf;
int chunklen;
unsigned long zlen = 0;
- while((chunklen = GetChars(chunk, 1023))) {
+ while((chunklen = (int)GetChars(chunk, 1023))) {
memcpy(chunkbuf, chunk, chunklen);
zlen += chunklen;
if (chunklen < 1023)
@@ -129,11 +129,11 @@
//printf("Decoding complength{%ld} uncomp{%ld}\n", zlen, blen);
if (zlen) {
- unsigned int blen = zlen*20; // trust compression is less than 1000%
+ unsigned int blen = (unsigned int)(zlen*20); // trust compression is less than 1000%
char *buf = new char[blen];
//printf("Doing decompress {%s}\n", zbuf);
slen = 0;
- switch (BZ2_bzBuffToBuffDecompress(buf, &blen, zbuf, zlen, 0, 0)){
+ switch (BZ2_bzBuffToBuffDecompress(buf, &blen, zbuf, (unsigned int)zlen, 0, 0)){
case BZ_OK: SendChars(buf, blen); slen = blen; break;
case BZ_MEM_ERROR: fprintf(stderr, "ERROR: not enough memory during decompression.\n"); break;
case BZ_OUTBUFF_FULL: fprintf(stderr, "ERROR: not enough room in the out buffer during decompression.\n"); break;
Modified: trunk/src/modules/common/entriesblk.cpp
===================================================================
--- trunk/src/modules/common/entriesblk.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/modules/common/entriesblk.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -84,8 +84,8 @@
void EntriesBlock::setMetaEntry(int index, unsigned long offset, unsigned long size) {
- __u32 rawOffset = archtosword32(offset);
- __u32 rawSize = archtosword32(size);
+ __u32 rawOffset = (__u32)archtosword32(offset);
+ __u32 rawSize = (__u32)archtosword32(size);
if (index >= getCount()) // assert index < count
return;
Modified: trunk/src/modules/common/rawstr.cpp
===================================================================
--- trunk/src/modules/common/rawstr.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/modules/common/rawstr.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -183,9 +183,9 @@
headoff = 0;
stdstr(&key, ikey, 3);
- if (!caseSensitive) toupperstr_utf8(key, strlen(key)*3);
+ if (!caseSensitive) toupperstr_utf8(key, (unsigned int)(strlen(key)*3));
- int keylen = strlen(key);
+ int keylen = (int)strlen(key);
bool substr = false;
trybuf = maxbuf = 0;
@@ -243,7 +243,7 @@
idxfd->read(&tmpStart, 4);
idxfd->read(&tmpSize, 2);
if (idxoff)
- *idxoff = tryoff;
+ *idxoff = (__u32)tryoff;
*start = swordtoarch32(tmpStart);
*size = swordtoarch16(tmpSize);
@@ -262,17 +262,17 @@
if (bad) {
if(!awayFromSubstrCheck)
retval = -1;
- *start = laststart;
+ *start = (__u32)laststart;
*size = lastsize;
tryoff = lasttry;
if (idxoff)
- *idxoff = tryoff;
+ *idxoff = (__u32)tryoff;
break;
}
idxfd->read(&tmpStart, 4);
idxfd->read(&tmpSize, 2);
if (idxoff)
- *idxoff = tryoff;
+ *idxoff = (__u32)tryoff;
*start = swordtoarch32(tmpStart);
*size = swordtoarch16(tmpSize);
@@ -346,7 +346,7 @@
while (true); // while we're resolving links
if (idxbuflocal) {
- int localsize = strlen(idxbuflocal);
+ int localsize = (int)strlen(idxbuflocal);
localsize = (localsize < (*isize - 1)) ? localsize : (*isize - 1);
strncpy(*idxbuf, idxbuflocal, localsize);
(*idxbuf)[localsize] = 0;
@@ -381,7 +381,7 @@
char errorStatus = findOffset(ikey, &start, &size, 0, &idxoff);
stdstr(&key, ikey, 2);
- if (!caseSensitive) toupperstr_utf8(key, strlen(key)*2);
+ if (!caseSensitive) toupperstr_utf8(key, (unsigned int)(strlen(key)*2));
len = (len < 0) ? strlen(buf) : len;
@@ -424,7 +424,7 @@
while (true); // while we're resolving links
}
- endoff = idxfd->seek(0, SEEK_END);
+ endoff = (__u32)idxfd->seek(0, SEEK_END);
shiftSize = endoff - idxoff;
@@ -440,7 +440,7 @@
memcpy(outbuf + size, buf, len);
size = outsize = size + (len);
- start = outstart = datfd->seek(0, SEEK_END);
+ start = outstart = (__u32)datfd->seek(0, SEEK_END);
outstart = archtosword32(start);
outsize = archtosword16(size);
Modified: trunk/src/modules/common/rawstr4.cpp
===================================================================
--- trunk/src/modules/common/rawstr4.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/modules/common/rawstr4.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -193,9 +193,9 @@
headoff = 0;
stdstr(&key, ikey, 3);
- if (!caseSensitive) toupperstr_utf8(key, strlen(key)*3);
+ if (!caseSensitive) toupperstr_utf8(key, (unsigned int)(strlen(key)*3));
- int keylen = strlen(key);
+ int keylen = (int)strlen(key);
bool substr = false;
trybuf = maxbuf = 0;
@@ -252,7 +252,7 @@
idxfd->read(&tmpStart, 4);
idxfd->read(&tmpSize, 4);
if (idxoff)
- *idxoff = tryoff;
+ *idxoff = (__u32)tryoff;
*start = swordtoarch32(tmpStart);
*size = swordtoarch32(tmpSize);
@@ -271,17 +271,17 @@
if (bad) {
if(!awayFromSubstrCheck)
retval = -1;
- *start = laststart;
- *size = lastsize;
+ *start = (__u32)laststart;
+ *size = (__u32)lastsize;
tryoff = lasttry;
if (idxoff)
- *idxoff = tryoff;
+ *idxoff = (__u32)tryoff;
break;
}
idxfd->read(&tmpStart, 4);
idxfd->read(&tmpSize, 4);
if (idxoff)
- *idxoff = tryoff;
+ *idxoff = (__u32)tryoff;
*start = swordtoarch32(tmpStart);
*size = swordtoarch32(tmpSize);
@@ -355,7 +355,7 @@
while (true); // while we're resolving links
if (idxbuflocal) {
- unsigned int localsize = strlen(idxbuflocal);
+ unsigned int localsize = (unsigned int)strlen(idxbuflocal);
localsize = (localsize < (*isize - 1)) ? localsize : (*isize - 1);
strncpy(*idxbuf, idxbuflocal, localsize);
(*idxbuf)[localsize] = 0;
@@ -389,7 +389,7 @@
char errorStatus = findOffset(ikey, &start, &size, 0, &idxoff);
stdstr(&key, ikey, 3);
- if (!caseSensitive) toupperstr_utf8(key, strlen(key)*3);
+ if (!caseSensitive) toupperstr_utf8(key, (unsigned int)(strlen(key)*3));
len = (len < 0) ? strlen(buf) : len;
getIDXBufDat(start, &dbKey);
@@ -432,7 +432,7 @@
while (true); // while we're resolving links
}
- endoff = idxfd->seek(0, SEEK_END);
+ endoff = (__u32)idxfd->seek(0, SEEK_END);
shiftSize = endoff - idxoff;
@@ -446,9 +446,9 @@
sprintf(outbuf, "%s%c%c", key, 13, 10);
size = strlen(outbuf);
memcpy(outbuf + size, buf, len);
- size = outsize = size + len;
+ size = outsize = size + (__u32)len;
- start = outstart = datfd->seek(0, SEEK_END);
+ start = outstart = (__u32)datfd->seek(0, SEEK_END);
outstart = archtosword32(start);
outsize = archtosword32(size);
Modified: trunk/src/modules/common/rawverse.cpp
===================================================================
--- trunk/src/modules/common/rawverse.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/modules/common/rawverse.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -186,7 +186,7 @@
size = (len < 0) ? strlen(buf) : len;
- start = textfp[testmt-1]->seek(0, SEEK_END);
+ start = (__s32)textfp[testmt-1]->seek(0, SEEK_END);
idxfp[testmt-1]->seek(idxoff, SEEK_SET);
if (size) {
Modified: trunk/src/modules/common/rawverse4.cpp
===================================================================
--- trunk/src/modules/common/rawverse4.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/modules/common/rawverse4.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -185,9 +185,9 @@
if (!testmt)
testmt = ((idxfp[1]) ? 1:2);
- size = (len < 0) ? strlen(buf) : len;
+ size = (__u32)((len < 0) ? strlen(buf) : len);
- start = textfp[testmt-1]->seek(0, SEEK_END);
+ start = (__u32)textfp[testmt-1]->seek(0, SEEK_END);
idxfp[testmt-1]->seek(idxoff, SEEK_SET);
if (size) {
Modified: trunk/src/modules/common/zipcomprs.cpp
===================================================================
--- trunk/src/modules/common/zipcomprs.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/modules/common/zipcomprs.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -153,7 +153,7 @@
char *chunkbuf = zbuf;
int chunklen;
unsigned long zlen = 0;
- while((chunklen = GetChars(chunk, 1023))) {
+ while((chunklen = (int)GetChars(chunk, 1023))) {
memcpy(chunkbuf, chunk, chunklen);
zlen += chunklen;
if (chunklen < 1023)
Modified: trunk/src/modules/common/zstr.cpp
===================================================================
--- trunk/src/modules/common/zstr.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/modules/common/zstr.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -198,19 +198,19 @@
bool awayFromSubstrCheck = false;
if (idxfd->getFd() >= 0) {
- tailoff = maxoff = idxfd->seek(0, SEEK_END) - IDXENTRYSIZE;
+ tailoff = maxoff = (__s32)idxfd->seek(0, SEEK_END) - IDXENTRYSIZE;
if (*ikey) {
headoff = 0;
stdstr(&key, ikey, 3);
- if (!caseSensitive) toupperstr_utf8(key, strlen(key)*3);
+ if (!caseSensitive) toupperstr_utf8(key, (unsigned int)(strlen(key)*3));
- int keylen = strlen(key);
+ int keylen = (int)strlen(key);
bool substr = false;
getKeyFromIdxOffset(maxoff, &maxbuf);
while (headoff < tailoff) {
- tryoff = (lastoff == -1) ? headoff + (((((tailoff / IDXENTRYSIZE) - (headoff / IDXENTRYSIZE))) / 2) * IDXENTRYSIZE) : lastoff;
+ tryoff = ((__s32)lastoff == -1) ? headoff + (((((tailoff / IDXENTRYSIZE) - (headoff / IDXENTRYSIZE))) / 2) * IDXENTRYSIZE) : (__s32)lastoff;
lastoff = -1;
getKeyFromIdxOffset(tryoff, &trybuf);
@@ -366,7 +366,7 @@
while (true); // while we're resolving links
if (idxbuflocal) {
- __u32 localsize = strlen(idxbuflocal);
+ __u32 localsize = (__u32)strlen(idxbuflocal);
localsize = (localsize < (size - 1)) ? localsize : (size - 1);
strncpy(*idxbuf, idxbuflocal, localsize);
(*idxbuf)[localsize] = 0;
@@ -416,7 +416,7 @@
cacheBlock = new EntriesBlock(rawBuf, len);
cacheBlockIndex = block;
}
- size = cacheBlock->getEntrySize(entry);
+ size = (__u32)cacheBlock->getEntrySize(entry);
*buf = (*buf) ? (char *)realloc(*buf, size*2 + 1) : (char *)malloc(size*2 + 1);
strcpy(*buf, cacheBlock->getEntry(entry));
}
@@ -448,7 +448,7 @@
len = (len < 0) ? strlen(buf) : len;
stdstr(&key, ikey, 3);
- if (!caseSensitive) toupperstr_utf8(key, strlen(key)*3);
+ if (!caseSensitive) toupperstr_utf8(key, (unsigned int)(strlen(key)*3));
char notFound = findKeyIndex(ikey, &idxoff, 0);
if (!notFound) {
@@ -497,9 +497,9 @@
}
}
- endoff = idxfd->seek(0, SEEK_END);
+ endoff = (__s32)idxfd->seek(0, SEEK_END);
- shiftSize = endoff - idxoff;
+ shiftSize = endoff - (__s32)idxoff;
if (shiftSize > 0) {
idxBytes = new char [ shiftSize ];
@@ -509,7 +509,7 @@
outbuf = new char [ len + strlen(key) + 5 ];
sprintf(outbuf, "%s%c%c", key, 13, 10);
- size = strlen(outbuf);
+ size = (__u32)strlen(outbuf);
if (len > 0) { // NOT a link
if (!cacheBlock) {
flushCache();
@@ -523,7 +523,7 @@
}
__u32 entry = cacheBlock->addEntry(buf);
cacheDirty = true;
- outstart = archtosword32(cacheBlockIndex);
+ outstart = (__u32)archtosword32(cacheBlockIndex);
outsize = archtosword32(entry);
memcpy (outbuf + size, &outstart, sizeof(__u32));
memcpy (outbuf + size + sizeof(__u32), &outsize, sizeof(__u32));
@@ -534,7 +534,7 @@
size += len;
}
- start = datfd->seek(0, SEEK_END);
+ start = (__u32)datfd->seek(0, SEEK_END);
outstart = archtosword32(start);
outsize = archtosword32(size);
@@ -609,7 +609,7 @@
unsigned long zdtSize = zdtfd->seek(0, SEEK_END);
if ((cacheBlockIndex * ZDXENTRYSIZE) > (zdxSize - ZDXENTRYSIZE)) { // New Block
- start = zdtSize;
+ start = (__u32)zdtSize;
}
else {
zdxfd->seek(cacheBlockIndex * ZDXENTRYSIZE, SEEK_SET);
@@ -624,7 +624,7 @@
size = outsize;
}
else { // middle and bigger-- we have serious problems, for now let's put it at the end = lots of wasted space
- start = zdtSize;
+ start = (__u32)zdtSize;
}
}
Modified: trunk/src/modules/common/zverse.cpp
===================================================================
--- trunk/src/modules/common/zverse.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/modules/common/zverse.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -272,7 +272,7 @@
compressor->Buf(0, &len);
cacheBuf = (char *)calloc(len + 1, 1);
memcpy(cacheBuf, compressor->Buf(), len);
- cacheBufSize = strlen(cacheBuf); // TODO: can we just use len?
+ cacheBufSize = (int)strlen(cacheBuf); // TODO: can we just use len?
cacheTestament = testmt;
cacheBufIdx = ulBuffNum;
}
@@ -314,12 +314,12 @@
__u32 start;
__u16 size;
- __u32 outBufIdx = cacheBufIdx;
+ __u32 outBufIdx = (__u32)cacheBufIdx;
idxoff *= 10;
size = len;
- start = strlen(cacheBuf);
+ start = (__u32)strlen(cacheBuf);
if (!size)
start = outBufIdx = 0;
@@ -343,9 +343,9 @@
__u32 size, outsize;
__u32 zsize, outzsize;
- idxoff = cacheBufIdx * 12;
+ idxoff = (__u32)cacheBufIdx * 12;
if (cacheBuf) {
- size = outsize = zsize = outzsize = strlen(cacheBuf);
+ size = outsize = zsize = outzsize = (__u32)strlen(cacheBuf);
if (size) {
// if (compressor) {
// delete compressor;
@@ -354,16 +354,16 @@
compressor->Buf(cacheBuf);
unsigned long tmpSize;
compressor->zBuf(&tmpSize);
- outzsize = zsize = tmpSize;
+ outzsize = zsize = (__u32)tmpSize;
SWBuf buf;
buf.setSize(zsize + 5);
memcpy(buf.getRawData(), compressor->zBuf(&tmpSize), tmpSize);
- outzsize = zsize = tmpSize;
+ outzsize = zsize = (__u32)tmpSize;
buf.setSize(zsize);
rawZFilter(buf, 1); // 1 = encipher
- start = outstart = textfp[cacheTestament-1]->seek(0, SEEK_END);
+ start = outstart = (__u32)textfp[cacheTestament-1]->seek(0, SEEK_END);
outstart = archtosword32(start);
outsize = archtosword32(size);
Modified: trunk/src/modules/common/zverse4.cpp
===================================================================
--- trunk/src/modules/common/zverse4.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/modules/common/zverse4.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -270,7 +270,7 @@
compressor->Buf(0, &len);
cacheBuf = (char *)calloc(len + 1, 1);
memcpy(cacheBuf, compressor->Buf(), len);
- cacheBufSize = strlen(cacheBuf); // TODO: can we just use len?
+ cacheBufSize = (int)strlen(cacheBuf); // TODO: can we just use len?
cacheTestament = testmt;
cacheBufIdx = ulBuffNum;
}
@@ -312,12 +312,12 @@
__u32 start;
__u32 size;
- __u32 outBufIdx = cacheBufIdx;
+ __u32 outBufIdx = (__u32)cacheBufIdx;
idxoff *= 12;
- size = len;
+ size = (__u32)len;
- start = strlen(cacheBuf);
+ start = (__u32)strlen(cacheBuf);
if (!size)
start = outBufIdx = 0;
@@ -341,23 +341,23 @@
__u32 size, outsize;
__u32 zsize, outzsize;
- idxoff = cacheBufIdx * 12;
+ idxoff = (__u32)cacheBufIdx * 12;
if (cacheBuf) {
- size = outsize = zsize = outzsize = strlen(cacheBuf);
+ size = outsize = zsize = outzsize = (__u32)strlen(cacheBuf);
if (size) {
compressor->Buf(cacheBuf);
unsigned long tmpSize;
compressor->zBuf(&tmpSize);
- outzsize = zsize = tmpSize;
+ outzsize = zsize = (__u32)tmpSize;
SWBuf buf;
buf.setSize(zsize + 5);
memcpy(buf.getRawData(), compressor->zBuf(&tmpSize), tmpSize);
- outzsize = zsize = tmpSize;
+ outzsize = zsize = (__u32)tmpSize;
buf.setSize(zsize);
rawZFilter(buf, 1); // 1 = encipher
- start = outstart = textfp[cacheTestament-1]->seek(0, SEEK_END);
+ start = outstart = (__u32)textfp[cacheTestament-1]->seek(0, SEEK_END);
outstart = archtosword32(start);
outsize = archtosword32(size);
Modified: trunk/src/modules/filters/gbfstrongs.cpp
===================================================================
--- trunk/src/modules/filters/gbfstrongs.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/modules/filters/gbfstrongs.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -75,7 +75,7 @@
token[0] = 0;
token[1] = 0;
token[2] = 0;
- textEnd = text.size();
+ textEnd = (unsigned int)text.size();
continue;
}
if (*from == '>') { // process tokens
@@ -110,7 +110,7 @@
if (lastspace)
text--;
}
- if (newText) {textStart = text.size(); newText = false; }
+ if (newText) {textStart = (unsigned int)text.size(); newText = false; }
continue;
}
}
@@ -130,7 +130,7 @@
text += '<';
text += token;
text += '>';
- if (newText) {textStart = text.size(); newText = false; }
+ if (newText) {textStart = (unsigned int)text.size(); newText = false; }
continue;
}
if (intoken) {
Modified: trunk/src/modules/filters/gbfwordjs.cpp
===================================================================
--- trunk/src/modules/filters/gbfwordjs.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/modules/filters/gbfwordjs.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -88,7 +88,7 @@
token[0] = 0;
token[1] = 0;
token[2] = 0;
- textEnd = text.length();
+ textEnd = (unsigned int)text.length();
continue;
}
if (*from == '>') { // process tokens
@@ -212,13 +212,13 @@
else m = morph.c_str();
spanStart.appendFormatted("<span class=\"clk\" onclick=\"p('%s','%s','%s','%s','','%s');\" >", lexName.c_str(), strong.c_str(), wordID.c_str(), m, modName.c_str());
text.insert(textStr, spanStart);
- lastAppendLen = spanStart.length();
+ lastAppendLen = (unsigned int)spanStart.length();
}
}
}
if (newText) {
- textStart = text.length(); newText = false;
+ textStart = (unsigned int)text.length(); newText = false;
}
continue;
}
Modified: trunk/src/modules/filters/osishtmlhref.cpp
===================================================================
--- trunk/src/modules/filters/osishtmlhref.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/modules/filters/osishtmlhref.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -322,7 +322,7 @@
// Compensate for starting :
ref = the_ref + 1;
- int size = target.size() - ref.size() - 1;
+ int size = (int)(target.size() - ref.size() - 1);
work.setSize(size);
strncpy(work.getRawData(), target, size);
@@ -460,7 +460,7 @@
const unsigned char *tmpBuf = (const unsigned char *)lastText.c_str();
getUniCharFromUTF8(&tmpBuf);
- int char_length = (tmpBuf - (const unsigned char *)lastText.c_str());
+ int char_length = (int)(tmpBuf - (const unsigned char *)lastText.c_str());
scratch.setFormatted("%.*s<font size=\"-1\">%s</font>",
char_length,
lastText.c_str(),
Modified: trunk/src/modules/filters/osislatex.cpp
===================================================================
--- trunk/src/modules/filters/osislatex.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/modules/filters/osislatex.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -388,7 +388,7 @@
// Compensate for starting :
ref = the_ref + 1;
- int size = target.size() - ref.size() - 1;
+ int size = (int)(target.size() - ref.size() - 1);
work.setSize(size);
strncpy(work.getRawData(), target, size);
Modified: trunk/src/modules/filters/osisstrongs.cpp
===================================================================
--- trunk/src/modules/filters/osisstrongs.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/modules/filters/osisstrongs.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -117,7 +117,7 @@
const char *m = strchr(attrib, ':');
if (m) {
- int len = m-attrib;
+ int len = (int)(m-attrib);
mClass.append(attrib, len);
attrib += (len+1);
}
@@ -150,7 +150,7 @@
const char *m = strchr(attrib, ':');
if (m) {
- int len = m-attrib;
+ int len = (int)(m-attrib);
lClass.append(attrib, len);
attrib += (len+1);
}
@@ -217,7 +217,7 @@
if (wtag.isEmpty()) {
int j;
- for (j = token.length()-1; ((j>0) && (strchr(" /", token[j]))); j--);
+ for (j = (int)token.length()-1; ((j>0) && (strchr(" /", token[j]))); j--);
token.size(j+1);
}
Modified: trunk/src/modules/filters/teihtmlhref.cpp
===================================================================
--- trunk/src/modules/filters/teihtmlhref.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/modules/filters/teihtmlhref.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -221,7 +221,7 @@
// Compensate for starting :
ref = the_ref + 1;
- int size = target.size() - ref.size() - 1;
+ int size = (int)(target.size() - ref.size() - 1);
work.setSize(size);
strncpy(work.getRawData(), target, size);
}
Modified: trunk/src/modules/filters/thmlstrongs.cpp
===================================================================
--- trunk/src/modules/filters/thmlstrongs.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/modules/filters/thmlstrongs.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -77,7 +77,7 @@
token[0] = 0;
token[1] = 0;
token[2] = 0;
- textEnd = text.length();
+ textEnd = (unsigned int)text.length();
continue;
}
if (*from == '>') { // process tokens
@@ -116,7 +116,7 @@
if (lastspace)
text--;
}
- if (newText) {textStart = text.length(); newText = false; }
+ if (newText) {textStart = (unsigned int)text.length(); newText = false; }
continue;
}
}
@@ -150,7 +150,7 @@
text += '<';
text += token;
text += '>';
- if (newText) {textStart = text.length(); newText = false; }
+ if (newText) {textStart = (unsigned int)text.length(); newText = false; }
continue;
}
if (intoken) {
Modified: trunk/src/modules/filters/thmlwordjs.cpp
===================================================================
--- trunk/src/modules/filters/thmlwordjs.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/modules/filters/thmlwordjs.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -91,7 +91,7 @@
token[0] = 0;
token[1] = 0;
token[2] = 0;
- textEnd = text.length();
+ textEnd = (unsigned int)text.length();
continue;
}
if (*from == '>') { // process tokens
@@ -226,13 +226,13 @@
else m = morph.c_str();
spanStart.appendFormatted("<span class=\"clk\" onclick=\"p('%s','%s','%s','%s','','%s');\" >", lexName.c_str(), strong.c_str(), wordID.c_str(), m, modName.c_str());
text.insert(textStr, spanStart);
- lastAppendLen = spanStart.length();
+ lastAppendLen = (unsigned int)spanStart.length();
}
}
}
if (newText) {
- textStart = text.length(); newText = false;
+ textStart = (unsigned int)text.length(); newText = false;
}
continue;
}
Modified: trunk/src/modules/filters/utf8arabicpoints.cpp
===================================================================
--- trunk/src/modules/filters/utf8arabicpoints.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/modules/filters/utf8arabicpoints.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -163,7 +163,7 @@
// "start_of_input" is either mark_pos or any text between the
// end of any previous mark and the current mark_pos.
// This text is now ready to be moved into the output.
- int ready_size = mark_pos - start_of_input;
+ int ready_size = (int)(mark_pos - start_of_input);
if (ready_size > 0) {
// Append the input text before the current mark to the
// output.
Modified: trunk/src/modules/genbook/rawgenbook/rawgenbook.cpp
===================================================================
--- trunk/src/modules/genbook/rawgenbook/rawgenbook.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/modules/genbook/rawgenbook/rawgenbook.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -133,7 +133,7 @@
void RawGenBook::setEntry(const char *inbuf, long len) {
- __u32 offset = archtosword32(bdtfd->seek(0, SEEK_END));
+ __u32 offset = (__u32)archtosword32(bdtfd->seek(0, SEEK_END));
__u32 size = 0;
TreeKeyIdx *key = ((TreeKeyIdx *)&(getTreeKey()));
@@ -144,7 +144,7 @@
bdtfd->write(inbuf, len);
- size = archtosword32(len);
+ size = (__u32)archtosword32(len);
memcpy(userData, &offset, 4);
memcpy(userData+4, &size, 4);
key->setUserData(userData, 8);
Modified: trunk/src/modules/lexdict/swld.cpp
===================================================================
--- trunk/src/modules/lexdict/swld.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/modules/lexdict/swld.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -125,7 +125,7 @@
{
char *check;
int size = 0;
- int len = strlen(buf);
+ int len = (int)strlen(buf);
char subLet = 0;
bool bang = false, prefix=false;
if ((len < 9) && (len > 0)) {
Modified: trunk/src/modules/lexdict/zld/zld.cpp
===================================================================
--- trunk/src/modules/lexdict/zld/zld.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/modules/lexdict/zld/zld.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -90,7 +90,7 @@
rawFilter(entryBuf, key);
- entrySize = size; // support getEntrySize call
+ entrySize = (int)size; // support getEntrySize call
if (!key->isPersist()) // If we have our own key
*key = idxbuf; // reset it to entry index buffer
Modified: trunk/src/modules/texts/rawtext4/rawtext4.cpp
===================================================================
--- trunk/src/modules/texts/rawtext4/rawtext4.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/modules/texts/rawtext4/rawtext4.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -75,7 +75,7 @@
VerseKey &key = getVerseKey();
findOffset(key.getTestament(), key.getTestamentIndex(), &start, &size);
- entrySize = size; // support getEntrySize call
+ entrySize = (int)size; // support getEntrySize call
entryBuf = "";
readText(key.getTestament(), start, size, entryBuf);
Modified: trunk/src/modules/texts/ztext4/ztext4.cpp
===================================================================
--- trunk/src/modules/texts/ztext4/ztext4.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/modules/texts/ztext4/ztext4.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -80,7 +80,7 @@
VerseKey &key = getVerseKey();
findOffset(key.getTestament(), key.getTestamentIndex(), &start, &size, &buffnum);
- entrySize = size; // support getEntrySize call
+ entrySize = (int)size; // support getEntrySize call
entryBuf = "";
Modified: trunk/src/utilfuns/ftplib.c
===================================================================
--- trunk/src/utilfuns/ftplib.c 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/utilfuns/ftplib.c 2016-10-23 08:32:02 UTC (rev 3439)
@@ -249,7 +249,7 @@
x = (max >= ctl->cavail) ? ctl->cavail : max-1;
end = mymemccpy(bp,ctl->cget,'\n',x);
if (end != NULL) {
- x = end - bp;
+ x = (int)(end - bp);
}
retval += x;
bp += x;
@@ -288,7 +288,7 @@
}
if (!socket_wait(ctl))
return retval;
- if ((x = net_read(ctl->handle,ctl->cput,ctl->cleft)) == -1)
+ if ((x = (int)net_read(ctl->handle,ctl->cput,ctl->cleft)) == -1)
{
perror("read");
retval = -1;
@@ -326,7 +326,7 @@
{
if (!socket_wait(nData))
return x;
- w = net_write(nData->handle, nbp, FTPLIB_BUFSIZ);
+ w = (int)net_write(nData->handle, nbp, FTPLIB_BUFSIZ);
if (w != FTPLIB_BUFSIZ)
{
if (ftplib_debug > 1)
@@ -341,7 +341,7 @@
{
if (!socket_wait(nData))
return x;
- w = net_write(nData->handle, nbp, FTPLIB_BUFSIZ);
+ w = (int)net_write(nData->handle, nbp, FTPLIB_BUFSIZ);
if (w != FTPLIB_BUFSIZ)
{
if (ftplib_debug > 1)
@@ -356,7 +356,7 @@
{
if (!socket_wait(nData))
return x;
- w = net_write(nData->handle, nbp, nb);
+ w = (int)net_write(nData->handle, nbp, nb);
if (w != nb)
{
if (ftplib_debug > 1)
@@ -951,7 +951,7 @@
}
if (path != NULL)
{
- int i = strlen(buf);
+ int i = (int)strlen(buf);
buf[i++] = ' ';
if ((strlen(path) + i) >= sizeof(buf))
return 0;
@@ -995,7 +995,7 @@
i = socket_wait(nData);
if (i != 1)
return 0;
- i = net_read(nData->handle, buf, max);
+ i = (int)net_read(nData->handle, buf, max);
}
if (i == -1)
return 0;
@@ -1026,7 +1026,7 @@
else
{
socket_wait(nData);
- i = net_write(nData->handle, buf, len);
+ i = (int)net_write(nData->handle, buf, len);
}
if (i == -1)
return 0;
@@ -1243,7 +1243,7 @@
dbuf = malloc(FTPLIB_BUFSIZ);
if (typ == FTPLIB_FILE_WRITE)
{
- while ((l = fread(dbuf, 1, FTPLIB_BUFSIZ, local)) > 0)
+ while ((l = (int)fread(dbuf, 1, FTPLIB_BUFSIZ, local)) > 0)
if ((c = FtpWrite(dbuf, l, nData)) < l)
{
if (ftplib_debug > 1)
@@ -1255,7 +1255,7 @@
else
{
while ((l = FtpRead(dbuf, FTPLIB_BUFSIZ, nData)) > 0) {
- writeResult = (nData->writercb) ? nData->writercb(nData, dbuf, l, nData->writerarg) : fwrite(dbuf, 1, l, local);
+ writeResult = (int)((nData->writercb) ? nData->writercb(nData, dbuf, l, nData->writerarg) : fwrite(dbuf, 1, l, local));
if (writeResult <= 0)
{
perror("localstore write");
Modified: trunk/src/utilfuns/roman.cpp
===================================================================
--- trunk/src/utilfuns/roman.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/utilfuns/roman.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -37,7 +37,7 @@
}
int from_rom(const char* str) {
- int i, n = strlen(str);
+ int i, n = (int)strlen(str);
short * num= (short *) calloc(n, sizeof(short));
for (i = 0; str[i]; i++) {
switch(str[i]) {
Modified: trunk/src/utilfuns/swbuf.cpp
===================================================================
--- trunk/src/utilfuns/swbuf.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/utilfuns/swbuf.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -151,7 +151,7 @@
// return;
str += start;
- int len = (max > -1) ? max : strlen(str);
+ int len = (int)((max > -1) ? max : strlen(str));
if (!len || (pos > length())) //nothing to do, return
return;
Modified: trunk/src/utilfuns/url.cpp
===================================================================
--- trunk/src/utilfuns/url.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/utilfuns/url.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -233,8 +233,8 @@
url = urlText;
SWBuf buf;
- const int length = url.length();
- for (int i = 0; i < length; i++) { //fill "buf"
+ const long length = url.length();
+ for (long i = 0; i < length; i++) { //fill "buf"
const char& c = url[i];
buf.append( ((m[c].length()) ? m[c] : SWBuf(c)) );
}
@@ -249,7 +249,7 @@
text = encoded;
SWBuf decoded;
- const int length = text.length();
+ const long length = text.length();
int i = 0;
while (i < length) {
Modified: trunk/src/utilfuns/utilstr.cpp
===================================================================
--- trunk/src/utilfuns/utilstr.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/utilfuns/utilstr.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -81,7 +81,7 @@
if (*ipstr)
delete [] *ipstr;
if (istr) {
- int len = strlen(istr) + 1;
+ int len = (int)strlen(istr) + 1;
*ipstr = new char [ len * memPadFactor ];
memcpy(*ipstr, istr, len);
}
@@ -102,7 +102,7 @@
char *tmp = istr;
char *rtmp;
- int len = strlen(istr);
+ int len = (int)strlen(istr);
if (len < 1)
return istr;
rtmp = istr + (len - 1);
@@ -126,8 +126,8 @@
*/
const char *stristr(const char *s1, const char *s2) {
- int tLen = strlen(s2);
- int cLen = strlen(s1);
+ int tLen = (int)strlen(s2);
+ int cLen = (int)strlen(s1);
char *target = new char [ tLen + 1 ];
int i, j;
const char *retVal = 0;
@@ -161,8 +161,8 @@
*/
int strnicmp(const char *s1, const char *s2, int len) {
- int tLen = strlen(s2);
- int cLen = strlen(s1);
+ int tLen = (int)strlen(s2);
+ int cLen = (int)strlen(s1);
char diff;
int i;
for (i = 0; ((i < len) && (i < tLen) && (i < cLen)); i++) {
Modified: trunk/src/utilfuns/utilxml.cpp
===================================================================
--- trunk/src/utilfuns/utilxml.cpp 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/utilfuns/utilxml.cpp 2016-10-23 08:32:02 UTC (rev 3439)
@@ -128,12 +128,12 @@
empty = t.empty;
endTag = t.endTag;
if (t.buf) {
- int len = strlen(t.buf);
+ int len = (int)strlen(t.buf);
buf = new char[len + 1];
memcpy(buf, t.buf, len + 1);
}
if (t.name) {
- int len = strlen(t.name);
+ int len = (int)strlen(t.name);
name = new char[len + 1];
memcpy(name, t.name, len + 1);
}
Modified: trunk/src/utilfuns/zlib/gzread.c
===================================================================
--- trunk/src/utilfuns/zlib/gzread.c 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/utilfuns/zlib/gzread.c 2016-10-23 08:32:02 UTC (rev 3439)
@@ -27,7 +27,7 @@
*have = 0;
do {
- ret = read(state->fd, buf + *have, len - *have);
+ ret = (int)read(state->fd, buf + *have, len - *have);
if (ret <= 0)
break;
*have += ret;
Modified: trunk/src/utilfuns/zlib/gzwrite.c
===================================================================
--- trunk/src/utilfuns/zlib/gzwrite.c 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/utilfuns/zlib/gzwrite.c 2016-10-23 08:32:02 UTC (rev 3439)
@@ -81,7 +81,7 @@
/* write directly if requested */
if (state->direct) {
- got = write(state->fd, strm->next_in, strm->avail_in);
+ got = (int)write(state->fd, strm->next_in, strm->avail_in);
if (got < 0 || (unsigned)got != strm->avail_in) {
gz_error(state, Z_ERRNO, zstrerror());
return -1;
@@ -98,7 +98,7 @@
if (strm->avail_out == 0 || (flush != Z_NO_FLUSH &&
(flush != Z_FINISH || ret == Z_STREAM_END))) {
have = (unsigned)(strm->next_out - state->x.next);
- if (have && ((got = write(state->fd, state->x.next, have)) < 0 ||
+ if (have && ((got = (int)write(state->fd, state->x.next, have)) < 0 ||
(unsigned)got != have)) {
gz_error(state, Z_ERRNO, zstrerror());
return -1;
Modified: trunk/src/utilfuns/zlib/untgz.c
===================================================================
--- trunk/src/utilfuns/zlib/untgz.c 2016-10-22 04:02:49 UTC (rev 3438)
+++ trunk/src/utilfuns/zlib/untgz.c 2016-10-23 08:32:02 UTC (rev 3439)
@@ -201,7 +201,7 @@
{
char *buffer = strdup(newdir);
char *p;
- int len = strlen(buffer);
+ int len = (int)strlen(buffer);
if (len <= 0) {
free(buffer);
More information about the sword-cvs
mailing list