diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-02-08 15:22:16 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-02-08 15:22:16 +0000 |
commit | 4a86cb2b78634385c8819f8b9b996aaefe6bf780 (patch) | |
tree | 56076cd6e7d1f7cace7a988f690826399444bc90 /src/ats | |
parent | 23818fb1b0be92a7c840fbc24eb6c4efa44b98cd (diff) | |
download | gnunet-4a86cb2b78634385c8819f8b9b996aaefe6bf780.tar.gz gnunet-4a86cb2b78634385c8819f8b9b996aaefe6bf780.zip |
-clarify API
Diffstat (limited to 'src/ats')
-rw-r--r-- | src/ats/gnunet-service-ats_preferences.h | 2 | ||||
-rw-r--r-- | src/ats/plugin_ats_mlp.c | 2 | ||||
-rw-r--r-- | src/ats/plugin_ats_proportional.c | 9 |
3 files changed, 6 insertions, 7 deletions
diff --git a/src/ats/gnunet-service-ats_preferences.h b/src/ats/gnunet-service-ats_preferences.h index dc19891bb..4500dd0ff 100644 --- a/src/ats/gnunet-service-ats_preferences.h +++ b/src/ats/gnunet-service-ats_preferences.h | |||
@@ -76,7 +76,7 @@ GAS_preference_done (void); | |||
76 | * @param cls ignored | 76 | * @param cls ignored |
77 | * @param id the peer | 77 | * @param id the peer |
78 | * @return pointer to the values, can be indexed | 78 | * @return pointer to the values, can be indexed |
79 | * with GNUNET_ATS_PreferenceKind, NULL if peer does not exist | 79 | * with `enum GNUNET_ATS_PreferenceKind`, never NULL |
80 | */ | 80 | */ |
81 | const double * | 81 | const double * |
82 | GAS_preference_get_by_peer (void *cls, | 82 | GAS_preference_get_by_peer (void *cls, |
diff --git a/src/ats/plugin_ats_mlp.c b/src/ats/plugin_ats_mlp.c index ec53e7438..f2f961f7e 100644 --- a/src/ats/plugin_ats_mlp.c +++ b/src/ats/plugin_ats_mlp.c | |||
@@ -2032,7 +2032,7 @@ get_peer_pref_value (struct GAS_MLP_Handle *mlp, | |||
2032 | const struct GNUNET_PeerIdentity *peer) | 2032 | const struct GNUNET_PeerIdentity *peer) |
2033 | { | 2033 | { |
2034 | double res; | 2034 | double res; |
2035 | const double *preferences = NULL; | 2035 | const double *preferences; |
2036 | int c; | 2036 | int c; |
2037 | 2037 | ||
2038 | preferences = mlp->env->get_preferences (mlp->env->cls, peer); | 2038 | preferences = mlp->env->get_preferences (mlp->env->cls, peer); |
diff --git a/src/ats/plugin_ats_proportional.c b/src/ats/plugin_ats_proportional.c index b4cabb067..96ff1a0c0 100644 --- a/src/ats/plugin_ats_proportional.c +++ b/src/ats/plugin_ats_proportional.c | |||
@@ -542,8 +542,8 @@ distribute_bandwidth (struct GAS_PROPORTIONAL_Handle *s, | |||
542 | if (GNUNET_YES != cur_address->addr->active) | 542 | if (GNUNET_YES != cur_address->addr->active) |
543 | continue; | 543 | continue; |
544 | 544 | ||
545 | GNUNET_assert( NULL != (peer_relative_prefs = s->env->get_preferences (s->env->cls, | 545 | peer_relative_prefs = s->env->get_preferences (s->env->cls, |
546 | &cur_address->addr->peer))); | 546 | &cur_address->addr->peer); |
547 | relative_peer_prefence = 0.0; | 547 | relative_peer_prefence = 0.0; |
548 | relative_peer_prefence += peer_relative_prefs[GNUNET_ATS_PREFERENCE_BANDWIDTH]; | 548 | relative_peer_prefence += peer_relative_prefs[GNUNET_ATS_PREFERENCE_BANDWIDTH]; |
549 | sum_relative_peer_prefences += relative_peer_prefence; | 549 | sum_relative_peer_prefences += relative_peer_prefence; |
@@ -577,9 +577,8 @@ distribute_bandwidth (struct GAS_PROPORTIONAL_Handle *s, | |||
577 | { | 577 | { |
578 | if (GNUNET_YES == cur_address->addr->active) | 578 | if (GNUNET_YES == cur_address->addr->active) |
579 | { | 579 | { |
580 | GNUNET_assert( NULL != (peer_relative_prefs = | 580 | peer_relative_prefs = s->env->get_preferences (s->env->cls, |
581 | s->env->get_preferences (s->env->cls, | 581 | &cur_address->addr->peer); |
582 | &cur_address->addr->peer))); | ||
583 | 582 | ||
584 | cur_pref = peer_relative_prefs[GNUNET_ATS_PREFERENCE_BANDWIDTH]; | 583 | cur_pref = peer_relative_prefs[GNUNET_ATS_PREFERENCE_BANDWIDTH]; |
585 | total_weight = net->active_addresses + | 584 | total_weight = net->active_addresses + |