diff --git a/c/.clang-tidy b/c/.clang-tidy deleted file mode 100644 index 010f41b090..0000000000 --- a/c/.clang-tidy +++ /dev/null @@ -1,42 +0,0 @@ -# See: http://clang.llvm.org/extra/clang-tidy/ -# clang-tidy-4.0 src/pvt_engine/*.cc -- -std=c++14 -Irefactor/common/ -Irefactor/common/libswiftnav -Iinclude/ -Iinclude/libswiftnav/ -isystem -third_party/ -isystem./libfec/include/ -Ithird_party/Optional -isystem./third_party/json/src/ -isystem./third_party/eigen/ -# -# TODO (mookerji: Disabled are clang-analyzer-alpha.*, since these seem to check -# non-project code. Fix when resolved in LLVM. -# -# TODO (nsirola: Disabled a bunch of checks on updating to clang-4.0, to be -# re-enabled and checked individually: -# -modernize-deprecated-headers (new in 3.9) -# -modernize-use-default-member-init (new in 4.0) -# -modernize-redundant-void-arg (since 3.8, for some reason did not warn before) -# -modernize-use-using (new in 3.9) -# -modernize-use-equals-delete (new in 4.0) -# -modernize-use-equals-default (new in 4.0) -# -modernize-use-bool-literals (new in 3.9) -# -modernize-use-auto (extended in 4.0) -# -modernize-use-emplace (new in 3.9) -# -cppcoreguidelines-special-member-functions (new in 4.0) -# -cppcoreguidelines-pro-type-member-init (new in 3.9) -# -readability-avoid-const-params-in-decls (new in 3.9) -# -readability-non-const-parameter (new in 4.0) -# -readability-redundant-member-init (new in 4.0) -# -readability-redundant-declaration (new in 4.0) -# -cert-err34-c (new in 3.9) -# -cert-err58-cpp (since 3.8, for some reason did not warn before) -# -performance-unnecessary-value-param (new in 3.9) -# -google-runtime-references (new in 4.0) -# -clang-analyzer-optin.cplusplus.VirtualCall (new in 4.0) -# -clang-analyzer-core.CallAndMessage (not mentioned in release notes) -# -clang-analyzer-core.UndefinedBinaryOperatorResult (not mentioned in release notes) -# -clang-analyzer-core.uninitialized.Assign (not mentioned in release notes) -# -# TODO jbangelo: Disabled several more check on updating to clang-6.0, really should re-enable and fix -# -cppcoreguidelines-owning-memory -# -cert-dcl21-cpp -# -modernize-return-braced-init-list - -Checks: "-*,cert-*,google-*,misc-*,readability-*,clang-analyzer-*,modernize-*,performance-*,-clang-analyzer-alpha*,cppcoreguidelines-*,cert-*,-cppcoreguidelines-pro-bounds-constant-array-index,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-type-vararg,-modernize-pass-by-value,-modernize-deprecated-headers,-modernize-use-default-member-init,-modernize-redundant-void-arg,-modernize-use-using,-modernize-use-equals-delete,-modernize-use-equals-default,-modernize-use-bool-literals,-modernize-use-auto,-modernize-use-emplace,-cppcoreguidelines-special-member-functions,-cppcoreguidelines-pro-type-member-init,-readability-avoid-const-params-in-decls,-readability-non-const-parameter,-readability-redundant-member-init,-readability-redundant-declaration,-cert-err34-c,-cert-err58-cpp,-performance-unnecessary-value-param,-google-runtime-references,-clang-analyzer-optin.cplusplus.VirtualCall,-clang-analyzer-core.CallAndMessage,-clang-analyzer-core.UndefinedBinaryOperatorResult,-clang-analyzer-core.uninitialized.Assign,-cppcoreguidelines-owning-memory,-clang-analyzer-core.uninitialized.UndefReturn,-cert-dcl21-cpp,-modernize-return-braced-init-list,-cert-dcl03-c,-misc-static-assert,-cppcoreguidelines-pro-type-static-cast-downcast,-clang-analyzer-optin.performance.Padding,-cppcoreguidelines-pro-type-union-access" -HeaderFilterRegex: '.*' -AnalyzeTemporaryDtors: true -... - diff --git a/c/.gitignore b/c/.gitignore index 07eca6db0f..c57d66bd2a 100644 --- a/c/.gitignore +++ b/c/.gitignore @@ -1,3 +1,4 @@ .DS_Store .deps build*/ +.clang-tidy diff --git a/c/CMakeLists.txt b/c/CMakeLists.txt index eb3ed6d7e9..3dc93c2781 100644 --- a/c/CMakeLists.txt +++ b/c/CMakeLists.txt @@ -21,7 +21,6 @@ include(TestTargets) add_code_coverage_all_targets() # TODO: Reformatting is limited to generated files; it should be expanded to cover all files swift_setup_clang_format(PATTERNS 'include/*.h' 'test/*.c' 'test/*.h' 'test/cpp/*.cc') -swift_setup_clang_tidy(PATTERNS 'src/*.c') if(libsbp_BUILD_TESTS) find_package(Googletest) @@ -35,3 +34,6 @@ if(libsbp_BUILD_TESTS) add_subdirectory(test) endif() add_subdirectory(examples) + +swift_validate_targets() +swift_create_clang_tidy_targets() diff --git a/c/cmake/common b/c/cmake/common index a094e49076..c7c2139678 160000 --- a/c/cmake/common +++ b/c/cmake/common @@ -1 +1 @@ -Subproject commit a094e49076f7ceccae11700559e24c8a79bfcb2f +Subproject commit c7c21396787ac7b7fb7540b57449bf1cebbde253 diff --git a/c/src/v4/bootload.c b/c/src/v4/bootload.c index 37a73f5c2e..23fe1e306f 100644 --- a/c/src/v4/bootload.c +++ b/c/src/v4/bootload.c @@ -123,11 +123,11 @@ bool sbp_msg_bootloader_handshake_resp_version_set( } bool sbp_msg_bootloader_handshake_resp_version_set_raw( - sbp_msg_bootloader_handshake_resp_t *msg, const char *new_str, - size_t new_str_len, bool should_trunc, size_t *n_written) { + sbp_msg_bootloader_handshake_resp_t *msg, const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written) { return sbp_unterminated_string_set_raw( &msg->version, SBP_MSG_BOOTLOADER_HANDSHAKE_RESP_VERSION_MAX, - should_trunc, n_written, new_str, new_str_len); + should_trunc, n_written, new_buf, new_buf_len); } bool sbp_msg_bootloader_handshake_resp_version_printf( @@ -530,11 +530,11 @@ bool sbp_msg_bootloader_handshake_dep_a_handshake_set( } bool sbp_msg_bootloader_handshake_dep_a_handshake_set_raw( - sbp_msg_bootloader_handshake_dep_a_t *msg, const char *new_str, - size_t new_str_len, bool should_trunc, size_t *n_written) { + sbp_msg_bootloader_handshake_dep_a_t *msg, const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written) { return sbp_unterminated_string_set_raw( &msg->handshake, SBP_MSG_BOOTLOADER_HANDSHAKE_DEP_A_HANDSHAKE_MAX, - should_trunc, n_written, new_str, new_str_len); + should_trunc, n_written, new_buf, new_buf_len); } bool sbp_msg_bootloader_handshake_dep_a_handshake_printf( diff --git a/c/src/v4/file_io.c b/c/src/v4/file_io.c index f68d1f6411..659a2d3577 100644 --- a/c/src/v4/file_io.c +++ b/c/src/v4/file_io.c @@ -53,13 +53,13 @@ bool sbp_msg_fileio_read_req_filename_set(sbp_msg_fileio_read_req_t *msg, } bool sbp_msg_fileio_read_req_filename_set_raw(sbp_msg_fileio_read_req_t *msg, - const char *new_str, - size_t new_str_len, + const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written) { return sbp_null_terminated_string_set_raw( &msg->filename, SBP_MSG_FILEIO_READ_REQ_FILENAME_MAX, should_trunc, - n_written, new_str, new_str_len); + n_written, new_buf, new_buf_len); } bool sbp_msg_fileio_read_req_filename_printf(sbp_msg_fileio_read_req_t *msg, @@ -355,11 +355,11 @@ bool sbp_msg_fileio_read_dir_req_dirname_set(sbp_msg_fileio_read_dir_req_t *msg, } bool sbp_msg_fileio_read_dir_req_dirname_set_raw( - sbp_msg_fileio_read_dir_req_t *msg, const char *new_str, size_t new_str_len, + sbp_msg_fileio_read_dir_req_t *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written) { return sbp_null_terminated_string_set_raw( &msg->dirname, SBP_MSG_FILEIO_READ_DIR_REQ_DIRNAME_MAX, should_trunc, - n_written, new_str, new_str_len); + n_written, new_buf, new_buf_len); } bool sbp_msg_fileio_read_dir_req_dirname_printf( @@ -723,13 +723,13 @@ bool sbp_msg_fileio_remove_filename_set(sbp_msg_fileio_remove_t *msg, } bool sbp_msg_fileio_remove_filename_set_raw(sbp_msg_fileio_remove_t *msg, - const char *new_str, - size_t new_str_len, + const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written) { return sbp_null_terminated_string_set_raw( &msg->filename, SBP_MSG_FILEIO_REMOVE_FILENAME_MAX, should_trunc, - n_written, new_str, new_str_len); + n_written, new_buf, new_buf_len); } bool sbp_msg_fileio_remove_filename_printf(sbp_msg_fileio_remove_t *msg, @@ -898,13 +898,13 @@ bool sbp_msg_fileio_write_req_filename_set(sbp_msg_fileio_write_req_t *msg, } bool sbp_msg_fileio_write_req_filename_set_raw(sbp_msg_fileio_write_req_t *msg, - const char *new_str, - size_t new_str_len, + const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written) { return sbp_null_terminated_string_set_raw( &msg->filename, SBP_MSG_FILEIO_WRITE_REQ_FILENAME_MAX, should_trunc, - n_written, new_str, new_str_len); + n_written, new_buf, new_buf_len); } bool sbp_msg_fileio_write_req_filename_printf(sbp_msg_fileio_write_req_t *msg, diff --git a/c/src/v4/linux.c b/c/src/v4/linux.c index 056912fff6..94368d31d8 100644 --- a/c/src/v4/linux.c +++ b/c/src/v4/linux.c @@ -54,11 +54,11 @@ bool sbp_msg_linux_cpu_state_dep_a_cmdline_set( } bool sbp_msg_linux_cpu_state_dep_a_cmdline_set_raw( - sbp_msg_linux_cpu_state_dep_a_t *msg, const char *new_str, - size_t new_str_len, bool should_trunc, size_t *n_written) { + sbp_msg_linux_cpu_state_dep_a_t *msg, const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written) { return sbp_unterminated_string_set_raw( &msg->cmdline, SBP_MSG_LINUX_CPU_STATE_DEP_A_CMDLINE_MAX, should_trunc, - n_written, new_str, new_str_len); + n_written, new_buf, new_buf_len); } bool sbp_msg_linux_cpu_state_dep_a_cmdline_printf( @@ -278,11 +278,11 @@ bool sbp_msg_linux_mem_state_dep_a_cmdline_set( } bool sbp_msg_linux_mem_state_dep_a_cmdline_set_raw( - sbp_msg_linux_mem_state_dep_a_t *msg, const char *new_str, - size_t new_str_len, bool should_trunc, size_t *n_written) { + sbp_msg_linux_mem_state_dep_a_t *msg, const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written) { return sbp_unterminated_string_set_raw( &msg->cmdline, SBP_MSG_LINUX_MEM_STATE_DEP_A_CMDLINE_MAX, should_trunc, - n_written, new_str, new_str_len); + n_written, new_buf, new_buf_len); } bool sbp_msg_linux_mem_state_dep_a_cmdline_printf( @@ -632,11 +632,11 @@ bool sbp_msg_linux_process_socket_counts_cmdline_set( } bool sbp_msg_linux_process_socket_counts_cmdline_set_raw( - sbp_msg_linux_process_socket_counts_t *msg, const char *new_str, - size_t new_str_len, bool should_trunc, size_t *n_written) { + sbp_msg_linux_process_socket_counts_t *msg, const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written) { return sbp_unterminated_string_set_raw( &msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_COUNTS_CMDLINE_MAX, - should_trunc, n_written, new_str, new_str_len); + should_trunc, n_written, new_buf, new_buf_len); } bool sbp_msg_linux_process_socket_counts_cmdline_printf( @@ -863,11 +863,11 @@ bool sbp_msg_linux_process_socket_queues_cmdline_set( } bool sbp_msg_linux_process_socket_queues_cmdline_set_raw( - sbp_msg_linux_process_socket_queues_t *msg, const char *new_str, - size_t new_str_len, bool should_trunc, size_t *n_written) { + sbp_msg_linux_process_socket_queues_t *msg, const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written) { return sbp_unterminated_string_set_raw( &msg->cmdline, SBP_MSG_LINUX_PROCESS_SOCKET_QUEUES_CMDLINE_MAX, - should_trunc, n_written, new_str, new_str_len); + should_trunc, n_written, new_buf, new_buf_len); } bool sbp_msg_linux_process_socket_queues_cmdline_printf( @@ -1251,11 +1251,11 @@ bool sbp_msg_linux_process_fd_count_cmdline_set( } bool sbp_msg_linux_process_fd_count_cmdline_set_raw( - sbp_msg_linux_process_fd_count_t *msg, const char *new_str, - size_t new_str_len, bool should_trunc, size_t *n_written) { + sbp_msg_linux_process_fd_count_t *msg, const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written) { return sbp_unterminated_string_set_raw( &msg->cmdline, SBP_MSG_LINUX_PROCESS_FD_COUNT_CMDLINE_MAX, should_trunc, - n_written, new_str, new_str_len); + n_written, new_buf, new_buf_len); } bool sbp_msg_linux_process_fd_count_cmdline_printf( @@ -1643,13 +1643,13 @@ bool sbp_msg_linux_cpu_state_cmdline_set(sbp_msg_linux_cpu_state_t *msg, } bool sbp_msg_linux_cpu_state_cmdline_set_raw(sbp_msg_linux_cpu_state_t *msg, - const char *new_str, - size_t new_str_len, + const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written) { return sbp_unterminated_string_set_raw( &msg->cmdline, SBP_MSG_LINUX_CPU_STATE_CMDLINE_MAX, should_trunc, - n_written, new_str, new_str_len); + n_written, new_buf, new_buf_len); } bool sbp_msg_linux_cpu_state_cmdline_printf(sbp_msg_linux_cpu_state_t *msg, @@ -1888,13 +1888,13 @@ bool sbp_msg_linux_mem_state_cmdline_set(sbp_msg_linux_mem_state_t *msg, } bool sbp_msg_linux_mem_state_cmdline_set_raw(sbp_msg_linux_mem_state_t *msg, - const char *new_str, - size_t new_str_len, + const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written) { return sbp_unterminated_string_set_raw( &msg->cmdline, SBP_MSG_LINUX_MEM_STATE_CMDLINE_MAX, should_trunc, - n_written, new_str, new_str_len); + n_written, new_buf, new_buf_len); } bool sbp_msg_linux_mem_state_cmdline_printf(sbp_msg_linux_mem_state_t *msg, diff --git a/c/src/v4/logging.c b/c/src/v4/logging.c index 78425959cc..72113d780e 100644 --- a/c/src/v4/logging.c +++ b/c/src/v4/logging.c @@ -43,12 +43,12 @@ bool sbp_msg_log_text_set(sbp_msg_log_t *msg, const char *new_str, should_trunc, n_written, new_str); } -bool sbp_msg_log_text_set_raw(sbp_msg_log_t *msg, const char *new_str, - size_t new_str_len, bool should_trunc, +bool sbp_msg_log_text_set_raw(sbp_msg_log_t *msg, const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written) { return sbp_unterminated_string_set_raw(&msg->text, SBP_MSG_LOG_TEXT_MAX, - should_trunc, n_written, new_str, - new_str_len); + should_trunc, n_written, new_buf, + new_buf_len); } bool sbp_msg_log_text_printf(sbp_msg_log_t *msg, bool should_trunc, @@ -298,11 +298,11 @@ bool sbp_msg_print_dep_text_set(sbp_msg_print_dep_t *msg, const char *new_str, } bool sbp_msg_print_dep_text_set_raw(sbp_msg_print_dep_t *msg, - const char *new_str, size_t new_str_len, + const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written) { return sbp_unterminated_string_set_raw(&msg->text, SBP_MSG_PRINT_DEP_TEXT_MAX, - should_trunc, n_written, new_str, - new_str_len); + should_trunc, n_written, new_buf, + new_buf_len); } bool sbp_msg_print_dep_text_printf(sbp_msg_print_dep_t *msg, bool should_trunc, diff --git a/c/src/v4/piksi.c b/c/src/v4/piksi.c index 7ec2b8756e..dd83a64ab9 100644 --- a/c/src/v4/piksi.c +++ b/c/src/v4/piksi.c @@ -1541,12 +1541,12 @@ bool sbp_msg_command_req_command_set(sbp_msg_command_req_t *msg, } bool sbp_msg_command_req_command_set_raw(sbp_msg_command_req_t *msg, - const char *new_str, - size_t new_str_len, bool should_trunc, + const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written) { return sbp_null_terminated_string_set_raw( &msg->command, SBP_MSG_COMMAND_REQ_COMMAND_MAX, should_trunc, n_written, - new_str, new_str_len); + new_buf, new_buf_len); } bool sbp_msg_command_req_command_printf(sbp_msg_command_req_t *msg, @@ -1802,12 +1802,12 @@ bool sbp_msg_command_output_line_set(sbp_msg_command_output_t *msg, } bool sbp_msg_command_output_line_set_raw(sbp_msg_command_output_t *msg, - const char *new_str, - size_t new_str_len, bool should_trunc, + const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written) { return sbp_unterminated_string_set_raw( &msg->line, SBP_MSG_COMMAND_OUTPUT_LINE_MAX, should_trunc, n_written, - new_str, new_str_len); + new_buf, new_buf_len); } bool sbp_msg_command_output_line_printf(sbp_msg_command_output_t *msg, diff --git a/c/src/v4/string/null_terminated.c b/c/src/v4/string/null_terminated.c index 54f442d3fa..9365612958 100644 --- a/c/src/v4/string/null_terminated.c +++ b/c/src/v4/string/null_terminated.c @@ -69,13 +69,13 @@ size_t sbp_null_terminated_string_space_remaining(const sbp_string_t *s, bool sbp_null_terminated_string_set_raw(sbp_string_t *s, size_t maxlen, - bool should_trunc, size_t *n_written, const char *new_str, - size_t new_str_len) { + bool should_trunc, size_t *n_written, const char *new_buf, + size_t new_buf_len) { size_t copied; size_t truncated_len = - (maxlen - 1) > new_str_len ? new_str_len : (maxlen - 1); - size_t len = should_trunc ? truncated_len : new_str_len; - if (!sbp_string_copy_to_buf(s->data, &copied, maxlen, new_str, len)) { + (maxlen - 1) > new_buf_len ? new_buf_len : (maxlen - 1); + size_t len = should_trunc ? truncated_len : new_buf_len; + if (!sbp_string_copy_to_buf(s->data, &copied, maxlen, new_buf, len)) { return false; } diff --git a/c/src/v4/string/sbp_string.c b/c/src/v4/string/sbp_string.c index e8f2e8b0cb..3dc5357692 100644 --- a/c/src/v4/string/sbp_string.c +++ b/c/src/v4/string/sbp_string.c @@ -51,7 +51,7 @@ bool sbp_string_copy_to_buf(char *buf, size_t *copied, size_t max, return copy_str(buf, copied, max, str, n); } -bool sbp_string_vprintf_to_buf(char *buf, size_t *copied, size_t max, bool should_truncate, +bool sbp_string_vprintf_to_buf(char *buf, size_t *copied, size_t max, bool should_trunc, const char *fmt, va_list ap) { char tmp[256]; int n = vsnprintf(tmp, sizeof(tmp), fmt, ap); @@ -59,7 +59,7 @@ bool sbp_string_vprintf_to_buf(char *buf, size_t *copied, size_t max, bool shoul return false; } size_t trunc_len = (max - 1) < (size_t)n ? (max - 1) : (size_t)n; - size_t len = should_truncate ? trunc_len : (size_t)n; + size_t len = should_trunc ? trunc_len : (size_t)n; return copy_str(buf, copied, max, tmp, len); } diff --git a/c/src/v4/string/unterminated.c b/c/src/v4/string/unterminated.c index 997b6a7abc..40b0c3f9b5 100644 --- a/c/src/v4/string/unterminated.c +++ b/c/src/v4/string/unterminated.c @@ -62,11 +62,11 @@ size_t sbp_unterminated_string_space_remaining(const sbp_string_t *s, } bool sbp_unterminated_string_set_raw(sbp_string_t *s, size_t maxlen, - bool should_truncate, size_t *n_written, + bool should_trunc, size_t *n_written, const char *new_buf, size_t new_buf_len) { size_t copied; size_t truncated_len = maxlen > new_buf_len ? new_buf_len : maxlen; - size_t len = should_truncate ? truncated_len : new_buf_len; + size_t len = should_trunc ? truncated_len : new_buf_len; if (!sbp_string_copy_to_buf(s->data, &copied, maxlen + 1u, new_buf, len)) { @@ -81,8 +81,8 @@ bool sbp_unterminated_string_set_raw(sbp_string_t *s, size_t maxlen, } bool sbp_unterminated_string_set(sbp_string_t *s, size_t maxlen, - bool should_truncate, size_t *n_written, const char *new_str) { - return sbp_unterminated_string_set_raw(s, maxlen, should_truncate, n_written, new_str, sbp_strnlen(new_str, maxlen+1)); + bool should_trunc, size_t *n_written, const char *new_str) { + return sbp_unterminated_string_set_raw(s, maxlen, should_trunc, n_written, new_str, sbp_strnlen(new_str, maxlen+1)); } bool sbp_unterminated_string_vprintf(sbp_string_t *s, size_t maxlen, bool should_trunc, size_t *n_written, diff --git a/c/src/v4/system.c b/c/src/v4/system.c index b27268c9e8..afa70616a6 100644 --- a/c/src/v4/system.c +++ b/c/src/v4/system.c @@ -142,12 +142,12 @@ bool sbp_msg_dgnss_status_source_set(sbp_msg_dgnss_status_t *msg, } bool sbp_msg_dgnss_status_source_set_raw(sbp_msg_dgnss_status_t *msg, - const char *new_str, - size_t new_str_len, bool should_trunc, + const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written) { return sbp_unterminated_string_set_raw( &msg->source, SBP_MSG_DGNSS_STATUS_SOURCE_MAX, should_trunc, n_written, - new_str, new_str_len); + new_buf, new_buf_len); } bool sbp_msg_dgnss_status_source_printf(sbp_msg_dgnss_status_t *msg, @@ -690,13 +690,13 @@ bool sbp_msg_csac_telemetry_telemetry_set(sbp_msg_csac_telemetry_t *msg, } bool sbp_msg_csac_telemetry_telemetry_set_raw(sbp_msg_csac_telemetry_t *msg, - const char *new_str, - size_t new_str_len, + const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written) { return sbp_unterminated_string_set_raw( &msg->telemetry, SBP_MSG_CSAC_TELEMETRY_TELEMETRY_MAX, should_trunc, - n_written, new_str, new_str_len); + n_written, new_buf, new_buf_len); } bool sbp_msg_csac_telemetry_telemetry_printf(sbp_msg_csac_telemetry_t *msg, @@ -881,12 +881,12 @@ bool sbp_msg_csac_telemetry_labels_telemetry_labels_set( } bool sbp_msg_csac_telemetry_labels_telemetry_labels_set_raw( - sbp_msg_csac_telemetry_labels_t *msg, const char *new_str, - size_t new_str_len, bool should_trunc, size_t *n_written) { + sbp_msg_csac_telemetry_labels_t *msg, const char *new_buf, + size_t new_buf_len, bool should_trunc, size_t *n_written) { return sbp_unterminated_string_set_raw( &msg->telemetry_labels, SBP_MSG_CSAC_TELEMETRY_LABELS_TELEMETRY_LABELS_MAX, should_trunc, - n_written, new_str, new_str_len); + n_written, new_buf, new_buf_len); } bool sbp_msg_csac_telemetry_labels_telemetry_labels_printf( diff --git a/generator/sbpg/targets/resources/c/src/sbp_messages_template.c b/generator/sbpg/targets/resources/c/src/sbp_messages_template.c index 96510a0ec7..671261d912 100644 --- a/generator/sbpg/targets/resources/c/src/sbp_messages_template.c +++ b/generator/sbpg/targets/resources/c/src/sbp_messages_template.c @@ -53,9 +53,9 @@ size_t (((f.fn_prefix)))_space_remaining(const (((m.type_name))) *msg) return (((string_prefix)))_set(&msg->(((f.name))), (((f.max_items_macro))), should_trunc, n_written, new_str); } - bool (((f.fn_prefix)))_set_raw( (((-m.type_name))) *msg, const char *new_str, size_t new_str_len, bool should_trunc, size_t *n_written) + bool (((f.fn_prefix)))_set_raw( (((-m.type_name))) *msg, const char *new_buf, size_t new_buf_len, bool should_trunc, size_t *n_written) { - return (((string_prefix)))_set_raw(&msg->(((f.name))), (((f.max_items_macro))), should_trunc, n_written, new_str, new_str_len); + return (((string_prefix)))_set_raw(&msg->(((f.name))), (((f.max_items_macro))), should_trunc, n_written, new_buf, new_buf_len); }