dds_stream now inherits from dds_stream_base - #11036
Conversation
| union dds_stream_uid | ||
| { | ||
| uint32_t whole; | ||
| uint32_t whole = 0; |
There was a problem hiding this comment.
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.
Hehe
And the default ctor?
There was a problem hiding this comment.
Good point. It was hidden in a collapsed part of the code.
But seeing the two added initializations made me wonder which initialization prevails :-)
| } | ||
|
|
||
| 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.
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.
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.
No need to change in default constructor as well?
There was a problem hiding this comment.
No, the default uses the = 0 from above.
Plus:
Tracked on LRS-502 (I think?)