Skip to content

Commit

Permalink
Converted u8_t to uint8_t and u16_t to uint16_t in the platforms dire…
Browse files Browse the repository at this point in the history
…ctory.

Added "These names are deprecated, use C99 names" warnings the contiki-conf.h files that were missing it.
  • Loading branch information
njh authored and malvira committed Feb 21, 2012
1 parent a561d20 commit 680225e
Show file tree
Hide file tree
Showing 57 changed files with 274 additions and 250 deletions.
20 changes: 10 additions & 10 deletions platform/avr-atmega128rfa1/apps/raven-ipso/raven-ipso.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,18 @@
#define cmd_len 8
#define data_len 20

static u8_t seqno;
static uint8_t seqno;
uip_ipaddr_t ping_addr;
uip_ipaddr_t udp_addr;
static struct uip_udp_conn *udp_conn;
char udp_data[data_len];

static struct{
u8_t frame[cmd_len];
u8_t ndx;
u8_t len;
u8_t cmd;
u8_t done;
uint8_t frame[cmd_len];
uint8_t ndx;
uint8_t len;
uint8_t cmd;
uint8_t done;
} cmd;

#define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN])
Expand Down Expand Up @@ -114,8 +114,8 @@ raven_ping6(void)
memset((void *)UIP_ICMP_BUF + UIP_ICMPH_LEN, 0, 4);

uip_len = UIP_ICMPH_LEN + UIP_ICMP6_ECHO_REQUEST_LEN + UIP_IPH_LEN;
UIP_IP_BUF->len[0] = (u8_t)((uip_len - 40) >> 8);
UIP_IP_BUF->len[1] = (u8_t)((uip_len - 40) & 0x00FF);
UIP_IP_BUF->len[0] = (uint8_t)((uip_len - 40) >> 8);
UIP_IP_BUF->len[1] = (uint8_t)((uip_len - 40) & 0x00FF);

UIP_ICMP_BUF->icmpchksum = 0;
UIP_ICMP_BUF->icmpchksum = ~uip_icmp6chksum();
Expand All @@ -140,7 +140,7 @@ send_frame(uint8_t cmd, uint8_t len, uint8_t *payload)
}

