From 8c4f6d1549856cab0c4db68a0ae8c6f01f86b3d1 Mon Sep 17 00:00:00 2001 From: ecdr Date: Wed, 30 Oct 2013 00:38:46 -0800 Subject: [PATCH] eLua - Remove redundant includes duplicate files included by platform.h/platform_conf.h --- inc/common.h | 1 - inc/elua_adc.h | 1 - inc/elua_net.h | 1 - inc/elua_uip.h | 1 - inc/platform.h | 1 - inc/platform_conf.h | 4 +++- src/buf.c | 3 --- src/common.c | 6 +----- src/common_tmr.c | 2 -- src/common_uart.c | 4 ---- src/elua_int.c | 2 -- src/elua_uip.c | 1 - src/eluarpc.c | 1 - src/main.c | 2 -- src/mmcfs.c | 2 -- src/romfs.c | 2 -- src/salloc.c | 1 - src/semifs.c | 2 -- src/term.c | 1 - 19 files changed, 4 insertions(+), 34 deletions(-) diff --git a/inc/common.h b/inc/common.h index 3e28c691..76c93e9b 100644 --- a/inc/common.h +++ b/inc/common.h @@ -6,7 +6,6 @@ #include "elua_int.h" #include "lua.h" #include "platform.h" -#include "devman.h" // Virtual timers data // VTMR_FIRST_ID must be LARGER than PLATFORM_TIMER_SYS_ID (as declared in platform.h) diff --git a/inc/elua_adc.h b/inc/elua_adc.h index b1af89c7..2ef9cca8 100644 --- a/inc/elua_adc.h +++ b/inc/elua_adc.h @@ -1,7 +1,6 @@ #ifndef __ELUA_ADC_H__ #define __ELUA_ADC_H__ -#include "type.h" #include "platform_conf.h" diff --git a/inc/elua_net.h b/inc/elua_net.h index 96db308b..b3b8482e 100644 --- a/inc/elua_net.h +++ b/inc/elua_net.h @@ -3,7 +3,6 @@ #ifndef __ELUA_NET_H__ #define __ELUA_NET_H__ -#include "type.h" #include "lauxlib.h" #include "platform.h" diff --git a/inc/elua_uip.h b/inc/elua_uip.h index 7e93e0c7..bb1fbed7 100644 --- a/inc/elua_uip.h +++ b/inc/elua_uip.h @@ -4,7 +4,6 @@ #ifndef __ELUA_UIP_H__ #define __ELUA_UIP_H__ -#include "type.h" #include "elua_net.h" // eLua UIP application states diff --git a/inc/platform.h b/inc/platform.h index 39a297db..f8b8d6ac 100644 --- a/inc/platform.h +++ b/inc/platform.h @@ -4,7 +4,6 @@ #define __PLATFORM_H__ #include "devman.h" -#include "type.h" #include "elua_int.h" // Error / status codes diff --git a/inc/platform_conf.h b/inc/platform_conf.h index 1e256bb6..d75dc107 100644 --- a/inc/platform_conf.h +++ b/inc/platform_conf.h @@ -8,9 +8,11 @@ #include "legc.h" #include "platform.h" #include "auxmods.h" -#include "elua_int.h" #include "lualib.h" +// FIXME: ASF ill behaved - compiler.h does not check for previous definition of "UNDEFINED before defining it. +// It is also defined in lua source (but there it checks to be sure not defined). +// Moving include of ELUA_CPU_HEADER before lua things solves that problem, but maybe there is another way? #include ELUA_CPU_HEADER #include ELUA_BOARD_HEADER #include "platform_generic.h" // generic platform header (include whatever else is missing here) diff --git a/src/buf.c b/src/buf.c index abb320a6..e83f59b4 100644 --- a/src/buf.c +++ b/src/buf.c @@ -23,11 +23,8 @@ #ifdef BUF_ENABLE -#include "buf.h" #include "type.h" -#include "platform.h" #include "utils.h" -#include "sermux.h" #include #include diff --git a/src/common.c b/src/common.c index 16d01153..f0a54dea 100644 --- a/src/common.c +++ b/src/common.c @@ -1,11 +1,9 @@ // Common code for all backends -#include "platform.h" +#include "platform.h" // platform_conf.h #include "platform_conf.h" -#include "type.h" #include "genstd.h" #include "common.h" -#include "buf.h" #include #include #include @@ -14,8 +12,6 @@ #include "elua_adc.h" #include "term.h" #include "xmodem.h" -#include "elua_int.h" -#include "sermux.h" #include "lua.h" #include "lapi.h" #include "lauxlib.h" diff --git a/src/common_tmr.c b/src/common_tmr.c index 917559be..3be9a4cc 100644 --- a/src/common_tmr.c +++ b/src/common_tmr.c @@ -3,9 +3,7 @@ #include "platform.h" #include "platform_conf.h" -#include "type.h" #include "common.h" -#include "elua_int.h" #include "utils.h" #include diff --git a/src/common_uart.c b/src/common_uart.c index 15e6be0b..1028e198 100644 --- a/src/common_uart.c +++ b/src/common_uart.c @@ -1,11 +1,7 @@ // Common implementation: UART functions #include "common.h" -#include "platform.h" #include "platform_conf.h" -#include "buf.h" -#include "elua_int.h" -#include "sermux.h" // **************************************************************************** // UART functions diff --git a/src/elua_int.c b/src/elua_int.c index 18341456..a6c01ae3 100644 --- a/src/elua_int.c +++ b/src/elua_int.c @@ -1,10 +1,8 @@ // eLua interrupt support -#include "elua_int.h" #include "lua.h" #include "platform.h" #include "platform_conf.h" -#include "type.h" #include "ldebug.h" #include #include diff --git a/src/elua_uip.c b/src/elua_uip.c index c5e42d46..adb7758d 100644 --- a/src/elua_uip.c +++ b/src/elua_uip.c @@ -6,7 +6,6 @@ #include "elua_uip.h" #include "elua_net.h" -#include "type.h" #include "uip.h" #include "uip_arp.h" #include "platform.h" diff --git a/src/eluarpc.c b/src/eluarpc.c index 3c0811bc..1ace5f91 100644 --- a/src/eluarpc.c +++ b/src/eluarpc.c @@ -3,7 +3,6 @@ #include #include #include -#include "type.h" #include "eluarpc.h" #include "rtype.h" diff --git a/src/main.c b/src/main.c index 0324e3c7..4b1d5422 100644 --- a/src/main.c +++ b/src/main.c @@ -2,8 +2,6 @@ #include #include #include -#include "type.h" -#include "devman.h" #include "platform.h" #include "romfs.h" #include "xmodem.h" diff --git a/src/mmcfs.c b/src/mmcfs.c index 012f804e..b2bd9e6e 100644 --- a/src/mmcfs.c +++ b/src/mmcfs.c @@ -1,9 +1,7 @@ // MMC filesystem implementation using FatFs #include "mmcfs.h" -#include "type.h" #include #include -#include "devman.h" #include #include "ioctl.h" #include diff --git a/src/romfs.c b/src/romfs.c index 8282f1ab..58e41e0e 100644 --- a/src/romfs.c +++ b/src/romfs.c @@ -1,9 +1,7 @@ // Filesystem implementation #include "romfs.h" -#include "type.h" #include #include -#include "devman.h" #include "romfiles.h" #include #include "ioctl.h" diff --git a/src/salloc.c b/src/salloc.c index 3a15c335..8c71f6a7 100644 --- a/src/salloc.c +++ b/src/salloc.c @@ -7,7 +7,6 @@ #include #include "platform.h" #include "platform_conf.h" -#include "type.h" // Macros for the dynamic size allocator // Dynamic structure: pointer to next, pointer to prev diff --git a/src/semifs.c b/src/semifs.c index e7d9ff25..8eac2e49 100644 --- a/src/semifs.c +++ b/src/semifs.c @@ -1,9 +1,7 @@ // Filesystem implementation #include "swi.h" -#include "type.h" #include #include -#include "devman.h" #include #include "ioctl.h" #include "semifs.h" diff --git a/src/term.c b/src/term.c index d2bbbf7c..99bc6c9a 100644 --- a/src/term.c +++ b/src/term.c @@ -1,7 +1,6 @@ // Terminal function #include "term.h" -#include "type.h" #include "platform.h" #include #include