Re: [AD] fceil

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


Eric Botcazou <ebotcazou@xxxxxxxxxx> wrote:
> > They return values from `get_config_text', which returns "AL_CONST
> > char *".
> >
> > Hmm, is this related to the bug report on SourceForge?
> 
> Looks like all the warnings (except the one in glyph.c you just fixed) are
> related to this problem.

They look like MSVC problems to me.

> However, the last 'tools/plugins/datgrid.c(203) : warning C4700:
> local variable 'dat' used without having been initialized'

Vincent, does this look about right?  (untested)

Index: datgrid.c
===================================================================
RCS file: /cvsroot/alleg/allegro/tools/plugins/datgrid.c,v
retrieving revision 1.5
diff -u -r1.5 datgrid.c
--- datgrid.c	2000/09/26 08:57:54	1.5
+++ datgrid.c	2001/02/19 23:38:03
@@ -174,7 +174,7 @@
    void *v;
    char buf[256];
    RGB tmprgb = datedit_current_palette[0];
-   int tx, ty;
+   int tx = 0, ty = 0;
 
    if ((type == DAT_RLE_SPRITE) || (type == DAT_C_SPRITE) || (type == DAT_XC_SPRITE)) {
       datedit_current_palette[0].r = 63;
@@ -195,18 +195,9 @@
       return NULL;
    }
 
-   if (autocrop) {
+   if (autocrop)
       bmp = crop_bitmap(bmp, &tx, &ty);
 
-      if (tx || ty) {
-         sprintf(buf, "%d", tx);
-         datedit_set_property(dat, DAT_XCRP, buf);
-
-         sprintf(buf, "%d", ty);
-         datedit_set_property(dat, DAT_YCRP, buf);
-      }
-   }
-
    if (type == DAT_RLE_SPRITE) {
       v = get_rle_sprite(bmp);
       destroy_bitmap(bmp);
@@ -229,6 +220,14 @@
 
    sprintf(buf, "%d", h);
    datedit_set_property(dat, DAT_YSIZ, buf);
+
+   if (tx || ty) {
+      sprintf(buf, "%d", tx);
+      datedit_set_property(dat, DAT_XCRP, buf);
+
+      sprintf(buf, "%d", ty);
+      datedit_set_property(dat, DAT_YCRP, buf);
+   }
 
    datedit_set_property(dat, DAT_ORIG, grabber_graphic_origin);
    datedit_set_property(dat, DAT_DATE, grabber_graphic_date);

> seems to be serious.

I wonder how it worked before.



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