From 81ea4248627896ef425cbeadf064b848e169410e Mon Sep 17 00:00:00 2001 From: Mark McLoughlin Date: Wed, 3 Mar 2004 19:03:19 +0000 Subject: [PATCH] don't try and store pointers in ints. Fixes 64-bit build. 2004-03-03 Mark McLoughlin * tests/testsocket_common.c: (print_hello): don't try and store pointers in ints. Fixes 64-bit build. --- ChangeLog | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-4 | 5 +++++ ChangeLog.pre-2-6 | 5 +++++ ChangeLog.pre-2-8 | 5 +++++ tests/testsocket_common.c | 40 ++++++++++++++++++++++++++++++++------- 6 files changed, 58 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3fb14275ee..27ab8bb868 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2004-03-03 Mark McLoughlin + + * tests/testsocket_common.c: (print_hello): don't try and store + pointers in ints. Fixes 64-bit build. + 2004-03-03 Federico Mena Quintero * gtk/gtkfilesystem.c (gtk_file_system_get_parent): Simplify by diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 3fb14275ee..27ab8bb868 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +2004-03-03 Mark McLoughlin + + * tests/testsocket_common.c: (print_hello): don't try and store + pointers in ints. Fixes 64-bit build. + 2004-03-03 Federico Mena Quintero * gtk/gtkfilesystem.c (gtk_file_system_get_parent): Simplify by diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 3fb14275ee..27ab8bb868 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,8 @@ +2004-03-03 Mark McLoughlin + + * tests/testsocket_common.c: (print_hello): don't try and store + pointers in ints. Fixes 64-bit build. + 2004-03-03 Federico Mena Quintero * gtk/gtkfilesystem.c (gtk_file_system_get_parent): Simplify by diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 3fb14275ee..27ab8bb868 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +2004-03-03 Mark McLoughlin + + * tests/testsocket_common.c: (print_hello): don't try and store + pointers in ints. Fixes 64-bit build. + 2004-03-03 Federico Mena Quintero * gtk/gtkfilesystem.c (gtk_file_system_get_parent): Simplify by diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 3fb14275ee..27ab8bb868 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +2004-03-03 Mark McLoughlin + + * tests/testsocket_common.c: (print_hello): don't try and store + pointers in ints. Fixes 64-bit build. + 2004-03-03 Federico Mena Quintero * gtk/gtkfilesystem.c (gtk_file_system_get_parent): Simplify by diff --git a/tests/testsocket_common.c b/tests/testsocket_common.c index 6e96d35cd9..2e2aa05328 100644 --- a/tests/testsocket_common.c +++ b/tests/testsocket_common.c @@ -3,21 +3,47 @@ #include "x11/gdkx.h" #include -static void -print_hello (GtkWidget *w, gpointer data) +enum { - g_message (data); + ACTION_FILE_NEW, + ACTION_FILE_OPEN, + ACTION_OK, + ACTION_HELP_ABOUT +}; + +static void +print_hello (GtkWidget *w, + guint action) +{ + switch (action) + { + case ACTION_FILE_NEW: + g_message ("File New activated"); + break; + case ACTION_FILE_OPEN: + g_message ("File Open activated"); + break; + case ACTION_OK: + g_message ("OK activated"); + break; + case ACTION_HELP_ABOUT: + g_message ("Help About activated "); + break; + default: + g_assert_not_reached (); + break; + } } static GtkItemFactoryEntry menu_items[] = { { "/_File", NULL, NULL, 0, "" }, - { "/File/_New", "N", print_hello, GPOINTER_TO_INT("File New activated"), "" }, - { "/File/_Open", "O", print_hello, GPOINTER_TO_INT("File Open activated"), "" }, + { "/File/_New", "N", print_hello, ACTION_FILE_NEW, "" }, + { "/File/_Open", "O", print_hello, ACTION_FILE_OPEN, "" }, { "/File/sep1", NULL, NULL, 0, "" }, { "/File/Quit", "Q", gtk_main_quit, 0, "" }, - { "/O_K", "K",print_hello, GPOINTER_TO_INT("OK activated"), "" }, + { "/O_K", "K",print_hello, ACTION_OK, "" }, { "/_Help", NULL, NULL, 0, "" }, - { "/_Help/About", NULL, print_hello, GPOINTER_TO_INT("Help About activated "), "" }, + { "/_Help/About", NULL, print_hello, ACTION_HELP_ABOUT, "" }, }; static void