From: Nick Mathewson Date: Mon, 25 Apr 2016 19:28:58 +0000 (-0400) Subject: Remove redundant declarations of MIN X-Git-Tag: tor-0.2.9.1-alpha~282 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bff53aabce531d7786a7ce2d4dee818770d8d0cd;p=thirdparty%2Ftor.git Remove redundant declarations of MIN Apparently somewhere along the line we decided that MIN might be missing. But we already defined it (if it was missing) in compat.h, which everybody includes. Closes ticket 18889. --- diff --git a/changes/bug18889 b/changes/bug18889 new file mode 100644 index 0000000000..45b09921d6 --- /dev/null +++ b/changes/bug18889 @@ -0,0 +1,2 @@ + o Code simplification and refactoring: + - Remove redundant declarations of the MIN macro. Closes ticket 18889. diff --git a/src/common/crypto.c b/src/common/crypto.c index 763488724c..65a575ebea 100644 --- a/src/common/crypto.c +++ b/src/common/crypto.c @@ -2384,8 +2384,6 @@ tor_check_dh_key(int severity, BIGNUM *bn) return -1; } -#undef MIN -#define MIN(a,b) ((a)<(b)?(a):(b)) /** Given a DH key exchange object, and our peer's value of g^y (as a * pubkey_len-byte value in pubkey) generate * secret_bytes_out bytes of shared key material and write them diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index a5a933e6b0..e6fe3f0c37 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -47,10 +47,6 @@ #include "routerset.h" #include "crypto.h" -#ifndef MIN -#define MIN(a,b) ((a)<(b)?(a):(b)) -#endif - static channel_t * channel_connect_for_circuit(const tor_addr_t *addr, uint16_t port, const char *id_digest); diff --git a/src/test/test-memwipe.c b/src/test/test-memwipe.c index 5d4fcec664..5e89534db6 100644 --- a/src/test/test-memwipe.c +++ b/src/test/test-memwipe.c @@ -6,9 +6,6 @@ #include "crypto.h" #include "compat.h" -#undef MIN -#define MIN(a,b) ( ((a)<(b)) ? (a) : (b) ) - static unsigned fill_a_buffer_memset(void) __attribute__((noinline)); static unsigned fill_a_buffer_memwipe(void) __attribute__((noinline)); static unsigned fill_a_buffer_nothing(void) __attribute__((noinline));