wok-next diff 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 diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/arj/stuff/patches/64_bit_clean.patch Sat May 13 17:25:31 2017 +0300 1.3 @@ -0,0 +1,194 @@ 1.4 +#DPATCHLEVEL=1 1.5 +diff -Naur -x .svn -x CVS arj-3.10.22.orig/arj_arcv.c arj-3.10.22/arj_arcv.c 1.6 +--- arj-3.10.22.orig/arj_arcv.c 2005-06-21 22:53:12.000000000 +0300 1.7 ++++ arj-3.10.22/arj_arcv.c 2005-11-24 02:50:31.000000000 +0200 1.8 +@@ -59,27 +59,27 @@ 1.9 + #define setup_hput(ptr) (tmp_hptr=(ptr)) 1.10 + 1.11 + #define hget_byte() (*(tmp_hptr++)&0xFF) 1.12 +-#define hput_byte(c) (*(tmp_hptr++)=(char) (c)) 1.13 ++#define hput_byte(c) (*(tmp_hptr++)=(uint8_t) (c)) 1.14 + 1.15 + /* Reads two bytes from the header, incrementing the pointer */ 1.16 + 1.17 +-static unsigned int hget_word() 1.18 ++static uint16_t hget_word() 1.19 + { 1.20 +- unsigned int result; 1.21 ++ uint16_t result; 1.22 + 1.23 + result=mget_word(tmp_hptr); 1.24 +- tmp_hptr+=sizeof(short); 1.25 ++ tmp_hptr+=sizeof(uint16_t); 1.26 + return result; 1.27 + } 1.28 + 1.29 + /* Reads four bytes from the header, incrementing the pointer */ 1.30 + 1.31 +-static unsigned long hget_longword() 1.32 ++static uint32_t hget_longword() 1.33 + { 1.34 +- unsigned long result; 1.35 ++ uint32_t result; 1.36 + 1.37 + result=mget_dword(tmp_hptr); 1.38 +- tmp_hptr+=sizeof(unsigned long); 1.39 ++ tmp_hptr+=sizeof(uint32_t); 1.40 + return result; 1.41 + } 1.42 + 1.43 +@@ -87,18 +87,18 @@ 1.44 + 1.45 + /* Writes two bytes to the header, incrementing the pointer */ 1.46 + 1.47 +-static void hput_word(unsigned int w) 1.48 ++static void hput_word(uint16_t w) 1.49 + { 1.50 + mput_word(w,tmp_hptr); 1.51 +- tmp_hptr+=sizeof(unsigned short); 1.52 ++ tmp_hptr+=sizeof(uint16_t); 1.53 + } 1.54 + 1.55 + /* Writes four bytes to the header, incrementing the pointer */ 1.56 + 1.57 +-static void hput_longword(unsigned long l) 1.58 ++static void hput_longword(uint32_t l) 1.59 + { 1.60 + mput_dword(l,tmp_hptr); 1.61 +- tmp_hptr+=sizeof(unsigned long); 1.62 ++ tmp_hptr+=sizeof(uint32_t); 1.63 + } 1.64 + 1.65 + /* Calculates and stores the basic header size */ 1.66 +diff -Naur -x .svn -x CVS arj-3.10.22.orig/arj_proc.c arj-3.10.22/arj_proc.c 1.67 +--- arj-3.10.22.orig/arj_proc.c 2005-11-24 02:50:19.000000000 +0200 1.68 ++++ arj-3.10.22/arj_proc.c 2005-11-24 02:50:31.000000000 +0200 1.69 +@@ -585,7 +585,7 @@ 1.70 + /* Returns the exact amount of data that could be safely written to the 1.71 + destination volume */ 1.72 + 1.73 +-unsigned long get_volfree(unsigned int increment) 1.74 ++unsigned long get_volfree(unsigned long increment) 1.75 + { 1.76 + unsigned long pvol; 1.77 + unsigned int arjsec_overhead; 1.78 +@@ -605,7 +605,7 @@ 1.79 + remain=volume_limit-ftell(aostream)-pvol-(long)arjsec_overhead- 1.80 + (long)out_bytes-(long)cpos-(long)ext_voldata- 1.81 + MULTIVOLUME_RESERVE-t_volume_offset; 1.82 +- return((unsigned long)min(remain, (unsigned long)increment)); 1.83 ++ return((unsigned long)min(remain, increment)); 1.84 + } 1.85 + 1.86 + /* Performs various checks when multivolume data is packed to predict an 1.87 +@@ -2466,14 +2466,14 @@ 1.88 + *tsptr='\0'; 1.89 + endptr=tsptr; 1.90 + tsptr=sptr; 1.91 +- while((unsigned int)tsptr<(unsigned int)endptr&&patterns<SEARCH_STR_MAX) 1.92 ++ while((intptr_t)tsptr<(intptr_t)endptr&&patterns<SEARCH_STR_MAX) 1.93 + { 1.94 + while(*tsptr=='\0') 1.95 + tsptr++; 1.96 +- if((unsigned int)tsptr<(unsigned int)endptr) 1.97 ++ if((intptr_t)tsptr<(intptr_t)endptr) 1.98 + { 1.99 + search_str[patterns++]=tsptr; 1.100 +- while(*tsptr!='\0'&&(unsigned int)tsptr<(unsigned int)endptr) 1.101 ++ while(*tsptr!='\0'&&(intptr_t)tsptr<(intptr_t)endptr) 1.102 + tsptr++; 1.103 + } 1.104 + } 1.105 +@@ -2901,9 +2901,9 @@ 1.106 + #if (defined(WORDS_BIGENDIAN) || defined(ALIGN_POINTERS)) && !defined(ARJDISP) && !defined(REGISTER) 1.107 + /* Model-independent routine to get 2 bytes from far RAM */ 1.108 + 1.109 +-unsigned int mget_word(char FAR *p) 1.110 ++uint16_t mget_word(char FAR *p) 1.111 + { 1.112 +- unsigned int b0, b1; 1.113 ++ uint16_t b0, b1; 1.114 + 1.115 + b0=mget_byte(p); 1.116 + b1=mget_byte(p+1); 1.117 +@@ -2912,9 +2912,9 @@ 1.118 + 1.119 + /* Model-independent routine to get 4 bytes from far RAM */ 1.120 + 1.121 +-unsigned long mget_dword(char FAR *p) 1.122 ++uint32_t mget_dword(char FAR *p) 1.123 + { 1.124 +- unsigned long w0, w1; 1.125 ++ uint32_t w0, w1; 1.126 + 1.127 + w0=mget_word(p); 1.128 + w1=mget_word(p+2); 1.129 +@@ -2923,7 +2923,7 @@ 1.130 + 1.131 + /* Model-independent routine to store 2 bytes in far RAM */ 1.132 + 1.133 +-void mput_word(unsigned int w, char FAR *p) 1.134 ++void mput_word(uint16_t w, char FAR *p) 1.135 + { 1.136 + mput_byte(w&0xFF, p); 1.137 + mput_byte(w>>8 , p+1); 1.138 +@@ -2931,7 +2931,7 @@ 1.139 + 1.140 + /* Model-independent routine to store 4 bytes in far RAM */ 1.141 + 1.142 +-void mput_dword(unsigned long d, char FAR *p) 1.143 ++void mput_dword(uint32_t d, char FAR *p) 1.144 + { 1.145 + mput_word(d&0xFFFF, p); 1.146 + mput_word(d>>16 , p+2); 1.147 +diff -Naur -x .svn -x CVS arj-3.10.22.orig/arj_proc.h arj-3.10.22/arj_proc.h 1.148 +--- arj-3.10.22.orig/arj_proc.h 2005-11-24 02:50:19.000000000 +0200 1.149 ++++ arj-3.10.22/arj_proc.h 2005-11-24 03:17:25.000000000 +0200 1.150 +@@ -8,15 +8,17 @@ 1.151 + #ifndef ARJ_PROC_INCLUDED 1.152 + #define ARJ_PROC_INCLUDED 1.153 + 1.154 ++#include <stdint.h> 1.155 ++ 1.156 + /* Helper macros */ 1.157 + 1.158 +-#define mget_byte(p) (*(unsigned char FAR *)(p)&0xFF) 1.159 +-#define mput_byte(c, p) *(unsigned char FAR *)(p)=(unsigned char)(c) 1.160 ++#define mget_byte(p) (*(uint8_t FAR *)(p)&0xFF) 1.161 ++#define mput_byte(c, p) *(uint8_t FAR *)(p)=(uint8_t)(c) 1.162 + #if !defined(ALIGN_POINTERS) && !defined(WORDS_BIGENDIAN) 1.163 +-#define mget_word(p) (*(unsigned short *)(p)&0xFFFF) 1.164 +-#define mput_word(w,p) (*(unsigned short *)(p)=(unsigned short)(w)) 1.165 +-#define mget_dword(p) (*(unsigned long *)(p)) 1.166 +-#define mput_dword(w,p) (*(unsigned long *)(p)=(unsigned long)(w)) 1.167 ++#define mget_word(p) (*(uint16_t *)(p)&0xFFFF) 1.168 ++#define mput_word(w,p) (*(uint16_t *)(p)=(uint16_t)(w)) 1.169 ++#define mget_dword(p) (*(uint32_t *)(p)) 1.170 ++#define mput_dword(w,p) (*(uint32_t *)(p)=(uint32_t)(w)) 1.171 + #endif 1.172 + 1.173 + /* Prototypes */ 1.174 +@@ -31,7 +33,7 @@ 1.175 + int translate_path(char *name); 1.176 + void restart_proc(char *dest); 1.177 + int search_for_extension(char *name, char *ext_list); 1.178 +-unsigned long get_volfree(unsigned int increment); 1.179 ++unsigned long get_volfree(unsigned long increment); 1.180 + unsigned int check_multivolume(unsigned int increment); 1.181 + void store(); 1.182 + void hollow_encode(); 1.183 +@@ -61,10 +63,10 @@ 1.184 + void strip_lf(char *str); 1.185 + char *ltrim(char *str); 1.186 + #if defined(ALIGN_POINTERS) || defined(WORDS_BIGENDIAN) 1.187 +-unsigned int mget_word(char FAR *p); 1.188 +-unsigned long mget_dword(char FAR *p); 1.189 +-void mput_word(unsigned int w, char FAR *p); 1.190 +-void mput_dword(unsigned long d, char FAR *p); 1.191 ++uint16_t mget_word(char FAR *p); 1.192 ++uint32_t mget_dword(char FAR *p); 1.193 ++void mput_word(uint16_t w, char FAR *p); 1.194 ++void mput_dword(uint32_t d, char FAR *p); 1.195 + #endif 1.196 + 1.197 + #endif