Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Unified Diff: webrtc/base/flags.h

Issue 2325623002: webrtc/base: Use RTC_DCHECK() instead of assert() (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/base/firewallsocketserver.cc ('k') | webrtc/base/flags.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/flags.h
diff --git a/webrtc/base/flags.h b/webrtc/base/flags.h
index d16f12bad63a8bc26f52269c084a3371d640adcf..6ca50b5cea2ca80fe779f344fb4d80108c6ec441 100644
--- a/webrtc/base/flags.h
+++ b/webrtc/base/flags.h
@@ -23,8 +23,6 @@
#ifndef WEBRTC_BASE_FLAGS_H__
#define WEBRTC_BASE_FLAGS_H__
-#include <assert.h>
-
#include "webrtc/base/checks.h"
#include "webrtc/base/common.h"
#include "webrtc/base/constructormagic.h"
@@ -88,43 +86,43 @@ class Flag {
// Flag variables
bool* bool_variable() const {
- assert(type_ == BOOL);
+ RTC_DCHECK_EQ(BOOL, type_);
return &variable_->b;
}
int* int_variable() const {
- assert(type_ == INT);
+ RTC_DCHECK_EQ(INT, type_);
return &variable_->i;
}
double* float_variable() const {
- assert(type_ == FLOAT);
+ RTC_DCHECK_EQ(FLOAT, type_);
return &variable_->f;
}
const char** string_variable() const {
- assert(type_ == STRING);
+ RTC_DCHECK_EQ(STRING, type_);
return &variable_->s;
}
// Default values
bool bool_default() const {
- assert(type_ == BOOL);
+ RTC_DCHECK_EQ(BOOL, type_);
return default_.b;
}
int int_default() const {
- assert(type_ == INT);
+ RTC_DCHECK_EQ(INT, type_);
return default_.i;
}
double float_default() const {
- assert(type_ == FLOAT);
+ RTC_DCHECK_EQ(FLOAT, type_);
return default_.f;
}
const char* string_default() const {
- assert(type_ == STRING);
+ RTC_DCHECK_EQ(STRING, type_);
return default_.s;
}
« no previous file with comments | « webrtc/base/firewallsocketserver.cc ('k') | webrtc/base/flags.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698