switch source package format to 3.0 quilt
[debian/gnuradio] / gnuradio-core / src / lib / filter / gr_pfb_clock_sync_ccf.cc
index 433b7d6133f4c04e6991e6af34d94dd44fe68e2e..ff4fb70a36eed08aa623374a0ccf3e2128c622f3 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2009 Free Software Foundation, Inc.
+ * Copyright 2009,2010 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
@@ -45,8 +45,8 @@ gr_pfb_clock_sync_ccf_sptr gr_make_pfb_clock_sync_ccf (double sps, float gain,
                                                                max_rate_deviation));
 }
 
-int ios[] = {sizeof(gr_complex), sizeof(float), sizeof(float), sizeof(float)};
-std::vector<int> iosig(ios, ios+sizeof(ios)/sizeof(int));
+static int ios[] = {sizeof(gr_complex), sizeof(float), sizeof(float), sizeof(float)};
+static std::vector<int> iosig(ios, ios+sizeof(ios)/sizeof(int));
 gr_pfb_clock_sync_ccf::gr_pfb_clock_sync_ccf (double sps, float gain,
                                              const std::vector<float> &taps,
                                              unsigned int filter_size,
@@ -93,9 +93,16 @@ gr_pfb_clock_sync_ccf::~gr_pfb_clock_sync_ccf ()
 {
   for(int i = 0; i < d_nfilters; i++) {
     delete d_filters[i];
+    delete d_diff_filters[i];
   }
 }
 
+bool
+gr_pfb_clock_sync_ccf::check_topology(int ninputs, int noutputs)
+{
+  return noutputs == 1 || noutputs == 4;
+}
+
 void
 gr_pfb_clock_sync_ccf::set_taps (const std::vector<float> &newtaps,
                                 std::vector< std::vector<float> > &ourtaps,
@@ -219,8 +226,8 @@ gr_pfb_clock_sync_ccf::general_work (int noutput_items,
   gr_complex *in = (gr_complex *) input_items[0];
   gr_complex *out = (gr_complex *) output_items[0];
 
-  float *err, *outrate, *outk;
-  if(output_items.size() > 2) {
+  float *err = 0, *outrate = 0, *outk = 0;
+  if(output_items.size() == 4) {
     err = (float *) output_items[1];
     outrate = (float*)output_items[2];
     outk = (float*)output_items[3];
@@ -271,7 +278,7 @@ gr_pfb_clock_sync_ccf::general_work (int noutput_items,
     i++;
     count += (int)floor(d_sps);
 
-    if(output_items.size() > 2) {
+    if(output_items.size() == 4) {
       err[i] = error;
       outrate[i] = d_rate_f;
       outk[i] = d_k;