Re: [dev] Looking for simple, alpha supporting image format

From: Markus Teich <markus.teich_AT_stusta.mhn.de>
Date: Wed, 16 Jul 2014 12:00:42 +0200

Heyho,

Charlie Murphy wrote:
> The X axis runs fastest.

You did not introduce the directions of x and y axis previously.

> len = *w * *h * 4;

For readability I would leave the brackets.

        len = (*w) * (*h) * 4;

> data = malloc(len);
> if (!data)
> return NULL;
>
> if (read(fd, data, len) != len) {
> free(data);
> return NULL;
> }

You can combine these, since free(NULL) does nothing.

        if (!(data = malloc(len)) || read(fd, data, len) != len) {
                free(data);
                return NULL;
        }

--Markus
Received on Wed Jul 16 2014 - 12:00:42 CEST

This archive was generated by hypermail 2.3.0 : Wed Jul 16 2014 - 12:00:10 CEST