Skip to content

Commit

Permalink
oniguruma.h: constify
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
nobu committed Aug 27, 2015
1 parent 2ded8d0 commit 8b9ad9d
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions enc/euc_jp.c
Expand Up @@ -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));

Expand Down
4 changes: 2 additions & 2 deletions enc/shift_jis.c
Expand Up @@ -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));

Expand Down
4 changes: 2 additions & 2 deletions enc/unicode.c
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion include/ruby/oniguruma.h
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion regenc.c
Expand Up @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions regenc.h
Expand Up @@ -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));
Expand Down

0 comments on commit 8b9ad9d

Please sign in to comment.