This was supposed to happen ~8 months ago but I got sidetracked on the "how" of cleaning up the s_time and speed modules. I think I have an idea of how to attack that now so I want to close off this separate line of changes before starting in on that.
As suggested by jca@, change TM_START -> TM_RESET and TM_STOP -> TM_GET, which are more accurate descriptions of the operations taking place. Not going to do a complete find/replace for these constants and their module-local synonyms because I intend to refactor away a lot of the duplicate invocations therein. When that's done I will switch to the new names. ok? -- Scott Cheloha Index: usr.bin/openssl/apps.h =================================================================== RCS file: /cvs/src/usr.bin/openssl/apps.h,v retrieving revision 1.20 diff -u -p -r1.20 apps.h --- usr.bin/openssl/apps.h 5 Dec 2017 15:02:06 -0000 1.20 +++ usr.bin/openssl/apps.h 13 Jul 2018 14:36:17 -0000 @@ -277,10 +277,10 @@ unsigned char *next_protos_parse(unsigne int app_isdir(const char *); -#define TM_START 0 -#define TM_STOP 1 -double app_timer_real(int stop); -double app_timer_user(int stop); +#define TM_RESET 0 +#define TM_GET 1 +double app_timer_real(int); +double app_timer_user(int); #define OPENSSL_NO_SSL_INTERN Index: usr.bin/openssl/apps_posix.c =================================================================== RCS file: /cvs/src/usr.bin/openssl/apps_posix.c,v retrieving revision 1.4 diff -u -p -r1.4 apps_posix.c --- usr.bin/openssl/apps_posix.c 5 Dec 2017 15:02:06 -0000 1.4 +++ usr.bin/openssl/apps_posix.c 13 Jul 2018 14:36:17 -0000 @@ -124,13 +124,13 @@ #include "apps.h" double -app_timer_real(int stop) +app_timer_real(int get) { static struct timespec start; struct timespec elapsed, now; clock_gettime(CLOCK_MONOTONIC, &now); - if (stop) { + if (get) { timespecsub(&now, &start, &elapsed); return elapsed.tv_sec + elapsed.tv_nsec / 1000000000.0; } @@ -139,14 +139,14 @@ app_timer_real(int stop) } double -app_timer_user(int stop) +app_timer_user(int get) { static struct timeval start; struct timeval elapsed; struct rusage now; getrusage(RUSAGE_SELF, &now); - if (stop) { + if (get) { timersub(&now.ru_utime, &start, &elapsed); return elapsed.tv_sec + elapsed.tv_usec / 1000000.0; } Index: usr.bin/openssl/s_time.c =================================================================== RCS file: /cvs/src/usr.bin/openssl/s_time.c,v retrieving revision 1.23 diff -u -p -r1.23 s_time.c --- usr.bin/openssl/s_time.c 7 Feb 2018 05:47:55 -0000 1.23 +++ usr.bin/openssl/s_time.c 13 Jul 2018 14:36:17 -0000 @@ -228,8 +228,8 @@ s_time_usage(void) /*********************************************************************** * TIME - time functions */ -#define START 0 -#define STOP 1 +#define START TM_RESET +#define STOP TM_GET static double tm_Time_F(int op) Index: usr.bin/openssl/speed.c =================================================================== RCS file: /cvs/src/usr.bin/openssl/speed.c,v retrieving revision 1.22 diff -u -p -r1.22 speed.c --- usr.bin/openssl/speed.c 7 Feb 2018 05:47:55 -0000 1.22 +++ usr.bin/openssl/speed.c 13 Jul 2018 14:36:18 -0000 @@ -195,8 +195,8 @@ sig_done(int sig) run = 0; } -#define START 0 -#define STOP 1 +#define START TM_RESET +#define STOP TM_GET static double