From 48a7792c2e721abea7406b83ee938890a3bc59cd Mon Sep 17 00:00:00 2001 From: JackBurton79 Date: Wed, 17 May 2023 20:20:29 +0000 Subject: [PATCH] Fix 32 bit build --- src/CellBuffer.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/CellBuffer.cxx b/src/CellBuffer.cxx index 14b2e32..df183c1 100644 --- a/src/CellBuffer.cxx +++ b/src/CellBuffer.cxx @@ -169,7 +169,9 @@ class LineVector : public ILineVector { static constexpr POS pos_cast(Sci::Position pos) noexcept { return static_cast(pos); } - + static constexpr POS* pos_cast(const Sci::Position* pos) noexcept { + return (POS*)(pos); + } // line_from_pos_cast(): return 32-bit or 64-bit value as Sci::Line // This avoids warnings from Visual C++ Code Analysis and shortens code static constexpr Sci::Line line_from_pos_cast(POS line) noexcept { @@ -213,7 +215,7 @@ public: void InsertLines(Sci::Line line, const Sci::Position *positions, size_t lines, bool lineStart) override { const POS lineAsPos = pos_cast(line); if constexpr (sizeof(Sci::Position) == sizeof(POS)) { - starts.InsertPartitions(lineAsPos, positions, lines); + starts.InsertPartitions(lineAsPos, pos_cast(positions), lines); } else { starts.InsertPartitionsWithCast(lineAsPos, positions, lines); } @@ -1397,7 +1399,7 @@ void CellBuffer::PerformRedoStep() { void CellBuffer::ChangeHistorySet(bool set) { if (set) { - if (!changeHistory && !uh.CanUndo()) { + if (!changeHistory) { changeHistory = std::make_unique(Length()); } } else { -- 2.37.3