speechd-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] replace several 0's with NULL's for pointer assignments


From: Trevor Saunders
Subject: [PATCH] replace several 0's with NULL's for pointer assignments
Date: Tue, 29 Mar 2011 10:57:35 -0400

On Tue, Mar 29, 2011 at 08:44:13AM -0500, William Hubbs wrote:
> I have never felt comfortable using 0 for NULL. I don't know that they
> are always the same.

well, personally I think NULL makes its clearer that its a pointer your
initializing, so I think I prefer it however I don't believe it actually
matters, iirc the c++ standard requires that they be the same and see
the C faq on the subject says that 0 in a pointer context is equivelent
to NULL, and refers to K & R see
http://c-faq.com/null/nullor0.html

Trev

> ---
>  src/server/module.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/src/server/module.c b/src/server/module.c
> index a0e122e..31d8e58 100644
> --- a/src/server/module.c
> +++ b/src/server/module.c
> @@ -124,7 +124,7 @@ OutputModule *load_output_module(char *mod_name, char 
> *mod_prog,
>  {
>       OutputModule *module;
>       int fr;
> -     char *argv[3] = {0, 0, 0};
> +     char *argv[3] = {NULL, NULL, NULL};
>       int ret;
>       char *module_conf_dir;
>       char *rep_line = NULL;
> -- 
> 1.7.3.4
> 
> 
> _______________________________________________
> Speechd mailing list
> Speechd at lists.freebsoft.org
> http://lists.freebsoft.org/mailman/listinfo/speechd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: 
<http://lists.freebsoft.org/pipermail/speechd/attachments/20110329/23a6bb90/attachment.pgp>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]