mirror of
https://github.com/genodelabs/genode.git
synced 2025-03-24 04:55:42 +00:00
musl_tm: prevent compilter warning
warning: dangling pointer ‘is_leap’ to an unnamed temporary may be used [-Wdangling-pointer=]
This commit is contained in:
parent
ac4aaa208f
commit
2580045a83
@ -44,6 +44,10 @@ static int month_to_secs(int month, int is_leap)
|
||||
|
||||
static long long year_to_secs(long long year, int *is_leap)
|
||||
{
|
||||
int _is_leap = 0;
|
||||
if (!is_leap)
|
||||
is_leap = &_is_leap;
|
||||
|
||||
if (year-2ULL <= 136) {
|
||||
int y = year;
|
||||
int leaps = (y-68)>>2;
|
||||
@ -56,7 +60,6 @@ static long long year_to_secs(long long year, int *is_leap)
|
||||
|
||||
int cycles, centuries, leaps, rem;
|
||||
|
||||
if (!is_leap) is_leap = &(int){0};
|
||||
cycles = (year-100) / 400;
|
||||
rem = (year-100) % 400;
|
||||
if (rem < 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user