coding style fixes

This commit is contained in:
Markus Teich 2016-09-21 13:50:20 +02:00
parent 658cb96846
commit b31da162a8
6 changed files with 101 additions and 102 deletions

View File

@ -77,7 +77,6 @@ BRANDT_bidder_start (struct BRANDT_Auction *auction,
return; return;
} }
weprintf("broadcasting msg_init %p from bidder %d", buf, i);
auction->bcast (auction->closure, buf, buflen); auction->bcast (auction->closure, buf, buflen);
gcry_mpi_set_bit (auction->round_progress, auction->i); gcry_mpi_set_bit (auction->round_progress, auction->i);
free (buf); free (buf);
@ -404,7 +403,6 @@ BRANDT_got_message (struct BRANDT_Auction *auction,
/** \todo: cache out of order messages instead of discarding */ /** \todo: cache out of order messages instead of discarding */
if (ntohl (head->msg_type) != round || ntohl (head->prot_version) != 0) if (ntohl (head->msg_type) != round || ntohl (head->prot_version) != 0)
{ {
weprintf ("%d", auction->i);
weprintf ("got unexpected message, ignoring..."); weprintf ("got unexpected message, ignoring...");
return; return;
} }
@ -427,7 +425,6 @@ BRANDT_got_message (struct BRANDT_Auction *auction,
return; return;
} }
gcry_mpi_set_bit (auction->round_progress, sender); gcry_mpi_set_bit (auction->round_progress, sender);
DM(auction->round_progress);
advance_round (auction, atype, outcome); advance_round (auction, atype, outcome);
} }

View File

@ -29,8 +29,7 @@
#include <gnunet/gnunet_util_lib.h> #include <gnunet/gnunet_util_lib.h>
/** Enumeration of all possible status reports for a single bidder */ /** Enumeration of all possible status reports for a single bidder */
enum BRANDT_BidderStatus enum BRANDT_BidderStatus {
{
BRANDT_bidder_won, BRANDT_bidder_won,
}; };
@ -41,8 +40,7 @@ struct BRANDT_Auction;
* An array of this struct is given to the application by the BRANDT_CbResult() * An array of this struct is given to the application by the BRANDT_CbResult()
* callback. One instance represents the status of a single bidder. * callback. One instance represents the status of a single bidder.
*/ */
struct BRANDT_Result struct BRANDT_Result {
{
/** Id of the bidder this instance refers to */ /** Id of the bidder this instance refers to */
uint16_t bidder; uint16_t bidder;

View File

@ -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) uint16_t *len)
{ {
struct BRANDT_Result *ret; struct BRANDT_Result *ret;
@ -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) uint16_t *len)
{ {
struct BRANDT_Result *ret; struct BRANDT_Result *ret;

View File

@ -30,8 +30,7 @@
#include "util.h" #include "util.h"
struct msg struct msg {
{
uint16_t sender; uint16_t sender;
uint16_t receiver; uint16_t receiver;
void *buf; void *buf;
@ -61,7 +60,8 @@ transfer_message (void *arg)
struct msg *m = (struct msg *)arg; struct msg *m = (struct msg *)arg;
struct msg_head *h = (struct msg_head *)m->buf; 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); BRANDT_got_message (ad[m->receiver], m->sender, m->buf, m->buf_len);
free (arg); free (arg);
} }
@ -71,6 +71,7 @@ static uint16_t
cb_start (void *auction_closure) cb_start (void *auction_closure)
{ {
uint16_t *s = (uint16_t *)auction_closure; uint16_t *s = (uint16_t *)auction_closure;
if (!s || bidders != *s) if (!s || bidders != *s)
{ {
weprintf ("start callback called from bidder"); weprintf ("start callback called from bidder");
@ -139,7 +140,8 @@ cb_result (void *auction_closure,
weprintf ("result determined by agent %d: none", *s); weprintf ("result determined by agent %d: none", *s);
for (uint16_t i = 0; i < results_len; i++) 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, *s,
results[i].bidder, results[i].bidder,
results[i].status, results[i].status,