summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorypostolov <ypostolov@luxoft.com>2020-02-19 12:57:00 +0200
committeryurii <ypostolov>2020-03-26 15:02:49 +0200
commit9a5fd54723f107d621b976d7fb98f746b208812b (patch)
tree302157750a0de67d68ad7497e60a7fa48f22b84e
parent91d94fd27998e37ca34e291310b032be76698c44 (diff)
downloadsdl_core-9a5fd54723f107d621b976d7fb98f746b208812b.tar.gz
fixed issue invalidPrintfArgType_sint
-rw-r--r--src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc3
-rw-r--r--src/components/application_manager/src/request_controller.cc3
-rw-r--r--src/components/application_manager/test/resumption/resumption_data_test.cc15
3 files changed, 7 insertions, 14 deletions
diff --git a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc
index 346479ef1f..df7847fc2e 100644
--- a/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc
+++ b/src/components/application_manager/rpc_plugins/sdl_rpc_plugin/src/commands/mobile/on_system_request_notification.cc
@@ -173,8 +173,7 @@ void OnSystemRequestNotification::AddHeader(BinaryMessage& message) const {
}
char timeout_str[24];
- // cppcheck-suppress invalidPrintfArgType_sint
- if (0 > sprintf(timeout_str, "%d", timeout)) {
+ if (0 > sprintf(timeout_str, "%u", timeout)) {
memset(timeout_str, 0, sizeof(timeout_str));
}
diff --git a/src/components/application_manager/src/request_controller.cc b/src/components/application_manager/src/request_controller.cc
index aea31a0bff..9e56e751c6 100644
--- a/src/components/application_manager/src/request_controller.cc
+++ b/src/components/application_manager/src/request_controller.cc
@@ -81,8 +81,7 @@ void RequestController::InitializeThreadpool() {
pool_state_ = TPoolState::STARTED;
char name[50];
for (uint32_t i = 0; i < pool_size_; i++) {
- // cppcheck-suppress invalidPrintfArgType_sint
- snprintf(name, sizeof(name) / sizeof(name[0]), "AM Pool %d", i);
+ snprintf(name, sizeof(name) / sizeof(name[0]), "AM Pool %u", i);
pool_.push_back(threads::CreateThread(name, new Worker(this)));
pool_[i]->start();
LOG4CXX_DEBUG(logger_, "Request thread initialized: " << name);
diff --git a/src/components/application_manager/test/resumption/resumption_data_test.cc b/src/components/application_manager/test/resumption/resumption_data_test.cc
index 96e6d390dd..a1ddf2cec2 100644
--- a/src/components/application_manager/test/resumption/resumption_data_test.cc
+++ b/src/components/application_manager/test/resumption/resumption_data_test.cc
@@ -149,8 +149,7 @@ void ResumptionDataTest::CheckChoiceSet(sm::SmartObject& res_list) {
sm::SmartObject command = res_list[i][am::strings::choice_set][j];
EXPECT_EQ(i + j, command[am::strings::choice_id].asUInt());
char numb[12];
- // cppcheck-suppress invalidPrintfArgType_sint
- std::snprintf(numb, 12, "%d", i + j);
+ std::snprintf(numb, 12, "%u", i + j);
std::string test_choice =
(*test_choiceset_map[i])[am::strings::choice_set][j]
[am::strings::vr_commands][0]
@@ -490,8 +489,7 @@ void ResumptionDataTest::SetCommands() {
sm::SmartObject sm_icon;
for (uint32_t i = 0; i < kCountOfCommands_; ++i) {
char numb[12];
- // cppcheck-suppress invalidPrintfArgType_sint
- std::snprintf(numb, 12, "%d", i);
+ std::snprintf(numb, 12, "%u", i);
sm_comm[am::strings::cmd_id] = i;
sm_comm[am::strings::menu_params][am::strings::position] = i;
sm_comm[am::strings::menu_params][am::hmi_request::parent_id] = i;
@@ -500,8 +498,7 @@ void ResumptionDataTest::SetCommands() {
for (uint32_t j = 0; j < kCountOfChoice_; ++j) {
char vr[12];
- // cppcheck-suppress invalidPrintfArgType_sint
- std::snprintf(vr, 12, "%d", i + j);
+ std::snprintf(vr, 12, "%u", i + j);
vr_commandsvector[j] = "VrCommand " + std::string(vr);
}
sm_comm[am::strings::vr_commands] = vr_commandsvector;
@@ -519,8 +516,7 @@ void ResumptionDataTest::SetSubmenues() {
sm::SmartObject sm_comm;
for (uint32_t i = 10; i < kCountOfSubmenues_ + 10; ++i) {
char numb[12];
- // cppcheck-suppress invalidPrintfArgType_sint
- std::snprintf(numb, 12, "%d", i);
+ std::snprintf(numb, 12, "%u", i);
sm_comm[am::strings::menu_id] = i;
sm_comm[am::strings::position] = i;
sm_comm[am::strings::menu_name] = "SubMenu" + std::string(numb);
@@ -539,8 +535,7 @@ void ResumptionDataTest::SetChoiceSet() {
for (uint32_t i = 0; i < kCountOfChoiceSets_; ++i) {
for (uint32_t j = 0; j < kCountOfChoice_; ++j) {
char numb[12];
- // cppcheck-suppress invalidPrintfArgType_sint
- std::snprintf(numb, 12, "%d", i + j);
+ std::snprintf(numb, 12, "%u", i + j);
choice[am::strings::choice_id] = i + j;
vr_commandsvector[0] = "ChoiceSet VrCommand " + std::string(numb);