From: wessels <> Date: Fri, 21 Nov 1997 10:42:37 +0000 (+0000) Subject: get rid of some compiler warnings X-Git-Tag: SQUID_3_0_PRE1~4498 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9aa84e04b3e81fdd4ec29c0d6fa24cfe326ef1ad;p=thirdparty%2Fsquid.git get rid of some compiler warnings --- diff --git a/include/snmp.h b/include/snmp.h index fc43bd618b..a5f9e06bb0 100644 --- a/include/snmp.h +++ b/include/snmp.h @@ -3,7 +3,7 @@ * * */ -/*********************************************************** +/* Copyright 1988, 1989 by Carnegie Mellon University All Rights Reserved @@ -23,7 +23,7 @@ ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -******************************************************************/ +*/ #ifndef SNMP_H #define SNMP_H @@ -121,7 +121,6 @@ typedef struct _conf_if_list { extern conf_if_list *if_list; -#ifndef SQUID_SNMP /*extern void init_snmp(); */ extern int read_objid(char *input, @@ -129,19 +128,12 @@ extern int read_objid(char *input, int *out_len); extern void sprint_objid(char *buf, oid * id, int idlen); -extern void print_objid(oid * id, - int idlen); -void snmp_add_null_var(struct snmp_pdu *, - oid *, - int); -extern void xdump(u_char * cp, - int length, - char *prefix); - +extern void print_objid(oid * id, int idlen); +void snmp_add_null_var(struct snmp_pdu *, oid *, int); +extern void xdump(u_char * cp, int length, char *prefix); extern void snmp_synch_setup(struct snmp_session *session); - extern int snmp_synch_response(struct snmp_session *ss, struct snmp_pdu *pdu, struct snmp_pdu **response); -#endif + #endif diff --git a/include/snmp_api.h b/include/snmp_api.h index c8bbbd8ca8..292011573f 100644 --- a/include/snmp_api.h +++ b/include/snmp_api.h @@ -179,7 +179,6 @@ struct variable_list { int val_len; }; -#ifndef SQUID_SNMP /* * struct snmp_session *snmp_open(session) * struct snmp_session *session; @@ -315,7 +314,6 @@ void snmp_timeout _ANSI_ARGS_((void)); * Any data in the pdu must be copied because it will be freed elsewhere. * Operations are defined below: */ -#endif #define RECEIVED_MESSAGE 1 #define TIMED_OUT 2 diff --git a/snmplib/Makefile.in b/snmplib/Makefile.in index 498fe40f78..4c51492548 100644 --- a/snmplib/Makefile.in +++ b/snmplib/Makefile.in @@ -21,7 +21,7 @@ OBJS= snmp_client.o snmp.o snmp_auth.o asn1.o mib.o parse.o snmp_api.o \ CC= @CC@ FLAGS= -DEFS= -DBSD4_3 -DSQUID_SNMP +DEFS= -DBSD4_3 -DSQUID_SNMP=1 INCLUDE= -I../include -I./../include -I../src -I./../src MIBDEFS= -DMIBFILEPATH=\"$(prefix)/lib\" # CFLAGS=-O -DDEBUG -DBSD4_3 diff --git a/snmplib/mib.c b/snmplib/mib.c index 11e168f350..16da785449 100644 --- a/snmplib/mib.c +++ b/snmplib/mib.c @@ -904,14 +904,10 @@ parse_subtree(subtree, input, output, out_len) } void -sprint_objid(buf, objid, objidlen) - char *buf; - oid *objid; - int objidlen; /* number of subidentifiers */ +sprint_objid(char *buf, oid * objid, int objidlen) { char tempbuf[2048], *cp; struct tree *subtree = Mib; - *tempbuf = '.'; /* this is a fully qualified name */ get_symbol(objid, objidlen, subtree, tempbuf + 1); if (Suffix) { @@ -929,7 +925,6 @@ sprint_objid(buf, objid, objidlen) cp++; if (cp < tempbuf) cp = tempbuf; - } else { cp = tempbuf; if ((strlen(tempbuf) > strlen((char *) RFC1213_MIB_text)) @@ -961,7 +956,6 @@ sprint_objid(buf, objid, objidlen) strcpy(buf, cp); } - void print_objid(objid, objidlen) oid *objid; diff --git a/snmplib/parse.c b/snmplib/parse.c index a01870f287..b7545cc348 100644 --- a/snmplib/parse.c +++ b/snmplib/parse.c @@ -19,18 +19,29 @@ WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ -/* - * parse.c - */ + +#include "config.h" + +#if HAVE_STDIO_H #include +#endif +#if HAVE_CTYPE_H #include +#endif +#if HAVE_SYS_TYPES_H #include -#ifdef linux +#endif +#if HAVE_STDLIB>H #include +#endif +#if HAVE_STRING_H #include #endif +#if HAVE_GNUMALLOC_H +#include +#elif HAVE_MALLOC_H && !defined(_SQUID_FREEBSD_) && !defined(_SQUID_NEXT_) #include - +#endif #include "parse.h" @@ -260,10 +271,6 @@ static char * Malloc(num) unsigned num; { -#ifndef linux - char *calloc(); -#endif - /* this is to fix (what seems to be) a problem with the IBM RT C * library malloc */ if (num < 16)