Refactor dtcs into a ecu->dtc_list table of tables, move them out into separate files#98
Refactor dtcs into a ecu->dtc_list table of tables, move them out into separate files#98brendandburns wants to merge 2 commits into
Conversation
|
Just skimming the code in less than 5 minutes (will need to take a closer look later), I think you're on the right track. Some notes; many struct members should be marked
also, make sure you've run our uncrustify.cfg formatter prior to committing. I didn't check if your 'formatting' commit applies to existing code, or stuff you just added. Commit message also need a bit of work, see how previous messages are formatted. Also, I think the table of tables should be "unpacked", currently you have everything in the one main array, but that will quickly get out of hand when adding more. So e.g. I would prefer (I wouldn't bother with designated initializers for these tables unless there's a valid case where some members should not be initialized, or if there are so many members that readability suffers) |
|
Just so I'm clear, the current structs for ECU: And DTC: Have printable strings which are I don't mind making them Let me know what you prefer. I will refactor the table of tables to be "unpacked" as you suggest. |
|
The strings aren't going to be modified during execution, so they should have the const qualifier so the compiler knows to put them in the rodata section and apply appropriate optimizations. I snuck the omission past fenugrec but you weren't so lucky. As long as you're making tweaks - freediag uses C-style comments in some places and C++-style comments elsewhere, but the new comment in dtc_raw_by_printable should be C-style to match the surrounding code. |
Thanks, I just took care of it (as well as some other unrelated, low-hanging fruit in scantool_850.c flagged by cppcheck) |
Move them out into separate files.
|
Ok, rebased and I think I addressed all of your comments. I also ran Please take another look when you get a chance. |
Move them out into separate files. Ref GH #98
|
Merged (reworded commit message) as of #8aabe66c834230e7152f9c066cd20428b289e165 Slightly reorganized code and functions, I wasn't a fan of having a struct definition in basic.h. I also split DTC and ECU lists in separate files, thinking they may evolve independantly, but I don't mind re-merging them if you guys want to eliminate the |
|
Oops, I should've looked at your PR #99 first. Some of the changes I made make less sense. Let me know if anything needs be reverted / changed to not completely break your code generators . |
@aaeegg @fenugrec
This is the first step as discussed in #95
I have refactored the existing codes/codebase to make the table of tables and prepare for different lists of dtcs.
There should be no actual changes in functionality.
Please let me know if there's any feedback or changes to the approach desired.