summaryrefslogtreecommitdiff
path: root/src/twm.c
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2020-06-18 18:34:59 -0400
committerThomas E. Dickey <dickey@invisible-island.net>2020-06-18 18:34:59 -0400
commita9d6701d977700b18e31a70cc7982431bc702095 (patch)
treeeb24677e90094a95c1461243b56e83309a47742b /src/twm.c
parentd2b4f0598086d4dd5caf3cdc218d0f97c37229ac (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/twm.c')
-rw-r--r--src/twm.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/twm.c b/src/twm.c
index ce67806..405a57e 100644
--- a/src/twm.c
+++ b/src/twm.c
@@ -183,12 +183,12 @@ static char *atom_names[11] = {
/* |hasExtension()| and |IsPrintScreen()| have been stolen from
* xc/programs/xdpyinfo/xdpyinfo.c */
static Bool
-hasExtension(Display *dpy, char *extname)
+hasExtension(Display *dpy2, char *extname)
{
int num_extensions, i;
char **extensions;
- extensions = XListExtensions(dpy, &num_extensions);
+ extensions = XListExtensions(dpy2, &num_extensions);
for (i = 0; i < num_extensions &&
(strcmp(extensions[i], extname) != 0); i++);
XFreeExtensionList(extensions);
@@ -198,15 +198,15 @@ hasExtension(Display *dpy, char *extname)
static Bool
IsPrintScreen(Screen *s)
{
- Display *dpy = XDisplayOfScreen(s);
- int i;
+ Display *dpy2 = XDisplayOfScreen(s);
/* Check whether this is a screen of a print DDX */
- if (hasExtension(dpy, XP_PRINTNAME)) {
+ if (hasExtension(dpy2, XP_PRINTNAME)) {
Screen **pscreens;
int pscrcount;
+ int i;
- pscreens = XpQueryScreens(dpy, &pscrcount);
+ pscreens = XpQueryScreens(dpy2, &pscrcount);
for (i = 0; (i < pscrcount) && pscreens; i++) {
if (s == pscreens[i]) {
return True;
@@ -889,11 +889,12 @@ void
RestoreWithdrawnLocation(TwmWindow *tmp)
{
int gravx, gravy;
- unsigned int bw, mask;
+ unsigned int bw;
XWindowChanges xwc;
if (XGetGeometry(dpy, tmp->w, &JunkRoot, &xwc.x, &xwc.y,
&JunkWidth, &JunkHeight, &bw, &JunkDepth)) {
+ unsigned mask;
GetGravityOffsets(tmp, &gravx, &gravy);
if (gravy < 0)