Re: [AD] Allegro 4.2.0 RC2

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


On Sun, 2005-08-28 at 13:41 +0200, Michal Molhanec wrote:
> Elias Pschernig wrote:
> > On Sun, 2005-08-28 at 12:55 +0200, Michal Molhanec wrote:
> > 
> >>Yet another useless patch from the category "we don't like warnings"  :-)
> >>
> >>plain text document attachment (exsprite.c.diff)
> >>--- exsprite.c.old	Mon Feb 14 06:56:20 2005
> >>+++ exsprite.c	Sun Aug 28 12:40:30 2005
> >>@@ -149,7 +149,7 @@
> >> 
> >>    /* create and clear a bitmap for sprite buffering, big
> >>     * enough to hold the diagonal(sqrt(2)) when rotating */
> >>-   sprite_buffer = create_bitmap(82 * sqrt(2) + 2, 82 * sqrt(2) + 2);
> >>+   sprite_buffer = create_bitmap(82 * (int)sqrt(2) + 2, 82 * (int)sqrt(2) + 2);
> >>    clear_bitmap(sprite_buffer);
> >> 
> >>    x = (sprite_buffer->w - 82) / 2;
> > 
> > 
> > What was the warning?
> 
> warning C4761: integral size mismatch in argument; conversion supplied
> 

I see. Your fix most certainly will break the program though:

82 * sqrt(2) + 2 = 117
82 * (int)sqrt(2) + 2 = 84

-- 
Elias Pschernig





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