File: 0076-Fix-sign-comparison-warnings.patch

package info (click to toggle)
hackrf 2015.07.2-11
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 69,764 kB
  • ctags: 9,327
  • sloc: ansic: 13,907; python: 696; vhdl: 218; sh: 32; makefile: 15
file content (71 lines) | stat: -rw-r--r-- 1,905 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
From 0e0119394d99d7e0872fba0e337618e9fc59f50c Mon Sep 17 00:00:00 2001
From: Dominic Spill <dominicgs@gmail.com>
Date: Mon, 30 May 2016 18:55:04 -0600
Subject: [PATCH 076/111] Fix sign comparison warnings

---
 host/hackrf-tools/src/hackrf_info.c     |  2 +-
 host/hackrf-tools/src/hackrf_transfer.c | 12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

--- a/host/hackrf-tools/src/hackrf_info.c
+++ b/host/hackrf-tools/src/hackrf_info.c
@@ -26,7 +26,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-int main(int argc, char** argv)
+int main(void)
 {
 	int result = HACKRF_SUCCESS;
 	uint8_t board_id = BOARD_ID_INVALID;
--- a/host/hackrf-tools/src/hackrf_transfer.c
+++ b/host/hackrf-tools/src/hackrf_transfer.c
@@ -325,7 +325,7 @@
 
 bool limit_num_samples = false;
 uint64_t samples_to_xfer = 0;
-size_t bytes_to_xfer = 0;
+ssize_t bytes_to_xfer = 0;
 
 bool baseband_filter_bw = false;
 uint32_t baseband_filter_bw_hz = 0;
@@ -333,12 +333,12 @@
 bool repeat = false;
 
 int rx_callback(hackrf_transfer* transfer) {
-	size_t bytes_to_write;
+	ssize_t bytes_to_write;
+	ssize_t bytes_written;
 	int i;
 
 	if( fd != NULL ) 
 	{
-		ssize_t bytes_written;
 		byte_count += transfer->valid_length;
 		bytes_to_write = transfer->valid_length;
 		if (limit_num_samples) {
@@ -366,12 +366,12 @@
 }
 
 int tx_callback(hackrf_transfer* transfer) {
-	size_t bytes_to_read;
+	ssize_t bytes_to_read;
+	ssize_t bytes_read;
 	int i;
 
 	if( fd != NULL )
 	{
-		ssize_t bytes_read;
 		byte_count += transfer->valid_length;
 		bytes_to_read = transfer->valid_length;
 		if (limit_num_samples) {
@@ -695,7 +695,7 @@
 			u64toa(freq_hz,&ascii_u64_data1));
 
 	} else if (automatic_tuning) {
-		if( (freq_hz > FREQ_MAX_HZ) || (freq_hz < FREQ_MIN_HZ) )
+		if(freq_hz > FREQ_MAX_HZ)
 		{
 			fprintf(stderr, "argument error: freq_hz shall be between %s and %s.\n",
 				u64toa(FREQ_MIN_HZ,&ascii_u64_data1),