diff --git a/H316/h316_mt.c b/H316/h316_mt.c index 320a6ab9..731e207b 100644 --- a/H316/h316_mt.c +++ b/H316/h316_mt.c @@ -1,6 +1,6 @@ /* h316_mt.c: H316/516 magnetic tape simulator - Copyright (c) 2003-2012, Robert M. Supnik + Copyright (c) 2003-2022, Robert M. Supnik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -25,6 +25,7 @@ mt 516-4100 seven track magnetic tape + 26-Mar-22 RMS Added extra case points for new MTSE definitions 03-Jul-13 RLA compatibility changes for extended interrupts 19-Mar-12 RMS Fixed declaration of chan_req (Mark Pizzolato) 09-Jun-07 RMS Fixed bug in write without stop (Theo Engel) @@ -519,6 +520,7 @@ switch (st) { case MTSE_FMT: /* illegal fmt */ case MTSE_UNATT: /* unattached */ + default: /* unknown error */ mt_err = 1; /* reject */ case MTSE_OK: /* no error */ return SCPE_IERR; /* never get here! */ diff --git a/I1401/i1401_mt.c b/I1401/i1401_mt.c index 83b29027..34e3caba 100644 --- a/I1401/i1401_mt.c +++ b/I1401/i1401_mt.c @@ -1,6 +1,6 @@ /* i1401_mt.c: IBM 1401 magnetic tape simulator - Copyright (c) 1993-2016, Robert M. Supnik + Copyright (c) 1993-2022, Robert M. Supnik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -25,6 +25,7 @@ mt 7-track magtape + 26-Mar-22 RMS Added extra case points for new MTSE definitions 20-Oct-16 RMS Must call sim_tape_attach to use library (Mark Pizzolato) 03-Sep-13 RMS Read TMK does not write GM+WM to memory 19-Mar-11 RMS Restored lost edit to insert EOF in memory on read EOF @@ -416,6 +417,7 @@ switch (st) { break; case MTSE_FMT: /* illegal fmt */ + default: /* unknown error */ return SCPE_IERR; case MTSE_UNATT: /* not attached */ diff --git a/I7094/i7094_mt.c b/I7094/i7094_mt.c index 87afe0a1..baa4878c 100644 --- a/I7094/i7094_mt.c +++ b/I7094/i7094_mt.c @@ -1,6 +1,6 @@ /* i7094_mt.c: IBM 7094 magnetic tape simulator - Copyright (c) 2003-2021, Robert M Supnik + Copyright (c) 2003-2022, Robert M Supnik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -25,6 +25,8 @@ mt magtape simulator + 26-Mar-22 RMS Added extra case points for new MTSE definitions + 11-Mar-22 RMS Removed dead code (COVERITY) 31-Jan-21 RMS Replaced dynamic buffers with static (Mark Pizzolato) 19-Mar-12 RMS Fixed declaration of sel_name (Mark Pizzolato) 16-Jul-10 RMS Fixed handling of BSR, BSF (Dave Pitts) @@ -514,7 +516,7 @@ if (ch >= NUM_CHAN) /* invalid chan? */ return SCPE_IERR; xb = mtxb[ch]; /* get xfer buf */ u = mt_unit[ch] & 017; -if ((xb == NULL) || (u > MT_NUMDR)) /* invalid args? */ +if (u > MT_NUMDR) /* invalid args */ return SCPE_IERR; uptr = mt_dev[ch].units + u; /* get unit */ mt_chob[ch] = val & DMASK; /* save word from chan */ @@ -554,8 +556,6 @@ t_uint64 dat; t_mtrlnt bc; t_stat r; -if (xb == NULL) /* valid buffer? */ - return SCPE_IERR; u = uptr - mt_dev[ch].units; switch (uptr->UST) { /* case on state */ @@ -733,8 +733,6 @@ uint8 *xb = mtxb[ch]; t_stat r; if (mt_bptr[ch]) { /* any data? */ - if (xb == NULL) - return SCPE_IERR; r = sim_tape_wrrecf (uptr, xb, mt_bptr[ch]); /* write record */ if ((r = mt_map_err (uptr, r))) /* map error */ return r; @@ -761,6 +759,7 @@ switch (st) { case MTSE_FMT: /* illegal fmt */ case MTSE_UNATT: /* not attached */ + default: /* unknown error */ ch6_err_disc (ch, u, CHF_TRC); mt_unit[ch] = 0; /* disconnect */ return SCPE_IERR; diff --git a/Interdata/id_mt.c b/Interdata/id_mt.c index f9209d82..ba8b8c4e 100644 --- a/Interdata/id_mt.c +++ b/Interdata/id_mt.c @@ -1,6 +1,6 @@ /* id_mt.c: Interdata magnetic tape simulator - Copyright (c) 2001-2008, Robert M Supnik + Copyright (c) 2001-2022, Robert M Supnik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -25,6 +25,7 @@ mt M46-494 dual density 9-track magtape controller + 26-Mar-22 RMS Added extra case points for new MTSE definitions 16-Feb-06 RMS Added tape capacity checking 18-Mar-05 RMS Added attached test to detach routine 07-Dec-04 RMS Added read-only file support @@ -424,6 +425,7 @@ switch (st) { case MTSE_FMT: /* illegal fmt */ case MTSE_UNATT: /* not attached */ + default: /* unknown error */ mt_sta = mt_sta | STA_ERR; case MTSE_OK: /* no error */ return SCPE_IERR; diff --git a/NOVA/nova_mta.c b/NOVA/nova_mta.c index e90a5c28..b7277a91 100644 --- a/NOVA/nova_mta.c +++ b/NOVA/nova_mta.c @@ -1,6 +1,6 @@ /* nova_mta.c: NOVA magnetic tape simulator - Copyright (c) 1993-2020, Robert M. Supnik + Copyright (c) 1993-2022, Robert M. Supnik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -25,6 +25,7 @@ mta magnetic tape + 26-Mar-22 RMS Added extra case points for new MTSE definitions 23-Mar-20 RMS Unload should call sim_tape_detach (Mark Pizzolato) 13-Mar-17 RMS Annotated fall through in switch 04-Jul-07 BKR fixed boot code to properly boot self-boot tapes; @@ -514,6 +515,7 @@ switch (st) { case MTSE_FMT: /* illegal fmt */ mta_upddsta (uptr, uptr->USTAT | STA_WLK | STA_RDY); /* fall through */ + default: case MTSE_UNATT: /* unattached */ mta_sta = mta_sta | STA_ILL; /* fall through */ diff --git a/PDP10/pdp10_tu.c b/PDP10/pdp10_tu.c index cf8e8e3a..e1568c0a 100644 --- a/PDP10/pdp10_tu.c +++ b/PDP10/pdp10_tu.c @@ -1,6 +1,6 @@ /* pdp10_tu.c - PDP-10 RH11/TM03/TU45 magnetic tape simulator - Copyright (c) 1993-2020, Robert M Supnik + Copyright (c) 1993-2022, Robert M Supnik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -25,6 +25,7 @@ tu RH11/TM03/TU45 magtape + 26-Mar-22 RMS Added extra case points for new MTSE definitions 07-Sep-20 RMS Fixed || -> | in macro (Mark Pizzolato) 23-Mar-20 RMS Unload should call sim_tape_detach (Mark Pizzolato) 12-Jan-18 RMS Fixed missing () in logical test (Mark Pizzolato) @@ -1097,6 +1098,7 @@ switch (st) { case MTSE_FMT: /* illegal fmt */ case MTSE_UNATT: /* not attached */ + default: /* unknown error */ set_tuer (ER_NXF); /* can't execute */ if (qdt) /* data xfr? set TRE */ tucs1 = tucs1 | CS1_TRE; diff --git a/PDP11/pdp11_ta.c b/PDP11/pdp11_ta.c index 5036aad2..00c6f430 100644 --- a/PDP11/pdp11_ta.c +++ b/PDP11/pdp11_ta.c @@ -1,6 +1,6 @@ /* pdp11_ta.c: PDP-11 cassette tape simulator - Copyright (c) 2007-2016, Robert M Supnik + Copyright (c) 2007-2022, Robert M Supnik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -25,6 +25,7 @@ ta TA11/TU60 cassette tape + 26-Mar-22 RMS Added extra case points for new MTSE definitions 10-Oct-16 RMS Fixed bad register definitions (Mark Pizzolato) 23-Oct-13 RMS Revised for new boot setup routine 06-Jun-13 RMS Reset must set RDY (Ian Hammond) @@ -527,6 +528,7 @@ switch (st) { case MTSE_UNATT: /* unattached */ ta_cs |= TACS_ERR|TACS_CRC; case MTSE_OK: /* no error */ + default: /* unknown error*/ return SCPE_IERR; /* never get here! */ case MTSE_TMK: /* end of file */ diff --git a/PDP11/pdp11_tm.c b/PDP11/pdp11_tm.c index 6e6dee2d..d2da3916 100644 --- a/PDP11/pdp11_tm.c +++ b/PDP11/pdp11_tm.c @@ -1,6 +1,6 @@ /* pdp11_tm.c: PDP-11 magnetic tape simulator - Copyright (c) 1993-2020, Robert M Supnik + Copyright (c) 1993-2022, Robert M Supnik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -25,6 +25,7 @@ tm TM11/TU10 magtape + 26-Mar-22 RMS Added extra case points for new MTSE definitions 23-Mar-20 RMS Unload should call sim_tape_detach (Mark Pizzolato) 23-Oct-13 RMS Revised for new boot setup routine 16-Feb-06 RMS Added tape capacity checking @@ -537,6 +538,7 @@ switch (st) { case MTSE_UNATT: /* not attached */ tm_sta = tm_sta | STA_ILL; case MTSE_OK: /* no error */ + default: /* unknown error */ return SCPE_IERR; case MTSE_TMK: /* tape mark */ diff --git a/PDP11/pdp11_tq.c b/PDP11/pdp11_tq.c index 251ad27b..09dfdca9 100644 --- a/PDP11/pdp11_tq.c +++ b/PDP11/pdp11_tq.c @@ -1,6 +1,6 @@ /* pdp11_tq.c: TMSCP tape controller simulator - Copyright (c) 2002-2018, Robert M Supnik + Copyright (c) 2002-2022, Robert M Supnik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -25,6 +25,8 @@ tq TQK50 tape controller + 26-Mar-22 RMS Added extra case points for new MTSE definitions + 31-Jan-21 RMS Revised for new register macros 28-May-18 RMS Changed to avoid nested comment warnings (Mark Pizzolato) 23-Oct-13 RMS Revised for new boot setup routine 17-Mar-13 RMS Fixed bug in ABORT link walk loop (Dave Bryan) @@ -459,7 +461,7 @@ REG tq_reg[] = { { DRDATA (QTIME, tq_qtime, 24), PV_LEFT + REG_NZ }, { DRDATA (XTIME, tq_xtime, 24), PV_LEFT + REG_NZ }, { DRDATA (RWTIME, tq_rwtime, 32), PV_LEFT + REG_NZ }, - { BRDATA (PKTS, tq_pkt, DEV_RDX, 16, TQ_NPKTS * (TQ_PKT_SIZE_W + 1)) }, + { XRDATA (PKTS, tq_pkt, DEV_RDX, 16, 0, TQ_NPKTS * (TQ_PKT_SIZE_W + 1), sizeof (int16), sizeof (int16)) }, { DRDATA (DEVTYPE, tq_typ, 2), REG_HRO }, { DRDATA (DEVCAP, drv_tab[TQU_TYPE].cap, T_ADDR_W), PV_LEFT | REG_HRO }, { GRDATA (DEVADDR, tq_dib.ba, DEV_RDX, 32, 0), REG_HRO }, @@ -1447,6 +1449,10 @@ switch (st) { case MTSE_WRP: uptr->flags = uptr->flags | UNIT_SXC; return ST_WPR; + + default: + uptr->flags = uptr->flags | UNIT_SXC; + return SCPE_IERR; } return ST_SUC; diff --git a/PDP11/pdp11_ts.c b/PDP11/pdp11_ts.c index abd7157f..4f034232 100644 --- a/PDP11/pdp11_ts.c +++ b/PDP11/pdp11_ts.c @@ -1,6 +1,6 @@ /* pdp11_ts.c: TS11/TSV05 magnetic tape simulator - Copyright (c) 1993-2014, Robert M Supnik + Copyright (c) 1993-2022, Robert M Supnik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -25,6 +25,7 @@ ts TS11/TSV05 magtape + 26-Mar-22 RMS Added extra case points for new MTSE definitions 27-Oct-14 RMS Fixed bug in read forward with byte swap 23-Oct-13 RMS Revised for new boot setup routine 19-Mar-12 RMS Fixed declaration of cpu_opt (Mark Pizzolato) @@ -460,6 +461,7 @@ switch (st) { msgxs0 = msgxs0 | XS0_MOT; /* tape has moved */ case MTSE_INVRL: /* invalid rec lnt */ case MTSE_IOERR: /* IO error */ + default: /* unknown error */ msgxs1 = msgxs1 | XS1_UCOR; /* uncorrectable */ return (XTC (XS0_RLS, TC6)); /* pos lost */ diff --git a/PDP18B/pdp18b_mt.c b/PDP18B/pdp18b_mt.c index 847a73d1..522b99c3 100644 --- a/PDP18B/pdp18b_mt.c +++ b/PDP18B/pdp18b_mt.c @@ -1,6 +1,6 @@ /* pdp18b_mt.c: 18b PDP magnetic tape simulator - Copyright (c) 1993-2016, Robert M Supnik + Copyright (c) 1993-2022, Robert M Supnik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -26,6 +26,7 @@ mt (PDP-9) TC59 magtape (PDP-15) TC59D magtape + 26-Mar-22 RMS Added extra case points for new MTSE definitions 10-Mar-16 RMS Added 3-cycle databreak set/show entries 07-Mar-16 RMS Revised for dynamically allocated memory 13-Sep-15 RMS Added APIVEC register @@ -437,6 +438,7 @@ switch (st) { case MTSE_FMT: /* illegal fmt */ case MTSE_UNATT: /* not attached */ + default: /* unknown error */ mt_sta = mt_sta | STA_ILL | STA_ERR; case MTSE_OK: /* no error */ return SCPE_IERR; diff --git a/PDP8/pdp8_mt.c b/PDP8/pdp8_mt.c index 6d1d2f7a..62dc8a89 100644 --- a/PDP8/pdp8_mt.c +++ b/PDP8/pdp8_mt.c @@ -1,6 +1,6 @@ /* pdp8_mt.c: PDP-8 magnetic tape simulator - Copyright (c) 1993-2020, Robert M Supnik + Copyright (c) 1993-2022, Robert M Supnik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -25,6 +25,7 @@ mt TM8E/TU10 magtape + 26-Mar-22 RMS Added extra case points for new MTSE definitions 23-Mar-20 RMS Unload should call sim_tape_detach (Mark Pizzolato) 16-Feb-06 RMS Added tape capacity checking 16-Aug-05 RMS Fixed C++ declaration and cast problems @@ -555,6 +556,7 @@ switch (st) { case MTSE_FMT: /* illegal fmt */ case MTSE_UNATT: /* unattached */ + default: /* unknown error */ mt_sta = mt_sta | STA_ILL | STA_ERR; case MTSE_OK: /* no error */ return SCPE_IERR; /* never get here! */ diff --git a/sigma/sigma_mt.c b/sigma/sigma_mt.c index dc626ef7..1f1d9f85 100644 --- a/sigma/sigma_mt.c +++ b/sigma/sigma_mt.c @@ -1,6 +1,6 @@ /* sigma_mt.c: Sigma 732X 9-track magnetic tape - Copyright (c) 2007-2020, Robert M. Supnik + Copyright (c) 2007-2022, Robert M. Supnik Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), @@ -25,6 +25,7 @@ mt 7320 and 7322/7323 magnetic tape + 26-Mar-22 RMS Added extra case points for new MTSE definitions 23-Mar-20 RMS Unload should call sim_tape_detach (Mark Pizzolato) 13-Mar-17 RMS Annotated fall through in switch @@ -478,6 +479,7 @@ switch (st) { case MTSE_FMT: /* illegal fmt */ case MTSE_UNATT: /* not attached */ case MTSE_WRP: /* write protect */ + default: /* unknown error*/ chan_set_chf (mt_dib.dva, CHF_XMME); /* set err, fall through */ case MTSE_OK: /* no error */ chan_uen (mt_dib.dva); /* uend */