/*------------------------------------------------------------------*/
static u8_t
static uint8_t
raven_gui_loop(process_event_t ev, process_data_t data)
{
if(ev == tcpip_icmp6_event) {
Expand Down Expand Up @@ -235,7 +235,7 @@ int raven_lcd_serial_input(unsigned char ch)
PROCESS(raven_lcd_process, "Raven LCD interface process");
PROCESS_THREAD(raven_lcd_process, ev, data)
{
u8_t error;
uint8_t error;

PROCESS_BEGIN();

Expand Down
22 changes: 11 additions & 11 deletions platform/avr-atmega128rfa1/apps/raven-lcd-interface/raven-lcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,17 @@
#include <avr/sleep.h>
#include <dev/watchdog.h>

static u8_t count = 0;
static u8_t seqno;
static uint8_t count = 0;
static uint8_t seqno;
uip_ipaddr_t dest_addr;

#define MAX_CMD_LEN 20
static struct{
u8_t frame[MAX_CMD_LEN];
u8_t ndx;
u8_t len;
u8_t cmd;
u8_t done;
uint8_t frame[MAX_CMD_LEN];
uint8_t ndx;
uint8_t len;
uint8_t cmd;
uint8_t done;
} cmd;

#define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN])
Expand Down Expand Up @@ -138,8 +138,8 @@ seqno++;


uip_len = UIP_ICMPH_LEN + UIP_ICMP6_ECHO_REQUEST_LEN + UIP_IPH_LEN + PING6_DATALEN;
UIP_IP_BUF->len[0] = (u8_t)((uip_len - 40) >> 8);
UIP_IP_BUF->len[1] = (u8_t)((uip_len - 40) & 0x00FF);
UIP_IP_BUF->len[0] = (uint8_t)((uip_len - 40) >> 8);
UIP_IP_BUF->len[1] = (uint8_t)((uip_len - 40) & 0x00FF);

UIP_ICMP_BUF->icmpchksum = 0;
UIP_ICMP_BUF->icmpchksum = ~uip_icmp6chksum();
Expand Down Expand Up @@ -262,13 +262,13 @@ ISR(TIMER2_COMPA_vect)
#endif /* !AVR_CONF_USE32KCRYSTAL */

#if DEBUGSERIAL
u8_t serialcount;
uint8_t serialcount;
char dbuf[30];
#endif

/*---------------------------------------------------------------------------*/
extern uint16_t ledtimer;
static u8_t
static uint8_t
raven_gui_loop(process_event_t ev, process_data_t data)
{
uint8_t i,activeconnections,radio_state;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ generate_file_stats(void *arg)
static const char httpd_cgi_filestat3[] HTTPD_STRING_ATTR = "%5u";
char tmp[20];
struct httpd_fsdata_file_noconst *f,fram;
u16_t i;
uint16_t i;
unsigned short numprinted;

/* Transfer arg from whichever flash that contains the html file to RAM */
Expand Down
14 changes: 7 additions & 7 deletions platform/avr-atmega128rfa1/apps/raven-webserver/httpd-fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include "httpd-fsdata.c"

#if HTTPD_FS_STATISTICS==2
u16_t httpd_filecount[HTTPD_FS_NUMFILES];
uint16_t httpd_filecount[HTTPD_FS_NUMFILES];
#endif /* HTTPD_FS_STATISTICS */

/*-----------------------------------------------------------------------------------*/
Expand All @@ -50,18 +50,18 @@ httpd_fs_get_root()
return (void *)HTTPD_FS_ROOT;
}
/*-----------------------------------------------------------------------------------*/
u16_t
uint16_t
httpd_fs_get_size()
{
return HTTPD_FS_SIZE;
}
/*-----------------------------------------------------------------------------------*/

u16_t
uint16_t
httpd_fs_open(const char *name, struct httpd_fs_file *file)
{
#if HTTPD_FS_STATISTICS
u16_t i = 0;
uint16_t i = 0;
#endif /* HTTPD_FS_STATISTICS */
struct httpd_fsdata_file_noconst *f,fram;

Expand Down Expand Up @@ -103,19 +103,19 @@ void
httpd_fs_init(void)
{
#if HTTPD_FS_STATISTICS && 0 //count will already be zero at boot
u16_t i;
uint16_t i;
for(i = 0; i < HTTPD_FS_NUMFILES; i++) {
count[i] = 0;
}
#endif /* HTTPD_FS_STATISTICS */
}
/*-----------------------------------------------------------------------------------*/
#if HTTPD_FS_STATISTICS && 0 //Not needed, httpd_fs_open returns count
u16_t
uint16_t
httpd_fs_count(char *name)
{
struct httpd_fsdata_file_noconst *f,fram;
u16_t i;
uint16_t i;

i = 0;
for(f = (struct httpd_fsdata_file_noconst *)HTTPD_FS_ROOT;
Expand Down
6 changes: 3 additions & 3 deletions platform/avr-atmega128rfa1/apps/raven-webserver/httpd-fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#define HTTPD_FS_STATISTICS 2 //Puts count in RAM array

#if HTTPD_FS_STATISTICS==2
extern u16_t httpd_filecount[];
extern uint16_t httpd_filecount[];
#endif /* HTTPD_FS_STATISTICS */

#include <avr/pgmspace.h>
Expand All @@ -59,12 +59,12 @@ void httpd_fs_init(void);
/* Returns root of http files in program flash */
void* httpd_fs_get_root();
/* Returns size of http files in any flash */
u16_t httpd_fs_get_size();
uint16_t httpd_fs_get_size();
/* Open a file in any flash and return statistics if enabled.
If file is allocated by caller it will be filled in.
If NULL, just file stats are returned.
*/
u16_t httpd_fs_open(const char *name, struct httpd_fs_file *file);
uint16_t httpd_fs_open(const char *name, struct httpd_fs_file *file);

#if COFFEE_FILES
/* Coffee file system can be static or dynamic. If static, new files
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ struct httpd_fsdata_file {
const char *data; //offset to coffee file data
const int len; //length of file data
#if HTTPD_FS_STATISTICS == 1 //not enabled since list is in PROGMEM
u16_t count; //storage for file statistics
uint16_t count; //storage for file statistics
#endif
}
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct httpd_fsdata_file {
const char *data;
const int len;
#if HTTPD_FS_STATISTICS == 1
u16_t count;
uint16_t count;
#endif /* HTTPD_FS_STATISTICS */
};

Expand All @@ -53,7 +53,7 @@ struct httpd_fsdata_file_noconst {
char *data;
int len;
#if HTTPD_FS_STATISTICS == 1
u16_t count;
uint16_t count;
#endif /* HTTPD_FS_STATISTICS */
};

Expand Down
2 changes: 2 additions & 0 deletions platform/avr-atmega128rfa1/contiki-conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@
#endif
#include <stdint.h>

/* These names are deprecated, use C99 names. */
typedef int32_t s32_t;
typedef unsigned char u8_t;
typedef unsigned short u16_t;
typedef unsigned long u32_t;

typedef unsigned short clock_time_t;
typedef unsigned short uip_stats_t;
typedef unsigned long off_t;
Expand Down
20 changes: 10 additions & 10 deletions platform/avr-raven/apps/raven-ipso/raven-ipso.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,18 @@
#define cmd_len 8
#define data_len 20

static u8_t seqno;
static uint8_t seqno;
uip_ipaddr_t ping_addr;
uip_ipaddr_t udp_addr;
static struct uip_udp_conn *udp_conn;
char udp_data[data_len];

static struct{
u8_t frame[cmd_len];
u8_t ndx;
u8_t len;
u8_t cmd;
u8_t done;
uint8_t frame[cmd_len];
uint8_t ndx;
uint8_t len;
uint8_t cmd;
uint8_t done;
} cmd;

#define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN])
Expand Down Expand Up @@ -114,8 +114,8 @@ raven_ping6(void)
memset((void *)UIP_ICMP_BUF + UIP_ICMPH_LEN, 0, 4);

uip_len = UIP_ICMPH_LEN + UIP_ICMP6_ECHO_REQUEST_LEN + UIP_IPH_LEN;
UIP_IP_BUF->len[0] = (u8_t)((uip_len - 40) >> 8);
UIP_IP_BUF->len[1] = (u8_t)((uip_len - 40) & 0x00FF);
UIP_IP_BUF->len[0] = (uint8_t)((uip_len - 40) >> 8);
UIP_IP_BUF->len[1] = (uint8_t)((uip_len - 40) & 0x00FF);

UIP_ICMP_BUF->icmpchksum = 0;
UIP_ICMP_BUF->icmpchksum = ~uip_icmp6chksum();
Expand All @@ -140,7 +140,7 @@ send_frame(uint8_t cmd, uint8_t len, uint8_t *payload)
}

/*------------------------------------------------------------------*/
static u8_t
static uint8_t
raven_gui_loop(process_event_t ev, process_data_t data)
{
if(ev == tcpip_icmp6_event) {
Expand Down Expand Up @@ -235,7 +235,7 @@ int raven_lcd_serial_input(unsigned char ch)
PROCESS(raven_lcd_process, "Raven LCD interface process");
PROCESS_THREAD(raven_lcd_process, ev, data)
{
u8_t error;
uint8_t error;

PROCESS_BEGIN();

Expand Down
22 changes: 11 additions & 11 deletions platform/avr-raven/apps/raven-lcd-interface/raven-lcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,17 @@
#include <avr/sleep.h>
#include <dev/watchdog.h>

static u8_t count = 0;
static u8_t seqno;
static uint8_t count = 0;
static uint8_t seqno;
uip_ipaddr_t dest_addr;

#define MAX_CMD_LEN 20
static struct{
u8_t frame[MAX_CMD_LEN];
u8_t ndx;
u8_t len;
u8_t cmd;
u8_t done;
uint8_t frame[MAX_CMD_LEN];
uint8_t ndx;
uint8_t len;
uint8_t cmd;
uint8_t done;
} cmd;

#define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN])
Expand Down Expand Up @@ -137,8 +137,8 @@ raven_ping6(void)


uip_len = UIP_ICMPH_LEN + UIP_ICMP6_ECHO_REQUEST_LEN + UIP_IPH_LEN + PING6_DATALEN;
UIP_IP_BUF->len[0] = (u8_t)((uip_len - 40) >> 8);
UIP_IP_BUF->len[1] = (u8_t)((uip_len - 40) & 0x00FF);
UIP_IP_BUF->len[0] = (uint8_t)((uip_len - 40) >> 8);
UIP_IP_BUF->len[1] = (uint8_t)((uip_len - 40) & 0x00FF);

UIP_ICMP_BUF->icmpchksum = 0;
UIP_ICMP_BUF->icmpchksum = ~uip_icmp6chksum();
Expand Down Expand Up @@ -253,12 +253,12 @@ ISR(TIMER2_COMPA_vect)
#endif /* !AVR_CONF_USE32KCRYSTAL */

#if DEBUGSERIAL
u8_t serialcount;
uint8_t serialcount;
char dbuf[30];
#endif

/*---------------------------------------------------------------------------*/
static u8_t
static uint8_t
raven_gui_loop(process_event_t ev, process_data_t data)
{
uint8_t i,activeconnections,radio_state;
Expand Down
2 changes: 1 addition & 1 deletion platform/avr-raven/apps/raven-webserver/httpd-cgi.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ generate_file_stats(void *arg)
static const char httpd_cgi_filestat3[] HTTPD_STRING_ATTR = "%5u";
char tmp[20];
struct httpd_fsdata_file_noconst *f,fram;
u16_t i;
uint16_t i;
unsigned short numprinted;

/* Transfer arg from whichever flash that contains the html file to RAM */
Expand Down
Loading

0 comments on commit 680225e

Please sign in to comment.