Fixed some indenting, fixed an implicit declaration of dw_printf()

This commit is contained in:
Nate Morrison 2022-03-22 01:51:48 -07:00
parent bc07681df9
commit 0a3707cb5b
10 changed files with 31 additions and 25 deletions

View File

@ -1524,7 +1524,7 @@ static void usage (char **argv)
/* I don't know if win32 supports ANSI colour sequences. */
#else
// TODO: Could vary by platform and build options.
//dw_printf ("Complete documentation can be found in /usr/local/share/doc/direwolf\n");
dw_printf ("Complete documentation can be found in /usr/local/share/doc/direwolf\n");
//dw_printf ("\e[0m\e\n\e[0J\e"); /* This appears to break the last bit of colour, so it is commented out. */
#endif
dw_printf ("or online at https://github.com/wb2osz/direwolf/tree/master/doc\n");
@ -1535,3 +1535,4 @@ static void usage (char **argv)
/* end direwolf.c */

View File

@ -484,3 +484,4 @@ static int my_unstuff (int chan, int subchan, int slice, unsigned char * restric
} // my_unstuff
// end fx25_rec.c

View File

@ -335,3 +335,4 @@ static int stuff_it (unsigned char *in, int ilen, unsigned char *out, int osize)
} // end stuff_it
// end fx25_send.c

View File

@ -252,7 +252,7 @@ int main(int argc, char **argv)
if (modem.achan[0].baud < MIN_BAUD || modem.achan[0].baud > MAX_BAUD) {
text_color_set(DW_COLOR_ERROR);
dw_printf ("Use a more reasonable bit rate in range of %d - %d.\n", MIN_BAUD, MAX_BAUD);
dw_printf ("\e[0m\e\n\e[0J\e");
dw_printf ("\e[0m\e\n\e[0J\e");
exit (EXIT_FAILURE);
}
break;
@ -273,7 +273,7 @@ int main(int argc, char **argv)
if (modem.achan[0].baud != 100 && (modem.achan[0].baud < MIN_BAUD || modem.achan[0].baud > MAX_BAUD)) {
text_color_set(DW_COLOR_ERROR);
dw_printf ("Use a more reasonable bit rate in range of %d - %d.\n", MIN_BAUD, MAX_BAUD);
dw_printf ("\e[0m\e\n\e[0J\e");
dw_printf ("\e[0m\e\n\e[0J\e");
exit (EXIT_FAILURE);
}
@ -345,7 +345,7 @@ int main(int argc, char **argv)
if (modem.achan[0].mark_freq < 300 || modem.achan[0].mark_freq > 3000) {
text_color_set(DW_COLOR_ERROR);
dw_printf ("Use a more reasonable value in range of 300 - 3000.\n");
dw_printf ("\e[0m\e\n\e[0J\e");
dw_printf ("\e[0m\e\n\e[0J\e");
exit (EXIT_FAILURE);
}
break;
@ -358,7 +358,7 @@ int main(int argc, char **argv)
if (modem.achan[0].space_freq < 300 || modem.achan[0].space_freq > 3000) {
text_color_set(DW_COLOR_ERROR);
dw_printf ("Use a more reasonable value in range of 300 - 3000.\n");
dw_printf ("\e[0m\e\n\e[0J\e");
dw_printf ("\e[0m\e\n\e[0J\e");
exit (EXIT_FAILURE);
}
break;
@ -383,7 +383,7 @@ int main(int argc, char **argv)
if (amplitude < 0 || amplitude > 200) {
text_color_set(DW_COLOR_ERROR);
dw_printf ("Amplitude must be in range of 0 to 200.\n");
dw_printf ("\e[0m\e\n\e[0J\e");
dw_printf ("\e[0m\e\n\e[0J\e");
exit (EXIT_FAILURE);
}
break;
@ -397,7 +397,7 @@ int main(int argc, char **argv)
text_color_set(DW_COLOR_ERROR);
dw_printf ("Use a more reasonable audio sample rate in range of %d - %d.\n",
MIN_SAMPLES_PER_SEC, MAX_SAMPLES_PER_SEC);
dw_printf ("\e[0m\e\n\e[0J\e");
dw_printf ("\e[0m\e\n\e[0J\e");
exit (EXIT_FAILURE);
}
break;
@ -416,7 +416,7 @@ int main(int argc, char **argv)
if (leading_zeros < 8 || leading_zeros > 12000) {
text_color_set(DW_COLOR_ERROR);
dw_printf ("Use a more reasonable value.\n");
dw_printf ("\e[0m\e\n\e[0J\e");
dw_printf ("\e[0m\e\n\e[0J\e");
exit (EXIT_FAILURE);
}
break;
@ -454,7 +454,7 @@ int main(int argc, char **argv)
if (g_morse_wpm < 5 || g_morse_wpm > 50) {
text_color_set(DW_COLOR_ERROR);
dw_printf ("Morse code speed must be in range of 5 to 50 WPM.\n");
dw_printf ("\e[0m\e\n\e[0J\e");
dw_printf ("\e[0m\e\n\e[0J\e");
exit (EXIT_FAILURE);
}
break;
@ -512,7 +512,7 @@ int main(int argc, char **argv)
text_color_set(DW_COLOR_ERROR);
dw_printf ("ERROR: Either -j or -J must be specified when using 2400 bps QPSK.\n");
usage (argv);
dw_printf ("\e[0m\e\n\e[0J\e");
dw_printf ("\e[0m\e\n\e[0J\e");
exit (1);
}
@ -524,7 +524,7 @@ int main(int argc, char **argv)
text_color_set(DW_COLOR_ERROR);
dw_printf ("ERROR: The -o output file option must be specified.\n");
usage (argv);
dw_printf ("\e[0m\e\n\e[0J\e");
dw_printf ("\e[0m\e\n\e[0J\e");
exit (1);
}
@ -534,7 +534,7 @@ int main(int argc, char **argv)
if (err < 0) {
text_color_set(DW_COLOR_ERROR);
dw_printf ("ERROR - Can't open output file.\n");
dw_printf ("\e[0m\e\n\e[0J\e");
dw_printf ("\e[0m\e\n\e[0J\e");
exit (1);
}
@ -582,7 +582,7 @@ int main(int argc, char **argv)
if (input_fp == NULL) {
text_color_set(DW_COLOR_ERROR);
dw_printf ("Can't open %s for read.\n", argv[optind]);
dw_printf ("\e[0m\e\n\e[0J\e");
dw_printf ("\e[0m\e\n\e[0J\e");
exit (EXIT_FAILURE);
}
text_color_set(DW_COLOR_INFO);
@ -718,7 +718,7 @@ static void usage (char **argv)
dw_printf ("\n");
dw_printf (" Read message from stdin and put quarter volume sound into the file x.wav.\n");
dw_printf ("\e[0m\e\n\e[0J\e");
dw_printf ("\e[0m\e\n\e[0J\e");
exit (EXIT_FAILURE);
}

