79a1d19516
Mostly const-correctness fixes. There were also some variable-shadowing, unused variable, and a couple of sockaddr type-correctness changes. I also had trouble with cast-align warnings. I was able to prove that one of them was a false positive. But ultimately I had to disable the warning program-wide to deal with the others. Reviewed by: cem MFC after: 3 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D14460
64 lines
791 B
C
64 lines
791 B
C
/* $FreeBSD$ */
|
|
|
|
#include <setjmp.h>
|
|
#include <stdarg.h>
|
|
#include <stdio.h>
|
|
|
|
#include "dhcpd.h"
|
|
|
|
extern jmp_buf env;
|
|
|
|
void
|
|
error(const char *fmt, ...)
|
|
{
|
|
va_list ap;
|
|
|
|
va_start(ap, fmt);
|
|
(void)vfprintf(stderr, fmt, ap);
|
|
va_end(ap);
|
|
fprintf(stderr, "\n");
|
|
|
|
longjmp(env, 1);
|
|
}
|
|
|
|
int
|
|
warning(const char *fmt, ...)
|
|
{
|
|
va_list ap;
|
|
|
|
va_start(ap, fmt);
|
|
(void)vfprintf(stderr, fmt, ap);
|
|
va_end(ap);
|
|
fprintf(stderr, "\n");
|
|
|
|
/*
|
|
* The original warning() would return "ret" here. We do this to
|
|
* check warnings explicitely.
|
|
*/
|
|
longjmp(env, 1);
|
|
}
|
|
|
|
int
|
|
note(const char *fmt, ...)
|
|
{
|
|
int ret;
|
|
va_list ap;
|
|
|
|
va_start(ap, fmt);
|
|
ret = vfprintf(stderr, fmt, ap);
|
|
va_end(ap);
|
|
fprintf(stderr, "\n");
|
|
|
|
return ret;
|
|
}
|
|
|
|
void
|
|
bootp(struct packet *packet)
|
|
{
|
|
}
|
|
|
|
void
|
|
dhcp(struct packet *packet)
|
|
{
|
|
}
|