Skip to content
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.

Commit

Permalink
Prefer true, false keywords to macros of same.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Garzik committed May 4, 2015
1 parent 11a7370 commit 3de4e81
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion lib/addr_match.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ parr *bp_block_match(const struct bp_block *block,

err_out:
BN_clear_free(&tmp_mask);
parr_free(arr, TRUE);
parr_free(arr, true);
return NULL;
}

8 changes: 4 additions & 4 deletions lib/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void bp_locator_free(struct bp_locator *locator)
return;

if (locator->vHave) {
parr_free(locator->vHave, TRUE);
parr_free(locator->vHave, true);
locator->vHave = NULL;
}
}
Expand Down Expand Up @@ -329,7 +329,7 @@ void bp_tx_free_vout(struct bp_tx *tx)
if (!tx || !tx->vout)
return;

parr_free(tx->vout, TRUE);
parr_free(tx->vout, true);
tx->vout = NULL;
}

Expand All @@ -339,7 +339,7 @@ void bp_tx_free(struct bp_tx *tx)
return;

if (tx->vin) {
parr_free(tx->vin, TRUE);
parr_free(tx->vin, true);
tx->vin = NULL;
}

Expand Down Expand Up @@ -508,7 +508,7 @@ void bp_block_vtx_free(struct bp_block *block)
bp_tx_free(tx);
}

parr_free(block->vtx, TRUE);
parr_free(block->vtx, true);

block->vtx = NULL;
}
Expand Down
6 changes: 3 additions & 3 deletions lib/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ cstring *ser_msg_addr(unsigned int protover, const struct msg_addr *ma)
void msg_addr_free(struct msg_addr *ma)
{
if (ma->addrs) {
parr_free(ma->addrs, TRUE);
parr_free(ma->addrs, true);
ma->addrs = NULL;
}
}
Expand Down Expand Up @@ -217,7 +217,7 @@ void msg_headers_free(struct msg_headers *mh)
bp_block_free(block);
}

parr_free(mh->headers, TRUE);
parr_free(mh->headers, true);
mh->headers = NULL;
}
}
Expand Down Expand Up @@ -343,7 +343,7 @@ void msg_vinv_free(struct msg_vinv *mv)
return;

if (mv->invs) {
parr_free(mv->invs, TRUE);
parr_free(mv->invs, true);
mv->invs = NULL;
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/script.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ parr *bsp_parse_all(const void *data_, size_t data_len)
return arr;

err_out:
parr_free(arr, TRUE);
parr_free(arr, true);
return NULL;
}

Expand Down Expand Up @@ -220,7 +220,7 @@ bool bsp_addr_parse(struct bscript_addr *addr,

addr->txtype = txtype;

parr_free(ops, TRUE);
parr_free(ops, true);
return true;
}

Expand Down
6 changes: 3 additions & 3 deletions lib/script_eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -1051,7 +1051,7 @@ static bool bp_script_eval(parr *stack, const cstring *script,

out:
BN_clear_free(&bn);
parr_free(altstack, TRUE);
parr_free(altstack, true);
g_byte_array_unref(vfExec);
return rc;
}
Expand Down Expand Up @@ -1111,11 +1111,11 @@ bool bp_script_verify(const cstring *scriptSig, const cstring *scriptPubKey,
rc = true;

out:
parr_free(stack, TRUE);
parr_free(stack, true);
if (pubkey2)
cstr_free(pubkey2, true);
if (stackCopy)
parr_free(stackCopy, TRUE);
parr_free(stackCopy, true);
return rc;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/serialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ bool deser_u256_array(parr **ao, struct const_buffer *buf)
{
parr *arr = *ao;
if (arr) {
parr_free(arr, TRUE);
parr_free(arr, true);
*ao = arr = NULL;
}

Expand Down Expand Up @@ -262,7 +262,7 @@ bool deser_u256_array(parr **ao, struct const_buffer *buf)
return true;

err_out:
parr_free(arr, TRUE);
parr_free(arr, true);
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/utxo.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ static void bp_utxo_free_vout(struct bp_utxo *coin)
if (!coin || !coin->vout)
return;

parr_free(coin->vout, TRUE);
parr_free(coin->vout, true);
coin->vout = NULL;
}

Expand Down
2 changes: 1 addition & 1 deletion src/blkstats.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ static void scan_txout(struct bp_txout *txout)
}
}

parr_free(script, TRUE);
parr_free(script, true);
}

static void scan_tx(struct bp_tx *tx)
Expand Down
4 changes: 2 additions & 2 deletions src/brd.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ static bool nc_conn_send(struct nc_conn *conn, const char *command,
buf->p = msg->str;
buf->len = msg->len;

cstr_free(msg, FALSE);
cstr_free(msg, false);

/* if write q exists, write_evt will handle output */
if (conn->write_q) {
Expand Down Expand Up @@ -1609,7 +1609,7 @@ static void shutdown_nci(struct net_child_info *nci)
peerman_free(nci->peers);
nc_conns_gc(nci, true);
assert(nci->conns->len == 0);
parr_free(nci->conns, TRUE);
parr_free(nci->conns, true);
event_base_free(nci->eb);
}

Expand Down
2 changes: 1 addition & 1 deletion src/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ static bool nc_conn_send(struct nc_conn *conn, const char *command,
buf->p = msg->str;
buf->len = msg->len;

cstr_free(msg, FALSE);
cstr_free(msg, false);

/* if write q exists, write_evt will handle output */
if (conn->write_q) {
Expand Down
2 changes: 1 addition & 1 deletion src/peerman.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ static unsigned long addr_hash(const void *key)

static bool addr_equal(const void *a, const void *b)
{
return memcmp(a, b, 16) == 0 ? TRUE : FALSE;
return (memcmp(a, b, 16) == 0);
}

bool deser_peer(unsigned int protover,
Expand Down
2 changes: 1 addition & 1 deletion src/wallet.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ static void wallet_free(struct wallet *wlt)
wallet_for_each_key(wlt, key)
bp_key_free(key);

parr_free(wlt->keys, TRUE);
parr_free(wlt->keys, true);
wlt->keys = NULL;

memset(wlt, 0, sizeof(*wlt));
Expand Down
4 changes: 2 additions & 2 deletions test/tx-valid.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,12 @@ static void runtest(bool is_valid, const char *basefn)
cstr_free(tx_ser, true);

if (comments->len > 0) {
parr_free(comments, TRUE);
parr_free(comments, true);
comments = parr_new(8, free);
}
}

parr_free(comments, TRUE);
parr_free(comments, true);
comments = NULL;

bp_hashtab_unref(input_map);
Expand Down
2 changes: 1 addition & 1 deletion test/wallet-basics.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ static void runtest(const char *json_base_fn, const char *ser_in_fn,
g_array_free(mtree, TRUE);
g_array_free(mbranch, TRUE);
BN_clear_free(&tmp_mask);
parr_free(matches, TRUE);
parr_free(matches, true);
bpks_free(&ks);
bp_key_free(&key);
bp_block_free(&block_in);
Expand Down

0 comments on commit 3de4e81

Please sign in to comment.