ui: rename CHECK_TRUE and CHECK_FALSE to avoid name conflicts#1537
ui: rename CHECK_TRUE and CHECK_FALSE to avoid name conflicts#1537iscgar wants to merge 1 commit intosolvespace:masterfrom
CHECK_TRUE and CHECK_FALSE to avoid name conflicts#1537Conversation
Currently the test harness needs to undefine them when including `ui.h` in order to avoid a name conflict with its own definitions. Rename them so we can do away with this hack, and have better names while at it.
ruevs
left a comment
There was a problem hiding this comment.
SolveSpace is a fairly old (started 2008) and very stable project with very few active maintainers. Because of this any changes "for the sake of changes" should be minimized. Especially in the main project.
In this case if you really insist on avoiding the undef statements what you should do is rename these:
Line 58 in a5d40f8
And the ~63 places where they are used in the tests, instead of renaming these:
Line 206 in a5d40f8
and the ~68 places where they are used in the main project.
The reason is that any change like this "pollutes" the git log and makes it harder to bisect where and why real changes were made.
In my opinion this is completely unnecessary anyway.
|
On its own this change is quite useless, but it's not just for the sake of change. The reason for this change is that I'm working on improving In trying to fix it and untangle the inclusion of everything through While I don't mind changing the test definitions instead, I also totally understand your point of view regarding changes to the code base in general. If that's a change you'd prefer to avoid, I'm fine with closing this PR. |
|
@ruevs I'm kind of in favor of refactoring the header files if it actually improves compile times and makes sense. I understand the arguments against change too. But if we change them I feel like it should be more of a one-time large change just to restructure headers and not a little change here or there. What do you think? Sometimes new contributors are put off by the code structure, but OTOH the core is complex and people who can make good progress in there seem to be able to look past the strange organization. I find the separation of code based on function rather than classes interesting - ratpoly.cpp is still my favorite file and it contains functions for curves and surfaces, even though those are in different classes it makes sense. But the one giant header is kind of icky. As for CHECK_TRUE and CHECK_FALSE I don't really want to lengthen the names... Maybe "check" is the wrong word in the test suite? @iscgar What are you trying to do with List and IdList ? Those are very key structures. I don't really like them personally, but they are key to a lot of Solvespace internals. |
|
@phkahler this is off-topic for this PR, but I suppose I only have myself to blame for bringing it up here 😅 in In order to ensure that no deep copies are accidentally introduced and hurt performance, while working on it I temporarily deleted the copy constructor and copy assignment operator of For As a data point, while still a WIP, when running the tests (in release mode) with my changes, I'm seeing ~10% reduction in memory usage of |
For cross reference #359
Indeed. See here: #1503 Do not Interpret the above as comments from me. I'm just adding some cross references from my phone :-) |
|
Wasn't going to interpret it that way :) A perhaps less controversial idea: instead of refactoring the header files, I'd love to begin by just changing the current way things are included in |
|
Be careful of trying to refactor those containers to remove manual memory management - there is a list of my previous attempts to do so around here somewhere... if nothing else in the branches on my fork. 😉 Harder than it looks because there is some usage of them as a pool, etc. I do also strongly dislike the weird header include namespace inject thing. As long as it can be done neatly I would be in favor of fixing that. |
I'm certainly being careful, or at least trying to :)
I have already made such a change and pushed it into a branch in my fork here. If that's what you had in mind, and if it's something that is deemed acceptable, I'll open a PR. |
Currently the test harness needs to undefine them when including
ui.hin order to avoid a name conflict with its own definitions. Rename them so we can do away with this hack, and have better names while at it.