[hamradio-commits] [dump1090] 83/373: Another attempt to remove UNIX compiler warnings

Matthew Ernisse mernisse-guest at moszumanska.debian.org
Thu Oct 23 14:58:07 UTC 2014


This is an automated email from the git hooks/post-receive script.

mernisse-guest pushed a commit to branch backport
in repository dump1090.

commit 1175a03f4bacea9eed5fe06f1c47aa8c645c7352
Author: Malcolm Robb <Support at ATTAvionics.com>
Date:   Fri Apr 12 21:06:19 2013 +0100

    Another attempt to remove UNIX compiler warnings
    
    M$ VC 6.0 does not like long long
    UNIX compilers don't like printing int64_t or uint64_t as %lld
    Raspberry Pi Linux doesn;t like PRId64
    
    So I give up.
    
    I've changed the affected variables to bog standard unsigned ints.
    Assuming these compile as 32 bit unsigned's, its unlikely youll have the
    program running long enough for these to overflow.
---
 dump1090.c | 42 +++++++++++++++++++++---------------------
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/dump1090.c b/dump1090.c
index 9bff269..b1ea192 100644
--- a/dump1090.c
+++ b/dump1090.c
@@ -192,17 +192,17 @@ struct {
     uint64_t interactive_last_update;  /* Last screen update in milliseconds */
 
     /* Statistics */
-    int64_t stat_valid_preamble;
-    int64_t stat_demodulated;
-    int64_t stat_goodcrc;
-    int64_t stat_badcrc;
-    int64_t stat_fixed;
-    int64_t stat_single_bit_fix;
-    int64_t stat_two_bits_fix;
-    int64_t stat_http_requests;
-    int64_t stat_sbs_connections;
-    int64_t stat_out_of_phase;
-    int64_t stat_DF_Corrected;
+    unsigned int stat_valid_preamble;
+    unsigned int stat_demodulated;
+    unsigned int stat_goodcrc;
+    unsigned int stat_badcrc;
+    unsigned int stat_fixed;
+    unsigned int stat_single_bit_fix;
+    unsigned int stat_two_bits_fix;
+    unsigned int stat_http_requests;
+    unsigned int stat_sbs_connections;
+    unsigned int stat_out_of_phase;
+    unsigned int stat_DF_Corrected;
 } Modes;
 
 /* The struct we use to store information about a decoded message. */
@@ -2692,16 +2692,16 @@ int main(int argc, char **argv) {
 
     /* If --ifile and --stats were given, print statistics. */
     if (Modes.stats && Modes.filename) {
-        printf("%lld valid preambles\n",                          Modes.stat_valid_preamble);
-        printf("%lld DF-?? fields corrected for length\n",        Modes.stat_DF_Corrected);
-        printf("%lld demodulated again after phase correction\n", Modes.stat_out_of_phase);
-        printf("%lld demodulated with zero errors\n",             Modes.stat_demodulated);
-        printf("%lld with good crc\n",                            Modes.stat_goodcrc);
-        printf("%lld with bad crc\n",                             Modes.stat_badcrc);
-        printf("%lld errors corrected\n",                         Modes.stat_fixed);
-        printf("%lld single bit errors\n",                        Modes.stat_single_bit_fix);
-        printf("%lld two bits errors\n",                          Modes.stat_two_bits_fix);
-        printf("%lld total usable messages\n",                    Modes.stat_goodcrc + Modes.stat_fixed);
+        printf("%d valid preambles\n",                          Modes.stat_valid_preamble);
+        printf("%d DF-?? fields corrected for length\n",        Modes.stat_DF_Corrected);
+        printf("%d demodulated again after phase correction\n", Modes.stat_out_of_phase);
+        printf("%d demodulated with zero errors\n",             Modes.stat_demodulated);
+        printf("%d with good crc\n",                            Modes.stat_goodcrc);
+        printf("%d with bad crc\n",                             Modes.stat_badcrc);
+        printf("%d errors corrected\n",                         Modes.stat_fixed);
+        printf("%d single bit errors\n",                        Modes.stat_single_bit_fix);
+        printf("%d two bits errors\n",                          Modes.stat_two_bits_fix);
+        printf("%d total usable messages\n",                    Modes.stat_goodcrc + Modes.stat_fixed);
     }
 
     rtlsdr_close(Modes.dev);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/dump1090.git



More information about the pkg-hamradio-commits mailing list