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

Unified Diff: webrtc/modules/audio_coding/test/PCMFile.cc

Issue 2685783014: Replace NULL with nullptr in all C++ files. (Closed)
Patch Set: Fixing android. Created 3 years, 10 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
Index: webrtc/modules/audio_coding/test/PCMFile.cc
diff --git a/webrtc/modules/audio_coding/test/PCMFile.cc b/webrtc/modules/audio_coding/test/PCMFile.cc
index 5d2d8183222820a2e26b87263ac20197b948bc0c..33d523c6997572cd25a10ab0c24630d254591638 100644
--- a/webrtc/modules/audio_coding/test/PCMFile.cc
+++ b/webrtc/modules/audio_coding/test/PCMFile.cc
@@ -22,7 +22,7 @@ namespace webrtc {
#define MAX_FILE_NAME_LENGTH_BYTE 500
PCMFile::PCMFile()
- : pcm_file_(NULL),
+ : pcm_file_(nullptr),
samples_10ms_(160),
frequency_(16000),
end_of_file_(false),
@@ -35,7 +35,7 @@ PCMFile::PCMFile()
}
PCMFile::PCMFile(uint32_t timestamp)
- : pcm_file_(NULL),
+ : pcm_file_(nullptr),
samples_10ms_(160),
frequency_(16000),
end_of_file_(false),
@@ -56,7 +56,7 @@ int16_t PCMFile::ChooseFile(std::string* file_name, int16_t max_len,
uint16_t* frequency_hz) {
char tmp_name[MAX_FILE_NAME_LENGTH_BYTE];
- EXPECT_TRUE(fgets(tmp_name, MAX_FILE_NAME_LENGTH_BYTE, stdin) != NULL);
+ EXPECT_TRUE(fgets(tmp_name, MAX_FILE_NAME_LENGTH_BYTE, stdin) != nullptr);
tmp_name[MAX_FILE_NAME_LENGTH_BYTE - 1] = '\0';
int16_t n = 0;
@@ -90,7 +90,7 @@ int16_t PCMFile::ChooseFile(std::string* file_name, int16_t max_len,
}
printf("Enter the sampling frequency (in Hz) of the above file [%u]: ",
*frequency_hz);
- EXPECT_TRUE(fgets(tmp_name, 10, stdin) != NULL);
+ EXPECT_TRUE(fgets(tmp_name, 10, stdin) != nullptr);
uint16_t tmp_frequency = (uint16_t) atoi(tmp_name);
if (tmp_frequency > 0) {
*frequency_hz = tmp_frequency;
@@ -100,7 +100,7 @@ int16_t PCMFile::ChooseFile(std::string* file_name, int16_t max_len,
void PCMFile::Open(const std::string& file_name, uint16_t frequency,
const char* mode, bool auto_rewind) {
- if ((pcm_file_ = fopen(file_name.c_str(), mode)) == NULL) {
+ if ((pcm_file_ = fopen(file_name.c_str(), mode)) == nullptr) {
printf("Cannot open file %s.\n", file_name.c_str());
ADD_FAILURE() << "Unable to read file";
}
@@ -190,7 +190,7 @@ void PCMFile::Write10MsData(int16_t* playout_buffer, size_t length_smpls) {
void PCMFile::Close() {
fclose(pcm_file_);
- pcm_file_ = NULL;
+ pcm_file_ = nullptr;
blocks_read_ = 0;
}

Powered by Google App Engine
This is Rietveld 408576698