mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 09:13:34 +08:00
platform: some code cleanup for px4_{posix,qurt}_tasks.cpp
- __BEGIN_DECLS is for declarations not definitions - getprogname() declaration is in err.h
This commit is contained in:
@@ -58,6 +58,7 @@
|
||||
|
||||
#include <px4_tasks.h>
|
||||
#include <px4_posix.h>
|
||||
#include <systemlib/err.h>
|
||||
|
||||
#define MAX_CMD_LEN 100
|
||||
|
||||
@@ -381,14 +382,12 @@ bool px4_task_is_running(const char *taskname)
|
||||
|
||||
return false;
|
||||
}
|
||||
__BEGIN_DECLS
|
||||
|
||||
unsigned long px4_getpid()
|
||||
{
|
||||
return (unsigned long)pthread_self();
|
||||
}
|
||||
|
||||
const char *getprogname();
|
||||
const char *getprogname()
|
||||
{
|
||||
pthread_t pid = pthread_self();
|
||||
@@ -427,4 +426,3 @@ int px4_prctl(int option, const char *arg2, unsigned pid)
|
||||
return rv;
|
||||
}
|
||||
|
||||
__END_DECLS
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
#include <string>
|
||||
|
||||
#include <px4_tasks.h>
|
||||
#include <systemlib/err.h>
|
||||
|
||||
#define MAX_CMD_LEN 100
|
||||
|
||||
@@ -325,8 +326,6 @@ void px4_show_tasks()
|
||||
|
||||
}
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
unsigned long px4_getpid()
|
||||
{
|
||||
pthread_t pid = pthread_self();
|
||||
@@ -346,7 +345,6 @@ unsigned long px4_getpid()
|
||||
}
|
||||
|
||||
|
||||
const char *getprogname();
|
||||
const char *getprogname()
|
||||
{
|
||||
pthread_t pid = pthread_self();
|
||||
@@ -404,4 +402,3 @@ int px4_prctl(int option, const char *arg2, unsigned pid)
|
||||
|
||||
return rv;
|
||||
}
|
||||
__END_DECLS
|
||||
|
||||
Reference in New Issue
Block a user