coding style fixes
This commit is contained in:
parent
658cb96846
commit
b31da162a8
3
brandt.c
3
brandt.c
@ -77,7 +77,6 @@ BRANDT_bidder_start (struct BRANDT_Auction *auction,
|
||||
return;
|
||||
}
|
||||
|
||||
weprintf("broadcasting msg_init %p from bidder %d", buf, i);
|
||||
auction->bcast (auction->closure, buf, buflen);
|
||||
gcry_mpi_set_bit (auction->round_progress, auction->i);
|
||||
free (buf);
|
||||
@ -404,7 +403,6 @@ BRANDT_got_message (struct BRANDT_Auction *auction,
|
||||
/** \todo: cache out of order messages instead of discarding */
|
||||
if (ntohl (head->msg_type) != round || ntohl (head->prot_version) != 0)
|
||||
{
|
||||
weprintf ("%d", auction->i);
|
||||
weprintf ("got unexpected message, ignoring...");
|
||||
return;
|
||||
}
|
||||
@ -427,7 +425,6 @@ BRANDT_got_message (struct BRANDT_Auction *auction,
|
||||
return;
|
||||
}
|
||||
gcry_mpi_set_bit (auction->round_progress, sender);
|
||||
DM(auction->round_progress);
|
||||
|
||||
advance_round (auction, atype, outcome);
|
||||
}
|
||||
|
6
brandt.h
6
brandt.h
@ -29,8 +29,7 @@
|
||||
#include <gnunet/gnunet_util_lib.h>
|
||||
|
||||
/** Enumeration of all possible status reports for a single bidder */
|
||||
enum BRANDT_BidderStatus
|
||||
{
|
||||
enum BRANDT_BidderStatus {
|
||||
BRANDT_bidder_won,
|
||||
};
|
||||
|
||||
@ -41,8 +40,7 @@ struct BRANDT_Auction;
|
||||
* An array of this struct is given to the application by the BRANDT_CbResult()
|
||||
* callback. One instance represents the status of a single bidder.
|
||||
*/
|
||||
struct BRANDT_Result
|
||||
{
|
||||
struct BRANDT_Result {
|
||||
/** Id of the bidder this instance refers to */
|
||||
uint16_t bidder;
|
||||
|
||||
|
10
crypto.c
10
crypto.c
@ -1162,7 +1162,8 @@ quit:
|
||||
}
|
||||
|
||||
|
||||
struct BRANDT_Result *fp_pub_determine_outcome (struct BRANDT_Auction *ad,
|
||||
struct BRANDT_Result *
|
||||
fp_pub_determine_outcome (struct BRANDT_Auction *ad,
|
||||
uint16_t *len)
|
||||
{
|
||||
struct BRANDT_Result *ret;
|
||||
@ -1208,7 +1209,7 @@ struct BRANDT_Result *fp_pub_determine_outcome (struct BRANDT_Auction *ad,
|
||||
if (-1 == winner || -1 == price)
|
||||
return NULL;
|
||||
|
||||
ret = GNUNET_new(struct BRANDT_Result);
|
||||
ret = GNUNET_new (struct BRANDT_Result);
|
||||
ret->bidder = winner;
|
||||
ret->price = price;
|
||||
ret->status = BRANDT_bidder_won;
|
||||
@ -1717,7 +1718,8 @@ fp_priv_recv_decryption (struct BRANDT_Auction *ad,
|
||||
}
|
||||
|
||||
|
||||
struct BRANDT_Result *fp_priv_determine_outcome (struct BRANDT_Auction *ad,
|
||||
struct BRANDT_Result *
|
||||
fp_priv_determine_outcome (struct BRANDT_Auction *ad,
|
||||
uint16_t *len)
|
||||
{
|
||||
struct BRANDT_Result *ret;
|
||||
@ -1762,7 +1764,7 @@ struct BRANDT_Result *fp_priv_determine_outcome (struct BRANDT_Auction *ad,
|
||||
if (-1 == winner || -1 == price)
|
||||
return NULL;
|
||||
|
||||
ret = GNUNET_new(struct BRANDT_Result);
|
||||
ret = GNUNET_new (struct BRANDT_Result);
|
||||
ret->bidder = winner;
|
||||
ret->price = price;
|
||||
ret->status = BRANDT_bidder_won;
|
||||
|
@ -30,8 +30,7 @@
|
||||
#include "util.h"
|
||||
|
||||
|
||||
struct msg
|
||||
{
|
||||
struct msg {
|
||||
uint16_t sender;
|
||||
uint16_t receiver;
|
||||
void *buf;
|
||||
@ -50,7 +49,7 @@ bidder_start (void *arg)
|
||||
{
|
||||
uint16_t i = *(uint16_t *)arg;
|
||||
|
||||
weprintf("starting bidder %d", i);
|
||||
weprintf ("starting bidder %d", i);
|
||||
BRANDT_bidder_start (ad[i], i, bidders);
|
||||
}
|
||||
|
||||
@ -61,7 +60,8 @@ transfer_message (void *arg)
|
||||
struct msg *m = (struct msg *)arg;
|
||||
struct msg_head *h = (struct msg_head *)m->buf;
|
||||
|
||||
weprintf("xfer msg %d %x from %d to %d", ntohl(h->msg_type), arg, m->sender, m->receiver);
|
||||
weprintf ("xfer msg %d %x from %d to %d", ntohl (
|
||||
h->msg_type), arg, m->sender, m->receiver);
|
||||
BRANDT_got_message (ad[m->receiver], m->sender, m->buf, m->buf_len);
|
||||
free (arg);
|
||||
}
|
||||
@ -71,6 +71,7 @@ static uint16_t
|
||||
cb_start (void *auction_closure)
|
||||
{
|
||||
uint16_t *s = (uint16_t *)auction_closure;
|
||||
|
||||
if (!s || bidders != *s)
|
||||
{
|
||||
weprintf ("start callback called from bidder");
|
||||
@ -139,7 +140,8 @@ cb_result (void *auction_closure,
|
||||
weprintf ("result determined by agent %d: none", *s);
|
||||
|
||||
for (uint16_t i = 0; i < results_len; i++)
|
||||
weprintf ("result determined by agent %d: bidder %d got status %d with price %d",
|
||||
weprintf (
|
||||
"result determined by agent %d: bidder %d got status %d with price %d",
|
||||
*s,
|
||||
results[i].bidder,
|
||||
results[i].status,
|
||||
|
@ -310,7 +310,7 @@ test_all_auctions ()
|
||||
|
||||
for (size_t oc = 0; oc < outcome_last; oc++)
|
||||
{
|
||||
if (!test_setup_auction_data() || !test_auction (atype, oc))
|
||||
if (!test_setup_auction_data () || !test_auction (atype, oc))
|
||||
{
|
||||
cleanup_auction_data ();
|
||||
return 0;
|
||||
|
Loading…
Reference in New Issue
Block a user