fix up annoying signed/unsigned and mixed type errors

This commit is contained in:
Eric Andersen 2006-01-30 22:30:41 +00:00
parent 5e678873f9
commit 0cb6f35c33
9 changed files with 17 additions and 15 deletions

View File

@ -404,7 +404,7 @@ int arping_main(int argc, char **argv)
}
} else if (!dad) {
int on = 1;
int alen = sizeof(saddr);
socklen_t alen = sizeof(saddr);
saddr.sin_port = htons(1025);
saddr.sin_addr = dst;
@ -437,7 +437,7 @@ int arping_main(int argc, char **argv)
}
{
int alen = sizeof(me);
socklen_t alen = sizeof(me);
if (getsockname(s, (struct sockaddr *) &me, &alen) == -1) {
bb_error_msg("getsockname");
@ -479,9 +479,9 @@ int arping_main(int argc, char **argv)
while (1) {
sigset_t sset, osset;
char packet[4096];
unsigned char packet[4096];
struct sockaddr_ll from;
int alen = sizeof(from);
socklen_t alen = sizeof(from);
int cc;
if ((cc = recvfrom(s, packet, sizeof(packet), 0,

View File

@ -123,8 +123,10 @@ static const char home[] = "./";
#ifdef CONFIG_LFS
# define cont_l_fmt "%lld"
# define cont_l_type (long long)
#else
# define cont_l_fmt "%ld"
# define cont_l_type (long)
#endif
#define TIMEOUT 60
@ -1028,7 +1030,7 @@ static int sendHeaders(HttpResponseNum responseNum)
if (config->ContentLength != -1) { /* file */
strftime(timeStr, sizeof(timeStr), RFC1123FMT, gmtime(&config->last_mod));
len += sprintf(buf+len, "Last-Modified: %s\r\n%s " cont_l_fmt "\r\n",
timeStr, Content_length, config->ContentLength);
timeStr, Content_length, cont_l_type config->ContentLength);
}
strcat(buf, "\r\n");
len += 2;

View File

@ -501,7 +501,7 @@ static char *UNSPEC_sprint(struct sockaddr *sap, int numeric)
if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
return safe_strncpy(buf, _("[NONE SET]"), sizeof(buf));
return (UNSPEC_print(sap->sa_data));
return (UNSPEC_print((unsigned char *)sap->sa_data));
}
static struct aftype unspec_aftype = {
@ -1833,7 +1833,7 @@ static void ife_print(struct interface *ptr)
hardware address if it's null. */
if (hw->print != NULL && (!(hw_null_address(hw, ptr->hwaddr) &&
hw->suppress_null_addr)))
printf(_("HWaddr %s "), hw->print(ptr->hwaddr));
printf(_("HWaddr %s "), hw->print((unsigned char *)ptr->hwaddr));
#ifdef IFF_PORTSEL
if (ptr->flags & IFF_PORTSEL) {
printf(_("Media:%s"), if_port_text[ptr->map.port] /* [0] */);

View File

@ -166,7 +166,7 @@ static int kw_lookup(const char *kwtbl, char ***pargs)
static void INET_setroute(int action, char **args)
{
struct rtentry rt;
const char *netmask;
const char *netmask = NULL;
int skfd, isnet, xflag;
assert((action == RTACTION_ADD) || (action == RTACTION_DEL));

View File

@ -204,7 +204,7 @@ static void handlenetoutput(int len)
*/
int i, j;
byte * p = G.buf;
byte * p = (byte*)G.buf;
byte outbuf[4*DATABUFSIZE];
for (i = len, j = 0; i > 0; i--, p++)

View File

@ -131,7 +131,7 @@ static struct tsession *sessions;
*/
static char *
remove_iacs(struct tsession *ts, int *pnum_totty) {
unsigned char *ptr0 = ts->buf1 + ts->wridx1;
unsigned char *ptr0 = (unsigned char *)ts->buf1 + ts->wridx1;
unsigned char *ptr = ptr0;
unsigned char *totty = ptr;
unsigned char *end = ptr + MIN(BUFSIZE - ts->wridx1, ts->size1);

View File

@ -293,7 +293,7 @@ struct IFADDRLIST {
static const char route[] = "/proc/net/route";
/* last inbound (icmp) packet */
static u_char packet[512] __attribute__((align (32)));
static u_char packet[512] __attribute__((aligned (32)));
static struct ip *outip; /* last output (udp) packet */
static struct udphdr *outudp; /* last output (udp) packet */
@ -371,7 +371,7 @@ ifaddrlist(struct IFADDRLIST **ipaddrp)
if (errno == EINVAL)
bb_error_msg_and_die(
"SIOCGIFCONF: ifreq struct too small (%d bytes)",
sizeof(ibuf));
(int)sizeof(ibuf));
else
bb_perror_msg_and_die("SIOCGIFCONF");
}

View File

@ -332,11 +332,11 @@ int wget_main(int argc, char **argv)
#ifdef CONFIG_FEATURE_WGET_AUTHENTICATION
if (target.user) {
fprintf(sfp, "Authorization: Basic %s\r\n",
base64enc(target.user, buf, sizeof(buf)));
base64enc((unsigned char*)target.user, buf, sizeof(buf)));
}
if (use_proxy && server.user) {
fprintf(sfp, "Proxy-Authorization: Basic %s\r\n",
base64enc(server.user, buf, sizeof(buf)));
base64enc((unsigned char*)server.user, buf, sizeof(buf)));
}
#endif

View File

@ -314,7 +314,7 @@ fail:
goto fail;
} else {
struct ifreq ifr;
short seed[3];
unsigned short seed[3];
// get the interface's ethernet address
memset(&ifr, 0, sizeof (ifr));