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 -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20230317185117.00B151C1466%40moolenaar.net.

Raspunde prin e-mail lui