[vlc-devel] [PATCH] removed some signedness warnings

Laurent Aimar fenrir at via.ecp.fr
Sat Feb 27 21:39:28 CET 2010


Hi,

On Sat, Feb 27, 2010, Toralf Niebuhr wrote:
> > On Sat, Feb 27, 2010, Toralf Niebuhr wrote:
> >> removed some signedness warnings
> >> 
> >> one question:
> >> include/vlc_picture.h
> >> I'm not sure if the attribute i_pixel_pitch from struct plane_t should be size_t instead of unsigned int.
> > I am not sure it would be wise to apply your patch so near 1.1, as
> > moving from signed to unsigned may have unseen consequences.
> > 
> > About, i_pitch, I am unsure if it can be changed to unsigned, in some place
> > it could be possible that a negative pitch is used for bottom to top image (At
> > least it should be checked).
> You are probably right about i_pixel_pitch.
> All the other variables indicate some kind of size ( length for example ) so unsigned should be the right thing.
 I didn't(nor did) say it wasn't the right thing to do or that it didn't make sense,
but playing with unsigned variable has sides effects.

 For example, with unsigned:
 if( plane->i_lines - 10 < 1 )
 {
 }
does not do what you probably want anymore and I don't think it will generate
a warning...
 That's why I said, IMO it isn't wise to change it now.

Regards,

-- 
fenrir



More information about the vlc-devel mailing list