From 31df52073ab5faa38f3761af96aa701e2222491b Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 27 Aug 2015 19:49:45 +0000 Subject: oniguruma.h: constify * include/ruby/oniguruma.h (OnigEncodingTypeST): constify property_name_to_ctype arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- enc/euc_jp.c | 4 ++-- enc/shift_jis.c | 4 ++-- enc/unicode.c | 4 ++-- include/ruby/oniguruma.h | 2 +- regenc.c | 2 +- regenc.h | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/enc/euc_jp.c b/enc/euc_jp.c index 61bb8ba65a..d0852c3daa 100644 --- a/enc/euc_jp.c +++ b/enc/euc_jp.c @@ -501,9 +501,9 @@ static const OnigCodePoint CR_Cyrillic[] = { #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)); diff --git a/enc/shift_jis.c b/enc/shift_jis.c index cbd3f02051..165592c905 100644 --- a/enc/shift_jis.c +++ b/enc/shift_jis.c @@ -490,9 +490,9 @@ static const OnigCodePoint CR_Cyrillic[] = { #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)); diff --git a/enc/unicode.c b/enc/unicode.c index f0ef89880f..975fc2648e 100644 --- a/enc/unicode.c +++ b/enc/unicode.c @@ -188,12 +188,12 @@ onigenc_utf16_32_get_ctype_code_range(OnigCtype ctype, OnigCodePoint* sb_out, #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; diff --git a/include/ruby/oniguruma.h b/include/ruby/oniguruma.h index 2530f61427..519c0ac336 100644 --- a/include/ruby/oniguruma.h +++ b/include/ruby/oniguruma.h @@ -167,7 +167,7 @@ typedef struct OnigEncodingTypeST { 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); diff --git a/regenc.c b/regenc.c index 2683b826f2..c8f317c8d9 100644 --- a/regenc.c +++ b/regenc.c @@ -790,7 +790,7 @@ onigenc_mb4_code_to_mbc(OnigEncoding enc, OnigCodePoint code, UChar *buf) } 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), diff --git a/regenc.h b/regenc.h index 5e467961a1..273d1d3318 100644 --- a/regenc.h +++ b/regenc.h @@ -149,8 +149,8 @@ ONIG_EXTERN OnigCodePoint onigenc_mbn_mbc_to_code P_((OnigEncoding enc, const UC 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)); -- cgit v1.2.3