Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 92170 Details for
Bug 140987
hexcalc produces the wrong answer, which is bad for a calculator :)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Fixes the above issue.
hexcalc-order.diff (text/plain), 981 bytes, created by
Joe Jezak (RETIRED)
on 2006-07-18 18:06:17 UTC
(
hide
)
Description:
Fixes the above issue.
Filename:
MIME Type:
Creator:
Joe Jezak (RETIRED)
Created:
2006-07-18 18:06:17 UTC
Size:
981 bytes
patch
obsolete
>--- hexcalc.c 1989-11-22 16:29:06.000000000 -0500 >+++ /home/jjezak/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 '<' :
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 140987
: 92170