fix errno declaration

also time_t and miscellaneous other fixes
This commit is contained in:
naddy 2016-03-16 22:22:33 +00:00
parent cac0ba989b
commit 8270ef9338
5 changed files with 85 additions and 16 deletions

View File

@ -1,10 +1,10 @@
# $OpenBSD: Makefile,v 1.20 2015/01/22 18:41:16 naddy Exp $
# $OpenBSD: Makefile,v 1.21 2016/03/16 22:22:33 naddy Exp $
COMMENT= spreadsheet program under X11
DISTNAME= xspread3.1.1c
PKGNAME= xspread-3.1.1c
REVISION= 1
REVISION= 2
CATEGORIES= math
# GPLv2
@ -20,7 +20,7 @@ CONFIGURE_ENV= CPPFLAGS="-I${X11BASE}/include" \
INSTALL_TARGET= install install.man
post-install:
@find ${WRKSRC} -name "*.tmp" -delete || /usr/bin/true
@find ${WRKSRC} -name "*.tmp" -exec rm -f {} +
${INSTALL_DATA_DIR} \
${PREFIX}/share/xspread/{doc,documents,tests}
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/xspread

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-Makefile_in,v 1.1 2002/11/23 07:25:59 pvalchev Exp $
$OpenBSD: patch-Makefile_in,v 1.2 2016/03/16 22:22:34 naddy Exp $
--- Makefile.in.orig Tue Nov 7 03:17:18 1995
+++ Makefile.in Fri Nov 22 15:31:18 2002
+++ Makefile.in Wed Mar 16 22:47:51 2016
@@ -19,11 +19,11 @@ CC = @CC@
CFLAGS = @CFLAGS@
DEFS = @DEFS@
@ -15,7 +15,7 @@ $OpenBSD: patch-Makefile_in,v 1.1 2002/11/23 07:25:59 pvalchev Exp $
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL)
INSTALLFLAGS = -c
@@ -81,10 +81,10 @@ $(PROGRAM): $(OBJS) $(DEPLIBS) gram.o le
@@ -81,10 +81,10 @@ $(PROGRAM): $(OBJS) $(DEPLIBS) gram.o lex.o
$(CCLINK) -o $@ $(LDOPTIONS) $(OBJS) gram.o lex.o $(LOCAL_LIBRARIES) $(LIBS) $(EXTRA_LOAD_FLAGS)
install:: xspread

View File

@ -1,7 +1,36 @@
$OpenBSD: patch-interp_c,v 1.1 2002/11/23 07:25:59 pvalchev Exp $
$OpenBSD: patch-interp_c,v 1.2 2016/03/16 22:22:34 naddy Exp $
--- interp.c.orig Tue Nov 7 03:17:26 1995
+++ interp.c Fri Nov 22 15:31:18 2002
@@ -516,7 +516,7 @@ int mo, day, yr;
+++ interp.c Wed Mar 16 23:20:06 2016
@@ -32,9 +32,8 @@
#include <signal.h>
#include <setjmp.h>
#include <ctype.h>
+#include <errno.h>
-extern int errno; /* set by math functions */
-
#include "sc.h"
#ifdef HAVE_X11_X_H
@@ -103,7 +102,7 @@ static char * docapital PROTO((char *));
static char * docase PROTO((int, char *));
static char * docat PROTO((char *, char *));
static double docount PROTO((int, int, int, int));
-static char * dodate PROTO((long));
+static char * dodate PROTO((time_t));
static double doeqs PROTO((char *, char *));
static char * doext PROTO((char *, double));
static char * dofmt PROTO((char *, double));
@@ -508,7 +507,7 @@ double
dodts(mo, day, yr)
int mo, day, yr;
{
- long trial;
+ time_t trial;
register struct tm *tp;
register int i;
register long jdate;
@@ -516,7 +515,7 @@ int mo, day, yr;
mdays[1] = 28 + (yr%4 == 0);
if (mo < 1 || mo > 12 || day < 1 || day > mdays[--mo] ||
@ -10,3 +39,36 @@ $OpenBSD: patch-interp_c,v 1.1 2002/11/23 07:25:59 pvalchev Exp $
scerror("@dts: invalid argument");
cellerror = CELLERROR;
return(0.0);
@@ -577,11 +576,11 @@ double when;
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);
- tloc = (long)when;
+ return (double)time(NULL);
+ tloc = (time_t)when;
if (tloc != t_cache) {
tp = localtime(&tloc);
@@ -1002,7 +1001,7 @@ register char *s1, *s2;
static char *
dodate(tloc)
-long tloc;
+time_t tloc;
{
char *tp;
char *p;
@@ -1274,7 +1273,7 @@ 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((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)));

View File

@ -0,0 +1,11 @@
$OpenBSD: patch-sc_h,v 1.1 2016/03/16 22:22:34 naddy Exp $
--- sc.h.orig Wed Mar 16 22:59:07 2016
+++ sc.h Wed Mar 16 22:59:19 2016
@@ -22,6 +22,7 @@
#endif
#endif
*/
+#include <string.h>
#ifndef PI
#define PI (double)3.14159265358979323846

View File

@ -1,6 +1,6 @@
@comment $OpenBSD: PLIST,v 1.5 2004/09/15 09:12:00 espie Exp $
bin/pxspread
bin/xspread
@comment $OpenBSD: PLIST,v 1.6 2016/03/16 22:22:34 naddy Exp $
@bin bin/pxspread
@bin bin/xspread
@man man/man1/pxspread.1
@man man/man1/xspread.1
share/examples/xspread/
@ -14,13 +14,11 @@ share/examples/xspread/ex1o
share/examples/xspread/ex2
share/examples/xspread/ex2o
share/examples/xspread/ex3
share/examples/xspread/sample_files.tmp
share/examples/xspread/tutorial
share/xspread/
share/xspread/README
share/xspread/doc/
share/xspread/doc/Sample_Run
share/xspread/doc/doc.tmp
share/xspread/doc/final_rpt
share/xspread/doc/last_xspread
share/xspread/doc/prog_rpt
@ -35,7 +33,6 @@ share/xspread/doc/xspread.tex
share/xspread/doc/xspread.toc
share/xspread/doc/xspread_prog.asc
share/xspread/documents/
share/xspread/documents/documents.tmp
share/xspread/documents/progress.aux
share/xspread/documents/progress.dvi
share/xspread/documents/progress.log
@ -68,5 +65,4 @@ share/xspread/tests/read.input
share/xspread/tests/read.output
share/xspread/tests/read.sc
share/xspread/tests/tester.sh
share/xspread/tests/tests.tmp
share/xspread/tests/txt.sc