1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
|
$NetBSD: patch-at,v 1.2 2011/11/25 21:42:44 joerg Exp $
--- rf/uwidget.cpp.orig 2003-01-14 18:07:42.000000000 +0000
+++ rf/uwidget.cpp
@@ -24,7 +24,9 @@
#include "config.h"
#endif
+#include <inttypes.h>
#include <stdio.h>
+#include <stdlib.h>
#include "uwidget.h"
#include "uconsole.h"
@@ -231,23 +233,23 @@ extern "C"
static void gtkclicked(GtkButton *button, gpointer user_data)
{
- int widid = ULOWORD((int)user_data);
- int cmdid = UHIWORD((int)user_data);
+ int widid = ULOWORD((int)(intptr_t)user_data);
+ int cmdid = UHIWORD((int)(intptr_t)user_data);
UEventSendMessage(widid, EV_CMD, cmdid, 0L);
}
static void gtkmenuitemactivate(GtkMenuItem *menuitem, gpointer user_data)
{
- int widid = ULOWORD((int)user_data);
- int cmdid = UHIWORD((int)user_data);
+ int widid = ULOWORD((int)(intptr_t)user_data);
+ int cmdid = UHIWORD((int)(intptr_t)user_data);
UEventSendMessage(widid, EV_CMD, cmdid, 0L);
}
static void gtkselectclist(GtkWidget *clist, gint row, gint column,
GdkEventButton *event, gpointer user_data)
{
- int widid = ULOWORD((int)user_data);
- int cmdid = UHIWORD((int)user_data);
+ int widid = ULOWORD((int)(intptr_t)user_data);
+ int cmdid = UHIWORD((int)(intptr_t)user_data);
gchar *text;
gtk_clist_get_text(GTK_CLIST(clist), row, column, &text);
UEventSendMessage(widid, EV_LIST_SELECTING, UMAKEINT(cmdid, row), text);
@@ -255,15 +257,15 @@ extern "C"
static void gtkselectclistcolumn(GtkCList *clist, gint column, gpointer user_data)
{
- int widid = ULOWORD((int)user_data);
- int cmdid = UHIWORD((int)user_data);
+ int widid = ULOWORD((int)(intptr_t)user_data);
+ int cmdid = UHIWORD((int)(intptr_t)user_data);
UEventSendMessage(widid, EV_LIST_SELCOLUMN, UMAKEINT(cmdid, column), 0L);
}
static gint gtkclistdblclick(GtkWidget *widget, GdkEventButton *event, gpointer data)
{
- int widid = ULOWORD((int)data);
- int cmdid = UHIWORD((int)data);
+ int widid = ULOWORD((int)(intptr_t)data);
+ int cmdid = UHIWORD((int)(intptr_t)data);
if (event->type == GDK_2BUTTON_PRESS)
{
UEventSendMessage(widid, EV_LIST_DBLCLICK, cmdid, 0L);
@@ -274,8 +276,8 @@ extern "C"
static void gtkcomboclicked(GtkWidget *widget, gpointer user_data)
{
- int widid = ULOWORD((int)user_data);
- int cmdid = UHIWORD((int)user_data);
+ int widid = ULOWORD((int)(intptr_t)user_data);
+ int cmdid = UHIWORD((int)(intptr_t)user_data);
GtkList *list = GTK_LIST(widget->parent);
GList *selection = list->selection;
@@ -320,8 +322,8 @@ extern "C"
static void gtkmenuactivated(GtkWidget *widget, gpointer user_data)
{
- int widid = ULOWORD((int)user_data);
- int cmdid = UHIWORD((int)user_data);
+ int widid = ULOWORD((int)(intptr_t)user_data);
+ int cmdid = UHIWORD((int)(intptr_t)user_data);
UStr selTxt;
@@ -392,7 +394,7 @@ extern "C"
static void dataForeach(GQuark key_id, gpointer data, gpointer user_data)
{
const char *str = g_quark_to_string(key_id);
- int id = (int)user_data;
+ int id = (int)(intptr_t)user_data;
int cmd;
if(matchToken(str, cmd))
{
@@ -514,32 +516,32 @@ extern "C"
static void gtktreeexpand(GtkWidget *item, gpointer user_data)
{
- int widid = ULOWORD((int)user_data);
- int cmdid = UHIWORD((int)user_data);
+ int widid = ULOWORD((int)(intptr_t)user_data);
+ int cmdid = UHIWORD((int)(intptr_t)user_data);
g_assert(GTK_IS_TREE_ITEM(item));
UEventSendMessage(widid, EV_TREE_EXPANDING, UMAKEINT(cmdid, 0), item);
}
static void gtktreecollapse(GtkWidget *item, gpointer user_data)
{
- int widid = ULOWORD((int)user_data);
- int cmdid = UHIWORD((int)user_data);
+ int widid = ULOWORD((int)(intptr_t)user_data);
+ int cmdid = UHIWORD((int)(intptr_t)user_data);
g_assert(GTK_IS_TREE_ITEM(item));
UEventSendMessage(widid, EV_TREE_EXPANDING, UMAKEINT(cmdid, 1), item);
}
static void gtktreeselect(GtkWidget *item, gpointer user_data)
{
- int widid = ULOWORD((int)user_data);
- int cmdid = UHIWORD((int)user_data);
+ int widid = ULOWORD((int)(intptr_t)user_data);
+ int cmdid = UHIWORD((int)(intptr_t)user_data);
g_assert(GTK_IS_TREE_ITEM(item));
UEventSendMessage(widid, EV_TREE_SELECTING, UMAKEINT(cmdid, 0), item);
}
static void gtktreedeselect(GtkWidget *item, gpointer user_data)
{
- int widid = ULOWORD((int)user_data);
- int cmdid = UHIWORD((int)user_data);
+ int widid = ULOWORD((int)(intptr_t)user_data);
+ int cmdid = UHIWORD((int)(intptr_t)user_data);
g_assert(GTK_IS_TREE_ITEM(item));
UEventSendMessage(widid, EV_TREE_SELECTING, UMAKEINT(cmdid, 1), item);
}
@@ -661,8 +663,8 @@ extern "C"
gint page_num,
gpointer data)
{
- int widid = ULOWORD((int)data);
- int cmdid = UHIWORD((int)data);
+ int widid = ULOWORD((int)(intptr_t)data);
+ int cmdid = UHIWORD((int)(intptr_t)data);
UEventSendMessage(widid, EV_PAGE_CHANGED, UMAKEINT(cmdid, page_num), 0L);
}
@@ -682,8 +684,8 @@ extern "C"
static gint gtkexposeevent(GtkWidget *widget, GdkEvent *event, gpointer user_data)
{
- int widid = ULOWORD((int)user_data);
- int cmdid = UHIWORD((int)user_data);
+ int widid = ULOWORD((int)(intptr_t)user_data);
+ int cmdid = UHIWORD((int)(intptr_t)user_data);
UEventSendMessage(widid, EV_CUSTOM_DRAW, cmdid, event);
return TRUE;
|