changeset 12424:7c2e2c4d45a4

[gaim-migrate @ 14731] Add prototypes, make things static, or #if 0 out unused function as necessary to get zephyr to compile without prototype warnings. It's painfully obvious that this code was written before prototypes existed, or at least before they became standard. As we need to maintain source compatibility with an external libzephyr, I can't really start adding header files. If someone cares about this protocol, feel free to clean this up a bit. My only concern is that I caught any actual mistakes and that it compiles without spurious warnings that would distract us from problems elsewhere. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Thu, 08 Dec 2005 23:38:36 +0000
parents 692467ea6244
children 6066f8e2782d
files src/protocols/zephyr/ZFmtSmRLst.c src/protocols/zephyr/ZGetLocs.c src/protocols/zephyr/ZGetSubs.c src/protocols/zephyr/ZMkAuth.c src/protocols/zephyr/ZPeekIfNot.c src/protocols/zephyr/ZRetSubs.c src/protocols/zephyr/ZSendPkt.c src/protocols/zephyr/ZSendRLst.c src/protocols/zephyr/ZSendRaw.c src/protocols/zephyr/Zinternal.c src/protocols/zephyr/et_name.c src/protocols/zephyr/zephyr.c src/protocols/zephyr/zephyr.h src/protocols/zephyr/zephyr_err.c
diffstat 14 files changed, 49 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/zephyr/ZFmtSmRLst.c	Thu Dec 08 23:36:47 2005 +0000
+++ b/src/protocols/zephyr/ZFmtSmRLst.c	Thu Dec 08 23:38:36 2005 +0000
@@ -10,6 +10,7 @@
 
 #include "internal.h"
 
+#if 0
 Code_t ZFormatSmallRawNoticeList(notice, list, nitems, buffer, ret_len)
     ZNotice_t *notice;
     char *list[];
@@ -44,3 +45,4 @@
 
     return (ZERR_NONE);
 }
+#endif
--- a/src/protocols/zephyr/ZGetLocs.c	Thu Dec 08 23:36:47 2005 +0000
+++ b/src/protocols/zephyr/ZGetLocs.c	Thu Dec 08 23:38:36 2005 +0000
@@ -11,10 +11,11 @@
 #include "internal.h"
 
 #define min(a,b) ((a)<(b)?(a):(b))
-	
-Code_t ZGetLocations(location, numlocs)
-    ZLocations_t *location;
-    int *numlocs;
+
+/* Prototype for -Wmissing-prototypes */
+Code_t ZGetLocations(ZLocations_t *location, int *numlocs);
+
+Code_t ZGetLocations(ZLocations_t *location, int *numlocs)
 {
     int i;
 	
--- a/src/protocols/zephyr/ZGetSubs.c	Thu Dec 08 23:36:47 2005 +0000
+++ b/src/protocols/zephyr/ZGetSubs.c	Thu Dec 08 23:38:36 2005 +0000
@@ -11,10 +11,11 @@
 #include "internal.h"
 
 #define min(a,b) ((a)<(b)?(a):(b))
-	
-Code_t ZGetSubscriptions(subscription, numsubs)
-    ZSubscription_t *subscription;
-    int *numsubs;
+
+/* Prototype for -Wmissing-prototypes */
+Code_t ZGetSubscriptions(ZSubscription_t *subscription, int *numsubs);
+
+Code_t ZGetSubscriptions(ZSubscription_t *subscription, int *numsubs)
 {
     int i;
 	
--- a/src/protocols/zephyr/ZMkAuth.c	Thu Dec 08 23:36:47 2005 +0000
+++ b/src/protocols/zephyr/ZMkAuth.c	Thu Dec 08 23:38:36 2005 +0000
@@ -24,12 +24,14 @@
 static KTEXT_ST last_authent;
 #endif
 
+#if 0
 Code_t ZResetAuthentication () {
 #ifdef ZEPHYR_USES_KERBEROS
     last_authent_time = 0L;
 #endif
     return ZERR_NONE;
 }
+#endif
 
 Code_t ZMakeAuthentication(notice, buffer, buffer_len, len)
     register ZNotice_t *notice;
--- a/src/protocols/zephyr/ZPeekIfNot.c	Thu Dec 08 23:36:47 2005 +0000
+++ b/src/protocols/zephyr/ZPeekIfNot.c	Thu Dec 08 23:38:36 2005 +0000
@@ -10,6 +10,7 @@
 
 #include "internal.h"
 
+#if 0
 Code_t ZPeekIfNotice(notice, from, predicate, args)
     ZNotice_t *notice;
     struct sockaddr_in *from;
@@ -49,3 +50,4 @@
 	    return (retval);
     }
 }
+#endif
--- a/src/protocols/zephyr/ZRetSubs.c	Thu Dec 08 23:36:47 2005 +0000
+++ b/src/protocols/zephyr/ZRetSubs.c	Thu Dec 08 23:38:36 2005 +0000
@@ -11,7 +11,7 @@
 
 #include "internal.h"
 
