]> git.sur5r.net Git - cc65/blobdiff - src/cc65/scanner.c
Make much more usage of dynamic strings (StrBufs) instead of char* and
[cc65] / src / cc65 / scanner.c
index e8e13ee6a20e6e55d738779d68a4e58867b28d1c..573b09c1e929816f03bcc6e9c8a8a58ba68cb7e3 100644 (file)
@@ -6,8 +6,8 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998-2004 Ullrich von Bassewitz                                       */
-/*               Römerstrasse 52                                             */
+/* (C) 1998-2008 Ullrich von Bassewitz                                       */
+/*               Roemerstrasse 52                                            */
 /*               D-70794 Filderstadt                                         */
 /* EMail:        uz@cc65.org                                                 */
 /*                                                                           */
@@ -442,7 +442,7 @@ static void NumericConst (void)
 {
     unsigned Base;              /* Temporary number base */
     unsigned Prefix;            /* Base according to prefix */
-    StrBuf   S;
+    StrBuf   S = STATIC_STRBUF_INITIALIZER;
     int      IsFloat;
     char     C;
     unsigned DigitVal;
@@ -470,7 +470,6 @@ static void NumericConst (void)
      * before converting it, so we can determine if it's a float or an
      * integer.
      */
-    InitStrBuf (&S);
     while (IsXDigit (CurC) && HexVal (CurC) < Base) {
         SB_AppendChar (&S, CurC);
         NextChar ();
@@ -506,7 +505,7 @@ static void NumericConst (void)
     }
 
     /* We don't need the string buffer any longer */
-    DoneStrBuf (&S);
+    SB_Done (&S);
 
     /* Distinguish between integer and floating point constants */
     if (!IsFloat) {