]> arthur.barton.de Git - netatalk.git/commitdiff
remove compiler warnings
authordidg <didg>
Wed, 3 Dec 2008 18:35:44 +0000 (18:35 +0000)
committerdidg <didg>
Wed, 3 Dec 2008 18:35:44 +0000 (18:35 +0000)
31 files changed:
bin/psorder/psorder.c
etc/afpd/afp_asp.c
etc/afpd/afp_dsi.c
etc/afpd/appl.c
etc/afpd/directory.c
etc/afpd/directory.h
etc/afpd/file.c
etc/afpd/fork.c
etc/afpd/fork.h
etc/afpd/globals.h
etc/afpd/ofork.c
etc/afpd/unix.c
etc/afpd/volume.c
etc/papd/lp.c
etc/uams/uams_krb4/uams_krb4.c
etc/uams/uams_randnum.c
include/atalk/adouble.h
include/atalk/list.h
libatalk/adouble/ad_lock.c
libatalk/adouble/ad_mmap.c
libatalk/adouble/ad_private.h
libatalk/adouble/ad_sendfile.c
libatalk/cnid/cdb/cnid_cdb_add.c
libatalk/cnid/cdb/cnid_cdb_private.h
libatalk/cnid/cnid.c
libatalk/cnid/db3/cnid_db3.h
libatalk/cnid/db3/cnid_db3_open.c
libatalk/cnid/db3/cnid_db3_private.h
libatalk/cnid/tdb/cnid_tdb.h
libatalk/util/server_child.c
libatalk/util/volinfo.c

index 7ba4332f9eedfe3e4258189f68428cb562806cc2..7d514862fd85f63526b47b9820bec0b227a1d616 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: psorder.c,v 1.5 2001-06-29 14:14:46 rufustfirefly Exp $
+ * $Id: psorder.c,v 1.6 2008-12-03 18:35:44 didg Exp $
  *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
@@ -151,7 +151,7 @@ filesetup( inputfile, infd, tfile, tfd )
        make temporary file
  */
 
