Commit Graph

13806 Commits

Author SHA1 Message Date
Eric Anholt
d84d71029a glamor: Apply x-indent.sh.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-01-27 09:30:47 -08:00
Eric Anholt
e8e9a54c47 glamor: Touch up some code so indent doesn't get confused.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-01-27 09:30:47 -08:00
Alan Coopersmith
9fc19168e7 Check for calloc() failure in add_master()
Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-01-25 18:54:16 +10:00
Peter Hutterer
76b3be75b6 Xi: fix modifier offset in XIPassiveGrab swapping function
The request is followed by mask_len 4-byte units, then followed by the actual
modifiers.

Also fix up the swapping test, which had the same issue.

Reported-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-01-25 18:54:16 +10:00
Keith Packard
c1ce807d9f dix: Praise clients which haven't run for a while, rather than idle clients
A client which is ready, but hasn't run for a while, should receive
the same benefit as one which has simply been idle for a while. Use
the smart_stop_tick to see how long it has been since a client has
run instead of smart_check_tick, which got reset each time a client
was ready, even if it didn't get to run.

Reported-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Keith Packard <keithp@keithp.com>
Tested-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-23 10:10:28 -08:00
Keith Packard
76b275d7ac test/signal-formatting: Ignore compiler warnings
The signal formatting tests intentionally include code which generates
warnings with the current X server warning flags. Turn the compiler
warnings off

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-22 19:56:32 -08:00
Keith Packard
12ea817928 test/hashtabletest: Clean up -Wshadow errors
Declare 'XID id' local to each scope it is used in, rather than having
the first use be a function-wide declaration.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-22 19:56:32 -08:00
Keith Packard
7104f0f338 test/xi2: Clean up -Wshadow warnings
protocol-common declares a bunch of pretty generic names; fix shadows
of these names.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-22 19:56:32 -08:00
Keith Packard
92a9495800 kdrive/ephyr: Remove extra 'i' variable in ProcXF86DRIGetDrawableInfo
Just re-use the top-level one

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-22 19:56:32 -08:00
Keith Packard
9888770654 randr: Eliminate -Wshadow warnings
Don't use rrScrPriv for nested screen private fetching.

Eliminate a duplicate fetch of the randr screen private in rrCheckPixmapBounding.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-22 19:56:32 -08:00
Keith Packard
f46c487625 hw/xnest: Eliminate shadowed names
Just rename stuff; nothing fancy here.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-22 19:56:32 -08:00
Keith Packard
1f3676a81e hw/vfb: Rename screenInfo parameter to screen_info
Avoid shadowing the global screenInfo value.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-22 19:56:32 -08:00
Keith Packard
89c0fa3d6c kdrive: Fix -Wshadow errors
Just rename stuff to avoid conflicts.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-22 19:56:32 -08:00
Keith Packard
9c108b3ccd exa: Fix -Wshadow warnings
In exa_accel, there was a duplicate fetch of a pixmap private field.

exa_render just had a regular shadowed value.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-22 19:56:32 -08:00
Keith Packard
04e320a4e4 composite: Remove duplicate window pixmap fetch
There's nothing between the previous fetch and this one that could
cause the window pixmap to have changed.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-22 19:56:32 -08:00
Keith Packard
07b03e721e xfree86: Fix -Wshadow warnings
Just rename variables to eliminate -Wshadow warnings.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-22 19:56:31 -08:00
Keith Packard
3c94b89f14 Xi: Use 'void *' instead of 'Pointer' (which is going away)
There's no reason for XI to declare 'typedef char *Pointer' in a
shared header file; assume it will eventually go away and stop using
it here.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-22 19:56:31 -08:00
Keith Packard
08d0481e29 os: Fix -Wshadow errors
Rename variables to avoid shadowing globals

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-22 19:56:31 -08:00
Keith Packard
1487145b41 Add 'FONT_PATH_NAME_ELEMENT_CONST' to dix-config.h and xorg-server.h
This signals to the fontsproto code that the X server has been fixed
to allow the name member in a FontPathElement struct to be declared
const to eliminate piles of warnings when assigning string constants
to them.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-22 19:56:31 -08:00
Keith Packard
1ad8d12e7f Ignore a couple of format-nonliteral warnings
These are generated in code which uses sprintf as a convenient way to
construct strings from various pieces.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-22 19:56:31 -08:00
Keith Packard
9ef53e2267 include: GetClientResolutions is declared in font.h
No need to have a duplicate definition here.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-22 19:56:31 -08:00
Keith Packard
25ebb9dbc9 Merge remote-tracking branch 'whot/for-keith' 2014-01-22 11:33:53 -08:00
Keith Packard
409e8e29fb Merge remote-tracking branch 'dlespiau/20131216-4k' 2014-01-22 11:32:35 -08:00
Alan Coopersmith
457bc83549 If EAGAIN == EWOULDBLOCK, only need to check errno for one of them
Solaris <sys/errno.h> has:
 #define EWOULDBLOCK       EAGAIN
