patch-hexcalc_c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. $OpenBSD: patch-hexcalc_c,v 1.1 2011/06/16 11:45:53 sthen Exp $
  2. Fix with GCC4. From http://bugs.gentoo.org/show_bug.cgi?id=140987
  3. --- hexcalc.c.orig Sun May 15 11:30:39 2011
  4. +++ hexcalc.c Sun May 15 11:34:23 2011
  5. @@ -37,6 +37,7 @@ static char *sccsid = "@(#)hexcalc.c 1.11 11/21/89";
  6. #endif
  7. #include <stdio.h>
  8. +#include <stdlib.h>
  9. #include <ctype.h>
  10. #include <X11/IntrinsicP.h>
  11. #include <X11/StringDefs.h>
  12. @@ -509,14 +510,16 @@ caddr_t data;
  13. switch(topOp) {
  14. case '+' :
  15. - ac = PopArg() + PopArg();
  16. + temp = PopArg();
  17. + ac = PopArg() + temp;
  18. break;
  19. case '-' :
  20. temp = PopArg();
  21. ac = PopArg() - temp;
  22. break;
  23. case '*' :
  24. - ac = PopArg() * PopArg();
  25. + temp = PopArg();
  26. + ac = temp * PopArg();
  27. break;
  28. case '/' :
  29. temp = PopArg();
  30. @@ -528,15 +531,18 @@ caddr_t data;
  31. break;
  32. case '|' :
  33. - ac = PopArg() | PopArg();
  34. + temp = PopArg();
  35. + ac = temp | PopArg();
  36. break;
  37. case '&' :
  38. - ac = PopArg() & PopArg();
  39. + temp = PopArg();
  40. + ac = temp & PopArg();
  41. break;
  42. case '^' :
  43. - ac = PopArg() ^ PopArg();
  44. + temp = PopArg();
  45. + ac = temp ^ PopArg();
  46. break;
  47. case '<' :