diff options
author | Przemyslaw Skibinski <inikep@gmail.com> | 2016-11-16 08:01:45 (GMT) |
---|---|---|
committer | Przemyslaw Skibinski <inikep@gmail.com> | 2016-11-16 08:01:45 (GMT) |
commit | 7b6a9d86383579099fd174000b857a5ea1671f0b (patch) | |
tree | 9e1dd4dbed190a957cbd580a20d9c0fb39ca9ad0 /programs/lz4io.c | |
parent | 2e10aab20f17adfffb2379e828124be12c774779 (diff) | |
download | lz4-7b6a9d86383579099fd174000b857a5ea1671f0b.zip lz4-7b6a9d86383579099fd174000b857a5ea1671f0b.tar.gz lz4-7b6a9d86383579099fd174000b857a5ea1671f0b.tar.bz2 |
Merge remote-tracking branch 'refs/remotes/lz4/dev' into dev
Diffstat (limited to 'programs/lz4io.c')
-rw-r--r-- | programs/lz4io.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/programs/lz4io.c b/programs/lz4io.c index 5a366a4..4d076a9 100644 --- a/programs/lz4io.c +++ b/programs/lz4io.c @@ -134,9 +134,6 @@ static int g_blockIndependence = 1; static int g_sparseFileSupport = 1; static int g_contentSizeFlag = 0; -static const int minBlockSizeID = 4; -static const int maxBlockSizeID = 7; - /************************************** * Exceptions @@ -183,10 +180,12 @@ int LZ4IO_setTestMode(int yes) } /* blockSizeID : valid values : 4-5-6-7 */ -int LZ4IO_setBlockSizeID(int bsid) +size_t LZ4IO_setBlockSizeID(unsigned bsid) { - static const int blockSizeTable[] = { 64 KB, 256 KB, 1 MB, 4 MB }; - if ((bsid < minBlockSizeID) || (bsid > maxBlockSizeID)) return -1; + static const size_t blockSizeTable[] = { 64 KB, 256 KB, 1 MB, 4 MB }; + static const unsigned minBlockSizeID = 4; + static const unsigned maxBlockSizeID = 7; + if ((bsid < minBlockSizeID) || (bsid > maxBlockSizeID)) return 0; g_blockSizeId = bsid; return blockSizeTable[g_blockSizeId-minBlockSizeID]; } @@ -777,6 +776,7 @@ static dRess_t LZ4IO_createDResources(void) ress.dstBuffer = malloc(ress.dstBufferSize); if (!ress.srcBuffer || !ress.dstBuffer) EXM_THROW(61, "Allocation error : not enough memory"); + ress.dstFile = NULL; return ress; } |