Re: [PATCH] More cleanup + bugfixes
Re: [PATCH] More cleanup + bugfixes
- Subject: Re: [PATCH] More cleanup + bugfixes
- From: Ben Byer <email@hidden>
- Date: Fri, 16 Nov 2007 02:42:07 -0800
Great! I'm trying to rewrite the modifier stuff (!) tonight, and then
I'll commit these and look over the points you mentioned. -b
On Nov 16, 2007, at 12:09 AM, Jeremy Huddleston wrote:
Here's another patch to further the codebase cleanup.
1) Fixed a bug where XQUARTZ was #defined when auto but not when --
enable-xquartz
2) Cleaned up missing #includes and function prototypes.
3) Fixed some invalid C syntax problems
4) Removed a bunch of dead code
5) Cleaned up code to prevent some warnings
6) Bugfix in xpr/x-hook.c - looks like someone just forgot to finish
writing code for hook_remove()... I only noticed it because gcc -
Wall complained about reaching the end of a non-void function...
lucky for us gcc is smarter than we are.
http://cloud.cs.berkeley.edu/~jeremy/X11/X11-XDarwin-Cleanup.patch
There are two compile warnings remaining that actually concern me as
potentially bug-causing, but I haven't looked into them enough to
fix them. Here they are if someone cares to investigate:
quartz.c: In function ‘DarwinModeInitOutput’:
quartz.c:168: warning: passing argument 1 of
‘RegisterBlockAndWakeupHandlers’ from incompatible pointer type
quartz.c: In function ‘DarwinModeProcessEvent’:
quartz.c:467: warning: passing argument 1 of
‘RootlessNativeWindowMoved’ makes pointer from integer without a cast
---
The RegisterBlockAndWakeupHandlers warning is weird. Here's the
offending call:
if (!RegisterBlockAndWakeupHandlers(QuartzBlockHandler,
QuartzWakeupHandler,
NULL))
Looking at include/scrnintstr.h, we see the types need to be:
typedef void (* ScreenBlockHandlerProcPtr)(
int /*screenNum*/,
pointer /*blockData*/,
pointer /*pTimeout*/,
pointer /*pReadmask*/);
typedef void (* ScreenWakeupHandlerProcPtr)(
int /*screenNum*/,
pointer /*wakeupData*/,
unsigned long /*result*/,
pointer /*pReadMask*/);
but BOTH are the wrong type as we look in quartzCommon.h:
void QuartzBlockHandler(void *blockData, void *pTimeout, void
*pReadmask);
void QuartzWakeupHandler(void *blockData, int result, void
*pReadmask);
They don't have ScreenNum. Changing the prototypes to match
scrnintstr.h (by adding int as the first arg and changing int result
to unsigned in wakeup) causes the compiler to complain about BOTH
arguments. I am befuddled and give up for now.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden
Ben Byer
CoreOS / BSD Technology Group, XDarwin maintainer
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden