diff --git a/src/apps/terminal/AppearPrefView.cpp b/src/apps/terminal/AppearPrefView.cpp index 49ab99168db..7da4e58cd45 100644 --- a/src/apps/terminal/AppearPrefView.cpp +++ b/src/apps/terminal/AppearPrefView.cpp @@ -225,8 +225,8 @@ AppearancePrefView::AttachedToWindow() _SetCurrentColorScheme(fColorSchemeField); bool enableCustomColors = - !strcmp(fColorSchemeField->Menu()->FindMarked()->Label(), - gCustomColorScheme.name); + strcmp(fColorSchemeField->Menu()->FindMarked()->Label(), + gCustomColorScheme.name) == 0; _EnableCustomColors(enableCustomColors); } @@ -250,18 +250,18 @@ AppearancePrefView::MessageReceived(BMessage* msg) = pref->getString(PREF_HALF_FONT_FAMILY); const char* currentStyle = pref->getString(PREF_HALF_FONT_STYLE); - if (currentFamily == NULL || strcmp(currentFamily, family) - || currentStyle == NULL || strcmp(currentStyle, style)) { + if (currentFamily == NULL || strcmp(currentFamily, family) != 0 + || currentStyle == NULL || strcmp(currentStyle, style) != 0) { pref->setString(PREF_HALF_FONT_FAMILY, family); pref->setString(PREF_HALF_FONT_STYLE, style); modified = true; } break; } + case MSG_HALF_SIZE_CHANGED: if (strcmp(PrefHandler::Default()->getString(PREF_HALF_FONT_SIZE), - fFontSize->Menu()->FindMarked()->Label())) { - + fFontSize->Menu()->FindMarked()->Label()) != 0) { PrefHandler::Default()->setString(PREF_HALF_FONT_SIZE, fFontSize->Menu()->FindMarked()->Label()); modified = true; @@ -405,7 +405,7 @@ AppearancePrefView::_SetCurrentColorScheme(BMenuField* field) for (int32 i = 0; i < fColorSchemeField->Menu()->CountItems(); i++) { BMenuItem* item = fColorSchemeField->Menu()->ItemAt(i); - if (!strcmp(item->Label(), currentSchemeName)) { + if (strcmp(item->Label(), currentSchemeName) == 0) { item->SetMarked(true); break; } @@ -440,8 +440,8 @@ AppearancePrefView::_MakeFontMenu(uint32 command, BMenuItem* item = new BMenuItem(itemLabel, message); menu->AddItem(item); - if (!strcmp(defaultFamily, family) - && !strcmp(defaultStyle, style)) + if (strcmp(defaultFamily, family) == 0 + && strcmp(defaultStyle, style) == 0) item->SetMarked(true); } } @@ -502,7 +502,7 @@ AppearancePrefView::_MakeMenu(uint32 msg, const char** items, int32 i = 0; while (*items) { - if (!strcmp((*items), "")) + if (strcmp((*items), "") == 0) menu->AddSeparatorItem(); else { BMessage* message = new BMessage(msg); @@ -529,7 +529,7 @@ AppearancePrefView::_MakeColorSchemeMenu(uint32 msg, const color_scheme** items, int32 i = 0; while (*items) { - if (!strcmp((*items)->name, "")) + if (strcmp((*items)->name, "") == 0) menu->AddSeparatorItem(); else { BMessage* message = new BMessage(msg); diff --git a/src/apps/terminal/PrefHandler.cpp b/src/apps/terminal/PrefHandler.cpp index b1e477870b8..41f96bf0db4 100644 --- a/src/apps/terminal/PrefHandler.cpp +++ b/src/apps/terminal/PrefHandler.cpp @@ -242,7 +242,7 @@ PrefHandler::getBool(const char *key) if (value == NULL) return false; - return !strcmp(value, PREF_TRUE); + return strcmp(value, PREF_TRUE) == 0; } @@ -352,7 +352,7 @@ PrefHandler::_ConfirmFont(const char *key, const BFont *fallback) if (get_font_family(i, &family) != B_OK) continue; - if (!strcmp(family, font)) { + if (strcmp(family, font) == 0) { // found font family: we can safely use this font return; } diff --git a/src/apps/terminal/TermApp.cpp b/src/apps/terminal/TermApp.cpp index 1f8cfb62cd0..002dd5dd78f 100644 --- a/src/apps/terminal/TermApp.cpp +++ b/src/apps/terminal/TermApp.cpp @@ -200,7 +200,7 @@ TermApp::RefsReceived(BMessage* message) info.GetType(mimetype); // if App opened by Pref file - if (!strcmp(mimetype, PREFFILE_MIMETYPE)) { + if (strcmp(mimetype, PREFFILE_MIMETYPE) == 0) { BEntry ent(&ref); BPath path(&ent); @@ -209,7 +209,7 @@ TermApp::RefsReceived(BMessage* message) } // if App opened by Shell Script - if (!strcmp(mimetype, "text/x-haiku-shscript")){ + if (strcmp(mimetype, "text/x-haiku-shscript") == 0) { // Not implemented. // beep(); return; diff --git a/src/apps/terminal/TermView.cpp b/src/apps/terminal/TermView.cpp index e0fbb41eb85..2346a591b75 100644 --- a/src/apps/terminal/TermView.cpp +++ b/src/apps/terminal/TermView.cpp @@ -1862,7 +1862,8 @@ TermView::MessageReceived(BMessage *msg) int32 encodingID; BMessage specifier; if (msg->GetCurrentSpecifier(&i, &specifier) == B_OK - && !strcmp("encoding", specifier.FindString("property", i))) { + && !strcmp("encoding", + specifier.FindString("property", i)) == 0) { msg->FindInt32 ("data", &encodingID); SetEncoding(encodingID); msg->SendReply(B_REPLY); @@ -1877,11 +1878,13 @@ TermView::MessageReceived(BMessage *msg) int32 i; BMessage specifier; if (msg->GetCurrentSpecifier(&i, &specifier) == B_OK - && !strcmp("encoding", specifier.FindString("property", i))) { + && strcmp("encoding", + specifier.FindString("property", i)) == 0) { BMessage reply(B_REPLY); reply.AddInt32("result", Encoding()); msg->SendReply(&reply); - } else if (!strcmp("tty", specifier.FindString("property", i))) { + } else if (strcmp("tty", + specifier.FindString("property", i)) == 0) { BMessage reply(B_REPLY); reply.AddString("result", TerminalName()); msg->SendReply(&reply);