From c014639d94e728dcdb295840f64b0020c16aaac7 Mon Sep 17 00:00:00 2001 From: "warren.toomey" Date: Sat, 17 May 2008 02:37:44 +0000 Subject: [PATCH] Patches from Sergey Poznyakoff, way back in 2001. powf() function may not be present. struct termios may lack c_ispeed, c_ospeed members. --- tools/apout/cpu.c | 5 +++-- tools/apout/fp.c | 8 ++++++-- tools/apout/v7trap.c | 12 ++++++------ 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/tools/apout/cpu.c b/tools/apout/cpu.c index 17753f4..45784e8 100644 --- a/tools/apout/cpu.c +++ b/tools/apout/cpu.c @@ -1,8 +1,8 @@ /* cpu.c - this holds the main loop for the emulator, plus generic * functions to deal with exceptional instructions and events * - * $Revision: 1.25 $ - * $Date: 2002/06/10 11:41:40 $ + * $Revision: 1.26 $ + * $Date: 2008/05/15 07:52:45 $ */ #include "defines.h" #include @@ -69,6 +69,7 @@ void run() { regs[0], regs[1], regs[2], regs[3], regs[4], regs[5], regs[6])); TrapDebug((dbg_file, "NZVC1 %d%d%d%d\n",CC_N,CC_Z,CC_V,CC_C)); + fflush(dbg_file); } regs[PC] += 2; itab[ir >> 6] (); if ((Sighead!=NULL) && (sigrunner!=NULL)) (void) (*sigrunner)(); diff --git a/tools/apout/fp.c b/tools/apout/fp.c index b3bc85d..3b69cb3 100644 --- a/tools/apout/fp.c +++ b/tools/apout/fp.c @@ -1,7 +1,7 @@ /* fp.c - PDP-11 floating point operations * - * $Revision: 2.23 $ - * $Date: 1999/12/30 02:11:16 $ + * $Revision: 2.24 $ + * $Date: 2008/05/15 07:52:45 $ */ /* The floating-point emulation code here is just enough to allow @@ -13,7 +13,11 @@ */ #include "defines.h" #include +#ifdef HAVE_POWF float powf(float x, float y); /* FreeBSD 3.X no longer defines this */ +#else +# define powf(x,y) (float)pow((double)x, (double)y) +#endif #define XUL 170141163178059628080016879768632819712.0 /* Biggest float */ diff --git a/tools/apout/v7trap.c b/tools/apout/v7trap.c index 0ea142f..4246d76 100644 --- a/tools/apout/v7trap.c +++ b/tools/apout/v7trap.c @@ -1,8 +1,8 @@ /* v7trap.c - Deal with V7 trap instructions. V5 and V6 syscalls are also * done here, because the syscall interface is nearly the same as V7. * - * $Revision: 1.47 $ - * $Date: 2002/06/10 11:43:24 $ + * $Revision: 1.48 $ + * $Date: 2008/05/15 07:52:45 $ */ #include "defines.h" #include @@ -609,8 +609,8 @@ trap_gtty(u_int16_t fd, u_int16_t ucnt) return i; CLR_CC_C(); sgtb = (struct tr_sgttyb *) & dspace[ucnt]; - sgtb->sg_ispeed = tios.c_ispeed; - sgtb->sg_ospeed = tios.c_ospeed; + sgtb->sg_ispeed = cfgetispeed(&tios); /* tios.c_ispeed; --gray */ + sgtb->sg_ospeed = cfgetospeed(&tios); /* tios.c_ospeed; --gray */ sgtb->sg_erase = tios.c_cc[VERASE]; sgtb->sg_kill = tios.c_cc[VKILL]; sgtb->sg_flags = 0; @@ -644,8 +644,8 @@ trap_stty(u_int16_t fd, u_int16_t ucnt) if (ucnt != 0) { sgtb = (struct tr_sgttyb *) & dspace[ucnt]; - tios.c_ispeed = sgtb->sg_ispeed; - tios.c_ospeed = sgtb->sg_ospeed; + cfsetispeed(&tios, sgtb->sg_ispeed); + cfsetospeed(&tios, sgtb->sg_ospeed); tios.c_cc[VERASE] = sgtb->sg_erase; tios.c_cc[VKILL] = sgtb->sg_kill; if (sgtb->sg_flags & TR_XTABS)