summaryrefslogtreecommitdiff
path: root/src/common/util.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-12-07 10:37:59 -0500
committerNick Mathewson <nickm@torproject.org>2017-12-08 14:47:19 -0500
commit95531ddfbfb6cb30760523d91fd4dfc966d2f6a5 (patch)
tree8f07a0011605954075903893952504ec0be24334 /src/common/util.h
parent5508ee29d56c948efc7a07747e37cc27538e17a8 (diff)
downloadtor-95531ddfbfb6cb30760523d91fd4dfc966d2f6a5.tar.gz
tor-95531ddfbfb6cb30760523d91fd4dfc966d2f6a5.zip
Let's have only one FREE_AND_NULL variant.
This commit removes the old FREE_AND_NULL, and renames the old FREE_AND_NULL_UNMATCHED so that it is now called FREE_AND_NULL. This will break all the FREE_AND_NULL_* users; the next commit will fix them.
Diffstat (limited to 'src/common/util.h')
-rw-r--r--src/common/util.h10
1 files changed, 1 insertions, 9 deletions
diff --git a/src/common/util.h b/src/common/util.h
index e85be57c07..97ad15f834 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -121,11 +121,8 @@ void tor_log_mallinfo(int severity);
/* Helper macro: free a variable of type 'typename' using freefn, and
* set the variable to NULL.
- *
- * We use this for legacy cases when freefn and typename don't line up
- * perfectly.
*/
-#define FREE_AND_NULL_UNMATCHED(typename, freefn, var) \
+#define FREE_AND_NULL(typename, freefn, var) \
do { \
/* only evaluate (var) once. */ \
typename **tmp__free__ptr ## freefn = &(var); \
@@ -133,11 +130,6 @@ void tor_log_mallinfo(int severity);
(*tmp__free__ptr ## freefn) = NULL; \
} while (0)
-/* Helper macro: free a variable of type 'type' using type_free_, and
- * set the variable to NULL. */
-#define FREE_AND_NULL(type, var) \
- FREE_AND_NULL_UNMATCHED(type ## _t, type ## _free_, (var))
-
/** Macro: yield a pointer to the field at position <b>off</b> within the
* structure <b>st</b>. Example:
* <pre>