xserver: Branch 'master' - 31 commits
Keith Packard
keithp at kemper.freedesktop.org
Fri Oct 26 16:45:39 PDT 2012
hw/xwin/InitOutput.c | 23 +++++---------
hw/xwin/Makefile.am | 1
hw/xwin/glx/gen_gl_wrappers.py | 10 ++----
hw/xwin/glx/glwrap.c | 2 -
hw/xwin/glx/indirect.c | 12 +++----
hw/xwin/win.h | 18 ++---------
hw/xwin/winallpriv.c | 2 -
hw/xwin/winclipboard.h | 3 -
hw/xwin/winclipboardtextconv.c | 10 +++---
hw/xwin/winclipboardthread.c | 5 +--
hw/xwin/winclipboardwrappers.c | 9 -----
hw/xwin/wincursor.c | 3 +
hw/xwin/winerror.c | 4 --
hw/xwin/wingc.c | 5 ---
hw/xwin/winlayouts.h | 10 +++---
hw/xwin/winmonitors.c | 8 +++--
hw/xwin/winmsg.c | 4 +-
hw/xwin/winmsg.h | 30 +++++++++++++-----
hw/xwin/winmultiwindowwm.c | 8 -----
hw/xwin/winprefs.c | 21 +++++--------
hw/xwin/winprefslex.l | 7 +---
hw/xwin/winprefsyacc.y | 10 +++---
hw/xwin/winprocarg.c | 4 --
hw/xwin/winregistry.c | 65 -----------------------------------------
hw/xwin/winscrinit.c | 6 +--
hw/xwin/winvalargs.c | 2 -
hw/xwin/winwindow.c | 6 ---
hw/xwin/winwindowswm.c | 5 ---
include/os.h | 4 +-
29 files changed, 95 insertions(+), 202 deletions(-)
New commits:
commit 0e85e5e62819c9e516d6e19836f9f5d7a5d53e87
Author: Colin Harrison <colin.harrison at virgin.net>
Date: Thu Oct 11 18:05:47 2012 +0100
hw/xwin: Fix no return value warning in winClipboardProc()
winclipboardthread.c: In function âwinClipboardProcâ:
winclipboardthread.c:415:9: warning: âreturnâ with no value, in function returning non-void
winclipboardthread.c:424:13: warning: âreturnâ with no value, in function returning non-void
Signed-off-by: Colin Harrison <colin.harrison at virgin.net>
Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>
diff --git a/hw/xwin/winclipboardthread.c b/hw/xwin/winclipboardthread.c
index 4479b54..8912782 100644
--- a/hw/xwin/winclipboardthread.c
+++ b/hw/xwin/winclipboardthread.c
@@ -412,7 +412,7 @@ winClipboardProc(void *pvNotUsed)
("winClipboardProc - the clipboard thread has restarted %d times and seems to be unstable, disabling clipboard integration\n",
clipboardRestarts);
g_fClipboard = FALSE;
- return;
+ return NULL;
}
if (g_fClipboard) {
@@ -421,7 +421,7 @@ winClipboardProc(void *pvNotUsed)
/* Create the clipboard client thread */
if (!winInitClipboard()) {
ErrorF("winClipboardProc - winClipboardInit failed.\n");
- return;
+ return NULL;
}
winDebug("winClipboardProc - winInitClipboard returned.\n");
commit 51ed6a7d46c6cc19eb9aaf838be41eb57fd8230a
Author: Colin Harrison <colin.harrison at virgin.net>
Date: Thu Oct 11 17:57:37 2012 +0100
hw/xwin: Remove unused variable in winmultiwindowwm.c
winmultiwindowwm.c: In function âUpdateNameâ:
winmultiwindowwm.c:522:14: warning: unused variable âpszNameâ [-Wunused-variable]
Signed-off-by: Colin Harrison <colin.harrison at virgin.net>
Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>
diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c
index 8d55e01..ac9d579 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -519,7 +519,6 @@ getHwnd(WMInfoPtr pWMInfo, Window iWindow)
static void
UpdateName(WMInfoPtr pWMInfo, Window iWindow)
{
- wchar_t *pszName;
HWND hWnd;
XWindowAttributes attr;
commit 5886b1dc4d2ce12a238a2e3600fdb576abc6e419
Author: Colin Harrison <colin.harrison at virgin.net>
Date: Thu Oct 11 17:56:11 2012 +0100
hw/xwin: Remove unused variables in winwindow.c
winwindow.c: In function âwinCreateWindowNativeGDIâ:
winwindow.c:62:19: warning: unused variable âpWinPrivâ [-Wunused-variable]
winwindow.c: In function âwinDestroyWindowNativeGDIâ:
winwindow.c:85:19: warning: unused variable âpWinPrivâ [-Wunused-variable]
winwindow.c: In function âwinPositionWindowNativeGDIâ:
winwindow.c:108:19: warning: unused variable âpWinPrivâ [-Wunused-variable]
winwindow.c: In function âwinChangeWindowAttributesNativeGDIâ:
winwindow.c:213:19: warning: unused variable âpWinPrivâ [-Wunused-variable]
winwindow.c: In function âwinUnmapWindowNativeGDIâ:
winwindow.c:241:19: warning: unused variable âpWinPrivâ [-Wunused-variable]
winwindow.c: In function âwinMapWindowNativeGDIâ:
winwindow.c:265:19: warning: unused variable âpWinPrivâ [-Wunused-variable]
Signed-off-by: Colin Harrison <colin.harrison at virgin.net>
Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>
diff --git a/hw/xwin/winwindow.c b/hw/xwin/winwindow.c
index 5947917..ab6d8de 100644
--- a/hw/xwin/winwindow.c
+++ b/hw/xwin/winwindow.c
@@ -59,7 +59,6 @@ winCreateWindowNativeGDI(WindowPtr pWin)
Bool fResult = TRUE;
ScreenPtr pScreen = pWin->drawable.pScreen;
- winWindowPriv(pWin);
winScreenPriv(pScreen);
#if CYGDEBUG
@@ -82,7 +81,6 @@ winDestroyWindowNativeGDI(WindowPtr pWin)
Bool fResult = TRUE;
ScreenPtr pScreen = pWin->drawable.pScreen;
- winWindowPriv(pWin);
winScreenPriv(pScreen);
#if CYGDEBUG
@@ -105,7 +103,6 @@ winPositionWindowNativeGDI(WindowPtr pWin, int x, int y)
Bool fResult = TRUE;
ScreenPtr pScreen = pWin->drawable.pScreen;
- winWindowPriv(pWin);
winScreenPriv(pScreen);
#if CYGDEBUG
@@ -210,7 +207,6 @@ winChangeWindowAttributesNativeGDI(WindowPtr pWin, unsigned long mask)
Bool fResult = TRUE;
ScreenPtr pScreen = pWin->drawable.pScreen;
- winWindowPriv(pWin);
winScreenPriv(pScreen);
#if CYGDEBUG
@@ -238,7 +234,6 @@ winUnmapWindowNativeGDI(WindowPtr pWin)
Bool fResult = TRUE;
ScreenPtr pScreen = pWin->drawable.pScreen;
- winWindowPriv(pWin);
winScreenPriv(pScreen);
#if CYGDEBUG
@@ -262,7 +257,6 @@ winMapWindowNativeGDI(WindowPtr pWin)
Bool fResult = TRUE;
ScreenPtr pScreen = pWin->drawable.pScreen;
- winWindowPriv(pWin);
winScreenPriv(pScreen);
#if CYGDEBUG
commit 08b33882f34fed0c23d54ff7361efc5833868a4b
Author: Colin Harrison <colin.harrison at virgin.net>
Date: Thu Oct 11 17:52:11 2012 +0100
hw/xwin: Remove unused variables in winvalargs.c
winvalargs.c: In function âwinValidateArgsâ:
winvalargs.c:62:10: warning: unused variable âfImplicitScreenFoundâ [-Wunused-variable]
winvalargs.c:60:9: warning: unused variable âiMaxConsecutiveScreenâ [-Wunused-variable]
Signed-off-by: Colin Harrison <colin.harrison at virgin.net>
Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>
diff --git a/hw/xwin/winvalargs.c b/hw/xwin/winvalargs.c
index eb6e973..edfd71f 100644
--- a/hw/xwin/winvalargs.c
+++ b/hw/xwin/winvalargs.c
@@ -57,9 +57,7 @@ Bool
winValidateArgs(void)
{
int i;
- int iMaxConsecutiveScreen = 0;
BOOL fHasNormalScreen0 = FALSE;
- BOOL fImplicitScreenFound = FALSE;
/*
* Check for a malformed set of -screen parameters.
commit 7e665f1a21468118dababdbf6d8573f1ce1ebd47
Author: Colin Harrison <colin.harrison at virgin.net>
Date: Thu Oct 11 17:50:42 2012 +0100
hw/xwin: Remove unused variables in winwindowswm.c
winwindowswm.c: In function âProcWindowsWMQueryVersionâ:
winwindowswm.c:85:9: warning: unused variable ânâ [-Wunused-variable]
winwindowswm.c: In function âSProcWindowsWMQueryVersionâ:
winwindowswm.c:565:9: warning: unused variable ânâ [-Wunused-variable]
Signed-off-by: Colin Harrison <colin.harrison at virgin.net>
Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>
diff --git a/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c
index 01ae088..fbd41aa 100644
--- a/hw/xwin/winwindowswm.c
+++ b/hw/xwin/winwindowswm.c
@@ -82,7 +82,6 @@ static int
ProcWindowsWMQueryVersion(ClientPtr client)
{
xWindowsWMQueryVersionReply rep;
- int n;
REQUEST_SIZE_MATCH(xWindowsWMQueryVersionReq);
rep.type = X_Reply;
@@ -562,8 +561,6 @@ SNotifyEvent(xWindowsWMNotifyEvent * from, xWindowsWMNotifyEvent * to)
static int
SProcWindowsWMQueryVersion(ClientPtr client)
{
- int n;
-
REQUEST(xWindowsWMQueryVersionReq);
swaps(&stuff->length);
return ProcWindowsWMQueryVersion(client);
commit e893d570aa3e9ae8df6a30ac4adaf0949a2fc733
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date: Thu Oct 11 19:36:13 2012 +0100
Use X_ATTRIBUTE_PRINTF where suggested for os.h
InitOutput.c: In function âOsVendorInitâ:
InitOutput.c:630:29: warning: assignment left-hand side might be a candidate for a format attribute [-Wmissing-format-attribute]
winprocarg.c: In function âddxProcessArgumentâ:
winprocarg.c:231:29: warning: assignment left-hand side might be a candidate for a format attribute [-Wmissing-format-attribute]
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
diff --git a/include/os.h b/include/os.h
index e324216..c7108a5 100644
--- a/include/os.h
+++ b/include/os.h
@@ -88,7 +88,9 @@ extern void ddxBeforeReset(void);
#endif
#ifdef DDXOSVERRORF
-extern _X_EXPORT void (*OsVendorVErrorFProc) (const char *, va_list args);
+extern _X_EXPORT void (*OsVendorVErrorFProc) (const char *,
+ va_list args)
+_X_ATTRIBUTE_PRINTF(1, 0);
#endif
extern _X_EXPORT int WaitForSomething(int * /*pClientsReady */
commit e59cc83bcdca6b64c1bfb2de395d741757f615f6
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date: Thu Oct 11 19:35:19 2012 +0100
hw/xwin: Use X_ATTRIBUTE_PRINTF where suggested for winmsg.c
winmsg.c: In function âwinVMsgâ:
winmsg.c:47:5: warning: function might be possible candidate for âgnu_printfâ format attribute [-Wmissing-format-attribute]
winmsg.c: In function âwinDrvMsgâ:
winmsg.c:56:5: warning: function might be possible candidate for âgnu_printfâ format attribute [-Wmissing-format-attribute]
winmsg.c: In function âwinMsgâ:
winmsg.c:66:5: warning: function might be possible candidate for âgnu_printfâ format attribute [-Wmissing-format-attribute]
winmsg.c: In function âwinDrvMsgVerbâ:
winmsg.c:77:5: warning: function might be possible candidate for âgnu_printfâ format attribute [-Wmissing-format-attribute]
winmsg.c: In function âwinMsgVerbâ:
winmsg.c:87:5: warning: function might be possible candidate for âgnu_printfâ format attribute [-Wmissing-format-attribute]
winmsg.c: In function âwinErrorFVerbâ:
winmsg.c:97:5: warning: function might be possible candidate for âgnu_printfâ format attribute [-Wmissing-format-attribute]
winmsg.c: In function âwinDebugâ:
winmsg.c:107:5: warning: function might be possible candidate for âgnu_printfâ format attribute [-Wmissing-format-attribute]
winmsg.c: In function âwinTraceâ:
winmsg.c:117:5: warning: function might be possible candidate for âgnu_printfâ format attribute [-Wmissing-format-attribute]
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
diff --git a/hw/xwin/winmsg.c b/hw/xwin/winmsg.c
index 07c2f30..57c1d18 100644
--- a/hw/xwin/winmsg.c
+++ b/hw/xwin/winmsg.c
@@ -38,7 +38,9 @@
#endif
#include <stdarg.h>
-void winVMsg(int, MessageType, int verb, const char *, va_list);
+void
+winVMsg(int, MessageType, int verb, const char *, va_list)
+_X_ATTRIBUTE_PRINTF(4, 0);
void
winVMsg(int scrnIndex, MessageType type, int verb, const char *format,
diff --git a/hw/xwin/winmsg.h b/hw/xwin/winmsg.h
index ec285ba..b638f2c 100644
--- a/hw/xwin/winmsg.h
+++ b/hw/xwin/winmsg.h
@@ -34,15 +34,29 @@
* Function prototypes
*/
-void winDrvMsgVerb(int scrnIndex,
- MessageType type, int verb, const char *format, ...);
-void winDrvMsg(int scrnIndex, MessageType type, const char *format, ...);
-void winMsgVerb(MessageType type, int verb, const char *format, ...);
-void winMsg(MessageType type, const char *format, ...);
-void winDebug(const char *format, ...);
-void winTrace(const char *format, ...);
+void
+winDrvMsgVerb(int scrnIndex,
+ MessageType type, int verb, const char *format, ...)
+_X_ATTRIBUTE_PRINTF(4, 5);
+void
+winDrvMsg(int scrnIndex, MessageType type, const char *format, ...)
+_X_ATTRIBUTE_PRINTF(3, 4);
+void
+winMsgVerb(MessageType type, int verb, const char *format, ...)
+_X_ATTRIBUTE_PRINTF(3, 4);
+void
+winMsg(MessageType type, const char *format, ...)
+_X_ATTRIBUTE_PRINTF(2, 3);
+void
+winDebug(const char *format, ...)
+_X_ATTRIBUTE_PRINTF(1, 2);
+void
+winTrace(const char *format, ...)
+_X_ATTRIBUTE_PRINTF(1, 2);
-void winErrorFVerb(int verb, const char *format, ...);
+void
+winErrorFVerb(int verb, const char *format, ...)
+_X_ATTRIBUTE_PRINTF(2, 3);
void winW32Error(int verb, const char *message);
void winW32ErrorEx(int verb, const char *message, DWORD errorcode);
void winDebugWin32Message(const char *function, HWND hwnd, UINT message,
commit 3d6e6a394ea2d5dcb77aa706f751423315d8a7ed
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date: Thu Oct 11 19:32:24 2012 +0100
hw/xwin: Use X_ATTRIBUTE_PRINTF where suggested for winerror.c
Also, fix the typoed name OsVenderVErrorF (sic), so it actually gets prototyped
and remove redundant declarations of it's prototype.
winerror.c: In function âOsVendorVErrorFâ:
winerror.c:56:5: warning: function might be possible candidate for âgnu_printfâ format attribute [-Wmissing-format-attribute]
winerror.c: In function âwinMessageBoxFâ:
winerror.c:104:5: warning: function might be possible candidate for âgnu_printfâ format attribute [-Wmissing-format-attribute]
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index 14ce852..4bcd3a0 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -77,11 +77,6 @@ static void
winClipboardShutdown(void);
#endif
-#if defined(DDXOSVERRORF)
-void
- OsVendorVErrorF(const char *pszFormat, va_list va_args);
-#endif
-
static Bool
winCheckDisplayNumber(void);
diff --git a/hw/xwin/win.h b/hw/xwin/win.h
index e632c79..7b34e84 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -857,11 +857,13 @@ void
#ifdef DDXOSVERRORF
void
- OSVenderVErrorF(const char *pszFormat, va_list va_args);
+OsVendorVErrorF(const char *pszFormat, va_list va_args)
+_X_ATTRIBUTE_PRINTF(1, 0);
#endif
void
- winMessageBoxF(const char *pszError, UINT uType, ...);
+winMessageBoxF(const char *pszError, UINT uType, ...)
+_X_ATTRIBUTE_PRINTF(1, 3);
#ifdef XWIN_NATIVEGDI
/*
diff --git a/hw/xwin/winerror.c b/hw/xwin/winerror.c
index 56c1e34..6645469 100644
--- a/hw/xwin/winerror.c
+++ b/hw/xwin/winerror.c
@@ -36,10 +36,6 @@
#include "win.h"
#ifdef DDXOSVERRORF
-/* Prototype */
-void
- OsVendorVErrorF(const char *pszFormat, va_list va_args);
-
void
OsVendorVErrorF(const char *pszFormat, va_list va_args)
{
diff --git a/hw/xwin/winprocarg.c b/hw/xwin/winprocarg.c
index a5b3c07..14056fa 100644
--- a/hw/xwin/winprocarg.c
+++ b/hw/xwin/winprocarg.c
@@ -56,10 +56,6 @@ void
void
winLogVersionInfo(void);
-#ifdef DDXOSVERRORF
-void OsVendorVErrorF(const char *pszFormat, va_list va_args);
-#endif
-
/*
* Process arguments on the command line
*/
commit 13fb6b36b8742a79b9768944eee6d1ad66d7e4d9
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date: Thu Oct 11 16:20:35 2012 +0100
hw/xwin: Use char strings in winClipboardUNIXtoDOS for consistency with the rest of the clipboard code
winclipboardxevents.c: In function âwinClipboardFlushXEventsâ:
winclipboardxevents.c:575:13: warning: passing argument 1 of âwinClipboardUNIXtoDOSâ from incompatible pointer type
winclipboard.h:102:2: note: expected âunsigned char **â but argument is of type âchar **â
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
diff --git a/hw/xwin/winclipboard.h b/hw/xwin/winclipboard.h
index 40da551..2cd775d 100644
--- a/hw/xwin/winclipboard.h
+++ b/hw/xwin/winclipboard.h
@@ -99,7 +99,7 @@ void
winClipboardDOStoUNIX(char *pszData, int iLength);
void
- winClipboardUNIXtoDOS(unsigned char **ppszData, int iLength);
+ winClipboardUNIXtoDOS(char **ppszData, int iLength);
/*
* winclipboardthread.c
diff --git a/hw/xwin/winclipboardtextconv.c b/hw/xwin/winclipboardtextconv.c
index 74a351b..fd405a0 100644
--- a/hw/xwin/winclipboardtextconv.c
+++ b/hw/xwin/winclipboardtextconv.c
@@ -38,7 +38,7 @@
void
winClipboardDOStoUNIX(char *pszSrc, int iLength);
void
- winClipboardUNIXtoDOS(unsigned char **ppszData, int iLength);
+ winClipboardUNIXtoDOS(char **ppszData, int iLength);
/*
* Convert \r\n to \n
@@ -75,12 +75,12 @@ winClipboardDOStoUNIX(char *pszSrc, int iLength)
*/
void
-winClipboardUNIXtoDOS(unsigned char **ppszData, int iLength)
+winClipboardUNIXtoDOS(char **ppszData, int iLength)
{
int iNewlineCount = 0;
- unsigned char *pszSrc = *ppszData;
- unsigned char *pszEnd = pszSrc + iLength;
- unsigned char *pszDest = NULL, *pszDestBegin = NULL;
+ char *pszSrc = *ppszData;
+ char *pszEnd = pszSrc + iLength;
+ char *pszDest = NULL, *pszDestBegin = NULL;
winDebug("UNIXtoDOS () - Original data:'%s'\n", *ppszData);
commit fa36a7cd488e4f7fb91beed8a87764b8e0c1a72f
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date: Thu Oct 11 15:51:39 2012 +0100
hw/xwin: Fix warning about discarding const in initializing winKBLayouts
winlayouts.h:46:5: warning: initialization discards qualifiers from pointer target type
winlayouts.h:46:5: warning: initialization discards qualifiers from pointer target type
winlayouts.h:46:5: warning: initialization discards qualifiers from pointer target type
[repeated for each layout]
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
diff --git a/hw/xwin/winlayouts.h b/hw/xwin/winlayouts.h
index d8875ce..8b6b984 100644
--- a/hw/xwin/winlayouts.h
+++ b/hw/xwin/winlayouts.h
@@ -30,11 +30,11 @@
typedef struct {
unsigned int winlayout;
int winkbtype;
- char *xkbmodel;
- char *xkblayout;
- char *xkbvariant;
- char *xkboptions;
- char *layoutname;
+ const char *xkbmodel;
+ const char *xkblayout;
+ const char *xkbvariant;
+ const char *xkboptions;
+ const char *layoutname;
} WinKBLayoutRec, *WinKBLayoutPtr;
/*
commit 0ea65df8a5f97a6fe5225226493aa01380080d2f
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date: Thu Sep 27 17:23:43 2012 +0100
hw/xwin: Fix some of the warnings in generated gl wrapper code
Fix some of the warnings in generated gl wrapper code:
- glWinResolveHelper takes a const char * argument
- ensure formal parameter names don't collide with reserved names or shadow
global declarations (e.g. near, far, index (from string.h), remainder (from
math.h), pointer (from Xdefs.h) by postpending a '_'.
generated_gl_wrappers.c:13:3: warning: passing argument 2 of 'glWinResolveHelper' discards qualifiers from pointer target type
glwrap.c:70:1: note: expected 'char *' but argument is of type 'const char *'
[repeated many times]
generated_gl_wrappers.c: In function 'glVertexAttrib1dARBWrapper': generated_gl_wrappers.c:6884:47: warning: declaration of 'index' shadows a global declaration [-Wshadow]
generated_gl_wrappers.c:6886:3: warning: passing argument 2 of 'glWinResolveHelper' discards qualifiers from pointer target type
[repeated many times]
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
diff --git a/hw/xwin/glx/gen_gl_wrappers.py b/hw/xwin/glx/gen_gl_wrappers.py
index 15f7ef8..2273589 100755
--- a/hw/xwin/glx/gen_gl_wrappers.py
+++ b/hw/xwin/glx/gen_gl_wrappers.py
@@ -146,9 +146,8 @@ for line in glspec :
arglist_use = m1.group(2)
wrappers[function] = {}
- # near and far might be reserved words or macros so can't be used as formal parameter names
- arglist_use = arglist_use.replace('near','zNear')
- arglist_use = arglist_use.replace('far','zFar')
+ # ensure formal parameter names don't collide with reserved names or shadow global declarations
+ arglist_use = ',' .join([i.rstrip() + '_' for i in arglist_use.split(",")])
wrappers[function]['arglist_use'] = arglist_use
param_count = 0
@@ -217,9 +216,8 @@ for w in sorted(wrappers.keys()) :
if k.startswith('param') :
l = wrappers[w][k].split()
- # near and far might be reserved words or macros so can't be used as formal parameter names
- l[0] = l[0].replace('near','zNear')
- l[0] = l[0].replace('far','zFar')
+ # ensure formal parameter names don't collide with reserved names or shadow global declarations
+ l[0] = l[0] + '_'
if l[2] == 'in' :
if l[3] == 'array' :
diff --git a/hw/xwin/glx/glwrap.c b/hw/xwin/glx/glwrap.c
index 690b829..73cff3c 100644
--- a/hw/xwin/glx/glwrap.c
+++ b/hw/xwin/glx/glwrap.c
@@ -67,7 +67,7 @@ glWinCallDelta(void)
}
static PROC
-glWinResolveHelper(PROC * cache, char *symbol)
+glWinResolveHelper(PROC * cache, const char *symbol)
{
PROC proc = NULL;
commit f7f0739311927ad177dece7119272481b75b73b4
Author: Colin Harrison <colin.harrison at virgin.net>
Date: Tue Oct 19 23:42:53 2010 +0100
hw/xwin: Warning fix in ProcWindowsWMFrameSetTitle()
winwindowswm.c: In function âProcWindowsWMFrameSetTitleâ:
winwindowswm.c:514: error: pointer targets in passing argument 2 of âstrncpyâ differ in signedness
If you're going to stick random casts into your code, at least use the goddammed
right ones. :-)
Signed-off-by: Colin Harrison <colin.harrison at virgin.net>
Reviewed-by: Jon TURNEY <jon.turney at dronecode.org.uk>
diff --git a/hw/xwin/winwindowswm.c b/hw/xwin/winwindowswm.c
index 88c3757..01ae088 100644
--- a/hw/xwin/winwindowswm.c
+++ b/hw/xwin/winwindowswm.c
@@ -491,7 +491,7 @@ ProcWindowsWMFrameSetTitle(ClientPtr client)
#endif
title_bytes = malloc(title_length + 1);
- strncpy(title_bytes, (unsigned char *) &stuff[1], title_length);
+ strncpy(title_bytes, (char *) &stuff[1], title_length);
title_bytes[title_length] = '\0';
pRLWinPriv = (win32RootlessWindowPtr) RootlessFrameForWindow(pWin, FALSE);
commit 97c9ed026a7f7efe5fca02c188bcbdbcd7c594e9
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date: Wed Jan 25 19:01:55 2012 +0000
hw/xwin: Fix shadowed local variable i in HandleCustomWM_COMMAND()
Fix shadowed local variable i in HandleCustomWM_COMMAND()
Also, fds are meant to be representable as an int
winprefs.c: In function âHandleCustomWM_COMMANDâ:
winprefs.c:346:23: error: declaration of âiâ shadows a previous local
winprefs.c:322:7: error: shadowed declaration is here
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
diff --git a/hw/xwin/winprefs.c b/hw/xwin/winprefs.c
index 5d2512e..dbc5b52 100644
--- a/hw/xwin/winprefs.c
+++ b/hw/xwin/winprefs.c
@@ -327,12 +327,12 @@ HandleCustomWM_COMMAND(unsigned long hwndIn, int command)
case CMD_EXEC:
if (fork() == 0) {
struct rlimit rl;
- unsigned long i;
+ int fd;
/* Close any open descriptors except for STD* */
getrlimit(RLIMIT_NOFILE, &rl);
- for (i = STDERR_FILENO + 1; i < rl.rlim_cur; i++)
- close(i);
+ for (fd = STDERR_FILENO + 1; fd < rl.rlim_cur; fd++)
+ close(fd);
/* Disassociate any TTYs */
setsid();
commit b55d0b92fc536793a877f6073754801a7c3c2dd5
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date: Wed Jan 25 18:56:22 2012 +0000
hw/xwin: Fix shadowed local variables in winLoadCursor()
Move shadowed local variables x and y to the places they are used
wincursor.c: In function âwinLoadCursorâ:
wincursor.c:212:11: error: declaration of âxâ shadows a previous local
wincursor.c:166:7: error: shadowed declaration is here
wincursor.c:212:14: error: declaration of âyâ shadows a previous local
wincursor.c:166:10: error: shadowed declaration is here
wincursor.c:228:11: error: declaration of âxâ shadows a previous local
wincursor.c:166:7: error: shadowed declaration is here
wincursor.c:228:14: error: declaration of âyâ shadows a previous local
wincursor.c:166:10: error: shadowed declaration is here
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
diff --git a/hw/xwin/wincursor.c b/hw/xwin/wincursor.c
index b56104f..b5ea0db 100644
--- a/hw/xwin/wincursor.c
+++ b/hw/xwin/wincursor.c
@@ -158,7 +158,6 @@ winLoadCursor(ScreenPtr pScreen, CursorPtr pCursor, int screen)
HBITMAP hAnd, hXor;
ICONINFO ii;
unsigned char *pCur;
- int x, y;
unsigned char bit;
HDC hDC;
BITMAPV4HEADER bi;
@@ -262,6 +261,7 @@ winLoadCursor(ScreenPtr pScreen, CursorPtr pCursor, int screen)
sizeof(unsigned long));
if (lpBits) {
+ int y;
for (y = 0; y < nCY; y++) {
unsigned long *src, *dst;
@@ -305,6 +305,7 @@ winLoadCursor(ScreenPtr pScreen, CursorPtr pCursor, int screen)
pCur = (unsigned char *) lpBits;
if (lpBits) {
+ int x, y;
for (y = 0; y < pScreenPriv->cursor.sm_cy; y++) {
for (x = 0; x < pScreenPriv->cursor.sm_cx; x++) {
if (x >= nCX || y >= nCY) /* Outside of X11 icon bounds */
commit a8c9c3699e6dfde29eeec058d903740a499dcf3b
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date: Thu Oct 11 19:11:36 2012 +0100
hw/xwin/glx: Fix using Mask as a formal parameter shadows a global typedef of the same name
Fix using Mask as a formal parameter shadows the typedef of the same name from X.h
indirect.c: In function 'GetShift':
indirect.c:1629:14: warning: declaration of 'Mask' shadows a global declaration [-Wshadow]
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c
index 97b6045..c0069a2 100644
--- a/hw/xwin/glx/indirect.c
+++ b/hw/xwin/glx/indirect.c
@@ -1626,15 +1626,15 @@ glxWinCreateContext(__GLXscreen * screen,
*/
static int
-GetShift(int Mask)
+GetShift(int mask)
{
- int Shift = 0;
+ int shift = 0;
- while ((Mask &1) == 0) {
- Shift++;
- Mask >>=1;
+ while ((mask &1) == 0) {
+ shift++;
+ mask >>=1;
}
- return Shift;
+ return shift;
}
static int
commit 47df98c7851fd9e97a54f0b4950340506d4a9244
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date: Wed Jan 25 19:17:16 2012 +0000
hw/xwin: Fix using screenInfo as a formal parameter to InitOutput() shadows a global declaration
Using screenInfo as a formal parameter to InitOutput() shadows a global declaration of screenInfo.
Change the formal parameter name from screenInfo to pScreenInfo, as everywhere else uses.
InitOutput.c: In function âInitOutputâ:
InitOutput.c:891:25: error: declaration of âscreenInfoâ shadows a global declaration
../../include/scrnintstr.h:570:19: error: shadowed declaration is here
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index 23b53cf..14ce852 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -897,7 +897,7 @@ ddxUseMsg(void)
*/
void
-InitOutput(ScreenInfo * screenInfo, int argc, char *argv[])
+InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[])
{
int i;
@@ -940,15 +940,15 @@ InitOutput(ScreenInfo * screenInfo, int argc, char *argv[])
LoadPreferences();
/* Setup global screen info parameters */
- screenInfo->imageByteOrder = IMAGE_BYTE_ORDER;
- screenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD;
- screenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT;
- screenInfo->bitmapBitOrder = BITMAP_BIT_ORDER;
- screenInfo->numPixmapFormats = NUMFORMATS;
+ pScreenInfo->imageByteOrder = IMAGE_BYTE_ORDER;
+ pScreenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD;
+ pScreenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT;
+ pScreenInfo->bitmapBitOrder = BITMAP_BIT_ORDER;
+ pScreenInfo->numPixmapFormats = NUMFORMATS;
/* Describe how we want common pixmap formats padded */
for (i = 0; i < NUMFORMATS; i++) {
- screenInfo->formats[i] = g_PixmapFormats[i];
+ pScreenInfo->formats[i] = g_PixmapFormats[i];
}
/* Load pointers to DirectDraw functions */
commit 97e9c34687f7dc05ee0bdef097a19e7623fb59a3
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date: Wed Jan 25 19:07:49 2012 +0000
hw/xwin: Fix using menu as a formal parameter shadows a global variable of the same name
Using menu as a formal parameter shadows a global variable of the same name
winprefsyacc.y: In function âSetRootMenuâ:
winprefsyacc.y:286:20: error: declaration of âmenuâ shadows a global declaration
winprefsyacc.y:55:19: error: shadowed declaration is here
winprefsyacc.y: In function âSetDefaultSysMenuâ:
winprefsyacc.y:293:26: error: declaration of âmenuâ shadows a global declaration
winprefsyacc.y:55:19: error: shadowed declaration is here
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
diff --git a/hw/xwin/winprefsyacc.y b/hw/xwin/winprefsyacc.y
index 19c2f40..3b376b3 100644
--- a/hw/xwin/winprefsyacc.y
+++ b/hw/xwin/winprefsyacc.y
@@ -283,16 +283,16 @@ SetTrayIcon (char *fname)
}
static void
-SetRootMenu (char *menu)
+SetRootMenu (char *menuname)
{
- strncpy (pref.rootMenuName, menu, MENU_MAX);
+ strncpy (pref.rootMenuName, menuname, MENU_MAX);
pref.rootMenuName[MENU_MAX] = 0;
}
static void
-SetDefaultSysMenu (char *menu, int pos)
+SetDefaultSysMenu (char *menuname, int pos)
{
- strncpy (pref.defaultSysMenuName, menu, MENU_MAX);
+ strncpy (pref.defaultSysMenuName, menuname, MENU_MAX);
pref.defaultSysMenuName[MENU_MAX] = 0;
pref.defaultSysMenuPos = pos;
}
commit efe96a17bd741f222ccb226d306b5c1dc1f25ade
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date: Wed Jan 25 18:54:57 2012 +0000
hw/xwin: Fix using index as a formal parameter shadows index()
Using index as a formal parameter shadows index() from strings.h
winallpriv.c: In function âwinInitCmapPrivatesâ:
winallpriv.c:119:45: error: declaration of âindexâ shadows a global declaration
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
diff --git a/hw/xwin/winallpriv.c b/hw/xwin/winallpriv.c
index ea3126f..cc3b3d1 100644
--- a/hw/xwin/winallpriv.c
+++ b/hw/xwin/winallpriv.c
@@ -110,7 +110,7 @@ winAllocatePrivates(ScreenPtr pScreen)
*/
Bool
-winInitCmapPrivates(ColormapPtr pcmap, int index)
+winInitCmapPrivates(ColormapPtr pcmap, int i)
{
#if CYGDEBUG
winDebug("winInitCmapPrivates\n");
commit 451c5d9175cdeb36fd614502ff0317f968490dfc
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date: Wed Jan 25 19:09:12 2012 +0000
hw/xwin: Fix using index as a formal parameter in winscrinit.c shadows index()
Using index as a local variable shadows index() from strings.h
winscrinit.c: In function âwinFinishScreenInitFBâ:
winscrinit.c:274:28: error: declaration of âindexâ shadows a global declaration
winscrinit.c: In function âwinFinishScreenInitNativeGDIâ:
winscrinit.c:623:35: error: declaration of âindexâ shadows a global declaration
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c
index be25f12..639a99c 100644
--- a/hw/xwin/winscrinit.c
+++ b/hw/xwin/winscrinit.c
@@ -254,7 +254,7 @@ winCreateScreenResources(ScreenPtr pScreen)
/* See Porting Layer Definition - p. 20 */
Bool
-winFinishScreenInitFB(int index, ScreenPtr pScreen, int argc, char **argv)
+winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv)
{
winScreenPriv(pScreen);
winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo;
@@ -578,11 +578,11 @@ winFinishScreenInitFB(int index, ScreenPtr pScreen, int argc, char **argv)
/* See Porting Layer Definition - p. 20 */
Bool
-winFinishScreenInitNativeGDI(int index,
+winFinishScreenInitNativeGDI(int i,
ScreenPtr pScreen, int argc, char **argv)
{
winScreenPriv(pScreen);
- winScreenInfoPtr pScreenInfo = &g_ScreenInfo[index];
+ winScreenInfoPtr pScreenInfo = &g_ScreenInfo[i];
VisualPtr pVisuals = NULL;
DepthPtr pDepths = NULL;
VisualID rootVisual = 0;
commit 21faee4b383a12bef58f300b4ad1a3bd34d6de2d
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date: Wed Jan 25 19:05:42 2012 +0000
hw/xwin: Fix using index as a local variable shadows index()
Using index as a local variable shadows index() from strings.h
winprefs.c: In function âLoadImageCommaâ:
winprefs.c:574:7: error: declaration of âindexâ shadows a global declaration
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
diff --git a/hw/xwin/winprefs.c b/hw/xwin/winprefs.c
index 52d1bc1..5d2512e 100644
--- a/hw/xwin/winprefs.c
+++ b/hw/xwin/winprefs.c
@@ -535,21 +535,21 @@ static HICON
LoadImageComma(char *fname, int sx, int sy, int flags)
{
HICON hicon;
- int index;
+ int i;
char file[PATH_MAX + NAME_MAX + 2];
/* Some input error checking */
if (!fname || !fname[0])
return NULL;
- index = 0;
+ i = 0;
hicon = NULL;
if (fname[0] == ',') {
/* It's the XWIN.EXE resource they want */
- index = atoi(fname + 1);
+ i = atoi(fname + 1);
hicon = LoadImage(g_hInstance,
- MAKEINTRESOURCE(index), IMAGE_ICON, sx, sy, flags);
+ MAKEINTRESOURCE(i), IMAGE_ICON, sx, sy, flags);
}
else {
file[0] = 0;
@@ -566,8 +566,8 @@ LoadImageComma(char *fname, int sx, int sy, int flags)
/* Specified as <fname>,<index> */
*(strrchr(file, ',')) = 0; /* End string at comma */
- index = atoi(strrchr(fname, ',') + 1);
- hicon = ExtractIcon(g_hInstance, file, index);
+ i = atoi(strrchr(fname, ',') + 1);
+ hicon = ExtractIcon(g_hInstance, file, i);
}
else {
/* Just an .ico file... */
commit 2d9123fd0c89c1a72e7281e56985196bc53507bf
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date: Wed Jan 25 18:59:21 2012 +0000
hw/xwin: Fix using index as a formal parameter in winmonitors.c shadows index()
Fix using index as a local variable shadows global declaration of index() from strings.h
winmonitors.c: In function âQueryMonitorâ:
winmonitors.c:59:23: error: declaration of âindexâ shadows a global declaration
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
diff --git a/hw/xwin/winmonitors.c b/hw/xwin/winmonitors.c
index 76063d3..955fb92 100644
--- a/hw/xwin/winmonitors.c
+++ b/hw/xwin/winmonitors.c
@@ -59,13 +59,13 @@ getMonitorInfo(HMONITOR hMonitor, HDC hdc, LPRECT rect, LPARAM _data)
}
Bool
-QueryMonitor(int index, struct GetMonitorInfoData *data)
+QueryMonitor(int i, struct GetMonitorInfoData *data)
{
/* prepare data */
if (data == NULL)
return FALSE;
memset(data, 0, sizeof(*data));
- data->requestedMonitor = index;
+ data->requestedMonitor = i;
/* query information */
EnumDisplayMonitors(NULL, NULL, getMonitorInfo, (LPARAM) data);
commit 5b0435dbdaa47404629800e4e9c5a6952a7bb260
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date: Wed Jan 25 18:53:02 2012 +0000
hw/xwin: Fix using system as a local variable in winCheckMount() shadows system()
Using system as local variable in winCheckMount() shadows the global declaration of system() from stdlib.h
InitOutput.c: In function âwinCheckMountâ:
InitOutput.c:296:10: error: declaration of âsystemâ shadows a global declaration
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index 1cf0f02..23b53cf 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -299,11 +299,11 @@ winCheckMount(void)
}
while ((ent = getmntent(mnt)) != NULL) {
- BOOL system = (winCheckMntOpt(ent, "user") != NULL);
+ BOOL sys = (winCheckMntOpt(ent, "user") != NULL);
BOOL root = (strcmp(ent->mnt_dir, "/") == 0);
BOOL tmp = (strcmp(ent->mnt_dir, "/tmp") == 0);
- if (system) {
+ if (sys) {
if (root)
curlevel = sys_root;
else if (tmp)
commit 17d84c743d6b52f32c4ca0341aebaff972522945
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date: Wed Jan 25 17:18:12 2012 +0000
hw/xwin: Remove obsolete redundant declarations of winPushPixels()
winPushPixels() and winpushpxl.c was removed in it's entirety in commit
f31bd087e8a7f65cd588bd1d022bb18e72b2a60c "Death to mfb"
wingc.c:37:1: error: redundant redeclaration of âwinPushPixelsâ
win.h:1104:1: note: previous declaration of âwinPushPixelsâ was here
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
diff --git a/hw/xwin/win.h b/hw/xwin/win.h
index 08d0d3f..e632c79 100644
--- a/hw/xwin/win.h
+++ b/hw/xwin/win.h
@@ -1052,18 +1052,6 @@ void
winPolyLineNativeGDI(DrawablePtr pDrawable,
GCPtr pGC, int mode, int npt, DDXPointPtr ppt);
#endif
-
-#ifdef XWIN_NATIVEGDI
-/*
- * winpushpxl.c
- */
-
-void
-
-winPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDrawable,
- int dx, int dy, int xOrg, int yOrg);
-#endif
-
/*
* winscrinit.c
*/
diff --git a/hw/xwin/wingc.c b/hw/xwin/wingc.c
index 8b7c704..7ac305d 100644
--- a/hw/xwin/wingc.c
+++ b/hw/xwin/wingc.c
@@ -33,11 +33,6 @@
#endif
#include "win.h"
-void
-
-winPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDrawable, int dx,
- int dy, int xOrg, int yOrg);
-
/*
* Local prototypes
*/
commit f06b468d96afd323e28645dde44170ab367da4f1
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date: Wed Jan 25 17:09:18 2012 +0000
hw/xwin: Fix redundant declarations in winmultiwindowwm.c
winmultiwindowwm.c:139:14: error: redundant redeclaration of âdisplayâ
../../include/opaque.h:52:14: note: previous declaration of âdisplayâ was here
winmultiwindowwm.c:140:13: error: redundant redeclaration of âErrorFâ
../../include/os.h:558:13: note: previous declaration of âErrorFâ was here
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c
index ffb7c2d..8d55e01 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -132,13 +132,6 @@ typedef struct _XMsgProcArgRec {
} XMsgProcArgRec, *XMsgProcArgPtr;
/*
- * References to external symbols
- */
-
-extern char *display;
-extern void ErrorF(const char * /*f */ , ...);
-
-/*
* Prototypes for local functions
*/
commit 3e8269177ee01fe107830032b60a8d311d4b4b0e
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date: Wed Jan 25 17:08:17 2012 +0000
hw/xwin: Fix redundant declarations in winclipboardwrappers.c
Fix redundant declarations in winclipboardwrappers.c.
Also remove obsolete winProcQueryTree() prototype.
winclipboardwrappers.c:64:12: error: redundant redeclaration of âg_iNumScreensâ
winglobals.h:33:12: note: previous declaration of âg_iNumScreensâ was here
winclipboardwrappers.c:67:13: error: redundant redeclaration of âg_fXdmcpEnabledâ
winglobals.h:45:13: note: previous declaration of âg_fXdmcpEnabledâ was here
winclipboardwrappers.c:75:27: error: redundant redeclaration of âwinProcEstablishConnectionOrigâ
winglobals.h:66:27: note: previous declaration of âwinProcEstablishConnectionOrigâ was here
winclipboardwrappers.c:76:27: error: redundant redeclaration of âwinProcQueryTreeOrigâ
winglobals.h:67:27: note: previous declaration of âwinProcQueryTreeOrigâ was here
winclipboardwrappers.c:77:27: error: redundant redeclaration of âwinProcSetSelectionOwnerOrigâ
winglobals.h:68:27: note: previous declaration of âwinProcSetSelectionOwnerOrigâ was here
winclipboardwrappers.c:56:5: warning: redundant redeclaration of âwinProcEstablishConnectionâ [-Wredundant-decls]
winclipboardwrappers.c:52:5: note: previous declaration of âwinProcEstablishConnectionâ was here
winclipboardwrappers.c:57:5: warning: redundant redeclaration of âwinProcSetSelectionOwnerâ [-Wredundant-decls]
winclipboardwrappers.c:54:5: note: previous declaration of âwinProcSetSelectionOwnerâ was here
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
diff --git a/hw/xwin/winclipboardwrappers.c b/hw/xwin/winclipboardwrappers.c
index 1118f4f..008088b 100644
--- a/hw/xwin/winclipboardwrappers.c
+++ b/hw/xwin/winclipboardwrappers.c
@@ -49,10 +49,6 @@
* Local function prototypes
*/
-int winProcEstablishConnection(ClientPtr /* client */ );
-int winProcQueryTree(ClientPtr /* client */ );
-int winProcSetSelectionOwner(ClientPtr /* client */ );
-
DISPATCH_PROC(winProcEstablishConnection);
DISPATCH_PROC(winProcSetSelectionOwner);
@@ -60,10 +56,8 @@ DISPATCH_PROC(winProcSetSelectionOwner);
* References to external symbols
*/
-extern int g_iNumScreens;
extern unsigned int g_uiAuthDataLen;
extern char *g_pAuthData;
-extern Bool g_fXdmcpEnabled;
extern Bool g_fClipboardLaunched;
extern Bool g_fClipboardStarted;
extern Bool g_fClipboard;
@@ -71,9 +65,6 @@ extern Window g_iClipboardWindow;
extern Atom g_atomLastOwnedSelection;
extern HWND g_hwndClipboard;
-extern winDispatchProcPtr winProcEstablishConnectionOrig;
-extern winDispatchProcPtr winProcQueryTreeOrig;
-extern winDispatchProcPtr winProcSetSelectionOwnerOrig;
/*
* Wrapper for internal EstablishConnection function.
commit 0975fa0b391d7b8d7e8a127ebf7a863e53fcab7d
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date: Wed Jan 25 17:06:27 2012 +0000
hw/xwin: Fix redundant declaration in winclipboardthread.c
winclipboardthread.c:51:22: error: redundant redeclaration of âserverGenerationâ
../../include/misc.h:362:22: note: previous declaration of âserverGenerationâ was here
winclipboardthread.c: In function âwinClipboardProcâ:
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
diff --git a/hw/xwin/winclipboardthread.c b/hw/xwin/winclipboardthread.c
index f2e8e6d..4479b54 100644
--- a/hw/xwin/winclipboardthread.c
+++ b/hw/xwin/winclipboardthread.c
@@ -47,7 +47,6 @@
*/
extern Bool g_fUnicodeClipboard;
-extern unsigned long serverGeneration;
extern Bool g_fClipboardStarted;
extern Bool g_fClipboardLaunched;
extern Bool g_fClipboard;
commit 4a1da00c495706e0fbcec2b30aef3ad7acf5b703
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date: Wed Jan 25 17:05:25 2012 +0000
hw/xwin: Fix redundant declaration in winclipboardinit.c
In file included from winclipboardinit.c:35:0:
winclipboard.h:81:13: error: redundant redeclaration of âErrorFâ
../../include/os.h:558:13: note: previous declaration of âErrorFâ was here
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
diff --git a/hw/xwin/winclipboard.h b/hw/xwin/winclipboard.h
index 27eb2f9..40da551 100644
--- a/hw/xwin/winclipboard.h
+++ b/hw/xwin/winclipboard.h
@@ -79,7 +79,6 @@
*/
extern char *display;
-extern void ErrorF(const char * /*f */ , ...);
extern void winDebug(const char *format, ...);
extern void winErrorFVerb(int verb, const char *format, ...);
commit 30f31b80f0105676359105c895bc195b9f3e704c
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date: Wed Jan 25 16:48:45 2012 +0000
hw/xwin: Fix various warnings in code generated by lex/yacc
Remove various redundant declarations.
Instruct lex not to generate code which isn't going to be used, thus avoiding
some unused function warnings.
Note that bison <2.5 expects stdlib.h to define _STDLIB_H if it's been included,
and avoids prototyping free/malloc in that case. Some stdlib.h (e.g. newlib) may
not match precisely (e.g. defining _STDLIB_H_), so we define it after including
stdlib.h to be sure, and avoid a redudant declaration warning for those symbols.
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
diff --git a/hw/xwin/winprefslex.l b/hw/xwin/winprefslex.l
index ba8aea6..15f7077 100644
--- a/hw/xwin/winprefslex.l
+++ b/hw/xwin/winprefslex.l
@@ -37,14 +37,10 @@
#include <string.h>
#include "winprefsyacc.h"
-extern YYSTYPE yylval;
-extern char *yytext;
extern int yyparse(void);
extern void ErrorF (const char* /*f*/, ...);
-int yylineno;
-
/* Copy the parsed string, must be free()d in yacc parser */
static char *makestr(char *str)
{
@@ -62,6 +58,9 @@ static char *makestr(char *str)
%}
%option yylineno
+%option nounput
+%option noinput
+%option never-interactive
%%
\#.*[\r\n] { /* comment */ return NEWLINE; }
diff --git a/hw/xwin/winprefsyacc.y b/hw/xwin/winprefsyacc.y
index 0acf160..19c2f40 100644
--- a/hw/xwin/winprefsyacc.y
+++ b/hw/xwin/winprefsyacc.y
@@ -37,6 +37,7 @@
#endif
#include <stdio.h>
#include <stdlib.h>
+#define _STDLIB_H 1 /* bison checks this to know if stdlib has been included */
#include <string.h>
#include "winprefs.h"
@@ -80,7 +81,6 @@ static void CloseSysMenu(void);
static int yyerror (char *s);
-extern void ErrorF (const char* /*f*/, ...);
extern char *yytext;
extern int yylex(void);
commit 4231b9541c6fd26f43b605ecc9dd76622dd786f7
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date: Wed Jan 25 16:38:49 2012 +0000
hw/xwin: Fix redundant declaration in winprefs.c
winprefs.c:63:14: error: redundant redeclaration of âdisplayâ
../../include/opaque.h:52:14: note: previous declaration of âdisplayâ was here
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
diff --git a/hw/xwin/winprefs.c b/hw/xwin/winprefs.c
index faa97c3..52d1bc1 100644
--- a/hw/xwin/winprefs.c
+++ b/hw/xwin/winprefs.c
@@ -57,9 +57,6 @@ extern int parse_file(FILE * fp);
/* Currently in use command ID, incremented each new menu item created */
static int g_cmdid = STARTMENUID;
-/* Defined in DIX */
-extern char *display;
-
/* Local function to handle comma-ified icon names */
static HICON LoadImageComma(char *fname, int sx, int sy, int flags);
commit 70087c55fffc3cbc52f550418e6b1230bbb1b3b3
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date: Wed Jan 25 16:36:40 2012 +0000
hw/xwin: Fix redundant declaration warnings in winmonitors.c
Include xwin-config.h so HAVE_STRLCPY and HAVE_STRNDUP are defined, so
duplicate declarations of strlcpy(), strlcat() and strndup() aren't made
by os.h
In file included from ../../include/misc.h:111:0,
from ../../include/screenint.h:51,
from ../../include/scrnintstr.h:51,
from win.h:157,
from winmonitors.c:31:
../../include/os.h:491:15: error: redundant redeclaration of âstrlcpyâ
/usr/include/string.h:86:35: note: previous declaration of âstrlcpyâ was here
../../include/os.h:492:15: error: redundant redeclaration of âstrlcatâ
/usr/include/string.h:85:35: note: previous declaration of âstrlcatâ was here
../../include/os.h:496:15: error: redundant redeclaration of âstrndupâ
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
diff --git a/hw/xwin/winmonitors.c b/hw/xwin/winmonitors.c
index 07532f6..76063d3 100644
--- a/hw/xwin/winmonitors.c
+++ b/hw/xwin/winmonitors.c
@@ -27,6 +27,10 @@ from The Open Group.
*/
+#ifdef HAVE_XWIN_CONFIG_H
+#include <xwin-config.h>
+#endif
+
#include "win.h"
#include "winmonitors.h"
commit 9904c8fe75c96cf84d8885aa95f2743c1b25ea37
Author: Jon TURNEY <jon.turney at dronecode.org.uk>
Date: Wed Jan 25 16:09:59 2012 +0000
hw/xwin: Remove completely unused winregistry.c
Signed-off-by: Jon TURNEY <jon.turney at dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison at virgin.net>
diff --git a/hw/xwin/Makefile.am b/hw/xwin/Makefile.am
index 33729a9..99dc556 100644
--- a/hw/xwin/Makefile.am
+++ b/hw/xwin/Makefile.am
@@ -95,7 +95,6 @@ SRCS = InitInput.c \
winprefsyacc.y \
winprefslex.l \
winprocarg.c \
- winregistry.c \
winscrinit.c \
winshaddd.c \
winshadddnl.c \
diff --git a/hw/xwin/winregistry.c b/hw/xwin/winregistry.c
deleted file mode 100644
index d33f8c3..0000000
--- a/hw/xwin/winregistry.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- *Copyright (C) 2002-2004 Harold L Hunt II All Rights Reserved.
- *
- *Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- *"Software"), to deal in the Software without restriction, including
- *without limitation the rights to use, copy, modify, merge, publish,
- *distribute, sublicense, and/or sell copies of the Software, and to
- *permit persons to whom the Software is furnished to do so, subject to
- *the following conditions:
- *
- *The above copyright notice and this permission notice shall be
- *included in all copies or substantial portions of the Software.
- *
- *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- *NONINFRINGEMENT. IN NO EVENT SHALL HAROLD L HUNT II BE LIABLE FOR
- *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
- *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- *Except as contained in this notice, the name of Harold L Hunt II
- *shall not be used in advertising or otherwise to promote the sale, use
- *or other dealings in this Software without prior written authorization
- *from Harold L Hunt II.
- *
- * Authors: Harold L Hunt II
- */
-
-#ifdef HAVE_XWIN_CONFIG_H
-#include <xwin-config.h>
-#endif
-#include "win.h"
-
-/* Prototypes */
-DWORD winGetRegistryDWORD(HKEY hkey, char *pszRegistryKey);
-
-DWORD
-winGetRegistryDWORD(HKEY hkey, char *pszRegistryKey)
-{
- HKEY hkResult;
- DWORD dwDisposition;
-
- RegCreateKeyEx(hkey,
- pszRegistryKey,
- 0,
- '\0',
- REG_OPTION_NON_VOLATILE,
- KEY_READ, NULL, &hkResult, &dwDisposition);
-
- if (dwDisposition == REG_CREATED_NEW_KEY) {
- ErrorF("winGetRegistryDWORD - Created new key: %s\n", pszRegistryKey);
- }
- else if (dwDisposition == REG_OPENED_EXISTING_KEY) {
- ErrorF("winGetRegistryDWORD - Opened existing key: %s\n",
- pszRegistryKey);
- }
-
- /* Free the registry key handle */
- RegCloseKey(hkResult);
- hkResult = NULL;
-
- return 0;
-}
More information about the xorg-commit
mailing list