-static Code_t Z_RetSubs ();
+static Code_t Z_RetSubs(ZNotice_t *notice, int *nsubs, Z_AuthProc auth_routine);
 
 /* Need STDC definition when possible for unsigned short argument. */
 #ifdef __STDC__
@@ -41,6 +41,7 @@
 	return(Z_RetSubs(&notice, nsubs, ZAUTH));
 }
 
+#if 0
 Code_t ZRetrieveDefaultSubscriptions(nsubs)
 	int *nsubs;
 {
@@ -54,6 +55,7 @@
 	return(Z_RetSubs(&notice, nsubs, ZNOAUTH));
 
 }
+#endif
 
 static Code_t Z_RetSubs(notice, nsubs, auth_routine)
 	register ZNotice_t *notice;
--- a/src/protocols/zephyr/ZSendPkt.c	Thu Dec 08 23:36:47 2005 +0000
+++ b/src/protocols/zephyr/ZSendPkt.c	Thu Dec 08 23:38:36 2005 +0000
@@ -14,7 +14,8 @@
 #else
 #include <sys/socket.h>
 #endif
-static int wait_for_hmack();
+
+static int wait_for_hmack(ZNotice_t *notice, void *uid);
 
 Code_t ZSendPacket(packet, len, waitforack)
     char *packet;
@@ -56,9 +57,7 @@
     return retval;
 }
 
-static int wait_for_hmack(notice, uid)
-    ZNotice_t *notice;
-    ZUnique_Id_t *uid;
+static int wait_for_hmack(ZNotice_t *notice, void *uid)
 {
-    return (notice->z_kind == HMACK && ZCompareUID(&notice->z_uid, uid));
+    return (notice->z_kind == HMACK && ZCompareUID(&notice->z_uid, (ZUnique_Id_t *)uid));
 }
--- a/src/protocols/zephyr/ZSendRLst.c	Thu Dec 08 23:36:47 2005 +0000
+++ b/src/protocols/zephyr/ZSendRLst.c	Thu Dec 08 23:38:36 2005 +0000
@@ -1,5 +1,5 @@
 /* This file is part of the Project Athena Zephyr Notification System.
- * It contains source for the ZSendRawNotice function.
+ * It contains source for the ZSendRawList function.
  *
  *	Created by:	John T. Kohl
  *
@@ -10,6 +10,7 @@
 
 #include "internal.h"
 
+#if 0
 Code_t ZSendRawList(notice, list, nitems)
     ZNotice_t *notice;
     char *list[];
@@ -42,3 +43,4 @@
 
     return (retval);
 }
+#endif
--- a/src/protocols/zephyr/ZSendRaw.c	Thu Dec 08 23:36:47 2005 +0000
+++ b/src/protocols/zephyr/ZSendRaw.c	Thu Dec 08 23:38:36 2005 +0000
@@ -10,6 +10,7 @@
 
 #include "internal.h"
 
+#if 0
 Code_t ZSendRawNotice(notice)
     ZNotice_t *notice;
 {
@@ -31,3 +32,4 @@
 
     return (retval);
 }
+#endif
--- a/src/protocols/zephyr/Zinternal.c	Thu Dec 08 23:36:47 2005 +0000
+++ b/src/protocols/zephyr/Zinternal.c	Thu Dec 08 23:38:36 2005 +0000
@@ -144,7 +144,7 @@
 
 /* Return 1 if there is a packet waiting, 0 otherwise */
 
