On Wed, 2012-07-25 at 10:53 +0100, Måns Rullgård wrote:
> "Ronald S. Bultje" <[email protected]> writes:
> > On Tue, Jul 24, 2012 at 7:45 PM, Loren Merritt <[email protected]> 
> > wrote:
> >> -    long x, y;
> >> -    uint32_t pixel;
> >> +    uint32_t tmp;
> >>
> >> -    for (y = 0; y < h; y++) {
> >> -        for (x = 0; x < w; x++) {
> >> -            pixel = lowpass(frame_ant[x]<<8, src[x]<<16, temporal);
> >> -            frame_ant[x] = ((pixel+0x1000007F)>>8);
> >> -            dst[x]= ((pixel+0x10007FFF)>>16);
> >> +    for (long y = 0; y < h; y++) {
> >> +        for (long x = 0; x < w; x++) {
> >
> > Unfortunately, this won't compile on MSVC, please do declare the
> > variables outside the loop.
> 
> Same goes for a number of other compilers.  It's unfortunate, but a
> small price to pay for portability.

What compilers are those actually? Since this syntax has been used
without problems they can't be very common ones.

Calling restrictions on basic language syntax "a small price" is
disingenuous IMO. And declaring variables outside the loop is worse
style unless you explicitly mean to indicate that the final value of the
variable after the loop will be used by the following code.

This kind of syntax issues could be automatically handled by a
conversion wrapper for the deficient compilers.


_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to