Repository navigation
OIL 41, chapter Functions: host code drops no result without its reason - #127
Merged
Merged
Conversation
Every result the simulator, the control program and DocuPictures drop, a system call's included, goes to Discard() with its reason. Where a failure matters it is handled instead: a socket that still blocks, or that would wait without end for a request, is closed rather than polled; a failed avr_init() fails the load; a matrix that does not start fails DocuPictures; the control program logs a window without a timer. What the host code computes or finds is MAXMATRIX_NODISCARD. A reference to the object itself or a handle to what was just added is no result; AGENTS.md says so. The serial port's Open() hands its setup to Configure(), as the reasons made it too long. The library and its sizes do not change.
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.
Nothing changes for a sketch. Whoever runs the simulator or the control program sees a difference only where something fails that went unnoticed before: a connection that cannot be made non-blocking is closed rather than stopping the sketch, simavr that does not initialize fails the load, and the control program says so in its log if it gets no timer. The library is untouched, and every example has the same flash and RAM as on main.
The fourth pull request of the review of the chapter Functions in OIL item 41, for FN-10 of the coding style, as decided on 2026-11-17: every result dropped on purpose goes to
Discard()with its reason, a system call's as well, and one whose failure matters is handled instead.Discard()with the reason beside them;close()once, in a function of the simulator's socket code.std::string::append()returns, or a handle to what was just added, aswxSizer::Add()returns, is no result: the call returns it only to chain calls. AGENTS.md says so, beside the rule.Open()hands its setup to a function of its own, as the reasons made it longer than 40 lines.Checked:
make checkpasses: lint, clang-tidy, every host and AVR test, coverage at 100 % of lines, branches and conditions.