From 1639b712bb5e980dafa9587a058a58429b965525 Mon Sep 17 00:00:00 2001
From: Oliver Schmidt
Date: Sun, 1 Nov 2015 18:10:17 +0100
Subject: [PATCH] Removed CC_FASTCALL.
CC_FASTCALL was introduced many years ago for the cc65 tool chain. It was never used for another tool chain. With https://github.com/cc65/cc65/commit/a798b1d6487c38345cf136617543671e4c85adbf the cc65 tool chain doesn't need CC_FASTCALL anymore.
---
apps/cmdd/cmdd.c | 2 +-
apps/webbrowser/htmlparser.c | 12 ++++++------
apps/webbrowser/www.c | 18 +++++++++---------
core/ctk/ctk.c | 16 ++++++++--------
core/ctk/ctk.h | 4 ++--
core/sys/cc.h | 14 ++------------
cpu/6502/6502def.h | 1 -
cpu/6502/lib/config.c | 4 ++--
cpu/6502/lib/config.h | 2 +-
cpu/6502/net/ethernet.c | 2 +-
cpu/6502/net/ethernet.h | 2 +-
cpu/cc2430/8051def.h | 1 -
cpu/cc253x/8051def.h | 1 -
platform/cooja/contiki-conf.h | 1 -
platform/jn516x/platform-conf.h | 1 -
platform/mbxxx/platform-conf.h | 1 -
platform/minimal-net/contiki-conf.h | 1 -
platform/native/contiki-conf.h | 1 -
platform/win32/contiki-conf.h | 3 +--
tools/wpcapslip/tcpdump.c | 6 +++---
20 files changed, 37 insertions(+), 56 deletions(-)
diff --git a/apps/cmdd/cmdd.c b/apps/cmdd/cmdd.c
index 6dfebe42fe2..74bfdb0e8f4 100644
--- a/apps/cmdd/cmdd.c
+++ b/apps/cmdd/cmdd.c
@@ -24,7 +24,7 @@ static char send_udp = 0;
static const char *prompt = "contiki> ";
/*---------------------------------------------------------------------------*/
-static char * CC_FASTCALL
+static char *
n(uint16_t num, char *ptr)
{
uint16_t d;
diff --git a/apps/webbrowser/htmlparser.c b/apps/webbrowser/htmlparser.c
index 5e606d08ee5..b0d8cfdc350 100644
--- a/apps/webbrowser/htmlparser.c
+++ b/apps/webbrowser/htmlparser.c
@@ -222,7 +222,7 @@ static const char *tags[] = {
};
/*-----------------------------------------------------------------------------------*/
-static unsigned char CC_FASTCALL
+static unsigned char
iswhitespace(char c)
{
return (c == ISO_space ||
@@ -255,7 +255,7 @@ htmlparser_init(void)
#endif /* WWW_CONF_FORMS */
}
/*-----------------------------------------------------------------------------------*/
-static char CC_FASTCALL
+static char
lowercase(char c)
{
/* XXX: This is a *brute force* approach to lower-case
@@ -276,7 +276,7 @@ endtagfound(void)
s.tagattrparam[s.tagattrparamptr] = 0;
}
/*-----------------------------------------------------------------------------------*/
-static void CC_FASTCALL
+static void
switch_majorstate(unsigned char newstate)
{
if(s.majorstate != newstate) {
@@ -286,7 +286,7 @@ switch_majorstate(unsigned char newstate)
}
}
/*-----------------------------------------------------------------------------------*/
-static void CC_FASTCALL
+static void
add_char(unsigned char c)
{
if(s.wordlen < WWW_CONF_WEBPAGE_WIDTH - 1 && c < 0x80) {
@@ -320,7 +320,7 @@ newline(void)
htmlparser_newline();
}
/*-----------------------------------------------------------------------------------*/
-static unsigned char CC_FASTCALL
+static unsigned char
find_tag(char *tag)
{
static unsigned char first, last, i, tabi;
@@ -521,7 +521,7 @@ parse_tag(void)
}
}
/*-----------------------------------------------------------------------------------*/
-static uint16_t CC_FASTCALL
+static uint16_t
parse_word(char *data, uint8_t dlen)
{
static uint8_t i;
diff --git a/apps/webbrowser/www.c b/apps/webbrowser/www.c
index 1d8cc7b178e..346c219f622 100644
--- a/apps/webbrowser/www.c
+++ b/apps/webbrowser/www.c
@@ -196,7 +196,7 @@ PROCESS(www_process, "Web browser");
AUTOSTART_PROCESSES(&www_process);
-static void CC_FASTCALL formsubmit(struct inputattrib *trigger);
+static void formsubmit(struct inputattrib *trigger);
/*-----------------------------------------------------------------------------------*/
/* make_window()
@@ -232,7 +232,7 @@ redraw_window(void)
ctk_window_redraw(&mainwindow);
}
/*-----------------------------------------------------------------------------------*/
-static char * CC_FASTCALL
+static char *
add_pageattrib(unsigned size)
{
char *ptr;
@@ -246,7 +246,7 @@ add_pageattrib(unsigned size)
}
/*-----------------------------------------------------------------------------------*/
#if WWW_CONF_FORMS
-static void CC_FASTCALL
+static void
add_forminput(struct inputattrib *inputptr)
{
inputptr->nextptr = NULL;
@@ -285,7 +285,7 @@ start_loading(void)
clear_page();
}
/*-----------------------------------------------------------------------------------*/
-static void CC_FASTCALL
+static void
show_statustext(char *text)
{
ctk_label_set_text(&statustext, text);
@@ -398,7 +398,7 @@ open_url(void)
* Will format a link from the current web pages so that it suits the
* open_url() function.
*/
-static void CC_FASTCALL
+static void
set_link(char *link)
{
register char *urlptr;
@@ -618,7 +618,7 @@ PROCESS_THREAD(www_process, ev, data)
* "url" variable and the visible "editurl" (which is shown in the URL
* text entry widget in the browser window).
*/
-static void CC_FASTCALL
+static void
set_url(char *host, uint16_t port, char *file)
{
char *urlptr;
@@ -732,7 +732,7 @@ webclient_datahandler(char *data, uint16_t len)
}
}
/*-----------------------------------------------------------------------------------*/
-static void CC_FASTCALL
+static void
add_pagewidget(char *text, unsigned char size, char *attrib, unsigned char type,
unsigned char border)
{
@@ -939,7 +939,7 @@ htmlparser_inputfield(unsigned char type, unsigned char size, char *text, char *
}
}
/*-----------------------------------------------------------------------------------*/
-static void CC_FASTCALL
+static void
add_query(char delimiter, char *string)
{
static char *query;
@@ -967,7 +967,7 @@ add_query(char delimiter, char *string)
query += length;
}
/*-----------------------------------------------------------------------------------*/
-static void CC_FASTCALL
+static void
formsubmit(struct inputattrib *trigger)
{
struct inputattrib *input;
diff --git a/core/ctk/ctk.c b/core/ctk/ctk.c
index 5da963b197d..56f962b4a06 100644
--- a/core/ctk/ctk.c
+++ b/core/ctk/ctk.c
@@ -185,7 +185,7 @@ unsigned short ctk_screensaver_timeout = (5*60);
static struct timer timer;
#endif /* CTK_CONF_SCREENSAVER */
-static void CC_FASTCALL
+static void
textentry_input(ctk_arch_key_t c,
CC_REGISTER_ARG struct ctk_textentry *t);
@@ -555,7 +555,7 @@ ctk_menu_remove(struct ctk_menu *menu)
* \param clipy2 The lower bound of the clip interval
*/
/*---------------------------------------------------------------------------*/
-static void CC_FASTCALL
+static void
do_redraw_all(unsigned char clipy1, unsigned char clipy2)
{
#if CTK_CONF_WINDOWS
@@ -818,7 +818,7 @@ ctk_menuitem_add(CC_REGISTER_ARG struct ctk_menu *menu, char *name)
* \param w The widget that should be redrawn.
*/
/*---------------------------------------------------------------------------*/
-static void CC_FASTCALL
+static void
add_redrawwidget(struct ctk_widget *w)
{
static unsigned char i;
@@ -921,7 +921,7 @@ ctk_widget_redraw(struct ctk_widget *widget)
* \param widget The widget to be added.
*/
/*---------------------------------------------------------------------------*/
-void CC_FASTCALL
+void
ctk_widget_add(CC_REGISTER_ARG struct ctk_window *window,
CC_REGISTER_ARG struct ctk_widget *widget)
{
@@ -973,7 +973,7 @@ ctk_desktop_height(struct ctk_desktop *d)
* \param focus The widget to be focused.
*/
/*---------------------------------------------------------------------------*/
-static void CC_FASTCALL
+static void
select_widget(struct ctk_widget *focus)
{
struct ctk_window *window;
@@ -1001,7 +1001,7 @@ select_widget(struct ctk_widget *focus)
#define DOWN 1
#define LEFT 2
#define RIGHT 3
-static void CC_FASTCALL
+static void
switch_focus_widget(unsigned char direction)
{
#if CTK_CONF_WINDOWS
@@ -1126,7 +1126,7 @@ switch_menu_item(unsigned char updown)
}
#endif /* CTK_CONF_MENUS */
/*---------------------------------------------------------------------------*/
-static unsigned char CC_FASTCALL
+static unsigned char
activate(CC_REGISTER_ARG struct ctk_widget *w)
{
if(w->type == CTK_WIDGET_BUTTON) {
@@ -1183,7 +1183,7 @@ ctk_textentry_input_null(ctk_arch_key_t c, struct ctk_textentry *t)
}
#endif /* SDCC */
/*---------------------------------------------------------------------------*/
-static void CC_FASTCALL
+static void
textentry_input(ctk_arch_key_t c, CC_REGISTER_ARG struct ctk_textentry *t)
{
register char *cptr, *cptr2;
diff --git a/core/ctk/ctk.h b/core/ctk/ctk.h
index 0cbef830d0d..4aea9458e4f 100644
--- a/core/ctk/ctk.h
+++ b/core/ctk/ctk.h
@@ -743,8 +743,8 @@ void ctk_icon_add(struct ctk_widget *icon, struct process *p);
*/
#define CTK_WIDGET_ADD(win, widg) \
ctk_widget_add(win, (struct ctk_widget *)widg)
-CCIF void CC_FASTCALL ctk_widget_add(struct ctk_window *window,
- struct ctk_widget *widget);
+CCIF void ctk_widget_add(struct ctk_window *window,
+ struct ctk_widget *widget);
/**
* Set focus to a widget.
diff --git a/core/sys/cc.h b/core/sys/cc.h
index f105a78c316..c77bc41d7f5 100644
--- a/core/sys/cc.h
+++ b/core/sys/cc.h
@@ -67,24 +67,14 @@
#define CC_FUNCTION_POINTER_ARGS 0
#endif /* CC_CONF_FUNCTION_POINTER_ARGS */
-/**
- * Configure if the C compiler supports fastcall function
- * declarations.
- */
-#ifdef CC_CONF_FASTCALL
-#define CC_FASTCALL CC_CONF_FASTCALL
-#else /* CC_CONF_FASTCALL */
-#define CC_FASTCALL
-#endif /* CC_CONF_FASTCALL */
-
/**
* Configure if the C compiler have problems with const function pointers
*/
#ifdef CC_CONF_CONST_FUNCTION_BUG
#define CC_CONST_FUNCTION
-#else /* CC_CONF_FASTCALL */
+#else /* CC_CONF_CONST_FUNCTION_BUG */
#define CC_CONST_FUNCTION const
-#endif /* CC_CONF_FASTCALL */
+#endif /* CC_CONF_CONST_FUNCTION_BUG */
/**
* Configure work-around for unsigned char bugs with sdcc.
diff --git a/cpu/6502/6502def.h b/cpu/6502/6502def.h
index 164af5e67a0..2da81b02e43 100644
--- a/cpu/6502/6502def.h
+++ b/cpu/6502/6502def.h
@@ -51,7 +51,6 @@ typedef uint32_t u32_t;
typedef int32_t s32_t;
#define CC_CONF_REGISTER_ARGS 1
-#define CC_CONF_FASTCALL __fastcall__
#define ARCH_DOESNT_NEED_ALIGNED_STRUCTS 1
diff --git a/cpu/6502/lib/config.c b/cpu/6502/lib/config.c
index 545c47116ad..7a013bd0b2c 100644
--- a/cpu/6502/lib/config.c
+++ b/cpu/6502/lib/config.c
@@ -43,7 +43,7 @@
/*-----------------------------------------------------------------------------------*/
#if LOG_CONF_ENABLED
-static char * CC_FASTCALL
+static char *
ipaddrtoa(uip_ipaddr_t *ipaddr, char *buffer)
{
char *ptr = buffer;
@@ -59,7 +59,7 @@ ipaddrtoa(uip_ipaddr_t *ipaddr, char *buffer)
}
#endif /* LOG_CONF_ENABLED */
/*-----------------------------------------------------------------------------------*/
-struct ethernet_config * CC_FASTCALL
+struct ethernet_config *
config_read(char *filename)
{
static struct {
diff --git a/cpu/6502/lib/config.h b/cpu/6502/lib/config.h
index 8f7f971be23..11bc034632d 100644
--- a/cpu/6502/lib/config.h
+++ b/cpu/6502/lib/config.h
@@ -35,6 +35,6 @@
#ifndef CONFIG_H_
#define CONFIG_H_
-struct ethernet_config * CC_FASTCALL config_read(char *filename);
+struct ethernet_config * config_read(char *filename);
#endif /* CONFIG_H_ */
diff --git a/cpu/6502/net/ethernet.c b/cpu/6502/net/ethernet.c
index 58c15e4d562..2817b5d3c17 100644
--- a/cpu/6502/net/ethernet.c
+++ b/cpu/6502/net/ethernet.c
@@ -58,7 +58,7 @@ struct {
} *module;
/*---------------------------------------------------------------------------*/
-void CC_FASTCALL
+void
ethernet_init(struct ethernet_config *config)
{
static const char signature[4] = {0x65, 0x74, 0x68, 0x01};
diff --git a/cpu/6502/net/ethernet.h b/cpu/6502/net/ethernet.h
index d99f06451d7..ce06f6e7a74 100644
--- a/cpu/6502/net/ethernet.h
+++ b/cpu/6502/net/ethernet.h
@@ -35,7 +35,7 @@
#ifndef ETHERNET_H_
#define ETHERNET_H_
-void CC_FASTCALL ethernet_init(struct ethernet_config *config);
+void ethernet_init(struct ethernet_config *config);
uint16_t ethernet_poll(void);
void ethernet_send(void);
void ethernet_exit(void);
diff --git a/cpu/cc2430/8051def.h b/cpu/cc2430/8051def.h
index 6d89a1fb22b..f0acda7b955 100644
--- a/cpu/cc2430/8051def.h
+++ b/cpu/cc2430/8051def.h
@@ -38,7 +38,6 @@
#endif
#define CC_CONF_FUNCTION_POINTER_ARGS 1
-#define CC_CONF_FASTCALL
#define CC_CONF_VA_ARGS 1
#define CC_CONF_UNSIGNED_CHAR_BUGS 0
#define CC_CONF_REGISTER_ARGS 0
diff --git a/cpu/cc253x/8051def.h b/cpu/cc253x/8051def.h
index eb794e754b0..e16cf3c2eaa 100644
--- a/cpu/cc253x/8051def.h
+++ b/cpu/cc253x/8051def.h
@@ -38,7 +38,6 @@
#endif
#define CC_CONF_FUNCTION_POINTER_ARGS 1
-#define CC_CONF_FASTCALL
#define CC_CONF_VA_ARGS 1
#define CC_CONF_UNSIGNED_CHAR_BUGS 0
#define CC_CONF_REGISTER_ARGS 0
diff --git a/platform/cooja/contiki-conf.h b/platform/cooja/contiki-conf.h
index d4f3979e920..04f1c4d43e2 100644
--- a/platform/cooja/contiki-conf.h
+++ b/platform/cooja/contiki-conf.h
@@ -183,7 +183,6 @@
#define CC_CONF_REGISTER_ARGS 1
#define CC_CONF_FUNCTION_POINTER_ARGS 1
-#define CC_CONF_FASTCALL
#define CC_CONF_VA_ARGS 1
#define CC_CONF_INLINE inline
diff --git a/platform/jn516x/platform-conf.h b/platform/jn516x/platform-conf.h
index 60497645f95..fa289fc2fb5 100644
--- a/platform/jn516x/platform-conf.h
+++ b/platform/jn516x/platform-conf.h
@@ -158,7 +158,6 @@
#define CC_CONF_REGISTER_ARGS 1
#define CC_CONF_FUNCTION_POINTER_ARGS 1
-#define CC_CONF_FASTCALL
#define CC_CONF_VA_ARGS 1
#define CC_CONF_INLINE inline
diff --git a/platform/mbxxx/platform-conf.h b/platform/mbxxx/platform-conf.h
index 8e8def73df5..6b811ec966d 100644
--- a/platform/mbxxx/platform-conf.h
+++ b/platform/mbxxx/platform-conf.h
@@ -62,7 +62,6 @@
/* Platform-dependent definitions */
#define CC_CONF_REGISTER_ARGS 0
#define CC_CONF_FUNCTION_POINTER_ARGS 1
-#define CC_CONF_FASTCALL
#define CC_CONF_VA_ARGS 1
#define CC_CONF_INLINE inline
diff --git a/platform/minimal-net/contiki-conf.h b/platform/minimal-net/contiki-conf.h
index 5368ac6407d..9fa2e225fdc 100644
--- a/platform/minimal-net/contiki-conf.h
+++ b/platform/minimal-net/contiki-conf.h
@@ -47,7 +47,6 @@ int select_set_callback(int fd, const struct select_callback *callback);
#define CC_CONF_REGISTER_ARGS 1
#define CC_CONF_FUNCTION_POINTER_ARGS 1
-#define CC_CONF_FASTCALL
#define CC_CONF_VA_ARGS 1
#define CCIF
diff --git a/platform/native/contiki-conf.h b/platform/native/contiki-conf.h
index b3c15d48c84..e011bff96ad 100644
--- a/platform/native/contiki-conf.h
+++ b/platform/native/contiki-conf.h
@@ -46,7 +46,6 @@ int select_set_callback(int fd, const struct select_callback *callback);
#define CC_CONF_REGISTER_ARGS 1
#define CC_CONF_FUNCTION_POINTER_ARGS 1
-#define CC_CONF_FASTCALL
#define CC_CONF_VA_ARGS 1
/*#define CC_CONF_INLINE inline*/
diff --git a/platform/win32/contiki-conf.h b/platform/win32/contiki-conf.h
index 060648c36f8..fbdd93d5cb7 100644
--- a/platform/win32/contiki-conf.h
+++ b/platform/win32/contiki-conf.h
@@ -6,8 +6,7 @@
#endif
#define CC_CONF_REGISTER_ARGS 1
-#define CC_CONF_FASTCALL __fastcall
-#define CC_CONF_INLINE __inline
+#define CC_CONF_INLINE __inline
#define ARCH_DOESNT_NEED_ALIGNED_STRUCTS 1
diff --git a/tools/wpcapslip/tcpdump.c b/tools/wpcapslip/tcpdump.c
index 6883cfec33c..7ecd7c50aa3 100644
--- a/tools/wpcapslip/tcpdump.c
+++ b/tools/wpcapslip/tcpdump.c
@@ -156,7 +156,7 @@ tcpflags(unsigned char flags, char *flagsstr)
*flagsstr = 0;
}
/*---------------------------------------------------------------------------*/
-static char * CC_FASTCALL
+static char *
n(uint16_t num, char *ptr)
{
uint16_t d;
@@ -179,14 +179,14 @@ n(uint16_t num, char *ptr)
return ptr;
}
/*---------------------------------------------------------------------------*/
-static char * CC_FASTCALL
+static char *
d(char *ptr)
{
*ptr = '.';
return ptr + 1;
}
/*---------------------------------------------------------------------------*/
-static char * CC_FASTCALL
+static char *
s(char *str, char *ptr)
{
strcpy(ptr, str);