From 1bf9865d26afea2137b5b304fb47ef8def70641e Mon Sep 17 00:00:00 2001 From: Gary Houston Date: Sun, 6 Apr 1997 00:00:10 +0000 Subject: [PATCH] * stime.c (scm_init_stime): don't define ticks/sec. (scm_gettimeofday): renamed from scm_time_plus_ticks (avoids multiple return value problem and is still portable.) --- libguile/ChangeLog | 6 ++++++ libguile/stime.c | 22 +++++----------------- libguile/stime.h | 2 +- 3 files changed, 12 insertions(+), 18 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 869cadbd7..3c026cc5f 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,9 @@ +Sat Apr 5 23:56:40 1997 Gary Houston + + * stime.c (scm_init_stime): don't define ticks/sec. + (scm_gettimeofday): renamed from scm_time_plus_ticks (avoids multiple + return value problem and is still portable.) + Sat Apr 5 17:59:24 1997 Jim Blandy * cpp_err_symbols.in: Renamed from cpp_err_symbols, to avoid diff --git a/libguile/stime.c b/libguile/stime.c index be2adbf4b..a29fceb3a 100644 --- a/libguile/stime.c +++ b/libguile/stime.c @@ -183,16 +183,16 @@ scm_current_time() return scm_long2num((long) timv); } -SCM_PROC (s_time_plus_ticks, "time+ticks", 0, 0, 0, scm_time_plus_ticks); +SCM_PROC (s_gettimeofday, "gettimeofday", 0, 0, 0, scm_gettimeofday); SCM -scm_time_plus_ticks (void) +scm_gettimeofday (void) { #ifdef HAVE_GETTIMEOFDAY struct timeval time; SCM_DEFER_INTS; if (gettimeofday (&time, NULL) == -1) - scm_syserror (s_time_plus_ticks); + scm_syserror (s_gettimeofday); SCM_ALLOW_INTS; return scm_cons (scm_long2num ((long) time.tv_sec), scm_long2num ((long) time.tv_usec)); @@ -202,13 +202,13 @@ scm_time_plus_ticks (void) ftime(&time); return scm_cons (scm_long2num ((long) time.time), - SCM_MAKINUM (time.millitm)); + SCM_MAKINUM (time.millitm) * 1000); # else timet timv; SCM_DEFER_INTS; if ((timv = time (0)) == -1) - scm_syserror (s_time_plus_ticks); + scm_syserror (s_gettimeofday); SCM_ALLOW_INTS; return scm_cons (scm_long2num (timv), SCM_MAKINUM (0)); # endif @@ -405,18 +405,6 @@ scm_init_stime() if (!scm_your_base) time(&scm_your_base); #endif - scm_sysintern("ticks/sec", -#ifdef HAVE_GETTIMEOFDAY - scm_long2num ((long) 1000000) -#else -# ifdef HAVE_FTIME - SCM_MAKINUM (1000) -# else - SCM_MAKINUM (1) -# endif -#endif - ); - if (!scm_my_base) scm_my_base = mytime(); scm_add_feature ("current-time"); diff --git a/libguile/stime.h b/libguile/stime.h index 2e0e38371..6acee3a8e 100644 --- a/libguile/stime.h +++ b/libguile/stime.h @@ -50,7 +50,7 @@ extern SCM scm_get_internal_real_time SCM_P ((void)); extern SCM scm_get_internal_run_time SCM_P ((void)); extern SCM scm_current_time SCM_P ((void)); -extern SCM scm_time_plus_ticks (void); +extern SCM scm_gettimeofday (void); extern SCM scm_localtime (SCM time, SCM zone); extern SCM scm_gmtime (SCM time); extern SCM scm_mktime (SCM sbd_time);