mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 07:33:34 +08:00
parameters lib convert to c++ (#10267)
This commit is contained in:
@@ -35,7 +35,7 @@ set(srcs
|
||||
test_adc.c
|
||||
test_autodeclination.cpp
|
||||
test_bezierQuad.cpp
|
||||
test_bson.c
|
||||
test_bson.cpp
|
||||
test_conv.cpp
|
||||
test_dataman.c
|
||||
test_file.c
|
||||
|
||||
@@ -98,7 +98,7 @@ encode(bson_encoder_t encoder)
|
||||
}
|
||||
|
||||
static int
|
||||
decode_callback(bson_decoder_t decoder, void *private, bson_node_t node)
|
||||
decode_callback(bson_decoder_t decoder, void *priv, bson_node_t node)
|
||||
{
|
||||
unsigned len;
|
||||
|
||||
@@ -194,7 +194,7 @@ decode_callback(bson_decoder_t decoder, void *private, bson_node_t node)
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (strcmp(sbuf, sample_string)) {
|
||||
if (strcmp(sbuf, sample_string) != 0) {
|
||||
PX4_ERR("FAIL: decoder: string1 value '%s', expected '%s'", sbuf, sample_string);
|
||||
return 1;
|
||||
}
|
||||
@@ -268,7 +268,7 @@ test_bson(int argc, char *argv[])
|
||||
int len;
|
||||
|
||||
/* encode data to a memory buffer */
|
||||
if (bson_encoder_init_buf(&encoder, NULL, 0)) {
|
||||
if (bson_encoder_init_buf(&encoder, nullptr, 0)) {
|
||||
PX4_ERR("FAIL: bson_encoder_init_buf");
|
||||
return 1;
|
||||
}
|
||||
@@ -283,13 +283,13 @@ test_bson(int argc, char *argv[])
|
||||
|
||||
buf = bson_encoder_buf_data(&encoder);
|
||||
|
||||
if (buf == NULL) {
|
||||
if (buf == nullptr) {
|
||||
PX4_ERR("FAIL: bson_encoder_buf_data");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* now test-decode it */
|
||||
if (bson_decoder_init_buf(&decoder, buf, len, decode_callback, NULL)) {
|
||||
if (bson_decoder_init_buf(&decoder, buf, len, decode_callback, nullptr)) {
|
||||
PX4_ERR("FAIL: bson_decoder_init_buf");
|
||||
return 1;
|
||||
}
|
||||
Reference in New Issue
Block a user