From 99399115f2135eb1ce64d46370f496249318cbf0 Mon Sep 17 00:00:00 2001 From: Mark Charlebois Date: Sat, 14 Mar 2015 15:09:00 -0700 Subject: [PATCH] Linux: Minor fixes of error caught by gcc-4.9.1 - Missing static declarations for functions not used outside a file. Signed-off-by: Mark Charlebois --- src/drivers/ms5611/ms5611_linux.cpp | 1 + src/platforms/linux/main.cpp | 2 +- src/platforms/linux/vcdev_test/vcdevtest_example.cpp | 4 ++-- src/platforms/px4_config.h | 3 --- src/platforms/px4_defines.h | 12 +++++++++--- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/drivers/ms5611/ms5611_linux.cpp b/src/drivers/ms5611/ms5611_linux.cpp index 043f16407b..2e872f7b6e 100644 --- a/src/drivers/ms5611/ms5611_linux.cpp +++ b/src/drivers/ms5611/ms5611_linux.cpp @@ -37,6 +37,7 @@ */ #include +#include #include #include diff --git a/src/platforms/linux/main.cpp b/src/platforms/linux/main.cpp index 790f8d6cba..ae3c547bfd 100644 --- a/src/platforms/linux/main.cpp +++ b/src/platforms/linux/main.cpp @@ -72,7 +72,7 @@ void run_cmd(const vector &appargs) { } } -void process_line(string &line) +static void process_line(string &line) { vector appargs(5); diff --git a/src/platforms/linux/vcdev_test/vcdevtest_example.cpp b/src/platforms/linux/vcdev_test/vcdevtest_example.cpp index 39c804ada4..c773da8ba1 100644 --- a/src/platforms/linux/vcdev_test/vcdevtest_example.cpp +++ b/src/platforms/linux/vcdev_test/vcdevtest_example.cpp @@ -51,7 +51,7 @@ using namespace device; #define TESTDEV "/dev/vdevex" -int writer_main(int argc, char *argv[]) +static int writer_main(int argc, char *argv[]) { char buf[1] = { '1' }; @@ -97,7 +97,7 @@ VCDevExample::~VCDevExample() { } } -int test_pub_block(int fd, unsigned long blocked) +static int test_pub_block(int fd, unsigned long blocked) { int ret = px4_ioctl(fd, PX4_DEVIOCSPUBBLOCK, blocked); if (ret < 0) { diff --git a/src/platforms/px4_config.h b/src/platforms/px4_config.h index ac5a04c277..c53fd63d49 100644 --- a/src/platforms/px4_config.h +++ b/src/platforms/px4_config.h @@ -45,9 +45,6 @@ #elif defined (__PX4_LINUX) #define CONFIG_NFILE_STREAMS 1 -extern long PX4_TICKS_PER_SEC; -#define USEC2TICKS(x) (PX4_TICKS_PER_SEC*(long)x/1000000L) - #define px4_errx(x, ...) errx(x, __VA_ARGS__) #endif diff --git a/src/platforms/px4_defines.h b/src/platforms/px4_defines.h index 6a4b1f2cff..091d67e056 100644 --- a/src/platforms/px4_defines.h +++ b/src/platforms/px4_defines.h @@ -112,10 +112,16 @@ typedef param_t px4_param_t; #define _PX4_IOC(x,y) _IO(x,y) /* FIXME - Used to satisfy build */ -#define UNIQUE_ID 0x1FFF7A10 //STM DocID018909 Rev 8 Sect 39.1 (Unique device ID Register) -#define USEC2TICK(x) 0 +//STM DocID018909 Rev 8 Sect 39.1 (Unique device ID Register) +#define UNIQUE_ID 0x1FFF7A10 -#define getreg32(a) (*(volatile uint32_t *)(a)) +#define getreg32(a) (*(volatile uint32_t *)(a)) + +__BEGIN_DECLS +extern long PX4_TICKS_PER_SEC; +__END_DECLS + +#define USEC2TICK(x) (PX4_TICKS_PER_SEC*(long)x/1000000L) #endif