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

ruby-changes:68281

From: Nobuyoshi <ko1@a...>
Date: Wed, 6 Oct 2021 14:03:55 +0900 (JST)
Subject: [ruby-changes:68281] 702a58e9e5 (master): Remove duplicate type qualifiers

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

From 702a58e9e5b20a2450e753227112842bea8e7df6 Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Wed, 6 Oct 2021 13:54:53 +0900
Subject: Remove duplicate type qualifiers

`rb_encoding` is defined as `const OnigEncodingType`.
Fix lots of C4114 warnings for each files by MSVC.
---
 include/ruby/internal/encoding/ctype.h    | 22 +++++++++++-----------
 include/ruby/internal/encoding/encoding.h | 18 +++++++++---------
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/include/ruby/internal/encoding/ctype.h b/include/ruby/internal/encoding/ctype.h
index 422e2b9c2d..64aaf0a990 100644
--- a/include/ruby/internal/encoding/ctype.h
+++ b/include/ruby/internal/encoding/ctype.h
@@ -40,7 +40,7 @@ RBIMPL_SYMBOL_EXPORT_BEGIN() https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/encoding/ctype.h#L40
  * @retval     otherwise  It is.
  */
 static inline bool
-rb_enc_is_newline(const char *p,  const char *e, const rb_encoding *enc)
+rb_enc_is_newline(const char *p,  const char *e, rb_encoding *enc)
 {
     OnigUChar *up = RBIMPL_CAST((OnigUChar *)p);
     OnigUChar *ue = RBIMPL_CAST((OnigUChar *)e);
@@ -60,7 +60,7 @@ rb_enc_is_newline(const char *p,  const char *e, const rb_encoding *enc) https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/encoding/ctype.h#L60
  * @retval     0    Otherwise.
  */
 static inline bool
-rb_enc_isctype(OnigCodePoint c, OnigCtype t, const rb_encoding *enc)
+rb_enc_isctype(OnigCodePoint c, OnigCtype t, rb_encoding *enc)
 {
     return ONIGENC_IS_CODE_CTYPE(enc, c, t);
 }
@@ -79,7 +79,7 @@ rb_enc_isctype(OnigCodePoint c, OnigCtype t, const rb_encoding *enc) https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/encoding/ctype.h#L79
  * (not a bug).  But there could be rooms for future extensions.
  */
 static inline bool
-rb_enc_isascii(OnigCodePoint c, const rb_encoding *enc)
+rb_enc_isascii(OnigCodePoint c, rb_encoding *enc)
 {
     return ONIGENC_IS_CODE_ASCII(c);
 }
@@ -93,7 +93,7 @@ rb_enc_isascii(OnigCodePoint c, const rb_encoding *enc) https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/encoding/ctype.h#L93
  * @retval     0    Otherwise.
  */
 static inline bool
-rb_enc_isalpha(OnigCodePoint c, const rb_encoding *enc)
+rb_enc_isalpha(OnigCodePoint c, rb_encoding *enc)
 {
     return ONIGENC_IS_CODE_ALPHA(enc, c);
 }
@@ -107,7 +107,7 @@ rb_enc_isalpha(OnigCodePoint c, const rb_encoding *enc) https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/encoding/ctype.h#L107
  * @retval     0    Otherwise.
  */
 static inline bool
-rb_enc_islower(OnigCodePoint c, const rb_encoding *enc)
+rb_enc_islower(OnigCodePoint c, rb_encoding *enc)
 {
     return ONIGENC_IS_CODE_LOWER(enc, c);
 }
@@ -121,7 +121,7 @@ rb_enc_islower(OnigCodePoint c, const rb_encoding *enc) https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/encoding/ctype.h#L121
  * @retval     0    Otherwise.
  */
 static inline bool
-rb_enc_isupper(OnigCodePoint c, const rb_encoding *enc)
+rb_enc_isupper(OnigCodePoint c, rb_encoding *enc)
 {
     return ONIGENC_IS_CODE_UPPER(enc, c);
 }
@@ -135,7 +135,7 @@ rb_enc_isupper(OnigCodePoint c, const rb_encoding *enc) https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/encoding/ctype.h#L135
  * @retval     0    Otherwise.
  */
 static inline bool
-rb_enc_ispunct(OnigCodePoint c, const rb_encoding *enc)
+rb_enc_ispunct(OnigCodePoint c, rb_encoding *enc)
 {
     return ONIGENC_IS_CODE_PUNCT(enc, c);
 }
@@ -149,7 +149,7 @@ rb_enc_ispunct(OnigCodePoint c, const rb_encoding *enc) https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/encoding/ctype.h#L149
  * @retval     0    Otherwise.
  */
 static inline bool
-rb_enc_isalnum(OnigCodePoint c, const rb_encoding *enc)
+rb_enc_isalnum(OnigCodePoint c, rb_encoding *enc)
 {
     return ONIGENC_IS_CODE_ALNUM(enc, c);
 }
@@ -163,7 +163,7 @@ rb_enc_isalnum(OnigCodePoint c, const rb_encoding *enc) https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/encoding/ctype.h#L163
  * @retval     0    Otherwise.
  */
 static inline bool
-rb_enc_isprint(OnigCodePoint c, const rb_encoding *enc)
+rb_enc_isprint(OnigCodePoint c, rb_encoding *enc)
 {
     return ONIGENC_IS_CODE_PRINT(enc, c);
 }
@@ -177,7 +177,7 @@ rb_enc_isprint(OnigCodePoint c, const rb_encoding *enc) https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/encoding/ctype.h#L177
  * @retval     0    Otherwise.
  */
 static inline bool
-rb_enc_isspace(OnigCodePoint c, const rb_encoding *enc)
+rb_enc_isspace(OnigCodePoint c, rb_encoding *enc)
 {
     return ONIGENC_IS_CODE_SPACE(enc, c);
 }
@@ -191,7 +191,7 @@ rb_enc_isspace(OnigCodePoint c, const rb_encoding *enc) https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/encoding/ctype.h#L191
  * @retval     0    Otherwise.
  */
 static inline bool
-rb_enc_isdigit(OnigCodePoint c, const rb_encoding *enc)
+rb_enc_isdigit(OnigCodePoint c, rb_encoding *enc)
 {
     return ONIGENC_IS_CODE_DIGIT(enc, c);
 }
diff --git a/include/ruby/internal/encoding/encoding.h b/include/ruby/internal/encoding/encoding.h
index b4274b7f55..33f7f27fc1 100644
--- a/include/ruby/internal/encoding/encoding.h
+++ b/include/ruby/internal/encoding/encoding.h
@@ -430,7 +430,7 @@ rb_encoding *rb_enc_find(const char *name); https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/encoding/encoding.h#L430
  * @return     Its name.
  */
 static inline const char *
-rb_enc_name(const rb_encoding *enc)
+rb_enc_name(rb_encoding *enc)
 {
     return enc->name;
 }
@@ -445,7 +445,7 @@ rb_enc_name(const rb_encoding *enc) https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/encoding/encoding.h#L445
  * @return     Its least possible number of bytes except 0.
  */
 static inline int
-rb_enc_mbminlen(const rb_encoding *enc)
+rb_enc_mbminlen(rb_encoding *enc)
 {
     return enc->min_enc_len;
 }
@@ -460,7 +460,7 @@ rb_enc_mbminlen(const rb_encoding *enc) https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/encoding/encoding.h#L460
  * @return     Its maximum possible number of bytes of a character.
  */
 static inline int
-rb_enc_mbmaxlen(const rb_encoding *enc)
+rb_enc_mbmaxlen(rb_encoding *enc)
 {
     return enc->max_enc_len;
 }
@@ -604,7 +604,7 @@ rb_enc_codepoint(const char *p, const char *e, rb_encoding *enc) https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/encoding/encoding.h#L604
  * @return      Code point of the character pointed by `p`.
  */
 static inline OnigCodePoint
-rb_enc_mbc_to_codepoint(const char *p, const char *e, const rb_encoding *enc)
+rb_enc_mbc_to_codepoint(const char *p, const char *e, rb_encoding *enc)
 {
     const OnigUChar *up = RBIMPL_CAST((const OnigUChar *)p);
     const OnigUChar *ue = RBIMPL_CAST((const OnigUChar *)e);
@@ -632,7 +632,7 @@ int rb_enc_codelen(int code, rb_encoding *enc); https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/encoding/encoding.h#L632
  * @return     otherwise  Number of bytes used for `enc` to encode `code`.
  */
 static inline int
-rb_enc_code_to_mbclen(int c, const rb_encoding *enc)
+rb_enc_code_to_mbclen(int c, rb_encoding *enc)
 {
     OnigCodePoint uc = RBIMPL_CAST((OnigCodePoint)c);
 
@@ -654,7 +654,7 @@ rb_enc_code_to_mbclen(int c, const rb_encoding *enc) https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/encoding/encoding.h#L654
  * being any stricter than this. :FIXME:
  */
 static inline int
-rb_enc_mbcput(unsigned int c, void *buf, const rb_encoding *enc)
+rb_enc_mbcput(unsigned int c, void *buf, rb_encoding *enc)
 {
     OnigCodePoint uc = RBIMPL_CAST((OnigCodePoint)c);
     OnigUChar *ubuf = RBIMPL_CAST((OnigUChar *)buf);
@@ -673,7 +673,7 @@ rb_enc_mbcput(unsigned int c, void *buf, const rb_encoding *enc) https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/encoding/encoding.h#L673
  * @retval     otherwise  Pointer to the head of the previous character.
  */
 static inline char *
-rb_enc_prev_char(const char *s, const char *p, const char *e, const rb_encoding *enc)
+rb_enc_prev_char(const char *s, const char *p, const char *e, rb_encoding *enc)
 {
     const OnigUChar *us = RBIMPL_CAST((const OnigUChar *)s);
     const OnigUChar *up = RBIMPL_CAST((const OnigUChar *)p);
@@ -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 char *p, const char *e, rb_encoding *enc)
 {
     const OnigUChar *us = RBIMPL_CAST((const OnigUChar *)s);
     const OnigUChar *up = RBIMPL_CAST((const OnigUChar *)p);
@@ -737,7 +737,7 @@ rb_enc_right_char_head(const char *s, const char *p, const char *e, rb_encoding https://github.com/ruby/ruby/blob/trunk/include/ruby/internal/encoding/encoding.h#L737
  * @retval     otherwise  Pointer to `n` character before `p`.
  */
 static inline char *
-rb_enc_step_back(const char *s, const char *p, const char *e, int n, const rb_encoding *enc)
+rb_enc_step_back(const char *s, const char *p, const char *e, int n, rb_encoding *enc)
 {
     const OnigUChar *us = RBIMPL_CAST((const OnigUChar *)s);
     const OnigUChar *up = RBIMPL_CAST((const OnigUChar *)p);
-- 
cgit v1.2.1


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

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