Hi Keith,
On 6/24/22 05:13, Keith wrote:
Often I struggle to understand memory allocations and
the "weird" things
of C, so please point out to me what I'm missing here (I must be wrong,
because you guys would not miss this, right?
cleared_ci = (struct osmo_mgcpc_ep_ci){
.ep = ep,
.mgcp_client_fi = ci->mgcp_client_fi,
.got_port_info = ci->got_port_info,
.rtp_info = ci->rtp_info,
.occupied = true,
/* .pending = true follows below */
.verb = verb,
.notify = {
.fi = notify,
.success = event_success,
.failure = event_failure,
.data = notify_data,
}
};
ci->verb_info is being initialized to 0 in here, since the field doesn't
show up.
Same as if you you did "cleared_ci = (struct osmo_mgcpc_ep_ci){};"
everything within the struct will be initialized as 0. Actually, not
everything, only the struct fields. Padding bytes may be kept uninitialized.
Regards,
Pau
--
- Pau Espin Pedrol <pespin(a)sysmocom.de>
http://www.sysmocom.de/
=======================================================================
* sysmocom - systems for mobile communications GmbH
* Alt-Moabit 93
* 10559 Berlin, Germany
* Sitz / Registered office: Berlin, HRB 134158 B
* Geschaeftsfuehrer / Managing Director: Harald Welte