[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 06/16: digital: whitespace fixes
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 06/16: digital: whitespace fixes |
Date: |
Tue, 21 Jul 2015 19:27:51 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
trondeau pushed a commit to branch master
in repository gnuradio.
commit a6d1ca5b73041af374b3dbc080f964efb00681fb
Author: Felix Wunsch <address@hidden>
Date: Fri Jul 17 14:55:46 2015 +0200
digital: whitespace fixes
---
gr-digital/lib/crc32_bb_impl.cc | 75 +++++++++++++++++++----------------------
1 file changed, 35 insertions(+), 40 deletions(-)
diff --git a/gr-digital/lib/crc32_bb_impl.cc b/gr-digital/lib/crc32_bb_impl.cc
index 845f4a2..dfb5bb2 100644
--- a/gr-digital/lib/crc32_bb_impl.cc
+++ b/gr-digital/lib/crc32_bb_impl.cc
@@ -31,42 +31,37 @@ namespace gr {
namespace digital {
crc32_bb::sptr
- crc32_bb::make(bool check, const std::string& lengthtagname)
- {
- return gnuradio::get_initial_sptr (new crc32_bb_impl(check,
lengthtagname));
+ crc32_bb::make(bool check, const std::string &lengthtagname) {
+ return gnuradio::get_initial_sptr(new crc32_bb_impl(check,
lengthtagname));
}
- crc32_bb_impl::crc32_bb_impl(bool check, const std::string& lengthtagname)
- : tagged_stream_block("crc32_bb",
- io_signature::make(1, 1, sizeof (char)),
- io_signature::make(1, 1, sizeof (char)),
- lengthtagname),
- d_check(check),
- d_npass(0), d_nfail(0)
- {
+ crc32_bb_impl::crc32_bb_impl(bool check, const std::string &lengthtagname)
+ : tagged_stream_block("crc32_bb",
+ io_signature::make(1, 1, sizeof(char)),
+ io_signature::make(1, 1, sizeof(char)),
+ lengthtagname),
+ d_check(check),
+ d_npass(0), d_nfail(0) {
set_tag_propagation_policy(TPP_DONT);
}
- crc32_bb_impl::~crc32_bb_impl()
- {
+ crc32_bb_impl::~crc32_bb_impl() {
}
int
- crc32_bb_impl::calculate_output_stream_length(const gr_vector_int
&ninput_items)
- {
+ crc32_bb_impl::calculate_output_stream_length(const gr_vector_int
&ninput_items) {
if (d_check) {
- return ninput_items[0] - 4;
+ return ninput_items[0] - 4;
} else {
- return ninput_items[0] + 4;
+ return ninput_items[0] + 4;
}
}
int
- crc32_bb_impl::work (int noutput_items,
- gr_vector_int &ninput_items,
- gr_vector_const_void_star &input_items,
- gr_vector_void_star &output_items)
- {
+ crc32_bb_impl::work(int noutput_items,
+ gr_vector_int &ninput_items,
+ gr_vector_const_void_star &input_items,
+ gr_vector_void_star &output_items) {
const unsigned char *in = (const unsigned char *) input_items[0];
unsigned char *out = (unsigned char *) output_items[0];
long packet_length = ninput_items[0];
@@ -75,32 +70,32 @@ namespace gr {
if (d_check) {
d_crc_impl.reset();
- d_crc_impl.process_bytes(in, packet_length-4);
+ d_crc_impl.process_bytes(in, packet_length - 4);
crc = d_crc_impl();
- if (crc != *(unsigned int *)(in+packet_length-4)) { // Drop package
- d_nfail++;
- return 0;
- }
- d_npass++;
- memcpy((void *) out, (const void *) in, packet_length-4);
+ if (crc != *(unsigned int *) (in + packet_length - 4)) { // Drop
package
+ d_nfail++;
+ return 0;
+ }
+ d_npass++;
+ memcpy((void *) out, (const void *) in, packet_length - 4);
} else {
d_crc_impl.reset();
d_crc_impl.process_bytes(in, packet_length);
crc = d_crc_impl();
- memcpy((void *) out, (const void *) in, packet_length);
- memcpy((void *) (out + packet_length), &crc, 4); // FIXME
big-endian/little-endian, this might be wrong
+ memcpy((void *) out, (const void *) in, packet_length);
+ memcpy((void *) (out + packet_length), &crc, 4); // FIXME
big-endian/little-endian, this might be wrong
}
- std::vector<tag_t> tags;
- get_tags_in_range(tags, 0, nitems_read(0), nitems_read(0)+packet_length);
+ std::vector <tag_t> tags;
+ get_tags_in_range(tags, 0, nitems_read(0), nitems_read(0) +
packet_length);
for (size_t i = 0; i < tags.size(); i++) {
- tags[i].offset -= nitems_read(0);
- if (d_check && tags[i].offset > (unsigned
int)(packet_length+packet_size_diff)) {
- tags[i].offset = packet_length-5;
- }
- add_item_tag(0, nitems_written(0) + tags[i].offset,
- tags[i].key,
- tags[i].value);
+ tags[i].offset -= nitems_read(0);
+ if (d_check && tags[i].offset > (unsigned int) (packet_length +
packet_size_diff)) {
+ tags[i].offset = packet_length - 5;
+ }
+ add_item_tag(0, nitems_written(0) + tags[i].offset,
+ tags[i].key,
+ tags[i].value);
}
return packet_length + packet_size_diff;
- [Commit-gnuradio] [gnuradio] 15/16: Merge remote-tracking branch 'fewu/crc32_unpack', (continued)
- [Commit-gnuradio] [gnuradio] 15/16: Merge remote-tracking branch 'fewu/crc32_unpack', git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 01/16: updates to waterfall for suchsamples, git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 10/16: Merge remote-tracking branch 'namccart/master' into master_waterfall_pdu, git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 07/16: digital: added an option to the crc32_bb block that adds the unpacked CRC to the bit stream, git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 12/16: qtgui: protect PDU handling waterfall port for wrong data type., git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 09/16: Merge remote-tracking branch 'jdemel/fec/fix-extended_encoder', git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 16/16: Merge branch 'maint', git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 11/16: qtgui: waterfall PDU handling, git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 13/16: qtgui: pdu handler for float waterfall plot., git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 14/16: qtgui: waterfall plots, git, 2015/07/21
- [Commit-gnuradio] [gnuradio] 06/16: digital: whitespace fixes,
git <=