Hi

On Linux x86_64 (GUI athena), I see the following compilation warnings:

gui_athena.c:2257:65: warning: cast to pointer from integer of different size

gui_at_sb.c:823:60: warning: cast to pointer from integer of different size
gui_at_sb.c:897:50: warning: cast to pointer from integer of different size
gui_at_sb.c:980:47: warning: cast to pointer from integer of different size

gui_at_fs.c:1644:50: warning: cast to pointer from integer of different size
gui_at_fs.c:1687:4: warning: cast to pointer from integer of different size
gui_at_fs.c:2590:48: warning: cast to pointer from integer of different size
gui_at_fs.c:2592:44: warning: cast to pointer from integer of different size
gui_at_fs.c:2614:43: warning: cast to pointer from integer of different size
gui_at_fs.c:2616:44: warning: cast to pointer from integer of different size
gui_at_fs.c:2666:33: warning: cast to pointer from integer of different size
gui_at_fs.c:2668:32: warning: cast to pointer from integer of different size
gui_at_fs.c:2670:32: warning: cast to pointer from integer of different size
gui_at_fs.c:2672:33: warning: cast to pointer from integer of different size
gui_at_fs.c:2674:38: warning: cast to pointer from integer of different size
gui_at_fs.c:2676:40: warning: cast to pointer from integer of different size

The double cast in attached patch silences the warnings but it's admittedly
not elegant.

-- Dominique

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
diff -r 12ebd6f6dfce src/gui_at_fs.c
--- a/src/gui_at_fs.c	Sun Jun 06 16:11:09 2010 +0200
+++ b/src/gui_at_fs.c	Sun Jun 06 18:29:26 2010 +0200
@@ -1641,7 +1641,8 @@
 
     if (SFbuttonPressed)
 	SFscrollTimerId = XtAppAddTimeOut(SFapp,
-		       SFscrollTimerInterval(), SFscrollTimer, (XtPointer) n);
+		       SFscrollTimerInterval(), SFscrollTimer,
+		       (XtPointer)(long_u)n);
 }
 
     static int
@@ -1684,7 +1685,7 @@
 		SFscrollTimerAdded = 1;
 		SFscrollTimerId = XtAppAddTimeOut(SFapp,
 			SFscrollTimerInterval(), SFscrollTimer,
-			(XtPointer) n);
+			(XtPointer)(long_u)n);
 	    }
 	}
 	return -1;
@@ -2587,7 +2588,8 @@
 		    NULL);
 
 	XtAddCallback(selFileVScrolls[n], XtNjumpProc,
-		(XtCallbackProc)SFvFloatSliderMovedCallback, (XtPointer)n);
+		(XtCallbackProc)SFvFloatSliderMovedCallback,
+		(XtPointer)(long_u)n);
 	XtAddCallback(selFileVScrolls[n], XtNscrollProc,
 		(XtCallbackProc)SFvAreaSelectedCallback, (XtPointer)n);
 
@@ -2611,7 +2613,8 @@
 		    NULL);
 
 	XtAddCallback(selFileHScrolls[n], XtNjumpProc,
-		(XtCallbackProc)SFhSliderMovedCallback, (XtPointer)n);
+		(XtCallbackProc)SFhSliderMovedCallback,
+		(XtPointer)(long_u)n);
 	XtAddCallback(selFileHScrolls[n], XtNscrollProc,
 		(XtCallbackProc)SFhAreaSelectedCallback, (XtPointer)n);
     }
@@ -2663,17 +2666,17 @@
     for (n = 0; n < 3; n++)
     {
 	XtAddEventHandler(selFileLists[n], ExposureMask, True,
-		(XtEventHandler)SFexposeList, (XtPointer)n);
+		(XtEventHandler)SFexposeList, (XtPointer)(long_u)n);
 	XtAddEventHandler(selFileLists[n], EnterWindowMask, False,
-		(XtEventHandler)SFenterList, (XtPointer)n);
+		(XtEventHandler)SFenterList, (XtPointer)(long_u)n);
 	XtAddEventHandler(selFileLists[n], LeaveWindowMask, False,
-		(XtEventHandler)SFleaveList, (XtPointer)n);
+		(XtEventHandler)SFleaveList, (XtPointer)(long_u)n);
 	XtAddEventHandler(selFileLists[n], PointerMotionMask, False,
-		(XtEventHandler)SFmotionList, (XtPointer)n);
+		(XtEventHandler)SFmotionList, (XtPointer)(long_u)n);
 	XtAddEventHandler(selFileLists[n], ButtonPressMask, False,
-		(XtEventHandler)SFbuttonPressList, (XtPointer)n);
+		(XtEventHandler)SFbuttonPressList, (XtPointer)(long_u)n);
 	XtAddEventHandler(selFileLists[n], ButtonReleaseMask, False,
-		(XtEventHandler)SFbuttonReleaseList, (XtPointer)n);
+		(XtEventHandler)SFbuttonReleaseList, (XtPointer)(long_u)n);
     }
 
     XtAddEventHandler(selFileField, KeyPressMask, False,
diff -r 12ebd6f6dfce src/gui_at_sb.c
--- a/src/gui_at_sb.c	Sun Jun 06 16:11:09 2010 +0200
+++ b/src/gui_at_sb.c	Sun Jun 06 18:29:26 2010 +0200
@@ -820,7 +820,7 @@
     if (mode == SMODE_PAGE_UP || mode == SMODE_LINE_UP)
 	call_data = -call_data;
 
-    XtCallCallbacks((Widget)sbw, XtNscrollProc, (XtPointer)call_data);
+    XtCallCallbacks((Widget)sbw, XtNscrollProc, (XtPointer)(long_u)call_data);
 
     sbw->scrollbar.timer_id =
 	XtAppAddTimeOut(XtWidgetToApplicationContext((Widget)sbw),
@@ -894,7 +894,7 @@
 	return;
 
     sbw->scrollbar.scroll_mode = SMODE_LINE_UP;
-    XtCallCallbacks(w, XtNscrollProc, (XtPointer)call_data);
+    XtCallCallbacks(w, XtNscrollProc, (XtPointer)(long_u)call_data);
 }
 
     static void
@@ -977,7 +977,7 @@
     }
 
     if (call_data)
-	XtCallCallbacks(w, XtNscrollProc, (XtPointer)call_data);
+	XtCallCallbacks(w, XtNscrollProc, (XtPointer)(long_u)call_data);
 
     /* establish autoscroll */
     if (delay)
diff -r 12ebd6f6dfce src/gui_athena.c
--- a/src/gui_athena.c	Sun Jun 06 16:11:09 2010 +0200
+++ b/src/gui_athena.c	Sun Jun 06 18:29:26 2010 +0200
@@ -1270,7 +1270,7 @@
 		return;
 
 	    /* If there are other "pulldown" items in this pane, then adjust
-	     * the right margin to accomodate the arrow pixmap, otherwise
+	     * the right margin to accommodate the arrow pixmap, otherwise
 	     * the right margin will be the same as the left margin.
 	     */
 	    {
@@ -2254,7 +2254,7 @@
 		    vertical ? XtNfromVert : XtNfromHoriz, prev_dialogButton,
 		    NULL);
 
-	XtAddCallback(dialogButton, XtNcallback, butproc, (XtPointer)butcount);
+	XtAddCallback(dialogButton, XtNcallback, butproc, (XtPointer)(long_u)butcount);
 	p = next;
 	prev_dialogButton = dialogButton;
     }

Raspunde prin e-mail lui