From a29a92c614ae03f4058f0e63899350d83c43d670 Mon Sep 17 00:00:00 2001 From: Neil Date: Thu, 19 Apr 2018 17:09:27 +1000 Subject: 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. --- src/Editor.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Editor.h') diff --git a/src/Editor.h b/src/Editor.h index db070916d..3f6f8f2c8 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -394,9 +394,9 @@ protected: // ScintillaBase subclass needs access to much of Editor void AddChar(char ch); virtual void AddCharUTF(const char *s, unsigned int len, bool treatAsDBCS=false); void ClearBeforeTentativeStart(); - void InsertPaste(const char *text, int len); + void InsertPaste(const char *text, Sci::Position len); enum PasteShape { pasteStream=0, pasteRectangular = 1, pasteLine = 2 }; - void InsertPasteShape(const char *text, int len, PasteShape shape); + void InsertPasteShape(const char *text, Sci::Position len, PasteShape shape); void ClearSelection(bool retainMultipleSelections = false); void ClearAll(); void ClearDocumentStyle(); @@ -483,7 +483,7 @@ protected: // ScintillaBase subclass needs access to much of Editor std::string RangeText(Sci::Position start, Sci::Position end) const; void CopySelectionRange(SelectionText *ss, bool allowLineCopy=false); void CopyRangeToClipboard(Sci::Position start, Sci::Position end); - void CopyText(int length, const char *text); + void CopyText(size_t length, const char *text); void SetDragPosition(SelectionPosition newPos); virtual void DisplayCursor(Window::Cursor c); virtual bool DragThreshold(Point ptStart, Point ptNow); @@ -557,7 +557,7 @@ protected: // ScintillaBase subclass needs access to much of Editor int CodePage() const; virtual bool ValidCodePage(int /* codePage */) const { return true; } - int WrapCount(int line); + Sci::Line WrapCount(Sci::Line line); void AddStyledText(char *buffer, Sci::Position appendLength); virtual sptr_t DefWndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) = 0; -- cgit v1.2.3