fix some compiler warnings in gcc 4.1

This commit is contained in:
markt 2006-08-08 19:25:48 +00:00
parent e2c31b7285
commit 9b9d5a9617
7 changed files with 41 additions and 29 deletions

View file

@ -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

View file

@ -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,

View file

@ -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<<error_message;

View file

@ -93,11 +93,12 @@ void Gnome::setupFrame(FluxboxWindow &win) {
Atom ret_type;
int fmt;
unsigned long nitems, bytes_after;
long flags, *data = 0;
long flags;
unsigned char *data = 0;
if (win.winClient().property(m_gnome_wm_win_state, 0, 1, False, XA_CARDINAL,
&ret_type, &fmt, &nitems, &bytes_after,
(unsigned char **) &data) && data) {
&data) && data) {
flags = *data;
setState(&win, flags);
XFree (data);
@ -108,7 +109,7 @@ void Gnome::setupFrame(FluxboxWindow &win) {
// load gnome layer atom
if (win.winClient().property(m_gnome_wm_win_layer, 0, 1, False, XA_CARDINAL,
&ret_type, &fmt, &nitems, &bytes_after,
(unsigned char **) &data) && data) {
&data) && data) {
flags = *data;
setLayer(&win, flags);
XFree (data);
@ -119,7 +120,7 @@ void Gnome::setupFrame(FluxboxWindow &win) {
// load gnome workspace atom
if (win.winClient().property(m_gnome_wm_win_workspace, 0, 1, False, XA_CARDINAL,
&ret_type, &fmt, &nitems, &bytes_after,
(unsigned char **) &data) && data) {
&data) && data) {
unsigned int workspace_num = *data;
if (win.workspaceNumber() != workspace_num)
win.setWorkspace(workspace_num);

View file

@ -1281,7 +1281,8 @@ bool BScreen::isKdeDockapp(Window client) const {
bool iskdedockapp = false;
Atom ajunk;
int ijunk;
unsigned long *data = 0, uljunk;
unsigned char *data = 0;
unsigned long uljunk;
Display *disp = FbTk::App::instance()->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;

View file

@ -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<unsigned int>(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)

View file

@ -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<void *>(net));
XFree(data);
} else
return;