fix clang-tidy-readability-string-compare warnings

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@7828 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 77d58728f5cc4c89c7d31f7552b564a30263f70d
Former-commit-id: db634b09e7c52e447d51769d3efe7dacd88e03fb
This commit is contained in:
iobyte 2021-12-17 01:04:15 +00:00
parent 91f3bd7c99
commit 1b8fe61ed5
5 changed files with 11 additions and 17 deletions

View file

@ -175,7 +175,7 @@ void ForceFeedbackManager::saveConfiguration(){
}
//are we saving car specific settings o global ones?
if ( iterator->first.compare("globalEffect") == 0 ){
if ( iterator->first == "globalEffect"){
//global settings
//save global setting in the default section
effectPath.append("/forceFeedback/default/effectsConfig/");

View file

@ -309,15 +309,15 @@ void OSGPLOT::update(tSituation *s, const SDFrameInfo* frameInfo,
{
//get x value
float x = 0;
if(this->Xdata.compare("time") == 0) x = (float)GfTimeClock();
if(this->Xdata == "time") x = (float)GfTimeClock();
//get y value
float y = 0;
if(this->Ydata.compare("fps") == 0) y = (float)frameInfo->fInstFps;
else if(this->Ydata.compare("carspeed") == 0) y = (float)currCar->_speed_x * 3.6;
else if(this->Ydata.compare("fpsavverrange") == 0) y = (float)frameInfo->fAvgFps;
else if(this->Ydata.compare("carbracketemp") == 0) y = (float)currCar->_brakeTemp(0);
else if(this->Ydata.compare("forcefeedback") == 0) y = (float)forceFeedback.force;
if(this->Ydata == "fps") y = (float)frameInfo->fInstFps;
else if(this->Ydata == "carspeed") y = (float)currCar->_speed_x * 3.6;
else if(this->Ydata == "fpsavverrange") y = (float)frameInfo->fAvgFps;
else if(this->Ydata == "carbracketemp") y = (float)currCar->_brakeTemp(0);
else if(this->Ydata == "forcefeedback") y = (float)forceFeedback.force;
//get z value
float z=(float)0;

View file

@ -117,7 +117,7 @@ inline bool sortByScore(const tReStandings& a, const tReStandings& b)
//for find()
inline bool operator ==(const tReStandings& a, const std::string &b)
{
return !a.drvName.compare(b);
return a.drvName == b;
}
void

View file

@ -124,7 +124,7 @@ inline bool sortByScore(const tReStandings& a, const tReStandings& b)
//for find()
inline bool operator ==(const tReStandings& a, const std::string &b)
{
return !a.drvName.compare(b);
return a.drvName == b;
}
void

View file

@ -93,10 +93,7 @@ onSaveForceFeedbackConfig(void * /* dummy */)
GfLogInfo("%s%s.\n", editbox->effectTypeName.c_str(), editbox->effectParameterName.c_str());
if (
editbox->effectParameterName.compare("enabled") == 0
|| editbox->effectParameterName.compare("reverse") == 0
){
if (editbox->effectParameterName == "enabled" || editbox->effectParameterName == "reverse"){
forceFeedback.effectsConfig[editbox->effectTypeName.c_str()][editbox->effectParameterName.c_str()] =
(int)GfuiCheckboxIsChecked(ScrHandle, (int)editbox->id);
@ -189,10 +186,7 @@ ForceFeedbackMenuInit(void *prevMenu, void *nextMenu, int curPlayerIdx, const st
GfLogInfo("Exist: %s\n", editBoxName.c_str());
//if (iterator2->first.c_str() == "enabled"){
if (
iterator2->first.compare("enabled") == 0
|| iterator2->first.compare("reverse") == 0
){
if (iterator2->first == "enabled" || iterator2->first == "reverse"){
int checkboxId =
GfuiMenuCreateCheckboxControl(ScrHandle, menuXMLDescHdle, editBoxName.c_str(),