]> arthur.barton.de Git - netatalk.git/commitdiff
Back-port from trunk: warning fixes.
authorsrittau <srittau>
Wed, 2 Jan 2002 17:27:50 +0000 (17:27 +0000)
committersrittau <srittau>
Wed, 2 Jan 2002 17:27:50 +0000 (17:27 +0000)
etc/afpd/desktop.c
etc/afpd/enumerate.c
etc/afpd/icon.h
etc/afpd/main.c
etc/afpd/messages.c
etc/afpd/parse_mtab.c
etc/afpd/parse_mtab.h
etc/afpd/quota.c
etc/afpd/status.c

index 59961e6cbfa61c794b2e775a38160122f97692ab..706cca109d46a44b3e4818a9cdb473e18c742bb7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: desktop.c,v 1.7.2.1 2001-12-03 05:01:04 jmarcus Exp $
+ * $Id: desktop.c,v 1.7.2.2 2002-01-02 17:27:50 srittau Exp $
  *
  * See COPYRIGHT.
  */
@@ -603,11 +603,11 @@ char *dtfile(const struct vol *vol, u_char creator[], char *ext )
 
 char *mtoupath(const struct vol *vol, char *mpath)
 {
-    static unsigned char        upath[ MAXPATHLEN + 1];
-    unsigned char      *m, *u;
+    static char  upath[ MAXPATHLEN + 1];
+    char       *m, *u;
     int                 i = 0;
 
-    if ( mpath == NULL || *mpath == '\0' ) {
+    if ( *mpath == '\0' ) {
         return( "." );
     }
 
@@ -625,7 +625,7 @@ char *mtoupath(const struct vol *vol, char *mpath)
 #if 1
         if (vol->v_mtoupage && ((*m & 0x80) ||
                                 vol->v_flags & AFPVOL_MAPASCII)) {
-            *u = vol->v_mtoupage->map[*m].value;
+            *u = vol->v_mtoupage->map[(unsigned char) *m].value;
         } else
 #endif /* 1 */
 #if AD_VERSION == AD_VERSION1
@@ -659,9 +659,9 @@ char *mtoupath(const struct vol *vol, char *mpath)
 
 char *utompath(const struct vol *vol, char *upath)
 {
-    static unsigned char mpath[ MAXPATHLEN + 1];
-    unsigned char              *m, *u;
-    int                         h;
+    static char  mpath[ MAXPATHLEN + 1];
+    char        *m, *u;
+    int          h;
 
     /* do the hex conversion */
     u = upath;
@@ -669,9 +669,9 @@ char *utompath(const struct vol *vol, char *upath)
     while ( *u != '\0' ) {
         /* we have a code page */
 #if 1
-        if (vol->v_utompage && ((*u > 0x7F) ||
+        if (vol->v_utompage && ((*u & 0x80) ||
                                 (vol->v_flags & AFPVOL_MAPASCII))) {
-            *m = vol->v_utompage->map[*u].value;
+            *m = vol->v_utompage->map[(unsigned char) *u].value;
         } else
 #endif /* 1 */
             if ( *u == ':' && *(u+1) != '\0' && islxdigit( *(u+1)) &&
index 461633478d4fc6130272d26dc7f61b52eea0d799..dcbf5bcc3d8fec4834985d9963c92d72d51937a1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: enumerate.c,v 1.9.2.1 2001-12-03 05:01:04 jmarcus Exp $
+ * $Id: enumerate.c,v 1.9.2.2 2002-01-02 17:27:50 srittau Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -32,6 +32,7 @@
 #include "volume.h"
 #include "globals.h"
 #include "file.h"
+#include "filedir.h"
 
 /* check for mtab DID code */
 #ifdef DID_MTAB
index c75b4588b5e05d1781875e0e21ad8c2e8d3148fd..b5df14b721e4ff497bf12af1d35c62eb22e1b4fe 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: icon.h,v 1.2.2.1 2001-12-03 05:01:04 jmarcus Exp $
+ * $Id: icon.h,v 1.2.2.2 2002-01-02 17:27:50 srittau Exp $
  *
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -82,7 +82,7 @@ const unsigned char apple_tcp_icon[] = { /* default asip icon */
 };
 
 #if defined( ultrix )
-const u_char   icon[] = {      /* declogo */
+const unsigned char icon[] = { /* declogo */
     0x0, 0x80, 0x0, 0x0, 0x1, 0xC0, 0x0, 0x0,
     0x3, 0xE0, 0x0, 0x0, 0x7, 0xF0, 0x0, 0x0,
     0xF, 0xB0, 0x0, 0x0, 0x13, 0x6C, 0x0, 0x0,
@@ -119,7 +119,7 @@ const u_char        icon[] = {      /* declogo */
 
 #else
 #if defined( vax )
-const u_char   icon[] = {      /* daemon */
+const unsigned char icon[] = { /* daemon */
     0x0, 0x0, 0x0, 0x0, 0x0, 0x80, 0x2, 0x0,
     0x1, 0x80, 0x3, 0x0, 0x2, 0x80, 0x2, 0x80,
     0x2, 0x80, 0x2, 0x80, 0x4, 0x80, 0x2, 0x40,
@@ -156,7 +156,7 @@ const u_char        icon[] = {      /* daemon */
 
 #else
 #if defined( sun )
-const u_char   icon[] = {      /* sunlogo */
+const unsigned char icon[] = { /* sunlogo */
     0x0, 0x0, 0x0, 0x0, 0x0, 0x1, 0x80, 0x0,
     0x0, 0x2, 0x40, 0x0, 0x0, 0x2, 0x20, 0x0,
     0x0, 0x9, 0x10, 0x0, 0x0, 0x4, 0x88, 0x0,
@@ -193,7 +193,7 @@ const u_char        icon[] = {      /* sunlogo */
 
 #else
 #if defined( _IBMR2 )
-const u_char   icon[] = {      /* hagar */
+const unsigned char icon[] = { /* hagar */
     0x0, 0x0, 0x0, 0x0, 0x18, 0x0, 0x0, 0x18,
     0x24, 0x0, 0x0, 0x24, 0x44, 0x3, 0xC0, 0x22,
     0x44, 0xC, 0x30, 0x22, 0x42, 0x30, 0xC, 0x42,
@@ -229,7 +229,7 @@ const u_char        icon[] = {      /* hagar */
 };
 
 #else
-const u_char   icon[] = {      /* globe */
+const unsigned char icon[] = { /* globe */
     0x0, 0x0, 0x0, 0x0, 0x0, 0xF, 0xF0, 0x0,
     0x0, 0x30, 0xC, 0x0, 0x0, 0xC0, 0x3, 0x0,
     0x1, 0x80, 0x3, 0x80, 0x3, 0xE2, 0x1F, 0xC0,
index eb416cc448a124d0d685ea8a3538fb4f6ee4fd23..4e314c0f473e0e725006ae7aacb3625bbb5dee9d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: main.c,v 1.12.2.1 2001-12-03 05:01:04 jmarcus Exp $
+ * $Id: main.c,v 1.12.2.2 2002-01-02 17:27:50 srittau Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -63,6 +63,11 @@ static char **argv = NULL;
 
 unsigned char  nologin = 0;
 
+#ifdef DID_MTAB
+/* global mount table; afpd_st_cnid uses this to lookup the right entry.  */
+static struct afpd_mount_table *afpd_mount_table = NULL;
+#endif /* DID_MTAB */
+
 struct afp_options default_options;
 static AFPConfig *configs;
 static server_child *server_children;
index eb62369acbf33b3d13aaca311419b3423915f22a..bf4e6c847b4c475eb18b78250e88245b43d5b77d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: messages.c,v 1.9.2.1 2001-12-03 05:01:04 jmarcus Exp $
+ * $Id: messages.c,v 1.9.2.2 2002-01-02 17:27:50 srittau Exp $
  *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * All Rights Reserved.  See COPYRIGHT.
@@ -40,7 +40,7 @@ void readmessage(void)
     uid_t euid;
 
     i=0;
-    // Construct file name SERVERTEXT/message.[pid]
+    /* Construct file name SERVERTEXT/message.[pid] */
     filename=malloc(sizeof(SERVERTEXT)+15);
     sprintf(filename, "%s/message.%d", SERVERTEXT, getpid());
 
index b1bb9bfb63a89e59836d1b6e748663cde023cc69..3ad47bf609f591112201b850dd161af071926965 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: parse_mtab.c,v 1.4.2.1 2001-12-03 05:01:04 jmarcus Exp $
+ * $Id: parse_mtab.c,v 1.4.2.2 2002-01-02 17:27:50 srittau Exp $
  *
  * afpd_mtab_parse & support.  -- rgr, 9-Apr-01.
  */
@@ -40,6 +40,9 @@ char *strchr (), *strrchr ();
          (lval) = malloc(1+strlen(str)), strcpy((lval), (str))
 #endif /* COPY_STRING */
 
+/* global mount table; afpd_st_cnid uses this to lookup the right entry.  */
+static struct afpd_mount_table *afpd_mount_table;
+
 static int
 ceil_log_2 __P((int n))
 /* Return the number of bits required to represent n.  Only works for
index 4254ddd02bf21788f56b8842b2d73584373d4918..cf48e437a84bd0fe6c9e8ada2976e17ec3d02d7a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: parse_mtab.h,v 1.3.2.1 2001-12-03 05:01:04 jmarcus Exp $
+ * $Id: parse_mtab.h,v 1.3.2.2 2002-01-02 17:27:50 srittau Exp $
  *
  * header for afpd_mtab_parse, afpd_st_cnid
  */
@@ -31,9 +31,6 @@ struct afpd_mount_table {
                           entries may be null */
 };
 
-/* global mount table; afpd_st_cnid uses this to lookup the right entry.  */
-static struct afpd_mount_table *afpd_mount_table = NULL;
-
 extern
     unsigned int
     afpd_st_cnid __P((struct stat *st));
index d3a9d6a33598b1bf462092fbe031bfcf829c2921..2be5feb3bd6198d5eeeea74d675021dc9fcdbf46 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: quota.c,v 1.11.2.1 2001-12-03 05:01:04 jmarcus Exp $
+ * $Id: quota.c,v 1.11.2.2 2002-01-02 17:27:50 srittau Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -11,6 +11,8 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
+#include <errno.h>
 
 /* STDC check */
 #if STDC_HEADERS
@@ -330,7 +332,7 @@ const u_int32_t     bsize;
         }
 
         if (( vol->v_gvs = (char *)malloc( strlen( p ) + 1 )) == NULL ) {
-            syslog( LOG_ERR, "getquota: malloc: %m" );
+            syslog( LOG_ERR, "getquota: malloc: %s", strerror(errno) );
             return AFPERR_MISC;
         }
         strcpy( vol->v_gvs, p );
@@ -355,7 +357,7 @@ struct dqblk        *dqblk;
     }
 #else /* ultrix */
     if ( gettimeofday( &tv, 0 ) < 0 ) {
-        syslog( LOG_ERR, "overquota: gettimeofday: %m" );
+        syslog( LOG_ERR, "overquota: gettimeofday: %s", strerror(errno) );
         return( AFPERR_PARAM );
     }
     if ( !dqblk->dqb_btimelimit || dqblk->dqb_btimelimit > tv.tv_sec ) {
index 83d3f1cd113bb915b62b77ff95048f9f98d19d20..3019d34bd782d9da5d7306fe6f53c75ba766cc25 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: status.c,v 1.4.2.1 2001-12-03 05:01:04 jmarcus Exp $
+ * $Id: status.c,v 1.4.2.2 2002-01-02 17:27:50 srittau Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -251,7 +251,7 @@ static int status_netaddress(char *data, const int servoffset,
 }
 
 /* returns actual offset to signature */
-static void status_icon(char *data, const char *icondata,
+static void status_icon(char *data, const unsigned char *icondata,
                         const int iconlen, const int sigoffset)
 {
     char                *start = data;