Re: [PATCH 05/11] make red_pipe_item_init_full more typesafe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 23, 2016 at 05:57:52AM -0400, Frediano Ziglio wrote:
> You didn't understand the problem, this is not enough
> as a refactory of this would require a complete code scan
> as currently is (was?) needed, you have to check for every
> cast.

You did not explicitly state the problem either ;) I'm guessing that
you want to get a compile-time error in every places where there is a
cast from child class to base class (or the opposite)?

Personnally I'd consider that once you have one class inheriting from
another, then the parent instance has to be the first field in the child
instance struct, and that if you change that, you should expect quite
some pain (ie need to grep for both type names and check each use).
Since I don't consider changing the class hierarchy to be something
we'll do often, especially in the PipeItem case, this is why I'd just go
with casts and at most this static check near the struct definition.

Christophe

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]