summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2019-07-16 17:06:02 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2019-07-16 17:06:02 -0400
commit5e1798773d837eabaa70d0fff5762397f540ee00 (patch)
treef49b196a92086ac2893b9642d6798441847666db /src
parentb09c794f975d4b11685ac31884b8a6fd73b1ff15 (diff)
caddr_t used to be used in X code before XPointer was established; it's obsolete and less portable
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
Diffstat (limited to 'src')
-rw-r--r--src/add_window.c30
-rw-r--r--src/events.c4
-rw-r--r--src/iconmgr.c10
-rw-r--r--src/icons.c4
-rw-r--r--src/menus.c4
-rw-r--r--src/resize.c2
-rw-r--r--src/twm.c2
7 files changed, 28 insertions, 28 deletions
diff --git a/src/add_window.c b/src/add_window.c
index cb5be4e..acd685f 100644
--- a/src/add_window.c
+++ b/src/add_window.c
@@ -915,27 +915,27 @@ AddWindow(Window w, int iconm, IconMgr *iconp)
(void) AddIconManager(tmp_win);
- XSaveContext(dpy, tmp_win->w, TwmContext, (caddr_t) tmp_win);
- XSaveContext(dpy, tmp_win->w, ScreenContext, (caddr_t) Scr);
- XSaveContext(dpy, tmp_win->frame, TwmContext, (caddr_t) tmp_win);
- XSaveContext(dpy, tmp_win->frame, ScreenContext, (caddr_t) Scr);
+ XSaveContext(dpy, tmp_win->w, TwmContext, (XPointer) tmp_win);
+ XSaveContext(dpy, tmp_win->w, ScreenContext, (XPointer) Scr);
+ XSaveContext(dpy, tmp_win->frame, TwmContext, (XPointer) tmp_win);
+ XSaveContext(dpy, tmp_win->frame, ScreenContext, (XPointer) Scr);
if (tmp_win->title_height)
{
int i;
int nb = Scr->TBInfo.nleft + Scr->TBInfo.nright;
- XSaveContext(dpy, tmp_win->title_w, TwmContext, (caddr_t) tmp_win);
- XSaveContext(dpy, tmp_win->title_w, ScreenContext, (caddr_t) Scr);
+ XSaveContext(dpy, tmp_win->title_w, TwmContext, (XPointer) tmp_win);
+ XSaveContext(dpy, tmp_win->title_w, ScreenContext, (XPointer) Scr);
for (i = 0; i < nb; i++) {
XSaveContext(dpy, tmp_win->titlebuttons[i].window, TwmContext,
- (caddr_t) tmp_win);
+ (XPointer) tmp_win);
XSaveContext(dpy, tmp_win->titlebuttons[i].window, ScreenContext,
- (caddr_t) Scr);
+ (XPointer) Scr);
}
if (tmp_win->hilite_w)
{
- XSaveContext(dpy, tmp_win->hilite_w, TwmContext, (caddr_t)tmp_win);
- XSaveContext(dpy, tmp_win->hilite_w, ScreenContext, (caddr_t)Scr);
+ XSaveContext(dpy, tmp_win->hilite_w, TwmContext, (XPointer)tmp_win);
+ XSaveContext(dpy, tmp_win->hilite_w, ScreenContext, (XPointer)Scr);
}
}
@@ -1373,7 +1373,7 @@ CreateTwmColormap(Colormap c)
TwmColormap *cmap;
cmap = malloc(sizeof(TwmColormap));
if (!cmap ||
- XSaveContext(dpy, c, ColormapContext, (caddr_t) cmap)) {
+ XSaveContext(dpy, c, ColormapContext, (XPointer) cmap)) {
if (cmap) free(cmap);
return (NULL);
}
@@ -1395,13 +1395,13 @@ CreateColormapWindow(Window w, Bool creating_parent, Bool property_window)
cwin = malloc(sizeof(ColormapWindow));
if (cwin) {
if (!XGetWindowAttributes(dpy, w, &attributes) ||
- XSaveContext(dpy, w, ColormapContext, (caddr_t) cwin)) {
+ XSaveContext(dpy, w, ColormapContext, (XPointer) cwin)) {
free(cwin);
return (NULL);
}
if (XFindContext(dpy, attributes.colormap, ColormapContext,
- (caddr_t *)&cwin->colormap) == XCNOENT) {
+ (XPointer *)&cwin->colormap) == XCNOENT) {
cwin->colormap = cmap = CreateTwmColormap(attributes.colormap);
if (!cmap) {
XDeleteContext(dpy, w, ColormapContext);
@@ -1511,7 +1511,7 @@ FetchWmColormapWindows (TwmWindow *tmp)
*/
if (j == tmp->cmaps.number_cwins) {
if (XFindContext(dpy, cmap_windows[i], ColormapContext,
- (caddr_t *)&cwins[i]) == XCNOENT) {
+ (XPointer *)&cwins[i]) == XCNOENT) {
if ((cwins[i] = CreateColormapWindow(cmap_windows[i],
(Bool) tmp->cmaps.number_cwins == 0,
True)) == NULL) {
@@ -1535,7 +1535,7 @@ FetchWmColormapWindows (TwmWindow *tmp)
number_cmap_windows = 1;
cwins = malloc(sizeof(ColormapWindow *));
- if (XFindContext(dpy, tmp->w, ColormapContext, (caddr_t *)&cwins[0]) ==
+ if (XFindContext(dpy, tmp->w, ColormapContext, (XPointer *)&cwins[0]) ==
XCNOENT) {
cwins[0] = CreateColormapWindow(tmp->w,
(Bool) tmp->cmaps.number_cwins == 0, False);
diff --git a/src/events.c b/src/events.c
index 68d9749..f92014f 100644
--- a/src/events.c
+++ b/src/events.c
@@ -881,8 +881,8 @@ HandlePropertyNotify(void)
Tmp_win->icon_w = Tmp_win->wmhints->icon_window;
XSelectInput (dpy, Tmp_win->icon_w,
KeyPressMask | ButtonPressMask | ButtonReleaseMask);
- XSaveContext(dpy, Tmp_win->icon_w, TwmContext, (caddr_t)Tmp_win);
- XSaveContext(dpy, Tmp_win->icon_w, ScreenContext, (caddr_t)Scr);
+ XSaveContext(dpy, Tmp_win->icon_w, TwmContext, (XPointer)Tmp_win);
+ XSaveContext(dpy, Tmp_win->icon_w, ScreenContext, (XPointer)Scr);
XDefineCursor(dpy, Tmp_win->icon_w, Scr->IconCursor);
}
}
diff --git a/src/iconmgr.c b/src/iconmgr.c
index 6764802..80457a1 100644
--- a/src/iconmgr.c
+++ b/src/iconmgr.c
@@ -429,11 +429,11 @@ WList *AddIconManager(TwmWindow *tmp_win)
PackIconManager(ip);
XMapWindow(dpy, tmp->w);
- XSaveContext(dpy, tmp->w, IconManagerContext, (caddr_t) tmp);
- XSaveContext(dpy, tmp->w, TwmContext, (caddr_t) tmp_win);
- XSaveContext(dpy, tmp->w, ScreenContext, (caddr_t) Scr);
- XSaveContext(dpy, tmp->icon, TwmContext, (caddr_t) tmp_win);
- XSaveContext(dpy, tmp->icon, ScreenContext, (caddr_t) Scr);
+ XSaveContext(dpy, tmp->w, IconManagerContext, (XPointer) tmp);
+ XSaveContext(dpy, tmp->w, TwmContext, (XPointer) tmp_win);
+ XSaveContext(dpy, tmp->w, ScreenContext, (XPointer) Scr);
+ XSaveContext(dpy, tmp->icon, TwmContext, (XPointer) tmp_win);
+ XSaveContext(dpy, tmp->icon, ScreenContext, (XPointer) Scr);
tmp_win->list = tmp;
if (!ip->twm_win->icon)
diff --git a/src/icons.c b/src/icons.c
index ec9add9..a3a6588 100644
--- a/src/icons.c
+++ b/src/icons.c
@@ -574,8 +574,8 @@ CreateIconWindow(TwmWindow *tmp_win, int def_x, int def_y)
tmp_win->iconified = TRUE;
XMapSubwindows(dpy, tmp_win->icon_w);
- XSaveContext(dpy, tmp_win->icon_w, TwmContext, (caddr_t)tmp_win);
- XSaveContext(dpy, tmp_win->icon_w, ScreenContext, (caddr_t)Scr);
+ XSaveContext(dpy, tmp_win->icon_w, TwmContext, (XPointer)tmp_win);
+ XSaveContext(dpy, tmp_win->icon_w, ScreenContext, (XPointer)Scr);
XDefineCursor(dpy, tmp_win->icon_w, Scr->IconCursor);
if (pm) XFreePixmap (dpy, pm);
return;
diff --git a/src/menus.c b/src/menus.c
index 37db9b1..4401101 100644
--- a/src/menus.c
+++ b/src/menus.c
@@ -849,8 +849,8 @@ MakeMenu(MenuRoot *mr)
valuemask, &attributes);
- XSaveContext(dpy, mr->w, MenuContext, (caddr_t)mr);
- XSaveContext(dpy, mr->w, ScreenContext, (caddr_t)Scr);
+ XSaveContext(dpy, mr->w, MenuContext, (XPointer)mr);
+ XSaveContext(dpy, mr->w, ScreenContext, (XPointer)Scr);
mr->mapped = UNMAPPED;
}
diff --git a/src/resize.c b/src/resize.c
index e59e190..5a93ac5 100644
--- a/src/resize.c
+++ b/src/resize.c
@@ -536,7 +536,7 @@ EndResize(void)
MoveOutline(Scr->Root, 0, 0, 0, 0, 0, 0);
XUnmapWindow(dpy, Scr->SizeWindow);
- XFindContext(dpy, ResizeWindow, TwmContext, (caddr_t *)&tmp_win);
+ XFindContext(dpy, ResizeWindow, TwmContext, (XPointer *)&tmp_win);
ConstrainSize (tmp_win, &dragWidth, &dragHeight);
diff --git a/src/twm.c b/src/twm.c
index 204f7b1..a10c6ce 100644
--- a/src/twm.c
+++ b/src/twm.c
@@ -469,7 +469,7 @@ main(int argc, char *argv[])
Scr->d_depth = DefaultDepth(dpy, scrnum);
Scr->d_visual = DefaultVisual(dpy, scrnum);
Scr->Root = RootWindow(dpy, scrnum);
- XSaveContext (dpy, Scr->Root, ScreenContext, (caddr_t) Scr);
+ XSaveContext (dpy, Scr->Root, ScreenContext, (XPointer) Scr);
Scr->TwmRoot.cmaps.number_cwins = 1;
Scr->TwmRoot.cmaps.cwins = malloc(sizeof(ColormapWindow *));