refactor: reduce number of unique char casts (#15995)

This commit is contained in:
dundargoc
2021-10-12 17:52:54 +02:00
committed by GitHub
parent 64f0fdc682
commit 649b3160a1
29 changed files with 133 additions and 140 deletions

View File

@@ -306,7 +306,7 @@ void update_window_hl(win_T *wp, bool invalid)
// syntax group! It needs at least 10 layers of special casing! Noooooo!
//
// haha, theme engine go brrr
int normality = syn_check_group((const char_u *)S_LEN("Normal"));
int normality = syn_check_group(S_LEN("Normal"));
int ns_attr = ns_get_hl(-1, normality, false, false);
if (ns_attr > 0) {
// TODO(bfredl): hantera NormalNC and so on
@@ -890,7 +890,7 @@ HlAttrs dict2hlattrs(Dictionary dict, bool use_rgb, int *link_id, Error *err)
} else if (link_id && strequal(key, "link")) {
if (val.type == kObjectTypeString) {
String str = val.data.string;
*link_id = syn_check_group((const char_u *)str.data, (int)str.size);
*link_id = syn_check_group(str.data, (int)str.size);
} else if (val.type == kObjectTypeInteger) {
// TODO(bfredl): validate range?
*link_id = (int)val.data.integer;