commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] r9215 - usrp2/trunk/host-ng/apps


From: jcorgan
Subject: [Commit-gnuradio] r9215 - usrp2/trunk/host-ng/apps
Date: Sat, 9 Aug 2008 11:28:00 -0600 (MDT)

Author: jcorgan
Date: 2008-08-09 11:28:00 -0600 (Sat, 09 Aug 2008)
New Revision: 9215

Removed:
   usrp2/trunk/host-ng/apps/test_usrp2.cc
Modified:
   usrp2/trunk/host-ng/apps/rx_streaming_samples.cc
Log:
cleanup

Modified: usrp2/trunk/host-ng/apps/rx_streaming_samples.cc
===================================================================
--- usrp2/trunk/host-ng/apps/rx_streaming_samples.cc    2008-08-08 17:15:12 UTC 
(rev 9214)
+++ usrp2/trunk/host-ng/apps/rx_streaming_samples.cc    2008-08-09 17:28:00 UTC 
(rev 9215)
@@ -61,25 +61,25 @@
 
 class rx_nop_handler : public usrp2::rx_sample_handler
 {
-  size_t       d_max_samples;
-  size_t       d_nsamples;
-  size_t       d_nframes;
+  uint64_t     d_max_samples;
+  uint64_t     d_nsamples;
+  uint64_t     d_nframes;
 
 protected:
   bool          d_err;
   
 public:
   
-  rx_nop_handler(size_t max_samples)
+  rx_nop_handler(uint64_t max_samples)
     : d_max_samples(max_samples), d_nsamples(0), d_nframes(0), d_err(false) {}
       
   ~rx_nop_handler();
 
-  size_t nframes() const { return d_nframes; }
-  size_t nsamples() const { return d_nsamples; }
-  size_t max_samples() const { return d_max_samples; }
-  bool   has_errored_p() const { return d_err; }
-  bool   has_finished_p() const 
+  uint64_t nframes() const { return d_nframes; }
+  uint64_t nsamples() const { return d_nsamples; }
+  uint64_t max_samples() const { return d_max_samples; }
+  bool has_errored_p() const { return d_err; }
+  bool has_finished_p() const 
     { return d_max_samples == 0 ? false : d_nsamples >= d_max_samples; }
     
   bool 
@@ -100,6 +100,8 @@
   // nop
 }
 
+typedef boost::shared_ptr<rx_nop_handler> handler_sptr;
+
 // ------------------------------------------------------------------------
 
 // FIXME make this a template
@@ -111,7 +113,7 @@
   
 public:
 
-  complex_16_file_writer(const std::string &filename, size_t max_samples)
+  complex_16_file_writer(const std::string &filename, uint64_t max_samples)
     : rx_nop_handler(max_samples), d_filename(filename)
   {
     d_fp = fopen(filename.c_str(), "wb");
@@ -163,7 +165,7 @@
   
 public:
 
-  complex_float_file_writer(const std::string &filename, size_t max_samples)
+  complex_float_file_writer(const std::string &filename, uint64_t max_samples)
     : rx_nop_handler(max_samples), d_filename(filename)
   {
     d_fp = fopen(filename.c_str(), "wb");
@@ -244,7 +246,7 @@
   double rx_freq = 0.0;
   int rx_decim = 5;
   double rx_gain = 0.0;
-  size_t nsamples = 0;
+  uint64_t nsamples = 0;
   bool output_shorts = false;
   char *output_filename = 0;
   bool verbose = false;
@@ -289,26 +291,14 @@
       break;
 
     case 'N':
-      printf("In 'N' clause: optarg=%p &tmp=%p\n", optarg, &tmp);
       if (!strtod_si(optarg, &tmp)) {
         std::cerr << "invalid number: " << optarg << std::endl;
        usage(argv[0]);
        exit(1);
       }
-      nsamples = static_cast<size_t>(tmp);
+      nsamples = static_cast<uint64_t>(tmp);
       break;
       
-#if 0
-    case 'b':
-      if (!strtod_si(optarg, &tmp)) {
-        std::cerr << "invalid number: " << optarg << std::endl;
-       usage(argv[0]);
-       exit(1);
-      }
-      bufsize = static_cast<size_t>(tmp);
-      break;
-#endif
-
     case 's':
       output_shorts = true;
       break;
@@ -331,8 +321,6 @@
 
   install_sig_handler(SIGINT, sig_handler);
 
-
-  typedef boost::shared_ptr<rx_nop_handler> handler_sptr;
   handler_sptr handler;
 
   if (output_filename){
@@ -417,8 +405,8 @@
   u2->stop_rx_streaming();
 
   if (verbose){
-    printf("\nCopy handler called %zd times.\n", handler->nframes());
-    printf("Copy handler called with %zd bytes.\n\n", 
handler->nsamples()*sizeof(uint32_t));
+    printf("\nCopy handler called %li times.\n", handler->nframes());
+    printf("Copy handler called with %li bytes.\n\n", 
handler->nsamples()*sizeof(uint32_t));
     printf("Elapsed time was %5.3f seconds.\n", elapsed);
     printf("Packet rate was %1.0f pkts/sec.\n", pps);
     printf("Approximate throughput was %5.2f MB/sec.\n", mbs);

Deleted: usrp2/trunk/host-ng/apps/test_usrp2.cc





reply via email to

[Prev in Thread] Current Thread [Next in Thread]