Skip to content

Add qsort and bsearch safe rules#258

Merged
nunoplopes merged 2 commits into
Cpp2Rust:masterfrom
lucic71:safe-bsearch-qsort
Jul 16, 2026
Merged

Add qsort and bsearch safe rules#258
nunoplopes merged 2 commits into
Cpp2Rust:masterfrom
lucic71:safe-bsearch-qsort

Conversation

@lucic71

@lucic71 lucic71 commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread rules/cstdlib/tgt_refcount.rs Outdated
let mut __hi: isize = a2 as isize - 1;
let mut __found: Option<AnyPtr> = None;
while __lo <= __hi && __found.is_none() {
let __mid = (__lo + __hi) / 2;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I replaced (lo + hi) / 2 with lo + (hi - lo) / 2)

@nunoplopes nunoplopes merged commit a50ac5a into Cpp2Rust:master Jul 16, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants