From 659129c861c1bd42b4e3714bb1da3a7c7dc4fb11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20K=C3=B6hne?= Date: Tue, 20 Apr 2021 14:31:23 +0200 Subject: [PATCH] Avoid MSVC warning C4804 Fixes warnings like blake2.h(140): warning C4804: '/': unsafe use of type 'bool' in operation blake2.h(141): warning C4804: '/': unsafe use of type 'bool' in operation --- neon/blake2.h | 4 ++-- power8/blake2.h | 4 ++-- ref/blake2.h | 4 ++-- sse/blake2.h | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/neon/blake2.h b/neon/blake2.h index ad62f26..ca39030 100644 --- a/neon/blake2.h +++ b/neon/blake2.h @@ -137,8 +137,8 @@ extern "C" { /* Padded structs result in a compile-time error */ enum { - BLAKE2_DUMMY_1 = 1/(sizeof(blake2s_param) == BLAKE2S_OUTBYTES), - BLAKE2_DUMMY_2 = 1/(sizeof(blake2b_param) == BLAKE2B_OUTBYTES) + BLAKE2_DUMMY_1 = 1/(int)(sizeof(blake2s_param) == BLAKE2S_OUTBYTES), + BLAKE2_DUMMY_2 = 1/(int)(sizeof(blake2b_param) == BLAKE2B_OUTBYTES) }; /* Streaming API */ diff --git a/power8/blake2.h b/power8/blake2.h index 53e37c4..2f93e9e 100644 --- a/power8/blake2.h +++ b/power8/blake2.h @@ -133,8 +133,8 @@ extern "C" { /* Padded structs result in a compile-time error */ enum { - BLAKE2_DUMMY_1 = 1/(sizeof(blake2s_param) == BLAKE2S_OUTBYTES), - BLAKE2_DUMMY_2 = 1/(sizeof(blake2b_param) == BLAKE2B_OUTBYTES) + BLAKE2_DUMMY_1 = 1/(int)(sizeof(blake2s_param) == BLAKE2S_OUTBYTES), + BLAKE2_DUMMY_2 = 1/(int)(sizeof(blake2b_param) == BLAKE2B_OUTBYTES) }; /* Streaming API */ diff --git a/ref/blake2.h b/ref/blake2.h index ad62f26..ca39030 100644 --- a/ref/blake2.h +++ b/ref/blake2.h @@ -137,8 +137,8 @@ extern "C" { /* Padded structs result in a compile-time error */ enum { - BLAKE2_DUMMY_1 = 1/(sizeof(blake2s_param) == BLAKE2S_OUTBYTES), - BLAKE2_DUMMY_2 = 1/(sizeof(blake2b_param) == BLAKE2B_OUTBYTES) + BLAKE2_DUMMY_1 = 1/(int)(sizeof(blake2s_param) == BLAKE2S_OUTBYTES), + BLAKE2_DUMMY_2 = 1/(int)(sizeof(blake2b_param) == BLAKE2B_OUTBYTES) }; /* Streaming API */ diff --git a/sse/blake2.h b/sse/blake2.h index ad62f26..ca39030 100644 --- a/sse/blake2.h +++ b/sse/blake2.h @@ -137,8 +137,8 @@ extern "C" { /* Padded structs result in a compile-time error */ enum { - BLAKE2_DUMMY_1 = 1/(sizeof(blake2s_param) == BLAKE2S_OUTBYTES), - BLAKE2_DUMMY_2 = 1/(sizeof(blake2b_param) == BLAKE2B_OUTBYTES) + BLAKE2_DUMMY_1 = 1/(int)(sizeof(blake2s_param) == BLAKE2S_OUTBYTES), + BLAKE2_DUMMY_2 = 1/(int)(sizeof(blake2b_param) == BLAKE2B_OUTBYTES) }; /* Streaming API */