]> git.zerfleddert.de Git - rsbs2/commitdiff
the unknown element of the data_in struct is the current working byte
authorMichael Gernoth <michael@gernoth.net>
Mon, 2 Feb 2009 22:19:18 +0000 (23:19 +0100)
committerMichael Gernoth <michael@gernoth.net>
Mon, 2 Feb 2009 22:19:18 +0000 (23:19 +0100)
rsb-lz.c

index 644e8bb0e98976998edf1cada054297e678721ad..5f290d8fdad2bc4e71adc8dccdfb007d934398a7 100644 (file)
--- 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 */
 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 {
 };
 
 struct data_out_s {
@@ -43,15 +43,15 @@ unsigned char fn_59848(struct data_in_s *data_in)
 {
        unsigned char r5;
 
 {
        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)
        }
 
        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) {
 
        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;
 
                        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.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;
 
        data_out.pos = outbuf;
        data_out.end = outbuf + len;
Impressum, Datenschutz