aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/UndoHistory.h
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2024-02-28 15:24:13 +1100
committerNeil <nyamatongwe@gmail.com>2024-02-28 15:24:13 +1100
commitd09724bee7cc77bb6c8b327a6f2004cebe5ec9ba (patch)
tree9ac7d1f0f59c222df7c6841d0f0909afd16ffae7 /src/UndoHistory.h
parentce9ec5366ab200193140bbd060b948f62a10286b (diff)
downloadscintilla-mirror-d09724bee7cc77bb6c8b327a6f2004cebe5ec9ba.tar.gz
Fix failures with values larger than 0xffffff in 32-bit builds.
Diffstat (limited to 'src/UndoHistory.h')
-rw-r--r--src/UndoHistory.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/UndoHistory.h b/src/UndoHistory.h
index 90b2860a7..8de636f8d 100644
--- a/src/UndoHistory.h
+++ b/src/UndoHistory.h
@@ -15,9 +15,13 @@ namespace Scintilla::Internal {
// only use 2 bytes or even 1 byte for each length.
// This saves much memory often reducing by 50% for 32-bit builds and 75% for 64-bit builds.
+struct SizeMax {
+ size_t size = 1;
+ size_t maxValue = UINT8_MAX;
+};
+
class ScaledVector {
- size_t elementSize = 1;
- size_t elementMax = 255;
+ SizeMax element;
std::vector<uint8_t> bytes;
public:
[[nodiscard]] size_t Size() const noexcept;