aboutsummaryrefslogtreecommitdiff
path: root/lib/tftp.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2006-07-19 21:14:02 +0000
committerYang Tse <yangsita@gmail.com>2006-07-19 21:14:02 +0000
commitd157c292693972658d138475276dca85df77539b (patch)
treed51651e65fe7145775ae0562c5a25cbdbce9dc8d /lib/tftp.c
parent4d2e81661bbea7164209b5aac28c4f3d3f5dae8c (diff)
Fix compiler warnings
Diffstat (limited to 'lib/tftp.c')
-rw-r--r--lib/tftp.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/tftp.c b/lib/tftp.c
index 7a347b5c3..38adc0c75 100644
--- a/lib/tftp.c
+++ b/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);