Skip to content

Commit

Permalink
kconfig: remove const qualifier from str_get()
Browse files Browse the repository at this point in the history
update_text() apparently edits the buffer returned by str_get().
(and there is no reason why it shouldn't)

Remove 'const' quailifier and casting.

Signed-off-by: Masahiro Yamada <[email protected]>
  • Loading branch information
masahir0y committed Nov 21, 2022
1 parent 1791360 commit 4d980fd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion scripts/kconfig/lkc.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ struct gstr str_new(void);
void str_free(struct gstr *gs);
void str_append(struct gstr *gs, const char *s);
void str_printf(struct gstr *gs, const char *fmt, ...);
const char *str_get(struct gstr *gs);
char *str_get(struct gstr *gs);

/* menu.c */
void _menu_init(void);
Expand Down
4 changes: 2 additions & 2 deletions scripts/kconfig/mconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,8 @@ static void search_conf(void)

res = get_relations_str(sym_arr, &head);
set_subtitle();
dres = show_textbox_ext("Search Results", (char *)
str_get(&res), 0, 0, keys, &vscroll,
dres = show_textbox_ext("Search Results", str_get(&res), 0, 0,
keys, &vscroll,
&hscroll, &update_text, (void *)
&data);
again = false;
Expand Down
2 changes: 1 addition & 1 deletion scripts/kconfig/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void str_printf(struct gstr *gs, const char *fmt, ...)
}

/* Retrieve value of growable string */
const char *str_get(struct gstr *gs)
char *str_get(struct gstr *gs)
{
return gs->s;
}
Expand Down

0 comments on commit 4d980fd

Please sign in to comment.