shared/image: Silence maybe-uninitialized warning
shared/image-loader.c: In function 'load_image':
shared/image-loader.c:434:12: warning: 'image' may be used uninitialized
in this function [-Wmaybe-uninitialized]
} else if (!image) {
^
Warning produced by GCC 5.3 and 6.1, with -Og.
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
This commit is contained in:
@@ -396,7 +396,7 @@ static const struct image_loader loaders[] = {
|
|||||||
pixman_image_t *
|
pixman_image_t *
|
||||||
load_image(const char *filename)
|
load_image(const char *filename)
|
||||||
{
|
{
|
||||||
pixman_image_t *image;
|
pixman_image_t *image = NULL;
|
||||||
unsigned char header[4];
|
unsigned char header[4];
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
@@ -431,7 +431,6 @@ load_image(const char *filename)
|
|||||||
fprintf(stderr, "%s: unrecognized file header "
|
fprintf(stderr, "%s: unrecognized file header "
|
||||||
"0x%02x 0x%02x 0x%02x 0x%02x\n",
|
"0x%02x 0x%02x 0x%02x 0x%02x\n",
|
||||||
filename, header[0], header[1], header[2], header[3]);
|
filename, header[0], header[1], header[2], header[3]);
|
||||||
image = NULL;
|
|
||||||
} else if (!image) {
|
} else if (!image) {
|
||||||
/* load probably printed something, but just in case */
|
/* load probably printed something, but just in case */
|
||||||
fprintf(stderr, "%s: error reading image\n", filename);
|
fprintf(stderr, "%s: error reading image\n", filename);
|
||||||
|
|||||||
Reference in New Issue
Block a user