[vala] dova: Fix warning when throwing errors in constructors



commit 0f0cfec2661dbc89d47a1791d52204d32e997c9e
Author: Jürg Billeter <j bitron ch>
Date:   Wed Jun 16 08:37:24 2010 +0200

    dova: Fix warning when throwing errors in constructors

 codegen/valadovaerrormodule.vala |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/codegen/valadovaerrormodule.vala b/codegen/valadovaerrormodule.vala
index e40c878..a422cfc 100644
--- a/codegen/valadovaerrormodule.vala
+++ b/codegen/valadovaerrormodule.vala
@@ -65,7 +65,7 @@ internal class Vala.DovaErrorModule : DovaDelegateModule {
 			var unref_call = new CCodeFunctionCall (new CCodeIdentifier (cl.get_unref_function ()));
 			unref_call.add_argument (new CCodeIdentifier ("this"));
 			cerror_block.add_statement (new CCodeExpressionStatement (unref_call));
-			cerror_block.add_statement (new CCodeReturnStatement (new CCodeConstant ("NULL")));
+			cerror_block.add_statement (new CCodeReturnStatement ());
 		} else if (current_return_type is VoidType) {
 			cerror_block.add_statement (new CCodeReturnStatement ());
 		} else {
@@ -89,7 +89,7 @@ internal class Vala.DovaErrorModule : DovaDelegateModule {
 		// TODO log uncaught error as critical warning
 
 		if (current_method is CreationMethod) {
-			cerror_block.add_statement (new CCodeReturnStatement (new CCodeConstant ("NULL")));
+			cerror_block.add_statement (new CCodeReturnStatement ());
 		} else if (current_return_type is VoidType) {
 			cerror_block.add_statement (new CCodeReturnStatement ());
 		} else if (current_return_type != null) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]