-
Notifications
You must be signed in to change notification settings - Fork 661
Fix several issues related to building from Nuklear/src/* files #862
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
Draft
sleeptightAnsiC
wants to merge
4
commits into
Immediate-Mode-UI:master
Choose a base branch
from
sleeptightAnsiC:fix__math_util_build
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
7a8e8aa
fix(nk_property): nk_do_property now uses NK_STRTOD via macro
sleeptightAnsiC 52e7556
fix(build): failure do build from nuklear/src/* sources
sleeptightAnsiC 180f167
fix(util): guard nk_strtod implementation with preprocessor
sleeptightAnsiC 2b27828
fix(demo): nuklear_sdl3_renderer now provides NK_DTOA
sleeptightAnsiC File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3817,6 +3817,7 @@ NK_API int nk_strtoi(const char *str, char **endptr); | |
| NK_API float nk_strtof(const char *str, char **endptr); | ||
| #ifndef NK_STRTOD | ||
| #define NK_STRTOD nk_strtod | ||
| #define NK_STRTOD_IMPLEMENTATION | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note: |
||
| NK_API double nk_strtod(const char *str, char **endptr); | ||
| #endif | ||
| NK_API int nk_strfilter(const char *text, const char *regexp); | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
This is quite evil but works just fine. Comma-operator with "
((...), str)" at the very end makes sure that we get the proper return value. The999indicates that we don't care about buffer length (dtoa is unsafe anyway). Formatting with%gturns longer values into scientific notation (nk_dtoa does a very same thing). I hope I didn't miss any case.Uh oh!
There was an error while loading. Please reload this page.
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.
Actually, I missed the
str == NULLcase, I thought that SDL handles it(because it does... just not correctly).EDIT: Actually actually, SDL makes a correct nullcheck, but only for it's build-in version. If it uses the libc version, it has no such check, lol :DI'll fix it in few days. I should probably test this thing more deeply.EDIT: nah, the doc for SDL_snprintf clearly says that neither of pointers should be null, so it does not matter what SDL does internally. dtoa is unsafe and should never take null. However, I still want to ensure this macro is fully correct, and I don't like its current form. I think, I will just reimplement it into the function.