aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Document.h
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2018-04-19 17:09:27 +1000
committerNeil <nyamatongwe@gmail.com>2018-04-19 17:09:27 +1000
commita29a92c614ae03f4058f0e63899350d83c43d670 (patch)
tree5b2c629dde7ea3c7976912d80ddf1626c27a258b /src/Document.h
parent463b5ec1bd24fd9b23d0f6149a30a4e0d9136eaa (diff)
downloadscintilla-mirror-a29a92c614ae03f4058f0e63899350d83c43d670.tar.gz
Casting changed in many places, due to change to 64-bit variables for 64-bit
builds. Some of the changes ensure no truncation while others remove casts that are no longer needed because the externally visible Sci_Position is now identical to Sci::Position. Some extra methods (CellBuffer::UCharAt and Document::SciLineFromPosition) added to avoid casting in client code. Sci::Line is currently identical to Sci::Position but it could be made smaller so lines have Sci::Line types and are cast. Some arguments widened.
Diffstat (limited to 'src/Document.h')
-rw-r--r--src/Document.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Document.h b/src/Document.h
index d5d0a4d2e..387af74f0 100644
--- a/src/Document.h
+++ b/src/Document.h
@@ -290,6 +290,7 @@ public:
void SCI_METHOD SetErrorStatus(int status) override;
Sci_Position SCI_METHOD LineFromPosition(Sci_Position pos) const override;
+ Sci::Line SciLineFromPosition(Sci::Position pos) const; // Avoids casting LineFromPosition
Sci::Position ClampPositionIntoDocument(Sci::Position pos) const;
bool ContainsLineEnd(const char *s, Sci::Position length) const { return cb.ContainsLineEnd(s, length); }
bool IsCrLf(Sci::Position pos) const;
@@ -360,10 +361,10 @@ public:
char CharAt(Sci::Position position) const { return cb.CharAt(position); }
void SCI_METHOD GetCharRange(char *buffer, Sci_Position position, Sci_Position lengthRetrieve) const override {
- cb.GetCharRange(buffer, static_cast<Sci::Position>(position), static_cast<Sci::Position>(lengthRetrieve));
+ cb.GetCharRange(buffer, position, lengthRetrieve);
}
- char SCI_METHOD StyleAt(Sci_Position position) const override { return cb.StyleAt(static_cast<Sci::Position>(position)); }
- int StyleIndexAt(Sci_Position position) const { return static_cast<unsigned char>(cb.StyleAt(static_cast<Sci::Position>(position))); }
+ char SCI_METHOD StyleAt(Sci_Position position) const override { return cb.StyleAt(position); }
+ int StyleIndexAt(Sci_Position position) const { return static_cast<unsigned char>(cb.StyleAt(position)); }
void GetStyleRange(unsigned char *buffer, Sci::Position position, Sci::Position lengthRetrieve) const {
cb.GetStyleRange(buffer, position, lengthRetrieve);
}