View File

@ -269,14 +269,14 @@ int main (int argc, char *argv[])
if ( ! S_ISDIR(s.st_mode)) {
text_color_set(DW_COLOR_ERROR);
dw_printf ("Receive queue location, %s, is not a directory.\n", receive_output);
dw_printf ("\e[0m\e\n\e[0J\e");
dw_printf ("\e[0m\e\n\e[0J\e");
exit (EXIT_FAILURE);
}
}
else {
text_color_set(DW_COLOR_ERROR);
dw_printf ("Receive queue location, %s, does not exist.\n", receive_output);
dw_printf ("\e[0m\e\n\e[0J\e");
dw_printf ("\e[0m\e\n\e[0J\e");
exit (EXIT_FAILURE);
}
}
@ -366,7 +366,7 @@ int main (int argc, char *argv[])
else {
text_color_set(DW_COLOR_ERROR);
dw_printf("Can't access transmit queue directory %s. Quitting.\n", transmit_from);
dw_printf ("\e[0m\e\n\e[0J\e");
dw_printf ("\e[0m\e\n\e[0J\e");
exit (EXIT_FAILURE);
}
SLEEP_SEC (1);

View File

@ -1032,12 +1032,12 @@ int main (int argc, char *argv[])
if (errors > 0) {
text_color_set (DW_COLOR_ERROR);
dw_printf ("\nLocation Coordinate Conversion Test - FAILED!\n");
dw_printf ("\e[0m\e\n\e[0J\e");
dw_printf ("\e[0m\e\n\e[0J\e");
exit (EXIT_FAILURE);
}
text_color_set (DW_COLOR_REC);
dw_printf ("\nLocation Coordinate Conversion Test - SUCCESS!\n");
dw_printf ("\e[0m\e\n\e[0J\e");
dw_printf ("\e[0m\e\n\e[0J\e");
exit (EXIT_SUCCESS);
}
@ -1048,3 +1048,4 @@ int main (int argc, char *argv[])
/* end latlong.c */

View File

@ -116,3 +116,4 @@ static void usage (void)
dw_printf ("\e[0m\e\n\e[0J\e");
exit (1);
}

View File

@ -94,7 +94,7 @@ int main (int argc, char *argv[])
}
else {
fprintf (stderr, "Can't open %s for read.\n", argv[n]);
dw_printf ("\e[0m\e\n\e[0J\e");
printf ("\e[0m\e\n\e[0J\e");
exit (1);
}
}
@ -103,7 +103,7 @@ int main (int argc, char *argv[])
if (num_things == 0) {
fprintf (stderr, "Nothing to process.\n");
dw_printf ("\e[0m\e\n\e[0J\e");
printf ("\e[0m\e\n\e[0J\e");
exit (1);
}
@ -147,8 +147,8 @@ int main (int argc, char *argv[])
* GPX file tail.
*/
printf ("</gpx>\n");
printf ("\e[0m\e\n\e[0J\e");
dw_printf ("\e[0m\e\n\e[0J\e");
exit (0);
}

View File

@ -145,3 +145,4 @@ static void usage (void)
dw_printf ("\e[0m\e\n\e[0J\e");
exit (1);
}

View File

@ -76,7 +76,7 @@ int main (int argc, char *argv[])
if (tnc == MYFDERROR) {
text_color_set (DW_COLOR_ERROR);
dw_printf ("Can't open serial port to KISS TNC.\n");
dw_printf ("\e[0m\e\n\e[0J\e");
dw_printf ("\e[0m\e\n\e[0J\e");
exit (EXIT_FAILURE); // defined in stdlib.h
}
@ -106,7 +106,7 @@ int main (int argc, char *argv[])
else if (fix < 0) {
text_color_set (DW_COLOR_ERROR);
dw_printf ("Can't communicate with GPS receiver.\n");
dw_printf ("\e[0m\e\n\e[0J\e");
dw_printf ("\e[0m\e\n\e[0J\e");
exit (EXIT_FAILURE);
}
else {
@ -180,7 +180,7 @@ static void walk96 (int fix, double lat, double lon, float knots, float course,
if (pp == NULL) {
text_color_set (DW_COLOR_ERROR);
dw_printf ("Unexpected error in ax25_from_text. Quitting.\n");
dw_printf ("\e[0m\e\n\e[0J\e");
dw_printf ("\e[0m\e\n\e[0J\e");
exit (EXIT_FAILURE); // defined in stdlib.h
}