[Ffmpeg-devel] [PATCH] drawtext.c: 01 fix compiler warnings
Rich Felker
dalias
Sat Sep 23 22:19:53 CEST 2006
On Sat, Sep 23, 2006 at 08:09:55PM +0100, M?ns Rullg?rd wrote:
> "Gustavo Sverzut Barbieri" <barbieri at gmail.com> writes:
>
> > On 9/23/06, Rich Felker <dalias at aerifal.cx> wrote:
> >> On Sat, Sep 23, 2006 at 01:16:12PM -0300, Gustavo Sverzut Barbieri wrote:
> >> > On 9/12/06, Michael Niedermayer <michaelni at gmx.at> wrote:
> >> > >Hi
> >> > >
> >> > >On Sun, Sep 10, 2006 at 02:00:02PM -0300, Gustavo Sverzut Barbieri wrote:
> >> > >> This is the first patch of a series of incremental patches to drawtext.c.
> >> > >>
> >> > >> it fix the compiler warnings found in SVN, it's basically signess of
> >> > >> datatypes.
> >> > >[...]
> >> > >> - unsigned char *text = ci->text;
> >> > >> + char *text = ci->text;
> >> > >[...]
> >> > >> + unsigned char previous = text[i - 1];
> >> > >> FT_Get_Kerning( ci->face,
> >> > >> - ci->glyphs_index[ text[i-1] ],
> >> > >> + ci->glyphs_index[previous],
> >> > >
> >> > >this is ugly IMHO
> >> >
> >> > so, any other objection? I use "previous" to avoid a cast in order to
> >> > avoid compiler warnings.
> >>
> >> Shouldn't text be unsigned char * anyway?
> >> BTW this warning is stupid in most cases but in your case it's not, it
> >> actually indicated a bug..
> >
> > actually, ASCII is just char* (0<= value <128), so it doesn't matter.
Why should the contents just be ASCII??
> C99 uses unqualified char* when defining all the str* functions. It's
Yet the functions treat the values pointed to as unsigned char...
> gcc4 that gets a fit if it sees an unsigned char * being passed to a
> function taking a char* as argument.
This is an idiotic warning and should be disabled.
Rich
More information about the ffmpeg-devel
mailing list