Mercurial > vim
comparison src/highlight.c @ 29442:827d9f2b7a71 v9.0.0063
patch 9.0.0063: too many type casts for dict_get functions
Commit: https://github.com/vim/vim/commit/d61efa50f8f5b9d9dcbc136705cc33874f0fdcb3
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jul 23 09:52:04 2022 +0100
patch 9.0.0063: too many type casts for dict_get functions
Problem: Too many type casts for dict_get functions.
Solution: Change the key argument from "char_u *" to "char *".
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 23 Jul 2022 11:00:04 +0200 |
parents | 60977de70684 |
children | b944b7fb563b |
comparison
equal
deleted
inserted
replaced
29441:2a189fa0dcd7 | 29442:827d9f2b7a71 |
---|---|
4315 } | 4315 } |
4316 | 4316 |
4317 p = attr_str; | 4317 p = attr_str; |
4318 for (i = 0; i < (int)ARRAY_LENGTH(hl_name_table); i++) | 4318 for (i = 0; i < (int)ARRAY_LENGTH(hl_name_table); i++) |
4319 { | 4319 { |
4320 if (dict_get_bool(attrdict, (char_u *)hl_name_table[i], | 4320 if (dict_get_bool(attrdict, hl_name_table[i], VVAL_FALSE) == VVAL_TRUE) |
4321 VVAL_FALSE) == VVAL_TRUE) | |
4322 { | 4321 { |
4323 if (p != attr_str && (size_t)(p - attr_str + 2) < len) | 4322 if (p != attr_str && (size_t)(p - attr_str + 2) < len) |
4324 STRCPY(p, (char_u *)","); | 4323 STRCPY(p, (char_u *)","); |
4325 sz = STRLEN(hl_name_table[i]); | 4324 sz = STRLEN(hl_name_table[i]); |
4326 if (p - attr_str + sz + 1 < len) | 4325 if (p - attr_str + sz + 1 < len) |
4396 | 4395 |
4397 name = hldict_get_string(dict, (char_u *)"name", &error); | 4396 name = hldict_get_string(dict, (char_u *)"name", &error); |
4398 if (name == NULL || *name == NUL || error) | 4397 if (name == NULL || *name == NUL || error) |
4399 return FALSE; | 4398 return FALSE; |
4400 | 4399 |
4401 if (dict_get_bool(dict, (char_u *)"force", VVAL_FALSE) == VVAL_TRUE) | 4400 if (dict_get_bool(dict, "force", VVAL_FALSE) == VVAL_TRUE) |
4402 forceit = TRUE; | 4401 forceit = TRUE; |
4403 | 4402 |
4404 if (dict_get_bool(dict, (char_u *)"default", VVAL_FALSE) == VVAL_TRUE) | 4403 if (dict_get_bool(dict, "default", VVAL_FALSE) == VVAL_TRUE) |
4405 dodefault = TRUE; | 4404 dodefault = TRUE; |
4406 | 4405 |
4407 if (dict_has_key(dict, "cleared")) | 4406 if (dict_has_key(dict, "cleared")) |
4408 { | 4407 { |
4409 varnumber_T cleared; | 4408 varnumber_T cleared; |
4410 | 4409 |
4411 // clear a highlight group | 4410 // clear a highlight group |
4412 cleared = dict_get_bool(dict, (char_u *)"cleared", FALSE); | 4411 cleared = dict_get_bool(dict, "cleared", FALSE); |
4413 if (cleared == TRUE) | 4412 if (cleared == TRUE) |
4414 { | 4413 { |
4415 vim_snprintf((char *)hlsetBuf, HLSETBUFSZ, "clear %s", name); | 4414 vim_snprintf((char *)hlsetBuf, HLSETBUFSZ, "clear %s", name); |
4416 do_highlight(hlsetBuf, forceit, FALSE); | 4415 do_highlight(hlsetBuf, forceit, FALSE); |
4417 done = TRUE; | 4416 done = TRUE; |