Fixing logging in new DBPSK and DQPSK.
[debian/gnuradio] / gr-atsc / src / lib / atsc_field_sync_demux.cc
index 070c901ad01f7bde2a7e614a02be4e791a7da27b..b6195c6dfe1a90b263bf26e1f88e127ecb85e23d 100644 (file)
@@ -6,7 +6,7 @@
  * 
  * GNU Radio is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
+ * the Free Software Foundation; either version 3, or (at your option)
  * any later version.
  * 
  * GNU Radio is distributed in the hope that it will be useful,
 #include <atsci_syminfo.h>
 #include <stdio.h>
 #include <assert.h>
-#include <iostream.h>
+#include <iostream>
+
+using std::cerr;
+using std::endl;
 
-using std::abs;
 
 static const int        DEC = ATSC_DATA_SEGMENT_LENGTH; // nominal decimation factor
 
@@ -50,8 +52,8 @@ atsc_field_sync_demux::atsc_field_sync_demux()
                  gr_make_io_signature(2, 2, sizeof(float)),
                  gr_make_io_signature(1, 1, sizeof(atsc_soft_data_segment))),
                  d_locked(false), d_in_field2(true), d_segment_number(0),
-                 d_next_input(0), d_lost_index(0), d_inputs0_size(0),
-                 d_inputs0_index(0), d_consume(0)
+                 d_next_input(0), d_lost_index(0), d_inputs0_index(0), 
+                  d_inputs0_size(0), d_consume(0)
 {
   reset();
 }
@@ -100,7 +102,7 @@ atsc_field_sync_demux::work (int noutput_items,
 
   assert(sizeof(float) == sizeof(atsc::syminfo));
 
-  int  ii = 0;         // input index
+  unsigned int  ii = 0;         // input index
 
   // Are we in sync?
   if (!tag_is_seg_sync_or_field_sync (input_tags[0])){      // No ...
@@ -153,7 +155,7 @@ atsc_field_sync_demux::work (int noutput_items,
 
   while (k < noutput_items){
 
-    if (d_inputs0_size - ii <  ATSC_DATA_SEGMENT_LENGTH){
+    if (d_inputs0_size - ii <  static_cast<unsigned int>(ATSC_DATA_SEGMENT_LENGTH)){
       // We're out of input data.
       cerr << "atsc_field_sync_demux: ran out of input data\n";
       d_next_input += ii;       // update for forecast