diff options
| author | Paul Eggert | 2024-07-13 22:16:26 -0700 |
|---|---|---|
| committer | Paul Eggert | 2024-07-13 22:18:49 -0700 |
| commit | 62fdcfd4842693f436acd5b729d20934d12ca708 (patch) | |
| tree | 86344e712e3054b033c1508eb877623082373cbd /src | |
| parent | f9dae55ccca065a6b27d00959db711faf59b9fa3 (diff) | |
| download | emacs-62fdcfd4842693f436acd5b729d20934d12ca708.tar.gz emacs-62fdcfd4842693f436acd5b729d20934d12ca708.zip | |
Minor renaming in timefns.c
* src/timefns.c (current_time_in_cform): Rename this static
function from current_time_in_form, since this is about enum cform
not enum timeform. Use changed.
Diffstat (limited to 'src')
| -rw-r--r-- | src/timefns.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/timefns.c b/src/timefns.c index 7b8107ee12e..dc77051071d 100644 --- a/src/timefns.c +++ b/src/timefns.c | |||
| @@ -858,7 +858,9 @@ enum timeform | |||
| 858 | TIMEFORM_TICKS_HZ /* fractional time: HI is ticks, LO is ticks per second */ | 858 | TIMEFORM_TICKS_HZ /* fractional time: HI is ticks, LO is ticks per second */ |
| 859 | }; | 859 | }; |
| 860 | 860 | ||
| 861 | /* From the time components HIGH, LOW, USEC and PSEC, | 861 | /* Assuming the input form was FORM (which should be one of |
| 862 | TIMEFORM_HI_LO, TIMEFORM_HI_LO_US, TIMEFORM_HI_LO_US_PS), | ||
| 863 | and from the time components HIGH, LOW, USEC and PSEC, | ||
| 862 | generate the corresponding time value in CFORM form. | 864 | generate the corresponding time value in CFORM form. |
| 863 | 865 | ||
| 864 | Return a (0, valid timestamp) pair if successful, an (error number, | 866 | Return a (0, valid timestamp) pair if successful, an (error number, |
| @@ -1007,7 +1009,7 @@ struct form_time | |||
| 1007 | 1009 | ||
| 1008 | /* Current time (seconds since epoch) in form CFORM. */ | 1010 | /* Current time (seconds since epoch) in form CFORM. */ |
| 1009 | static union c_time | 1011 | static union c_time |
| 1010 | current_time_in_form (enum cform cform) | 1012 | current_time_in_cform (enum cform cform) |
| 1011 | { | 1013 | { |
| 1012 | struct timespec now = current_timespec (); | 1014 | struct timespec now = current_timespec (); |
| 1013 | return ((FASTER_TIMEFNS | 1015 | return ((FASTER_TIMEFNS |
| @@ -1037,11 +1039,21 @@ decode_lisp_time (Lisp_Object specified_time, enum cform cform) | |||
| 1037 | A/B s | 1039 | A/B s |
| 1038 | (A B C D) ; A, B : integer, C, D : fixnum | 1040 | (A B C D) ; A, B : integer, C, D : fixnum |
| 1039 | (A * 2**16 + B + C / 10**6 + D / 10**12) s | 1041 | (A * 2**16 + B + C / 10**6 + D / 10**12) s |
| 1042 | |||
| 1043 | The following specified_time forms are also supported, | ||
| 1044 | for compatibility with older Emacs versions: | ||
| 1045 | |||
| 1046 | (A B) | ||
| 1047 | like (A B 0 0) | ||
| 1048 | (A B . C) ; C : fixnum | ||
| 1049 | like (A B C 0) | ||
| 1050 | (A B C) | ||
| 1051 | like (A B C 0) | ||
| 1040 | */ | 1052 | */ |
| 1041 | 1053 | ||
| 1042 | if (NILP (specified_time)) | 1054 | if (NILP (specified_time)) |
| 1043 | return (struct form_time) {.form = TIMEFORM_NIL, | 1055 | return (struct form_time) {.form = TIMEFORM_NIL, |
| 1044 | .time = current_time_in_form (cform) }; | 1056 | .time = current_time_in_cform (cform) }; |
| 1045 | 1057 | ||
| 1046 | Lisp_Object high = make_fixnum (0); | 1058 | Lisp_Object high = make_fixnum (0); |
| 1047 | Lisp_Object low = specified_time; | 1059 | Lisp_Object low = specified_time; |