From 0a3707cb5b9318bd9aba0dc9188a0b5431e07e4c Mon Sep 17 00:00:00 2001 From: Nate Morrison Date: Tue, 22 Mar 2022 01:51:48 -0700 Subject: [PATCH] Fixed some indenting, fixed an implicit declaration of dw_printf() --- src/direwolf.c | 3 ++- src/fx25_rec.c | 1 + src/fx25_send.c | 1 + src/gen_packets.c | 26 +++++++++++++------------- src/kissutil.c | 6 +++--- src/latlong.c | 5 +++-- src/ll2utm.c | 1 + src/log2gpx.c | 6 +++--- src/utm2ll.c | 1 + src/walk96.c | 6 +++--- 10 files changed, 31 insertions(+), 25 deletions(-) diff --git a/src/direwolf.c b/src/direwolf.c index b9616ef..17982ef 100644 --- a/src/direwolf.c +++ b/src/direwolf.c @@ -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 */ + diff --git a/src/fx25_rec.c b/src/fx25_rec.c index 7887cb9..ba6ebc6 100644 --- a/src/fx25_rec.c +++ b/src/fx25_rec.c @@ -484,3 +484,4 @@ static int my_unstuff (int chan, int subchan, int slice, unsigned char * restric } // my_unstuff // end fx25_rec.c + diff --git a/src/fx25_send.c b/src/fx25_send.c index 0083f95..cd9f51b 100644 --- a/src/fx25_send.c +++ b/src/fx25_send.c @@ -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 + diff --git a/src/gen_packets.c b/src/gen_packets.c index 8097c52..62f628d 100644 --- a/src/gen_packets.c +++ b/src/gen_packets.c @@ -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); } diff --git a/src/kissutil.c b/src/kissutil.c index 9784ccc..1d8e6a7 100644 --- a/src/kissutil.c +++ b/src/kissutil.c @@ -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); diff --git a/src/latlong.c b/src/latlong.c index 4331351..e8ec8ce 100644 --- a/src/latlong.c +++ b/src/latlong.c @@ -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 */ + diff --git a/src/ll2utm.c b/src/ll2utm.c index 2f3a667..722528e 100644 --- a/src/ll2utm.c +++ b/src/ll2utm.c @@ -116,3 +116,4 @@ static void usage (void) dw_printf ("\e[0m\e\n\e[0J\e"); exit (1); } + diff --git a/src/log2gpx.c b/src/log2gpx.c index 1a76ee6..4e2c68a 100644 --- a/src/log2gpx.c +++ b/src/log2gpx.c @@ -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 ("\n"); + printf ("\e[0m\e\n\e[0J\e"); - dw_printf ("\e[0m\e\n\e[0J\e"); exit (0); } diff --git a/src/utm2ll.c b/src/utm2ll.c index 5f4ec74..eb4bc63 100644 --- a/src/utm2ll.c +++ b/src/utm2ll.c @@ -145,3 +145,4 @@ static void usage (void) dw_printf ("\e[0m\e\n\e[0J\e"); exit (1); } + diff --git a/src/walk96.c b/src/walk96.c index 27c170b..430dc3a 100644 --- a/src/walk96.c +++ b/src/walk96.c @@ -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 }