]> git.sur5r.net Git - cc65/blobdiff - src/cc65/scanner.c
Fixed wrong code generation for
[cc65] / src / cc65 / scanner.c
index 6516a396c10bb46e792f4c9030fa97ea97e92533..cc073e37313157786eea0c0e761245ce868ee501 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                                                 */
 /*                                                                           */
@@ -199,6 +199,15 @@ static int SkipWhite (void)
 
 
 
+int TokIsFuncSpec (const Token* T)
+/* Return true if the token is a function specifier */
+{
+    return (T->Tok == TOK_INLINE) || (T->Tok == TOK_FASTCALL) ||
+           (T->Tok == TOK_NEAR)   || (T->Tok == TOK_FAR);
+}
+
+
+
 void SymName (char* S)
 /* Read a symbol from the input stream. The first character must have been
  * checked before calling this function. The buffer is expected to be at
@@ -433,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;
@@ -461,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 ();
@@ -497,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) {
@@ -626,6 +634,8 @@ static void NumericConst (void)
             if (CurC == '-') {
                 Sign = -1;
                 NextChar ();
+            } else if (CurC == '+') {
+                NextChar ();
             }
 
             /* Read exponent digits. Since we support only 32 bit floats