aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/CellBuffer.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2018-04-21 08:43:03 +1000
committerNeil <nyamatongwe@gmail.com>2018-04-21 08:43:03 +1000
commit2a1338ce2d7c813db6f650154e2e3b6fdde06ff5 (patch)
treed076bc0442e8f06531bbaf04c13fc2e53a35b483 /src/CellBuffer.cxx
parent15789ad27ff66c8928d7dc90683af11d6c045009 (diff)
downloadscintilla-mirror-2a1338ce2d7c813db6f650154e2e3b6fdde06ff5.tar.gz
Backport: Tighten definition of regular expression iterators so they are noexcept and
define all the standard member functions. This cascades to all methods called by the iterators, affecting Document, CellBuffer, Partitioning, SplitVector and UTF-8 and DBCS functions. Other trivial functions declared noexcept. Backport of changeset 6724:f2dfdc0dddd3.
Diffstat (limited to 'src/CellBuffer.cxx')
-rw-r--r--src/CellBuffer.cxx26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/CellBuffer.cxx b/src/CellBuffer.cxx
index c7fb6b650..2928edcb4 100644
--- a/src/CellBuffer.cxx
+++ b/src/CellBuffer.cxx
@@ -35,9 +35,9 @@ public:
virtual void InsertLine(Sci::Line line, Sci::Position position, bool lineStart) = 0;
virtual void SetLineStart(Sci::Line line, Sci::Position position) = 0;
virtual void RemoveLine(Sci::Line line) = 0;
- virtual Sci::Line Lines() const = 0;
- virtual Sci::Line LineFromPosition(Sci::Position pos) const = 0;
- virtual Sci::Position LineStart(Sci::Line line) const = 0;
+ virtual Sci::Line Lines() const noexcept = 0;
+ virtual Sci::Line LineFromPosition(Sci::Position pos) const noexcept = 0;
+ virtual Sci::Position LineStart(Sci::Line line) const noexcept = 0;
virtual ~ILineVector() {}
};
@@ -84,13 +84,13 @@ public:
perLine->RemoveLine(line);
}
}
- Sci::Line Lines() const override {
+ Sci::Line Lines() const noexcept override {
return static_cast<Sci::Line>(starts.Partitions());
}
- Sci::Line LineFromPosition(Sci::Position pos) const override {
+ Sci::Line LineFromPosition(Sci::Position pos) const noexcept override {
return static_cast<Sci::Line>(starts.PartitionFromPosition(static_cast<POS>(pos)));
}
- Sci::Position LineStart(Sci::Line line) const override {
+ Sci::Position LineStart(Sci::Line line) const noexcept override {
return starts.PositionFromPartition(static_cast<POS>(line));
}
};
@@ -377,11 +377,11 @@ CellBuffer::CellBuffer(bool hasStyles_, bool largeDocument_) :
CellBuffer::~CellBuffer() {
}
-char CellBuffer::CharAt(Sci::Position position) const {
+char CellBuffer::CharAt(Sci::Position position) const noexcept {
return substance.ValueAt(position);
}
-unsigned char CellBuffer::UCharAt(Sci::Position position) const {
+unsigned char CellBuffer::UCharAt(Sci::Position position) const noexcept {
return static_cast<unsigned char>(substance.ValueAt(position));
}
@@ -398,7 +398,7 @@ void CellBuffer::GetCharRange(char *buffer, Sci::Position position, Sci::Positio
substance.GetRange(buffer, position, lengthRetrieve);
}
-char CellBuffer::StyleAt(Sci::Position position) const {
+char CellBuffer::StyleAt(Sci::Position position) const noexcept {
return hasStyles ? style.ValueAt(position) : 0;
}
@@ -496,7 +496,7 @@ const char *CellBuffer::DeleteChars(Sci::Position position, Sci::Position delete
return data;
}
-Sci::Position CellBuffer::Length() const {
+Sci::Position CellBuffer::Length() const noexcept {
return substance.Length();
}
@@ -537,11 +537,11 @@ void CellBuffer::SetPerLine(PerLine *pl) {
plv->SetPerLine(pl);
}
-Sci::Line CellBuffer::Lines() const {
+Sci::Line CellBuffer::Lines() const noexcept {
return plv->Lines();
}
-Sci::Position CellBuffer::LineStart(Sci::Line line) const {
+Sci::Position CellBuffer::LineStart(Sci::Line line) const noexcept {
if (line < 0)
return 0;
else if (line >= Lines())
@@ -550,7 +550,7 @@ Sci::Position CellBuffer::LineStart(Sci::Line line) const {
return plv->LineStart(line);
}
-Sci::Line CellBuffer::LineFromPosition(Sci::Position pos) const {
+Sci::Line CellBuffer::LineFromPosition(Sci::Position pos) const noexcept {
return plv->LineFromPosition(pos);
}