diff options
| author | Neil <nyamatongwe@gmail.com> | 2018-10-11 16:38:05 +1100 | 
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2018-10-11 16:38:05 +1100 | 
| commit | c804e5578b41b3523e5cb933fd40d08ba132b347 (patch) | |
| tree | 44689f9ac11b536da1ecab469bea920ae8e0895b /src | |
| parent | c5dedff99f306588a7217d40a4281db7d1baffaa (diff) | |
| download | scintilla-mirror-c804e5578b41b3523e5cb933fd40d08ba132b347.tar.gz | |
Replace NULL and 0 with nullptr in clear cases of pure C++ code.
Diffstat (limited to 'src')
| -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 6228f89d3..da3be5ecd 100644 --- a/src/CaseConvert.cxx +++ b/src/CaseConvert.cxx @@ -602,11 +602,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; @@ -614,7 +614,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); @@ -779,7 +779,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 639558a65..1abff92dc 100644 --- a/src/CellBuffer.cxx +++ b/src/CellBuffer.cxx @@ -138,7 +138,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. @@ -650,7 +650,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 @@ -1148,7 +1148,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 e640e05bb..50fff4931 100644 --- a/src/EditModel.cxx +++ b/src/EditModel.cxx @@ -75,7 +75,7 @@ EditModel::EditModel() : braces{} {  EditModel::~EditModel() {  	pdoc->Release(); -	pdoc = 0; +	pdoc = nullptr;  }  bool EditModel::BidirectionalEnabled() const { diff --git a/src/Indicator.cxx b/src/Indicator.cxx index bc3c83a17..5ab0a7813 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 3dfdffe5c..4a313d292 100644 --- a/src/PerLine.cxx +++ b/src/PerLine.cxx @@ -350,14 +350,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 std::unique_ptr<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 824bcdfeb..68cdd7f2b 100644 --- a/src/ScintillaBase.cxx +++ b/src/ScintillaBase.cxx @@ -443,12 +443,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;  } @@ -593,7 +593,7 @@ public:  }  LexState::LexState(Document *pdoc_) : LexInterface(pdoc_) { -	lexCurrent = 0; +	lexCurrent = nullptr;  	performingStyle = false;  	interfaceVersion = lvRelease4;  	lexLanguage = SCLEX_CONTAINER; @@ -602,7 +602,7 @@ LexState::LexState(Document *pdoc_) : LexInterface(pdoc_) {  LexState::~LexState() {  	if (instance) {  		instance->Release(); -		instance = 0; +		instance = nullptr;  	}  } @@ -617,7 +617,7 @@ void LexState::SetLexerModule(const LexerModule *lex) {  	if (lex != lexCurrent) {  		if (instance) {  			instance->Release(); -			instance = 0; +			instance = nullptr;  		}  		interfaceVersion = lvRelease4;  		lexCurrent = lex; @@ -632,7 +632,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) @@ -654,7 +654,7 @@ const char *LexState::DescribeWordListSets() {  	if (instance) {  		return instance->DescribeWordListSets();  	} else { -		return 0; +		return nullptr;  	}  } @@ -675,7 +675,7 @@ void *LexState::PrivateCall(int operation, void *pointer) {  	if (pdoc && instance) {  		return instance->PrivateCall(operation, pointer);  	} else { -		return 0; +		return nullptr;  	}  } @@ -683,7 +683,7 @@ const char *LexState::PropertyNames() {  	if (instance) {  		return instance->PropertyNames();  	} else { -		return 0; +		return nullptr;  	}  } @@ -699,7 +699,7 @@ const char *LexState::DescribeProperty(const char *name) {  	if (instance) {  		return instance->DescribeProperty(name);  	} else { -		return 0; +		return nullptr;  	}  } @@ -806,7 +806,7 @@ const char *LexState::NameOfStyle(int style) {  	if (instance) {  		return instance->NameOfStyle(style);  	} else { -		return 0; +		return nullptr;  	}  } @@ -814,7 +814,7 @@ const char *LexState::TagsOfStyle(int style) {  	if (instance) {  		return instance->TagsOfStyle(style);  	} else { -		return 0; +		return nullptr;  	}  } @@ -822,7 +822,7 @@ const char *LexState::DescriptionOfStyle(int style) {  	if (instance) {  		return instance->DescriptionOfStyle(style);  	} else { -		return 0; +		return nullptr;  	}  } diff --git a/src/Style.cxx b/src/Style.cxx index 03f37449a..5fff777a6 100644 --- a/src/Style.cxx +++ b/src/Style.cxx @@ -77,13 +77,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; @@ -107,7 +107,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 3e5504e74..d6a34e7ee 100644 --- a/src/ViewStyle.cxx +++ b/src/ViewStyle.cxx @@ -601,7 +601,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() { | 
