-
-
Notifications
You must be signed in to change notification settings - Fork 442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Axe automated header generation. #70
Conversation
53f6288
to
7caea27
Compare
Please remove |
myhtopplatsources = linux/Platform.c linux/IOPriorityPanel.c linux/IOPriority.c \ | ||
myhtopplatsources = linux/Platform.c linux/IOPriorityPanel.c \ |
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.
Why was linux/IOPriority.c
removed?
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.
Because aside from being a source from which the corresponding header was generated, it included nothing of actual substance -- an enum declaration, a few macros, and a typedef (zero variable or function definitions).
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.
sorry, missed, that the .c
file was removed in reallity too.
Agreed re: |
The extra targets in
Maybe the |
822154a
to
a1fe289
Compare
Ah, good point -- and also |
Reasoning: - implementation was unsound -- broke down when I added a fairly basic macro definition expanding to a struct initializer in a *.c file. - made it way too easy (e.g. via otherwise totally innocuous git commands) to end up with timestamps such that it always ran MakeHeader.py but never used its output, leading to overbuild noise when running what should be a null 'make'. - but mostly: it's just an awkward way of dealing with C code.
Applied via: $ find * -name '*.h' -exec sed -i -r 's/^extern (.+\()/\1/;' {} + Suggested-by: Bert Wesarg <[email protected]>
a1fe289
to
7758ffc
Compare
Rebased to resolve merge conflicts; also added a tiny commit to remove a duplicate declaration introduced in #86. |
PR htop-dev#70 got rid of the infrastructure for generating header files, but it left behind some code duplication. Some of cases are things that belong in the header file and don't need to be reapeated in the C file. Other cases are things that belong in the C file and don't need to be in the header file. In this commit I tried to fix most of these that I could find. When given a choice I preferred keeping things out of the header file, unless they were being used by someone else.
PR htop-dev#70 got rid of the infrastructure for generating header files, but it left behind some code duplication. Some of cases are things that belong in the header file and don't need to be repeated in the C file. Other cases are things that belong in the C file and don't need to be in the header file. In this commit I tried to fix all of these that I could find. When given a choice I preferred keeping things out of the header file, unless they were being used by someone else.
Reasoning:
implementation was unsound -- broke down when I added a fairly
basic macro definition expanding to a struct initializer in a *.c
file.
made it way too easy (e.g. via otherwise totally innocuous git
commands) to end up with timestamps such that it always ran
MakeHeader.py but never used its output, leading to overbuild noise
when running what should be a null 'make'.
but mostly: it's just an awkward way of dealing with C code.
[Addresses #9.]