Fix compiler warnings
This commit is contained in:
Родитель
4d2e81661b
Коммит
d157c29269
10
lib/base64.c
10
lib/base64.c
|
@ -177,10 +177,12 @@ size_t Curl_base64_encode(const char *inp, size_t insize, char **outptr)
|
|||
ibuf[i] = 0;
|
||||
}
|
||||
|
||||
obuf [0] = (ibuf [0] & 0xFC) >> 2;
|
||||
obuf [1] = ((ibuf [0] & 0x03) << 4) | ((ibuf [1] & 0xF0) >> 4);
|
||||
obuf [2] = ((ibuf [1] & 0x0F) << 2) | ((ibuf [2] & 0xC0) >> 6);
|
||||
obuf [3] = ibuf [2] & 0x3F;
|
||||
obuf[0] = (unsigned char) ((ibuf[0] & 0xFC) >> 2);
|
||||
obuf[1] = (unsigned char) (((ibuf[0] & 0x03) << 4) | \
|
||||
((ibuf[1] & 0xF0) >> 4));
|
||||
obuf[2] = (unsigned char) (((ibuf[1] & 0x0F) << 2) | \
|
||||
((ibuf[2] & 0xC0) >> 6));
|
||||
obuf[3] = (unsigned char) (ibuf[2] & 0x3F);
|
||||
|
||||
switch(inputparts) {
|
||||
case 1: /* only one byte read */
|
||||
|
|
|
@ -304,13 +304,13 @@ static void setup_des_key(unsigned char *key_56,
|
|||
DES_cblock key;
|
||||
|
||||
key[0] = key_56[0];
|
||||
key[1] = ((key_56[0] << 7) & 0xFF) | (key_56[1] >> 1);
|
||||
key[2] = ((key_56[1] << 6) & 0xFF) | (key_56[2] >> 2);
|
||||
key[3] = ((key_56[2] << 5) & 0xFF) | (key_56[3] >> 3);
|
||||
key[4] = ((key_56[3] << 4) & 0xFF) | (key_56[4] >> 4);
|
||||
key[5] = ((key_56[4] << 3) & 0xFF) | (key_56[5] >> 5);
|
||||
key[6] = ((key_56[5] << 2) & 0xFF) | (key_56[6] >> 6);
|
||||
key[7] = (key_56[6] << 1) & 0xFF;
|
||||
key[1] = (unsigned char)(((key_56[0] << 7) & 0xFF) | (key_56[1] >> 1));
|
||||
key[2] = (unsigned char)(((key_56[1] << 6) & 0xFF) | (key_56[2] >> 2));
|
||||
key[3] = (unsigned char)(((key_56[2] << 5) & 0xFF) | (key_56[3] >> 3));
|
||||
key[4] = (unsigned char)(((key_56[3] << 4) & 0xFF) | (key_56[4] >> 4));
|
||||
key[5] = (unsigned char)(((key_56[4] << 3) & 0xFF) | (key_56[5] >> 5));
|
||||
key[6] = (unsigned char)(((key_56[5] << 2) & 0xFF) | (key_56[6] >> 6));
|
||||
key[7] = (unsigned char) ((key_56[6] << 1) & 0xFF);
|
||||
|
||||
DES_set_odd_parity(&key);
|
||||
DES_set_key(&key, ks);
|
||||
|
@ -357,7 +357,7 @@ static void mk_lm_hash(char *password, unsigned char *lmbuffer /* 21 bytes */)
|
|||
len = 14;
|
||||
|
||||
for (i=0; i<len; i++)
|
||||
pw[i] = toupper(password[i]);
|
||||
pw[i] = (unsigned char)toupper(password[i]);
|
||||
|
||||
for (; i<14; i++)
|
||||
pw[i] = 0;
|
||||
|
|
|
@ -1806,7 +1806,7 @@ size_t Curl_ossl_version(char *buffer, size_t size)
|
|||
}
|
||||
else {
|
||||
if(ssleay_value&0xff0) {
|
||||
sub[0]=(char)((ssleay_value>>4)&0xff) + 'a' -1;
|
||||
sub[0]=(char)(((ssleay_value>>4)&0xff) + 'a' -1);
|
||||
}
|
||||
else
|
||||
sub[0]='\0';
|
||||
|
|
|
@ -295,8 +295,8 @@ static void send_negotiation(struct connectdata *conn, int cmd, int option)
|
|||
struct SessionHandle *data = conn->data;
|
||||
|
||||
buf[0] = CURL_IAC;
|
||||
buf[1] = cmd;
|
||||
buf[2] = option;
|
||||
buf[1] = (unsigned char)cmd;
|
||||
buf[2] = (unsigned char)option;
|
||||
|
||||
bytes_written = swrite(conn->sock[FIRSTSOCKET], buf, 3);
|
||||
if(bytes_written < 0) {
|
||||
|
|
14
lib/tftp.c
14
lib/tftp.c
|
@ -228,25 +228,25 @@ void tftp_set_timeouts(tftp_state_data_t *state)
|
|||
|
||||
static void setpacketevent(tftp_packet_t *packet, unsigned short num)
|
||||
{
|
||||
packet->data[0] = (num >> 8);
|
||||
packet->data[1] = (num & 0xff);
|
||||
packet->data[0] = (unsigned char)(num >> 8);
|
||||
packet->data[1] = (unsigned char)(num & 0xff);
|
||||
}
|
||||
|
||||
|
||||
static void setpacketblock(tftp_packet_t *packet, unsigned short num)
|
||||
{
|
||||
packet->data[2] = (num >> 8);
|
||||
packet->data[3] = (num & 0xff);
|
||||
packet->data[2] = (unsigned char)(num >> 8);
|
||||
packet->data[3] = (unsigned char)(num & 0xff);
|
||||
}
|
||||
|
||||
static unsigned short getrpacketevent(tftp_packet_t *packet)
|
||||
{
|
||||
return (packet->data[0] << 8) | packet->data[1];
|
||||
return (unsigned short)((packet->data[0] << 8) | packet->data[1]);
|
||||
}
|
||||
|
||||
static unsigned short getrpacketblock(tftp_packet_t *packet)
|
||||
{
|
||||
return (packet->data[2] << 8) | packet->data[3];
|
||||
return (unsigned short)((packet->data[2] << 8) | packet->data[3]);
|
||||
}
|
||||
|
||||
static CURLcode tftp_send_first(tftp_state_data_t *state, tftp_event_t event)
|
||||
|
@ -355,7 +355,7 @@ static CURLcode tftp_rx(tftp_state_data_t *state, tftp_event_t event)
|
|||
}
|
||||
}
|
||||
/* This is the expected block. Reset counters and ACK it. */
|
||||
state->block = rblock;
|
||||
state->block = (unsigned short)rblock;
|
||||
state->retries = 0;
|
||||
setpacketevent(&state->spacket, TFTP_EVENT_ACK);
|
||||
setpacketblock(&state->spacket, state->block);
|
||||
|
|
10
lib/url.c
10
lib/url.c
|
@ -2927,7 +2927,7 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
|||
|
||||
/* Now, build <protocol>_proxy and check for such a one to use */
|
||||
while(*protop)
|
||||
*envp++ = tolower((int)*protop++);
|
||||
*envp++ = (char)tolower((int)*protop++);
|
||||
|
||||
/* append _proxy */
|
||||
strcpy(envp, "_proxy");
|
||||
|
@ -2950,7 +2950,7 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
|||
if(!prox && !strequal("http_proxy", proxy_env)) {
|
||||
/* There was no lowercase variable, try the uppercase version: */
|
||||
for(envp = proxy_env; *envp; envp++)
|
||||
*envp = toupper((int)*envp);
|
||||
*envp = (char)toupper((int)*envp);
|
||||
prox=curl_getenv(proxy_env);
|
||||
}
|
||||
|
||||
|
@ -3080,7 +3080,7 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
|||
}
|
||||
|
||||
conn->port = port;
|
||||
conn->remote_port = port;
|
||||
conn->remote_port = (unsigned short)port;
|
||||
conn->protocol |= PROT_FTP;
|
||||
|
||||
if(data->change.proxy &&
|
||||
|
@ -3120,7 +3120,7 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
|||
if(type) {
|
||||
char command;
|
||||
*type=0; /* it was in the middle of the hostname */
|
||||
command = toupper((int)type[6]);
|
||||
command = (char)toupper((int)type[6]);
|
||||
switch(command) {
|
||||
case 'A': /* ASCII mode */
|
||||
data->set.ftp_ascii = 1;
|
||||
|
@ -3222,7 +3222,7 @@ static CURLcode CreateConnection(struct SessionHandle *data,
|
|||
if(type) {
|
||||
char command;
|
||||
*type=0; /* it was in the middle of the hostname */
|
||||
command = toupper((int)type[6]);
|
||||
command = (char)toupper((int)type[6]);
|
||||
switch(command) {
|
||||
case 'A': /* ASCII mode */
|
||||
case 'N': /* NETASCII mode */
|
||||
|
|
Загрузка…
Ссылка в новой задаче