summaryrefslogtreecommitdiffstats
path: root/programs
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2020-11-14 06:20:49 (GMT)
committerYann Collet <cyan@fb.com>2020-11-14 06:20:49 (GMT)
commit5fa6417b2e3ecb9d6434c632b39547b58e5ea12f (patch)
treeace41cd54362f1b0dcaa9e75ce5ce6df591c4ef8 /programs
parent772a312b00ad7b47967e0c4d62e742a86d8bd2cb (diff)
downloadlz4-5fa6417b2e3ecb9d6434c632b39547b58e5ea12f.zip
lz4-5fa6417b2e3ecb9d6434c632b39547b58e5ea12f.tar.gz
lz4-5fa6417b2e3ecb9d6434c632b39547b58e5ea12f.tar.bz2
dictionary functions don't need prefs mutability
Diffstat (limited to 'programs')
-rw-r--r--programs/lz4io.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/programs/lz4io.c b/programs/lz4io.c
index 27e8979..975f590 100644
--- a/programs/lz4io.c
+++ b/programs/lz4io.c
@@ -595,7 +595,8 @@ static void* LZ4IO_createDict(size_t* dictSize, const char* const dictFilename)
return dictBuf;
}
-static LZ4F_CDict* LZ4IO_createCDict(LZ4IO_prefs_t* const prefs) {
+static LZ4F_CDict* LZ4IO_createCDict(const LZ4IO_prefs_t* const prefs)
+{
size_t dictionarySize;
void* dictionaryBuffer;
LZ4F_CDict* cdict;
@@ -1001,7 +1002,7 @@ typedef struct {
size_t dictBufferSize;
} dRess_t;
-static void LZ4IO_loadDDict(LZ4IO_prefs_t* const prefs, dRess_t* ress)
+static void LZ4IO_loadDDict(dRess_t* ress, const LZ4IO_prefs_t* const prefs)
{
if (!prefs->useDictionary) {
ress->dictBuffer = NULL;
@@ -1014,7 +1015,7 @@ static void LZ4IO_loadDDict(LZ4IO_prefs_t* const prefs, dRess_t* ress)
}
static const size_t LZ4IO_dBufferSize = 64 KB;
-static dRess_t LZ4IO_createDResources(LZ4IO_prefs_t* const prefs)
+static dRess_t LZ4IO_createDResources(const LZ4IO_prefs_t* const prefs)
{
dRess_t ress;
@@ -1029,7 +1030,7 @@ static dRess_t LZ4IO_createDResources(LZ4IO_prefs_t* const prefs)
ress.dstBuffer = malloc(ress.dstBufferSize);
if (!ress.srcBuffer || !ress.dstBuffer) EXM_THROW(61, "Allocation error : not enough memory");
- LZ4IO_loadDDict(prefs, &ress);
+ LZ4IO_loadDDict(&ress, prefs);
ress.dstFile = NULL;
return ress;