Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some more issues #573

Merged
merged 17 commits into from
Dec 30, 2014
Merged

Conversation

peternewman
Copy link
Member

No description provided.

@peternewman
Copy link
Member Author

Can you take particular care checking the RDM sniffer stuff @nomis52 as I don't have a way to test it.

@nomis52
Copy link
Member

nomis52 commented Dec 12, 2014

LGTM

@@ -327,8 +333,8 @@ void RDMSniffer::DisplayDmxFrame() {
void RDMSniffer::DisplayAlternateFrame() {
unsigned int slot_count = m_frame.Size() - 1;
MaybePrintTimestamp();
cout << "SC 0x" << std::hex << std::setw(2) << static_cast<int>(m_frame[0])
<< " " << std::dec << slot_count << ":" << std::hex;
cout << "SC " << IntToHexString(m_frame[0])
Copy link
Member

Choose a reason for hiding this comment

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

I think you want IntToHexString(m_frame[0], 2) here

Copy link
Member

Choose a reason for hiding this comment

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

Also IntToHexString is rather expensive. I'd probably stick to what we had here.

Copy link
Member Author

Choose a reason for hiding this comment

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

Because m_frame is a uint8_t, it will use that version of IntToHexString surely, passing in 8/4=2. Is the expense just creating the ostringstream? Would making it inline guarantee the compiler optimised it? Alternatively, what if I did a version where you could pass in a pointer to a stream (e.g. cout) like the FormatData function? Also just noticed the old code missed the zero padding bit that IntToHexString does.

@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 0fb641a on peternewman:libusb into 2779984 on OpenLightingProject:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.0%) when pulling c7dd4cb on peternewman:libusb into 1d2c766 on OpenLightingProject:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0%) when pulling 03bd22f on peternewman:libusb into 3f007bf on OpenLightingProject:master.

@nomis52
Copy link
Member

nomis52 commented Dec 16, 2014

Were you still planning to make the change I sent you on irc?

@peternewman
Copy link
Member Author

Yep, I just got distracted fixing bugs in #575 .

@peternewman peternewman self-assigned this Dec 16, 2014
@coveralls
Copy link

Coverage Status

Coverage remained the same when pulling 99b2008 on peternewman:libusb into 4e057fd on OpenLightingProject:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.0%) when pulling c476723 on peternewman:libusb into 242d13b on OpenLightingProject:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) when pulling 1492c0f on peternewman:libusb into 242d13b on OpenLightingProject:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) when pulling a7c97f5 on peternewman:libusb into 242d13b on OpenLightingProject:master.

@peternewman
Copy link
Member Author

I think this is ready to merge if you're happy @nomis52 . I guess I should switch IntToHexString to use ToHex internally too, and perhaps deprecate it?

@peternewman peternewman assigned nomis52 and unassigned peternewman Dec 30, 2014
*/
template<typename T>
_ToHex<T> ToHex(T v, bool prefix = true) {
// TODO(Peter): This may break if we get a type that doesn't have digits
Copy link
Member

Choose a reason for hiding this comment

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

That's fine, it's a compile time error. You can remove the TODO

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) when pulling 2450bcb on peternewman:libusb into 242d13b on OpenLightingProject:master.

@nomis52
Copy link
Member

nomis52 commented Dec 30, 2014

LGTM

@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) when pulling 3829a74 on peternewman:libusb into 242d13b on OpenLightingProject:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) when pulling 7952638 on peternewman:libusb into 242d13b on OpenLightingProject:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) when pulling 7952638 on peternewman:libusb into 242d13b on OpenLightingProject:master.

peternewman added a commit that referenced this pull request Dec 30, 2014
@peternewman peternewman merged commit 58e9e68 into OpenLightingProject:master Dec 30, 2014
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.

None yet

3 participants