Remove usage of CHECK_NOTNULL
We want to switch to absl logging instead of glog. gtest and ceres are
going there, and we already have absl as a dependency. ABSL doesn't
have CHECK_NOTNULL, and we can move things over in an easier to review
fashion.
Change-Id: Ifd9a11ec34a2357cec43f88dba015db9c28ed2cf
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/aos/util/error_counter.h b/aos/util/error_counter.h
index e08c67e..7837f9e 100644
--- a/aos/util/error_counter.h
+++ b/aos/util/error_counter.h
@@ -51,7 +51,8 @@
static void InitializeStaticFbs(Static *builder) {
CHECK(builder->reserve(kNumErrors));
for (size_t ii = 0; ii < kNumErrors; ++ii) {
- auto element = CHECK_NOTNULL(builder->emplace_back());
+ auto element = builder->emplace_back();
+ CHECK(element != nullptr);
element->set_error(static_cast<Error>(ii));
element->set_count(0);
}
@@ -65,7 +66,7 @@
void InvalidateBuffer() { vector_ = nullptr; }
void IncrementError(Error error) {
- CHECK_NOTNULL(vector_);
+ CHECK(vector_ != nullptr);
DCHECK_LT(static_cast<size_t>(error), vector_->size());
Count *counter = vector_->GetMutableObject(static_cast<size_t>(error));
counter->mutate_count(counter->count() + 1);
@@ -73,7 +74,7 @@
// Sets all the error counts to zero.
void ResetCounts() {
- CHECK_NOTNULL(vector_);
+ CHECK(vector_ != nullptr);
DCHECK_EQ(vector_->size(), kNumErrors) << this << " vector " << vector_;
for (size_t ii = 0; ii < kNumErrors; ++ii) {
vector_->GetMutableObject(ii)->mutate_count(0);