wok-next view arj/stuff/patches/64_bit_clean.patch @ rev 19715

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