From 1b4dbdf45bfc59b84da48bbbac7209fda61c5d22 Mon Sep 17 00:00:00 2001 From: Eliseo Martínez Date: Tue, 31 Mar 2015 11:08:31 +0200 Subject: Fix warnings: terminal.c: get_config_string(): Dead init: RI. Problem : Dead initialization @ 1109. Diagnostic : Real issue. Rationale : `obj` is immediately assigned another value through GET_CONFIG_VALUE macro. Resolution : Don't initialize. Helped-by: oni-link --- src/nvim/terminal.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c index b3cdfe8775..f9786614f1 100644 --- a/src/nvim/terminal.c +++ b/src/nvim/terminal.c @@ -1099,18 +1099,19 @@ static bool is_focused(Terminal *term) do { \ Error err; \ o = dict_get_value(t->buf->b_vars, cstr_as_string(k), &err); \ - if (obj.type == kObjectTypeNil) { \ + if (o.type == kObjectTypeNil) { \ o = dict_get_value(&globvardict, cstr_as_string(k), &err); \ } \ } while (0) static char *get_config_string(Terminal *term, char *key) { - Object obj = OBJECT_INIT; + Object obj; GET_CONFIG_VALUE(term, key, obj); if (obj.type == kObjectTypeString) { return obj.data.string.data; } + api_free_object(obj); return NULL; } -- cgit