Fixed compiler warnings

This commit is contained in:
adamdunkels 2007-11-17 10:12:19 +00:00
parent 22cb35e9f6
commit 5e7cbff22a
6 changed files with 31 additions and 13 deletions

View file

@ -28,7 +28,7 @@
* *
* This file is part of the Contiki operating system. * This file is part of the Contiki operating system.
* *
* @(#)$Id: simple-cc2420.c,v 1.14 2007/11/12 22:26:03 adamdunkels Exp $ * @(#)$Id: simple-cc2420.c,v 1.15 2007/11/17 10:12:19 adamdunkels Exp $
*/ */
/* /*
* This code is almost device independent and should be easy to port. * This code is almost device independent and should be easy to port.
@ -72,9 +72,9 @@ static void (* receiver_callback)(const struct radio_driver *);
int simple_cc2420_on(void); int simple_cc2420_on(void);
int simple_cc2420_off(void); int simple_cc2420_off(void);
u16_t simple_cc2420_read(u8_t *buf, u16_t bufsize); int simple_cc2420_read(void *buf, unsigned short bufsize);
int simple_cc2420_send(const u8_t *data, u16_t len); int simple_cc2420_send(const void *data, unsigned short len);
void simple_cc2420_set_receiver(void (* recv)(const struct radio_driver *d)); void simple_cc2420_set_receiver(void (* recv)(const struct radio_driver *d));
@ -233,7 +233,7 @@ simple_cc2420_init(void)
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
int int
simple_cc2420_send(const u8_t *payload, u16_t payload_len) simple_cc2420_send(const void *payload, unsigned short payload_len)
{ {
u8_t spiStatusByte; u8_t spiStatusByte;
int i; int i;
@ -425,8 +425,8 @@ PROCESS_THREAD(simple_cc2420_process, ev, data)
PROCESS_END(); PROCESS_END();
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
u16_t int
simple_cc2420_read(u8_t *buf, u16_t bufsize) simple_cc2420_read(void *buf, unsigned short bufsize)
{ {
u8_t footer[2]; u8_t footer[2];
int len; int len;

View file

@ -28,7 +28,7 @@
* *
* This file is part of the Contiki operating system. * This file is part of the Contiki operating system.
* *
* $Id: xmac.c,v 1.9 2007/11/12 22:29:37 adamdunkels Exp $ * $Id: xmac.c,v 1.10 2007/11/17 10:12:39 adamdunkels Exp $
*/ */
/** /**
@ -124,6 +124,9 @@ static const struct radio_driver *radio;
#include <stdio.h> #include <stdio.h>
#define PRINTF(...) printf(__VA_ARGS__) #define PRINTF(...) printf(__VA_ARGS__)
#else #else
#undef LEDS_ON
#undef LEDS_OFF
#undef LEDS_TOGGLE
#define LEDS_ON(x) #define LEDS_ON(x)
#define LEDS_OFF(x) #define LEDS_OFF(x)
#define LEDS_TOGGLE(x) #define LEDS_TOGGLE(x)

View file

@ -39,7 +39,7 @@
* *
* This file is part of the Contiki operating system. * This file is part of the Contiki operating system.
* *
* $Id: rudolph2.c,v 1.1 2007/05/15 08:07:46 adamdunkels Exp $ * $Id: rudolph2.c,v 1.2 2007/11/17 10:13:17 adamdunkels Exp $
*/ */
/** /**
@ -185,6 +185,7 @@ send_nack(struct rudolph2_conn *c)
polite_send(&c->c, NACK_TIMEOUT, POLITE_HEADER); polite_send(&c->c, NACK_TIMEOUT, POLITE_HEADER);
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
#if 0 /* Function below not currently used in the code */
static void static void
send_next(struct rudolph2_conn *c) send_next(struct rudolph2_conn *c)
{ {
@ -212,6 +213,7 @@ send_next(struct rudolph2_conn *c)
} }
c->nacks = 0; c->nacks = 0;
} }
#endif /* 0 */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
static void static void
sent(struct polite_conn *polite) sent(struct polite_conn *polite)

View file

