From 56a4c5dc0246aee593dc2b7151f0eb70aebf8134 Mon Sep 17 00:00:00 2001 From: "Daniel M. Weeks" Date: Fri, 22 Jan 2016 14:00:34 -0500 Subject: [PATCH 1/7] git: ignore output binaries --- .gitignore | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.gitignore b/.gitignore index 496a5da..bc510e4 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,20 @@ direwolf.conf *.wav fsk_fast_filter.h +# Binaries +aclients +atest +decode_aprs +direwolf +direwolf.desktop +gen_fff +gen_packets +ll2utm +log2gpx +text2tt +tt2text +ttcalc +utm2ll # Object files *.o From ec35e5825a5a2303fdcada4b9eb14bd7ad52440d Mon Sep 17 00:00:00 2001 From: "Daniel M. Weeks" Date: Fri, 22 Jan 2016 22:15:15 -0500 Subject: [PATCH 2/7] Correct conditional operator precedence --- config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.c b/config.c index cb54011..97865f6 100644 --- a/config.c +++ b/config.c @@ -1233,7 +1233,7 @@ void config_init (char *fname, struct audio_s *p_audio_config, /* Later, we check for valid letters and no more than one letter if + specified. */ for (pc = t; *pc != '\0'; pc++) { - if ( ! isalpha(*pc) && ! *pc == '+') { + if ( ! isalpha(*pc) && ! (*pc == '+')) { text_color_set(DW_COLOR_ERROR); dw_printf ("Line %d: Demodulator type can only contain letters and + character.\n", line); } From 7636df04c9d622c625d044531189ca61e64c5015 Mon Sep 17 00:00:00 2001 From: "Daniel M. Weeks" Date: Fri, 22 Jan 2016 22:33:57 -0500 Subject: [PATCH 3/7] ANSI function declaration --- demod_afsk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demod_afsk.c b/demod_afsk.c index c5d248a..b769e21 100644 --- a/demod_afsk.c +++ b/demod_afsk.c @@ -720,7 +720,7 @@ static void emit_macro (char *name, int size, float *coeff) dw_printf ("\n"); } -int main () +int main (void) { //int n; char fff_profile; From 3a7dea69cbfdcdf5309feb38f50255e5e52e37df Mon Sep 17 00:00:00 2001 From: "Daniel M. Weeks" Date: Fri, 22 Jan 2016 14:11:02 -0500 Subject: [PATCH 4/7] Explicitly include necessary headers --- aclients.c | 1 + dwgpsd.c | 1 + igate.c | 1 + ttcalc.c | 1 + 4 files changed, 4 insertions(+) diff --git a/aclients.c b/aclients.c index a579285..fe5e93c 100644 --- a/aclients.c +++ b/aclients.c @@ -67,6 +67,7 @@ #include #include #include +#include #include #include #include diff --git a/dwgpsd.c b/dwgpsd.c index 5fc97bf..37688ff 100644 --- a/dwgpsd.c +++ b/dwgpsd.c @@ -41,6 +41,7 @@ #include #include #include +#include #if __WIN32__ #error Not for Windows diff --git a/igate.c b/igate.c index 4373857..6a716d1 100644 --- a/igate.c +++ b/igate.c @@ -78,6 +78,7 @@ #include #include #include +#include #include #include #endif diff --git a/ttcalc.c b/ttcalc.c index b122be4..17538e3 100644 --- a/ttcalc.c +++ b/ttcalc.c @@ -57,6 +57,7 @@ #include #include #include +#include #include #include #include From 3a4200d5f9658af972e35f4f8904d720439bafc9 Mon Sep 17 00:00:00 2001 From: "Daniel M. Weeks" Date: Fri, 22 Jan 2016 23:11:44 -0500 Subject: [PATCH 5/7] Fix for Makefile.linux for clang --- Makefile.linux | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.linux b/Makefile.linux index 0949eb7..399ac5a 100644 --- a/Makefile.linux +++ b/Makefile.linux @@ -327,7 +327,7 @@ gen_packets : gen_packets.c ax25_pad.c hdlc_send.c fcs_calc.c gen_tone.c morse.c # Unit test for AFSK demodulator -atest : atest.c fsk_fast_filter.h demod.c demod_afsk.c demod_9600.c \ +atest : atest.c demod.o demod_afsk.o demod_9600.c \ dsp.o hdlc_rec.c hdlc_rec2.o multi_modem.o rrbb.o \ fcs_calc.c ax25_pad.c decode_aprs.c dwgpsnmea.o \ dwgps.o dwgpsd.o serial_port.o telemetry.c latlong.c symbols.c tt_text.c textcolor.c \ @@ -692,7 +692,7 @@ itest : igate.c textcolor.c ax25_pad.c fcs_calc.c textcolor.o misc.a # Unit test for UDP reception with AFSK demodulator -udptest : udp_test.c demod.c dsp.c demod_afsk.c demod_9600.c hdlc_rec.c hdlc_rec2.c multi_modem.c rrbb.c +udptest : udp_test.c demod.o dsp.c demod_afsk.o demod_9600.c hdlc_rec.c hdlc_rec2.c multi_modem.c rrbb.c \ fcs_calc.c ax25_pad.c decode_aprs.c symbols.c textcolor.c misc.a $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) ./udptest @@ -701,7 +701,7 @@ demod.o : tune.h demod_afsk.o : tune.h demod_9600.o : tune.h -testagc : atest.c demod.c dsp.c demod_afsk.c demod_9600.c hdlc_rec.c hdlc_rec2.o multi_modem.o rrbb.o \ +testagc : atest.c demod.o dsp.c demod_afsk.o demod_9600.c hdlc_rec.c hdlc_rec2.o multi_modem.o rrbb.o \ fcs_calc.c ax25_pad.c decode_aprs.c telemetry.c latlong.c symbols.c tune.h textcolor.c misc.a $(CC) $(CFLAGS) -o atest $^ $(LDFLAGS) ./atest 02_Track_2.wav | grep "packets decoded in" > atest.out From 24fe207120a28784977cc39fde69afa6cbb18fee Mon Sep 17 00:00:00 2001 From: "Daniel M. Weeks" Date: Fri, 22 Jan 2016 22:14:22 -0500 Subject: [PATCH 6/7] Correct variable signedness --- audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio.c b/audio.c index d5fcdcd..84aa854 100644 --- a/audio.c +++ b/audio.c @@ -1134,7 +1134,7 @@ int audio_flush (int a) { #if USE_ALSA int k; - char *psound; + unsigned char *psound; int retries = 10; snd_pcm_status_t *status; From fbf4aa0064e4e15d4d5ddedecefb7e20b71e3fc4 Mon Sep 17 00:00:00 2001 From: "Daniel M. Weeks" Date: Fri, 22 Jan 2016 16:26:39 -0500 Subject: [PATCH 7/7] Remove unnecessary/unhelpful casts --- kiss.c | 2 +- kissnet.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kiss.c b/kiss.c index 0007d1f..db68d69 100644 --- a/kiss.c +++ b/kiss.c @@ -685,7 +685,7 @@ void kiss_send_rec_packet (int chan, unsigned char *fbuf, int flen) text_color_set(DW_COLOR_DEBUG); dw_printf ("\n"); dw_printf ("Packet content before adding KISS framing and any escapes:\n"); - hex_dump ((char*)fbuf, flen); + hex_dump (fbuf, flen); } kiss_len = kiss_encapsulate (stemp, flen+1, kiss_buff); diff --git a/kissnet.c b/kissnet.c index 357c582..e377657 100644 --- a/kissnet.c +++ b/kissnet.c @@ -511,7 +511,7 @@ void kissnet_send_rec_packet (int chan, unsigned char *fbuf, int flen) text_color_set(DW_COLOR_DEBUG); dw_printf ("\n"); dw_printf ("Packet content before adding KISS framing and any escapes:\n"); - hex_dump ((char*)fbuf, flen); + hex_dump (fbuf, flen); } kiss_len = kiss_encapsulate (stemp, flen+1, kiss_buff);