openbsd-ports/math/sc/patches/patch-interp_c

40 lines
1.1 KiB
Plaintext

$OpenBSD: patch-interp_c,v 1.2 2002/08/06 00:45:17 pvalchev Exp $
--- interp.c.orig Wed Nov 7 01:35:40 2001
+++ interp.c Mon Aug 5 17:45:50 2002
@@ -485,15 +485,13 @@ dotts(int hr, int min, int sec)
double
dotime(int which, double when)
{
- long time();
-
static long t_cache;
static struct tm tm_cache;
struct tm *tp;
- long tloc;
+ time_t tloc;
if (which == NOW)
- return (double)time((long *)0);
+ return (double)time(NULL);
tloc = (long)when;
@@ -944,7 +942,7 @@ docat(register char *s1, register char *
}
char *
-dodate(long tloc)
+dodate(time_t tloc)
{
char *tp;
char *p;
@@ -1199,7 +1197,7 @@ seval(register struct enode *se)
case IF:
case '?': return (eval(se->e.o.left) ? seval(se->e.o.right->e.o.left)
: seval(se->e.o.right->e.o.right));
- case DATE: return (dodate((long)(eval(se->e.o.right))));
+ case DATE: return (dodate((time_t)(eval(se->e.o.right))));
case FMT: return (dofmt(seval(se->e.o.left), eval(se->e.o.right)));
case UPPER: return (docase(UPPER, seval(se->e.o.right)));
case LOWER: return (docase(LOWER, seval(se->e.o.right)));