• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

mrubyを超漢字で動作させる


コミットメタ情報

リビジョンe35c3aff83d400dfe27fe105b7e282ac81b1197a (tree)
日時2015-09-03 00:14:37
作者Yukihiro "Matz" Matsumoto <matz@ruby...>
コミッターYukihiro "Matz" Matsumoto

ログメッセージ

unsigned long may be smaller than mrb_int; use uint64_t instead; fix #2935

変更サマリ

差分

--- a/mrbgems/mruby-sprintf/src/sprintf.c
+++ b/mrbgems/mruby-sprintf/src/sprintf.c
@@ -73,7 +73,7 @@ mrb_fix2binstr(mrb_state *mrb, mrb_value x, int base)
7373 {
7474 char buf[64], *b = buf + sizeof buf;
7575 mrb_int num = mrb_fixnum(x);
76- unsigned long val = (unsigned long)num;
76+ uint64_t val = (uint64_t)num;
7777 char d;
7878
7979 if (base != 2) {
--- a/src/string.c
+++ b/src/string.c
@@ -1863,7 +1863,7 @@ mrb_cstr_to_inum(mrb_state *mrb, const char *str, int base, int badcheck)
18631863 const char *p;
18641864 char sign = 1;
18651865 int c, uscore;
1866- unsigned long n = 0;
1866+ uint64_t n = 0;
18671867 mrb_int val;
18681868
18691869 #define conv_digit(c) \
@@ -1983,9 +1983,9 @@ mrb_cstr_to_inum(mrb_state *mrb, const char *str, int base, int badcheck)
19831983 }
19841984 n *= base;
19851985 n += c;
1986- }
1987- if (n > MRB_INT_MAX) {
1988- mrb_raisef(mrb, E_ARGUMENT_ERROR, "string (%S) too big for integer", mrb_str_new_cstr(mrb, str));
1986+ if (n > MRB_INT_MAX) {
1987+ mrb_raisef(mrb, E_ARGUMENT_ERROR, "string (%S) too big for integer", mrb_str_new_cstr(mrb, str));
1988+ }
19891989 }
19901990 val = n;
19911991 if (badcheck) {