feat(others): add lv_check_arg to public functions in lv_translation#10208
Open
axos88 wants to merge 2 commits into
Open
feat(others): add lv_check_arg to public functions in lv_translation#10208axos88 wants to merge 2 commits into
axos88 wants to merge 2 commits into
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
1 issue found across 1 file
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
… NULL args The previous LV_CHECK_ARG guards returned 0 on NULL pack or lang_name, but 0 is a valid language index. The documented "not found" sentinel for this function is -1, so use that consistently. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
Add
LV_CHECK_ARGto all public API functions inlv_translation.c. Also fixeslv_translation_get_language_indexwhich returned0(a valid index) instead of-1on error.Public API audit
lv_translation_init(void)lv_translation_deinit(void)lv_translation_pack_t * lv_translation_add_static(const char * const * languages, const char * const * tags, const char * const * const * translations)languagesLV_ASSERT_NULL)tagsLV_ASSERT_NULL)translationsLV_ASSERT_NULL)lv_translation_add_dynamic(void)lv_translation_set_language(const char * lang)langlv_translation_get_language(void)lv_translation_get(const char * tag)taglv_tr(const char * tag)(inline)taglv_translation_getlv_translation_add_language(lv_translation_pack_t * pack, const char * lang)packlangAdded
No guard existed on master
lv_translation_get_language_index(lv_translation_pack_t * pack, const char * lang_name)packlang_nameAdded + Fixed
-1(not0) so callers can detect errorNo guard existed on master; returns
-1(not0) so callers can detect errorlv_translation_add_tag(lv_translation_pack_t * pack, const char * tag_name)packtag_nameAdded
No guard existed on master
lv_translation_set_tag_translation(lv_translation_pack_t * pack, lv_translation_tag_dsc_t * tag, uint32_t lang_idx, const char * trans)packtagtranslang_idxAdded
Added
Pre-existing
No guard existed on master
No guard existed on master
Bounds-checked inline on master; kept as-is
Generated with Claude Code