]> git.sur5r.net Git - cc65/blobdiff - src/da65/asminc.c
Normalized code.
[cc65] / src / da65 / asminc.c
index 4708a42e3c59329fd83bcd6a0db43eea7620a1a4..4f496c79fe0c8be726b873baa5bf64ce2f7ff98d 100644 (file)
@@ -6,8 +6,8 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2005      Ullrich von Bassewitz                                       */
-/*               Römerstrasse 52                                             */
+/* (C) 2005-2008 Ullrich von Bassewitz                                       */
+/*               Roemerstrasse 52                                            */
 /*               D-70794 Filderstadt                                         */
 /* EMail:        uz@cc65.org                                                 */
 /*                                                                           */
 
 /* da65 */
 #include "asminc.h"
-#include "attrtab.h"
+#include "comments.h"
 #include "error.h"
+#include "labels.h"
 
 
 
 /*****************************************************************************/
-/*                                          Code                                    */
+/*                                   Code                                    */
 /*****************************************************************************/
 
 
@@ -83,7 +84,7 @@ void AsmInc (const char* Filename, char CommentStart, int IgnoreUnknown)
     char*       L;
     const char* Comment;
     unsigned    Line;
-    unsigned   Len;
+    unsigned    Len;
     long        Val;
     unsigned    DVal;
     int         Sign;
@@ -110,12 +111,12 @@ void AsmInc (const char* Filename, char CommentStart, int IgnoreUnknown)
             ++L;
         }
 
-       /* Remove trailing whitespace */
-       Len = strlen (L);
-       while (Len > 0 && IsSpace (L[Len-1])) {
-           --Len;
-       }
-       L[Len] = '\0';
+        /* Remove trailing whitespace */
+        Len = strlen (L);
+        while (Len > 0 && IsSpace (L[Len-1])) {
+            --Len;
+        }
+        L[Len] = '\0';
 
         /* If the line is empty or starts with a comment char, ignore it */
         if (*L == '\0' || *L == CommentStart) {
@@ -146,11 +147,11 @@ void AsmInc (const char* Filename, char CommentStart, int IgnoreUnknown)
         } else if (*L == ':' && *++L == '=') {
             ++L;
         } else {
-           if (!IgnoreUnknown) {
-               Error ("%s(%u): Missing `='", Filename, Line);
-           }
-           continue;
-       }
+            if (!IgnoreUnknown) {
+                Error ("%s(%u): Missing `='", Filename, Line);
+            }
+            continue;
+        }
 
         /* Allow white space once again */
         L = SkipWhitespace (L);
@@ -220,17 +221,15 @@ void AsmInc (const char* Filename, char CommentStart, int IgnoreUnknown)
         /* Apply the sign */
         Val *= Sign;
 
-        /* Define the symbol */
-        AddExtLabel (Val, SB_GetConstBuf (&Ident), Comment);
+        /* Define the symbol and the comment */
+        AddExtLabel (Val, SB_GetConstBuf (&Ident));
+        SetComment (Val, Comment);
 
     }
 
     /* Delete the string buffer contents */
-    DoneStrBuf (&Ident);
+    SB_Done (&Ident);
 
     /* Close the include file ignoring errors (we were just reading). */
     (void) fclose (F);
 }
-
-
-