From b91b810c64f3ccc244b0a5f6e2a067f88ee2c6d8 Mon Sep 17 00:00:00 2001 From: Paul Cruz Date: Mon, 19 Jun 2017 16:05:05 -0700 Subject: [PATCH] made some small changes to dictInfo struct and initDictInfo --- tests/decodecorpus.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/tests/decodecorpus.c b/tests/decodecorpus.c index 10c8a153..dba27712 100644 --- a/tests/decodecorpus.c +++ b/tests/decodecorpus.c @@ -237,8 +237,9 @@ typedef struct { int useDict; U32 dictID; size_t dictSize; + BYTE* fullDict; BYTE* dictContent; -} dictOptions; +} dictInfo; /*-******************************************************* * Generator Functions *********************************************************/ @@ -1326,6 +1327,17 @@ static int genRandomDict(U32 dictID, U32 seed, size_t dictSize, BYTE* fullDict){ return 0; } +static dictInfo initDictInfo(int useDict, size_t dictSize, BYTE* fullDict, U32 seed){ + /* allocate space statically */ + dictInfo dictOp; + memset((void*)(&dictOp), 0, sizeof(dictOp)); + dictOp.useDict = useDict; + dictOp.dictSize = dictSize; + dictOp.fullDict = fullDict; + dictOp.dictContent = fullDict + dictSize/4; + if (useDict) dictOp.dictID = RAND(&seed); + return dictOp; +} /*-******************************************************* * File I/O *********************************************************/ @@ -1381,17 +1393,6 @@ static int generateCorpus(U32 seed, unsigned numFiles, const char* const path, return 0; } -static dictOptions initDictOptions(int useDict, U32 dictID, size_t dictSize, BYTE* dictContent){ - /* allocate space statically */ - dictOptions dictOp; - memset((void*)(&dictOp), 0, sizeof(dictOp)); - dictOp.useDict = useDict; - dictOp.dictID = dictID; - dictOp.dictSize = dictSize; - dictOp.dictContent = dictContent; - return dictOp; -} - static int generateCorpusWithDict(U32 seed, unsigned numFiles, const char* const path, const char* const origPath, const size_t dictSize) {