cbfstool: Clean up code
cbfstool has diverged between coreboot upstream and the chromium tree.
Bring in some of the chromium changes, in particular the useful remainders
of cbf37fe (https://chromium-review.googlesource.com/176710)
- fix coding style
- mark unused variables explicitly unused
- remove some dead code
Change-Id: I354aaede8ce425ebe99d4c60c232feea62bf8a11
Signed-off-by: Stefan Reinauer <reinauer@google.com>
Reviewed-on: http://review.coreboot.org/8577
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marc.jones@se-eng.com>
diff --git a/util/cbfstool/lzma/lzma.c b/util/cbfstool/lzma/lzma.c
index abd1bfd..0944b1f 100644
--- a/util/cbfstool/lzma/lzma.c
+++ b/util/cbfstool/lzma/lzma.c
@@ -31,12 +31,12 @@
/* Memory Allocation API */
-static void *SzAlloc(void *unused, size_t size)
+static void *SzAlloc(unused void *u, size_t size)
{
return malloc(size);
}
-static void SzFree(void *unused, void *address)
+static void SzFree(unused void *u, void *address)
{
free(address);
}
@@ -53,7 +53,7 @@
static struct vector_t instream, outstream;
-static SRes Read(void *unused, void *buf, size_t *size)
+static SRes Read(unused void *u, void *buf, size_t *size)
{
if ((instream.size - instream.pos) < *size)
*size = instream.size - instream.pos;
@@ -62,7 +62,7 @@
return SZ_OK;
}
-static size_t Write(void *unused, const void *buf, size_t size)
+static size_t Write(unused void *u, const void *buf, size_t size)
{
if(outstream.size - outstream.pos < size)
size = outstream.size - outstream.pos;