[tor-commits] [tor/master] Add upcasts for circuitmux_policy_data_t and circuitmux_policy_circ_data_t to circuitmux.h

andrea at torproject.org andrea at torproject.org
Thu Oct 11 02:05:23 UTC 2012


commit e1de2f1437ffe67ee0ae74ae6ac1d432f3981542
Author: Andrea Shepard <andrea at torproject.org>
Date:   Mon Oct 1 01:48:52 2012 -0700

    Add upcasts for circuitmux_policy_data_t and circuitmux_policy_circ_data_t to circuitmux.h
---
 src/or/circuitmux.h |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/src/or/circuitmux.h b/src/or/circuitmux.h
index f4eb73e..a3eacaf 100644
--- a/src/or/circuitmux.h
+++ b/src/or/circuitmux.h
@@ -76,6 +76,23 @@ struct circuitmux_policy_circ_data_s {
   uint32_t magic;
 };
 
+/*
+ * Upcast #defines for the above types
+ */
+
+/**
+ * Convert a circuitmux_policy_data_t subtype to a circuitmux_policy_data_t.
+ */
+
+#define TO_CMUX_POL_DATA(x)  (&((x)->_base))
+
+/**
+ * Convert a circuitmux_policy_circ_data_t subtype to a
+ * circuitmux_policy_circ_data_t.
+ */
+
+#define TO_CMUX_POL_CIRC_DATA(x)  (&((x)->_base))
+
 /* Consistency check */
 void circuitmux_assert_okay(circuitmux_t *cmux);
 





More information about the tor-commits mailing list