-
Notifications
You must be signed in to change notification settings - Fork 507
**[IMPROVEMENT]** Port hex_to_int from C to Rust #1774
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
base: master
Are you sure you want to change the base?
**[IMPROVEMENT]** Port hex_to_int from C to Rust #1774
Conversation
cfsmp3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work on this C-to-Rust port! I've done a deep review and the implementation is correct.
Results
- ✅ ALL CI tests pass on Linux (237/237)
- ✅ Would FIX 1 test that has never passed before (hardsubx sample 184)
- ✅ Faithful port - Rust behavior exactly matches C behavior
- ✅ Good test coverage with unit tests
- ✅ Proper FFI export with
extern "C"and#[no_mangle] - ✅ Correct conditional compilation pattern (
#ifndef DISABLE_RUST) - ✅ Changelog updated
Before Merge
Please rebase on master - the PR has merge conflicts.
Windows Build Failure
The Windows build failure is due to vcpkg infrastructure issues, not your code. This is a known issue affecting multiple PRs.
Once rebased, this is ready to merge!
Note: Both the C and Rust versions only handle lowercase hex ('a'-'f'). While uppercase ('A'-'F') support could be a nice enhancement, that would be a separate PR - your port correctly matches the existing C behavior.
|
Thanks @cfsmp3 for review and i have done the necessary changes , i think now it is ready to merge |
|
Maybe you haven't pushed yet?
…On Wed, Dec 17, 2025, 07:33 Ishwar ***@***.***> wrote:
*ishwarthecodddr* left a comment (CCExtractor/ccextractor#1774)
<#1774 (comment)>
Thanks @cfsmp3 <https://github.com/cfsmp3> for review and i have done the
necessary changes , i think now it is ready to merge
—
Reply to this email directly, view it on GitHub
<#1774 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABNMTWKWCBBH7ZAXKETGU334CD2LFAVCNFSM6AAAAACNRNOL6KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTMNRTHA3DQMZXGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
14d78c0 to
25fe3a2
Compare
|
@cfsmp3 it's done now. |
CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results, when compared to test for commit 588ad52...:
NOTE: The following tests have been failing on the master branch as well as the PR:
Congratulations: Merging this PR would fix the following tests:
All tests passing on the master branch were passed completely. Check the result page for more info. |
In raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
Description
This PR ports the hex_to_int utility function from C (src/lib_ccx/utility.c) to Rust (src/rust/lib_ccxr/src/util/hex.rs) as part of the ongoing Rust migration effort.
Changes
Created src/rust/lib_ccxr/src/util/hex.rs with the Rust implementation. Exposed the function via C-FFI in
src/rust/src/libccxr_exports/util.rs
Updated src/lib_ccx/utility.c to use the Rust implementation when DISABLE_RUST is not defined.
Changes :- Created src/rust/lib_ccxr/src/util/hex.rs with the Rust implementation.Exposed the function via C-FFI in src/rust/src/libccxr_exports/util.rs.
Updated :- src/lib_ccx/utility.c to use the Rust implementation when DISABLE_RUST is not defined.
Verification :- Ran cargo test -p lib_ccxr and verified that all tests passed, including the new
test_hex_to_int.