Switch usage of _DEBUG macro to NDEBUG.

http://stackoverflow.com/a/29253284/5237416

BUG=None
R=tommi@webrtc.org
NOPRESUBMIT=true

Review URL: https://codereview.webrtc.org/1429513004

Cr-Commit-Position: refs/heads/master@{#10468}
This commit is contained in:
tfarina
2015-10-30 16:08:48 -07:00
committed by Commit bot
parent 5c3da4b6e9
commit a41ab9326c
30 changed files with 92 additions and 92 deletions

View File

@ -112,12 +112,12 @@ int main(int argc, char* argv[]) {
char version_number[20];
int mode = -1, tmp, nbTest = 0; /*,sss;*/
#ifdef _DEBUG
#if !defined(NDEBUG)
FILE* fy;
double kbps;
size_t totalbits = 0;
int totalsmpls = 0;
#endif /* _DEBUG */
#endif
/* only one structure used for ISAC encoder */
ISAC_MainStruct* ISAC_main_inst;
@ -126,12 +126,12 @@ int main(int argc, char* argv[]) {
BottleNeckModel BN_data;
f_bn = NULL;
#ifdef _DEBUG
#if !defined(NDEBUG)
fy = fopen("bit_rate.dat", "w");
fclose(fy);
fy = fopen("bytes_frames.dat", "w");
fclose(fy);
#endif /* _DEBUG */
#endif
// histfile = fopen("histo.dat", "ab");
// ratefile = fopen("rates.dat", "ab");
@ -589,7 +589,7 @@ int main(int argc, char* argv[]) {
fprintf(stderr, " \rframe = %d", framecnt);
framecnt++;
#ifdef _DEBUG
#if !defined(NDEBUG)
totalsmpls += declen;
totalbits += 8 * stream_len;
@ -598,15 +598,15 @@ int main(int argc, char* argv[]) {
fprintf(fy, "Frame %i = %0.14f\n", framecnt, kbps);
fclose(fy);
#endif /* _DEBUG */
#endif
}
#ifdef _DEBUG
#if !defined(NDEBUG)
printf("\n\ntotal bits = %" PRIuS " bits", totalbits);
printf("\nmeasured average bitrate = %0.3f kbits/s",
(double)totalbits * (FS / 1000) / totalsmpls);
printf("\n");
#endif /* _DEBUG */
#endif
/* Runtime statistics */
runtime = (double)(clock() / (double)CLOCKS_PER_SEC - starttime);

View File

@ -73,10 +73,10 @@ int main(int argc, char* argv[]) {
FILE* plFile;
int32_t sendBN;
#ifdef _DEBUG
#if !defined(NDEBUG)
FILE* fy;
double kbps;
#endif /* _DEBUG */
#endif
size_t totalbits = 0;
int totalsmpls = 0;
@ -103,12 +103,12 @@ int main(int argc, char* argv[]) {
BottleNeckModel BN_data;
#ifdef _DEBUG
#if !defined(NDEBUG)
fy = fopen("bit_rate.dat", "w");
fclose(fy);
fy = fopen("bytes_frames.dat", "w");
fclose(fy);
#endif /* _DEBUG */
#endif
/* Handling wrong input arguments in the command line */
if ((argc < 3) || (argc > 17)) {
@ -885,14 +885,14 @@ int main(int argc, char* argv[]) {
totalsmpls += declen;
totalbits += 8 * stream_len;
#ifdef _DEBUG
#if !defined(NDEBUG)
kbps = ((double)sampFreqKHz * 1000.) / ((double)cur_framesmpls) * 8.0 *
stream_len / 1000.0; // kbits/s
fy = fopen("bit_rate.dat", "a");
fprintf(fy, "Frame %i = %0.14f\n", framecnt, kbps);
fclose(fy);
#endif /* _DEBUG */
#endif
}
printf("\n");
printf("total bits = %" PRIuS " bits\n", totalbits);