From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:60268) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QmslX-0003G7-EZ for qemu-devel@nongnu.org; Fri, 29 Jul 2011 15:30:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QmslV-0000sb-To for qemu-devel@nongnu.org; Fri, 29 Jul 2011 15:30:35 -0400 Received: from v220110690675601.yourvserver.net ([78.47.199.172]:41286) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QmslV-0000sA-IG for qemu-devel@nongnu.org; Fri, 29 Jul 2011 15:30:33 -0400 From: Stefan Weil Date: Fri, 29 Jul 2011 21:30:24 +0200 Message-Id: <1311967824-5218-1-git-send-email-weil@mail.berlios.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH] Fix gcc-4.6 compiler error List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU Developers Cc: Anthony Liguori , Wayne Xia Commit 3d3b8303c6f83b9b245bc774af530a6403cc4ce6 breaks builds with gcc-4.6: hw/fw_cfg.c: In function =E2=80=98probe_splashfile=E2=80=99: hw/fw_cfg.c:66:9: error: variable =E2=80=98fop_ret=E2=80=99 set but not u= sed [-Werror=3Dunused-but-set-variable] hw/fw_cfg.c: In function =E2=80=98fw_cfg_bootsplash=E2=80=99: hw/fw_cfg.c:130:9: error: variable =E2=80=98fop_ret=E2=80=99 set but not = used [-Werror=3Dunused-but-set-variable] Remove fop_ret. Testing the result of fread() is normally a good idea, but I don't think it is needed here. Cc: Wayne Xia Cc: Anthony Liguori Signed-off-by: Stefan Weil --- hw/fw_cfg.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-) diff --git a/hw/fw_cfg.c b/hw/fw_cfg.c index a29db90..d906b83 100644 --- a/hw/fw_cfg.c +++ b/hw/fw_cfg.c @@ -63,7 +63,6 @@ struct FWCfgState { static FILE *probe_splashfile(char *filename, int *file_sizep, int *file= _typep) { FILE *fp =3D NULL; - int fop_ret; int file_size; int file_type =3D -1; unsigned char buf[2] =3D {0, 0}; @@ -86,7 +85,7 @@ static FILE *probe_splashfile(char *filename, int *file= _sizep, int *file_typep) } /* check magic ID */ fseek(fp, 0L, SEEK_SET); - fop_ret =3D fread(buf, 1, 2, fp); + (void)fread(buf, 1, 2, fp); filehead_value =3D (buf[0] + (buf[1] << 8)) & 0xffff; if (filehead_value =3D=3D 0xd8ff) { file_type =3D JPG_FILE; @@ -105,7 +104,7 @@ static FILE *probe_splashfile(char *filename, int *fi= le_sizep, int *file_typep) /* check BMP bpp */ if (file_type =3D=3D BMP_FILE) { fseek(fp, 28, SEEK_SET); - fop_ret =3D fread(buf, 1, 2, fp); + (void)fread(buf, 1, 2, fp); bmp_bpp =3D (buf[0] + (buf[1] << 8)) & 0xffff; if (bmp_bpp !=3D 24) { error_report("only 24bpp bmp file is supported."); @@ -127,7 +126,6 @@ static void fw_cfg_bootsplash(FWCfgState *s) char *p; char *filename; FILE *fp; - int fop_ret; int file_size; int file_type =3D -1; const char *temp; @@ -180,7 +178,7 @@ static void fw_cfg_bootsplash(FWCfgState *s) boot_splash_filedata =3D qemu_malloc(file_size); boot_splash_filedata_size =3D file_size; fseek(fp, 0L, SEEK_SET); - fop_ret =3D fread(boot_splash_filedata, 1, file_size, fp); + (void)fread(boot_splash_filedata, 1, file_size, fp); fclose(fp); /* insert data */ if (file_type =3D=3D JPG_FILE) { --=20 1.7.2.5