]> arthur.barton.de Git - netatalk.git/commitdiff
Fix all remaining warnings from gcc -Wall that can be fixed
authorfranklahm <franklahm>
Thu, 22 Oct 2009 13:40:11 +0000 (13:40 +0000)
committerfranklahm <franklahm>
Thu, 22 Oct 2009 13:40:11 +0000 (13:40 +0000)
13 files changed:
bin/uniconv/uniconv.c
etc/afpd/afp_dsi.c
etc/afpd/catsearch.c
etc/afpd/desktop.c
etc/afpd/directory.c
etc/afpd/extattrs.c
etc/papd/lp.c
etc/uams/uams_dhx_passwd.c
etc/uams/uams_gss.c
etc/uams/uams_randnum.c
libatalk/dsi/dsi_stream.c
libatalk/tdb/tdb.c
libatalk/util/test/logger_test.c

index 081c4493dfb630c1b3ab60f93043051a45cddfd9..b02943115578b537a84bb54b8a49c1a4eacd3f3b 100644 (file)
@@ -146,11 +146,11 @@ static char *convert_name(char *name, struct stat *st, cnid_t cur_did)
        size_t outlen = 0;
        unsigned char *p,*q;
        int require_conversion = 0;
        size_t outlen = 0;
        unsigned char *p,*q;
        int require_conversion = 0;
-        u_int16_t    flags = conv_flags;
+    u_int16_t    flags = conv_flags;
        cnid_t id;
 
        cnid_t id;
 
-       p = name;
-       q = buffer;
+       p = (unsigned char *)name;
+       q = (unsigned char *)buffer;
 
        /* optimize for ascii case */
        while (*p != 0) {
 
        /* optimize for ascii case */
        while (*p != 0) {
@@ -168,17 +168,17 @@ static char *convert_name(char *name, struct stat *st, cnid_t cur_did)
        }
 
        /* convert charsets */
        }
 
        /* convert charsets */
