Merge pull request #220 from davidgiven/dtrg-fixes

Don't rely on COMMON variable linkage.
This commit is contained in:
David Given 2020-09-14 23:13:12 +02:00 committed by GitHub
commit ec47148b85
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 60 additions and 33 deletions

View file

@ -42,27 +42,27 @@ struct swtab {
extern int wordsize;
extern const char* modulename;
int paramsize;
struct hshtab hshtab[HSHSIZ];
int hshused;
int eof;
int peekc;
const char* ctab;
struct hshtab *bsym;
struct hshtab *paraml, *parame;
int cval;
int isn;
char symbuf[NCPS+1];
FILE *sbufp;
int stack;
struct tnode **cp;
int *space;
int ospace[OSSIZ];
int retlab;
int nerror;
struct swtab swtab[SWSIZ];
struct swtab *swp;
int deflab;
extern int paramsize;
extern struct hshtab hshtab[HSHSIZ];
extern int hshused;
extern int eof;
extern int peekc;
extern const char* ctab;
extern struct hshtab *bsym;
extern struct hshtab *paraml, *parame;
extern int cval;
extern int isn;
extern char symbuf[NCPS+1];
extern FILE *sbufp;
extern int stack;
extern struct tnode **cp;
extern int *space;
extern int ospace[OSSIZ];
extern int retlab;
extern int nerror;
extern struct swtab swtab[SWSIZ];
extern struct swtab *swp;
extern int deflab;
extern int contlab;
extern int brklab;
@ -70,16 +70,16 @@ extern int opdope[];
extern int line;
extern int peeksym, peeksym2;
void error(char *s, ...);
void printtoken(int tok, FILE *out);
struct tnode * block(int op, int value, struct tnode *tr1, struct tnode *tr2);
void rcexpr(struct tnode *tr);
void cbranch(struct tnode *t, int lab);
void jump(int lab);
void fnlabel(int l);
void tonativeaddr(void);
void fromnativeaddr(void);
char* manglename(char* name, char prefix);
extern void error(char *s, ...);
extern void printtoken(int tok, FILE *out);
extern struct tnode * block(int op, int value, struct tnode *tr1, struct tnode *tr2);
extern void rcexpr(struct tnode *tr);
extern void cbranch(struct tnode *t, int lab);
extern void jump(int lab);
extern void fnlabel(int l);
extern void tonativeaddr(void);
extern void fromnativeaddr(void);
extern char* manglename(char* name, char prefix);
#define EOFC 0
#define SEMI 1

View file

@ -19,6 +19,35 @@ int bsymb_part;
int code_part;
int string_part;
int paramsize;
struct hshtab hshtab[HSHSIZ];
int hshused;
int eof;
int peekc;
const char* ctab;
struct hshtab *bsym;
struct hshtab *paraml, *parame;
int cval;
int isn;
char symbuf[NCPS+1];
FILE *sbufp;
int stack;
struct tnode **cp;
int *space;
int ospace[OSSIZ];
int retlab;
int nerror;
struct swtab swtab[SWSIZ];
struct swtab *swp;
int deflab;
int contlab;
int brklab;
int opdope[];
int line;
int peeksym, peeksym2;
void
init(char *s, int val)
{

View file

@ -35,7 +35,6 @@
#define oldlvbx(x) oldstruct(bext_lv,x)
short nrglobals;
short nrvars;
STATIC int Slv;

View file

@ -33,7 +33,6 @@
#define newudbx() (bext_p) newstruct(bext_ud)
#define oldudbx(x) oldstruct(bext_ud,x)
short nrglobals;
short nrvars;
int Svalue,Svariable;