From dd41d82ef5e5799d89c09469128efc7fefabb8d6 Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Mon, 26 Jan 2015 19:30:23 +0100 Subject: [PATCH] picview/png, my_popen: fix -Wclobbered warnings Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/283a6c30ebae3322d30a83e02bf9d5c00a042d51 Author: Stefan Seyfried Date: 2015-01-26 (Mon, 26 Jan 2015) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/driver/pictureviewer/png.cpp | 3 ++- src/system/helpers.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/driver/pictureviewer/png.cpp b/src/driver/pictureviewer/png.cpp index 4fa84dbe1..55f30613d 100644 --- a/src/driver/pictureviewer/png.cpp +++ b/src/driver/pictureviewer/png.cpp @@ -32,7 +32,7 @@ int int_png_load(const char *name, unsigned char **buffer, int* xp, int* yp, int png_infop info_ptr; png_uint_32 width, height; unsigned int i; - int bit_depth, color_type, interlace_type, number_passes, pass, int_bpp = 3; + int bit_depth, color_type, interlace_type, number_passes, pass, int_bpp; png_byte * fbptr; FILE * fh; @@ -96,6 +96,7 @@ int int_png_load(const char *name, unsigned char **buffer, int* xp, int* yp, int png_set_strip_alpha(png_ptr); if (bit_depth < 8) png_set_packing(png_ptr); + int_bpp = 3; } if (bit_depth == 16) png_set_strip_16(png_ptr); diff --git a/src/system/helpers.cpp b/src/system/helpers.cpp index 456e3ebc8..56984f41e 100644 --- a/src/system/helpers.cpp +++ b/src/system/helpers.cpp @@ -4,7 +4,7 @@ License: GPL (C) 2012-2013 the neutrino-hd developers - (C) 2012,2013 Stefan Seyfried + (C) 2012-2015 Stefan Seyfried This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -112,7 +112,7 @@ int my_system(const char * cmd) int my_system(int argc, const char *arg, ...) { - int i = 0, ret = 0, childExit = 0; + int i = 0, ret, childExit = 0; #define ARGV_MAX 64 /* static right now but could be made dynamic if necessary */ int argv_max = ARGV_MAX; @@ -143,6 +143,7 @@ int my_system(int argc, const char *arg, ...) ret = -errno; break; case 0: /* child process */ + ret = 0; for(i = 3; i < maxfd; i++) close(i); if (setsid() == -1) @@ -155,6 +156,7 @@ int my_system(int argc, const char *arg, ...) } _exit(ret); // terminate c h i l d proces s only default: /* parent returns to calling process */ + ret = 0; waitpid(pid, &childExit, 0); if (WEXITSTATUS(childExit) != 0) ret = (signed char)WEXITSTATUS(childExit);