From 5f203fc082959448a37f0e90d2067989e77de9e2 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Thu, 26 Apr 2007 13:13:26 +0200 Subject: [PATCH] Avoid warnings. --- src/compress_zlib.cpp | 2 +- src/work.cpp | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/compress_zlib.cpp b/src/compress_zlib.cpp index ca5846a7..29b0d516 100644 --- a/src/compress_zlib.cpp +++ b/src/compress_zlib.cpp @@ -211,7 +211,7 @@ int upx_zlib_test_overlap ( const upx_bytep buf, unsigned src_off, // verify the final result in any case. unsigned dlen = *dst_len; - unsigned overlap_overhead = src_off + src_len - dlen; + //unsigned overlap_overhead = src_off + src_len - dlen; //printf("upx_zlib_test_overlap: %d\n", overlap_overhead); upx_bytep const dst = (upx_bytep)malloc(src_off + src_len); diff --git a/src/work.cpp b/src/work.cpp index eccc7781..d7281650 100644 --- a/src/work.cpp +++ b/src/work.cpp @@ -58,12 +58,13 @@ void do_one_file(const char *iname, char *oname) { + int r; struct stat st; memset(&st, 0, sizeof(st)); #if defined(HAVE_LSTAT) - int r = lstat(iname,&st); + r = lstat(iname,&st); #else - int r = stat(iname,&st); + r = stat(iname,&st); #endif if (r != 0) @@ -211,15 +212,18 @@ void do_one_file(const char *iname, char *oname) struct utimbuf u; u.actime = st.st_atime; u.modtime = st.st_mtime; - (void) ::utime(name,&u); + r = utime(name, &u); + UNUSED(r); #endif #if defined(HAVE_CHMOD) // copy permissions - (void) ::chmod(name, st.st_mode); + r = chmod(name, st.st_mode); + UNUSED(r); #endif #if defined(HAVE_CHOWN) // copy the ownership - (void) ::chown(name, st.st_uid, st.st_gid); + r = chown(name, st.st_uid, st.st_gid); + UNUSED(r); #endif }