Fixed compiler warnings to make code compile with gcc's -pedantic switch

This commit is contained in:
adamdunkels 2007-11-17 18:01:00 +00:00
parent 607d27e0c6
commit 1e1e44a3f8
42 changed files with 313 additions and 286 deletions

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: test-rucb.c,v 1.1 2007/09/27 22:21:27 adamdunkels Exp $
* $Id: test-rucb.c,v 1.2 2007/11/17 18:09:56 adamdunkels Exp $
*/
/**
@ -46,11 +46,16 @@
#include "dev/leds.h"
#include "cfs/cfs.h"
#include "lib/print-stats.h"
#include "sys/profile.h"
#include <stdio.h>
#if NETSIM
#include "ether.h"
#include "node.h"
#endif /* NETSIM */
#define FILESIZE 40000
static unsigned long bytecount;
@ -87,7 +92,7 @@ read_chunk(struct rucb_conn *c, int offset, char *to, int maxsize)
bytecount += size;
if(bytecount == FILESIZE) {
printf("Completion time %u / %u\n", clock_time() - start_time, CLOCK_SECOND);
printf("Completion time %lu / %u\n", (unsigned long)clock_time() - start_time, CLOCK_SECOND);
/* profile_aggregates_print(); */
/* profile_print_stats(); */
print_stats();
@ -104,7 +109,6 @@ static struct rucb_conn rucb;
PROCESS_THREAD(test_rucb_process, ev, data)
{
static int fd;
PROCESS_EXITHANDLER(rucb_close(&rucb);)
PROCESS_BEGIN();
@ -116,11 +120,11 @@ PROCESS_THREAD(test_rucb_process, ev, data)
PROCESS_PAUSE();
if(rimeaddr_node_addr.u8[0] == 10 &&
if(rimeaddr_node_addr.u8[0] == 51 &&
rimeaddr_node_addr.u8[1] == 0) {
rimeaddr_t recv;
recv.u8[0] = 20;
recv.u8[0] = 52;
recv.u8[1] = 0;
start_time = clock_time();
rucb_send(&rucb, &recv);

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: test-rudolph0.c,v 1.5 2007/05/22 21:04:19 adamdunkels Exp $
* $Id: test-rudolph0.c,v 1.6 2007/11/17 18:09:56 adamdunkels Exp $
*/
/**
@ -39,6 +39,7 @@
*/
#include "contiki.h"
#include "cfs/cfs.h"
#include "net/rime/rudolph0.h"
#include "dev/button-sensor.h"
@ -55,7 +56,7 @@ AUTOSTART_PROCESSES(&test_rudolph0_process);
/*---------------------------------------------------------------------------*/
static void
write_chunk(struct rudolph0_conn *c, int offset, int flag,
char *data, int datalen)
uint8_t *data, int datalen)
{
int fd;
@ -94,7 +95,7 @@ write_chunk(struct rudolph0_conn *c, int offset, int flag,
}
}
static int
read_chunk(struct rudolph0_conn *c, int offset, char *to, int maxsize)
read_chunk(struct rudolph0_conn *c, int offset, uint8_t *to, int maxsize)
{
int fd;
int ret;

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: test-rudolph1.c,v 1.7 2007/05/15 08:10:32 adamdunkels Exp $
* $Id: test-rudolph1.c,v 1.8 2007/11/17 18:09:56 adamdunkels Exp $
*/
/**
@ -51,6 +51,11 @@
#include <stdio.h>
#if NETSIM
#include "ether.h"
#include "node.h"
#endif /* NETSIM */
#define FILESIZE 2000
/*---------------------------------------------------------------------------*/
@ -59,7 +64,7 @@ AUTOSTART_PROCESSES(&test_rudolph1_process);
/*---------------------------------------------------------------------------*/
static void
write_chunk(struct rudolph1_conn *c, int offset, int flag,
char *data, int datalen)
uint8_t *data, int datalen)
{
int fd;
#if NETSIM
@ -111,7 +116,7 @@ write_chunk(struct rudolph1_conn *c, int offset, int flag,
}
}
static int
read_chunk(struct rudolph1_conn *c, int offset, char *to, int maxsize)
read_chunk(struct rudolph1_conn *c, int offset, uint8_t *to, int maxsize)
{
int fd;
int ret;

View file

@ -28,7 +28,7 @@
*
* This file is part of the Contiki operating system.
*
* $Id: test-rudolph2.c,v 1.1 2007/05/15 08:10:32 adamdunkels Exp $
* $Id: test-rudolph2.c,v 1.2 2007/11/17 18:09:56 adamdunkels Exp $
*/
/**
@ -49,6 +49,11 @@
#include <stdio.h>
#if NETSIM
#include "ether.h"
#include "node.h"
#endif /* NETSIM */
#define FILESIZE 2000
/*---------------------------------------------------------------------------*/
@ -57,7 +62,7 @@ AUTOSTART_PROCESSES(&test_rudolph2_process);
/*---------------------------------------------------------------------------*/
static void
write_chunk(struct rudolph2_conn *c, int offset, int flag,
char *data, int datalen)
uint8_t *data, int datalen)
{
int fd;
#if NETSIM
@ -109,7 +114,7 @@ write_chunk(struct rudolph2_conn *c, int offset, int flag,
}
}
static int
read_chunk(struct rudolph2_conn *c, int offset, char *to, int maxsize)
read_chunk(struct rudolph2_conn *c, int offset, uint8_t *to, int maxsize)
{
int fd;
int ret;