Age | Commit message (Collapse) | Author |
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
|
|
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>
|
|
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>
|
|
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>
|
|
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
|
|
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
|
|
time interval, etc., in turn requires an update to the specification version.
Update that now.
|
|
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
|
|
be updated during initialization.
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
|
|
by changing some function parameters and struct-members to _XtString
(always "char*") from String (which may be "const char *"). There are
still many compiler warnings; subsequent commits will reduce those.
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
|
|
https://invisible-island.net/xterm/xterm.faq.html#building_it
I would like to add an optional feature which makes the String typedef
"const" if _CONST_X_STRING is defined. Modifying the Intrinsic.h header
is only a partial solution because the library has not been modified to
take advantage of this (if it had, most of the const-warnings from gcc
would go away).
This change modifies the header file as well as the makestrs.c program
which generates Shell.h and StringDefs.h so that they use String-casts
rather than char*-casts (reducing the warnings seen when compiling with
Xt's header files).
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
|
|
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Like asprintf() but using XtMalloc() to tie into the Xt memory allocation
and error handling subsystems.
Bumps libXt version to 1.0.99.1 so that modules can set their pkg-config
dependency to libXt >= 1.0.99.1 to require XtAsprintf().
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
Signed-off-by: Jesse Adkins <jesserayadkins@gmail.com>
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
|
terminating element in a varargs list). A sentinel needs to be NULL,
not 0 - which doesn't make a difference on 32bit but matters on 64bit.
Furthermore it can be told that functions have a printf-like format
string and argument list so that they can verify that both match. To
use these features certain attributes need to be set - which are
compiler specific. To do this we define macros which are expanded
depending on the compiler version. For now we put those in
include/Xfuncproto.h (the XFree86 DDX layer contains a file compiler.h
which however is not visible outside the DDX) (Bugzilla #3268).
|
|
(Thomas Dickey).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|