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>
diff --git a/util/cbfstool/lzma/lzma.c b/util/cbfstool/lzma/lzma.c
index f889946..5eebc7e 100644
--- a/util/cbfstool/lzma/lzma.c
+++ b/util/cbfstool/lzma/lzma.c
@@ -57,17 +57,17 @@
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 @@
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 @@
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 @@
return;
}
- ELzmaStatus status;
+ enum ELzmaStatus status;
size_t destlen = out_sizemax;
size_t srclen = src_len - (LZMA_PROPS_SIZE + 8);