From d1768d2771455f4c27246da725915e98f21f0179 Mon Sep 17 00:00:00 2001 From: Bob Supnik Date: Mon, 13 Mar 2017 10:59:06 -0700 Subject: [PATCH] PDP10, PDP11, PDP18B, PDP8: Annotate switch case fall through (COVERITY) --- PDP10/pdp10_rp.c | 10 ++++++---- PDP11/pdp11_rp.c | 6 ++++-- PDP11/pdp11_rs.c | 12 +++++++----- PDP11/pdp11_tu.c | 4 +++- PDP18B/pdp18b_lp.c | 7 ++++--- PDP8/pdp8_pt.c | 6 ++++-- 6 files changed, 28 insertions(+), 17 deletions(-) diff --git a/PDP10/pdp10_rp.c b/PDP10/pdp10_rp.c index be73cce7..30db9c3e 100644 --- a/PDP10/pdp10_rp.c +++ b/PDP10/pdp10_rp.c @@ -1,6 +1,6 @@ /* pdp10_rp.c - RH11/RP04/05/06/07 RM02/03/05/80 "Massbus" disk controller - Copyright (c) 1993-2008, Robert M Supnik + Copyright (c) 1993-2017, 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 @@ rp RH/RP/RM moving head disks + 13-Mar-17 RMS Annotated fall through in switch 12-Nov-05 RMS Fixed DCLR not to clear drive address 07-Jul-05 RMS Removed extraneous externs 18-Mar-05 RMS Added attached test to detach routine @@ -45,7 +46,7 @@ 28-Sep-01 RMS Fixed interrupt handling for SC/ATA 23-Aug-01 RMS Added read/write header stubs for ITS (found by Mirian Crzig Lennox) - 13-Jul-01 RMS Changed fread call to fxread (found by Peter Schorn) + 13-Jul-01 RMS Changed fread call to fxread (Peter Schorn) 14-May-01 RMS Added check for unattached drive The "Massbus style" disks consisted of several different large @@ -77,7 +78,7 @@ #define RP_MAXFR 32768 /* max transfer */ #define SPINUP_DLY (1000*1000) /* Spinup delay, usec */ #define GET_SECTOR(x,d) ((int) fmod (sim_gtime() / ((double) (x)), \ - ((double) drv_tab[d].sect))) + ((double) drv_tab[d].sect))) #define MBA_RP_CTRL 0 /* RP drive */ #define MBA_RM_CTRL 1 /* RM drive */ @@ -242,7 +243,7 @@ #define GET_DA(c,fs,d) ((((GET_CY (c) * drv_tab[d].surf) + \ GET_SF (fs)) * drv_tab[d].sect) + GET_SC (fs)) -/* RPCC - 176736 - current cylinder */ +/* RPCC - 176736 - current cylinder */ /* RPER2 - 176740 - error status 2 - drive unsafe conditions */ /* RPER3 - 176742 - error status 3 - more unsafe conditions */ /* RPEC1 - 176744 - ECC status 1 - unimplemented */ @@ -933,6 +934,7 @@ switch (uptr->FUNC) { /* case on function */ update_rpcs (CS1_DONE | CS1_TRE, drv); /* set done, err */ break; } + /* fall through */ case FNC_WCHK: /* write check */ case FNC_READ: /* read */ case FNC_READH: /* read headers */ diff --git a/PDP11/pdp11_rp.c b/PDP11/pdp11_rp.c index 12db2136..d1efc84b 100644 --- a/PDP11/pdp11_rp.c +++ b/PDP11/pdp11_rp.c @@ -1,6 +1,6 @@ /* pdp11_rp.c - RP04/05/06/07 RM02/03/05/80 Massbus disk controller - Copyright (c) 1993-2013, Robert M Supnik + Copyright (c) 1993-2017, 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 @@ rp RH/RP/RM moving head disks + 13-Mar-17 RMS Annotated intentional fall through in switch 23-Oct-13 RMS Revised for new boot setup routine 06-Mar-11 MP Converted to using sim_disk library and refactored for Asynch I/O. @@ -1171,7 +1172,8 @@ if (!uptr->io_complete) { /* Top End (I/O Initiation) Processing */ mba_set_exc (dibp->ba); /* set exception */ rp_update_ds (DS_ATA, drv); /* set attn */ return SCPE_OK; - } + } + /* fall through */ case FNC_WCHK: /* write check */ case FNC_READ: /* read */ case FNC_READH: /* read headers */ diff --git a/PDP11/pdp11_rs.c b/PDP11/pdp11_rs.c index 6dbc3b71..41affd3d 100644 --- a/PDP11/pdp11_rs.c +++ b/PDP11/pdp11_rs.c @@ -1,6 +1,6 @@ /* pdp11_rs.c - RS03/RS04 Massbus disk controller - Copyright (c) 2013, Robert M Supnik + Copyright (c) 2013-2017, 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 @@ rs RS03/RS04 fixed head disks + 13-Mar-17 RMS Annotated intentional fall through in switch 23-Oct-13 RMS Revised for new boot setup routine */ @@ -145,7 +146,7 @@ #define RS_LA_OF 7 -/* This controller supports many two disk drive types: +/* This controller supports two disk drive types: type #words/ #sectors/ #tracks/ sector track drive @@ -353,7 +354,7 @@ switch (ofs) { /* decode PA<5:1> */ break; case RS_DA_OF: /* RSDA */ - rsda[drv] = (uint16)data; + rsda[drv] = (uint16) data; break; case RS_AS_OF: /* RSAS */ @@ -361,7 +362,7 @@ switch (ofs) { /* decode PA<5:1> */ break; case RS_MR_OF: /* RSMR */ - rsmr[drv] = (uint16)data; + rsmr[drv] = (uint16) data; break; case RS_ER_OF: /* RSER */ @@ -482,10 +483,11 @@ switch (fnc) { /* case on function */ rs_update_ds (DS_ATA, drv); /* set attn */ return SCPE_OK; } + /* fall through */ case FNC_WCHK: /* write check */ case FNC_READ: /* read */ if (rsda[drv] & DA_INV) { /* bad addr? */ - rs_set_er (ER_IAE, drv); /* set error */ + rs_set_er (ER_IAE, drv); /* set error */ mba_set_exc (rs_dib.ba); /* set exception */ rs_update_ds (DS_ATA, drv); /* set attn */ break; diff --git a/PDP11/pdp11_tu.c b/PDP11/pdp11_tu.c index 01291d50..001f67e1 100644 --- a/PDP11/pdp11_tu.c +++ b/PDP11/pdp11_tu.c @@ -1,6 +1,6 @@ /* pdp11_tu.c - PDP-11 TM02/TU16 TM03/TU45/TU77 Massbus magnetic tape controller - Copyright (c) 1993-2013, Robert M Supnik + Copyright (c) 1993-2017, 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 TM02/TM03 magtape + 13-Mar-17 RMS Annotated fall through in switch 23-Oct-13 RMS Revised for new boot setup routine 18-Apr-11 MP Fixed t_addr printouts for 64b big-endian systems 17-May-07 RMS CS1 DVA resides in device, not MBA @@ -501,6 +502,7 @@ switch (fnc) { /* case on function */ tufs = tufs & ~(FS_SAT | FS_SSC | FS_ID | FS_ERR); sim_cancel (uptr); /* reset drive */ uptr->USTAT = 0; + /* fall through */ case FNC_NOP: tucs1 = tucs1 & ~CS1_GO; /* no operation */ return SCPE_OK; diff --git a/PDP18B/pdp18b_lp.c b/PDP18B/pdp18b_lp.c index 28f39496..345c9382 100644 --- a/PDP18B/pdp18b_lp.c +++ b/PDP18B/pdp18b_lp.c @@ -1,6 +1,6 @@ /* pdp18b_lp.c: 18b PDP's line printer simulator - Copyright (c) 1993-2016, Robert M Supnik + Copyright (c) 1993-2017, 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"), @@ -28,6 +28,7 @@ lp09 (PDP-9,15) LP09 line printer lp15 (PDP-15) LP15 line printer + 13-Mar-17 RMS Annotated fall throughs in switch 10-Mar-16 RMS Added 3-cycle databreak set/show entry 07-Mar-16 RMS Revised for dynamically allocated memory 13-Sep-15 RMS Added APIVEC register @@ -356,13 +357,13 @@ if (pulse & 004) { /* LPDI */ lp647_buf[lp647_bp] = lp647_buf[lp647_bp] | ((dat >> 12) & 077); lp647_bp = lp647_bp + 1; } - + /* fall through */ case 020: /* LPB2 */ if (lp647_bp < LP647_BSIZE) { lp647_buf[lp647_bp] = lp647_buf[lp647_bp] | ((dat >> 6) & 077); lp647_bp = lp647_bp + 1; } - + /* fall through */ case 060: /* LPB1 */ if (lp647_bp < LP647_BSIZE) { lp647_buf[lp647_bp] = lp647_buf[lp647_bp] | (dat & 077); diff --git a/PDP8/pdp8_pt.c b/PDP8/pdp8_pt.c index b0d2496b..70bb9605 100644 --- a/PDP8/pdp8_pt.c +++ b/PDP8/pdp8_pt.c @@ -1,6 +1,6 @@ /* pdp8_pt.c: PDP-8 paper tape reader/punch simulator - Copyright (c) 1993-2013, Robert M Supnik + Copyright (c) 1993-2017, 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 @@ ptr,ptp PC8E paper tape reader/punch + 13-Mar-17 RMS Annotated fall through in switch 17-Mar-13 RMS Modified to use central set_bootpc routine 25-Apr-03 RMS Revised for extended file support 04-Oct-02 RMS Added DIBs @@ -136,7 +137,8 @@ switch (IR & 07) { /* decode IR<9:11> */ return (dev_done & INT_PTR)? IOT_SKP + AC: AC; case 6: /* RFC!RRB */ - sim_activate (&ptr_unit, ptr_unit.wait); + sim_activate (&ptr_unit, ptr_unit.wait); /* activate */ + /* fall through */ case 2: /* RRB */ dev_done = dev_done & ~INT_PTR; /* clear flag */ int_req = int_req & ~INT_PTR; /* clear int req */