[vala/0.36] ccodegen: Use unsigned default value for flags-enum
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/0.36] ccodegen: Use unsigned default value for flags-enum
- Date: Wed, 10 Apr 2019 13:24:42 +0000 (UTC)
commit a4240e78a763f63cff7187f9a8134506e2e481e7
Author: Rico Tzschichholz <ricotz ubuntu com>
Date: Sun Mar 10 18:14:09 2019 +0100
ccodegen: Use unsigned default value for flags-enum
codegen/valaccodeattribute.vala | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/codegen/valaccodeattribute.vala b/codegen/valaccodeattribute.vala
index 2bb0d3718..bd42b6aa1 100644
--- a/codegen/valaccodeattribute.vala
+++ b/codegen/valaccodeattribute.vala
@@ -1250,7 +1250,12 @@ public class Vala.CCodeAttribute : AttributeCache {
private string get_default_default_value () {
if (sym is Enum) {
- return "0";
+ unowned Enum en = (Enum) sym;
+ if (en.is_flags) {
+ return "0U";
+ } else {
+ return "0";
+ }
} else if (sym is Struct) {
var st = (Struct) sym;
var base_st = st.base_struct;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]