so checking (errno == EAGAIN || errno == EWOULDBLOCK) is overkill.

This leads cppcheck 1.62 to complain:
[xserver/os/io.c:365] -> [xserver/os/io.c:365]: (style) Same expression on both sides of '||'.
[xserver/os/io.c:941] -> [xserver/os/io.c:941]: (style) Same expression on both sides of '||'.

This quiets it, and reduces the number of calls Solaris Studio cc
generates to the __errno() function to get the thread-specific errno value.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-01-22 11:30:27 -08:00
Keith Packard
044a6ef2ff Merge remote-tracking branch 'jeremyhu/master' 2014-01-22 11:28:54 -08:00
Keith Packard
0b932cf47a Merge remote-tracking branch 'anholt/xserver-unifdef' 2014-01-22 11:27:36 -08:00
Keith Packard
1d76b02fac Merge remote-tracking branch 'anholt/glamor-external-rebase' 2014-01-22 11:22:35 -08:00
Gaetan Nadon
771f390efd autoconf: fix warning by replacing AC_WARN with AC_MSG_WARN
A warning about the macro generating the warnings to the user...

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-01-22 11:18:44 -08:00
Gaetan Nadon
c3819da87f xorg-tls: fix warning, replace AC_TRY_COMPILE with AC_COMPILE_IFELSE
The code produced in the configure script is identical.

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-01-22 11:18:42 -08:00
Gaetan Nadon
02d866a088 autoconf: fix warning, replace AC_TRY_COMPILE with AC_COMPILE_IFELSE
The code produced in the configure script is identical.

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-01-22 11:18:41 -08:00
Gaetan Nadon
e38c98fe74 autoconf: fix warning, replace AC_TRY_LINK with AC_LINK_IFELSE
The code produced in the configure script is identical.

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-01-22 11:18:37 -08:00
Gaetan Nadon
4993590c90 autoconf: fix warning by replacing deprecated AC_HELP_STRING
We can also make do without the workaround introduced in 2005.
The 2.60 autoconf minimum version covers that now.

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-01-22 11:18:17 -08:00
Gaetan Nadon
1d4dbc2f2b libtool: bump minimum required version to 2.2
LT_PREREQ([2.2])
LT_INIT

AC_CONFIG_MACRO_DIR([m4]) is recommended to locate local macros,
which is fully used starting automake 1.14.

ACLOCAL_AMFLAGS in Makefile.am is deprecated since automake 1.14.
The comment is to prevent developers from removing the statement
as suggested in 1.14 which would break earlier versions.

Automake 1.14 is already in use by many.
This patch works on versions prior and post 1.14

References:
Building the X Window System from Source:
http://www.x.org/wiki/Building_the_X_Window_System/#index2h3

Discussion on xorg minimum autotools requirements:
http://lists.x.org/archives/xorg-devel/2013-October/038325.html

Tested with autoconf 2.60, automake 1.10.3 and libtool 2.2

The same upgrade will be applied to libraries and drivers.

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2014-01-22 11:05:30 -08:00
Peter Hutterer
71baa466b1 os: restrict display names to digits
We call atoi() on the server's display to get the socket but otherwise use the
unmodified display for log file name, xkb paths, etc. This results in
Xorg :banana being the equivalent of Xorg :0, except for the log files being
in /var/log/Xorg.banana.log. I'm not sure there's a good use-case for this
behaviour.

Check the display for something that looks reasonable, i.e. digits only, but
do allow for :0.0 (i.e. digits, followed by a period, followed by one or two
digits).

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
2014-01-15 08:09:47 +10:00
Jeremy Huddleston Sequoia
77df653ae3 XQuartz: Avoid passing uninitialized pointers to X11ApplicationSetWindowMenu in AppleWMSetWindowMenu
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2014-01-12 23:12:49 -08:00
Jeremy Huddleston Sequoia
3bc608a361 XQuartz: Check for allocated memory before using it in AppleWMSetWindowMenu
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2014-01-12 23:12:48 -08:00
Jeremy Huddleston Sequoia
64327226dd XQuartz: Silence a clang static analysis warning about a memory leak
It seems the alanyzer can't comprehend dixSetPrivate().

