Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
42366959
"vscode:/vscode.git/clone" did not exist on "7a89e498595541d43385c579ed679dc026b031e0"
Commit
42366959
authored
Sep 18, 2018
by
jem
Browse files
update leap year comment when div by 400
parent
c560ade8
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/localtime.c
View file @
42366959
...
@@ -52,8 +52,8 @@
...
@@ -52,8 +52,8 @@
static
int
is_leap_year
(
time_t
year
)
{
static
int
is_leap_year
(
time_t
year
)
{
if
(
year
%
4
)
return
0
;
/* A year not divisible by 4 is not leap. */
if
(
year
%
4
)
return
0
;
/* A year not divisible by 4 is not leap. */
else
if
(
year
%
100
)
return
1
;
/* If div by 4 and not 100 is surely leap. */
else
if
(
year
%
100
)
return
1
;
/* If div by 4 and not 100 is surely leap. */
else
if
(
year
%
400
)
return
0
;
/* If div by 100 *and* 400 is not leap. */
else
if
(
year
%
400
)
return
0
;
/* If div by 100 *and*
not by
400 is not leap. */
else
return
1
;
/* If div by 100 and
not by
400 is leap. */
else
return
1
;
/* If div by 100 and 400 is leap. */
}
}
void
nolocks_localtime
(
struct
tm
*
tmp
,
time_t
t
,
time_t
tz
,
int
dst
)
{
void
nolocks_localtime
(
struct
tm
*
tmp
,
time_t
t
,
time_t
tz
,
int
dst
)
{
...
...
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