diff options
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 33 |
1 files changed, 17 insertions, 16 deletions
@@ -260,7 +260,7 @@ ExpandFilename(const char *name) newname = malloc((size_t) HomeLen + strlen(name) + 2); if (!newname) { fprintf(stderr, - "%s: unable to allocate %ld bytes to expand filename %s/%s\n", + "%s: unable to allocate %lu bytes to expand filename %s/%s\n", ProgramName, (unsigned long) HomeLen + (unsigned long) strlen(name) + 2, Home, &name[1]); @@ -398,7 +398,7 @@ InsertRGBColormap(Atom a, XStandardColormap *maps, int nmaps, Bool replace) if (!sc) { /* no existing, allocate new */ sc = malloc(sizeof(StdCmap)); if (!sc) { - fprintf(stderr, "%s: unable to allocate %ld bytes for StdCmap\n", + fprintf(stderr, "%s: unable to allocate %lu bytes for StdCmap\n", ProgramName, (unsigned long) sizeof(StdCmap)); return; } @@ -585,12 +585,13 @@ FindFontSet(MyFont *font, const char *fontname) XFontSetExtents *font_extents; XFontStruct **xfonts; char **font_names; - register int i; - int ascent; - int descent; - int fnum; if (use_fontset) { + int ascent; + int descent; + int fnum; + register int i; + if (font->fontset != NULL) { XFreeFontSet(dpy, font->fontset); } @@ -648,10 +649,10 @@ FindFontSet(MyFont *font, const char *fontname) void GetFont(MyFont *font) { - const char *deffontname = "fixed"; if (!FindFontSet(font, font->name)) { const char *what = "fonts"; + const char *deffontname = "fixed"; if (use_fontset) { what = "fontsets"; @@ -952,15 +953,6 @@ Pixmap CreateMenuIcon(int height, unsigned *widthp, unsigned *heightp) { int h, w; - int ih, iw; - int ix, iy; - int mh, mw; - int tw, th; - int lw, lh; - int lx, ly; - int lines, dly; - int off; - int bw; h = height; w = h * 7 / 8; @@ -973,6 +965,15 @@ CreateMenuIcon(int height, unsigned *widthp, unsigned *heightp) if (Scr->tbpm.menu == None) { Pixmap pix; GC gc; + int ih, iw; + int ix, iy; + int mh, mw; + int tw, th; + int lw, lh; + int lx, ly; + int lines, dly; + int off; + int bw; pix = Scr->tbpm.menu = XCreatePixmap(dpy, Scr->Root, (unsigned) w, (unsigned) h, 1); |