Chore: repl some NULL with nullptr + use more "%zu" for printing size_t data#1457
Open
akleine wants to merge 1 commit intoleejet:masterfrom
Open
Chore: repl some NULL with nullptr + use more "%zu" for printing size_t data#1457akleine wants to merge 1 commit intoleejet:masterfrom
akleine wants to merge 1 commit intoleejet:masterfrom
Conversation
…ize_t data
1.
nullptr is a keyword introduced in C++11, designed to replace NULL.
Most of the NULL occurrences had already been altered, but there were still a few more.
2.
As far I know using the z modifier is recommended for printing size_t data ("%zu").
In practice, this has an impact on 32-bit systems, e.g. Android's armeabi-v7a .
Currently the output there is wrong, for example:
[DEBUG] clip_tokenizer.cpp:65 - vocab size: 18412924951465083136
But then you get this:
[DEBUG] clip_tokenizer.cpp:65 - vocab size: 49408
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
nullptr is a keyword introduced in C++11, designed to replace NULL.
Most of the NULL occurrences had already been altered, but there were still a few more.
As far I know using the z modifier is recommended for printing size_t data (%zu).
In practice, this has an impact on 32-bit systems, e.g. Android's armeabi-v7a .
Currently the output there is wrong, for example:
[DEBUG] clip_tokenizer.cpp:65 - vocab size: 18412924951465083136
But then you get this:
[DEBUG] clip_tokenizer.cpp:65 - vocab size: 49408 ✅