-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[FL-3884] Proper integer parsing #3839
Conversation
PVS-Studio report for commit |
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.
Please sync all targets' API versions.
./fbt TARGET_HW=18
383b76d
to
056a691
Compare
Compiled f7 firmware for commit |
Not sure how to fix the PVS-Studio diagnostic. I see two possible causes:
|
6a0e0ef
to
945eab6
Compare
Thank you, I'll address these comments. |
Looks nice now! Do you think it also makes sense to replace all uses of |
Yep, I think so too. I'll do that tomorrow. |
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.
One more nitpicky, but (technically) code-size-reducing comment.
@skotopes Does it make sense to strip away |
@CookiePLMonster yes, but we are not going to do it because external libraries/code may depend on it. |
Yeah that makes sense, if third parties use it you'll not save any flash space anyway, so might as well keep exposing it... |
* feat: strint_to_uint32 and tests * fix: permit explicit bases and prefixes * feat: strint_to_{int32,uint16,int16} * feat: strint_to_u?int64 * refactor: replace strtol, strtoul, sscanf with strint_to_* * fix: api symbols * docs: document parameter `end` of strint_to_uint_32 * style: apply changes requested by hedger * refactor: fix pvs-studio diagnostic * style: apply changes requested by CookiePLMonster * fix: unused var * fix: pointer type * refactor: convert atoi to strint_to_* * fix: strint_to_uint8 doesn't actually exist ._ . * fix: memory leak * style: address review comments * Toolbox: couple small comments in the code and doxygen comment update. SubGhz, Loader: fix strint usage. * Loader: fix incorrect cast Co-authored-by: あく <alleteam@gmail.com>
What's new
lib/toolbox/strint.h
):sscanf
andstrtol
and friends wherever warranted and possibleVerification
Run unit tests
Remarks
api_symbols.csv
is correctChecklist (For Reviewer)