summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-02-01 15:47:46 -0500
committerNick Mathewson <nickm@torproject.org>2013-02-01 15:49:51 -0500
commitb034d07acdec08ed536f66d491397b0f31ac5e1d (patch)
tree6afa28838281b537474b712dcf2f6d16a24b3b60
parenta141430ec3f344d4f021f614942ff5b769b8c900 (diff)
downloadtor-b034d07acdec08ed536f66d491397b0f31ac5e1d.tar.gz
tor-b034d07acdec08ed536f66d491397b0f31ac5e1d.zip
Remove old wrapper code and defines for keeping log() and log(3) apart
This is the non-automated portion of bug 7599.
-rw-r--r--changes/rename_log_75994
-rw-r--r--src/common/torlog.h1
-rw-r--r--src/common/util.c7
3 files changed, 7 insertions, 5 deletions
diff --git a/changes/rename_log_7599 b/changes/rename_log_7599
new file mode 100644
index 0000000000..38e843f066
--- /dev/null
+++ b/changes/rename_log_7599
@@ -0,0 +1,4 @@
+ o Code simplification and refactoring:
+ - Rename Tor's logging function log() to tor_log(), to avoid conflicts
+ with the natural logarithm function from the system libm. Resolves
+ ticket 7599.
diff --git a/src/common/torlog.h b/src/common/torlog.h
index b487e0e692..23ee597a4e 100644
--- a/src/common/torlog.h
+++ b/src/common/torlog.h
@@ -153,7 +153,6 @@ void set_log_time_granularity(int granularity_msec);
void tor_log(int severity, log_domain_mask_t domain, const char *format, ...)
CHECK_PRINTF(3,4);
-#define log tor_log /* hack it so we don't conflict with tor_log() as much */
#if defined(__GNUC__) || defined(RUNNING_DOXYGEN)
extern int log_global_min_severity_;
diff --git a/src/common/util.c b/src/common/util.c
index 414efce5f4..071ba8f635 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -20,7 +20,6 @@
#define UTIL_PRIVATE
#include "util.h"
#include "torlog.h"
-#undef log
#include "crypto.h"
#include "torint.h"
#include "container.h"
@@ -323,13 +322,13 @@ tor_log_mallinfo(int severity)
* ===== */
/**
- * Returns the natural logarithm of d base 2. We define this wrapper here so
- * as to make it easier not to conflict with Tor's tor_log() macro.
+ * Returns the natural logarithm of d base 2. We defined this wrapper here so
+ * to avoid conflicts with old versions of tor_log(), which were named log().
*/
double
tor_mathlog(double d)
{
- return tor_log(d);
+ return log(d);
}
/** Return the long integer closest to <b>d</b>. We define this wrapper