Repository: randombit/botan
Pull request #4054 (2024-05-11 20:39:49)

Fix some XCode warnings


Patch:
diff --git a/src/lib/math/mp/mp_monty.h b/src/lib/math/mp/mp_monty.h
index 7462272d5..8b8c54b0d 100644
--- a/src/lib/math/mp/mp_monty.h
+++ b/src/lib/math/mp/mp_monty.h
@@ -18,12 +18,12 @@ namespace Botan {
 * ws_size >= z_size
 */
 
-void bigint_monty_redc_4(word z[], const word p[], word p_dash, word ws[]);
-void bigint_monty_redc_6(word z[], const word p[], word p_dash, word ws[]);
-void bigint_monty_redc_8(word z[], const word p[], word p_dash, word ws[]);
-void bigint_monty_redc_16(word z[], const word p[], word p_dash, word ws[]);
-void bigint_monty_redc_24(word z[], const word p[], word p_dash, word ws[]);
-void bigint_monty_redc_32(word z[], const word p[], word p_dash, word ws[]);
+void bigint_monty_redc_4(word z[], const word p[4], word p_dash, word ws[]);
+void bigint_monty_redc_6(word z[], const word p[6], word p_dash, word ws[]);
+void bigint_monty_redc_8(word z[], const word p[8], word p_dash, word ws[]);
+void bigint_monty_redc_16(word z[], const word p[16], word p_dash, word ws[]);
+void bigint_monty_redc_24(word z[], const word p[24], word p_dash, word ws[]);
+void bigint_monty_redc_32(word z[], const word p[32], word p_dash, word ws[]);
 
 
 }


Test patch:
diff --git a/src/tests/test_bigint.cpp b/src/tests/test_bigint.cpp
index fe80dd6ef..e8298fdfa 100644
--- a/src/tests/test_bigint.cpp
+++ b/src/tests/test_bigint.cpp
@@ -94,13 +94,13 @@ class BigInt_Unit_Tests final : public Test
 
          result.test_throws("Invalid bit size",
                             "random_prime: Can't make a prime of 0 bits",
-                            [this]() { Botan::random_prime(Test::rng(), 0); });
+                            []() { Botan::random_prime(Test::rng(), 0); });
          result.test_throws("Invalid bit size",
                             "random_prime: Can't make a prime of 1 bits",
-                            [this]() { Botan::random_prime(Test::rng(), 1); });
+                            []() { Botan::random_prime(Test::rng(), 1); });
          result.test_throws("Invalid arg",
                             "random_prime Invalid value for equiv/modulo",
-                            [this]() { Botan::random_prime(Test::rng(), 2, 1, 0, 2); });
+                            []() { Botan::random_prime(Test::rng(), 2, 1, 0, 2); });
 
          BigInt p = Botan::random_prime(Test::rng(), 2);
          result.confirm("Only two 2-bit primes", p == 2 || p == 3);
diff --git a/src/tests/test_dl_group.cpp b/src/tests/test_dl_group.cpp
index 5937d15cf..9445bf075 100644
--- a/src/tests/test_dl_group.cpp
+++ b/src/tests/test_dl_group.cpp
@@ -43,7 +43,7 @@ class DL_Group_Tests final : public Test
 #if !defined(BOTAN_HAS_SANITIZER_UNDEFINED)
          result.test_throws("Bad generator param",
                             "DL_Group unknown PrimeType",
-                            [this]() {
+                            []() {
                             auto invalid_type = static_cast<Botan::DL_Group::PrimeType>(9);
                             Botan::DL_Group dl(Test::rng(), invalid_type, 1024);
              });
diff --git a/src/tests/test_passhash.cpp b/src/tests/test_passhash.cpp
index f838652c2..849163322 100644
--- a/src/tests/test_passhash.cpp
+++ b/src/tests/test_passhash.cpp
@@ -69,7 +69,7 @@ class Bcrypt_Tests final : public Text_Based_Test
 
          result.test_throws("Invalid bcrypt version rejected",
                             "Unknown bcrypt version 'q'",
-                            [this]() { Botan::generate_bcrypt("pass", Test::rng(), 4, 'q'); });
+                            []() { Botan::generate_bcrypt("pass", Test::rng(), 4, 'q'); });
 
          result.set_ns_consumed(Test::timestamp() - start);
 
@@ -192,7 +192,7 @@ class Passhash9_Tests final : public Text_Based_Test
 
          result.test_throws("Throws if algorithm not supported",
                             "Passhash9: Algorithm id 255 is not defined",
-                            [this]() { Botan::generate_passhash9("pass", Test::rng(), 3, 255); });
+                            []() { Botan::generate_passhash9("pass", Test::rng(), 3, 255); });
 
          result.test_throws("Throws if iterations is too high",
                             "Requested passhash9 work factor 513 is too large",