Index: webrtc/modules/audio_coding/codecs/isac/fix/test/kenny.cc |
diff --git a/webrtc/modules/audio_coding/codecs/isac/fix/test/kenny.cc b/webrtc/modules/audio_coding/codecs/isac/fix/test/kenny.cc |
index c61449a3efcff1e1db55d8f783032426cabe46f4..dbad66abbf4875380907b18da7353ffbba05d6e5 100644 |
--- a/webrtc/modules/audio_coding/codecs/isac/fix/test/kenny.cc |
+++ b/webrtc/modules/audio_coding/codecs/isac/fix/test/kenny.cc |
@@ -124,7 +124,7 @@ int main(int argc, char* argv[]) |
int32_t payloadRate = 0; |
int setControlBWE = 0; |
int readLoss; |
- FILE *plFile = NULL; |
+ FILE* plFile = nullptr; |
char version_number[20]; |
char tmpBit[5] = ".bit"; |
@@ -133,7 +133,7 @@ int main(int argc, char* argv[]) |
int totalsmpls =0; |
int16_t testNum, testCE; |
- FILE *fp_gns = NULL; |
+ FILE* fp_gns = nullptr; |
int gns = 0; |
int cur_delay = 0; |
char gns_file[100]; |
@@ -142,14 +142,14 @@ int main(int argc, char* argv[]) |
int16_t lostFrame; |
float scale = (float)0.7; |
/* only one structure used for ISAC encoder */ |
- ISACFIX_MainStruct *ISAC_main_inst = NULL; |
+ ISACFIX_MainStruct* ISAC_main_inst = nullptr; |
/* For fault test 10, garbage data */ |
FILE *seedfile; |
- unsigned int random_seed = (unsigned int) time(NULL);//1196764538 |
+ unsigned int random_seed = (unsigned int)time(nullptr); // 1196764538 |
BottleNeckModel BN_data; |
- f_bn = NULL; |
+ f_bn = nullptr; |
readLoss = 0; |
packetLossPercent = 0; |
@@ -318,7 +318,7 @@ int main(int argc, char* argv[]) |
} else { |
readLoss = 1; |
plFile = fopen( argv[i+1], "rb" ); |
- if( plFile == NULL ) { |
+ if (plFile == nullptr) { |
printf( "\n couldn't open the frameloss file: %s\n", argv[i+1] ); |
exit( 0 ); |
} |
@@ -330,7 +330,7 @@ int main(int argc, char* argv[]) |
/* Random packetlosses */ |
if (!strcmp ("-rnd", argv[i])) { |
- srand(time(NULL) ); |
+ srand(time(nullptr)); |
printf( "\n Random pattern in lossed packets \n" ); |
} |
@@ -338,7 +338,7 @@ int main(int argc, char* argv[]) |
if (!strcmp ("-G", argv[i])) { |
sscanf(argv[i + 1], "%s", gns_file); |
fp_gns = fopen(gns_file, "rb"); |
- if (fp_gns == NULL) { |
+ if (fp_gns == nullptr) { |
printf("Cannot read file %s.\n", gns_file); |
exit(0); |
} |
@@ -378,7 +378,7 @@ int main(int argc, char* argv[]) |
if (bottleneck == 0 && gns == 0) { |
sscanf(argv[CodingMode+1], "%s", bottleneck_file); |
f_bn = fopen(bottleneck_file, "rb"); |
- if (f_bn == NULL) { |
+ if (f_bn == nullptr) { |
printf("No value provided for BottleNeck and cannot read file %s\n", |
bottleneck_file); |
exit(0); |
@@ -401,7 +401,7 @@ int main(int argc, char* argv[]) |
*/ |
} |
} else { |
- f_bn = NULL; |
+ f_bn = nullptr; |
printf("\nfixed bottleneck rate of %d bits/s\n\n", bottleneck); |
} |
@@ -422,16 +422,16 @@ int main(int argc, char* argv[]) |
outbitsname[h] = tmpBit[k]; |
h++; |
} |
- if ((inp = fopen(inname,"rb")) == NULL) { |
+ if ((inp = fopen(inname, "rb")) == nullptr) { |
printf(" iSAC: Cannot read file %s\n", inname); |
exit(1); |
} |
- if ((outp = fopen(outname,"wb")) == NULL) { |
+ if ((outp = fopen(outname, "wb")) == nullptr) { |
printf(" iSAC: Cannot write file %s\n", outname); |
exit(1); |
} |
- if ((outbits = fopen(outbitsname,"wb")) == NULL) { |
+ if ((outbits = fopen(outbitsname, "wb")) == nullptr) { |
printf(" iSAC: Cannot write file %s\n", outbitsname); |
exit(1); |
} |
@@ -442,7 +442,7 @@ int main(int argc, char* argv[]) |
/* Test to run decoder with garbage data */ |
srand(random_seed); |
- if ( (seedfile = fopen(SEED_FILE, "a+t") ) == NULL ) { |
+ if ((seedfile = fopen(SEED_FILE, "a+t")) == nullptr) { |
printf("Error: Could not open file %s\n", SEED_FILE); |
} |
else { |
@@ -553,7 +553,7 @@ int main(int argc, char* argv[]) |
} |
if (testNum == 7) { |
- srand(time(NULL)); |
+ srand(time(nullptr)); |
} |
/* iSAC encoding */ |
@@ -631,7 +631,7 @@ int main(int argc, char* argv[]) |
cur_framesmpls += FRAMESAMPLES_10ms; |
/* read next bottleneck rate */ |
- if (f_bn != NULL) { |
+ if (f_bn != nullptr) { |
int aux_var; |
if (fscanf(f_bn, "%d", &aux_var) == EOF) { |
/* Set pointer to beginning of file */ |
@@ -663,14 +663,14 @@ int main(int argc, char* argv[]) |
} |
if (testNum == 6) { |
- srand(time(NULL)); |
+ srand(time(nullptr)); |
for (i = 0; i < stream_len; i++ ) { |
streamdata[i] = rand(); |
} |
} |
/* set pointer to beginning of file */ |
- if (fp_gns != NULL) { |
+ if (fp_gns != nullptr) { |
if (fscanf(fp_gns, "%d", &cur_delay) == EOF) { |
fseek(fp_gns, 0L, SEEK_SET); |
if (fscanf(fp_gns, "%d", &cur_delay) == EOF) { |
@@ -793,7 +793,7 @@ int main(int argc, char* argv[]) |
/* Error test number 10, garbage data */ |
if (testNum == 10) { |
- if ( (seedfile = fopen(SEED_FILE, "a+t") ) == NULL ) { |
+ if ((seedfile = fopen(SEED_FILE, "a+t")) == nullptr) { |
printf( "Error: Could not open file %s\n", SEED_FILE); |
} |
else { |