aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2014-12-20 12:37:06 +0000
committerChristian Grothoff <christian@grothoff.org>2014-12-20 12:37:06 +0000
commite46adaefee76201e8dfc0adc9963be77077a5004 (patch)
treeb6c598abdd8c3b035275800e1b03221d27b49827
parent4cf0c0c575b1f2153feaf96c9122eb55a118a19a (diff)
downloadgnunet-e46adaefee76201e8dfc0adc9963be77077a5004.tar.gz
gnunet-e46adaefee76201e8dfc0adc9963be77077a5004.zip
-fix unused initialization of locals
-rw-r--r--src/ats/plugin_ats_mlp.c51
1 files changed, 29 insertions, 22 deletions
diff --git a/src/ats/plugin_ats_mlp.c b/src/ats/plugin_ats_mlp.c
index 4491de078..2240ba680 100644
--- a/src/ats/plugin_ats_mlp.c
+++ b/src/ats/plugin_ats_mlp.c
@@ -1921,7 +1921,6 @@ GAS_mlp_address_add (void *solver,
1921 uint32_t network) 1921 uint32_t network)
1922{ 1922{
1923 struct GAS_MLP_Handle *mlp = solver; 1923 struct GAS_MLP_Handle *mlp = solver;
1924 struct ATS_Peer *p;
1925 1924
1926 GNUNET_assert (NULL != solver); 1925 GNUNET_assert (NULL != solver);
1927 GNUNET_assert (NULL != address); 1926 GNUNET_assert (NULL != address);
@@ -1942,14 +1941,20 @@ GAS_mlp_address_add (void *solver,
1942 GNUNET_i2s(&address->peer)); 1941 GNUNET_i2s(&address->peer));
1943 1942
1944 /* Is this peer included in the problem? */ 1943 /* Is this peer included in the problem? */
1945 if (NULL == (p = GNUNET_CONTAINER_multipeermap_get (mlp->requested_peers, 1944 if (NULL ==
1946 &address->peer))) 1945 GNUNET_CONTAINER_multipeermap_get (mlp->requested_peers,
1947 { 1946 &address->peer))
1948 LOG (GNUNET_ERROR_TYPE_DEBUG, "Adding address for peer `%s' without address request \n", GNUNET_i2s(&address->peer)); 1947 {
1948 /* FIXME: should this be an error? */
1949 LOG (GNUNET_ERROR_TYPE_DEBUG,
1950 "Adding address for peer `%s' without address request\n",
1951 GNUNET_i2s(&address->peer));
1949 return; 1952 return;
1950 } 1953 }
1951 1954
1952 LOG (GNUNET_ERROR_TYPE_DEBUG, "Adding address for peer `%s' with address request \n", GNUNET_i2s(&address->peer)); 1955 LOG (GNUNET_ERROR_TYPE_DEBUG,
1956 "Adding address for peer `%s' with address request \n",
1957 GNUNET_i2s(&address->peer));
1953 /* Problem size changed: new address for peer with pending request */ 1958 /* Problem size changed: new address for peer with pending request */
1954 mlp->stat_mlp_prob_changed = GNUNET_YES; 1959 mlp->stat_mlp_prob_changed = GNUNET_YES;
1955 if (GNUNET_YES == mlp->opt_mlp_auto_solve) 1960 if (GNUNET_YES == mlp->opt_mlp_auto_solve)
@@ -1975,7 +1980,6 @@ GAS_mlp_address_property_changed (void *solver,
1975{ 1980{
1976 struct MLP_information *mlpi = address->solver_information; 1981 struct MLP_information *mlpi = address->solver_information;
1977 struct GAS_MLP_Handle *mlp = solver; 1982 struct GAS_MLP_Handle *mlp = solver;
1978 struct ATS_Peer *p;
1979 int c1; 1983 int c1;
1980 int type_index; 1984 int type_index;
1981 1985
@@ -1993,8 +1997,9 @@ GAS_mlp_address_property_changed (void *solver,
1993 return; 1997 return;
1994 } 1998 }
1995 1999
1996 if (NULL == (p = GNUNET_CONTAINER_multipeermap_get (mlp->requested_peers, 2000 if (NULL ==
1997 &address->peer))) 2001 GNUNET_CONTAINER_multipeermap_get (mlp->requested_peers,
2002 &address->peer))
1998 { 2003 {
1999 /* Peer is not requested, so no need to update problem */ 2004 /* Peer is not requested, so no need to update problem */
2000 return; 2005 return;
@@ -2094,7 +2099,6 @@ GAS_mlp_address_change_network (void *solver,
2094{ 2099{
2095 struct MLP_information *mlpi = address->solver_information; 2100 struct MLP_information *mlpi = address->solver_information;
2096 struct GAS_MLP_Handle *mlp = solver; 2101 struct GAS_MLP_Handle *mlp = solver;
2097 struct ATS_Peer *p;
2098 int nets_avail[] = GNUNET_ATS_NetworkType; 2102 int nets_avail[] = GNUNET_ATS_NetworkType;
2099 int c1; 2103 int c1;
2100 2104
@@ -2116,8 +2120,9 @@ GAS_mlp_address_change_network (void *solver,
2116 if (mlpi->c_b == MLP_UNDEFINED) 2120 if (mlpi->c_b == MLP_UNDEFINED)
2117 return; /* This address is not yet in the matrix*/ 2121 return; /* This address is not yet in the matrix*/
2118 2122
2119 if (NULL == (p = GNUNET_CONTAINER_multipeermap_get (mlp->requested_peers, 2123 if (NULL ==
2120 &address->peer))) 2124 GNUNET_CONTAINER_multipeermap_get (mlp->requested_peers,
2125 &address->peer))
2121 { 2126 {
2122 /* Peer is not requested, so no need to update problem */ 2127 /* Peer is not requested, so no need to update problem */
2123 GNUNET_break (0); 2128 GNUNET_break (0);
@@ -2275,8 +2280,9 @@ GAS_mlp_get_preferred_address (void *solver,
2275 GNUNET_i2s (peer)); 2280 GNUNET_i2s (peer));
2276 2281
2277 /* Is this peer included in the problem? */ 2282 /* Is this peer included in the problem? */
2278 if (NULL == (p = GNUNET_CONTAINER_multipeermap_get (mlp->requested_peers, 2283 if (NULL ==
2279 peer))) 2284 GNUNET_CONTAINER_multipeermap_get (mlp->requested_peers,
2285 peer))
2280 { 2286 {
2281 LOG (GNUNET_ERROR_TYPE_INFO, "Adding peer `%s' to list of requested_peers with requests\n", 2287 LOG (GNUNET_ERROR_TYPE_INFO, "Adding peer `%s' to list of requested_peers with requests\n",
2282 GNUNET_i2s (peer)); 2288 GNUNET_i2s (peer));
@@ -2322,7 +2328,6 @@ GAS_mlp_address_delete (void *solver,
2322 struct ATS_Address *address, 2328 struct ATS_Address *address,
2323 int session_only) 2329 int session_only)
2324{ 2330{
2325 struct ATS_Peer *p;
2326 struct GAS_MLP_Handle *mlp = solver; 2331 struct GAS_MLP_Handle *mlp = solver;
2327 struct MLP_information *mlpi; 2332 struct MLP_information *mlpi;
2328 int was_active; 2333 int was_active;
@@ -2343,12 +2348,14 @@ GAS_mlp_address_delete (void *solver,
2343 address->assigned_bw_out = 0; 2348 address->assigned_bw_out = 0;
2344 2349
2345 /* Is this peer included in the problem? */ 2350 /* Is this peer included in the problem? */
2346 if (NULL == (p = GNUNET_CONTAINER_multipeermap_get (mlp->requested_peers, 2351 if (NULL ==
2347 &address->peer))) 2352 GNUNET_CONTAINER_multipeermap_get (mlp->requested_peers,
2348 { 2353 &address->peer))
2349 LOG (GNUNET_ERROR_TYPE_INFO, "Deleting %s for peer `%s' without address request \n", 2354 {
2350 (session_only == GNUNET_YES) ? "session" : "address", 2355 LOG (GNUNET_ERROR_TYPE_INFO,
2351 GNUNET_i2s(&address->peer)); 2356 "Deleting %s for peer `%s' without address request \n",
2357 (session_only == GNUNET_YES) ? "session" : "address",
2358 GNUNET_i2s(&address->peer));
2352 return; 2359 return;
2353 } 2360 }
2354 LOG (GNUNET_ERROR_TYPE_INFO, "Deleting %s for peer `%s' with address request \n", 2361 LOG (GNUNET_ERROR_TYPE_INFO, "Deleting %s for peer `%s' with address request \n",
@@ -2460,7 +2467,7 @@ GAS_mlp_address_change_preference (void *solver,
2460 double pref_rel) 2467 double pref_rel)
2461{ 2468{
2462 struct GAS_MLP_Handle *mlp = solver; 2469 struct GAS_MLP_Handle *mlp = solver;
2463 struct ATS_Peer *p = NULL; 2470 struct ATS_Peer *p;
2464 2471
2465 LOG (GNUNET_ERROR_TYPE_DEBUG, "Changing preference for address for peer `%s' to %.2f\n", 2472 LOG (GNUNET_ERROR_TYPE_DEBUG, "Changing preference for address for peer `%s' to %.2f\n",
2466 GNUNET_i2s(peer), pref_rel); 2473 GNUNET_i2s(peer), pref_rel);