aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMitchell Foral <unknown>2022-12-01 17:27:09 +1100
committerMitchell Foral <unknown>2022-12-01 17:27:09 +1100
commit9a400bd33f0cb4f322de4208bb7159673a399521 (patch)
tree907794431dd3dc69f6eafc3da05eb0f60ccc5096
parentb80ca55f14fc7e0aa582a1b0b2117faf23ec29be (diff)
downloadscintilla-mirror-9a400bd33f0cb4f322de4208bb7159673a399521.tar.gz
Change release compilation optimization option to favour speed over space.
-O2 for MSVC and -O3 for gcc and clang. Change code in Editor.cxx to avoid a warning that occurs with gcc -O3.
-rw-r--r--doc/ScintillaHistory.html4
-rw-r--r--gtk/makefile2
-rw-r--r--src/Editor.cxx2
-rw-r--r--win32/makefile2
-rw-r--r--win32/scintilla.mak2
5 files changed, 8 insertions, 4 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 1c919b7c2..a1a442137 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -610,6 +610,10 @@
<a href="https://sourceforge.net/p/scintilla/bugs/2363/">Bug #2363</a>.
</li>
<li>
+ Change release compilation optimization option to favour speed over space.
+ -O2 for MSVC and -O3 for gcc and clang.
+ </li>
+ <li>
On Win32, avoid blurry display with DirectWrite in GDI scaling mode.
<a href="https://sourceforge.net/p/scintilla/bugs/2344/">Bug #2344</a>.
</li>
diff --git a/gtk/makefile b/gtk/makefile
index a641f18e4..8643ae317 100644
--- a/gtk/makefile
+++ b/gtk/makefile
@@ -84,7 +84,7 @@ DEFINES += -DNO_CXX11_REGEX
endif
DEFINES += -D$(if $(DEBUG),DEBUG,NDEBUG)
-BASE_FLAGS += $(if $(DEBUG),-g,-Os)
+BASE_FLAGS += $(if $(DEBUG),-g,-O3)
CXX_BASE_FLAGS =--std=c++17 $(BASE_FLAGS)
CXX_ALL_FLAGS =$(DEFINES) $(INCLUDES) $(CXX_BASE_FLAGS) $(CONFIG_FLAGS)
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 1fb6d960d..72a8a4bd8 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -5872,7 +5872,7 @@ void Editor::StyleSetMessage(Message iMessage, uptr_t wParam, sptr_t lParam) {
if (!(classified & UTF8MaskInvalid)) {
// valid UTF-8
int len = classified & UTF8MaskWidth;
- while (len--)
+ for (int i=0; i<len && i<4; i++)
*rep++ = *utf8++;
}
*rep = 0;
diff --git a/win32/makefile b/win32/makefile
index e0f363653..c1829a45e 100644
--- a/win32/makefile
+++ b/win32/makefile
@@ -57,7 +57,7 @@ DEFINES += -DNO_CXX11_REGEX
endif
DEFINES += -D$(if $(DEBUG),DEBUG,NDEBUG)
-BASE_FLAGS += $(if $(DEBUG),-g,-Os)
+BASE_FLAGS += $(if $(DEBUG),-g,-O3)
ifndef DEBUG
STRIPFLAG=$(STRIPOPTION)
diff --git a/win32/scintilla.mak b/win32/scintilla.mak
index 62b90385e..f4eb67dcc 100644
--- a/win32/scintilla.mak
+++ b/win32/scintilla.mak
@@ -38,7 +38,7 @@ SUBSYSTEM=-SUBSYSTEM:WINDOWS,10.00
CRTFLAGS=-D_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1 -D_CRT_SECURE_NO_DEPRECATE=1 -D_SCL_SECURE_NO_WARNINGS=1 $(ADD_DEFINE)
CXXFLAGS=-Zi -TP -MP -W4 -EHsc -std:c++17 $(CRTFLAGS)
CXXDEBUG=-Od -MTd -DDEBUG
-CXXNDEBUG=-O1 -MT -DNDEBUG -GL
+CXXNDEBUG=-O2 -MT -DNDEBUG -GL
NAME=-Fo
LDFLAGS=-OPT:REF -LTCG -IGNORE:4197 -DEBUG $(SUBSYSTEM) $(CETCOMPAT)
LDDEBUG=