aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-03-04 08:57:07 +0100
committermarha <marha@users.sourceforge.net>2014-03-04 08:57:07 +0100
commit321c01267ae1c446f1bd22b642567fcafa016c02 (patch)
tree69f6e12bdfd1ccda5d054398321bc1876dd3fc89 /xorg-server/hw/xwin
parent982ac918afe6a1c02d5cf735d7b6c56443a048cc (diff)
downloadvcxsrv-321c01267ae1c446f1bd22b642567fcafa016c02.tar.gz
vcxsrv-321c01267ae1c446f1bd22b642567fcafa016c02.tar.bz2
vcxsrv-321c01267ae1c446f1bd22b642567fcafa016c02.zip
libX11 libxcb mesa xserver xcb-proto xkeyboard-config git update 4 Mar 2014
xserver commit b634e909895f6001e7d9543e1350b20c82c8c01c libxcb commit 4ffa6f83b92763eb901c7ddb7c20775e24d507ca libxcb/xcb-proto commit 4270141a7cb3c68f50251be19a5a628aa18553e6 xkeyboard-config commit d9e3d0ec1a48a5f61ea6dd6d20b8682eeecf3a39 libX11 commit d6bd988bc00494914b38b95ee5df77ac4f32f19f libXdmcp commit 089081dca4ba3598c6f9bf401c029378943b5854 libXext commit d5447c0156f556114dbf97d6064c0c7b0fcd5f70 libfontenc commit 0037a42107b952c9d903719615747e760e4e7247 libXinerama commit edd95182b26eb5d576d4878c559e0f17dddaa909 libXau commit 1e4635be11154dd8262f37b379511bd627defa2a xkbcomp commit 31b90ee4ffc774e0da540277907fc5540c0b012c pixman commit 82d094654a46bd97d47f1f132a01ae0a74b986f3 xextproto commit 66afec3f49e8eb0d4c2e9af7088fc3116d4bafd7 randrproto commit a4a6694c059d74247c16527eef4a0ec9f56bbef6 glproto commit f84853d97d5749308992412a215fa518b6536eb3 mkfontscale commit eac564e0fc9052a39981ea47b271f7f3d2821944 xwininfo commit ba0d1b0da21d2dbdd81098ed5778f3792b472e13 libXft commit 4acfdaf95adb0a05c2a25550bdde036c865902f4 libXmu commit 22d9c590901e121936f50dee97dc60c4f7defb63 libxtrans commit 3f0de269abe59353acbd7a5587d68ce0da91db67 fontconfig commit e310d2fac2d874d5aa76c609df70cc7b871c0b6d mesa commit 1a568e0f2b65e4e1e1d19a6dece3a792a33da825
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))
{