From 0a70d3241d1b663592375549bde5be2105139072 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Fri, 23 Oct 2020 19:42:24 -0700 Subject: [PATCH] Fix Solaris compiler errors "Cannot cast from void* to integer of smaller size" --- src/gtk/app.cpp | 4 ++-- src/gtk/clipbrd.cpp | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp index e4db864b01..b524c513a1 100644 --- a/src/gtk/app.cpp +++ b/src/gtk/app.cpp @@ -101,7 +101,7 @@ static gboolean wxapp_idle_callback(gpointer) } // 0: no change, 1: focus in, 2: focus out -static int gs_focusChange; +static wxUIntPtr gs_focusChange; extern "C" { static gboolean @@ -109,7 +109,7 @@ wx_focus_event_hook(GSignalInvocationHint*, unsigned, const GValue* param_values { // If focus change on TLW if (GTK_IS_WINDOW(g_value_peek_pointer(param_values))) - gs_focusChange = GPOINTER_TO_INT(data); + gs_focusChange = wxUIntPtr(data); return true; } diff --git a/src/gtk/clipbrd.cpp b/src/gtk/clipbrd.cpp index ca86c9eda8..8cd7b1644d 100644 --- a/src/gtk/clipbrd.cpp +++ b/src/gtk/clipbrd.cpp @@ -269,13 +269,14 @@ selection_handler( GtkWidget *WXUNUSED(widget), if ( !data ) return; + unsigned timestamp = unsigned(wxUIntPtr(signal_data)); + // ICCCM says that TIMESTAMP is a required atom. // In particular, it satisfies Klipper, which polls // TIMESTAMP to see if the clipboards content has changed. // It shall return the time which was used to set the data. if (gtk_selection_data_get_target(selection_data) == g_timestampAtom) { - guint timestamp = GPOINTER_TO_UINT (signal_data); gtk_selection_data_set(selection_data, GDK_SELECTION_TYPE_INTEGER, 32, @@ -295,7 +296,7 @@ selection_handler( GtkWidget *WXUNUSED(widget), wxString::FromAscii(wxGtkString(gdk_atom_name(gtk_selection_data_get_target(selection_data)))).c_str(), wxString::FromAscii(wxGtkString(gdk_atom_name(gtk_selection_data_get_data_type(selection_data)))).c_str(), wxString::FromAscii(wxGtkString(gdk_atom_name(gtk_selection_data_get_selection(selection_data)))).c_str(), - GPOINTER_TO_UINT( signal_data ) + timestamp ); if ( !data->IsSupportedFormat( format ) )