Skip to content

Commit

Permalink
* include/ruby/oniguruma.h (OnigCodePoint): unsigned long to unsigned…
Browse files Browse the repository at this point in the history
… int.

* include/ruby/encoding.h (rb_enc_codepoint): ditto.

* encoding.c (rb_enc_codepoint): signed int to unsigned int.

* encoding.c (rb_enc_ascget): ditto.

* string.c (rb_str_casecmp): ditto.

* string.c (enc_succ_alnum_char): ditto.

* string.c (rb_str_inspect): ditto.

* string.c (rb_str_upcase_bang): ditto.

* string.c (rb_str_downcase_bang): ditto.

* string.c (rb_str_capitalize_bang): ditto.

* string.c (rb_str_swapcase_bang): ditto.

* string.c (struct tr): ditto.

* string.c (trnext): ditto.

* string.c (tr_trans): ditto.

* string.c (tr_setup_table): ditto.

* string.c (tr_find): ditto.

* string.c (rb_str_delete_bang): ditto.

* string.c (rb_str_squeeze_bang): ditto.

* string.c (rb_str_count): ditto.

* string.c (rb_str_split_m): ditto.

* string.c (rb_str_each_line): ditto.

* string.c (rb_str_lstrip_bang): ditto.

* string.c (rb_str_rstrip_bang): ditto.

* string.c (rb_str_intern): ditto.

* dir.c (char_casecmp): ditto.

* sprintf.c (rb_str_format): ditto.

* enc/emacs_mule.c (mbc_to_code): to be 32bit clean.

* enc/emacs_mule.c (code_to_mbc): ditto.

* enc/gb18030.c (mbc_to_code): ditto.

* enc/gb18030.c (code_to_mbc): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nurse committed Sep 11, 2008
1 parent 9886722 commit d51b061
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 63 deletions.
62 changes: 62 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,65 @@
Thu Sep 11 19:12:56 2008 NARUSE, Yui <[email protected]>

* include/ruby/oniguruma.h (OnigCodePoint): unsigned long to unsigned int.

* include/ruby/encoding.h (rb_enc_codepoint): ditto.

* encoding.c (rb_enc_codepoint): signed int to unsigned int.

* encoding.c (rb_enc_ascget): ditto.

* string.c (rb_str_casecmp): ditto.

* string.c (enc_succ_alnum_char): ditto.

* string.c (rb_str_inspect): ditto.

* string.c (rb_str_upcase_bang): ditto.

* string.c (rb_str_downcase_bang): ditto.

* string.c (rb_str_capitalize_bang): ditto.

* string.c (rb_str_swapcase_bang): ditto.

* string.c (struct tr): ditto.

* string.c (trnext): ditto.

* string.c (tr_trans): ditto.

* string.c (tr_setup_table): ditto.

* string.c (tr_find): ditto.

* string.c (rb_str_delete_bang): ditto.

* string.c (rb_str_squeeze_bang): ditto.

* string.c (rb_str_count): ditto.

* string.c (rb_str_split_m): ditto.

* string.c (rb_str_each_line): ditto.

* string.c (rb_str_lstrip_bang): ditto.

* string.c (rb_str_rstrip_bang): ditto.

* string.c (rb_str_intern): ditto.

* dir.c (char_casecmp): ditto.

* sprintf.c (rb_str_format): ditto.

* enc/emacs_mule.c (mbc_to_code): to be 32bit clean.

* enc/emacs_mule.c (code_to_mbc): ditto.

* enc/gb18030.c (mbc_to_code): ditto.

* enc/gb18030.c (code_to_mbc): ditto.

Thu Sep 11 19:09:25 2008 NARUSE, Yui <[email protected]>

* ext/iconv/iconv.c: add attention for machine independent.
Expand Down
2 changes: 1 addition & 1 deletion dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static int
char_casecmp(const char *p1, const char *p2, rb_encoding *enc, const int nocase)
{
const char *p1end, *p2end;
int c1, c2;
unsigned int c1, c2;

if (!*p1 || !*p2) return !!*p1 - !!*p2;
p1end = p1 + strlen(p1);
Expand Down
3 changes: 1 addition & 2 deletions enc/emacs_mule.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
c = *p++;
n <<= 8; n += c;
}
n &= 0x7FFFFFFF;
return n;
}

Expand All @@ -258,7 +257,7 @@ code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc)
{
UChar *p = buf;

if ((code & 0xff000000) != 0) *p++ = (UChar )(((code >> 24) | 0x80));
if ((code & 0xff000000) != 0) *p++ = (UChar )(((code >> 24) & 0xff));
if ((code & 0xff0000) != 0) *p++ = (UChar )(((code >> 16) & 0xff));
if ((code & 0xff00) != 0) *p++ = (UChar )(((code >> 8) & 0xff));
*p++ = (UChar )(code & 0xff);
Expand Down
4 changes: 0 additions & 4 deletions enc/gb18030.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,16 +178,12 @@ gb18030_mbc_to_code(const UChar* p, const UChar* end, OnigEncoding enc)
c = *p++;
n <<= 8; n += c;
}
n &= 0x7FFFFFFF;
return n;
}

static int
gb18030_code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc)
{
if ((code & 0xff000000) != 0) {
code |= 0x80000000;
}
return onigenc_mb4_code_to_mbc(enc, code, buf);
}

Expand Down
4 changes: 2 additions & 2 deletions encoding.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,7 +717,7 @@ rb_enc_precise_mbclen(const char *p, const char *e, rb_encoding *enc)
int
rb_enc_ascget(const char *p, const char *e, int *len, rb_encoding *enc)
{
int c, l;
unsigned int c, l;
if (e <= p)
return -1;
if (rb_enc_asciicompat(enc)) {
Expand All @@ -737,7 +737,7 @@ rb_enc_ascget(const char *p, const char *e, int *len, rb_encoding *enc)
return c;
}

int
unsigned int
rb_enc_codepoint(const char *p, const char *e, rb_encoding *enc)
{
int r;
Expand Down
2 changes: 1 addition & 1 deletion include/ruby/encoding.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ int rb_enc_precise_mbclen(const char *p, const char *e, rb_encoding *enc);
int rb_enc_ascget(const char *p, const char *e, int *len, rb_encoding *enc);

/* -> code or raise exception */
int rb_enc_codepoint(const char *p, const char *e, rb_encoding *enc);
unsigned int rb_enc_codepoint(const char *p, const char *e, rb_encoding *enc);
#define rb_enc_mbc_to_codepoint(p, e, enc) ONIGENC_MBC_TO_CODE(enc,(UChar*)(p),(UChar*)(e))

/* -> codelen>0 or raise exception */
Expand Down
2 changes: 1 addition & 1 deletion include/ruby/oniguruma.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ extern "C" {
#endif

typedef unsigned char OnigUChar;
typedef unsigned long OnigCodePoint;
typedef unsigned int OnigCodePoint;
typedef unsigned int OnigCtype;
typedef unsigned int OnigDistance;

Expand Down
3 changes: 2 additions & 1 deletion sprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,8 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
{
VALUE val = GETARG();
VALUE tmp;
int c, n;
unsigned int c;
int n;

tmp = rb_check_string_type(val);
if (!NIL_P(tmp)) {
Expand Down
Loading

0 comments on commit d51b061

Please sign in to comment.