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 /src | |
parent | d43d89fa81e0b04b762c2a9d58cb3d86d0400ec2 (diff) | |
download | scintilla-mirror-9fbdf629124454ddfc8ff9fc10ed4841d2ef8fba.tar.gz |
Made code bool-safe and turned Visual C++ warning 4800 back on.
Diffstat (limited to 'src')
-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 |
11 files changed, 64 insertions, 64 deletions
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 |