orcc: Implement handling of 64 bit constants
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Sun, 5 Sep 2010 12:50:35 +0000 (14:50 +0200)
committerDavid Schleef <ds@schleef.org>
Mon, 6 Sep 2010 07:06:50 +0000 (00:06 -0700)
This uses %lx for printing 64 bit integers but on
32 bit architectures something like %llx would be
needed.

tools/orcc.c

index 40e1db1..d32fe3d 100644 (file)
@@ -834,9 +834,12 @@ output_program_generation (OrcProgram *p, FILE *output, int is_inline)
   }
   for(i=0;i<8;i++){
     var = &p->vars[ORC_VAR_C1 + i];
-    if (var->size) {
+    if (var->size <= 4) {
       fprintf(output, "      orc_program_add_constant (p, %d, 0x%08x, \"%s\");\n",
           var->size, (int)var->value.i, varnames[ORC_VAR_C1 + i]);
+    } else if (var->size > 4) {
+      fprintf(output, "      orc_program_add_constant_int64 (p, %d, 0x%016lx, \"%s\");\n",
+          var->size, var->value.i, varnames[ORC_VAR_C1 + i]);
     }
   }
   for(i=0;i<8;i++){