[前][次][番号順一覧][スレッド一覧]

ruby-changes:74212

From: S-H-GAMELINKS <ko1@a...>
Date: Sun, 23 Oct 2022 17:39:22 +0900 (JST)
Subject: [ruby-changes:74212] c4089e6524 (master): Fix argument & Remove enum

https://git.ruby-lang.org/ruby.git/commit/?id=c4089e6524

From c4089e65245aa00824c30fa7033a18cfa1c0e4c9 Mon Sep 17 00:00:00 2001
From: S-H-GAMELINKS <gamelinks007@g...>
Date: Sun, 23 Oct 2022 15:00:55 +0900
Subject: Fix argument & Remove enum

---
 re.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/re.c b/re.c
index d66f389c6f..e16e631a15 100644
--- a/re.c
+++ b/re.c
@@ -220,14 +220,8 @@ rb_memsearch_qs_utf8(const unsigned char *xs, long m, const unsigned char *ys, l https://github.com/ruby/ruby/blob/trunk/re.c#L220
     return -1;
 }
 
-enum char_size
-{
-    WCHAR_SIZE = 2,
-    QCHAR_SIZE = 4
-};
-
 static inline long
-rb_memsearch_with_char_size(const unsigned char *xs, long m, const unsigned char *ys, long n, enum char_size char_size)
+rb_memsearch_with_char_size(const unsigned char *xs, long m, const unsigned char *ys, long n, int char_size)
 {
     const unsigned char *x = xs, x0 = *xs, *y = ys;
 
@@ -241,13 +235,13 @@ rb_memsearch_with_char_size(const unsigned char *xs, long m, const unsigned char https://github.com/ruby/ruby/blob/trunk/re.c#L235
 static inline long
 rb_memsearch_wchar(const unsigned char *xs, long m, const unsigned char *ys, long n)
 {
-    return rb_memsearch_with_char_size(xs, m, ys, n, WCHAR_SIZE);
+    return rb_memsearch_with_char_size(xs, m, ys, n, 2);
 }
 
 static inline long
 rb_memsearch_qchar(const unsigned char *xs, long m, const unsigned char *ys, long n)
 {
-    return rb_memsearch_with_char_size(xs, m, ys, n, QCHAR_SIZE);
+    return rb_memsearch_with_char_size(xs, m, ys, n, 4);
 }
 
 long
-- 
cgit v1.2.3


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]