Browse code

libclamunrar - realign structs - see bb#474

git-svn: trunk@3534

aCaB authored on 2008/01/24 02:09:14
Showing 4 changed files
... ...
@@ -1,3 +1,7 @@
1
+Wed Jan 23 17:45:12 CET 2008 (acab)
2
+-----------------------------------
3
+  * libclamunrar: realign structs (related to bb#474)
4
+
1 5
 Wed Jan 23 17:15:28 CET 2008 (tk)
2 6
 ---------------------------------
3 7
   * shared/output.c: fix handling of special characters in mprintf/logg (bb#360)
... ...
@@ -219,9 +219,9 @@ typedef struct unpack_data_tag
219 219
 	int last_filter, old_filter_lengths_size;
220 220
 	int64_t written_size;
221 221
 	int64_t dest_unp_size;
222
-	uint32_t pack_size;
223 222
 	rarvm_data_t rarvm_data;
224 223
 	unsigned int unp_crc;
224
+	uint32_t pack_size;
225 225
 	
226 226
 	/* RAR2 variables */
227 227
 	int unp_cur_channel, unp_channel_delta, unp_audio_block, unp_channels;
... ...
@@ -27,8 +27,8 @@
27 27
 
28 28
 typedef struct rar_mem_blk_tag
29 29
 {
30
-	uint16_t stamp, nu;
31 30
 	struct rar_mem_blk_tag *next, *prev;
31
+	uint16_t stamp, nu;
32 32
 } rar_mem_blk_t;
33 33
 
34 34
 struct rar_node
... ...
@@ -38,12 +38,11 @@ struct rar_node
38 38
 
39 39
 typedef struct sub_allocator_tag
40 40
 {
41
-	long sub_allocator_size;
42
-	int16_t indx2units[N_INDEXES], units2indx[128], glue_count;
41
+	uint8_t *ptext, *units_start, *heap_end, *fake_units_start;
43 42
 	uint8_t *heap_start, *lo_unit, *hi_unit;
43
+	long sub_allocator_size;
44 44
 	struct rar_node free_list[N_INDEXES];
45
-	
46
-	uint8_t *ptext, *units_start, *heap_end, *fake_units_start;
45
+	int16_t indx2units[N_INDEXES], units2indx[128], glue_count;
47 46
 } sub_allocator_t;
48 47
 
49 48
 typedef struct range_coder_tag
... ...
@@ -62,37 +61,39 @@ struct see2_context_tag
62 62
 
63 63
 struct state_tag
64 64
 {
65
+	struct ppm_context *successor;
65 66
 	uint8_t symbol;
66 67
 	uint8_t freq;
67
-	struct ppm_context *successor;
68 68
 };
69 69
 
70 70
 struct freq_data_tag
71 71
 {
72
-	uint16_t summ_freq;
73 72
 	struct state_tag *stats;
73
+	uint16_t summ_freq;
74 74
 };
75 75
 
76 76
 struct ppm_context {
77
-	uint16_t num_stats;
77
+	struct ppm_context *suffix;
78 78
 	union {
79 79
 		struct freq_data_tag u;
80 80
 		struct state_tag one_state;
81 81
 	} con_ut;
82
-	struct ppm_context *suffix;
82
+	uint16_t num_stats;
83 83
 };
84 84
 
85 85
 typedef struct ppm_data_tag
86 86
 {
87
+	struct state_tag *found_state;
88
+	struct ppm_context *min_context, *max_context;
89
+	struct see2_context_tag see2cont[25][16], dummy_sse2cont;
90
+	int num_masked;
87 91
 	sub_allocator_t sub_alloc;
88 92
 	range_coder_t coder;
89
-	int num_masked, init_esc, order_fall, max_order, run_length, init_rl;
90
-	struct ppm_context *min_context, *max_context;
91
-	struct state_tag *found_state;
93
+	int init_esc, order_fall, max_order, run_length, init_rl;
92 94
 	uint8_t char_mask[256], ns2indx[256], ns2bsindx[256], hb2flag[256];
93
-	uint8_t esc_count, prev_success, hi_bits_flag;
94
-	struct see2_context_tag see2cont[25][16], dummy_sse2cont;
95 95
 	uint16_t bin_summ[128][64];
96
+	uint8_t esc_count, prev_success, hi_bits_flag;
97
+
96 98
 } ppm_data_t;
97 99
 
98 100
 int ppm_decode_init(ppm_data_t *ppm_data, int fd, struct unpack_data_tag *unpack_data, int *EscChar);
... ...
@@ -64,10 +64,10 @@ enum rarvm_op_type {
64 64
 };
65 65
 
66 66
 struct rarvm_prepared_operand {
67
+	unsigned int *addr;
67 68
 	enum rarvm_op_type type;
68 69
 	unsigned int data;
69 70
 	unsigned int base;
70
-	unsigned int *addr;
71 71
 };
72 72
 
73 73
 struct rarvm_prepared_command {
... ...
@@ -79,12 +79,12 @@ struct rarvm_prepared_command {
79 79
 struct rarvm_prepared_program {
80 80
 	rar_cmd_array_t cmd;
81 81
 	struct rarvm_prepared_command *alt_cmd;
82
-	int cmd_count;
83 82
 	unsigned char *global_data;
84 83
 	unsigned char *static_data;
84
+	uint8_t *filtered_data;
85 85
 	long global_size, static_size;
86
+	int cmd_count;
86 87
 	unsigned int init_r[7];
87
-	uint8_t *filtered_data;
88 88
 	unsigned int filtered_data_size;
89 89
 };
90 90