From: Michael Gernoth Date: Mon, 2 Feb 2009 22:19:18 +0000 (+0100) Subject: the unknown element of the data_in struct is the current working byte X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/rsbs2/commitdiff_plain/59a213c089f531918c27395ea8794da8cd3c2b9a the unknown element of the data_in struct is the current working byte --- diff --git a/rsb-lz.c b/rsb-lz.c index 644e8bb..5f290d8 100644 --- a/rsb-lz.c +++ b/rsb-lz.c @@ -17,8 +17,8 @@ void err_exit(const char *fname) struct data_in_s { unsigned char *start; /* 0 */ unsigned char *stop; /* 4 */ - unsigned char bit; /* 8 */ - unsigned char x; /* 9 */ + unsigned char bitpos; /* 8 */ + unsigned char byte; /* 9 */ }; struct data_out_s { @@ -43,15 +43,15 @@ unsigned char fn_59848(struct data_in_s *data_in) { unsigned char r5; - if (data_in->bit == 0x80) { - data_in->x = get_next_in_byte(data_in); + if (data_in->bitpos == 0x80) { + data_in->byte = get_next_in_byte(data_in); } - r5 = data_in->bit & data_in->x; + r5 = data_in->bitpos & data_in->byte; - data_in->bit >>= 1; - if (data_in->bit == 0) { - data_in->bit = 0x80; + data_in->bitpos >>= 1; + if (data_in->bitpos == 0) { + data_in->bitpos = 0x80; } if (r5 == 0) @@ -69,18 +69,18 @@ unsigned int fn_598b4(struct data_in_s *r11_data, unsigned int r10_arg2) r7 = 0; while (r6 != 0) { - if (r11_data->bit == 0x80) { - r11_data->x = get_next_in_byte(r11_data); + if (r11_data->bitpos == 0x80) { + r11_data->byte = get_next_in_byte(r11_data); } - if ((r11_data->bit & r11_data->x) != 0) + if ((r11_data->bitpos & r11_data->byte) != 0) r7 = r7 | r6; r6 = r6 >> 1; - r11_data->bit >>= 1; + r11_data->bitpos >>= 1; - if(r11_data->bit == 0) { - r11_data->bit = 0x80; + if(r11_data->bitpos == 0) { + r11_data->bitpos = 0x80; } } @@ -199,8 +199,8 @@ void extract_lz_file(unsigned char *inbuf, unsigned char *name) data_in.start = inbuf + 8; data_in.stop = inbuf + len; - data_in.x = 0; - data_in.bit = 0x80; + data_in.byte = 0x00; + data_in.bitpos = 0x80; data_out.pos = outbuf; data_out.end = outbuf + len;