-
Notifications
You must be signed in to change notification settings - Fork 830
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 conversion #7520
Fix conversion #7520
Conversation
d72da4f
to
647ab96
Compare
@bandi13 , seems like: |
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.
Lots of great cleanups for implicit casts. I don't foresee any portability issues. Will wait to merge until your response on my comment.
Oh for sure there are a ton more to do. I was basically going through by type of error, not based on file the error occurs in. At some point I ended up scripting some of the changes. Ultimately, I'd like to have |
byte *data; | ||
|
||
(void)heap; | ||
/* okmLen (2) + protocol|label len (1) + info len(1) + protocollen + | ||
* labellen + infolen */ | ||
len = 4 + protocolLen + labelLen + infoLen; | ||
len = (size_t)4 + protocolLen + labelLen + infoLen; |
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.
Prefer to solve with 4U
not cast to make unsigned.
@@ -1690,7 +1690,7 @@ const char* wolfSSL_get_shared_ciphers(WOLFSSL* ssl, char* buf, int len) | |||
return NULL; | |||
|
|||
cipher = wolfSSL_get_cipher_name_iana(ssl); | |||
len = min(len, (int)(XSTRLEN(cipher) + 1)); | |||
len = (int)min((word32)len, (int)(XSTRLEN(cipher) + 1)); |
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.
Our MIN() uses word32, however I'm not sure that is true for all cases. But for our testing purposes this should be fine.
Fix conversion
Fix issues related to
-Wconversion
and-Wsign-conversion
. Most notably where a variable needs to be cast to a different type. Not including implicit type upgrades that happen in equations (ie: uint8 + uint16).