[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/master] Add upcasts for circuitmux_policy_data_t and circuitmux_policy_circ_data_t to circuitmux.h
commit e1de2f1437ffe67ee0ae74ae6ac1d432f3981542
Author: Andrea Shepard <andrea@xxxxxxxxxxxxxx>
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);
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits