aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/UniConversion.cxx
diff options
context:
space:
mode:
authorNeil <nyamatongwe@gmail.com>2018-04-21 08:43:03 +1000
committerNeil <nyamatongwe@gmail.com>2018-04-21 08:43:03 +1000
commit2a1338ce2d7c813db6f650154e2e3b6fdde06ff5 (patch)
treed076bc0442e8f06531bbaf04c13fc2e53a35b483 /src/UniConversion.cxx
parent15789ad27ff66c8928d7dc90683af11d6c045009 (diff)
downloadscintilla-mirror-2a1338ce2d7c813db6f650154e2e3b6fdde06ff5.tar.gz
Backport: Tighten definition of regular expression iterators so they are noexcept and
define all the standard member functions. This cascades to all methods called by the iterators, affecting Document, CellBuffer, Partitioning, SplitVector and UTF-8 and DBCS functions. Other trivial functions declared noexcept. Backport of changeset 6724:f2dfdc0dddd3.
Diffstat (limited to 'src/UniConversion.cxx')
-rw-r--r--src/UniConversion.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/UniConversion.cxx b/src/UniConversion.cxx
index 880b3132f..04b8891cb 100644
--- a/src/UniConversion.cxx
+++ b/src/UniConversion.cxx
@@ -218,7 +218,7 @@ size_t UTF32FromUTF8(const char *s, size_t len, unsigned int *tbuf, size_t tlen)
return ui;
}
-unsigned int UTF16FromUTF32Character(unsigned int val, wchar_t *tbuf) {
+unsigned int UTF16FromUTF32Character(unsigned int val, wchar_t *tbuf) noexcept {
if (val < SUPPLEMENTAL_PLANE_FIRST) {
tbuf[0] = static_cast<wchar_t>(val);
return 1;
@@ -254,7 +254,7 @@ const unsigned char UTF8BytesOfLead[256] = {
// the non-characters *FFFE, *FFFF and FDD0 .. FDEF return 3 or 4 as they can be
// reasonably treated as code points in some circumstances. They will, however,
// not have associated glyphs.
-int UTF8Classify(const unsigned char *us, int len) {
+int UTF8Classify(const unsigned char *us, int len) noexcept {
// For the rules: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8
if (us[0] < 0x80) {
// ASCII
@@ -325,7 +325,7 @@ int UTF8Classify(const unsigned char *us, int len) {
return UTF8MaskInvalid | 1;
}
-int UTF8DrawBytes(const unsigned char *us, int len) {
+int UTF8DrawBytes(const unsigned char *us, int len) noexcept {
const int utf8StatusNext = UTF8Classify(us, len);
return (utf8StatusNext & UTF8MaskInvalid) ? 1 : (utf8StatusNext & UTF8MaskWidth);
}