summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-11-08 18:34:35 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-11-14 16:54:22 -0800
commitf7b1a3f4fec15a0f0a0cd95308f29310adb023a4 (patch)
tree8d86e305bfd1370f88f3cbca1dad03859e795a61
parent07f869b9024847a98d0593a3d05cff122ae7c8eb (diff)
Rename "dpy" function arguments to "display" to avoid shadowing global
Clears many gcc -Wshadow warnings Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--dsimple.c24
-rw-r--r--xprop.c22
2 files changed, 23 insertions, 23 deletions
diff --git a/dsimple.c b/dsimple.c
index afe41b6..e3ebec7 100644
--- a/dsimple.c
+++ b/dsimple.c
@@ -247,19 +247,19 @@ Window Select_Window_Args(
* Routine to let user select a window using the mouse
*/
-Window Select_Window(Display *dpy, int descend)
+Window Select_Window(Display *display, int descend)
{
int status;
Cursor cursor;
XEvent event;
- Window target_win = None, root = RootWindow(dpy,screen);
+ Window target_win = None, root = RootWindow(display,screen);
int buttons = 0;
/* Make the target cursor */
- cursor = XCreateFontCursor(dpy, XC_crosshair);
+ cursor = XCreateFontCursor(display, XC_crosshair);
/* Grab the pointer using target cursor, letting it room all over */
- status = XGrabPointer(dpy, root, False,
+ status = XGrabPointer(display, root, False,
ButtonPressMask|ButtonReleaseMask, GrabModeSync,
GrabModeAsync, root, cursor, CurrentTime);
if (status != GrabSuccess) Fatal_Error("Can't grab the mouse.");
@@ -267,8 +267,8 @@ Window Select_Window(Display *dpy, int descend)
/* Let the user select a window... */
while ((target_win == None) || (buttons != 0)) {
/* allow one more event */
- XAllowEvents(dpy, SyncPointer, CurrentTime);
- XWindowEvent(dpy, root, ButtonPressMask|ButtonReleaseMask, &event);
+ XAllowEvents(display, SyncPointer, CurrentTime);
+ XWindowEvent(display, root, ButtonPressMask|ButtonReleaseMask, &event);
switch (event.type) {
case ButtonPress:
if (target_win == None) {
@@ -284,12 +284,12 @@ Window Select_Window(Display *dpy, int descend)
}
}
- XUngrabPointer(dpy, CurrentTime); /* Done with pointer */
+ XUngrabPointer(display, CurrentTime); /* Done with pointer */
if (!descend || (target_win == root))
return(target_win);
- target_win = Find_Client(dpy, root, target_win);
+ target_win = Find_Client(display, root, target_win);
return(target_win);
}
@@ -303,7 +303,7 @@ Window Select_Window(Display *dpy, int descend)
* are looked at. Normally, top should be the RootWindow.
*/
Window Window_With_Name(
- Display *dpy,
+ Display *display,
Window top,
const char *name)
{
@@ -313,14 +313,14 @@ Window Window_With_Name(
Window w=0;
char *window_name;
- if (XFetchName(dpy, top, &window_name) && !strcmp(window_name, name))
+ if (XFetchName(display, top, &window_name) && !strcmp(window_name, name))
return(top);
- if (!XQueryTree(dpy, top, &dummy, &dummy, &children, &nchildren))
+ if (!XQueryTree(display, top, &dummy, &dummy, &children, &nchildren))
return(0);
for (i=0; i<nchildren; i++) {
- w = Window_With_Name(dpy, children[i], name);
+ w = Window_With_Name(display, children[i], name);
if (w)
break;
}
diff --git a/xprop.c b/xprop.c
index 7aa543f..cd7a184 100644
--- a/xprop.c
+++ b/xprop.c
@@ -596,7 +596,7 @@ Format_Signed (long wrd)
/*ARGSUSED*/
static int
-ignore_errors (Display *dpy, XErrorEvent *ev)
+ignore_errors (Display *display, XErrorEvent *ev)
{
return 0;
}
@@ -1621,20 +1621,20 @@ Handle_Prop_Requests (int argc, char **argv)
}
static void
-Remove_Property (Display *dpy, Window w, const char *propname)
+Remove_Property (Display *display, Window w, const char *propname)
{
- Atom id = XInternAtom (dpy, propname, True);
+ Atom id = XInternAtom (display, propname, True);
if (id == None) {
fprintf (stderr, "%s: no such property \"%s\"\n",
program_name, propname);
return;
}
- XDeleteProperty (dpy, w, id);
+ XDeleteProperty (display, w, id);
}
static void
-Set_Property (Display *dpy, Window w, const char *propname, const char *value)
+Set_Property (Display *display, Window w, const char *propname, const char *value)
{
Atom atom;
const char *format;
@@ -1666,7 +1666,7 @@ Set_Property (Display *dpy, Window w, const char *propname, const char *value)
case 'u':
if (size != 8)
Fatal_Error("can't use format character 'u' with any size except 8.");
- type = XInternAtom(dpy, "UTF8_STRING", False);
+ type = XInternAtom(display, "UTF8_STRING", False);
data = (const unsigned char *) value;
nelements = strlen(value);
break;
@@ -1674,7 +1674,7 @@ Set_Property (Display *dpy, Window w, const char *propname, const char *value)
XTextProperty textprop;
if (size != 8)
Fatal_Error("can't use format character 't' with any size except 8.");
- if (XmbTextListToTextProperty(dpy, (char **) &value, 1,
+ if (XmbTextListToTextProperty(display, (char **) &value, 1,
XStdICCTextStyle, &textprop) != Success) {
fprintf(stderr, "cannot convert %s argument to STRING or COMPOUND_TEXT.\n", propname);
return;
@@ -1804,7 +1804,7 @@ Set_Property (Display *dpy, Window w, const char *propname, const char *value)
Fatal_Error("bad format character: %c", format_char);
}
- XChangeProperty(dpy, target_win, atom, type, size, PropModeReplace,
+ XChangeProperty(display, target_win, atom, type, size, PropModeReplace,
data, nelements);
}
@@ -1917,9 +1917,9 @@ Parse_Format_Mapping (int *argc, char ***argv)
static int spy = 0;
-static int (*old_error_handler)(Display *dpy, XErrorEvent *ev);
+static int (*old_error_handler)(Display *display, XErrorEvent *ev);
-static int spy_error_handler(Display *dpy, XErrorEvent *ev)
+static int spy_error_handler(Display *display, XErrorEvent *ev)
{
if (ev->error_code == BadWindow || ev->error_code == BadMatch) {
/* Window was destroyed */
@@ -1928,7 +1928,7 @@ static int spy_error_handler(Display *dpy, XErrorEvent *ev)
}
if (old_error_handler)
- return old_error_handler(dpy, ev);
+ return old_error_handler(display, ev);
return 0;
}