2007-12-12 Rodney Dawes <dobey@wayofthemonkey.com>
authoralp@webkit.org <alp@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Dec 2007 17:27:05 +0000 (17:27 +0000)
committeralp@webkit.org <alp@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 12 Dec 2007 17:27:05 +0000 (17:27 +0000)
        Reviewed by Maciej.

        http://bugs.webkit.org/show_bug.cgi?id=16342
        Build Warning and Error fixes in WebCore GTK+

        Use C-style casts for casting function pointers to gpointer
        Use static_cast<int> to cast a float to int to fix a warning

        * platform/gtk/PlatformScrollBarGtk.cpp:
        (PlatformScrollbar::PlatformScrollbar):
        (PlatformScrollbar::~PlatformScrollbar):
        (PlatformScrollbar::gtkValueChanged):
        * platform/gtk/ThreadingGtk.cpp:
        (callFunctionOnMainThread):
        (callOnMainThread):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28654 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/gtk/PlatformScrollBarGtk.cpp
WebCore/platform/gtk/ThreadingGtk.cpp

index f0149c56944ee5f218e040fb77ecd306d0bffa5d..63584ae6f397629395afc0cfe2fcd1cbcce16079 100644 (file)
@@ -1,3 +1,21 @@
+2007-12-12  Rodney Dawes  <dobey@wayofthemonkey.com>
+
+        Reviewed by Maciej.
+
+        http://bugs.webkit.org/show_bug.cgi?id=16342
+        Build Warning and Error fixes in WebCore GTK+
+
+        Use C-style casts for casting function pointers to gpointer
+        Use static_cast<int> to cast a float to int to fix a warning
+
+        * platform/gtk/PlatformScrollBarGtk.cpp:
+        (PlatformScrollbar::PlatformScrollbar):
+        (PlatformScrollbar::~PlatformScrollbar):
+        (PlatformScrollbar::gtkValueChanged):
+        * platform/gtk/ThreadingGtk.cpp:
+        (callFunctionOnMainThread):
+        (callOnMainThread):
+
 2007-12-12  Dan Bernstein  <mitz@apple.com>
 
         Reviewed by Darin Adler.
index 79a16343a87f8ea56f9bf23582527899c001f0fc..768c9b8af5488c808a4f31b5c0d13226a3135214 100644 (file)
@@ -73,8 +73,8 @@ PlatformScrollbar::~PlatformScrollbar()
     /*
      * the Widget does not take over ownership.
      */
-    g_signal_handlers_disconnect_by_func(G_OBJECT(gtkWidget()), reinterpret_cast<gpointer>(PlatformScrollbar::gtkValueChanged), this);
-    g_signal_handlers_disconnect_by_func(G_OBJECT(gtkWidget()), reinterpret_cast<gpointer>(gtkScrollEventCallback), this);
+    g_signal_handlers_disconnect_by_func(G_OBJECT(gtkWidget()), (gpointer)PlatformScrollbar::gtkValueChanged, this);
+    g_signal_handlers_disconnect_by_func(G_OBJECT(gtkWidget()), (gpointer)gtkScrollEventCallback, this);
     g_object_unref(G_OBJECT(gtkWidget()));
 }
 
@@ -136,7 +136,7 @@ void PlatformScrollbar::geometryChanged()
 
 void PlatformScrollbar::gtkValueChanged(GtkAdjustment*, PlatformScrollbar* that)
 {
-    that->setValue(gtk_adjustment_get_value(that->m_adjustment));
+    that->setValue(static_cast<int>(gtk_adjustment_get_value(that->m_adjustment)));
 }
 
 static int scrollbarSize()
index 9fc775b41187fec6d4c56f22c4139f812fbab99a..dcbb2274fa4cfb9e8136f3066cb791c41dfe1d16 100644 (file)
@@ -39,7 +39,7 @@ namespace WebCore {
 
 static gboolean callFunctionOnMainThread(gpointer data)
 {
-    void (*function)() = reinterpret_cast<void(*)()>(data);
+    void (*function)() = (void(*)())data;
     function();
     return FALSE;
 }
@@ -47,7 +47,7 @@ static gboolean callFunctionOnMainThread(gpointer data)
 void callOnMainThread(void (*function)())
 {
     ASSERT(function);
-    g_timeout_add(0, callFunctionOnMainThread, reinterpret_cast<gpointer>(function));
+    g_timeout_add(0, callFunctionOnMainThread, (gpointer)function);
 }
 
 void initializeThreading()