[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r35158 - gnunet/src/ats
From: |
gnunet |
Subject: |
[GNUnet-SVN] r35158 - gnunet/src/ats |
Date: |
Sun, 8 Feb 2015 16:22:16 +0100 |
Author: grothoff
Date: 2015-02-08 16:22:16 +0100 (Sun, 08 Feb 2015)
New Revision: 35158
Modified:
gnunet/src/ats/gnunet-service-ats_preferences.h
gnunet/src/ats/plugin_ats_mlp.c
gnunet/src/ats/plugin_ats_proportional.c
Log:
-clarify API
Modified: gnunet/src/ats/gnunet-service-ats_preferences.h
===================================================================
--- gnunet/src/ats/gnunet-service-ats_preferences.h 2015-02-08 15:20:15 UTC
(rev 35157)
+++ gnunet/src/ats/gnunet-service-ats_preferences.h 2015-02-08 15:22:16 UTC
(rev 35158)
@@ -76,7 +76,7 @@
* @param cls ignored
* @param id the peer
* @return pointer to the values, can be indexed
- * with GNUNET_ATS_PreferenceKind, NULL if peer does not exist
+ * with `enum GNUNET_ATS_PreferenceKind`, never NULL
*/
const double *
GAS_preference_get_by_peer (void *cls,
Modified: gnunet/src/ats/plugin_ats_mlp.c
===================================================================
--- gnunet/src/ats/plugin_ats_mlp.c 2015-02-08 15:20:15 UTC (rev 35157)
+++ gnunet/src/ats/plugin_ats_mlp.c 2015-02-08 15:22:16 UTC (rev 35158)
@@ -2032,7 +2032,7 @@
const struct GNUNET_PeerIdentity *peer)
{
double res;
- const double *preferences = NULL;
+ const double *preferences;
int c;
preferences = mlp->env->get_preferences (mlp->env->cls, peer);
Modified: gnunet/src/ats/plugin_ats_proportional.c
===================================================================
--- gnunet/src/ats/plugin_ats_proportional.c 2015-02-08 15:20:15 UTC (rev
35157)
+++ gnunet/src/ats/plugin_ats_proportional.c 2015-02-08 15:22:16 UTC (rev
35158)
@@ -542,8 +542,8 @@
if (GNUNET_YES != cur_address->addr->active)
continue;
- GNUNET_assert( NULL != (peer_relative_prefs = s->env->get_preferences
(s->env->cls,
-
&cur_address->addr->peer)));
+ peer_relative_prefs = s->env->get_preferences (s->env->cls,
+ &cur_address->addr->peer);
relative_peer_prefence = 0.0;
relative_peer_prefence +=
peer_relative_prefs[GNUNET_ATS_PREFERENCE_BANDWIDTH];
sum_relative_peer_prefences += relative_peer_prefence;
@@ -577,9 +577,8 @@
{
if (GNUNET_YES == cur_address->addr->active)
{
- GNUNET_assert( NULL != (peer_relative_prefs =
- s->env->get_preferences (s->env->cls,
-
&cur_address->addr->peer)));
+ peer_relative_prefs = s->env->get_preferences (s->env->cls,
+ &cur_address->addr->peer);
cur_pref = peer_relative_prefs[GNUNET_ATS_PREFERENCE_BANDWIDTH];
total_weight = net->active_addresses +
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r35158 - gnunet/src/ats,
gnunet <=