mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-03 21:23:48 +00:00
[PR #1774] **[IMPROVEMENT]** Port hex_to_int from C to Rust #2501
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/CCExtractor/ccextractor/pull/1774
Author: @ishwarthecodddr
Created: 11/29/2025
Status: 🔄 Open
Base:
master← Head:port-hex-to-int📝 Commits (10+)
3e67f5dfix(708_output): replace sprintf with snprintf for buffer safety10e105dstyle: fix clang-format issues in macro definitions1e82253fix(708_output): replace sprintf with snprintf for buffer safety2d355b6style: fix clang-format issues in macro definitions9592e27fix(rust): prevent panics in timing code when processing multiple files8a6b9e3Initial planef539faRemove unintended Cargo.lock changesc91f806Initial pland6bae9bPort hex_to_int from C to Rust2cf6d06cleaned commits📊 Changes
7 files changed (+323 additions, -499 deletions)
View changed files
📝
src/lib_ccx/general_loop.c(+2 -2)📝
src/lib_ccx/utility.c(+7 -0)📝
src/rust/Cargo.lock(+277 -497)➕
src/rust/lib_ccxr/src/util/hex.rs(+28 -0)📝
src/rust/lib_ccxr/src/util/mod.rs(+1 -0)📝
src/rust/src/libccxr_exports/mod.rs(+1 -0)➕
src/rust/src/libccxr_exports/util.rs(+7 -0)📄 Description
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.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.