]> 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>
Wed, 10 Apr 2019 14:26:19 +0000 (16:26 +0200)
codegen/valaccodeattribute.vala

index b6f60498c554a340ad1d58a9818edcfad4ad6a6e..93e4c77e991077a49733150b556d54f5d1c1e08b 100644 (file)
@@ -1312,7 +1312,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;