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>
This commit is contained in:
Alexandru Gagniuc
2014-01-27 20:57:54 -06:00
parent 4a7b115211
commit 9ad52fe56e
8 changed files with 277 additions and 277 deletions

View File

@@ -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);