diff options
Diffstat (limited to 'src/option.c')
-rw-r--r-- | src/option.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/src/option.c b/src/option.c index 574478d524..56f86e34fd 100644 --- a/src/option.c +++ b/src/option.c @@ -320,7 +320,7 @@ struct vimoption { never be used for local or hidden options! */ #define P_NODEFAULT 0x40 /* don't set to default value */ #define P_DEF_ALLOCED 0x80 /* default value is in allocated memory, must - use vim_free() when assigning new value */ + use free() when assigning new value */ #define P_WAS_SET 0x100 /* option has been set/reset */ #define P_NO_MKRC 0x200 /* don't include in :mkvimrc output */ #define P_VI_DEF 0x400 /* Use Vi default for Vim */ @@ -1970,11 +1970,11 @@ void set_init_1(void) ga.ga_len += len; } if (mustfree) - vim_free(p); + free(p); } if (ga.ga_data != NULL) { set_string_default("bsk", ga.ga_data); - vim_free(ga.ga_data); + free(ga.ga_data); } } @@ -2038,10 +2038,10 @@ void set_init_1(void) options[opt_idx].def_val[VI_DEFAULT] = buf; options[opt_idx].flags |= P_DEF_ALLOCED; } else - vim_free(buf); /* cannot happen */ + free(buf); /* cannot happen */ } if (mustfree) - vim_free(cdpath); + free(cdpath); } } @@ -2108,7 +2108,7 @@ void set_init_1(void) * split P_DEF_ALLOCED in two. */ if (options[opt_idx].flags & P_DEF_ALLOCED) - vim_free(options[opt_idx].def_val[VI_DEFAULT]); + free(options[opt_idx].def_val[VI_DEFAULT]); options[opt_idx].def_val[VI_DEFAULT] = p; options[opt_idx].flags |= P_DEF_ALLOCED; } @@ -2154,7 +2154,7 @@ void set_init_1(void) * for practical purposes, thus use that. It's not an alias to * still support conversion between gb18030 and utf-8. */ p_enc = vim_strsave((char_u *)"cp936"); - vim_free(p); + free(p); } if (mb_init() == NULL) { opt_idx = findoption((char_u *)"encoding"); @@ -2185,7 +2185,7 @@ void set_init_1(void) #endif } else { - vim_free(p_enc); + free(p_enc); p_enc = save_enc; } } @@ -2293,7 +2293,7 @@ void set_string_default(char *name, char_u *val) opt_idx = findoption((char_u *)name); if (opt_idx >= 0) { if (options[opt_idx].flags & P_DEF_ALLOCED) - vim_free(options[opt_idx].def_val[VI_DEFAULT]); + free(options[opt_idx].def_val[VI_DEFAULT]); options[opt_idx].def_val[VI_DEFAULT] = p; options[opt_idx].flags |= P_DEF_ALLOCED; } @@ -2494,7 +2494,7 @@ void set_init_3(void) options[idx_srr].def_val[VI_DEFAULT] = p_srr; } } - vim_free(p); + free(p); } #endif @@ -3031,7 +3031,7 @@ do_set ( (char_u *)"indent,eol,start"); break; } - vim_free(oldval); + free(oldval); oldval = *(char_u **)varp; } /* @@ -3128,7 +3128,7 @@ do_set ( || (flags & P_COMMA)) { s = option_expand(opt_idx, newval); if (s != NULL) { - vim_free(newval); + free(newval); newlen = (unsigned)STRLEN(s) + 1; if (adding || prepending || removing) newlen += (unsigned)STRLEN(origval) + 1; @@ -3640,13 +3640,13 @@ void check_buf_options(buf_T *buf) void free_string_option(char_u *p) { if (p != empty_option) - vim_free(p); + free(p); } void clear_string_option(char_u **pp) { if (*pp != empty_option) - vim_free(*pp); + free(*pp); *pp = empty_option; } @@ -4047,7 +4047,7 @@ did_set_string_option ( /* canonize the value, so that STRCMP() can be used on it */ p = enc_canonize(*varp); if (p != NULL) { - vim_free(*varp); + free(*varp); *varp = p; } if (varp == &p_enc) { @@ -4076,7 +4076,7 @@ did_set_string_option ( /* Canonize printencoding if VIM standard one */ p = enc_canonize(p_penc); if (p != NULL) { - vim_free(p_penc); + free(p_penc); p_penc = p; } else { /* Ensure lower case and '-' for '_' */ @@ -4323,7 +4323,7 @@ did_set_string_option ( t_colors = colors; if (t_colors <= 1) { if (new_value_alloced) - vim_free(T_CCO); + free(T_CCO); T_CCO = empty_option; } /* We now have a different color setup, initialize it again. */ @@ -4829,7 +4829,7 @@ skip: return e_invarg; /* illegal trailing comma as in "set cc=80," */ } - vim_free(wp->w_p_cc_cols); + free(wp->w_p_cc_cols); if (count == 0) wp->w_p_cc_cols = NULL; else { @@ -5023,7 +5023,7 @@ static char_u *compile_cap_prog(synblock_T *synblock) /* Prepend a ^ so that we only match at one column */ re = concat_str((char_u *)"^", synblock->b_p_spc); synblock->b_cap_prog = vim_regcomp(re, RE_MAGIC); - vim_free(re); + free(re); if (synblock->b_cap_prog == NULL) { synblock->b_cap_prog = rp; /* restore the previous program */ return e_invarg; @@ -6173,7 +6173,7 @@ showoptions ( ui_breakcheck(); } } - vim_free(items); + free(items); } /* @@ -6395,10 +6395,10 @@ static int put_setstring(FILE *fd, char *cmd, char *name, char_u **valuep, int e buf = alloc(MAXPATHL); home_replace(NULL, *valuep, buf, MAXPATHL, FALSE); if (put_escstr(fd, buf, 2) == FAIL) { - vim_free(buf); + free(buf); return FAIL; } - vim_free(buf); + free(buf); } else if (put_escstr(fd, *valuep, 2) == FAIL) return FAIL; } @@ -7393,7 +7393,7 @@ int ExpandOldSetting(int *num_file, char_u ***file) buf = vim_strsave_escaped(var, escape_chars); if (buf == NULL) { - vim_free(*file); + free(*file); *file = NULL; return FAIL; } @@ -7785,10 +7785,10 @@ void vimrc_found(char_u *fname, char_u *envname) p = FullName_save(fname, FALSE); if (p != NULL) { vim_setenv(envname, p); - vim_free(p); + free(p); } } else if (dofree) - vim_free(p); + free(p); } } @@ -8002,7 +8002,7 @@ void save_file_ff(buf_T *buf) /* Only use free/alloc when necessary, they take time. */ if (buf->b_start_fenc == NULL || STRCMP(buf->b_start_fenc, buf->b_p_fenc) != 0) { - vim_free(buf->b_start_fenc); + free(buf->b_start_fenc); buf->b_start_fenc = vim_strsave(buf->b_p_fenc); } } |