Skip to content

Conversation

@matt335672
Copy link
Member

The first argument to libxrdp_init() is an intptr_t / tbus value. This represents the xrdp instance which is using the library, but this value is always a struct xrdp_process * pointer.

This PR replaces the intptr_t with an incomplete type declaration at the interface between xrdp and libxrdp.

The original intention was probably to provide some separation from xrdp and the libxrdp code, but in practice this has turned out not to be useful.

This improves readability somewhat in the callbacks, and also unblocks the cppcheck 2.17.1 error in #3657, as cppcheck is no longer confused by the case of self to an intptr_t.

The first argument to libxrdp_init() is a intptr_t / tbus value. This
represents the xrdp instance which is using the library, but this value
is always a 'struct xrdp_process' pointer.

This PR replaces the intptr_t with an incomplete type declaration at
the interface between xrdp and libxrdp.

The original intention was probably to provide some separation from
xrdp and the libxrdp code, but in practice this has turned out not to be
useful.
* Initialise the XRDP library
*
* @param id Channel ID (xrdp_process* as integer type)
* @param proc XRDP instance to use with this library
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @param proc XRDP instance to use with this library
* @param id XRDP instance to use with this library

The parameter is still called id.

@firewave
Copy link
Contributor

firewave commented Nov 3, 2025

LGTM. Using the actual type is much clearer and safer.

@matt335672 matt335672 merged commit 9d46ae7 into neutrinolabs:devel Nov 4, 2025
14 checks passed
@matt335672
Copy link
Member Author

@firewave - could you try rebasing #3657?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants