Skip to content

Commit

Permalink
Merge pull request #566 from nomis52/master
Browse files Browse the repository at this point in the history
Cleanup.
  • Loading branch information
nomis52 committed Dec 9, 2014
2 parents 6fbfa46 + 659e514 commit 031a36a
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 29 deletions.
10 changes: 6 additions & 4 deletions common/rdm/CommandPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,18 +388,20 @@ void CommandPrinter::DisplayParamData(
bool is_get,
const uint8_t *param_data,
unsigned int data_length) {
if (!data_length)
if (!data_length) {
return;
}

*m_output << " Param data:" << endl;
if (unpack_param_data && pid_descriptor) {
const Descriptor *descriptor = NULL;
if (is_request)
if (is_request) {
descriptor = (is_get ?
pid_descriptor->GetRequest() : pid_descriptor->GetRequest());
else
pid_descriptor->GetRequest() : pid_descriptor->SetRequest());
} else {
descriptor = (is_get ?
pid_descriptor->GetResponse() : pid_descriptor->SetResponse());
}

if (descriptor) {
auto_ptr<const Message> message(
Expand Down
2 changes: 1 addition & 1 deletion common/rdm/VariableFieldSizeCalculator.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class VariableFieldSizeCalculator
MISMATCHED_SIZE,
} calculator_state;

VariableFieldSizeCalculator() {}
VariableFieldSizeCalculator() : m_fixed_size_sum(0) {}
~VariableFieldSizeCalculator() {}

bool Descend() const { return false; }
Expand Down
10 changes: 7 additions & 3 deletions plugins/artnet/ArtNetNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,11 +437,15 @@ uint8_t ArtNetNodeImpl::GetOutputPortUniverse(uint8_t port_id) {

void ArtNetNodeImpl::DisableOutputPort(uint8_t port_id) {
OutputPort *port = GetOutputPort(port_id);
if (!port) {
return;
}

bool was_enabled = port->enabled;
if (port)
port->enabled = false;
if (was_enabled)
port->enabled = false;
if (was_enabled) {
SendPollReplyIfRequired();
}
}

bool ArtNetNodeImpl::OutputPortState(uint8_t port_id) const {
Expand Down
7 changes: 3 additions & 4 deletions plugins/e131/e131/BaseInflator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,23 +256,22 @@ bool BaseInflator::InflatePDU(HeaderSet *headers,
* before either the next inflator or handle_data is called.
* @return false will cease processing this PDU
*/
bool BaseInflator::PostHeader(uint32_t, const HeaderSet &headers) {
bool BaseInflator::PostHeader(OLA_UNUSED uint32_t,
OLA_UNUSED const HeaderSet &headers) {
return true;
(void) headers;
}


/*
* The base handle data method - does nothing
*/
bool BaseInflator::HandlePDUData(uint32_t vector,
const HeaderSet &headers,
OLA_UNUSED const HeaderSet &headers,
const uint8_t *,
unsigned int) {
OLA_WARN << "In BaseInflator::HandlePDUData, someone forgot to add"
<< " a handler, vector id " << vector;
return false;
(void) headers;
}
} // namespace e131
} // namespace plugin
Expand Down
3 changes: 1 addition & 2 deletions plugins/e131/e131/BaseInflatorTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,13 @@ class TestInflator: public ola::plugin::e131::BaseInflator {
return true;
}

bool HandlePDUData(uint32_t vector, const HeaderSet &headers,
bool HandlePDUData(uint32_t vector, OLA_UNUSED const HeaderSet &headers,
const uint8_t *data, unsigned int pdu_length) {
OLA_ASSERT_EQ((uint32_t) 289, vector);
OLA_ASSERT_EQ((unsigned int) sizeof(PDU_DATA), pdu_length);
OLA_ASSERT_FALSE(memcmp(data, PDU_DATA, pdu_length));
m_blocks_handled++;
return true;
(void) headers;
}

private:
Expand Down
3 changes: 1 addition & 2 deletions plugins/e131/e131/E131Node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,7 @@ void E131Node::NewDiscoveryPage(
void E131Node::SendDiscoveryPage(const std::vector<uint16_t> &universes,
uint8_t this_page,
uint8_t last_page,
uint32_t sequence_number) {
(void) sequence_number; // not used yet
OLA_UNUSED uint32_t sequence_number) {
uint16_t in_this_page = static_cast<uint16_t>(this_page == last_page ?
universes.size() % DISCOVERY_PAGE_SIZE : DISCOVERY_PAGE_SIZE);

Expand Down
10 changes: 4 additions & 6 deletions plugins/e131/e131/PDUTestCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,14 @@ class FakePDU: public PDU {
return true;
}

bool PackHeader(uint8_t *data, unsigned int *length) const {
bool PackHeader(OLA_UNUSED uint8_t *data,
OLA_UNUSED unsigned int *length) const {
return true;
(void) data;
(void) length;
}

bool PackData(uint8_t *data, unsigned int *length) const {
bool PackData(OLA_UNUSED uint8_t *data,
OLA_UNUSED unsigned int *length) const {
return true;
(void) data;
(void) length;
}

void Write(ola::io::OutputStream *stream) const {
Expand Down
4 changes: 1 addition & 3 deletions plugins/e131/e131/RDMPDU.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,7 @@ class RDMPDU: public PDU {
bool PackHeader(uint8_t *data, unsigned int *length) const;
bool PackData(uint8_t *data, unsigned int *length) const;

void PackHeader(ola::io::OutputStream *stream) const {
(void) stream;
}
void PackHeader(OLA_UNUSED ola::io::OutputStream *stream) const {}

void PackData(ola::io::OutputStream *stream) const;

Expand Down
6 changes: 2 additions & 4 deletions plugins/e131/e131/RootInflator.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,13 @@ class NullInflator : public InflatorInterface {
public:
uint32_t Id() const { return ola::acn::VECTOR_ROOT_NULL; }

unsigned int InflatePDUBlock(HeaderSet *headers,
const uint8_t *data,
unsigned int InflatePDUBlock(OLA_UNUSED HeaderSet *headers,
OLA_UNUSED const uint8_t *data,
unsigned int len) {
if (len) {
OLA_WARN << "VECTOR_ROOT_NULL contained data of size " << len;
}
return 0;
(void) data;
(void) headers;
}
};

Expand Down
1 change: 1 addition & 0 deletions plugins/espnet/RunLengthDecoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ void RunLengthDecoder::Decode(DmxBuffer *dst,
break;
case ESCAPE_VALUE:
value++;
// fall through
default:
dst->SetChannel(i, *value);
i++;
Expand Down

0 comments on commit 031a36a

Please sign in to comment.