There may be issues with running applications in 64-bit mode when
they were written with tacit assumptions about 32-bit platforms.
For example,
* Assuming that a pointer can be cast back and forth to an integer
The reason is that the size of the integer and pointer may be different.
See the description of "[PATCH] Warn when casting a pointer (constant)
to an integer of different size." in the gcc mailing list
http://gcc.gnu.org/ml/gcc-patches/2005-12/msg01881.html
where it was also suggested the use of casts to uintptr_t. This is
what this patch does.
As a result the following warnings are fixed, leaving us with an
almost warning-free compilation in 64-bits:
defaults.c:1446: warning: cast to pointer from integer of different size
defaults.c:1457: warning: cast to pointer from integer of different size
defaults.c:1471: warning: cast to pointer from integer of different size
defaults.c:1486: warning: cast to pointer from integer of different size
icon.c:67: warning: cast from pointer to integer of different size
menu.c:112: warning: cast from pointer to integer of different size
switchmenu.c:452: warning: cast from pointer to integer of different size
window.c:140: warning: cast from pointer to integer of different size
window.c:2217: warning: cast to pointer from integer of different size
workspace.c:135: warning: cast to pointer from integer of different size
workspace.c:214: warning: cast to pointer from integer of different size
workspace.c:634: warning: cast to pointer from integer of different size
workspace.c:1330: warning: cast to pointer from integer of different size
workspace.c:1514: warning: cast to pointer from integer of different size
wfilepanel.c:135: warning: cast from pointer to integer of different size
wfilepanel.c:171: warning: cast from pointer to integer of different size
wfontpanel.c:499: warning: cast to pointer from integer of different size
wfontpanel.c:500: warning: cast to pointer from integer of different size
wfontpanel.c:505: warning: cast to pointer from integer of different size
wfontpanel.c:506: warning: cast to pointer from integer of different size
wfontpanel.c:776: warning: cast from pointer to integer of different size
wfontpanel.c:777: warning: cast from pointer to integer of different size
wfontpanel.c:877: warning: cast from pointer to integer of different size
wfontpanel.c:878: warning: cast from pointer to integer of different size
wpanel.c:363: warning: cast from pointer to integer of different size
fontl.c:42: warning: cast from pointer to integer of different size
fontl.c:42: warning: cast from pointer to integer of different size
fontl.c:42: warning: cast from pointer to integer of different size
fontl.c:90: warning: cast to pointer from integer of different size
puzzle.c:138: warning: cast from pointer to integer of different size
puzzle.c:225: warning: cast to pointer from integer of different size
wtableview.c:1031: warning: cast to pointer from integer of different size
wtableview.c:1067: warning: cast to pointer from integer of different size
wtableview.c:1069: warning: cast to pointer from integer of different size
wtableview.c:1074: warning: cast to pointer from integer of different size
wtabledelegates.c:234: warning: cast from pointer to integer of different size
wtabledelegates.c:250: warning: cast from pointer to integer of different size
wtabledelegates.c:265: warning: cast from pointer to integer of different size
wtabledelegates.c:287: warning: cast to pointer from integer of different size
wtabledelegates.c:351: warning: cast from pointer to integer of different size
wtabledelegates.c:372: warning: cast from pointer to integer of different size
wtabledelegates.c:393: warning: cast from pointer to integer of different size
wtabledelegates.c:410: warning: cast to pointer from integer of different size
test.c:44: warning: cast from pointer to integer of different size
test.c:47: warning: cast to pointer from integer of different size
test.c:55: warning: cast from pointer to integer of different size
test.c:58: warning: cast from pointer to integer of different size
15 files changed, 62 insertions(+), 48 deletions(-)
WINGs/Examples/fontl.c | 6 ++++--
WINGs/Examples/puzzle.c | 6 +++---
WINGs/Extras/test.c | 9 +++++----
WINGs/Extras/wtabledelegates.c | 18 +++++++++---------
WINGs/Extras/wtableview.c | 9 +++++----
WINGs/wfilepanel.c | 5 +++--
WINGs/wfontpanel.c | 17 +++++++++--------
WINGs/wpanel.c | 3 ++-
WPrefs.app/editmenu.c | 3 ++-
src/defaults.c | 9 +++++----
src/icon.c | 3 ++-
src/menu.c | 3 ++-
src/switchmenu.c | 3 ++-
src/window.c | 5 +++--
src/workspace.c | 11 ++++++-----
# HG changeset patch
# User Carlos R. Mafra <[email protected]>
# Date 1225932989 -3600
# Node ID 9e5a9405eb7d2123eb5682a9bd9147d22421bf10
# Parent be392fd85635001243fb45fa7d18c294e3f85b5a
wmaker: Fix compiler warnings about pointer <--> integer conversion
There may be issues with running applications in 64-bit mode when
they were written with tacit assumptions about 32-bit platforms.
For example,
* Assuming that a pointer can be cast back and forth to an integer
The reason is that the size of the integer and pointer may be different.
See the description of "[PATCH] Warn when casting a pointer (constant)
to an integer of different size." in the gcc mailing list
http://gcc.gnu.org/ml/gcc-patches/2005-12/msg01881.html
where it was also suggested the use of casts to uintptr_t. This is
what this patch does.
As a result the following warnings are fixed, leaving us with an
almost warning-free compilation in 64-bits:
defaults.c:1446: warning: cast to pointer from integer of different size
defaults.c:1457: warning: cast to pointer from integer of different size
defaults.c:1471: warning: cast to pointer from integer of different size
defaults.c:1486: warning: cast to pointer from integer of different size
icon.c:67: warning: cast from pointer to integer of different size
menu.c:112: warning: cast from pointer to integer of different size
switchmenu.c:452: warning: cast from pointer to integer of different size
window.c:140: warning: cast from pointer to integer of different size
window.c:2217: warning: cast to pointer from integer of different size
workspace.c:135: warning: cast to pointer from integer of different size
workspace.c:214: warning: cast to pointer from integer of different size
workspace.c:634: warning: cast to pointer from integer of different size
workspace.c:1330: warning: cast to pointer from integer of different size
workspace.c:1514: warning: cast to pointer from integer of different size
wfilepanel.c:135: warning: cast from pointer to integer of different size
wfilepanel.c:171: warning: cast from pointer to integer of different size
wfontpanel.c:499: warning: cast to pointer from integer of different size
wfontpanel.c:500: warning: cast to pointer from integer of different size
wfontpanel.c:505: warning: cast to pointer from integer of different size
wfontpanel.c:506: warning: cast to pointer from integer of different size
wfontpanel.c:776: warning: cast from pointer to integer of different size
wfontpanel.c:777: warning: cast from pointer to integer of different size
wfontpanel.c:877: warning: cast from pointer to integer of different size
wfontpanel.c:878: warning: cast from pointer to integer of different size
wpanel.c:363: warning: cast from pointer to integer of different size
fontl.c:42: warning: cast from pointer to integer of different size
fontl.c:42: warning: cast from pointer to integer of different size
fontl.c:42: warning: cast from pointer to integer of different size
fontl.c:90: warning: cast to pointer from integer of different size
puzzle.c:138: warning: cast from pointer to integer of different size
puzzle.c:225: warning: cast to pointer from integer of different size
wtableview.c:1031: warning: cast to pointer from integer of different size
wtableview.c:1067: warning: cast to pointer from integer of different size
wtableview.c:1069: warning: cast to pointer from integer of different size
wtableview.c:1074: warning: cast to pointer from integer of different size
wtabledelegates.c:234: warning: cast from pointer to integer of different size
wtabledelegates.c:250: warning: cast from pointer to integer of different size
wtabledelegates.c:265: warning: cast from pointer to integer of different size
wtabledelegates.c:287: warning: cast to pointer from integer of different size
wtabledelegates.c:351: warning: cast from pointer to integer of different size
wtabledelegates.c:372: warning: cast from pointer to integer of different size
wtabledelegates.c:393: warning: cast from pointer to integer of different size
wtabledelegates.c:410: warning: cast to pointer from integer of different size
test.c:44: warning: cast from pointer to integer of different size
test.c:47: warning: cast to pointer from integer of different size
test.c:55: warning: cast from pointer to integer of different size
test.c:58: warning: cast from pointer to integer of different size
diff --git a/WINGs/Examples/fontl.c b/WINGs/Examples/fontl.c
--- a/WINGs/Examples/fontl.c
+++ b/WINGs/Examples/fontl.c
@@ -24,6 +24,7 @@
#include <stdlib.h>
#include <stdio.h>
+#include <stdint.h>
#include <WINGs/WINGs.h>
#include <WINGs/WUtil.h>
@@ -39,7 +40,8 @@
void *d;
WMLabel *l = (WMLabel*)data;
d = WMGetHangedData(self);
- sprintf(buf, "%i - 0x%x - 0%o", (int)d, (int)d, (int)d);
+ sprintf(buf, "%i - 0x%x - 0%o", (int)(uintptr_t)d, (int)(uintptr_t)d,
+ (int)(uintptr_t)d);
WMSetLabelText(l, buf);
}
@@ -87,7 +89,7 @@
sprintf(buf, "%c", c);
WMSetButtonText(lab, buf);
WMSetButtonAction(lab, show, pos);
- WMHangData(lab, (void*)c);
+ WMHangData(lab, (void*)(uintptr_t)c);
if (c>0) {
WMGroupButtons(l0, lab);
} else {
diff --git a/WINGs/Examples/puzzle.c b/WINGs/Examples/puzzle.c
--- a/WINGs/Examples/puzzle.c
+++ b/WINGs/Examples/puzzle.c
@@ -4,7 +4,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <WINGs/WINGs.h>
-
+#include <stdint.h>
#define MAX_SIZE 10*10
@@ -135,7 +135,7 @@
{
char buffer[300];
- if (SlideButton((int)ptr)) {
+ if (SlideButton((int)(uintptr_t)ptr)) {
MoveCount++;
if (CheckWin()) {
@@ -222,7 +222,7 @@
Button[i] = WMCreateButton(win, WBTMomentaryLight);
WMSetWidgetBackgroundColor(Button[i], color);
WMReleaseColor(color);
- WMSetButtonAction(Button[i], buttonClick, (void*)i);
+ WMSetButtonAction(Button[i], buttonClick, (void*)(uintptr_t)i);
WMResizeWidget(Button[i], WinSize/Size, WinSize/Size);
WMMoveWidget(Button[i], x*(WinSize/Size), y*(WinSize/Size));
sprintf(buf, "%i", i+1);
diff --git a/WINGs/Extras/test.c b/WINGs/Extras/test.c
--- a/WINGs/Extras/test.c
+++ b/WINGs/Extras/test.c
@@ -2,6 +2,7 @@
#include <WINGs/WINGs.h>
#include <stdio.h>
+#include <stdint.h>
#include "wtableview.h"
#include "wtabledelegates.h"
@@ -41,10 +42,10 @@
col2[i] = 0;
}
}
- if ((int)WMGetTableColumnId(column) == 1)
+ if ((int)(uintptr_t)WMGetTableColumnId(column) == 1)
return col1[row];
else
- return (void*)col2[row];
+ return (void*)(uintptr_t)col2[row];
}
@@ -52,10 +53,10 @@
setValueForCell(WMTableViewDelegate *self, WMTableColumn *column, int row,
void *data)
{
- if ((int)WMGetTableColumnId(column) == 1)
+ if ((int)(uintptr_t)WMGetTableColumnId(column) == 1)
col1[row] = data;
else
- col2[row] = (int)data;
+ col2[row] = (int)(uintptr_t)data;
}
diff --git a/WINGs/Extras/wtabledelegates.c b/WINGs/Extras/wtabledelegates.c
--- a/WINGs/Extras/wtabledelegates.c
+++ b/WINGs/Extras/wtabledelegates.c
@@ -1,5 +1,5 @@
-
+#include <stdint.h>
#include <WINGs/WINGsP.h>
#include "wtableview.h"
@@ -231,7 +231,7 @@
{
EnumSelectorData *strdata = (EnumSelectorData*)self->data;
WMTableView *table = WMGetTableColumnTableView(column);
- int i = (int)WMTableViewDataForCell(table, column, row);
+ int i = (int)(uintptr_t)WMTableViewDataForCell(table, column, row);
stringDraw(WMWidgetScreen(table), d,
strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
@@ -247,7 +247,7 @@
{
EnumSelectorData *strdata = (EnumSelectorData*)self->data;
WMTableView *table = WMGetTableColumnTableView(column);
- int i = (int)WMTableViewDataForCell(table, column, row);
+ int i = (int)(uintptr_t)WMTableViewDataForCell(table, column, row);
stringDraw(WMWidgetScreen(table), d,
strdata->gc, strdata->selGC, strdata->textColor, strdata->font,
@@ -262,7 +262,7 @@
{
EnumSelectorData *strdata = (EnumSelectorData*)self->data;
WMRect rect = WMTableViewRectForCell(strdata->table, column, row);
- int data = (int)WMTableViewDataForCell(strdata->table, column, row);
+ int data = (int)(uintptr_t)WMTableViewDataForCell(strdata->table, column, row);
wassertr(data < strdata->count);
@@ -284,7 +284,7 @@
WMUnmapWidget(strdata->widget);
option = WMGetPopUpButtonSelectedItem(strdata->widget);
- WMSetTableViewDataForCell(strdata->table, column, row, (void*)option);
+ WMSetTableViewDataForCell(strdata->table, column, row, (void*)(uintptr_t)option);
}
@@ -348,7 +348,7 @@
{
BooleanSwitchData *strdata = (BooleanSwitchData*)self->data;
WMTableView *table = WMGetTableColumnTableView(column);
- int i = (int)WMTableViewDataForCell(table, column, row);
+ int i = (int)(uintptr_t)WMTableViewDataForCell(table, column, row);
WMScreen *scr = WMWidgetScreen(table);
if (i) {
@@ -369,7 +369,7 @@
{
BooleanSwitchData *strdata = (BooleanSwitchData*)self->data;
WMTableView *table = WMGetTableColumnTableView(column);
- int i = (int)WMTableViewDataForCell(table, column, row);
+ int i = (int)(uintptr_t)WMTableViewDataForCell(table, column, row);
WMScreen *scr = WMWidgetScreen(table);
if (i) {
@@ -390,7 +390,7 @@
{
BooleanSwitchData *strdata = (BooleanSwitchData*)self->data;
WMRect rect = WMTableViewRectForCell(strdata->table, column, row);
- int data = (int)WMTableViewDataForCell(strdata->table, column, row);
+ int data = (int)(uintptr_t)WMTableViewDataForCell(strdata->table, column, row);
WMSetButtonSelected(strdata->widget, data);
WMMoveWidget(strdata->widget, rect.pos.x+1, rect.pos.y+1);
@@ -407,7 +407,7 @@
int value;
value = WMGetButtonSelected(strdata->widget);
- WMSetTableViewDataForCell(strdata->table, column, row, (void*)value);
+ WMSetTableViewDataForCell(strdata->table, column, row, (void*)(uintptr_t)value);
WMUnmapWidget(strdata->widget);
}
diff --git a/WINGs/Extras/wtableview.c b/WINGs/Extras/wtableview.c
--- a/WINGs/Extras/wtableview.c
+++ b/WINGs/Extras/wtableview.c
@@ -2,6 +2,7 @@
#include <WINGs/WINGsP.h>
#include <X11/cursorfont.h>
+#include <stdint.h>
#include "wtableview.h"
@@ -1028,7 +1029,7 @@
if (!column->delegate || !column->delegate->drawCell)
continue;
- if (WMFindInArray(table->selectedRows, NULL, (void*)row) != WANotFound)
+ if (WMFindInArray(table->selectedRows, NULL, (void*)(uintptr_t)row) != WANotFound)
(*column->delegate->drawSelectedCell)(column->delegate, column, row, d);
else
(*column->delegate->drawCell)(column->delegate, column, row, d);
@@ -1064,14 +1065,14 @@
{
int repaint = 0;
- if (WMFindInArray(table->selectedRows, NULL, (void*)row) != WANotFound) {
+ if (WMFindInArray(table->selectedRows, NULL, (void*)(uintptr_t)row) != WANotFound) {
if (!flag) {
- WMRemoveFromArray(table->selectedRows, (void*)row);
+ WMRemoveFromArray(table->selectedRows, (void*)(uintptr_t)row);
repaint = 1;
}
} else {
if (flag) {
- WMAddToArray(table->selectedRows, (void*)row);
+ WMAddToArray(table->selectedRows, (void*)(uintptr_t)row);
repaint = 1;
}
}
diff --git a/WINGs/wfilepanel.c b/WINGs/wfilepanel.c
--- a/WINGs/wfilepanel.c
+++ b/WINGs/wfilepanel.c
@@ -8,6 +8,7 @@
#include <dirent.h>
#include <limits.h>
#include <errno.h>
+#include <stdint.h>
#ifndef PATH_MAX
#define PATH_MAX 1024
@@ -132,7 +133,7 @@
return;
text = WMGetTextFieldText(panel->fileField);
- textEvent = (int)WMGetNotificationClientData(notification);
+ textEvent = (int)(uintptr_t)WMGetNotificationClientData(notification);
if (panel->flags.autoCompletion && textEvent!=WMDeleteTextEvent)
i = closestListItem(list, text, False);
@@ -168,7 +169,7 @@
{
W_FilePanel *panel = (W_FilePanel*)observerData;
- if ((int)WMGetNotificationClientData(notification)==WMReturnTextMovement) {
+ if ((int)(uintptr_t)WMGetNotificationClientData(notification)==WMReturnTextMovement) {
WMPerformButtonClick(panel->okButton);
}
}
diff --git a/WINGs/wfontpanel.c b/WINGs/wfontpanel.c
--- a/WINGs/wfontpanel.c
+++ b/WINGs/wfontpanel.c
@@ -8,6 +8,7 @@
#include <ctype.h>
#include <string.h>
+#include <stdint.h>
#include <X11/Xft/Xft.h>
#include <fontconfig/fontconfig.h>
@@ -496,14 +497,14 @@
for (j = 0; j < sizeof(scalableFontSizes)/sizeof(int); j++) {
size = scalableFontSizes[j];
- if (!WMCountInArray(face->sizes, (void*)size)) {
- WMAddToArray(face->sizes, (void*)size);
+ if (!WMCountInArray(face->sizes, (void*)(uintptr_t)size)) {
+ WMAddToArray(face->sizes, (void*)(uintptr_t)size);
}
}
WMSortArray(face->sizes, compare_int);
} else {
- if (!WMCountInArray(face->sizes, (void*)size)) {
- WMAddToArray(face->sizes, (void*)size);
+ if (!WMCountInArray(face->sizes, (void*)(uintptr_t)size)) {
+ WMAddToArray(face->sizes, (void*)(uintptr_t)size);
WMSortArray(face->sizes, compare_int);
}
}
@@ -773,8 +774,8 @@
WMClearList(panel->sizLs);
WM_ITERATE_ARRAY(face->sizes, size, i) {
- if ((int)size != 0) {
- sprintf(buffer, "%i", (int)size);
+ if ((int)(uintptr_t)size != 0) {
+ sprintf(buffer, "%i", (int)(uintptr_t)size);
WMAddListItem(panel->sizLs, buffer);
}
@@ -874,8 +875,8 @@
WM_ITERATE_ARRAY(face->sizes, vsize, i) {
char buffer[32];
- if ((int)vsize != 0) {
- sprintf(buffer, "%i", (int)vsize);
+ if ((int)(uintptr_t)vsize != 0) {
+ sprintf(buffer, "%i", (int)(uintptr_t)vsize);
WMAddListItem(panel->sizLs, buffer);
}
diff --git a/WINGs/wpanel.c b/WINGs/wpanel.c
--- a/WINGs/wpanel.c
+++ b/WINGs/wpanel.c
@@ -3,6 +3,7 @@
#include "WINGsP.h"
#include <X11/keysym.h>
+#include <stdint.h>
@@ -360,7 +361,7 @@
{
WMInputPanel *panel = (WMInputPanel*)observerData;
- switch ((int)WMGetNotificationClientData(notification)) {
+ switch ((int)(uintptr_t)WMGetNotificationClientData(notification)) {
case WMReturnTextMovement:
if (panel->defBtn)
WMPerformButtonClick(panel->defBtn);
diff --git a/WPrefs.app/editmenu.c b/WPrefs.app/editmenu.c
--- a/WPrefs.app/editmenu.c
+++ b/WPrefs.app/editmenu.c
@@ -24,6 +24,7 @@
#include <WINGs/WINGsP.h>
#include <WINGs/WUtil.h>
#include <stdlib.h>
+#include <stdint.h>
#include <assert.h>
#include <ctype.h>
@@ -969,7 +970,7 @@
if (!menu->flags.isEditing)
return;
- reason = (int)WMGetNotificationClientData(notif);
+ reason = (int)(uintptr_t)WMGetNotificationClientData(notif);
switch (reason) {
case WMEscapeTextMovement:
diff --git a/src/defaults.c b/src/defaults.c
--- a/src/defaults.c
+++ b/src/defaults.c
@@ -24,6 +24,7 @@
#include "wconfig.h"
#include <stdio.h>
+#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
@@ -1445,7 +1446,7 @@
foo |= WColorSettings;
if (foo)
WMPostNotificationName(WNMenuTitleAppearanceSettingsChanged, NULL,
- (void*)foo);
+ (void*)(uintptr_t)foo);
foo = 0;
if (needs_refresh & REFRESH_MENU_TEXTURE)
@@ -1456,7 +1457,7 @@
foo |= WColorSettings;
if (foo)
WMPostNotificationName(WNMenuAppearanceSettingsChanged, NULL,
- (void*)foo);
+ (void*)(uintptr_t)foo);
foo = 0;
if (needs_refresh & REFRESH_WINDOW_FONT) {
@@ -1470,7 +1471,7 @@
}
if (foo)
WMPostNotificationName(WNWindowAppearanceSettingsChanged, NULL,
- (void*)foo);
+ (void*)(uintptr_t)foo);
if (!(needs_refresh & REFRESH_ICON_TILE)) {
foo = 0;
@@ -1485,7 +1486,7 @@
}
if (foo)
WMPostNotificationName(WNIconAppearanceSettingsChanged, NULL,
- (void*)foo);
+ (void*)(uintptr_t)foo);
}
if (needs_refresh & REFRESH_ICON_TILE)
WMPostNotificationName(WNIconTileSettingsChanged, NULL, NULL);
diff --git a/src/icon.c b/src/icon.c
--- a/src/icon.c
+++ b/src/icon.c
@@ -26,6 +26,7 @@
#include <X11/Xutil.h>
#include <stdlib.h>
#include <stdio.h>
+#include <stdint.h>
#include <string.h>
#include <unistd.h>
#include <ctype.h>
@@ -64,7 +65,7 @@
appearanceObserver(void *self, WMNotification *notif)
{
WIcon *icon = (WIcon*)self;
- int flags = (int)WMGetNotificationClientData(notif);
+ int flags = (int)(uintptr_t)WMGetNotificationClientData(notif);
if (flags & WTextureSettings) {
icon->force_paint = 1;
diff --git a/src/menu.c b/src/menu.c
--- a/src/menu.c
+++ b/src/menu.c
@@ -29,6 +29,7 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
+#include <stdint.h>
#include <unistd.h>
#include <ctype.h>
#if 0
@@ -109,7 +110,7 @@
appearanceObserver(void *self, WMNotification *notif)
{
WMenu *menu = (WMenu*)self;
- int flags = (int)WMGetNotificationClientData(notif);
+ int flags = (int)(uintptr_t)WMGetNotificationClientData(notif);
if (!menu->flags.realized)
return;
diff --git a/src/switchmenu.c b/src/switchmenu.c
--- a/src/switchmenu.c
+++ b/src/switchmenu.c
@@ -28,6 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <stdint.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
@@ -449,7 +450,7 @@
void *data = WMGetNotificationClientData(notif);
if (strcmp(name, WMNWorkspaceNameChanged) == 0) {
- UpdateSwitchMenuWorkspace(scr, (int)data);
+ UpdateSwitchMenuWorkspace(scr, (int)(uintptr_t)data);
} else if (strcmp(name, WMNWorkspaceChanged) == 0) {
}
diff --git a/src/window.c b/src/window.c
--- a/src/window.c
+++ b/src/window.c
@@ -33,6 +33,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <stdint.h>
/* For getting mouse wheel mappings from WINGs */
#include <WINGs/WINGsP.h>
@@ -137,7 +138,7 @@
appearanceObserver(void *self, WMNotification *notif)
{
WWindow *wwin = (WWindow*)self;
- int flags = (int)WMGetNotificationClientData(notif);
+ int flags = (int)(uintptr_t)WMGetNotificationClientData(notif);
if (!wwin->frame || (!wwin->frame->titlebar && !wwin->frame->resizebar))
return;
@@ -2214,7 +2215,7 @@
wwin->frame->workspace = workspace;
- WMPostNotificationName(WMNChangedWorkspace, wwin, (void*)oldWorkspace);
+ WMPostNotificationName(WMNChangedWorkspace, wwin, (void*)(uintptr_t)oldWorkspace);
}
if (unmap) {
diff --git a/src/workspace.c b/src/workspace.c
--- a/src/workspace.c
+++ b/src/workspace.c
@@ -29,6 +29,7 @@
#include <stdlib.h>
#include <stdio.h>
+#include <stdint.h>
#include <unistd.h>
#include <ctype.h>
#include <string.h>
@@ -132,7 +133,7 @@
#endif
WMPostNotificationName(WMNWorkspaceCreated, scr,
- (void*)(scr->workspace_count-1));
+ (void*)(uintptr_t)(scr->workspace_count-1));
XFlush(dpy);
return scr->workspace_count-1;
@@ -211,7 +212,7 @@
#endif
WMPostNotificationName(WMNWorkspaceDestroyed, scr,
- (void*)(scr->workspace_count-1));
+ (void*)(uintptr_t)(scr->workspace_count-1));
if (scr->current_workspace >= scr->workspace_count)
wWorkspaceChange(scr, scr->workspace_count-1);
@@ -631,7 +632,7 @@
showWorkspaceName(scr, workspace);
- WMPostNotificationName(WMNWorkspaceChanged, scr, (void*)workspace);
+ WMPostNotificationName(WMNWorkspaceChanged, scr, (void*)(uintptr_t)workspace);
/* XSync(dpy, False); */
}
@@ -1327,7 +1328,7 @@
if (scr->clip_icon)
wClipIconPaint(scr->clip_icon);
- WMPostNotificationName(WMNWorkspaceNameChanged, scr, (void*)workspace);
+ WMPostNotificationName(WMNWorkspaceNameChanged, scr, (void*)(uintptr_t)workspace);
}
@@ -1511,7 +1512,7 @@
}
}
- WMPostNotificationName(WMNWorkspaceNameChanged, scr, (void*)i);
+ WMPostNotificationName(WMNWorkspaceNameChanged, scr, (void*)(uintptr_t)i);
}
}