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

Remove penultimate call to xstrdup in project from mtk. #1406

Merged
merged 1 commit into from
Jan 27, 2025
Merged

Conversation

robertlipe
Copy link
Collaborator

No description provided.

Copy link

codacy-production bot commented Jan 26, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.01% 0.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (ca990a1) 27426 17105 62.37%
Head commit (2168c78) 54859 (+27433) 34219 (+17114) 62.38% (+0.01%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#1406) 13 0 0.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

@tsteven4
Copy link
Collaborator

It's actually the antepenultimate call, don't forget jeeps/gpsusbcommon.cc

@robertlipe
Copy link
Collaborator Author

It's actually the antepenultimate call, don't forget jeeps/gpsusbcommon.cc

Busted.

That last call is in a pretty awkward place. I'm not sure that anyone but me has ever executed that code anyway, and it's deep in chain that leaks anyway, but it's a device path, so it doesn't make sense to care. So I may not fix that one "well." It's pretty clear we can soon remove xstrdup to remove it from temptation's path.

We're down to a single caller of xfopen, so maybe we just move it into gbfile. xrealloc and xcalloc are also only used there and could probably turn into a QByteArray pretty easily.

About our biggest use of xfoo any longer is, unsurprisingly, xmalloc and it tends to be in formats that we try not to touch.

Looking at xstrtoi(), I just don't know what we were thinking. Nothing looks for ERANGE. That can probably turn into std::fromChars() with only a dash of thinking about boundary cases.

It's mostly busy work that brings only risk and little value but gives us some closure to a decade of whittling these down.

@robertlipe robertlipe merged commit 27c1f7c into master Jan 27, 2025
40 checks passed
@robertlipe robertlipe deleted the mtk_scrub branch January 27, 2025 01:07
@tsteven4
Copy link
Collaborator

xstrtoi was my extension of strtol/strtoll for the integer type. I was probably motivated by some tool complaining about loss of precision with strtol.

@tsteven4
Copy link
Collaborator

xstrtoi was used much more extensively before I refactored format/filter option handling. Those uses have been consolidated in parse_integer which uses stoi.

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