<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 9, 2016 at 10:46 PM, Bernhard R. Fischer <span dir="ltr"><<a href="mailto:bf@abenteuerland.at" target="_blank">bf@abenteuerland.at</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
>>>>       if (unlikely (status)) {<br>
>>>> +        if ((int) status < 0) status = CAIRO_STATUS_READ_ERROR;<br>
>>>>         cairo_status_t *error = png_get_error_ptr (png);<br>
>>>>         if (*error == CAIRO_STATUS_SUCCESS)<br>
>>>>             *error = status;<br>
>>><br>
>>> This would probably need to look more like:<br>
>>><br>
>>>     status = png_closure->read_func (png_closure->closure, data, size);<br>
>>>     if (unlikely (status)) {<br>
>>>         cairo_status_t *error;<br>
>>>         if ((int) status < 0)<br>
>>>             status = CAIRO_STATUS_READ_ERROR;<br>
>>>         error = png_get_error_ptr (png);<br>
>><br>
>><br>
>> Why? It makes no difference.<br>
>><br>
><br>
> The variables have to be declared first before any statements (required by<br>
> older C compilers).<br>
<br>
</div></div>I just inserted the 1-line "if ( )..." statement. Everything else is as<br>
it is in the current (1.14.6) cairo-png.c.<br></blockquote><div><br></div><div>The problem is that you have to put the declaration of the "error" variable before the statement. Annoying but Cairo is following these rules so that it works with some rather old compilers.</div><div><br></div></div></div></div>