rev |
line source |
al@19715
|
1 #DPATCHLEVEL=1
|
al@19715
|
2 diff -Naur -x .svn -x CVS arj-3.10.22.orig/arj_arcv.c arj-3.10.22/arj_arcv.c
|
al@19715
|
3 --- arj-3.10.22.orig/arj_arcv.c 2005-06-21 22:53:12.000000000 +0300
|
al@19715
|
4 +++ arj-3.10.22/arj_arcv.c 2005-11-24 02:50:31.000000000 +0200
|
al@19715
|
5 @@ -59,27 +59,27 @@
|
al@19715
|
6 #define setup_hput(ptr) (tmp_hptr=(ptr))
|
al@19715
|
7
|
al@19715
|
8 #define hget_byte() (*(tmp_hptr++)&0xFF)
|
al@19715
|
9 -#define hput_byte(c) (*(tmp_hptr++)=(char) (c))
|
al@19715
|
10 +#define hput_byte(c) (*(tmp_hptr++)=(uint8_t) (c))
|
al@19715
|
11
|
al@19715
|
12 /* Reads two bytes from the header, incrementing the pointer */
|
al@19715
|
13
|
al@19715
|
14 -static unsigned int hget_word()
|
al@19715
|
15 +static uint16_t hget_word()
|
al@19715
|
16 {
|
al@19715
|
17 - unsigned int result;
|
al@19715
|
18 + uint16_t result;
|
al@19715
|
19
|
al@19715
|
20 result=mget_word(tmp_hptr);
|
al@19715
|
21 - tmp_hptr+=sizeof(short);
|
al@19715
|
22 + tmp_hptr+=sizeof(uint16_t);
|
al@19715
|
23 return result;
|
al@19715
|
24 }
|
al@19715
|
25
|
al@19715
|
26 /* Reads four bytes from the header, incrementing the pointer */
|
al@19715
|
27
|
al@19715
|
28 -static unsigned long hget_longword()
|
al@19715
|
29 +static uint32_t hget_longword()
|
al@19715
|
30 {
|
al@19715
|
31 - unsigned long result;
|
al@19715
|
32 + uint32_t result;
|
al@19715
|
33
|
al@19715
|
34 result=mget_dword(tmp_hptr);
|
al@19715
|
35 - tmp_hptr+=sizeof(unsigned long);
|
al@19715
|
36 + tmp_hptr+=sizeof(uint32_t);
|
al@19715
|
37 return result;
|
al@19715
|
38 }
|
al@19715
|
39
|
al@19715
|
40 @@ -87,18 +87,18 @@
|
al@19715
|
41
|
al@19715
|
42 /* Writes two bytes to the header, incrementing the pointer */
|
al@19715
|
43
|
al@19715
|
44 -static void hput_word(unsigned int w)
|
al@19715
|
45 +static void hput_word(uint16_t w)
|
al@19715
|
46 {
|
al@19715
|
47 mput_word(w,tmp_hptr);
|
al@19715
|
48 - tmp_hptr+=sizeof(unsigned short);
|
al@19715
|
49 + tmp_hptr+=sizeof(uint16_t);
|
al@19715
|
50 }
|
al@19715
|
51
|
al@19715
|
52 /* Writes four bytes to the header, incrementing the pointer */
|
al@19715
|
53
|
al@19715
|
54 -static void hput_longword(unsigned long l)
|
al@19715
|
55 +static void hput_longword(uint32_t l)
|
al@19715
|
56 {
|
al@19715
|
57 mput_dword(l,tmp_hptr);
|
al@19715
|
58 - tmp_hptr+=sizeof(unsigned long);
|
al@19715
|
59 + tmp_hptr+=sizeof(uint32_t);
|
al@19715
|
60 }
|
al@19715
|
61
|
al@19715
|
62 /* Calculates and stores the basic header size */
|
al@19715
|
63 diff -Naur -x .svn -x CVS arj-3.10.22.orig/arj_proc.c arj-3.10.22/arj_proc.c
|
al@19715
|
64 --- arj-3.10.22.orig/arj_proc.c 2005-11-24 02:50:19.000000000 +0200
|
al@19715
|
65 +++ arj-3.10.22/arj_proc.c 2005-11-24 02:50:31.000000000 +0200
|
al@19715
|
66 @@ -585,7 +585,7 @@
|
al@19715
|
67 /* Returns the exact amount of data that could be safely written to the
|
al@19715
|
68 destination volume */
|
al@19715
|
69
|
al@19715
|
70 -unsigned long get_volfree(unsigned int increment)
|
al@19715
|
71 +unsigned long get_volfree(unsigned long increment)
|
al@19715
|
72 {
|
al@19715
|
73 unsigned long pvol;
|
al@19715
|
74 unsigned int arjsec_overhead;
|
al@19715
|
75 @@ -605,7 +605,7 @@
|
al@19715
|
76 remain=volume_limit-ftell(aostream)-pvol-(long)arjsec_overhead-
|
al@19715
|
77 (long)out_bytes-(long)cpos-(long)ext_voldata-
|
al@19715
|
78 MULTIVOLUME_RESERVE-t_volume_offset;
|
al@19715
|
79 - return((unsigned long)min(remain, (unsigned long)increment));
|
al@19715
|
80 + return((unsigned long)min(remain, increment));
|
al@19715
|
81 }
|
al@19715
|
82
|
al@19715
|
83 /* Performs various checks when multivolume data is packed to predict an
|
al@19715
|
84 @@ -2466,14 +2466,14 @@
|
al@19715
|
85 *tsptr='\0';
|
al@19715
|
86 endptr=tsptr;
|
al@19715
|
87 tsptr=sptr;
|
al@19715
|
88 - while((unsigned int)tsptr<(unsigned int)endptr&&patterns<SEARCH_STR_MAX)
|
al@19715
|
89 + while((intptr_t)tsptr<(intptr_t)endptr&&patterns<SEARCH_STR_MAX)
|
al@19715
|
90 {
|
al@19715
|
91 while(*tsptr=='\0')
|
al@19715
|
92 tsptr++;
|
al@19715
|
93 - if((unsigned int)tsptr<(unsigned int)endptr)
|
al@19715
|
94 + if((intptr_t)tsptr<(intptr_t)endptr)
|
al@19715
|
95 {
|
al@19715
|
96 search_str[patterns++]=tsptr;
|
al@19715
|
97 - while(*tsptr!='\0'&&(unsigned int)tsptr<(unsigned int)endptr)
|
al@19715
|
98 + while(*tsptr!='\0'&&(intptr_t)tsptr<(intptr_t)endptr)
|
al@19715
|
99 tsptr++;
|
al@19715
|
100 }
|
al@19715
|
101 }
|
al@19715
|
102 @@ -2901,9 +2901,9 @@
|
al@19715
|
103 #if (defined(WORDS_BIGENDIAN) || defined(ALIGN_POINTERS)) && !defined(ARJDISP) && !defined(REGISTER)
|
al@19715
|
104 /* Model-independent routine to get 2 bytes from far RAM */
|
al@19715
|
105
|
al@19715
|
106 -unsigned int mget_word(char FAR *p)
|
al@19715
|
107 +uint16_t mget_word(char FAR *p)
|
al@19715
|
108 {
|
al@19715
|
109 - unsigned int b0, b1;
|
al@19715
|
110 + uint16_t b0, b1;
|
al@19715
|
111
|
al@19715
|
112 b0=mget_byte(p);
|
al@19715
|
113 b1=mget_byte(p+1);
|
al@19715
|
114 @@ -2912,9 +2912,9 @@
|
al@19715
|
115
|
al@19715
|
116 /* Model-independent routine to get 4 bytes from far RAM */
|
al@19715
|
117
|
al@19715
|
118 -unsigned long mget_dword(char FAR *p)
|
al@19715
|
119 +uint32_t mget_dword(char FAR *p)
|
al@19715
|
120 {
|
al@19715
|
121 - unsigned long w0, w1;
|
al@19715
|
122 + uint32_t w0, w1;
|
al@19715
|
123
|
al@19715
|
124 w0=mget_word(p);
|
al@19715
|
125 w1=mget_word(p+2);
|
al@19715
|
126 @@ -2923,7 +2923,7 @@
|
al@19715
|
127
|
al@19715
|
128 /* Model-independent routine to store 2 bytes in far RAM */
|
al@19715
|
129
|
al@19715
|
130 -void mput_word(unsigned int w, char FAR *p)
|
al@19715
|
131 +void mput_word(uint16_t w, char FAR *p)
|
al@19715
|
132 {
|
al@19715
|
133 mput_byte(w&0xFF, p);
|
al@19715
|
134 mput_byte(w>>8 , p+1);
|
al@19715
|
135 @@ -2931,7 +2931,7 @@
|
al@19715
|
136
|
al@19715
|
137 /* Model-independent routine to store 4 bytes in far RAM */
|
al@19715
|
138
|
al@19715
|
139 -void mput_dword(unsigned long d, char FAR *p)
|
al@19715
|
140 +void mput_dword(uint32_t d, char FAR *p)
|
al@19715
|
141 {
|
al@19715
|
142 mput_word(d&0xFFFF, p);
|
al@19715
|
143 mput_word(d>>16 , p+2);
|
al@19715
|
144 diff -Naur -x .svn -x CVS arj-3.10.22.orig/arj_proc.h arj-3.10.22/arj_proc.h
|
al@19715
|
145 --- arj-3.10.22.orig/arj_proc.h 2005-11-24 02:50:19.000000000 +0200
|
al@19715
|
146 +++ arj-3.10.22/arj_proc.h 2005-11-24 03:17:25.000000000 +0200
|
al@19715
|
147 @@ -8,15 +8,17 @@
|
al@19715
|
148 #ifndef ARJ_PROC_INCLUDED
|
al@19715
|
149 #define ARJ_PROC_INCLUDED
|
al@19715
|
150
|
al@19715
|
151 +#include <stdint.h>
|
al@19715
|
152 +
|
al@19715
|
153 /* Helper macros */
|
al@19715
|
154
|
al@19715
|
155 -#define mget_byte(p) (*(unsigned char FAR *)(p)&0xFF)
|
al@19715
|
156 -#define mput_byte(c, p) *(unsigned char FAR *)(p)=(unsigned char)(c)
|
al@19715
|
157 +#define mget_byte(p) (*(uint8_t FAR *)(p)&0xFF)
|
al@19715
|
158 +#define mput_byte(c, p) *(uint8_t FAR *)(p)=(uint8_t)(c)
|
al@19715
|
159 #if !defined(ALIGN_POINTERS) && !defined(WORDS_BIGENDIAN)
|
al@19715
|
160 -#define mget_word(p) (*(unsigned short *)(p)&0xFFFF)
|
al@19715
|
161 -#define mput_word(w,p) (*(unsigned short *)(p)=(unsigned short)(w))
|
al@19715
|
162 -#define mget_dword(p) (*(unsigned long *)(p))
|
al@19715
|
163 -#define mput_dword(w,p) (*(unsigned long *)(p)=(unsigned long)(w))
|
al@19715
|
164 +#define mget_word(p) (*(uint16_t *)(p)&0xFFFF)
|
al@19715
|
165 +#define mput_word(w,p) (*(uint16_t *)(p)=(uint16_t)(w))
|
al@19715
|
166 +#define mget_dword(p) (*(uint32_t *)(p))
|
al@19715
|
167 +#define mput_dword(w,p) (*(uint32_t *)(p)=(uint32_t)(w))
|
al@19715
|
168 #endif
|
al@19715
|
169
|
al@19715
|
170 /* Prototypes */
|
al@19715
|
171 @@ -31,7 +33,7 @@
|
al@19715
|
172 int translate_path(char *name);
|
al@19715
|
173 void restart_proc(char *dest);
|
al@19715
|
174 int search_for_extension(char *name, char *ext_list);
|
al@19715
|
175 -unsigned long get_volfree(unsigned int increment);
|
al@19715
|
176 +unsigned long get_volfree(unsigned long increment);
|
al@19715
|
177 unsigned int check_multivolume(unsigned int increment);
|
al@19715
|
178 void store();
|
al@19715
|
179 void hollow_encode();
|
al@19715
|
180 @@ -61,10 +63,10 @@
|
al@19715
|
181 void strip_lf(char *str);
|
al@19715
|
182 char *ltrim(char *str);
|
al@19715
|
183 #if defined(ALIGN_POINTERS) || defined(WORDS_BIGENDIAN)
|
al@19715
|
184 -unsigned int mget_word(char FAR *p);
|
al@19715
|
185 -unsigned long mget_dword(char FAR *p);
|
al@19715
|
186 -void mput_word(unsigned int w, char FAR *p);
|
al@19715
|
187 -void mput_dword(unsigned long d, char FAR *p);
|
al@19715
|
188 +uint16_t mget_word(char FAR *p);
|
al@19715
|
189 +uint32_t mget_dword(char FAR *p);
|
al@19715
|
190 +void mput_word(uint16_t w, char FAR *p);
|
al@19715
|
191 +void mput_dword(uint32_t d, char FAR *p);
|
al@19715
|
192 #endif
|
al@19715
|
193
|
al@19715
|
194 #endif
|