Pull request for reviewed static analysis fixes, second batch

2011-02-01 Thread Erkki Seppala
The following changes since commit e994ab227ed28655565c3193e63733630105e7f9: Erkki Seppälä (1): Comparing array against NULL is not useful "&xkb->server->vmods != NULL" are available in the git repository at: g...@gitorious.org:erkkise/libx11-fixes.git fixes-reviewed-2011-02-01 Al

Re: [PATCH:xman 4/4] Use snprintf to PATH_MAX sized buffers to construct filenames

2011-02-01 Thread Guillem Jover
Hi! On Fri, 2011-01-28 at 23:14:00 -0800, Alan Coopersmith wrote: > diff --git a/misc.c b/misc.c > index 0921307..8818aa8 100644 > --- a/misc.c > +++ b/misc.c > @@ -693,7 +693,7 @@ ConstructCommand(cmdbuf, path, filename, tempfile) > FILE *file; > char fmtbuf[128]; > int gotfmt = 0;

[PATCH evdev v2] Add third button emulation.

2011-02-01 Thread Peter Hutterer
New properties: "Evdev Third Button Emulation" → switch on/off "Evdev Third Button Emulation Timeout" → timeout until event is delivered "Evdev Third Button Emulation Button" → phys button to be emulated "Evdev Third Button Emulation Threshold" → move threshold before emulation is cancelled Signed

Re: [PATCH] Xi: add device node property to known properties.

2011-02-01 Thread Peter Hutterer
On Wed, Feb 02, 2011 at 03:34:18PM +1000, Peter Hutterer wrote: > Since the server has little choice (or even knowledge) of the actual device > node used by the driver, this property is merely provided for > standardisation. It is up to the driver to set it to the appropriate value, > usually a dev

[PATCH] Xi: add device node property to known properties.

2011-02-01 Thread Peter Hutterer
Since the server has little choice (or even knowledge) of the actual device node used by the driver, this property is merely provided for standardisation. It is up to the driver to set it to the appropriate value, usually a device node in the form of /dev/input/event0 or similar. Signed-off-by: Pe

[PATCH evdev] Export device node as property.

2011-02-01 Thread Peter Hutterer
There is currently no mapping between XI devices and physical devices other than what can be extracted by parsing the Xorg logfile. Add new property "Device Node" to the driver to export the open device file. The client is responsible for detecting if the device is on the same host and converting

Re: [PATCH] xcms/LRGB: Add a label for freeing property_return.

2011-02-01 Thread Alan Coopersmith
On 02/ 1/11 01:07 AM, Ander Conselvan de Oliveira wrote: > The rest of the code uses goto's to free memory allocated later > and prevent memory leaks, but there were several paths were > property_return was free'd just before a goto. > > Signed-off-by: Ander Conselvan de Oliveira > > Signed-off-

Re: supporting non-rectangular windows

2011-02-01 Thread Pat Kane
Attached is the source to xhole, the program that is shown on http://en.wikipedia.org/wiki/Shape_extension Pat --- On Tue, Feb 1, 2011 at 10:56 AM, Pat Kane wrote: >  > Also, can anyone help me to understand >  > what difference does it make if we call XSelectInput or XShapeSelectInput?

Re: supporting non-rectangular windows

2011-02-01 Thread Pat Kane
> Also, can anyone help me to understand > what difference does it make if we call XSelectInput or XShapeSelectInput? This document: http://www.x.org/docs/Xext/shape.pdf has this to say about it ... only one event type can be selected via the extension, XShapeSelectInput provides

XI2: Where is Mode_switch?

2011-02-01 Thread Philipp Reh
Hi, when I use XI2 to obtain keypress / keyrelease events, the XIModifierState of XIDeviceEvent doesn't seem to contain a bit that indicates if Mode_switch was held down. In this case, all the four ints of the struct are zero. However, if I run xev, it is reported that the state field of XKeyEven

Re: [PATCH evdev] Add third button emulation.

