Skip to content

Initialize members of SPIDMXParser class - #1329

Merged
peternewman merged 12 commits into
OpenLightingProject:masterfrom
FloEdelmann:spidmx-fix
Dec 24, 2017
Merged

Initialize members of SPIDMXParser class#1329
peternewman merged 12 commits into
OpenLightingProject:masterfrom
FloEdelmann:spidmx-fix

Conversation

@FloEdelmann

@FloEdelmann FloEdelmann commented Nov 4, 2017

Copy link
Copy Markdown
Member

Addition to #1289, as requested in a comment after merging.

I don't know how to run Coverity myself, so I initialized all members. It builds without problems and all variables are reset before first proper use anyway, so it should not break anything.

Comment thread plugins/spidmx/SPIDMXParser.h Outdated
SPIDMXParser(DmxBuffer *buffer, Callback0<void> *callback)
: m_dmx_buffer(buffer),
m_callback(callback) {
state = WAIT_FOR_BREAK; // reset in ChangeState()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should all be prefixes with m_ and set using m_state(WAIT_FOR_BREAK)

@peternewman
peternewman requested a review from nomis52 December 18, 2017 12:01
@peternewman

Copy link
Copy Markdown
Member

If you're interested @FloEdelmann , there's details on Coverity Scan here:
https://scan.coverity.com/

You can sign up, run it on your own machine, and upload the results to the website for analysis. Or you could configure your own Travis instance to run it with your key.

@peternewman peternewman left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FloEdelmann , Travis is now complaining:
https://travis-ci.org/OpenLightingProject/ola/jobs/318397996#L3314

The class constructor needs to match the order of the variable in the code:
https://stackoverflow.com/questions/1564937/gcc-warning-will-be-initialized-after

@peternewman
peternewman merged commit a7af6be into OpenLightingProject:master Dec 24, 2017
@FloEdelmann
FloEdelmann deleted the spidmx-fix branch December 26, 2017 12:34
@peternewman peternewman added this to the 0.11.0 milestone Jun 12, 2018
@peternewman peternewman mentioned this pull request Jul 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants