Control: tags -1 patch
Please find a patch attached.
diff -Nru a56-1.3+dfsg/debian/changelog a56-1.3+dfsg/debian/changelog
--- a56-1.3+dfsg/debian/changelog 2024-01-13 22:00:00.000000000 +0000
+++ a56-1.3+dfsg/debian/changelog 2024-03-16 20:29:00.000000000 +0000
@@ -1,3 +1,11 @@
+a56 (1.3+dfsg-10.1) unstable; urgency=medium
+
+ * Non-maintainer upload.
+ * Use standard strtol.
+ * Fix a lot of implicit-function-declarations. (Closes: #1066195)
+
+ -- Bastian Germann <b...@debian.org> Sat, 16 Mar 2024 20:29:00 +0000
+
a56 (1.3+dfsg-10) unstable; urgency=medium
[ debian janitor ]
diff -Nru a56-1.3+dfsg/debian/patches/ansi-c.patch
a56-1.3+dfsg/debian/patches/ansi-c.patch
--- a56-1.3+dfsg/debian/patches/ansi-c.patch 1970-01-01 00:00:00.000000000
+0000
+++ a56-1.3+dfsg/debian/patches/ansi-c.patch 2024-01-13 22:00:00.000000000
+0000
@@ -0,0 +1,170 @@
+Origin:
https://github.com/rkujawa/a56/commit/68dacec16838a482264e67976b23310841bb539c
+From: =?UTF-8?q?Rados=C5=82aw=20Kujawa?= <radoslaw.kuj...@c0ff33.net>
+Date: Fri, 17 May 2013 10:46:34 +0200
+Subject: More code cleanup and converstion to ANSI C.
+---
+diff --git a/frac2int.c b/frac2int.c
+index 8f01796..a045a70 100644
+--- a/frac2int.c
++++ b/frac2int.c
+@@ -98,21 +98,26 @@
+ * signed, fractional quantities. *
+ \******************************************************************/
+
+-main()
+-{
+- double fractnum; /* double precision floating pt */
+- long hexval; /* long integer */
+-
+- for(;;) {
+- /* Read 1 Decimal Floating Point Number from the Keyboard */
+- printf("Enter the decimal fraction: ");
+- scanf("%lf", &fractnum);
++#include <stdio.h>
++#include <stdlib.h>
+
+- /* Convert to a Hex Integer which can be used by the DSP56200 */
+- hexval = (long) (8388608.0 * fractnum);
+- hexval = 0x00ffffffL & hexval;
+-
+- /* Write the Hex number out to the Terminal */
+- printf("DSP56200 Coefficient = %06lx\n", hexval);
+- }
++int
++main(void)
++{
++ double fractnum; /* double precision floating pt */
++ long hexval; /* long integer */
++
++ for(;;) {
++ /* Read 1 Decimal Floating Point Number from the Keyboard */
++ printf("Enter the decimal fraction: ");
++ scanf("%lf", &fractnum);
++
++ /* Convert to a Hex Integer which can be used by the DSP56200 */
++ hexval = (long) (8388608.0 * fractnum);
++ hexval = 0x00ffffffL & hexval;
++
++ /* Write the Hex number out to the Terminal */
++ printf("DSP56200 Coefficient = %06lx\n", hexval);
++ }
++ return(EXIT_SUCCESS);
+ }
+diff --git a/main.c b/main.c
+index 06f6dc4..9d2aacf 100644
+--- a/main.c
++++ b/main.c
+@@ -21,6 +21,7 @@
+ */
+ #include <unistd.h>
+ #include <stdbool.h>
++#include <string.h>
+
+ static char *Copyright = "Copyright (C) 1990-1994 Quinn C. Jensen";
+
+@@ -45,11 +46,12 @@ BOOL list_on_next = TRUE;
+
+
++void dump_symtab();
+ void summarize(struct psect *);
+
+
+ void psect_summary();
+ void reset_psects();
+
+ int
+ main(int argc, char *argv[])
+ {
+@@ -107,8 +111,8 @@ struct inc inc[MAX_NEST];
+ int inc_p = 0;
+ FILE *yyin;
+
+-include(file)
+-char *file;
++void
++include(char *file)
+ {
+ FILE *fp = open_read(file);
+
+@@ -205,7 +209,7 @@ sym_def(char *sym, int type, int seg, int i, double f)
+ sp->n.val.f = f;
+ } else {
+ sp = find_sym(sym);
+- if(NOT sp)
++ if(!sp)
+ fatal("internal error 304\n");
+ if(sp->n.type != type ||
+ type == INT && sp->n.val.i != (i & 0xFFFFFF) ||
+@@ -214,8 +218,8 @@ sym_def(char *sym, int type, int seg, int i, double f)
+ }
+ }
+
+-struct sym *find_sym(sym)
+-char *sym;
++struct sym *
++find_sym(char *sym)
+ {
+ struct sym *sp, **stop;
+
+@@ -228,6 +232,8 @@ char *sym;
+ }
+
+ extern char segs[];
++
++void
+ dump_symtab()
+ {
+ struct sym *sp, **stop;
+@@ -339,6 +345,7 @@ char *s;
+
+ #define ONE 0x4000000
+
++int
+ makefrac(char *s)
+ {
+ int frac = 0, div = 1;
+diff --git a/torom.c b/torom.c
+index afb79c2..cf19d5b 100644
+--- a/torom.c
++++ b/torom.c
+@@ -5,7 +5,7 @@
+ * Written by Quinn C. Jensen
+ * July 1990
+ *
+- *******************************************************\
++ *******************************************************/
+
+ /*
+ * Copyright (C) 1990-1994 Quinn C. Jensen
+@@ -27,12 +27,14 @@ static char *Copyright = "Copyright (C) 1990-1994 Quinn C.
Jensen";
+ *
+ */
+
++#include <stdio.h>
++#include <stdlib.h>
++
+
+ #define MAX 256
+
+-main(argc,argv)
+-int argc;
+-char *argv[];
++int
++main(int argc, char *argv[])
+ {
+ char buf[MAX];
+ int curaddr = 0;
+@@ -59,10 +61,11 @@ char *argv[];
+ }
+ }
+ }
++ return EXIT_SUCCESS;
+ }
+
+-putword(data)
+-int data;
++void
++putword(int data)
+ {
+ putchar(data >> 0 & 0xFF);
+ putchar(data >> 8 & 0xFF);
diff -Nru a56-1.3+dfsg/debian/patches/clang.patch
a56-1.3+dfsg/debian/patches/clang.patch
--- a56-1.3+dfsg/debian/patches/clang.patch 1970-01-01 00:00:00.000000000
+0000
+++ a56-1.3+dfsg/debian/patches/clang.patch 2024-01-13 22:00:00.000000000
+0000
@@ -0,0 +1,38 @@
+Origin:
https://github.com/rkujawa/a56/commit/b2a3a9ca8c88bc9b0fec947ad4bdd2a4ceb4acfd
+From: =?UTF-8?q?Rados=C5=82aw=20Kujawa?= <radoslaw.kuj...@c0ff33.net>
+Date: Mon, 6 May 2013 00:46:45 +0200
+Subject: Make this compile with modern compiler (tested with clang).
+---
+diff --git a/main.c b/main.c
+index e85f8a1..611d4eb 100644
+--- a/main.c
++++ b/main.c
+@@ -41,5 +41,9 @@ extern BOOL list_on;
+ BOOL list_on_next = TRUE;
+
++void
++summarize(struct psect *);
++
++int
+ main(argc,argv)
+ int argc;
+ char *argv[];
+@@ -172,6 +176,7 @@ char *sym;
+
+ struct sym *symtab[HASHSIZE];
+
++void
+ sym_def(sym, type, seg, i, f)
+ char *sym;
+ int type;
+@@ -390,8 +395,8 @@ SSSSSSSSSSSSSSSSSSSSSSSS X FFFF FFFF FFFF 99999 100%
99999 100% 99999
+ printf("\n");
+ }
+
+-summarize(pp)
+-struct psect *pp;
++void
++summarize(struct psect *pp)
+ {
+ int used, avail, of;
+
diff -Nru a56-1.3+dfsg/debian/patches/clean-up.patch
a56-1.3+dfsg/debian/patches/clean-up.patch
--- a56-1.3+dfsg/debian/patches/clean-up.patch 1970-01-01 00:00:00.000000000
+0000
+++ a56-1.3+dfsg/debian/patches/clean-up.patch 2024-01-13 22:00:00.000000000
+0000
@@ -0,0 +1,418 @@
+Origin:
https://github.com/rkujawa/a56/commit/2dcf6ca8efabcf31c4c5464b49465ae89ab4dd15
+From: =?UTF-8?q?Rados=C5=82aw=20Kujawa?= <radoslaw.kuj...@c0ff33.net>
+Date: Thu, 16 May 2013 21:07:45 +0200
+Subject: Clean up code some more...
+---
+diff --git a/Makefile b/Makefile
+index 49574e5..c4f4433 100644
+--- a/Makefile
++++ b/Makefile
+@@ -56,8 +56,8 @@ POSTPROCESS = echo
+ #DEBUG = -O -Olimit 3000
+ DEBUG = -O
+
+-SRCS = main.c a56.y lex.c subs.c getopt.c kparse.key
+-OBJS = main.o gram.o lex.o toktab.o subs.o getopt.o kparse.o
++SRCS = main.c a56.y lex.c subs.c kparse.key
++OBJS = main.o gram.o lex.o toktab.o subs.o kparse.o
+
+ DEFINES = $(CCDEFS)
+ #DEFINES = -DYYDEBUG -DLDEBUG $(CCDEFS)
+diff --git a/a56.h b/a56.h
+index 474688b..ec85e9b 100644
+--- a/a56.h
++++ b/a56.h
+@@ -5,7 +5,7 @@
+ * Written by Quinn C. Jensen
+ * July 1990
+ *
+- *******************************************************\
++ *******************************************************/
+
+ /*
+ * Copyright (C) 1990-1994 Quinn C. Jensen
+diff --git a/keybld.c b/keybld.c
+index f3d6ce6..ba8613a 100644
+--- a/keybld.c
++++ b/keybld.c
+@@ -10,6 +10,29 @@
+ * provided "as is" without express or implied warranty.
+ *
+ */
++#include <stdio.h>
++#include <string.h>
++
++#define MAX_CHAR 'z'
++
++#define TRANSITIONS (MAX_CHAR + 1)
++
++struct state {
++ int number;
++ char *seen;
++ struct trans {
++ char action;
++ void *arg;
++ } trans[TRANSITIONS];
++ struct state *next;
++} empty_state, *stop = NULL, *scur = NULL, *new_state();
++
++int n_states = 0;
++
++int follow(char, char *, struct state *);
++void dump_machine(void);
++int add_tok(char *, char *);
++
+ static char *Copyright = "Copyright (C) 1990-1994 Quinn C. Jensen";
+
+ /*
+@@ -17,12 +40,12 @@ static char *Copyright = "Copyright (C) 1990-1994 Quinn C.
Jensen";
+ *
+ */
+
+-#include <stdio.h>
+ #include "a56.h"
+
+ char buf[1024];
+
+-main()
++int
++main(void)
+ {
+ int line = 0;
+
+@@ -43,20 +66,7 @@ main()
+ return 0;
+ }
+
+-#define MAX_CHAR 'z'
+
+-#define TRANSITIONS (MAX_CHAR + 1)
+-
+-struct state {
+- int number;
+- char *seen;
+- struct trans {
+- char action;
+- void *arg;
+- } trans[TRANSITIONS];
+- struct state *next;
+-} empty_state, *stop = NULL, *scur = NULL, *new_state();
+-int n_states = 0;
+
+ /* actions */
+ #define NOMATCH 0 /* argument is nothing */
+@@ -69,8 +79,8 @@ struct user_action {
+ } *utop = NULL, *ucur = NULL;
+ int n_user_actions = 0;
+
+-add_tok(tok, actions)
+-char *tok, *actions;
++int
++add_tok(char *tok, char *actions)
+ {
+ struct state *scur;
+ struct user_action *unew = (struct user_action *)alloc(sizeof *unew);
+@@ -92,10 +102,8 @@ char *tok, *actions;
+ return 0;
+ }
+
+-follow(c, tp, sp)
+-char c;
+-char *tp;
+-struct state *sp;
++int
++follow(char c, char *tp, struct state *sp)
+ {
+ struct trans *arcp, *arcup;
+
+@@ -160,7 +168,8 @@ char *tp;
+ return snew;
+ }
+
+-dump_machine()
++void
++dump_machine(void)
+ {
+ struct state *sp;
+ struct user_action *up;
+diff --git a/lex.c b/lex.c
+index 5195793..8b3670b 100644
+--- a/lex.c
++++ b/lex.c
+@@ -438,8 +438,8 @@ char line_buf[INLINE];
+ char *cur_line = line_buf; /* points to current line buffer */
+ char *clp = NULL; /* where we're at in cur_line */
+
+-lgetc(fp)
+-FILE *fp;
++int
++lgetc(FILE *fp)
+ {
+ int c;
+
+diff --git a/main.c b/main.c
+index 611d4eb..06f6dc4 100644
+--- a/main.c
++++ b/main.c
+@@ -5,7 +5,7 @@
+ * Written by Quinn C. Jensen
+ * July 1990
+ *
+- *******************************************************\
++ *******************************************************/
+
+ /*
+ * Copyright (C) 1990-1994 Quinn C. Jensen
+@@ -19,6 +19,9 @@
+ * provided "as is" without express or implied warranty.
+ *
+ */
++#include <unistd.h>
++#include <stdbool.h>
++
+ static char *Copyright = "Copyright (C) 1990-1994 Quinn C. Jensen";
+
+ /*
+@@ -41,12 +44,14 @@ extern BOOL list_on;
+ BOOL list_on_next = TRUE;
+
+-void
+-summarize(struct psect *);
++
++void summarize(struct psect *);
++
++
++void psect_summary();
++void reset_psects();
+
+ int
+-main(argc,argv)
+-int argc;
+-char *argv[];
++main(int argc, char *argv[])
+ {
+ int i;
+ extern char *optarg;
+@@ -151,8 +156,7 @@ yywrap()
+ }
+
+ struct n
+-sym_ref(sym) /* return symbol value or UNDEF if not defined yet */
+-char *sym;
++sym_ref(char *sym) /* return symbol value or UNDEF if not defined yet */
+ {
+ struct sym *sp, *find_sym();
+ struct n result;
+@@ -177,12 +181,7 @@ char *sym;
+ struct sym *symtab[HASHSIZE];
+
+ void
+-sym_def(sym, type, seg, i, f)
+-char *sym;
+-int type;
+-int seg;
+-int i;
+-double f;
++sym_def(char *sym, int type, int seg, int i, double f)
+ {
+ struct sym *sp, **stop, *find_sym();
+
+@@ -291,8 +290,8 @@ int n;
+
+ extern char segs[];
+
+-gencode(seg, pc, word)
+-int seg, pc, word;
++void
++gencode(int seg, int pc, int word)
+ {
+ fprintf(obj, "%c %04X %06X\n", segs[seg], pc, word & 0xFFFFFF);
+ }
+@@ -340,8 +339,7 @@ char *s;
+
+ #define ONE 0x4000000
+
+-makefrac(s)
+-char *s;
++makefrac(char *s)
+ {
+ int frac = 0, div = 1;
+ int scale = 1;
+@@ -369,6 +367,7 @@ char *s;
+
+ struct psect *ptop = NULL, *cur_psect = NULL;
+
++void
+ reset_psects()
+ {
+ struct psect *pp;
+@@ -380,6 +379,7 @@ reset_psects()
+ set_psect(NULL);
+ }
+
++void
+ psect_summary()
+ {
+ printf("\nSummary of psect usage\n\n");
+@@ -415,8 +415,8 @@ summarize(struct psect *pp)
+ of);
+ }
+
+-struct psect *find_psect(name)
+-char *name;
++struct psect *
++find_psect(char *name)
+ {
+ struct psect *pp;
+
+@@ -427,33 +427,30 @@ char *name;
+ return NULL;
+ }
+
+-set_psect(pp)
+-struct psect *pp;
++void
++set_psect(struct psect *pp)
+ {
+ cur_psect = pp;
+ }
+
+-check_psect(seg, pc)
+-int seg;
+-unsigned int pc;
++bool
++check_psect(int seg, unsigned int pc)
+ {
+ if(cur_psect) {
+ if(seg == cur_psect->seg && pc >= cur_psect->bottom &&
+ pc <= cur_psect->top) {
+ cur_psect->pc = pc;
+- return TRUE;
++ return true;
+ } else {
+- return FALSE;
++ return false;
+ }
+ } else {
+- return TRUE;
++ return true;
+ }
+ }
+
+-struct psect *new_psect(name, seg, bottom, top)
+-char *name;
+-int seg;
+-unsigned int bottom, top;
++struct psect *
++new_psect(char *name, int seg, unsigned int bottom, unsigned int top)
+ {
+ struct psect *pp = find_psect(name);
+
+diff --git a/subs.c b/subs.c
+index a9e0b5e..4e92adc 100644
+--- a/subs.c
++++ b/subs.c
+@@ -5,7 +5,7 @@
+ * Written by Quinn C. Jensen
+ * July 1990
+ *
+- *******************************************************\
++ *******************************************************/
+
+ /*
+ * Copyright (C) 1990-1994 Quinn C. Jensen
+@@ -26,6 +26,9 @@ static char *Copyright = "Copyright (C) 1990-1994 Quinn C.
Jensen";
+ *
+ */
+
++#include <stdlib.h>
++#include <string.h>
++
+ #include "a56.h"
+
+ #define MAX 1024
+@@ -68,8 +71,8 @@ char *file;
+ return fp;
+ }
+
+-fatal(c, a1, a2, a3, a4, a5, a6, a7, a8)
+-char *c, *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8;
++void
++fatal(char *c, char *a1, char *a2, char *a3, char *a4, char *a5, char *a6,
char *a7, char *a8)
+ {
+ fprintf(stderr, c, a1, a2, a3, a4, a5, a6, a7, a8);
+ exit(1);
+@@ -117,13 +120,12 @@ register int stops;
+ return o;
+ }
+
+-char *alloc(size)
+-int size;
++char *
++alloc(int size)
+ {
+ char *p = (char *)malloc(size);
+- if(NOT p)
+- fatal("alloc: insufficient virtual memory to allocate %d
bytes\n",
+- size);
++ if (!p)
++ fprintf(stderr, "alloc: insufficient virtual memory to
allocate %d bytes\n", size);
+ return p;
+ }
+
+@@ -134,6 +136,7 @@ int size;
+ (c) >= 'A' && (c) <= 'Z' || \
+ (c) >= 'a' && (c) <= 'z')
+
++/*
+ strtol(s, p, base)
+ register char *s, **p;
+ register int base;
+@@ -163,3 +166,4 @@ register int base;
+
+ return sign ? -result : result;
+ }
++*/
+diff --git a/toomf.c b/toomf.c
+index 2504b80..fdb887b 100644
+--- a/toomf.c
++++ b/toomf.c
+@@ -5,7 +5,7 @@
+ * Written by Quinn C. Jensen
+ * July 1990
+ *
+- *******************************************************\
++ *******************************************************/
+
+ /*
+ * Copyright (C) 1990-1994 Quinn C. Jensen
+@@ -19,6 +19,10 @@
+ * provided "as is" without express or implied warranty.
+ *
+ */
++
++#include <stdio.h>
++#include <stdlib.h>
++
+ static char *Copyright = "Copyright (C) 1990-1994 Quinn C. Jensen";
+
+ /*
+@@ -31,9 +35,8 @@ static char *Copyright = "Copyright (C) 1990-1994 Quinn C.
Jensen";
+
+ #define MAX 256
+
+-main(argc,argv)
+-int argc;
+-char *argv[];
++int
++main(int argc, char *argv[])
+ {
+ char buf[MAX];
+ int curaddr = 0;
+@@ -57,4 +60,6 @@ char *argv[];
+ }
+ }
+ printf("\n_END %04X\n", startaddr);
++
++ return(EXIT_SUCCESS);
+ }
diff -Nru a56-1.3+dfsg/debian/patches/fgets.patch
a56-1.3+dfsg/debian/patches/fgets.patch
--- a56-1.3+dfsg/debian/patches/fgets.patch 1970-01-01 00:00:00.000000000
+0000
+++ a56-1.3+dfsg/debian/patches/fgets.patch 2024-01-13 22:00:00.000000000
+0000
@@ -0,0 +1,46 @@
+Origin:
https://github.com/XboxDev/a56/commit/3ef0e0955a19ba42c45444bb2fcc4b6d7ba762c8
+From: kl0wn <4371017+kl...@users.noreply.github.com>
+Date: Mon, 14 Oct 2019 19:13:29 -0500
+Subject: Use fgets() instead of gets()
+
+---
+ keybld.c | 2 +-
+ toomf.c | 4 +++-
+ torom.c | 3 ++-
+ 3 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/keybld.c b/keybld.c
+index f3d6ce6..9abb437 100755
+--- a/keybld.c
++++ b/keybld.c
+@@ -26,7 +26,7 @@ main()
+ {
+ int line = 0;
+
+- while(gets(buf)) {
++ while(fgets(buf, sizeof(buf), stdin)) {
+ char *bp = buf;
+ line++;
+ while(*bp != '\t' && *bp != ' ') bp++;
+diff --git a/toomf.c b/toomf.c
+index 2504b80..5c11cc1 100755
+--- a/toomf.c
++++ b/toomf.c
+@@ -29,6 +29,8 @@ static char *Copyright = "Copyright (C) 1990-1994 Quinn C.
Jensen";
+ *
+ */
+
++#include <stdio.h>
++
+ #define MAX 256
+
+ main(argc,argv)
+@@ -41,7 +43,7 @@ char *argv[];
+ int curseg = '\0';
+ int startaddr = -1;
+
+- while(gets(buf)) {
++ while(fgets(buf, sizeof(buf), stdin)) {
+ char seg;
+ int addr, data;
+ line++;
diff -Nru a56-1.3+dfsg/debian/patches/include.patch
a56-1.3+dfsg/debian/patches/include.patch
--- a56-1.3+dfsg/debian/patches/include.patch 2024-01-13 22:00:00.000000000
+0000
+++ a56-1.3+dfsg/debian/patches/include.patch 2024-01-13 22:00:00.000000000
+0000
@@ -1,19 +1,6 @@
Author: Thorsten Alteholz <deb...@alteholz.de>
Description: add some #include's to calm compiler
Forwarded: not-needed as there is no upstream anymore
-Index: a56/toomf.c
-===================================================================
---- a56.orig/toomf.c 2012-11-26 12:07:34.000000000 +0100
-+++ a56/toomf.c 2012-11-26 12:10:32.000000000 +0100
-@@ -21,6 +21,8 @@
- */
- static char *Copyright = "Copyright (C) 1990-1994 Quinn C. Jensen";
-
-+#include <stdio.h>
-+
- /*
- * This small program converts the a56.out file from the assembler
- * into a file suitable for loading into 56001 memory via the
Index: a56/a56.h
===================================================================
--- a56.orig/a56.h 1995-01-28 18:51:07.000000000 +0100
diff -Nru a56-1.3+dfsg/debian/patches/prototype2.patch
a56-1.3+dfsg/debian/patches/prototype2.patch
--- a56-1.3+dfsg/debian/patches/prototype2.patch 1970-01-01
00:00:00.000000000 +0000
+++ a56-1.3+dfsg/debian/patches/prototype2.patch 2024-03-16
20:16:28.000000000 +0000
@@ -0,0 +1,101 @@
+Description: Add function prototypes
+ Correct some sym_def calls by adding the last (unevaluated) parameter.
+Author: Bastian Germann <b...@debian.org>
+---
+--- a56-1.3+dfsg.orig/a56.y
++++ a56-1.3+dfsg/a56.y
+@@ -334,7 +334,7 @@ good_stuff
+ w0 = w1 = 0; uses_w1 = FALSE;
+ long_symbolic_expr = FALSE;}
+ | SYM
+- {sym_def($1, INT, seg, pc);
++ {sym_def($1, INT, seg, pc, 0.0f);
+ free($1);
+ if(pass == 2 && list_on) {
+ sprintf(list_buf, "%c:%04X%s", segs[seg], pc,
spaces(14-8));
+@@ -428,7 +428,7 @@ assembler_ops
+ pc += (align - (pc % align));
+ }
+ if($1)
+- { sym_def($1, INT, seg, pc);
++ { sym_def($1, INT, seg, pc, 0.0f);
+ free($1);
+ }
+ pc += size;
+@@ -498,7 +498,7 @@ space
+
+ label_field
+ : SYM
+- {sym_def($1, INT, seg, pc);
++ {sym_def($1, INT, seg, pc, 0.0f);
+ free($1);}
+ | /* empty */
+ ;
+@@ -2060,14 +2060,14 @@ int tok;
+ return "*bogus*";
+ }
+
+-yyerror(s, a0, a1, a2, a3)
+-char *s, *a0, *a1, *a2, *a3;
++yyerror(s, a0)
++char *s, *a0;
+ {
+ extern int error;
+ char buf[1024];
+
+ error++;
+- sprintf(buf, s, a0, a1, a2, a3);
++ sprintf(buf, s, a0);
+
+ if(pass == 2) {
+ fprintf(stderr, "%s: line %d: %s (tok=%s)\n", curfile, curline,
+--- a56-1.3+dfsg.orig/a56.h
++++ a56-1.3+dfsg/a56.h
+@@ -58,6 +58,9 @@ struct sym {
+ struct sym *next;
+ } *find_sym();
+
++void sym_def(char *sym, int type, int seg, int i, double f);
++int n2int(struct n n);
++int n2frac(struct n n);
+ extern int pass;
+
+ #define NEW(object) ((object *)alloc(sizeof(object)))
+@@ -83,6 +86,9 @@ struct psect {
+ struct psect *next;
+ } *find_psect(), *new_psect();
+
++_Bool check_psect(int seg, unsigned int pc);
++void set_psect(struct psect *);
++
+ FILE *open_read(), *open_write(), *open_append();
+
+ /* save string s somewhere */
+@@ -97,4 +103,14 @@ FILE *open_read(), *open_write(), *open_
+
+ char *alloc (int size);
+ char *fixstring (char *s);
+-
++void include(char *file);
++void gencode(int seg, int pc, int word);
++char *untab(register char *s);
++
++void yyerror(char *s, ...);
++void yywarning(char *s, ...);
++int yylex();
++int yyparse();
++int yywrap();
++int kparse(char *tok);
++char *tok_print(int tok);
+--- a56-1.3+dfsg.orig/lex.c
++++ a56-1.3+dfsg/lex.c
+@@ -33,6 +33,9 @@ int ldebug = 0;
+ extern YYSTYPE yyval;
+
+ double atof();
++static int is_keyword(char *tok);
++static int lgetc(FILE *fp);
++static int next_tok();
+
+ /**************** yylex - returns next token *****************************/
+
diff -Nru a56-1.3+dfsg/debian/patches/replace-undecl-fatal.patch
a56-1.3+dfsg/debian/patches/replace-undecl-fatal.patch
--- a56-1.3+dfsg/debian/patches/replace-undecl-fatal.patch 1970-01-01
00:00:00.000000000 +0000
+++ a56-1.3+dfsg/debian/patches/replace-undecl-fatal.patch 2024-01-13
22:00:00.000000000 +0000
@@ -0,0 +1,62 @@
+Description: Replace undeclared fatal
+Author: Bastian Germann <b...@debian.org>
+---
+--- a56-1.3+dfsg.orig/main.c
++++ a56-1.3+dfsg/main.c
+@@ -80,7 +80,8 @@ main(int argc, char *argv[])
+ break;
+ case '?':
+ default:
+- fatal(usage);
++ fprintf(stderr, "%s", usage);
++ exit(1);
+ }
+ input_file = argv[optind++];
+ if(input_file == NULL) fatal(usage);
+@@ -84,6 +84,9 @@ main(int argc, char *argv[])
+ }
+ input_file = argv[optind++];
+- if(input_file == NULL) fatal(usage);
++ if(input_file == NULL) {
++ fprintf(stderr, "%s", usage);
++ exit(1);
++ }
+ obj = open_write(output_file);
+
+ pc = 0;
+@@ -118,7 +121,10 @@ include(char *file)
+
+ inc_p++;
+ if(inc_p >= MAX_NEST)
+- fatal("%s: include nesting too deep\n", file);
++ {
++ fprintf(stderr, "%s: include nesting too deep\n", file);
++ exit(1);
++ }
+
+ inc[inc_p].file = file;
+ inc[inc_p].fp = fp;
+@@ -210,7 +216,10 @@ sym_def(char *sym, int type, int seg, in
+ } else {
+ sp = find_sym(sym);
+ if(!sp)
+- fatal("internal error 304\n");
++ {
++ fprintf(stderr, "%s", "internal error 304\n");
++ exit(1);
++ }
+ if(sp->n.type != type ||
+ type == INT && sp->n.val.i != (i & 0xFFFFFF) ||
+ type == FLT && sp->n.val.f != f)
+--- a56-1.3+dfsg.orig/torom.c
++++ a56-1.3+dfsg/torom.c
+@@ -49,7 +49,8 @@ main(int argc, char *argv[])
+ break;
+ } else {
+ if(addr < curaddr) {
+- fatal("%s: input line %d: can't go
back\n", argv[0], line);
++ fprintf(stderr, "%s: input line %d:
can't go back\n", argv[0], line);
++ exit(1);
+ } else if(addr != curaddr) {
+ while(curaddr < addr) {
+ putword(0);
diff -Nru a56-1.3+dfsg/debian/patches/series a56-1.3+dfsg/debian/patches/series
--- a56-1.3+dfsg/debian/patches/series 2024-01-13 22:00:00.000000000 +0000
+++ a56-1.3+dfsg/debian/patches/series 2024-03-16 20:17:06.000000000 +0000
@@ -2,5 +2,10 @@
prototype.patch
include.patch
Makefile.patch
-strtol.patch
clang-ftbfs.diff
+fgets.patch
+clang.patch
+clean-up.patch
+ansi-c.patch
+replace-undecl-fatal.patch
+prototype2.patch