From 435b896e5c11d160c5c80af1d9de0c338c2490b6 Mon Sep 17 00:00:00 2001 From: c vw Date: Tue, 17 Dec 2019 16:07:55 +0100 Subject: [PATCH] Corrections suggested by "cppcheck" --- Makefile | 41 ++++++++++++----- Makefile.mac | 36 +++++++++------ about_menu.c | 1 - agc_menu.c | 3 -- audio.c | 8 ++-- audio_waterfall.c | 2 +- band.c | 2 - band_menu.c | 2 - bandstack_menu.c | 1 - configure.c | 2 +- cw_menu.c | 2 - discovery.c | 1 - display_menu.c | 2 - diversity_menu.c | 1 - dsp_menu.c | 2 - encoder_menu.c | 1 - equalizer_menu.c | 1 - error_handler.c | 2 +- exit_menu.c | 4 +- filter_menu.c | 1 - gpio.c | 5 --- main.c | 8 ++-- meter.c | 2 - midi2.c | 16 +++---- mode_menu.c | 2 - new_menu.c | 2 +- new_protocol.c | 109 ++++++++++++++++++++++------------------------ noise_menu.c | 3 -- old_protocol.c | 36 ++++++++------- ozyio.c | 10 ++--- portaudio.c | 6 +-- property.c | 1 - ps_menu.c | 1 - radio.c | 4 -- receiver.c | 14 ++---- rigctl.c | 38 ++++------------ rigctl_menu.c | 2 - rx_panadapter.c | 6 --- sliders.c | 24 +++++----- store.c | 31 ++++++------- store_menu.c | 1 - switch_menu.c | 3 +- toolbar.c | 2 +- transmitter.c | 7 +-- tx_menu.c | 1 - tx_panadapter.c | 14 ++---- update.c | 4 +- vfo.c | 4 +- vox_menu.c | 4 -- xvtr_menu.c | 7 ++- 50 files changed, 202 insertions(+), 280 deletions(-) diff --git a/Makefile b/Makefile index 3b32b0f..a52f6fc 100644 --- a/Makefile +++ b/Makefile @@ -41,9 +41,6 @@ PURESIGNAL_INCLUDE=PURESIGNAL # uncomment the line below to include support for STEMlab discovery (WITHOUT AVAHI) #STEMLAB_DISCOVERY=STEMLAB_DISCOVERY_NOAVAHI -# uncomment the line below to include support for Pi SDR -#PI_SDR_INCLUDE=PI_SDR - # uncomment the line below to include MIDI support MIDI_INCLUDE=MIDI @@ -210,26 +207,22 @@ STEMLAB_HEADERS=stemlab_discovery.h STEMLAB_OBJS=stemlab_discovery.o endif -ifeq ($(PI_SDR_INCLUDE),PI_SDR) -PI_SDR_OPTIONS=-D PI_SDR -endif - GTKINCLUDES=`pkg-config --cflags gtk+-3.0` GTKLIBS=`pkg-config --libs gtk+-3.0` AUDIO_LIBS=-lasound #AUDIO_LIBS=-lsoundio -OPTIONS=-g -Wno-deprecated-declarations $(MIDI_OPTIONS) $(PURESIGNAL_OPTIONS) $(REMOTE_OPTIONS) $(USBOZY_OPTIONS) \ +CFLAGS= -g -Wno-deprecated-declarations -O3 +OPTIONS=$(MIDI_OPTIONS) $(PURESIGNAL_OPTIONS) $(REMOTE_OPTIONS) $(USBOZY_OPTIONS) \ $(I2C_OPTIONS) $(GPIO_OPTIONS) $(SOAPYSDR_OPTIONS) $(FREEDV_OPTIONS) $(LOCALCW_OPTIONS) $(RADIOBERRY_OPTIONS) \ - $(PI_SDR_OPTIONS) $(PSK_OPTIONS) $(STEMLAB_OPTIONS) \ - $(CONTROLLER2_OPTIONS) \ - -D GIT_DATE='"$(GIT_DATE)"' -D GIT_VERSION='"$(GIT_VERSION)"' $(DEBUG_OPTION) -O3 + $(PSK_OPTIONS) $(STEMLAB_OPTIONS) $(CONTROLLER2_OPTIONS) \ + -D GIT_DATE='"$(GIT_DATE)"' -D GIT_VERSION='"$(GIT_VERSION)"' $(DEBUG_OPTION) LIBS=-lrt -lm -lwdsp -lpthread $(AUDIO_LIBS) $(USBOZY_LIBS) $(PSKLIBS) $(GTKLIBS) $(GPIO_LIBS) $(I2C_LIBS) $(SOAPYSDRLIBS) $(FREEDVLIBS) $(STEMLAB_LIBS) $(MIDI_LIBS) INCLUDES=$(GTKINCLUDES) -COMPILE=$(CC) $(OPTIONS) $(INCLUDES) +COMPILE=$(CC) $(CFLAGS) $(OPTIONS) $(INCLUDES) .c.o: $(COMPILE) -c -o $@ $< @@ -450,39 +443,63 @@ $(PROGRAM): $(OBJS) $(REMOTE_OBJS) $(USBOZY_OBJS) $(SOAPYSDR_OBJS) $(FREEDV_OBJ $(SOAPYSDR_OBJS) $(FREEDV_OBJS) $(LOCALCW_OBJS) $(PSK_OBJS) $(PURESIGNAL_OBJS) \ $(MIDI_OBJS) $(STEMLAB_OBJS) $(LIBS) +.PHONY: all all: prebuild $(PROGRAM) $(HEADERS) $(REMOTE_HEADERS) $(USBOZY_HEADERS) $(SOAPYSDR_HEADERS) \ $(FREEDV_HEADERS) $(LOCALCW_HEADERS) $(I2C_HEADERS) $(GPIO_HEADERS) $(PSK_HEADERS) \ $(PURESIGNAL_HEADERS) $(MIDI_HEADERS) $(STEMLAB_HEADERS) $(SOURCES) $(REMOTE_SOURCES) \ $(USBOZY_SOURCES) $(SOAPYSDR_SOURCES) $(FREEDV_SOURCES) $(I2C_SOURCES) $(GPIO_SOURCES) \ $(PSK_SOURCES) $(PURESIGNAL_SOURCES) $(MIDI_SOURCES)$(STEMLAB_SOURCES) +.PHONY: prebuild prebuild: rm -f version.o +# +# On some platforms, INCLUDES contains "-pthread" (from a pkg-config output) +# which is not a valid cppcheck option +# Therefore, correct this here. Furthermore, we can add additional options to CPP +# in the variable CPPOPTIONS +# +CPPOPTIONS= --enable=all --suppress=shadowVariable --suppress=variableScope +CPPINCLUDES:=$(shell echo $(INCLUDES) | sed -e "s/-pthread / /" ) + +.PHONY: cppcheck +cppcheck: + cppcheck $(CPPOPTIONS) $(OPTIONS) $(CPPINCLUDES) $(SOURCES) $(REMOTE_SOURCES) \ + $(USBOZY_SOURCES) $(SOAPYSDR_SOURCES) $(FREEDV_SOURCES) $(I2C_SOURCES) $(GPIO_SOURCES) \ + $(PSK_SOURCES) $(PURESIGNAL_SOURCES) $(MIDI_SOURCES)$(STEMLAB_SOURCES) + +.PHONY: clean clean: -rm -f *.o -rm -f $(PROGRAM) hpsdrsim +.PHONY: install install: $(PROGRAM) cp $(PROGRAM) /usr/local/bin +.PHONY: release release: $(PROGRAM) cp $(PROGRAM) release/pihpsdr cd release; tar cvf pihpsdr.tar pihpsdr cd release; tar cvf pihpsdr-$(GIT_VERSION).tar pihpsdr +.PHONY: nocontroller nocontroller: clean controller1 $(PROGRAM) cp $(PROGRAM) release/pihpsdr cd release; tar cvf pihpsdr-nocontroller.$(GIT_VERSION).tar pihpsdr +.PHONY: controller1 controller1: clean $(PROGRAM) cp $(PROGRAM) release/pihpsdr cd release; tar cvf pihpsdr-controller1.$(GIT_VERSION).tar pihpsdr +.PHONY: controller2v1 controller2v1: clean $(PROGRAM) cp $(PROGRAM) release/pihpsdr cd release; tar cvf pihpsdr-controller2-v1.$(GIT_VERSION).tar pihpsdr +.PHONY: controller2v2 controller2v2: clean $(PROGRAM) cp $(PROGRAM) release/pihpsdr cd release; tar cvf pihpsdr-controller2-v2.$(GIT_VERSION).tar pihpsdr diff --git a/Makefile.mac b/Makefile.mac index 5dba29c..8b27c9c 100644 --- a/Makefile.mac +++ b/Makefile.mac @@ -41,9 +41,6 @@ LOCALCW_INCLUDE=LOCALCW # uncomment the line below to include support for STEMlab discovery (WITHOUT AVAHI) STEMLAB_DISCOVERY=STEMLAB_DISCOVERY_NOAVAHI -# uncomment the line below to include support for Pi SDR -#PI_SDR_INCLUDE=PI_SDR - # uncomment the line below to include MIDI support MIDI_INCLUDE=MIDI @@ -209,27 +206,23 @@ STEMLAB_HEADERS=stemlab_discovery.h STEMLAB_OBJS=stemlab_discovery.o endif -ifeq ($(PI_SDR_INCLUDE),PI_SDR) -PI_SDR_OPTIONS=-D PI_SDR -endif - GTKINCLUDES=`pkg-config --cflags gtk+-3.0` GTKLIBS=`pkg-config --libs gtk+-3.0` AUDIO_OPTIONS=-DPORTAUDIO -AUDIO_LIBS=-lportaudio +AUDIO_LIBS=-lportaudio -O3 -OPTIONS=-g -Wno-deprecated-declarations $(MIDI_OPTIONS) $(PURESIGNAL_OPTIONS) $(REMOTE_OPTIONS) $(USBOZY_OPTIONS) \ +CFLAGS= -g -Wno-deprecated-declarations +OPTIONS=$(MIDI_OPTIONS) $(PURESIGNAL_OPTIONS) $(REMOTE_OPTIONS) $(USBOZY_OPTIONS) \ $(I2C_OPTIONS) $(GPIO_OPTIONS) $(SOAPYSDR_OPTIONS) $(FREEDV_OPTIONS) $(LOCALCW_OPTIONS) $(RADIOBERRY_OPTIONS) \ - $(PI_SDR_OPTIONS) $(PSK_OPTIONS) $(STEMLAB_OPTIONS) \ - $(CONTROLLER2_OPTIONS) \ - $(AUDIO_OPTIONS) \ - -D GIT_DATE='"$(GIT_DATE)"' -D GIT_VERSION='"$(GIT_VERSION)"' $(DEBUG_OPTION) -O3 + $(PSK_OPTIONS) $(STEMLAB_OPTIONS) \ + $(CONTROLLER2_OPTIONS) $(AUDIO_OPTIONS) \ + -D GIT_DATE='"$(GIT_DATE)"' -D GIT_VERSION='"$(GIT_VERSION)"' $(DEBUG_OPTION) LIBS= -lm -lwdsp -lpthread $(AUDIO_LIBS) $(USBOZY_LIBS) $(PSKLIBS) $(GTKLIBS) $(GPIO_LIBS) $(SOAPYSDRLIBS) $(FREEDVLIBS) $(STEMLAB_LIBS) $(MIDI_LIBS) INCLUDES=$(GTKINCLUDES) -COMPILE=$(CC) $(OPTIONS) $(INCLUDES) +COMPILE=$(CC) $(CFLAGS) $(OPTIONS) $(INCLUDES) .c.o: $(COMPILE) -c -o $@ $< @@ -461,6 +454,21 @@ all: prebuild $(PROGRAM) $(HEADERS) $(REMOTE_HEADERS) $(USBOZY_HEADERS) $(SOAPY prebuild: rm -f version.o +# +# On some platforms, INCLUDES contains "-pthread" (from a pkg-config output) +# which is not a valid cppcheck option +# Therefore, correct this here. Furthermore, we can add additional options to CPP +# in the variable CPPOPTIONS +# +CPPOPTIONS= --enable=all --suppress=shadowVariable --suppress=variableScope -q +CPPINCLUDES:=$(shell echo $(INCLUDES) | sed -e "s/-pthread / /" ) + +.PHONY: cppcheck +cppcheck: + cppcheck $(CPPOPTIONS) $(OPTIONS) $(CPPINCLUDES) $(SOURCES) $(REMOTE_SOURCES) \ + $(USBOZY_SOURCES) $(SOAPYSDR_SOURCES) $(FREEDV_SOURCES) $(I2C_SOURCES) $(GPIO_SOURCES) \ + $(PSK_SOURCES) $(PURESIGNAL_SOURCES) $(MIDI_SOURCES)$(STEMLAB_SOURCES) + clean: -rm -f *.o -rm -f $(PROGRAM) hpsdrsim diff --git a/about_menu.c b/about_menu.c index 441e44a..8c4e9ee 100644 --- a/about_menu.c +++ b/about_menu.c @@ -56,7 +56,6 @@ static gboolean delete_event(GtkWidget *widget, GdkEvent *event, gpointer user_d } void about_menu(GtkWidget *parent) { - int i; char text[2048]; char line[128]; char addr[64]; diff --git a/agc_menu.c b/agc_menu.c index e669461..fd807ac 100644 --- a/agc_menu.c +++ b/agc_menu.c @@ -64,9 +64,6 @@ static void agc_select_cb (GtkToggleButton *widget, gpointer data) { } void agc_menu(GtkWidget *parent) { - GtkWidget *b; - int i; - BAND *band; parent_window=parent; diff --git a/audio.c b/audio.c index 3ea1be7..50ab759 100644 --- a/audio.c +++ b/audio.c @@ -625,7 +625,7 @@ g_print("audio_get_cards\n"); strcpy(input_devices[n_input_devices].name,device_id); input_devices[n_input_devices].description=g_new0(char,strlen(device_id)+1); strcpy(input_devices[n_input_devices].description,device_id); - input_devices[n_input_devices].index=i; + input_devices[n_input_devices].index=0; // not used n_input_devices++; g_print("input_device: %s\n",device_id); } @@ -642,7 +642,7 @@ g_print("input_device: %s\n",device_id); strcpy(output_devices[n_output_devices].name,device_id); output_devices[n_output_devices].description=g_new0(char,strlen(device_id)+1); strcpy(output_devices[n_output_devices].description,device_id); - input_devices[n_output_devices].index=i; + input_devices[n_output_devices].index=0; // not used n_output_devices++; g_print("output_device: %s\n",device_id); } @@ -676,7 +676,7 @@ g_print("output_device: %s\n",device_id); i++; } output_devices[n_output_devices].description[i]='\0'; - input_devices[n_output_devices].index=i; + input_devices[n_output_devices].index=0; // not used n_output_devices++; g_print("output_device: name=%s descr=%s\n",name,descr); //} @@ -694,7 +694,7 @@ g_print("output_device: name=%s descr=%s\n",name,descr); i++; } input_devices[n_input_devices].description[i]='\0'; - input_devices[n_input_devices].index=i; + input_devices[n_input_devices].index=0; // not used n_input_devices++; g_print("input_device: name=%s descr=%s\n",name,descr); //} diff --git a/audio_waterfall.c b/audio_waterfall.c index ae89d7c..3bbf6a7 100644 --- a/audio_waterfall.c +++ b/audio_waterfall.c @@ -140,7 +140,7 @@ void audio_waterfall_update() { int width=gdk_pixbuf_get_width(pixbuf); int height=gdk_pixbuf_get_height(pixbuf); int rowstride=gdk_pixbuf_get_rowstride(pixbuf); - int channels=gdk_pixbuf_get_n_channels(pixbuf); + int channels=gdk_pixbuf_get_n_channels(pixbuf); // used in debug code //fprintf(stderr,"audio_waterfall_update: width=%d height=%d rowsstride=%d channels=%d\n",width,height,rowstride,channels); diff --git a/band.c b/band.c index baa6745..194c9df 100644 --- a/band.c +++ b/band.c @@ -395,7 +395,6 @@ BAND *band_set_current(int b) { void bandSaveState() { char name[128]; char value[128]; - int current; BANDSTACK_ENTRY* entry; int b; @@ -517,7 +516,6 @@ void bandRestoreState() { int stack; char name[128]; BANDSTACK_ENTRY* entry; - int current; for(b=0;bid, bitspersample,samplesperframe); @@ -1617,9 +1616,8 @@ static void process_iq_data(unsigned char *buffer, RECEIVER *rx) { // at the end // static void process_div_iq_data(unsigned char*buffer) { - long sequence; - long long timestamp; - int bitspersample; + // long long timestamp; // never used + // int bitspersample; // never used int samplesperframe; int b; int leftsample0; @@ -1631,16 +1629,16 @@ static void process_div_iq_data(unsigned char*buffer) { double leftsampledouble1; double rightsampledouble1; - timestamp=((long long)(buffer[ 4]&0xFF)<<56) - +((long long)(buffer[ 5]&0xFF)<<48) - +((long long)(buffer[ 6]&0xFF)<<40) - +((long long)(buffer[ 7]&0xFF)<<32) - +((long long)(buffer[ 8]&0xFF)<<24) - +((long long)(buffer[ 9]&0xFF)<<16) - +((long long)(buffer[10]&0xFF)<< 8) - +((long long)(buffer[11]&0xFF) ); - - bitspersample=((buffer[12]&0xFF)<<8)+(buffer[13]&0xFF); + //timestamp=((long long)(buffer[ 4]&0xFF)<<56) + // +((long long)(buffer[ 5]&0xFF)<<48) + // +((long long)(buffer[ 6]&0xFF)<<40) + // +((long long)(buffer[ 7]&0xFF)<<32) + // +((long long)(buffer[ 8]&0xFF)<<24) + // +((long long)(buffer[ 9]&0xFF)<<16) + // +((long long)(buffer[10]&0xFF)<< 8) + // +((long long)(buffer[11]&0xFF) ); + + //bitspersample=((buffer[12]&0xFF)<<8)+(buffer[13]&0xFF); samplesperframe=((buffer[14]&0xFF)<<8)+(buffer[15]&0xFF); b=16; @@ -1677,9 +1675,8 @@ static void process_div_iq_data(unsigned char*buffer) { } static void process_ps_iq_data(unsigned char *buffer) { - long sequence; - long long timestamp; - int bitspersample; + //long long timestamp; // never used + int bitspersample; // used in debug code int samplesperframe; int b; int leftsample0; @@ -1691,16 +1688,16 @@ static void process_ps_iq_data(unsigned char *buffer) { double leftsampledouble1; double rightsampledouble1; - timestamp=((long long)(buffer[ 4]&0xFF)<<56) - +((long long)(buffer[ 5]&0xFF)<<48) - +((long long)(buffer[ 6]&0xFF)<<40) - +((long long)(buffer[ 7]&0xFF)<<32) - +((long long)(buffer[ 8]&0xFF)<<24) - +((long long)(buffer[ 9]&0xFF)<<16) - +((long long)(buffer[10]&0xFF)<< 8) - +((long long)(buffer[11]&0xFF) ); + //timestamp=((long long)(buffer[ 4]&0xFF)<<56) + // +((long long)(buffer[ 5]&0xFF)<<48) + // +((long long)(buffer[ 6]&0xFF)<<40) + // +((long long)(buffer[ 7]&0xFF)<<32) + // +((long long)(buffer[ 8]&0xFF)<<24) + // +((long long)(buffer[ 9]&0xFF)<<16) + // +((long long)(buffer[10]&0xFF)<< 8) + // +((long long)(buffer[11]&0xFF) ); - bitspersample=((buffer[12]&0xFF)<<8)+(buffer[13]&0xFF); + bitspersample=((buffer[12]&0xFF)<<8)+(buffer[13]&0xFF); // used in debug code samplesperframe=((buffer[14]&0xFF)<<8)+(buffer[15]&0xFF); //fprintf(stderr,"process_ps_iq_data: bitspersample=%d samplesperframe=%d\n", bitspersample,samplesperframe); @@ -1757,8 +1754,6 @@ static void process_high_priority(unsigned char *buffer) { int previous_dot; int previous_dash; - int id=active_receiver->id; - sequence=((high_priority_buffer[0]&0xFF)<<24)+((high_priority_buffer[1]&0xFF)<<16)+((high_priority_buffer[2]&0xFF)<<8)+(high_priority_buffer[3]&0xFF); if (sequence != highprio_rcvd_sequence) { fprintf(stderr,"HighPrio SeqErr Expected=%ld Seen=%ld\n", highprio_rcvd_sequence, sequence); @@ -1793,7 +1788,7 @@ static void process_high_priority(unsigned char *buffer) { #endif } - int tx_vfo=split?VFO_B:VFO_A; + //int tx_vfo=split?VFO_B:VFO_A; //if(vfo[tx_vfo].mode==modeCWL || vfo[tx_vfo].mode==modeCWU) { // local_ptt=local_ptt|dot|dash; //} @@ -1857,7 +1852,7 @@ void new_protocol_cw_audio_samples(short left_audio_sample,short right_audio_sam rc=sendto(data_socket,audiobuffer,sizeof(audiobuffer),0,(struct sockaddr*)&audio_addr,audio_addr_length); if(rc!=sizeof(audiobuffer)) { - fprintf(stderr,"sendto socket failed for %ld bytes of audio: %d\n",sizeof(audiobuffer),rc); + fprintf(stderr,"sendto socket failed for %ld bytes of audio: %d\n",(long)sizeof(audiobuffer),rc); } audioindex=4; audiosequence++; @@ -1891,7 +1886,7 @@ void new_protocol_audio_samples(RECEIVER *rx,short left_audio_sample,short right rc=sendto(data_socket,audiobuffer,sizeof(audiobuffer),0,(struct sockaddr*)&audio_addr,audio_addr_length); if(rc!=sizeof(audiobuffer)) { - fprintf(stderr,"sendto socket failed for %ld bytes of audio: %d\n",sizeof(audiobuffer),rc); + fprintf(stderr,"sendto socket failed for %ld bytes of audio: %d\n",(long)sizeof(audiobuffer),rc); } audioindex=4; audiosequence++; diff --git a/noise_menu.c b/noise_menu.c index 080cf87..bbef41b 100644 --- a/noise_menu.c +++ b/noise_menu.c @@ -143,9 +143,6 @@ static void snb_cb(GtkWidget *widget, gpointer data) { } void noise_menu(GtkWidget *parent) { - GtkWidget *b; - int i; - parent_window=parent; dialog=gtk_dialog_new(); diff --git a/old_protocol.c b/old_protocol.c index 4c99cc6..6fbf533 100644 --- a/old_protocol.c +++ b/old_protocol.c @@ -266,7 +266,6 @@ void old_protocol_set_mic_sample_rate(int rate) { void old_protocol_init(int rx,int pixels,int rate) { int i; - int num_hpsdr_receivers=how_many_receivers(); fprintf(stderr,"old_protocol_init: num_hpsdr_receivers=%d\n",how_many_receivers()); old_protocol_set_mic_sample_rate(rate); @@ -325,8 +324,6 @@ void old_protocol_init(int rx,int pixels,int rate) { // static void start_usb_receive_threads() { - int rc; - fprintf(stderr,"old_protocol starting USB receive thread: buffer_size=%d\n",buffer_size); ozy_EP6_rx_thread_id = g_thread_new( "OZY EP6 RX", ozy_ep6_rx_thread, NULL); @@ -352,7 +349,6 @@ static gpointer ozy_ep4_rx_thread(gpointer arg) // static gpointer ozy_ep6_rx_thread(gpointer arg) { int bytes; - unsigned char buffer[2048]; fprintf(stderr, "old_protocol: USB EP6 receive_thread\n"); running=1; @@ -791,11 +787,11 @@ static long long channel_freq(int chan) { static int how_many_receivers() { // // Depending on how the program is compiled and which board we have, - // we use a FIXED number of receivers except for RADIOBERRY and PI_SDR, + // we use a FIXED number of receivers except for RADIOBERRY, // where the number may be dynamically changed // int ret; -#if defined(RADIOBERRY) || defined(PI_SDR) +#ifdef RADIOBERRY ret = receivers; // 1 or 2 #else ret = RECEIVERS; // 2 @@ -806,19 +802,32 @@ static int how_many_receivers() { // we need at least 2, and up to 5 for Orion2 boards. This is so because // the TX DAC is hard-wired to RX4 for HERMES,STEMLAB and to RX5 for ANGELIA // and beyond. - ret = 2; // METIS? - if (device == DEVICE_HERMES || device == DEVICE_STEMLAB) ret = 4; - if (device == DEVICE_ANGELIA || device == DEVICE_ORION || device == DEVICE_ORION2) ret = 5; + switch (device) { + case DEVICE_HERMES: + case DEVICE_STEMLAB: + ret=4; // TX feedback hard-wired to RX4 + break; + case DEVICE_ANGELIA: + case DEVICE_ORION: + case DEVICE_ORION2: + ret=5; // TX feedback hard-wired to RX5 + break; + default: + // + // older FPGAs support no more than two receivers + // then TX feedback is wired to RX2 + // + ret=2; + break; + } #endif return ret; } static void process_ozy_input_buffer(unsigned char *buffer) { - int i,j; + int i; int r; int b=0; - unsigned char ozy_samples[8*8]; - int bytes; int previous_ptt; int previous_dot; int previous_dash; @@ -828,10 +837,7 @@ static void process_ozy_input_buffer(unsigned char *buffer) { float fsample; double left_sample_double; double right_sample_double; - double mic_sample_double; double gain=pow(10.0, mic_gain / 20.0); - int left_sample_1; - int right_sample_1; double left_sample_double_rx; double right_sample_double_rx; double left_sample_double_tx; diff --git a/ozyio.c b/ozyio.c index 125cf25..b4b9958 100644 --- a/ozyio.c +++ b/ozyio.c @@ -480,10 +480,6 @@ void ozy_i2c_readvars() { fprintf(stderr,"ozy_i2c_init: starting\n"); - if (rc != 0) { - fprintf(stderr,"ozy_i2c_init: failed open %d\n",rc); - } - rc = ozy_i2c_read(buffer,2,I2C_MERC1_FW); if(rc<0) { perror("ozy_i2c_init2: failed"); @@ -573,6 +569,7 @@ static int file_exists (const char * fileName) return ( i == 0 ) ? 1 : 0 ; } +#if defined(__linux__) || defined(__APPLE__) int filePath (char *sOut, const char *sIn) { int rc = 0; @@ -585,7 +582,7 @@ int filePath (char *sOut, const char *sIn) { char xPath [PATH_MAX] = {0}; char *p; - int rc = readlink ("/proc/self/exe", xPath, sizeof(xPath)); + int rc = readlink ("/proc/self/exe", xPath, sizeof(xPath)); // rc SHADOWED // try to detect the directory from which the executable has been loaded if (rc >= 0) { @@ -616,6 +613,7 @@ int filePath (char *sOut, const char *sIn) { } return rc; } +#endif @@ -648,7 +646,7 @@ int ozy_initialise() ozy_set_led(1,0); ozy_close(); ozy_open(); - rc=ozy_get_firmware_string(ozy_firmware_version,8); + ozy_get_firmware_string(ozy_firmware_version,8); fprintf(stderr,"Ozy FX2 version: %s\n",ozy_firmware_version); ozy_i2c_readvars(); diff --git a/portaudio.c b/portaudio.c index 3073ece..9827569 100644 --- a/portaudio.c +++ b/portaudio.c @@ -136,7 +136,7 @@ unsigned char *micbuffer = NULL; int audio_open_input() { PaError err; - PaStreamParameters inputParameters, outputParameters; + PaStreamParameters inputParameters; long framesPerBuffer; int i; int padev; @@ -444,7 +444,7 @@ int audio_write (RECEIVER *rx, float left, float right) if (rx->playback_handle != NULL && rx->local_audio_buffer != NULL) { buffer[rx->local_audio_buffer_offset++] = (left+right)*0.5; // mix to MONO if (rx->local_audio_buffer_offset == BUFFER_SIZE) { - err=Pa_WriteStream(rx->playback_handle, rx->local_audio_buffer, (unsigned long) BUFFER_SIZE); + Pa_WriteStream(rx->playback_handle, rx->local_audio_buffer, (unsigned long) BUFFER_SIZE); rx->local_audio_buffer_offset=0; // do not check on errors, there will be underflows every now and then } @@ -461,7 +461,7 @@ int cw_audio_write(float sample) { if (rx->playback_handle != NULL && rx->local_audio_buffer != NULL) { buffer[rx->local_audio_buffer_offset++] = sample; if (rx->local_audio_buffer_offset == BUFFER_SIZE) { - err=Pa_WriteStream(rx->playback_handle, rx->local_audio_buffer, (unsigned long) BUFFER_SIZE); + Pa_WriteStream(rx->playback_handle, rx->local_audio_buffer, (unsigned long) BUFFER_SIZE); // do not check on errors, there will be underflows every now and then rx->local_audio_buffer_offset=0; } diff --git a/property.c b/property.c index beba9a5..0b95c69 100644 --- a/property.c +++ b/property.c @@ -81,7 +81,6 @@ void saveProperties(char* filename) { PROPERTY* property; FILE* f=fopen(filename,"w+"); char line[512]; - char version[32]; fprintf(stderr,"saveProperties: %s\n",filename); diff --git a/ps_menu.c b/ps_menu.c index c560b7d..e26ee5b 100644 --- a/ps_menu.c +++ b/ps_menu.c @@ -338,7 +338,6 @@ static void twotone_cb(GtkWidget *widget, gpointer data) { } void ps_menu(GtkWidget *parent) { - GtkWidget *b; int i; parent_window=parent; diff --git a/radio.c b/radio.c index 7383397..66dd8fc 100644 --- a/radio.c +++ b/radio.c @@ -413,7 +413,6 @@ static gboolean menu_cb (GtkWidget *widget, GdkEventButton *event, gpointer data void start_radio() { int i; - int x; int y; //fprintf(stderr,"start_radio: selected radio=%p device=%d\n",radio,radio->device); gdk_window_set_cursor(gtk_widget_get_window(top_window),gdk_cursor_new(GDK_WATCH)); @@ -1217,7 +1216,6 @@ void frequency_changed(RECEIVER *rx) { } #endif } else { - double f=(double)(vfo[0].frequency-vfo[0].lo); if(radio->protocol==NEW_PROTOCOL) { schedule_high_priority(); #ifdef SOAPYSDR @@ -1522,7 +1520,6 @@ void set_alex_attenuation(int v) { } void radioRestoreState() { - char name[80]; char *value; fprintf(stderr,"radioRestoreState: %s\n",property_path); @@ -1782,7 +1779,6 @@ fprintf(stderr,"radioRestoreState: %s\n",property_path); void radioSaveState() { int i; - char name[80]; char value[80]; fprintf(stderr,"radioSaveState: %s\n",property_path); diff --git a/receiver.c b/receiver.c index a0cfeda..1477783 100644 --- a/receiver.c +++ b/receiver.c @@ -80,7 +80,6 @@ void receiver_weak_notify(gpointer data,GObject *obj) { gboolean receiver_button_press_event(GtkWidget *widget, GdkEventButton *event, gpointer data) { RECEIVER *rx=(RECEIVER *)data; if(rx==active_receiver) { - int x=(int)event->x; if (event->button == 1) { last_x=(int)event->x; has_moved=FALSE; @@ -106,8 +105,8 @@ gboolean receiver_button_release_event(GtkWidget *widget, GdkEventButton *event, g_idle_add(ext_start_rx,NULL); } } else { - int display_width=gtk_widget_get_allocated_width (rx->panadapter); - int display_height=gtk_widget_get_allocated_height (rx->panadapter); + //int display_width=gtk_widget_get_allocated_width (rx->panadapter); + //int display_height=gtk_widget_get_allocated_height (rx->panadapter); if(pressed) { int x=(int)event->x; if (event->button == 1) { @@ -615,17 +614,13 @@ void set_displaying(RECEIVER *rx,int state) { if(state) { rx->update_timer_id=gdk_threads_add_timeout_full(G_PRIORITY_HIGH_IDLE,1000/rx->fps, update_display, rx, NULL); } else { - if(rx->update_timer_id!=-1) { - rx->update_timer_id=-1; - } + rx->update_timer_id=-1; } } void set_mode(RECEIVER *rx,int m) { - int local_mode=m; #ifdef PSK if(vfo[rx->id].mode!=modePSK && m==modePSK) { - local_mode=modeUSB; //init_psk(); show_psk(); } else if(vfo[rx->id].mode==modePSK && m!=modePSK) { @@ -721,8 +716,6 @@ static void init_analyzer(RECEIVER *rx) { int span_clip_h = 0; int pixels=rx->pixels; int stitches = 1; - int avm = 0; - double tau = 0.001 * 120.0; int calibration_data_set = 0; double span_min_freq = 0.0; double span_max_freq = 0.0; @@ -1456,7 +1449,6 @@ static void process_rx_buffer(RECEIVER *rx) { } void full_rx_buffer(RECEIVER *rx) { - int j; int error; g_mutex_lock(&rx->mutex); diff --git a/rigctl.c b/rigctl.c index 9bcd536..7ff0035 100644 --- a/rigctl.c +++ b/rigctl.c @@ -636,9 +636,9 @@ void send_resp (int client_sock,char * msg) { fprintf(stderr,"RIGCTL: RESP=%s\n",msg); #endif if(client_sock == -1) { // Serial port - int bytes=write(fd,msg,strlen(msg)); + write(fd,msg,strlen(msg)); } else { // TCP/IP port - int bytes=write(client_sock, msg, strlen(msg)); + write(client_sock, msg, strlen(msg)); } } @@ -648,7 +648,6 @@ void send_resp (int client_sock,char * msg) { static gpointer rigctl_server(gpointer data) { int port=GPOINTER_TO_INT(data); - int rc; int on=1; int i; @@ -694,9 +693,6 @@ static gpointer rigctl_server(gpointer data) { for(i=0;isocket , cmd_input , MAXDATASIZE-2 , 0)) > 0 ) { for(i=0;iwaterfall_high <0) { sprintf(msg,"ZZDO-%03d;",abs(active_receiver->waterfall_high)); @@ -1550,7 +1541,6 @@ void parse_cmd ( char * cmd_input,int len,int client_sock) { send_resp(client_sock,"?;"); } } - } } else if((strcmp(cmd_str,"DQ")==0) && (zzid_flag == 0)) { // TS-2000 - DQ - ETs/and reads the DCS function status - not supported @@ -2433,11 +2423,7 @@ void parse_cmd ( char * cmd_input,int len,int client_sock) { if(zzid_flag == 0) { if(len <=2) { work_int = (int) ((mic_gain +10.0)* 100.0/60.0); - if(zzid_flag == 0) { - sprintf(msg,"MG%03d;",work_int); - } else { - sprintf(msg,"ZZMG%03d;",work_int); - } + sprintf(msg,"MG%03d;",work_int); send_resp(client_sock,msg); } else { int tval = atoi(&cmd_input[2]); @@ -2694,17 +2680,17 @@ void parse_cmd ( char * cmd_input,int len,int client_sock) { // PiHPSDR - ZZNR - Set/Read Noise Reduction function status if(len <=2) { if(zzid_flag == 0) { - if (active_receiver->nr==1 & active_receiver->nr2==0) { + if (active_receiver->nr==1 && active_receiver->nr2==0) { send_resp(client_sock,"NR1;"); - } else if (active_receiver->nr==1 & active_receiver->nr2==1) { + } else if (active_receiver->nr==1 && active_receiver->nr2==1) { send_resp(client_sock,"NR2;"); } else { send_resp(client_sock,"NR0;"); } } else { - if (active_receiver->nr==1 & active_receiver->nr2==0) { + if (active_receiver->nr==1 && active_receiver->nr2==0) { send_resp(client_sock,"ZZNR1;"); - } else if (active_receiver->nr==1 & active_receiver->nr2==1) { + } else if (active_receiver->nr==1 && active_receiver->nr2==1) { send_resp(client_sock,"ZZNR2;"); } else { send_resp(client_sock,"ZZNR0;"); @@ -3452,11 +3438,7 @@ void parse_cmd ( char * cmd_input,int len,int client_sock) { } break; } - if(zzid_flag == 0) { - sprintf(msg,"ST%02d;",coded_step_val); - } else { - sprintf(msg,"ZZST%02d;",coded_step_val); - } + sprintf(msg,"ST%02d;",coded_step_val); send_resp(client_sock,msg); } else { coded_step_val = atoi(&cmd_input[2]); @@ -3892,14 +3874,13 @@ void set_blocking (int fd, int should_block) static gpointer serial_server(gpointer data) { // We're going to Read the Serial port and // when we get data we'll send it to parse_cmd - int num_chars; char ser_buf[MAXDATASIZE]; char work_buf[MAXDATASIZE]; const char s[2]=";"; char *p; char *d; char save_buf[MAXDATASIZE] = ""; - int str_len = 0; + int str_len; cat_control++; while(1) { int num_chars = read (fd, ser_buf, sizeof ser_buf); @@ -3996,7 +3977,6 @@ void disable_serial () { // (Port numbers now const ints instead of defines..) // void launch_rigctl () { - int err; fprintf(stderr, "LAUNCHING RIGCTL!!\n"); diff --git a/rigctl_menu.c b/rigctl_menu.c index 5ec99e1..5bbf009 100644 --- a/rigctl_menu.c +++ b/rigctl_menu.c @@ -103,8 +103,6 @@ static void parity_cb(GtkWidget *widget, gpointer data) { } void rigctl_menu(GtkWidget *parent) { - int i; - parent_window=parent; dialog=gtk_dialog_new(); diff --git a/rx_panadapter.c b/rx_panadapter.c index e1c7a74..ea68b99 100644 --- a/rx_panadapter.c +++ b/rx_panadapter.c @@ -115,10 +115,7 @@ static gboolean panadapter_scroll_event_cb(GtkWidget *widget, GdkEventScroll *ev void rx_panadapter_update(RECEIVER *rx) { int i; int x1,x2; - int result; float *samples; - float saved_max; - float saved_min; cairo_text_extents_t extents; gboolean active=active_receiver==rx; @@ -480,9 +477,6 @@ void rx_panadapter_update(RECEIVER *rx) { void rx_panadapter_init(RECEIVER *rx, int width,int height) { - int display_width=width; - int display_height=height; - rx->panadapter_surface=NULL; rx->panadapter = gtk_drawing_area_new (); gtk_widget_set_size_request (rx->panadapter, width, height); diff --git a/sliders.c b/sliders.c index af20035..346b3bb 100644 --- a/sliders.c +++ b/sliders.c @@ -202,7 +202,7 @@ void set_attenuation_value(double value) { gtk_container_add(GTK_CONTAINER(content),attenuation_scale); scale_timer=g_timeout_add(2000,scale_timeout_cb,NULL); //gtk_widget_show_all(scale_dialog); - int result=gtk_dialog_run(GTK_DIALOG(scale_dialog)); + gtk_dialog_run(GTK_DIALOG(scale_dialog)); } else { g_source_remove(scale_timer); gtk_range_set_value (GTK_RANGE(attenuation_scale),(double)adc_attenuation[active_receiver->adc]); @@ -313,7 +313,7 @@ void set_agc_gain(int rx,double value) { gtk_container_add(GTK_CONTAINER(content),agc_scale); scale_timer=g_timeout_add(2000,scale_timeout_cb,NULL); //gtk_widget_show_all(scale_dialog); - int result=gtk_dialog_run(GTK_DIALOG(scale_dialog)); + gtk_dialog_run(GTK_DIALOG(scale_dialog)); } else { g_source_remove(scale_timer); gtk_range_set_value (GTK_RANGE(agc_scale),receiver[rx]->agc_gain); @@ -365,7 +365,7 @@ void set_af_gain(int rx,double value) { gtk_container_add(GTK_CONTAINER(content),af_gain_scale); scale_timer=g_timeout_add(2000,scale_timeout_cb,NULL); //gtk_widget_show_all(scale_dialog); - int result=gtk_dialog_run(GTK_DIALOG(scale_dialog)); + gtk_dialog_run(GTK_DIALOG(scale_dialog)); } else { g_source_remove(scale_timer); gtk_range_set_value (GTK_RANGE(af_gain_scale),receiver[rx]->volume*100.0); @@ -415,7 +415,7 @@ void set_rf_gain(int rx,double value) { gtk_container_add(GTK_CONTAINER(content),rf_gain_scale); scale_timer=g_timeout_add(2000,scale_timeout_cb,NULL); //gtk_widget_show_all(scale_dialog); - int result=gtk_dialog_run(GTK_DIALOG(scale_dialog)); + gtk_dialog_run(GTK_DIALOG(scale_dialog)); } else { g_source_remove(scale_timer); gtk_range_set_value (GTK_RANGE(rf_gain_scale),receiver[rx]->rf_gain); @@ -443,7 +443,7 @@ void set_filter_width(int rx,int width) { gtk_container_add(GTK_CONTAINER(content),filter_width_scale); scale_timer=g_timeout_add(2000,scale_timeout_cb,NULL); //gtk_widget_show_all(scale_dialog); - int result=gtk_dialog_run(GTK_DIALOG(scale_dialog)); + gtk_dialog_run(GTK_DIALOG(scale_dialog)); } else { g_source_remove(scale_timer); gtk_range_set_value (GTK_RANGE(filter_width_scale),(double)width); @@ -486,7 +486,7 @@ void set_mic_gain(double value) { gtk_container_add(GTK_CONTAINER(content),mic_gain_scale); scale_timer=g_timeout_add(2000,scale_timeout_cb,NULL); //gtk_widget_show_all(scale_dialog); - int result=gtk_dialog_run(GTK_DIALOG(scale_dialog)); + gtk_dialog_run(GTK_DIALOG(scale_dialog)); } else { g_source_remove(scale_timer); gtk_range_set_value (GTK_RANGE(mic_gain_scale),mic_gain); @@ -519,7 +519,7 @@ void set_linein_gain(int value) { gtk_container_add(GTK_CONTAINER(content),mic_gain_scale); scale_timer=g_timeout_add(2000,scale_timeout_cb,NULL); //gtk_widget_show_all(scale_dialog); - int result=gtk_dialog_run(GTK_DIALOG(scale_dialog)); + gtk_dialog_run(GTK_DIALOG(scale_dialog)); } else { g_source_remove(scale_timer); gtk_range_set_value (GTK_RANGE(mic_gain_scale),linein_gain); @@ -568,7 +568,7 @@ void set_drive(double value) { gtk_container_add(GTK_CONTAINER(content),drive_scale); scale_timer=g_timeout_add(2000,scale_timeout_cb,NULL); //gtk_widget_show_all(scale_dialog); - int result=gtk_dialog_run(GTK_DIALOG(scale_dialog)); + gtk_dialog_run(GTK_DIALOG(scale_dialog)); } else { g_source_remove(scale_timer); gtk_range_set_value (GTK_RANGE(drive_scale),value); @@ -636,7 +636,7 @@ void set_squelch() { gtk_widget_show(squelch_scale); gtk_container_add(GTK_CONTAINER(content),squelch_scale); scale_timer=g_timeout_add(2000,scale_timeout_cb,NULL); - int result=gtk_dialog_run(GTK_DIALOG(scale_dialog)); + gtk_dialog_run(GTK_DIALOG(scale_dialog)); } else { g_source_remove(scale_timer); gtk_range_set_value (GTK_RANGE(squelch_scale),active_receiver->squelch); @@ -671,7 +671,7 @@ void set_compression(TRANSMITTER* tx) { gtk_widget_show(comp_scale); gtk_container_add(GTK_CONTAINER(content),comp_scale); scale_timer=g_timeout_add(2000,scale_timeout_cb,NULL); - int result=gtk_dialog_run(GTK_DIALOG(scale_dialog)); + gtk_dialog_run(GTK_DIALOG(scale_dialog)); } else { g_source_remove(scale_timer); gtk_range_set_value (GTK_RANGE(comp_scale),tx->compressor_level); @@ -703,7 +703,7 @@ void show_diversity_gain() { gtk_container_add(GTK_CONTAINER(content),diversity_gain_scale); scale_timer=g_timeout_add(2000,scale_timeout_cb,NULL); //gtk_widget_show_all(scale_dialog); - int result=gtk_dialog_run(GTK_DIALOG(scale_dialog)); + gtk_dialog_run(GTK_DIALOG(scale_dialog)); } else { g_source_remove(scale_timer); gtk_range_set_value (GTK_RANGE(diversity_gain_scale),div_gain); @@ -730,7 +730,7 @@ void show_diversity_phase() { gtk_container_add(GTK_CONTAINER(content),diversity_phase_scale); scale_timer=g_timeout_add(2000,scale_timeout_cb,NULL); //gtk_widget_show_all(scale_dialog); - int result=gtk_dialog_run(GTK_DIALOG(scale_dialog)); + gtk_dialog_run(GTK_DIALOG(scale_dialog)); } else { g_source_remove(scale_timer); gtk_range_set_value (GTK_RANGE(diversity_phase_scale),div_phase); diff --git a/store.c b/store.c index 0b6bb47..3eb332d 100644 --- a/store.c +++ b/store.c @@ -64,11 +64,7 @@ MEM mem[NUM_OF_MEMORYS]; // This makes it a compile time option void memSaveState() { char name[128]; char value[128]; - int current; - BANDSTACK_ENTRY* entry; - int workvar; int b; - int stack; for(b=0;b0) { @@ -96,10 +92,7 @@ void memSaveState() { void memRestoreState() { char* value; int b; - int stack; char name[128]; - BANDSTACK_ENTRY* entry; - int current; // Initialize the array with default values // Allows this to be a compile time option.. @@ -115,23 +108,31 @@ void memRestoreState() { for(b=0;bid); if(tx->displaying) { #ifdef AUDIO_SAMPLES @@ -544,8 +542,6 @@ static void init_analyzer(TRANSMITTER *tx) { int span_clip_h = 0; int pixels=tx->pixels; int stitches = 1; - int avm = 0; - double tau = 0.001 * 120.0; int calibration_data_set = 0; double span_min_freq = 0.0; double span_max_freq = 0.0; @@ -899,7 +895,7 @@ void tx_set_pre_emphasize(TRANSMITTER *tx,int state) { static void full_tx_buffer(TRANSMITTER *tx) { long isample; long qsample; - double gain, sidevol, ramp, fgain; + double gain, sidevol, ramp; double *dp; int j; int error; @@ -907,7 +903,6 @@ static void full_tx_buffer(TRANSMITTER *tx) { int sidetone=0; static int txflag=0; static long last_qsample=0; - long delta; // It is important to query tx->mode and tune only *once* within this function, to assure that // the two "if (cwmode)" clauses give the same result. diff --git a/tx_menu.c b/tx_menu.c index 20b04ec..5b73ce2 100644 --- a/tx_menu.c +++ b/tx_menu.c @@ -223,7 +223,6 @@ static void tune_value_changed_cb(GtkWidget *widget, gpointer data) { } void tx_menu(GtkWidget *parent) { - GtkWidget *b; int i; parent_window=parent; diff --git a/tx_panadapter.c b/tx_panadapter.c index 997eb9f..5c1d36d 100644 --- a/tx_panadapter.c +++ b/tx_panadapter.c @@ -100,7 +100,6 @@ tx_panadapter_button_press_event_cb (GtkWidget *widget, GdkEventButton *event, gpointer data) { - int x=(int)event->x; if (event->button == 1) { last_x=(int)event->x; has_moved=FALSE; @@ -118,7 +117,7 @@ tx_panadapter_button_release_event_cb (GtkWidget *widget, { TRANSMITTER *tx=(TRANSMITTER *)data; int display_width=gtk_widget_get_allocated_width (tx->panadapter); - int display_height=gtk_widget_get_allocated_height (tx->panadapter); + //int display_height=gtk_widget_get_allocated_height (tx->panadapter); if(pressed) { int x=(int)event->x; @@ -180,11 +179,7 @@ tx_panadapter_scroll_event_cb (GtkWidget *widget, void tx_panadapter_update(TRANSMITTER *tx) { int i; - int result; float *samples; - float saved_max; - float saved_min; - cairo_text_extents_t extents; if(tx->panadapter_surface) { @@ -248,8 +243,6 @@ void tx_panadapter_update(TRANSMITTER *tx) { } // plot frequency markers - long long f; - long long divisor=20000; //long long half=24000LL; //(long long)(tx->output_rate/2); long long half=6000LL; //(long long)(tx->output_rate/2); long long frequency; @@ -270,8 +263,9 @@ void tx_panadapter_update(TRANSMITTER *tx) { } #ifdef TX_FREQ_MARKERS - //divisor=5000LL; - divisor=50000LL; + long long f; + cairo_text_extents_t extents; + long long divisor=50000; for(i=0;i 0) { diff --git a/update.c b/update.c index 5f2756a..8487fac 100644 --- a/update.c +++ b/update.c @@ -23,7 +23,7 @@ int check_update() { FILE* f=fopen("latest","r"); if(f) { - char *s=fgets(new_version,sizeof(new_version),f); + fgets(new_version,sizeof(new_version),f); fclose(f); } else { fprintf(stderr,"check_update: could not read latest version\n"); @@ -42,7 +42,7 @@ int check_update() { fprintf(stderr,"check_version: latest version is %s\n",new_version); - fprintf(stderr,"check_version: length of version=%ld length of new_version=%ld\n", strlen(version), strlen(new_version)); + fprintf(stderr,"check_version: length of version=%ld length of new_version=%ld\n", (long)strlen(version), (long)strlen(new_version)); rc=strcmp(version,new_version); return rc; diff --git a/vfo.c b/vfo.c index e227faa..4fb1331 100644 --- a/vfo.c +++ b/vfo.c @@ -788,7 +788,6 @@ vfo_scroll_event_cb (GtkWidget *widget, GdkEventScroll *event, gpointer data) { - int i; if(event->direction==GDK_SCROLL_UP) { vfo_move(step,TRUE); } else { @@ -1095,7 +1094,7 @@ void vfo_update() { cairo_set_source_rgb(cr, 1.0, 1.0, 0.0); cairo_show_text(cr, temp_text); - char *info=getFrequencyInfo(af,active_receiver->filter_low,active_receiver->filter_high); + getFrequencyInfo(af,active_receiver->filter_low,active_receiver->filter_high); /* cairo_move_to(cr, (my_width/4)*3, 50); cairo_show_text(cr, getFrequencyInfo(af)); @@ -1198,7 +1197,6 @@ vfo_press_event_cb (GtkWidget *widget, } GtkWidget* vfo_init(int width,int height,GtkWidget *parent) { - int i; fprintf(stderr,"vfo_init: width=%d height=%d\n", width, height); diff --git a/vox_menu.c b/vox_menu.c index b43a088..4b10114 100644 --- a/vox_menu.c +++ b/vox_menu.c @@ -57,7 +57,6 @@ static int vox_timeout_cb(gpointer data) { } static int level_update(void *data) { - char title[16]; if(run_level) { gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(level),peak); @@ -121,7 +120,6 @@ static gboolean enable_cb (GtkWidget *widget, GdkEventButton *event, gpointer da } static void start_level_thread() { - int rc; run_level=1; level_thread_id = g_thread_new( "VOX level", level_thread, NULL); if(!level_thread_id ) { @@ -148,8 +146,6 @@ static void vox_hang_value_changed_cb(GtkWidget *widget, gpointer data) { } void vox_menu(GtkWidget *parent) { - int i; - parent_window=parent; dialog=gtk_dialog_new(); diff --git a/xvtr_menu.c b/xvtr_menu.c index f584e8d..c9ce2e6 100644 --- a/xvtr_menu.c +++ b/xvtr_menu.c @@ -52,8 +52,8 @@ static void save_xvtr () { const char *maxf; const char *lof; const char *loerr; - const char *txlof; - const char *txloerr; + const char *txlof; // used in temporarily de-activated code + const char *txloerr; // used in temporarily de-activated code for(i=BANDS;ibandstack; @@ -98,7 +98,6 @@ fprintf(stderr,"min=%s:%lld max=%s:%lld lo=%s:%lld\n",minf,xvtr->frequencyMin,ma } void update_receiver(int band,gboolean error) { - int i; RECEIVER *rx=active_receiver; gboolean saved_ctun; //g_print("update_receiver: band=%d error=%d\n",band,error); @@ -207,7 +206,7 @@ static gboolean delete_event(GtkWidget *widget, GdkEvent *event, gpointer user_d } void xvtr_menu(GtkWidget *parent) { - int i,j; + int i; char f[16]; fprintf(stderr,"xvtr_menu\n"); -- 2.45.2