Re: [AD] Allegro 4.1.8 WIP, dat2c

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


This patch will make dat2c generate code that
works for any compiler supporting any of the 
standards C89 or C99.
Tested on gcc 2.95
/Christer
Index: allegro/tools/dat2c.c
===================================================================
RCS file: /cvsroot/alleg/allegro/tools/dat2c.c,v
retrieving revision 1.8
diff -u -b -r1.8 dat2c.c
--- allegro/tools/dat2c.c	20 Dec 2002 08:31:46 -0000	1.8
+++ allegro/tools/dat2c.c	7 Jan 2003 19:00:54 -0000
@@ -1188,11 +1188,12 @@
         for(glyph = iter->begin; glyph < iter->end; glyph++) {
             FONT_GLYPH* fg = iter->glyphs[glyph - iter->begin];
             
-            cwrite(dat2c, C, "static FONT_GLYPH $string lower$_glyph"
+            cwrite(dat2c, C, "static struct { short w,h; char data[$int$];} $string lower$_glyph"
                              "$int$ = {$n$"
                              "    $int$, $int$, /* width, height */$n$"
                              "    $data$$n$"
                              "};$n$$n$",
+                fg->h * ((fg->w + 7) / 8),
                 name, glyph,
                 fg->w, fg->h,
                 fg->h * ((fg->w + 7) / 8), 4, fg->dat);
@@ -1204,7 +1205,7 @@
             name, data_count);
         
         for(glyph = iter->begin; glyph < iter->end; glyph++) {
-            cwrite(dat2c, C, "    &$string lower$_glyph$int$,$n$",
+            cwrite(dat2c, C, "    (FONT_GLYPH*)&$string lower$_glyph$int$,$n$",
                 name, glyph);
         }
         






Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/