This patch fixes typos and lack of tags in "Xlib - C Language X Interface" document - Chapter 02.
Signed-off-by: Lucien Gentis <lucien.gentis@waika9.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
This was introduced in 8ea762f.
Reported-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Emilio Pozuelo Monfort <pochu@debian.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Check if enough bytes were received for specified image type and
geometry. Otherwise GetPixel and other functions could trigger an
out of boundary read later on.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
v2: FontNames.c return a NULL list whenever a single
length field from the server is incohent.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
since Xfree is a define for free():
Xlibint.h:#define Xfree(ptr) free((ptr))
Xfree will accept NULL and do nothing.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
instead of converting to int and back
Fixes clang warnings of the form:
HVC.c:190:43: warning: implicit conversion changes signedness: 'int' to
'unsigned long' [-Wsign-conversion]
if (strncmp(spec, _XcmsTekHVC_prefix, n) != 0) {
~~~~~~~
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Clears many gcc warnings of the form:
uvY.c: In function ‘XcmsCIEuvYToCIEXYZ’:
uvY.c:263:19: warning: comparison between signed and unsigned integer
expressions [-Wsign-compare]
for (i = 0; i < nColors; i++, pColor++) {
^
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Fixes gcc warnings of the form:
IdOfPr.c: In function ‘XcmsFormatOfPrefix’:
IdOfPr.c:69:32: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if ((len = strlen(prefix)) >= sizeof(string_buf)) {
^
IdOfPr.c:83:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (len >= sizeof(string_buf)) Xfree(string_lowered);
^
IdOfPr.c:97:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (len >= sizeof(string_buf)) Xfree(string_lowered);
^
IdOfPr.c:104:13: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (len >= sizeof(string_buf)) Xfree(string_lowered);
^
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
The basic rule "put parantheses around macro parameters" should be
observed where possible. Otherwise code like
ConnectionNumber(foo = bar);
fails to compile. (It obviously passes if ConnectionNumber is a C
function.) There are several other macros amended for the same reason.
This bug appeared while building http://ioccc.org/1993/cmills.c, so
historically it was not present.
Signed-off-by: Dominik Muth <muth@nxdomain.no-ip.biz>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
libX11-xcb only accesses data structures defined in X11 headers,
it doesn't call any functions or reference any global variables
in libX11 itself. (Seems to have been left from previous XCL
implementation.)
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Removes --with-local-transport-order=... flag to configure.
Code which used this ordered list was removed in commit 15e5eaf628
which outsourced X11 connection handling & authentication to libxcb.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
Removes --enable-secure-rpc & --disable-secure-rpc flags to configure
Code that used SECURE_RPC definitions was removed in commit 15e5eaf628
which outsourced X11 connection handling & authentication to libxcb.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Matthieu Herrb <matthieu@herrb.eu>
XkbGetKeyboardByName relies on flags to read the data from the server.
If the X server sends us the wrong flags or if a subreply is smaller
than it should be, XkbGetKeyboardByName will not read all the available
data and leave data in the buffer, which will cause the next _XReply()
to fail with:
[xcb] Extra reply data still left in queue
[xcb] This is most likely caused by a broken X extension library
[xcb] Aborting, sorry about that.
xcb_io.c:576: _XReply: Assertion `!xcb_xlib_extra_reply_data_left' failed.
Aborted
Check if there is some extra data left at the end of
XkbGetKeyboardByName() and discard that data if any is found.
Many thanks to Peter Hutterer <peter.hutterer@who-t.net> for finding the
root cause of the issue and Adam Jackson <ajax@redhat.com> for helping
with the analysis!
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Don't need to test for a case that we already returned for, don't need
to store a count that will only ever be 1 if we didn't return, don't
need to increment pointers to allow storing more than one item when we
can only ever possibly do one.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Code seems to have been originally written to handle appending multiple
strings, but only ever operates on a single string.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Rework code to store allocations directly into XIM struct instead of
temporary local variables, so we can use _XCloseIM to unwind instead
of duplicating it, and consistently jump to error handler on failure,
instead of sometimes leaking and sometimes freeing.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93183
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
The only use of XCONN_CHECK_FREQ was removed in commit 15e5eaf628
when we dropped the old Xlib connection handling in favor of xcb's.
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
This is a forward of the Ubuntu bug https://launchpad.net/bugs/518056
One of the conclusions from the discussion on that bug report, which
basically is about typing the ccedilla character easily on a non-
Portuguese keyboard, is that X11 should include a compose file for
pt_PT.UTF-8 similar to the file for pt_BR.UTF-8.
FDO bug: https://bugs.freedesktop.org/show_bug.cgi?id=90300
Signed-off-by: Gunnar Hjalmarsson <gunnarhj@ubuntu.com>
Signed-off-by: James Cloos <cloos@jhcloos.com>
It's only used inside XNextRequest(), so doesn't need to be exported.
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Make use of the new 64-bit sequence number API in XCB 1.11.1 to avoid
the 32-bit sequence number wrap in libX11.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71338
Signed-off-by: Christian Linhart <chris@demorecorder.com>
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
ICWrap.c dereferences the xim parameter passed in from client code without a
NULL check. I have seen mplayer trigger this resulting in a segfault. In this
case mplayer had called XOpenIM and NULL was returned which was later passed
into XCreateIC.
Patch originally by Drew Moseley <drew_moseley@mentor.com>.
Signed-off-by: Ross Burton <ross.burton@intel.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Incorrect parameter usage with sizeof. Earlier passed argument FontData
will be 4 bytes always as its a pointer hence the change is needed and
FontDataRec should be used for memset.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
False positive, if rlen/nbytes are unset we quit early before using it. Still,
initialize it so we don't have to deal with these warnings again.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
If we hit the depth limit, filename leaks. Move the depth check up before we
allocate filename.
Introduced in 226622349a.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Sorry, my patch to fix the spelling mistakes in the ks_IN and sd_IN
locales fixed it only partly, I introduced a new spelling mistake
in the sd_IN locales. This patch fixes this.
Signed-off-by: James Cloos <cloos@jhcloos.com>
The codeset must be *before* the modifier.
See also: http://pubs.opengroup.org/onlinepubs/7908799/xbd/envvar.html
opengroup> The syntax for these environment variables is thus defined as:
opengroup>
opengroup> [language[_territory][.codeset][@modifier]]
Signed-off-by: James Cloos <cloos@jhcloos.com>
See also: https://bugzilla.redhat.com/show_bug.cgi?id=1066910
If these are not in locale.dir,
$ LANG=sr_RS.UTF-8@latin xterm
and
$ LANG=sr_RS@latin xterm
give the warning:
Warning: locale not supported by Xlib, locale set to C
and some programs (like xmms) fail to find translations for Serbian
in Latin because of this.
Signed-off-by: James Cloos <cloos@jhcloos.com>
In the man page the field "resourceid" was in a different place than
in the actual struct layout in Xlib.h
Signed-off-by: Joonas Javanainen <joonas.javanainen@gmail.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
The Compose format has a feature which allows specifying certain
modifiers must (or must not) be present with a given keysym in the
sequence.
The grammar in imLcPrs.c and the Compose man page both do not match what
the code actually does (see the handling of the variables
`modifier_mask` and `modifier` in parseline() in imLcPrs.c, which are
eventually matched as `ev->state & modifier_mask == modifier`).
Also explicitly list the accepted modifier names, since they are
not standard (e.g. "Ctrl" instead of "Control").
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: James Cloos <cloos@jhcloos.com>
In the spec and the man page the `mods_rtrn` argument is described as
"backfilled with unconsumed modifiers" but actually it is backfilled
with the *consumed* modifiers. This is also mentioned a few lines below
in each case.
Signed-off-by: Ran Benita <ran234@gmail.com>
Signed-off-by: James Cloos <cloos@jhcloos.com>