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

Line 199, BLEScanner::checkReportForUuid -- Remove const specifier fr… #809

Closed
wants to merge 1 commit into from

Conversation

ScottCase-Stemco
Copy link

…om uuid variable.

The local variable uuid in function bool BLEScanner::checkReportForUuid was defined as const, but it was not initialized with a value and is later assigned one (on lines 210 or 216). A const variable must be declared with an initial value, which cannot be changed. What is needed here is not a const value, but a cast where uuid was assigned a value. This was done correctly in one spot, but not on the other.

…om uuid variable.

The local variable uuid in function bool BLEScanner::checkReportForUuid was defined as const, but it was not initialized with a value and is later assigned one (on lines 210 or 216). A const variable must be declared with an initial value, which cannot be changed. What is needed here is not a const value, but a cast where uuid was assigned a value. This was done correctly in one spot, but not on the other.
Copy link
Member

@hathach hathach left a comment

Choose a reason for hiding this comment

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

You probably misunderstand the purpose, it is pointer to "const memory", the pointer itself is not const.

@hathach hathach closed this Feb 6, 2024
@ScottCase-Stemco
Copy link
Author

Thanks for the explanation, hathatch!

@ScottCase-Stemco ScottCase-Stemco deleted the patch-1 branch February 6, 2024 15:00
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.

2 participants