From e5ee788d6fc8d1723c0f0f8310d6fe055cc821be Mon Sep 17 00:00:00 2001 From: dyb Date: Wed, 11 Oct 2017 16:35:24 -0400 Subject: [PATCH] - renamed s_gettime => S_gettime to remain consistent with the convention that the only undocumented externs are prefixed with S_. externs.h, stats.c, thread.c original commit: 898c3941d807a18c393a4575a72283e3671ee7e5 --- LOG | 4 ++++ c/externs.h | 2 +- c/stats.c | 22 +++++++++++----------- c/thread.c | 4 ++-- 4 files changed, 18 insertions(+), 14 deletions(-) diff --git a/LOG b/LOG index 7f05f860fe..7583cafa71 100644 --- a/LOG +++ b/LOG @@ -588,3 +588,7 @@ cp0.ss primdata.ss fx.ms +- renamed s_gettime => S_gettime to remain consistent with the + convention that the only undocumented externs are prefixed with + S_. + externs.h, stats.c, thread.c diff --git a/c/externs.h b/c/externs.h index 8014632f5b..45b8b02ad9 100644 --- a/c/externs.h +++ b/c/externs.h @@ -321,7 +321,7 @@ extern ptr S_gmtime PROTO((ptr tzoff, ptr tspair)); extern ptr S_asctime PROTO((ptr dtvec)); extern ptr S_mktime PROTO((ptr dtvec)); extern ptr S_unique_id PROTO((void)); -extern void s_gettime PROTO((INT typeno, struct timespec *tp)); +extern void S_gettime PROTO((INT typeno, struct timespec *tp)); /* symbol.c */ extern ptr S_symbol_value PROTO((ptr sym)); diff --git a/c/stats.c b/c/stats.c index 48034f3917..820db2ace9 100644 --- a/c/stats.c +++ b/c/stats.c @@ -119,7 +119,7 @@ typedef void (WINAPI *GetSystemTimeAsFileTime_t)(LPFILETIME lpSystemTimeAsFileTi static GetSystemTimeAsFileTime_t s_GetSystemTimeAsFileTime = GetSystemTimeAsFileTime; -void s_gettime(INT typeno, struct timespec *tp) { +void S_gettime(INT typeno, struct timespec *tp) { switch (typeno) { case time_process: { FILETIME ftKernel, ftUser, ftDummy; @@ -205,7 +205,7 @@ void s_gettime(INT typeno, struct timespec *tp) { } default: - S_error1("s_gettime", "unexpected typeno ~s", Sinteger(typeno)); + S_error1("S_gettime", "unexpected typeno ~s", Sinteger(typeno)); break; } } @@ -228,7 +228,7 @@ static char *asctime_r(const struct tm *tm, char *buf) { #else /* WIN32 */ -void s_gettime(INT typeno, struct timespec *tp) { +void S_gettime(INT typeno, struct timespec *tp) { switch (typeno) { case time_thread: #ifdef CLOCK_THREAD_CPUTIME_ID @@ -244,7 +244,7 @@ void s_gettime(INT typeno, struct timespec *tp) { struct rusage rbuf; if (getrusage(RUSAGE_SELF,&rbuf) != 0) - S_error1("s_gettime", "failed: ~s", S_strerror(errno)); + S_error1("S_gettime", "failed: ~s", S_strerror(errno)); tp->tv_sec = rbuf.ru_utime.tv_sec + rbuf.ru_stime.tv_sec; tp->tv_nsec = (rbuf.ru_utime.tv_usec + rbuf.ru_stime.tv_usec) * 1000; if (tp->tv_nsec >= 1000000000) { @@ -277,13 +277,13 @@ void s_gettime(INT typeno, struct timespec *tp) { struct timeval tvtp; if (gettimeofday(&tvtp,NULL) != 0) - S_error1("s_gettime", "failed: ~s", S_strerror(errno)); + S_error1("S_gettime", "failed: ~s", S_strerror(errno)); tp->tv_sec = (time_t)tvtp.tv_sec; tp->tv_nsec = (long)(tvtp.tv_usec * 1000); return; } default: - S_error1("s_gettime", "unexpected typeno ~s", Sinteger(typeno)); + S_error1("S_gettime", "unexpected typeno ~s", Sinteger(typeno)); break; } } @@ -294,7 +294,7 @@ ptr S_clock_gettime(I32 typeno) { struct timespec tp; time_t sec; I32 nsec; - s_gettime(typeno, &tp); + S_gettime(typeno, &tp); sec = tp.tv_sec; nsec = tp.tv_nsec; @@ -319,7 +319,7 @@ ptr S_gmtime(ptr tzoff, ptr tspair) { if (tspair == Sfalse) { struct timespec tp; - s_gettime(time_utc, &tp); + S_gettime(time_utc, &tp); tx = tp.tv_sec; INITVECTIT(dtvec, dtvec_nsec) = Sinteger(tp.tv_nsec); } else { @@ -472,7 +472,7 @@ static long adjust_time_zone(ptr dtvec, struct tm *tmxp, ptr given_tzoff) { ptr S_cputime(void) { struct timespec tp; - s_gettime(time_process, &tp); + S_gettime(time_process, &tp); return S_add(S_mul(S_integer_time_t(tp.tv_sec), FIX(1000)), Sinteger((tp.tv_nsec + 500000) / 1000000)); } @@ -481,7 +481,7 @@ ptr S_realtime(void) { struct timespec tp; time_t sec; I32 nsec; - s_gettime(time_monotonic, &tp); + S_gettime(time_monotonic, &tp); sec = tp.tv_sec - starting_mono_tp.tv_sec; nsec = tp.tv_nsec - starting_mono_tp.tv_nsec; @@ -507,5 +507,5 @@ void S_stats_init() { FreeLibrary(h); } #endif - s_gettime(time_monotonic, &starting_mono_tp); + S_gettime(time_monotonic, &starting_mono_tp); } diff --git a/c/thread.c b/c/thread.c index 88395dea98..51b135c920 100644 --- a/c/thread.c +++ b/c/thread.c @@ -337,7 +337,7 @@ void S_condition_free(c) s_thread_cond_t *c; { static inline int s_thread_cond_timedwait(s_thread_cond_t *cond, s_thread_mutex_t *mutex, int typeno, long sec, long nsec) { if (typeno == time_utc) { struct timespec now; - s_gettime(time_utc, &now); + S_gettime(time_utc, &now); sec -= (long)now.tv_sec; nsec -= now.tv_nsec; if (nsec < 0) { @@ -364,7 +364,7 @@ static inline int s_thread_cond_timedwait(s_thread_cond_t *cond, s_thread_mutex_ struct timespec t; if (typeno == time_duration) { struct timespec now; - s_gettime(time_utc, &now); + S_gettime(time_utc, &now); t.tv_sec = now.tv_sec + sec; t.tv_nsec = now.tv_nsec + nsec; if (t.tv_nsec >= 1000000000) {