diff options
author | Keith Packard <keithp@keithp.com> | 2012-03-21 12:55:09 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2012-03-21 13:54:42 -0700 |
commit | 9838b7032ea9792bec21af424c53c07078636d21 (patch) | |
tree | b72d0827dac50f0f3b8eab29b3b7639546d735d7 /test/xi2/protocol-xiwarppointer.c | |
parent | 75199129c603fc8567185ac31866c9518193cb78 (diff) |
Introduce a consistent coding style
This is strictly the application of the script 'x-indent-all.sh'
from util/modular. Compared to the patch that Daniel posted in
January, I've added a few indent flags:
-bap
-psl
-T PrivatePtr
-T pmWait
-T _XFUNCPROTOBEGIN
-T _XFUNCPROTOEND
-T _X_EXPORT
The typedefs were needed to make the output of sdksyms.sh match the
previous output, otherwise, the code is formatted badly enough that
sdksyms.sh generates incorrect output.
The generated code was compared with the previous version and found to
be essentially identical -- "assert" line numbers and BUILD_TIME were
the only differences found.
The comparison was done with this script:
dir1=$1
dir2=$2
for dir in $dir1 $dir2; do
(cd $dir && find . -name '*.o' | while read file; do
dir=`dirname $file`
base=`basename $file .o`
dump=$dir/$base.dump
objdump -d $file > $dump
done)
done
find $dir1 -name '*.dump' | while read dump; do
otherdump=`echo $dump | sed "s;$dir1;$dir2;"`
diff -u $dump $otherdump
done
Signed-off-by: Keith Packard <keithp@keithp.com>
Acked-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'test/xi2/protocol-xiwarppointer.c')
-rw-r--r-- | test/xi2/protocol-xiwarppointer.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/test/xi2/protocol-xiwarppointer.c b/test/xi2/protocol-xiwarppointer.c index 2b40f63f9..c279ac413 100644 --- a/test/xi2/protocol-xiwarppointer.c +++ b/test/xi2/protocol-xiwarppointer.c @@ -48,14 +48,14 @@ static int expected_y = SPRITE_Y; * fake client window. If the requested ID is neither of those wanted, * return whatever the real dixLookupWindow does. */ -int __wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access) +int +__wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access) { - if (id == root.drawable.id) - { + if (id == root.drawable.id) { *win = &root; return Success; - } else if (id == window.drawable.id) - { + } + else if (id == window.drawable.id) { *win = &window; return Success; } @@ -66,17 +66,17 @@ int __wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access /** * This function overrides the one in the screen rec. */ -static Bool ScreenSetCursorPosition(DeviceIntPtr dev, ScreenPtr screen, - int x, int y, Bool generateEvent) +static Bool +ScreenSetCursorPosition(DeviceIntPtr dev, ScreenPtr screen, + int x, int y, Bool generateEvent) { assert(x == expected_x); assert(y == expected_y); return TRUE; } - -static void request_XIWarpPointer(ClientPtr client, xXIWarpPointerReq* req, - int error) +static void +request_XIWarpPointer(ClientPtr client, xXIWarpPointerReq * req, int error) { int rc; @@ -87,8 +87,7 @@ static void request_XIWarpPointer(ClientPtr client, xXIWarpPointerReq* req, assert(client->errorValue == req->deviceid); else if (rc == BadWindow) assert(client->errorValue == req->dst_win || - client->errorValue == req->src_win); - + client->errorValue == req->src_win); client->swapped = TRUE; @@ -109,12 +108,13 @@ static void request_XIWarpPointer(ClientPtr client, xXIWarpPointerReq* req, assert(client->errorValue == req->deviceid); else if (rc == BadWindow) assert(client->errorValue == req->dst_win || - client->errorValue == req->src_win); + client->errorValue == req->src_win); client->swapped = FALSE; } -static void test_XIWarpPointer(void) +static void +test_XIWarpPointer(void) { int i; ClientRec client_request; @@ -143,12 +143,11 @@ static void test_XIWarpPointer(void) request.deviceid = devices.kbd->id; request_XIWarpPointer(&client_request, &request, BadDevice); - devices.mouse->master = NULL; /* Float, kind-of */ + devices.mouse->master = NULL; /* Float, kind-of */ request.deviceid = devices.mouse->id; request_XIWarpPointer(&client_request, &request, Success); - for (i = devices.kbd->id + 1; i <= 0xFFFF; i++) - { + for (i = devices.kbd->id + 1; i <= 0xFFFF; i++) { request.deviceid = i; request_XIWarpPointer(&client_request, &request, BadDevice); } @@ -161,10 +160,10 @@ static void test_XIWarpPointer(void) request_XIWarpPointer(&client_request, &request, Success); request.src_win = root.drawable.id; - request.dst_win = 0xFFFF; /* invalid window */ + request.dst_win = 0xFFFF; /* invalid window */ request_XIWarpPointer(&client_request, &request, BadWindow); - request.src_win = 0xFFFF; /* invalid window */ + request.src_win = 0xFFFF; /* invalid window */ request.dst_win = root.drawable.id; request_XIWarpPointer(&client_request, &request, BadWindow); @@ -200,7 +199,8 @@ static void test_XIWarpPointer(void) /* FIXME: src_x/y checks */ } -int main(int argc, char** argv) +int +main(int argc, char **argv) { init_simple(); screen.SetCursorPosition = ScreenSetCursorPosition; |