Skip to content
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

Rename lmms_basics.h and scope it down to type declaration #7677

Open
wants to merge 33 commits into
base: master
Choose a base branch
from

Conversation

Rossmaxx
Copy link
Contributor

@Rossmaxx Rossmaxx commented Feb 2, 2025

  • Renamed the lmms_basics.h to LmmsTypeDeclarations.h and scoped it down for that purpose.
  • Shifted the LMMS_STRINGIFY macro's declaration to call sites.

@Rossmaxx
Copy link
Contributor Author

Rossmaxx commented Feb 2, 2025

I am still not sure about copy pasting the macro directly to the other places but the "modern" methods I looked at to implement this functionality turned out to be very janky compared to this simple macro.

@Rossmaxx Rossmaxx changed the title Cleanup lmms_basics.h and simplify the LMMS_STRINGIFY macro to be used at call sites. Rename lmms_basics.h and scope it down to type declaration Feb 14, 2025
@Rossmaxx
Copy link
Contributor Author

Do note that the diff itself is small. Most of the thing is due to the file rename in the #include statement

@Rossmaxx Rossmaxx marked this pull request as ready for review February 14, 2025 15:32
@Rossmaxx
Copy link
Contributor Author

Rossmaxx commented Feb 14, 2025

Now i should hunt down any unused includes over here, but I don't really have the insanity to do that manually.

@Rossmaxx
Copy link
Contributor Author

I'll fix the declaration later.

@Rossmaxx
Copy link
Contributor Author

Seems like I got myself into a rabbit hole with this refactoring

CMakeLists.txt Outdated
@@ -630,6 +630,10 @@ IF(NOT CMAKE_BUILD_TYPE)
"MinSizeRel" "RelWithDebInfo")
ENDIF()

IF(CMAKE_BUILD_TYPE STREQUAL "Release")
add_compile_definitions(NDEBUG)
Copy link
Member

@tresf tresf Feb 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems incorrectly placed.

  • Prior to this PR, setting -DLMMS_DEBUG would UNSET NDEBUG, now you're doing this based on CMAKE_BUILD_TYPE which modifies the behavior to something else.
  • I believe what you meant to do here was to only set NDEBUG when LMMS_DEBUG was NOT set. If that's the case, the code should be updated to reflect that. Furthermore we should also document this in our debug flags, e.g.
  Developer options
  -----------------------------------------
  * Debug FP exceptions               : Disabled
  * Debug using AddressSanitizer      : Disabled
  * Debug using ThreadSanitizer       : Disabled
  * Debug using MemorySanitizer       : Disabled
  * Debug using UBSanitizer           : Disabled
  * Debug packaging commands          : Disabled
  * Profile using GNU profiler        : Disabled
+ * Debug assertions                  : Disabled

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would just call it "Debug assertions" rather than "Treat assertions as fatal" because failed assertions are always fatal.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update, it seems cmake already handles this, so should i even bother?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update, it seems cmake already handles this, so should i even bother?

I don't believe this statement to be true. Please be more specific, as my reply is specific and contains instructions to resolve this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants