aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xwin')
-rw-r--r--xorg-server/hw/xwin/InitOutput.c5
-rw-r--r--xorg-server/hw/xwin/glx/gen_gl_wrappers.py45
-rw-r--r--xorg-server/hw/xwin/glx/indirect.c2
-rw-r--r--xorg-server/hw/xwin/win.h6
-rw-r--r--xorg-server/hw/xwin/winallpriv.c4
-rw-r--r--xorg-server/hw/xwin/winclipboardinit.c2
-rw-r--r--xorg-server/hw/xwin/winclipboardxevents.c5
-rw-r--r--xorg-server/hw/xwin/wincursor.c10
-rw-r--r--xorg-server/hw/xwin/winkeybd.c2
-rw-r--r--xorg-server/hw/xwin/winmonitors.h2
-rw-r--r--xorg-server/hw/xwin/winmultiwindowwm.c91
-rw-r--r--xorg-server/hw/xwin/winnativegdi.c3
-rw-r--r--xorg-server/hw/xwin/winprefslex.l3
-rw-r--r--xorg-server/hw/xwin/winprefsyacc.y25
-rw-r--r--xorg-server/hw/xwin/winshadgdi.c6
-rw-r--r--xorg-server/hw/xwin/winwin32rootless.c7
-rw-r--r--xorg-server/hw/xwin/winwindow.c2
-rw-r--r--xorg-server/hw/xwin/winwindowswm.c4
18 files changed, 119 insertions, 105 deletions
diff --git a/xorg-server/hw/xwin/InitOutput.c b/xorg-server/hw/xwin/InitOutput.c
index b05ca2736..9413350e6 100644
--- a/xorg-server/hw/xwin/InitOutput.c
+++ b/xorg-server/hw/xwin/InitOutput.c
@@ -58,8 +58,11 @@ typedef WINAPI HRESULT(*SHGETFOLDERPATHPROC) (HWND hwndOwner,
HANDLE hToken,
DWORD dwFlags, LPTSTR pszPath);
#endif
-
#include "glx_extinit.h"
+#ifdef XWIN_GLX_WINDOWS
+#include "glx/glwindows.h"
+#endif
+
/*
* References to external symbols
*/
diff --git a/xorg-server/hw/xwin/glx/gen_gl_wrappers.py b/xorg-server/hw/xwin/glx/gen_gl_wrappers.py
index 683b9d903..cdbba638a 100644
--- a/xorg-server/hw/xwin/glx/gen_gl_wrappers.py
+++ b/xorg-server/hw/xwin/glx/gen_gl_wrappers.py
@@ -43,35 +43,18 @@ thunkdefs=False
staticwrappers=False
nodebug=False
-#exclude base WGL API
-WinGDI={key: 1 for key in [
- "wglCopyContext"
- ,"wglCreateContext"
- ,"wglCreateLayerContext"
- ,"wglDeleteContext"
- ,"wglGetCurrentContext"
- ,"wglGetCurrentDC"
- ,"wglGetProcAddress"
- ,"wglMakeCurrent"
- ,"wglShareLists"
- ,"wglUseFontBitmapsA"
- ,"wglUseFontBitmapsW"
- ,"wglUseFontBitmaps"
- ,"SwapBuffers"
- ,"wglUseFontOutlinesA"
- ,"wglUseFontOutlinesW"
- ,"wglUseFontOutlines"
- ,"wglDescribeLayerPlane"
- ,"wglSetLayerPaletteEntries"
- ,"wglGetLayerPaletteEntries"
- ,"wglRealizeLayerPalette"
- ,"wglSwapLayerBuffers"
- ,"wglSwapMultipleBuffers"
- ,"ChoosePixelFormat"
- ,"DescribePixelFormat"
- ,"GetEnhMetaFilePixelFormat"
- ,"GetPixelFormat"
- ,"SetPixelFormat"
+# list of WGL extension functions we use
+used_wgl_ext_fns = {key: 1 for key in [
+ "wglSwapIntervalEXT",
+ "wglGetExtensionsStringARB",
+ "wglDestroyPbufferARB",
+ "wglGetPbufferDCARB",
+ "wglReleasePbufferDCARB",
+ "wglCreatePbufferARB",
+ "wglMakeContextCurrentARB",
+ "wglChoosePixelFormatARB",
+ "wglGetPixelFormatAttribivARB",
+ "wglGetPixelFormatAttribivARB"
]}
if __name__ == '__main__':
@@ -162,7 +145,7 @@ class PreResolveOutputGenerator(OutputGenerator):
def genCmd(self, cmd, name):
OutputGenerator.genCmd(self, cmd, name)
- if name in WinGDI:
+ if prefix == 'wgl' and not name in used_wgl_ext_fns:
return
self.outFile.write('RESOLVE_DECL(PFN' + name.upper() + 'PROC);\n')
@@ -190,7 +173,7 @@ class WrapperOutputGenerator(OutputGenerator):
def genCmd(self, cmd, name):
OutputGenerator.genCmd(self, cmd, name)
- if name in WinGDI:
+ if prefix == 'wgl' and not name in used_wgl_ext_fns:
return
proto=noneStr(cmd.elem.find('proto'))
diff --git a/xorg-server/hw/xwin/glx/indirect.c b/xorg-server/hw/xwin/glx/indirect.c
index f130651fb..690611428 100644
--- a/xorg-server/hw/xwin/glx/indirect.c
+++ b/xorg-server/hw/xwin/glx/indirect.c
@@ -1613,7 +1613,7 @@ glxWinCreateContext(__GLXscreen * screen,
glxWinReleaseTexImage
};
- context = (__GLXWinContext *) calloc(1, sizeof(__GLXWinContext));
+ context = calloc(1, sizeof(__GLXWinContext));
if (!context)
return NULL;
diff --git a/xorg-server/hw/xwin/win.h b/xorg-server/hw/xwin/win.h
index 0adb227c0..80fc504f6 100644
--- a/xorg-server/hw/xwin/win.h
+++ b/xorg-server/hw/xwin/win.h
@@ -751,7 +751,7 @@ Bool
winAllocatePrivates(ScreenPtr pScreen);
Bool
- winInitCmapPrivates(ColormapPtr pCmap, int index);
+ winInitCmapPrivates(ColormapPtr pCmap, int i);
Bool
winAllocateCmapPrivates(ColormapPtr pCmap);
@@ -1056,12 +1056,12 @@ Bool
winScreenInit(ScreenPtr pScreen, int argc, char **argv);
Bool
- winFinishScreenInitFB(int index, ScreenPtr pScreen, int argc, char **argv);
+ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv);
#if defined(XWIN_NATIVEGDI)
Bool
-winFinishScreenInitNativeGDI(int index,
+winFinishScreenInitNativeGDI(int i,
ScreenPtr pScreen, int argc, char **argv);
#endif
diff --git a/xorg-server/hw/xwin/winallpriv.c b/xorg-server/hw/xwin/winallpriv.c
index cc3b3d1ba..629af92c9 100644
--- a/xorg-server/hw/xwin/winallpriv.c
+++ b/xorg-server/hw/xwin/winallpriv.c
@@ -58,7 +58,7 @@ winAllocatePrivates(ScreenPtr pScreen)
}
/* Allocate memory for the screen private structure */
- pScreenPriv = (winPrivScreenPtr) malloc(sizeof(winPrivScreenRec));
+ pScreenPriv = malloc(sizeof(winPrivScreenRec));
if (!pScreenPriv) {
ErrorF("winAllocateScreenPrivates - malloc () failed\n");
return FALSE;
@@ -150,7 +150,7 @@ winAllocateCmapPrivates(ColormapPtr pCmap)
}
/* Allocate memory for our private structure */
- pCmapPriv = (winPrivCmapPtr) malloc(sizeof(winPrivCmapRec));
+ pCmapPriv = malloc(sizeof(winPrivCmapRec));
if (!pCmapPriv) {
ErrorF("winAllocateCmapPrivates - malloc () failed\n");
return FALSE;
diff --git a/xorg-server/hw/xwin/winclipboardinit.c b/xorg-server/hw/xwin/winclipboardinit.c
index 304e6df9f..157006dab 100644
--- a/xorg-server/hw/xwin/winclipboardinit.c
+++ b/xorg-server/hw/xwin/winclipboardinit.c
@@ -77,7 +77,7 @@ winInitClipboard(void)
}
/*
- * Create the Windows window that we use to recieve Windows messages
+ * Create the Windows window that we use to receive Windows messages
*/
HWND
diff --git a/xorg-server/hw/xwin/winclipboardxevents.c b/xorg-server/hw/xwin/winclipboardxevents.c
index 226c3f055..7d3c30e85 100644
--- a/xorg-server/hw/xwin/winclipboardxevents.c
+++ b/xorg-server/hw/xwin/winclipboardxevents.c
@@ -248,7 +248,7 @@ winClipboardFlushXEvents(HWND hwnd,
(LPCWSTR) pszGlobalData,
-1, NULL, 0, NULL, NULL);
/* NOTE: iConvertDataLen includes space for null terminator */
- pszConvertData = (char *) malloc(iConvertDataLen);
+ pszConvertData = malloc(iConvertDataLen);
WideCharToMultiByte(CP_UTF8,
0,
(LPCWSTR) pszGlobalData,
@@ -581,8 +581,7 @@ winClipboardFlushXEvents(HWND hwnd,
pszReturnData, -1, NULL, 0);
/* Allocate memory for the Unicode string */
- pwszUnicodeStr
- = (wchar_t *) malloc(sizeof(wchar_t) * (iUnicodeLen + 1));
+ pwszUnicodeStr = malloc(sizeof(wchar_t) * (iUnicodeLen + 1));
if (!pwszUnicodeStr) {
ErrorF("winClipboardFlushXEvents - SelectionNotify "
"malloc failed for pwszUnicodeStr, aborting.\n");
diff --git a/xorg-server/hw/xwin/wincursor.c b/xorg-server/hw/xwin/wincursor.c
index a35336a34..f3ac0f7ae 100644
--- a/xorg-server/hw/xwin/wincursor.c
+++ b/xorg-server/hw/xwin/wincursor.c
@@ -255,10 +255,8 @@ winLoadCursor(ScreenPtr pScreen, CursorPtr pCursor, int screen)
bi.bV4BlueMask = 0x000000FF;
bi.bV4AlphaMask = 0xFF000000;
- lpBits =
- (uint32_t *) calloc(pScreenPriv->cursor.sm_cx *
- pScreenPriv->cursor.sm_cy,
- sizeof(uint32_t));
+ lpBits = calloc(pScreenPriv->cursor.sm_cx * pScreenPriv->cursor.sm_cy,
+ sizeof(uint32_t));
if (lpBits) {
int y;
@@ -302,9 +300,7 @@ winLoadCursor(ScreenPtr pScreen, CursorPtr pCursor, int screen)
pbmiColors[2].rgbBlue = pCursor->foreBlue >> 8;
pbmiColors[2].rgbReserved = 0;
- lpBits =
- (uint32_t *) calloc(pScreenPriv->cursor.sm_cx *
- pScreenPriv->cursor.sm_cy, sizeof(char));
+ lpBits = calloc(pScreenPriv->cursor.sm_cx * pScreenPriv->cursor.sm_cy, 1);
pCur = (unsigned char *) lpBits;
if (lpBits) {
diff --git a/xorg-server/hw/xwin/winkeybd.c b/xorg-server/hw/xwin/winkeybd.c
index b6b208612..3a75ab268 100644
--- a/xorg-server/hw/xwin/winkeybd.c
+++ b/xorg-server/hw/xwin/winkeybd.c
@@ -128,7 +128,7 @@ winKeybdBell(int iPercent, DeviceIntPtr pDeviceInt, void *pCtrl, int iClass)
* sound on systems with a sound card or it will beep the PC speaker
* on systems that do not have a sound card.
*/
- MessageBeep(MB_OK);
+ if (iPercent > 0) MessageBeep(MB_OK);
}
/* Change some keyboard configuration parameters */
diff --git a/xorg-server/hw/xwin/winmonitors.h b/xorg-server/hw/xwin/winmonitors.h
index 8201e47f4..5fe3ecd52 100644
--- a/xorg-server/hw/xwin/winmonitors.h
+++ b/xorg-server/hw/xwin/winmonitors.h
@@ -40,4 +40,4 @@ struct GetMonitorInfoData {
HMONITOR monitorHandle;
};
-Bool QueryMonitor(int index, struct GetMonitorInfoData *data);
+Bool QueryMonitor(int i, struct GetMonitorInfoData *data);
diff --git a/xorg-server/hw/xwin/winmultiwindowwm.c b/xorg-server/hw/xwin/winmultiwindowwm.c
index 1dd8ba5b3..9f12521bc 100644
--- a/xorg-server/hw/xwin/winmultiwindowwm.c
+++ b/xorg-server/hw/xwin/winmultiwindowwm.c
@@ -111,6 +111,7 @@ typedef struct _WMInfo {
WMMsgQueueRec wmMsgQueue;
Atom atmWmProtos;
Atom atmWmDelete;
+ Atom atmWmTakeFocus;
Atom atmPrivMap;
Bool fAllowOtherWM;
} WMInfoRec, *WMInfoPtr;
@@ -405,7 +406,7 @@ Xutf8TextPropertyToString(Display * pDisplay, XTextProperty * xtp)
for (i = 0; i < nNum; i++)
iLen += strlen(ppList[i]);
- pszReturnData = (char *) malloc(iLen + 1);
+ pszReturnData = malloc(iLen + 1);
pszReturnData[0] = '\0';
for (i = 0; i < nNum; i++)
strcat(pszReturnData, ppList[i]);
@@ -413,7 +414,7 @@ Xutf8TextPropertyToString(Display * pDisplay, XTextProperty * xtp)
XFreeStringList(ppList);
}
else {
- pszReturnData = (char *) malloc(1);
+ pszReturnData = malloc(1);
pszReturnData[0] = '\0';
}
@@ -453,6 +454,27 @@ GetWindowName(Display * pDisplay, Window iWin, char **ppWindowName)
}
/*
+ * Does the client support the specified WM_PROTOCOLS protocol?
+ */
+
+static Bool
+IsWmProtocolAvailable(Display * pDisplay, Window iWindow, Atom atmProtocol)
+{
+ int i, n, found = 0;
+ Atom *protocols;
+
+ if (XGetWMProtocols(pDisplay, iWindow, &protocols, &n)) {
+ for (i = 0; i < n; ++i)
+ if (protocols[i] == atmProtocol)
+ ++found;
+
+ XFree(protocols);
+ }
+
+ return found > 0;
+}
+
+/*
* Send a message to the X server from the WM thread
*/
@@ -537,7 +559,7 @@ UpdateName(WMInfoPtr pWMInfo, Window iWindow)
int iLen =
MultiByteToWideChar(CP_UTF8, 0, pszWindowName, -1, NULL, 0);
wchar_t *pwszWideWindowName =
- (wchar_t *) malloc(sizeof(wchar_t) * (iLen + 1));
+ malloc(sizeof(wchar_t)*(iLen + 1));
MultiByteToWideChar(CP_UTF8, 0, pszWindowName, -1,
pwszWideWindowName, iLen);
@@ -805,21 +827,10 @@ winMultiWindowWMProc(void *pArg)
ErrorF("\tWM_WM_KILL\n");
#endif
{
- int i, n, found = 0;
- Atom *protocols;
-
- /* --- */
- if (XGetWMProtocols(pWMInfo->pDisplay,
- pNode->msg.iWindow, &protocols, &n)) {
- for (i = 0; i < n; ++i)
- if (protocols[i] == pWMInfo->atmWmDelete)
- ++found;
-
- XFree(protocols);
- }
-
/* --- */
- if (found)
+ if (IsWmProtocolAvailable(pWMInfo->pDisplay,
+ pNode->msg.iWindow,
+ pWMInfo->atmWmDelete))
SendXMessage(pWMInfo->pDisplay,
pNode->msg.iWindow,
pWMInfo->atmWmProtos, pWMInfo->atmWmDelete);
@@ -832,11 +843,39 @@ winMultiWindowWMProc(void *pArg)
#if CYGMULTIWINDOW_DEBUG
ErrorF("\tWM_WM_ACTIVATE\n");
#endif
-
/* Set the input focus */
- XSetInputFocus(pWMInfo->pDisplay,
- pNode->msg.iWindow,
- RevertToPointerRoot, CurrentTime);
+
+ /*
+ ICCCM 4.1.7 is pretty opaque, but it appears that the rules are
+ actually quite simple:
+ -- the WM_HINTS input field determines whether the WM should call
+ XSetInputFocus()
+ -- independently, the WM_TAKE_FOCUS protocol determines whether
+ the WM should send a WM_TAKE_FOCUS ClientMessage.
+ */
+ {
+ Bool neverFocus = FALSE;
+ XWMHints *hints = XGetWMHints(pWMInfo->pDisplay, pNode->msg.iWindow);
+
+ if (hints) {
+ if (hints->flags & InputHint)
+ neverFocus = !hints->input;
+ XFree(hints);
+ }
+
+ if (!neverFocus)
+ XSetInputFocus(pWMInfo->pDisplay,
+ pNode->msg.iWindow,
+ RevertToPointerRoot, CurrentTime);
+
+ if (IsWmProtocolAvailable(pWMInfo->pDisplay,
+ pNode->msg.iWindow,
+ pWMInfo->atmWmTakeFocus))
+ SendXMessage(pWMInfo->pDisplay,
+ pNode->msg.iWindow,
+ pWMInfo->atmWmProtos, pWMInfo->atmWmTakeFocus);
+
+ }
break;
case WM_WM_NAME_EVENT:
@@ -1237,9 +1276,9 @@ winInitWM(void **ppWMInfo,
pthread_mutex_t * ppmServerStarted,
int dwScreen, HWND hwndScreen, BOOL allowOtherWM)
{
- WMProcArgPtr pArg = (WMProcArgPtr) malloc(sizeof(WMProcArgRec));
- WMInfoPtr pWMInfo = (WMInfoPtr) malloc(sizeof(WMInfoRec));
- XMsgProcArgPtr pXMsgArg = (XMsgProcArgPtr) malloc(sizeof(XMsgProcArgRec));
+ WMProcArgPtr pArg = malloc(sizeof(WMProcArgRec));
+ WMInfoPtr pWMInfo = malloc(sizeof(WMInfoRec));
+ XMsgProcArgPtr pXMsgArg = malloc(sizeof(XMsgProcArgRec));
/* Bail if the input parameters are bad */
if (pArg == NULL || pWMInfo == NULL || pXMsgArg == NULL) {
@@ -1404,6 +1443,8 @@ winInitMultiWindowWM(WMInfoPtr pWMInfo, WMProcArgPtr pProcArg)
"WM_PROTOCOLS", False);
pWMInfo->atmWmDelete = XInternAtom(pWMInfo->pDisplay,
"WM_DELETE_WINDOW", False);
+ pWMInfo->atmWmTakeFocus = XInternAtom(pWMInfo->pDisplay,
+ "WM_TAKE_FOCUS", False);
pWMInfo->atmPrivMap = XInternAtom(pWMInfo->pDisplay,
WINDOWSWM_NATIVE_HWND, False);
@@ -1432,7 +1473,7 @@ winSendMessageToWM(void *pWMInfo, winWMMessagePtr pMsg)
ErrorF("winSendMessageToWM ()\n");
#endif
- pNode = (WMMsgNodePtr) malloc(sizeof(WMMsgNodeRec));
+ pNode = malloc(sizeof(WMMsgNodeRec));
if (pNode != NULL) {
memcpy(&pNode->msg, pMsg, sizeof(winWMMessageRec));
PushMessage(&((WMInfoPtr) pWMInfo)->wmMsgQueue, pNode);
diff --git a/xorg-server/hw/xwin/winnativegdi.c b/xorg-server/hw/xwin/winnativegdi.c
index a2a5123a0..1859698a0 100644
--- a/xorg-server/hw/xwin/winnativegdi.c
+++ b/xorg-server/hw/xwin/winnativegdi.c
@@ -344,8 +344,7 @@ winCreateDIBNativeGDI(int iWidth, int iHeight, int iDepth,
}
/* Allocate bitmap info header */
- pbmih = (BITMAPINFOHEADER *) malloc(sizeof(BITMAPINFOHEADER)
- + 256 * sizeof(RGBQUAD));
+ pbmih = malloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD));
if (pbmih == NULL) {
ErrorF("winCreateDIBNativeGDI - malloc () failed\n");
return FALSE;
diff --git a/xorg-server/hw/xwin/winprefslex.l b/xorg-server/hw/xwin/winprefslex.l
index 15f707766..fd13edc05 100644
--- a/xorg-server/hw/xwin/winprefslex.l
+++ b/xorg-server/hw/xwin/winprefslex.l
@@ -45,7 +45,7 @@ extern void ErrorF (const char* /*f*/, ...);
static char *makestr(char *str)
{
char *ptr;
- ptr = (char*)malloc (strlen(str)+1);
+ ptr = malloc(strlen(str)+1);
if (!ptr)
{
ErrorF ("winMultiWindowLex:makestr() out of memory\n");
@@ -90,6 +90,7 @@ ALWAYSONTOP { return ALWAYSONTOP; }
DEBUG { return DEBUGOUTPUT; }
RELOAD { return RELOAD; }
TRAYICON { return TRAYICON; }
+FORCEEXIT { return FORCEEXIT; }
SILENTEXIT { return SILENTEXIT; }
"{" { return LB; }
"}" { return RB; }
diff --git a/xorg-server/hw/xwin/winprefsyacc.y b/xorg-server/hw/xwin/winprefsyacc.y
index 3b376b3e7..683fc44ca 100644
--- a/xorg-server/hw/xwin/winprefsyacc.y
+++ b/xorg-server/hw/xwin/winprefsyacc.y
@@ -311,10 +311,9 @@ static void
AddMenuLine (char *text, MENUCOMMANDTYPE cmd, char *param)
{
if (menu.menuItem==NULL)
- menu.menuItem = (MENUITEM*)malloc(sizeof(MENUITEM));
+ menu.menuItem = malloc(sizeof(MENUITEM));
else
- menu.menuItem = (MENUITEM*)
- realloc(menu.menuItem, sizeof(MENUITEM)*(menu.menuItems+1));
+ menu.menuItem = realloc(menu.menuItem, sizeof(MENUITEM)*(menu.menuItems+1));
strncpy (menu.menuItem[menu.menuItems].text, text, MENU_MAX);
menu.menuItem[menu.menuItems].text[MENU_MAX] = 0;
@@ -339,10 +338,9 @@ CloseMenu (void)
}
if (pref.menuItems)
- pref.menu = (MENUPARSED*)
- realloc (pref.menu, (pref.menuItems+1)*sizeof(MENUPARSED));
+ pref.menu = realloc (pref.menu, (pref.menuItems+1)*sizeof(MENUPARSED));
else
- pref.menu = (MENUPARSED*)malloc (sizeof(MENUPARSED));
+ pref.menu = malloc (sizeof(MENUPARSED));
memcpy (pref.menu+pref.menuItems, &menu, sizeof(MENUPARSED));
pref.menuItems++;
@@ -365,10 +363,9 @@ static void
AddIconLine (char *matchstr, char *iconfile)
{
if (pref.icon==NULL)
- pref.icon = (ICONITEM*)malloc(sizeof(ICONITEM));
+ pref.icon = malloc(sizeof(ICONITEM));
else
- pref.icon = (ICONITEM*)
- realloc(pref.icon, sizeof(ICONITEM)*(pref.iconItems+1));
+ pref.icon = realloc(pref.icon, sizeof(ICONITEM)*(pref.iconItems+1));
strncpy(pref.icon[pref.iconItems].match, matchstr, MENU_MAX);
pref.icon[pref.iconItems].match[MENU_MAX] = 0;
@@ -401,10 +398,9 @@ static void
AddStyleLine (char *matchstr, unsigned long style)
{
if (pref.style==NULL)
- pref.style = (STYLEITEM*)malloc(sizeof(STYLEITEM));
+ pref.style = malloc(sizeof(STYLEITEM));
else
- pref.style = (STYLEITEM*)
- realloc(pref.style, sizeof(STYLEITEM)*(pref.styleItems+1));
+ pref.style = realloc(pref.style, sizeof(STYLEITEM)*(pref.styleItems+1));
strncpy(pref.style[pref.styleItems].match, matchstr, MENU_MAX);
pref.style[pref.styleItems].match[MENU_MAX] = 0;
@@ -434,10 +430,9 @@ static void
AddSysMenuLine (char *matchstr, char *menuname, int pos)
{
if (pref.sysMenu==NULL)
- pref.sysMenu = (SYSMENUITEM*)malloc(sizeof(SYSMENUITEM));
+ pref.sysMenu = malloc(sizeof(SYSMENUITEM));
else
- pref.sysMenu = (SYSMENUITEM*)
- realloc(pref.sysMenu, sizeof(SYSMENUITEM)*(pref.sysMenuItems+1));
+ pref.sysMenu = realloc(pref.sysMenu, sizeof(SYSMENUITEM)*(pref.sysMenuItems+1));
strncpy (pref.sysMenu[pref.sysMenuItems].match, matchstr, MENU_MAX);
pref.sysMenu[pref.sysMenuItems].match[MENU_MAX] = 0;
diff --git a/xorg-server/hw/xwin/winshadgdi.c b/xorg-server/hw/xwin/winshadgdi.c
index 2e3c64ce9..5c815eb73 100644
--- a/xorg-server/hw/xwin/winshadgdi.c
+++ b/xorg-server/hw/xwin/winshadgdi.c
@@ -184,8 +184,7 @@ winQueryRGBBitsAndMasks(ScreenPtr pScreen)
}
/* Allocate a bitmap header and color table */
- pbmih = (BITMAPINFOHEADER *) malloc(sizeof(BITMAPINFOHEADER)
- + 256 * sizeof(RGBQUAD));
+ pbmih = malloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD));
if (pbmih == NULL) {
ErrorF("winQueryRGBBitsAndMasks - malloc failed\n");
return FALSE;
@@ -545,8 +544,7 @@ winInitScreenShadowGDI(ScreenPtr pScreen)
pScreenPriv->hdcShadow = CreateCompatibleDC(pScreenPriv->hdcScreen);
/* Allocate bitmap info header */
- pScreenPriv->pbmih = (BITMAPINFOHEADER *) malloc(sizeof(BITMAPINFOHEADER)
- + 256 * sizeof(RGBQUAD));
+ pScreenPriv->pbmih = malloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD));
if (pScreenPriv->pbmih == NULL) {
ErrorF("winInitScreenShadowGDI - malloc () failed\n");
return FALSE;
diff --git a/xorg-server/hw/xwin/winwin32rootless.c b/xorg-server/hw/xwin/winwin32rootless.c
index 724976a84..0b62696f3 100644
--- a/xorg-server/hw/xwin/winwin32rootless.c
+++ b/xorg-server/hw/xwin/winwin32rootless.c
@@ -184,8 +184,8 @@ InitWin32RootlessEngine(win32RootlessWindowPtr pRLWinPriv)
/* Allocate bitmap info header */
pRLWinPriv->pbmihShadow =
- (BITMAPINFOHEADER *) malloc(sizeof(BITMAPINFOHEADER)
- + 256 * sizeof(RGBQUAD));
+ malloc(sizeof(BITMAPINFOHEADER)
+ + 256 * sizeof(RGBQUAD));
if (pRLWinPriv->pbmihShadow == NULL) {
ErrorF("InitWin32RootlessEngine - malloc () failed\n");
return;
@@ -214,8 +214,7 @@ winMWExtWMCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen,
newX, newY, pFrame->width, pFrame->height);
#endif
- pRLWinPriv =
- (win32RootlessWindowPtr) malloc(sizeof(win32RootlessWindowRec));
+ pRLWinPriv = malloc(sizeof(win32RootlessWindowRec));
pRLWinPriv->pFrame = pFrame;
pRLWinPriv->pfb = NULL;
pRLWinPriv->hbmpShadow = NULL;
diff --git a/xorg-server/hw/xwin/winwindow.c b/xorg-server/hw/xwin/winwindow.c
index 759aa5eee..8c1c28f2a 100644
--- a/xorg-server/hw/xwin/winwindow.c
+++ b/xorg-server/hw/xwin/winwindow.c
@@ -155,7 +155,7 @@ winCopyWindowNativeGDI(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
nbox = RegionNumRects(prgnDst);
/* Allocate source points for each box */
- if (!(pptSrc = (DDXPointPtr) malloc(nbox * sizeof(DDXPointRec))))
+ if (!(pptSrc = malloc(nbox * sizeof(DDXPointRec))))
return;
/* Set an iterator pointer */
diff --git a/xorg-server/hw/xwin/winwindowswm.c b/xorg-server/hw/xwin/winwindowswm.c
index c3503dbf9..2805ff7ce 100644
--- a/xorg-server/hw/xwin/winwindowswm.c
+++ b/xorg-server/hw/xwin/winwindowswm.c
@@ -162,7 +162,7 @@ ProcWindowsWMSelectInput(ClientPtr client)
}
/* build the entry */
- pNewEvent = (WMEventPtr) malloc(sizeof(WMEventRec));
+ pNewEvent = malloc(sizeof(WMEventRec));
if (!pNewEvent)
return BadAlloc;
pNewEvent->next = 0;
@@ -183,7 +183,7 @@ ProcWindowsWMSelectInput(ClientPtr client)
* done through the resource database.
*/
if (!pHead) {
- pHead = (WMEventPtr *) malloc(sizeof(WMEventPtr));
+ pHead = malloc(sizeof(WMEventPtr));
if (!pHead ||
!AddResource(eventResource, eventResourceType, (void *) pHead))
{