Commit graph

870 commits

Author SHA1 Message Date
Alan Coopersmith
6841260c8b Bug 37624 - parameter x is missing from synopsis of XDrawString in libX11.html
https://bugs.freedesktop.org/show_bug.cgi?id=37624

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-05-27 20:14:36 -07:00
Matt Dew
205af6a4e5 Add id's to functions, to make clickable links.
Signed-off-by: Matt Dew <marcoz@osource.org>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2011-05-24 12:42:43 -06:00
Alan Coopersmith
5c06bc5944 libX11 spec: fix monospaced column alignment after deligaturization
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-05-20 15:38:08 -07:00
James Cloos
ef0019c714 Expand latin ligatures out to their NFKC equivalents.
Ligatures should be done by the typesetting system.
Manuscripts should not bother with them.

Signed-off-by: James Cloos <cloos@jhcloos.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2011-05-20 17:37:44 -04:00
Daniel Stone
761b8aa0c9 XCB: Add more friendly error messages for common asserts
This patch adds more friendly error messages for three common classes of
assertion:
    - missed sequence numbers due to being griefed by another thread
    - unknown requests in queue due to being griefed by another thread
    - extensions dequeuing too much or too little reply data

It adds error messages offering advice (e.g. call XInitThreads() first)
on stderr, but still generates actual assertions.  Hopefully this means
it's a little more Googleable and a little less frightening.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-05-20 17:45:18 +01:00
Gaetan Nadon
159bf29247 Remove misplaced hyphens in libX11 DocBook/XML #37364
Reported-by: Christopher Yeleighton <giecrilj@stegny.2a.pl>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2011-05-20 11:21:36 -04:00
Alan Coopersmith
0ee6d8247d Fix man page and comment references to use XFreeModifiermap (lowercase map)
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-05-17 20:49:59 -07:00
Alan Coopersmith
3275ec4ca8 XKB man pages: Fix coordinantes typo in multiple pages
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-05-17 20:30:54 -07:00
Alan Coopersmith
ca33a80606 DisplayOfCCC.man: Fix typo "ClientWhitePointOfCC" -> "ClientWhitePointOfCCC"
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-05-17 16:27:32 -07:00
Jeremy Huddleston
ae39d82b01 Silence clang static analysis warnings for SetReqLen
This provides a simplified version of the SetReqLen macro when using clang for
static analysis.  Prior to this change, we would see many Idempotent operation
warnings inside this macro due to the common case of calling with arg2 and
arg3 being the same variable.  This has no effect on code produced during
compilation, but it silences a number of false positives in static analysis.

XIPassiveGrab.c:170:5: warning: Assigned value is always the same as the existing value
    SetReqLen(req, num_modifiers, num_modifiers);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from XIPassiveGrab.c:26:
.../include/X11/Xlibint.h:580:8: note: instantiated from:
            n = badlen; \
              ^

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-05-08 09:08:07 -07:00
Jeremy Huddleston
130af2bc02 XKB: XkbComputeSectionBounds: Check correct bounds in default switch-case
XKBGeom.c:191:25: warning: Access to field 'x1' results in a dereference of a null pointer (loaded from variable 'rbounds')
        _XkbCheckBounds(bounds,rbounds->x1,rbounds->y1);
                               ^~~~~~~

Found-by: clang static analyzer
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-05-04 15:37:36 -07:00
Jeremy Huddleston
c987ef04be Revert "XKB: Avoid a possible NULL dereference"
Sorry for the noise.  I accidentally pushed and didn't mean to. =(

