src/video/Xext/Xxf86vm/XF86VMode.c
changeset 2762 90de10bc38ec
parent 2754 703d7746f6c7
child 3633 81dde1b00bf1
equal deleted inserted replaced
2761:0c544c2eff77 2762:90de10bc38ec
   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);
       
   218 }
   211 }
   219 
   212 
   220 Bool SDL_NAME(XF86VidModeGetModeLine) (dpy, screen, dotclock, modeline)
   213 Bool SDL_NAME(XF86VidModeGetModeLine) (dpy, screen, dotclock, modeline)
   221      Display *
   214      Display *
   222          dpy;
   215          dpy;
   290             return False;
   283             return False;
   291         }
   284         }
   292         _XRead(dpy, (char *) modeline->private,
   285         _XRead(dpy, (char *) modeline->private,
   293                modeline->privsize * sizeof(INT32));
   286                modeline->privsize * sizeof(INT32));
   294     } else {
   287     } else {
   295         zap_ptr((char *) &modeline->private, sizeof(modeline->private));
   288         modeline->private = NULL;
   296     }
   289     }
   297     UnlockDisplay(dpy);
   290     UnlockDisplay(dpy);
   298     SyncHandle();
   291     SyncHandle();
   299     return True;
   292     return True;
   300 }
   293 }