Several compiler warning fixes:

* msp430: fix "implicit declaration of function" warnings in clock.c, by including watchdog.h;
     * sky: fix a couple pointer target signedness warnings;
     * core: fix several signed/unsigned comparison warnings;
     * framer-802154: "const static" -> "static const" to fix compiler warnings;
     * core: comment or remove unused variables and function definitions.

Signed-off-by: Lionel Debroux <lionel_debroux@yahoo.fr>
Signed-off-by: Mariano Alvira <mar@devl.org>
This commit is contained in:
Lionel Debroux 2011-02-19 08:25:29 +00:00 committed by Mariano Alvira
parent 01b7a4f7f2
commit 5cb49e8b07
11 changed files with 21 additions and 17 deletions

View File

@ -139,7 +139,7 @@ static int cc2420_send(const void *data, unsigned short len);
static int cc2420_receiving_packet(void);
static int pending_packet(void);
static int cc2420_cca(void);
static int detected_energy(void);
/*static int detected_energy(void);*/
signed char cc2420_last_rssi;
uint8_t cc2420_last_correlation;

View File

@ -454,7 +454,7 @@ send_packet(void)
packetbuf_attr(PACKETBUF_ATTR_ERELIABLE);
len = NETSTACK_FRAMER.create();
strobe_len = len + sizeof(struct cxmac_hdr);
if(len == 0 || strobe_len > sizeof(strobe)) {
if(len == 0 || strobe_len > (int)sizeof(strobe)) {
/* Failed to send */
PRINTF("cxmac: send failed, too large header\n");
return MAC_TX_ERR_FATAL;

View File

@ -56,8 +56,8 @@
static uint8_t mac_dsn;
static uint8_t initialized = 0;
const static uint16_t mac_dst_pan_id = IEEE802154_PANID;
const static uint16_t mac_src_pan_id = IEEE802154_PANID;
static const uint16_t mac_dst_pan_id = IEEE802154_PANID;
static const uint16_t mac_src_pan_id = IEEE802154_PANID;
/*---------------------------------------------------------------------------*/
static int

View File

@ -455,7 +455,9 @@ send_packet(void)
rtimer_clock_t t;
rtimer_clock_t encounter_time = 0;
int strobes;
#if 0
struct xmac_hdr *hdr;
#endif
uint8_t got_strobe_ack = 0;
uint8_t got_ack = 0;
uint8_t strobe[MAX_STROBE_SIZE];
@ -495,7 +497,7 @@ send_packet(void)
packetbuf_set_attr(PACKETBUF_ATTR_MAC_ACK, 1);
len = NETSTACK_FRAMER.create();
strobe_len = len + sizeof(struct xmac_hdr);
if(len == 0 || strobe_len > sizeof(strobe)) {
if(len == 0 || strobe_len > (int)sizeof(strobe)) {
/* Failed to send */
PRINTF("xmac: send failed, too large header\n");
return MAC_TX_ERR_FATAL;
@ -602,9 +604,9 @@ send_packet(void)
while(got_strobe_ack == 0 &&
RTIMER_CLOCK_LT(RTIMER_NOW(), t + xmac_config.strobe_wait_time)) {
#if 0
rtimer_clock_t now = RTIMER_NOW();
#if 0
/* See if we got an ACK */
packetbuf_clear();
len = NETSTACK_RADIO.read(packetbuf_dataptr(), PACKETBUF_SIZE);
@ -647,7 +649,9 @@ send_packet(void)
#endif
off();
} else {
#if 0
rtimer_clock_t wt;
#endif
on();
NETSTACK_RADIO.send(strobe, strobe_len);
#if 0

View File

@ -108,9 +108,6 @@ collect_link_estimate_update_rx(struct collect_link_estimate *n)
uint16_t
collect_link_estimate(struct collect_link_estimate *le)
{
int i;
uint16_t etx;
if(le->num_estimates == 0) {
return INITIAL_LINK_ESTIMATE * COLLECT_LINK_ESTIMATE_UNIT;
}

View File

@ -419,7 +419,7 @@ rpl_get_dag(int instance_id)
rpl_of_t *
rpl_find_of(rpl_ocp_t ocp)
{
int i;
unsigned int i;
for(i = 0;
i < sizeof(objective_functions) / sizeof(objective_functions[0]);

View File

@ -46,7 +46,8 @@ uip_debug_ipaddr_print(const uip_ipaddr_t *addr)
{
#if UIP_CONF_IPV6
uint16_t a;
int i, f;
unsigned int i;
int f;
for(i = 0, f = 0; i < sizeof(uip_ipaddr_t); i += 2) {
a = (addr->u8[i] << 8) + addr->u8[i + 1];
if(a == 0 && f >= 0) {
@ -70,7 +71,7 @@ uip_debug_ipaddr_print(const uip_ipaddr_t *addr)
void
uip_debug_lladdr_print(const uip_lladdr_t *addr)
{
int i;
unsigned int i;
for(i = 0; i < sizeof(uip_lladdr_t); i++) {
if(i > 0) {
printf(":");

View File

@ -47,7 +47,8 @@ uiplib_ipaddrconv(const char *addrstr, uip_ipaddr_t *ipaddr)
{
#if UIP_CONF_IPV6
uint16_t value;
int tmp, len, zero;
int tmp, zero;
unsigned int len;
char c = 0; //gcc warning if not initialized
value = 0;

View File

@ -147,7 +147,7 @@ void
timetable_aggregate_compute_detailed(struct timetable_aggregate *a,
struct timetable *timetable)
{
int i;
unsigned int i;
rtimer_clock_t t;
t = timetable->timestamps[0].time;
@ -179,7 +179,8 @@ void
timetable_aggregate_compute_categories(struct timetable_aggregate *a,
struct timetable *timetable)
{
int i,j;
unsigned int i;
int j;
rtimer_clock_t t;
uint16_t categories[XXX_HACK_MAX_CATEGORIES];
int categories_ptr = 0;

View File

@ -118,7 +118,7 @@ timetable_init(void)
void
timetable_print(struct timetable *t)
{
int i;
unsigned int i;
int time;
time = t->timestamps[0].time;

View File

@ -200,7 +200,7 @@ xmem_pread(void *_p, int size, unsigned long offset)
return size;
}
/*---------------------------------------------------------------------------*/
static const char *
static const unsigned char *
program_page(unsigned long offset, const unsigned char *p, int nbytes)
{
const unsigned char *end = p + nbytes;