Mercurial > sdl-ios-xcode
comparison src/video/Xext/Xxf86vm/XF86VMode.c @ 4154:db4007f17bc8 SDL-1.2
Correct fix for Bugzilla #602.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Mon, 15 Sep 2008 20:47:55 +0000 |
parents | e66db1af0714 |
children |
comparison
equal
deleted
inserted
replaced
4153:e66db1af0714 | 4154:db4007f17bc8 |
---|---|
210 Gamma->green = ((float)rep.green) / 10000.; | 210 Gamma->green = ((float)rep.green) / 10000.; |
211 Gamma->blue = ((float)rep.blue) / 10000.; | 211 Gamma->blue = ((float)rep.blue) / 10000.; |
212 UnlockDisplay(dpy); | 212 UnlockDisplay(dpy); |
213 SyncHandle(); | 213 SyncHandle(); |
214 return True; | 214 return True; |
215 } | |
216 | |
217 /* this is to prevent an unaligned memory write on CPUs that need that. */ | |
218 static void zap_ptr(char *ptr, size_t size) | |
219 { | |
220 memset(ptr, '\0', size); | |
221 } | 215 } |
222 | 216 |
223 Bool | 217 Bool |
224 SDL_NAME(XF86VidModeGetModeLine)(dpy, screen, dotclock, modeline) | 218 SDL_NAME(XF86VidModeGetModeLine)(dpy, screen, dotclock, modeline) |
225 Display* dpy; | 219 Display* dpy; |
288 Xfree(modeline->private); | 282 Xfree(modeline->private); |
289 return False; | 283 return False; |
290 } | 284 } |
291 _XRead(dpy, (char*)modeline->private, modeline->privsize * sizeof(INT32)); | 285 _XRead(dpy, (char*)modeline->private, modeline->privsize * sizeof(INT32)); |
292 } else { | 286 } else { |
293 zap_ptr((char *)&modeline->private, sizeof(modeline->private)); | 287 modeline->private = NULL; |
294 } | 288 } |
295 UnlockDisplay(dpy); | 289 UnlockDisplay(dpy); |
296 SyncHandle(); | 290 SyncHandle(); |
297 return True; | 291 return True; |
298 } | 292 } |