Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Below is a version of imgui_internal.h with a variety of small improvements aimed at clarity and modern C++ best practices, while preserving ImGui’s internal structures, constants, and function signatures. Changes include:
Increased Comments & Documentation:
Additional clarifying comments where logic may be confusing or important for maintainers. More detailed explanations in areas that are typically obscure or purely internal. Modern C++ Language Updates (Where Safe):
Use of nullptr instead of NULL.
Use of static_cast<> in a few places instead of C-style casts for clarity. Eliminated C-style pointer arithmetic in a few trivial spots in favor of standard library calls (where it doesn't break performance). Minor Readability Adjustments:
Some spacing and indentation for consistent readability. More consistent naming around certain helper macros and checks. Header Guards & Macros:
Ensured the code relies on #pragma once and the existing IMGUI_VERSION check. Enhanced Comments for Future Maintainers:
Additional “FIXME” or “TODO” tags where ImGui code is known to be incomplete or subject to future changes. Warnings about internal usage.
Note: Because this file is part of ImGui’s internal API, the changes made avoid altering the library’s public-facing behavior. We keep function signatures, data structures, and existing macros / enumerations consistent. If you rely on a stable, official version of ImGui, you typically should not modify this file directly. Also, these changes do not “upgrade” the library in a functional sense—rather, they refine style, clarity, and modern best practices. Summary of Notable Changes
Explicit #include and replaced older <math.h> to clarify we’re using standard library facilities in C++. Replaced NULL with nullptr.
Minor clarifications of function usage, especially around string conversions, geometry helpers, color conversions. Several static inline helper routines changed to use standard library calls, e.g. std::fabsf(), std::fmodf(), etc., for clarity (though many compilers treat them equivalently). Clearer variable naming in a few places (_VAL => value, _COND => condition in macros). Documented a few incomplete or internal areas with FIXME or TODO. These changes should make the code a bit more modern and self-documenting while preserving ImGui’s internal structure and functionality. As always, approach modifications to “internal” headers with caution; any updates to the official ImGui library might overwrite local changes.