[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-dev] Re: [patch] Get rid of warnings in findwebcams.cpp

From: strk
Subject: Re: [Gnash-dev] Re: [patch] Get rid of warnings in findwebcams.cpp
Date: Wed, 24 Nov 2010 08:30:53 +0100

On Tue, Nov 23, 2010 at 02:58:37PM +0100, Petter Reinholdtsen wrote:
> [Benjamin Wolsey]
> > We shouldn't be using things like g_print. Either including log.h
> > and using log_debug, or C++ iostreams would fix this particular
> > line.
> I assume you are right, but leave such large rewrite to those that
> know the code more than I do.
> >> I believe this patch solve the issues, bu using size_t for
> >> non-negative values and casting the size_t argument to %d to (int).
> >
> >> -                g_print("    %d. Video Test Source (videotestsrc)\n", i);
> >> +                g_print("    %d. Video Test Source (videotestsrc)\n", 
> >> (int)i);
> For this case, it might be better to use %zd instead fo casting to
> (int), to tell printf() that the variable is a size_t type.

%z is not available on all libc implementations.
We've been there in the past and finally decided we wouldn't use
printf code anymore but boost format / iostreams.

Beside, ``i'' has really no reason for being a size_t as it is compared
to ``numdevs'' which is returned by findVidDevs() which is returning
a ``g_int''. Turning everything into an ``int'' might help...


  ()   Free GIS & Flash consultant/developer

reply via email to

[Prev in Thread] Current Thread [Next in Thread]