diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2020-06-18 18:34:59 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2020-06-18 18:34:59 -0400 |
commit | a9d6701d977700b18e31a70cc7982431bc702095 (patch) | |
tree | eb24677e90094a95c1461243b56e83309a47742b /src/util.c | |
parent | d2b4f0598086d4dd5caf3cdc218d0f97c37229ac (diff) |
fix the cppcheck style- and format-warnings
also bump version to 1.0.11.1, reflecting ongoing work since release
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
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); |