[MPlayer-dev-eng] Re: [PATCH] esd: support non-default tcp port

Németh Márton nm127 at freemail.hu
Sun Oct 9 23:51:14 CEST 2005


Hi,

In this patch the AO_ESD_FREE_BUFFER was removed. I am using now the code:

	if (server) free(server);

but in the "ISO/IEC 9899 - Programming languages - C", Chapter 7.20.3.2: 
"The free function", one can read the following
(The document is available from: 
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf ) :

 > 	void free(void *ptr);
 >
 > The free function causes the space pointed to by ptr to be
 > deallocated, that is, made available for further allocation.
 > If ptr is a null pointer, no action occurs.

This means, that
	free(server);
maybe enough, and we do not have to test against NULL.

Is it working so in the practice, too?

	NMarci

Alban Bedel írta:
> On Sun, 09 Oct 2005 20:36:17 +0200
> Németh Márton <nm127 at freemail.hu> wrote:
> 
> 
>>+#define AO_ESD_OVERWRITES_PARAMETER
>>+
>>+#ifdef AO_ESD_OVERWRITES_PARAMETER
>>+#define AO_ESD_FREE_BUFFER(var_name)	if (var_name) free(var_name);
>>+#else
>>+#define AO_ESD_FREE_BUFFER(var_name)
>>+#endif
> 
> 
> All this pre-processor madness is not really usefull. I can't see
> why one would want to disable only that part of the code.
> imho it would be much simpler and cleaner w/o all the #ifdef.
> 
> 	Albeu
> 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: esd_tcp_port3.patch
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20051009/9c4d486e/attachment.asc>


More information about the MPlayer-dev-eng mailing list