From 7f0d29bc6b722a44191aaa06daa01c983e82c66e Mon Sep 17 00:00:00 2001 From: knarf Date: Tue, 23 Nov 2010 19:28:02 +0000 Subject: support __unused__ where known. This let's e.g. gcc know that especially the Cactus variables might be unused and should not be reported as such. This closes ET ticket #1 git-svn-id: http://svn.cactuscode.org/flesh/trunk@4651 17b73243-c579-4c4c-a9d2-2d5706c11dac --- lib/sbin/create_c_stuff.pl | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'lib/sbin/create_c_stuff.pl') diff --git a/lib/sbin/create_c_stuff.pl b/lib/sbin/create_c_stuff.pl index 124fd560..3277c15f 100644 --- a/lib/sbin/create_c_stuff.pl +++ b/lib/sbin/create_c_stuff.pl @@ -172,11 +172,10 @@ sub GetThornParameterList sub CreateCStructureParameterHeader { my($prefix, $structure, $rhparameters, $rhparameter_db) = @_; - my($line,@data,@use); + my($line,@data); my(%parameters); my($type, $type_string); my(@definition); - my(@use); # Create the structure push(@data, '#ifdef __cplusplus'); @@ -207,8 +206,7 @@ sub CreateCStructureParameterHeader my $realname = $rhparameter_db->{"\U$rhparameters->{$parameter} $parameter\E realname"}; push(@data, " $type_string $realname$suffix;"); - push(@definition, " $type_string$varprefix const $parameter = $structure.$realname; \\"); - push(@use, " $delim dummy\_$structure\_$parameter = sizeof( $parameter ) \\"); + push(@definition, " CCTK_DECLARE_INIT ($type_string$varprefix const, $parameter, $structure.$realname); \\"); $delim = ','; } @@ -228,12 +226,6 @@ sub CreateCStructureParameterHeader push(@data, "#define DECLARE_${structure}_PARAMS \\"); push(@data, @definition); - if( @use ) - { - push(@data, " enum { \\"); - push(@data, @use); - push(@data, " }; \\"); - } push(@data, "\n"); # workaround for perl 5.004_04 to add a trailing newline -- cgit v1.2.3