From a488e1bfec6eac8747444bbf5d87376601ac8a93 Mon Sep 17 00:00:00 2001 From: Brian Cox Date: Thu, 21 Apr 2016 00:48:28 -0700 Subject: [PATCH] Another batch of warning fixes, including several for gcc -Wparentheses --- src/core/haval.cpp | 3 +++ src/core/msystem.cpp | 6 +++--- src/cryptlib/sha.cpp | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/core/haval.cpp b/src/core/haval.cpp index 77c84b7..5328350 100644 --- a/src/core/haval.cpp +++ b/src/core/haval.cpp @@ -76,6 +76,9 @@ * - byte-order is discovered at compile time. we use the information * in "../../include/byteorder.h" to get this information. */ + +#pragma GCC diagnostic ignored "-Wparentheses" + #include "stdcore.h" #include "config.h" #include diff --git a/src/core/msystem.cpp b/src/core/msystem.cpp index 3900a76..04cba64 100644 --- a/src/core/msystem.cpp +++ b/src/core/msystem.cpp @@ -619,7 +619,7 @@ char *cmd; #endif { const char *argv[5]; /* argument list */ - register char *p; /* temoporary pointers */ + register const char *p; /* temoporary pointers */ register const char* shptr; /* the program to be run */ register int i; /* index number of child */ @@ -672,7 +672,7 @@ char *mode; #endif { const char *argv[5]; /* argument list */ - register char *p; /* temoporary pointers */ + register const char *p; /* temoporary pointers */ register const char *shptr; /* the program to be run */ FILE *fpa[3]; /* process communication descriptors */ register int indx; /* index number of child */ @@ -759,7 +759,7 @@ FILE *fpa[]; #endif { const char *argv[5]; /* argument list */ - register char *p; /* temoporary pointers */ + register const char *p; /* temoporary pointers */ register const char *shptr; /* the program to be run */ register int indx; /* index number of child */ diff --git a/src/cryptlib/sha.cpp b/src/cryptlib/sha.cpp index 1772a2a..3660534 100644 --- a/src/cryptlib/sha.cpp +++ b/src/cryptlib/sha.cpp @@ -83,8 +83,8 @@ void SHA::Final(byte *hash) for this information */ #ifdef NEW_SHA - #define expand(W,i) ( W[ i & 15 ] = rotl( (W[i&15] ^ W[i-14&15] ^ \ - W[i-8&15] ^ W[i-3&15]), 1U) ) + #define expand(W,i) ( W[ i & 15 ] = rotl( (W[i&15] ^ W[(i-14)&15] ^ \ + W[(i-8)&15] ^ W[(i-3)&15]), 1U) ) #else #define expand(W,i) ( W[ i & 15 ] ^= W[ i - 14 & 15 ] ^ W[ i - 8 & 15 ] ^ W[ i - 3 & 15 ] ) #endif /* NEW_SHA */