comparison src/quickfix.c @ 13244:ac42c4b11dbc v8.0.1496

patch 8.0.1496: clearing a pointer takes two lines commit https://github.com/vim/vim/commit/d23a823669d93fb2a570a039173eefe4856ac806 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 10 18:45:26 2018 +0100 patch 8.0.1496: clearing a pointer takes two lines Problem: Clearing a pointer takes two lines. Solution: Add VIM_CLEAR() and replace vim_clear(). (Hirohito Higashi, closes #2629)
author Christian Brabandt <cb@256bit.org>
date Sat, 10 Feb 2018 19:00:07 +0100
parents 9812a9ca3ab2
children 66b8b29854d9
comparison
equal deleted inserted replaced
13243:899b19739188 13244:ac42c4b11dbc
1175 static char_u *last_efm = NULL; 1175 static char_u *last_efm = NULL;
1176 int retval = -1; /* default: return error flag */ 1176 int retval = -1; /* default: return error flag */
1177 int status; 1177 int status;
1178 1178
1179 /* Do not used the cached buffer, it may have been wiped out. */ 1179 /* Do not used the cached buffer, it may have been wiped out. */
1180 vim_free(qf_last_bufname); 1180 VIM_CLEAR(qf_last_bufname);
1181 qf_last_bufname = NULL;
1182 1181
1183 vim_memset(&state, 0, sizeof(state)); 1182 vim_memset(&state, 0, sizeof(state));
1184 vim_memset(&fields, 0, sizeof(fields)); 1183 vim_memset(&fields, 0, sizeof(fields));
1185 #ifdef FEAT_MBYTE 1184 #ifdef FEAT_MBYTE
1186 state.vc.vc_type = CONV_NONE; 1185 state.vc.vc_type = CONV_NONE;
1227 * previously parsed values. 1226 * previously parsed values.
1228 */ 1227 */
1229 if (last_efm == NULL || (STRCMP(last_efm, efm) != 0)) 1228 if (last_efm == NULL || (STRCMP(last_efm, efm) != 0))
1230 { 1229 {
1231 /* free the previously parsed data */ 1230 /* free the previously parsed data */
1232 vim_free(last_efm); 1231 VIM_CLEAR(last_efm);
1233 last_efm = NULL;
1234 free_efm_list(&fmt_first); 1232 free_efm_list(&fmt_first);
1235 1233
1236 /* parse the current 'efm' */ 1234 /* parse the current 'efm' */
1237 fmt_first = parse_efm_option(efm); 1235 fmt_first = parse_efm_option(efm);
1238 if (fmt_first != NULL) 1236 if (fmt_first != NULL)
1349 } 1347 }
1350 1348
1351 static void 1349 static void
1352 qf_store_title(qf_info_T *qi, int qf_idx, char_u *title) 1350 qf_store_title(qf_info_T *qi, int qf_idx, char_u *title)
1353 { 1351 {
1354 vim_free(qi->qf_lists[qf_idx].qf_title); 1352 VIM_CLEAR(qi->qf_lists[qf_idx].qf_title);
1355 qi->qf_lists[qf_idx].qf_title = NULL;
1356 1353
1357 if (title != NULL) 1354 if (title != NULL)
1358 { 1355 {
1359 char_u *p = alloc((int)STRLEN(title) + 2); 1356 char_u *p = alloc((int)STRLEN(title) + 2);
1360 1357
3001 { 2998 {
3002 qf_list_T *qfl = &qi->qf_lists[idx]; 2999 qf_list_T *qfl = &qi->qf_lists[idx];
3003 3000
3004 qf_free_items(qi, idx); 3001 qf_free_items(qi, idx);
3005 3002
3006 vim_free(qfl->qf_title); 3003 VIM_CLEAR(qfl->qf_title);
3007 qfl->qf_title = NULL;
3008 free_tv(qfl->qf_ctx); 3004 free_tv(qfl->qf_ctx);
3009 qfl->qf_ctx = NULL; 3005 qfl->qf_ctx = NULL;
3010 qfl->qf_id = 0; 3006 qfl->qf_id = 0;
3011 qfl->qf_changedtick = 0L; 3007 qfl->qf_changedtick = 0L;
3012 } 3008 }