diff options
author | schnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2005-09-28 17:09:31 +0000 |
---|---|---|
committer | schnetter <schnetter@17b73243-c579-4c4c-a9d2-2d5706c11dac> | 2005-09-28 17:09:31 +0000 |
commit | eb75db00165b16e86b94f9aa56c61f8fea601dc3 (patch) | |
tree | 3c0986245ee4fceccc0691b5a7343c89767a9742 /lib/sbin/create_c_stuff.pl | |
parent | e550a14b85001e57fdd4ee65bfdfb272d0254735 (diff) |
Undo changes that prevent more unwanted warnings about unused variables.
git-svn-id: http://svn.cactuscode.org/flesh/trunk@4155 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/create_c_stuff.pl')
-rw-r--r-- | lib/sbin/create_c_stuff.pl | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/sbin/create_c_stuff.pl b/lib/sbin/create_c_stuff.pl index bbd1059e..9c541bac 100644 --- a/lib/sbin/create_c_stuff.pl +++ b/lib/sbin/create_c_stuff.pl @@ -176,6 +176,7 @@ sub CreateCStructureParameterHeader my(%parameters); my($type, $type_string); my(@definition); + my(@use); # Create the structure push(@data, '#ifdef __cplusplus'); @@ -186,6 +187,7 @@ sub CreateCStructureParameterHeader push(@data, 'extern struct'); push(@data, '{'); + push(@use, " const void *${structure}_use = ( \\"); foreach $parameter (&order_params($rhparameters, $rhparameter_db)) { my $type = $rhparameter_db->{"\U$rhparameters->{$parameter} $parameter\E type"}; @@ -205,8 +207,11 @@ sub CreateCStructureParameterHeader my $realname = $rhparameter_db->{"\U$rhparameters->{$parameter} $parameter\E realname"}; push(@data, " $type_string $realname$suffix;"); - push(@definition, " CCTK_DECLARE_INIT ($type_string$varprefix const, $parameter, $structure.$realname); \\"); + push(@definition, " $type_string$varprefix const $parameter = $structure.$realname; \\"); + push(@use, " ${structure}_use = \&$parameter, \\"); } + push(@use, " &${structure}_use \\"); + push(@use, ' );'); # Some compilers don't like an empty structure. if((keys %$rhparameters) == 0) @@ -224,7 +229,7 @@ sub CreateCStructureParameterHeader push(@data, "#define DECLARE_${structure}_PARAMS \\"); push(@data, @definition); -## push(@data, @use); + push(@data, @use); push(@data, "\n"); # workaround for perl 5.004_04 to add a trailing newline @@ -239,7 +244,7 @@ sub order_params my(@int_params) = (); my(@string_params)= (); - foreach $parameter (sort keys %$rhparameters) + foreach $parameter (sort(keys %$rhparameters)) { $type = $rhparameter_db->{"\U$rhparameters->{$parameter} $parameter\E type"}; |