]> www.wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
MSVC: Fix Elvis operator
authorVitaly Chikunov <vt@altlinux.org>
Fri, 3 Dec 2021 09:06:25 +0000 (12:06 +0300)
committerDmitry Belyavskiy <beldmit@users.noreply.github.com>
Sat, 11 Dec 2021 16:45:14 +0000 (19:45 +0300)
Error example:

  gost_md.c(54,45): error C2059: syntax error: ':'
  gost_md.c(67,5): error C2059: syntax error: 'if'
  gost_md.c(69,6): error C2143: syntax error: missing '{' before '->'
  gost_md.c(69,6): error C2059: syntax error: '->'
  gost_md.c(70,5): error C2059: syntax error: 'return'
  gost_md.c(71,1): error C2059: syntax error: '}'

Signed-off-by: Vitaly Chikunov <vt@altlinux.org>
gost_crypt.c
gost_md.c

index da78e396fd941acc40034f426e7cbd5f79ee3601..8f8e0d382ff05bd340f504b34e29f5a49830454b 100644 (file)
@@ -74,7 +74,7 @@ static int magma_cipher_ctl_acpkm_omac(EVP_CIPHER_CTX *ctx, int type, int arg, v
  * Note: that you cannot template 0 value.
  */
 #define TPL(st,field) ( \
-    ((st)->field) ?: TPL_VAL(st,field) \
+    ((st)->field) ? ((st)->field) : TPL_VAL(st,field) \
 )
 
 #define TPL_VAL(st,field) ( \
index 6d03d50e7ead7ea5deed24e37cb0e05796d03b5e..b8824eb48d5c99f6138c42eed2afc9b72ef41d9b 100644 (file)
--- a/gost_md.c
+++ b/gost_md.c
@@ -37,7 +37,7 @@ GOST_digest GostR3411_94_digest = {
  * Note: that you cannot template 0 value.
  */
 #define TPL(st,field) ( \
-    ((st)->field) ?: TPL_VAL(st,field) \
+    ((st)->field) ? ((st)->field) : TPL_VAL(st,field) \
 )
 
 #define TPL_VAL(st,field) ( \