]> git.sur5r.net Git - cc65/blobdiff - src/cc65/codegen.c
Move the version numbers from the interface of the version module into a new
[cc65] / src / cc65 / codegen.c
index 76077ab30655f1bd9367dfdddf6547fd7a063b0f..2feb273f4f338c26d663809947cf686dadb022aa 100644 (file)
@@ -6,10 +6,10 @@
 /*                                                                           */
 /*                                                                           */
 /*                                                                           */
-/* (C) 1998-2009 Ullrich von Bassewitz                                       */
-/*               Roemerstrasse 52                                            */
-/*               D-70794 Filderstadt                                         */
-/* EMail:        uz@cc65.org                                                 */
+/* (C) 1998-2009, Ullrich von Bassewitz                                      */
+/*                Roemerstrasse 52                                           */
+/*                D-70794 Filderstadt                                        */
+/* EMail:         uz@cc65.org                                                */
 /*                                                                           */
 /*                                                                           */
 /* This software is provided 'as-is', without any expressed or implied       */
@@ -151,13 +151,12 @@ void g_preamble (void)
 
     /* Identify the compiler version */
     AddTextLine (";");
-    AddTextLine ("; File generated by cc65 v %u.%u.%u",
-                VER_MAJOR, VER_MINOR, VER_PATCH);
+    AddTextLine ("; File generated by cc65 v %s", GetVersionAsString ());
     AddTextLine (";");
 
     /* Insert some object file options */
-    AddTextLine ("\t.fopt\t\tcompiler,\"cc65 v %u.%u.%u\"",
-                   VER_MAJOR, VER_MINOR, VER_PATCH);
+    AddTextLine ("\t.fopt\t\tcompiler,\"cc65 v %s\"",
+                GetVersionAsString ());
 
     /* If we're producing code for some other CPU, switch the command set */
     switch (CPU) {
@@ -929,7 +928,7 @@ void g_getind (unsigned Flags, unsigned Offs)
 void g_leasp (int Offs)
 /* Fetch the address of the specified symbol into the primary register */
 {
-    unsigned char Lo, Hi;              
+    unsigned char Lo, Hi;
 
     /* Calculate the offset relative to sp */
     Offs -= StackPtr;
@@ -4230,7 +4229,7 @@ void g_defbytes (const void* Bytes, unsigned Count)
         } while (Chunk);
 
         /* Output the line */
-        AddDataLine (Buf);
+        AddDataLine ("%s", Buf);
     }
 }
 
@@ -4407,7 +4406,7 @@ void g_switch (Collection* Nodes, unsigned DefaultLabel, unsigned Depth)
 void g_asmcode (struct StrBuf* B)
 /* Output one line of assembler code. */
 {
-    AddCodeLine ("%.*s", SB_GetLen (B), SB_GetConstBuf (B));
+    AddCodeLine ("%.*s", (int) SB_GetLen (B), SB_GetConstBuf (B));
 }