Skip to content

Commit

Permalink
Running clang
Browse files Browse the repository at this point in the history
  • Loading branch information
sg777 committed May 31, 2024
1 parent bd7af1c commit 3986e9a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion privatebet/bet.c
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ static void bet_start(int argc, char **argv)
if (id_cansignfor(argv[2], 0, &retval)) {
cJSON *out = update_cmm(argv[2], NULL);
dlg_info("%s", cJSON_Print(out));
}
}
} else {
bet_command_info();
}
Expand Down
1 change: 0 additions & 1 deletion privatebet/dealer.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ int32_t dealer_shuffle_deck(char *id)
dealer_init_deck();
game_id_str = get_str_from_id_key(id, T_GAME_ID_KEY);


for (int32_t i = 0; i < num_of_players; i++) {
cJSON *player_deck =
get_cJSON_from_id_key_vdxfid(player_ids[i], get_key_data_vdxf_id(PLAYER_DECK_KEY, game_id_str));
Expand Down
8 changes: 4 additions & 4 deletions privatebet/deck.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ void blind_deck_d(bits256 *r, int32_t n, struct pair256 *blinder)
void blind_deck_b(bits256 *r, int32_t n, struct pair256 *blinder)
{
char hexstr[65];

dlg_info("Cashier blinding the deck");
for (int32_t i = 0; i < n; i++) {
dlg_info("Dealer card::%s", bits256_str(hexstr,r[i]));
dlg_info("BV::%s", bits256_str(hexstr,blinder[i].priv));
dlg_info("Dealer card::%s", bits256_str(hexstr, r[i]));
dlg_info("BV::%s", bits256_str(hexstr, blinder[i].priv));
r[i] = fmul_donna(blinder[i].priv, r[i]);
dlg_info("Blinded card::%s", bits256_str(hexstr,r[i]));
dlg_info("Blinded card::%s", bits256_str(hexstr, r[i]));
}
}
4 changes: 2 additions & 2 deletions privatebet/game.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ int32_t verus_receive_card(char *table_id, struct privatebet_vars *vars)

if (flag) {
if (vars->round == 0) {
dlg_info("Initiate betting with small blind");
dlg_info("Initiate betting with small blind");
//retval = bet_dcv_small_blind(NULL, vars);
retval = verus_small_blind(table_id, vars);
} else {
Expand Down Expand Up @@ -374,6 +374,6 @@ int32_t verus_small_blind(char *table_id, struct privatebet_vars *vars)

out = append_game_state(table_id, G_ROUND_BETTING, smallBlindInfo);
dlg_info("%s", cJSON_Print(out));

return retval;
}
9 changes: 4 additions & 5 deletions privatebet/player.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ int32_t decode_card(bits256 b_blinded_card, bits256 blinded_value, cJSON *dealer
d_blinded_card = fmul_donna(blinded_value_inv, b_blinded_card);

dlg_info("Dealer blinded card :: %s", bits256_str(str1, d_blinded_card));

for (int32_t i = 0; i < CARDS777_MAXCARDS; i++) {
for (int32_t j = 0; j < CARDS777_MAXCARDS; j++) {
if (strcmp(bits256_str(str1, d_blinded_card),
Expand Down Expand Up @@ -107,7 +107,7 @@ int32_t reveal_card(char *table_id)
dlg_error("BV is missing");
}
dlg_info("%s", cJSON_Print(bv));
if((jint(bv_info, "card_id") == card_id) && (jint(bv_info, "player_id") == player_id))
if ((jint(bv_info, "card_id") == card_id) && (jint(bv_info, "player_id") == player_id))
break;
}

Expand Down Expand Up @@ -165,7 +165,7 @@ int32_t handle_game_state_player(char *table_id)
int32_t game_state, retval = OK;

game_state = get_game_state(table_id);
dlg_info("%s",game_state_str(game_state));
dlg_info("%s", game_state_str(game_state));
switch (game_state) {
case G_REVEAL_CARD:
retval = handle_player_reveal_card(table_id);
Expand Down Expand Up @@ -207,10 +207,9 @@ int32_t handle_verus_player()
}
dlg_info("Player deck shuffling info updated to table");


while (1) {
retval = handle_game_state_player(player_config.table_id);
if(retval)
if (retval)
return retval;
sleep(2);
}
Expand Down

0 comments on commit 3986e9a

Please sign in to comment.