]> git.sur5r.net Git - cc65/blobdiff - src/cc65/asmlabel.c
Fix 32/64-bit int/pointer casts
[cc65] / src / cc65 / asmlabel.c
index 6ae60b1f42af8dcbcaad4c0c2228afd6f427ed5b..09aee3b927c4a5ee50eb93f24c69879066f83c95 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************/
 /*                                                                           */
-/*                               asmlabel.c                                 */
+/*                                asmlabel.c                                 */
 /*                                                                           */
-/*                     Generate assembler code labels                       */
+/*                      Generate assembler code labels                       */
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
@@ -46,7 +46,7 @@
 
 
 /*****************************************************************************/
-/*                                  Code                                    */
+/*                                   Code                                    */
 /*****************************************************************************/
 
 
@@ -58,7 +58,7 @@ unsigned GetLocalLabel (void)
     static unsigned NextLabel = 0;
 
     /* Check for an overflow */
-    if (NextLabel > 0xFFFF) {
+    if (NextLabel >= 0xFFFF) {
         Internal ("Local label overflow");
     }
 
@@ -70,9 +70,9 @@ unsigned GetLocalLabel (void)
 
 const char* LocalLabelName (unsigned L)
 /* Make a label name from the given label number. The label name will be
- * created in static storage and overwritten when calling the function
- * again.
- */
+** created in static storage and overwritten when calling the function
+** again.
+*/
 {
     static char Buf[64];
     sprintf (Buf, "L%04X", L);
@@ -89,7 +89,7 @@ int IsLocalLabelName (const char* Name)
     if (Name[0] != 'L' || strlen (Name) != 5) {
         return 0;
     }
-    for (I = 1; I <= 5; ++I) {
+    for (I = 1; I <= 4; ++I) {
         if (!IsXDigit (Name[I])) {
             return 0;
         }
@@ -98,7 +98,3 @@ int IsLocalLabelName (const char* Name)
     /* Local label name */
     return 1;
 }
-
-
-
-