Ver código fonte

remove unused variables, type fixes

Signed-off-by: Steve Markgraf <steve@steve-m.de>
Steve Markgraf 11 anos atrás
pai
commit
50743b1ccb
7 arquivos alterados com 13 adições e 20 exclusões
  1. 1 1
      src/librtlsdr.c
  2. 3 4
      src/rtl_adsb.c
  3. 5 7
      src/rtl_fm.c
  4. 2 4
      src/rtl_power.c
  5. 1 1
      src/rtl_sdr.c
  6. 0 2
      src/tuner_e4k.c
  7. 1 1
      src/tuner_r82xx.c

+ 1 - 1
src/librtlsdr.c

@@ -534,7 +534,7 @@ int rtlsdr_demod_write_reg(rtlsdr_dev_t *dev, uint8_t page, uint16_t addr, uint1
 
 
 void rtlsdr_set_gpio_bit(rtlsdr_dev_t *dev, uint8_t gpio, int val)
 void rtlsdr_set_gpio_bit(rtlsdr_dev_t *dev, uint8_t gpio, int val)
 {
 {
-	uint8_t r;
+	uint16_t r;
 
 
 	gpio = 1 << gpio;
 	gpio = 1 << gpio;
 	r = rtlsdr_read_reg(dev, SYSB, GPO, 1);
 	r = rtlsdr_read_reg(dev, SYSB, GPO, 1);

+ 3 - 4
src/rtl_adsb.c

@@ -306,8 +306,7 @@ void manchester(uint16_t *buf, int len)
 
 
 void messages(uint16_t *buf, int len)
 void messages(uint16_t *buf, int len)
 {
 {
-	int i, i2, start, preamble_found;
-	int data_i, index, shift, frame_len;
+	int i, data_i, index, shift, frame_len;
 	// todo, allow wrap across buffers
 	// todo, allow wrap across buffers
 	for (i=0; i<len; i++) {
 	for (i=0; i<len; i++) {
 		if (buf[i] > 1) {
 		if (buf[i] > 1) {
@@ -365,8 +364,8 @@ int main(int argc, char **argv)
 	struct sigaction sigact;
 	struct sigaction sigact;
 #endif
 #endif
 	char *filename = NULL;
 	char *filename = NULL;
-	int n_read, r, opt;
-	int i, gain = AUTO_GAIN; /* tenths of a dB */
+	int r, opt;
+	int gain = AUTO_GAIN; /* tenths of a dB */
 	int dev_index = 0;
 	int dev_index = 0;
 	int dev_given = 0;
 	int dev_given = 0;
 	int ppm_error = 0;
 	int ppm_error = 0;

+ 5 - 7
src/rtl_fm.c

@@ -394,7 +394,7 @@ void fifth_order(int16_t *data, int length, int16_t *hist)
 void generic_fir(int16_t *data, int length, int *fir, int16_t *hist)
 void generic_fir(int16_t *data, int length, int *fir, int16_t *hist)
 /* Okay, not at all generic.  Assumes length 9, fix that eventually. */
 /* Okay, not at all generic.  Assumes length 9, fix that eventually. */
 {
 {
-	int d, f, temp, sum;
+	int d, temp, sum;
 	for (d=0; d<length; d+=2) {
 	for (d=0; d<length; d+=2) {
 		temp = data[d];
 		temp = data[d];
 		sum = 0;
 		sum = 0;
@@ -730,8 +730,7 @@ void arbitrary_resample(int16_t *buf1, int16_t *buf2, int len1, int len2)
 
 
 void full_demod(struct demod_state *d)
 void full_demod(struct demod_state *d)
 {
 {
-	uint8_t dump[BUFFER_DUMP];
-	int i, ds, ds_p, freq_next, n_read;
+	int i, ds_p;
 	int sr = 0;
 	int sr = 0;
 	ds_p = d->downsample_passes;
 	ds_p = d->downsample_passes;
 	if (ds_p) {
 	if (ds_p) {
@@ -856,7 +855,7 @@ static void optimal_settings(int freq, int rate)
 {
 {
 	// giant ball of hacks
 	// giant ball of hacks
 	// seems unable to do a single pass, 2:1
 	// seems unable to do a single pass, 2:1
-	int r, capture_freq, capture_rate;
+	int capture_freq, capture_rate;
 	struct dongle_state *d = &dongle;
 	struct dongle_state *d = &dongle;
 	struct demod_state *dm = &demod;
 	struct demod_state *dm = &demod;
 	struct controller_state *cs = &controller;
 	struct controller_state *cs = &controller;
@@ -883,7 +882,7 @@ static void *controller_thread_fn(void *arg)
 {
 {
 	// thoughts for multiple dongles
 	// thoughts for multiple dongles
 	// might be no good using a controller thread if retune/rate blocks
 	// might be no good using a controller thread if retune/rate blocks
-	int i, r;
+	int i;
 	struct controller_state *s = arg;
 	struct controller_state *s = arg;
 
 
 	if (s->wb_mode) {
 	if (s->wb_mode) {
@@ -1042,8 +1041,7 @@ int main(int argc, char **argv)
 #ifndef _WIN32
 #ifndef _WIN32
 	struct sigaction sigact;
 	struct sigaction sigact;
 #endif
 #endif
-	int n_read, r, opt;
-	int i;
+	int r, opt;
 	int dev_given = 0;
 	int dev_given = 0;
 	int custom_ppm = 0;
 	int custom_ppm = 0;
 	dongle_init(&dongle);
 	dongle_init(&dongle);

+ 2 - 4
src/rtl_power.c

@@ -403,7 +403,6 @@ void rms_power(struct tuning_state *ts)
 	uint8_t *buf = ts->buf8;
 	uint8_t *buf = ts->buf8;
 	int buf_len = ts->buf_len;
 	int buf_len = ts->buf_len;
 	long p, t;
 	long p, t;
-	int ln, lp;
 	double dc, err;
 	double dc, err;
 
 
 	p = t = 0L;
 	p = t = 0L;
@@ -588,7 +587,7 @@ void remove_dc(int16_t *data, int length)
 void generic_fir(int16_t *data, int length, int *fir)
 void generic_fir(int16_t *data, int length, int *fir)
 /* Okay, not at all generic.  Assumes length 9, fix that eventually. */
 /* Okay, not at all generic.  Assumes length 9, fix that eventually. */
 {
 {
-	int d, f, temp, sum;
+	int d, temp, sum;
 	int hist[9] = {0,};
 	int hist[9] = {0,};
 	/* cheat on the beginning, let it go unfiltered */
 	/* cheat on the beginning, let it go unfiltered */
 	for (d=0; d<18; d+=2) {
 	for (d=0; d<18; d+=2) {
@@ -760,10 +759,9 @@ int main(int argc, char **argv)
 	struct sigaction sigact;
 	struct sigaction sigact;
 #endif
 #endif
 	char *filename = NULL;
 	char *filename = NULL;
-	int i, length, n_read, r, opt, wb_mode = 0;
+	int i, length, r, opt, wb_mode = 0;
 	int f_set = 0;
 	int f_set = 0;
 	int gain = AUTO_GAIN; // tenths of a dB
 	int gain = AUTO_GAIN; // tenths of a dB
-	uint8_t *buffer;
 	int dev_index = 0;
 	int dev_index = 0;
 	int dev_given = 0;
 	int dev_given = 0;
 	int ppm_error = 0;
 	int ppm_error = 0;

+ 1 - 1
src/rtl_sdr.c

@@ -111,7 +111,7 @@ int main(int argc, char **argv)
 	char *filename = NULL;
 	char *filename = NULL;
 	int n_read;
 	int n_read;
 	int r, opt;
 	int r, opt;
-	int i, gain = 0;
+	int gain = 0;
 	int ppm_error = 0;
 	int ppm_error = 0;
 	int sync_mode = 0;
 	int sync_mode = 0;
 	FILE *file;
 	FILE *file;

+ 0 - 2
src/tuner_e4k.c

@@ -532,8 +532,6 @@ uint32_t e4k_compute_pll_params(struct e4k_pll_params *oscp, uint32_t fosc, uint
 
 
 int e4k_tune_params(struct e4k_state *e4k, struct e4k_pll_params *p)
 int e4k_tune_params(struct e4k_state *e4k, struct e4k_pll_params *p)
 {
 {
-	uint8_t val;
-
 	/* program R + 3phase/2phase */
 	/* program R + 3phase/2phase */
 	e4k_reg_write(e4k, E4K_REG_SYNTH7, p->r_idx);
 	e4k_reg_write(e4k, E4K_REG_SYNTH7, p->r_idx);
 	/* program Z */
 	/* program Z */

+ 1 - 1
src/tuner_r82xx.c

@@ -765,7 +765,7 @@ static int r82xx_set_tv_standard(struct r82xx_priv *priv,
 {
 {
 	int rc, i;
 	int rc, i;
 	uint32_t if_khz, filt_cal_lo;
 	uint32_t if_khz, filt_cal_lo;
-	uint8_t data[5], val;
+	uint8_t data[5];
 	uint8_t filt_gain, img_r, filt_q, hp_cor, ext_enable, loop_through;
 	uint8_t filt_gain, img_r, filt_q, hp_cor, ext_enable, loop_through;
 	uint8_t lt_att, flt_ext_widest, polyfil_cur;
 	uint8_t lt_att, flt_ext_widest, polyfil_cur;
 	int need_calibration;
 	int need_calibration;