Skip to content

Chore: repl some NULL with nullptr + use more "%zu" for printing size_t data#1457

Merged
leejet merged 1 commit intoleejet:masterfrom
akleine:leejet_Apr20
Apr 27, 2026
Merged

Chore: repl some NULL with nullptr + use more "%zu" for printing size_t data#1457
leejet merged 1 commit intoleejet:masterfrom
akleine:leejet_Apr20

Conversation

@akleine
Copy link
Copy Markdown
Contributor

@akleine akleine commented Apr 23, 2026

  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 ✅

…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
@leejet leejet merged commit 970c4a3 into leejet:master Apr 27, 2026
13 checks passed
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.

2 participants