]> git.sur5r.net Git - cc65/blobdiff - src/cc65/anonname.c
Change the OptStackOps function so that it adjusts the instruction pointer
[cc65] / src / cc65 / anonname.c
index 1a52147e2e02d2f402d1c44e40f65c0190acff45..27b498d2a3e14c44dcd04df0fbe34afd62ff0951 100644 (file)
@@ -1,15 +1,15 @@
 /*****************************************************************************/
 /*                                                                           */
-/*                               anonname.c                                 */
+/*                               anonname.c                                 */
 /*                                                                           */
 /*               Create names for anonymous variables/types                 */
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 2000     Ullrich von Bassewitz                                        */
-/*              Wacholderweg 14                                              */
-/*              D-70597 Stuttgart                                            */
-/* EMail:       uz@musoftware.de                                             */
+/* (C) 2000-2009, Ullrich von Bassewitz                                      */
+/*                Roemerstrasse 52                                           */
+/*                D-70794 Filderstadt                                        */
+/* EMail:         uz@cc65.org                                                */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
 
 
 #include <stdio.h>
+#include <string.h>
 
+/* common */
+#include "xsprintf.h"
+
+/* cc65 */
 #include "anonname.h"
+#include "ident.h"
+
+
+
+/*****************************************************************************/
+/*                                  Data                                    */
+/*****************************************************************************/
+
+
+
+static const char AnonTag[] = "$anon";
 
 
 
 /*****************************************************************************/
-/*                                  Code                                    */
+/*                                  Code                                    */
 /*****************************************************************************/
 
 
@@ -51,9 +67,17 @@ char* AnonName (char* Buf, const char* Spec)
  */
 {
     static unsigned ACount = 0;
-    sprintf (Buf, "$anon-%s-%04X", Spec, ++ACount);
+    xsprintf (Buf, IDENTSIZE, "%s-%s-%04X", AnonTag, Spec, ++ACount);
     return Buf;
 }
 
 
 
+int IsAnonName (const char* Name)
+/* Check if the given symbol name is that of an anonymous symbol */
+{
+    return (strncmp (Name, AnonTag, sizeof (AnonTag) - 1) == 0);
+}
+
+
+