summaryrefslogtreecommitdiff
path: root/devel/as31
diff options
context:
space:
mode:
authorjoerg <joerg>2012-07-03 18:13:26 +0000
committerjoerg <joerg>2012-07-03 18:13:26 +0000
commitfb840d8180660a4cd71c29ad97d5cd213eca0a18 (patch)
tree6b24b2bf6cc8aff136a1acb354f3518fea8df6d1 /devel/as31
parenta1ebfe06db312a7f15b33a24b59c7be9d13653c2 (diff)
downloadpkgsrc-fb840d8180660a4cd71c29ad97d5cd213eca0a18.tar.gz
Fix missing prototypes and void vs int mismatches.
Diffstat (limited to 'devel/as31')
-rw-r--r--devel/as31/Makefile4
-rw-r--r--devel/as31/distinfo8
-rw-r--r--devel/as31/patches/patch-aa93
-rw-r--r--devel/as31/patches/patch-as31.y80
-rw-r--r--devel/as31/patches/patch-lexer.c25
-rw-r--r--devel/as31/patches/patch-main.c18
-rw-r--r--devel/as31/patches/patch-symbol.c42
7 files changed, 262 insertions, 8 deletions
diff --git a/devel/as31/Makefile b/devel/as31/Makefile
index 1f6c0ae06c4..9de94a5c464 100644
--- a/devel/as31/Makefile
+++ b/devel/as31/Makefile
@@ -1,8 +1,8 @@
-# $NetBSD: Makefile,v 1.18 2012/03/07 20:39:47 hans Exp $
+# $NetBSD: Makefile,v 1.19 2012/07/03 18:13:26 joerg Exp $
DISTNAME= asm.8051
PKGNAME= as31-19900126
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= devel
MASTER_SITES= ftp://ftp.uu.net/usenet/comp.sources.misc/volume10/
EXTRACT_SUFX= .Z
diff --git a/devel/as31/distinfo b/devel/as31/distinfo
index 2d9903600ed..2d5dd4a35af 100644
--- a/devel/as31/distinfo
+++ b/devel/as31/distinfo
@@ -1,6 +1,10 @@
-$NetBSD: distinfo,v 1.3 2005/02/23 22:24:09 agc Exp $
+$NetBSD: distinfo,v 1.4 2012/07/03 18:13:26 joerg Exp $
SHA1 (asm.8051.Z) = f0f5f6c627a7c532aa6149a358d334775a085147
RMD160 (asm.8051.Z) = 5020ef10a2777af2900579c39999f491d5368def
Size (asm.8051.Z) = 36129 bytes
-SHA1 (patch-aa) = d215f0e5df78c2972c5a6e73bc1ca0675492e87e
+SHA1 (patch-aa) = 12a8027db77748bace255e7af660363eb372110a
+SHA1 (patch-as31.y) = 368697a67d843f927e19c0ea2eb35ece6c28720b
+SHA1 (patch-lexer.c) = 43633848e2089b7cc8023dd5963ec9bb591bbffc
+SHA1 (patch-main.c) = fbeffe01a15cdaed650870415a2d20dc8cd1177f
+SHA1 (patch-symbol.c) = 0be031d5b075517e34b6327f70cc93c3a6ee3daa
diff --git a/devel/as31/patches/patch-aa b/devel/as31/patches/patch-aa
index 7cc05678e62..10b369a4fbf 100644
--- a/devel/as31/patches/patch-aa
+++ b/devel/as31/patches/patch-aa
@@ -1,7 +1,92 @@
-$NetBSD: patch-aa,v 1.1.1.1 2000/07/08 13:30:04 bjh21 Exp $
---- emitter.c Sat Jul 8 11:55:42 2000
-+++ emitter.c Sun May 28 14:19:50 2000
-@@ -394,32 +394,47 @@
+$NetBSD: patch-aa,v 1.2 2012/07/03 18:13:26 joerg Exp $
+
+--- emitter.c.orig 2012-07-03 10:49:15.000000000 +0000
++++ emitter.c
+@@ -19,6 +19,8 @@
+ */
+
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+
+ /* ----------------------------------------------------------------------
+ * DECLARE your own open(), close(), addr(), and byte() routines here.
+@@ -30,6 +32,8 @@ static int open2(), close2(), addr2(), b
+ static int open3(), close3(), addr3(), byte3();
+ static int open4(), close4(), addr4(), byte4();
+
++void dumpline(unsigned long, unsigned char *, int);
++
+ /* ----------------------------------------------------------------------
+ * ADD an entry to this table to register your
+ * output format routines. Give your object format
+@@ -67,8 +71,8 @@ emitusage()
+ fprintf(stderr, ".\n");
+ }
+
+-emitopen(file,ftype,arg)
+-char *file,*ftype,*arg;
++void
++emitopen(char *file, char *ftype, char *arg)
+ {
+ int i;
+ if( ftype ) {
+@@ -94,14 +98,12 @@ emitclose()
+ (*formtab[format].e_close)();
+ }
+
+-emitaddr(a)
+-unsigned long int a;
++void emitaddr(unsigned long a)
+ {
+ (*formtab[format].e_addr)(a);
+ }
+
+-emitbyte(b)
+-int b;
++void emitbyte(int b)
+ {
+ (*formtab[format].e_byte)(b);
+ }
+@@ -180,9 +182,9 @@ unsigned char b;
+ if( pos != -666 ) fprintf(fout,"\n");
+ newaddr = 0;
+ pos = 15;
+- fprintf(fout,"%06x: ",addr+offset);
++ fprintf(fout,"%06lx: ",addr+offset);
+ } else if( pos == 15 ) {
+- fprintf(fout,"%06x: ",addr+offset);
++ fprintf(fout,"%06lx: ",addr+offset);
+ }
+
+ fprintf(fout,"%02x ", b&0xff );
+@@ -225,7 +227,7 @@ unsigned long int a;
+ static byte2(b)
+ unsigned char b;
+ {
+- fprintf(fout,"%04x: %02x\n", addr, b&0xff );
++ fprintf(fout,"%04lx: %02x\n", addr, b&0xff );
+ addr += 1;
+ }
+
+@@ -283,6 +285,7 @@ unsigned char b;
+ addr += 1;
+ }
+
++void
+ dumpline(a,b,len)
+ unsigned long a;
+ unsigned char *b;
+@@ -292,7 +295,7 @@ int len;
+
+ if(len <= 0 ) return;
+
+- fprintf(fout,"%04x: ",a);
++ fprintf(fout,"%04lx: ",a);
+
+ for(i=0; i<8; i++ ) {
+ if( i <= len )
+@@ -394,32 +397,47 @@ static byte4(b)
}
}
diff --git a/devel/as31/patches/patch-as31.y b/devel/as31/patches/patch-as31.y
new file mode 100644
index 00000000000..1e00fd4922f
--- /dev/null
+++ b/devel/as31/patches/patch-as31.y
@@ -0,0 +1,80 @@
+$NetBSD: patch-as31.y,v 1.1 2012/07/03 18:13:26 joerg Exp $
+
+--- as31.y.orig 2012-07-03 10:49:15.000000000 +0000
++++ as31.y
+@@ -28,6 +28,10 @@
+
+ #define YYSTYPE union ystack
+
++void genbyte(int);
++void emitbyte(int);
++void emitaddr(unsigned long);
++
+ extern int lineno;
+ extern int dashl;
+ extern char *asmfile;
+@@ -948,6 +952,10 @@ relative : expr
+
+ %%
+
++#include <stdarg.h>
++void error(const char *, ...);
++void warning(const char *, ...);
++
+ /* ---------------------------------------------------------------------- */
+
+ yyerror(s)
+@@ -963,11 +971,13 @@ char *s;
+ * termination.
+ */
+
+-error(cs,a1,a2,a3,a4,a5,a6)
+-char *cs,*a1,*a2,*a3,*a4,*a5,*a6;
++void error(const char *cs, ...)
+ {
++ va_list ap;
++ va_start(ap, cs);
+ fprintf(stderr,"File: %s, line: %d, ",asmfile,lineno);
+- fprintf(stderr,cs,a1,a2,a3,a4,a5,a6);
++ vfprintf(stderr,cs, ap);
++ va_end(ap);
+ fprintf(stderr,".\n");
+ longjmp(main_env,1);
+ }
+@@ -979,12 +989,14 @@ char *cs,*a1,*a2,*a3,*a4,*a5,*a6;
+ *
+ */
+
+-warning(cs,a1,a2,a3,a4,a5,a6)
+-char *cs,*a1,*a2,*a3,*a4,*a5,*a6;
++void warning(const char *cs, ...)
+ {
++ va_list ap;
++ va_start(ap, cs);
+ fatal++;
+ fprintf(stderr,"File: %s, line: %d, ",asmfile,lineno);
+- fprintf(stderr,cs,a1,a2,a3,a4,a5,a6);
++ vfprintf(stderr,cs, ap);
++ va_end(ap);
+ fprintf(stderr,".\n");
+ }
+
+@@ -1095,7 +1107,7 @@ char *txt;
+ {
+ int i,j;
+
+- fprintf(listing,show?"%04X: ":" ",lc);
++ fprintf(listing,show?"%04lX: ":" ",lc);
+
+ j=0;
+ for(i=0; i<bytecount; i++ ) {
+@@ -1118,8 +1130,7 @@ char *txt;
+ *
+ */
+
+-genbyte(b)
+-int b;
++void genbyte(int b)
+ {
+ if( bytecount < sizeof(bytebuf) )
+ bytebuf[bytecount++] = b;
diff --git a/devel/as31/patches/patch-lexer.c b/devel/as31/patches/patch-lexer.c
new file mode 100644
index 00000000000..780f1ed084e
--- /dev/null
+++ b/devel/as31/patches/patch-lexer.c
@@ -0,0 +1,25 @@
+$NetBSD: patch-lexer.c,v 1.1 2012/07/03 18:13:26 joerg Exp $
+
+--- lexer.c.orig 2012-07-03 10:49:15.000000000 +0000
++++ lexer.c
+@@ -23,16 +23,19 @@
+ *
+ */
+
++#include <stdlib.h>
+ #include <stdio.h>
++#include <string.h>
+ #include <ctype.h>
+ #include "as31.h"
+
++void error(const char *, ...);
++
+ extern union ystack yylval;
+ extern int pass;
+
+ struct symbol *looksym();
+ struct opcode *lookop();
+-char *malloc();
+ int lineno;
+
+ static char line[100],*lineptr=line;
diff --git a/devel/as31/patches/patch-main.c b/devel/as31/patches/patch-main.c
new file mode 100644
index 00000000000..4807711af07
--- /dev/null
+++ b/devel/as31/patches/patch-main.c
@@ -0,0 +1,18 @@
+$NetBSD: patch-main.c,v 1.1 2012/07/03 18:13:26 joerg Exp $
+
+--- main.c.orig 2012-07-03 10:49:15.000000000 +0000
++++ main.c
+@@ -17,7 +17,13 @@
+ */
+
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <setjmp.h>
++#include <string.h>
++#include <unistd.h>
++
++void emitopen(char *, char *, char *);
++emitaddr(unsigned long );
+
+ extern int lineno;
+ extern int pass,fatal;
diff --git a/devel/as31/patches/patch-symbol.c b/devel/as31/patches/patch-symbol.c
new file mode 100644
index 00000000000..8ef73397d2b
--- /dev/null
+++ b/devel/as31/patches/patch-symbol.c
@@ -0,0 +1,42 @@
+$NetBSD: patch-symbol.c,v 1.1 2012/07/03 18:13:26 joerg Exp $
+
+--- symbol.c.orig 2012-07-03 10:49:15.000000000 +0000
++++ symbol.c
+@@ -20,6 +20,10 @@
+ * January, 1990.
+ *
+ */
++#include <string.h>
++#include <stdlib.h>
++
++void error(const char *, ...);
+
+ #include "as31.h"
+ #define NULL (0)
+@@ -149,7 +153,7 @@ static unsigned char clr[]= { 0xe4, 0xc3
+ static unsigned char cpl[]= { 0xf4, 0xb3, 0xb2 };
+ static unsigned char da[]= { 0xd4 };
+ static unsigned char dec[]= { 0x14, 0x18, 0x15, 0x16 };
+-static unsigned char div[]= { 0x84 };
++static unsigned char divop[]= { 0x84 };
+ static unsigned char djnz[]= { 0xd8, 0xd5 };
+ static unsigned char inc[]= { 0x04, 0x08, 0x05, 0x06, 0xa3 };
+ static unsigned char jb[]= { 0x20 };
+@@ -216,7 +220,7 @@ static struct opcode optable[] = {
+ {"cpl", CPL, cpl },
+ {"da", DA, da },
+ {"dec", DEC, dec },
+- {"div", DIV, div },
++ {"div", DIV, divop },
+ {"djnz", DJNZ, djnz },
+ {"dptr", DPTR, NULL },
+ {"end", D_END, NULL },
+@@ -339,7 +343,7 @@ struct symbol *looksym(s)
+ char *s;
+ {
+ register struct symbol *ptr,*prev;
+- char *malloc(),*p;
++ char *p;
+ register int hv;
+
+ hv = hash(s);