diff options
author | nyamatongwe <unknown> | 2002-01-10 23:11:57 +0000 |
---|---|---|
committer | nyamatongwe <unknown> | 2002-01-10 23:11:57 +0000 |
commit | 9fbdf629124454ddfc8ff9fc10ed4841d2ef8fba (patch) | |
tree | ccf8d10998c2a32af1e3a8e66cf75d93669fc6a1 | |
parent | d43d89fa81e0b04b762c2a9d58cb3d86d0400ec2 (diff) | |
download | scintilla-mirror-9fbdf629124454ddfc8ff9fc10ed4841d2ef8fba.tar.gz |
Made code bool-safe and turned Visual C++ warning 4800 back on.
-rw-r--r-- | gtk/ScintillaGTK.cxx | 22 | ||||
-rw-r--r-- | include/Platform.h | 2 | ||||
-rw-r--r-- | src/Editor.cxx | 84 | ||||
-rw-r--r-- | src/LexAVE.cxx | 2 | ||||
-rw-r--r-- | src/LexBaan.cxx | 6 | ||||
-rw-r--r-- | src/LexBullant.cxx | 2 | ||||
-rw-r--r-- | src/LexCPP.cxx | 6 | ||||
-rw-r--r-- | src/LexHTML.cxx | 8 | ||||
-rw-r--r-- | src/LexPascal.cxx | 2 | ||||
-rw-r--r-- | src/LexPython.cxx | 4 | ||||
-rw-r--r-- | src/LexRuby.cxx | 2 | ||||
-rw-r--r-- | src/LexSQL.cxx | 2 | ||||
-rw-r--r-- | src/ScintillaBase.cxx | 10 | ||||
-rw-r--r-- | win32/PlatWin.cxx | 6 | ||||
-rw-r--r-- | win32/ScintillaWin.cxx | 12 |
15 files changed, 87 insertions, 83 deletions
diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index d193cfae4..2a48f7f53 100644 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -898,7 +898,7 @@ void ScintillaGTK::ReceivedSelection(GtkSelectionData *selection_data) { } // Check for "\n\0" ending to string indicating that selection is rectangular #if PLAT_GTK_WIN32 - bool isRectangular = ::IsClipboardFormatAvailable(cfColumnSelect); + bool isRectangular = ::IsClipboardFormatAvailable(cfColumnSelect) != 0; #else bool isRectangular = ((selection_data->length > 1) && (ptr[selection_data->length - 1] == 0 && ptr[selection_data->length - 2] == '\n')); @@ -925,7 +925,7 @@ void ScintillaGTK::ReceivedDrop(GtkSelectionData *selection_data) { char *ptr = reinterpret_cast<char *>(selection_data->data); // 3rd argument is false because the deletion of the moved data is handle by GetSelection #if PLAT_GTK_WIN32 - bool isRectangular = ::IsClipboardFormatAvailable(cfColumnSelect); + bool isRectangular = ::IsClipboardFormatAvailable(cfColumnSelect) != 0; #else bool isRectangular = ((selection_data->length > 1) && (ptr[selection_data->length - 1] == 0 && ptr[selection_data->length - 2] == '\n')); @@ -1071,7 +1071,7 @@ gint ScintillaGTK::PressThis(GdkEventButton *event) { return FALSE; } - bool ctrl = event->state & GDK_CONTROL_MASK; + bool ctrl = (event->state & GDK_CONTROL_MASK) != 0; gtk_widget_grab_focus(PWidget(wMain)); if (event->button == 1) { @@ -1082,9 +1082,9 @@ gint ScintillaGTK::PressThis(GdkEventButton *event) { // Instead of sending literal modifiers use control instead of alt // This is because all the window managers seem to grab alt + click for moving ButtonDown(pt, event->time, - event->state & GDK_SHIFT_MASK, - event->state & GDK_CONTROL_MASK, - event->state & GDK_CONTROL_MASK); + (event->state & GDK_SHIFT_MASK) != 0, + (event->state & GDK_CONTROL_MASK) != 0, + (event->state & GDK_CONTROL_MASK) != 0); } else if (event->button == 2) { // Grab the primary selection if it exists Position pos = PositionFromLocation(pt); @@ -1143,7 +1143,7 @@ gint ScintillaGTK::MouseRelease(GtkWidget *widget, GdkEventButton *event) { // If mouse released on scroll bar then the position is relative to the // scrollbar, not the drawing window so just repeat the most recent point. pt = sciThis->ptMouseLast; - sciThis->ButtonUp(pt, event->time, event->state & 4); + sciThis->ButtonUp(pt, event->time, (event->state & 4) != 0); } return FALSE; } @@ -1306,9 +1306,9 @@ gint ScintillaGTK::KeyPress(GtkWidget *widget, GdkEventKey *event) { ScintillaGTK *sciThis = ScintillaFromWidget(widget); //Platform::DebugPrintf("SC-key: %d %x [%s]\n", // event->keyval, event->state, (event->length > 0) ? event->string : "empty"); - bool shift = event->state & GDK_SHIFT_MASK; - bool ctrl = event->state & GDK_CONTROL_MASK; - bool alt = event->state & GDK_MOD1_MASK; + bool shift = (event->state & GDK_SHIFT_MASK) != 0; + bool ctrl = (event->state & GDK_CONTROL_MASK) != 0; + bool alt = (event->state & GDK_MOD1_MASK) != 0; int key = event->keyval; if (ctrl && (key < 128)) key = toupper(key); @@ -1322,7 +1322,7 @@ gint ScintillaGTK::KeyPress(GtkWidget *widget, GdkEventKey *event) { key = KeyTranslate(key); bool consumed = false; - int added = sciThis->KeyDown(key, shift, ctrl, alt, &consumed); + bool added = sciThis->KeyDown(key, shift, ctrl, alt, &consumed) != 0; if (!consumed) consumed = added; //Platform::DebugPrintf("SK-key: %d %x %x\n",event->keyval, event->state, consumed); diff --git a/include/Platform.h b/include/Platform.h index b3cfcfe66..2d082053b 100644 --- a/include/Platform.h +++ b/include/Platform.h @@ -447,7 +447,7 @@ public: // Shut up annoying Visual C++ warnings: #ifdef _MSC_VER -#pragma warning(disable: 4244 4309 4514 4710 4800) +#pragma warning(disable: 4244 4309 4514 4710) #endif #endif diff --git a/src/Editor.cxx b/src/Editor.cxx index 44df21c99..8c4a5cb9b 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -2930,10 +2930,10 @@ long Editor::FindText( TextToFind *ft = reinterpret_cast<TextToFind *>(lParam); int lengthFound = strlen(ft->lpstrText); int pos = pdoc->FindText(ft->chrg.cpMin, ft->chrg.cpMax, ft->lpstrText, - wParam & SCFIND_MATCHCASE, - wParam & SCFIND_WHOLEWORD, - wParam & SCFIND_WORDSTART, - wParam & SCFIND_REGEXP, + (wParam & SCFIND_MATCHCASE) != 0, + (wParam & SCFIND_WHOLEWORD) != 0, + (wParam & SCFIND_WORDSTART) != 0, + (wParam & SCFIND_REGEXP) != 0, &lengthFound); if (pos != -1) { ft->chrgText.cpMin = pos; @@ -2973,17 +2973,17 @@ long Editor::SearchText( int lengthFound = strlen(txt); if (iMessage == SCI_SEARCHNEXT) { pos = pdoc->FindText(searchAnchor, pdoc->Length(), txt, - wParam & SCFIND_MATCHCASE, - wParam & SCFIND_WHOLEWORD, - wParam & SCFIND_WORDSTART, - wParam & SCFIND_REGEXP, + (wParam & SCFIND_MATCHCASE) != 0, + (wParam & SCFIND_WHOLEWORD) != 0, + (wParam & SCFIND_WORDSTART) != 0, + (wParam & SCFIND_REGEXP) != 0, &lengthFound); } else { pos = pdoc->FindText(searchAnchor, 0, txt, - wParam & SCFIND_MATCHCASE, - wParam & SCFIND_WHOLEWORD, - wParam & SCFIND_WORDSTART, - wParam & SCFIND_REGEXP, + (wParam & SCFIND_MATCHCASE) != 0, + (wParam & SCFIND_WHOLEWORD) != 0, + (wParam & SCFIND_WORDSTART) != 0, + (wParam & SCFIND_REGEXP) != 0, &lengthFound); } @@ -3001,10 +3001,10 @@ long Editor::SearchText( long Editor::SearchInTarget(const char *text, int length) { int lengthFound = length; int pos = pdoc->FindText(targetStart, targetEnd, text, - searchFlags & SCFIND_MATCHCASE, - searchFlags & SCFIND_WHOLEWORD, - searchFlags & SCFIND_WORDSTART, - searchFlags & SCFIND_REGEXP, + (searchFlags & SCFIND_MATCHCASE) != 0, + (searchFlags & SCFIND_WHOLEWORD) != 0, + (searchFlags & SCFIND_WORDSTART) != 0, + (searchFlags & SCFIND_REGEXP) != 0, &lengthFound); if (pos != -1) { targetStart = pos; @@ -3979,7 +3979,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { break; case SCI_SETREADONLY: - pdoc->SetReadOnly(wParam); + pdoc->SetReadOnly(wParam != 0); return 1; case SCI_GETREADONLY: @@ -4022,12 +4022,12 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { } case SCI_HIDESELECTION: - hideSelection = wParam; + hideSelection = wParam != 0; Redraw(); break; case SCI_FORMATRANGE: - return FormatRange(wParam, reinterpret_cast<RangeToFormat *>(lParam)); + return FormatRange(wParam != 0, reinterpret_cast<RangeToFormat *>(lParam)); case SCI_GETMARGINLEFT: return vs.leftMarginWidth; @@ -4092,7 +4092,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { return 0; case SCI_SETUNDOCOLLECTION: - pdoc->SetUndoCollection(wParam); + pdoc->SetUndoCollection(wParam != 0); return 0; case SCI_GETUNDOCOLLECTION: @@ -4275,7 +4275,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { break; case SCI_SETBUFFEREDDRAW: - bufferedDraw = wParam; + bufferedDraw = wParam != 0; break; case SCI_GETBUFFEREDDRAW: @@ -4299,7 +4299,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { return pdoc->indentInChars; case SCI_SETUSETABS: - pdoc->useTabs = wParam; + pdoc->useTabs = wParam != 0; InvalidateStyleRedraw(); break; @@ -4317,14 +4317,14 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { return pdoc->GetLineIndentPosition(wParam); case SCI_SETTABINDENTS: - pdoc->tabIndents = wParam; + pdoc->tabIndents = wParam != 0; break; case SCI_GETTABINDENTS: return pdoc->tabIndents; case SCI_SETBACKSPACEUNINDENTS: - pdoc->backspaceUnindents = wParam; + pdoc->backspaceUnindents = wParam != 0; break; case SCI_GETBACKSPACEUNINDENTS: @@ -4359,7 +4359,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { return pdoc->GetColumn(wParam); case SCI_SETHSCROLLBAR : - horizontalScrollBarVisible = wParam; + horizontalScrollBarVisible = wParam != 0; SetScrollBars(); ReconfigureScrollBars(); break; @@ -4368,7 +4368,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { return horizontalScrollBarVisible; case SCI_SETINDENTATIONGUIDES: - vs.viewIndentationGuides = wParam; + vs.viewIndentationGuides = wParam != 0; Redraw(); break; @@ -4396,7 +4396,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { return pdoc->dbcsCodePage; case SCI_SETUSEPALETTE: - palette.allowRealization = wParam; + palette.allowRealization = wParam != 0; InvalidateStyleRedraw(); break; @@ -4497,7 +4497,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { case SCI_SETMARGINSENSITIVEN: if (ValidMargin(wParam)) { - vs.ms[wParam].sensitive = lParam; + vs.ms[wParam].sensitive = lParam != 0; InvalidateStyleRedraw(); } break; @@ -4527,19 +4527,19 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { break; case SCI_STYLESETBOLD: if (wParam <= STYLE_MAX) { - vs.styles[wParam].bold = lParam; + vs.styles[wParam].bold = lParam != 0; InvalidateStyleRedraw(); } break; case SCI_STYLESETITALIC: if (wParam <= STYLE_MAX) { - vs.styles[wParam].italic = lParam; + vs.styles[wParam].italic = lParam != 0; InvalidateStyleRedraw(); } break; case SCI_STYLESETEOLFILLED: if (wParam <= STYLE_MAX) { - vs.styles[wParam].eolFilled = lParam; + vs.styles[wParam].eolFilled = lParam != 0; InvalidateStyleRedraw(); } break; @@ -4559,7 +4559,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { break; case SCI_STYLESETUNDERLINE: if (wParam <= STYLE_MAX) { - vs.styles[wParam].underline = lParam; + vs.styles[wParam].underline = lParam != 0; InvalidateStyleRedraw(); } break; @@ -4577,13 +4577,13 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { break; case SCI_STYLESETVISIBLE: if (wParam <= STYLE_MAX) { - vs.styles[wParam].visible = lParam; + vs.styles[wParam].visible = lParam != 0; InvalidateStyleRedraw(); } break; case SCI_STYLESETCHANGEABLE: if (wParam <= STYLE_MAX) { - vs.styles[wParam].changeable = lParam; + vs.styles[wParam].changeable = lParam != 0; InvalidateStyleRedraw(); } break; @@ -4611,7 +4611,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { case SCI_GETCARETLINEVISIBLE: return vs.showCaretLineBackground; case SCI_SETCARETLINEVISIBLE: - vs.showCaretLineBackground = wParam; + vs.showCaretLineBackground = wParam != 0; InvalidateStyleRedraw(); break; case SCI_GETCARETLINEBACK: @@ -4661,7 +4661,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { return cs.GetVisible(wParam); case SCI_SETFOLDEXPANDED: - if (cs.SetExpanded(wParam, lParam)) { + if (cs.SetExpanded(wParam, lParam != 0)) { RedrawSelMargin(); } break; @@ -4708,13 +4708,13 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { return LinesOnScreen(); case SCI_SETSELFORE: - vs.selforeset = wParam; + vs.selforeset = wParam != 0; vs.selforeground.desired = ColourDesired(lParam); InvalidateStyleRedraw(); break; case SCI_SETSELBACK: - vs.selbackset = wParam; + vs.selbackset = wParam != 0; vs.selbackground.desired = ColourDesired(lParam); InvalidateStyleRedraw(); break; @@ -4844,7 +4844,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { return vs.viewEOL; case SCI_SETVIEWEOL: - vs.viewEOL = wParam; + vs.viewEOL = wParam != 0; Redraw(); break; @@ -4917,14 +4917,14 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { return (selType == selRectangle) ? 1 : 0; case SCI_SETOVERTYPE: - inOverstrike = wParam; + inOverstrike = wParam != 0; break; case SCI_GETOVERTYPE: return inOverstrike ? 1 : 0; case SCI_SETFOCUS: - SetFocusState(wParam); + SetFocusState(wParam != 0); break; case SCI_GETFOCUS: @@ -4938,7 +4938,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) { return errorStatus; case SCI_SETMOUSEDOWNCAPTURES: - mouseDownCaptures = wParam; + mouseDownCaptures = wParam != 0; break; case SCI_GETMOUSEDOWNCAPTURES: diff --git a/src/LexAVE.cxx b/src/LexAVE.cxx index a7422743f..dfd15f02f 100644 --- a/src/LexAVE.cxx +++ b/src/LexAVE.cxx @@ -26,7 +26,7 @@ static void ColouriseAveDoc(unsigned int startPos, int length, int initStyle, Wo styler.StartAt(startPos); - bool fold = styler.GetPropertyInt("fold"); + bool fold = styler.GetPropertyInt("fold") != 0; int lineCurrent = styler.GetLine(startPos); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; diff --git a/src/LexBaan.cxx b/src/LexBaan.cxx index b0d2b1dad..a8a9d6054 100644 --- a/src/LexBaan.cxx +++ b/src/LexBaan.cxx @@ -34,7 +34,7 @@ static void ColouriseBaanDoc(unsigned int startPos, int length, int initStyle, W WordList &keywords = *keywordlists[0]; WordList &keywords2 = *keywordlists[1]; - bool stylingWithinPreprocessor = styler.GetPropertyInt("styling.within.preprocessor"); + bool stylingWithinPreprocessor = styler.GetPropertyInt("styling.within.preprocessor") != 0; if (initStyle == SCE_BAAN_STRINGEOL) // Does not leak onto next line initStyle = SCE_BAAN_DEFAULT; @@ -132,8 +132,8 @@ static void ColouriseBaanDoc(unsigned int startPos, int length, int initStyle, W static void FoldBaanDoc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler) { - bool foldComment = styler.GetPropertyInt("fold.comment"); - bool foldCompact = styler.GetPropertyInt("fold.compact", 1); + bool foldComment = styler.GetPropertyInt("fold.comment") != 0; + bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; unsigned int endPos = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); diff --git a/src/LexBullant.cxx b/src/LexBullant.cxx index dd317d7a3..1f76ffcf0 100644 --- a/src/LexBullant.cxx +++ b/src/LexBullant.cxx @@ -68,7 +68,7 @@ static void ColouriseBullantDoc(unsigned int startPos, int length, int initStyle styler.StartAt(startPos); - bool fold = styler.GetPropertyInt("fold"); + bool fold = styler.GetPropertyInt("fold") != 0; int lineCurrent = styler.GetLine(startPos); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; diff --git a/src/LexCPP.cxx b/src/LexCPP.cxx index 9248bd68e..06da84341 100644 --- a/src/LexCPP.cxx +++ b/src/LexCPP.cxx @@ -58,7 +58,7 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo WordList &keywords2 = *keywordlists[1]; WordList &keywords3 = *keywordlists[2]; - bool stylingWithinPreprocessor = styler.GetPropertyInt("styling.within.preprocessor"); + bool stylingWithinPreprocessor = styler.GetPropertyInt("styling.within.preprocessor") != 0; // Do not leak onto next line if (initStyle == SCE_C_STRINGEOL) @@ -262,8 +262,8 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo static void FoldCppDoc(unsigned int startPos, int length, int initStyle, WordList *[], Accessor &styler) { - bool foldComment = styler.GetPropertyInt("fold.comment"); - bool foldCompact = styler.GetPropertyInt("fold.compact", 1); + bool foldComment = styler.GetPropertyInt("fold.comment") != 0; + bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; unsigned int endPos = startPos + length; int visibleChars = 0; int lineCurrent = styler.GetLine(startPos); diff --git a/src/LexHTML.cxx b/src/LexHTML.cxx index 6042f168f..dba7646d6 100644 --- a/src/LexHTML.cxx +++ b/src/LexHTML.cxx @@ -272,7 +272,7 @@ static int classifyWordHTVB(unsigned int start, unsigned int end, WordList &keyw } static void classifyWordHTPy(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler, char *prevWord, int inScriptType) { - bool wordIsNumber = isdigit(styler[start]); + bool wordIsNumber = isdigit(styler[start]) != 0; char s[30 + 1]; unsigned int i = 0; for (; i < end - start + 1 && i < 30; i++) { @@ -296,7 +296,7 @@ static void classifyWordHTPy(unsigned int start, unsigned int end, WordList &key // Called when in a PHP word static void classifyWordHTPHP(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler) { char chAttr = SCE_HPHP_DEFAULT; - bool wordIsNumber = isdigit(styler[start]); + bool wordIsNumber = isdigit(styler[start]) != 0; if (wordIsNumber) chAttr = SCE_HPHP_NUMBER; else { @@ -437,9 +437,9 @@ static void ColouriseHyperTextDoc(unsigned int startPos, int length, int initSty int scriptLanguage = ScriptOfState(state); - const bool foldHTML = styler.GetPropertyInt("fold.html", 0); + const bool foldHTML = styler.GetPropertyInt("fold.html", 0) != 0; const bool fold = foldHTML && styler.GetPropertyInt("fold"); - const bool foldCompact = styler.GetPropertyInt("fold.compact", 1); + const bool foldCompact = styler.GetPropertyInt("fold.compact", 1) != 0; int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; diff --git a/src/LexPascal.cxx b/src/LexPascal.cxx index acc38b52d..51b24f2ff 100644 --- a/src/LexPascal.cxx +++ b/src/LexPascal.cxx @@ -49,7 +49,7 @@ static void ColourisePascalDoc(unsigned int startPos, int length, int initStyle, styler.StartAt(startPos); - bool fold = styler.GetPropertyInt("fold"); + bool fold = styler.GetPropertyInt("fold") != 0; int lineCurrent = styler.GetLine(startPos); int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK; int levelCurrent = levelPrev; diff --git a/src/LexPython.cxx b/src/LexPython.cxx index 221859035..3bfbb4a82 100644 --- a/src/LexPython.cxx +++ b/src/LexPython.cxx @@ -276,8 +276,8 @@ static void FoldPyDoc(unsigned int startPos, int length, int /*initStyle - unuse const int maxPos = startPos + length; const int maxLines = styler.GetLine(maxPos-1); // Requested last line const int docLines = styler.GetLine(styler.Length() - 1); // Available last line - const bool foldComment = styler.GetPropertyInt("fold.comment.python"); - const bool foldQuotes = styler.GetPropertyInt("fold.quotes.python"); + const bool foldComment = styler.GetPropertyInt("fold.comment.python") != 0; + const bool foldQuotes = styler.GetPropertyInt("fold.quotes.python") != 0; // Backtrack to previous non-blank line so we can determine indent level // for any white space lines (needed esp. within triple quoted strings) diff --git a/src/LexRuby.cxx b/src/LexRuby.cxx index b29eee3bb..44bbf7216 100644 --- a/src/LexRuby.cxx +++ b/src/LexRuby.cxx @@ -21,7 +21,7 @@ static void ClassifyWordRb(unsigned int start, unsigned int end, WordList &keywords, Accessor &styler, char *prevWord) { char s[100]; - bool wordIsNumber = isdigit(styler[start]); + bool wordIsNumber = isdigit(styler[start]) != 0; for (unsigned int i = 0; i < end - start + 1 && i < 30; i++) { s[i] = styler[start + i]; s[i + 1] = '\0'; diff --git a/src/LexSQL.cxx b/src/LexSQL.cxx index 84d7d1c52..5cb5b9de2 100644 --- a/src/LexSQL.cxx +++ b/src/LexSQL.cxx @@ -43,7 +43,7 @@ static void ColouriseSQLDoc(unsigned int startPos, int length, styler.StartAt(startPos); - bool fold = styler.GetPropertyInt("fold"); + bool fold = styler.GetPropertyInt("fold") != 0; int lineCurrent = styler.GetLine(startPos); int spaceFlags = 0; diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx index 6b2bd8553..2994f42db 100644 --- a/src/ScintillaBase.cxx +++ b/src/ScintillaBase.cxx @@ -447,7 +447,7 @@ sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPara break; case SCI_AUTOCSETCANCELATSTART: - ac.cancelAtStartPos = wParam; + ac.cancelAtStartPos = wParam != 0; break; case SCI_AUTOCGETCANCELATSTART: @@ -458,14 +458,14 @@ sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPara break; case SCI_AUTOCSETCHOOSESINGLE: - ac.chooseSingle = wParam; + ac.chooseSingle = wParam != 0; break; case SCI_AUTOCGETCHOOSESINGLE: return ac.chooseSingle; case SCI_AUTOCSETIGNORECASE: - ac.ignoreCase = wParam; + ac.ignoreCase = wParam != 0; break; case SCI_AUTOCGETIGNORECASE: @@ -477,7 +477,7 @@ sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPara break; case SCI_AUTOCSETAUTOHIDE: - ac.autoHide = wParam; + ac.autoHide = wParam != 0; break; case SCI_AUTOCGETAUTOHIDE: @@ -529,7 +529,7 @@ sptr_t ScintillaBase::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lPara break; case SCI_USEPOPUP: - displayPopupMenu = wParam; + displayPopupMenu = wParam != 0; break; #ifdef SCI_LEXER diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index c6adbf327..bfec57ea4 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -880,7 +880,7 @@ static LARGE_INTEGER frequency; ElapsedTime::ElapsedTime() { if (!initialisedET) { - usePerformanceCounter = ::QueryPerformanceFrequency(&frequency); + usePerformanceCounter = ::QueryPerformanceFrequency(&frequency) != 0; initialisedET = true; } if (usePerformanceCounter) { @@ -946,7 +946,7 @@ void Platform::DebugDisplay(const char *s) { } bool Platform::IsKeyDown(int key) { - return ::GetKeyState(key) & 0x80000000; + return (::GetKeyState(key) & 0x80000000) != 0; } long Platform::SendScintilla(WindowID w, unsigned int msg, unsigned long wParam, long lParam) { @@ -954,7 +954,7 @@ long Platform::SendScintilla(WindowID w, unsigned int msg, unsigned long wParam, } bool Platform::IsDBCSLeadByte(int codePage, char ch) { - return ::IsDBCSLeadByteEx(codePage, ch); + return ::IsDBCSLeadByteEx(codePage, ch) != 0; } // These are utility functions not really tied to a platform diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 1eae2e1e8..ae6018f94 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -577,7 +577,9 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam // Platform::IsKeyDown(VK_CONTROL), // Platform::IsKeyDown(VK_MENU)); ButtonDown(Point::FromLong(lParam), ::GetTickCount(), - wParam & MK_SHIFT, wParam & MK_CONTROL, Platform::IsKeyDown(VK_MENU)); + (wParam & MK_SHIFT) != 0, + (wParam & MK_CONTROL) != 0, + Platform::IsKeyDown(VK_MENU)); ::SetFocus(MainHWND()); break; @@ -586,7 +588,9 @@ sptr_t ScintillaWin::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam break; case WM_LBUTTONUP: - ButtonUp(Point::FromLong(lParam), ::GetTickCount(), wParam & MK_CONTROL); + ButtonUp(Point::FromLong(lParam), + ::GetTickCount(), + (wParam & MK_CONTROL) != 0); break; case WM_SETCURSOR: @@ -970,7 +974,7 @@ bool ScintillaWin::CanPaste() { if (::IsClipboardFormatAvailable(CF_TEXT)) return true; if (IsUnicodeMode()) - return ::IsClipboardFormatAvailable(CF_UNICODETEXT); + return ::IsClipboardFormatAvailable(CF_UNICODETEXT) != 0; return false; } @@ -979,7 +983,7 @@ void ScintillaWin::Paste() { int selStart = SelectionStart(); ClearSelection(); ::OpenClipboard(MainHWND()); - bool isRectangular = ::IsClipboardFormatAvailable(cfColumnSelect); + bool isRectangular = ::IsClipboardFormatAvailable(cfColumnSelect) != 0; HGLOBAL hmemUSelection = 0; if (IsUnicodeMode()) { hmemUSelection = ::GetClipboardData(CF_UNICODETEXT); |