aboutsummaryrefslogtreecommitdiff
path: root/util/cbfstool/lzma/C/LzmaDec.h
diff options
context:
space:
mode:
authorAlexandru Gagniuc <mr.nuke.me@gmail.com>2014-01-26 22:55:01 -0600
committerAlexandru Gagniuc <mr.nuke.me@gmail.com>2014-01-29 20:04:53 +0100
commit91e9f27973aba1988b32e694add144ab852dfece (patch)
tree0f5cc2a057ca50d668a89a7fdcae44e5bbb4bef6 /util/cbfstool/lzma/C/LzmaDec.h
parentaa2f739ae87386b8a29068ecfdc2b25bcf4a19ca (diff)
cbfstool/lzma: Use stdint and stdbool types
This is the first patch on a long road to refactor and fix the lzma code in cbfstool. I want to submit it in small atomic patches, so that any potential errors are easy to spot before it's too late. Change-Id: Ib557f8c83f49f18488639f38bf98d3ce849e61af Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-on: http://review.coreboot.org/4834 Tested-by: build bot (Jenkins) Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'util/cbfstool/lzma/C/LzmaDec.h')
-rw-r--r--util/cbfstool/lzma/C/LzmaDec.h44
1 files changed, 22 insertions, 22 deletions
diff --git a/util/cbfstool/lzma/C/LzmaDec.h b/util/cbfstool/lzma/C/LzmaDec.h
index 7927acd0d4..3d06b584a5 100644
--- a/util/cbfstool/lzma/C/LzmaDec.h
+++ b/util/cbfstool/lzma/C/LzmaDec.h
@@ -15,9 +15,9 @@ extern "C" {
but memory usage for CLzmaDec::probs will be doubled in that case */
#ifdef _LZMA_PROB32
-#define CLzmaProb UInt32
+#define CLzmaProb uint32_t
#else
-#define CLzmaProb UInt16
+#define CLzmaProb uint16_t
#endif
@@ -28,7 +28,7 @@ extern "C" {
typedef struct _CLzmaProps
{
unsigned lc, lp, pb;
- UInt32 dicSize;
+ uint32_t dicSize;
} CLzmaProps;
/* LzmaProps_Decode - decodes properties
@@ -37,7 +37,7 @@ Returns:
SZ_ERROR_UNSUPPORTED - Unsupported properties
*/
-SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size);
+SRes LzmaProps_Decode(CLzmaProps *p, const uint8_t *data, unsigned size);
/* ---------- LZMA Decoder state ---------- */
@@ -51,21 +51,21 @@ typedef struct
{
CLzmaProps prop;
CLzmaProb *probs;
- Byte *dic;
- const Byte *buf;
- UInt32 range, code;
- SizeT dicPos;
- SizeT dicBufSize;
- UInt32 processedPos;
- UInt32 checkDicSize;
+ uint8_t *dic;
+ const uint8_t *buf;
+ uint32_t range, code;
+ size_t dicPos;
+ size_t dicBufSize;
+ uint32_t processedPos;
+ uint32_t checkDicSize;
unsigned state;
- UInt32 reps[4];
+ uint32_t reps[4];
unsigned remainLen;
int needFlush;
int needInitState;
- UInt32 numProbs;
+ uint32_t numProbs;
unsigned tempBufSize;
- Byte tempBuf[LZMA_REQUIRED_INPUT_MAX];
+ uint8_t tempBuf[LZMA_REQUIRED_INPUT_MAX];
} CLzmaDec;
#define LzmaDec_Construct(p) { (p)->dic = 0; (p)->probs = 0; }
@@ -131,10 +131,10 @@ LzmaDec_Allocate* can return:
SZ_ERROR_UNSUPPORTED - Unsupported properties
*/
-SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc);
+SRes LzmaDec_AllocateProbs(CLzmaDec *p, const uint8_t *props, unsigned propsSize, ISzAlloc *alloc);
void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc);
-SRes LzmaDec_Allocate(CLzmaDec *state, const Byte *prop, unsigned propsSize, ISzAlloc *alloc);
+SRes LzmaDec_Allocate(CLzmaDec *state, const uint8_t *prop, unsigned propsSize, ISzAlloc *alloc);
void LzmaDec_Free(CLzmaDec *state, ISzAlloc *alloc);
/* ---------- Dictionary Interface ---------- */
@@ -178,8 +178,8 @@ Returns:
SZ_ERROR_DATA - Data error
*/
-SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit,
- const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
+SRes LzmaDec_DecodeToDic(CLzmaDec *p, size_t dicLimit,
+ const uint8_t *src, size_t *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
/* ---------- Buffer Interface ---------- */
@@ -195,8 +195,8 @@ finishMode:
LZMA_FINISH_END - Stream must be finished after (*destLen).
*/
-SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen,
- const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
+SRes LzmaDec_DecodeToBuf(CLzmaDec *p, uint8_t *dest, size_t *destLen,
+ const uint8_t *src, size_t *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
/* ---------- One Call Interface ---------- */
@@ -220,8 +220,8 @@ Returns:
SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src).
*/
-SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
- const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,
+SRes LzmaDecode(uint8_t *dest, size_t *destLen, const uint8_t *src, size_t *srcLen,
+ const uint8_t *propData, unsigned propSize, ELzmaFinishMode finishMode,
ELzmaStatus *status, ISzAlloc *alloc);
#ifdef __cplusplus