]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
ccodegen: Use unsigned default value for flags-enum
authorRico Tzschichholz <ricotz@ubuntu.com>
Sun, 10 Mar 2019 17:14:09 +0000 (18:14 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Sun, 10 Mar 2019 17:14:09 +0000 (18:14 +0100)
codegen/valaccodeattribute.vala

index e41a75ca0697763f178bc64b1465e6b258dd120e..5615eb618c6511091d55a86b650296ee6933ac16 100644 (file)
@@ -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;