[vala/staging: 8/9] ccodegen: Use unsigned default value for flags-enum
- From: Rico Tzschichholz <ricotz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala/staging: 8/9] ccodegen: Use unsigned default value for flags-enum
- Date: Sun, 10 Mar 2019 17:26:46 +0000 (UTC)
commit 9199f6a29da38499920a3455f382a41371a1be4e
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 e41a75ca0..5615eb618 100644
--- a/codegen/valaccodeattribute.vala
+++ b/codegen/valaccodeattribute.vala
@@ -1374,7 +1374,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) {
unowned Struct st = (Struct) sym;
unowned Struct? base_st = st.base_struct;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]