xserver/randr
Enrico Weigelt, metux IT consult 5b13d85464 randr: refine allocation and copying of optional buffers
Simplifying the code flow allocating/checking/copying some buffers in
RRConfigureOutputProperty() and RRConfigureProviderProperty() so it's
easier to understand for both the human reader as well as the analyzer.

Depending on whether we have elements to process, a temporary buffer needs
to be allocated, checked for successful allocation and copy over data. The
way it's currently done is technically correct, but unnecessarily complex to
understand: instead of just branching on whether there are elements and doing
all the buffer-related things only then, the branching is done just somewhere
in the middle, only on checking for allocation failure, and relying on both
calloc() and memcpy() not doing weird things when size is zero.

It's easy to simplify by putting it all behind one if statement and so make
things easier for both human reader as well as the analyzer (so it's not
spilling out false alarms here anymore) and also drops unnecessary calls
in the zero-size case.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
2025-06-12 16:32:09 +02:00
..
meson.build meson: hide C API if Xorg is disabled (like autotools) 2021-03-11 00:22:36 +00:00
randr.c randr: move remaining dispatch prototypes to rrdispatch.h 2025-06-12 16:27:20 +02:00
randrstr.h randr: unexport and document RRXineramaExtensionInit() 2025-06-12 16:29:59 +02:00
randrstr_priv.h randr: unexport and document RRTransformCopy() 2025-06-12 16:30:10 +02:00
rrcrtc.c randr: unexport and document RRInit() 2025-06-12 16:27:28 +02:00
rrdispatch.c randr: unexport screen related request handlers 2025-06-12 16:27:05 +02:00
rrdispatch_priv.h randr: move remaining dispatch prototypes to rrdispatch.h 2025-06-12 16:27:20 +02:00
rrinfo.c randr: unexport and document RROutputSetSubpixelOrder() 2025-06-12 16:28:53 +02:00
rrlease.c randr: move remaining dispatch prototypes to rrdispatch.h 2025-06-12 16:27:20 +02:00
rrmode.c randr: unexport mode related request handlers 2025-06-12 16:27:11 +02:00
rrmonitor.c randr: move remaining dispatch prototypes to rrdispatch.h 2025-06-12 16:27:20 +02:00
rroutput.c randr: unexport and document RROutputSetSubpixelOrder() 2025-06-12 16:28:53 +02:00
rrpointer.c randr: unexport and document RRCrtcGetScanoutSize() 2025-06-12 16:27:50 +02:00
rrproperty.c randr: refine allocation and copying of optional buffers 2025-06-12 16:32:09 +02:00
rrprovider.c randr: unexport provider related request handlers 2025-06-12 16:27:17 +02:00
rrproviderproperty.c randr: refine allocation and copying of optional buffers 2025-06-12 16:32:09 +02:00
rrscreen.c randr: unexport screen related request handlers 2025-06-12 16:27:05 +02:00
rrsdispatch.c randr: unexport screen related request handlers 2025-06-12 16:27:05 +02:00
rrtransform.c randr: unexport and document RRTransformInit() 2025-06-12 16:30:01 +02:00
rrtransform.h randr: unexport and document RRTransformCopy() 2025-06-12 16:30:10 +02:00
rrxinerama.c randr: use struct initializer for reply structs 2025-02-24 20:30:26 +00:00