-       q=buffer;
-       p=name;
+       q=(unsigned char *)buffer;
+       p=(unsigned char *)name;
 
 
-       outlen = convert_charset(ch_from, ch_to, ch_mac, p, strlen(p), q, sizeof(buffer) -2, &flags);
+       outlen = convert_charset(ch_from, ch_to, ch_mac, (char *)p, strlen((char *)p), (char *)q, sizeof(buffer) -2, &flags);
        if ((size_t)-1 == outlen) {
           if ( ch_to == CH_UTF8) {
                /* maybe name is already in UTF8? */
                flags = conv_flags;
        if ((size_t)-1 == outlen) {
           if ( ch_to == CH_UTF8) {
                /* maybe name is already in UTF8? */
                flags = conv_flags;
-               q = (char*) buffer;
-               p = name;
-               outlen = convert_charset(ch_to, ch_to, ch_mac, p, strlen(p), q, sizeof(buffer) -2, &flags);
+               q = (unsigned char *)buffer;
+               p = (unsigned char *)name;
+               outlen = convert_charset(ch_to, ch_to, ch_mac, (char *)p, strlen((char *)p), (char *)q, sizeof(buffer) -2, &flags);
                if ((size_t)-1 == outlen) {
                        /* it's not UTF8... */
                        fprintf(stderr, "ERROR: conversion from '%s' to '%s' for '%s' in DID %u failed!!!\n", 
                if ((size_t)-1 == outlen) {
                        /* it's not UTF8... */
                        fprintf(stderr, "ERROR: conversion from '%s' to '%s' for '%s' in DID %u failed!!!\n", 
index 45e626431a14f228c6e387bc2d6f80afc0d0695a..ac6d8fbce618337b8f06cdb09eb99bb580a8f2e4 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * $Id: afp_dsi.c,v 1.44 2009-10-22 07:40:50 didg Exp $
+ * $Id: afp_dsi.c,v 1.45 2009-10-22 13:40:11 franklahm Exp $
  *
  * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  *
  * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
@@ -366,8 +366,8 @@ void afp_over_dsi(AFPObj *obj)
                 LOG(log_debug, logtype_afpd, "=> Start AFP command: %s", afpcmpstr);
 
                 err = (*afp_switch[function])(obj,
                 LOG(log_debug, logtype_afpd, "=> Start AFP command: %s", afpcmpstr);
 
                 err = (*afp_switch[function])(obj,
-                                              dsi->commands, dsi->cmdlen,
-                                              dsi->data, &dsi->datalen);
+                                              (char *)&dsi->commands, dsi->cmdlen,
+                                              (char *)&dsi->data, &dsi->datalen);
 
                 LOG(log_debug, logtype_afpd, "=> Finished AFP command: %s", afpcmpstr);
 #ifdef FORCE_UIDGID
 
                 LOG(log_debug, logtype_afpd, "=> Finished AFP command: %s", afpcmpstr);
 #ifdef FORCE_UIDGID
@@ -399,8 +399,9 @@ void afp_over_dsi(AFPObj *obj)
             if ( afp_switch[ function ] != NULL ) {
                 dsi->datalen = DSI_DATASIZ;
                 child.flags |= CHILD_RUNNING;
             if ( afp_switch[ function ] != NULL ) {
                 dsi->datalen = DSI_DATASIZ;
                 child.flags |= CHILD_RUNNING;
-                err = (*afp_switch[function])(obj, dsi->commands, dsi->cmdlen,
-                                              dsi->data, &dsi->datalen);
+                err = (*afp_switch[function])(obj,
+                                              (char *)&dsi->commands, dsi->cmdlen,
+                                              (char *)&dsi->data, &dsi->datalen);
                 child.flags &= ~CHILD_RUNNING;
 #ifdef FORCE_UIDGID
                /* bring everything back to old euid, egid */
                 child.flags &= ~CHILD_RUNNING;
 #ifdef FORCE_UIDGID
                /* bring everything back to old euid, egid */
index 8bc9adbed8e38933505fa9c7ebf638515e9bda46..6115a4e4c306f068509d9036a91859b5d6565e72 100644 (file)
@@ -736,8 +736,8 @@ static int catsearch_afp(AFPObj *obj _U_, char *ibuf, size_t ibuflen,
     }
 
     /* Parse file specifications */
     }
 
     /* Parse file specifications */
-    spec1 = ibuf;
-    spec2 = ibuf + spec_len + 2;
+    spec1 = (unsigned char*)ibuf;
+    spec2 = (unsigned char*)ibuf + spec_len + 2;
 
     spec1 += 2; 
     spec2 += 2; 
 
     spec1 += 2; 
     spec2 += 2; 
index 8acce125e2e7c08048d0ef39bf7729834ac1658d..060b68dc20425bfc424a483357680772ce3859d8 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * $Id: desktop.c,v 1.41 2009-10-22 05:09:56 didg Exp $
+ * $Id: desktop.c,v 1.42 2009-10-22 13:40:11 franklahm Exp $
  *
  * See COPYRIGHT.
  *
  *
  * See COPYRIGHT.
  *
@@ -530,7 +530,6 @@ int afp_geticon(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t
             *rbuflen = buflen;
         }
 
             *rbuflen = buflen;
         }
 
-geticon_done:
         dsi_readdone(dsi);
         return AFP_OK;
 
         dsi_readdone(dsi);
         return AFP_OK;
 
index c008a74c65436c71facccccba010d2ca8cfd8aaa..8c95ff50bc2a30bd749e6e5a92aec9359b2a86a3 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * $Id: directory.c,v 1.112 2009-10-22 12:35:38 franklahm Exp $
+ * $Id: directory.c,v 1.113 2009-10-22 13:40:11 franklahm Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -1074,7 +1074,7 @@ const struct dir *k = key;
        0x69232f74U, 0xfead7bb3U, 0xe9089ab6U, 0xf012f6aeU,
     };
 
        0x69232f74U, 0xfead7bb3U, 0xe9089ab6U, 0xf012f6aeU,
     };
 
-    const unsigned char *str = k->d_u_name;
+    const unsigned char *str = (unsigned char *)(k->d_u_name);
     hash_val_t acc = 0;
 
     while (*str) {
     hash_val_t acc = 0;
 
     while (*str) {
@@ -2574,8 +2574,7 @@ int afp_mapid(AFPObj *obj, char *ibuf, size_t ibuflen _U_, char *rbuf, size_t *r
     u_int32_t           id;
     int                        len, sfunc;
     int         utf8 = 0;
     u_int32_t           id;
     int                        len, sfunc;
     int         utf8 = 0;
-    uuidtype_t          type;
-
+    
     ibuf++;
     sfunc = (unsigned char) *ibuf++;
     *rbuflen = 0;
     ibuf++;
     sfunc = (unsigned char) *ibuf++;
     *rbuflen = 0;
index a26c801a230c2163f22118595fa8688a115b8894..126bf9cf98e1a5342ae1c8d9fb90c8bbcacd6e8a 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
-  $Id: extattrs.c,v 1.9 2009-10-22 12:35:38 franklahm Exp $
+  $Id: extattrs.c,v 1.10 2009-10-22 13:40:11 franklahm Exp $
   Copyright (c) 2009 Frank Lahm <franklahm@gmail.com>
 
   This program is free software; you can redistribute it and/or modify
   Copyright (c) 2009 Frank Lahm <franklahm@gmail.com>
 
   This program is free software; you can redistribute it and/or modify
@@ -45,6 +45,7 @@ static char *ea_resourcefork = "com.apple.ResourceFork";
 /* This should be big enough to consecutively store the names of all attributes */
 static char attrnamebuf[ATTRNAMEBUFSIZ];
 
 /* This should be big enough to consecutively store the names of all attributes */
 static char attrnamebuf[ATTRNAMEBUFSIZ];
 
+#ifdef DEBUG
 static void hexdump(void *m, size_t l) {
     char *p = m;
     int count = 0, len;
 static void hexdump(void *m, size_t l) {
     char *p = m;
     int count = 0, len;
@@ -62,6 +63,7 @@ static void hexdump(void *m, size_t l) {
         }
     }
 }
         }
     }
 }
+#endif
 
 /***************************************
  * AFP funcs
 
 /***************************************
  * AFP funcs
index 033571b3733b94204092d164c8dc096c7566c77c..3b817b9f4d3c7d1cdca4d496ad517b9dafcdf377 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * $Id: lp.c,v 1.30 2009-10-16 01:10:59 didg Exp $
+ * $Id: lp.c,v 1.31 2009-10-22 13:40:11 franklahm Exp $
  *
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
  *
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -127,7 +127,7 @@ static void convert_octal (char *string, charset_t dest)
     char temp[4];
     long int ch;
 
     char temp[4];
     long int ch;
 
-    q=p=string;
+    q=p=(unsigned char *)string;
     while ( *p != '\0' ) {
         ch = 0;
         if ( *p == '\\' ) {
     while ( *p != '\0' ) {
         ch = 0;
         if ( *p == '\\' ) {
index f31c5dcbf7b964ad4bcb35d2326bc0f76186a16e..6c55a8186088e32a09f106233cf2853d9f81ff56 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * $Id: uams_dhx_passwd.c,v 1.25 2009-10-15 11:39:48 didg Exp $
+ * $Id: uams_dhx_passwd.c,v 1.26 2009-10-22 13:40:11 franklahm Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) 
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) 
@@ -125,7 +125,7 @@ static int pwd_login(void *obj, char *username, int ulen, struct passwd **uam_pw
       return AFPERR_NOTAUTH;
 
     /* get the client's public key */
       return AFPERR_NOTAUTH;
 
     /* get the client's public key */
-    if (!(bn = BN_bin2bn(ibuf, KEYSIZE, NULL))) {
+    if (!(bn = BN_bin2bn((unsigned char *)ibuf, KEYSIZE, NULL))) {
       return AFPERR_PARAM;
     }
 
       return AFPERR_PARAM;
     }
 
@@ -157,10 +157,10 @@ static int pwd_login(void *obj, char *username, int ulen, struct passwd **uam_pw
     }
 
     /* figure out the key. use rbuf as a temporary buffer. */
     }
 
     /* figure out the key. use rbuf as a temporary buffer. */
-    i = DH_compute_key(rbuf, bn, dh);
+    i = DH_compute_key((unsigned char *)rbuf, bn, dh);
     
     /* set the key */
     
     /* set the key */
-    CAST_set_key(&castkey, i, rbuf);
+    CAST_set_key(&castkey, i, (unsigned char *)rbuf);
     
     /* session id. it's just a hashed version of the object pointer. */
     sessid = dhxhash(obj);
     
     /* session id. it's just a hashed version of the object pointer. */
     sessid = dhxhash(obj);
@@ -169,7 +169,7 @@ static int pwd_login(void *obj, char *username, int ulen, struct passwd **uam_pw
     *rbuflen += sizeof(sessid);
     
     /* send our public key */
     *rbuflen += sizeof(sessid);
     
     /* send our public key */
-    BN_bn2bin(dh->pub_key, rbuf); 
+    BN_bn2bin(dh->pub_key, (unsigned char *)rbuf); 
     rbuf += KEYSIZE;
     *rbuflen += KEYSIZE;
 
     rbuf += KEYSIZE;
     *rbuflen += KEYSIZE;
 
@@ -195,7 +195,7 @@ static int pwd_login(void *obj, char *username, int ulen, struct passwd **uam_pw
 #endif /* 0 */
 
     /* encrypt using cast */
 #endif /* 0 */
 
     /* encrypt using cast */
-    CAST_cbc_encrypt(rbuf, rbuf, CRYPTBUFLEN, &castkey, iv, CAST_ENCRYPT);
+    CAST_cbc_encrypt((unsigned char *)rbuf, (unsigned char *)rbuf, CRYPTBUFLEN, &castkey, iv, CAST_ENCRYPT);
     *rbuflen += CRYPTBUFLEN;
     BN_free(bn);
     DH_free(dh);
     *rbuflen += CRYPTBUFLEN;
     BN_free(bn);
     DH_free(dh);
@@ -298,12 +298,12 @@ static int passwd_logincont(void *obj, struct passwd **uam_pwd,
     ibuf += sizeof(sessid);
    
     /* use rbuf as scratch space */
     ibuf += sizeof(sessid);
    
     /* use rbuf as scratch space */
-    CAST_cbc_encrypt(ibuf, rbuf, CRYPT2BUFLEN, &castkey,
+    CAST_cbc_encrypt((unsigned char *)ibuf, (unsigned char *)rbuf, CRYPT2BUFLEN, &castkey,
                     iv, CAST_DECRYPT);
     
     /* check to make sure that the random number is the same. we
      * get sent back an incremented random number. */
                     iv, CAST_DECRYPT);
     
     /* check to make sure that the random number is the same. we
      * get sent back an incremented random number. */
-    if (!(bn1 = BN_bin2bn(rbuf, KEYSIZE, NULL)))
+    if (!(bn1 = BN_bin2bn((unsigned char *)rbuf, KEYSIZE, NULL)))
       return AFPERR_PARAM;
 
     if (!(bn2 = BN_bin2bn(randbuf, sizeof(randbuf), NULL))) {
       return AFPERR_PARAM;
 
     if (!(bn2 = BN_bin2bn(randbuf, sizeof(randbuf), NULL))) {
index 605d99c44613dbdd3f470730f7fca888754323f0..e1b3ff6b934f062cd8ff9b2fc4db1ac39f43c6bf 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * $Id: uams_gss.c,v 1.9 2009-10-15 14:54:43 franklahm Exp $
+ * $Id: uams_gss.c,v 1.10 2009-10-22 13:40:11 franklahm Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu)
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu)
@@ -326,7 +326,7 @@ static int acquire_credentials (gss_name_t *server_name, gss_cred_id_t *server_c
     OM_uint32 major_status = 0, minor_status = 0;
     char *envp;
 
     OM_uint32 major_status = 0, minor_status = 0;
     char *envp;
 
-    if (envp = getenv("KRB5_KTNAME"))
+    if ((envp = getenv("KRB5_KTNAME")))
         LOG(log_debug, logtype_uams,
             "acquire credentials: acquiring credentials (uid = %d, keytab = %s)",
             (int)geteuid(), envp);
         LOG(log_debug, logtype_uams,
             "acquire credentials: acquiring credentials (uid = %d, keytab = %s)",
             (int)geteuid(), envp);
index 8adebec705519d939508fdf96f435a96d9f0287f..686cc088e09abe99a838518d580a83d8a287fb44 100644 (file)
@@ -1,5 +1,5 @@
 /* 
 /* 
- * $Id: uams_randnum.c,v 1.19 2009-10-15 11:39:48 didg Exp $
+ * $Id: uams_randnum.c,v 1.20 2009-10-22 13:40:11 franklahm Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) 
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) 
@@ -476,7 +476,7 @@ static int randnum_changepw(void *obj, const char *username _U_,
 #endif /* USE_CRACKLIB */
 
     if (!err) 
 #endif /* USE_CRACKLIB */
 
     if (!err) 
-      err = randpass(pwd, passwdfile, ibuf + PASSWDLEN, sizeof(seskey), 1);
+        err = randpass(pwd, passwdfile, (unsigned char *)ibuf + PASSWDLEN, sizeof(seskey), 1);
 
     /* zero out some fields */
     memset(&seskeysched, 0, sizeof(seskeysched));
 
     /* zero out some fields */
     memset(&seskeysched, 0, sizeof(seskeysched));
index 872ea1877af716610af35a1a2be70f90cf7a9328..fe03d9e4d0dc251a984aa6d3bd7f5545b44d8fdd 100644 (file)
@@ -1,5 +1,5 @@
 /*
 /*
- * $Id: dsi_stream.c,v 1.15 2009-10-22 04:59:50 didg Exp $
+ * $Id: dsi_stream.c,v 1.16 2009-10-22 13:40:11 franklahm Exp $
  *
  * Copyright (c) 1998 Adrian Sun (asun@zoology.washington.edu)
  * All rights reserved. See COPYRIGHT.
  *
  * Copyright (c) 1998 Adrian Sun (asun@zoology.washington.edu)
  * All rights reserved. See COPYRIGHT.
@@ -368,7 +368,7 @@ int dsi_stream_receive(DSI *dsi, void *buf, const size_t ilength,
   char block[DSI_BLOCKSIZ];
 
   /* read in the header */
   char block[DSI_BLOCKSIZ];
 
   /* read in the header */
-  if (dsi_buffered_stream_read(dsi, block, sizeof(block)) != sizeof(block)) 
+  if (dsi_buffered_stream_read(dsi, (u_int8_t *)block, sizeof(block)) != sizeof(block)) 
     return 0;
 
   dsi->header.dsi_flags = block[0];
     return 0;
 
   dsi->header.dsi_flags = block[0];
index 70255d454c0a2e84a995ebd132a259f9a8cf2004..12d1d839ce855ace64cea4d3c095cc8e638a7f0e 100644 (file)
@@ -1975,16 +1975,19 @@ int tdb_chainunlock(TDB_CONTEXT *tdb, TDB_DATA key)
        return tdb_unlock(tdb, BUCKET(tdb_hash(&key)), F_WRLCK);
 }
 
        return tdb_unlock(tdb, BUCKET(tdb_hash(&key)), F_WRLCK);
 }
 
+#if 0
 static int tdb_chainlock_read(TDB_CONTEXT *tdb, TDB_DATA key)
 {
        return tdb_lock(tdb, BUCKET(tdb_hash(&key)), F_RDLCK);
 }
 static int tdb_chainlock_read(TDB_CONTEXT *tdb, TDB_DATA key)
 {
        return tdb_lock(tdb, BUCKET(tdb_hash(&key)), F_RDLCK);
 }
+#endif
 
 
+#if 0
 static int tdb_chainunlock_read(TDB_CONTEXT *tdb, TDB_DATA key)
 {
        return tdb_unlock(tdb, BUCKET(tdb_hash(&key)), F_RDLCK);
 }
 static int tdb_chainunlock_read(TDB_CONTEXT *tdb, TDB_DATA key)
 {
        return tdb_unlock(tdb, BUCKET(tdb_hash(&key)), F_RDLCK);
 }
-
+#endif
 
 /* register a loging function */
 void tdb_logging_function(TDB_CONTEXT *tdb, void (*fn)(TDB_CONTEXT *, int , const char *, ...))
 
 /* register a loging function */
 void tdb_logging_function(TDB_CONTEXT *tdb, void (*fn)(TDB_CONTEXT *, int , const char *, ...))
index 20e74c93746adfc853d432c4224b3cf34b9a00bc..016f610f994857c4cf3903caa69c779f1d088307 100644 (file)
@@ -5,8 +5,6 @@
 
 int main(int argc, char *argv[])
 {
 
 int main(int argc, char *argv[])
 {
-  bool retval;
-
   set_processname("logger_Test");
 
   LOG(log_severe, logtype_logger, "Logging Test starting: this should only log to syslog");
   set_processname("logger_Test");
 
   LOG(log_severe, logtype_logger, "Logging Test starting: this should only log to syslog");