comparison src/tag.c @ 27018:268f6a3511df v8.2.4038

patch 8.2.4038: various code not used when features are disabled Commit: https://github.com/vim/vim/commit/748b308eebe8d8860888eb27da08333f175d547d Author: Dominique Pelle <dominique.pelle@gmail.com> Date: Sat Jan 8 12:41:16 2022 +0000 patch 8.2.4038: various code not used when features are disabled Problem: Various code not used when features are disabled. Solution: Add #ifdefs. (Dominique Pell?, closes https://github.com/vim/vim/issues/9491)
author Bram Moolenaar <Bram@vim.org>
date Sat, 08 Jan 2022 13:45:04 +0100
parents ac75c145f0a9
children c9474ae175f4
comparison
equal deleted inserted replaced
27017:da790d50f73d 27018:268f6a3511df
100 #endif 100 #endif
101 101
102 // Used instead of NUL to separate tag fields in the growarrays. 102 // Used instead of NUL to separate tag fields in the growarrays.
103 #define TAG_SEP 0x02 103 #define TAG_SEP 0x02
104 104
105 #if defined(FEAT_EVAL) || defined(PROTO)
105 /* 106 /*
106 * Reads the 'tagfunc' option value and convert that to a callback value. 107 * Reads the 'tagfunc' option value and convert that to a callback value.
107 * Invoked when the 'tagfunc' option is set. The option value can be a name of 108 * Invoked when the 'tagfunc' option is set. The option value can be a name of
108 * a function (string), or function(<name>) or funcref(<name>) or a lambda. 109 * a function (string), or function(<name>) or funcref(<name>) or a lambda.
109 */ 110 */
123 copy_callback(&curbuf->b_tfu_cb, &tfu_cb); 124 copy_callback(&curbuf->b_tfu_cb, &tfu_cb);
124 #endif 125 #endif
125 126
126 return OK; 127 return OK;
127 } 128 }
128 129 #endif
129 #if defined(EXITFREE) || defined(PROTO) 130
131 # if defined(EXITFREE) || defined(PROTO)
130 void 132 void
131 free_tagfunc_option(void) 133 free_tagfunc_option(void)
132 { 134 {
133 # ifdef FEAT_EVAL 135 # ifdef FEAT_EVAL
134 free_callback(&tfu_cb); 136 free_callback(&tfu_cb);
135 # endif 137 # endif
136 } 138 }
137 #endif 139 # endif
138 140
141 #if defined(FEAT_EVAL) || defined(PROTO)
139 /* 142 /*
140 * Mark the global 'tagfunc' callback with 'copyID' so that it is not garbage 143 * Mark the global 'tagfunc' callback with 'copyID' so that it is not garbage
141 * collected. 144 * collected.
142 */ 145 */
143 int 146 int
144 set_ref_in_tagfunc(int copyID UNUSED) 147 set_ref_in_tagfunc(int copyID UNUSED)
145 { 148 {
146 int abort = FALSE; 149 int abort = FALSE;
147 150
148 #ifdef FEAT_EVAL
149 abort = set_ref_in_callback(&tfu_cb, copyID); 151 abort = set_ref_in_callback(&tfu_cb, copyID);
150 #endif
151 152
152 return abort; 153 return abort;
153 } 154 }
154 155
155 /* 156 /*
157 * callback for 'buf'. 158 * callback for 'buf'.
158 */ 159 */
159 void 160 void
160 set_buflocal_tfu_callback(buf_T *buf UNUSED) 161 set_buflocal_tfu_callback(buf_T *buf UNUSED)
161 { 162 {
162 #ifdef FEAT_EVAL
163 free_callback(&buf->b_tfu_cb); 163 free_callback(&buf->b_tfu_cb);
164 if (tfu_cb.cb_name != NULL && *tfu_cb.cb_name != NUL) 164 if (tfu_cb.cb_name != NULL && *tfu_cb.cb_name != NUL)
165 copy_callback(&buf->b_tfu_cb, &tfu_cb); 165 copy_callback(&buf->b_tfu_cb, &tfu_cb);
166 #endif
167 } 166 }
167 #endif
168 168
169 /* 169 /*
170 * Jump to tag; handling of tag commands and tag stack 170 * Jump to tag; handling of tag commands and tag stack
171 * 171 *
172 * *tag != NUL: ":tag {tag}", jump to new tag, add to tag stack 172 * *tag != NUL: ":tag {tag}", jump to new tag, add to tag stack