From 65ce21963b8f75458e10187152e449c0939590be Mon Sep 17 00:00:00 2001 From: LoRd_MuldeR Date: Sun, 18 Oct 2020 19:48:17 +0200 Subject: [PATCH] Fixed a few warnings. --- frontend/MCrypt.vcxproj | 14 ++++++++++---- frontend/src/main.c | 7 +++++-- libMCrypt/libMCrypt.vcxproj | 14 ++++++++++---- libMCrypt/src/mcrypt.c | 5 ++++- 4 files changed, 29 insertions(+), 11 deletions(-) diff --git a/frontend/MCrypt.vcxproj b/frontend/MCrypt.vcxproj index fb331c6..551a46d 100644 --- a/frontend/MCrypt.vcxproj +++ b/frontend/MCrypt.vcxproj @@ -116,11 +116,12 @@ - Level3 + Level4 true WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true $(SolutionDir)libMCrypt\include + 4706;4204 Console @@ -129,7 +130,7 @@ - Level3 + Level4 true true WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) @@ -144,6 +145,8 @@ false Fast NoExtensions + 4706;4204 + false Console @@ -155,11 +158,12 @@ - Level3 + Level4 true _DEBUG;_CONSOLE;%(PreprocessorDefinitions) true $(SolutionDir)libMCrypt\include + 4706;4204 Console @@ -168,7 +172,7 @@ - Level3 + Level4 true true NDEBUG;_CONSOLE;%(PreprocessorDefinitions) @@ -182,6 +186,8 @@ MultiThreaded false Fast + 4706;4204 + false Console diff --git a/frontend/src/main.c b/frontend/src/main.c index 992a95d..a4c5e3b 100644 --- a/frontend/src/main.c +++ b/frontend/src/main.c @@ -491,8 +491,11 @@ static int self_test(void) static void sigint_handler(const int sig) { - g_interrupted = 1; - signal(SIGINT, sigint_handler); + if (sig == SIGINT) + { + g_interrupted = 1; + signal(SIGINT, sigint_handler); + } } int MAIN(int argc, CHR* argv[]) diff --git a/libMCrypt/libMCrypt.vcxproj b/libMCrypt/libMCrypt.vcxproj index a7ab06a..b58f34e 100644 --- a/libMCrypt/libMCrypt.vcxproj +++ b/libMCrypt/libMCrypt.vcxproj @@ -103,12 +103,13 @@ - Level3 + Level4 true WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) true NotUsing $(ProjectDir)include + 4706;4204 @@ -118,7 +119,7 @@ - Level3 + Level4 true true WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) @@ -134,6 +135,8 @@ false Fast NoExtensions + 4706;4204 + false @@ -145,12 +148,13 @@ - Level3 + Level4 true _DEBUG;_LIB;%(PreprocessorDefinitions) true NotUsing $(ProjectDir)include + 4706;4204 @@ -160,7 +164,7 @@ - Level3 + Level4 true true NDEBUG;_LIB;%(PreprocessorDefinitions) @@ -175,6 +179,8 @@ MultiThreaded false Fast + 4706;4204 + false diff --git a/libMCrypt/src/mcrypt.c b/libMCrypt/src/mcrypt.c index 37d78f2..1566e8b 100644 --- a/libMCrypt/src/mcrypt.c +++ b/libMCrypt/src/mcrypt.c @@ -12,11 +12,14 @@ #ifdef _MSC_VER #define FORCE_INLINE __forceinline +#define UNUSED __pragma(warning(suppress: 4189)) #else #ifdef __GNUC__ #define FORCE_INLINE __attribute__((always_inline)) inline +#define UNUSED __attribute__((unused)) #else #define FORCE_INLINE inline +#define UNUSED #endif #endif @@ -124,7 +127,7 @@ static void random_seed(rand_state_t* const state, const uint64_t salt, const ui mcrypt_bzero(&key, sizeof(key_data_t)); for (size_t i = 0U; i < 97U; ++i) { - volatile uint32_t u = random_next(state); + volatile UNUSED uint32_t u = random_next(state); } }