diff options
Diffstat (limited to 'oldXMenu')
-rw-r--r-- | oldXMenu/Create.c | 2 | ||||
-rw-r--r-- | oldXMenu/Internal.c | 31 | ||||
-rw-r--r-- | oldXMenu/Makefile.in | 19 | ||||
-rw-r--r-- | oldXMenu/XMakeAssoc.c | 2 |
4 files changed, 18 insertions, 36 deletions
diff --git a/oldXMenu/Create.c b/oldXMenu/Create.c index 7eb17c508d5..e209bbeceeb 100644 --- a/oldXMenu/Create.c +++ b/oldXMenu/Create.c @@ -598,6 +598,8 @@ XMenuCreate(Display *display, Window parent, register char const *def_env) * Create pane, active, and inactive GC's. */ values = (XGCValues *)malloc(sizeof(XGCValues)); + if (!values) + return NULL; valuemask = (GCForeground | GCBackground | GCFont | GCLineWidth); /* diff --git a/oldXMenu/Internal.c b/oldXMenu/Internal.c index f489e27beab..3e97f9ab3f1 100644 --- a/oldXMenu/Internal.c +++ b/oldXMenu/Internal.c @@ -534,7 +534,6 @@ _XMRecomputePane(register Display *display, register XMenu *menu, register XMPan register int window_y; /* Recomputed window Y coordinate. */ unsigned long change_mask; /* Value mask to reconfigure window. */ - XWindowChanges *changes; /* Values to use in configure window. */ register Bool config_p = False; /* Reconfigure pane window? */ @@ -612,21 +611,19 @@ _XMRecomputePane(register Display *display, register XMenu *menu, register XMPan * it for creation with the new configuration. */ if (p_ptr->window) { + XWindowChanges changes; change_mask = (CWX | CWY | CWWidth | CWHeight); - changes = (XWindowChanges *)malloc(sizeof(XWindowChanges)); - changes->x = p_ptr->window_x; - changes->y = p_ptr->window_y; - changes->width = p_ptr->window_w; - changes->height = p_ptr->window_h; + changes.x = p_ptr->window_x; + changes.y = p_ptr->window_y; + changes.width = p_ptr->window_w; + changes.height = p_ptr->window_h; XConfigureWindow( display, p_ptr->window, change_mask, - changes + &changes ); - free(changes); - } else { if (_XMWinQueAddPane(display, menu, p_ptr) == _FAILURE) { @@ -681,7 +678,6 @@ _XMRecomputeSelection(register Display *display, register XMenu *menu, register /* Selection sequence number. */ { register Bool config_s = False; /* Reconfigure selection window? */ - XWindowChanges *changes; /* Values to change in configure. */ unsigned long change_mask; /* Value mask for XConfigureWindow. */ /* @@ -738,22 +734,19 @@ _XMRecomputeSelection(register Display *display, register XMenu *menu, register * for creation with the new configuration. */ if (s_ptr->window) { - changes = (XWindowChanges *)malloc(sizeof(XWindowChanges)); + XWindowChanges changes; change_mask = (CWX | CWY | CWWidth | CWHeight); - changes = (XWindowChanges *)malloc(sizeof(XWindowChanges)); - changes->x = s_ptr->window_x; - changes->y = s_ptr->window_y; - changes->width = s_ptr->window_w; - changes->height = s_ptr->window_h; + changes.x = s_ptr->window_x; + changes.y = s_ptr->window_y; + changes.width = s_ptr->window_w; + changes.height = s_ptr->window_h; XConfigureWindow( display, s_ptr->window, change_mask, - changes + &changes ); - free(changes); - } else { if (_XMWinQueAddSelection(display, menu, s_ptr) == _FAILURE) { diff --git a/oldXMenu/Makefile.in b/oldXMenu/Makefile.in index 7ae355b568d..39fd155735a 100644 --- a/oldXMenu/Makefile.in +++ b/oldXMenu/Makefile.in @@ -43,6 +43,7 @@ ### Code: srcdir=@srcdir@ +top_builddir = @top_builddir@ # MinGW CPPFLAGS may use this. abs_top_srcdir=@abs_top_srcdir@ VPATH=@srcdir@ @@ -93,23 +94,7 @@ OBJS = Activate.o \ all: libXMenu11.a .PHONY: all -# 'make' verbosity. -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ - -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = - -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = - -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = +-include ${top_builddir}/src/verbose.mk AUTO_DEPEND = @AUTO_DEPEND@ DEPDIR = deps diff --git a/oldXMenu/XMakeAssoc.c b/oldXMenu/XMakeAssoc.c index 9bbde2cf94d..2530e8e507b 100644 --- a/oldXMenu/XMakeAssoc.c +++ b/oldXMenu/XMakeAssoc.c @@ -69,6 +69,8 @@ XMakeAssoc(register Display *dpy, register XAssocTable *table, register XID x_id /* before the current value of "Entry". */ /* Create a new XAssoc and load it with new provided data. */ new_entry = (XAssoc *) malloc(sizeof(XAssoc)); + if (!new_entry) + return; /* This obsolete API has no way to report failure! */ new_entry->display = dpy; new_entry->x_id = x_id; new_entry->data = data; |