summaryrefslogtreecommitdiff
path: root/src/gui_x11.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-02-10 18:45:26 +0100
committerBram Moolenaar <Bram@vim.org>2018-02-10 18:45:26 +0100
commitd23a823669d93fb2a570a039173eefe4856ac806 (patch)
tree617130258eae70e3bd7ef7b6da9c494ffee7b572 /src/gui_x11.c
parent42443c7d7fecc3a2a72154bb6139b028438617c2 (diff)
downloadvim-git-d23a823669d93fb2a570a039173eefe4856ac806.tar.gz
patch 8.0.1496: clearing a pointer takes two linesv8.0.1496
Problem: Clearing a pointer takes two lines. Solution: Add VIM_CLEAR() and replace vim_clear(). (Hirohito Higashi, closes #2629)
Diffstat (limited to 'src/gui_x11.c')
-rw-r--r--src/gui_x11.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/gui_x11.c b/src/gui_x11.c
index 34d584e78..097de5f90 100644
--- a/src/gui_x11.c
+++ b/src/gui_x11.c
@@ -826,7 +826,7 @@ gui_x11_key_hit_cb(
# endif
)
{
- int maxlen = len * 4 + 40; /* guessed */
+ int maxlen = len * 4 + 40; /* guessed */
char_u *p = (char_u *)XtMalloc(maxlen);
mch_memmove(p, string, len);
@@ -1567,8 +1567,7 @@ gui_mch_uninit(void)
XtCloseDisplay(gui.dpy);
gui.dpy = NULL;
vimShell = (Widget)0;
- vim_free(gui_argv);
- gui_argv = NULL;
+ VIM_CLEAR(gui_argv);
}
/*
@@ -1741,8 +1740,7 @@ gui_mch_exit(int rc UNUSED)
* says that this isn't needed when exiting, so just skip it. */
XtCloseDisplay(gui.dpy);
#endif
- vim_free(gui_argv);
- gui_argv = NULL;
+ VIM_CLEAR(gui_argv);
}
/*
@@ -1956,7 +1954,7 @@ gui_mch_get_font(char_u *name, int giveErrorIfMissing)
{
XFontStruct *font;
- if (!gui.in_use || name == NULL) /* can't do this when GUI not running */
+ if (!gui.in_use || name == NULL) /* can't do this when GUI not running */
return NOFONT;
font = XLoadQueryFont(gui.dpy, (char *)name);
@@ -2275,7 +2273,7 @@ fontset_ascent(XFontSet fs)
guicolor_T
gui_mch_get_color(char_u *name)
{
- guicolor_T requested;
+ guicolor_T requested;
/* can't do this when GUI not running */
if (!gui.in_use || name == NULL || *name == NUL)
@@ -2298,8 +2296,8 @@ gui_mch_get_color(char_u *name)
guicolor_T
gui_mch_get_rgb_color(int r, int g, int b)
{
- char spec[8]; /* space enough to hold "#RRGGBB" */
- XColor available;
+ char spec[8]; /* space enough to hold "#RRGGBB" */
+ XColor available;
Colormap colormap;
vim_snprintf(spec, sizeof(spec), "#%.2x%.2x%.2x", r, g, b);