added rcsid

added code to check for write errors on codefile
This commit is contained in:
sater 1984-05-19 11:40:08 +00:00
parent f792cb549e
commit 445ee4ccb8
2 changed files with 16 additions and 0 deletions

View file

@ -1,3 +1,7 @@
#ifndef NORCSID
static char rcsid2[] = "$Header$";
#endif
#include <stdio.h> #include <stdio.h>
#include "assert.h" #include "assert.h"
#include <em_spec.h> #include <em_spec.h>
@ -203,6 +207,7 @@ dopseudo() {
case EOF: case EOF:
swtxt(); swtxt();
popstr(0); popstr(0);
tstoutput();
exit(0); exit(0);
default: default:
error("Unknown opcode %d",savetab1); error("Unknown opcode %d",savetab1);
@ -330,6 +335,7 @@ dopseudo() {
#ifdef REGVARS #ifdef REGVARS
unlinkregs(); unlinkregs();
#endif #endif
tstoutput();
break; break;
default: default:
error("No table entry for %d",savetab1); error("No table entry for %d",savetab1);

View file

@ -1,3 +1,7 @@
#ifndef NORCSID
static char rcsid[] = "$Header$";
#endif
#include "assert.h" #include "assert.h"
#include <stdio.h> #include <stdio.h>
#include "param.h" #include "param.h"
@ -59,6 +63,12 @@ out_finish() {
fclose(codefile); fclose(codefile);
} }
tstoutput() {
if (ferror(codefile))
error("Write error on output");
}
gencode(code) register char *code; { gencode(code) register char *code; {
register c; register c;
int tokno,fldno,insno,regno,subno; int tokno,fldno,insno,regno,subno;