]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
dova: Use unsigned hash codes
authorJürg Billeter <j@bitron.ch>
Tue, 13 Jul 2010 18:22:36 +0000 (20:22 +0200)
committerJürg Billeter <j@bitron.ch>
Tue, 13 Jul 2010 18:22:36 +0000 (20:22 +0200)
codegen/valadovaobjectmodule.vala
codegen/valadovavaluemodule.vala

index c64c7b97ad74cc4b6edecd0c916c7a97c84a35d9..20316366ef4b1e6e8e5b0d3abf44fdb79bdfc2dd 100644 (file)
@@ -63,7 +63,7 @@ internal class Vala.DovaObjectModule : DovaArrayModule {
 
                        source_declarations.add_type_member_declaration (value_equals_function);
 
-                       var value_hash_function = new CCodeFunction ("dova_type_value_hash", "int32_t");
+                       var value_hash_function = new CCodeFunction ("dova_type_value_hash", "uint32_t");
                        value_hash_function.add_parameter (new CCodeFormalParameter ("type", "DovaType *"));
                        value_hash_function.add_parameter (new CCodeFormalParameter ("value", "void *"));
                        value_hash_function.add_parameter (new CCodeFormalParameter ("value_index", "int32_t"));
@@ -156,7 +156,7 @@ internal class Vala.DovaObjectModule : DovaArrayModule {
                        vdeclarator.add_parameter (new CCodeFormalParameter ("value", "void *"));
                        vdeclarator.add_parameter (new CCodeFormalParameter ("value_index", "int32_t"));
 
-                       vdecl = new CCodeDeclaration ("int32_t");
+                       vdecl = new CCodeDeclaration ("uint32_t");
                        vdecl.add_declarator (vdeclarator);
                        instance_priv_struct.add_declaration (vdecl);
 
@@ -297,7 +297,7 @@ internal class Vala.DovaObjectModule : DovaArrayModule {
        CCodeFunction create_set_value_hash_function (bool decl_only = false) {
                var result = new CCodeFunction ("dova_type_set_value_hash");
                result.add_parameter (new CCodeFormalParameter ("type", "DovaType *"));
-               result.add_parameter (new CCodeFormalParameter ("(*function) (void *value, int32_t value_index)", "int32_t"));
+               result.add_parameter (new CCodeFormalParameter ("(*function) (void *value, int32_t value_index)", "uint32_t"));
                if (decl_only) {
                        return result;
                }
@@ -774,7 +774,7 @@ internal class Vala.DovaObjectModule : DovaArrayModule {
                        declare_set_value_equals_function (header_declarations);
                        source_type_member_definition.append (create_set_value_equals_function ());
 
-                       var value_hash_function = new CCodeFunction ("dova_type_value_hash", "int32_t");
+                       var value_hash_function = new CCodeFunction ("dova_type_value_hash", "uint32_t");
                        value_hash_function.add_parameter (new CCodeFormalParameter ("type", "DovaType *"));
                        value_hash_function.add_parameter (new CCodeFormalParameter ("value", "void *"));
                        value_hash_function.add_parameter (new CCodeFormalParameter ("value_index", "int32_t"));
index 8552612251e7a166c6fbb4ee75906c6da7648b04..f7c29d1bab57a01318561d8d5e456d9a72b8c423 100644 (file)
@@ -220,7 +220,7 @@ internal class Vala.DovaValueModule : DovaObjectModule {
                }
 
                if (cl.scope.lookup ("hash") is Method) {
-                       var value_hash_fun = new CCodeFunction ("%s_value_hash".printf (cl.get_lower_case_cname ()), "int32_t");
+                       var value_hash_fun = new CCodeFunction ("%s_value_hash".printf (cl.get_lower_case_cname ()), "uint32_t");
                        value_hash_fun.modifiers = CCodeModifiers.STATIC;
                        value_hash_fun.add_parameter (new CCodeFormalParameter ("value", cl.get_cname () + "**"));
                        value_hash_fun.add_parameter (new CCodeFormalParameter ("value_index", "int32_t"));
@@ -235,7 +235,7 @@ internal class Vala.DovaValueModule : DovaObjectModule {
 
                        var value_hash_call = new CCodeFunctionCall (new CCodeIdentifier ("dova_type_set_value_hash"));
                        value_hash_call.add_argument (new CCodeIdentifier ("type"));
-                       value_hash_call.add_argument (new CCodeCastExpression (new CCodeIdentifier ("%s_value_hash".printf (cl.get_lower_case_cname ())), "int32_t (*)(void *, int32_t)"));
+                       value_hash_call.add_argument (new CCodeCastExpression (new CCodeIdentifier ("%s_value_hash".printf (cl.get_lower_case_cname ())), "uint32_t (*)(void *, int32_t)"));
                        type_init_fun.block.add_statement (new CCodeExpressionStatement (value_hash_call));
                }
 
@@ -543,7 +543,7 @@ internal class Vala.DovaValueModule : DovaObjectModule {
                }
 
                if (st.scope.lookup ("hash") is Method) {
-                       var value_hash_fun = new CCodeFunction ("%s_value_hash".printf (st.get_lower_case_cname ()), "int32_t");
+                       var value_hash_fun = new CCodeFunction ("%s_value_hash".printf (st.get_lower_case_cname ()), "uint32_t");
                        value_hash_fun.modifiers = CCodeModifiers.STATIC;
                        value_hash_fun.add_parameter (new CCodeFormalParameter ("value", st.get_cname () + "*"));
                        value_hash_fun.add_parameter (new CCodeFormalParameter ("value_index", "int32_t"));
@@ -558,7 +558,7 @@ internal class Vala.DovaValueModule : DovaObjectModule {
 
                        var value_hash_call = new CCodeFunctionCall (new CCodeIdentifier ("dova_type_set_value_hash"));
                        value_hash_call.add_argument (new CCodeIdentifier ("type"));
-                       value_hash_call.add_argument (new CCodeCastExpression (new CCodeIdentifier ("%s_value_hash".printf (st.get_lower_case_cname ())), "int32_t (*)(void *, int32_t)"));
+                       value_hash_call.add_argument (new CCodeCastExpression (new CCodeIdentifier ("%s_value_hash".printf (st.get_lower_case_cname ())), "uint32_t (*)(void *, int32_t)"));
                        type_init_fun.block.add_statement (new CCodeExpressionStatement (value_hash_call));
                }