-    (void *)strncpy( tfile, template, MAXNAMLEN );
+    strncpy( tfile, template, MAXNAMLEN );
     if (( *tfd = mkstemp( tfile )) == -1 ) {
        fprintf( stderr, "can't create temporary file %s\n", tfile );
        filecleanup( -1, -1, "" );
index 958e557b2eb981bca7c4f7bae3dab792f1524de9..cb40d1d5597c53039be8bb589d1af612a4723646 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: afp_asp.c,v 1.22 2005-04-28 20:49:39 bfernhomberg Exp $
+ * $Id: afp_asp.c,v 1.23 2008-12-03 18:35:44 didg Exp $
  *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
@@ -47,9 +47,9 @@ extern struct oforks  *writtenfork;
 
 static AFPObj *child;
 
-static __inline__ void afp_authprint_remove(AFPObj *);
+static void afp_authprint_remove(AFPObj *);
 
-static __inline__ void afp_asp_close(AFPObj *obj)
+static void afp_asp_close(AFPObj *obj)
 {
     ASP asp = obj->handle;
 
@@ -65,7 +65,7 @@ static __inline__ void afp_asp_close(AFPObj *obj)
 }
 
 /* removes the authprint trailing when appropriate */
-static __inline__ void afp_authprint_remove(AFPObj *obj)
+static void afp_authprint_remove(AFPObj *obj)
 {
     ASP asp = obj->handle;
     char addr_filename[256];
index a12532237ccd127557d9416481f615707eb8e907..a38bc99004de041a82fd232f5bfd26da14057424 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: afp_dsi.c,v 1.32 2005-04-28 20:49:39 bfernhomberg Exp $
+ * $Id: afp_dsi.c,v 1.33 2008-12-03 18:35:44 didg Exp $
  *
  * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
@@ -56,7 +56,7 @@ static struct {
 } child;
 
 
-static __inline__ void afp_dsi_close(AFPObj *obj)
+static void afp_dsi_close(AFPObj *obj)
 {
     DSI *dsi = obj->handle;
 
index a595c21098b467cf0d83c64971e08b6fe04c1b90..3189ab5fa8f81a9bb8ff37e12a88b1b10fb0b41e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: appl.c,v 1.15 2005-04-28 20:49:40 bfernhomberg Exp $
+ * $Id: appl.c,v 1.16 2008-12-03 18:35:44 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -29,7 +29,7 @@
 
 static struct savedt   sa = { { 0, 0, 0, 0 }, -1, 0, 0};
 
-static __inline__ int pathcmp( p, plen, q, qlen )
+static int pathcmp( p, plen, q, qlen )
 char   *p;
 int    plen;
 char   *q;
index 81fa9754e7376a163d09695374de570508804c0f..f83fef25f413869583fe9dd5b46f53393ccb62fa 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: directory.c,v 1.87 2008-09-01 15:18:36 didg Exp $
+ * $Id: directory.c,v 1.88 2008-12-03 18:35:44 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -439,9 +439,7 @@ static void dir_hash_del(const struct vol *vol, struct dir *dir)
 /* remove the node from the tree. this is just like insertion, but
  * different. actually, it has to worry about a bunch of things that
  * insertion doesn't care about. */
-static void dir_remove( vol, dir )
-struct vol     *vol;
-struct dir     *dir;
+static void dir_remove( const struct vol *vol _U_, struct dir  *dir)
 {
 #ifdef REMOVE_NODES
     struct ofork *of, *last;
@@ -2146,8 +2144,8 @@ setdirparam_done:
 
 
 int afp_syncdir(obj, ibuf, ibuflen, rbuf, rbuflen )
-AFPObj  *obj;
-char    *ibuf, *rbuf;
+AFPObj  *obj _U_;
+char    *ibuf, *rbuf _U_;
 int     ibuflen _U_, *rbuflen;
 {
     DIR                  *dp;
index b9e061643a4b0cbd50e2101223d748376f788b7e..dcd4a2f2f12fe6ad9a7f21675f561c16bed4d2b1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: directory.h,v 1.22 2008-09-01 15:18:37 didg Exp $
+ * $Id: directory.h,v 1.23 2008-12-03 18:35:44 didg Exp $
  *
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
@@ -71,7 +71,7 @@ struct path {
 };
 
 #ifndef ATACC
-static __inline__ int path_isadir(struct path *o_path)
+static inline int path_isadir(struct path *o_path)
 {
     return o_path->d_dir != NULL;
 #if 0
index a5f22bc0af127d003271b1f162444d16b781c722..5657aac9f0cc1e48fbbf49ad5a1a78c8a2c04015 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: file.c,v 1.106 2007-05-14 19:31:28 didg Exp $
+ * $Id: file.c,v 1.107 2008-12-03 18:35:44 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -1277,7 +1277,7 @@ int       ibuflen _U_, *rbuflen;
 }
 
 /* ----------------------- */
-static __inline__ int copy_all(const int dfd, const void *buf,
+static int copy_all(const int dfd, const void *buf,
                                size_t buflen)
 {
     ssize_t cc;
index 09b8ed5212f3e6b8dee52ec61c2cb18eee36be25..54aa0ede26316268f48efab4e3902c630e4d70fa 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: fork.c,v 1.56 2006-09-29 09:39:16 didg Exp $
+ * $Id: fork.c,v 1.57 2008-12-03 18:35:44 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -161,7 +161,7 @@ static int is_neg(int is64, off_t val)
     return 0;
 }
 
-static __inline__ int sum_neg(int is64, off_t offset, off_t reqcount) 
+static int sum_neg(int is64, off_t offset, off_t reqcount) 
 {
     if (is_neg(is64, offset +reqcount) ) 
        return 1;
@@ -774,7 +774,7 @@ int ibuflen, *rbuflen;
 #undef UNLOCKBIT
 
 /* --------------------------- */
-static __inline__ int crlf( of )
+static int crlf( of )
 struct ofork   *of;
 {
     struct extmap      *em;
@@ -794,7 +794,7 @@ struct ofork        *of;
 }
 
 
-static __inline__ ssize_t read_file(struct ofork *ofork, int eid,
+static ssize_t read_file(struct ofork *ofork, int eid,
                                     off_t offset, u_char nlmask,
                                     u_char nlchar, char *rbuf,
                                     int *rbuflen, const int xlate)
@@ -1166,7 +1166,7 @@ int       ibuflen _U_, *rbuflen;
 }
 
 
-static __inline__ ssize_t write_file(struct ofork *ofork, int eid,
+static ssize_t write_file(struct ofork *ofork, int eid,
                                      off_t offset, char *rbuf,
                                      size_t rbuflen, const int xlate)
 {
index 5a6bdc011b5e896ed66fcb7c6601d15f46e292b3..4263a7c71122f8358419ab6d47ab2eb3cbc23993 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: fork.h,v 1.10 2005-09-28 09:46:37 didg Exp $
+ * $Id: fork.h,v 1.11 2008-12-03 18:35:44 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -22,6 +22,7 @@ struct file_key {
 };
 
 struct ofork {
+    struct file_key     key;
     struct adouble     *of_ad;
     struct vol          *of_vol;
     struct dir         *of_dir;
@@ -29,7 +30,6 @@ struct ofork {
     u_int16_t           of_refnum;
     int                 of_flags;
 
-    struct file_key     key;
     struct ofork        **prevp, *next;
     struct ofork        *of_d_prev, *of_d_next;
 };
index f1e0c9e91eb88ba1ea0f6ddc90d7d085b7e244eb..c6b741ff6a54f58970b4248d27d3a4f1d6678ac5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: globals.h,v 1.23 2008-05-16 04:19:41 didg Exp $
+ * $Id: globals.h,v 1.24 2008-12-03 18:35:44 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
 #include <atalk/unicode.h>
 #include <atalk/uam.h>
 
-/* test for inline */
-#ifndef __inline__
-#define __inline__
-#endif
-
 #define MACFILELEN 31
 #define MAXUSERLEN 256
 
index 1d59b06115e69501a605fa9f81ede423aaa70809..130a3cfa29580949c82469837529b8a0dfe5c98c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ofork.c,v 1.26 2008-08-16 21:11:36 didg Exp $
+ * $Id: ofork.c,v 1.27 2008-12-03 18:35:44 didg Exp $
  *
  * Copyright (c) 1996 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -38,7 +38,7 @@ static u_short                lastrefnum = 0;
 
 
 /* OR some of each character for the hash*/
-static __inline__ unsigned long hashfn(const struct file_key *key)
+static unsigned long hashfn(const struct file_key *key)
 {
 #if 0
     unsigned long i = 0;
@@ -49,7 +49,7 @@ static __inline__ unsigned long hashfn(const struct file_key *key)
     return key->inode & (OFORK_HASHSIZE - 1);
 }
 
-static __inline__ void of_hash(struct ofork *of)
+static void of_hash(struct ofork *of)
 {
     struct ofork **table;
 
@@ -60,7 +60,7 @@ static __inline__ void of_hash(struct ofork *of)
     of->prevp = table;
 }
 
-static __inline__ void of_unhash(struct ofork *of)
+static void of_unhash(struct ofork *of)
 {
     if (of->prevp) {
         if (of->next)
index 5fd15f1c9bc93cf91f874af2988b04acfcaadd65..d8903e810667aecefdd611829fad5471a323236f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: unix.c,v 1.49 2007-05-16 18:35:58 didg Exp $
+ * $Id: unix.c,v 1.50 2008-12-03 18:35:44 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -99,7 +99,7 @@ u_int32_t   *bsize;
     return( AFP_OK );
 }
 
-static __inline__ int utombits( bits )
+static int utombits( bits )
 mode_t bits;
 {
     int                mbits;
@@ -204,7 +204,7 @@ const gid_t gid;
     return( 0 );
 }
 
-static __inline__ mode_t mtoubits( bits )
+static mode_t mtoubits( bits )
 u_char bits;
 {
     mode_t     mode;
index 3d5bcbb9cbb184ddd34e2c8d03ac0b4d4aba429a..877472ca30e612ef569d85575793180ebbfca3f8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: volume.c,v 1.72 2008-09-01 15:18:38 didg Exp $
+ * $Id: volume.c,v 1.73 2008-12-03 18:35:44 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -189,7 +189,7 @@ static void handle_special_folders (const struct vol *);
 static int savevoloptions (const struct vol *);
 static void deletevol(struct vol *vol);
 
-static __inline__ void volfree(struct vol_option *options,
+static void volfree(struct vol_option *options,
                                const struct vol_option *save)
 {
     int i;
index f475053e60853dccc8039bd105693223a04e3589..2cd04216157d29a0ff5dd83d884888db9a22cf87 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: lp.c,v 1.18 2008-11-14 10:29:08 didg Exp $
+ * $Id: lp.c,v 1.19 2008-12-03 18:35:44 didg Exp $
  *
  * Copyright (c) 1990,1994 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -885,7 +885,7 @@ int lp_print()
 }
 
 #ifndef HAVE_CUPS
-int lp_disconn_unix( fd )
+int lp_disconn_unix( int fd )
 {
     return( close( fd ));
 }
index 72840abd16b3651693f9b214b784ff969208a2b7..f2c6d420b1672197223c0c054ab55cb5f78588a5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: uams_krb4.c,v 1.8 2008-11-14 10:29:08 didg Exp $
+ * $Id: uams_krb4.c,v 1.9 2008-12-03 18:35:44 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -86,7 +86,7 @@ struct ClearToken {
 
 #ifdef KRB
 
-static __inline__ void lcase( p )
+static void lcase( p )
     char       *p;
 {
     for (; *p; p++ ) {
@@ -97,7 +97,7 @@ static __inline__ void lcase( p )
     return;
 }
 
-static __inline__ void ucase( p )
+static void ucase( p )
     char       *p;
 {
     for (; *p; p++ ) {
index 3edd5a18ecaba86d6c34fd37bca0ab5e3d3ae95e..f4c5cde53c69cf381e95283eb034103efa8c756d 100644 (file)
@@ -1,5 +1,5 @@
 /* 
- * $Id: uams_randnum.c,v 1.17 2005-05-03 14:55:11 didg Exp $
+ * $Id: uams_randnum.c,v 1.18 2008-12-03 18:35:44 didg Exp $
  *
  * Copyright (c) 1990,1993 Regents of The University of Michigan.
  * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) 
@@ -53,10 +53,6 @@ char *strchr (), *strrchr ();
 #include <crack.h>
 #endif /* USE_CRACKLIB */
 
-#ifndef __inline__
-#define __inline__
-#endif /* __inline__ */
-
 #define PASSWDLEN 8
 
 static C_Block         seskey;
@@ -71,7 +67,7 @@ static u_int8_t         randbuf[8];
 
 
 /* handle ~/.passwd. courtesy of shirsch@ibm.net. */
-static  __inline__ int home_passwd(const struct passwd *pwd, 
+static  int home_passwd(const struct passwd *pwd, 
                                   const char *path, const int pathlen _U_, 
                                   unsigned char *passwd, const int len,
                                   const int set)
index 3bc262190570e2ca2e582fb1aebacb4356d03ae4..e4cf9753ea90ce677660b51708c1685a978ff1c8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: adouble.h,v 1.32 2006-09-29 09:44:59 didg Exp $
+ * $Id: adouble.h,v 1.33 2008-12-03 18:35:44 didg Exp $
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
  * All Rights Reserved.
  *
@@ -468,10 +468,7 @@ extern int ad_metadata    __P((const char *, int, struct adouble *));
  * remove X mode and extend header to RW if R or W (W if R for locking),
  */ 
 #ifndef ATACC
-#ifndef __inline__
-#define __inline__
-#endif
-static __inline__ mode_t ad_hf_mode (mode_t mode)
+static inline mode_t ad_hf_mode (mode_t mode)
 {
     mode &= ~(S_IXUSR | S_IXGRP | S_IXOTH);
     /* fnctl lock need write access */
index 82518ebdbf8ba8fe727f5e7f625cfbdf6ee72dde..bb39b90c3b9063bcbb0252f28ed27afcdb30d403 100644 (file)
@@ -4,11 +4,6 @@
 #ifndef _ATALK_LIST_H
 #define _ATALK_LIST_H
 
-/* test for inline */
-#ifndef __inline__
-#define __inline__
-#endif
-
 /*
  * Simple doubly linked list implementation.
  *
@@ -39,7 +34,7 @@ struct list_head {
  * This is only for internal list manipulation where we know
  * the prev/next entries already!
  */
-static __inline__ void __list_add(struct list_head * new,
+static inline void __list_add(struct list_head * new,
                                   struct list_head * prev,
                                   struct list_head * next)
 {
@@ -57,7 +52,7 @@ static __inline__ void __list_add(struct list_head * new,
  * Insert a new entry after the specified head.
  * This is good for implementing stacks.
  */
-static __inline__ void list_add(struct list_head *new, struct list_head *head)
+static inline void list_add(struct list_head *new, struct list_head *head)
 {
     __list_add(new, head, head->next);
 }
@@ -70,7 +65,7 @@ static __inline__ void list_add(struct list_head *new, struct list_head *head)
  * Insert a new entry before the specified head.
  * This is useful for implementing queues.
  */
-static __inline__ void list_add_tail(struct list_head *new, struct list_head *head)
+static inline void list_add_tail(struct list_head *new, struct list_head *head)
 {
     __list_add(new, head->prev, head);
 }
@@ -82,7 +77,7 @@ static __inline__ void list_add_tail(struct list_head *new, struct list_head *he
  * This is only for internal list manipulation where we know
  * the prev/next entries already!
  */
-static __inline__ void __list_del(struct list_head * prev,
+static inline void __list_del(struct list_head * prev,
                                   struct list_head * next)
 {
     next->prev = prev;
@@ -94,7 +89,7 @@ static __inline__ void __list_del(struct list_head * prev,
  * @entry: the element to delete from the list.
  * Note: list_empty on entry does not return true after this, the entry is in an undefined state.
  */
-static __inline__ void list_del(struct list_head *entry)
+static inline void list_del(struct list_head *entry)
 {
     __list_del(entry->prev, entry->next);
 }
@@ -103,7 +98,7 @@ static __inline__ void list_del(struct list_head *entry)
  * list_del_init - deletes entry from list and reinitialize it.
  * @entry: the element to delete from the list.
  */
-static __inline__ void list_del_init(struct list_head *entry)
+static inline void list_del_init(struct list_head *entry)
 {
     __list_del(entry->prev, entry->next);
     ATALK_INIT_LIST_HEAD(entry);
@@ -113,7 +108,7 @@ static __inline__ void list_del_init(struct list_head *entry)
  * list_empty - tests whether a list is empty
  * @head: the list to test.
  */
-static __inline__ int list_empty(struct list_head *head)
+static inline int list_empty(struct list_head *head)
 {
     return head->next == head;
 }
@@ -123,7 +118,7 @@ static __inline__ int list_empty(struct list_head *head)
  * @list: the new list to add.
  * @head: the place to add it in the first list.
  */
-static __inline__ void list_splice(struct list_head *list, struct list_head *head)
+static inline void list_splice(struct list_head *list, struct list_head *head)
 {
     struct list_head *first = list->next;
 
index 31e8c71a476fe38bbf82e88abd0018df470ea502..4af465cab8a96e9f912c5b08878c1e1a902e279b 100644 (file)
@@ -1,5 +1,5 @@
 /* 
- * $Id: ad_lock.c,v 1.13 2006-09-29 09:39:16 didg Exp $
+ * $Id: ad_lock.c,v 1.14 2008-12-03 18:35:44 didg Exp $
  *
  * Copyright (c) 1998,1999 Adrian Sun (asun@zoology.washington.edu)
  * All Rights Reserved. See COPYRIGHT for more information.
@@ -67,7 +67,7 @@ static int OVERLAP(off_t a, off_t alen, off_t b, off_t blen)
 #define ARRAY_FREE_DELTA 100
 
 /* remove a lock and compact space if necessary */
-static __inline__ void adf_freelock(struct ad_fd *ad, const int i)
+static void adf_freelock(struct ad_fd *ad, const int i)
 {
     adf_lock_t *lock = ad->adf_lock + i;
 
@@ -111,7 +111,7 @@ static __inline__ void adf_freelock(struct ad_fd *ad, const int i)
  * i converted to using arrays of locks. everytime a lock
  * gets removed, we shift all of the locks down.
  */
-static __inline__ void adf_unlock(struct ad_fd *ad, const int user)
+static void adf_unlock(struct ad_fd *ad, const int user)
 {
     adf_lock_t *lock = ad->adf_lock;
     int i;
@@ -128,7 +128,7 @@ static __inline__ void adf_unlock(struct ad_fd *ad, const int user)
 
 /* relock any byte lock that overlaps off/len. unlock everything
  * else. */
-static __inline__ void adf_relockrange(struct ad_fd *ad, int fd,
+static void adf_relockrange(struct ad_fd *ad, int fd,
                                       const off_t off, const off_t len)
 {
     adf_lock_t *lock = ad->adf_lock;
@@ -142,7 +142,7 @@ static __inline__ void adf_relockrange(struct ad_fd *ad, int fd,
 
 
 /* find a byte lock that overlaps off/len for a particular user */
-static __inline__ int adf_findlock(struct ad_fd *ad,
+static int adf_findlock(struct ad_fd *ad,
                                   const int user, const int type,
                                   const off_t off,
                                   const off_t len)
@@ -164,7 +164,7 @@ static __inline__ int adf_findlock(struct ad_fd *ad,
 
 
 /* search other user lock lists */
-static __inline__  int adf_findxlock(struct ad_fd *ad, 
+static int adf_findxlock(struct ad_fd *ad, 
                                     const int user, const int type,
                                     const off_t off,
                                     const off_t len)
index 6695deca7f654612155abcb4c50478e10d3646ac..2cb5c05937f2f6d69470996bea5994eaaf069e2b 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ad_mmap.c,v 1.5 2005-04-28 20:49:52 bfernhomberg Exp $
+ * $Id: ad_mmap.c,v 1.6 2008-12-03 18:35:44 didg Exp $
  *
  * ad_mmap provides interfaces to memory mapped files. as this is the
  * case, we don't have to deal w/ temporary buffers such as
@@ -19,7 +19,7 @@
 
 #include "ad_private.h"
 
-static __inline__ void *ad_mmap(const size_t length, const int prot,
+static void *ad_mmap(const size_t length, const int prot,
                                const int flags, const int fd, 
                                const off_t offset)
 {
index f87d51e15638b9f4760c3bc4ead5508bab1682c5..82a11aa12606543b9f9e4b00c89cfd743d9dbd39 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ad_private.h,v 1.5 2003-01-31 11:26:36 didg Exp $
+ * $Id: ad_private.h,v 1.6 2008-12-03 18:35:44 didg Exp $
  */
 
 #ifndef LIBATALK_ADOUBLE_AD_PRIVATE_H
 #define MAP_FAILED ((void *) -1)
 #endif /* ! MAP_FAILED */
 
-#ifndef __inline__
-#define __inline__
-#endif /* ! __inline__ */
-
 /* this is so that we can keep lists of fds referencing the same file
  * around. that way, we can honor locks created by the same process
  * with the same file. */
index 42971911f5beb4bedcb42482df89fa3d935f385e..b4b63a94cabad5a6352c8a17c0d364c2fee05ce9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ad_sendfile.c,v 1.8 2005-04-28 20:49:52 bfernhomberg Exp $
+ * $Id: ad_sendfile.c,v 1.9 2008-12-03 18:35:44 didg Exp $
  *
  * Copyright (c) 1999 Adrian Sun (asun@zoology.washington.edu)
  * All rights reserved. See COPYRIGHT.
@@ -140,7 +140,7 @@ ssize_t sys_sendfile(int out_fd, int in_fd, off_t *_offset, size_t count)
 #endif
 
 /* ------------------------------- */
-static __inline__ int ad_sendfile_init(const struct adouble *ad, 
+static int ad_sendfile_init(const struct adouble *ad, 
                                       const int eid, off_t *off,
                                       const int end)
 {
index 3f1461f932ee919bc79c9b4ceb039071c5e2f726..e48ed5b48fc5583ba07392d255f2d0de33069f02 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: cnid_cdb_add.c,v 1.3 2005-05-03 14:55:13 didg Exp $
+ * $Id: cnid_cdb_add.c,v 1.4 2008-12-03 18:35:44 didg Exp $
  *
  * Copyright (c) 1999. Adrian Sun (asun@zoology.washington.edu)
  * All Rights Reserved. See COPYRIGHT.
 #ifdef CNID_BACKEND_CDB
 #include "cnid_cdb_private.h"
 
+extern int cnid_cdb_update(struct _cnid_db *cdb, const cnid_t id, const struct stat *st,
+                const cnid_t did, char *name, const size_t len);
+
+
 #define tid    NULL
 
-#ifdef ATACC
 static void make_devino_data(unsigned char *buf, dev_t dev, ino_t ino)
 {
     buf[CNID_DEV_LEN - 1] = dev; dev >>= 8;
@@ -67,10 +70,6 @@ unsigned char *make_cnid_data(const struct stat *st,const cnid_t did,
 
     return start;
 }    
-#endif
-
-extern int cnid_cdb_update(struct _cnid_db *cdb, const cnid_t id, const struct stat *st,
-                const cnid_t did, char *name, const size_t len);
 
 /* --------------- */
 int db_stamp(void *buffer, size_t size)
index 7453173ea47c1842880805ac53c8dce1062379f3..35dc39e2fc523cf8db0fe44a760d19f3733fd32a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: cnid_cdb_private.h,v 1.3 2005-05-03 14:55:13 didg Exp $
+ * $Id: cnid_cdb_private.h,v 1.4 2008-12-03 18:35:44 didg Exp $
  */
 
 #ifndef LIBATALK_CDB_PRIVATE_H
@@ -168,64 +168,8 @@ typedef struct CNID_private {
  * name namelen = strlen(name) + 1 
  */
 
-#ifndef __inline__
-#define __inline__
-#endif /* __inline__ */
-
 /* construct db_cnid data. NOTE: this is not re-entrant.  */
-#ifndef ATACC
-static void make_devino_data(unsigned char *buf, dev_t dev, ino_t ino)
-{
-    buf[CNID_DEV_LEN - 1] = dev; dev >>= 8;
-    buf[CNID_DEV_LEN - 2] = dev; dev >>= 8;
-    buf[CNID_DEV_LEN - 3] = dev; dev >>= 8;
-    buf[CNID_DEV_LEN - 4] = dev; dev >>= 8;
-    buf[CNID_DEV_LEN - 5] = dev; dev >>= 8;
-    buf[CNID_DEV_LEN - 6] = dev; dev >>= 8;
-    buf[CNID_DEV_LEN - 7] = dev; dev >>= 8;
-    buf[CNID_DEV_LEN - 8] = dev;
-
-    buf[CNID_DEV_LEN + CNID_INO_LEN - 1] = ino; ino >>= 8;
-    buf[CNID_DEV_LEN + CNID_INO_LEN - 2] = ino; ino >>= 8;
-    buf[CNID_DEV_LEN + CNID_INO_LEN - 3] = ino; ino >>= 8;
-    buf[CNID_DEV_LEN + CNID_INO_LEN - 4] = ino; ino >>= 8;
-    buf[CNID_DEV_LEN + CNID_INO_LEN - 5] = ino; ino >>= 8;
-    buf[CNID_DEV_LEN + CNID_INO_LEN - 6] = ino; ino >>= 8;
-    buf[CNID_DEV_LEN + CNID_INO_LEN - 7] = ino; ino >>= 8;
-    buf[CNID_DEV_LEN + CNID_INO_LEN - 8] = ino;    
-}
-
-static __inline__ unsigned char *make_cnid_data(const struct stat *st,
-                                       const cnid_t did,
-                                       const char *name, const size_t len)
-{
-    static unsigned char start[CNID_HEADER_LEN + MAXPATHLEN + 1];
-    unsigned char *buf = start  +CNID_LEN;
-    u_int32_t i;
-
-    if (len > MAXPATHLEN)
-        return NULL;
-
-    make_devino_data(buf, st->st_dev, st->st_ino);
-    buf += CNID_DEVINO_LEN;
-
-    i = S_ISDIR(st->st_mode)?1:0;
-    i = htonl(i);
-    memcpy(buf, &i, sizeof(i));
-    buf += sizeof(i);
-    
-    /* did is already in network byte order */
-    memcpy(buf, &did, sizeof(did));
-    buf += sizeof(did);
-
-    memcpy(buf, name, len);
-    *(buf + len) = '\0';
-
-    return start;
-}
-#else
 extern unsigned char *make_cnid_data __P((const struct stat *,const cnid_t ,
                                        const char *, const size_t ));
-#endif
 
 #endif /* atalk/cnid/cnid_private.h */
index ead06ac53ae079e4334ad008b2ef210f34ed7979..abeeef8a2a5afad2aebfed8896496e804c85aa22 100644 (file)
@@ -1,5 +1,5 @@
 /* 
- * $Id: cnid.c,v 1.3 2005-05-03 14:55:12 didg Exp $
+ * $Id: cnid.c,v 1.4 2008-12-03 18:35:44 didg Exp $
  *
  * Copyright (c) 2003 the Netatalk Team
  * Copyright (c) 2003 Rafal Lewczuk <rlewczuk@pronet.pl>
@@ -98,8 +98,8 @@ struct _cnid_db *cnid_open(const char *volpath, mode_t mask, char *type, int fla
     struct _cnid_db *db;
     cnid_module *mod = NULL;
     struct list_head *ptr;
-    uid_t uid;  /* uninitialized, OK 310105 */
-    gid_t gid;
+    uid_t uid = -1;  
+    gid_t gid = -1;
     
     list_for_each(ptr, &modules) {
         if (0 == strcmp(list_entry(ptr, cnid_module, db_list)->name, type)) {
index 9986544c9737119dab9573284fbdf7aa09606ba0..1b01ebe090e77c5bfa3c4f0b50ba9ca7b922a4ec 100644 (file)
@@ -14,7 +14,7 @@
 #include <netatalk/endian.h>
 #include <atalk/cnid.h>
 
-static __inline__ int db3_txn_abort(DB_TXN *db_txn)
+static int db3_txn_abort(DB_TXN *db_txn)
 {
     int ret;
 #if DB_VERSION_MAJOR >= 4
@@ -26,7 +26,7 @@ static __inline__ int db3_txn_abort(DB_TXN *db_txn)
 }
 
 /* -------------------- */
-static __inline__ int db3_txn_begin(DB_ENV *db_env, DB_TXN *parent, DB_TXN **db_txn, u_int32_t flags)
+static int db3_txn_begin(DB_ENV *db_env, DB_TXN *parent, DB_TXN **db_txn, u_int32_t flags)
 {
     int ret;
 #if DB_VERSION_MAJOR >= 4
@@ -38,7 +38,7 @@ static __inline__ int db3_txn_begin(DB_ENV *db_env, DB_TXN *parent, DB_TXN **db_
 }
             
 /* -------------------- */
-static __inline__ int db3_txn_commit(DB_TXN *db_txn, u_int32_t flags)
+static int db3_txn_commit(DB_TXN *db_txn, u_int32_t flags)
 {
     int ret;
 #if DB_VERSION_MAJOR >= 4
index aa9557fdb1ce88d1b4a394cb395099a1b1353157..c63543492dde4fc871b6f577ba382188a123c1fe 100644 (file)
@@ -1,6 +1,6 @@
 
 /*
- * $Id: cnid_db3_open.c,v 1.3 2005-05-03 14:55:13 didg Exp $
+ * $Id: cnid_db3_open.c,v 1.4 2008-12-03 18:35:44 didg Exp $
  *
  * Copyright (c) 1999. Adrian Sun (asun@zoology.washington.edu)
  * All Rights Reserved. See COPYRIGHT.
@@ -147,7 +147,7 @@ static int my_open(DB * p, const char *f, const char *d, DBTYPE t, u_int32_t fla
 */
 
 /* the first compare that's always done. */
-static __inline__ int compare_did(const DBT * a, const DBT * b)
+static int compare_did(const DBT * a, const DBT * b)
 {
     u_int32_t dida, didb;
 
index 9a454599662ca5cc4c371aadf874e149325918d1..98f99498575c0f5ea47968a513289039cf3ad330 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: cnid_db3_private.h,v 1.3 2005-05-03 14:55:13 didg Exp $
+ * $Id: cnid_db3_private.h,v 1.4 2008-12-03 18:35:44 didg Exp $
  */
 
 #ifndef LIBATALK_CNID_PRIVATE_H
@@ -101,12 +101,8 @@ typedef struct CNID_private {
  * name namelen = strlen(name) + 1 
  */
 
-#ifndef __inline__
-#define __inline__
-#endif /* __inline__ */
-
 /* construct db_cnid data. NOTE: this is not re-entrant.  */
-static __inline__ unsigned char *make_cnid_data(const struct stat *st,
+static inline unsigned char *make_cnid_data(const struct stat *st,
                                        const cnid_t did,
                                        const char *name, const size_t len)
 {
index 29bed97715dafcc8e249e3ef4d8cefd37f2ca878..f361f5e2c988c4252d2a686c371a75c49329cd0a 100644 (file)
@@ -88,7 +88,7 @@ extern int cnid_tdb_delete __P((struct _cnid_db *, const cnid_t));
 extern cnid_t cnid_tdb_nextid __P((struct _cnid_db *));
 
 /* construct db_cnid data. NOTE: this is not re-entrant.  */
-static __inline__ char *make_tdb_data(const struct stat *st,
+static inline char *make_tdb_data(const struct stat *st,
                                        const cnid_t did,
                                        const char *name, const size_t len)
 {
index 97998261ca1e58e3cb0a5ec86ab8a61fb32c2dd2..bb81089f466de81bd3bc9d9f920a9e321480b1a6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: server_child.c,v 1.9 2005-04-28 20:50:05 bfernhomberg Exp $
+ * $Id: server_child.c,v 1.10 2008-12-03 18:35:44 didg Exp $
  *
  * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu)
  * All rights reserved. See COPYRIGHT.
 
 #include <atalk/server_child.h>
 
-#ifndef __inline__
-#define __inline__
-#endif /* ! __inline__ */
-
 /* hash/child functions: hash OR's pid */
 #define CHILD_HASHSIZE 32
 #define HASH(i) ((((i) >> 8) ^ (i)) & (CHILD_HASHSIZE - 1))
@@ -77,7 +73,7 @@ typedef struct server_child_fork {
 } server_child_fork;
 
  
-static __inline__ void hash_child(struct server_child_data **htable,
+static inline void hash_child(struct server_child_data **htable,
                                  struct server_child_data *child)
 {
   struct server_child_data **table;
@@ -89,7 +85,7 @@ static __inline__ void hash_child(struct server_child_data **htable,
   child->prevp = table;
 }
 
-static __inline__ void unhash_child(struct server_child_data *child)
+static inline void unhash_child(struct server_child_data *child)
 {
   if (child->prevp) {
     if (child->next)
@@ -98,7 +94,7 @@ static __inline__ void unhash_child(struct server_child_data *child)
   }
 }
 
-static __inline__ struct server_child_data 
+static inline struct server_child_data 
 *resolve_child(struct server_child_data **table, const pid_t pid)
 {
   struct server_child_data *child;
index ac1e61d0c175c338f6785beb00981a1479e572f0..9a1a657e80388bbebc19888f9d15c56e8c524d13 100644 (file)
@@ -152,13 +152,13 @@ static char * make_path_absolute(char *path, size_t bufsize)
         *p = '\0';
     }
 
-    getcwd(savecwd, sizeof(savecwd));
-    if ((chdir(abspath)) < 0)  
+    if (!getcwd(savecwd, sizeof(savecwd)) || chdir(abspath) < 0)       
         return NULL;
 
-    getcwd(abspath, sizeof(abspath));
-    chdir (savecwd);
-
+    if (!getcwd(abspath, sizeof(abspath)) || chdir (savecwd) < 0)
+        return NULL;
+        
+    
     if (strlen(abspath) > bufsize)
         return NULL;