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
commit8634c0958c532e7d219e649353e1f1a74d52da1b (patch)
tree91352944c8b5c727a385426431d2e62f3301f6ad /src/UniConversion.cxx
parentf00008fa5a49722171c5b288f988a64443122115 (diff)
downloadscintilla-mirror-8634c0958c532e7d219e649353e1f1a74d52da1b.tar.gz
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.
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 18c1cd521..fb50b9277 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);
}