diff options
Diffstat (limited to 'src/add_window.c')
-rw-r--r-- | src/add_window.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/src/add_window.c b/src/add_window.c index 99481b0..74fd7bf 100644 --- a/src/add_window.c +++ b/src/add_window.c @@ -179,7 +179,7 @@ AddWindow(Window w, int iconm, IconMgr *iconp) } tmp_win->w = w; tmp_win->zoomed = ZOOM_NONE; - tmp_win->iconmgr = iconm; + tmp_win->iconmgr = (short) iconm; tmp_win->iconmgrp = iconp; tmp_win->cmaps.number_cwins = 0; @@ -266,7 +266,7 @@ AddWindow(Window w, int iconm, IconMgr *iconp) * fields in the WM_NORMAL_HINTS property. */ - tmp_win->transient = Transient(tmp_win->w, &tmp_win->transientfor); + tmp_win->transient = (short)Transient(tmp_win->w, &tmp_win->transientfor); tmp_win->nameChanged = 0; if (tmp_win->class.res_name == NULL) @@ -275,7 +275,7 @@ AddWindow(Window w, int iconm, IconMgr *iconp) tmp_win->class.res_class = NoName; tmp_win->full_name = strdup(tmp_win->name); - namelen = strlen (tmp_win->name); + namelen = (int)strlen (tmp_win->name); tmp_win->highlight = Scr->Highlight && (!(short)(long) LookInList(Scr->NoHighlight, tmp_win->full_name, @@ -479,7 +479,7 @@ AddWindow(Window w, int iconm, IconMgr *iconp) tmp_win->name, namelen)); height = Scr->SizeFont.height + SIZE_VINDENT * 2; - XResizeWindow (dpy, Scr->SizeWindow, width + SIZE_HINDENT, height); + XResizeWindow (dpy, Scr->SizeWindow, (unsigned)(width + SIZE_HINDENT), (unsigned)height); XMapRaised(dpy, Scr->SizeWindow); InstallRootColormap(); @@ -585,8 +585,8 @@ AddWindow(Window w, int iconm, IconMgr *iconp) Scr->SizeStringOffset = width + MyFont_TextWidth(&Scr->SizeFont, ": ", 2); - XResizeWindow (dpy, Scr->SizeWindow, Scr->SizeStringOffset + - Scr->SizeStringWidth, height); + XResizeWindow (dpy, Scr->SizeWindow, (unsigned)(Scr->SizeStringOffset + + Scr->SizeStringWidth), (unsigned)height); MyFont_DrawImageString (dpy, Scr->SizeWindow, &Scr->SizeFont, Scr->NormalGC, width, SIZE_VINDENT + Scr->SizeFont.ascent, @@ -843,7 +843,7 @@ AddWindow(Window w, int iconm, IconMgr *iconp) tmp_win->gray = XCreatePixmapFromBitmapData(dpy, Scr->Root, gray_bits, gray_width, gray_height, tmp_win->border_tile.fore, tmp_win->border_tile.back, - Scr->d_depth); + (unsigned)Scr->d_depth); SetBorder (tmp_win, False); } @@ -882,7 +882,7 @@ AddWindow(Window w, int iconm, IconMgr *iconp) XShapeQueryExtents (dpy, tmp_win->w, &boundingShaped, &xws, &yws, &wws, &hws, &clipShaped, &xbs, &ybs, &wbs, &hbs); - tmp_win->wShaped = boundingShaped; + tmp_win->wShaped = (short)boundingShaped; } if (!tmp_win->iconmgr) @@ -1023,7 +1023,7 @@ GrabButtons(TwmWindow *tmp_win) /* twm used to do this grab on the application main window, * tmp_win->w . This was not ICCCM complient and was changed. */ - XGrabButton(dpy, i, j, tmp_win->frame, + XGrabButton(dpy, (unsigned)i, (unsigned)j, tmp_win->frame, True, ButtonPressMask | ButtonReleaseMask, GrabModeAsync, GrabModeAsync, None, Scr->FrameCursor); @@ -1048,29 +1048,29 @@ GrabKeys(TwmWindow *tmp_win) switch (tmp->cont) { case C_WINDOW: - XGrabKey(dpy, tmp->keycode, tmp->mods, tmp_win->w, True, + XGrabKey(dpy, tmp->keycode, (unsigned)tmp->mods, tmp_win->w, True, GrabModeAsync, GrabModeAsync); break; case C_ICON: if (tmp_win->icon_w) - XGrabKey(dpy, tmp->keycode, tmp->mods, tmp_win->icon_w, True, + XGrabKey(dpy, tmp->keycode, (unsigned)tmp->mods, tmp_win->icon_w, True, GrabModeAsync, GrabModeAsync); case C_TITLE: if (tmp_win->title_w) - XGrabKey(dpy, tmp->keycode, tmp->mods, tmp_win->title_w, True, + XGrabKey(dpy, tmp->keycode, (unsigned)tmp->mods, tmp_win->title_w, True, GrabModeAsync, GrabModeAsync); break; case C_NAME: - XGrabKey(dpy, tmp->keycode, tmp->mods, tmp_win->w, True, + XGrabKey(dpy, tmp->keycode, (unsigned)tmp->mods, tmp_win->w, True, GrabModeAsync, GrabModeAsync); if (tmp_win->icon_w) - XGrabKey(dpy, tmp->keycode, tmp->mods, tmp_win->icon_w, True, + XGrabKey(dpy, tmp->keycode, (unsigned)tmp->mods, tmp_win->icon_w, True, GrabModeAsync, GrabModeAsync); if (tmp_win->title_w) - XGrabKey(dpy, tmp->keycode, tmp->mods, tmp_win->title_w, True, + XGrabKey(dpy, tmp->keycode, (unsigned)tmp->mods, tmp_win->title_w, True, GrabModeAsync, GrabModeAsync); break; /* @@ -1087,7 +1087,7 @@ GrabKeys(TwmWindow *tmp_win) { for (p = &Scr->iconmgr; p != NULL; p = p->next) { - XUngrabKey(dpy, tmp->keycode, tmp->mods, p->twm_win->w); + XUngrabKey(dpy, tmp->keycode, (unsigned)tmp->mods, p->twm_win->w); } } } @@ -1125,8 +1125,8 @@ static Window CreateHighlightWindow (TwmWindow *tmp_win) } if (Scr->hilitePm) { pm = XCreatePixmap (dpy, tmp_win->title_w, - Scr->hilite_pm_width, Scr->hilite_pm_height, - Scr->d_depth); + (unsigned)Scr->hilite_pm_width, (unsigned)Scr->hilite_pm_height, + (unsigned)Scr->d_depth); gcv.foreground = tmp_win->title.fore; gcv.background = tmp_win->title.back; gcv.graphics_exposures = False; @@ -1135,7 +1135,7 @@ static Window CreateHighlightWindow (TwmWindow *tmp_win) &gcv); if (gc) { XCopyPlane (dpy, Scr->hilitePm, pm, gc, 0, 0, - Scr->hilite_pm_width, Scr->hilite_pm_height, + (unsigned)Scr->hilite_pm_width, (unsigned)Scr->hilite_pm_height, 0, 0, 1); XFreeGC (dpy, gc); } else { @@ -1287,14 +1287,14 @@ static void CreateWindowTitlebarButtons (TwmWindow *tmp_win) tmp_win->titlebuttons = NULL; nb = Scr->TBInfo.nleft + Scr->TBInfo.nright; if (nb > 0) { - tmp_win->titlebuttons = malloc (nb * sizeof(TBWindow)); + tmp_win->titlebuttons = malloc ((size_t)nb * sizeof(TBWindow)); if (!tmp_win->titlebuttons) { fprintf (stderr, "%s: unable to allocate %d titlebuttons\n", ProgramName, nb); } else { TBWindow *tbw; int boxwidth = (Scr->TBInfo.width + Scr->TBInfo.pad); - unsigned int h = (Scr->TBInfo.width - Scr->TBInfo.border * 2); + unsigned h = (unsigned)(Scr->TBInfo.width - Scr->TBInfo.border * 2); for (tb = Scr->TBInfo.head, tbw = tmp_win->titlebuttons; tb; tb = tb->next, tbw++) { @@ -1338,8 +1338,8 @@ SetHighlightPixmap (char *filename) XFreePixmap (dpy, Scr->hilitePm); } Scr->hilitePm = pm; - Scr->hilite_pm_width = JunkWidth; - Scr->hilite_pm_height = JunkHeight; + Scr->hilite_pm_width = (int)JunkWidth; + Scr->hilite_pm_height = (int)JunkHeight; } } @@ -1469,7 +1469,7 @@ FetchWmColormapWindows (TwmWindow *tmp) } if (i == number_cmap_windows) { /* not in list */ Window *new_cmap_windows = - malloc (sizeof(Window) * (number_cmap_windows + 1)); + malloc (sizeof(Window) * (size_t)(number_cmap_windows + 1)); if (!new_cmap_windows) { fprintf (stderr, @@ -1487,7 +1487,7 @@ FetchWmColormapWindows (TwmWindow *tmp) number_cmap_windows++; } - cwins = malloc(sizeof(ColormapWindow *) * number_cmap_windows); + cwins = malloc(sizeof(ColormapWindow *) * (size_t)number_cmap_windows); if (cwins) { for (i = 0; i < number_cmap_windows; i++) { |