[vte] utf8: Use a symbol for REJECT in the data table



commit 9bda7de4baf75fd81b8d9a4c745cf46898273477
Author: Christian Persch <chpe src gnome org>
Date:   Mon Sep 3 16:10:51 2018 +0200

    utf8: Use a symbol for REJECT in the data table
    
    Use a short abbreviation, so that the table doesn't need
    to be reformatted when the next commit introduces a new
    3-digit state.

 src/utf8.cc | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
---
diff --git a/src/utf8.cc b/src/utf8.cc
index b0d96218..f5373bfb 100644
--- a/src/utf8.cc
+++ b/src/utf8.cc
@@ -25,6 +25,8 @@
 
 #include "utf8.hh"
 
+#define RJ vte::base::UTF8Decoder::REJECT
+
 uint8_t const vte::base::UTF8Decoder::kTable[] = {
         // The first part of the table maps bytes to character classes that
         // to reduce the size of the transition table and create bitmasks.
@@ -68,13 +70,13 @@ uint8_t const vte::base::UTF8Decoder::kTable[] = {
         /*
          0   1   2   3   4   5   6   7   8   9  10  11 // character class
         */
-         0, 12, 24, 36, 60, 96, 84, 12, 12, 12, 48, 72, // state 0 (accept)
-        12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, // state 12 (reject)
-        12,  0, 12, 12, 12, 12, 12,  0, 12,  0, 12, 12, // state 24
-        12, 24, 12, 12, 12, 12, 12, 24, 12, 24, 12, 12, // state 36
-        12, 12, 12, 12, 12, 12, 12, 24, 12, 12, 12, 12, // state 48
-        12, 24, 12, 12, 12, 12, 12, 12, 12, 24, 12, 12, // state 60
-        12, 12, 12, 12, 12, 12, 12, 36, 12, 36, 12, 12, // state 72
-        12, 36, 12, 12, 12, 12, 12, 36, 12, 36, 12, 12, // state 84
-        12, 36, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, // state 96
+         0, RJ, 24, 36, 60, 96, 84, RJ, RJ, RJ, 48, 72, // state 0 (accept)
+        RJ, RJ, RJ, RJ, RJ, RJ, RJ, RJ, RJ, RJ, RJ, RJ, // state 12 (reject)
+        RJ,  0, RJ, RJ, RJ, RJ, RJ,  0, RJ,  0, RJ, RJ, // state 24
+        RJ, 24, RJ, RJ, RJ, RJ, RJ, 24, RJ, 24, RJ, RJ, // state 36
+        RJ, RJ, RJ, RJ, RJ, RJ, RJ, 24, RJ, RJ, RJ, RJ, // state 48
+        RJ, 24, RJ, RJ, RJ, RJ, RJ, RJ, RJ, 24, RJ, RJ, // state 60
+        RJ, RJ, RJ, RJ, RJ, RJ, RJ, 36, RJ, 36, RJ, RJ, // state 72
+        RJ, 36, RJ, RJ, RJ, RJ, RJ, 36, RJ, 36, RJ, RJ, // state 84
+        RJ, 36, RJ, RJ, RJ, RJ, RJ, RJ, RJ, RJ, RJ, RJ, // state 96
 };


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]