summaryrefslogtreecommitdiff
path: root/lib/sbin/create_c_stuff.pl
diff options
context:
space:
mode:
authortradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac>2001-06-12 22:02:06 +0000
committertradke <tradke@17b73243-c579-4c4c-a9d2-2d5706c11dac>2001-06-12 22:02:06 +0000
commit9e89efdc39e00d1e0fdb9928825b00cc170e2785 (patch)
tree0d41114853c727177d5beaaff9980fd08818b9ce /lib/sbin/create_c_stuff.pl
parenta8e641780c5fe7b93b9520e9d79deb916365699b (diff)
Changed the USE_CCTK_PARAMETERS and CCTK_USE_ARGUMENTS macros to use a
'const void *' dummy pointer for assignments. This should also fix PR Cactus-715. git-svn-id: http://svn.cactuscode.org/flesh/trunk@2227 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'lib/sbin/create_c_stuff.pl')
-rw-r--r--lib/sbin/create_c_stuff.pl66
1 files changed, 7 insertions, 59 deletions
diff --git a/lib/sbin/create_c_stuff.pl b/lib/sbin/create_c_stuff.pl
index aae35679..88e13b86 100644
--- a/lib/sbin/create_c_stuff.pl
+++ b/lib/sbin/create_c_stuff.pl
@@ -196,7 +196,7 @@ sub CreateCStructureParameterHeader
# Create the structure
- push(@data,("#ifdef __cplusplus", "extern \"C\"", "{", "#endif"));
+ push(@data,("#ifdef __cplusplus", "extern \"C\"", "{", "#endif", ""));
push(@data,( "extern struct ", "{"));
foreach $parameter (&order_params($rhparameters, $rhparameter_db))
@@ -209,80 +209,28 @@ sub CreateCStructureParameterHeader
push(@data, $line);
- $line = $type_string ." " .$parameter . " = $structure.$parameter;";
+ $line = " const $type_string $parameter = $structure.$parameter; \\";
push(@definition, $line);
- $line = "";
- if ($type_string =~ /CCTK_REAL16/)
- {
- $line = "cctk_pdummy_real16=$parameter;";
- }
- elsif ($type_string =~ /CCTK_REAL8/)
- {
- $line = "cctk_pdummy_real8=$parameter;";
- }
- elsif ($type_string =~ /CCTK_REAL4/)
- {
- $line = "cctk_pdummy_real4=$parameter;";
- }
- elsif ($type_string =~ /CCTK_REAL/)
- {
- $line = "cctk_pdummy_real=$parameter;";
- }
- elsif ($type_string =~ /CCTK_INT8/)
- {
- $line = "cctk_pdummy_int8=$parameter;";
- }
- elsif ($type_string =~ /CCTK_INT4/)
- {
- $line = "cctk_pdummy_int4=$parameter;";
- }
- elsif ($type_string =~ /CCTK_INT2/)
- {
- $line = "cctk_pdummy_int2=$parameter;";
- }
- elsif ($type_string =~ /CCTK_INT/)
- {
- $line = "cctk_pdummy_int=$parameter;";
- }
- else
- {
- $line = "cctk_pdummy_pointer=(void *)$parameter;";
- }
+ $line = " cctk_pdummy_pointer = \&$parameter; \\";
push(@use, $line);
-
}
-
# Some compilers don't like an empty structure.
if((keys %$rhparameters) == 0)
{
push(@data, " int dummy_parameter;");
}
- push(@data, "} $structure;");
+ push(@data, "} $structure;", "");
- push(@data, "");
- push(@data,("#ifdef __cplusplus", "}", "#endif"));
-
-
- push(@data, "#define DECLARE_$structure"."_PARAMS \\");
-
- foreach $line (@definition)
- {
- push(@data, " const $line \\");
- }
+ push(@data,("#ifdef __cplusplus", "}", "#endif", ""));
+ push(@data, "#define DECLARE_$structure"."_PARAMS \\", @definition);
push(@data, "");
-
- push(@data, "#define USE_$structure"."_PARAMS \\");
-
- foreach $line (@use)
- {
- push(@data, " $line \\");
- }
+ push(@data, "#define USE_$structure"."_PARAMS \\", @use);
return @data;
}