comparison src/quickfix.c @ 28451:e015d650ea9f v8.2.4750

patch 8.2.4750: small pieces of dead code Commit: https://github.com/vim/vim/commit/b836658a04ee5456deca2ee523de9efe51252da3 Author: =?UTF-8?q?Dundar=20G=C3=B6c?= <gocdundar@gmail.com> Date: Thu Apr 14 20:43:56 2022 +0100 patch 8.2.4750: small pieces of dead code Problem: Small pieces of dead code. Solution: Remove the dead code. (Goc Dundar, closes https://github.com/vim/vim/issues/10190) Rename the qftf_cb struct member to avoid confusion.
author Bram Moolenaar <Bram@vim.org>
date Thu, 14 Apr 2022 21:45:02 +0200
parents 62cc3b60493b
children 4dcccb2673fe
comparison
equal deleted inserted replaced
28450:4d88ce67e7ad 28451:e015d650ea9f
83 int qf_index; // current index in the error list 83 int qf_index; // current index in the error list
84 int qf_nonevalid; // TRUE if not a single valid entry found 84 int qf_nonevalid; // TRUE if not a single valid entry found
85 char_u *qf_title; // title derived from the command that created 85 char_u *qf_title; // title derived from the command that created
86 // the error list or set by setqflist 86 // the error list or set by setqflist
87 typval_T *qf_ctx; // context set by setqflist/setloclist 87 typval_T *qf_ctx; // context set by setqflist/setloclist
88 callback_T qftf_cb; // 'quickfixtextfunc' callback function 88 callback_T qf_qftf_cb; // 'quickfixtextfunc' callback function
89 89
90 struct dir_stack_T *qf_dir_stack; 90 struct dir_stack_T *qf_dir_stack;
91 char_u *qf_directory; 91 char_u *qf_directory;
92 struct dir_stack_T *qf_file_stack; 92 struct dir_stack_T *qf_file_stack;
93 char_u *qf_currfile; 93 char_u *qf_currfile;
2335 if (to_qfl->qf_ctx != NULL) 2335 if (to_qfl->qf_ctx != NULL)
2336 copy_tv(from_qfl->qf_ctx, to_qfl->qf_ctx); 2336 copy_tv(from_qfl->qf_ctx, to_qfl->qf_ctx);
2337 } 2337 }
2338 else 2338 else
2339 to_qfl->qf_ctx = NULL; 2339 to_qfl->qf_ctx = NULL;
2340 if (from_qfl->qftf_cb.cb_name != NULL) 2340 if (from_qfl->qf_qftf_cb.cb_name != NULL)
2341 copy_callback(&to_qfl->qftf_cb, &from_qfl->qftf_cb); 2341 copy_callback(&to_qfl->qf_qftf_cb, &from_qfl->qf_qftf_cb);
2342 else 2342 else
2343 to_qfl->qftf_cb.cb_name = NULL; 2343 to_qfl->qf_qftf_cb.cb_name = NULL;
2344 2344
2345 if (from_qfl->qf_count) 2345 if (from_qfl->qf_count)
2346 if (copy_loclist_entries(from_qfl, to_qfl) == FAIL) 2346 if (copy_loclist_entries(from_qfl, to_qfl) == FAIL)
2347 return FAIL; 2347 return FAIL;
2348 2348
3936 qf_free_items(qfl); 3936 qf_free_items(qfl);
3937 3937
3938 VIM_CLEAR(qfl->qf_title); 3938 VIM_CLEAR(qfl->qf_title);
3939 free_tv(qfl->qf_ctx); 3939 free_tv(qfl->qf_ctx);
3940 qfl->qf_ctx = NULL; 3940 qfl->qf_ctx = NULL;
3941 free_callback(&qfl->qftf_cb); 3941 free_callback(&qfl->qf_qftf_cb);
3942 qfl->qf_id = 0; 3942 qfl->qf_id = 0;
3943 qfl->qf_changedtick = 0L; 3943 qfl->qf_changedtick = 0L;
3944 } 3944 }
3945 3945
3946 /* 3946 /*
4658 list_T *qftf_list = NULL; 4658 list_T *qftf_list = NULL;
4659 4659
4660 // If 'quickfixtextfunc' is set, then use the user-supplied function to get 4660 // If 'quickfixtextfunc' is set, then use the user-supplied function to get
4661 // the text to display. Use the local value of 'quickfixtextfunc' if it is 4661 // the text to display. Use the local value of 'quickfixtextfunc' if it is
4662 // set. 4662 // set.
4663 if (qfl->qftf_cb.cb_name != NULL) 4663 if (qfl->qf_qftf_cb.cb_name != NULL)
4664 cb = &qfl->qftf_cb; 4664 cb = &qfl->qf_qftf_cb;
4665 if (cb != NULL && cb->cb_name != NULL) 4665 if (cb->cb_name != NULL)
4666 { 4666 {
4667 typval_T args[1]; 4667 typval_T args[1];
4668 dict_T *d; 4668 dict_T *d;
4669 typval_T rettv; 4669 typval_T rettv;
4670 4670
7103 static int 7103 static int
7104 qf_getprop_qftf(qf_list_T *qfl, dict_T *retdict) 7104 qf_getprop_qftf(qf_list_T *qfl, dict_T *retdict)
7105 { 7105 {
7106 int status; 7106 int status;
7107 7107
7108 if (qfl->qftf_cb.cb_name != NULL) 7108 if (qfl->qf_qftf_cb.cb_name != NULL)
7109 { 7109 {
7110 typval_T tv; 7110 typval_T tv;
7111 7111
7112 put_callback(&qfl->qftf_cb, &tv); 7112 put_callback(&qfl->qf_qftf_cb, &tv);
7113 status = dict_add_tv(retdict, "quickfixtextfunc", &tv); 7113 status = dict_add_tv(retdict, "quickfixtextfunc", &tv);
7114 clear_tv(&tv); 7114 clear_tv(&tv);
7115 } 7115 }
7116 else 7116 else
7117 status = dict_add_string(retdict, "quickfixtextfunc", (char_u *)""); 7117 status = dict_add_string(retdict, "quickfixtextfunc", (char_u *)"");
7549 static int 7549 static int
7550 qf_setprop_qftf(qf_info_T *qi UNUSED, qf_list_T *qfl, dictitem_T *di) 7550 qf_setprop_qftf(qf_info_T *qi UNUSED, qf_list_T *qfl, dictitem_T *di)
7551 { 7551 {
7552 callback_T cb; 7552 callback_T cb;
7553 7553
7554 free_callback(&qfl->qftf_cb); 7554 free_callback(&qfl->qf_qftf_cb);
7555 cb = get_callback(&di->di_tv); 7555 cb = get_callback(&di->di_tv);
7556 if (cb.cb_name != NULL && *cb.cb_name != NUL) 7556 if (cb.cb_name != NULL && *cb.cb_name != NUL)
7557 set_callback(&qfl->qftf_cb, &cb); 7557 set_callback(&qfl->qf_qftf_cb, &cb);
7558 7558
7559 return OK; 7559 return OK;
7560 } 7560 }
7561 7561
7562 /* 7562 /*
7735 ctx = qi->qf_lists[i].qf_ctx; 7735 ctx = qi->qf_lists[i].qf_ctx;
7736 if (ctx != NULL && ctx->v_type != VAR_NUMBER 7736 if (ctx != NULL && ctx->v_type != VAR_NUMBER
7737 && ctx->v_type != VAR_STRING && ctx->v_type != VAR_FLOAT) 7737 && ctx->v_type != VAR_STRING && ctx->v_type != VAR_FLOAT)
7738 abort = abort || set_ref_in_item(ctx, copyID, NULL, NULL); 7738 abort = abort || set_ref_in_item(ctx, copyID, NULL, NULL);
7739 7739
7740 cb = &qi->qf_lists[i].qftf_cb; 7740 cb = &qi->qf_lists[i].qf_qftf_cb;
7741 abort = abort || set_ref_in_callback(cb, copyID); 7741 abort = abort || set_ref_in_callback(cb, copyID);
7742 } 7742 }
7743 7743
7744 return abort; 7744 return abort;
7745 } 7745 }