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

ruby-changes:39629

From: nobu <ko1@a...>
Date: Fri, 28 Aug 2015 04:50:09 +0900 (JST)
Subject: [ruby-changes:39629] nobu:r51710 (trunk): oniguruma.h: constify

nobu	2015-08-28 04:49:45 +0900 (Fri, 28 Aug 2015)

  New Revision: 51710

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=51710

  Log:
    oniguruma.h: constify
    
    * include/ruby/oniguruma.h (OnigEncodingTypeST): constify
      property_name_to_ctype arguments.

  Modified files:
    trunk/enc/euc_jp.c
    trunk/enc/shift_jis.c
    trunk/enc/unicode.c
    trunk/include/ruby/oniguruma.h
    trunk/regenc.c
    trunk/regenc.h
Index: include/ruby/oniguruma.h
===================================================================
--- include/ruby/oniguruma.h	(revision 51709)
+++ include/ruby/oniguruma.h	(revision 51710)
@@ -167,7 +167,7 @@ typedef struct OnigEncodingTypeST { https://github.com/ruby/ruby/blob/trunk/include/ruby/oniguruma.h#L167
   int    (*mbc_case_fold)(OnigCaseFoldType flag, const OnigUChar** pp, const OnigUChar* end, OnigUChar* to, const struct OnigEncodingTypeST* enc);
   int    (*apply_all_case_fold)(OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void* arg, const struct OnigEncodingTypeST* enc);
   int    (*get_case_fold_codes_by_str)(OnigCaseFoldType flag, const OnigUChar* p, const OnigUChar* end, OnigCaseFoldCodeItem acs[], const struct OnigEncodingTypeST* enc);
-  int    (*property_name_to_ctype)(const struct OnigEncodingTypeST* enc, OnigUChar* p, OnigUChar* end);
+  int    (*property_name_to_ctype)(const struct OnigEncodingTypeST* enc, const OnigUChar* p, const OnigUChar* end);
   int    (*is_code_ctype)(OnigCodePoint code, OnigCtype ctype, const struct OnigEncodingTypeST* enc);
   int    (*get_ctype_code_range)(OnigCtype ctype, OnigCodePoint* sb_out, const OnigCodePoint* ranges[], const struct OnigEncodingTypeST* enc);
   OnigUChar* (*left_adjust_char_head)(const OnigUChar* start, const OnigUChar* p, const OnigUChar* end, const struct OnigEncodingTypeST* enc);
Index: regenc.c
===================================================================
--- regenc.c	(revision 51709)
+++ regenc.c	(revision 51710)
@@ -790,7 +790,7 @@ onigenc_mb4_code_to_mbc(OnigEncoding enc https://github.com/ruby/ruby/blob/trunk/regenc.c#L790
 }
 
 extern int
-onigenc_minimum_property_name_to_ctype(OnigEncoding enc, UChar* p, UChar* end)
+onigenc_minimum_property_name_to_ctype(OnigEncoding enc, const UChar* p, const UChar* end)
 {
   static const PosixBracketEntryType PBS[] = {
     POSIX_BRACKET_ENTRY_INIT("Alnum",  ONIGENC_CTYPE_ALNUM),
Index: regenc.h
===================================================================
--- regenc.h	(revision 51709)
+++ regenc.h	(revision 51710)
@@ -149,8 +149,8 @@ ONIG_EXTERN OnigCodePoint onigenc_mbn_mb https://github.com/ruby/ruby/blob/trunk/regenc.h#L149
 ONIG_EXTERN int onigenc_mbn_mbc_case_fold P_((OnigEncoding enc, OnigCaseFoldType flag, const UChar** p, const UChar* end, UChar* lower));
 ONIG_EXTERN int onigenc_mb2_code_to_mbclen P_((OnigCodePoint code, OnigEncoding enc));
 ONIG_EXTERN int onigenc_mb2_code_to_mbc P_((OnigEncoding enc, OnigCodePoint code, UChar *buf));
-ONIG_EXTERN int onigenc_minimum_property_name_to_ctype P_((OnigEncoding enc, UChar* p, UChar* end));
-ONIG_EXTERN int onigenc_unicode_property_name_to_ctype P_((OnigEncoding enc, UChar* p, UChar* end));
+ONIG_EXTERN int onigenc_minimum_property_name_to_ctype P_((OnigEncoding enc, const UChar* p, const UChar* end));
+ONIG_EXTERN int onigenc_unicode_property_name_to_ctype P_((OnigEncoding enc, const UChar* p, const UChar* end));
 ONIG_EXTERN int onigenc_mb2_is_code_ctype P_((OnigEncoding enc, OnigCodePoint code, unsigned int ctype));
 ONIG_EXTERN int onigenc_mb4_code_to_mbclen P_((OnigCodePoint code, OnigEncoding enc));
 ONIG_EXTERN int onigenc_mb4_code_to_mbc P_((OnigEncoding enc, OnigCodePoint code, UChar *buf));
Index: enc/euc_jp.c
===================================================================
--- enc/euc_jp.c	(revision 51709)
+++ enc/euc_jp.c	(revision 51710)
@@ -501,9 +501,9 @@ static const OnigCodePoint CR_Cyrillic[] https://github.com/ruby/ruby/blob/trunk/enc/euc_jp.c#L501
 #include "enc/jis/props.h"
 
 static int
-property_name_to_ctype(OnigEncoding enc, UChar* p, UChar* end)
+property_name_to_ctype(OnigEncoding enc, const UChar* p, const UChar* end)
 {
-  UChar *s = p, *e = end;
+  const UChar *s = p, *e = end;
   const struct enc_property *prop =
     onig_jis_property((const char* )s, (unsigned int )(e - s));
 
Index: enc/shift_jis.c
===================================================================
--- enc/shift_jis.c	(revision 51709)
+++ enc/shift_jis.c	(revision 51710)
@@ -490,9 +490,9 @@ static const OnigCodePoint CR_Cyrillic[] https://github.com/ruby/ruby/blob/trunk/enc/shift_jis.c#L490
 #include "enc/jis/props.h"
 
 static int
-property_name_to_ctype(OnigEncoding enc, UChar* p, UChar* end)
+property_name_to_ctype(OnigEncoding enc, const UChar* p, const UChar* end)
 {
-  UChar *s = p, *e = end;
+  const UChar *s = p, *e = end;
   const struct enc_property *prop =
     onig_jis_property((const char* )s, (unsigned int )(e - s));
 
Index: enc/unicode.c
===================================================================
--- enc/unicode.c	(revision 51709)
+++ enc/unicode.c	(revision 51710)
@@ -188,12 +188,12 @@ onigenc_utf16_32_get_ctype_code_range(On https://github.com/ruby/ruby/blob/trunk/enc/unicode.c#L188
 #define PROPERTY_NAME_MAX_SIZE    (MAX_WORD_LENGTH + 1)
 
 extern int
-onigenc_unicode_property_name_to_ctype(OnigEncoding enc, UChar* name, UChar* end)
+onigenc_unicode_property_name_to_ctype(OnigEncoding enc, const UChar* name, const UChar* end)
 {
   int len;
   int ctype;
   UChar buf[PROPERTY_NAME_MAX_SIZE];
-  UChar *p;
+  const UChar *p;
   OnigCodePoint code;
 
   len = 0;

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

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