Skip to content

Commit

Permalink
Pull request suggestions for commit smartdevicelink#1
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherniev committed Feb 6, 2017
1 parent 95e3286 commit 07e4cce
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,6 @@ bool SetGlobalPropertiesRequest::ValidateConditionalMandatoryParameters(

bool SetGlobalPropertiesRequest::IsWhiteSpaceExist() {
LOG4CXX_AUTO_TRACE(logger_);
const char* str;

const smart_objects::SmartObject& msg_params =
(*message_)[strings::msg_params];
Expand All @@ -456,6 +455,7 @@ bool SetGlobalPropertiesRequest::IsWhiteSpaceExist() {
smart_objects::SmartArray::const_iterator it_hp = hp_array->begin();
smart_objects::SmartArray::const_iterator it_hp_end = hp_array->end();

const char* str;
for (; it_hp != it_hp_end; ++it_hp) {
str = (*it_hp)[strings::text].asCharArray();
if (strlen(str) && !CheckSyntax(str)) {
Expand All @@ -472,6 +472,7 @@ bool SetGlobalPropertiesRequest::IsWhiteSpaceExist() {
smart_objects::SmartArray::const_iterator it_tp = tp_array->begin();
smart_objects::SmartArray::const_iterator it_tp_end = tp_array->end();

const char* str;
for (; it_tp != it_tp_end; ++it_tp) {
str = (*it_tp)[strings::text].asCharArray();
if (strlen(str) && !CheckSyntax(str)) {
Expand All @@ -488,6 +489,7 @@ bool SetGlobalPropertiesRequest::IsWhiteSpaceExist() {
smart_objects::SmartArray::const_iterator it_vh = vh_array->begin();
smart_objects::SmartArray::const_iterator it_vh_end = vh_array->end();

const char* str;
for (; it_vh != it_vh_end; ++it_vh) {
str = (*it_vh)[strings::text].asCharArray();
if (!CheckSyntax(str)) {
Expand All @@ -507,23 +509,24 @@ bool SetGlobalPropertiesRequest::IsWhiteSpaceExist() {
}

if (msg_params.keyExists(strings::menu_icon)) {
str = msg_params[strings::menu_icon][strings::value].asCharArray();
const char* str =
msg_params[strings::menu_icon][strings::value].asCharArray();
if (!CheckSyntax(str)) {
LOG4CXX_ERROR(logger_, "Invalid menu_icon value syntax check failed");
return true;
}
}

if (msg_params.keyExists(strings::vr_help_title)) {
str = msg_params[strings::vr_help_title].asCharArray();
const char* str = msg_params[strings::vr_help_title].asCharArray();
if (!CheckSyntax(str)) {
LOG4CXX_ERROR(logger_, "Invalid vr_help_title value syntax check failed");
return true;
}
}

if (msg_params.keyExists(strings::menu_title)) {
str = msg_params[strings::menu_title].asCharArray();
const char* str = msg_params[strings::menu_title].asCharArray();
if (!CheckSyntax(str)) {
LOG4CXX_ERROR(logger_, "Invalid menu_title value syntax check failed");
return true;
Expand All @@ -540,6 +543,7 @@ bool SetGlobalPropertiesRequest::IsWhiteSpaceExist() {
smart_objects::SmartArray::const_iterator it_lcl = lcl_array->begin();
smart_objects::SmartArray::const_iterator it_lcl_end = lcl_array->end();

const char* str;
for (; it_lcl != it_lcl_end; ++it_lcl) {
str = (*it_lcl).asCharArray();
if (!CheckSyntax(str)) {
Expand All @@ -553,7 +557,7 @@ bool SetGlobalPropertiesRequest::IsWhiteSpaceExist() {

if (msg_params[strings::keyboard_properties].keyExists(
strings::auto_complete_text)) {
str =
const char* str =
msg_params[strings::keyboard_properties][strings::auto_complete_text]
.asCharArray();

Expand All @@ -574,6 +578,7 @@ bool SetGlobalPropertiesRequest::IsWhiteSpaceExist() {
smart_objects::SmartArray::const_iterator it_acl = acl_array->begin();
smart_objects::SmartArray::const_iterator it_acl_end = acl_array->end();

const char* str;
for (; it_acl != it_acl_end; ++it_acl) {
str = (*it_acl).asCharArray();
if (!CheckSyntax(str)) {
Expand Down

0 comments on commit 07e4cce

Please sign in to comment.