From: srittau Date: Thu, 31 May 2001 18:48:32 +0000 (+0000) Subject: Warning fixes. X-Git-Tag: netatalk-1-5-rc1~401 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=commitdiff_plain;h=a24a8fa9f80174f42fc8d35af3354f53702b1a66 Warning fixes. --- diff --git a/etc/afpd/afp_config.c b/etc/afpd/afp_config.c index 8c658789..0096eb57 100644 --- a/etc/afpd/afp_config.c +++ b/etc/afpd/afp_config.c @@ -95,6 +95,8 @@ static int asp_start(AFPConfig *config, AFPConfig *configs, afp_over_asp(&config->obj); exit (0); } + + return 0; } #endif /* no afp/asp */ @@ -115,6 +117,8 @@ static int dsi_start(AFPConfig *config, AFPConfig *configs, afp_over_dsi(&config->obj); /* start a session */ exit (0); } + + return 0; } #ifndef NO_DDP diff --git a/etc/afpd/afp_dsi.c b/etc/afpd/afp_dsi.c index 7903e511..43bd8e3d 100644 --- a/etc/afpd/afp_dsi.c +++ b/etc/afpd/afp_dsi.c @@ -257,7 +257,7 @@ void afp_over_dsi(AFPObj *obj) case DSIFUNC_WRITE: /* FPWrite and FPAddIcon */ function = (u_char) dsi->commands[0]; if ( obj->options.flags & OPTION_DEBUG ) { - printf("(write) command: %d, %ld\n", function, dsi->cmdlen); + printf("(write) command: %d, %d\n", function, dsi->cmdlen); bprint(dsi->commands, dsi->cmdlen); } diff --git a/etc/afpd/afp_options.c b/etc/afpd/afp_options.c index 2b50abf0..99e308b5 100644 --- a/etc/afpd/afp_options.c +++ b/etc/afpd/afp_options.c @@ -24,6 +24,7 @@ #include #include +#include #include "globals.h" #include "status.h" #include "auth.h" @@ -203,7 +204,7 @@ int afp_options_parseline(char *buf, struct afp_options *options) if ((c = getoption(buf, "-tickleval"))) options->tickleval = atoi(c); - if (c = getoption(buf, "-server_quantum")) + if ((c = getoption(buf, "-server_quantum"))) options->server_quantum = strtoul(c, NULL, 0); @@ -225,7 +226,7 @@ int afp_options_parseline(char *buf, struct afp_options *options) if ((c = getoption(buf, "-nlspath")) && (opt = strdup(c))) options->nlspath = opt; - if (c = getoption(buf, "-ipaddr")) { + if ((c = getoption(buf, "-ipaddr"))) { struct in_addr inaddr; if (inet_aton(c, &inaddr) && (opt = strdup(c))) { if (!gethostbyaddr((const char *) &inaddr, sizeof(inaddr), AF_INET)) @@ -236,18 +237,18 @@ int afp_options_parseline(char *buf, struct afp_options *options) if ((c = getoption(buf, "-port"))) options->port = atoi(c); - if (c = getoption(buf, "-ddpaddr")) + if ((c = getoption(buf, "-ddpaddr"))) atalk_aton(c, &options->ddpaddr); /* do a little checking for the domain name. */ - if (c = getoption(buf, "-fqdn")) { + if ((c = getoption(buf, "-fqdn"))) { char *p = strchr(c, ':'); if (p) *p = '\0'; if (gethostbyname(c)) { if (p) *p = ':'; - if (opt = strdup(c)) + if ((opt = strdup(c))) options->fqdn = opt; } } diff --git a/etc/afpd/auth.c b/etc/afpd/auth.c index dbc7f573..1b8f1f60 100644 --- a/etc/afpd/auth.c +++ b/etc/afpd/auth.c @@ -130,6 +130,8 @@ static int send_reply(const AFPObj *obj, const int err) obj->reply(obj->handle, err); obj->exit(0); + + return AFP_OK; } static int login(AFPObj *obj, struct passwd *pwd, void (*logout)(void)) @@ -303,6 +305,7 @@ int afp_logout(obj, ibuf, ibuflen, rbuf, rbuflen) { syslog(LOG_INFO, "logout %s", obj->username); obj->exit(0); + return AFP_OK; } @@ -472,7 +475,7 @@ int auth_load(const char *path, const char *list) if ((stat(name, &st) == 0) && (mod = uam_load(name, p))) { */ if (stat(name, &st) == 0) { - if (mod = uam_load(name, p)) { + if ((mod = uam_load(name, p))) { uam_attach(&uam_modules, mod); syslog(LOG_INFO, "uam: %s loaded", p); } else { @@ -483,6 +486,8 @@ int auth_load(const char *path, const char *list) } p = strtok(NULL, ","); } + + return 0; } /* get rid of all of the uams */ diff --git a/etc/afpd/codepage.c b/etc/afpd/codepage.c index de6eeb51..eb6013cd 100644 --- a/etc/afpd/codepage.c +++ b/etc/afpd/codepage.c @@ -1,5 +1,5 @@ /* - * $Id: codepage.c,v 1.3 2001-02-23 15:35:37 rufustfirefly Exp $ + * $Id: codepage.c,v 1.4 2001-05-31 18:48:32 srittau Exp $ * * Copyright (c) 2000 Adrian Sun * All Rights Reserved. See COPYRIGHT. @@ -64,7 +64,9 @@ static __inline__ unsigned char *codepage_find(struct codepage *page, static int add_code(struct codepage *page, unsigned char *from, unsigned char *to) { +#if 0 union codepage_val *ptr; +#endif if (page->quantum < 1) /* no quantum given. don't do anything */ return 1; @@ -89,6 +91,7 @@ static int add_code(struct codepage *page, unsigned char *from, map[*from].hash } #endif + return 0; } static struct codepage *init_codepage(const int quantum) diff --git a/etc/afpd/desktop.c b/etc/afpd/desktop.c index 3ef29e72..e1dbf189 100644 --- a/etc/afpd/desktop.c +++ b/etc/afpd/desktop.c @@ -1,5 +1,5 @@ /* - * $Id: desktop.c,v 1.3 2001-02-23 15:35:37 rufustfirefly Exp $ + * $Id: desktop.c,v 1.4 2001-05-31 18:48:32 srittau Exp $ * See COPYRIGHT. */ @@ -549,6 +549,7 @@ geticon_exit: syslog(LOG_INFO, "afp_geticon: %m"); dsi_readdone(dsi); obj->exit(1); + return AFP_OK; } else { if ( read( si.sdt_fd, rbuf, rc ) < rc ) { diff --git a/etc/afpd/directory.c b/etc/afpd/directory.c index 0d774acc..e52a11b0 100644 --- a/etc/afpd/directory.c +++ b/etc/afpd/directory.c @@ -160,6 +160,7 @@ static void dir_rightrotate(vol, dir) dir->d_back = left; } +#if 0 /* recolor after a removal */ static struct dir *dir_rmrecolor(vol, dir) struct vol *vol; @@ -227,7 +228,10 @@ static struct dir *dir_rmrecolor(vol, dir) } } dir->d_color = DIRTREE_COLOR_BLACK; + + return dir; } +#endif /* remove the node from the tree. this is just like insertion, but diff --git a/etc/afpd/enumerate.c b/etc/afpd/enumerate.c index fcde82c3..1e2969af 100644 --- a/etc/afpd/enumerate.c +++ b/etc/afpd/enumerate.c @@ -87,7 +87,7 @@ adddir( vol, dir, name, namlen, upath, upathlen, st ) #endif #endif - if (edir = dirinsert( vol, cdir )) { + if ((edir = dirinsert( vol, cdir ))) { if (edir->d_name) { if (strcmp(edir->d_name, cdir->d_name)) { syslog(LOG_INFO, "WARNING: DID conflict for '%s' and '%s'. Are these the same file?", edir->d_name, cdir->d_name); diff --git a/etc/afpd/file.c b/etc/afpd/file.c index 817c6c93..0868cc6d 100644 --- a/etc/afpd/file.c +++ b/etc/afpd/file.c @@ -1,5 +1,5 @@ /* - * $Id: file.c,v 1.19 2001-04-03 13:20:44 rufustfirefly Exp $ + * $Id: file.c,v 1.20 2001-05-31 18:48:32 srittau Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -807,7 +807,7 @@ int afp_copyfile(obj, ibuf, ibuflen, rbuf, rbuflen ) struct dir *dir; char *newname, *path, *p; u_int32_t sdid, ddid; - int plen, err, did, retvalue = AFP_OK; + int plen, err, retvalue = AFP_OK; u_int16_t svid, dvid; #ifdef DEBUG diff --git a/etc/afpd/filedir.c b/etc/afpd/filedir.c index e57bfc15..6f987771 100644 --- a/etc/afpd/filedir.c +++ b/etc/afpd/filedir.c @@ -553,7 +553,7 @@ int afp_moveandrename(obj, ibuf, ibuflen, rbuf, rbuflen ) char *oldname, *newname; char *path, *p, *upath; int did, rc; - int plen, retvalue; + int plen; u_int16_t vid; #if AD_VERSION > AD_VERSION1 cnid_t id; diff --git a/etc/afpd/uam.c b/etc/afpd/uam.c index f554a1b8..d22dcf19 100644 --- a/etc/afpd/uam.c +++ b/etc/afpd/uam.c @@ -1,5 +1,5 @@ /* - * $Id: uam.c,v 1.7 2001-04-10 18:07:06 rufustfirefly Exp $ + * $Id: uam.c,v 1.8 2001-05-31 18:48:32 srittau Exp $ * * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu) * All Rights Reserved. See COPYRIGHT. @@ -188,7 +188,7 @@ struct passwd *uam_getname(char *name, const int len) setpwent(); while ((pwent = getpwent())) { - if (user = strchr(pwent->pw_gecos, ',')) + if ((user = strchr(pwent->pw_gecos, ','))) *user = '\0'; user = pwent->pw_gecos; @@ -321,7 +321,7 @@ int uam_afpserver_option(void *private, const int what, void *option, break; case UAM_OPTION_PROTOCOL: - *buf = obj->proto; + *buf = (void *) obj->proto; break; case UAM_OPTION_COOKIE: @@ -366,7 +366,7 @@ int uam_afp_read(void *handle, char *buf, int *buflen, goto uam_afp_read_err; } - while (len = (dsi_write(obj->handle, buf, *buflen))) { + while ((len = (dsi_write(obj->handle, buf, *buflen)))) { if ((len = action(handle, buf, len)) < 0) { dsi_writeflush(obj->handle); goto uam_afp_read_err; diff --git a/etc/afpd/unix.c b/etc/afpd/unix.c index 33b1a1c5..ae1c7235 100644 --- a/etc/afpd/unix.c +++ b/etc/afpd/unix.c @@ -133,7 +133,7 @@ void utommode( stat, ma ) * Calculate the mode for a directory using Posix access() calls to * estimate permission, a la mdw. */ -accessmode( path, ma, dir ) +void accessmode( path, ma, dir ) char *path; struct maccess *ma; struct dir *dir; @@ -159,8 +159,6 @@ accessmode( path, ma, dir ) ma->ma_owner |= AR_UWRITE; } } - - return; } int gmem( gid ) @@ -213,7 +211,7 @@ inline int stickydirmode(name, mode, dropbox) const mode_t mode; const int dropbox; { - int uid, retval; + int retval; /* Turn on the sticky bit if this is a drop box, also turn off the setgid bit */ retval=0; @@ -238,7 +236,7 @@ inline int stickydirmode(name, mode, dropbox) } /* end if not & S_IROTH */ } else { /* end if S_IWOTH and not S_IROTH */ #endif DROPKLUDGE - if ( retval=chmod( name, DIRBITS | mode ) < 0 ) { + if ( (retval=chmod( name, DIRBITS | mode )) < 0 ) { syslog( LOG_ERR, "stickydirmode: chmod \"%s\": %m", name ); } #ifdef DROPKLUDGE diff --git a/etc/afpd/volume.c b/etc/afpd/volume.c index 107867bd..3a940602 100644 --- a/etc/afpd/volume.c +++ b/etc/afpd/volume.c @@ -1,5 +1,5 @@ /* - * $Id: volume.c,v 1.6 2001-03-07 15:36:54 rufustfirefly Exp $ + * $Id: volume.c,v 1.7 2001-05-31 18:48:32 srittau Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -14,6 +14,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -167,7 +170,7 @@ static void volxlate(AFPObj *obj, char *dest, int destlen, destlen -= len; } } else if (is_var(p, "$f")) { - if (q = strchr(pwd->pw_gecos, ',')) + if ((q = strchr(pwd->pw_gecos, ','))) *q = '\0'; q = pwd->pw_gecos; } else if (is_var(p, "$g")) { diff --git a/etc/afpd/volume.h b/etc/afpd/volume.h index 4c4dc0b1..8713b6c3 100644 --- a/etc/afpd/volume.h +++ b/etc/afpd/volume.h @@ -1,5 +1,5 @@ /* - * $Id: volume.h,v 1.3 2001-02-28 16:53:24 rufustfirefly Exp $ + * $Id: volume.h,v 1.4 2001-05-31 18:48:32 srittau Exp $ * * Copyright (c) 1990,1994 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -41,7 +41,7 @@ struct vol { #ifdef __svr4__ int v_qfd; #endif /*__svr4__*/ - void *v_gvs; + char *v_gvs; u_int32_t v_time; int v_lastdid; u_int16_t v_vid; diff --git a/etc/atalkd/aep.c b/etc/atalkd/aep.c index 5e5726dc..f378b063 100644 --- a/etc/atalkd/aep.c +++ b/etc/atalkd/aep.c @@ -16,7 +16,7 @@ #include "atserv.h" -aep_packet( ap, from, data, len ) +int aep_packet( ap, from, data, len ) struct atport *ap; struct sockaddr_at *from; char *data; diff --git a/etc/atalkd/main.c b/etc/atalkd/main.c index 30a2bc06..45d91a35 100644 --- a/etc/atalkd/main.c +++ b/etc/atalkd/main.c @@ -55,6 +55,9 @@ #include "atserv.h" #include "main.h" +/* Forward Declarations */ +int ifconfig(char *iname, unsigned long cmd, struct sockaddr_at *sa); + /* FIXME/SOCKLEN_T: socklen_t is a unix98 feature */ #ifndef SOCKLEN_T #define SOCKLEN_T unsigned int