-int Z_PacketWaiting()
+static int Z_PacketWaiting()
 {
     struct timeval tv;
     fd_set read;
@@ -195,7 +195,7 @@
  * notices that haven't been touched in a while
  */
 
-struct _Z_InputQ *Z_SearchQueue(uid, kind)
+static struct _Z_InputQ *Z_SearchQueue(uid, kind)
     ZUnique_Id_t *uid;
     ZNotice_Kind_t kind;
 {
--- a/src/protocols/zephyr/et_name.c	Thu Dec 08 23:36:47 2005 +0000
+++ b/src/protocols/zephyr/et_name.c	Thu Dec 08 23:38:36 2005 +0000
@@ -14,9 +14,11 @@
 static const char char_set[] =
 	"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_";
 
-const char * error_table_name_r(num, buf)
-    int num;
-    char *buf;
+/* Prototypes for -Wmissing-prototypes */
+const char * error_table_name(int num);
+const char * error_table_name_r(int num, char *buf);
+
+const char * error_table_name_r(int num, char *buf)
 {
     int ch;
     int i;
@@ -37,8 +39,7 @@
     return(buf);
 }
 
-const char * error_table_name(num)
-    int num;
+const char * error_table_name(int num)
 {
     static char buf[6];
 
--- a/src/protocols/zephyr/zephyr.c	Thu Dec 08 23:36:47 2005 +0000
+++ b/src/protocols/zephyr/zephyr.c	Thu Dec 08 23:38:36 2005 +0000
@@ -147,7 +147,7 @@
 extern const char *username;
 #endif
 
-Code_t zephyr_subscribe_to(zephyr_account* zephyr, char* class, char *instance, char *recipient, char* galaxy) {
+static Code_t zephyr_subscribe_to(zephyr_account* zephyr, char* class, char *instance, char *recipient, char* galaxy) {
 
 	if (use_tzc(zephyr)) {
 		/* ((tzcfodder . subscribe) ("class" "instance" "recipient")) */
@@ -175,7 +175,7 @@
 static void zephyr_chat_set_topic(GaimConnection * gc, int id, const char *topic);
 char* zephyr_tzc_deescape_str(const char *message);
 
-char *zephyr_strip_local_realm(zephyr_account* zephyr,const char* user){
+static char *zephyr_strip_local_realm(zephyr_account* zephyr,const char* user){
 	/*
 	  Takes in a username of the form username or username@realm 
 	  and returns:
@@ -885,7 +885,8 @@
 		
 	}
 }
-int  free_parse_tree(parse_tree* tree) {
+
+static int  free_parse_tree(parse_tree* tree) {
 	if (!tree) {
 		return 0;
 	}
@@ -906,7 +907,7 @@
 	return 0;
 }
 
-parse_tree *tree_child(parse_tree* tree,int index) {
+static parse_tree *tree_child(parse_tree* tree,int index) {
 	if (index < tree->num_children) {
 		return tree->children[index];
 	} else {
@@ -914,7 +915,7 @@
 	}
 }
 
-parse_tree *find_node(parse_tree* ptree,gchar* key)
+static parse_tree *find_node(parse_tree* ptree,gchar* key)
 {
 	gchar* tc = tree_child(ptree,0)->contents;
 
@@ -936,7 +937,7 @@
 	}
 }
 
-parse_tree *parse_buffer(gchar* source, gboolean do_parse) {
+static parse_tree *parse_buffer(gchar* source, gboolean do_parse) {
 	
 	parse_tree *ptree = g_new0(parse_tree,1);
 	ptree->contents = NULL;
@@ -1026,7 +1027,7 @@
 	}
 }
 
-parse_tree  *read_from_tzc(zephyr_account* zephyr){
+static parse_tree  *read_from_tzc(zephyr_account* zephyr){
 	struct timeval tv;
 	fd_set rfds;
 	int bufsize = 2048;
@@ -1981,7 +1982,7 @@
 static int zephyr_send_message(zephyr_account *zephyr,char* zclass, char* instance, char* recipient, const char *im, 
 			       const char *sig, char *opcode) ;
 
-const char * zephyr_get_signature()
+static const char * zephyr_get_signature()
 {
 	/* XXX add zephyr error reporting */
 	const char * sig =ZGetVariable("zwrite-signature");
@@ -2042,7 +2043,7 @@
 /* Munge the outgoing zephyr so that any quotes or backslashes are
    escaped and do not confuse tzc: */
 
-char* zephyr_tzc_escape_msg(const char *message)
+static char* zephyr_tzc_escape_msg(const char *message)
 {
 	int pos = 0;
 	int pos2 = 0;
--- a/src/protocols/zephyr/zephyr.h	Thu Dec 08 23:36:47 2005 +0000
+++ b/src/protocols/zephyr/zephyr.h	Thu Dec 08 23:38:36 2005 +0000
@@ -97,7 +97,7 @@
     int			z_authent_len;
     char		*z_ascii_authent;
     char		*z_class;
-    const char	*z_class_inst;
+    const char		*z_class_inst;
     char		*z_opcode;
     char		*z_sender;
     const char		*z_recipient;
@@ -177,8 +177,6 @@
 Code_t ZSetFD ZP((int));
 Code_t ZFormatSmallRawNotice ZP((ZNotice_t*, ZPacket_t, int*));
 int ZCompareUID ZP((ZUnique_Id_t*, ZUnique_Id_t*));
-Code_t ZSrvSendRawList ZP((ZNotice_t*, char*[], int,
-			   Code_t (*)(ZNotice_t *, char *, int, int)));
 Code_t ZMakeAscii ZP((char*, int, unsigned char*, int));
 Code_t ZMakeAscii32 ZP((char *, int, unsigned long));
 Code_t ZMakeAscii16 ZP((char *, int, unsigned int));
--- a/src/protocols/zephyr/zephyr_err.c	Thu Dec 08 23:36:47 2005 +0000
+++ b/src/protocols/zephyr/zephyr_err.c	Thu Dec 08 23:38:36 2005 +0000
@@ -1,7 +1,5 @@
-/*
- * zephyr_err.c:
- * This file is automatically generated; please do not edit it.
- */
+#include "zephyr_err.h"
+
 #ifdef __STDC__
 #define NOARGS void
 #else