]> git.sur5r.net Git - cc65/commitdiff
Fixed a bug
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sat, 20 Jul 2002 08:20:59 +0000 (08:20 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Sat, 20 Jul 2002 08:20:59 +0000 (08:20 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@1367 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/cc65/codegen.c

index 136db691e5fc8e962e9b8be69a7062bc9be5c354..716d49bbaff407afbeb962174166593e3625a10c 100644 (file)
@@ -6,7 +6,7 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998-2001 Ullrich von Bassewitz                                       */
+/* (C) 1998-2002 Ullrich von Bassewitz                                       */
 /*               Wacholderweg 14                                             */
 /*               D-70597 Stuttgart                                           */
 /* EMail:        uz@cc65.org                                                 */
@@ -3493,7 +3493,7 @@ void g_le (unsigned flags, unsigned long val)
                        }
                    } else {
                        /* Signed compare */
-                       if (val < 0x7F) {
+                       if ((long) val < 0x7F) {
                            /* Use < instead of <= because the former gives
                             * better code on the 6502 than the latter.
                             */
@@ -3523,7 +3523,7 @@ void g_le (unsigned flags, unsigned long val)
                    }
                } else {
                    /* Signed compare */
-                   if (val < 0x7FFF) {
+                   if ((long) val < 0x7FFF) {
                        g_lt (flags, val+1);
                    } else {
                        /* Always true */
@@ -3548,7 +3548,7 @@ void g_le (unsigned flags, unsigned long val)
                    }
                } else {
                    /* Signed compare */
-                   if (val < 0x7FFFFFFF) {
+                   if ((long) val < 0x7FFFFFFF) {
                        g_lt (flags, val+1);
                    } else {
                        /* Always true */
@@ -3579,7 +3579,7 @@ void g_gt (unsigned flags, unsigned long val)
 /* Test for greater than */
 {
     static char* ops [12] = {
-       "tosgt00",      "tosgta0",      "tosgtax",
+       "tosgt00",      "tosgta0",      "tosgtax",
        "tosugt00",     "tosugta0",     "tosugtax",
        0,              0,              "tosgteax",
        0,              0,              "tosugteax",
@@ -3614,7 +3614,7 @@ void g_gt (unsigned flags, unsigned long val)
                            AddCodeLine ("jsr return0");
                        }
                    } else {
-                       if (val < 0x7F) {
+                       if ((long) val < 0x7F) {
                            /* Use >= instead of > because the former gives
                             * better code on the 6502 than the latter.
                             */
@@ -3650,7 +3650,7 @@ void g_gt (unsigned flags, unsigned long val)
                    }
                        } else {
                    /* Signed compare */
-                   if (val < 0x7FFF) {
+                   if ((long) val < 0x7FFF) {
                        g_ge (flags, val+1);
                    } else {
                        /* Never true */
@@ -3681,7 +3681,7 @@ void g_gt (unsigned flags, unsigned long val)
                    }
                        } else {
                    /* Signed compare */
-                   if (val < 0x7FFFFFFF) {
+                   if ((long) val < 0x7FFFFFFF) {
                        g_ge (flags, val+1);
                    } else {
                        /* Never true */