quartz.c:119:12: warning: Potential leak of memory pointed to by 'displayInfo'
    return quartzProcs->AddScreen(index, pScreen);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2014-01-12 23:12:48 -08:00
Jeremy Huddleston Sequoia
b2f6b3497c XQuartz: Silence a clang static analysis warning about a possible memory leak on exit
stub.c:356:9: warning: Potential leak of memory pointed to by 'newargv'
        asl_log(aslc, NULL, ASL_LEVEL_ERR,
        ^~~~~~~
stub.c:356:9: warning: Potential leak of memory pointed to by 'newenvp'
        asl_log(aslc, NULL, ASL_LEVEL_ERR,
        ^~~~~~~
2 warnings generated.

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2014-01-12 23:12:48 -08:00
Jeremy Huddleston Sequoia
a03f096a85 XQuartz: Validate length in appledri before swapping
Avoids potential memory corruption from bad requests

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2014-01-12 23:12:48 -08:00
Jeremy Huddleston Sequoia
b3572c0d1a XQuartz: Validate screen in AppleDRIQueryDirectRenderingCapable requests
Return an error to the caller rather than crashing the server on
invalid screens.

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2014-01-12 23:12:48 -08:00
Jeremy Huddleston Sequoia
959e8f23af XQuartz: Simplify hook_run to quiet static analyzer
x-hook.c:96:9: warning: Called function pointer is an uninitalized pointer value
        (*fun[i])(arg, data[i]);
        ^~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2014-01-12 23:12:48 -08:00
Jeremy Huddleston Sequoia
f79af19417 XQuartz: Mark applicationWillTerminate: noreturn
X11Controller.m:938:1: warning: method 'applicationWillTerminate:' could be declared with attribute 'noreturn'
      [-Wmissing-noreturn,Semantic Issue]
{
^

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2014-01-12 23:12:48 -08:00
Jeremy Huddleston Sequoia
ea80279e29 XQuartz: Fix get_proc_address signature
indirect.c:675:28: warning: incompatible pointer types passing 'glx_gpa_proc (*)(const char *)' to parameter of type
      'glx_gpa_proc' (aka 'glx_func_ptr (*)(const char *)') [-Wincompatible-pointer-types,Semantic Issue]
    __glXsetGetProcAddress(&get_proc_address);
                           ^~~~~~~~~~~~~~~~~
../../../glx/glxserver.h:122:42: note: passing argument to parameter 'get_proc_address' here [Semantic Issue]
void __glXsetGetProcAddress(glx_gpa_proc get_proc_address);
                                         ^

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2014-01-12 23:12:48 -08:00
Jeremy Huddleston Sequoia
2e3ebec952 XQuartz: Fix darwinfb.h header guard
./darwinfb.h:28:9: warning: '_DARWIN_FB_H' is used as a header guard here, followed by #define of a different macro
      [-Wheader-guard,Lexical or Preprocessor Issue]
        ^~~~~~~~~~~~
./darwinfb.h:29:9: note: '_DARWIN_DB_H' is defined here; did you mean '_DARWIN_FB_H'? [Lexical or Preprocessor Issue]
        ^~~~~~~~~~~~
        _DARWIN_FB_H

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2014-01-12 23:12:48 -08:00
Jeremy Huddleston Sequoia
9da6c0918f XQuartz: Silence some static analyzer warnings by annotating referencing counts
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2014-01-12 23:12:47 -08:00
Keith Packard
2d2d49dab5 Clean up a few function prototypes to not place formals in /**/
This just removes the comment markers from around the formals in
several function prototypes near where pointer -> void * changes were
made. There are plenty more of these to fix.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2014-01-12 10:24:12 -08: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
Keith Packard
93fa64e17d Don't build dmx by default
It's clearly un-loved, having piles and piles of warnings. If someone
wants to fix it up to compile without warnings, we can re-enable it.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-01-12 10:14:51 -08:00
Keith Packard
319dff750f hw/xfree86: nobus.c shouldn't define a static function
Having this function be static generates a compiler warning.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-01-12 10:14:51 -08:00
Keith Packard
7915791bac kdrive/ephyr; Don't redeclare monitorResolution
It's already declared in globals.h

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2014-01-12 10:14:51 -08:00