aboutsummaryrefslogtreecommitdiffstats
path: root/xen/common/unlzma.c
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2011-11-11 14:29:21 +0100
committerLasse Collin <lasse.collin@tukaani.org>2011-11-11 14:29:21 +0100
commit8901ea9184c3c02232f9c33a6daeeeed827c645e (patch)
treea9348e56d0c52868a8f80a4d9691ba119bbd15ac /xen/common/unlzma.c
parent3d4e3e903e3b4bbfdab4924a71bdab28fb62f84f (diff)
downloadxen-8901ea9184c3c02232f9c33a6daeeeed827c645e.tar.gz
xen-8901ea9184c3c02232f9c33a6daeeeed827c645e.tar.bz2
xen-8901ea9184c3c02232f9c33a6daeeeed827c645e.zip
Decompressors: get rid of set_error_fn() macro
From: Lasse Collin <lasse.collin@tukaani.org> set_error_fn() is a useless complication. Only unlzma.c had some use for it and that was easy to change too. This also gets rid of the static function pointer "error". Signed-off-by: Lasse Collin <lasse.collin@tukaani.org> Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org> Committed-by: Jan Beulich <jbeulich@suse.com>
Diffstat (limited to 'xen/common/unlzma.c')
-rw-r--r--xen/common/unlzma.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/xen/common/unlzma.c b/xen/common/unlzma.c
index bf772d06e8..689b72a662 100644
--- a/xen/common/unlzma.c
+++ b/xen/common/unlzma.c
@@ -67,6 +67,7 @@ struct rc {
uint32_t code;
uint32_t range;
uint32_t bound;
+ void (*error)(const char *);
};
@@ -85,7 +86,7 @@ static void INIT rc_read(struct rc *rc)
{
rc->buffer_size = rc->fill((char *)rc->buffer, LZMA_IOBUF_SIZE);
if (rc->buffer_size <= 0)
- error("unexpected EOF");
+ rc->error("unexpected EOF");
rc->ptr = rc->buffer;
rc->buffer_end = rc->buffer + rc->buffer_size;
}
@@ -529,7 +530,7 @@ STATIC int INIT unlzma(unsigned char *buf, unsigned int in_len,
int(*flush)(void*, unsigned int),
unsigned char *output,
unsigned int *posp,
- void(*error_fn)(const char *x)
+ void(*error)(const char *x)
)
{
struct lzma_header header;
@@ -545,7 +546,7 @@ STATIC int INIT unlzma(unsigned char *buf, unsigned int in_len,
unsigned char *inbuf;
int ret = -1;
- set_error_fn(error_fn);
+ rc.error = error;
if (buf)
inbuf = buf;