On Mon, 8 Nov 2010, Vasiliy Kulikov wrote:

> Hi,
> 
> Current coccinelle doesn't properly format blank structures
> initializations:
> 
> $ spatch -version
> spatch version 0.2.4rc5 with Python suppor
> 
> @@
> identifier T, x, f;
> @@
> 
> f(...)
> {
>  ...
>  struct T x
> + = {}
>  ;
>  ...
> }
> 
> 
> diff -u -p a/power/apm_power.c b/power/apm_power.c
> --- a/power/apm_power.c 2010-09-17 19:20:36.000000000 +0400
> +++ b/power/apm_power.c 2010-11-08 22:05:15.000000000 +0300
> @@ -71,7 +71,9 @@ static int __find_main_battery(struct de
>  
>  static void find_main_battery(void)
>  {
> -   struct find_bat_param bp;
> +   struct find_bat_param bp= {
> +
> +   };
>     int error;
>  
>     memset(&bp, 0, sizeof(struct find_bat_param));
> --
> 
> The proper version is 
> 
> -   struct find_bat_param bp;
> +   struct find_bat_param bp= {};

OK, thanks for the report.  I guess there should be a space before the = 
as well.

julia
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to