Fix multiple issues#210
Fix multiple issues#210henrygab wants to merge 22 commits intogerbv:mainfrom henrygab:first_pass_reduction
Conversation
|
It's hard to review with so much going on! Could this be multiple PRs please? |
|
I broke every significant change into its own commit. Can you review the commits in sequence? Stop anytime. These were not undirected commits. Each was a reduction of work from my initial dev tree. I'll consider rebase'ing, with changes at any commit. |
|
Or just consider the above 22 separate PRs. 😆 |
To help you with review, I've opened issues to help describe what the changes are addressing. That's a lot of issues. Where I could easily do so, I provided references to CERT coding standards. Thus, if you wonder why it's worth making a given change, the linked web page gives detailed descriptions of the "why" such practices help write solid, bug-free code. Each commit here is focused on one type of change, which was an expressed preference. If you find that is not the case, let me know. I may be open to splitting, rebasing, and force-pushing. However, given the multi-day timeframe for PR reviews, doing 22 individual PRs just doesn't make sense for either one of us. |
|
@henrygab first of all, thank you very much for your tremendous work! It's very much appreciated! I have skipped over most commits and they look reasonable. I'll see if GitHub has a way to mark individual commits as reviewed so we can split the effort and merge when all has been reviewed :-) |
src/drill.c
Outdated
| DRILL_DATA | ||
| } drill_file_section_t; | ||
|
|
||
| static const char* drill_file_section_list[] = { "NONE", "HEADER", "DATA", NULL }; |
There was a problem hiding this comment.
Could this be declared inside of the function below? If that function is the only one using it, might as well limit the scope, right?
|
Do you want me to keep my fork / this branch around? I'm done with this fix, and want to mentally offload this work. FYI, I'm not really vested in whether this PR gets accepted, heavily modified, or thrown away. Of course, I did ensure that each commit in this branch not only builds, but fully passed all the built-in CI tests. I looked into this because a company I sent a tiny PCB design to hit this bug. I'm relatively happy to answer questions about any commit; Unfortunately, at some point my memory will fade.... |
|
I want to look at it, I've just been swamped. I'll get to it next week. |
* C11 does not support references. * C11 does not support the `typeof` operator (although GCC allows it as an extension)
* Order of internal `drill_state_t` structure changed * `drill_state_t->autod` changed to native `bool`
Excellon format is clear that only two values are valid for `header_number_format`, and which value is used depends on the units: * Inches ==> FMT_00_0000 * Metric ==> FMT_000_000 Therefore, do not set to FMT_USER on those occasions, but to the allowed format type. Also added many more comments to `drill_parse_header_is_metric()`, explaining the implied logic.
Specifically, pull out the detection for two edge cases (hacks for bad data) into separate functions. These new functions ensure that, if they return false, they leave the file descriptor pointer where it was at entry.
Two issues with the prior method:
1. `dprintf()` is already defined in `stdio.h`,
which reduces clarity.
2. The use of an `if` statement without braces
can hide significant logic errors.
Example code that would have logic error:
```C
// Ensure number format is set to FMT_USER (and warn if not true).
if (state->number_format == FMT_USER)
dprintf("Some debugging information here.")
else
state->number_format = FMT_USER;
```
Bug in the above is that `number_format` is never set to `FMT_USER`.
|
I think your rebase resulted in a There is an explicit request to ensure that every commit will be working (e.g., for With your force-push, the CI checks fails for at least one commit, and I cannot tell you which commit that this broke in. If I could, I would have undone your force-push. [[ I don't know if this is even possible to do with I think removing the extra blank line is all that was needed to fix this. |
|
Sorry about that. I've been going through the commits one by one and putting them in as I review them. I rebased in order to see what work remains. I can avoid the rebasing in the future. |
|
I will defer to your choices in this matter. At the same time, I cannot ensure this branch is 100% clean ( |
|
FYI, I have created a new PR (PR #226) today. I re-generated proof of each commit successfully completing the CI checks. See 100% CI success rate at https://github.com/henrygab/gerbv/pull/3. I am therefore closing this PR. |
Highlights are as follows:
clang-formatCI check was not applying the checked-in file style. See 0f74a9c.dprintf()to saferDPRINTF(()). See a831563All commits build and pass tests. See https://github.com/henrygab/gerbv/pull/1 for automated build / test results for each commit.
Fixes #195.
Fixes #211.
Fixes #212.
Fixes #213.
Fixes #214.
Fixes #215.
Fixes #216.
Fixes #217.
Fixes #218.
Fixes #219.
Fixes #220.
Fixes #221.