template.c: remove "debug mode"
This commit is contained in:
parent
24dc6a338e
commit
64cfda4a33
@ -52,33 +52,13 @@ const char* dbgpnt_labels[3] = { "memory allocation",
|
||||
(unsigned int)(sizeof(dbgpnt_labels) / sizeof(dbgpnt_labels[0]))
|
||||
|
||||
// global variables
|
||||
bool silent_mode = false, debug_mode = false;
|
||||
bool silent_mode = false;
|
||||
|
||||
// function prototypes
|
||||
void
|
||||
debug_print(void);
|
||||
|
||||
SAMPLE_TYPE
|
||||
bytebeat(long double w);
|
||||
|
||||
// function implementations
|
||||
void
|
||||
debug_print(void)
|
||||
{
|
||||
if (!debug_mode)
|
||||
return;
|
||||
|
||||
int has_label = dbgpnt_counter <= dbgpnt_labels_size;
|
||||
printf("[OK] ");
|
||||
|
||||
if (has_label)
|
||||
printf("%s", dbgpnt_labels[dbgpnt_counter++]);
|
||||
else
|
||||
printf("debug point %d", ++dbgpnt_counter);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
SAMPLE_TYPE
|
||||
bytebeat(long double w)
|
||||
{
|
||||
@ -87,7 +67,7 @@ bytebeat(long double w)
|
||||
`bytebeat_contents`;
|
||||
}
|
||||
|
||||
#define USAGE "render_bytebeat [-s | --silent] [-d | --debug]"
|
||||
#define USAGE "render_bytebeat [-s | --silent]"
|
||||
|
||||
int
|
||||
main(int argc, char** argv)
|
||||
@ -96,7 +76,6 @@ main(int argc, char** argv)
|
||||
ARGH_PARSE {
|
||||
ARGH_NEXT();
|
||||
if ARGH_BOOL("-s", "--silent") { silent_mode = true; }
|
||||
else if ARGH_BOOL("-d", "--debug") { debug_mode = true; }
|
||||
}
|
||||
|
||||
// * log -> welcome
|
||||
@ -139,8 +118,6 @@ main(int argc, char** argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
debug_print();
|
||||
|
||||
// * bytebeat generating loop
|
||||
for (size_t w = 0; w < PRODUCT; w++) {
|
||||
// 1. generate audio data
|
||||
@ -178,7 +155,6 @@ main(int argc, char** argv)
|
||||
}
|
||||
|
||||
printf("%s", ANSI_CLEAR);
|
||||
debug_print();
|
||||
|
||||
// * wave file output
|
||||
// 0. log
|
||||
@ -230,7 +206,6 @@ main(int argc, char** argv)
|
||||
|
||||
// 5. close file
|
||||
fclose(output_file);
|
||||
debug_print();
|
||||
|
||||
// * end of program
|
||||
printf("Done!\n");
|
||||
|
Loading…
Reference in New Issue
Block a user