Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emacs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
emacs
emacs
Commits
8e718b4e
Commit
8e718b4e
authored
Feb 10, 1994
by
Karl Heuer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(difftm): Simplify expression.
parent
9106ccf1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
16 deletions
+15
-16
src/editfns.c
src/editfns.c
+15
-16
No files found.
src/editfns.c
View file @
8e718b4e
...
...
@@ -611,15 +611,13 @@ and from `file-attributes'.")
/* Yield A - B, measured in seconds. */
static
long
difftm
(
a
,
b
)
difftm
(
a
,
b
)
struct
tm
*
a
,
*
b
;
{
int
ay
=
a
->
tm_year
+
(
TM_YEAR_ORIGIN
-
1
);
int
by
=
b
->
tm_year
+
(
TM_YEAR_ORIGIN
-
1
);
return
(
(
(
/* Some compilers can't handle this as a single return statement. */
int
days
=
(
/* difference in day of year */
a
->
tm_yday
-
b
->
tm_yday
/* + intervening leap days */
...
...
@@ -628,9 +626,10 @@ difftm(a, b)
+
((
ay
/
100
>>
2
)
-
(
by
/
100
>>
2
))
/* + difference in years * 365 */
+
(
long
)(
ay
-
by
)
*
365
)
*
24
+
(
a
->
tm_hour
-
b
->
tm_hour
)
)
*
60
+
(
a
->
tm_min
-
b
->
tm_min
)
)
*
60
+
(
a
->
tm_sec
-
b
->
tm_sec
);
);
return
(
60
*
(
60
*
(
24
*
days
+
(
a
->
tm_hour
-
b
->
tm_hour
))
+
(
a
->
tm_min
-
b
->
tm_min
))
+
(
a
->
tm_sec
-
b
->
tm_sec
));
}
DEFUN
(
"current-time-zone"
,
Fcurrent_time_zone
,
Scurrent_time_zone
,
0
,
1
,
0
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment