mirror of
https://github.com/neovim/neovim.git
synced 2025-09-30 23:18:33 +00:00
refactor: remove redundant const char * casts
This commit is contained in:
@@ -49,7 +49,7 @@ typedef struct {
|
||||
#define TYPVAL_ENCODE_CONV_STRING(tv, str, len) \
|
||||
do { \
|
||||
const size_t len_ = (size_t)(len); \
|
||||
const char *const str_ = (const char *)(str); \
|
||||
const char *const str_ = (str); \
|
||||
assert(len_ == 0 || str_ != NULL); \
|
||||
kvi_push(edata->stack, STRING_OBJ(cbuf_to_string((len_?str_:""), len_))); \
|
||||
} while (0)
|
||||
|
@@ -843,7 +843,7 @@ void remote_ui_raw_line(UI *ui, Integer grid, Integer row, Integer startcol, Int
|
||||
uint32_t csize = (repeat > 1) ? 3 : ((attrs[i] != last_hl) ? 2 : 1);
|
||||
nelem++;
|
||||
mpack_array(buf, csize);
|
||||
mpack_str(buf, (const char *)chunk[i]);
|
||||
mpack_str(buf, chunk[i]);
|
||||
if (csize >= 2) {
|
||||
mpack_uint(buf, (uint32_t)attrs[i]);
|
||||
if (csize >= 3) {
|
||||
@@ -873,7 +873,7 @@ void remote_ui_raw_line(UI *ui, Integer grid, Integer row, Integer startcol, Int
|
||||
for (int i = 0; i < endcol - startcol; i++) {
|
||||
remote_ui_cursor_goto(ui, row, startcol + i);
|
||||
remote_ui_highlight_set(ui, attrs[i]);
|
||||
remote_ui_put(ui, (const char *)chunk[i]);
|
||||
remote_ui_put(ui, chunk[i]);
|
||||
if (utf_ambiguous_width(utf_ptr2char((char *)chunk[i]))) {
|
||||
data->client_col = -1; // force cursor update
|
||||
}
|
||||
|
@@ -275,13 +275,13 @@ Dictionary nvim_win_get_config(Window window, Error *err)
|
||||
for (size_t i = 0; i < 8; i++) {
|
||||
Array tuple = ARRAY_DICT_INIT;
|
||||
|
||||
String s = cstrn_to_string((const char *)config->border_chars[i], sizeof(schar_T));
|
||||
String s = cstrn_to_string(config->border_chars[i], sizeof(schar_T));
|
||||
|
||||
int hi_id = config->border_hl_ids[i];
|
||||
char *hi_name = syn_id2name(hi_id);
|
||||
if (hi_name[0]) {
|
||||
ADD(tuple, STRING_OBJ(s));
|
||||
ADD(tuple, STRING_OBJ(cstr_to_string((const char *)hi_name)));
|
||||
ADD(tuple, STRING_OBJ(cstr_to_string(hi_name)));
|
||||
ADD(border, ARRAY_OBJ(tuple));
|
||||
} else {
|
||||
ADD(border, STRING_OBJ(s));
|
||||
@@ -293,10 +293,9 @@ Dictionary nvim_win_get_config(Window window, Error *err)
|
||||
VirtText title_datas = config->title_chunks;
|
||||
for (size_t i = 0; i < title_datas.size; i++) {
|
||||
Array tuple = ARRAY_DICT_INIT;
|
||||
ADD(tuple, CSTR_TO_OBJ((const char *)title_datas.items[i].text));
|
||||
ADD(tuple, CSTR_TO_OBJ(title_datas.items[i].text));
|
||||
if (title_datas.items[i].hl_id > 0) {
|
||||
ADD(tuple,
|
||||
STRING_OBJ(cstr_to_string((const char *)syn_id2name(title_datas.items[i].hl_id))));
|
||||
ADD(tuple, STRING_OBJ(cstr_to_string(syn_id2name(title_datas.items[i].hl_id))));
|
||||
}
|
||||
ADD(titles, ARRAY_OBJ(tuple));
|
||||
}
|
||||
|
Reference in New Issue
Block a user