From 48a9b5b42bc3c6c06f442d7bd6776c022c0ac944 Mon Sep 17 00:00:00 2001 From: Bob Supnik Date: Mon, 13 Mar 2017 10:32:27 -0700 Subject: [PATCH] PDP10, PDP11, PDP18B, PDP8: Annotate switch case fall through (COVERITY) --- PDP10/pdp10_rp.c | 5 +++-- PDP11/pdp11_rp.c | 5 +++-- PDP11/pdp11_rs.c | 15 ++++++++------- PDP11/pdp11_tu.c | 5 +++-- PDP18B/pdp18b_lp.c | 7 ++++--- PDP8/pdp8_pt.c | 5 +++-- 6 files changed, 24 insertions(+), 18 deletions(-) diff --git a/PDP10/pdp10_rp.c b/PDP10/pdp10_rp.c index 8788d0ad..070640c1 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-2012, 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 17-Mar-13 RMS Fixed incorrect copy/paste from pdp11_rp.c 08-Dec-12 RMS UNLOAD does not set ATTN (Mark Pizzolato) 12-Nov-05 RMS Fixed DCLR not to clear drive address @@ -937,7 +938,7 @@ switch (uptr->FUNC) { /* case on function */ set_rper (ER1_WLE, drv); /* set drive error */ 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 d037270d..32006530 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 08-Dec-12 RMS UNLOAD shouldn't set ATTN (Mark Pizzolato) 17-May-07 RMS CS1 DVA resides in device, not MBA @@ -827,7 +828,7 @@ switch (fnc) { /* case on function */ mba_set_exc (rp_dib.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 798a040c..7cde80b7 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 */ @@ -60,7 +61,7 @@ #define UNIT_V_DTYPE (UNIT_V_UF + 0) /* disk type */ #define RS03_DTYPE (0) -#define RS04_DTYPE (1) +#define RS04_DTYPE (1) #define UNIT_V_AUTO (UNIT_V_UF + 1) /* autosize */ #define UNIT_V_WLK (UNIT_V_UF + 2) /* write lock */ #define UNIT_DTYPE (1 << UNIT_V_DTYPE) @@ -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 @@ -347,7 +348,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 */ @@ -355,7 +356,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 */ @@ -475,11 +476,11 @@ switch (fnc) { /* case on function */ mba_set_exc (rs_dib.ba); /* set exception */ 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 0b1e7fe6..16deaefe 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 @@ -488,7 +489,7 @@ switch (fnc) { /* case on function */ tutc = tutc & ~TC_FCS; /* clear fc status */ tufs = tufs & ~(FS_SAT | FS_SSC | FS_ID | FS_ERR); sim_cancel (uptr); /* reset drive */ - uptr->USTAT = 0; + 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 0a68097a..8931008e 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 @@ -358,13 +359,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 0d84c526..c3cfd189 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,7 @@ 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 */