From 2cbe7005c2498393651d486f74c908654b7addfa Mon Sep 17 00:00:00 2001 From: John Szakmeister Date: Fri, 17 Apr 2015 09:51:54 -0400 Subject: Fix a couple uninitialized variable warnings in the release build. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Eliseo Martínez Reviewed-by: Marco Hinz Reviewed-by: Björn Linse --- src/nvim/hardcopy.c | 2 +- src/nvim/msgpack_rpc/server.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/nvim/hardcopy.c b/src/nvim/hardcopy.c index 6e9ad02b3a..0cbbe95572 100644 --- a/src/nvim/hardcopy.c +++ b/src/nvim/hardcopy.c @@ -2130,7 +2130,7 @@ int mch_print_init(prt_settings_T *psettings, char_u *jobname, int forceit) } /* Use first encoding matched if no charset matched */ - if (p_mbchar == NULL && p_mbenc_first != NULL) { + if (p_mbenc_first != NULL && p_mbchar == NULL) { p_mbenc = p_mbenc_first; cmap = effective_cmap; } diff --git a/src/nvim/msgpack_rpc/server.c b/src/nvim/msgpack_rpc/server.c index 8fb2902b0b..5e3fd100da 100644 --- a/src/nvim/msgpack_rpc/server.c +++ b/src/nvim/msgpack_rpc/server.c @@ -238,7 +238,7 @@ void server_stop(char *endpoint) } } - if (i == servers.ga_len) { + if (i >= servers.ga_len) { ELOG("Not listening on %s", addr); return; } -- cgit From f03780c1b86af0fd3cc936f21d38788e4231c886 Mon Sep 17 00:00:00 2001 From: Eliseo Martínez Date: Fri, 17 Apr 2015 21:09:15 -0400 Subject: Fix an uninitialized variable warning for call_start. --- src/nvim/eval.c | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index d6a8351330..1392a12b2d 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -19086,15 +19086,26 @@ call_user_func ( --no_wait_return; } } + + bool func_not_yet_profiling_but_should = + do_profiling == PROF_YES + && !fp->uf_profiling && has_profiling(FALSE, fp->uf_name, NULL); + + if (func_not_yet_profiling_but_should) + func_do_profile(fp); + + bool func_or_func_caller_profiling = + do_profiling == PROF_YES + && (fp->uf_profiling + || (fc->caller != NULL && fc->caller->func->uf_profiling)); + + if (func_or_func_caller_profiling) { + ++fp->uf_tm_count; + call_start = profile_start(); + fp->uf_tm_children = profile_zero(); + } + if (do_profiling == PROF_YES) { - if (!fp->uf_profiling && has_profiling(FALSE, fp->uf_name, NULL)) - func_do_profile(fp); - if (fp->uf_profiling - || (fc->caller != NULL && fc->caller->func->uf_profiling)) { - ++fp->uf_tm_count; - call_start = profile_start(); - fp->uf_tm_children = profile_zero(); - } script_prof_save(&wait_start); } @@ -19117,9 +19128,7 @@ call_user_func ( rettv->vval.v_number = -1; } - if (do_profiling == PROF_YES && (fp->uf_profiling - || (fc->caller != NULL && - fc->caller->func->uf_profiling))) { + if (func_or_func_caller_profiling) { call_start = profile_end(call_start); call_start = profile_sub_wait(wait_start, call_start); fp->uf_tm_total = profile_add(fp->uf_tm_total, call_start); -- cgit