aboutsummaryrefslogtreecommitdiff
path: root/src/common/util.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-12-15 14:32:55 -0500
committerNick Mathewson <nickm@torproject.org>2009-12-15 14:40:49 -0500
commite56747f9cf29ed788baf8805bfe391925d8a19da (patch)
tree2a8c6ec2bb649ca4f0dc86d103ed358550ec533a /src/common/util.h
parentd086c9a7f73ce5b9b7cf4add07fa7d071b829081 (diff)
downloadtor-e56747f9cf29ed788baf8805bfe391925d8a19da.tar.gz
tor-e56747f9cf29ed788baf8805bfe391925d8a19da.zip
Refactor a bit so that it is safe to include math.h, and mostly not needed.
Diffstat (limited to 'src/common/util.h')
-rw-r--r--src/common/util.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/common/util.h b/src/common/util.h
index 85234f5157..17cbb4a44f 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -43,7 +43,7 @@
* stderr. */
#define tor_assert(expr) STMT_BEGIN \
if (PREDICT_UNLIKELY(!(expr))) { \
- log(LOG_ERR, LD_BUG, "%s:%d: %s: Assertion %s failed; aborting.", \
+ log_err(LD_BUG, "%s:%d: %s: Assertion %s failed; aborting.", \
_SHORT_FILE_, __LINE__, __func__, #expr); \
fprintf(stderr,"%s:%d %s: Assertion %s failed; aborting.\n", \
_SHORT_FILE_, __LINE__, __func__, #expr); \
@@ -152,6 +152,8 @@ void tor_log_mallinfo(int severity);
#define bool_neq(a,b) (!(a)!=!(b))
/* Math functions */
+double tor_mathlog(double d) ATTR_CONST;
+long tor_lround(double d) ATTR_CONST;
int tor_log2(uint64_t u64) ATTR_CONST;
uint64_t round_to_power_of_2(uint64_t u64);
unsigned round_to_next_multiple_of(unsigned number, unsigned divisor);