mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 07:03:34 +08:00
systemcmds: convert c -> c++
This commit is contained in:
@@ -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);
|
||||
Reference in New Issue
Block a user