Port hex_string_to_int from C to Rust#2141
Port hex_string_to_int from C to Rust#2141Anayo-Anyafulu wants to merge 1 commit intoCCExtractor:masterfrom
Conversation
|
The DVB, General, and Options test failures are pre-existing and unrelated to this change. These same categories fail on master. All build checks and format checks are passing |
cfsmp3
left a comment
There was a problem hiding this comment.
Thanks for the port — the implementation is correct and tests pass. A few things to fix before merging:
-
Null check needed:
ccxr_hex_string_to_intcallsCStr::from_ptr()without checking if the pointer is null first. Please add a null guard. -
Squash commits: 7 commits is too many for this change. Please squash into 1-2 meaningful commits.
-
Unrelated change: There's a blank line removal in
utility.cthat's not related to this PR. Please revert it. -
Uppercase hex: The new Rust version accepts uppercase (A-F) while the C version only accepts lowercase (a-f). This is fine as an improvement, but please mention it in the PR description so it's documented as an intentional behavior change.
Once these are addressed this is ready to merge. Also note: #2139 will be closed in favor of this PR.
|
Thanks for the review! I'll address all four points — adding the null guard, squashing the commits, reverting the unrelated blank line in utility.c, and updating the PR description to document the uppercase hex behavior change. Will push the fixes shortly. |
079b2e2 to
28c895f
Compare
CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results, when compared to test for commit c3c5d9c...:
Your PR breaks these cases:
It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you). Check the result page for more info. |
CCExtractor CI platform finished running the test files on windows. Below is a summary of the test results, when compared to test for commit 8de778a...:
Congratulations: Merging this PR would fix the following tests:
All tests passed completely. Check the result page for more info. |
[IMPROVEMENT] Port
hex_string_to_intfrom C to RustIn raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
Clean port of
hex_string_to_intfrom C to Rust, following the same pattern as #2139.Changes
src/rust/lib_ccxr/src/util/hex.rs— Rust implementation reusinghex_char_to_valsrc/rust/src/libccxr_exports/util.rs— FFI export with added null checksrc/lib_ccx/utility.c—#ifndef DISABLE_RUSTguard addedNote: The Rust version now accepts uppercase hex (A-F), which is an intentional improvement over the original C version that only accepted lowercase (a-f).
Testing
All 48 Rust unit tests passing locally.