From 2bf538f59ceede1d2a8b5113e57e624a81104e92 Mon Sep 17 00:00:00 2001 From: Sergey Svishchev Date: Thu, 9 Mar 2017 18:33:40 -0800 Subject: [PATCH] PDP11, All VAX: fix CID: 1415573, 1415452 "Operands don't affect result" Character length of 5 is stored as 0. --- PDP11/pdp11_dz.c | 2 +- PDP11/pdp11_vh.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/PDP11/pdp11_dz.c b/PDP11/pdp11_dz.c index 49dea673..9f050f86 100644 --- a/PDP11/pdp11_dz.c +++ b/PDP11/pdp11_dz.c @@ -166,7 +166,7 @@ const char *dz_stopbits[] = {"1", "2", "1", "1.5"}; #define LPR_GETSPD(x) dz_baudrates[((x) & LPR_M_SPEED) >> LPR_V_SPEED] #define LPR_GETCHARSIZE(x) dz_charsizes[((x) & LPR_M_CHARSIZE) >> LPR_V_CHARSIZE] #define LPR_GETPARITY(x) dz_parity[(((x) >> LPR_V_PARENB) & 1) | (((x) >> (LPR_V_PARODD-1)) & 2)] -#define LPR_GETSTOPBITS(x) dz_stopbits[(((x) >> LPR_V_STOPBITS) & 1) + (((((x) & LPR_M_CHARSIZE) >> LPR_V_CHARSIZE) == 5) ? 2 : 0)] +#define LPR_GETSTOPBITS(x) dz_stopbits[(((x) >> LPR_V_STOPBITS) & 1) + (((((x) & LPR_M_CHARSIZE) >> LPR_V_CHARSIZE) == 0) ? 2 : 0)] #define LPR_LPAR 0007770 /* line pars - NI */ #define LPR_RCVE 0010000 /* receive enb */ #define LPR_GETLN(x) (((x) >> LPR_V_LINE) & DZ_LNOMASK) diff --git a/PDP11/pdp11_vh.c b/PDP11/pdp11_vh.c index 05a4221b..fa414310 100644 --- a/PDP11/pdp11_vh.c +++ b/PDP11/pdp11_vh.c @@ -253,7 +253,7 @@ BITFIELD vh_lpr_bits[] = { #define LPR_GETSPD(x) vh_baudrates[((x) >> LPR_V_RX_SPEED) & LPR_M_RX_SPEED] #define LPR_GETCHARSIZE(x) vh_charsizes[((x) >> LPR_V_CHAR_LGTH) & LPR_M_CHAR_LGTH] #define LPR_GETPARITY(x) vh_parity[(((x) >> LPR_V_PARITY_ENAB) & 1) | (((x) >> (LPR_V_EVEN_PARITY-1)) & 2)] -#define LPR_GETSTOPBITS(x) vh_stopbits[(((x) >> LPR_V_STOP_CODE) & 1) + (((((x) >> LPR_V_CHAR_LGTH) & LPR_M_CHAR_LGTH) == 5) ? 2 : 0)] +#define LPR_GETSTOPBITS(x) vh_stopbits[(((x) >> LPR_V_STOP_CODE) & 1) + (((((x) >> LPR_V_CHAR_LGTH) & LPR_M_CHAR_LGTH) == 0) ? 2 : 0)] /* Line-Status Register (STAT) */