On Thu, Mar 11, 2021 at 18:47:37 +0000, Daniel P. Berrangé wrote:
On Thu, Mar 11, 2021 at 06:54:20PM +0100, Michal Privoznik wrote:
> Historically, we declared pointer type to our types:
>
> typedef struct _virXXX virXXX;
> typedef virXXX *virXXXPtr;
>
> But usefulness of such declaration is questionable, at best.
> Unfortunately, we can't drop every such declaration - we have to
> carry some over, because they are part of public API (e.g.
> virDomainPtr). But for internal types - we can do drop them and
> use what every other C project uses 'virXXX *'.
>
> This change was generated by a very ugly shell script that
> generated sed script which was then called over each file in the
> repository. For the shell script refer to the cover letter:
>
> $URL
>
> Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
> ---
> docs/advanced-tests.rst | 2 +-
> docs/api_extension.html.in | 2 +-
> docs/coding-style.rst | 2 +-
snip
> tools/virt-login-shell-helper.c | 4 +-
> tools/vsh-table.c | 36 +-
> tools/vsh-table.h | 12 +-
> tools/vsh.c | 4 +-
> 732 files changed, 29237 insertions(+), 30131 deletions(-)
Converting every single file at the same time in one commit is
guaranting backporting conflict hell.
eg if I'm backporting a patch from src/qemu, it is much
saner if I can cherry-pick the "Ptr" conversion from src/qemu
and only deal with conflicts in that, not the entire soure
tree.
I don't think it's a good idea to try to backport anything from this
patch. There's no need to do so, upstream will strictly use types
without Ptr and all of them already exist upstream. Backporting any
future changes to the code which still has *Ptr should not cause any
issues. Except for moving big parts of code (but such change would
likely conflict for other reasons too) and trivial context when the
patch touches lines close to virSomethingPtr.
Jirka