From 5ab16a216589d59a4dc85e76b0790ea4196f836a Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Sat, 16 Mar 2013 16:39:14 +0000 Subject: [PATCH] Tests: Suppress Visual Studio 2012 Code Analysis warnings --- libusb/version_nano.h | 2 +- tests/testlib.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libusb/version_nano.h b/libusb/version_nano.h index 04ee3a8..22e03e4 100644 --- a/libusb/version_nano.h +++ b/libusb/version_nano.h @@ -1 +1 @@ -#define LIBUSB_NANO 10630 +#define LIBUSB_NANO 10631 diff --git a/tests/testlib.c b/tests/testlib.c index 77395cb..e69aa39 100644 --- a/tests/testlib.c +++ b/tests/testlib.c @@ -48,6 +48,7 @@ #define NULL_PATH "/dev/null" #endif #define INVALID_FD -1 +#define IGNORE_RETVAL(expr) do { (void)(expr); } while(0) /** * Converts a test result code into a human readable string. @@ -81,11 +82,11 @@ static void cleanup_test_output(libusbx_testlib_ctx * ctx) #ifndef DISABLE_STDOUT_REDIRECTION if (!ctx->verbose) { if (ctx->old_stdout != INVALID_FD) { - dup2(ctx->old_stdout, STDOUT_FILENO); + IGNORE_RETVAL(dup2(ctx->old_stdout, STDOUT_FILENO)); ctx->old_stdout = INVALID_FD; } if (ctx->old_stderr != INVALID_FD) { - dup2(ctx->old_stderr, STDERR_FILENO); + IGNORE_RETVAL(dup2(ctx->old_stderr, STDERR_FILENO)); ctx->old_stderr = INVALID_FD; } if (ctx->null_fd != INVALID_FD) { -- 2.11.4.GIT