Re: Add vorbis_dsp_init() ?

Conrad Parker <[email protected]>
Newsgroups gmane.comp.multimedia.ogg.vorbis.devel
Message-ID <[email protected]>
2009/3/15 [email protected] <[email protected]>:
>> Is a memset of zeros also promised to create proper null pointers just
>> as assigning with zero?  (The value in memory for a null pointer isn't
>> guarenteed to be the all zero bit sequence)
>
> Pedantically, I think not (though I'm very hazy with the distinction
> of the null pointer and its bit pattern that can be non zeros).
> Are you aware of an implementation that does this ? I do recall
> eerie discussions about assigments of a pointer with 0 yielding
> this non zero bit pattern, but that was years ago.
>
> Moreover, I'm entirely in the dark what would then happen to:
>
> void foo(char *p)
> {
>  if (p) *p=0;
> }
>
> Would the test of p test against the null pointer, or cast p to an
> int, then test this int ?

http://c-faq.com/null/

esp. read 5.13 a few times.

(Basically: runtime assigned zero value is not guaranteed to be
equivalent to NULL (whereas compile-time constant 0 is), but like you
say it happens to work on all current systems).

Back to the patch in question, we can drop the bit that removed the
explicit 0 and NULL assignments, and I'm still waiting on feedback
about the appropriateness of adding the public vorbis_dsp_init()
function.

Conrad.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.