-
Notifications
You must be signed in to change notification settings - Fork 324
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
Fixed pedantic toolchain warnings. #229
base: master
Are you sure you want to change the base?
Conversation
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.
Minor changes requested to get rid of casts. Otherwise looks good.
tests/test-reader.c
Outdated
@@ -184,7 +189,7 @@ int check_boms(void) | |||
failed++; | |||
} | |||
else { | |||
if (parser.unread != check) { | |||
if ((int)parser.unread != check) { |
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.
Same here, avoid casts.
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.
The cast still needs to be there, to avoid compiler warnings. However, I improved the logic. Please see the new line 187.
src/api.c
Outdated
@@ -121,7 +121,7 @@ yaml_stack_extend(void **start, void **top, void **end) | |||
void *new_start; | |||
|
|||
if ((char *)*end - (char *)*start >= INT_MAX / 2) | |||
return 0; | |||
return 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.
Isn't the indent broken?
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.
Yes, it is. Another reason to fully use 4 spaces / tab / {}, so autoformating tools will not struggle
Can this go into the master yet? Is there still something remaining, @nobu @pantoniou ? I can help/fix that, if needed. |
Our toolchain is very pedantic. I fixed several issues it pointed out.