]> 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 12:55:04 +0000 (14:55 +0200)
codegen/valaccodeattribute.vala

index 2bb0d3718b98dcb0d24e1c538969387358c122b5..bd42b6aa17c604d8846631d2687918ac3c03e4d5 100644 (file)
@@ -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;