-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
dds_stream now inherits from dds_stream_base #11036
Conversation
@@ -15,7 +15,7 @@ namespace realdds { | |||
|
|||
union dds_stream_uid | |||
{ | |||
uint32_t whole; | |||
uint32_t whole = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant
If a non-static data member has a default member initializer and also appears in a member initializer list, then the member initializer is used and the default member initializer is ignored
cppreference
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hehe
And the default ctor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. It was hidden in a collapsed part of the code.
But seeing the two added initializations made me wonder which initialization prevails :-)
@@ -184,32 +186,31 @@ bool dds_device::impl::init() | |||
LOG_ERROR( "Got VIDEO_STREAM_PROFILES with no data" ); | |||
break; | |||
} | |||
|
|||
for( size_t i = 0; i < video_stream_profiles->num_of_profiles; ++i ) | |||
if( _streams.size() >= _expected_num_of_streams ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to add video_stream_profiles->num_of_profiles.
And Error only if greater than, when equals need to advance state machine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're about to add a stream.
If we already have what we expected (or greater) then we throw an error.
What do the number of profiles have to do with it?
, index( static_cast< int8_t >( index_ )) | ||
{} | ||
{ | ||
whole = 0; // it covers an extra byte, which needs to be 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to change in default constructor as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the default uses the = 0
from above.
Plus:
Tracked on LRS-502 (I think?)