зеркало из https://github.com/github/ruby.git
* ext/tk/tkutil/tkutil.c: follow the change of st.c (committed at Fri,
4 Mar 2005 15:47:47 +0900 by matz) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
40671c1c5d
Коммит
57b3ed4cda
|
@ -1,3 +1,8 @@
|
|||
Mon Mar 7 01:21:01 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
||||
|
||||
* ext/tk/tkutil/tkutil.c: follow the change of st.c (committed
|
||||
at Fri, 4 Mar 2005 15:47:47 +0900 by matz)
|
||||
|
||||
Mon Mar 7 00:01:55 2005 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
||||
|
||||
* ext/tk/tcltklib.c: fail to call TclTkLib.mainloop when $SAFE==4
|
||||
|
|
|
@ -8,20 +8,12 @@
|
|||
|
||||
************************************************/
|
||||
|
||||
#define TKUTIL_RELEASE_DATE "2005-03-02"
|
||||
#define TKUTIL_RELEASE_DATE "2005-03-07"
|
||||
|
||||
#include "ruby.h"
|
||||
#include "rubysig.h"
|
||||
#include "st.h"
|
||||
|
||||
/* check ruby_version */
|
||||
#include "version.h"
|
||||
#if RUBY_VERSION_MINOR == 9
|
||||
#define ST_FOREACH_PASS_ERR_ARG 1 /* Ruby 1.9 */
|
||||
#else
|
||||
#define ST_FOREACH_PASS_ERR_ARG 0 /* Ruby 1.8 (from 2005/02/08) */
|
||||
#endif
|
||||
|
||||
static VALUE cMethod;
|
||||
|
||||
static VALUE cTclTkLib;
|
||||
|
@ -207,36 +199,12 @@ fromUTF8_toDefaultEnc(str, self)
|
|||
return tk_fromUTF8(1, argv, self);
|
||||
}
|
||||
|
||||
|
||||
#if ST_FOREACH_PASS_ERR_ARG
|
||||
static void
|
||||
hash_check(err)
|
||||
int err;
|
||||
{
|
||||
if (err) {
|
||||
rb_raise(rb_eRuntimeError, "hash modified during iteration");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if ST_FOREACH_PASS_ERR_ARG
|
||||
static int
|
||||
to_strkey(key, value, hash, err)
|
||||
VALUE key;
|
||||
VALUE value;
|
||||
VALUE hash;
|
||||
int err;
|
||||
#else
|
||||
static int
|
||||
to_strkey(key, value, hash)
|
||||
VALUE key;
|
||||
VALUE value;
|
||||
VALUE hash;
|
||||
#endif
|
||||
{
|
||||
#if ST_FOREACH_PASS_ERR_ARG
|
||||
hash_check(err);
|
||||
#endif
|
||||
if (key == Qundef) return ST_CONTINUE;
|
||||
rb_hash_aset(hash, rb_funcall(key, ID_to_s, 0, 0), value);
|
||||
return ST_CHECK;
|
||||
|
@ -484,26 +452,14 @@ assoc2kv_enc(assoc, ary, self)
|
|||
}
|
||||
}
|
||||
|
||||
#if ST_FOREACH_PASS_ERR_ARG
|
||||
static int
|
||||
push_kv(key, val, args, err)
|
||||
VALUE key;
|
||||
VALUE val;
|
||||
VALUE args;
|
||||
int err;
|
||||
#else
|
||||
static int
|
||||
push_kv(key, val, args)
|
||||
VALUE key;
|
||||
VALUE val;
|
||||
VALUE args;
|
||||
#endif
|
||||
{
|
||||
volatile VALUE ary;
|
||||
|
||||
#if ST_FOREACH_PASS_ERR_ARG
|
||||
hash_check(err);
|
||||
#endif
|
||||
ary = RARRAY(args)->ptr[0];
|
||||
|
||||
if (key == Qundef) return ST_CONTINUE;
|
||||
|
@ -544,26 +500,14 @@ hash2kv(hash, ary, self)
|
|||
}
|
||||
}
|
||||
|
||||
#if ST_FOREACH_PASS_ERR_ARG
|
||||
static int
|
||||
push_kv_enc(key, val, args, err)
|
||||
VALUE key;
|
||||
VALUE val;
|
||||
VALUE args;
|
||||
int err;
|
||||
#else
|
||||
static int
|
||||
push_kv_enc(key, val, args)
|
||||
VALUE key;
|
||||
VALUE val;
|
||||
VALUE args;
|
||||
#endif
|
||||
{
|
||||
volatile VALUE ary;
|
||||
|
||||
#if ST_FOREACH_PASS_ERR_ARG
|
||||
hash_check(err);
|
||||
#endif
|
||||
ary = RARRAY(args)->ptr[0];
|
||||
|
||||
if (key == Qundef) return ST_CONTINUE;
|
||||
|
|
Загрузка…
Ссылка в новой задаче