[vala] dova: Use unsigned hash codes
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vala] dova: Use unsigned hash codes
- Date: Tue, 13 Jul 2010 19:47:51 +0000 (UTC)
commit a87ec1bee7fb9a2209af68c4d73d34cace1c15d8
Author: Jürg Billeter <j bitron ch>
Date: Tue Jul 13 20:22:36 2010 +0200
dova: Use unsigned hash codes
codegen/valadovaobjectmodule.vala | 8 ++++----
codegen/valadovavaluemodule.vala | 8 ++++----
2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/codegen/valadovaobjectmodule.vala b/codegen/valadovaobjectmodule.vala
index c64c7b9..2031636 100644
--- a/codegen/valadovaobjectmodule.vala
+++ b/codegen/valadovaobjectmodule.vala
@@ -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"));
diff --git a/codegen/valadovavaluemodule.vala b/codegen/valadovavaluemodule.vala
index 8552612..f7c29d1 100644
--- a/codegen/valadovavaluemodule.vala
+++ b/codegen/valadovavaluemodule.vala
@@ -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));
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]