gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r31347 - in gnunet/src: ats transport


From: gnunet
Subject: [GNUnet-SVN] r31347 - in gnunet/src: ats transport
Date: Fri, 13 Dec 2013 13:05:02 +0100

Author: grothoff
Date: 2013-12-13 13:05:02 +0100 (Fri, 13 Dec 2013)
New Revision: 31347

Modified:
   gnunet/src/ats/plugin_ats_ril.c
   gnunet/src/transport/plugin_transport_http_client.c
   gnunet/src/transport/plugin_transport_tcp.c
Log:
-doxygen, style fixes

Modified: gnunet/src/ats/plugin_ats_ril.c
===================================================================
--- gnunet/src/ats/plugin_ats_ril.c     2013-12-13 10:42:41 UTC (rev 31346)
+++ gnunet/src/ats/plugin_ats_ril.c     2013-12-13 12:05:02 UTC (rev 31347)
@@ -380,6 +380,7 @@
 static int
 ril_count_agents(struct GAS_RIL_Handle * solver);
 
+
 /**
  * Estimate the current action-value for state s and action a
  *
@@ -405,10 +406,10 @@
   {
     return isinf(result) * UINT32_MAX; //TODO! fix
   }
-
   return result;
 }
 
+
 /**
  * Decide whether to do exploration (i.e. taking a new action) or exploitation 
(i.e. taking the
  * currently estimated best action) in the current step
@@ -430,13 +431,14 @@
   return GNUNET_NO;
 }
 
-  /**
-   * Get the index of the address in the agent's list.
-   *
-   * @param agent agent handle
-   * @param address address handle
-   * @return the index, starting with zero
-   */
+
+/**
+ * Get the index of the address in the agent's list.
+ *
+ * @param agent agent handle
+ * @param address address handle
+ * @return the index, starting with zero
+ */
 static int
 agent_address_get_index (struct RIL_Peer_Agent *agent, struct ATS_Address 
*address)
 {
@@ -448,14 +450,12 @@
   {
     i++;
     if (cur->address_naked == address)
-    {
       return i;
-    }
   }
-
   return i;
 }
 
+
 /**
  * Gets the wrapped address from the agent's list
  *
@@ -469,16 +469,12 @@
   struct RIL_Address_Wrapped *cur;
 
   for (cur = agent->addresses_head; NULL != cur; cur = cur->next)
-  {
     if (cur->address_naked == address)
-    {
       return cur;
-    }
-  }
-
-  return NULL ;
+  return NULL;
 }
 
+
 /**
  * Gets the action, with the maximal estimated Q-value (i.e. the one currently 
estimated to bring the
  * most reward in the future)
@@ -510,6 +506,7 @@
   return max_i;
 }
 
+
 /**
  * Gets any action, to explore the action space from that state
  *
@@ -524,6 +521,7 @@
   return GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, agent->n);
 }
 
+
 /**
  * Updates the weights (i.e. coefficients) of the weight vector in matrix W 
for action a
  *
@@ -563,10 +561,11 @@
   }
 }
 
+
 /**
  * Changes the eligibility trace vector e in various manners:
  * #RIL_E_ACCUMULATE - adds @a f to each component as in accumulating 
eligibility traces
- * #RIL_E_REPLACE - resets each component to @f  as in replacing traces
+ * #RIL_E_REPLACE - resets each component to @a f  as in replacing traces
  * #RIL_E_SET - multiplies e with discount factor and lambda as in the update 
rule
  * #RIL_E_ZERO - sets e to 0 as in Watkin's Q-learning algorithm when 
exploring and when initializing
  *
@@ -575,7 +574,9 @@
  * @param f how much to change
  */
 static void
-agent_modify_eligibility (struct RIL_Peer_Agent *agent, enum 
RIL_E_Modification mod, double *f)
+agent_modify_eligibility (struct RIL_Peer_Agent *agent,
+                          enum RIL_E_Modification mod,
+                          double *f)
 {
   int i;
   double *e = agent->e;
@@ -610,6 +611,7 @@
     solver->plugin_envi->info_cb (solver->plugin_envi->info_cb_cls, op, stat, 
GAS_INFO_NONE);
 }
 
+
 /**
  * Changes the active assignment suggestion of the handler and invokes the 
bw_changed callback to
  * notify ATS of its new decision
@@ -699,6 +701,7 @@
   agent->address_inuse = new_address;
 }
 
+
 static unsigned long long
 ril_network_get_assigned (struct GAS_RIL_Handle *solver, enum 
GNUNET_ATS_Network_Type type, int direction_in)
 {

Modified: gnunet/src/transport/plugin_transport_http_client.c
===================================================================
--- gnunet/src/transport/plugin_transport_http_client.c 2013-12-13 10:42:41 UTC 
(rev 31346)
+++ gnunet/src/transport/plugin_transport_http_client.c 2013-12-13 12:05:02 UTC 
(rev 31347)
@@ -622,13 +622,15 @@
 /**
  * Disconnect a session
  *
+ * @param cls the `struct HTTP_Client_Plugin`
  * @param s session
  * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
  */
 static int
-http_client_session_disconnect (struct HTTP_Client_Plugin *plugin,
+http_client_session_disconnect (void *cls,
                                 struct Session *s)
 {
+  struct HTTP_Client_Plugin *plugin = cls;
   struct HTTP_Message *msg;
   struct HTTP_Message *t;
   int res = GNUNET_OK;

Modified: gnunet/src/transport/plugin_transport_tcp.c
===================================================================
--- gnunet/src/transport/plugin_transport_tcp.c 2013-12-13 10:42:41 UTC (rev 
31346)
+++ gnunet/src/transport/plugin_transport_tcp.c 2013-12-13 12:05:02 UTC (rev 
31347)
@@ -1017,6 +1017,7 @@
  * to close a session due to a disconnect or failure to
  * establish a connection.
  *
+ * @param cls the `struct Plugin`
  * @param session session to close down
  * @return #GNUNET_OK on success
  */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]