summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2024-02-11unifdef hpuxAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-02-11unifdef sgiAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-02-11unifdef ultrixAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-11-12quiet a couple of unused-parameter warningsThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2023-11-12eliminate an unnecessary castThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2023-11-12Add continue_to_dispatch parameter to _XtResourceConfigurationEH()Thomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2023-11-12remove substitution for EXEEXT_FOR_BUILD, not defined in automakeThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2023-11-12issue #20: c23 boolean conflictThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2023-09-18README.md: update & correct links to O'Reilly X Toolkit booksAlan Coopersmith
Fix volume 5 link to point to volume 5, not 4. Fix volume 4 3rd edition link to point to 3rd ed. not 2nd. Update links to drop "www." from hostname to avoid a redirect. Reported-by: consolers on #xorg-devel IRC Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-08-14issue #19: include <process.h> on Windows for getpid()Thomas E. Dickey
submitted by Billy O'Neal This problem was first detected in https://github.com/microsoft/vcpkg/pull/33088 Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2023-05-27issue #18: cross-build issue in utilThomas E. Dickey
Modify link rule for utils/makestrs to use $(CC_FOR_BUILD) directly, avoiding libtool flags added when cross-compiling the library. Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2023-05-27issue #17: avoid _Static_assert from c++Thomas E. Dickey
2023-04-09libXt 1.3.0libXt-1.3.0Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-03-07Replace XtMalloc() calls with XtMallocArray()Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-03-07Replace XtRealloc() calls with XtReallocArray()Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-03-07Add XtReallocArray() for overflow checking of multiplied argsAlan Coopersmith
Uses reallocarray() if available, otherwise checks for overflow itself, if overflow is possible (i.e. in ILP32 & ILP64 environments, but not LP64 with 32-bit ints). Includes unit tests and XtMallocArray() helper macro. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-03-07test: Add unit tests for XtMalloc, XtCalloc, & XtReallocAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-03-04configure: Use LT_INIT from libtool 2 instead of deprecated AC_PROG_LIBTOOLAlan Coopersmith
AC_PROG_LIBTOOL was replaced by LT_INIT in libtool 2 in 2008, so it's time to rely on it. Clears autoconf warnings: configure.ac:36: warning: The macro `AC_PROG_LIBTOOL' is obsolete. configure.ac:36: You should run autoupdate. m4/libtool.m4:100: AC_PROG_LIBTOOL is expanded from... configure.ac:36: the top level Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-02-25Remove "All rights reserved" from Oracle copyright noticesAlan Coopersmith
Oracle no longer includes this term in our copyright & license notices. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-02-09TMstate.c: Handle -Wduplicated-branches warningsAlan Coopersmith
Gets rid of these messages from gcc: TMstate.c: In function ‘GetBranchHead’: TMstate.c:128:12: warning: this condition has identical branches [-Wduplicated-branches] if (parseTree->branchHeadTblSize == 0) ^ TMstate.c: In function ‘_XtGetQuarkIndex’: TMstate.c:183:16: warning: this condition has identical branches [-Wduplicated-branches] if (parseTree->quarkTblSize == 0) ^ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-02-09Add xfilesearchpath to xt.pcAlan Coopersmith
Make setting of --with-xfile-search-path available to other components, without having to link with libXt. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-02-06configure.ac: Replace HAVE_LIBRARY with AC_CHECK_LIBAlan Coopersmith
AC_CHECK_LIB was introduced in autoconf 2.0 (1994) to replace HAVE_LIBRARY Clears autoconf warnings of: configure.ac:108: warning: The macro `AC_HAVE_LIBRARY' is obsolete. configure.ac:108: You should run autoupdate. ./lib/autoconf/libs.m4:138: AC_HAVE_LIBRARY is expanded from... configure.ac:108: the top level Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-17tests: Replace g_assert() calls with g_assert_*() callsAlan Coopersmith
https://docs.gtk.org/glib/testing.html warns against using g_assert() in test cases, since it is a no-op when compiling with G_DISABLE_ASSERT. The replacement calls also give more detailed messages on failures. Raises the minimum required glib version for building unit tests from 2.16 (released March 2008) to 2.40 (released March 2014) to get support for g_assert_nonnull(). Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-17tests: Use XORG_MEMORY_CHECK_FLAGS from xorg-macros 1.16Alan Coopersmith
Replaces previous local copy which had gotten out of date. Raises xorg-macros minimum version from 1.13 (released March 2011) to 1.16 (Dec. 2011). Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-12-17tests: update g_test_bug_base url from bugzilla to gitlabAlan Coopersmith
Also adds a call to g_test_bug() for the one existing testcase associated with a bug in a public bug tracker. Otherwise this is mostly a placeholder for now, as no other tests call g_test_bug() yet to report what bugs they test for. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-08-11Use memcpy() instead of XtMemmove() when buffers are known to differAlan Coopersmith
Most of these came from a mass XtBCopy() -> XtMemmove() substitution in 1993 with a commit comment of "ANSIfication". But include/X11/IntrinsicI.h now defines XtMemmmove() as just calling memcpy() as long as src & dst differ, so remove an unnecessary check when we've just allocated a buffer, and reduce the chance that someone thinks we'll actually call memmove() instead of memcpy() Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-08-11Use memcpy() instead of memmove() when buffers are known not to overlapAlan Coopersmith
Most of these came from a mass bcopy() -> memmove() substitution in 1993 with a commit comment of "ANSIfication". Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-07-17gitlab CI: stop requiring Signed-off-by in commitsAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-07-17Fix spelling/wording issuesAlan Coopersmith
Found by using: codespell --builtin clear,rare,usage,informal,code,names Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-07-17Build xz tarballs instead of bzip2Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-06-20update copyright-dateThomas E. Dickey
2022-06-20Support buttons > 5 in translation tables [v2]Keith Packard
Add support for arbitrary button numbers by replacing the table-driven detail parsing for BtnDown/ButtonPress and BtnUp/ButtonRelease with a custom parser that allows for an arbitrary button number (1-255) after the 'Button' prefix. Document what this syntax looks like in the table of detail information. Signed-off-by: Keith Packard <keithp@keithp.com>
2022-06-18cppcheck (revise IsDescendant() to fix possible null-dereference)Thomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-06-18cppcheck fixes (const, null dereferencing, uninitialized, scope)Thomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-06-18fixes for gcc13 warningsThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-06-18cppcheck and clang --analyze fixesThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-06-14codespell-fixesThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-06-14add _X_NORETURN to agree with header-fileThomas E. Dickey
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2021-12-02gitlab CI: add a basic build testAlan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2021-06-27Fix InternalCallbackRec layout if pointers are bigger than 64 bitsAlex Richardson
When running `xeyes` via `SSH -X` on CHERI-RISC-V FreeBSD, I was getting a Bus Error (unaligned store) in the `cl->callback = callback;` line of _XtAddCallback. The `cl` variable (created using `ToList(icl)`) was only aligned to 8 bytes, but for CHERI-RISC-V pointer-type loads and stores require 16-byte alignment. In order to fix this, I added a C99 flexible array member to internalCallbackRec when compiling for C99 or newer. This ensures that sizeof(InternalCallbackRec) is 16 (since it now includes the required 12 byte padding up to the first XtCallbackRec). This also ensures that alignof(InternalCallbackRec) is 16, but that doesn't matter in this case since malloc() will always return a sufficiently-aligned pointer. I also changed ToList(p) to use the flexible array member directly when compiling for C99. This is not a functional change since it will evaluate to the same pointer, but it does add additional type checking and ensures that only a `InternalCallbackRec *` can be passed to the macro. Signed-off-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
2021-06-27Fix XrmResource layout if pointers are bigger than longAlex Richardson
On CHERI-enabled architectures (e.g. Arm's Morello), pointers are twice the size of addresses (i.e. 128 bits for Morello, 64 bits for 32-bit RISC-V). However, XtArgVal is currently defined as long, so it cannot be used to store pointers on these architectures. Also add a _Static_assert() when compiling with C11 support to check that the offset of the last member matches that of XtResource. Signed-off-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
2021-06-27Cast via intptr_t when converting integers to pointersAlex Richardson
I found these by compiling libXt with the CHERI Clang compiler, as it warns about conversions from integer to pointer that do not use intptr_t. Signed-off-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
2021-06-27Use XtUIntPtr for integer types that can hold pointersAlex Richardson
Various Xt*Id types are integer types that are used to hold pointers. Use uintptr_t for standards-compliant conversion and to support architectures where long cannot hold pointers (e.g. CHERI). I found these by compiling libXt with the CHERI Clang compiler, as it warns about conversions from integer to pointer that do not use intptr_t. Signed-off-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
2021-06-27XtArgVal: Support architectures where pointers are bigger than longAlex Richardson
On CHERI-enabled architectures (e.g. Arm's Morello), pointers are twice the size of addresses (i.e. 128 bits for Morello, 64 bits for 32-bit RISC-V). However, XtArgVal is currently defined as long, so it cannot be used to store pointers on these architectures. This commit changes XtArgVal to use intptr_t instead, which should be long on most architectures but is larger for CHERI. It also introduces XtIntPtr/XtUIntPtr which will be used in follow-up changes. This commit should also help on LLP64 ABIs where long is 32 bits but pointers are 64 bits. I am not sure what the compiler and C standard requirements are, so I've guarded the use of stdint.h with `#if __STDC_VERSION__ >= 199901L`. I've also added a _Static_assert() when compiling in C11 mode to statically verify that the XtArgVal type requirements are met. Signed-off-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
2021-06-16Define LONG64 if __SIZEOF_LONG__ indicates 64-bit longAlex Richardson
All modern compilers (GCC>=4.6, Clang>=3.0) define this macro, so we can use it to detect 64-bit longs without adding to the architecture list. This change is needed to successfully run xeyes on a FreeBSD CHERI-RISC-V QEMU VM via SSH forwarding. See also https://gitlab.freedesktop.org/xorg/proto/xorgproto/-/merge_requests/41 Signed-off-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk>
2021-01-24libXt 1.2.1libXt-1.2.1Matt Turner
Signed-off-by: Matt Turner <mattst88@gmail.com>
2020-02-05_XtCalloc actually uses a Cardinal, not size_tThomas E. Dickey
2019-12-22add errorhandling to _XtVaToTypedArgList()Walter Harms
to make it behave like _XtVaToTypedArgList() add some checks and make sure that all args are propper initialized. also replace Malloc with Calloc and get arg check for free Signed-off-by: Walter Harms <wharms@bfs.de>
2019-12-22Merge branch 'master' of ssh://gitlab.freedesktop.org/xorg/lib/libxtWalter Harms
2019-12-22refactoring, reduce indent levelWalter Harms
Signed-off-by: Walter Harms <wharms@bfs.de>