systemcmds: convert c -> c++

This commit is contained in:
Daniel Agar
2021-12-21 09:22:49 -05:00
parent d2e931858d
commit 0029a75ab0
27 changed files with 69 additions and 111 deletions
+1 -1
View File
@@ -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;
}