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
@@ -37,5 +37,5 @@ px4_add_module(
COMPILE_FLAGS
-Wno-cast-align # TODO: fix and enable
SRCS
bl_update.c
bl_update.cpp
)
@@ -66,8 +66,6 @@
# define STM_RAM_BASE STM32_SRAM_BASE
#endif
__EXPORT int bl_update_main(int argc, char *argv[]);
#if defined (CONFIG_STM32_STM32F4XXX) || defined (CONFIG_ARCH_CHIP_STM32F7) || \
defined (CONFIG_ARCH_CHIP_STM32H7)
@@ -90,8 +88,7 @@ static void print_usage(const char *reason)
#endif // defined (CONFIG_STM32_STM32F4XXX) || defined (CONFIG_ARCH_CHIP_STM32F7)
int
bl_update_main(int argc, char *argv[])
extern "C" __EXPORT int bl_update_main(int argc, char *argv[])
{
#if !(defined (CONFIG_STM32_STM32F4XXX) || defined (CONFIG_ARCH_CHIP_STM32F7) \
|| defined (CONFIG_ARCH_CHIP_STM32H7))
@@ -144,9 +141,9 @@ bl_update_main(int argc, char *argv[])
image_size = (file_size + page_size) & ~page_size;
#endif
uint8_t *buf = malloc(image_size);
uint8_t *buf = (uint8_t *)malloc(image_size);
if (buf == NULL)
if (buf == nullptr)
{
PX4_ERR("failed to allocate %jd bytes for firmware buffer", (intmax_t) file_size);
close(fd);