aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2018-11-30 17:49:29 +0100
committerAndreas Schneider <asn@cryptomilk.org>2018-11-30 18:25:12 +0100
commitc0ae59e1022071539cd9ce2343cf486cf69b94f2 (patch)
tree6fa5ce02274c2e112c2b0f4accb105bfed45354c
parent109a203453e782bcaa8ac5662aac74397fa0cc1a (diff)
downloadlibssh-c0ae59e1022071539cd9ce2343cf486cf69b94f2.tar.gz
libssh-c0ae59e1022071539cd9ce2343cf486cf69b94f2.tar.xz
libssh-c0ae59e1022071539cd9ce2343cf486cf69b94f2.zip
bignum: Use UNUSED macros
-rw-r--r--ConfigureChecks.cmake32
-rw-r--r--src/bignum.c8
2 files changed, 21 insertions, 19 deletions
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index d4e9f105..7c24dfd9 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -343,25 +343,27 @@ int main(void) {
return 0;
}" HAVE_FALLTHROUGH_ATTRIBUTE)
-check_c_source_compiles("
-#define __unused __attribute__((unused))
+if (NOT WIN32)
+ check_c_source_compiles("
+ #define __unused __attribute__((unused))
-static int do_nothing(int i __unused)
-{
- return 0;
-}
+ static int do_nothing(int i __unused)
+ {
+ return 0;
+ }
-int main(void)
-{
- int i;
+ int main(void)
+ {
+ int i;
- i = do_nothing(5);
- if (i > 5) {
- return 1;
- }
+ i = do_nothing(5);
+ if (i > 5) {
+ return 1;
+ }
- return 0;
-}" HAVE_UNUSED_ATTRIBUTE)
+ return 0;
+ }" HAVE_UNUSED_ATTRIBUTE)
+endif()
check_c_source_compiles("
#include <string.h>
diff --git a/src/bignum.c b/src/bignum.c
index 3a0c6a03..6777f023 100644
--- a/src/bignum.c
+++ b/src/bignum.c
@@ -88,12 +88,12 @@ bignum ssh_make_string_bn(ssh_string string){
return bn;
}
-void ssh_make_string_bn_inplace(ssh_string string, bignum bnout) {
- size_t len = ssh_string_len(string);
+void ssh_make_string_bn_inplace(ssh_string string,
+ UNUSED_PARAM(bignum bnout))
+{
+ UNUSED_VAR(size_t len) = ssh_string_len(string);
#ifdef HAVE_LIBGCRYPT
/* XXX: FIXME as needed for LIBGCRYPT ECDSA codepaths. */
- (void) len;
- (void) bnout;
#elif defined HAVE_LIBCRYPTO
bignum_bin2bn(string->data, len, bnout);
#elif defined HAVE_LIBMBEDCRYPTO