]> arthur.barton.de Git - netatalk.git/commitdiff
Warning fixes.
authorsrittau <srittau>
Thu, 31 May 2001 18:48:32 +0000 (18:48 +0000)
committersrittau <srittau>
Thu, 31 May 2001 18:48:32 +0000 (18:48 +0000)
16 files changed:
etc/afpd/afp_config.c
etc/afpd/afp_dsi.c
etc/afpd/afp_options.c
etc/afpd/auth.c
etc/afpd/codepage.c
etc/afpd/desktop.c
etc/afpd/directory.c
etc/afpd/enumerate.c
etc/afpd/file.c
etc/afpd/filedir.c
etc/afpd/uam.c
etc/afpd/unix.c
etc/afpd/volume.c
etc/afpd/volume.h
etc/atalkd/aep.c
etc/atalkd/main.c

index 8c6587893d8c9b1e8d7ca91b7b9ad586c7a3ad00..0096eb5775fce890b2974523a0e8de544ac8de3c 100644 (file)
@@ -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
index 7903e5113ba4de8e30cf733ceec0f938cc90c7e2..43bd8e3de738b63bed97066e38e6145c471f9106 100644 (file)
@@ -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);
       }
 
index 2b50abf040d6a13a34ac3b9f14d0e179781484dd..99e308b57da815a81531aa006dad9a4864cfdbc6 100644 (file)
@@ -24,6 +24,7 @@
 #include <netdb.h>
 
 #include <atalk/paths.h>
+#include <atalk/util.h>
 #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;
     }
   }
index dbc7f573fc2ec6cb20ed1c76ca43d816b138d1ab..1b8f1f60ea99e5b758c4205a1c52d34c7915e57f 100644 (file)
@@ -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 */
index de6eeb51dd6521587694fa094f1c9f42065a2f68..eb6013cdd00ef6a82e55cf59aea79d93cffb5225 100644 (file)
@@ -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)
index 3ef29e729e2db62c4c9b058f81ffd5f9b8d81e82..e1dbf1890207b37a99b1581dd707bf654bc0e413 100644 (file)
@@ -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 ) {
index 0d774acc49a98edc31f375ae2f597e9adb24a598..e52a11b0584e66936dbb8fa15262faeab8fa12a5 100644 (file)
@@ -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
index fcde82c3fd8f7688d53fe99fdadf9c2cb5d2804d..1e2969af7b1ba466e32e902b9f04cc9aef59a57b 100644 (file)
@@ -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);
index 817c6c93e4cec41238a3f8b10271d11e5afba061..0868cc6d1331735981aaee3c34726afdee007084 100644 (file)
@@ -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
index e57bfc15d0d769f84c75fb7856f39b2322e83511..6f9877719e6f45ccd3e8c683ef0b09ddc280a9a6 100644 (file)
@@ -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;
index f554a1b8ba62c0878c1f2c15a62497f7c53b7811..d22dcf196eddb777fadfa788e1a26facfd626164 100644 (file)
@@ -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;
index 33b1a1c50633ca7be566315c1a06d82031c823b1..ae1c7235f582842aba95747a0acf15e4e86aec89 100644 (file)
@@ -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
index 107867bd200dd68ae778592d444b4f4701e37894..3a940602941e773353478abf626e6f001dcf3cdd 100644 (file)
@@ -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 <sys/types.h>
 #include <sys/stat.h>
 #include <sys/param.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
 #include <netatalk/endian.h>
 #include <atalk/asp.h>
 #include <atalk/dsi.h>
@@ -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")) {
index 4c4dc0b1d44bf6e5e9bd8ef8b4f02ffed4a9ae63..8713b6c3792a8a5cd84893957715d82988914eea 100644 (file)
@@ -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;
index 5e5726dc5315d4d2f9b156951c6e40ada04c4974..f378b063fff57418bf10b64ad5ebe68ced50b047 100644 (file)
@@ -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;
index 30a2bc0654a4c943b4e7e0e4c58d4fa105e42e2e..45d91a35cec400fc4686c80ef19eb60353f1c469 100644 (file)
@@ -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