Attention is currently required from: arehbein, laforge, neels, pespin.
daniel has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/35079?usp=email )
Change subject: osmo_io: Remove union in struct osmo_io_ops ......................................................................
Patch Set 4:
(2 comments)
File src/core/osmo_io.c:
https://gerrit.osmocom.org/c/libosmocore/+/35079/comment/1bcca390_cafaad48 PS3, Line 546: if (iofd->io_ops.read_cb)
ah ok, read_cb happens to be in the same place as recvfrom_cb, so only checking the one location wor […]
This fix is only necessary after removing the union. I don't see how you could realize checking the exact member with the union in place. I can basically stick an ```c OSMO_ASSERT(&iofd->io_ops.read_cb == &iofd->io_ops.recvfrom_cb) ``` in here. Unless I'm missing something this is exactly the feature of the union, afterwards you can't know whether this memory location was set as read_cb or recvfrom_cb.
File src/core/osmo_io.c:
https://gerrit.osmocom.org/c/libosmocore/+/35079/comment/813d11cc_3e337a84 PS4, Line 391: || (iofd->mode == OSMO_IO_FD_MODE_RECVFROM_SENDTO && iofd->io_ops.recvfrom_cb));
this code should also work with the union present?
It "works" in the sense that it even returns true if mode == *_READ_WRITE and .recvfrom_cb (or the other way around) is set since both function pointers are sharing the same memory location.