summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-02-11unifdef AIXSHLIB & SUNSHLIBHEADmasterAlan Coopersmith6-265/+2
AIXSHLIB was only set in the Imake configs for AIX versions < 5 SUNSHLIB was only set in the Imake configs for SunOS versions < 5 Neither has ever been set in the autoconf configs Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-02-11unifdef __EMX__Alan Coopersmith1-4/+0
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-02-11unifdef VMSAlan Coopersmith7-23/+0
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-02-11unifdef USGAlan Coopersmith1-23/+0
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-02-11unifdef MOTOROLAAlan Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-02-11unifdef AIXV3Alan Coopersmith2-7/+2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-02-11unifdef __osf__Alan Coopersmith2-3/+3
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-02-11unifdef hpuxAlan Coopersmith2-24/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-02-11unifdef sgiAlan Coopersmith2-3/+2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2024-02-11unifdef ultrixAlan Coopersmith1-7/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-11-12quiet a couple of unused-parameter warningsThomas E. Dickey2-2/+2
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2023-11-12eliminate an unnecessary castThomas E. Dickey1-1/+1
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2023-11-12Add continue_to_dispatch parameter to _XtResourceConfigurationEH()Thomas E. Dickey3-4/+6
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2023-11-12remove substitution for EXEEXT_FOR_BUILD, not defined in automakeThomas E. Dickey1-1/+0
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2023-11-12issue #20: c23 boolean conflictThomas E. Dickey1-2/+2
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2023-09-18README.md: update & correct links to O'Reilly X Toolkit booksAlan Coopersmith1-6/+11
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. Dickey1-0/+4
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. Dickey1-0/+3
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. Dickey2-2/+2
2023-04-09libXt 1.3.0libXt-1.3.0Alan Coopersmith1-2/+2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-03-07Replace XtMalloc() calls with XtMallocArray()Alan Coopersmith22-114/+91
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-03-07Replace XtRealloc() calls with XtReallocArray()Alan Coopersmith17-106/+79
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-03-07Add XtReallocArray() for overflow checking of multiplied argsAlan Coopersmith7-15/+264
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 Coopersmith3-1/+508
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2023-03-04configure: Use LT_INIT from libtool 2 instead of deprecated AC_PROG_LIBTOOLAlan Coopersmith1-1/+1
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 Coopersmith45-45/+45
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 Coopersmith1-16/+8
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 Coopersmith1-0/+1
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 Coopersmith1-1/+1
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 Coopersmith4-17/+20
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 Coopersmith1-21/+4
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 Coopersmith3-3/+6
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 Coopersmith3-18/+16
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 Coopersmith12-64/+60
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 Coopersmith1-2/+2
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-07-17Fix spelling/wording issuesAlan Coopersmith3-5/+5
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 Coopersmith1-1/+1
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2022-06-20update copyright-dateThomas E. Dickey1-1/+1
2022-06-20Support buttons > 5 in translation tables [v2]Keith Packard2-16/+48
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. Dickey1-4/+3
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-06-18cppcheck fixes (const, null dereferencing, uninitialized, scope)Thomas E. Dickey16-48/+53
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-06-18fixes for gcc13 warningsThomas E. Dickey3-1/+6
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-06-18cppcheck and clang --analyze fixesThomas E. Dickey12-19/+28
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-06-14codespell-fixesThomas E. Dickey25-53/+53
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2022-06-14add _X_NORETURN to agree with header-fileThomas E. Dickey4-8/+8
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
2021-12-02gitlab CI: add a basic build testAlan Coopersmith1-0/+102
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2021-06-27Fix InternalCallbackRec layout if pointers are bigger than 64 bitsAlex Richardson2-1/+9
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 Richardson1-4/+9
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 Richardson6-8/+8
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 Richardson1-5/+5
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>