2011-02-01 Thread Benjamin Tissoires
Hi Peter, I detected 2 problems (I backported it on 2.6.0, so I hope it's not related to my backport): - In case of an absolute device, the patch does not seems to work: Evdev3BEmuFilterEvent is called during the EV_KEY event and Evdev3BEmuProcessAbsMotion during the EV_SYNC event. This means

Re: [PATCH libX11] config: Add an option to initialize threads by default.

2011-02-01 Thread Rami Ylimäki
On 01/31/2011 09:11 PM, Alan Coopersmith wrote: On 01/31/11 02:46 AM, Rami Ylimäki wrote: It's sometimes impossible to know in advance whether an X client is using Xlib from multiple threads or not. For example, there could be some generic X client that acts as a plugin container. Plugins could

Re: [PATCH libX11] poll_for_response: Really handle xcb_poll_for_reply getting a reply.

2011-02-01 Thread Pauli Nieminen
On Sat, Jan 29, 2011 at 8:16 PM, Alan Coopersmith wrote: > On 01/18/11 02:02 PM, Pauli Nieminen wrote: >> Cherry pick without conflicts from master to 1.3 branch. > > Pushed to libX11-1.3-branch > > If another release was to be cut from this branch, are there other fixes > that should be cherry pi

Re: [PATCH evdev] Add third button emulation.

2011-02-01 Thread Benjamin Tissoires
On 01/31/2011 10:52 PM, Peter Hutterer wrote: On Mon, Jan 31, 2011 at 11:48:08AM +0100, Benjamin Tissoires wrote: Thanks, that seems to be a good feature for touchscreen devices! I've got one problem: on which tree does this patch applies? (I've tried against the branch master of xf86-input-evde

Re: [PATCH v2 x11perf 3/3] Omit benchmarks reading contents of window that is larger than screen.

2011-02-01 Thread Michel Dänzer
On Die, 2011-02-01 at 10:59 +0200, Rami Ylimäki wrote: > On 01/31/2011 06:08 PM, Michel Dänzer wrote: > > On Mon, 2011-01-31 at 15:48 +0200, Rami Ylimäki wrote: > >> Signed-off-by: Rami Ylimäki > >> --- > >> do_blt.c | 10 ++ > >> 1 files changed, 10 insertions(+), 0 deletions(-) > >>

[PATCH] xcms/LRGB: Add a label for freeing property_return.

2011-02-01 Thread Ander Conselvan de Oliveira
The rest of the code uses goto's to free memory allocated later and prevent memory leaks, but there were several paths were property_return was free'd just before a goto. Signed-off-by: Ander Conselvan de Oliveira Signed-off-by: Erkki Seppälä --- src/xcms/LRGB.c | 24 ++--

Re: [PATCH v2 17/25] [libx11] The rest of the code uses goto's to free memory allocated later and prevent memory leaks, but there were several paths were property_return was free'd just before a goto.

2011-02-01 Thread Erkki Seppala
On 01.02.2011 11:04, Ander Conselvan de Oliveira wrote: xcms/LRGB: Add a label for freeing property_return. That's a much better subject/shortlog line than the far too long one you have there now. I agree with you and I actually wrote the commit message that way. Looks like Erkki changed it f

Re: [PATCH v2 17/25] [libx11] The rest of the code uses goto's to free memory allocated later and prevent memory leaks, but there were several paths were property_return was free'd just before a goto.

2011-02-01 Thread Ander Conselvan de Oliveira
On 02/01/2011 10:03 AM, ext Alan Coopersmith wrote: On 01/31/11 04:02 AM, Erkki Seppälä wrote: From: Ander Conselvan de Oliveira xcms/LRGB: Add a label for freeing property_return. That's a much better subject/shortlog line than the far too long one you have there now. I agree with you and

Re: [PATCH v2 x11perf 3/3] Omit benchmarks reading contents of window that is larger than screen.

2011-02-01 Thread Rami Ylimäki
On 01/31/2011 06:08 PM, Michel Dänzer wrote: On Mon, 2011-01-31 at 15:48 +0200, Rami Ylimäki wrote: Signed-off-by: Rami Ylimäki --- do_blt.c | 10 ++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/do_blt.c b/do_blt.c index 4be2836..fae9e1d 100644 --- a/do_blt.c +++

Re: [PATCH v2 25/25] [libx11] Removed superfluous check for NULL target_dir; it is already handled before this code.

2011-02-01 Thread Alan Coopersmith
On 01/31/11 04:02 AM, Erkki Seppälä wrote: > Cannot reach dead expression "0U" inside statement "if (1U + (target_dir ? > strl..." > > Reviewed-by: Ander Conselvan de Oliveira > > Signed-off-by: Erkki Seppälä > --- > src/xlibi18n/lcFile.c |3 +-- > 1 files changed, 1 insertions(+), 2 dele

Re: [PATCH v2 24/25] [libx11] Removed superfluous check for NULL target_dir; it is already handled before this code.

2011-02-01 Thread Alan Coopersmith
On 01/31/11 04:02 AM, Erkki Seppälä wrote: > Cannot reach dead expression "0U" inside statement "if (1U + (target_dir ? > strl..." > > Reviewed-by: Ander Conselvan de Oliveira > > Signed-off-by: Erkki Seppälä > --- > src/xlibi18n/lcFile.c |3 +-- > 1 files changed, 1 insertions(+), 2 dele

Re: [PATCH v2 23/25] [libx11] Fixed by negative value to memcpy by checking for the negative return value of _Xlcwctomb and returning 0/XLookupNone in that case.

2011-02-01 Thread Alan Coopersmith
On 01/31/11 04:02 AM, Erkki Seppälä wrote: > a negative value was passed to memcpy > > Unfortunately the other return values for *status don't fit into the > error (which appears to indicate some internal error or running out of > memory). The other valid status codes are XBufferOverflow, > XLooku

Re: [PATCH v2 22/25] [libx11] Checked return value of XGetWindowProperty and return false if it fails.

2011-02-01 Thread Alan Coopersmith
On 01/31/11 04:02 AM, Erkki Seppälä wrote: > Return value of "XGetWindowProperty(im->core.display, spec->lib_connect_wid, > prop, 0L, (length + bytes_after_ret + 3UL) / 4UL, 1, 0UL, &type_ret, > &format_ret, &nitems, &bytes_after_ret, &prop_ret)" is not checked > > Signed-off-by: Erkki Seppälä

Re: [PATCH v2 21/25] [libx11] Fixed by zero'ing conv on allocation. Then close_converter works properly.

2011-02-01 Thread Alan Coopersmith
On 01/31/11 04:02 AM, Erkki Seppälä wrote: > From: Ander Conselvan de Oliveira > > Using uninitialized value "conv->state" in call to function "close_converter" > > Reviewed-by: Erkki Seppälä > Signed-off-by: Ander Conselvan de Oliveira > > Signed-off-by: Erkki Seppälä > --- > modules/lc/de

Re: [PATCH v2 20/25] [libx11] info_list->watch_data was being reallocated, but the return value of the reallocation was stored only into a local variable. This might cause some funky behavior and cra

2011-02-01 Thread Alan Coopersmith
On 01/31/11 04:02 AM, Erkki Seppälä wrote: > From: Ander Conselvan de Oliveira > > Variable "wd_array" goes out of scope Value "wd_array" is overwritten in > "wd_array = (XPointer*)realloc((char*)info_list->watch_data, > (((dpy->watcher_count + 1) * 4U == 0U) ? 1U : ((dpy->watcher_count + 1) *

Re: [PATCH v2 18/25] [libx11] Initialize local variable

2011-02-01 Thread Alan Coopersmith
On 01/31/11 04:02 AM, Erkki Seppälä wrote: > Using uninitialized value "error.resourceID" in call to function "_XError" > > Reviewed-by: Erkki Seppälä > Signed-off-by: Ander Conselvan de Oliveira > > Signed-off-by: Erkki Seppälä > --- > src/GetProp.c |2 +- > 1 files changed, 1 insertions

Re: [PATCH v2 1/3] [libx11] Variable "map" goes out of scope

2011-02-01 Thread Dirk Wallenstein
On Mon, Jan 31, 2011 at 12:03:32PM +0200, Erkki Seppälä wrote: > Release modifiermap before returning. Reordered code to call > XGetModifierMapping after the first return from the function. > > Signed-off-by: Erkki Seppälä > > diff --git a/modules/im/ximcp/imThaiFlt.c b/modules/im/ximcp/imThaiFl

Re: [PATCH v2 17/25] [libx11] The rest of the code uses goto's to free memory allocated later and prevent memory leaks, but there were several paths were property_return was free'd just before a goto.

2011-02-01 Thread Alan Coopersmith
On 01/31/11 04:02 AM, Erkki Seppälä wrote: > From: Ander Conselvan de Oliveira > > xcms/LRGB: Add a label for freeing property_return. That's a much better subject/shortlog line than the far too long one you have there now. > @@ -789,8 +782,6 @@ LINEAR_RGB_InitSCCData( > #endif /* ALLDEBUG */