diff options
author | markt <markt> | 2006-08-08 19:25:48 (GMT) |
---|---|---|
committer | markt <markt> | 2006-08-08 19:25:48 (GMT) |
commit | 9b9d5a9617612928710570e024632ba62f0ff74f (patch) | |
tree | 187697534c1eee0ce1c4ce73574bc277e61b9b06 /src | |
parent | e2c31b7285f4bba232547bb61f97abf29fdca34e (diff) | |
download | fluxbox_lack-9b9d5a9617612928710570e024632ba62f0ff74f.zip fluxbox_lack-9b9d5a9617612928710570e024632ba62f0ff74f.tar.bz2 |
fix some compiler warnings in gcc 4.1
Diffstat (limited to 'src')
-rw-r--r-- | src/Ewmh.cc | 4 | ||||
-rw-r--r-- | src/FbTk/FbPixmap.cc | 8 | ||||
-rw-r--r-- | src/Gnome.cc | 9 | ||||
-rw-r--r-- | src/Screen.cc | 7 | ||||
-rw-r--r-- | src/WinClient.cc | 24 | ||||
-rw-r--r-- | src/Window.cc | 15 |
6 files changed, 38 insertions, 29 deletions
diff --git a/src/Ewmh.cc b/src/Ewmh.cc index 97c66b8..c697b6d 100644 --- a/src/Ewmh.cc +++ b/src/Ewmh.cc | |||
@@ -1138,10 +1138,10 @@ void Ewmh::updateStrut(WinClient &winclient) { | |||
1138 | Atom ret_type = 0; | 1138 | Atom ret_type = 0; |
1139 | int fmt = 0; | 1139 | int fmt = 0; |
1140 | unsigned long nitems = 0, bytes_after = 0; | 1140 | unsigned long nitems = 0, bytes_after = 0; |
1141 | long *data = 0; | 1141 | unsigned char *data = 0; |
1142 | if (winclient.property(m_net_wm_strut, 0, 4, False, XA_CARDINAL, | 1142 | if (winclient.property(m_net_wm_strut, 0, 4, False, XA_CARDINAL, |
1143 | &ret_type, &fmt, &nitems, &bytes_after, | 1143 | &ret_type, &fmt, &nitems, &bytes_after, |
1144 | (unsigned char **) &data) && data) { | 1144 | &data) && data) { |
1145 | 1145 | ||
1146 | int head = winclient.screen().getHead(winclient); | 1146 | int head = winclient.screen().getHead(winclient); |
1147 | winclient.setStrut(winclient.screen().requestStrut(head, | 1147 | winclient.setStrut(winclient.screen().requestStrut(head, |
diff --git a/src/FbTk/FbPixmap.cc b/src/FbTk/FbPixmap.cc index 3aebd62..ea1d1c9 100644 --- a/src/FbTk/FbPixmap.cc +++ b/src/FbTk/FbPixmap.cc | |||
@@ -359,7 +359,7 @@ void FbPixmap::rootwinPropertyNotify(int screen_num, Atom atom) { | |||
359 | Atom real_type; | 359 | Atom real_type; |
360 | int real_format; | 360 | int real_format; |
361 | unsigned long items_read, items_left; | 361 | unsigned long items_read, items_left; |
362 | unsigned long *data; | 362 | unsigned char *data; |
363 | 363 | ||
364 | if (XGetWindowProperty(display(), | 364 | if (XGetWindowProperty(display(), |
365 | RootWindow(display(), screen_num), | 365 | RootWindow(display(), screen_num), |
@@ -368,7 +368,7 @@ void FbPixmap::rootwinPropertyNotify(int screen_num, Atom atom) { | |||
368 | False, XA_PIXMAP, | 368 | False, XA_PIXMAP, |
369 | &real_type, &real_format, | 369 | &real_type, &real_format, |
370 | &items_read, &items_left, | 370 | &items_read, &items_left, |
371 | (unsigned char **) &data) == Success) { | 371 | &data) == Success) { |
372 | if (real_format == 32 && items_read == 1) { | 372 | if (real_format == 32 && items_read == 1) { |
373 | root_pm = (Pixmap) (*data); | 373 | root_pm = (Pixmap) (*data); |
374 | } | 374 | } |
@@ -410,7 +410,7 @@ Pixmap FbPixmap::getRootPixmap(int screen_num, bool force_update) { | |||
410 | Atom real_type; | 410 | Atom real_type; |
411 | int real_format; | 411 | int real_format; |
412 | unsigned long items_read, items_left; | 412 | unsigned long items_read, items_left; |
413 | unsigned long *data; | 413 | unsigned char *data; |
414 | 414 | ||
415 | unsigned int prop = 0; | 415 | unsigned int prop = 0; |
416 | 416 | ||
@@ -435,7 +435,7 @@ Pixmap FbPixmap::getRootPixmap(int screen_num, bool force_update) { | |||
435 | False, XA_PIXMAP, | 435 | False, XA_PIXMAP, |
436 | &real_type, &real_format, | 436 | &real_type, &real_format, |
437 | &items_read, &items_left, | 437 | &items_read, &items_left, |
438 | (unsigned char **) &data) == Success) { | 438 | &data) == Success) { |
439 | if (real_format == 32 && items_read == 1) { | 439 | if (real_format == 32 && items_read == 1) { |
440 | if (print_error && strcmp(root_prop_ids[prop], "_XSETROOT_ID") == 0) { | 440 | if (print_error && strcmp(root_prop_ids[prop], "_XSETROOT_ID") == 0) { |
441 | cerr<<error_message; | 441 | cerr<<error_message; |
diff --git a/src/Gnome.cc b/src/Gnome.cc index 81803dd..684b7f6 100644 --- a/src/Gnome.cc +++ b/src/Gnome.cc | |||
@@ -93,11 +93,12 @@ void Gnome::setupFrame(FluxboxWindow &win) { | |||
93 | Atom ret_type; | 93 | Atom ret_type; |
94 | int fmt; | 94 | int fmt; |
95 | unsigned long nitems, bytes_after; | 95 | unsigned long nitems, bytes_after; |
96 | long flags, *data = 0; | 96 | long flags; |
97 | unsigned char *data = 0; | ||
97 | 98 | ||
98 | if (win.winClient().property(m_gnome_wm_win_state, 0, 1, False, XA_CARDINAL, | 99 | if (win.winClient().property(m_gnome_wm_win_state, 0, 1, False, XA_CARDINAL, |
99 | &ret_type, &fmt, &nitems, &bytes_after, | 100 | &ret_type, &fmt, &nitems, &bytes_after, |
100 | (unsigned char **) &data) && data) { | 101 | &data) && data) { |
101 | flags = *data; | 102 | flags = *data; |
102 | setState(&win, flags); | 103 | setState(&win, flags); |
103 | XFree (data); | 104 | XFree (data); |
@@ -108,7 +109,7 @@ void Gnome::setupFrame(FluxboxWindow &win) { | |||
108 | // load gnome layer atom | 109 | // load gnome layer atom |
109 | if (win.winClient().property(m_gnome_wm_win_layer, 0, 1, False, XA_CARDINAL, | 110 | if (win.winClient().property(m_gnome_wm_win_layer, 0, 1, False, XA_CARDINAL, |
110 | &ret_type, &fmt, &nitems, &bytes_after, | 111 | &ret_type, &fmt, &nitems, &bytes_after, |
111 | (unsigned char **) &data) && data) { | 112 | &data) && data) { |
112 | flags = *data; | 113 | flags = *data; |
113 | setLayer(&win, flags); | 114 | setLayer(&win, flags); |
114 | XFree (data); | 115 | XFree (data); |
@@ -119,7 +120,7 @@ void Gnome::setupFrame(FluxboxWindow &win) { | |||
119 | // load gnome workspace atom | 120 | // load gnome workspace atom |
120 | if (win.winClient().property(m_gnome_wm_win_workspace, 0, 1, False, XA_CARDINAL, | 121 | if (win.winClient().property(m_gnome_wm_win_workspace, 0, 1, False, XA_CARDINAL, |
121 | &ret_type, &fmt, &nitems, &bytes_after, | 122 | &ret_type, &fmt, &nitems, &bytes_after, |
122 | (unsigned char **) &data) && data) { | 123 | &data) && data) { |
123 | unsigned int workspace_num = *data; | 124 | unsigned int workspace_num = *data; |
124 | if (win.workspaceNumber() != workspace_num) | 125 | if (win.workspaceNumber() != workspace_num) |
125 | win.setWorkspace(workspace_num); | 126 | win.setWorkspace(workspace_num); |
diff --git a/src/Screen.cc b/src/Screen.cc index d2117ff..65359e4 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -1281,7 +1281,8 @@ bool BScreen::isKdeDockapp(Window client) const { | |||
1281 | bool iskdedockapp = false; | 1281 | bool iskdedockapp = false; |
1282 | Atom ajunk; | 1282 | Atom ajunk; |
1283 | int ijunk; | 1283 | int ijunk; |
1284 | unsigned long *data = 0, uljunk; | 1284 | unsigned char *data = 0; |
1285 | unsigned long uljunk; | ||
1285 | Display *disp = FbTk::App::instance()->display(); | 1286 | Display *disp = FbTk::App::instance()->display(); |
1286 | // Check if KDE v2.x dock applet | 1287 | // Check if KDE v2.x dock applet |
1287 | if (XGetWindowProperty(disp, client, | 1288 | if (XGetWindowProperty(disp, client, |
@@ -1289,7 +1290,7 @@ bool BScreen::isKdeDockapp(Window client) const { | |||
1289 | "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR", False), | 1290 | "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR", False), |
1290 | 0l, 1l, False, | 1291 | 0l, 1l, False, |
1291 | XA_WINDOW, &ajunk, &ijunk, &uljunk, | 1292 | XA_WINDOW, &ajunk, &ijunk, &uljunk, |
1292 | &uljunk, (unsigned char **) &data) == Success) { | 1293 | &uljunk, &data) == Success) { |
1293 | 1294 | ||
1294 | if (data) | 1295 | if (data) |
1295 | iskdedockapp = true; | 1296 | iskdedockapp = true; |
@@ -1304,7 +1305,7 @@ bool BScreen::isKdeDockapp(Window client) const { | |||
1304 | if (XGetWindowProperty(disp, client, | 1305 | if (XGetWindowProperty(disp, client, |
1305 | kwm1, 0l, 1l, False, | 1306 | kwm1, 0l, 1l, False, |
1306 | kwm1, &ajunk, &ijunk, &uljunk, | 1307 | kwm1, &ajunk, &ijunk, &uljunk, |
1307 | &uljunk, (unsigned char **) &data) == Success && data) { | 1308 | &uljunk, &data) == Success && data) { |
1308 | iskdedockapp = (data && data[0] != 0); | 1309 | iskdedockapp = (data && data[0] != 0); |
1309 | XFree((void *) data); | 1310 | XFree((void *) data); |
1310 | data = 0; | 1311 | data = 0; |
diff --git a/src/WinClient.cc b/src/WinClient.cc index b8149b2..0eee037 100644 --- a/src/WinClient.cc +++ b/src/WinClient.cc | |||
@@ -411,6 +411,7 @@ void WinClient::updateBlackboxHints() { | |||
411 | int format; | 411 | int format; |
412 | Atom atom_return; | 412 | Atom atom_return; |
413 | unsigned long num, len; | 413 | unsigned long num, len; |
414 | unsigned char *data; | ||
414 | FbAtoms *atoms = FbAtoms::instance(); | 415 | FbAtoms *atoms = FbAtoms::instance(); |
415 | 416 | ||
416 | if (m_blackbox_hint) { | 417 | if (m_blackbox_hint) { |
@@ -422,19 +423,21 @@ void WinClient::updateBlackboxHints() { | |||
422 | PropBlackboxHintsElements, False, | 423 | PropBlackboxHintsElements, False, |
423 | atoms->getFluxboxHintsAtom(), &atom_return, | 424 | atoms->getFluxboxHintsAtom(), &atom_return, |
424 | &format, &num, &len, | 425 | &format, &num, &len, |
425 | (unsigned char **) &m_blackbox_hint) && | 426 | &data) && |
426 | m_blackbox_hint) { | 427 | data) { |
427 | 428 | ||
428 | if (num != (unsigned)PropBlackboxHintsElements) { | 429 | if (num != (unsigned)PropBlackboxHintsElements) { |
429 | XFree(m_blackbox_hint); | 430 | XFree(data); |
430 | m_blackbox_hint = 0; | 431 | m_blackbox_hint = 0; |
431 | } | 432 | } else |
433 | m_blackbox_hint = (FluxboxWindow::BlackboxHints *) data; | ||
432 | } | 434 | } |
433 | } | 435 | } |
434 | 436 | ||
435 | void WinClient::updateMWMHints() { | 437 | void WinClient::updateMWMHints() { |
436 | int format; | 438 | int format; |
437 | Atom atom_return; | 439 | Atom atom_return; |
440 | unsigned char *data; | ||
438 | unsigned long num = 0, len = 0; | 441 | unsigned long num = 0, len = 0; |
439 | 442 | ||
440 | if (m_mwm_hint) { | 443 | if (m_mwm_hint) { |
@@ -447,13 +450,14 @@ void WinClient::updateMWMHints() { | |||
447 | PropMwmHintsElements, false, | 450 | PropMwmHintsElements, false, |
448 | motif_wm_hints, &atom_return, | 451 | motif_wm_hints, &atom_return, |
449 | &format, &num, &len, | 452 | &format, &num, &len, |
450 | (unsigned char **) &m_mwm_hint) && | 453 | &data) && |
451 | m_mwm_hint)) { | 454 | data)) { |
452 | if (num != static_cast<unsigned int>(PropMwmHintsElements)) { | 455 | if (num != static_cast<unsigned int>(PropMwmHintsElements)) { |
453 | XFree(m_mwm_hint); | 456 | XFree(m_mwm_hint); |
454 | m_mwm_hint = 0; | 457 | m_mwm_hint = 0; |
455 | return; | 458 | return; |
456 | } | 459 | } |
460 | m_mwm_hint = (MwmHints *) data; | ||
457 | } | 461 | } |
458 | } | 462 | } |
459 | 463 | ||
@@ -602,12 +606,12 @@ Window WinClient::getGroupLeftWindow() const { | |||
602 | unsigned long num = 0, len = 0; | 606 | unsigned long num = 0, len = 0; |
603 | Atom group_left_hint = XInternAtom(display(), "_FLUXBOX_GROUP_LEFT", False); | 607 | Atom group_left_hint = XInternAtom(display(), "_FLUXBOX_GROUP_LEFT", False); |
604 | 608 | ||
605 | Window *data = 0; | 609 | unsigned char *data = 0; |
606 | if (property(group_left_hint, 0, | 610 | if (property(group_left_hint, 0, |
607 | 1, false, | 611 | 1, false, |
608 | XA_WINDOW, &atom_return, | 612 | XA_WINDOW, &atom_return, |
609 | &format, &num, &len, | 613 | &format, &num, &len, |
610 | (unsigned char **) &data) && | 614 | &data) && |
611 | data) { | 615 | data) { |
612 | if (num != 1) { | 616 | if (num != 1) { |
613 | XFree(data); | 617 | XFree(data); |
@@ -638,12 +642,12 @@ bool WinClient::hasGroupLeftWindow() const { | |||
638 | unsigned long num = 0, len = 0; | 642 | unsigned long num = 0, len = 0; |
639 | Atom group_left_hint = XInternAtom(display(), "_FLUXBOX_GROUP_LEFT", False); | 643 | Atom group_left_hint = XInternAtom(display(), "_FLUXBOX_GROUP_LEFT", False); |
640 | 644 | ||
641 | Window *data = 0; | 645 | unsigned char *data = 0; |
642 | if (property(group_left_hint, 0, | 646 | if (property(group_left_hint, 0, |
643 | 1, false, | 647 | 1, false, |
644 | XA_WINDOW, &atom_return, | 648 | XA_WINDOW, &atom_return, |
645 | &format, &num, &len, | 649 | &format, &num, &len, |
646 | (unsigned char **) &data) && | 650 | &data) && |
647 | data) { | 651 | data) { |
648 | XFree(data); | 652 | XFree(data); |
649 | if (num != 1) | 653 | if (num != 1) |
diff --git a/src/Window.cc b/src/Window.cc index 5aebad4..43d0517 100644 --- a/src/Window.cc +++ b/src/Window.cc | |||
@@ -2207,11 +2207,12 @@ bool FluxboxWindow::getState() { | |||
2207 | Atom atom_return; | 2207 | Atom atom_return; |
2208 | bool ret = false; | 2208 | bool ret = false; |
2209 | int foo; | 2209 | int foo; |
2210 | unsigned long *state, ulfoo, nitems; | 2210 | unsigned char *state; |
2211 | unsigned long ulfoo, nitems; | ||
2211 | if (!m_client->property(FbAtoms::instance()->getWMStateAtom(), | 2212 | if (!m_client->property(FbAtoms::instance()->getWMStateAtom(), |
2212 | 0l, 2l, false, FbAtoms::instance()->getWMStateAtom(), | 2213 | 0l, 2l, false, FbAtoms::instance()->getWMStateAtom(), |
2213 | &atom_return, &foo, &nitems, &ulfoo, | 2214 | &atom_return, &foo, &nitems, &ulfoo, |
2214 | (unsigned char **) &state) || !state) | 2215 | &state) || !state) |
2215 | return false; | 2216 | return false; |
2216 | 2217 | ||
2217 | if (nitems >= 1) { | 2218 | if (nitems >= 1) { |
@@ -2239,18 +2240,20 @@ void FluxboxWindow::restoreAttributes() { | |||
2239 | Atom atom_return; | 2240 | Atom atom_return; |
2240 | int foo; | 2241 | int foo; |
2241 | unsigned long ulfoo, nitems; | 2242 | unsigned long ulfoo, nitems; |
2243 | unsigned char *data; | ||
2242 | FbAtoms *fbatoms = FbAtoms::instance(); | 2244 | FbAtoms *fbatoms = FbAtoms::instance(); |
2243 | 2245 | ||
2244 | BlackboxAttributes *net; | 2246 | BlackboxAttributes *net; |
2245 | if (m_client->property(fbatoms->getFluxboxAttributesAtom(), 0l, | 2247 | if (m_client->property(fbatoms->getFluxboxAttributesAtom(), 0l, |
2246 | PropBlackboxAttributesElements, false, | 2248 | PropBlackboxAttributesElements, false, |
2247 | fbatoms->getFluxboxAttributesAtom(), &atom_return, &foo, | 2249 | fbatoms->getFluxboxAttributesAtom(), &atom_return, &foo, |
2248 | &nitems, &ulfoo, (unsigned char **) &net) && | 2250 | &nitems, &ulfoo, &data) && |
2249 | net) { | 2251 | data) { |
2250 | if (nitems != (unsigned)PropBlackboxAttributesElements) { | 2252 | if (nitems != (unsigned)PropBlackboxAttributesElements) { |
2251 | XFree(net); | 2253 | XFree(data); |
2252 | return; | 2254 | return; |
2253 | } | 2255 | } |
2256 | net = (BlackboxAttributes *) data; | ||
2254 | m_blackbox_attrib.flags = net->flags; | 2257 | m_blackbox_attrib.flags = net->flags; |
2255 | m_blackbox_attrib.attrib = net->attrib; | 2258 | m_blackbox_attrib.attrib = net->attrib; |
2256 | m_blackbox_attrib.workspace = net->workspace; | 2259 | m_blackbox_attrib.workspace = net->workspace; |
@@ -2260,7 +2263,7 @@ void FluxboxWindow::restoreAttributes() { | |||
2260 | m_blackbox_attrib.premax_w = net->premax_w; | 2263 | m_blackbox_attrib.premax_w = net->premax_w; |
2261 | m_blackbox_attrib.premax_h = net->premax_h; | 2264 | m_blackbox_attrib.premax_h = net->premax_h; |
2262 | 2265 | ||
2263 | XFree(static_cast<void *>(net)); | 2266 | XFree(data); |
2264 | } else | 2267 | } else |
2265 | return; | 2268 | return; |
2266 | 2269 | ||