From: franklahm Date: Thu, 22 Oct 2009 12:35:38 +0000 (+0000) Subject: Fix incompatible func args warnings X-Git-Tag: before-ipv6~45 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=commitdiff_plain;h=f758a8c097b044293fa2fe58f8a7fcc2d8909b55 Fix incompatible func args warnings --- diff --git a/etc/afpd/directory.c b/etc/afpd/directory.c index 84f01584..c008a74c 100644 --- a/etc/afpd/directory.c +++ b/etc/afpd/directory.c @@ -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; diff --git a/etc/afpd/directory.h b/etc/afpd/directory.h index 64a3ef4f..b3301405 100644 --- a/etc/afpd/directory.h +++ b/etc/afpd/directory.h @@ -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 *); diff --git a/etc/afpd/extattrs.c b/etc/afpd/extattrs.c index 2890add2..a26c801a 100644 --- a/etc/afpd/extattrs.c +++ b/etc/afpd/extattrs.c @@ -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 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; diff --git a/etc/afpd/fork.c b/etc/afpd/fork.c index 611dc8f9..57b3268e 100644 --- a/etc/afpd/fork.c +++ b/etc/afpd/fork.c @@ -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 ); diff --git a/etc/afpd/uam.c b/etc/afpd/uam.c index 946af2cf..74340565 100644 --- a/etc/afpd/uam.c +++ b/etc/afpd/uam.c @@ -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; diff --git a/etc/afpd/uam_auth.h b/etc/afpd/uam_auth.h index 07669b0f..7c879b31 100644 --- a/etc/afpd/uam_auth.h +++ b/etc/afpd/uam_auth.h @@ -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; }; diff --git a/include/atalk/asp.h b/include/atalk/asp.h index 7c555e48..fcc40a1d 100644 --- a/include/atalk/asp.h +++ b/include/atalk/asp.h @@ -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 *); diff --git a/include/atalk/uam.h b/include/atalk/uam.h index ed79772d..f54a5d31 100644 --- a/include/atalk/uam.h +++ b/include/atalk/uam.h @@ -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 diff --git a/include/atalk/vfs.h b/include/atalk/vfs.h index dba6b231..0797e045 100644 --- a/include/atalk/vfs.h +++ b/include/atalk/vfs.h @@ -67,13 +67,13 @@ #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 diff --git a/libatalk/asp/asp_write.c b/libatalk/asp/asp_write.c index 8bbf4f5f..2819e315 100644 --- a/libatalk/asp/asp_write.c +++ b/libatalk/asp/asp_write.c @@ -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; diff --git a/libatalk/util/locking.c b/libatalk/util/locking.c index 7fdb5d81..b7ffd766 100644 --- a/libatalk/util/locking.c +++ b/libatalk/util/locking.c @@ -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 This program is free software; you can redistribute it and/or modify @@ -13,6 +13,10 @@ GNU General Public License for more details. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif /* HAVE_CONFIG_H */ + #include #include #include diff --git a/libatalk/vfs/ea.c b/libatalk/vfs/ea.c index a0366cff..e5d4fdb8 100644 --- a/libatalk/vfs/ea.c +++ b/libatalk/vfs/ea.c @@ -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 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;