1 diff -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
10 diff -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",
20 + filename[sizeof(filename) - 1] = 0;
21 if (access(filename,X_OK)) {
22 printf("Could not find server (%s)\n",
24 diff -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);
32 + fi->fh=(unsigned long) fp;
36 diff -up afpfs-ng-0.8.1/include/afpfs-ng/afp.h.pointer afpfs-ng-0.8.1/include/afp.h
37 --- afpfs-ng-0.8.1/include/afpfs-ng/afp.h.pointer 2008-03-08 17:08:18.000000000 +0100
38 +++ afpfs-ng-0.8.1/include/afpfs-ng/afp.h 2011-06-14 17:02:15.000000000 +0200
39 @@ -370,7 +370,7 @@ int afp_unmount_all_volumes(struct afp_s
41 int afp_opendt(struct afp_volume *volume, unsigned short * refnum);
43 -int afp_closedt(struct afp_server * server, unsigned short * refnum);
44 +int afp_closedt(struct afp_server * server, unsigned short refnum);
46 int afp_getcomment(struct afp_volume *volume, unsigned int did,
47 const char * pathname, struct afp_comment * comment);
48 diff -up afpfs-ng-0.8.1/include/afpfs-gn/utils.h.pointer afpfs-ng-0.8.1/include/utils.h
49 --- afpfs-ng-0.8.1/include/afpfs-ng/utils.h.pointer 2008-02-18 04:33:58.000000000 +0100
50 +++ afpfs-ng-0.8.1/include/afpfs-ng/utils.h 2011-06-14 17:02:15.000000000 +0200
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 */
62 diff -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)
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;
74 @@ -188,7 +188,7 @@ int afp_parse_url(struct afp_url * url,
78 - if (p==NULL) p=toparse;
79 + if (p==NULL) p=(char *)toparse;
81 /* Now split on the first / */
82 if (sscanf(p,"%[^/]/%[^$]",
83 diff -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
89 /* Go to the end of last known entry */
91 + p=(char *)path+(p-copy);
94 while ((p=strchr(p+1,'/'))) {
95 diff -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
100 server->flags=ntohs(reply1->flags);
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;
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);
110 ret = read(server->fd, (void *)
111 - (((unsigned int) server->incoming_buffer)+server->data_read),
112 + (((unsigned long) server->incoming_buffer)+server->data_read),
114 if (ret<0) return -1;
116 diff -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
120 static unsigned char exit_program=0;
122 static pthread_t ending_thread;
123 -static pthread_t main_thread = NULL;
124 +static pthread_t main_thread = (pthread_t)NULL;
126 static int loop_started=0;
127 static pthread_cond_t loop_started_condition;
128 diff -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;
135 - set_nonunix_perms(stbuf,&fp);
136 + set_nonunix_perms(&stbuf->st_mode,&fp);
138 stbuf->st_uid=fp.unixprivs.uid;
139 stbuf->st_gid=fp.unixprivs.gid;
140 diff -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,
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;
152 diff -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++;
163 req2->len=htons(namelen);
164 diff -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
171 -int afp_closedt(struct afp_server * server, unsigned short * refnum)
172 +int afp_closedt(struct afp_server * server, unsigned short refnum)
175 struct dsi_header dsi_header __attribute__((__packed__));
176 diff -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
184 int afp_enumerateext2_reply(struct afp_server *server, char * buf, unsigned int size, void * other)
187 @@ -266,8 +267,7 @@ int afp_enumerateext2_reply(struct afp_s
188 char * p = buf + sizeof(*reply);
191 - struct afp_file_info * filebase = NULL, *filecur=NULL, *new_file=NULL;
193 + struct afp_file_info * filebase = NULL, *filecur = NULL, *new_file = NULL, **x = (struct afp_file_info **) other;
195 if (reply->dsi_header.return_code.error_code) {
196 return reply->dsi_header.return_code.error_code;
197 diff -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
202 if (reply->header.return_code.error_code!=kFPNoErr) return -1;
204 - copy_from_pascal_two(name,&reply->name,255);
205 + copy_from_pascal_two(name,reply->name,255);
209 diff -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
214 case kLoginWithTimeAndID:
215 case kReconnWithTimeAndID: {
216 - uint32_t *p = (void *) (((unsigned int) request)+
217 + uint32_t *p = (void *) (((unsigned long) request)+
220 offset=sizeof(timestamp);
221 @@ -63,7 +63,7 @@ int afp_getsessiontoken(struct afp_serve
225 - data=(void *) (((unsigned int) request)+sizeof(*request)+offset);
226 + data=(void *) (((unsigned long) request)+sizeof(*request)+offset);
227 request->idlength=htonl(datalen);
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)
234 - token_data = request + sizeof(*request);
235 + token_data = (char *)request + sizeof(*request);
237 request->type=htons(type);
239 diff -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
245 p += copy_to_pascal(p, username) + 1;
251 @@ -230,7 +230,7 @@ static int cleartxt_passwd(struct afp_se
254 p += copy_to_pascal(p, username) + 1;
260 @@ -580,7 +580,7 @@ static int dhx_login(struct afp_server *
263 d += copy_to_pascal(ai, username) + 1;
269 diff -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 *
277 + p=(char *)filename+1;
278 while ((q=strchr(p,'/'))) {