This reverts commit 4024091678.
2011-05-04 15:31:17 -07:00
Jeremy Huddleston
46d04bc4e7 Dead code removal
XKBGeom.c:118:27: warning: Assigned value is always the same as the existing value
    for (key=row->keys,pos=k=0;k<row->num_keys;k++,key++) {
                       ~~~^~~~
XKBGeom.c:115:5: warning: Value stored to 'pos' is never read
    pos= 0;
    ^    ~

Found-by: clang static analyzer
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-05-04 11:35:31 -07:00
Jeremy Huddleston
4024091678 XKB: Avoid a possible NULL dereference
XKBGeom.c:191:25: warning: Access to field 'x1' results in a dereference of a null pointer (loaded from variable 'rbounds')
        _XkbCheckBounds(bounds,rbounds->x1,rbounds->y1);
                               ^~~~~~~

Found-by: clang static analyzer
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-05-04 11:34:53 -07:00
Jeremy Huddleston
626e5e34be Annotate _XIOError as _X_NORETURN
Found-by: clang static analyzer
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-05-04 11:21:41 -07:00
Jeremy Huddleston
d3d7896408 clang analyzer: Don't warn about Xmalloc(0)
This will prevent a number of false positives in where clang's
static analysis reports about calls to malloc(0).

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-05-03 09:32:53 -07:00
Alan Coopersmith
393921cf21 Delete special case code to append "/sparcv9" to i18n module path
Was triggered by defined(__sparcv9) so only built on Solaris SPARC 64-bit.
Inconsistent with all other platforms, and a bit overcomplicated.

Should anyone need to continue using that path, simply build with
a #define POSTLOCALELIBDIR "sparcv9" to get the same result.

Fixes Solaris bug 7038737:
 sparcv9 Xlib looking in wrong path for i18n loadable modules

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-04-22 13:52:27 -07:00
Alan Coopersmith
b9ff9cfd5c specs/libX11: Fix XOpenDisplay() prototype in chapter 2 [bug 36244]
Was incorrectly showing AllPlanes() instead when describing XOpenDisplay()

https://bugs.freedesktop.org/show_bug.cgi?id=36244

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-18 17:49:23 -07:00
Alan Coopersmith
b850adbdeb Convert malloc(strlen()); strcpy() sets to strdup
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-04-18 17:49:18 -07:00
Alan Coopersmith
09194042d3 Replace Xmalloc+bzero pairs with Xcalloc calls
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-04-18 17:49:13 -07:00
Ander Conselvan de Oliveira
ac1e2bff71 om: Fix memory leaks on get_font_name error paths.
While at it, remove unneeded check for NULL before Xfree.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-13 11:06:00 +03:00
Ander Conselvan de Oliveira
7c362e275c xcms: Fix memory leaks on LINEAR_RGB_InitSCCData error path.
pScreenData is replaced when building per visual intensity tables. If
malloc failed the old value of pScreenData (stored also in
pScreenDefaultData) was being leaked. Also, property_return wasn't
free'd in that case.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-13 11:06:00 +03:00
Ander Conselvan de Oliveira
5c810e2ac2 xcms: Fix error on LINEAR_RGB_InitSCCData error path.
Due to what looks like a copy & paste error, pScreenData->pBlueTbl would
be accessed after being free'd.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-13 11:06:00 +03:00
Ander Conselvan de Oliveira
d749948f94 om: Fix potential memory leak in init_om.
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-13 11:05:59 +03:00
Ander Conselvan de Oliveira
d0749d6abd om: Fix memory leak on read_EncodingInfo error path.
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-13 11:05:59 +03:00
Ander Conselvan de Oliveira
4b2e8d00f5 Fix memory leaks on _XimCbDispatch error path.
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-13 11:05:59 +03:00
Ander Conselvan de Oliveira
46e6c78b1a Fix memory leak on _XimCommitRecv error path.
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-13 11:05:59 +03:00
Ander Conselvan de Oliveira
0ace642a2d Fix memory leaks on _XimWriteCachedDefaultTree error paths.
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-13 11:05:59 +03:00
Ander Conselvan de Oliveira
e29be94edb Fix memory leaks on _XimGetAttributeID error paths.
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-13 11:05:59 +03:00
Ander Conselvan de Oliveira
d144a50512 Fix memory leaks on _XimProtoCreateIC error paths.
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-13 11:05:59 +03:00
Ander Conselvan de Oliveira
6a452f7a98 Fix leaks in _XimEncodingNegotiation error paths.
name_ptr and detail_ptr weren't free'd in some cases before returning
False.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-13 11:05:59 +03:00
Ander Conselvan de Oliveira
396e5a452a FSWrap: fix potential leak in copy_string_list
If list_count is 0, dst would be allocated and leaked.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-13 11:05:59 +03:00
Ander Conselvan de Oliveira
1a94426018 Fix memory leak with broken bitmap files in XReadBitmapFileData
Bitmap file data is read looping through the lines in the input file. If
there is extra data after the bitmap, these lines will be processed and
if this data represents another bitmap it will replace the one read
before causing the memory allocated for bits to leak.

This changes the code to stop processing the file once a bitmap was
read.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira@nokia.com>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-13 11:05:59 +03:00
Alan Coopersmith
c1c91e9a22 Fix "attrinute" typo in comments in ximcp
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-12 20:50:42 -07:00
Alan Coopersmith
7103b83a88 Make doc install subdirectories more like the pre-docbook.am paths
Haven't restored the "specs" path in the install path, but have restored
libX11 & i18n subdirectories in the path for better logical grouping.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2011-04-12 18:18:39 -07:00
Alan Coopersmith
9a1ae7a90f Install xml versions of specs even if HAVE_XMLTO is false
Moves HAVE_XMLTO check into docbook.am, more closely matches behaviour
from before docbook.am changes (commit e8c76407d2)

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2011-04-12 18:18:22 -07:00
Alan Coopersmith
a0ad0d5c99 libX11 1.4.3
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-04-05 13:29:24 -07:00
Gaetan Nadon
e8c76407d2 Documentation: add Docbook external references support
When writing technical documentation, it is often necessary to cross
reference to other information. When that other information is not in the
current document, additional support is needed, namely <olink>.

A new feature with version 1.7 of xorg-sgml-doctools adds references to
other documents within or outside this package.

This patch adds technical support for this feature but does not change
the content of the documentation as seen by the end user.

Each book or article must generate a database containing the href
of sections that can be referred to from another document. This database
is installed in DATAROOTDIR/sgml/X11/dbs. There is a requirement that
the value of DATAROOTDIR for xorg-sgml-doctools and for the package
documentation is the same. This forms a virtual document tree.

This database is consulted by other documents while they are being generated
in order to fulfill the missing information for linking.
Refer to the xorg-sgml-doctools for further technical information.

Co-authored-by: Matt Dew <marcoz@osource.org>

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2011-03-30 20:18:35 -04:00
Harshula Jayasuriya
25eb76b3d2 Add #define XK_SINHALA
Add #define XK_SINHALA so that the Sinhala keysyms can be used by
the lk xkb keymap.

Signed-off-by: Harshula Jayasuriya <harshula@gmail.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-03-21 14:49:51 +00:00
Jeremy Huddleston
db8b20b789 configure.ac: Bump version to 1.4.2
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-03-17 16:15:00 -07:00
Jamey Sharp
83e1ba59c4 Call _XErrorFunction without holding the Display lock.
Historically, Xlib dropped the Display lock around the upcall to any
user-supplied _XErrorFunction, but somewhere along the way I quit doing
that if you built with XCB. The reasons are lost somewhere in the
pre-git history of Xlib/XCB, and I can't now see any reason to hold the
lock.

The documentation for XSetErrorHandler still applies though:

    Because this condition is not assumed to be fatal, it is acceptable
    for your error handler to return; the returned value is ignored.
    However, the error handler should not call any functions (directly
    or indirectly) on the display that will generate protocol requests
    or that will look for input events.

So while you are now once again permitted to re-enter Xlib from the
error handler, you're only allowed to call non-protocol functions.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
2011-03-15 16:48:07 -07:00
Jamey Sharp
fd85aca7a6 Ignore user locks after sleeping in _XReply and _XReadEvents.
This bug appears as a hang in applications that wait for replies from
multiple threads, where one such thread has taken a user lock using
XLockDisplay.

Prior to this fix, the code could deadlock in this way: If thread 1 goes
to sleep waiting for a reply, and then thread 2 takes a user lock and
waits for a reply, then thread 2 will wait for thread 1 to process its
reply (because responses must be processed in order), but thread 1 will
wait for thread 2 to drop its user lock.

Fixed by making thread 1 not wait for thread 2 to drop its user lock.
This makes the semantics of user locks hard to define, but they were
already hard to define. The new behavior appears to be consistent with
the way Xlib worked historically, anyway.

Fixes: http://lists.freedesktop.org/archives/xcb/2011-March/006802.html

There was a similar potential for deadlock in _XReadEvents, fixed the
same way, with the same caveats about user-lock semantics.

Signed-off-by: Jamey Sharp <jamey@minilop.net>
2011-03-14 14:45:35 -07:00
Erkki Seppälä
690f8bffd4 xkb: XkbPropertyPtr determined allocation success from wrong variables
Cannot reach dead statement "return NULL;"

Check for the NULLness of prop->name and prop->value instead of
name and value, which was checked earlier anyway. Decided against
using strdup due to curious memory allocation functions and the
rest of the xkb not using it either.

Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
2011-03-11 12:38:08 +02:00
Erkki Seppälä
6a4d027284 keyBind: Use Xcalloc to initialize allocated _XKeytrans
Using uninitialized value "p->modifiers"

Small fix by using Xcalloc instead of Xmalloc

Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
2011-03-11 12:38:08 +02:00
Erkki Seppälä
b993d73bb3 im/ximcp: release modifiermap before returning
Variable "map" goes out of scope

Release modifiermap before returning. Reordered code to call
XGetModifierMapping after the first return from the function.

Signed-off-by: Erkki Seppälä <erkki.seppala@vincit.fi>
Reviewed-by: Dirk Wallenstein <halsmit@t-online.de>
2011-03-11 12:38:08 +02:00
Gaetan Nadon
807a7fc035 Docbook: change the book id to match the xml file basename
This is required for the up-coming external references support.

Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
2011-02-25 09:23:54 -05:00
Samuel Thibault
40812b53ff Make the Local XIM request key releases for braille
Braille chords management needs key release events. We need to explicitly
request then, else GTK would not pass them throught XFilterEvent and braille
wouldn't work.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2011-02-21 21:54:17 +01:00
Samuel Thibault
c97c42c49c Match braille patterns with compose tree
Braille patterns should also be usable in Compose.  This combines the
implementation of braille chords and compose tree: only emit the braille
pattern if it can not be found in the compose tree, if any.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2011-02-21 17:27:38 +01:00
Samuel Thibault
0c6ca565d7 Fix status reporting for braille patterns
_XimLocalMbLookupString can return a braille keysym even if _Xlcwctomb can't
convert to the current MB charset.
_XimLocalUtf8LookupString needs to set the braille keysym and status too.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
2011-02-21 15:56:54 +01:00
Alan Coopersmith
993abe751f Clean up memory when first XCreateRegion succeeds and second fails
Error: Memory leak (CWE 401)
   Memory leak of pointer 's' allocated with XCreateRegion()
        at line 387 of /export/alanc/X.Org/sx86-gcc/lib/libX11/src/Region.c in function 'XShrinkRegion'.
          's' allocated at line 387 with XCreateRegion().
          s leaks when s != 0 at line 387.
Error: Memory leak (CWE 401)
   Memory leak of pointer 'tra' allocated with XCreateRegion()
        at line 1452 of /export/alanc/X.Org/sx86-gcc/lib/libX11/src/Region.c in function 'XXorRegion'.
          'tra' allocated at line 1451 with XCreateRegion().
          tra leaks when tra != 0 at line 1451.

[ This bug was found by the Parfait 0.3.6 bug checking tool.
  For more information see http://labs.oracle.com/projects/parfait/ ]

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-02-11 14:49:17 -08:00