This is not the only error, only the first. But by patching it, all the others went away too.
libsrc/fcntl/z88/stat.c:
Code: Select all
#define JD0101970 2440588
time_t doepoch(long days, long sec)
{
days-=JD0101970; /* sub 1970 */
days*=86400; /* into seconds */
return (days+sec);
}
Code: Select all
._doepoch
ld hl,6 ;const
add hl,sp
push hl
call l_glong
push de
push hl
ld hl,49780 ;const
ld de,281474976710618
call l_long_add
I did not have too much time to dig after this, but found a possible workaround. It seems the problem appeares when casting a negative long to unsigned - all bits from 32 to 63 are 1. Hence, by adding
Code: Select all
if (sizeof(unsigned long) > 4)
val &= 0xffffffff;
The output is now
Code: Select all
ld hl,49780 ;const
ld de,65498
call l_long_add