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.
This patch adds
const
to pointers to data types which aren't modified.There are few minor issues remaining - I did not changed these but please inform me what's your opinion on these:
nk_group_get_scroll
- unlike with other getters, this getter can not use const context because the implementation modifies the context on one branch (the value is cached and created on-demand, which means getters need to be able to create it too)nk_find_value
- the use ofconst
would be questionable here, especially given the fact that the function returns non-const pointer. Perhaps it needs a second overload with both const input and const output?nk_combo_callback
,nk_combobox_callback
- shouldn'titem_getter
be changed fromvoid(*)(void*, int, const char**)
toconst char*(*)(void*, int)
?struct nk_font* nk_font_atlas_add_from_memory(struct nk_font_atlas *atlas, void *memory, nk_size size, float height, const struct nk_font_config *config);
and likewisenk_font_atlas_add_compressed
takes a non-const pointer to the memory but looking at the implementation this memory is never modified (actually copied).