@ -28,7 +28,7 @@
* *
* This file is part of the Contiki operating system. * This file is part of the Contiki operating system.
* *
* $Id: profile-aggregates.c,v 1.1 2007/10/23 20:39:07 adamdunkels Exp $ * $Id: profile-aggregates.c,v 1.2 2007/11/17 10:14:19 adamdunkels Exp $
*/ */
/** /**
@ -87,6 +87,7 @@ find_aggregate_category(const uint16_t cat)
return &aggregates[aggregates_list_ptr++]; return &aggregates[aggregates_list_ptr++];
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
#if DETAILED_AGGREGATES
static struct aggregate * static struct aggregate *
find_aggregate(const unsigned char *ptr) find_aggregate(const unsigned char *ptr)
{ {
@ -102,6 +103,7 @@ find_aggregate(const unsigned char *ptr)
return &aggregates[aggregates_list_ptr++]; return &aggregates[aggregates_list_ptr++];
} }
#endif /* DETAILED_AGGREGATES */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
void void
profile_aggregates_print(void) profile_aggregates_print(void)
@ -130,6 +132,7 @@ profile_aggregates_print(void)
sizeof(struct aggregate) * aggregates_list_ptr); sizeof(struct aggregate) * aggregates_list_ptr);
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
#if DETAILED_AGGREGATES
static void static void
detailed_profile_aggregates_compute(void) detailed_profile_aggregates_compute(void)
{ {
@ -167,6 +170,7 @@ detailed_profile_aggregates_compute(void)
/* print_aggregates();*/ /* print_aggregates();*/
} }
#endif /* DETAILED_AGGREGATES */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
static void static void
category_profile_aggregates_compute(void) category_profile_aggregates_compute(void)

View file

@ -28,7 +28,7 @@
* *
* This file is part of the Contiki operating system. * This file is part of the Contiki operating system.
* *
* $Id: profile.c,v 1.1 2007/10/23 20:39:07 adamdunkels Exp $ * $Id: profile.c,v 1.2 2007/11/17 10:14:19 adamdunkels Exp $
*/ */
/** /**
@ -57,6 +57,12 @@ static rtimer_clock_t episode_start_time;
grained timer, and 32678 / 8 ticks per second for the coarse. */ grained timer, and 32678 / 8 ticks per second for the coarse. */
#define FINE_TICKS_PER_COARSE_TICK (2457600/(32678/8)) #define FINE_TICKS_PER_COARSE_TICK (2457600/(32678/8))
/* XXX hack: we use a function called clock_counter() that is not part
of the clock API and currently is only implemented for the
MSP430. We therefore declare this function here instead of in
dev/clock.h. */
rtimer_clock_t clock_counter(void);
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
rtimer_clock_t rtimer_clock_t
profile_timediff(const char *ptr1, const char *ptr2) profile_timediff(const char *ptr1, const char *ptr2)
@ -64,7 +70,7 @@ profile_timediff(const char *ptr1, const char *ptr2)
int i; int i;
int t1, t2; int t1, t2;
int timestamp_ptr = PROFILE_TIMESTAMP_PTR; int timestamp_ptr = PROFILE_TIMESTAMP_PTR;
/* printf("profile_timestamp_ptr %d max %d\n", profile_timestamp_ptr, profile_max_queuelen);*/ /* printf("profile_timestamp_ptr %d max %d\n", profile_timestamp_ptr, profile_max_queuelen);*/
t1 = t2 = PROFILE_LIST_LENGTH; t1 = t2 = PROFILE_LIST_LENGTH;
@ -160,6 +166,8 @@ profile_episode_end(void)
/* profile_print_stats(); */ /* profile_print_stats(); */
} }
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
#if 0
#include <stdio.h>
void void
profile_print_stats(void) profile_print_stats(void)
{ {
@ -170,4 +178,5 @@ profile_print_stats(void)
profile_invalid_episode_overflow, profile_invalid_episode_overflow,
profile_invalid_episode_toolong); profile_invalid_episode_toolong);
} }
#endif /* 0 */
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/

View file

@ -28,7 +28,7 @@
* *
* This file is part of the Contiki operating system. * This file is part of the Contiki operating system.
* *
* $Id: profile.h,v 1.1 2007/10/23 20:39:07 adamdunkels Exp $ * $Id: profile.h,v 1.2 2007/11/17 10:14:19 adamdunkels Exp $
*/ */
/** /**
@ -56,7 +56,7 @@
#endif #endif
struct profile_timestamp { struct profile_timestamp {
const unsigned char *ptr; const char *ptr;
rtimer_clock_t time; rtimer_clock_t time;
}; };