]> git.pld-linux.org Git - packages/afpfs-ng.git/blame - pointer.patch
undefine __cxx not to require gcc-c++
[packages/afpfs-ng.git] / pointer.patch
CommitLineData
017a8877
ER
1diff -up afpfs-ng-0.8.1/cmdline/getstatus.c.pointer afpfs-ng-0.8.1/cmdline/getstatus.c
2--- afpfs-ng-0.8.1/cmdline/getstatus.c.pointer 2011-06-14 17:06:35.000000000 +0200
3+++ afpfs-ng-0.8.1/cmdline/getstatus.c 2011-06-14 17:07:25.000000000 +0200
4@@ -1,4 +1,5 @@
5 #include <stdio.h>
6+#include <stdlib.h>
7 #include <string.h>
8 #include <pthread.h>
9
10diff -up afpfs-ng-0.8.1/fuse/client.c.pointer afpfs-ng-0.8.1/fuse/client.c
11--- afpfs-ng-0.8.1/fuse/client.c.pointer 2008-03-08 03:44:16.000000000 +0100
12+++ afpfs-ng-0.8.1/fuse/client.c 2011-06-14 17:02:15.000000000 +0200
13@@ -61,8 +61,9 @@ static int start_afpfsd(void)
14 snprintf(filename, PATH_MAX,
15 "/usr/local/bin/%s",AFPFSD_FILENAME);
16 if (access(filename,X_OK)) {
17- snprintf(filename, "/usr/bin/%s",
18+ snprintf(filename, sizeof(filename), "/usr/bin/%s",
19 AFPFSD_FILENAME);
20+ filename[sizeof(filename) - 1] = 0;
21 if (access(filename,X_OK)) {
22 printf("Could not find server (%s)\n",
23 filename);
24diff -up afpfs-ng-0.8.1/fuse/fuse_int.c.pointer afpfs-ng-0.8.1/fuse/fuse_int.c
25--- afpfs-ng-0.8.1/fuse/fuse_int.c.pointer 2008-03-02 06:06:24.000000000 +0100
26+++ afpfs-ng-0.8.1/fuse/fuse_int.c 2011-06-14 17:02:15.000000000 +0200
27@@ -197,7 +197,7 @@ static int fuse_open(const char *path, s
28 ret = ml_open(volume,path,flags,&fp);
29
30 if (ret==0)
31- fi->fh=(void *) fp;
32+ fi->fh=(unsigned long) fp;
33
34 return ret;
35 }
36diff -up afpfs-ng-0.8.1/include/afp.h.pointer afpfs-ng-0.8.1/include/afp.h
37--- afpfs-ng-0.8.1/include/afp.h.pointer 2008-03-08 17:08:18.000000000 +0100
38+++ afpfs-ng-0.8.1/include/afp.h 2011-06-14 17:02:15.000000000 +0200
39@@ -370,7 +370,7 @@ int afp_unmount_all_volumes(struct afp_s
40
41 int afp_opendt(struct afp_volume *volume, unsigned short * refnum);
42
43-int afp_closedt(struct afp_server * server, unsigned short * refnum);
44+int afp_closedt(struct afp_server * server, unsigned short refnum);
45
46 int afp_getcomment(struct afp_volume *volume, unsigned int did,
47 const char * pathname, struct afp_comment * comment);
48diff -up afpfs-ng-0.8.1/include/utils.h.pointer afpfs-ng-0.8.1/include/utils.h
49--- afpfs-ng-0.8.1/include/utils.h.pointer 2008-02-18 04:33:58.000000000 +0100
50+++ afpfs-ng-0.8.1/include/utils.h 2011-06-14 17:02:15.000000000 +0200
51@@ -8,8 +8,8 @@
52 #define hton64(x) (x)
53 #define ntoh64(x) (x)
54 #else /* BYTE_ORDER == BIG_ENDIAN */
55-#define hton64(x) ((u_int64_t) (htonl(((x) >> 32) & 0xffffffffLL)) | \
56- (u_int64_t) ((htonl(x) & 0xffffffffLL) << 32))
57+#define hton64(x) ((u_int64_t) (htonl((((unsigned long long)(x)) >> 32) & 0xffffffffLL)) | \
58+ (u_int64_t) ((htonl((unsigned long long)(x)) & 0xffffffffLL) << 32))
59 #define ntoh64(x) (hton64(x))
60 #endif /* BYTE_ORDER == BIG_ENDIAN */
61
62diff -up afpfs-ng-0.8.1/lib/afp_url.c.pointer afpfs-ng-0.8.1/lib/afp_url.c
63--- afpfs-ng-0.8.1/lib/afp_url.c.pointer 2008-03-04 21:16:49.000000000 +0100
64+++ afpfs-ng-0.8.1/lib/afp_url.c 2011-06-14 17:02:15.000000000 +0200
65@@ -33,7 +33,7 @@ static int check_port(char * port)
66 static int check_uamname(const char * uam)
67 {
68 char * p;
69- for (p=uam;*p;p++) {
70+ for (p=(char *)uam;*p;p++) {
71 if (*p==' ') continue;
72 if ((*p<'A') || (*p>'z')) return -1;
73 }
74@@ -188,7 +188,7 @@ int afp_parse_url(struct afp_url * url,
75 return -1;
76
77 }
78- if (p==NULL) p=toparse;
79+ if (p==NULL) p=(char *)toparse;
80
81 /* Now split on the first / */
82 if (sscanf(p,"%[^/]/%[^$]",
83diff -up afpfs-ng-0.8.1/lib/did.c.pointer afpfs-ng-0.8.1/lib/did.c
84--- afpfs-ng-0.8.1/lib/did.c.pointer 2008-02-18 04:39:17.000000000 +0100
85+++ afpfs-ng-0.8.1/lib/did.c 2011-06-14 17:02:15.000000000 +0200
86@@ -226,7 +226,7 @@ int get_dirid(struct afp_volume * volume
87
88
89 /* Go to the end of last known entry */
90- p=path+(p-copy);
91+ p=(char *)path+(p-copy);
92 p2=p;
93
94 while ((p=strchr(p+1,'/'))) {
95diff -up afpfs-ng-0.8.1/lib/dsi.c.pointer afpfs-ng-0.8.1/lib/dsi.c
96--- afpfs-ng-0.8.1/lib/dsi.c.pointer 2008-02-18 04:53:03.000000000 +0100
97+++ afpfs-ng-0.8.1/lib/dsi.c 2011-06-14 17:02:15.000000000 +0200
98@@ -474,7 +474,7 @@ void dsi_getstatus_reply(struct afp_serv
99 }
100 server->flags=ntohs(reply1->flags);
101
102- p=(void *)((unsigned int) server->incoming_buffer + sizeof(*reply1));
103+ p=(void *)((unsigned long) server->incoming_buffer + sizeof(*reply1));
104 p+=copy_from_pascal(server->server_name,p,AFP_SERVER_NAME_LEN)+1;
105
106 /* Now work our way through the variable bits */
107@@ -757,7 +757,7 @@ gotenough:
108 printf("<<< read() of rest of AFP, %d bytes\n",amount_to_read);
109 #endif
110 ret = read(server->fd, (void *)
111- (((unsigned int) server->incoming_buffer)+server->data_read),
112+ (((unsigned long) server->incoming_buffer)+server->data_read),
113 amount_to_read);
114 if (ret<0) return -1;
115 if (ret==0) {
116diff -up afpfs-ng-0.8.1/lib/loop.c.pointer afpfs-ng-0.8.1/lib/loop.c
117--- afpfs-ng-0.8.1/lib/loop.c.pointer 2008-02-18 04:40:11.000000000 +0100
118+++ afpfs-ng-0.8.1/lib/loop.c 2011-06-14 17:02:15.000000000 +0200
119@@ -25,7 +25,7 @@
120 static unsigned char exit_program=0;
121
122 static pthread_t ending_thread;
123-static pthread_t main_thread = NULL;
124+static pthread_t main_thread = (pthread_t)NULL;
125
126 static int loop_started=0;
127 static pthread_cond_t loop_started_condition;
128diff -up afpfs-ng-0.8.1/lib/lowlevel.c.pointer afpfs-ng-0.8.1/lib/lowlevel.c
129--- afpfs-ng-0.8.1/lib/lowlevel.c.pointer 2008-02-20 02:33:17.000000000 +0100
130+++ afpfs-ng-0.8.1/lib/lowlevel.c 2011-06-14 17:02:15.000000000 +0200
131@@ -582,7 +582,7 @@ int ll_getattr(struct afp_volume * volum
132 if (volume->server->using_version->av_number>=30)
133 stbuf->st_mode |= fp.unixprivs.permissions;
134 else
135- set_nonunix_perms(stbuf,&fp);
136+ set_nonunix_perms(&stbuf->st_mode,&fp);
137
138 stbuf->st_uid=fp.unixprivs.uid;
139 stbuf->st_gid=fp.unixprivs.gid;
140diff -up afpfs-ng-0.8.1/lib/midlevel.c.pointer afpfs-ng-0.8.1/lib/midlevel.c
141--- afpfs-ng-0.8.1/lib/midlevel.c.pointer 2008-03-08 17:08:18.000000000 +0100
142+++ afpfs-ng-0.8.1/lib/midlevel.c 2011-06-14 17:02:15.000000000 +0200
143@@ -713,7 +713,7 @@ int ml_write(struct afp_volume * volume,
144 {
145
146 int ret,err=0;
147- int totalwritten = 0;
148+ size_t totalwritten = 0;
149 uint64_t sizetowrite, ignored;
150 unsigned char flags = 0;
151 unsigned int max_packet_size=volume->server->tx_quantum;
152diff -up afpfs-ng-0.8.1/lib/proto_attr.c.pointer afpfs-ng-0.8.1/lib/proto_attr.c
153--- afpfs-ng-0.8.1/lib/proto_attr.c.pointer 2008-01-30 05:37:58.000000000 +0100
154+++ afpfs-ng-0.8.1/lib/proto_attr.c 2011-06-14 17:02:15.000000000 +0200
155@@ -166,7 +166,7 @@ int afp_getextattr(struct afp_volume * v
156 copy_path(server,p,pathname,strlen(pathname));
157 unixpath_to_afppath(server,p);
158 p2=p+sizeof_path_header(server)+strlen(pathname);
159- if (((unsigned int ) p2) & 0x1) p2++;
160+ if (((unsigned long) p2) & 0x1) p2++;
161 req2=(void *) p2;
162
163 req2->len=htons(namelen);
164diff -up afpfs-ng-0.8.1/lib/proto_desktop.c.pointer afpfs-ng-0.8.1/lib/proto_desktop.c
165--- afpfs-ng-0.8.1/lib/proto_desktop.c.pointer 2008-02-18 04:44:11.000000000 +0100
166+++ afpfs-ng-0.8.1/lib/proto_desktop.c 2011-06-14 17:02:15.000000000 +0200
167@@ -168,7 +168,7 @@ int afp_getcomment_reply(struct afp_serv
168 return 0;
169 }
170
171-int afp_closedt(struct afp_server * server, unsigned short * refnum)
172+int afp_closedt(struct afp_server * server, unsigned short refnum)
173 {
174 struct {
175 struct dsi_header dsi_header __attribute__((__packed__));
176diff -up afpfs-ng-0.8.1/lib/proto_directory.c.pointer afpfs-ng-0.8.1/lib/proto_directory.c
177--- afpfs-ng-0.8.1/lib/proto_directory.c.pointer 2008-02-19 03:39:29.000000000 +0100
178+++ afpfs-ng-0.8.1/lib/proto_directory.c 2011-06-14 17:02:15.000000000 +0200
179@@ -248,6 +248,7 @@ int afp_enumerate_reply(struct afp_serve
180
181 return 0;
182 }
183+
184 int afp_enumerateext2_reply(struct afp_server *server, char * buf, unsigned int size, void * other)
185 {
186
187@@ -266,8 +267,7 @@ int afp_enumerateext2_reply(struct afp_s
188 char * p = buf + sizeof(*reply);
189 int i;
190 char *max=buf+size;
191- struct afp_file_info * filebase = NULL, *filecur=NULL, *new_file=NULL;
192- void ** x = other;
193+ struct afp_file_info * filebase = NULL, *filecur = NULL, *new_file = NULL, **x = (struct afp_file_info **) other;
194
195 if (reply->dsi_header.return_code.error_code) {
196 return reply->dsi_header.return_code.error_code;
197diff -up afpfs-ng-0.8.1/lib/proto_map.c.pointer afpfs-ng-0.8.1/lib/proto_map.c
198--- afpfs-ng-0.8.1/lib/proto_map.c.pointer 2008-01-30 05:37:59.000000000 +0100
199+++ afpfs-ng-0.8.1/lib/proto_map.c 2011-06-14 17:02:15.000000000 +0200
200@@ -122,7 +122,7 @@ int afp_mapid_reply(struct afp_server *s
201
202 if (reply->header.return_code.error_code!=kFPNoErr) return -1;
203
204- copy_from_pascal_two(name,&reply->name,255);
205+ copy_from_pascal_two(name,reply->name,255);
206
207 return 0;
208 }
209diff -up afpfs-ng-0.8.1/lib/proto_session.c.pointer afpfs-ng-0.8.1/lib/proto_session.c
210--- afpfs-ng-0.8.1/lib/proto_session.c.pointer 2008-02-18 04:46:19.000000000 +0100
211+++ afpfs-ng-0.8.1/lib/proto_session.c 2011-06-14 17:02:15.000000000 +0200
212@@ -39,7 +39,7 @@ int afp_getsessiontoken(struct afp_serve
213 switch (type) {
214 case kLoginWithTimeAndID:
215 case kReconnWithTimeAndID: {
216- uint32_t *p = (void *) (((unsigned int) request)+
217+ uint32_t *p = (void *) (((unsigned long) request)+
218 sizeof(*request));
219
220 offset=sizeof(timestamp);
221@@ -63,7 +63,7 @@ int afp_getsessiontoken(struct afp_serve
222 goto error;
223 }
224
225- data=(void *) (((unsigned int) request)+sizeof(*request)+offset);
226+ data=(void *) (((unsigned long) request)+sizeof(*request)+offset);
227 request->idlength=htonl(datalen);
228 request->pad=0;
229 request->type=htons(type);
230@@ -127,7 +127,7 @@ int afp_disconnectoldsession(struct afp_
231 if ((request=malloc(sizeof(*request) + AFP_TOKEN_MAX_LEN))==NULL)
232 return -1;
233
234- token_data = request + sizeof(*request);
235+ token_data = (char *)request + sizeof(*request);
236
237 request->type=htons(type);
238
239diff -up afpfs-ng-0.8.1/lib/uams.c.pointer afpfs-ng-0.8.1/lib/uams.c
240--- afpfs-ng-0.8.1/lib/uams.c.pointer 2008-01-04 04:52:44.000000000 +0100
241+++ afpfs-ng-0.8.1/lib/uams.c 2011-06-14 17:02:15.000000000 +0200
242@@ -180,7 +180,7 @@ static int cleartxt_login(struct afp_ser
243 goto cleartxt_fail;
244
245 p += copy_to_pascal(p, username) + 1;
246- if ((int)p & 0x1)
247+ if ((long)p & 0x1)
248 len--;
249 else
250 p++;
251@@ -230,7 +230,7 @@ static int cleartxt_passwd(struct afp_se
252 goto cleartxt_fail;
253
254 p += copy_to_pascal(p, username) + 1;
255- if ((int)p & 0x1)
256+ if ((long)p & 0x1)
257 len--;
258 else
259 p++;
260@@ -580,7 +580,7 @@ static int dhx_login(struct afp_server *
261 if (ai == NULL)
262 goto dhx_noctx_fail;
263 d += copy_to_pascal(ai, username) + 1;
264- if (((int)d) % 2)
265+ if (((long)d) % 2)
266 d++;
267 else
268 ai_len--;
269diff -up afpfs-ng-0.8.1/lib/utils.c.pointer afpfs-ng-0.8.1/lib/utils.c
270--- afpfs-ng-0.8.1/lib/utils.c.pointer 2008-02-18 04:53:37.000000000 +0100
271+++ afpfs-ng-0.8.1/lib/utils.c 2011-06-14 17:02:15.000000000 +0200
272@@ -196,7 +196,7 @@ int invalid_filename(struct afp_server *
273 maxlen=255;
274
275
276- p=filename+1;
277+ p=(char *)filename+1;
278 while ((q=strchr(p,'/'))) {
279 if (q>p+maxlen)
280 return 1;
This page took 0.102411 seconds and 4 git commands to generate.