summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authorS-H-GAMELINKS <gamelinks007@gmail.com>2022-10-23 15:00:55 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-10-23 17:38:59 +0900
commitc4089e65245aa00824c30fa7033a18cfa1c0e4c9 (patch)
tree273b22c86887b191b4881020fc5664478e99e5b0 /re.c
parent1e06ef1328880bf39a7e6d757678be619c21f0c1 (diff)
downloadruby-c4089e65245aa00824c30fa7033a18cfa1c0e4c9.tar.gz
Fix argument & Remove enum
Diffstat (limited to 're.c')
-rw-r--r--re.c12
1 files 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
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
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