[前][次][番号順一覧][スレッド一覧]

ruby-changes:19143

From: naruse <ko1@a...>
Date: Sat, 26 Mar 2011 05:31:00 +0900 (JST)
Subject: [ruby-changes:19143] Ruby:r31182 (trunk): time(3)'s argument and return value is time_t.

naruse	2011-03-26 05:29:53 +0900 (Sat, 26 Mar 2011)

  New Revision: 31182

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31182

  Log:
    time(3)'s argument and return value is time_t.

  Modified files:
    trunk/ext/date/date_strftime.c

Index: ext/date/date_strftime.c
===================================================================
--- ext/date/date_strftime.c	(revision 31181)
+++ ext/date/date_strftime.c	(revision 31182)
@@ -1134,6 +1134,7 @@
 #ifndef NULL
 #include	<stdio.h>
 #endif
+#include	<time.h>
 #include	<sys/time.h>
 #include	<string.h>
 
@@ -1191,8 +1192,6 @@
 int argc;
 char **argv;
 {
-	long time();
-
 	char *next;
 	char string[MAXTIME];
 
@@ -1201,11 +1200,11 @@
 
 	struct tm *tm;
 
-	long clock;
+	time_t clock;
 
 	/* Call the function. */
 
-	clock = time((long *) 0);
+	clock = time(NULL);
 	tm = localtime(&clock);
 
 	for (k = 0; next = array[k]; k++) {

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]