Patch 8.2.4750
Problem:    Small pieces of dead code.
Solution:   Remove the dead code. (Goc Dundar, closes #10190) Rename the
            qftf_cb struct member to avoid confusion.
Files:      src/ex_cmds.c, src/misc1.c, src/optionstr.c, src/quickfix.c


*** ../vim-8.2.4749/src/ex_cmds.c       2022-04-08 11:56:09.179436450 +0100
--- src/ex_cmds.c       2022-04-14 20:29:05.112292348 +0100
***************
*** 4960,4967 ****
      else
      {
        delim = *cmd;           // get the delimiter
!       if (delim)
!           ++cmd;              // skip delimiter if there is one
        pat = cmd;              // remember start of pattern
        cmd = skip_regexp_ex(cmd, delim, magic_isset(), &eap->arg, NULL, NULL);
        if (cmd[0] == delim)                // end delimiter found
--- 4960,4966 ----
      else
      {
        delim = *cmd;           // get the delimiter
!       ++cmd;                  // skip delimiter if there is one
        pat = cmd;              // remember start of pattern
        cmd = skip_regexp_ex(cmd, delim, magic_isset(), &eap->arg, NULL, NULL);
        if (cmd[0] == delim)                // end delimiter found
*** ../vim-8.2.4749/src/misc1.c 2022-04-13 14:28:03.749082509 +0100
--- src/misc1.c 2022-04-14 20:30:52.756094220 +0100
***************
*** 1576,1582 ****
                c = (int)STRLEN(var);
                // if var[] ends in a path separator and tail[] starts
                // with it, skip a character
!               if (*var != NUL && after_pathsep(dst, dst + c)
  #if defined(BACKSLASH_IN_FILENAME) || defined(AMIGA)
                        && dst[-1] != ':'
  #endif
--- 1576,1582 ----
                c = (int)STRLEN(var);
                // if var[] ends in a path separator and tail[] starts
                // with it, skip a character
!               if (after_pathsep(dst, dst + c)
  #if defined(BACKSLASH_IN_FILENAME) || defined(AMIGA)
                        && dst[-1] != ':'
  #endif
*** ../vim-8.2.4749/src/optionstr.c     2022-04-13 11:47:21.711886557 +0100
--- src/optionstr.c     2022-04-14 20:33:10.883901472 +0100
***************
*** 1249,1256 ****
                int x2 = -1;
                int x3 = -1;
  
!               if (*p != NUL)
!                   p += mb_ptr2len(p);
                if (*p != NUL)
                    x2 = *p++;
                if (*p != NUL)
--- 1249,1255 ----
                int x2 = -1;
                int x3 = -1;
  
!               p += mb_ptr2len(p);
                if (*p != NUL)
                    x2 = *p++;
                if (*p != NUL)
*** ../vim-8.2.4749/src/quickfix.c      2022-04-04 15:16:50.742014128 +0100
--- src/quickfix.c      2022-04-14 20:38:41.339399516 +0100
***************
*** 85,91 ****
      char_u    *qf_title;      // title derived from the command that created
                                // the error list or set by setqflist
      typval_T  *qf_ctx;        // context set by setqflist/setloclist
!     callback_T  qftf_cb;      // 'quickfixtextfunc' callback function
  
      struct dir_stack_T        *qf_dir_stack;
      char_u            *qf_directory;
--- 85,91 ----
      char_u    *qf_title;      // title derived from the command that created
                                // the error list or set by setqflist
      typval_T  *qf_ctx;        // context set by setqflist/setloclist
!     callback_T  qf_qftf_cb;   // 'quickfixtextfunc' callback function
  
      struct dir_stack_T        *qf_dir_stack;
      char_u            *qf_directory;
***************
*** 2337,2346 ****
      }
      else
        to_qfl->qf_ctx = NULL;
!     if (from_qfl->qftf_cb.cb_name != NULL)
!       copy_callback(&to_qfl->qftf_cb, &from_qfl->qftf_cb);
      else
!       to_qfl->qftf_cb.cb_name = NULL;
  
      if (from_qfl->qf_count)
        if (copy_loclist_entries(from_qfl, to_qfl) == FAIL)
--- 2337,2346 ----
      }
      else
        to_qfl->qf_ctx = NULL;
!     if (from_qfl->qf_qftf_cb.cb_name != NULL)
!       copy_callback(&to_qfl->qf_qftf_cb, &from_qfl->qf_qftf_cb);
      else
!       to_qfl->qf_qftf_cb.cb_name = NULL;
  
      if (from_qfl->qf_count)
        if (copy_loclist_entries(from_qfl, to_qfl) == FAIL)
***************
*** 3938,3944 ****
      VIM_CLEAR(qfl->qf_title);
      free_tv(qfl->qf_ctx);
      qfl->qf_ctx = NULL;
!     free_callback(&qfl->qftf_cb);
      qfl->qf_id = 0;
      qfl->qf_changedtick = 0L;
  }
--- 3938,3944 ----
      VIM_CLEAR(qfl->qf_title);
      free_tv(qfl->qf_ctx);
      qfl->qf_ctx = NULL;
!     free_callback(&qfl->qf_qftf_cb);
      qfl->qf_id = 0;
      qfl->qf_changedtick = 0L;
  }
***************
*** 4660,4668 ****
      // If 'quickfixtextfunc' is set, then use the user-supplied function to 
get
      // the text to display. Use the local value of 'quickfixtextfunc' if it is
      // set.
!     if (qfl->qftf_cb.cb_name != NULL)
!       cb = &qfl->qftf_cb;
!     if (cb != NULL && cb->cb_name != NULL)
      {
        typval_T        args[1];
        dict_T          *d;
--- 4660,4668 ----
      // If 'quickfixtextfunc' is set, then use the user-supplied function to 
get
      // the text to display. Use the local value of 'quickfixtextfunc' if it is
      // set.
!     if (qfl->qf_qftf_cb.cb_name != NULL)
!       cb = &qfl->qf_qftf_cb;
!     if (cb->cb_name != NULL)
      {
        typval_T        args[1];
        dict_T          *d;
***************
*** 7105,7115 ****
  {
      int               status;
  
!     if (qfl->qftf_cb.cb_name != NULL)
      {
        typval_T        tv;
  
!       put_callback(&qfl->qftf_cb, &tv);
        status = dict_add_tv(retdict, "quickfixtextfunc", &tv);
        clear_tv(&tv);
      }
--- 7105,7115 ----
  {
      int               status;
  
!     if (qfl->qf_qftf_cb.cb_name != NULL)
      {
        typval_T        tv;
  
!       put_callback(&qfl->qf_qftf_cb, &tv);
        status = dict_add_tv(retdict, "quickfixtextfunc", &tv);
        clear_tv(&tv);
      }
***************
*** 7551,7560 ****
  {
      callback_T        cb;
  
!     free_callback(&qfl->qftf_cb);
      cb = get_callback(&di->di_tv);
      if (cb.cb_name != NULL && *cb.cb_name != NUL)
!       set_callback(&qfl->qftf_cb, &cb);
  
      return OK;
  }
--- 7551,7560 ----
  {
      callback_T        cb;
  
!     free_callback(&qfl->qf_qftf_cb);
      cb = get_callback(&di->di_tv);
      if (cb.cb_name != NULL && *cb.cb_name != NUL)
!       set_callback(&qfl->qf_qftf_cb, &cb);
  
      return OK;
  }
***************
*** 7737,7743 ****
                && ctx->v_type != VAR_STRING && ctx->v_type != VAR_FLOAT)
            abort = abort || set_ref_in_item(ctx, copyID, NULL, NULL);
  
!       cb = &qi->qf_lists[i].qftf_cb;
        abort = abort || set_ref_in_callback(cb, copyID);
      }
  
--- 7737,7743 ----
                && ctx->v_type != VAR_STRING && ctx->v_type != VAR_FLOAT)
            abort = abort || set_ref_in_item(ctx, copyID, NULL, NULL);
  
!       cb = &qi->qf_lists[i].qf_qftf_cb;
        abort = abort || set_ref_in_callback(cb, copyID);
      }
  
*** ../vim-8.2.4749/src/version.c       2022-04-14 15:39:39.281754582 +0100
--- src/version.c       2022-04-14 20:41:24.503137582 +0100
***************
*** 748,749 ****
--- 748,751 ----
  {   /* Add new patch number below this line */
+ /**/
+     4750,
  /**/

-- 
Sometimes you can protect millions of dollars in your budget simply by buying
a bag of cookies, dropping it on the budget anylyst's desk, and saying
something deeply personal such as "How was your weekend, big guy?"
                                (Scott Adams - The Dilbert principle)

 /// 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/20220414194549.3A4EB1C0216%40moolenaar.net.

Raspunde prin e-mail lui