[MPlayer-dev-eng] [PATCH] trivial signed/unsigned comparisons fix - spudec.c
Dominik 'Rathann' Mierzejewski
dominik at rangers.eu.org
Sat May 13 20:47:24 CEST 2006
On Sunday, 07 May 2006 at 19:14, Dominik 'Rathann' Mierzejewski wrote:
> On Friday, 05 May 2006 at 17:18, Rich Felker wrote:
> > On Fri, May 05, 2006 at 10:42:45AM +0200, Pierre Lombard wrote:
> > > Hi,
> > >
> > > The attached patch fix some 'always false' tests by somewhat more
> > > sensible, I guess.
> > >
> > > unsigned int a => a<0 is always false
> >
> > It would probably be better to fix the type of the vars instead of
> > casting all over the place..
>
> Agreed, I'll take a look.
Again, neither one of my GCCs generates any warnings here, but what
about the following patch instead?
R.
--
MPlayer developer and RPMs maintainer: http://rpm.greysector.net/mplayer/
There should be a science of discontent. People need hard times and
oppression to develop psychic muscles.
-- from "Collected Sayings of Muad'Dib" by the Princess Irulan
-------------- next part --------------
--- MPlayer-20060513/spudec.h.spu 2003-09-21 21:17:48.000000000 +0200
+++ MPlayer-20060513/spudec.h 2006-05-13 20:42:12.000000000 +0200
@@ -17,7 +17,7 @@
void spudec_set_font_factor(void * this, double factor); // sets the equivalent to ffactor
void spudec_set_hw_spu(void *this, vo_functions_t *hw_spu);
int spudec_changed(void *this);
-void spudec_calc_bbox(void *me, unsigned int dxs, unsigned int dys, unsigned int* bbox);
+void spudec_calc_bbox(void *me, unsigned int dxs, unsigned int dys, int* bbox);
void spudec_draw_scaled(void *me, unsigned int dxs, unsigned int dys, void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride));
void spudec_set_forced_subs_only(void * const this, const unsigned int flag);
#endif
--- MPlayer-20060513/spudec.c.spu 2005-06-29 01:22:40.000000000 +0200
+++ MPlayer-20060513/spudec.c 2006-05-13 20:46:00.000000000 +0200
@@ -80,7 +80,7 @@
unsigned char *image; /* Grayscale value */
unsigned char *aimage; /* Alpha value */
unsigned int scaled_frame_width, scaled_frame_height;
- unsigned int scaled_start_col, scaled_start_row;
+ int scaled_start_col, scaled_start_row;
unsigned int scaled_width, scaled_height, scaled_stride;
size_t scaled_image_size;
unsigned char *scaled_image;
@@ -631,7 +631,7 @@
}
/* calc the bbox for spudec subs */
-void spudec_calc_bbox(void *me, unsigned int dxs, unsigned int dys, unsigned int* bbox)
+void spudec_calc_bbox(void *me, unsigned int dxs, unsigned int dys, int* bbox)
{
spudec_handle_t *spu;
spu = (spudec_handle_t *)me;
More information about the MPlayer-dev-eng
mailing list