libCom/calc: fix bit31 bit manipulations

This commit is contained in:
Ralph Lange
2016-02-18 15:19:01 +01:00
parent 4241b4e6cb
commit 599e6635fb
+9 -9
View File
@@ -284,33 +284,33 @@ epicsShareFunc long
break;
case BIT_OR:
itop = (epicsInt32) *ptop--;
*ptop = (epicsInt32) *ptop | itop;
itop = (epicsUInt32) *ptop--;
*ptop = (epicsInt32) ((epicsUInt32)*ptop | itop);
break;
case BIT_AND:
itop = (epicsInt32) *ptop--;
*ptop = (epicsInt32) *ptop & itop;
itop = (epicsUInt32) *ptop--;
*ptop = (epicsInt32) ((epicsUInt32) *ptop & itop);
break;
case BIT_EXCL_OR:
itop = (epicsInt32) *ptop--;
*ptop = (epicsInt32) *ptop ^ itop;
itop = (epicsUInt32) *ptop--;
*ptop = (epicsInt32) ((epicsUInt32) *ptop ^ itop);
break;
case BIT_NOT:
itop = (epicsInt32) *ptop;
itop = (epicsUInt32) *ptop;
*ptop = ~itop;
break;
case RIGHT_SHIFT:
itop = (epicsInt32) *ptop--;
*ptop = (epicsInt32) *ptop >> itop;
*ptop = (epicsInt32) (epicsUInt32) *ptop >> itop;
break;
case LEFT_SHIFT:
itop = (epicsInt32) *ptop--;
*ptop = (epicsInt32) *ptop << itop;
*ptop = (epicsInt32) ((epicsUInt32) *ptop << itop);
break;
case NOT_EQ: