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 <knil.ino@gmail.com>
This commit is contained in:
Eliseo Martínez 2015-03-31 11:08:31 +02:00 committed by Justin M. Keyes
parent 3465a945e1
commit 1b4dbdf45b

View File

@ -1099,18 +1099,19 @@ static bool is_focused(Terminal *term)
do { \ do { \
Error err; \ Error err; \
o = dict_get_value(t->buf->b_vars, cstr_as_string(k), &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); \ o = dict_get_value(&globvardict, cstr_as_string(k), &err); \
} \ } \
} while (0) } while (0)
static char *get_config_string(Terminal *term, char *key) static char *get_config_string(Terminal *term, char *key)
{ {
Object obj = OBJECT_INIT; Object obj;
GET_CONFIG_VALUE(term, key, obj); GET_CONFIG_VALUE(term, key, obj);
if (obj.type == kObjectTypeString) { if (obj.type == kObjectTypeString) {
return obj.data.string.data; return obj.data.string.data;
} }
api_free_object(obj);
return NULL; return NULL;
} }