Skip to content
Snippets Groups Projects
Commit 05194cce authored by Nick Mathewson's avatar Nick Mathewson :game_die:
Browse files

Avoid c99 designated initializers in circuitmux_ewma.c

We still want to build on compilers w/o c99 support, such as
(notoriously, shamefully) MSVC.

So I'm commenting out the designated initializers in
circuitmux_ewma.c.  The alternative would have been to use some kind
of macros to use designated initializers only when they're
supported, but that's error-prone, and can lead to code having
different meanings under different compilers.

Bug 7286; fix on 0.2.4.4-alpha; spotted by Gisle Vanem.
parent ae99fc1c
No related branches found
No related tags found
No related merge requests found
o Minor bugfixes:
- Compile correctly on compilers without C99 designated initializer
support. Fixes bug 7286; bugfix on 0.2.4.4-alpha.
......@@ -200,15 +200,16 @@ static int ewma_enabled = 0;
/*** EWMA circuitmux_policy_t method table ***/
circuitmux_policy_t ewma_policy = { .alloc_cmux_data = ewma_alloc_cmux_data,
.free_cmux_data = ewma_free_cmux_data,
.alloc_circ_data = ewma_alloc_circ_data,
.free_circ_data = ewma_free_circ_data,
.notify_circ_active = ewma_notify_circ_active,
.notify_circ_inactive = ewma_notify_circ_inactive,
.notify_set_n_cells = NULL, /* EWMA doesn't need this */
.notify_xmit_cells = ewma_notify_xmit_cells,
.pick_active_circuit = ewma_pick_active_circuit
circuitmux_policy_t ewma_policy = {
/*.alloc_cmux_data =*/ ewma_alloc_cmux_data,
/*.free_cmux_data =*/ ewma_free_cmux_data,
/*.alloc_circ_data =*/ ewma_alloc_circ_data,
/*.free_circ_data =*/ ewma_free_circ_data,
/*.notify_circ_active =*/ ewma_notify_circ_active,
/*.notify_circ_inactive =*/ ewma_notify_circ_inactive,
/*.notify_set_n_cells =*/ NULL, /* EWMA doesn't need this */
/*.notify_xmit_cells =*/ ewma_notify_xmit_cells,
/*.pick_active_circuit =*/ ewma_pick_active_circuit
};
/*** EWMA method implementations using the below EWMA helper functions ***/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment