Make this compile with GCC4 by fixing a few signedness related warnings.

Reviewed by:	md5(1)
This commit is contained in:
mux 2005-04-26 14:25:11 +00:00
parent d95f635399
commit 87934eb0bc
3 changed files with 7 additions and 6 deletions

View File

@ -243,7 +243,7 @@ _NgDebugMsg(const struct ng_mesg *msg, const char *path)
fail2:
NGLOGX(" cmd %d", msg->header.cmd);
NGLOGX(" args (%d bytes)", msg->header.arglen);
_NgDebugBytes(msg->data, msg->header.arglen);
_NgDebugBytes((u_char *)msg->data, msg->header.arglen);
done:
if (csock != -1)

View File

@ -76,7 +76,7 @@ NgSendMsg(int cs, const char *path,
msg.header.token = gMsgId;
msg.header.flags = NGF_ORIG;
msg.header.cmd = cmd;
snprintf(msg.header.cmdstr, NG_CMDSTRSIZ, "cmd%d", cmd);
snprintf((char *)msg.header.cmdstr, NG_CMDSTRSIZ, "cmd%d", cmd);
/* Deliver message */
if (NgDeliverMsg(cs, path, &msg, args, arglen) < 0)
@ -122,7 +122,8 @@ NgSendAsciiMsg(int cs, const char *path, const char *fmt, ...)
memset(ascii, 0, sizeof(*ascii));
/* Build inner header (only need cmdstr, arglen, and data fields) */
strncpy(ascii->header.cmdstr, cmd, sizeof(ascii->header.cmdstr) - 1);
strncpy((char *)ascii->header.cmdstr, cmd,
sizeof(ascii->header.cmdstr) - 1);
strcpy(ascii->data, args);
ascii->header.arglen = strlen(ascii->data) + 1;
free(buf);
@ -249,8 +250,8 @@ NgRecvMsg(int cs, struct ng_mesg *rep, size_t replen, char *path)
{
u_char sgbuf[NG_PATHSIZ + NGSA_OVERHEAD];
struct sockaddr_ng *const sg = (struct sockaddr_ng *) sgbuf;
int len, sglen = sizeof(sgbuf);
int errnosv;
socklen_t sglen = sizeof(sgbuf);
int len, errnosv;
/* Read reply */
len = recvfrom(cs, rep, replen, 0, (struct sockaddr *) sg, &sglen);

View File

@ -213,7 +213,7 @@ NgRecvData(int ds, u_char * buf, size_t len, char *hook)
{
u_char frombuf[NG_HOOKSIZ + NGSA_OVERHEAD];
struct sockaddr_ng *const from = (struct sockaddr_ng *) frombuf;
int fromlen = sizeof(frombuf);
socklen_t fromlen = sizeof(frombuf);
int rtn, errnosv;
/* Read packet */