summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorcostan <costan@google.com>2018-04-10 16:18:06 -0700
committerVictor Costan <pwnall@chromium.org>2018-04-10 16:26:43 -0700
commit09217fd0677a4fd9713c7a4d774c494a7d3c1f15 (patch)
tree7b22f6275e16b1cb5059aa726d59e8c5a357c1d5 /include
parent6a3b915166fce75aaf9ac209114a3ad9caa34171 (diff)
downloadleveldb-09217fd0677a4fd9713c7a4d774c494a7d3c1f15.tar.gz
Replace NULL with nullptr in C++ files.
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=192365747
Diffstat (limited to 'include')
-rw-r--r--include/leveldb/cache.h2
-rw-r--r--include/leveldb/db.h8
-rw-r--r--include/leveldb/env.h12
-rw-r--r--include/leveldb/options.h24
-rw-r--r--include/leveldb/status.h12
-rw-r--r--include/leveldb/table.h2
6 files changed, 30 insertions, 30 deletions
diff --git a/include/leveldb/cache.h b/include/leveldb/cache.h
index 145ad69..e416ea5 100644
--- a/include/leveldb/cache.h
+++ b/include/leveldb/cache.h
@@ -56,7 +56,7 @@ class LEVELDB_EXPORT Cache {
virtual Handle* Insert(const Slice& key, void* value, size_t charge,
void (*deleter)(const Slice& key, void* value)) = 0;
- // If the cache has no mapping for "key", returns NULL.
+ // If the cache has no mapping for "key", returns nullptr.
//
// Else return a handle that corresponds to the mapping. The caller
// must call this->Release(handle) when the returned mapping is no
diff --git a/include/leveldb/db.h b/include/leveldb/db.h
index 092a154..84c32bc 100644
--- a/include/leveldb/db.h
+++ b/include/leveldb/db.h
@@ -47,7 +47,7 @@ class LEVELDB_EXPORT DB {
// Open the database with the specified "name".
// Stores a pointer to a heap-allocated database in *dbptr and returns
// OK on success.
- // Stores NULL in *dbptr and returns a non-OK status on error.
+ // Stores nullptr in *dbptr and returns a non-OK status on error.
// Caller should delete *dbptr when it is no longer needed.
static Status Open(const Options& options,
const std::string& name,
@@ -141,10 +141,10 @@ class LEVELDB_EXPORT DB {
// needed to access the data. This operation should typically only
// be invoked by users who understand the underlying implementation.
//
- // begin==NULL is treated as a key before all keys in the database.
- // end==NULL is treated as a key after all keys in the database.
+ // begin==nullptr is treated as a key before all keys in the database.
+ // end==nullptr is treated as a key after all keys in the database.
// Therefore the following call will compact the entire database:
- // db->CompactRange(NULL, NULL);
+ // db->CompactRange(nullptr, nullptr);
virtual void CompactRange(const Slice* begin, const Slice* end) = 0;
};
diff --git a/include/leveldb/env.h b/include/leveldb/env.h
index 54c9e3b..87dc06e 100644
--- a/include/leveldb/env.h
+++ b/include/leveldb/env.h
@@ -47,7 +47,7 @@ class LEVELDB_EXPORT Env {
// Create a brand new sequentially-readable file with the specified name.
// On success, stores a pointer to the new file in *result and returns OK.
- // On failure stores NULL in *result and returns non-OK. If the file does
+ // On failure stores nullptr in *result and returns non-OK. If the file does
// not exist, returns a non-OK status. Implementations should return a
// NotFound status when the file does not exist.
//
@@ -57,7 +57,7 @@ class LEVELDB_EXPORT Env {
// Create a brand new random access read-only file with the
// specified name. On success, stores a pointer to the new file in
- // *result and returns OK. On failure stores NULL in *result and
+ // *result and returns OK. On failure stores nullptr in *result and
// returns non-OK. If the file does not exist, returns a non-OK
// status. Implementations should return a NotFound status when the file does
// not exist.
@@ -69,7 +69,7 @@ class LEVELDB_EXPORT Env {
// Create an object that writes to a new file with the specified
// name. Deletes any existing file with the same name and creates a
// new file. On success, stores a pointer to the new file in
- // *result and returns OK. On failure stores NULL in *result and
+ // *result and returns OK. On failure stores nullptr in *result and
// returns non-OK.
//
// The returned file will only be accessed by one thread at a time.
@@ -79,7 +79,7 @@ class LEVELDB_EXPORT Env {
// Create an object that either appends to an existing file, or
// writes to a new file (if the file does not exist to begin with).
// On success, stores a pointer to the new file in *result and
- // returns OK. On failure stores NULL in *result and returns
+ // returns OK. On failure stores nullptr in *result and returns
// non-OK.
//
// The returned file will only be accessed by one thread at a time.
@@ -117,7 +117,7 @@ class LEVELDB_EXPORT Env {
const std::string& target) = 0;
// Lock the specified file. Used to prevent concurrent access to
- // the same db by multiple processes. On failure, stores NULL in
+ // the same db by multiple processes. On failure, stores nullptr in
// *lock and returns non-OK.
//
// On success, stores a pointer to the object that represents the
@@ -264,7 +264,7 @@ class LEVELDB_EXPORT FileLock {
virtual ~FileLock();
};
-// Log the specified data to *info_log if info_log is non-NULL.
+// Log the specified data to *info_log if info_log is non-null.
void Log(Logger* info_log, const char* format, ...)
# if defined(__GNUC__) || defined(__clang__)
__attribute__((__format__ (__printf__, 2, 3)))
diff --git a/include/leveldb/options.h b/include/leveldb/options.h
index 1c42921..b6ddbd8 100644
--- a/include/leveldb/options.h
+++ b/include/leveldb/options.h
@@ -63,9 +63,9 @@ struct LEVELDB_EXPORT Options {
Env* env;
// Any internal progress/error information generated by the db will
- // be written to info_log if it is non-NULL, or to a file stored
- // in the same directory as the DB contents if info_log is NULL.
- // Default: NULL
+ // be written to info_log if it is non-null, or to a file stored
+ // in the same directory as the DB contents if info_log is null.
+ // Default: nullptr
Logger* info_log;
// -------------------
@@ -93,9 +93,9 @@ struct LEVELDB_EXPORT Options {
// Control over blocks (user data is stored in a set of blocks, and
// a block is the unit of reading from disk).
- // If non-NULL, use the specified cache for blocks.
- // If NULL, leveldb will automatically create and use an 8MB internal cache.
- // Default: NULL
+ // If non-null, use the specified cache for blocks.
+ // If null, leveldb will automatically create and use an 8MB internal cache.
+ // Default: nullptr
Cache* block_cache;
// Approximate size of user data packed per block. Note that the
@@ -147,11 +147,11 @@ struct LEVELDB_EXPORT Options {
// Default: currently false, but may become true later.
bool reuse_logs;
- // If non-NULL, use the specified filter policy to reduce disk reads.
+ // If non-null, use the specified filter policy to reduce disk reads.
// Many applications will benefit from passing the result of
// NewBloomFilterPolicy() here.
//
- // Default: NULL
+ // Default: nullptr
const FilterPolicy* filter_policy;
// Create an Options object with default values for all fields.
@@ -170,17 +170,17 @@ struct LEVELDB_EXPORT ReadOptions {
// Default: true
bool fill_cache;
- // If "snapshot" is non-NULL, read as of the supplied snapshot
+ // If "snapshot" is non-null, read as of the supplied snapshot
// (which must belong to the DB that is being read and which must
- // not have been released). If "snapshot" is NULL, use an implicit
+ // not have been released). If "snapshot" is null, use an implicit
// snapshot of the state at the beginning of this read operation.
- // Default: NULL
+ // Default: nullptr
const Snapshot* snapshot;
ReadOptions()
: verify_checksums(false),
fill_cache(true),
- snapshot(NULL) {
+ snapshot(nullptr) {
}
};
diff --git a/include/leveldb/status.h b/include/leveldb/status.h
index 42ad4bb..39d692d 100644
--- a/include/leveldb/status.h
+++ b/include/leveldb/status.h
@@ -22,7 +22,7 @@ namespace leveldb {
class LEVELDB_EXPORT Status {
public:
// Create a success status.
- Status() : state_(NULL) { }
+ Status() : state_(nullptr) { }
~Status() { delete[] state_; }
// Copy the specified status.
@@ -50,7 +50,7 @@ class LEVELDB_EXPORT Status {
}
// Returns true iff the status indicates success.
- bool ok() const { return (state_ == NULL); }
+ bool ok() const { return (state_ == nullptr); }
// Returns true iff the status indicates a NotFound error.
bool IsNotFound() const { return code() == kNotFound; }
@@ -72,7 +72,7 @@ class LEVELDB_EXPORT Status {
std::string ToString() const;
private:
- // OK status has a NULL state_. Otherwise, state_ is a new[] array
+ // OK status has a null state_. Otherwise, state_ is a new[] array
// of the following form:
// state_[0..3] == length of message
// state_[4] == code
@@ -89,7 +89,7 @@ class LEVELDB_EXPORT Status {
};
Code code() const {
- return (state_ == NULL) ? kOk : static_cast<Code>(state_[4]);
+ return (state_ == nullptr) ? kOk : static_cast<Code>(state_[4]);
}
Status(Code code, const Slice& msg, const Slice& msg2);
@@ -97,14 +97,14 @@ class LEVELDB_EXPORT Status {
};
inline Status::Status(const Status& s) {
- state_ = (s.state_ == NULL) ? NULL : CopyState(s.state_);
+ state_ = (s.state_ == nullptr) ? nullptr : CopyState(s.state_);
}
inline void Status::operator=(const Status& s) {
// The following condition catches both aliasing (when this == &s),
// and the common case where both s and *this are ok.
if (state_ != s.state_) {
delete[] state_;
- state_ = (s.state_ == NULL) ? NULL : CopyState(s.state_);
+ state_ = (s.state_ == nullptr) ? nullptr : CopyState(s.state_);
}
}
diff --git a/include/leveldb/table.h b/include/leveldb/table.h
index 83078d2..e9f6641 100644
--- a/include/leveldb/table.h
+++ b/include/leveldb/table.h
@@ -31,7 +31,7 @@ class LEVELDB_EXPORT Table {
// If successful, returns ok and sets "*table" to the newly opened
// table. The client should delete "*table" when no longer needed.
// If there was an error while initializing the table, sets "*table"
- // to NULL and returns a non-ok status. Does not take ownership of
+ // to nullptr and returns a non-ok status. Does not take ownership of
// "*source", but the client must ensure that "source" remains live
// for the duration of the returned table's lifetime.
//