diff options
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 36 |
1 files changed, 20 insertions, 16 deletions
@@ -59,7 +59,7 @@ in this Software without prior written authorization from The Open Group. #include "twm.h" #include "util.h" -#include "gram.h" +#include "parse.h" #include "screen.h" #include <X11/Xos.h> #include <X11/Xatom.h> @@ -96,7 +96,7 @@ MoveOutline(Window root, int x, int y, int width, int height, int bw, int th) int xl, xr, yt, yb, xinnerl, xinnerr, yinnert, yinnerb; int xthird, ythird; XSegment outline[18]; - register XSegment *r; + XSegment *r; if (x == lastx && y == lasty && width == lastWidth && height == lastHeight && lastBW == bw && th == lastTH) @@ -209,6 +209,8 @@ Zoom(Window wf, Window wt) long dx, dy, dw, dh; long z; int j; + unsigned udummy = 0; + Window wdummy = None; if (!Scr->DoZoom || Scr->ZoomCount < 1) return; @@ -216,8 +218,8 @@ Zoom(Window wf, Window wt) if (wf == None || wt == None) return; - XGetGeometry(dpy, wf, &JunkRoot, &fx, &fy, &fw, &fh, &JunkBW, &JunkDepth); - XGetGeometry(dpy, wt, &JunkRoot, &tx, &ty, &tw, &th, &JunkBW, &JunkDepth); + XGetGeometry(dpy, wf, &wdummy, &fx, &fy, &fw, &fh, &udummy, &udummy); + XGetGeometry(dpy, wt, &wdummy, &tx, &ty, &tw, &th, &udummy, &udummy); dx = ((long) (tx - fx)); /* going from -> to */ dy = ((long) (ty - fy)); /* going from -> to */ @@ -275,10 +277,14 @@ ExpandFilename(const char *name) void GetUnknownIcon(const char *name) { + int dummy = 0; + unsigned udummy = 0; + Window wdummy = None; + if ((Scr->UnknownPm = GetBitmap(name)) != None) { - XGetGeometry(dpy, Scr->UnknownPm, &JunkRoot, &JunkX, &JunkY, + XGetGeometry(dpy, Scr->UnknownPm, &wdummy, &dummy, &dummy, (unsigned int *) &Scr->UnknownWidth, - (unsigned int *) &Scr->UnknownHeight, &JunkBW, &JunkDepth); + (unsigned int *) &Scr->UnknownHeight, &udummy, &udummy); } } @@ -371,7 +377,9 @@ FindBitmap(const char *name, unsigned *widthp, unsigned *heightp) Pixmap GetBitmap(const char *name) { - return FindBitmap(name, &JunkWidth, &JunkHeight); + unsigned udummy = 0; + + return FindBitmap(name, &udummy, &udummy); } void @@ -387,7 +395,7 @@ InsertRGBColormap(Atom a, XStandardColormap *maps, int nmaps, Bool replace) } if (!sc) { /* no existing, allocate new */ - sc = malloc(sizeof(StdCmap)); + sc = (StdCmap *) malloc(sizeof(StdCmap)); if (!sc) { twmWarning("unable to allocate %lu bytes for StdCmap", (unsigned long) sizeof(StdCmap)); @@ -474,10 +482,8 @@ GetColor(int kind, Pixel *what, const char *name) Status stat = 0; Colormap cmap = Scr->TwmRoot.cmaps.cwins[0]->colormap->c; -#ifndef TOM if (!Scr->FirstTime) return; -#endif if (Scr->Monochrome != kind) return; @@ -549,10 +555,8 @@ GetColorValue(int kind, XColor *what, const char *name) XColor junkcolor; Colormap cmap = Scr->TwmRoot.cmaps.cwins[0]->colormap->c; -#ifndef TOM if (!Scr->FirstTime) return; -#endif if (Scr->Monochrome != kind) return; @@ -579,7 +583,7 @@ FindFontSet(MyFont *font, const char *fontname) int ascent; int descent; int fnum; - register int i; + int i; if (font->fontset != NULL) { XFreeFontSet(dpy, font->fontset); @@ -911,11 +915,11 @@ CreateDotPixmap(unsigned *widthp, unsigned *heightp) if (!(h & 1)) h--; *widthp = *heightp = (unsigned int) h; - if (Scr->tbpm.delete == None) { + if (Scr->tbpm.remove == None) { GC gc; Pixmap pix; - pix = Scr->tbpm.delete = + pix = Scr->tbpm.remove = XCreatePixmap(dpy, Scr->Root, (unsigned) h, (unsigned) h, 1); gc = XCreateGC(dpy, pix, 0L, NULL); XSetLineAttributes(dpy, gc, (unsigned) h, LineSolid, CapRound, @@ -926,7 +930,7 @@ CreateDotPixmap(unsigned *widthp, unsigned *heightp) XDrawLine(dpy, pix, gc, h / 2, h / 2, h / 2, h / 2); XFreeGC(dpy, gc); } - return Scr->tbpm.delete; + return Scr->tbpm.remove; } #define questionmark_width 8 |