summaryrefslogtreecommitdiff
path: root/lib/sbin/create_c_stuff.pl
diff options
context:
space:
mode:
authorknarf <knarf@17b73243-c579-4c4c-a9d2-2d5706c11dac>2010-11-23 19:28:02 +0000
committerknarf <knarf@17b73243-c579-4c4c-a9d2-2d5706c11dac>2010-11-23 19:28:02 +0000
commit7f0d29bc6b722a44191aaa06daa01c983e82c66e (patch)
tree657a866e2566558f79cfef298ba71b1da4b9f60a /lib/sbin/create_c_stuff.pl
parentb15b5f628e90931cee5d0d4aed64791946b4a727 (diff)
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
Diffstat (limited to 'lib/sbin/create_c_stuff.pl')
-rw-r--r--lib/sbin/create_c_stuff.pl12
1 files changed, 2 insertions, 10 deletions
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