Skip to content

cleaned up some casts#8272

Open
firewave wants to merge 1 commit intodanmar:mainfrom
firewave:cast-z
Open

cleaned up some casts#8272
firewave wants to merge 1 commit intodanmar:mainfrom
firewave:cast-z

Conversation

@firewave
Copy link
Collaborator

No description provided.

@firewave
Copy link
Collaborator Author

Not a thorough review but just some things which accumulated over time.

@firewave firewave marked this pull request as draft February 27, 2026 13:58
@firewave firewave marked this pull request as ready for review March 1, 2026 00:01
@sonarqubecloud
Copy link

sonarqubecloud bot commented Mar 1, 2026

<< " " << ATTR_CALL_ARGVALUETYPE << "=\"" << static_cast<unsigned>(callValueType) << "\""
<< " " << ATTR_CALL_ARGVALUE << "=\"" << callArgValue.value << "\""
<< " " << ATTR_CALL_UNKNOWN_FUNCTION_RETURN << "=\"" << static_cast<int>(callArgValue.unknownFunctionReturn) << "\"";
<< " " << ATTR_CALL_UNKNOWN_FUNCTION_RETURN << "=\"" << static_cast<unsigned>(callArgValue.unknownFunctionReturn) << "\"";
Copy link
Owner

Choose a reason for hiding this comment

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

Why is it important to use unsigned instead of int.

I am not against this and would likely accept such unsigned use if this was new code. But if you refactor you need to have some important reasons. We could get a commit battle where somebody else thinks that it should be plain int and send me a PR about that. I see no clear reasons to use neither int nor unsigned here.

Using unsigned just because the value is always positive is not a good reason in my opinion. That is dangerous approach and leads to conversion problems.

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