Commit Graph

6 Commits

Author SHA1 Message Date
Peter Harris 5eb77697ea Avoid starting a comment with */*
Even though -Wcomment doesn't mind it (in gcc or clang), the appearance
of */* confuses the syntax highlighter of some editors (eg. vim), and
causes warnings in MSVC.

Signed-off-by: Peter Harris <pharris@opentext.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-07-17 10:19:52 -07:00
Keith Packard 60014a4a98 Replace 'pointer' type with 'void *'
This lets us stop using the 'pointer' typedef in Xdefs.h as 'pointer'
is used throughout the X server for other things, and having duplicate
names generates compiler warnings.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-12 10:24:11 -08:00
Peter Hutterer ddc11397a5 dix: delete all callbacks before reset
DeleteCallbackManager() introduced for better symmetry in the caller, they
do the same thing.

==20085== 24 bytes in 1 blocks are still reachable in loss record 11 of 103
==20085==    at 0x4C2A4CD: malloc (vg_replace_malloc.c:236)
==20085==    by 0x43A097: CreateCallbackList (dixutils.c:837)
==20085==    by 0x43A1D3: AddCallback (dixutils.c:869)
==20085==    by 0x4B1736: GEExtensionInit (geext.c:209)
==20085==    by 0x41C8A8: InitExtensions (miinitext.c:389)
==20085==    by 0x5AC918: main (main.c:208)

==2042== 8 bytes in 1 blocks are still reachable in loss record 2 of 97
==2042==    at 0x4C2A4CD: malloc (vg_replace_malloc.c:236)
==2042==    by 0x4C2A657: realloc (vg_replace_malloc.c:525)
==2042==    by 0x4802F5: XNFrealloc (utils.c:1095)
==2042==    by 0x43A17A: CreateCallbackList (dixutils.c:855)
==2042==    by 0x43A1EF: AddCallback (dixutils.c:870)
==2042==    by 0x4B1752: GEExtensionInit (geext.c:209)
==2042==    by 0x41C8A8: InitExtensions (miinitext.c:389)
==2042==    by 0x5AC9E4: main (main.c:208)
==2042==

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2013-05-08 09:27:30 +10:00
Keith Packard 9838b7032e 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>
2012-03-21 13:54:42 -07:00
Adam Jackson 6274dca9d9 dix: optimize CallCallbacks
Move the basic sanity checking to an inline wrapper, which avoids the
function call overhead if the callback list is empty.  On an XACEful
server on a 2.4GHz Core 2 Duo:

    1              2           Operation
--------   -----------------   -----------------
20000000.0   25100000.0 (  1.25)   X protocol NoOperation

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2010-10-13 09:24:06 -07:00
Keith Packard 998e982b77 Move callback definitions to their own file
Needed as the privates stuff uses the callbacks before they would have
been defined in dix.h

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
2010-04-30 13:04:44 -07:00