]> git.sur5r.net Git - cc65/blobdiff - src/cc65/testexpr.c
Fixed two compiler warnings.
[cc65] / src / cc65 / testexpr.c
index 6fb573b93df700c4666ebe289851ffc98cfb6bab..5b2ae3d02dbddaec1e0b282c2e0d2396ea0bca1e 100644 (file)
 /*****************************************************************************/
 
 
-
+                     
+/* cc65 */
 #include "codegen.h"
 #include "error.h"
 #include "expr.h"
+#include "loadexpr.h"
 #include "scanner.h"
 #include "testexpr.h"
 
@@ -63,13 +65,13 @@ unsigned Test (unsigned Label, int Invert)
     if (ED_IsConstAbs (&Expr)) {
 
         /* Result is constant, so we know the outcome */
-        Result = (Expr.Val != 0);
+        Result = (Expr.IVal != 0);
 
        /* Constant rvalue */
-               if (!Invert && Expr.Val == 0) {
+               if (!Invert && Expr.IVal == 0) {
            g_jump (Label);
            Warning ("Unreachable code");
-       } else if (Invert && Expr.Val != 0) {
+       } else if (Invert && Expr.IVal != 0) {
            g_jump (Label);
        }
 
@@ -79,12 +81,12 @@ unsigned Test (unsigned Label, int Invert)
         Result = TESTEXPR_UNKNOWN;
 
         /* If the expr hasn't set condition codes, set the force-test flag */
-        if ((Expr.Test & E_CC) == 0) {
-            Expr.Test |= E_FORCETEST;
+        if (!ED_IsTested (&Expr)) {
+            ED_MarkForTest (&Expr);
         }
 
         /* Load the value into the primary register */
-        ExprLoad (CF_FORCECHAR, &Expr);
+        LoadExpr (CF_FORCECHAR, &Expr);
 
         /* Generate the jump */
         if (Invert) {