You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/sci-calculators/hexcalc/files/hexcalc-order.diff

52 lines
972 B

--- a/hexcalc.c 1989-11-22 16:29:06.000000000 -0500
+++ b/hexcalc.c 2006-07-18 17:36:40.000000000 -0400
@@ -37,6 +37,7 @@
#endif
#include <stdio.h>
+#include <stdlib.h>
#include <ctype.h>
#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>
@@ -509,14 +508,16 @@
switch(topOp) {
case '+' :
- ac = PopArg() + PopArg();
+ temp = PopArg();
+ ac = PopArg() + temp;
break;
case '-' :
temp = PopArg();
ac = PopArg() - temp;
break;
case '*' :
- ac = PopArg() * PopArg();
+ temp = PopArg();
+ ac = temp * PopArg();
break;
case '/' :
temp = PopArg();
@@ -528,15 +529,18 @@
break;
case '|' :
- ac = PopArg() | PopArg();
+ temp = PopArg();
+ ac = temp | PopArg();
break;
case '&' :
- ac = PopArg() & PopArg();
+ temp = PopArg();
+ ac = temp & PopArg();
break;
case '^' :
- ac = PopArg() ^ PopArg();
+ temp = PopArg();
+ ac = temp ^ PopArg();
break;
case '<' :