summaryrefslogtreecommitdiff
path: root/util/cbfstool/lzma/lzma.c
diff options
context:
space:
mode:
authorAlexandru Gagniuc <mr.nuke.me@gmail.com>2014-01-27 20:57:54 -0600
committerAlexandru Gagniuc <mr.nuke.me@gmail.com>2014-01-29 20:06:26 +0100
commit9ad52fe56e8fbb1cd2e37795741773708b72eef3 (patch)
treee0a598de3af23d97add5eca164c2f60f6f55c47a /util/cbfstool/lzma/lzma.c
parent4a7b1152115e866cd3164bdd90d8b0ffa26a863b (diff)
cbfstool/lzma: Avoid use of typedef with structs and enums
When typedef is used with structs, enums, and to create new typenames, readability suffers. As such, restrict use of typedefs only to creating new data types. The 80 character limit is intentionally ignored in this patch in order to make reviewing easier. Change-Id: I62660b19bccf234128930a047c754bce3ebb6cf8 Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-on: http://review.coreboot.org/5070 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'util/cbfstool/lzma/lzma.c')
-rw-r--r--util/cbfstool/lzma/lzma.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/util/cbfstool/lzma/lzma.c b/util/cbfstool/lzma/lzma.c
index f889946690..5eebc7e60c 100644
--- a/util/cbfstool/lzma/lzma.c
+++ b/util/cbfstool/lzma/lzma.c
@@ -57,17 +57,17 @@ static void SzFree(void *unused, void *address)
free(address);
}
-static ISzAlloc LZMAalloc = { SzAlloc, SzFree };
+static struct ISzAlloc LZMAalloc = { SzAlloc, SzFree };
/* Streaming API */
-typedef struct {
+struct vector_t {
char *p;
size_t pos;
size_t size;
-} vector_t;
+};
-static vector_t instream, outstream;
+static struct vector_t instream, outstream;
static SRes Read(void *unused, void *buf, size_t *size)
{
@@ -87,8 +87,8 @@ static size_t Write(void *unused, const void *buf, size_t size)
return size;
}
-static ISeqInStream is = { Read };
-static ISeqOutStream os = { Write };
+static struct ISeqInStream is = { Read };
+static struct ISeqOutStream os = { Write };
/**
* Compress a buffer with lzma
@@ -106,7 +106,7 @@ void do_lzma_compress(char *in, int in_len, char *out, int *out_len)
return;
}
- CLzmaEncProps props;
+ struct CLzmaEncProps props;
LzmaEncProps_Init(&props);
props.dictSize = in_len;
props.pb = 0; /* PosStateBits, default: 2, range: 0..4 */
@@ -181,7 +181,7 @@ void do_lzma_uncompress(char *dst, int dst_len, char *src, int src_len)
return;
}
- ELzmaStatus status;
+ enum ELzmaStatus status;
size_t destlen = out_sizemax;
size_t srclen = src_len - (LZMA_PROPS_SIZE + 8);