mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 21:23:33 +08:00
systemcmds: convert c -> c++
This commit is contained in:
@@ -36,7 +36,7 @@ px4_add_module(
|
||||
STACK_MAIN 4096
|
||||
COMPILE_FLAGS
|
||||
SRCS
|
||||
dumpfile.c
|
||||
dumpfile.cpp
|
||||
DEPENDS
|
||||
)
|
||||
|
||||
|
||||
@@ -49,19 +49,15 @@
|
||||
|
||||
#include <systemlib/err.h>
|
||||
|
||||
__EXPORT int dumpfile_main(int argc, char *argv[]);
|
||||
|
||||
static void print_usage(void)
|
||||
static void print_usage()
|
||||
{
|
||||
PRINT_MODULE_DESCRIPTION("Dump file utility. Prints file size and contents in binary mode (don't replace LF with CR LF) to stdout.");
|
||||
|
||||
PRINT_MODULE_USAGE_NAME_SIMPLE("dumpfile", "command");
|
||||
PRINT_MODULE_USAGE_ARG("<file>", "File to dump", false);
|
||||
|
||||
}
|
||||
|
||||
int
|
||||
dumpfile_main(int argc, char *argv[])
|
||||
extern "C" __EXPORT int dumpfile_main(int argc, char *argv[])
|
||||
{
|
||||
if (argc < 2) {
|
||||
print_usage();
|
||||
@@ -72,7 +68,7 @@ dumpfile_main(int argc, char *argv[])
|
||||
FILE *f;
|
||||
f = fopen(argv[1], "r");
|
||||
|
||||
if (f == NULL) {
|
||||
if (f == nullptr) {
|
||||
PX4_ERR("Failed to open file (%i)", errno);
|
||||
return 1;
|
||||
}
|
||||
Reference in New Issue
Block a user