diff options
-rw-r--r-- | src/CaseConvert.cxx | 8 | ||||
-rw-r--r-- | src/CellBuffer.cxx | 6 | ||||
-rw-r--r-- | src/EditModel.cxx | 2 | ||||
-rw-r--r-- | src/Indicator.cxx | 4 | ||||
-rw-r--r-- | src/PerLine.cxx | 4 | ||||
-rw-r--r-- | src/RESearch.cxx | 4 | ||||
-rw-r--r-- | src/ScintillaBase.cxx | 26 | ||||
-rw-r--r-- | src/Style.cxx | 6 | ||||
-rw-r--r-- | src/ViewStyle.cxx | 2 |
9 files changed, 31 insertions, 31 deletions
diff --git a/src/CaseConvert.cxx b/src/CaseConvert.cxx index 2d6db4eb7..a3680c084 100644 --- a/src/CaseConvert.cxx +++ b/src/CaseConvert.cxx @@ -597,11 +597,11 @@ public: const char *Find(int character) { const std::vector<int>::iterator it = std::lower_bound(characters.begin(), characters.end(), character); if (it == characters.end()) - return 0; + return nullptr; else if (*it == character) return conversions[it - characters.begin()].conversion; else - return 0; + return nullptr; } size_t CaseConvertString(char *converted, size_t sizeConverted, const char *mixed, size_t lenMixed) override { size_t lenConverted = 0; @@ -609,7 +609,7 @@ public: unsigned char bytes[UTF8MaxBytes + 1]{}; while (mixedPos < lenMixed) { const unsigned char leadByte = mixed[mixedPos]; - const char *caseConverted = 0; + const char *caseConverted = nullptr; size_t lenMixedChar = 1; if (UTF8IsAscii(leadByte)) { caseConverted = Find(leadByte); @@ -774,7 +774,7 @@ CaseConverter *ConverterForConversion(enum CaseConversion conversion) { case CaseConversionLower: return &caseConvLow; } - return 0; + return nullptr; } } diff --git a/src/CellBuffer.cxx b/src/CellBuffer.cxx index 76865545a..17a30a565 100644 --- a/src/CellBuffer.cxx +++ b/src/CellBuffer.cxx @@ -137,7 +137,7 @@ class LineVector : public ILineVector { LineStartIndex<POS> startsUTF16; LineStartIndex<POS> startsUTF32; public: - LineVector() : starts(256), perLine(0) { + LineVector() : starts(256), perLine(nullptr) { Init(); } // Deleted so LineVector objects can not be copied. @@ -649,7 +649,7 @@ bool CellBuffer::SetStyleFor(Sci::Position position, Sci::Position lengthStyle, const char *CellBuffer::DeleteChars(Sci::Position position, Sci::Position deleteLength, bool &startSequence) { // InsertString and DeleteChars are the bottleneck though which all changes occur PLATFORM_ASSERT(deleteLength > 0); - const char *data = 0; + const char *data = nullptr; if (!readOnly) { if (collectingUndo) { // Save into the undo/redo stack, but only the characters - not the formatting @@ -1147,7 +1147,7 @@ void CellBuffer::EndUndoAction() { void CellBuffer::AddUndoAction(Sci::Position token, bool mayCoalesce) { bool startSequence; - uh.AppendAction(containerAction, token, 0, 0, startSequence, mayCoalesce); + uh.AppendAction(containerAction, token, nullptr, 0, startSequence, mayCoalesce); } void CellBuffer::DeleteUndoHistory() { diff --git a/src/EditModel.cxx b/src/EditModel.cxx index 8bb1bc395..7ed7e350d 100644 --- a/src/EditModel.cxx +++ b/src/EditModel.cxx @@ -73,5 +73,5 @@ EditModel::EditModel() : braces{} { EditModel::~EditModel() { pdoc->Release(); - pdoc = 0; + pdoc = nullptr; } diff --git a/src/Indicator.cxx b/src/Indicator.cxx index b62abaa08..544bd571d 100644 --- a/src/Indicator.cxx +++ b/src/Indicator.cxx @@ -60,7 +60,7 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r const PRectangle rcSquiggle = PixelGridAlign(rc); const int width = std::min(4000, static_cast<int>(rcSquiggle.Width())); - RGBAImage image(width, 3, 1.0, 0); + RGBAImage image(width, 3, 1.0, nullptr); enum { alphaFull = 0xff, alphaSide = 0x2f, alphaSide2=0x5f }; for (int x = 0; x < width; x++) { if (x%2) { @@ -165,7 +165,7 @@ void Indicator::Draw(Surface *surface, const PRectangle &rc, const PRectangle &r IntegerRectangle ircBox(rcBox); // Cap width at 4000 to avoid large allocations when mistakes made const int width = std::min(ircBox.Width(), 4000); - RGBAImage image(width, ircBox.Height(), 1.0, 0); + RGBAImage image(width, ircBox.Height(), 1.0, nullptr); // Draw horizontal lines top and bottom for (int x=0; x<width; x++) { for (int y = 0; y<ircBox.Height(); y += ircBox.Height() - 1) { diff --git a/src/PerLine.cxx b/src/PerLine.cxx index 4ac4de9ce..537512290 100644 --- a/src/PerLine.cxx +++ b/src/PerLine.cxx @@ -349,14 +349,14 @@ const char *LineAnnotation::Text(Sci::Line line) const { if (annotations.Length() && (line >= 0) && (line < annotations.Length()) && annotations[line]) return annotations[line].get()+sizeof(AnnotationHeader); else - return 0; + return nullptr; } const unsigned char *LineAnnotation::Styles(Sci::Line line) const { if (annotations.Length() && (line >= 0) && (line < annotations.Length()) && annotations[line] && MultipleStyles(line)) return reinterpret_cast<unsigned char *>(annotations[line].get() + sizeof(AnnotationHeader) + Length(line)); else - return 0; + return nullptr; } static char *AllocateAnnotation(int length, int style) { diff --git a/src/RESearch.cxx b/src/RESearch.cxx index d29549ac2..5ce073a44 100644 --- a/src/RESearch.cxx +++ b/src/RESearch.cxx @@ -445,7 +445,7 @@ const char *RESearch::Compile(const char *pattern, Sci::Position length, bool ca if (!pattern || !length) { if (sta) - return 0; + return nullptr; else return badpat("No previous regular expression"); } @@ -727,7 +727,7 @@ const char *RESearch::Compile(const char *pattern, Sci::Position length, bool ca return badpat((posix ? "Unmatched (" : "Unmatched \\(")); *mp = END; sta = OKP; - return 0; + return nullptr; } /* diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx index 9a36412ed..c327206d8 100644 --- a/src/ScintillaBase.cxx +++ b/src/ScintillaBase.cxx @@ -442,12 +442,12 @@ int ScintillaBase::AutoCompleteGetCurrentText(char *buffer) const { const int item = ac.GetSelection(); if (item != -1) { const std::string selected = ac.GetValue(item); - if (buffer != NULL) + if (buffer) memcpy(buffer, selected.c_str(), selected.length()+1); return static_cast<int>(selected.length()); } } - if (buffer != NULL) + if (buffer) *buffer = '\0'; return 0; } @@ -592,7 +592,7 @@ public: } LexState::LexState(Document *pdoc_) : LexInterface(pdoc_) { - lexCurrent = 0; + lexCurrent = nullptr; performingStyle = false; interfaceVersion = lvOriginal; lexLanguage = SCLEX_CONTAINER; @@ -601,7 +601,7 @@ LexState::LexState(Document *pdoc_) : LexInterface(pdoc_) { LexState::~LexState() { if (instance) { instance->Release(); - instance = 0; + instance = nullptr; } } @@ -616,7 +616,7 @@ void LexState::SetLexerModule(const LexerModule *lex) { if (lex != lexCurrent) { if (instance) { instance->Release(); - instance = 0; + instance = nullptr; } interfaceVersion = lvOriginal; lexCurrent = lex; @@ -631,7 +631,7 @@ void LexState::SetLexerModule(const LexerModule *lex) { void LexState::SetLexer(uptr_t wParam) { lexLanguage = static_cast<int>(wParam); if (lexLanguage == SCLEX_CONTAINER) { - SetLexerModule(0); + SetLexerModule(nullptr); } else { const LexerModule *lex = Catalogue::Find(lexLanguage); if (!lex) @@ -653,7 +653,7 @@ const char *LexState::DescribeWordListSets() { if (instance) { return instance->DescribeWordListSets(); } else { - return 0; + return nullptr; } } @@ -674,7 +674,7 @@ void *LexState::PrivateCall(int operation, void *pointer) { if (pdoc && instance) { return instance->PrivateCall(operation, pointer); } else { - return 0; + return nullptr; } } @@ -682,7 +682,7 @@ const char *LexState::PropertyNames() { if (instance) { return instance->PropertyNames(); } else { - return 0; + return nullptr; } } @@ -698,7 +698,7 @@ const char *LexState::DescribeProperty(const char *name) { if (instance) { return instance->DescribeProperty(name); } else { - return 0; + return nullptr; } } @@ -805,7 +805,7 @@ const char *LexState::NameOfStyle(int style) { if (instance && (interfaceVersion >= lvMetaData)) { return static_cast<ILexerWithMetaData *>(instance)->NameOfStyle(style); } else { - return 0; + return nullptr; } } @@ -813,7 +813,7 @@ const char *LexState::TagsOfStyle(int style) { if (instance && (interfaceVersion >= lvMetaData)) { return static_cast<ILexerWithMetaData *>(instance)->TagsOfStyle(style); } else { - return 0; + return nullptr; } } @@ -821,7 +821,7 @@ const char *LexState::DescriptionOfStyle(int style) { if (instance && (interfaceVersion >= lvMetaData)) { return static_cast<ILexerWithMetaData *>(instance)->DescriptionOfStyle(style); } else { - return 0; + return nullptr; } } diff --git a/src/Style.cxx b/src/Style.cxx index 54f489c48..2cb82616b 100644 --- a/src/Style.cxx +++ b/src/Style.cxx @@ -76,13 +76,13 @@ void FontMeasurements::ClearMeasurements() { Style::Style() : FontSpecification() { Clear(ColourDesired(0, 0, 0), ColourDesired(0xff, 0xff, 0xff), - Platform::DefaultFontSize() * SC_FONT_SIZE_MULTIPLIER, 0, SC_CHARSET_DEFAULT, + Platform::DefaultFontSize() * SC_FONT_SIZE_MULTIPLIER, nullptr, SC_CHARSET_DEFAULT, SC_WEIGHT_NORMAL, false, false, false, caseMixed, true, true, false); } Style::Style(const Style &source) : FontSpecification(), FontMeasurements() { Clear(ColourDesired(0, 0, 0), ColourDesired(0xff, 0xff, 0xff), - 0, 0, 0, + 0, nullptr, 0, SC_WEIGHT_NORMAL, false, false, false, caseMixed, true, true, false); fore = source.fore; back = source.back; @@ -106,7 +106,7 @@ Style &Style::operator=(const Style &source) { if (this == &source) return * this; Clear(ColourDesired(0, 0, 0), ColourDesired(0xff, 0xff, 0xff), - 0, 0, SC_CHARSET_DEFAULT, + 0, nullptr, SC_CHARSET_DEFAULT, SC_WEIGHT_NORMAL, false, false, false, caseMixed, true, true, false); fore = source.fore; back = source.back; diff --git a/src/ViewStyle.cxx b/src/ViewStyle.cxx index 387070ae9..065fae988 100644 --- a/src/ViewStyle.cxx +++ b/src/ViewStyle.cxx @@ -600,7 +600,7 @@ FontRealised *ViewStyle::Find(const FontSpecification &fs) { // Should always reach here since map was just set for all styles return it->second.get(); } - return 0; + return nullptr; } void ViewStyle::FindMaxAscentDescent() { |