Make this WARNS=3 clean.

This commit is contained in:
ru 2004-01-26 10:27:18 +00:00
parent b215311598
commit 0455fe1058
13 changed files with 28 additions and 19 deletions

View File

@ -5,7 +5,7 @@ PROG= ngctl
MAN= ngctl.8
SRCS= main.c mkpeer.c config.c connect.c dot.c name.c show.c list.c \
msg.c debug.c shutdown.c rmhook.c status.c types.c write.c
WARNS?= 3
DPADD= ${LIBNETGRAPH}
LDADD= -lnetgraph

View File

@ -46,7 +46,8 @@ const struct ngcmd config_cmd = {
ConfigCmd,
"config <path> [arguments]",
"get or set configuration of node at <path>",
NULL
NULL,
{}
};
static int

View File

@ -57,7 +57,7 @@ static int
ConnectCmd(int ac, char **av)
{
struct ngm_connect con;
char *path = ".";
const char *path = ".";
/* Get arguments */
switch (ac) {

View File

@ -48,7 +48,8 @@ const struct ngcmd debug_cmd = {
"Without any argument, this command displays the current"
" debugging verbosity level. If the argument is ``+'' or ``-''"
" the debug level is incremented or decremented; otherwise,"
" it must be an absolute numerical level."
" it must be an absolute numerical level.",
{}
};
static int

View File

@ -61,7 +61,8 @@ DotCmd(int ac, char **av)
struct ng_mesg *const nlresp = (struct ng_mesg *)nlrbuf;
struct namelist *const nlist = (struct namelist *)nlresp->data;
FILE *f = stdout;
int ch, i;
int ch;
u_int i;
/* Get options */
optind = 1;
@ -129,7 +130,7 @@ DotCmd(int ac, char **av)
struct hooklist *const hlist = (struct hooklist *)hlresp->data;
struct nodeinfo *const ninfo = &hlist->nodeinfo;
char path[NG_PATHSIZ];
int j;
u_int j;
(void)snprintf(path, sizeof(path), "[%jx]:",
(uintmax_t)nlist->nodeinfo[i].id);

View File

@ -58,7 +58,8 @@ ListCmd(int ac, char **av)
struct ng_mesg *const resp = (struct ng_mesg *) rbuf;
struct namelist *const nlist = (struct namelist *) resp->data;
int named_only = 0;
int k, ch, rtn = CMDRTN_OK;
int ch, rtn = CMDRTN_OK;
u_int k;
/* Get options */
optind = 1;
@ -100,11 +101,11 @@ ListCmd(int ac, char **av)
nlist->numnames, named_only ? "named " : "");
for (k = 0; k < nlist->numnames; k++) {
char path[NG_PATHSIZ];
char *av[3] = { "list", "-n", path };
char *argv[3] = { "list", "-n", path };
snprintf(path, sizeof(path),
"[%lx]:", (u_long) nlist->nodeinfo[k].id);
if ((rtn = (*show_cmd.func)(3, av)) != CMDRTN_OK)
if ((rtn = (*show_cmd.func)(3, argv)) != CMDRTN_OK)
break;
}

View File

@ -453,7 +453,7 @@ HelpCmd(int ac, char **av)
* QuitCmd()
*/
static int
QuitCmd(int ac, char **av)
QuitCmd(int ac __unused, char **av __unused)
{
return(CMDRTN_QUIT);
}

View File

@ -49,14 +49,15 @@ const struct ngcmd mkpeer_cmd = {
" and connects it to the node at \"path\". The hooks used for the"
" connection are \"hook\" on the original node and \"peerhook\""
" on the new node."
" If \"path\" is omitted then \".\" is assumed."
" If \"path\" is omitted then \".\" is assumed.",
{}
};
static int
MkPeerCmd(int ac, char **av)
{
struct ngm_mkpeer mkp;
char *path = ".";
const char *path = ".";
/* Get arguments */
switch (ac) {

View File

@ -45,7 +45,8 @@ const struct ngcmd name_cmd = {
NameCmd,
"name <path> <name>",
"Assign name <name> to the node at <path>",
NULL
NULL,
{}
};
static int

View File

@ -55,7 +55,7 @@ static int
RmHookCmd(int ac, char **av)
{
struct ngm_rmhook rmh;
char *path = ".";
const char *path = ".";
/* Get arguments */
switch (ac) {

View File

@ -105,7 +105,7 @@ ShowCmd(int ac, char **av)
printf(" Name: %-15s Type: %-15s ID: %08x Num hooks: %d\n",
ninfo->name, ninfo->type, ninfo->id, ninfo->hooks);
if (!no_hooks && ninfo->hooks > 0) {
int k;
u_int k;
printf(FMT, "Local hook", "Peer name",
"Peer type", "Peer ID", "Peer hook");

View File

@ -47,7 +47,8 @@ const struct ngcmd status_cmd = {
StatusCmd,
"status <path>",
"Get human readable status information from the node at <path>",
NULL
NULL,
{}
};
static int

View File

@ -45,16 +45,18 @@ const struct ngcmd types_cmd = {
TypesCmd,
"types",
"Show information about all installed node types",
NULL
NULL,
{}
};
static int
TypesCmd(int ac, char **av)
TypesCmd(int ac, char **av __unused)
{
u_char rbuf[16 * 1024];
struct ng_mesg *const resp = (struct ng_mesg *) rbuf;
struct typelist *const tlist = (struct typelist *) resp->data;
int k, rtn = CMDRTN_OK;
int rtn = CMDRTN_OK;
u_int k;
/* Get arguments */
switch (ac) {