From: Tilman Sauerbeck Date: Tue, 12 Apr 2005 18:38:31 +0000 (+0000) Subject: Don't pass VALUEs to rb_raise(). X-Git-Tag: ruby-eet-0.1.3~27 X-Git-Url: http://git.code-monkey.de/?a=commitdiff_plain;ds=inline;h=3eb6e149e8a04c8e9571588b1782b31891c70a90;p=ruby-eet.git Don't pass VALUEs to rb_raise(). --- diff --git a/ChangeLog b/ChangeLog index bef6415..c5872d4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,10 @@ -- -$Id: ChangeLog 29 2005-04-12 17:07:48Z tilman $ +$Id: ChangeLog 30 2005-04-12 18:38:31Z tilman $ ++ 2005-04-12 Tilman Sauerbeck (tilman at code-monkey de) * ext/ext.c: Code cleanup + * ext/ext.c: Don't pass VALUEs to rb_raise() 2005-04-11 Tilman Sauerbeck (tilman at code-monkey de) * ext/ext.c: Use StringValue() instead of diff --git a/ext/ext.c b/ext/ext.c index 485bfc6..1819958 100644 --- a/ext/ext.c +++ b/ext/ext.c @@ -1,5 +1,5 @@ /* - * $Id: ext.c 29 2005-04-12 17:07:48Z tilman $ + * $Id: ext.c 30 2005-04-12 18:38:31Z tilman $ * * Copyright (c) 2005 Tilman Sauerbeck (tilman at code-monkey de) * @@ -99,13 +99,13 @@ c_init (int argc, VALUE *argv, VALUE self) VALUE file = Qnil, mode = Qnil; Eet_File **ef = NULL; Eet_File_Mode m = EET_FILE_MODE_READ; - const char *tmp; + const char *tmp, *cfile; Data_Get_Struct (self, Eet_File *, ef); rb_scan_args (argc, argv, "11", &file, &mode); - StringValue (file); + cfile = StringValuePtr (file); if (!NIL_P (mode)) { StringValue (mode); @@ -121,7 +121,7 @@ c_init (int argc, VALUE *argv, VALUE self) eet_init (); - *ef = eet_open (StringValuePtr (file), m); + *ef = eet_open (cfile, m); if (!*ef) { switch (m) { case EET_FILE_MODE_READ_WRITE: @@ -133,7 +133,7 @@ c_init (int argc, VALUE *argv, VALUE self) break; } - rb_raise (rb_eRuntimeError, tmp, file); + rb_raise (rb_eRuntimeError, tmp, cfile); } return self;