summaryrefslogtreecommitdiff
path: root/codegen/valagdbusclientmodule.vala
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2010-10-18 16:30:33 +0200
committerJürg Billeter <j@bitron.ch>2010-10-18 16:30:33 +0200
commite6aafaa71533d38bf2d67b27b270159c670b1305 (patch)
tree5dfd5351ee03e79881eb75d9f3c10dc7f2aa98fe /codegen/valagdbusclientmodule.vala
parent34c18af47efebf67d236f45d59417dbac5ebb15a (diff)
downloadvala-e6aafaa71533d38bf2d67b27b270159c670b1305.tar.gz
codegen: Add return_default_value helper method
Diffstat (limited to 'codegen/valagdbusclientmodule.vala')
-rw-r--r--codegen/valagdbusclientmodule.vala12
1 files changed, 2 insertions, 10 deletions
diff --git a/codegen/valagdbusclientmodule.vala b/codegen/valagdbusclientmodule.vala
index 223703a9b..7729d8a1f 100644
--- a/codegen/valagdbusclientmodule.vala
+++ b/codegen/valagdbusclientmodule.vala
@@ -479,11 +479,7 @@ public class Vala.GDBusClientModule : GDBusModule {
if (call_type == CallType.SYNC || call_type == CallType.FINISH) {
// return on error
ccode.open_if (new CCodeUnaryExpression (CCodeUnaryOperator.LOGICAL_NEGATION, new CCodeIdentifier ("_reply")));
- if (m.return_type is VoidType || m.return_type.is_real_non_null_struct_type ()) {
- ccode.add_return ();
- } else {
- ccode.add_return (default_value_for_type (m.return_type, false));
- }
+ return_default_value (m.return_type);
ccode.close ();
ccode.add_declaration ("GVariantIter", new CCodeVariableDeclarator ("_reply_iter"));
@@ -708,11 +704,7 @@ public class Vala.GDBusClientModule : GDBusModule {
// return on error
ccode.open_if (new CCodeUnaryExpression (CCodeUnaryOperator.LOGICAL_NEGATION, new CCodeIdentifier ("_reply")));
- if (prop.property_type.is_real_non_null_struct_type ()) {
- ccode.add_return ();
- } else {
- ccode.add_return (default_value_for_type (prop.property_type, false));
- }
+ return_default_value (prop.property_type);
ccode.close ();
ccode.add_declaration ("GVariantIter", new CCodeVariableDeclarator ("_reply_iter"));