]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Remove redundant declarations of MIN
authorNick Mathewson <nickm@torproject.org>
Mon, 25 Apr 2016 19:28:58 +0000 (15:28 -0400)
committerNick Mathewson <nickm@torproject.org>
Mon, 25 Apr 2016 19:28:58 +0000 (15:28 -0400)
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.

changes/bug18889 [new file with mode: 0644]
src/common/crypto.c
src/or/circuitbuild.c
src/test/test-memwipe.c

diff --git a/changes/bug18889 b/changes/bug18889
new file mode 100644 (file)
index 0000000..45b0992
--- /dev/null
@@ -0,0 +1,2 @@
+  o Code simplification and refactoring:
+    - Remove redundant declarations of the MIN macro. Closes ticket 18889.
index 763488724c3916e3bbcfe66b9d32517cb9ce6c2d..65a575ebea3e4c773734c56af1f15c25e52905a1 100644 (file)
@@ -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
  * <b>pubkey_len</b>-byte value in <b>pubkey</b>) generate
  * <b>secret_bytes_out</b> bytes of shared key material and write them
index a5a933e6b07fe7bb11e05965351f171b23f03041..e6fe3f0c370da8e317f8cf4b327c5e510948711b 100644 (file)
 #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);
index 5d4fcec664ca223d77c6cc5b400011f12191a0d4..5e89534db6332ddecafdbaf6aab2082f10d78662 100644 (file)
@@ -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));