Mercurial > vim
comparison src/profiler.c @ 25567:0082503ff2ff v8.2.3320
patch 8.2.3320: some local functions are not static
Commit: https://github.com/vim/vim/commit/8ee52affe7fd4daa03e002bc06611f0a8c3bcd5b
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Mon Aug 9 19:59:06 2021 +0200
patch 8.2.3320: some local functions are not static
Problem: Some local functions are not static.
Solution: Add "static". Move snprintf() related code to strings.c.
(Yegappan Lakshmanan, closes #8734)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 09 Aug 2021 20:00:06 +0200 |
parents | 03819ebd3e6d |
children | 06a137af96f8 |
comparison
equal
deleted
inserted
replaced
25566:e1c7aa26ddf5 | 25567:0082503ff2ff |
---|---|
550 return; // out of memory | 550 return; // out of memory |
551 fp->uf_prof_initialized = TRUE; | 551 fp->uf_prof_initialized = TRUE; |
552 } | 552 } |
553 | 553 |
554 fp->uf_profiling = TRUE; | 554 fp->uf_profiling = TRUE; |
555 } | |
556 | |
557 /* | |
558 * Save time when starting to invoke another script or function. | |
559 */ | |
560 static void | |
561 script_prof_save( | |
562 proftime_T *tm) // place to store wait time | |
563 { | |
564 scriptitem_T *si; | |
565 | |
566 if (SCRIPT_ID_VALID(current_sctx.sc_sid)) | |
567 { | |
568 si = SCRIPT_ITEM(current_sctx.sc_sid); | |
569 if (si->sn_prof_on && si->sn_pr_nest++ == 0) | |
570 profile_start(&si->sn_pr_child); | |
571 } | |
572 profile_get_wait(tm); | |
555 } | 573 } |
556 | 574 |
557 /* | 575 /* |
558 * When calling a function: may initialize for profiling. | 576 * When calling a function: may initialize for profiling. |
559 */ | 577 */ |
788 | 806 |
789 ga_init2(&si->sn_prl_ga, sizeof(sn_prl_T), 100); | 807 ga_init2(&si->sn_prl_ga, sizeof(sn_prl_T), 100); |
790 si->sn_prl_idx = -1; | 808 si->sn_prl_idx = -1; |
791 si->sn_prof_on = TRUE; | 809 si->sn_prof_on = TRUE; |
792 si->sn_pr_nest = 0; | 810 si->sn_pr_nest = 0; |
793 } | |
794 | |
795 /* | |
796 * Save time when starting to invoke another script or function. | |
797 */ | |
798 void | |
799 script_prof_save( | |
800 proftime_T *tm) // place to store wait time | |
801 { | |
802 scriptitem_T *si; | |
803 | |
804 if (SCRIPT_ID_VALID(current_sctx.sc_sid)) | |
805 { | |
806 si = SCRIPT_ITEM(current_sctx.sc_sid); | |
807 if (si->sn_prof_on && si->sn_pr_nest++ == 0) | |
808 profile_start(&si->sn_pr_child); | |
809 } | |
810 profile_get_wait(tm); | |
811 } | 811 } |
812 | 812 |
813 /* | 813 /* |
814 * Count time spent in children after invoking another script or function. | 814 * Count time spent in children after invoking another script or function. |
815 */ | 815 */ |