ruby-changes:27958
From: nobu <ko1@a...>
Date: Sun, 31 Mar 2013 06:08:51 +0900 (JST)
Subject: [ruby-changes:27958] nobu:r40010 (trunk): thread.c: format specifiers for time_t
nobu 2013-03-31 06:08:34 +0900 (Sun, 31 Mar 2013) New Revision: 40010 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=40010 Log: thread.c: format specifiers for time_t * thread.c (sleep_timeval): fix format specifiers for time_t. * time.c (DEBUG_REPORT_GUESSRANGE): ditto. Modified files: trunk/thread.c trunk/time.c Index: time.c =================================================================== --- time.c (revision 40009) +++ time.c (revision 40010) @@ -2794,7 +2794,7 @@ timegm_noleapsecond(struct tm *tm) https://github.com/ruby/ruby/blob/trunk/time.c#L2794 #endif #ifdef DEBUG_GUESSRANGE -#define DEBUG_REPORT_GUESSRANGE fprintf(stderr, "find time guess range: %ld - %ld : %lu\n", guess_lo, guess_hi, (unsigned_time_t)(guess_hi-guess_lo)) +#define DEBUG_REPORT_GUESSRANGE fprintf(stderr, "find time guess range: %ld - %ld : %"PRI_TIMET_PREFIX"u\n", guess_lo, guess_hi, (unsigned_time_t)(guess_hi-guess_lo)) #else #define DEBUG_REPORT_GUESSRANGE #endif Index: thread.c =================================================================== --- thread.c (revision 40009) +++ thread.c (revision 40010) @@ -996,9 +996,9 @@ sleep_timeval(rb_thread_t *th, struct ti https://github.com/ruby/ruby/blob/trunk/thread.c#L996 getclockofday(&tvn); if (to.tv_sec < tvn.tv_sec) break; if (to.tv_sec == tvn.tv_sec && to.tv_usec <= tvn.tv_usec) break; - thread_debug("sleep_timeval: %ld.%.6ld > %ld.%.6ld\n", - (long)to.tv_sec, (long)to.tv_usec, - (long)tvn.tv_sec, (long)tvn.tv_usec); + thread_debug("sleep_timeval: %"PRI_TIMET_PREFIX"d.%.6ld > %"PRI_TIMET_PREFIX"d.%.6ld\n", + (time_t)to.tv_sec, (long)to.tv_usec, + (time_t)tvn.tv_sec, (long)tvn.tv_usec); tv.tv_sec = to.tv_sec - tvn.tv_sec; if ((tv.tv_usec = to.tv_usec - tvn.tv_usec) < 0) { --tv.tv_sec; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/