mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-02 06:20:34 +08:00
GCC fixes for warnings
GCC was more picky about prototypes for inlines being required. The generate_listener.py script used incorrect printf formats and was casting %f params to float, but printf casts all %f params to double per the spec. Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
@@ -363,6 +363,14 @@ static void usage()
|
||||
PX4_WARN("Publish sensors combined: simulator start -p");
|
||||
}
|
||||
|
||||
__BEGIN_DECLS
|
||||
extern int simulator_main(int argc, char *argv[]);
|
||||
extern void led_init(void);
|
||||
extern void led_on(int led);
|
||||
extern void led_off(int led);
|
||||
extern void led_toggle(int led);
|
||||
__END_DECLS
|
||||
|
||||
extern "C" {
|
||||
|
||||
int simulator_main(int argc, char *argv[])
|
||||
@@ -418,13 +426,6 @@ int simulator_main(int argc, char *argv[])
|
||||
|
||||
}
|
||||
|
||||
__BEGIN_DECLS
|
||||
extern void led_init(void);
|
||||
extern void led_on(int led);
|
||||
extern void led_off(int led);
|
||||
extern void led_toggle(int led);
|
||||
__END_DECLS
|
||||
|
||||
bool static _led_state[2] = { false , false };
|
||||
|
||||
__EXPORT void led_init()
|
||||
|
||||
@@ -788,7 +788,8 @@ tone_alarm_main(int argc, char *argv[])
|
||||
PX4_WARN("not enough memory memory");
|
||||
return 1;
|
||||
}
|
||||
fread(buffer, sz, 1, fd);
|
||||
// FIXME - Make GCC happy
|
||||
if (fread(buffer, sz, 1, fd)) { }
|
||||
/* terminate the string */
|
||||
buffer[sz] = 0;
|
||||
ret = play_string(buffer, true);
|
||||
|
||||
@@ -37,12 +37,14 @@
|
||||
#pragma once
|
||||
extern sem_t _work_lock[];
|
||||
|
||||
inline void work_lock(int id);
|
||||
inline void work_lock(int id)
|
||||
{
|
||||
//printf("work_lock %d\n", id);
|
||||
sem_wait(&_work_lock[id]);
|
||||
}
|
||||
|
||||
inline void work_unlock(int id);
|
||||
inline void work_unlock(int id)
|
||||
{
|
||||
//printf("work_unlock %d\n", id);
|
||||
|
||||
Reference in New Issue
Block a user