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

Unified Diff: webrtc/modules/audio_coding/neteq/test/RTPjitter.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/neteq/test/RTPjitter.cc
diff --git a/webrtc/modules/audio_coding/neteq/test/RTPjitter.cc b/webrtc/modules/audio_coding/neteq/test/RTPjitter.cc
index 391f051f30c15a4b7fbfa8002343ad4ff6c1079f..fdbdfcb4b2ccacbf25a043895cd9b6583d13dce9 100644
--- a/webrtc/modules/audio_coding/neteq/test/RTPjitter.cc
+++ b/webrtc/modules/audio_coding/neteq/test/RTPjitter.cc
@@ -33,9 +33,12 @@
/*********************/
#define FIRSTLINELEN 40
-#define CHECK_NOT_NULL(a) if((a)==NULL){ \
- fprintf(stderr,"\n %s \n line: %d \nerror at %s\n",__FILE__,__LINE__,#a ); \
- return(-1);}
+#define CHECK_NOT_NULL(a) \
+ if ((a) == nullptr) { \
+ fprintf(stderr, "\n %s \n line: %d \nerror at %s\n", __FILE__, __LINE__, \
+ #a); \
+ return (-1); \
+ }
struct arr_time {
float time;
@@ -66,9 +69,9 @@ int main(int argc, char* argv[])
unsigned int dat_len, rtp_len, Npack, k;
arr_time *time_vec;
char firstline[FIRSTLINELEN];
- unsigned char* rtp_vec = NULL;
- unsigned char** packet_ptr = NULL;
- unsigned char* temp_packet = NULL;
+ unsigned char* rtp_vec = nullptr;
+ unsigned char** packet_ptr = nullptr;
+ unsigned char* temp_packet = nullptr;
const unsigned int kRtpDumpHeaderSize = 4 + 4 + 4 + 2 + 2;
uint16_t len;
uint32_t *offset;
@@ -110,7 +113,7 @@ int main(int argc, char* argv[])
// add 1000 bytes to avoid (rare) strange error.
time_vec = (arr_time *) malloc(sizeof(arr_time)
*(filelen(dat_file)/sizeof(float)) + 1000);
- if (time_vec==NULL) {
+ if (time_vec == nullptr) {
fprintf(stderr, "Error: could not allocate memory for reading dat file\n");
goto closing;
}
@@ -130,13 +133,13 @@ int main(int argc, char* argv[])
rtp_vec = (unsigned char *) malloc(sizeof(unsigned char)*filelen(in_file));
- if (rtp_vec==NULL) {
+ if (rtp_vec == nullptr) {
fprintf(stderr,"Error: could not allocate memory for reading rtp file\n");
goto closing;
}
// read file header and write directly to output file
- EXPECT_TRUE(fgets(firstline, FIRSTLINELEN, in_file) != NULL);
+ EXPECT_TRUE(fgets(firstline, FIRSTLINELEN, in_file) != nullptr);
EXPECT_GT(fputs(firstline, out_file), 0);
EXPECT_EQ(kRtpDumpHeaderSize, fread(firstline, 1, kRtpDumpHeaderSize,
in_file));
@@ -206,7 +209,7 @@ int main(int argc, char* argv[])
closing:
free(time_vec);
free(rtp_vec);
- if (packet_ptr != NULL) {
+ if (packet_ptr != nullptr) {
free(packet_ptr);
}
fclose(in_file);

Powered by Google App Engine
This is Rietveld 408576698