# HG changeset patch # User Mychaela Falconia # Date 1718410180 0 # Node ID a6db7d8d6df41caa9edf1cf5f2e26053c90809b5 # Parent aa7cc4333d95de1a437bfde92650ef09a9fad5c5 change compile-time quiet control to runtime, and suppress all noisy output diff -r aa7cc4333d95 -r a6db7d8d6df4 Makefile --- a/Makefile Fri Jun 14 23:57:53 2024 +0000 +++ b/Makefile Sat Jun 15 00:09:40 2024 +0000 @@ -1,5 +1,5 @@ CC= gcc -CFLAGS= -O2 -fno-builtin -DSILENT +CFLAGS= -O2 -fno-builtin PROG= gsm_hr OBJS= dtx.o err_conc.o globdefs.o gsm_hr.o homing.o host.o mathdp31.o \ mathhalf.o sp_dec.o sp_enc.o sp_frm.o sp_rom.o sp_sfrm.o vad.o diff -r aa7cc4333d95 -r a6db7d8d6df4 gsm_hr.c --- a/gsm_hr.c Fri Jun 14 23:57:53 2024 +0000 +++ b/gsm_hr.c Sat Jun 15 00:09:40 2024 +0000 @@ -100,6 +100,8 @@ FILE *pfileInFile, *pfileOutFile; + int quiet = 0; + /*_________________________________________________________________________ | | | Executable Code | @@ -163,6 +165,16 @@ option = 0; else if (!strcmp(argv[1], "dec")) option = 1; + else if (!strcmp(argv[1], "enc-q")) + { + option = 0; + quiet = 1; + } + else if (!strcmp(argv[1], "dec-q")) + { + option = 1; + quiet = 1; + } else { printf("error in option selection\n"); @@ -206,6 +218,7 @@ exit(1); } +if (!quiet) { puts("\n\n"); puts(" ****************************************"); puts(" * *"); @@ -241,7 +254,7 @@ printf("input file: %s\n", argv[2]); printf("output file: %s\n\n", argv[3]); - +} switch (option) { @@ -260,9 +273,8 @@ giFrmCnt++) { -#ifndef SILENT - printf("encoding frame %d \r", giFrmCnt); -#endif + if (!quiet) + printf("encoding frame %d \r", giFrmCnt); if (encode(pfileInFile, pfileOutFile)) iDoneFrm = 1; @@ -271,7 +283,8 @@ if (iDoneFrm) giFrmCnt--; - printf(" %d speech frames encoded\n", giFrmCnt - 1); + if (!quiet) + printf(" %d speech frames encoded\n", giFrmCnt - 1); break; case 1: /* decode */ @@ -289,9 +302,8 @@ giFrmCnt++) { -#ifndef SILENT - printf("decoding frame %d \r", giFrmCnt); -#endif + if (!quiet) + printf("decoding frame %d \r", giFrmCnt); if (decode(pfileInFile, pfileOutFile)) iDoneFrm = 1; @@ -300,7 +312,8 @@ if (iDoneFrm) giFrmCnt--; - printf(" %d speech frames decoded\n", giFrmCnt - 1); + if (!quiet) + printf(" %d speech frames decoded\n", giFrmCnt - 1); break; }