Add checked parsing, BtechTextBuilder, and modernize string/file/event handling - #1
Closed
gtaylor wants to merge 1 commit into
Closed
Add checked parsing, BtechTextBuilder, and modernize string/file/event handling#1gtaylor wants to merge 1 commit into
gtaylor wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Description
mux/support/stringutil.{c,h}:parse_int_checked,parse_long_checked,parse_float_checked, plus supporting helpers and improvedstring_*APIs andmatches_exit_from_listimplementation; exported new prototypes in the header.BtechTextBuilderwithbtech_text_builder.{h,c}and replaced many ad-hocstrcat/snprintfmanipulations with builder calls in multiple UI files (mech_status_summary.c,mech_status_weapons_format.c, etc.).my_open_file/my_close_file/template_file.c/mechfile_api.h) with plainfopen/fcloseusage and removed the generated mech file API.mech_event_failure_markerand replaced priorvery_fake_funcusages and prototypes across event/repair persistence and dispatch code.parse_*_checkedinstead ofatoi/atof/strtol, added#include "mux/support/stringutil.h"where needed, and adjusted function names for stagger modifiers to clearer identifiers.core/btech_text_builder.ctoBTECH_SOURCES, addedtests/btech_safe_helpers.cand abtech_safe_helpers_testexecutable and test entry inCMakeLists.txt(with-ffunction-sections/--gc-sectionsfor test linking).Testing
btech_safe_helpers(registered in CTest asbtech_safe_helpers) which exercises checked parsing andBtechTextBuilder; the test passed.ctest -R btech_safe_helperssuccessfully.Codex Task