diff options
Diffstat (limited to 'dcop/dcopidlng/kalyptusCxxToDcopIDL.pm')
-rw-r--r-- | dcop/dcopidlng/kalyptusCxxToDcopIDL.pm | 25 |
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/</</g; $argType =~ s/>/>/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=\"&\"" if $r_isRef; + $returnType = "void" unless $returnType; + $returnType =~ s/^\s*(.*?)\s*$/$1/; $returnType =~ s/</</g; $returnType =~ s/>/>/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"; |