From 9b9d5a9617612928710570e024632ba62f0ff74f Mon Sep 17 00:00:00 2001 From: markt Date: Tue, 8 Aug 2006 19:25:48 +0000 Subject: fix some compiler warnings in gcc 4.1 --- ChangeLog | 3 +++ src/Ewmh.cc | 4 ++-- src/FbTk/FbPixmap.cc | 8 ++++---- src/Gnome.cc | 9 +++++---- src/Screen.cc | 7 ++++--- src/WinClient.cc | 24 ++++++++++++++---------- src/Window.cc | 15 +++++++++------ 7 files changed, 41 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index f0f80f5..89b0bf4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ (Format: Year/Month/Day) Changes for 1.0rc3: +*06/08/08: + * Fix some warnings in gcc 4.1 (Mark) + FbTk/FbPixmap.cc Screen.cc Window.cc WinClient.cc Ewmh.cc Gnome.cc *06/08/07: * Documented background style option (Mark) doc/asciidoc/fluxstyle.txt 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) { Atom ret_type = 0; int fmt = 0; unsigned long nitems = 0, bytes_after = 0; - long *data = 0; + unsigned char *data = 0; if (winclient.property(m_net_wm_strut, 0, 4, False, XA_CARDINAL, &ret_type, &fmt, &nitems, &bytes_after, - (unsigned char **) &data) && data) { + &data) && data) { int head = winclient.screen().getHead(winclient); 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) { Atom real_type; int real_format; unsigned long items_read, items_left; - unsigned long *data; + unsigned char *data; if (XGetWindowProperty(display(), RootWindow(display(), screen_num), @@ -368,7 +368,7 @@ void FbPixmap::rootwinPropertyNotify(int screen_num, Atom atom) { False, XA_PIXMAP, &real_type, &real_format, &items_read, &items_left, - (unsigned char **) &data) == Success) { + &data) == Success) { if (real_format == 32 && items_read == 1) { root_pm = (Pixmap) (*data); } @@ -410,7 +410,7 @@ Pixmap FbPixmap::getRootPixmap(int screen_num, bool force_update) { Atom real_type; int real_format; unsigned long items_read, items_left; - unsigned long *data; + unsigned char *data; unsigned int prop = 0; @@ -435,7 +435,7 @@ Pixmap FbPixmap::getRootPixmap(int screen_num, bool force_update) { False, XA_PIXMAP, &real_type, &real_format, &items_read, &items_left, - (unsigned char **) &data) == Success) { + &data) == Success) { if (real_format == 32 && items_read == 1) { if (print_error && strcmp(root_prop_ids[prop], "_XSETROOT_ID") == 0) { cerr<display(); // Check if KDE v2.x dock applet if (XGetWindowProperty(disp, client, @@ -1289,7 +1290,7 @@ bool BScreen::isKdeDockapp(Window client) const { "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR", False), 0l, 1l, False, XA_WINDOW, &ajunk, &ijunk, &uljunk, - &uljunk, (unsigned char **) &data) == Success) { + &uljunk, &data) == Success) { if (data) iskdedockapp = true; @@ -1304,7 +1305,7 @@ bool BScreen::isKdeDockapp(Window client) const { if (XGetWindowProperty(disp, client, kwm1, 0l, 1l, False, kwm1, &ajunk, &ijunk, &uljunk, - &uljunk, (unsigned char **) &data) == Success && data) { + &uljunk, &data) == Success && data) { iskdedockapp = (data && data[0] != 0); XFree((void *) data); 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() { int format; Atom atom_return; unsigned long num, len; + unsigned char *data; FbAtoms *atoms = FbAtoms::instance(); if (m_blackbox_hint) { @@ -422,19 +423,21 @@ void WinClient::updateBlackboxHints() { PropBlackboxHintsElements, False, atoms->getFluxboxHintsAtom(), &atom_return, &format, &num, &len, - (unsigned char **) &m_blackbox_hint) && - m_blackbox_hint) { + &data) && + data) { if (num != (unsigned)PropBlackboxHintsElements) { - XFree(m_blackbox_hint); + XFree(data); m_blackbox_hint = 0; - } + } else + m_blackbox_hint = (FluxboxWindow::BlackboxHints *) data; } } void WinClient::updateMWMHints() { int format; Atom atom_return; + unsigned char *data; unsigned long num = 0, len = 0; if (m_mwm_hint) { @@ -447,13 +450,14 @@ void WinClient::updateMWMHints() { PropMwmHintsElements, false, motif_wm_hints, &atom_return, &format, &num, &len, - (unsigned char **) &m_mwm_hint) && - m_mwm_hint)) { + &data) && + data)) { if (num != static_cast(PropMwmHintsElements)) { XFree(m_mwm_hint); m_mwm_hint = 0; return; } + m_mwm_hint = (MwmHints *) data; } } @@ -602,12 +606,12 @@ Window WinClient::getGroupLeftWindow() const { unsigned long num = 0, len = 0; Atom group_left_hint = XInternAtom(display(), "_FLUXBOX_GROUP_LEFT", False); - Window *data = 0; + unsigned char *data = 0; if (property(group_left_hint, 0, 1, false, XA_WINDOW, &atom_return, &format, &num, &len, - (unsigned char **) &data) && + &data) && data) { if (num != 1) { XFree(data); @@ -638,12 +642,12 @@ bool WinClient::hasGroupLeftWindow() const { unsigned long num = 0, len = 0; Atom group_left_hint = XInternAtom(display(), "_FLUXBOX_GROUP_LEFT", False); - Window *data = 0; + unsigned char *data = 0; if (property(group_left_hint, 0, 1, false, XA_WINDOW, &atom_return, &format, &num, &len, - (unsigned char **) &data) && + &data) && data) { XFree(data); 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() { Atom atom_return; bool ret = false; int foo; - unsigned long *state, ulfoo, nitems; + unsigned char *state; + unsigned long ulfoo, nitems; if (!m_client->property(FbAtoms::instance()->getWMStateAtom(), 0l, 2l, false, FbAtoms::instance()->getWMStateAtom(), &atom_return, &foo, &nitems, &ulfoo, - (unsigned char **) &state) || !state) + &state) || !state) return false; if (nitems >= 1) { @@ -2239,18 +2240,20 @@ void FluxboxWindow::restoreAttributes() { Atom atom_return; int foo; unsigned long ulfoo, nitems; + unsigned char *data; FbAtoms *fbatoms = FbAtoms::instance(); BlackboxAttributes *net; if (m_client->property(fbatoms->getFluxboxAttributesAtom(), 0l, PropBlackboxAttributesElements, false, fbatoms->getFluxboxAttributesAtom(), &atom_return, &foo, - &nitems, &ulfoo, (unsigned char **) &net) && - net) { + &nitems, &ulfoo, &data) && + data) { if (nitems != (unsigned)PropBlackboxAttributesElements) { - XFree(net); + XFree(data); return; } + net = (BlackboxAttributes *) data; m_blackbox_attrib.flags = net->flags; m_blackbox_attrib.attrib = net->attrib; m_blackbox_attrib.workspace = net->workspace; @@ -2260,7 +2263,7 @@ void FluxboxWindow::restoreAttributes() { m_blackbox_attrib.premax_w = net->premax_w; m_blackbox_attrib.premax_h = net->premax_h; - XFree(static_cast(net)); + XFree(data); } else return; -- cgit v0.11.2