summaryrefslogtreecommitdiffstats
path: root/dcop/dcopidlng/kalyptusCxxToDcopIDL.pm
diff options
context:
space:
mode:
Diffstat (limited to 'dcop/dcopidlng/kalyptusCxxToDcopIDL.pm')
-rw-r--r--dcop/dcopidlng/kalyptusCxxToDcopIDL.pm25
1 files changed, 20 insertions, 5 deletions
diff --git a/dcop/dcopidlng/kalyptusCxxToDcopIDL.pm b/dcop/dcopidlng/kalyptusCxxToDcopIDL.pm
index 8a2988f06..0d06613e4 100644
--- a/dcop/dcopidlng/kalyptusCxxToDcopIDL.pm
+++ b/dcop/dcopidlng/kalyptusCxxToDcopIDL.pm
@@ -161,18 +161,33 @@ sub generateMethod($$)
$argType =~ s/^\s*(.*?)\s*$/$1/;
$argType =~ s/</&lt;/g;
$argType =~ s/>/&gt;/g;
- $argType =~ s/\s//g;
-
- $args .= " <ARG><TYPE$typeAttrs>$argType</TYPE><NAME>$arg->{ArgName}</NAME></ARG>\n";
+ $argType =~ s/(\W)\s+/$1/g;
+ $argType =~ s/\s+(\W)/$1/g;
+ $argType =~ s/\b(signed|unsigned|long|short)$/$1 int/;
+
+ $args .= " ";
+ $args .= "<ARG><TYPE$typeAttrs>$argType</TYPE>";
+ $args .= "<NAME>$arg->{ArgName}</NAME>" if $arg->{ArgName} !~ /^$/;
+ $args .= "</ARG>\n";
}
my $qual = "";
$qual .= " qual=\"const\"" if $flags =~ "c";
+ my $r_isConst = ($returnType =~ s/^\s*const\s*//);
+ my $r_isRef = ($returnType =~ s/&//);
+
+ my $retTypeAttrs = "";
+ $retTypeAttrs .= " qleft=\"const\"" if $r_isConst;
+ $retTypeAttrs .= " qright=\"&amp;\"" if $r_isRef;
+
$returnType = "void" unless $returnType;
+ $returnType =~ s/^\s*(.*?)\s*$/$1/;
$returnType =~ s/</&lt;/g;
$returnType =~ s/>/&gt;/g;
- $returnType =~ s/^\s*const\s*//;
+ $returnType =~ s/(\W)\s+/$1/g;
+ $returnType =~ s/\s+(\W)/$1/g;
+ $returnType =~ s/\b(signed|unsigned|long|short)$/$1 int/;
my $methodCode = "";
@@ -182,7 +197,7 @@ sub generateMethod($$)
if (!$isConstructor) {
$methodCode .= " <$tagType$tagAttr$qual>\n";
- $methodCode .= " <TYPE>$returnType</TYPE>\n";
+ $methodCode .= " <TYPE$retTypeAttrs>$returnType</TYPE>\n";
$methodCode .= " <NAME>$name</NAME>\n";
$methodCode .= "$args";
$methodCode .= " </$tagType>\n";