> ../hw/xwin/InitOutput.c: In function ‘XwinExtensionInit’:
> ../hw/xwin/InitOutput.c:142:5: warning: ‘LoadExtensionList’ reading 12 bytes from a region of size 0 [-Wstringop-overread]
> 142 | LoadExtensionList(xwinExtensions, ARRAY_SIZE(xwinExtensions), TRUE);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../hw/xwin/InitOutput.c:142:5: note: referencing argument 1 of type ‘const ExtensionModule[0]’
> In file included from ../include/extnsionst.h:53,
> from ../randr/randrstr.h:40,
> from ../hw/xwin/win.h:174,
> from ../hw/xwin/InitOutput.c:35:
> ../include/extension.h:100:23: note: in a call to function ‘LoadExtensionList’
> 100 | extern _X_EXPORT void LoadExtensionList(const ExtensionModule ext[],
> | ^~~~~~~~~~~~~~~~~
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
> In function ‘ConvertAddr’,
> inlined from ‘ResetHosts’ at ../os/access.c:1014:26:
> ../os/access.c:1540:25: warning: ‘saddr’ may be used uninitialized [-Wmaybe-uninitialized]
> 1540 | if (16777343 == *(long *) &((struct sockaddr_in *) saddr)->sin_addr)
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../os/access.c: In function ‘ResetHosts’:
> ../os/access.c:908:7: note: ‘saddr’ declared here
> 908 | } saddr;
> | ^~~~~
The union isn't needed at all, we're just using one of the fields anyways.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
the target struct type defines char* fields, but we're sure they'll
never be written into, so just add typecast for silencing the warning.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
a) trade a little bit of code size for speed
(depending on exact caller, compiler might also optimize a lot)
b) reduce the need for exported, but non-public symbol
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Since xtrans is now in-tree and already have been trimmed down
for only things needed by the Xserver, the split between xstrans.c
and transport.c isn't needed anymore.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
add some macros for making request handlers and byte swapping easier:
* X_REQUEST_HEAD_STRUCT(type) and X_REQUEST_HEAD_AT_LEAST(type)
declare header struct pointers and check size
* X_REQUEST_FIELD_CARD16(field)
swaps a CARD16 (word) header field (if neccessary)
* X_REQUEST_FIELD_CARD32(field)
swaps a CARD32 (dword) header field (if neccessary)
* X_REQUEST_REST_CARD16()
swaps remaining CARD16 array payload (if necessary)
* X_REQUEST_REST_CARD32()
swaps remaining CARD32 array payload (if necessary)
* X_REQUEST_REST_COUNT_CARD16(count)
check swaps `count` CARD16 payload fields and checks size
* X_REQUEST_REST_COUNT_CARD32(count)
check swaps `count` CARD32 payload fields and checks size
How to use them:
1. put X_REQUEST_HEAD_STRUCT() or X_REQUEST_HEAD_AT_LEAST() ontop of each Proc*()
2. add X_REQUEST_FIELD_*() et al below, for all fields to be swapped and
drop the corresponding SProc*()'s
3. let the dispatchers call Proc*() instead of SProc*()
Notes:
* the length field is already swapped before request handlers called
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Current code walks along all screens and initializes screen resources,
then gc's, stipples, root windows for each of them, hence after
the first screen registering new private keys is no more possible.
This crashes modesetting driver if it is not initialized before others.
This patch makes screen resources for all screen initialize first, hence
all necessary private keys (including of the type PRIVATE_WINDOW) are
initialized before root windows are created.
Signed-off-by: Oleh Nykyforchyn <oleh.nyk@gmail.com>
The space needed to store these extra values is at worst a few dozen bytes.
In exchange for these, larger cursors glyphs can use a more optimal cursor size.
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
Make the code a bit easier to read by using initialization of the reply
structs, at the point of declaration. Most of them aren't written to later,
just passed into WriteReplyToClient(). Also dropping some useless zero
assignments (struct initializers automatically zero-out unmentioned fields).
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
After the dmabuf fd exported by another screen is imported to a pixmap,
the pixmap holds a reference for the buffer, thus the FD itself finished
its job and needs to be closed to prevent a stale reference to the
buffer.
Signed-off-by: Icenowy Zheng's avatarIcenowy Zheng <uwu@icenowy.me>
Adding a new header for math related functions, beginning with new
MIN/MAX macros, which will be used by subsequent commits.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Nothing in there that we need, include <regionstr.h> instead.
But keeping the file in place, until all external consumer have
been migrated.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Added a workflow to check the commit messages of a PR to make sure each is
signed off by the author. A repo token is required, here named SECRET_TOKEN,
which has access to read and write PR comments.
Signed-off-by: JSOwens <josephs.owens@gmail.com>