diff options
Diffstat (limited to 'src/modules/common/zverse.cpp')
-rw-r--r-- | src/modules/common/zverse.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/modules/common/zverse.cpp b/src/modules/common/zverse.cpp index cd63eca..e975a81 100644 --- a/src/modules/common/zverse.cpp +++ b/src/modules/common/zverse.cpp @@ -5,7 +5,7 @@ * and provides lookup and parsing functions based on * class VerseKey for compressed modules * - * $Id: zverse.cpp 3166 2014-04-17 04:08:45Z greg.hellings $ + * $Id: zverse.cpp 3439 2016-10-23 08:32:02Z scribe $ * * Copyright 1996-2013 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society @@ -67,7 +67,6 @@ zVerse::zVerse(const char *ipath, int fileMode, int blockType, SWCompress *icomp SWBuf buf; - nl = '\n'; path = 0; cacheBufIdx = -1; cacheTestament = 0; @@ -273,7 +272,7 @@ void zVerse::zReadText(char testmt, long start, unsigned short size, unsigned lo 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; } @@ -315,12 +314,12 @@ void zVerse::doSetText(char testmt, long idxoff, const char *buf, long len) { __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; @@ -344,9 +343,9 @@ void zVerse::flushCache() const { __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; @@ -355,16 +354,16 @@ void zVerse::flushCache() const { 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); |