]> arthur.barton.de Git - netatalk.git/commitdiff
Fix incompatible func args warnings
authorfranklahm <franklahm>
Thu, 22 Oct 2009 12:35:38 +0000 (12:35 +0000)
committerfranklahm <franklahm>
Thu, 22 Oct 2009 12:35:38 +0000 (12:35 +0000)
12 files changed:
etc/afpd/directory.c
etc/afpd/directory.h
etc/afpd/extattrs.c
etc/afpd/fork.c
etc/afpd/uam.c
etc/afpd/uam_auth.h
include/atalk/asp.h
include/atalk/uam.h
include/atalk/vfs.h
libatalk/asp/asp_write.c
libatalk/util/locking.c
libatalk/vfs/ea.c

index 84f0158491d871e2fd53a6d7869b7e682182dace..c008a74c65436c71facccccba010d2ca8cfd8aaa 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: directory.c,v 1.111 2009-10-16 00:15:53 didg Exp $
+ * $Id: directory.c,v 1.112 2009-10-22 12:35:38 franklahm Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -955,7 +955,7 @@ struct dir *
         LOG(log_error, logtype_afpd, "adddir: malloc: %s", strerror(errno) );
         return NULL;
     }
-    if ((size_t)-1 == convert_string_allocate((utf8_encoding())?CH_UTF8_MAC:vol->v_maccharset, CH_UCS2, path->m_name, strlen(path->m_name), &cdir->d_m_name_ucs2)) {
+    if ((size_t)-1 == convert_string_allocate((utf8_encoding())?CH_UTF8_MAC:vol->v_maccharset, CH_UCS2, path->m_name, strlen(path->m_name), (char **)&cdir->d_m_name_ucs2)) {
         LOG(log_error, logtype_afpd, "Couldn't set UCS2 name for %s", name);
         cdir->d_m_name_ucs2 = NULL;
     }
@@ -1559,7 +1559,7 @@ static int invisible_dots(const struct vol *vol, const char *name)
 int getdirparams(const struct vol *vol,
                  u_int16_t bitmap, struct path *s_path,
                  struct dir *dir, 
-                 char *buf, int *buflen )
+                 char *buf, size_t *buflen )
 {
     struct maccess     ma;
     struct adouble     ad;
index 64a3ef4f27db0f374eca9f5c9ade176f132c39a5..b330140501304b3a429db2c1c5ea7e17d1428e43 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: directory.h,v 1.31 2009-10-15 12:08:22 didg Exp $
+ * $Id: directory.h,v 1.32 2009-10-22 12:35:38 franklahm Exp $
  *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
@@ -130,7 +130,7 @@ extern struct path      *cname (struct vol *, struct dir *,
 extern mode_t           mtoumode (struct maccess *);
 extern void             utommode (struct stat *, struct maccess *);
 extern int getdirparams (const struct vol *, u_int16_t, struct path *,
-                                 struct dir *, char *, int *);
+                                 struct dir *, char *, size_t *);
 extern int setdirparams (const struct vol *, struct path *, u_int16_t, char *);
 extern int renamedir (const struct vol *, char *, char *, struct dir *,
                               struct dir *, char *);
index 2890add282fc85684abd0cc7f3445006044ee941..a26c801a230c2163f22118595fa8688a115b8894 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  $Id: extattrs.c,v 1.8 2009-10-20 09:53:42 franklahm Exp $
+  $Id: extattrs.c,v 1.9 2009-10-22 12:35:38 franklahm Exp $
   Copyright (c) 2009 Frank Lahm <franklahm@gmail.com>
 
   This program is free software; you can redistribute it and/or modify
@@ -84,9 +84,11 @@ int afp_listextattr(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, siz
     struct adouble      ad, *adp = NULL;
     struct ofork        *of;
     char                *uname, *FinderInfo;
-    static int          buf_valid = 0, attrbuflen = 0;
     char                emptyFinderInfo[32] = { 0 };
 
+    static int          buf_valid = 0;
+    static size_t       attrbuflen = 0;
+
     *rbuflen = 0;
     ibuf += 2;
 
index 611dc8f9819f4da607c8f1fabaddc61c31d794f1..57b3268ea8726d0d8cb7bb1d80ad8ead3d73693f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: fork.c,v 1.66 2009-10-22 05:09:56 didg Exp $
+ * $Id: fork.c,v 1.67 2009-10-22 12:35:38 franklahm Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -1374,9 +1374,9 @@ int afp_write_ext(AFPObj *obj, char *ibuf, size_t ibuflen, char *rbuf, size_t *r
 int afp_getforkparams(AFPObj *obj _U_, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *rbuflen)
 {
     struct ofork       *ofork;
-    int                        buflen, ret;
+    int             ret;
     u_int16_t          ofrefnum, bitmap;
-
+    size_t          buflen;
     ibuf += 2;
     memcpy(&ofrefnum, ibuf, sizeof( ofrefnum ));
     ibuf += sizeof( ofrefnum );
index 946af2cf250f37cc339dc8371c2bf145882519a1..74340565b4da5dc26fe9a91195b7ad260e25fc4a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: uam.c,v 1.29 2009-10-15 11:39:48 didg Exp $
+ * $Id: uam.c,v 1.30 2009-10-22 12:35:38 franklahm Exp $
  *
  * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
  * All Rights Reserved.  See COPYRIGHT.
@@ -493,7 +493,7 @@ AFPObj *obj = private;
 /* if we need to maintain a connection, this is how we do it.
  * because an action pointer gets passed in, we can stream 
  * DSI connections */
-int uam_afp_read(void *handle, char *buf, int *buflen,
+int uam_afp_read(void *handle, char *buf, size_t *buflen,
                  int (*action)(void *, void *, const int))
 {
     AFPObj *obj = handle;
index 07669b0fcb950536331ec0c8695e42d3ca2e680e..7c879b313797300d85b00d209dbc8224dca98e82 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: uam_auth.h,v 1.6 2009-10-13 22:55:37 didg Exp $
+ * $Id: uam_auth.h,v 1.7 2009-10-22 12:35:38 franklahm Exp $
  *
  * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
  * All Rights Reserved.  See COPYRIGHT.
@@ -29,15 +29,15 @@ struct uam_obj {
     union {
         struct {
             int (*login) (void *, struct passwd **,
-                              char *, int, char *, int *);
+                              char *, int, char *, size_t *);
             int (*logincont) (void *, struct passwd **, char *,
-                                  int, char *, int *);
+                                  int, char *, size_t *);
             void (*logout) (void);
             int (*login_ext) (void *, char *, struct passwd **,
-                              char *, int, char *, int *);
+                              char *, int, char *, size_t *);
         } uam_login;
         int (*uam_changepw) (void *, char *, struct passwd *, char *,
-                                 int, char *, int *);
+                                 int, char *, size_t *);
     } u;
     struct uam_obj *uam_prev, *uam_next;
 };
index 7c555e481ad9ecec304e50eeaf988b57c4e51499..fcc40a1d635081a5fd4769cae7dda9d25067e121 100644 (file)
@@ -95,7 +95,7 @@ extern int asp_shutdown     (ASP);
 extern int asp_attention    (ASP, AFPUserBytes);
 extern int asp_getrequest   (ASP);
 extern int asp_cmdreply     (ASP, int);
-extern int asp_wrtcont      (ASP, char *, int *);
+extern int asp_wrtcont      (ASP, char *, size_t *);
 #define asp_wrtreply(a,b)   asp_cmdreply((a), (b))
 extern void asp_kill        (int);
 extern int asp_tickle      (ASP, const u_int8_t, struct sockaddr_at *);
index ed79772d44950f6e4a42aea2d13c657191a71bad..f54a5d31e1ac7a54256dca3183e141c96bcaeadd 100644 (file)
@@ -86,7 +86,7 @@ extern struct passwd *uam_getname (void*, char *, const int);
 extern int uam_checkuser (const struct passwd *);
 
 /* afp helper functions */
-extern int uam_afp_read (void *, char *, int *,
+extern int uam_afp_read (void *, char *, size_t *,
                             int (*)(void *, void *, const int));
 extern int uam_afpserver_option (void *, const int, void *, size_t *);
 #ifdef TRU64
index dba6b231c8eb5a8824754791d7d7db5c174aeba2..0797e04511e65ab08520e039523fb0ef76f15f47 100644 (file)
 #define VFS_FUNC_ARGS_REMOVE_ACL const struct vol *vol, const char *path, int dir
 #define VFS_FUNC_VARS_REMOVE_ACL vol, path, dir
 
-#define VFS_FUNC_ARGS_EA_GETSIZE const struct vol * restrict vol, char * restrict rbuf, int * restrict rbuflen, const char * restrict uname, int oflag, const char * restrict attruname
+#define VFS_FUNC_ARGS_EA_GETSIZE const struct vol * restrict vol, char * restrict rbuf, size_t * restrict rbuflen, const char * restrict uname, int oflag, const char * restrict attruname
 #define VFS_FUNC_VARS_EA_GETSIZE vol, rbuf, rbuflen, uname, oflag, attruname
 
-#define VFS_FUNC_ARGS_EA_GETCONTENT const struct vol * restrict vol, char * restrict rbuf, int * restrict rbuflen,  const char * restrict uname, int oflag, const char * restrict attruname, int maxreply
+#define VFS_FUNC_ARGS_EA_GETCONTENT const struct vol * restrict vol, char * restrict rbuf, size_t * restrict rbuflen,  const char * restrict uname, int oflag, const char * restrict attruname, int maxreply
 #define VFS_FUNC_VARS_EA_GETCONTENT vol, rbuf, rbuflen, uname, oflag, attruname, maxreply
 
-#define VFS_FUNC_ARGS_EA_LIST const struct vol * restrict vol, char * restrict attrnamebuf, int * restrict buflen, const char * restrict uname, int oflag
+#define VFS_FUNC_ARGS_EA_LIST const struct vol * restrict vol, char * restrict attrnamebuf, size_t * restrict buflen, const char * restrict uname, int oflag
 #define VFS_FUNC_VARS_EA_LIST vol, attrnamebuf, buflen, uname, oflag
 
 #define VFS_FUNC_ARGS_EA_SET const struct vol * restrict vol, const char * restrict uname, const char * restrict attruname, const char * restrict ibuf, size_t attrsize, int oflag
index 8bbf4f5f325ca01da41d7173aac966e73adeffda..2819e3152db6a357f5611e7463e4a7266971fa5c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: asp_write.c,v 1.3 2001-06-29 14:14:46 rufustfirefly Exp $
+ * $Id: asp_write.c,v 1.4 2009-10-22 12:35:39 franklahm Exp $
  *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
@@ -39,7 +39,7 @@
 #define memmove(a, b, n)   bcopy((b), (a), (n))
 #endif /* BSD || BSD4_3 */
 
-int asp_wrtcont(ASP asp, char *buf, int *buflen)
+int asp_wrtcont(ASP asp, char *buf, size_t *buflen)
 {
     struct iovec       iov[ ASP_MAXPACKETS ];
     struct atp_block   atpb;
index 7fdb5d8106b124e3907f1887acc86ac595c265e1..b7ffd7663bc6f5f3343209404b40d1c703ba1a4a 100644 (file)
@@ -1,5 +1,5 @@
 /*
-   $Id: locking.c,v 1.2 2009-10-14 01:38:29 didg Exp $
+   $Id: locking.c,v 1.3 2009-10-22 12:35:39 franklahm Exp $
    Copyright (c) 2009 Frank Lahm <franklahm@gmail.com>
 
    This program is free software; you can redistribute it and/or modify
    GNU General Public License for more details.
 */
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif /* HAVE_CONFIG_H */
+
 #include <unistd.h>
 #include <fcntl.h>
 #include <atalk/util.h>
index a0366cff18c7760ac758aece0e7ea0e242ea2296..e5d4fdb8a29449041ee5a2cca4b820df453714d0 100644 (file)
@@ -1,5 +1,5 @@
 /*
-  $Id: ea.c,v 1.8 2009-10-21 17:41:45 franklahm Exp $
+  $Id: ea.c,v 1.9 2009-10-22 12:35:39 franklahm Exp $
   Copyright (c) 2009 Frank Lahm <franklahm@gmail.com>
 
   This program is free software; you can redistribute it and/or modify
@@ -908,12 +908,7 @@ exit:
  *
  * Copies EA size into rbuf in network order. Increments *rbuflen +4.
  */
-int get_easize(const struct vol * restrict vol,
-               char * restrict rbuf,
-               int * restrict rbuflen,
-               const char * restrict uname,
-               int oflag,
-               const char * restrict attruname)
+int get_easize(VFS_FUNC_ARGS_EA_GETSIZE)
 {
     int ret = AFPERR_MISC, count = 0;
     uint32_t uint32;
@@ -969,13 +964,7 @@ int get_easize(const struct vol * restrict vol,
  *
  * Copies EA into rbuf. Increments *rbuflen accordingly.
  */
-int get_eacontent(const struct vol * restrict vol,
-                  char * restrict rbuf,
-                  int * restrict rbuflen,
-                  const char * restrict uname,
-                  int oflag,
-                  const char * restrict attruname,
-                  int maxreply)
+int get_eacontent(VFS_FUNC_ARGS_EA_GETCONTENT)
 {
     int ret = AFPERR_MISC, count = 0, fd = -1;
     uint32_t uint32;
@@ -1058,11 +1047,7 @@ int get_eacontent(const struct vol * restrict vol,
  * Copies names of all EAs of uname as consecutive C strings into rbuf.
  * Increments *buflen accordingly.
  */
-int list_eas(const struct vol * restrict vol,
-             char * restrict attrnamebuf,
-             int * restrict buflen,
-             const char * restrict uname,
-             int oflag)
+int list_eas(VFS_FUNC_ARGS_EA_LIST)
 {
     int count = 0, attrbuflen = *buflen, ret = AFP_OK, len;
     char *buf = attrnamebuf;