diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-02-08 11:46:36 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-02-08 11:46:36 +0000 |
commit | 6115a1150c65bd4a33ed61c6e96594c4a73d86ac (patch) | |
tree | f2bb2a57f540a3799cd112b5235f1c4222fd283e /src/ats | |
parent | cd0a6e382eafd7fd241a00a10527333d73985fca (diff) | |
download | gnunet-6115a1150c65bd4a33ed61c6e96594c4a73d86ac.tar.gz gnunet-6115a1150c65bd4a33ed61c6e96594c4a73d86ac.zip |
more dead and duplicate code elimination
Diffstat (limited to 'src/ats')
-rw-r--r-- | src/ats/ats_api_scanner.c | 11 | ||||
-rw-r--r-- | src/ats/gnunet-service-ats_normalization.c | 2 | ||||
-rw-r--r-- | src/ats/plugin_ats_mlp.c | 42 |
3 files changed, 4 insertions, 51 deletions
diff --git a/src/ats/ats_api_scanner.c b/src/ats/ats_api_scanner.c index ddc755a04..ce1c90567 100644 --- a/src/ats/ats_api_scanner.c +++ b/src/ats/ats_api_scanner.c | |||
@@ -78,23 +78,14 @@ GNUNET_ATS_print_property_type (enum GNUNET_ATS_Property type) | |||
78 | return "UTILIZATION_UP"; | 78 | return "UTILIZATION_UP"; |
79 | case GNUNET_ATS_UTILIZATION_IN: | 79 | case GNUNET_ATS_UTILIZATION_IN: |
80 | return "UTILIZATION_DOWN"; | 80 | return "UTILIZATION_DOWN"; |
81 | case GNUNET_ATS_UTILIZATION_PAYLOAD_OUT: | ||
82 | return "UTILIZATION_PAYLOAD_UP"; | ||
83 | case GNUNET_ATS_UTILIZATION_PAYLOAD_IN: | ||
84 | return "UTILIZATION_PAYLOAD_DOWN"; | ||
85 | case GNUNET_ATS_NETWORK_TYPE: | 81 | case GNUNET_ATS_NETWORK_TYPE: |
86 | return "NETWORK_TYPE"; | 82 | return "NETWORK_TYPE"; |
87 | case GNUNET_ATS_QUALITY_NET_DELAY: | 83 | case GNUNET_ATS_QUALITY_NET_DELAY: |
88 | return "DELAY"; | 84 | return "DELAY"; |
89 | case GNUNET_ATS_QUALITY_NET_DISTANCE: | 85 | case GNUNET_ATS_QUALITY_NET_DISTANCE: |
90 | return "DISTANCE"; | 86 | return "DISTANCE"; |
91 | case GNUNET_ATS_COST_WAN: | ||
92 | return "COST_WAN"; | ||
93 | case GNUNET_ATS_COST_LAN: | ||
94 | return "COST_LAN"; | ||
95 | case GNUNET_ATS_COST_WLAN: | ||
96 | return "COST_WLAN"; | ||
97 | default: | 87 | default: |
88 | GNUNET_break (0); | ||
98 | return NULL; | 89 | return NULL; |
99 | } | 90 | } |
100 | } | 91 | } |
diff --git a/src/ats/gnunet-service-ats_normalization.c b/src/ats/gnunet-service-ats_normalization.c index 0d0b63e9d..23b7b0cb7 100644 --- a/src/ats/gnunet-service-ats_normalization.c +++ b/src/ats/gnunet-service-ats_normalization.c | |||
@@ -324,7 +324,7 @@ property_normalize (struct Property *p, | |||
324 | /* Normalize the values of this property */ | 324 | /* Normalize the values of this property */ |
325 | if (GNUNET_NO == limits_changed) | 325 | if (GNUNET_NO == limits_changed) |
326 | { | 326 | { |
327 | /* normalize just this address */ | 327 | /* normalize just this address */ |
328 | normalize_address (p, | 328 | normalize_address (p, |
329 | &address->peer, | 329 | &address->peer, |
330 | address); | 330 | address); |
diff --git a/src/ats/plugin_ats_mlp.c b/src/ats/plugin_ats_mlp.c index fbaed1eaa..89be5ae7d 100644 --- a/src/ats/plugin_ats_mlp.c +++ b/src/ats/plugin_ats_mlp.c | |||
@@ -597,45 +597,6 @@ mlp_delete_problem (struct GAS_MLP_Handle *mlp) | |||
597 | 597 | ||
598 | 598 | ||
599 | /** | 599 | /** |
600 | * Translate ATS properties to text | ||
601 | * Just intended for debugging | ||
602 | * | ||
603 | * @param ats_index the ATS index | ||
604 | * @return string with result | ||
605 | */ | ||
606 | static const char * | ||
607 | mlp_ats_to_string (int ats_index) | ||
608 | { | ||
609 | switch (ats_index) { | ||
610 | case GNUNET_ATS_ARRAY_TERMINATOR: | ||
611 | return "GNUNET_ATS_ARRAY_TERMINATOR"; | ||
612 | case GNUNET_ATS_UTILIZATION_OUT: | ||
613 | return "GNUNET_ATS_UTILIZATION_OUT"; | ||
614 | case GNUNET_ATS_UTILIZATION_IN: | ||
615 | return "GNUNET_ATS_UTILIZATION_IN"; | ||
616 | case GNUNET_ATS_UTILIZATION_PAYLOAD_OUT: | ||
617 | return "GNUNET_ATS_UTILIZATION_PAYLOAD_OUT"; | ||
618 | case GNUNET_ATS_UTILIZATION_PAYLOAD_IN: | ||
619 | return "GNUNET_ATS_UTILIZATION_PAYLOAD_IN"; | ||
620 | case GNUNET_ATS_COST_LAN: | ||
621 | return "GNUNET_ATS_COST_LAN"; | ||
622 | case GNUNET_ATS_COST_WAN: | ||
623 | return "GNUNET_ATS_COST_LAN"; | ||
624 | case GNUNET_ATS_COST_WLAN: | ||
625 | return "GNUNET_ATS_COST_WLAN"; | ||
626 | case GNUNET_ATS_NETWORK_TYPE: | ||
627 | return "GNUNET_ATS_NETWORK_TYPE"; | ||
628 | case GNUNET_ATS_QUALITY_NET_DELAY: | ||
629 | return "GNUNET_ATS_QUALITY_NET_DELAY"; | ||
630 | case GNUNET_ATS_QUALITY_NET_DISTANCE: | ||
631 | return "GNUNET_ATS_QUALITY_NET_DISTANCE"; | ||
632 | default: | ||
633 | GNUNET_break (0); | ||
634 | return "unknown"; | ||
635 | } | ||
636 | } | ||
637 | |||
638 | /** | ||
639 | * Translate glpk status error codes to text | 600 | * Translate glpk status error codes to text |
640 | * @param retcode return code | 601 | * @param retcode return code |
641 | * @return string with result | 602 | * @return string with result |
@@ -1217,7 +1178,8 @@ mlp_create_problem_add_invariant_rows (struct GAS_MLP_Handle *mlp, struct MLP_Pr | |||
1217 | { | 1178 | { |
1218 | for (c = 0; c < mlp->pv.m_q; c++) | 1179 | for (c = 0; c < mlp->pv.m_q; c++) |
1219 | { | 1180 | { |
1220 | GNUNET_asprintf(&name, "c7_q%i_%s", c, mlp_ats_to_string(mlp->pv.q[c])); | 1181 | GNUNET_asprintf (&name, "c7_q%i_%s", c, |
1182 | GNUNET_ATS_print_property_type (mlp->pv.q[c])); | ||
1221 | p->r_q[c] = mlp_create_problem_create_constraint (p, name, GLP_FX, 0.0, 0.0); | 1183 | p->r_q[c] = mlp_create_problem_create_constraint (p, name, GLP_FX, 0.0, 0.0); |
1222 | GNUNET_free (name); | 1184 | GNUNET_free (name); |
1223 | mlp_create_problem_set_value (p, p->r_q[c], p->c_q[c], -1, __LINE__); | 1185 | mlp_create_problem_set_value (p, p->r_q[c], p->c_q[c], -1, __LINE__); |