summaryrefslogtreecommitdiff
path: root/time.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-09 17:45:53 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-10-09 17:45:53 +0000
commit90a88ab9a09d19165cf3668b6a8473024e064fa7 (patch)
treee11fe4e2ab597cf512b2fd680b50c91cc0293a08 /time.c
parent80549d5f17e09173251204f08d288a71bad39256 (diff)
* marshal.c (r_object0): remove unnecessary iv restoration for
USRMARSHAL. [ruby-dev:21582] * marshal.c (w_object): dump generic instance variables from a string from '_dump'. * variable.c (rb_generic_ivar_table): return 0 if obj's FL_EXIVAR is not set. * time.c (time_dump): copy instance variables to dumped string, to be included in the marshaled data. * bignum.c (rb_big2ulong): add range check to ensure round trip. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'time.c')
-rw-r--r--time.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/time.c b/time.c
index 8c75b70..c0b1c38 100644
--- a/time.c
+++ b/time.c
@@ -1317,7 +1317,6 @@ time_mdump(time)
char buf[8];
time_t t;
int i;
- VALUE str;
GetTimeval(time, tobj);
@@ -1345,13 +1344,7 @@ time_mdump(time)
s = RSHIFT(s, 8);
}
- str = rb_str_new(buf, 8);
- if (FL_TEST(time, FL_EXIVAR)) {
- rb_copy_generic_ivar(str, time);
- FL_SET(str, FL_EXIVAR);
- }
-
- return str;
+ return rb_str_new(buf, 8);
}
static VALUE
@@ -1360,10 +1353,16 @@ time_dump(argc, argv, time)
VALUE *argv;
VALUE time;
{
- VALUE dummy;
+ VALUE str;
- rb_scan_args(argc, argv, "01", &dummy);
- return time_mdump(time);
+ rb_scan_args(argc, argv, "01", 0);
+ str = time_mdump(time);
+ if (FL_TEST(time, FL_EXIVAR)) {
+ rb_copy_generic_ivar(str, time);
+ FL_SET(str, FL_EXIVAR);
+ }
+
+ return str;
}
static VALUE