Instead of using our own Use x_rpcbuf_t for assembling and
byte-swapping the reply payload.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Since nothing on WIN32 (mingw) targets is calling uname() anymore,
this compat code is now obsolete.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Simplify DefineSelf() by using xhostname(). Neither need to
care about OS specifics here, nor take care of zero-terminating the
hostname string - xhostname() is already doing this.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Now that we have the OS layer xhostname() wrapper, we don't need the
_XSERVTransGetHostname() function anymore.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Simplify set_font_authorizations() by using xhostname(). Neither need to
care about OS specifics here, nor take care of zero-terminating the
hostname string - xhostname() is already doing this.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Simplify DoSubstitution() by using xhostname(). Neither need to
care about OS specifics here, nor take care of zero-terminating the
hostname string - xhostname() is already doing this.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Simplify vfbWriteXWDFileHeader() by using xhostname(). Neither need to
care about OS specifics here, nor take care of zero-terminating the
hostname string - xhostname() is already doing this.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This little helper does the OS specific part for gethostname()
calls. It's putting the result into a fixed-length struct and making
sure it's properly filled and the string is always zero-terminated.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Move down reply struct declaration/assignment and byte-swapping to
right before the write-out.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
* declare and assign in one shot
* move down reply struct declaration to where it's needed
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
* declare and assign them right where they're needed, in one shot
* drop unnecessary assignment and byte-swap of zero values
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
FlushClient() does drops the output buffer, when it becomes empty.
This previously wasn't any problem and actually intented, because we've
returned from the write path directly after FlushClient() was called.
But now we've changed the call order, so it's called from within
OutputBufferMakeRoom(), so we need to make sure we always got valid
output buffer before trying to access it.
For the future, we should think about whether dropping output buffers
really makes sense at all. Instead we could leave them as they are
(over the client's lifetime) and maybe just trim when they've went
too big.
Fixes: 1c13cfa6ca
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Reducing the ifdef-zoo a bit by moving the platform specific socket
close calls into separate function. On win32, this also checks the
retval and potentially query for error. On Unix, just calling close().
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Reducing the ifdef-zoo a bit by moving the platform specific socket
ioctl calls into separate function. On win32, this also checks the
retval and potentially query for error. On Unix, just calling ioctl().
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Reduce the ifdef-zoo a bit by moving win32 specific socket layer init
into a separate function (that's no-op on non-win32).
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This will be needed by Xfbdev's keyboard driver, which cannot work
with input threads yet.
Signed-off-by: stefan11111 <stefan11111@shitposting.expert>
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Both types are already binary equal: both are enums using the same bit values,
but from compiler's perspective they're still different types, so it's warning.
> ../glamor/glamor_trapezoid.c:123:47: warning: implicit conversion from
> enumeration type 'PictFormatShort' (aka 'enum _PictFormatShort') to different
> enumeration type 'pixman_format_code_t' [-Wenum-conversion]
> 123 | image = pixman_image_create_bits(picture->format,
> | ~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~^~~~~~
> 1 warning generated.
The PICT_* fields, values and macros are relics from pre-pixman days (pixman,
historically, essentially is the PICT_* stuff moved out to separate library)
This has been a practical way for doing the transition from the old internal
PICT_* code to pixman. Now it's time to finish it all up and drop the extra
glue layer.
In order to make it smooth, and also providing backwards compatibility for
drivers (until they all keep up), just aliasing the types and adding #define's
for the enum values.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>