Fix a boatload of format errors and constness violations.

Sponsored by:	DARPA, NAI Labs
This commit is contained in:
Dag-Erling Smørgrav 2002-05-08 15:41:15 +00:00
parent 95ed2ab27f
commit e009976aa6
2 changed files with 40 additions and 36 deletions

View File

@ -60,34 +60,34 @@ static const char rcsid[] =
extern int debug;
/* NIS v1 */
char *yp_procs[] = { "ypoldproc_null",
"ypoldproc_domain",
"ypoldproc_domain_nonack",
"ypoldproc_match",
"ypoldproc_first",
"ypoldproc_next",
"ypoldproc_poll",
"ypoldproc_push",
"ypoldproc_get",
"badproc1", /* placeholder */
"badproc2", /* placeholder */
"badproc3", /* placeholder */
/* NIS v2 */
"ypproc_null",
"ypproc_domain",
"ypproc_domain_nonack",
"ypproc_match",
"ypproc_first",
"ypproc_next",
"ypproc_xfr",
"ypproc_clear",
"ypproc_all",
"ypproc_master",
"ypproc_order",
"ypproc_maplist"
};
const char *yp_procs[] = {
"ypoldproc_null",
"ypoldproc_domain",
"ypoldproc_domain_nonack",
"ypoldproc_match",
"ypoldproc_first",
"ypoldproc_next",
"ypoldproc_poll",
"ypoldproc_push",
"ypoldproc_get",
"badproc1", /* placeholder */
"badproc2", /* placeholder */
"badproc3", /* placeholder */
/* NIS v2 */
"ypproc_null",
"ypproc_domain",
"ypproc_domain_nonack",
"ypproc_match",
"ypproc_first",
"ypproc_next",
"ypproc_xfr",
"ypproc_clear",
"ypproc_all",
"ypproc_master",
"ypproc_order",
"ypproc_maplist"
};
#ifdef TCP_WRAPPER
void
@ -226,12 +226,13 @@ yp_access(const char *map, const struct svc_req *rqstp)
#ifndef TCP_WRAPPER
struct securenet *tmp;
#endif
char *yp_procedure = NULL;
const char *yp_procedure = NULL;
char procbuf[50];
if (rqstp->rq_prog != YPPASSWDPROG && rqstp->rq_prog != YPPROG) {
snprintf(procbuf, sizeof(procbuf), "#%lu/#%lu", rqstp->rq_prog,
rqstp->rq_proc);
snprintf(procbuf, sizeof(procbuf), "#%lu/#%lu",
(unsigned long)rqstp->rq_prog,
(unsigned long)rqstp->rq_proc);
yp_procedure = (char *)&procbuf;
} else {
yp_procedure = rqstp->rq_prog == YPPASSWDPROG ?

View File

@ -468,7 +468,7 @@ yp_get_record(const char *domain, const char *map,
if (ypdb_debug)
yp_error("looking up key [%.*s]",
key->size, key->data);
(int)key->size, (char *)key->data);
/*
* Avoid passing back magic "YP_*" entries unless
@ -498,7 +498,8 @@ yp_get_record(const char *domain, const char *map,
if (ypdb_debug)
yp_error("result of lookup: key: [%.*s] data: [%.*s]",
key->size, key->data, data->size, data->data);
(int)key->size, (char *)key->data,
(int)data->size, (char *)data->data);
#ifdef DB_CACHE
if (TAILQ_FIRST(&qhead)->dbptr->size) {
@ -550,7 +551,8 @@ yp_first_record(const DB *dbp, DBT *key, DBT *data, int allow)
if (ypdb_debug)
yp_error("result of lookup: key: [%.*s] data: [%.*s]",
key->size, key->data, data->size, data->data);
(int)key->size, (char *)key->data,
(int)data->size, (char *)data->data);
#ifdef DB_CACHE
if (TAILQ_FIRST(&qhead)->dbptr->size) {
@ -591,7 +593,7 @@ yp_next_record(const DB *dbp, DBT *key, DBT *data, int all, int allow)
if (ypdb_debug)
yp_error("retrieving next key, previous was: [%.*s]",
key->size, key->data);
(int)key->size, (char *)key->data);
if (!all) {
#ifdef DB_CACHE
@ -631,7 +633,8 @@ yp_next_record(const DB *dbp, DBT *key, DBT *data, int all, int allow)
if (ypdb_debug)
yp_error("result of lookup: key: [%.*s] data: [%.*s]",
key->size, key->data, data->size, data->data);
(int)key->size, (char *)key->data,
(int)data->size, (char *)data->data);
#ifdef DB_CACHE
if (TAILQ_FIRST(&qhead)->dbptr->size) {