mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* enc/shift_jis.c (code_to_mbc): cast as int from the subtraction of pointers.
* enc/utf_16le.c (utf16le_mbc_enc_len): use ptrdiff_t. * enc/utf_32be.c (utf32be_left_adjust_char_head): ditto. * enc/utf_32le.c (utf32le_left_adjust_char_head): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a3b4b499a5
commit
10354c7b5c
5 changed files with 15 additions and 4 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
Thu Feb 3 16:34:10 2011 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* enc/shift_jis.c (code_to_mbc): cast as int from the subtraction of pointers.
|
||||||
|
|
||||||
|
* enc/utf_16le.c (utf16le_mbc_enc_len): use ptrdiff_t.
|
||||||
|
|
||||||
|
* enc/utf_32be.c (utf32be_left_adjust_char_head): ditto.
|
||||||
|
|
||||||
|
* enc/utf_32le.c (utf32le_left_adjust_char_head): ditto.
|
||||||
|
|
||||||
Thu Feb 3 16:31:43 2011 NARUSE, Yui <naruse@ruby-lang.org>
|
Thu Feb 3 16:31:43 2011 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
* include/ruby/missing.h: don't use HAVE_STDDEF_H because it never
|
* include/ruby/missing.h: don't use HAVE_STDDEF_H because it never
|
||||||
|
|
|
@ -175,7 +175,7 @@ code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc)
|
||||||
if (enclen(enc, buf) != (p - buf))
|
if (enclen(enc, buf) != (p - buf))
|
||||||
return REGERR_INVALID_CODE_POINT_VALUE;
|
return REGERR_INVALID_CODE_POINT_VALUE;
|
||||||
#endif
|
#endif
|
||||||
return p - buf;
|
return (int)(p - buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
|
@ -56,7 +56,8 @@ static int
|
||||||
utf16le_mbc_enc_len(const UChar* p, const OnigUChar* e,
|
utf16le_mbc_enc_len(const UChar* p, const OnigUChar* e,
|
||||||
OnigEncoding enc ARG_UNUSED)
|
OnigEncoding enc ARG_UNUSED)
|
||||||
{
|
{
|
||||||
int len = e-p, byte;
|
ptrdiff_t len = e - p;
|
||||||
|
UChar byte;
|
||||||
if (len < 2)
|
if (len < 2)
|
||||||
return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(1);
|
return ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(1);
|
||||||
byte = p[1];
|
byte = p[1];
|
||||||
|
|
|
@ -155,7 +155,7 @@ static UChar*
|
||||||
utf32be_left_adjust_char_head(const UChar* start, const UChar* s, const UChar* end,
|
utf32be_left_adjust_char_head(const UChar* start, const UChar* s, const UChar* end,
|
||||||
OnigEncoding enc ARG_UNUSED)
|
OnigEncoding enc ARG_UNUSED)
|
||||||
{
|
{
|
||||||
int rem;
|
ptrdiff_t rem;
|
||||||
|
|
||||||
if (s <= start) return (UChar* )s;
|
if (s <= start) return (UChar* )s;
|
||||||
|
|
||||||
|
|
|
@ -155,7 +155,7 @@ static UChar*
|
||||||
utf32le_left_adjust_char_head(const UChar* start, const UChar* s, const UChar* end,
|
utf32le_left_adjust_char_head(const UChar* start, const UChar* s, const UChar* end,
|
||||||
OnigEncoding enc ARG_UNUSED)
|
OnigEncoding enc ARG_UNUSED)
|
||||||
{
|
{
|
||||||
int rem;
|
ptrdiff_t rem;
|
||||||
|
|
||||||
if (s <= start) return (UChar* )s;
|
if (s <= start) return (UChar* )s;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue