diff --git a/sim_defs.h b/sim_defs.h index a779041b..7cd4c51a 100644 --- a/sim_defs.h +++ b/sim_defs.h @@ -203,9 +203,11 @@ typedef uint32 t_value; #if defined (USE_INT64) && defined (USE_ADDR64) /* 64b address */ typedef t_uint64 t_addr; #define T_ADDR_W 64 +#define T_ADDR_FMT LL_FMT #else /* 32b address */ typedef uint32 t_addr; #define T_ADDR_W 32 +#define T_ADDR_FMT "" #endif /* end 64b address */ #if defined (_WIN32) @@ -698,10 +700,12 @@ struct sim_debtab { char *desc; /* description */ }; +/* Deprecated Debug macros. Use sim_debug() */ + #define DEBUG_PRS(d) (sim_deb && d.dctrl) #define DEBUG_PRD(d) (sim_deb && d->dctrl) #define DEBUG_PRI(d,m) (sim_deb && (d.dctrl & (m))) -#define DEBUG_PRJ(d,m) (sim_deb && (d->dctrl & (m))) +#define DEBUG_PRJ(d,m) (sim_deb && ((d)->dctrl & (m))) #define SIM_DBG_EVENT 0x10000 #define SIM_DBG_ACTIVATE 0x20000 diff --git a/sim_tape.c b/sim_tape.c index 090c85ad..3cb018e1 100644 --- a/sim_tape.c +++ b/sim_tape.c @@ -662,7 +662,7 @@ switch (f) { /* switch on fmt */ default: return MTSE_FMT; } -sim_debug (MTSE_DBG_STR, ctx->dptr, "rd_lnt: st: %d, lnt: %d, pos: %d\n", r, *bc, uptr->pos); +sim_debug (MTSE_DBG_STR, ctx->dptr, "rd_lnt: st: %d, lnt: %d, pos: %" T_ADDR_FMT "u\n", r, *bc, uptr->pos); return r; } @@ -786,7 +786,7 @@ switch (f) { /* switch on fmt */ default: return MTSE_FMT; } -sim_debug (MTSE_DBG_STR, ctx->dptr, "rd_lnt: st: %d, lnt: %d, pos: %d\n", r, *bc, uptr->pos); +sim_debug (MTSE_DBG_STR, ctx->dptr, "rd_lnt: st: %d, lnt: %d, pos: %" T_ADDR_FMT "u\n", r, *bc, uptr->pos); return r; } @@ -1001,7 +1001,7 @@ if (ferror (uptr->fileref)) { /* error? */ MT_SET_PNU (uptr); return sim_tape_ioerr (uptr); } -sim_debug (MTSE_DBG_STR, ctx->dptr, "wr_lnt: lnt: %d, pos: %d\n", dat, uptr->pos); +sim_debug (MTSE_DBG_STR, ctx->dptr, "wr_lnt: lnt: %d, pos: %" T_ADDR_FMT "u\n", dat, uptr->pos); uptr->pos = uptr->pos + sizeof (t_mtrlnt); /* move tape */ return MTSE_OK; }