diff options
author | Yann Collet <yann.collet.73@gmail.com> | 2015-03-11 17:38:44 (GMT) |
---|---|---|
committer | Yann Collet <yann.collet.73@gmail.com> | 2015-03-11 17:38:44 (GMT) |
commit | e3f33d25793193e005eadf4c04c2fbcf2eae497e (patch) | |
tree | d3bb33fe98273a6e75d1ad2cd09714dee816fb68 /lib/lz4frame.c | |
parent | ceec6fa8492a5ff0ed163c96516716a3c2b09461 (diff) | |
download | lz4-e3f33d25793193e005eadf4c04c2fbcf2eae497e.zip lz4-e3f33d25793193e005eadf4c04c2fbcf2eae497e.tar.gz lz4-e3f33d25793193e005eadf4c04c2fbcf2eae497e.tar.bz2 |
Fixed minor warnings
Diffstat (limited to 'lib/lz4frame.c')
-rw-r--r-- | lib/lz4frame.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/lib/lz4frame.c b/lib/lz4frame.c index d81690f..2218fd2 100644 --- a/lib/lz4frame.c +++ b/lib/lz4frame.c @@ -436,16 +436,19 @@ size_t LZ4F_compressBegin(LZ4F_compressionContext_t compressionContext, void* ds * */ size_t LZ4F_compressBound(size_t srcSize, const LZ4F_preferences_t* preferencesPtr) { - const LZ4F_preferences_t prefsNull = {}; /* init to zero */ - const LZ4F_preferences_t* prefsPtr = (preferencesPtr==NULL) ? &prefsNull : preferencesPtr; - blockSizeID_t bid = prefsPtr->frameInfo.blockSizeID; - size_t blockSize = LZ4F_getBlockSize(bid); - unsigned nbBlocks = (unsigned)(srcSize / blockSize) + 1; - size_t lastBlockSize = prefsPtr->autoFlush ? srcSize % blockSize : blockSize; - size_t blockInfo = 4; /* default, without block CRC option */ - size_t frameEnd = 4 + (prefsPtr->frameInfo.contentChecksumFlag*4); - - return (blockInfo * nbBlocks) + (blockSize * (nbBlocks-1)) + lastBlockSize + frameEnd;; + LZ4F_preferences_t prefsNull; + memset(&prefsNull, 0, sizeof(prefsNull)); + { + const LZ4F_preferences_t* prefsPtr = (preferencesPtr==NULL) ? &prefsNull : preferencesPtr; + blockSizeID_t bid = prefsPtr->frameInfo.blockSizeID; + size_t blockSize = LZ4F_getBlockSize(bid); + unsigned nbBlocks = (unsigned)(srcSize / blockSize) + 1; + size_t lastBlockSize = prefsPtr->autoFlush ? srcSize % blockSize : blockSize; + size_t blockInfo = 4; /* default, without block CRC option */ + size_t frameEnd = 4 + (prefsPtr->frameInfo.contentChecksumFlag*4); + + return (blockInfo * nbBlocks) + (blockSize * (nbBlocks-1)) + lastBlockSize + frameEnd;; + } } |