[vala] dova: Fix default values for boolean and numeric types



commit 52f5e0f0898fe5fc88f24c42ac0781eda5f01e19
Author: Jürg Billeter <j bitron ch>
Date:   Fri Aug 6 18:00:32 2010 +0200

    dova: Fix default values for boolean and numeric types

 vala/valastruct.vala |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/vala/valastruct.vala b/vala/valastruct.vala
index c05618e..2f54119 100644
--- a/vala/valastruct.vala
+++ b/vala/valastruct.vala
@@ -620,6 +620,15 @@ public class Vala.Struct : TypeSymbol {
 				return st.get_default_value ();
 			}
 		}
+
+		if (CodeContext.get ().profile == Profile.DOVA) {
+			if (boolean_type) {
+				return "false";
+			} else if (integer_type || floating_type) {
+				return "0";
+			}
+		}
+
 		return null;
 	}
 



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