diff options
| author | Paul Eggert | 2012-07-10 16:24:36 -0700 |
|---|---|---|
| committer | Paul Eggert | 2012-07-10 16:24:36 -0700 |
| commit | e9a9ae0350689d352c2bdfa3af0eb722f587b966 (patch) | |
| tree | 10ed0298079b06838a525f0a4df780d7600e13fe /src/ChangeLog | |
| parent | ffacb12679a1e001981c2e0f690b327eda652d04 (diff) | |
| download | emacs-e9a9ae0350689d352c2bdfa3af0eb722f587b966.tar.gz emacs-e9a9ae0350689d352c2bdfa3af0eb722f587b966.zip | |
EMACS_TIME simplification (Bug#11875).
This replaces macros (which typically do not work in GDB)
with functions, typedefs and enums, making the code easier to debug.
The functional style also makes code easier to read and maintain.
* lib-src/profile.c (TV2): Remove no-longer-needed static var.
* src/systime.h: Include <sys/time.h> on all hosts, not just if
WINDOWSNT, since 'struct timeval' is needed in general.
(EMACS_TIME): Now a typedef, not a macro.
(EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
not macros.
(EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
(EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
(EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
(EMACS_TIME_LE): Now functions, not macros.
(EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
(EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
which are not functions. All uses rewritten to use:
(make_emacs_time): New function.
(EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
(EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
not functions. All uses rewritten to use the following, respectively:
(emacs_secs_addr, invalid_emacs_time, get_emacs_time)
(add_emacs_time, sub_emacs_time): New functions.
* src/atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
* src/fileio.c (Fcopy_file):
* src/xterm.c (XTflash): Get the current time closer to when it's used.
* src/makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
Diffstat (limited to 'src/ChangeLog')
| -rw-r--r-- | src/ChangeLog | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index d7ae52ac01e..de56d4160a7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,32 @@ | |||
| 1 | 2012-07-10 Paul Eggert <eggert@cs.ucla.edu> | 1 | 2012-07-10 Paul Eggert <eggert@cs.ucla.edu> |
| 2 | 2 | ||
| 3 | EMACS_TIME simplification (Bug#11875). | ||
| 4 | This replaces macros (which typically do not work in GDB) | ||
| 5 | with functions, typedefs and enums, making the code easier to debug. | ||
| 6 | The functional style also makes code easier to read and maintain. | ||
| 7 | * systime.h: Include <sys/time.h> on all hosts, not just if | ||
| 8 | WINDOWSNT, since 'struct timeval' is needed in general. | ||
| 9 | (EMACS_TIME): Now a typedef, not a macro. | ||
| 10 | (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants, | ||
| 11 | not macros. | ||
| 12 | (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P) | ||
| 13 | (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ) | ||
| 14 | (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT) | ||
| 15 | (EMACS_TIME_LE): Now functions, not macros. | ||
| 16 | (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS) | ||
| 17 | (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros, | ||
| 18 | which are not functions. All uses rewritten to use: | ||
| 19 | (make_emacs_time): New function. | ||
| 20 | (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME) | ||
| 21 | (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are | ||
| 22 | not functions. All uses rewritten to use the following, respectively: | ||
| 23 | (emacs_secs_addr, invalid_emacs_time, get_emacs_time) | ||
| 24 | (add_emacs_time, sub_emacs_time): New functions. | ||
| 25 | * atimer.c: Don't include <sys/time.h>, as "systime.h" does this. | ||
| 26 | * fileio.c (Fcopy_file): | ||
| 27 | * xterm.c (XTflash): Get the current time closer to when it's used. | ||
| 28 | * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies. | ||
| 29 | |||
| 3 | * bytecode.c (targets): Suppress -Woverride-init warnings. | 30 | * bytecode.c (targets): Suppress -Woverride-init warnings. |
| 4 | 31 | ||
| 5 | Simplify by avoiding confusing use of strncpy etc. | 32 | Simplify by avoiding confusing use of strncpy etc. |