core: revert removed explicit init & add missing init
-
vlc_stream_CustomNew()
usesvlc_custom_create()
which usescalloc()
. -
vlc_stream_CustomNew()
additionally initialised most attributes toNULL
/0
/false
(some were missing). - Functions using
vlc_stream_CustomNew()
further such initialised some attributes.
Patches removing the explicit initialisation (because I felt it was redundant) got merged in !1104 (merged) from a last minute addition that got overlooked. A revert of these patches has been requested (see !1104 (merged) discussion).
The basis for reverting is because explicit initialisation is preferred even if redundant. There is a portability issue at play here. The C standard says that an "integral constant expression" of 0
assigned to or compared with a pointer is interpreted as being a null pointer. Thus ptr = 0
means set to a null pointer and ptr == 0
compares with a null pointer, which we often do indirectly via the NULL
define, but this does not mean that a null pointer is necessarily a memory address of zero which is up to the underlying platform to decide. A call to calloc()
or memset(ptr, 0, n)
guarantee that memory is set to zero. Portably, use of those functions cannot be considered to correctly initialise pointers to be null pointers, just as is the same for correctly initialising floats/doubles to a value of 0.0
which is not necessarily an all-zero-bit pattern.
- The first commit reverts b10f5a02, restoring the (actually redundant) init done by users of
vlc_stream_CustomNew()
. - The second commit reverts 830ea36e, restoring the explicit init done by
vlc_stream_CustomNew()
. - The third commit adds missing attributes to the set
vlc_stream_CustomNew()
explicitly initialises to make the explicit init complete.
Merge request reports
Activity
- Resolved by Lyndon Brown
added MRStatus::InReview label
added MRStatus::Acceptable label and removed MRStatus::InReview label
mentioned in merge request !1104 (merged)
added MRStatus::Accepted label and removed MRStatus::Acceptable label
MR Acceptance result
This MergeRequest has been Accepted! Congratulations.MR acceptance checks details:
-
MR should be considered mergeable by Gitlab -
Last pipeline should be successful -
MergeRequest should have at least one external review and/or vote -
All threads should be resolved, have votes and score > 0 -
MergeRequest should have no activity (threads/votes) for (72h/72h)
-
added 91 commits
-
fc58043d...a7d0549c - 88 commits from branch
videolan:master
- f6dad0e9 - Revert "core: remove pointless re-initialisation of `stream_t` attributes"
- cb54d4d5 - Revert "stream: remove pointless & incomplete initialisation"
- a9dd4b14 - stream: add missing explicit initialisation
Toggle commit list-
fc58043d...a7d0549c - 88 commits from branch
enabled an automatic merge when the pipeline for a9dd4b14 succeeds
changed milestone to %4.0