openbsd-ports/math/hexcalc/patches/patch-hexcalc_c
sthen 46cfd641c4 - fix with gcc4, from gentoo via wen heping
- mirror distfile
- drop maintainer
- sync wantlib, plist

maintainer timeout
2011-06-16 11:45:53 +00:00

56 lines
1.1 KiB
Plaintext

$OpenBSD: patch-hexcalc_c,v 1.1 2011/06/16 11:45:53 sthen Exp $
Fix with GCC4. From http://bugs.gentoo.org/show_bug.cgi?id=140987
--- hexcalc.c.orig Sun May 15 11:30:39 2011
+++ hexcalc.c Sun May 15 11:34:23 2011
@@ -37,6 +37,7 @@ static char *sccsid = "@(#)hexcalc.c 1.11 11/21/89";
#endif
#include <stdio.h>
+#include <stdlib.h>
#include <ctype.h>
#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>
@@ -509,14 +510,16 @@ caddr_t data;
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 +531,18 @@ caddr_t data;
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 '<' :