Mercurial > sdl-ios-xcode
comparison src/video/Xext/Xxf86vm/XF86VMode.c @ 2751:3411fb673d4b
Merged r4082:4083 from branches/SDL-1.2: sparc64 crash fix.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Mon, 08 Sep 2008 07:38:41 +0000 |
parents | c121d94672cb |
children | 0969758c8809 |
comparison
equal
deleted
inserted
replaced
2750:e3affc66d963 | 2751:3411fb673d4b |
---|---|
206 Gamma->green = ((float) rep.green) / 10000.; | 206 Gamma->green = ((float) rep.green) / 10000.; |
207 Gamma->blue = ((float) rep.blue) / 10000.; | 207 Gamma->blue = ((float) rep.blue) / 10000.; |
208 UnlockDisplay(dpy); | 208 UnlockDisplay(dpy); |
209 SyncHandle(); | 209 SyncHandle(); |
210 return True; | 210 return True; |
211 } | |
212 | |
213 /* this is to prevent an unaligned memory write on CPUs that need that. */ | |
214 static void | |
215 zap_ptr(char *ptr, size_t size) | |
216 { | |
217 memset(ptr, '\0', size); | |
211 } | 218 } |
212 | 219 |
213 Bool SDL_NAME(XF86VidModeGetModeLine) (dpy, screen, dotclock, modeline) | 220 Bool SDL_NAME(XF86VidModeGetModeLine) (dpy, screen, dotclock, modeline) |
214 Display * | 221 Display * |
215 dpy; | 222 dpy; |
283 return False; | 290 return False; |
284 } | 291 } |
285 _XRead(dpy, (char *) modeline->private, | 292 _XRead(dpy, (char *) modeline->private, |
286 modeline->privsize * sizeof(INT32)); | 293 modeline->privsize * sizeof(INT32)); |
287 } else { | 294 } else { |
288 modeline->private = NULL; | 295 zap_ptr((char *)&modeline->private, sizeof(modeline->private)) |
289 } | 296 } |
290 UnlockDisplay(dpy); | 297 UnlockDisplay(dpy); |
291 SyncHandle(); | 298 SyncHandle(); |
292 return True; | 299 return True; |
293 } | 300 } |