Patchwork [07/11] configure: Fix compile warning in PNG test

login
register
mail settings
Submitter Peter Maydell
Date July 18, 2012, 2:10 p.m.
Message ID <1342620628-12751-8-git-send-email-peter.maydell@linaro.org>
Download mbox | patch
Permalink /patch/171700/
State New
Headers show

Comments

Peter Maydell - July 18, 2012, 2:10 p.m.
Fix compile warning (variable 'png_ptr' set but not used) in the
PNG detection test code.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 configure |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Stefan Weil - July 18, 2012, 3:46 p.m.
Am 18.07.2012 16:10, schrieb Peter Maydell:
> Fix compile warning (variable 'png_ptr' set but not used) in the
> PNG detection test code.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>   configure |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/configure b/configure
> index aced52e..784325a 100755
> --- a/configure
> +++ b/configure
> @@ -1727,7 +1727,7 @@ cat > $TMPC <<EOF
>   int main(void) {
>       png_structp png_ptr;
>       png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
> -    return 0;
> +    return png_ptr != 0;
>   }
>   EOF
>     if $pkg_config libpng --modversion >/dev/null 2>&1; then

Reviewed-by: Stefan Weil <sw@weilnetz.de>

Patch

diff --git a/configure b/configure
index aced52e..784325a 100755
--- a/configure
+++ b/configure
@@ -1727,7 +1727,7 @@  cat > $TMPC <<EOF
 int main(void) {
     png_structp png_ptr;
     png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
-    return 0;
+    return png_ptr != 0;
 }
 EOF
   if $pkg_config libpng --modversion >/dev/null 2>&1; then