Diffstat (limited to 'noncore/tools/calc2/engine.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/tools/calc2/engine.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/noncore/tools/calc2/engine.cpp b/noncore/tools/calc2/engine.cpp index e843e29..74cd701 100644 --- a/noncore/tools/calc2/engine.cpp +++ b/noncore/tools/calc2/engine.cpp | |||
@@ -16,16 +16,23 @@ | |||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "engine.h" | 21 | #include "engine.h" |
22 | |||
23 | /* OPIE */ | ||
24 | #include <opie2/odebug.h> | ||
25 | |||
26 | /* QT */ | ||
22 | #include <qstring.h> | 27 | #include <qstring.h> |
23 | #include <math.h> | ||
24 | #include <qlcdnumber.h> | 28 | #include <qlcdnumber.h> |
25 | 29 | ||
30 | /* STD */ | ||
31 | #include <math.h> | ||
32 | |||
26 | Data Engine::evalStack (Data num, bool inbrace = FALSE) | 33 | Data Engine::evalStack (Data num, bool inbrace = FALSE) |
27 | { | 34 | { |
28 | if (state != sError) { | 35 | if (state != sError) { |
29 | Instruction *i; | 36 | Instruction *i; |
30 | 37 | ||
31 | // Pop the next op from the stack | 38 | // Pop the next op from the stack |
@@ -39,13 +46,13 @@ Data Engine::evalStack (Data num, bool inbrace = FALSE) | |||
39 | 46 | ||
40 | // Evaluate this instruction | 47 | // Evaluate this instruction |
41 | num = i->eval (num); | 48 | num = i->eval (num); |
42 | 49 | ||
43 | // Error-check ( change this to work for all types ) | 50 | // Error-check ( change this to work for all types ) |
44 | if (isnan (num.dbl) || isinf (num.dbl)) { | 51 | if (isnan (num.dbl) || isinf (num.dbl)) { |
45 | qDebug ("bad result from operation"); | 52 | odebug << "bad result from operation" << oendl; |
46 | state = sError; | 53 | state = sError; |
47 | clearData(&num); | 54 | clearData(&num); |
48 | return num; | 55 | return num; |
49 | } | 56 | } |
50 | } | 57 | } |
51 | } | 58 | } |
@@ -110,13 +117,13 @@ void Engine::pushValue (char v) | |||
110 | } else if (state == sStart) { | 117 | } else if (state == sStart) { |
111 | softReset(); | 118 | softReset(); |
112 | displayString.truncate(0); | 119 | displayString.truncate(0); |
113 | state = sAppend; | 120 | state = sAppend; |
114 | pushValue (v); | 121 | pushValue (v); |
115 | } else if (state == sError) { | 122 | } else if (state == sError) { |
116 | qDebug ("in error state"); | 123 | odebug << "in error state" << oendl; |
117 | return; | 124 | return; |
118 | } | 125 | } |
119 | } | 126 | } |
120 | 127 | ||
121 | void Engine::del () | 128 | void Engine::del () |
122 | { | 129 | { |