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

Implement type conversion for simple numeric types #72

Merged
merged 1 commit into from
Nov 14, 2023

Conversation

mattjala
Copy link
Collaborator

@mattjala mattjala commented Sep 21, 2023

Several of the helpers here are copied from the DAOS VOL's datatype code.

Tests for this are implemented in HDFGroup/vol-tests#62.

Fix for #6

@mattjala mattjala added the enhancement New feature or request label Sep 21, 2023
@mattjala mattjala marked this pull request as draft September 21, 2023 18:52
@mattjala mattjala marked this pull request as ready for review October 2, 2023 15:59
&transfer_info[i].tconv_buf, &transfer_info[i].bkg_buf, NULL, &fill_bkg);

/* Perform type conversion on response values */
memset(transfer_info[i].tconv_buf, 0, file_type_size * (size_t)mem_select_npoints);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since TRUE is passed above for clear_tconv_buf, there's no need to memset it here since it will be allocated with calloc

"failed to parse member of compound type");

if (RV_json_values_to_binary_recursive(member_val, member_dtype_id,
(void *)((char *)value_buffer + offset)) < 0)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This will probably work for packed compound types, but if the compound datatype has padding in it in the same way that the natural C struct likely does, this will be problematic. Best to use H5Tget_member_offset to get the member offsets instead of assuming they're linearly next to each other

Copy link
Collaborator

@jhendersonHDF jhendersonHDF left a comment

Choose a reason for hiding this comment

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

Merging this for the functionality it brings, but there are a few minor improvements that can be made in the future.

@jhendersonHDF jhendersonHDF merged commit fbded14 into HDFGroup:master Nov 14, 2023
10 checks passed
@mattjala mattjala deleted the type_conversion branch March 21, 2024 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants