From 9d78f9b52ea18b442fc91c6a1e8d8b607f2f90e8 Mon Sep 17 00:00:00 2001 From: didg Date: Tue, 25 Nov 2008 15:16:31 +0000 Subject: [PATCH] remove gcc warnings and cleanup inline mess --- bin/psorder/psorder.c | 4 +- etc/afpd/afp_asp.c | 8 ++-- etc/afpd/afp_dsi.c | 4 +- etc/afpd/appl.c | 4 +- etc/afpd/directory.c | 12 +++--- etc/afpd/directory.h | 6 +-- etc/afpd/file.c | 4 +- etc/afpd/filedir.c | 4 +- etc/afpd/fork.c | 10 ++--- etc/afpd/fork.h | 4 +- etc/afpd/globals.h | 7 +--- etc/afpd/ofork.c | 8 ++-- etc/afpd/unix.c | 6 +-- etc/afpd/volume.c | 4 +- etc/papd/lp.c | 4 +- etc/uams/uams_krb4/uams_krb4.c | 6 +-- etc/uams/uams_randnum.c | 8 +--- include/atalk/adouble.h | 10 ++--- include/atalk/list.h | 21 ++++------ libatalk/adouble/ad_lock.c | 12 +++--- libatalk/adouble/ad_mmap.c | 4 +- libatalk/adouble/ad_open.c | 8 ++-- libatalk/adouble/ad_private.h | 6 +-- libatalk/adouble/ad_sendfile.c | 4 +- libatalk/cnid/cdb/cnid_cdb_add.c | 11 +++--- libatalk/cnid/cdb/cnid_cdb_private.h | 58 +--------------------------- libatalk/cnid/cnid.c | 6 +-- libatalk/cnid/db3/cnid_db3.h | 6 +-- libatalk/cnid/db3/cnid_db3_open.c | 4 +- libatalk/cnid/db3/cnid_db3_private.h | 8 +--- libatalk/cnid/tdb/cnid_tdb.h | 2 +- libatalk/util/server_child.c | 12 ++---- 32 files changed, 93 insertions(+), 182 deletions(-) diff --git a/bin/psorder/psorder.c b/bin/psorder/psorder.c index 7ba4332f..450c8ee3 100644 --- a/bin/psorder/psorder.c +++ b/bin/psorder/psorder.c @@ -1,5 +1,5 @@ /* - * $Id: psorder.c,v 1.5 2001-06-29 14:14:46 rufustfirefly Exp $ + * $Id: psorder.c,v 1.5.16.1 2008-11-25 15:16:31 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, "" ); diff --git a/etc/afpd/afp_asp.c b/etc/afpd/afp_asp.c index c167e536..c6517b14 100644 --- a/etc/afpd/afp_asp.c +++ b/etc/afpd/afp_asp.c @@ -1,5 +1,5 @@ /* - * $Id: afp_asp.c,v 1.18.6.6.2.1 2005-09-27 10:40:40 didg Exp $ + * $Id: afp_asp.c,v 1.18.6.6.2.2 2008-11-25 15:16:31 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]; diff --git a/etc/afpd/afp_dsi.c b/etc/afpd/afp_dsi.c index c480b1ca..110b1b40 100644 --- a/etc/afpd/afp_dsi.c +++ b/etc/afpd/afp_dsi.c @@ -1,5 +1,5 @@ /* - * $Id: afp_dsi.c,v 1.27.2.3.2.4.2.2 2005-09-27 10:40:40 didg Exp $ + * $Id: afp_dsi.c,v 1.27.2.3.2.4.2.3 2008-11-25 15:16:32 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; diff --git a/etc/afpd/appl.c b/etc/afpd/appl.c index 6fd2abb1..7934b48e 100644 --- a/etc/afpd/appl.c +++ b/etc/afpd/appl.c @@ -1,5 +1,5 @@ /* - * $Id: appl.c,v 1.12.2.1.2.2.2.2 2005-09-27 10:40:41 didg Exp $ + * $Id: appl.c,v 1.12.2.1.2.2.2.3 2008-11-25 15:16:32 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; diff --git a/etc/afpd/directory.c b/etc/afpd/directory.c index 82539580..577a4254 100644 --- a/etc/afpd/directory.c +++ b/etc/afpd/directory.c @@ -1,5 +1,5 @@ /* - * $Id: directory.c,v 1.71.2.4.2.15.2.9 2006-09-19 02:24:04 didg Exp $ + * $Id: directory.c,v 1.71.2.4.2.15.2.10 2008-11-25 15:16:32 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -392,9 +392,7 @@ 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; @@ -1613,8 +1611,9 @@ struct path Cur_Path = { 0, "", /* mac name */ ".", /* unix name */ + NULL, 0, /* stat is not set */ - 0, /* */ + 0 /* errno */ }; /* ------------------ */ @@ -2147,10 +2146,9 @@ struct dir *dir, *newparent; #define DOT_APPLEDOUBLE_LEN 13 /* delete an empty directory */ -int deletecurdir( vol, path, pathlen ) +int deletecurdir( vol, path ) const struct vol *vol; char *path; -int pathlen; { struct dirent *de; struct stat st; diff --git a/etc/afpd/directory.h b/etc/afpd/directory.h index 35971bf4..12b64790 100644 --- a/etc/afpd/directory.h +++ b/etc/afpd/directory.h @@ -1,5 +1,5 @@ /* - * $Id: directory.h,v 1.13.2.4.2.2 2004-05-10 18:40:32 didg Exp $ + * $Id: directory.h,v 1.13.2.4.2.2.2.1 2008-11-25 15:16:32 didg Exp $ * * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. @@ -70,7 +70,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 @@ -196,7 +196,7 @@ extern struct dir *adddir __P((struct vol *, struct dir *, extern struct dir *dirinsert __P((struct vol *, struct dir *)); extern int movecwd __P((const struct vol *, struct dir *)); -extern int deletecurdir __P((const struct vol *, char *, int)); +extern int deletecurdir __P((const struct vol *, char *)); extern struct path *cname __P((const struct vol *, struct dir *, char **)); extern mode_t mtoumode __P((struct maccess *)); diff --git a/etc/afpd/file.c b/etc/afpd/file.c index 510d64e7..efbc55ab 100644 --- a/etc/afpd/file.c +++ b/etc/afpd/file.c @@ -1,5 +1,5 @@ /* - * $Id: file.c,v 1.92.2.2.2.31.2.21 2007-05-14 18:25:27 didg Exp $ + * $Id: file.c,v 1.92.2.2.2.31.2.22 2008-11-25 15:16:33 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -1326,7 +1326,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; diff --git a/etc/afpd/filedir.c b/etc/afpd/filedir.c index e74b2f3a..93a9c994 100644 --- a/etc/afpd/filedir.c +++ b/etc/afpd/filedir.c @@ -1,5 +1,5 @@ /* - * $Id: filedir.c,v 1.45.2.2.2.14.2.4 2005-09-27 10:40:41 didg Exp $ + * $Id: filedir.c,v 1.45.2.2.2.14.2.5 2008-11-25 15:16:33 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -569,7 +569,7 @@ int ibuflen _U_, *rbuflen; rc = AFPERR_ACCESS; } else { - rc = deletecurdir( vol, obj->oldtmp, AFPOBJ_TMPSIZ); + rc = deletecurdir( vol, obj->oldtmp); } } else if (of_findname(s_path)) { rc = AFPERR_BUSY; diff --git a/etc/afpd/fork.c b/etc/afpd/fork.c index c63cca24..c537c03b 100644 --- a/etc/afpd/fork.c +++ b/etc/afpd/fork.c @@ -1,5 +1,5 @@ /* - * $Id: fork.c,v 1.51.2.2.2.10.2.5 2005-09-28 09:38:56 didg Exp $ + * $Id: fork.c,v 1.51.2.2.2.10.2.6 2008-11-25 15:16:33 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -162,7 +162,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; @@ -778,7 +778,7 @@ int ibuflen, *rbuflen; #undef UNLOCKBIT /* --------------------------- */ -static __inline__ int crlf( of ) +static int crlf( of ) struct ofork *of; { struct extmap *em; @@ -798,7 +798,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) @@ -1197,7 +1197,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) { diff --git a/etc/afpd/fork.h b/etc/afpd/fork.h index bd44edfd..0e7f7739 100644 --- a/etc/afpd/fork.h +++ b/etc/afpd/fork.h @@ -1,5 +1,5 @@ /* - * $Id: fork.h,v 1.8.6.2.2.2 2005-09-28 09:38:57 didg Exp $ + * $Id: fork.h,v 1.8.6.2.2.3 2008-11-25 15:16:33 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; }; diff --git a/etc/afpd/globals.h b/etc/afpd/globals.h index c3f40990..48571496 100644 --- a/etc/afpd/globals.h +++ b/etc/afpd/globals.h @@ -1,5 +1,5 @@ /* - * $Id: globals.h,v 1.18.2.2.2.5 2004-06-15 00:35:06 bfernhomberg Exp $ + * $Id: globals.h,v 1.18.2.2.2.5.2.1 2008-11-25 15:16:33 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -26,11 +26,6 @@ #include #include -/* test for inline */ -#ifndef __inline__ -#define __inline__ -#endif - #define MACFILELEN 31 #define OPTION_DEBUG (1 << 0) diff --git a/etc/afpd/ofork.c b/etc/afpd/ofork.c index b124351a..550013d7 100644 --- a/etc/afpd/ofork.c +++ b/etc/afpd/ofork.c @@ -1,5 +1,5 @@ /* - * $Id: ofork.c,v 1.20.6.6.2.6 2008-08-16 20:40:55 didg Exp $ + * $Id: ofork.c,v 1.20.6.6.2.7 2008-11-25 15:16:33 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) diff --git a/etc/afpd/unix.c b/etc/afpd/unix.c index 680a5161..58170528 100644 --- a/etc/afpd/unix.c +++ b/etc/afpd/unix.c @@ -1,5 +1,5 @@ /* - * $Id: unix.c,v 1.43.2.1.2.10.2.3 2005-09-27 10:40:41 didg Exp $ + * $Id: unix.c,v 1.43.2.1.2.10.2.4 2008-11-25 15:16:33 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; @@ -205,7 +205,7 @@ const gid_t gid; return( 0 ); } -static __inline__ mode_t mtoubits( bits ) +static mode_t mtoubits( bits ) u_char bits; { mode_t mode; diff --git a/etc/afpd/volume.c b/etc/afpd/volume.c index 30079cfa..1dfadcf8 100644 --- a/etc/afpd/volume.c +++ b/etc/afpd/volume.c @@ -1,5 +1,5 @@ /* - * $Id: volume.c,v 1.51.2.7.2.33.2.14 2007-04-11 00:21:23 didg Exp $ + * $Id: volume.c,v 1.51.2.7.2.33.2.15 2008-11-25 15:16:33 didg Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -186,7 +186,7 @@ static const _vol_opt_name vol_opt_casefold[] = { static void handle_special_folders (const struct vol *); static int savevoloptions (const struct vol *); -static __inline__ void volfree(struct vol_option *options, +static void volfree(struct vol_option *options, const struct vol_option *save) { int i; diff --git a/etc/papd/lp.c b/etc/papd/lp.c index 4fdbe9cf..6740a386 100644 --- a/etc/papd/lp.c +++ b/etc/papd/lp.c @@ -1,5 +1,5 @@ /* - * $Id: lp.c,v 1.14.8.4.2.3 2008-11-14 10:04:52 didg Exp $ + * $Id: lp.c,v 1.14.8.4.2.4 2008-11-25 15:16:33 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 )); } diff --git a/etc/uams/uams_krb4/uams_krb4.c b/etc/uams/uams_krb4/uams_krb4.c index bc7f1430..14c849b5 100644 --- a/etc/uams/uams_krb4/uams_krb4.c +++ b/etc/uams/uams_krb4/uams_krb4.c @@ -1,5 +1,5 @@ /* - * $Id: uams_krb4.c,v 1.6.10.1.2.1 2008-11-14 10:04:52 didg Exp $ + * $Id: uams_krb4.c,v 1.6.10.1.2.2 2008-11-25 15:16:33 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++ ) { diff --git a/etc/uams/uams_randnum.c b/etc/uams/uams_randnum.c index b2be7f23..1256a1bc 100644 --- a/etc/uams/uams_randnum.c +++ b/etc/uams/uams_randnum.c @@ -1,5 +1,5 @@ /* - * $Id: uams_randnum.c,v 1.12.6.4.2.1 2005-09-27 10:40:41 didg Exp $ + * $Id: uams_randnum.c,v 1.12.6.4.2.2 2008-11-25 15:16:33 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 #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) diff --git a/include/atalk/adouble.h b/include/atalk/adouble.h index cafe27a4..929bf777 100644 --- a/include/atalk/adouble.h +++ b/include/atalk/adouble.h @@ -1,5 +1,5 @@ /* - * $Id: adouble.h,v 1.21.6.20.2.7 2006-09-29 09:27:54 didg Exp $ + * $Id: adouble.h,v 1.21.6.20.2.8 2008-11-25 15:16:33 didg Exp $ * Copyright (c) 1990,1991 Regents of The University of Michigan. * All Rights Reserved. * @@ -246,7 +246,8 @@ struct adouble { char ad_filler[ 16 ]; struct ad_entry ad_eid[ ADEID_MAX ]; struct ad_fd ad_df, ad_hf; - int ad_flags, ad_inited; + int ad_flags; + unsigned ad_inited; int ad_options; int ad_refcount; /* used in afpd/ofork.c */ off_t ad_rlen; /* ressource fork len with AFP 3.0 @@ -423,10 +424,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 */ diff --git a/include/atalk/list.h b/include/atalk/list.h index 82518ebd..bb39b90c 100644 --- a/include/atalk/list.h +++ b/include/atalk/list.h @@ -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; diff --git a/libatalk/adouble/ad_lock.c b/libatalk/adouble/ad_lock.c index a5d00e9c..be753868 100644 --- a/libatalk/adouble/ad_lock.c +++ b/libatalk/adouble/ad_lock.c @@ -1,5 +1,5 @@ /* - * $Id: ad_lock.c,v 1.11.6.4.2.1 2004-12-07 03:24:38 didg Exp $ + * $Id: ad_lock.c,v 1.11.6.4.2.2 2008-11-25 15:16:33 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) diff --git a/libatalk/adouble/ad_mmap.c b/libatalk/adouble/ad_mmap.c index 0d6df4ca..c40dfdde 100644 --- a/libatalk/adouble/ad_mmap.c +++ b/libatalk/adouble/ad_mmap.c @@ -1,5 +1,5 @@ /* - * $Id: ad_mmap.c,v 1.4.8.1 2004-02-20 19:57:14 didg Exp $ + * $Id: ad_mmap.c,v 1.4.8.1.2.1 2008-11-25 15:16:33 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) { diff --git a/libatalk/adouble/ad_open.c b/libatalk/adouble/ad_open.c index 724aee94..086b5d85 100644 --- a/libatalk/adouble/ad_open.c +++ b/libatalk/adouble/ad_open.c @@ -1,5 +1,5 @@ /* - * $Id: ad_open.c,v 1.30.6.18.2.7 2006-09-29 09:27:54 didg Exp $ + * $Id: ad_open.c,v 1.30.6.18.2.8 2008-11-25 15:16:33 didg Exp $ * * Copyright (c) 1999 Adrian Sun (asun@u.washington.edu) * Copyright (c) 1990,1991 Regents of The University of Michigan. @@ -712,9 +712,7 @@ ad_path( path, adflags ) * ._name */ char * -ad_path_osx( path, adflags ) - const char *path; - int adflags; +ad_path_osx( const char *path, int adflags _U_) { static char pathbuf[ MAXPATHLEN + 1]; char c, *slash, buf[MAXPATHLEN + 1]; @@ -833,7 +831,7 @@ int ret = 0; #ifdef EMULATE_SUIDDIR uid_t id; - if (default_uid != -1) { + if (default_uid != (uid_t)-1) { /* we are root (admin) */ id = (default_uid)?default_uid:stbuf->st_uid; ret = chown( path, id, stbuf->st_gid ); diff --git a/libatalk/adouble/ad_private.h b/libatalk/adouble/ad_private.h index f87d51e1..771ec324 100644 --- a/libatalk/adouble/ad_private.h +++ b/libatalk/adouble/ad_private.h @@ -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.5.8.1 2008-11-25 15:16:34 didg Exp $ */ #ifndef LIBATALK_ADOUBLE_AD_PRIVATE_H @@ -11,10 +11,6 @@ #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. */ diff --git a/libatalk/adouble/ad_sendfile.c b/libatalk/adouble/ad_sendfile.c index 5245c6ae..e4057fe6 100644 --- a/libatalk/adouble/ad_sendfile.c +++ b/libatalk/adouble/ad_sendfile.c @@ -1,5 +1,5 @@ /* - * $Id: ad_sendfile.c,v 1.6.6.2 2004-02-20 19:57:15 didg Exp $ + * $Id: ad_sendfile.c,v 1.6.6.2.2.1 2008-11-25 15:16:34 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) { diff --git a/libatalk/cnid/cdb/cnid_cdb_add.c b/libatalk/cnid/cdb/cnid_cdb_add.c index 6b9924aa..4fd6500e 100644 --- a/libatalk/cnid/cdb/cnid_cdb_add.c +++ b/libatalk/cnid/cdb/cnid_cdb_add.c @@ -1,5 +1,5 @@ /* - * $Id: cnid_cdb_add.c,v 1.1.4.6.2.2 2005-09-27 10:40:41 didg Exp $ + * $Id: cnid_cdb_add.c,v 1.1.4.6.2.3 2008-11-25 15:16:34 didg Exp $ * * Copyright (c) 1999. Adrian Sun (asun@zoology.washington.edu) * All Rights Reserved. See COPYRIGHT. @@ -16,9 +16,12 @@ #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) diff --git a/libatalk/cnid/cdb/cnid_cdb_private.h b/libatalk/cnid/cdb/cnid_cdb_private.h index a59ae84f..a5a77e89 100644 --- a/libatalk/cnid/cdb/cnid_cdb_private.h +++ b/libatalk/cnid/cdb/cnid_cdb_private.h @@ -1,5 +1,5 @@ /* - * $Id: cnid_cdb_private.h,v 1.1.4.7.2.1 2005-09-27 10:40:41 didg Exp $ + * $Id: cnid_cdb_private.h,v 1.1.4.7.2.2 2008-11-25 15:16:34 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 */ diff --git a/libatalk/cnid/cnid.c b/libatalk/cnid/cnid.c index 79244d30..d17f31e5 100644 --- a/libatalk/cnid/cnid.c +++ b/libatalk/cnid/cnid.c @@ -1,5 +1,5 @@ /* - * $Id: cnid.c,v 1.1.4.11.2.3 2005-09-27 10:40:41 didg Exp $ + * $Id: cnid.c,v 1.1.4.11.2.4 2008-11-25 15:16:34 didg Exp $ * * Copyright (c) 2003 the Netatalk Team * Copyright (c) 2003 Rafal Lewczuk @@ -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)) { diff --git a/libatalk/cnid/db3/cnid_db3.h b/libatalk/cnid/db3/cnid_db3.h index 9986544c..1b01ebe0 100644 --- a/libatalk/cnid/db3/cnid_db3.h +++ b/libatalk/cnid/db3/cnid_db3.h @@ -14,7 +14,7 @@ #include #include -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 diff --git a/libatalk/cnid/db3/cnid_db3_open.c b/libatalk/cnid/db3/cnid_db3_open.c index 98356749..c7c1eb1b 100644 --- a/libatalk/cnid/db3/cnid_db3_open.c +++ b/libatalk/cnid/db3/cnid_db3_open.c @@ -1,6 +1,6 @@ /* - * $Id: cnid_db3_open.c,v 1.1.4.4 2004-03-02 13:30:29 bfernhomberg Exp $ + * $Id: cnid_db3_open.c,v 1.1.4.4.2.1 2008-11-25 15:16:34 didg Exp $ * * Copyright (c) 1999. Adrian Sun (asun@zoology.washington.edu) * All Rights Reserved. See COPYRIGHT. @@ -142,7 +142,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; diff --git a/libatalk/cnid/db3/cnid_db3_private.h b/libatalk/cnid/db3/cnid_db3_private.h index 7769f59b..ee0cc0eb 100644 --- a/libatalk/cnid/db3/cnid_db3_private.h +++ b/libatalk/cnid/db3/cnid_db3_private.h @@ -1,5 +1,5 @@ /* - * $Id: cnid_db3_private.h,v 1.1.4.3.2.1 2005-09-27 10:40:41 didg Exp $ + * $Id: cnid_db3_private.h,v 1.1.4.3.2.2 2008-11-25 15:16:35 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) { diff --git a/libatalk/cnid/tdb/cnid_tdb.h b/libatalk/cnid/tdb/cnid_tdb.h index 29bed977..f361f5e2 100644 --- a/libatalk/cnid/tdb/cnid_tdb.h +++ b/libatalk/cnid/tdb/cnid_tdb.h @@ -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) { diff --git a/libatalk/util/server_child.c b/libatalk/util/server_child.c index 9f96c4be..06d944f6 100644 --- a/libatalk/util/server_child.c +++ b/libatalk/util/server_child.c @@ -1,5 +1,5 @@ /* - * $Id: server_child.c,v 1.7.4.1.2.4.2.1 2005-03-31 00:25:55 didg Exp $ + * $Id: server_child.c,v 1.7.4.1.2.4.2.2 2008-11-25 15:16:35 didg Exp $ * * Copyright (c) 1997 Adrian Sun (asun@zoology.washington.edu) * All rights reserved. See COPYRIGHT. @@ -51,10 +51,6 @@ #include -#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; -- 2.39.2