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

ruby-changes:68261

From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Tue, 5 Oct 2021 14:18:43 +0900 (JST)
Subject: [ruby-changes:68261] f032c09bca (master): rb_enc_left_char_head(): take void*

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

From f032c09bca96d82ce5fe935c99afed4c3fc2dbea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?=
 <shyouhei@r...>
Date: Tue, 5 Oct 2021 11:39:05 +0900
Subject: rb_enc_left_char_head(): take void*

Nobu doesn't like (char*) cast.
---
 include/ruby/internal/encoding/encoding.h | 2 +-
 string.c                                  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/ruby/internal/encoding/encoding.h b/include/ruby/internal/encoding/encoding.h
index b4274b7f55..ae2e15773d 100644
--- a/include/ruby/internal/encoding/encoding.h
+++ b/include/ruby/internal/encoding/encoding.h
@@ -694,7 +694,7 @@ rb_enc_prev_char(const char *s, const char *p, const char *e, const rb_encoding https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/encoding/encoding.h#L694
  * @return     Pointer to the head of the character that contains `p`.
  */
 static inline char *
-rb_enc_left_char_head(const char *s, const char *p, const char *e, const rb_encoding *enc)
+rb_enc_left_char_head(const char *s, const void *p, const char *e, const rb_encoding *enc)
 {
     const OnigUChar *us = RBIMPL_CAST((const OnigUChar *)s);
     const OnigUChar *up = RBIMPL_CAST((const OnigUChar *)p);
diff --git a/string.c b/string.c
index 3717493fa1..3f588dfbb1 100644
--- a/string.c
+++ b/string.c
@@ -5738,7 +5738,7 @@ rb_str_setbyte(VALUE str, VALUE index, VALUE value) https://github.com/ruby/ruby/blob/trunk/string.c#L5738
 		ENC_CODERANGE_SET(str, ENC_CODERANGE_VALID);
 	    goto end;
 	  case ENC_CODERANGE_VALID:
-            left = rb_enc_left_char_head(head, (char *)ptr, head+len, enc);
+	    left = rb_enc_left_char_head(head, ptr, head+len, enc);
 	    width = rb_enc_precise_mbclen(left, head+len, enc);
 	    *ptr = byte;
 	    nlen = rb_enc_precise_mbclen(left, head+len, enc);
-- 
cgit v1.2.1


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

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