From 87269f084c8ff5eb28b9a4f242ef8bf310a14ede Mon Sep 17 00:00:00 2001 From: Bastian Bloessl Date: Wed, 5 Jun 2013 08:22:55 +0200 Subject: [PATCH] packet pad: make parameters unsigned --- grc/foo_packet_pad.xml | 3 +++ include/foo/packet_pad.h | 2 +- lib/packet_pad_impl.cc | 7 ++----- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/grc/foo_packet_pad.xml b/grc/foo_packet_pad.xml index 382b796..8b71562 100644 --- a/grc/foo_packet_pad.xml +++ b/grc/foo_packet_pad.xml @@ -37,6 +37,9 @@ int + $pad_front >= 0 + $pad_tail >= 0 + in complex diff --git a/include/foo/packet_pad.h b/include/foo/packet_pad.h index 5d751c7..81970da 100644 --- a/include/foo/packet_pad.h +++ b/include/foo/packet_pad.h @@ -28,7 +28,7 @@ class FOO_API packet_pad : virtual public gr::block public: typedef boost::shared_ptr sptr; - static sptr make(bool debug = false, int pad_front = 0, int pad_tail = 0); + static sptr make(bool debug = false, unsigned int pad_front = 0, unsigned int pad_tail = 0); }; diff --git a/lib/packet_pad_impl.cc b/lib/packet_pad_impl.cc index 50e3f58..8fc2760 100644 --- a/lib/packet_pad_impl.cc +++ b/lib/packet_pad_impl.cc @@ -29,16 +29,13 @@ static const int SYMBOL_LENGTH = 80; #define dout d_debug && std::cout public: -packet_pad_impl(bool debug, int pad_front, int pad_tail) : block("packet_pad", +packet_pad_impl(bool debug, unsigned int pad_front, unsigned int pad_tail) : block("packet_pad", gr::io_signature::make(1, 1, sizeof(gr_complex)), gr::io_signature::make(1, 1, sizeof(gr_complex))), d_debug(debug), d_pad_front(pad_front), d_pad_tail(pad_tail), d_front_left(0), d_tail_left(0), d_frame_left(0), d_state(IDLE) { - assert(pad_front >= 0); - assert(pad_tail >= 0); - set_relative_rate(1); set_output_multiple(SYMBOL_LENGTH); set_tag_propagation_policy(block::TPP_DONT); @@ -232,6 +229,6 @@ private: }; packet_pad::sptr -packet_pad::make(bool debug, int pad_front, int pad_tail) { +packet_pad::make(bool debug, unsigned int pad_front, unsigned int pad_tail) { return gnuradio::get_initial_sptr(new packet_pad_impl(debug, pad_front, pad_tail)); }