To: vim_dev@googlegroups.com Subject: Patch 9.0.1413 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.1413 (after 9.0.1411) Problem: Compiler warning for unused variable. Solution: Move variable declaration. (John Marriott) Files: src/time.c *** ../vim-9.0.1412/src/time.c 2023-03-16 21:43:07.343227878 +0000 --- src/time.c 2023-03-17 18:49:53.978923188 +0000 *************** *** 258,281 **** void f_reltimestr(typval_T *argvars UNUSED, typval_T *rettv) { - static char buf[50]; - # ifdef FEAT_RELTIME - proftime_T tm; - # endif - rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; # ifdef FEAT_RELTIME if (in_vim9script() && check_for_list_arg(argvars, 0) == FAIL) return; if (list2proftime(&argvars[0], &tm) == OK) { # ifdef MSWIN rettv->vval.v_string = vim_strsave((char_u *)profile_msg(&tm)); # else long usec = tm.tv_fsec / (TV_FSEC_SEC / 1000000); ! sprintf(buf, "%3ld.%06ld", (long)tm.tv_sec, usec); rettv->vval.v_string = vim_strsave((char_u *)buf); # endif } --- 258,278 ---- void f_reltimestr(typval_T *argvars UNUSED, typval_T *rettv) { rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; # ifdef FEAT_RELTIME if (in_vim9script() && check_for_list_arg(argvars, 0) == FAIL) return; + proftime_T tm; if (list2proftime(&argvars[0], &tm) == OK) { # ifdef MSWIN rettv->vval.v_string = vim_strsave((char_u *)profile_msg(&tm)); # else + static char buf[50]; long usec = tm.tv_fsec / (TV_FSEC_SEC / 1000000); ! vim_snprintf(buf, sizeof(buf), "%3ld.%06ld", (long)tm.tv_sec, usec); rettv->vval.v_string = vim_strsave((char_u *)buf); # endif } *** ../vim-9.0.1412/src/version.c 2023-03-17 18:42:54.378940647 +0000 --- src/version.c 2023-03-17 18:45:57.002933908 +0000 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 1413, /**/ -- FIRST HEAD: Oh! quick! get the sword out I want to cut his head off. THIRD HEAD: Oh, cut your own head off. SECOND HEAD: Yes - do us all a favour. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///