Replace assert() with static_assert() if the condition is evaluatable at

compile time.

The condition of static_assert() is evaluated at compile time which is safer and
more efficient.

Note that static_assert() requires C++11.

The changes were generated by the misc-static-assert ClangTidy check by alexfh@google.com

R=tommi@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/51019004

Cr-Commit-Position: refs/heads/master@{#9231}
This commit is contained in:
André Susano Pinto
2015-05-20 11:11:07 +02:00
parent 5ca688b3da
commit 664cdafb8a
5 changed files with 11 additions and 11 deletions

View File

@ -791,7 +791,7 @@ int AudioProcessingImpl::delay_offset_ms() const {
int AudioProcessingImpl::StartDebugRecording(
const char filename[AudioProcessing::kMaxFilenameSize]) {
CriticalSectionScoped crit_scoped(crit_);
assert(kMaxFilenameSize == FileWrapper::kMaxFileNameSize);
static_assert(kMaxFilenameSize == FileWrapper::kMaxFileNameSize, "");
if (filename == NULL) {
return kNullPointerError;