On 10/15/2012 05:53 AM, Ronald S. Bultje wrote:
> On Sun, Oct 14, 2012 at 8:11 PM, Mans Rullgard <m...@mansr.com> wrote:
>> Some compilers (e.g. old gcc) have trouble with these.
>>
>> Signed-off-by: Mans Rullgard <m...@mansr.com>
>> ---
>>  libswscale/swscale_unscaled.c | 17 +++++++++--------
>>  1 file changed, 9 insertions(+), 8 deletions(-)
>>
>> diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c
>> index 70eff72..5efc647 100644
>> --- a/libswscale/swscale_unscaled.c
>> +++ b/libswscale/swscale_unscaled.c
>> @@ -396,6 +396,11 @@ static int planarRgbToRgbWrapper(SwsContext *c, const 
>> uint8_t *src[],
>>                                   uint8_t *dst[], int dstStride[])
>>  {
>>      int alpha_first = 0;
>> +    const uint8_t *src102[] = { src[1], src[0], src[2] };
>> +    const uint8_t *src201[] = { src[2], src[0], src[1] };
>> +    int stride102[] = { srcStride[1], srcStride[0], srcStride[2] };
>> +    int stride201[] = { srcStride[2], srcStride[0], srcStride[1] };
>> +
>>      if (c->srcFormat != AV_PIX_FMT_GBRP) {
>>          av_log(c, AV_LOG_ERROR, "unsupported planar RGB conversion %s -> 
>> %s\n",
>>                 av_get_pix_fmt_name(c->srcFormat),
>> @@ -405,15 +410,13 @@ static int planarRgbToRgbWrapper(SwsContext *c, const 
>> uint8_t *src[],
>>
>>      switch (c->dstFormat) {
>>      case AV_PIX_FMT_BGR24:
>> -        gbr24ptopacked24((const uint8_t *[]) { src[1], src[0], src[2] },
>> -                         (int []) { srcStride[1], srcStride[0], 
>> srcStride[2] },
>> +        gbr24ptopacked24(src102, stride102,
>>                           dst[0] + srcSliceY * dstStride[0], dstStride[0],
>>                           srcSliceH, c->srcW);
>>          break;
> 
> I find it slightly hilarious that there is no way in hell this would
> have gotten in had the compiler's name been "gcc". Why don't you use
> c99-to-c89 for this so-called "compiler"?

As a matter of fact lots of patches went in to please a certain compiler
for microsoft.

As I said for the patches that didn't make the code less ugly even if is
something spotted by msvc, "why not?"

lu
_______________________________________________
libav-devel mailing list
libav-devel@libav.org
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to