comparison src/offix.c @ 225:12579d965149 r20-4b11

Import from CVS: tag r20-4b11
author cvs
date Mon, 13 Aug 2007 10:11:40 +0200
parents 78478c60bfcd
children c5d627a313b1
comparison
equal deleted inserted replaced
224:4663b37daab6 225:12579d965149
25 #include <X11/cursorfont.h> 25 #include <X11/cursorfont.h>
26 #include <X11/Xatom.h> 26 #include <X11/Xatom.h>
27 #include <X11/Xmu/WinUtil.h> 27 #include <X11/Xmu/WinUtil.h>
28 #include <stdio.h> 28 #include <stdio.h>
29 #include <stdlib.h> 29 #include <stdlib.h>
30 #include <values.h> 30 #include <limits.h>
31 31
32 /* Local variables */ 32 /* Local variables */
33 static Display *dpy; /* current display */ 33 static Display *dpy; /* current display */
34 static int DragPrecision; /* minimum dx,dy to start drag */ 34 static int DragPrecision; /* minimum dx,dy to start drag */
35 static int Dragging; /* Drag state flag */ 35 static int Dragging; /* Drag state flag */
278 /* Set the data type -- allow any type */ 278 /* Set the data type -- allow any type */
279 DataType = Type; 279 DataType = Type;
280 280
281 /* Set the data */ 281 /* Set the data */
282 AuxData = Data; 282 AuxData = Data;
283 AuxSize = ( Size <= MAXINT ? (int)Size : MAXINT ); 283 AuxSize = ( Size <= INT_MAX ? (int)Size : INT_MAX );
284 XChangeProperty(dpy,root,DndSelection,XA_STRING,8, 284 XChangeProperty(dpy,root,DndSelection,XA_STRING,8,
285 PropModeReplace,Data,AuxSize); 285 PropModeReplace,Data,AuxSize);
286 for(Size-=(unsigned long)AuxSize;Size;Size-=(unsigned long)AuxSize) 286 for(Size-=(unsigned long)AuxSize;Size;Size-=(unsigned long)AuxSize)
287 { 287 {
288 Data+=AuxSize; 288 Data+=AuxSize;
289 AuxSize = ( (Size<=(MAXINT)) ? (int)Size : (MAXINT) ); 289 AuxSize = ( (Size<=(INT_MAX)) ? (int)Size : (INT_MAX) );
290 XChangeProperty(dpy,root,DndSelection,XA_STRING,8, 290 XChangeProperty(dpy,root,DndSelection,XA_STRING,8,
291 PropModeAppend,Data,AuxSize); 291 PropModeAppend,Data,AuxSize);
292 } 292 }
293 293
294 /* Set the data for old DND version */ 294 /* Set the data for old DND version */
295 Size = BackSize; 295 Size = BackSize;
296 AuxData = Data; 296 AuxData = Data;
297 AuxSize = ( Size <= MAXINT ? (int)Size : MAXINT ); 297 AuxSize = ( Size <= INT_MAX ? (int)Size : INT_MAX );
298 XChangeProperty(dpy,root,OldDndSelection,XA_STRING,8, 298 XChangeProperty(dpy,root,OldDndSelection,XA_STRING,8,
299 PropModeReplace,Data,AuxSize); 299 PropModeReplace,Data,AuxSize);
300 for(Size-=(unsigned long)AuxSize;Size;Size-=(unsigned long)AuxSize) 300 for(Size-=(unsigned long)AuxSize;Size;Size-=(unsigned long)AuxSize)
301 { 301 {
302 Data+=AuxSize; 302 Data+=AuxSize;
303 AuxSize = ( (Size<=(MAXINT)) ? (int)Size : (MAXINT) ); 303 AuxSize = ( (Size<=(INT_MAX)) ? (int)Size : (INT_MAX) );
304 XChangeProperty(dpy,root,OldDndSelection,XA_STRING,8, 304 XChangeProperty(dpy,root,OldDndSelection,XA_STRING,8,
305 PropModeAppend,Data,AuxSize); 305 PropModeAppend,Data,AuxSize);
306 } 306 }
307 307
308 /* Everything is now ok */ 308 /* Everything is now ok */