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

Use explicit casts in nc4_convert_type to silence warnings #2808

Merged
merged 2 commits into from
Dec 22, 2023

Conversation

ZedThree
Copy link
Contributor

No description provided.

Copy link
Collaborator

@DennisHeimbigner DennisHeimbigner left a comment

Choose a reason for hiding this comment

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

I am confused by the changes to nc4var.c.
For example, line 729 is left as:
*sp++ = *ubp++;
but should it not be this?
*sp++ = (short)*ubp++;

@ZedThree
Copy link
Contributor Author

So I only added casts to lines that generate conversion warnings. I'm pretty sure that unsigned char* is implicitly castable to any other type, as it's used for raw memory access.

I could add the casts to the other lines here for consistency.

@DennisHeimbigner
Copy link
Collaborator

So I only added casts to lines that generate conversion warnings. I'm pretty sure that unsigned char* is implicitly castable to any other type, as it's used for raw memory access.

I could add the casts to the other lines here for consistency.

Thanks for the clarification. No need to modify for consistency, I think.

@WardF WardF merged commit 6e636ef into Unidata:main Dec 22, 2023
97 checks passed
@ZedThree ZedThree deleted the explicit-casts-in-nc4var branch January 3, 2024 17:30
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