From 4a52be76fee3a0721684fd5e1c6e8ed025193d07 Mon Sep 17 00:00:00 2001 From: "Markus F.X.J. Oberhumer" Date: Wed, 17 Jan 2001 15:52:58 +0000 Subject: [PATCH] Removed nop() macro. committer: mfx 979746778 +0000 --- src/conf.h | 7 ------- src/work.cpp | 9 +++++---- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/conf.h b/src/conf.h index 55a45001..20919e48 100644 --- a/src/conf.h +++ b/src/conf.h @@ -299,10 +299,6 @@ typedef RETSIGTYPE (SIGTYPEENTRY *sig_type)(int); #define outp upx_outp -// a dummy statement -#define nop ((void)0) - - #define COMPILE_TIME_ASSERT(expr) \ { typedef int __upx_compile_time_assert_fail[(expr) ? 1 : -1]; } @@ -332,9 +328,6 @@ typedef RETSIGTYPE (SIGTYPEENTRY *sig_type)(int); // memory util **************************************************************************/ -#undef FREE -#define FREE(ptr) if (ptr) { free(ptr); ptr = NULL; } - #undef UNUSED #if 1 # define UNUSED(var) { typedef int __upx_unused[sizeof(var) ? 2 : 1]; } diff --git a/src/work.cpp b/src/work.cpp index 0ee6ca5d..56c7b75b 100644 --- a/src/work.cpp +++ b/src/work.cpp @@ -77,13 +77,14 @@ void do_one_file(const char *iname, char *oname) throwIOException("empty file -- skipped"); if ((st.st_mode & S_IWUSR) == 0) { + bool skip = true; if (opt->output_name) - nop; + skip = false; else if (opt->to_stdout) - nop; + skip = false; else if (opt->backup) - nop; - else + skip = false; + if (skip) throwIOException("file is write protected -- skipped"); }