summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-01-22 22:46:42 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-01-22 22:46:45 -0800
commit81a64c9112b9d650106a01d8bcd246011d037bc2 (patch)
tree4dab5fcfc974bed4ed519056081be64853412710
parent70c0bd30f0f77e70910d10f91ecca617d6b5acb7 (diff)
Give unique names to the two reply variables in child_info
Clears compiler warnings: xlsclients.c:253:28: warning: declaration shadows a local variable [-Wshadow] xcb_get_property_reply_t *reply; ^ xlsclients.c:250:30: note: previous declaration is here xcb_query_tree_reply_t **reply; Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--xlsclients.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/xlsclients.c b/xlsclients.c
index 691f868..5b7ccad 100644
--- a/xlsclients.c
+++ b/xlsclients.c
@@ -247,23 +247,23 @@ static void child_info(void *closure)
int i, j;
int child_count, num_rep;
- xcb_query_tree_reply_t **reply;
+ xcb_query_tree_reply_t **qt_reply;
for (i = 0; i < cs->list_length; i++) {
- xcb_get_property_reply_t *reply;
- reply = xcb_get_property_reply(c, cs->prop_cookie[i], NULL);
- if (reply) {
- if (reply->type) {
+ xcb_get_property_reply_t *gp_reply;
+ gp_reply = xcb_get_property_reply(c, cs->prop_cookie[i], NULL);
+ if (gp_reply) {
+ if (gp_reply->type) {
/* Show information for this window */
print_client_properties(c, cs->win[i], cs->verbose, cs->maxcmdlen);
- free(reply);
+ free(gp_reply);
/* drain stale replies */
for (j = i+1; j < cs->list_length; j++) {
- reply = xcb_get_property_reply(c, cs->prop_cookie[j], NULL);
- if (reply)
- free(reply);
+ gp_reply = xcb_get_property_reply(c, cs->prop_cookie[j], NULL);
+ if (gp_reply)
+ free(gp_reply);
}
for (j = 0; j < cs->list_length; j++) {
xcb_query_tree_reply_t *rep;
@@ -273,25 +273,25 @@ static void child_info(void *closure)
}
goto done;
}
- free(reply);
+ free(gp_reply);
}
}
/* WM_STATE not found. Recurse into children: */
num_rep = 0;
- reply = malloc(sizeof(*reply) * cs->list_length);
- if (!reply)
+ qt_reply = malloc(sizeof(*qt_reply) * cs->list_length);
+ if (!qt_reply)
goto done; /* TODO: print OOM message, drain reply queue */
for (i = 0; i < cs->list_length; i++) {
- reply[num_rep] = xcb_query_tree_reply(c, cs->tree_cookie[i], NULL);
- if (reply[num_rep])
+ qt_reply[num_rep] = xcb_query_tree_reply(c, cs->tree_cookie[i], NULL);
+ if (qt_reply[num_rep])
num_rep++;
}
child_count = 0;
for (i = 0; i < num_rep; i++)
- child_count += reply[i]->children_len;
+ child_count += qt_reply[i]->children_len;
if (!child_count) {
/* No children have CS_STATE; try the parent window */
@@ -314,8 +314,8 @@ static void child_info(void *closure)
child_count = 0;
for (i = 0; i < num_rep; i++) {
- xcb_window_t *child = xcb_query_tree_children(reply[i]);
- for (j = 0; j < reply[i]->children_len; j++) {
+ xcb_window_t *child = xcb_query_tree_children(qt_reply[i]);
+ for (j = 0; j < qt_reply[i]->children_len; j++) {
cs->win[child_count] = child[j];
cs->prop_cookie[child_count] = xcb_get_property(c, 0, child[j],
WM_STATE, XCB_GET_PROPERTY_TYPE_ANY,
@@ -329,8 +329,8 @@ static void child_info(void *closure)
reply_done:
for (i = 0; i < num_rep; i++)
- free(reply[i]);
- free(reply);
+ free(qt_reply[i]);
+ free(qt_reply);
done:
free(closure);