mirror of https://github.com/facebook/rocksdb.git
Fix deprecated use of 0/NULL in internal_repo_rocksdb/repo/utilities/transactions/lock/range/range_tree/lib/locktree/wfg.cc + 3
Summary: `nullptr` is typesafe. `0` and `NULL` are not. In the future, only `nullptr` will be allowed. This diff helps us embrace the future _now_ in service of enabling `-Wzero-as-null-pointer-constant`. Reviewed By: meyering Differential Revision: D54163069 fbshipit-source-id: e5bb4b6ee79d82f1437ffed602bdb41dcfc0e59a
This commit is contained in:
parent
2940acac00
commit
a4ff83d1b2
|
@ -91,7 +91,7 @@ void wfg::add_edge(TXNID a_txnid, TXNID b_txnid) {
|
|||
// Return false otherwise.
|
||||
bool wfg::node_exists(TXNID txnid) {
|
||||
node *n = find_node(txnid);
|
||||
return n != NULL;
|
||||
return n != nullptr;
|
||||
}
|
||||
|
||||
bool wfg::cycle_exists_from_node(node *target, node *head,
|
||||
|
|
|
@ -65,7 +65,7 @@ DBT *toku_init_dbt(DBT *dbt) {
|
|||
}
|
||||
|
||||
DBT toku_empty_dbt(void) {
|
||||
static const DBT empty_dbt = {.data = 0, .size = 0, .ulen = 0, .flags = 0};
|
||||
static const DBT empty_dbt = {.data = nullptr, .size = 0, .ulen = 0, .flags = 0};
|
||||
return empty_dbt;
|
||||
}
|
||||
|
||||
|
@ -118,13 +118,13 @@ void toku_sdbt_cleanup(struct simple_dbt *sdbt) {
|
|||
|
||||
const DBT *toku_dbt_positive_infinity(void) {
|
||||
static DBT positive_infinity_dbt = {
|
||||
.data = 0, .size = 0, .ulen = 0, .flags = 0}; // port
|
||||
.data = nullptr, .size = 0, .ulen = 0, .flags = 0}; // port
|
||||
return &positive_infinity_dbt;
|
||||
}
|
||||
|
||||
const DBT *toku_dbt_negative_infinity(void) {
|
||||
static DBT negative_infinity_dbt = {
|
||||
.data = 0, .size = 0, .ulen = 0, .flags = 0}; // port
|
||||
.data = nullptr, .size = 0, .ulen = 0, .flags = 0}; // port
|
||||
return &negative_infinity_dbt;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue