Fix warnings.

This commit is contained in:
Matthew N. Dodd 2003-03-25 04:29:26 +00:00
parent 7ff910a94b
commit 619531d847
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=112587
6 changed files with 24 additions and 18 deletions

View File

@ -33,5 +33,6 @@ INCS= libatm.h
LDADD+= -lmd
DPADD+= ${LIBMD}
WARNS?= 5
.include <bsd.lib.mk>

View File

@ -183,6 +183,10 @@ get_hex_atm_addr(in, out, len)
val += c_value;
out[out_len] = (u_char) val;
out_len++;
if (out_len > len)
(void)fprintf(stderr, "%s() out_len > len (%d > %d)\n",
__func__, out_len, len);
break;
case 4:
@ -305,7 +309,8 @@ format_atm_addr(addr)
u2.c[3] = atm_spans->aas_addr[7];
if (!(u1.w == 0 && u2.w == 0))
sprintf(str, "0x%08lx.%08lx", ntohl(u1.w), ntohl(u2.w));
sprintf(str, "0x%08lx.%08lx",
(u_long)ntohl(u1.w), (u_long)ntohl(u2.w));
break;
case T_ATM_PVC_ADDR:

View File

@ -85,7 +85,7 @@ scsp_cache_key(ap, ip, ol, op)
* Copy the addresses into a buffer for MD5 computation
*/
len = sizeof(struct in_addr) + ap->address_length;
if (len > sizeof(buff))
if (len > (int)sizeof(buff))
len = sizeof(buff);
bcopy(ip, buff, sizeof(struct in_addr));
bcopy(ap->address, &buff[sizeof(struct in_addr)],

View File

@ -73,18 +73,18 @@ get_ip_addr(p)
char *p;
{
struct hostent *ip_host;
static struct sockaddr_in sin;
static struct sockaddr_in s;
/*
* Get IP address of specified host name
*/
bzero(&sin, sizeof(sin));
sin.sin_family = AF_INET;
bzero(&s, sizeof(s));
s.sin_family = AF_INET;
if (p[0] >= '0' && p[0] <= '9') {
/*
* IP address is in dotted decimal format
*/
if ((sin.sin_addr.s_addr = inet_addr(p)) == -1) {
if ((s.sin_addr.s_addr = inet_addr(p)) == INADDR_NONE) {
return((struct sockaddr_in *)0);
}
} else {
@ -96,9 +96,9 @@ get_ip_addr(p)
ip_host->h_addrtype != AF_INET) {
return((struct sockaddr_in *)0);
}
sin.sin_addr.s_addr = *(u_long *)ip_host->h_addr_list[0];
s.sin_addr.s_addr = *(u_long *)ip_host->h_addr_list[0];
}
return(&sin);
return(&s);
}
@ -115,7 +115,7 @@ get_ip_addr(p)
* char * pointer to a text-formatted string
*
*/
char *
const char *
format_ip_addr(addr)
struct in_addr *addr;
{

View File

@ -71,7 +71,7 @@ struct harp_timer {
struct harp_timer *ht_next; /* Timer chain */
int ht_ticks; /* Seconds till exp */
int ht_mark; /* Processing flag */
void (*ht_func)(); /* Function to call */
void (*ht_func)(struct harp_timer *); /* Function to call */
};
typedef struct harp_timer Harp_timer;
@ -100,7 +100,7 @@ extern int get_netif_info(char *, struct air_netif_rsp **);
/* ip_addr.c */
extern struct sockaddr_in *get_ip_addr(char *);
extern char *format_ip_addr(struct in_addr *);
extern const char *format_ip_addr(struct in_addr *);
/* ip_checksum.c */
extern short ip_checksum(char *, int);
@ -108,9 +108,9 @@ extern short ip_checksum(char *, int);
/* timer.c */
extern Harp_timer *harp_timer_head;
extern int harp_timer_exec;
extern void timer_proc();
extern int init_timer();
extern int block_timer();
extern void timer_proc(void);
extern int init_timer(void);
extern int block_timer(void);
extern void enable_timer(int);

View File

@ -72,7 +72,7 @@ int harp_timer_exec;
*
*/
static void
timer_tick()
timer_tick(void)
{
/*
* Bump the timer flag
@ -96,10 +96,10 @@ timer_tick()
*
*/
void
timer_proc()
timer_proc(void)
{
Harp_timer *htp;
void (*f)();
void (*f)(Harp_timer *);
/*
* Reset marks in all timers on the queue
@ -188,7 +188,7 @@ init_timer()
/*
* Set up signal handler
*/
if (signal(SIGALRM, timer_tick) == SIG_ERR) {
if (signal(SIGALRM, (sig_t)timer_tick) == SIG_ERR) {
return(errno);
}