Compiler suggested cleanup
Cast the results of unit pointer subtraction to int so it can be printed with a %d format specifier.
This commit is contained in:
parent
391c823e79
commit
f60390ce89
4 changed files with 30 additions and 30 deletions
|
@ -2130,8 +2130,8 @@ uint32 bc = GETP32 (pkt, RW_WBCL); /* byte count */
|
|||
uint32 bl = GETP32 (pkt, RW_WBLL); /* block addr */
|
||||
uint32 ma = GETP32 (pkt, RW_WMPL); /* block addr */
|
||||
|
||||
sim_debug (DBG_TRC, rq_devmap[cp->cnum], "rq_svc(unit=%ld, pkt=%d, cmd=%s, lbn=%0X, bc=%0x, phase=%s)\n",
|
||||
uptr-rq_devmap[cp->cnum]->units, pkt, rq_cmdname[cp->pak[pkt].d[CMD_OPC]&0x3f], bl, bc,
|
||||
sim_debug (DBG_TRC, rq_devmap[cp->cnum], "rq_svc(unit=%d, pkt=%d, cmd=%s, lbn=%0X, bc=%0x, phase=%s)\n",
|
||||
(int)(uptr-rq_devmap[cp->cnum]->units), pkt, rq_cmdname[cp->pak[pkt].d[CMD_OPC]&0x3f], bl, bc,
|
||||
uptr->io_complete ? "bottom" : "top");
|
||||
|
||||
if ((cp == NULL) || (pkt == 0)) /* what??? */
|
||||
|
|
|
@ -1311,8 +1311,8 @@ uint32 ntmk = GETP32 (pkt, POS_TMCL); /* #tmk to skp */
|
|||
struct tq_req_results *res = (struct tq_req_results *)uptr->results;
|
||||
int32 io_complete = res->io_complete;
|
||||
|
||||
sim_debug (DBG_TRC, &tq_dev, "tq_svc(unit=%ld, pkt=%d, cmd=%s, mdf=0x%0X, bc=0x%0x, phase=%s)\n",
|
||||
uptr-tq_dev.units, pkt, tq_cmdname[tq_pkt[pkt].d[CMD_OPC]&0x3f], mdf, bc,
|
||||
sim_debug (DBG_TRC, &tq_dev, "tq_svc(unit=%d, pkt=%d, cmd=%s, mdf=0x%0X, bc=0x%0x, phase=%s)\n",
|
||||
(int)(uptr-tq_dev.units), pkt, tq_cmdname[tq_pkt[pkt].d[CMD_OPC]&0x3f], mdf, bc,
|
||||
uptr->io_complete ? "bottom" : "top");
|
||||
|
||||
res->io_complete = 0;
|
||||
|
|
|
@ -237,7 +237,7 @@ static t_bool _disk_is_active (UNIT *uptr)
|
|||
struct disk_context *ctx = (struct disk_context *)uptr->disk_ctx;
|
||||
|
||||
if (ctx) {
|
||||
sim_debug (ctx->dbit, ctx->dptr, "_disk_is_active(unit=%ld, dop=%d)\n", uptr-ctx->dptr->units, ctx->io_dop);
|
||||
sim_debug (ctx->dbit, ctx->dptr, "_disk_is_active(unit=%d, dop=%d)\n", (int)(uptr-ctx->dptr->units), ctx->io_dop);
|
||||
return (ctx->io_dop != DOP_DONE);
|
||||
}
|
||||
return FALSE;
|
||||
|
@ -248,7 +248,7 @@ static void _disk_cancel (UNIT *uptr)
|
|||
struct disk_context *ctx = (struct disk_context *)uptr->disk_ctx;
|
||||
|
||||
if (ctx) {
|
||||
sim_debug (ctx->dbit, ctx->dptr, "_disk_cancel(unit=%ld, dop=%d)\n", uptr-ctx->dptr->units, ctx->io_dop);
|
||||
sim_debug (ctx->dbit, ctx->dptr, "_disk_cancel(unit=%d, dop=%d)\n", (int)(uptr-ctx->dptr->units), ctx->io_dop);
|
||||
if (ctx->asynch_io) {
|
||||
pthread_mutex_lock (&ctx->io_lock);
|
||||
while (ctx->io_dop != DOP_DONE)
|
||||
|
|
48
sim_tape.c
48
sim_tape.c
|
@ -173,7 +173,7 @@ if ((!callback) || !ctx->asynch_io)
|
|||
pthread_mutex_lock (&ctx->io_lock); \
|
||||
\
|
||||
sim_debug (ctx->dbit, ctx->dptr, \
|
||||
"sim_tape AIO_CALL(op=%d, unit=%ld)\n", op, uptr-ctx->dptr->units);\
|
||||
"sim_tape AIO_CALL(op=%d, unit=%d)\n", op, (int)(uptr-ctx->dptr->units));\
|
||||
\
|
||||
if (ctx->callback) \
|
||||
abort(); /* horrible mistake, stop */ \
|
||||
|
@ -227,7 +227,7 @@ struct tape_context *ctx = (struct tape_context *)uptr->tape_ctx;
|
|||
++sched_priority.sched_priority;
|
||||
pthread_setschedparam (pthread_self(), sched_policy, &sched_priority);
|
||||
|
||||
sim_debug (ctx->dbit, ctx->dptr, "_tape_io(unit=%ld) starting\n", uptr-ctx->dptr->units);
|
||||
sim_debug (ctx->dbit, ctx->dptr, "_tape_io(unit=%d) starting\n", (int)(uptr-ctx->dptr->units));
|
||||
|
||||
pthread_mutex_lock (&ctx->io_lock);
|
||||
pthread_cond_signal (&ctx->startup_cond); /* Signal we're ready to go */
|
||||
|
@ -296,7 +296,7 @@ struct tape_context *ctx = (struct tape_context *)uptr->tape_ctx;
|
|||
}
|
||||
pthread_mutex_unlock (&ctx->io_lock);
|
||||
|
||||
sim_debug (ctx->dbit, ctx->dptr, "_tape_io(unit=%ld) exiting\n", uptr-ctx->dptr->units);
|
||||
sim_debug (ctx->dbit, ctx->dptr, "_tape_io(unit=%d) exiting\n", (int)(uptr-ctx->dptr->units));
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
@ -315,7 +315,7 @@ static void _tape_completion_dispatch (UNIT *uptr)
|
|||
struct tape_context *ctx = (struct tape_context *)uptr->tape_ctx;
|
||||
TAPE_PCALLBACK callback = ctx->callback;
|
||||
|
||||
sim_debug (ctx->dbit, ctx->dptr, "_tape_completion_dispatch(unit=%ld, top=%d, callback=%p)\n", uptr-ctx->dptr->units, ctx->io_top, ctx->callback);
|
||||
sim_debug (ctx->dbit, ctx->dptr, "_tape_completion_dispatch(unit=%d, top=%d, callback=%p)\n", (int)(uptr-ctx->dptr->units), ctx->io_top, ctx->callback);
|
||||
|
||||
if (ctx->io_top != TOP_DONE)
|
||||
abort(); /* horribly wrong, stop */
|
||||
|
@ -331,7 +331,7 @@ static t_bool _tape_is_active (UNIT *uptr)
|
|||
struct tape_context *ctx = (struct tape_context *)uptr->tape_ctx;
|
||||
|
||||
if (ctx) {
|
||||
sim_debug (ctx->dbit, ctx->dptr, "_tape_is_active(unit=%ld, top=%d)\n", uptr-ctx->dptr->units, ctx->io_top);
|
||||
sim_debug (ctx->dbit, ctx->dptr, "_tape_is_active(unit=%d, top=%d)\n", (int)(uptr-ctx->dptr->units), ctx->io_top);
|
||||
return (ctx->io_top != TOP_DONE);
|
||||
}
|
||||
return FALSE;
|
||||
|
@ -342,7 +342,7 @@ static void _tape_cancel (UNIT *uptr)
|
|||
struct tape_context *ctx = (struct tape_context *)uptr->tape_ctx;
|
||||
|
||||
if (ctx) {
|
||||
sim_debug (ctx->dbit, ctx->dptr, "_tape_cancel(unit=%ld, top=%d)\n", uptr-ctx->dptr->units, ctx->io_top);
|
||||
sim_debug (ctx->dbit, ctx->dptr, "_tape_cancel(unit=%d, top=%d)\n", (int)(uptr-ctx->dptr->units), ctx->io_top);
|
||||
if (ctx->asynch_io) {
|
||||
pthread_mutex_lock (&ctx->io_lock);
|
||||
while (ctx->io_top != TOP_DONE)
|
||||
|
@ -1070,7 +1070,7 @@ t_mtrlnt i, tbc, rbc;
|
|||
t_addr opos;
|
||||
t_stat st;
|
||||
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_rdrecf(unit=%ld, buf=%p, max=%d)\n", uptr-ctx->dptr->units, buf, max);
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_rdrecf(unit=%d, buf=%p, max=%d)\n", (int)(uptr-ctx->dptr->units), buf, max);
|
||||
|
||||
opos = uptr->pos; /* old position */
|
||||
if (MTSE_OK != (st = sim_tape_rdlntf (uptr, &tbc))) /* read rec lnt */
|
||||
|
@ -1134,7 +1134,7 @@ uint32 f = MT_GET_FMT (uptr);
|
|||
t_mtrlnt i, rbc, tbc;
|
||||
t_stat st;
|
||||
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_rdrecr(unit=%ld, buf=%p, max=%d)\n", uptr-ctx->dptr->units, buf, max);
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_rdrecr(unit=%d, buf=%p, max=%d)\n", (int)(uptr-ctx->dptr->units), buf, max);
|
||||
|
||||
if (MTSE_OK != (st = sim_tape_rdlntr (uptr, &tbc))) /* read rec lnt */
|
||||
return st;
|
||||
|
@ -1184,7 +1184,7 @@ struct tape_context *ctx = (struct tape_context *)uptr->tape_ctx;
|
|||
uint32 f = MT_GET_FMT (uptr);
|
||||
t_mtrlnt sbc;
|
||||
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_wrrecf(unit=%ld, buf=%p, bc=%d)\n", uptr-ctx->dptr->units, buf, bc);
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_wrrecf(unit=%d, buf=%p, bc=%d)\n", (int)(uptr-ctx->dptr->units), buf, bc);
|
||||
|
||||
sim_tape_data_trace(uptr, buf, bc, "Record Write", ctx->dptr->dctrl & MTSE_DBG_DAT, MTSE_DBG_STR);
|
||||
MT_CLR_PNU (uptr);
|
||||
|
@ -1263,7 +1263,7 @@ t_stat sim_tape_wrtmk (UNIT *uptr)
|
|||
{
|
||||
struct tape_context *ctx = (struct tape_context *)uptr->tape_ctx;
|
||||
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_wrtmk(unit=%ld)\n", uptr-ctx->dptr->units);
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_wrtmk(unit=%d)\n", (int)(uptr-ctx->dptr->units));
|
||||
if (MT_GET_FMT (uptr) == MTUF_F_P7B) { /* P7B? */
|
||||
uint8 buf = P7B_EOF; /* eof mark */
|
||||
return sim_tape_wrrecf (uptr, &buf, 1); /* write char */
|
||||
|
@ -1287,7 +1287,7 @@ t_stat sim_tape_wreom (UNIT *uptr)
|
|||
t_stat result;
|
||||
struct tape_context *ctx = (struct tape_context *)uptr->tape_ctx;
|
||||
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_wreom(unit=%ld)\n", uptr-ctx->dptr->units);
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_wreom(unit=%d)\n", (int)(uptr-ctx->dptr->units));
|
||||
if (MT_GET_FMT (uptr) == MTUF_F_P7B) /* cant do P7B */
|
||||
return MTSE_FMT;
|
||||
|
||||
|
@ -1315,7 +1315,7 @@ t_stat sim_tape_wreomrw (UNIT *uptr)
|
|||
struct tape_context *ctx = (struct tape_context *)uptr->tape_ctx;
|
||||
t_stat r;
|
||||
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_wreomrw(unit=%ld)\n", uptr-ctx->dptr->units);
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_wreomrw(unit=%d)\n", (int)(uptr-ctx->dptr->units));
|
||||
if (MT_GET_FMT (uptr) == MTUF_F_P7B) /* cant do P7B */
|
||||
return MTSE_FMT;
|
||||
r = sim_tape_wrdata (uptr, MTR_EOM);
|
||||
|
@ -1447,7 +1447,7 @@ const uint32 format = MT_GET_FMT (uptr); /* tape format */
|
|||
const uint32 meta_size = sizeof (t_mtrlnt); /* bytes per metadatum */
|
||||
const uint32 min_rec_size = 2 + sizeof (t_mtrlnt) * 2; /* smallest data record size */
|
||||
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_wrgap(unit=%ld, gaplen=%u)\n", uptr-ctx->dptr->units, gaplen);
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_wrgap(unit=%d, gaplen=%u)\n", (int)(uptr-ctx->dptr->units), gaplen);
|
||||
|
||||
MT_CLR_PNU (uptr);
|
||||
|
||||
|
@ -1614,7 +1614,7 @@ t_stat sim_tape_sprecf (UNIT *uptr, t_mtrlnt *bc)
|
|||
struct tape_context *ctx = (struct tape_context *)uptr->tape_ctx;
|
||||
t_stat st;
|
||||
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_sprecf(unit=%ld)\n", uptr-ctx->dptr->units);
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_sprecf(unit=%d)\n", (int)(uptr-ctx->dptr->units));
|
||||
|
||||
st = sim_tape_rdlntf (uptr, bc); /* get record length */
|
||||
*bc = MTR_L (*bc);
|
||||
|
@ -1655,7 +1655,7 @@ struct tape_context *ctx = (struct tape_context *)uptr->tape_ctx;
|
|||
t_stat st;
|
||||
t_mtrlnt tbc;
|
||||
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_sprecsf(unit=%ld, count=%d)\n", uptr-ctx->dptr->units, count);
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_sprecsf(unit=%d, count=%d)\n", (int)(uptr-ctx->dptr->units), count);
|
||||
|
||||
*skipped = 0;
|
||||
while (*skipped < count) { /* loopo */
|
||||
|
@ -1700,7 +1700,7 @@ t_stat sim_tape_sprecr (UNIT *uptr, t_mtrlnt *bc)
|
|||
struct tape_context *ctx = (struct tape_context *)uptr->tape_ctx;
|
||||
t_stat st;
|
||||
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_sprecr(unit=%ld)\n", uptr-ctx->dptr->units);
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_sprecr(unit=%d)\n", (int)(uptr-ctx->dptr->units));
|
||||
|
||||
if (MT_TST_PNU (uptr)) {
|
||||
MT_CLR_PNU (uptr);
|
||||
|
@ -1747,7 +1747,7 @@ struct tape_context *ctx = (struct tape_context *)uptr->tape_ctx;
|
|||
t_stat st;
|
||||
t_mtrlnt tbc;
|
||||
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_sprecsr(unit=%ld, count=%d)\n", uptr-ctx->dptr->units, count);
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_sprecsr(unit=%d, count=%d)\n", (int)(uptr-ctx->dptr->units), count);
|
||||
|
||||
*skipped = 0;
|
||||
while (*skipped < count) { /* loopo */
|
||||
|
@ -1796,7 +1796,7 @@ t_stat st;
|
|||
t_bool last_tapemark = FALSE;
|
||||
uint32 filerecsskipped;
|
||||
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_spfilebyrecf(unit=%ld, count=%d, check_leot=%d)\n", uptr-ctx->dptr->units, count, check_leot);
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_spfilebyrecf(unit=%d, count=%d, check_leot=%d)\n", (int)(uptr-ctx->dptr->units), count, check_leot);
|
||||
|
||||
if (check_leot) {
|
||||
t_mtrlnt rbc;
|
||||
|
@ -1864,7 +1864,7 @@ t_stat sim_tape_spfilef (UNIT *uptr, uint32 count, uint32 *skipped)
|
|||
struct tape_context *ctx = (struct tape_context *)uptr->tape_ctx;
|
||||
uint32 totalrecsskipped;
|
||||
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_spfilef(unit=%ld, count=%d)\n", uptr-ctx->dptr->units, count);
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_spfilef(unit=%d, count=%d)\n", (int)(uptr-ctx->dptr->units), count);
|
||||
|
||||
return sim_tape_spfilebyrecf (uptr, count, skipped, &totalrecsskipped, FALSE);
|
||||
}
|
||||
|
@ -1905,7 +1905,7 @@ struct tape_context *ctx = (struct tape_context *)uptr->tape_ctx;
|
|||
t_stat st;
|
||||
uint32 filerecsskipped;
|
||||
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_spfilebyrecr(unit=%ld, count=%d)\n", uptr-ctx->dptr->units, count);
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_spfilebyrecr(unit=%d, count=%d)\n", (int)(uptr-ctx->dptr->units), count);
|
||||
|
||||
*skipped = 0;
|
||||
*recsskipped = 0;
|
||||
|
@ -1958,7 +1958,7 @@ t_stat sim_tape_spfiler (UNIT *uptr, uint32 count, uint32 *skipped)
|
|||
struct tape_context *ctx = (struct tape_context *)uptr->tape_ctx;
|
||||
uint32 totalrecsskipped;
|
||||
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_spfiler(unit=%ld, count=%d)\n", uptr-ctx->dptr->units, count);
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_spfiler(unit=%d, count=%d)\n", (int)(uptr-ctx->dptr->units), count);
|
||||
|
||||
return sim_tape_spfilebyrecr (uptr, count, skipped, &totalrecsskipped);
|
||||
}
|
||||
|
@ -1979,7 +1979,7 @@ t_stat sim_tape_rewind (UNIT *uptr)
|
|||
struct tape_context *ctx = (struct tape_context *)uptr->tape_ctx;
|
||||
|
||||
if (uptr->flags & UNIT_ATT) {
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_rewind(unit=%ld)\n", uptr-ctx->dptr->units);
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_rewind(unit=%d)\n", (int)(uptr-ctx->dptr->units));
|
||||
}
|
||||
uptr->pos = 0;
|
||||
MT_CLR_PNU (uptr);
|
||||
|
@ -2002,7 +2002,7 @@ t_stat sim_tape_position (UNIT *uptr, uint32 flags, uint32 recs, uint32 *recsski
|
|||
struct tape_context *ctx = (struct tape_context *)uptr->tape_ctx;
|
||||
t_stat r = MTSE_OK;
|
||||
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_position(unit=%ld, flags=0x%X, recs=%d, files=%d)\n", uptr-ctx->dptr->units, flags, recs, files);
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_position(unit=%d, flags=0x%X, recs=%d, files=%d)\n", (int)(uptr-ctx->dptr->units), flags, recs, files);
|
||||
|
||||
*recsskipped = *filesskipped = *objectsskipped = 0;
|
||||
if (flags & MTPOS_M_REW)
|
||||
|
@ -2066,7 +2066,7 @@ MT_CLR_PNU (uptr);
|
|||
if (!(uptr->flags & UNIT_ATT)) /* attached? */
|
||||
return SCPE_OK;
|
||||
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_reset(unit=%ld)\n", uptr-ctx->dptr->units);
|
||||
sim_debug (ctx->dbit, ctx->dptr, "sim_tape_reset(unit=%d)\n", (int)(uptr-ctx->dptr->units));
|
||||
|
||||
_sim_tape_io_flush(uptr);
|
||||
AIO_VALIDATE;
|
||||
|
|
Loading…
Add table
Reference in a new issue