> ../hw/xwin/winscrinit.c: In function ‘winFinishScreenInitFB’:
> ../hw/xwin/winscrinit.c:381:18: error: ‘struct _Screen’ has no member named ‘CreateWindowA’; did you mean ‘CreateWindow’?
> 381 | pScreen->CreateWindow = winCreateWindowRootless;
> | ^~~~~~~~~~~~
> ../hw/xwin/winscrinit.c:405:18: error: ‘struct _Screen’ has no member named ‘CreateWindowA’; did you mean ‘CreateWindow’?
> 405 | pScreen->CreateWindow = winCreateWindowMultiWindow;
> | ^~~~~~~~~~~~
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
> ../hw/xwin/winclipboard/xevents.c: In function ‘winClipboardSelectionNotifyData.constprop’:
> ../hw/xwin/winclipboard/xevents.c:313:23: warning: ‘codepage’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> 313 | int iUnicodeLen = MultiByteToWideChar(codepage, 0,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 314 | pszReturnData, -1, NULL, 0);
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> ../hw/xwin/winclipboard/xevents.c: In function ‘winClipboardFlushXEvents’:
> ../hw/xwin/winclipboard/xevents.c:550:35: warning: ‘codepage’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> 550 | int iConvertDataLen = WideCharToMultiByte(codepage, 0,
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 551 | (LPCWSTR) pszGlobalData, -1,
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 552 | NULL, 0, NULL, NULL);
> | ~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Windows headers are pretty nitpicking about include order:
> In file included from /usr/i686-w64-mingw32/include/X11/Xwinsock.h:57,
> from /usr/i686-w64-mingw32/include/xcb/xcb_windefs.h:34,
> from /usr/i686-w64-mingw32/include/xcb/xcb.h:41,
> from ../hw/xwin/winmultiwindowicons.c:43:
> /usr/share/mingw-w64/include/winsock2.h:15:2: warning: #warning Please include winsock2.h before windows.h [-Wcpp]
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
No need to directly hard-crash the Xserver when strdup() fails, instead
try to handle the situation gracefully.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Little helper function for checking whether a resource XID
belongs to the server itself.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Retrieves the ClientPtr for the owner of given resource.
This way reducing the sites directly accessing clients[] array.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Make it type-safe and a bit more obvious what it really does,
also adding some inline documentation. Since it's just some
bit shifting magic, it's qualified for inlining.
The CLIENT_ID() macro isn't used by any external modules, so the
new function doesn't need to be in a public header.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Hide internals (drop the need to include windowstr.h), make it typesafe
as well as the naming easier to understand.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
XID = 0 already is used as sign for error in several places,
so let's use that here, too.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
The old PCCONS driver only seems to be used on minimal install disks and
cannot coexist with newer ones (at least that's the feedback I've gotten
from BSD community), so there's probably no practical use case for
supporting it in Xorg anymore.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Now that the name clash on GC type between Xserver and xlib has been fixed,
there's no need to do the special renaming hack anymore.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Both xlib as well as the Xserver use the same identifier "GC" for
different types. While on xlib it's just the numerical ID of a GC,
the xserver defines a struct for it by the same name. This is this
ugly and needs ridiculous hacks for Xserver code that needs xlib.
Easy to solve by just renaming the GC typedef to GCRec (consistent
with how we're naming other structs) and replacing GC* by GCPtr.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
The function actually operates on ClientRec, so we can pass it in
directly, so it doesn't need to fetch it from clients[] array itself.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Not used by anybody, neither Xserver nor drivers, so no need to
keep it around any longer.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.
The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.
The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.
The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.
The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.
The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.
The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.
The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.
The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.
The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.
The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Using calloc() instead of malloc() as preventive measure, so there
never can be any hidden bugs or leaks due uninitialized memory.
The extra cost of using this compiler intrinsic should be practically
impossible to measure - in many cases a good compiler can even deduce
if certain areas really don't need to be zero'd (because they're written
to right after allocation) and create more efficient machine code.
The code pathes in question are pretty cold anyways, so it's probably
not worth even thinking about potential extra runtime costs.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Not used anywhere, neither Xserver nor drivers, so no need to keep it anymore.
According to git history, it had been introduced introduced in 2003 (*1),
but never called (inside the Xserver) - unclear whether it ever had been
actually used somewhere.
*1) 9508a382f8
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
There doesn't seem to be any driver for these cards anymore,
so no need for trying to probe them anymore.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
There doesn't seem to be any sungt driver anymore, so no need for
trying to probe those cards any longer.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
There doesn't seem to be any suncg12 driver anymore, so no need for
trying to probe those cards any longer.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
There doesn't seem to be any suncg8 driver anymore, so no need for
trying to probe those cards any longer.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
There doesn't seem to be any suncg4 driver anymore, so no need for
trying to probe those cards any longer.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
There doesn't seem to be any suncg2 driver anymore, no need for trying
to probe those cards any longer.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
There doesn't seem to be any sunbw2 driver anymore, so no need for trying
to probe those cards any longer.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
It's always enabled for very long time now (at least since meson transition),
there doesn't seem to be any need to ever disable it again. So we can reduce
code complexity by removing all the ifdef's.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new PostCreateScreenResources screen hook instead.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Right now, extensions that need to be called after the CreateScreenResources
proc had been run, must wrap the screen proc vector directly (all of them
forming kind of daisy chain), and so - when called - temporarily restore the
previous one, call it, wrap again, and if the call was successful finally
doing it's own stuff. (same is done for many other procs)
While that approach is looking nice and elegant on the drawing board, it's
complicated, dangerous like a chainsaw and makes debugging hard, leading to
pretty blurred API borders.
Instead introducing a simple approach for letting extension hook into a
post-CreateScreenResources callback list safely, w/o having to care much
about side effects with the call chain. Extensions now can simply register
their business logic and get called back - w/o ever having to mess with the
ScreenRec's internal structures.
Note that these hooks are executed *AFTER* the original CreateScreenResources()
proc had been called SUCCESSFULLY (returned TRUE), so callees can rely on
the DDX/driver had already done it's job.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Wrapping ScreenRec's function pointers is problematic for many reasons,
so use the new screen close notify hook instead.
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>