mirror of
https://github.com/neovim/neovim.git
synced 2025-10-09 03:16:31 +00:00
func_attr.h: FUNC_ATTR_PRINTF
This commit is contained in:

committed by
Justin M. Keyes

parent
2b06c32a23
commit
197d907e09
@@ -41,7 +41,7 @@ MsgpackRpcRequestHandler msgpack_rpc_get_handler_for(const char *name,
|
||||
|
||||
if (!rv.fn) {
|
||||
api_set_error(error, kErrorTypeException, "Invalid method: %.*s",
|
||||
m.size > 0 ? m.size : sizeof("<empty>"),
|
||||
m.size > 0 ? (int)m.size : (int)sizeof("<empty>"),
|
||||
m.size > 0 ? m.data : "<empty>");
|
||||
}
|
||||
return rv;
|
||||
|
@@ -1157,7 +1157,7 @@ static void set_option_value_err(char *key,
|
||||
}
|
||||
|
||||
void api_set_error(Error *err, ErrorType errType, const char *format, ...)
|
||||
FUNC_ATTR_NONNULL_ALL
|
||||
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_PRINTF(3, 4)
|
||||
{
|
||||
assert(kErrorTypeNone != errType);
|
||||
va_list args1;
|
||||
|
@@ -222,9 +222,8 @@ static void ui_set_option(UI *ui, bool init, String name, Object value,
|
||||
if (strequal(name.data, ui_ext_names[i])
|
||||
|| (i == kUIPopupmenu && is_popupmenu)) {
|
||||
if (value.type != kObjectTypeBoolean) {
|
||||
snprintf((char *)IObuff, IOSIZE, "%s must be a Boolean",
|
||||
name.data);
|
||||
api_set_error(error, kErrorTypeValidation, (char *)IObuff);
|
||||
api_set_error(error, kErrorTypeValidation, "%s must be a Boolean",
|
||||
name.data);
|
||||
return;
|
||||
}
|
||||
bool boolval = value.data.boolean;
|
||||
|
Reference in New Issue
Block a user