mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
clang-analyzer: Reduce scope in syntax.c.
This commit is contained in:
parent
020bfb6ea2
commit
4fa8a0c43c
@ -5684,22 +5684,19 @@ static int syn_compare_syntime(const void *v1, const void *v2)
|
|||||||
*/
|
*/
|
||||||
static void syntime_report(void)
|
static void syntime_report(void)
|
||||||
{
|
{
|
||||||
synpat_T *spp;
|
|
||||||
proftime_T tm;
|
|
||||||
int len;
|
|
||||||
int total_count = 0;
|
|
||||||
garray_T ga;
|
|
||||||
time_entry_T *p;
|
|
||||||
|
|
||||||
if (!syntax_present(curwin)) {
|
if (!syntax_present(curwin)) {
|
||||||
MSG(_(msg_no_items));
|
MSG(_(msg_no_items));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
garray_T ga;
|
||||||
ga_init(&ga, sizeof(time_entry_T), 50);
|
ga_init(&ga, sizeof(time_entry_T), 50);
|
||||||
|
|
||||||
proftime_T total_total = profile_zero();
|
proftime_T total_total = profile_zero();
|
||||||
|
int total_count = 0;
|
||||||
|
time_entry_T *p;
|
||||||
for (int idx = 0; idx < curwin->w_s->b_syn_patterns.ga_len; ++idx) {
|
for (int idx = 0; idx < curwin->w_s->b_syn_patterns.ga_len; ++idx) {
|
||||||
spp = &(SYN_ITEMS(curwin->w_s)[idx]);
|
synpat_T *spp = &(SYN_ITEMS(curwin->w_s)[idx]);
|
||||||
if (spp->sp_time.count > 0) {
|
if (spp->sp_time.count > 0) {
|
||||||
p = GA_APPEND_VIA_PTR(time_entry_T, &ga);
|
p = GA_APPEND_VIA_PTR(time_entry_T, &ga);
|
||||||
p->total = spp->sp_time.total;
|
p->total = spp->sp_time.total;
|
||||||
@ -5708,7 +5705,7 @@ static void syntime_report(void)
|
|||||||
p->match = spp->sp_time.match;
|
p->match = spp->sp_time.match;
|
||||||
total_count += spp->sp_time.count;
|
total_count += spp->sp_time.count;
|
||||||
p->slowest = spp->sp_time.slowest;
|
p->slowest = spp->sp_time.slowest;
|
||||||
tm = profile_divide(spp->sp_time.total, spp->sp_time.count);
|
proftime_T tm = profile_divide(spp->sp_time.total, spp->sp_time.count);
|
||||||
p->average = tm;
|
p->average = tm;
|
||||||
p->id = spp->sp_syn.id;
|
p->id = spp->sp_syn.id;
|
||||||
p->pattern = spp->sp_pattern;
|
p->pattern = spp->sp_pattern;
|
||||||
@ -5723,7 +5720,6 @@ static void syntime_report(void)
|
|||||||
" TOTAL COUNT MATCH SLOWEST AVERAGE NAME PATTERN"));
|
" TOTAL COUNT MATCH SLOWEST AVERAGE NAME PATTERN"));
|
||||||
MSG_PUTS("\n");
|
MSG_PUTS("\n");
|
||||||
for (int idx = 0; idx < ga.ga_len && !got_int; ++idx) {
|
for (int idx = 0; idx < ga.ga_len && !got_int; ++idx) {
|
||||||
spp = &(SYN_ITEMS(curwin->w_s)[idx]);
|
|
||||||
p = ((time_entry_T *)ga.ga_data) + idx;
|
p = ((time_entry_T *)ga.ga_data) + idx;
|
||||||
|
|
||||||
MSG_PUTS(profile_msg(p->total));
|
MSG_PUTS(profile_msg(p->total));
|
||||||
@ -5745,6 +5741,7 @@ static void syntime_report(void)
|
|||||||
MSG_PUTS(" ");
|
MSG_PUTS(" ");
|
||||||
|
|
||||||
msg_advance(69);
|
msg_advance(69);
|
||||||
|
int len;
|
||||||
if (Columns < 80)
|
if (Columns < 80)
|
||||||
len = 20; /* will wrap anyway */
|
len = 20; /* will wrap anyway */
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user