cast ptrdiff_t to int for ANSI

This commit is contained in:
ceriel
1990-04-25 14:23:05 +00:00
parent 8fe53f501f
commit f2b4713c24
8 changed files with 29 additions and 9 deletions

View File

@@ -12,6 +12,7 @@ static arg();
static pseudo();
extern char em_flag[];
char C_error;
#define flags(pp) (em_flag[(pp)->em_opcode - sp_fmnem] & EM_PAR)
@@ -26,6 +27,7 @@ C_alloc()
arith C_holsize, C_bsssize;
int C_holinit, C_bssinit;
int
C_out(p)
register struct e_instr *p;
{
@@ -75,8 +77,11 @@ C_out(p)
DFDNAM(p->em_dnam);
NL();
break;
default:
C_error = "Illegal EM line";
return 0;
}
return 1;
}
static

View File

@@ -70,7 +70,7 @@ C_flush() {
return;
}
#endif
if (C_opp != obuf && sys_write(C_ofp, obuf, C_opp - obuf) == 0) {
if (C_opp != obuf && sys_write(C_ofp, obuf, (int)(C_opp - obuf)) == 0) {
C_ofp = 0;
C_failed();
}

View File

@@ -66,6 +66,13 @@ emcode \- EM code interface for compilers
.B int C_getid()
.PP
.B char *C_tmpdir;
.PP
.B #include <em.h>
.PP
.B int C_out(p)
.B struct e_instr *p;
.PP
.B char *C_error;
.fi
.SH DESCRIPTION
This package provides a procedural EM code interface to be used in
@@ -437,6 +444,14 @@ The user can change this by just changing
.I C_tmpdir
before calling
.IR C_open.
.PP
.I C_out
accepts a structure as delivered by the
.I read_em
module, and produces code for it. It returns 1 if it succeeds, 0 if it fails
for some reason. The reason can then be found in \fIC_error\fP. The
.I C_out
routine replaces the EM_mkcalls routine.
.SH FILES
.nf
~em/modules/h/em.h