File: 0001-utftab-refactor.patch

package info (click to toggle)
chromium 139.0.7258.127-2
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 6,122,156 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (50 lines) | stat: -rw-r--r-- 1,855 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
From 791f91a0169528abfe02ab9893fd4dab72b362c1 Mon Sep 17 00:00:00 2001
From: Sophie Chang <sophiechang@chromium.org>
Date: Wed, 3 Feb 2021 04:42:04 +0000
Subject: [PATCH] utftab refactor

---
 third_party/utf/src/utf/chartorune.c |  8 --------
 third_party/utf/src/utf/utftab.c     | 11 +++++++++++
 2 files changed, 11 insertions(+), 8 deletions(-)
 create mode 100644 third_party/utf/src/utf/utftab.c

diff --git a/third_party/utf/src/utf/chartorune.c b/third_party/utf/src/utf/chartorune.c
index f5ed9a8c077c..3073d23de245 100644
--- a/third_party/utf/src/utf/chartorune.c
+++ b/third_party/utf/src/utf/chartorune.c
@@ -1,14 +1,6 @@
 /* See LICENSE file for copyright and license details. */
 #include "utf.h"
 
-/* lookup table for the number of bytes expected in a sequence */
-const unsigned char utftab[64] = {
-	0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 1100xxxx */
-	2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 1101xxxx */
-	3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 1110xxxx */
-	4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 0, 0, /* 1111xxxx */
-};
-
 int
 charntorune(Rune *p, const char *s, size_t len)
 {
diff --git a/third_party/utf/src/utf/utftab.c b/third_party/utf/src/utf/utftab.c
new file mode 100644
index 000000000000..141580c16d9a
--- /dev/null
+++ b/third_party/utf/src/utf/utftab.c
@@ -0,0 +1,11 @@
+/* See LICENSE file for copyright and license details. */
+#include "utf.h"
+
+/* lookup table for the number of bytes expected in a sequence */
+const unsigned char utftab[64] = {
+        0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 1100xxxx */
+        2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 1101xxxx */
+        3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 1110xxxx */
+        4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 0, 0, /* 1111xxxx */
+};
+
-- 
2.30.0.365.g02bc693789-goog