comparison src/channel.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 808625d4b71b
children a69636c63103
comparison
equal deleted inserted replaced
13243:899b19739188 13244:ac42c4b11dbc
315 return TRUE; 315 return TRUE;
316 316
317 /* If there is no callback then nobody can get readahead. If the fd is 317 /* If there is no callback then nobody can get readahead. If the fd is
318 * closed and there is no readahead then the callback won't be called. */ 318 * closed and there is no readahead then the callback won't be called. */
319 has_sock_msg = channel->ch_part[PART_SOCK].ch_fd != INVALID_FD 319 has_sock_msg = channel->ch_part[PART_SOCK].ch_fd != INVALID_FD
320 || channel->ch_part[PART_SOCK].ch_head.rq_next != NULL 320 || channel->ch_part[PART_SOCK].ch_head.rq_next != NULL
321 || channel->ch_part[PART_SOCK].ch_json_head.jq_next != NULL; 321 || channel->ch_part[PART_SOCK].ch_json_head.jq_next != NULL;
322 has_out_msg = channel->ch_part[PART_OUT].ch_fd != INVALID_FD 322 has_out_msg = channel->ch_part[PART_OUT].ch_fd != INVALID_FD
323 || channel->ch_part[PART_OUT].ch_head.rq_next != NULL 323 || channel->ch_part[PART_OUT].ch_head.rq_next != NULL
324 || channel->ch_part[PART_OUT].ch_json_head.jq_next != NULL; 324 || channel->ch_part[PART_OUT].ch_json_head.jq_next != NULL;
325 has_err_msg = channel->ch_part[PART_ERR].ch_fd != INVALID_FD 325 has_err_msg = channel->ch_part[PART_ERR].ch_fd != INVALID_FD
326 || channel->ch_part[PART_ERR].ch_head.rq_next != NULL 326 || channel->ch_part[PART_ERR].ch_head.rq_next != NULL
2976 */ 2976 */
2977 void 2977 void
2978 channel_clear(channel_T *channel) 2978 channel_clear(channel_T *channel)
2979 { 2979 {
2980 ch_log(channel, "Clearing channel"); 2980 ch_log(channel, "Clearing channel");
2981 vim_free(channel->ch_hostname); 2981 VIM_CLEAR(channel->ch_hostname);
2982 channel->ch_hostname = NULL;
2983 channel_clear_one(channel, PART_SOCK); 2982 channel_clear_one(channel, PART_SOCK);
2984 channel_clear_one(channel, PART_OUT); 2983 channel_clear_one(channel, PART_OUT);
2985 channel_clear_one(channel, PART_ERR); 2984 channel_clear_one(channel, PART_ERR);
2986 channel_clear_one(channel, PART_IN); 2985 channel_clear_one(channel, PART_IN);
2987 free_callback(channel->ch_callback, channel->ch_partial); 2986 free_callback(channel->ch_callback, channel->ch_partial);