From ca6aa912bbe81b264f6f937172f0e39c8aa96630 Mon Sep 17 00:00:00 2001 From: srittau Date: Fri, 6 Jun 2003 21:17:19 +0000 Subject: [PATCH] Warning fixes. --- bin/megatron/hqx.c | 3 ++- bin/megatron/nad.h | 4 +++- etc/afpd/unix.c | 6 ++++-- libatalk/cnid/cnid_add.c | 5 +++-- libatalk/cnid/cnid_close.c | 3 +-- libatalk/cnid/cnid_lookup.c | 3 ++- libatalk/cnid/cnid_mangle_add.c | 5 ++--- libatalk/cnid/cnid_mangle_get.c | 4 +--- libatalk/cnid/cnid_private.h | 4 +++- libatalk/cnid/cnid_update.c | 3 ++- libatalk/util/logger.c | 23 ++++------------------- 11 files changed, 27 insertions(+), 36 deletions(-) diff --git a/bin/megatron/hqx.c b/bin/megatron/hqx.c index 40187bc2..819f5ca7 100644 --- a/bin/megatron/hqx.c +++ b/bin/megatron/hqx.c @@ -1,5 +1,5 @@ /* - * $Id: hqx.c,v 1.12 2002-04-29 01:52:49 morgana Exp $ + * $Id: hqx.c,v 1.13 2003-06-06 21:17:19 srittau Exp $ */ #ifdef HAVE_CONFIG_H @@ -28,6 +28,7 @@ #include #include "megatron.h" +#include "nad.h" #include "hqx.h" #define HEXOUTPUT 0 diff --git a/bin/megatron/nad.h b/bin/megatron/nad.h index 0e0332df..9ce6aaf9 100644 --- a/bin/megatron/nad.h +++ b/bin/megatron/nad.h @@ -1,5 +1,5 @@ /* - * $Id: nad.h,v 1.2 2001-06-29 14:14:46 rufustfirefly Exp $ + * $Id: nad.h,v 1.3 2003-06-06 21:17:20 srittau Exp $ */ #ifndef _NAD_H @@ -15,4 +15,6 @@ int nad_read(int fork, char *forkbuf, int bufc); int nad_write(int fork, char *forkbuf, int bufc); int nad_close(int status); +void select_charset(int options); + #endif /* _NAD_H */ diff --git a/etc/afpd/unix.c b/etc/afpd/unix.c index 2d4c4518..22019e56 100644 --- a/etc/afpd/unix.c +++ b/etc/afpd/unix.c @@ -1,5 +1,5 @@ /* - * $Id: unix.c,v 1.44 2003-06-05 09:17:12 didg Exp $ + * $Id: unix.c,v 1.45 2003-06-06 21:18:00 srittau Exp $ * * Copyright (c) 1990,1993 Regents of The University of Michigan. * All Rights Reserved. See COPYRIGHT. @@ -23,7 +23,7 @@ #include #include /* STDC check */ -#if STDC_HEADERS +#ifdef STDC_HEADERS #include #else /* STDC_HEADERS */ #ifndef HAVE_STRCHR @@ -710,10 +710,12 @@ recursive_chown_end: /* This is equivalent of unix rename(). */ int unix_rename(const char *oldpath, const char *newpath) { +#if 0 char pd_name[PATH_MAX+1]; int i; struct stat pd_stat; uid_t uid; +#endif if (rename(oldpath, newpath) < 0) return -1; diff --git a/libatalk/cnid/cnid_add.c b/libatalk/cnid/cnid_add.c index f044f950..3fd59e8c 100644 --- a/libatalk/cnid/cnid_add.c +++ b/libatalk/cnid/cnid_add.c @@ -1,5 +1,5 @@ /* - * $Id: cnid_add.c,v 1.34 2003-03-07 14:51:50 didg Exp $ + * $Id: cnid_add.c,v 1.35 2003-06-06 21:22:43 srittau Exp $ * * Copyright (c) 1999. Adrian Sun (asun@zoology.washington.edu) * All Rights Reserved. See COPYRIGHT. @@ -37,6 +37,7 @@ #include #include +#define use_make_cnid_data #include "cnid_private.h" #ifdef CNID_DB_CDB @@ -50,7 +51,7 @@ static int add_cnid(CNID_private *db, DBT *key, DBT *data) { #ifndef CNID_DB_CDB DB_TXN *tid; #endif /* CNID_DB_CDB */ - int rc, ret; + int rc; memset(&altkey, 0, sizeof(altkey)); memset(&altdata, 0, sizeof(altdata)); diff --git a/libatalk/cnid/cnid_close.c b/libatalk/cnid/cnid_close.c index 39e07a48..db5647eb 100644 --- a/libatalk/cnid/cnid_close.c +++ b/libatalk/cnid/cnid_close.c @@ -1,5 +1,5 @@ /* - * $Id: cnid_close.c,v 1.29 2003-03-09 19:55:35 didg Exp $ + * $Id: cnid_close.c,v 1.30 2003-06-06 21:22:44 srittau Exp $ */ #ifdef HAVE_CONFIG_H @@ -24,7 +24,6 @@ void cnid_close(void *CNID) { CNID_private *db; - int rc; if (!(db = CNID)) { return; diff --git a/libatalk/cnid/cnid_lookup.c b/libatalk/cnid/cnid_lookup.c index 13978860..153dcca7 100644 --- a/libatalk/cnid/cnid_lookup.c +++ b/libatalk/cnid/cnid_lookup.c @@ -1,5 +1,5 @@ /* - * $Id: cnid_lookup.c,v 1.16 2003-01-04 20:49:33 jmarcus Exp $ + * $Id: cnid_lookup.c,v 1.17 2003-06-06 21:22:44 srittau Exp $ */ #ifdef HAVE_CONFIG_H @@ -19,6 +19,7 @@ #include #include +#define use_make_cnid_data #include "cnid_private.h" #define LOGFILEMAX 100 /* kbytes */ diff --git a/libatalk/cnid/cnid_mangle_add.c b/libatalk/cnid/cnid_mangle_add.c index ef37a315..6439eb44 100644 --- a/libatalk/cnid/cnid_mangle_add.c +++ b/libatalk/cnid/cnid_mangle_add.c @@ -1,5 +1,5 @@ /* - * $Id: cnid_mangle_add.c,v 1.5 2003-01-04 20:49:33 jmarcus Exp $ + * $Id: cnid_mangle_add.c,v 1.6 2003-06-06 21:22:44 srittau Exp $ */ #ifdef HAVE_CONFIG_H @@ -35,8 +35,7 @@ cnid_mangle_add(void *CNID, char *mfilename, char *filename) #ifndef CNID_DB_CDB DB_TXN *tid; #endif /* CNID_DB_CDB */ - cnid_t id; - int rc, ret; + int rc; if (!(db = CNID)) { return -1; diff --git a/libatalk/cnid/cnid_mangle_get.c b/libatalk/cnid/cnid_mangle_get.c index b0c3d289..dec6c29d 100644 --- a/libatalk/cnid/cnid_mangle_get.c +++ b/libatalk/cnid/cnid_mangle_get.c @@ -1,5 +1,5 @@ /* - * $Id: cnid_mangle_get.c,v 1.7 2003-01-04 20:49:33 jmarcus Exp $ + * $Id: cnid_mangle_get.c,v 1.8 2003-06-06 21:22:45 srittau Exp $ */ #ifdef HAVE_CONFIG_H @@ -28,8 +28,6 @@ cnid_mangle_get(void *CNID, char *mfilename) { CNID_private *db; DBT key, data; - cnid_t id; - struct stat st; char *filename; int rc; diff --git a/libatalk/cnid/cnid_private.h b/libatalk/cnid/cnid_private.h index 5b6ff05a..d5ee6a47 100644 --- a/libatalk/cnid/cnid_private.h +++ b/libatalk/cnid/cnid_private.h @@ -1,5 +1,5 @@ /* - * $Id: cnid_private.h,v 1.11 2002-05-30 06:41:19 jmarcus Exp $ + * $Id: cnid_private.h,v 1.12 2003-06-06 21:22:45 srittau Exp $ */ #ifndef LIBATALK_CNID_PRIVATE_H @@ -113,6 +113,7 @@ typedef struct CNID_private { #define __inline__ #endif /* __inline__ */ +#ifdef use_make_cnid_data /* construct db_cnid data. NOTE: this is not re-entrant. */ static __inline__ char *make_cnid_data(const struct stat *st, const cnid_t did, @@ -137,5 +138,6 @@ static __inline__ char *make_cnid_data(const struct stat *st, return start; } +#endif /* use_make_cnid_date */ #endif /* atalk/cnid/cnid_private.h */ diff --git a/libatalk/cnid/cnid_update.c b/libatalk/cnid/cnid_update.c index 1a2dbb1c..92aafee4 100644 --- a/libatalk/cnid/cnid_update.c +++ b/libatalk/cnid/cnid_update.c @@ -1,5 +1,5 @@ /* - * $Id: cnid_update.c,v 1.20 2002-08-30 03:12:52 jmarcus Exp $ + * $Id: cnid_update.c,v 1.21 2003-06-06 21:22:45 srittau Exp $ */ #ifdef HAVE_CONFIG_H @@ -19,6 +19,7 @@ #include #include +#define use_make_cnid_data #include "cnid_private.h" #ifdef CNID_DB_CDB diff --git a/libatalk/util/logger.c b/libatalk/util/logger.c index 4dc47afa..3a7b88ab 100644 --- a/libatalk/util/logger.c +++ b/libatalk/util/logger.c @@ -134,8 +134,6 @@ void generate_message_details(char *message_details_buffer, int get_syslog_equivalent(enum loglevels loglevel); -static char *get_command_name(char *commandpath); - /* ========================================================================= Instanciated data ========================================================================= */ @@ -235,12 +233,6 @@ bool log_setup(char *filename, enum loglevels loglevel, enum logtypes logtype, { #ifndef DISABLE_LOGGER - struct stat statbuf; - int firstattempt; - int retval; - gid_t gid; - uid_t uid; - int access; char lastchar[2]; log_file_data_pair *logs; @@ -668,6 +660,7 @@ void load_proccessname_from_proc() Internal function definitions ========================================================================= */ +#if 0 static char *get_command_name(char *commandpath) { char *ptr; @@ -679,12 +672,13 @@ static char *get_command_name(char *commandpath) ptr = commandpath; else ptr++; - + #ifdef DEBUG_OUTPUT_TO_SCREEN printf("Concluded %s\n", ptr); #endif return ptr; } +#endif void workout_what_to_print(struct what_to_print_array *what_to_print, struct tag_log_file_data *log_struct) @@ -720,18 +714,10 @@ void generate_message_details(char *message_details_buffer, struct tag_log_file_data *log_struct, enum loglevels loglevel, enum logtypes logtype) { - char datebuffer[32]; - char processinfo[64]; - char *ptr = message_details_buffer; int templen; int len = message_details_buffer_length; - char log_buffer[MAXLOGSIZE]; - const char *logtype_string; - - char loglevel_string[12]; /* max int size is 2 billion, or 10 digits */ - struct what_to_print_array what_to_print; workout_what_to_print(&what_to_print, log_struct); @@ -929,8 +915,7 @@ void setuplog(char *logtype, char *loglevel, char *filename) can be taken from default if needs be. */ /* const char* sources[] = {"syslog", "filelog"}; */ - const char *null = ""; - int sourcenum, typenum, levelnum; + int typenum, levelnum; log_file_data_pair *logs = log_file_arr[logtype_default]; /* -- 2.39.2