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

Unnecessary checking of h5 in nc4grp.c #782

Closed
edhartnett opened this issue Jan 19, 2018 · 3 comments · Fixed by #789
Closed

Unnecessary checking of h5 in nc4grp.c #782

edhartnett opened this issue Jan 19, 2018 · 3 comments · Fixed by #789

Comments

@edhartnett
Copy link
Contributor

Similar to #779.

@edhartnett
Copy link
Contributor Author

Why did you close this bug? The PR is not yet merged.

@WardF
Copy link
Member

WardF commented Jan 19, 2018

Because it didn’t contain any meaningful detail.

@edhartnett
Copy link
Contributor Author

From #779:

When I originally wrote nc4type.c Denis had not yet added the dispatch layer. So netCDF-4 functions from that era had to deal with it if they were called on a netCDF-3 file. This results in code snippets like this (from NC4_inq_typeid() in libsrc4/nc4type.c):

 /* Must be a netCDF-4 file. */
if (!h5)
   return NC_ENOTNC4;
This is no longer needed. Now the dispatch layer will only call these functions on netCDF-4 files. Classic files will not even cause this function to be called (and will return NC_ENOTNC4 on their own).

So I can now change these to asserts.

This is also true for nc4grp.c. Since I am dealing with these two separately, since I am putting them in different PRs, I also gave them separate issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants