]> git.sur5r.net Git - cc65/blobdiff - src/cc65/segments.c
Allow any number of optional braces around all initializers as required by the standard
[cc65] / src / cc65 / segments.c
index 77b787ca84e1881fb0114ab97800157b108aa835..dd7817b8887149d68ead2401edad3c0b0c411653 100644 (file)
@@ -41,6 +41,7 @@
 #include "check.h"
 #include "coll.h"
 #include "scanner.h"
+#include "segnames.h"
 #include "xmalloc.h"
 
 /* cc65 */
@@ -85,10 +86,10 @@ static Collection SegmentStack = STATIC_COLLECTION_INITIALIZER;
 void InitSegNames (void)
 /* Initialize the segment names */
 {
-    SegmentNames [SEG_BSS]     = xstrdup ("BSS");
-    SegmentNames [SEG_CODE]    = xstrdup ("CODE");
-    SegmentNames [SEG_DATA]    = xstrdup ("DATA");
-    SegmentNames [SEG_RODATA]  = xstrdup ("RODATA");
+    SegmentNames [SEG_BSS]     = xstrdup (SEGNAME_BSS);
+    SegmentNames [SEG_CODE]    = xstrdup (SEGNAME_CODE);
+    SegmentNames [SEG_DATA]    = xstrdup (SEGNAME_DATA);
+    SegmentNames [SEG_RODATA]  = xstrdup (SEGNAME_RODATA);
 }
 
 
@@ -103,27 +104,6 @@ void NewSegName (segment_t Seg, const char* Name)
 
 
 
-int ValidSegName (const char* Name)
-/* Return true if the given segment name is valid, return false otherwise */
-{
-    /* Must start with '_' or a letter */
-    if ((*Name != '_' && !IsAlpha(*Name)) || strlen(Name) > 80) {
-               return 0;
-    }
-
-    /* Can have letters, digits or the underline */
-    while (*++Name) {
-               if (*Name != '_' && !IsAlNum(*Name)) {
-                   return 0;
-               }
-    }
-
-    /* Name is ok */
-    return 1;
-}
-
-
-
 static Segments* NewSegments (SymEntry* Func)
 /* Initialize a Segments structure (set all fields to NULL) */
 {