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

Remove the hash_size param from H5Iregister_type() #5170

Merged
merged 14 commits into from
Dec 10, 2024

Conversation

derobins
Copy link
Member

@derobins derobins commented Dec 8, 2024

The hash_size parameter of H5Iregister_type() hasn't been used since 1.8.
It's been removed and the API call has been versioned.

This PR also updates the make_vers script to handle v2.0.0.

Fixes #4344

Dana Robinson added 9 commits December 2, 2024 08:41
* Add the function call (copy of existing H5Iregister_type)
* Add H5Ideprec.c
* Remove the hash_size parameter from H5Iregister_type
* Copy the basic test in tid.c and use the register1 call instead
* No make_vers changes at this time
* Update bin/make_vers to handle v200
* H5Iregister_type() --> H5Iregister_type2()

The bin/make_vers script could still use some cleanup regarding the
hash table / index magic, which seems over-complicated.

Also, H5Iregister_type1/2 should have common code extracted.
Replaces the overly complicated file parse with something a LOT simpler.
@derobins derobins added Priority - 2. Medium ⏹ It would be nice to have this in the next release Component - C Library Core C library issues (usually in the src directory) Type - Improvement Improvements that don't add a new feature or functionality labels Dec 8, 2024
} else {
die "unknown line type: $line";
$api_vers_to_type_vers{$hash_vers}{$name} = $curr_sym_number;
Copy link
Member Author

@derobins derobins Dec 8, 2024

Choose a reason for hiding this comment

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

All that index manipulation nonsense reduced to about a dozen lines of code that even handles the v111 complication without additional logic.

Copy link
Member Author

Choose a reason for hiding this comment

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

I reworked the whole script to just use an explicit list of supported versions. All that array index complexity was giving me a headache.

@derobins derobins added the Perl Related to Perl scripts label Dec 8, 2024
@hyoklee hyoklee assigned jhendersonHDF and byrnHDF and unassigned jhendersonHDF and byrnHDF Dec 9, 2024
*-------------------------------------------------------------------------
*/
H5I_type_t
H5I__register_type_common(unsigned reserved, H5I_free_t free_func)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Seems like this function should return a pointer to the registered class rather than H5I_type_t so that if an error occurs later the code can free the registered class if need be.

@derobins
Copy link
Member Author

I'm going to go ahead and merge this to get the make_vers changes in. I'll address Jordan's comment in a future PR.

@derobins derobins merged commit 8f2c03b into HDFGroup:develop Dec 10, 2024
68 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component - C Library Core C library issues (usually in the src directory) Perl Related to Perl scripts Priority - 2. Medium ⏹ It would be nice to have this in the next release Type - Improvement Improvements that don't add a new feature or functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove the hash_size parameter from H5Iregister_type()
5 participants