]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/window.cpp
fixed warnings about truncating 64 bit integers
[wxWidgets.git] / src / motif / window.cpp
index bc01bf3cbb7f3b5092859faf5133295359319c3b..57aa52ecd546d686e22906619d820006578dfb85 100644 (file)
 // headers
 // ----------------------------------------------------------------------------
 
-#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
-    #pragma implementation "window.h"
-#endif
-
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
 
 #include <string.h>
 
-// ----------------------------------------------------------------------------
-// constants
-// ----------------------------------------------------------------------------
-
-static const int SCROLL_MARGIN = 4;
-
 // ----------------------------------------------------------------------------
 // global variables for this module
 // ----------------------------------------------------------------------------
@@ -1743,18 +1733,18 @@ bool wxWindow::ProcessAccelerator(wxKeyEvent& event)
 
 bool wxAddWindowToTable(Widget w, wxWindow *win)
 {
-    wxWindow *oldItem = NULL;
-    if ((oldItem = (wxWindow *)wxWidgetHashTable->Get ((long) w)))
+    const long key = (long)w;
+    if ( wxWidgetHashTable->Get(key))
     {
         wxLogDebug("Widget table clash: new widget is %ld, %s",
-                   (long)w, win->GetClassInfo()->GetClassName());
+                   key, win->GetClassInfo()->GetClassName());
         return false;
     }
 
-    wxWidgetHashTable->Put((long) w, win);
+    wxWidgetHashTable->Put(key, win);
 
     wxLogTrace("widget", "Widget 0x%p <-> window %p (%s)",
-               (WXWidget)w, win, win->GetClassInfo()->GetClassName());
+               w, win, win->GetClassInfo()->GetClassName());
 
     return true;
 }
@@ -2094,7 +2084,7 @@ static void wxScrollBarCallback(Widget scrollbar,
                                 XmScrollBarCallbackStruct *cbs)
 {
     wxWindow *win = wxGetWindowFromTable(scrollbar);
-    wxOrientation orientation = (wxOrientation)(int)clientData;
+    wxOrientation orientation = (wxOrientation)wxPtrToUInt(clientData);
 
     wxEventType eventType = wxEVT_NULL;
     switch (cbs->reason)
@@ -2157,24 +2147,18 @@ static void wxScrollBarCallback(Widget scrollbar,
 // For repainting arbitrary windows
 void wxUniversalRepaintProc(Widget w, XtPointer WXUNUSED(c_data), XEvent *event, char *)
 {
-    Window window;
-    Display *display;
-
     wxWindow* win = wxGetWindowFromTable(w);
     if (!win)
         return;
 
-    switch(event -> type)
+    switch ( event->type )
     {
-    case Expose:
+        case Expose:
         {
-            window = (Window) win -> GetXWindow();
-            display = (Display *) win -> GetXDisplay();
-
             win->AddUpdateRect(event->xexpose.x, event->xexpose.y,
                                event->xexpose.width, event->xexpose.height);
 
-            if (event -> xexpose.count == 0)
+            if ( event->xexpose.count == 0 )
             {
                 win->DoPaint();
             }
@@ -2537,7 +2521,8 @@ wxWindow *wxWindowBase::GetCapture()
 // position.
 wxWindow* wxFindWindowAtPointer(wxPoint& pt)
 {
-    return wxFindWindowAtPoint(wxGetMousePosition());
+    pt = wxGetMousePosition();
+    return wxFindWindowAtPoint(pt);
 }
 
 // Get the current mouse position.