From: Travis Reitter Date: Mon, 30 Jan 2012 19:23:26 +0000 (-0800) Subject: Cut invalid overly-specific type cast X-Git-Tag: FOLKS_0_6_7~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c0003918e4be83e13e8823e0801486f05e66227d;p=platform%2Fupstream%2Ffolks.git Cut invalid overly-specific type cast The Vala compiler now correctly warns that typeof(Foo) is invalid, so this stops pretending we can be that specific. (The generated C code can't make a GValue as specific as the above Vala code fragment suggests; historically, the compiler would let you get away with this, likely with the false assumption that the generic type would ever be considered again.) --- diff --git a/folks/individual-aggregator.vala b/folks/individual-aggregator.vala index e008695..91f4172 100644 --- a/folks/individual-aggregator.vala +++ b/folks/individual-aggregator.vala @@ -1760,7 +1760,7 @@ public class Folks.IndividualAggregator : Object if (local_ids.size > 0) { - var local_ids_value = Value (typeof (Set)); + var local_ids_value = Value (typeof (Set)); local_ids_value.set_object (local_ids); details.insert ( (!) Folks.PersonaStore.detail_key (PersonaDetail.LOCAL_IDS), diff --git a/tests/eds/add-persona.vala b/tests/eds/add-persona.vala index b2ad672..b6b8c08 100644 --- a/tests/eds/add-persona.vala +++ b/tests/eds/add-persona.vala @@ -167,7 +167,7 @@ public class AddPersonaTests : Folks.TestCase details.insert (Folks.PersonaStore.detail_key (PersonaDetail.FULL_NAME), (owned) v1); - Value? v2 = Value (typeof (Set)); + Value? v2 = Value (typeof (Set)); var emails = new HashSet ( (GLib.HashFunc) EmailFieldDetails.hash, (GLib.EqualFunc) EmailFieldDetails.equal); @@ -185,7 +185,7 @@ public class AddPersonaTests : Folks.TestCase details.insert (Folks.PersonaStore.detail_key (PersonaDetail.AVATAR), (owned) v3); - Value? v4 = Value (typeof (MultiMap)); + Value? v4 = Value (typeof (MultiMap)); var im_fds = new HashMultiMap (); im_fds.set ("jabber", new ImFieldDetails (this._im_addr_1)); im_fds.set ("yahoo", new ImFieldDetails (this._im_addr_2)); @@ -193,7 +193,7 @@ public class AddPersonaTests : Folks.TestCase details.insert ( Folks.PersonaStore.detail_key (PersonaDetail.IM_ADDRESSES), v4); - Value? v5 = Value (typeof (Set)); + Value? v5 = Value (typeof (Set)); var phones = new HashSet ( (GLib.HashFunc) PhoneFieldDetails.hash, (GLib.EqualFunc) PhoneFieldDetails.equal); @@ -211,7 +211,7 @@ public class AddPersonaTests : Folks.TestCase Folks.PersonaStore.detail_key (PersonaDetail.PHONE_NUMBERS), (owned) v5); - Value? v6 = Value (typeof (Set)); + Value? v6 = Value (typeof (Set)); var pa_fds = new HashSet ( (GLib.HashFunc) PostalAddressFieldDetails.hash, (GLib.EqualFunc) PostalAddressFieldDetails.equal); @@ -235,7 +235,7 @@ public class AddPersonaTests : Folks.TestCase Folks.PersonaStore.detail_key (PersonaDetail.STRUCTURED_NAME), (owned) v7); - Value? v8 = Value (typeof (Set)); + Value? v8 = Value (typeof (Set)); var notes = new HashSet ( (GLib.HashFunc) NoteFieldDetails.hash, (GLib.EqualFunc) NoteFieldDetails.equal); @@ -252,7 +252,7 @@ public class AddPersonaTests : Folks.TestCase details.insert (Folks.PersonaStore.detail_key (PersonaDetail.BIRTHDAY), (owned) v9); - Value? v10 = Value (typeof (Set)); + Value? v10 = Value (typeof (Set)); var role_fds = new HashSet ( (GLib.HashFunc) RoleFieldDetails.hash, (GLib.EqualFunc) RoleFieldDetails.equal); diff --git a/tests/eds/link-personas.vala b/tests/eds/link-personas.vala index 70c9574..09c5e31 100644 --- a/tests/eds/link-personas.vala +++ b/tests/eds/link-personas.vala @@ -211,7 +211,7 @@ public class LinkPersonasTests : Folks.TestCase if (this._linking_method == LinkingMethod.IM_ADDRESSES || this._linking_method == LinkingMethod.EMAIL_AS_IM_ADDRESS) { - v1 = Value (typeof (MultiMap)); + v1 = Value (typeof (MultiMap)); var im_addrs1 = new HashMultiMap ( null, null, (GLib.HashFunc) ImFieldDetails.hash, @@ -226,7 +226,7 @@ public class LinkPersonasTests : Folks.TestCase } else if (this._linking_method == LinkingMethod.WEB_SERVICE_ADDRESSES) { - v1 = Value (typeof (MultiMap)); + v1 = Value (typeof (MultiMap)); var wsa1 = new HashMultiMap ( null, null, (GLib.HashFunc) WebServiceFieldDetails.hash, @@ -246,7 +246,7 @@ public class LinkPersonasTests : Folks.TestCase Value? v3; if (this._linking_method == LinkingMethod.IM_ADDRESSES) { - v3 = Value (typeof (MultiMap)); + v3 = Value (typeof (MultiMap)); var im_addrs2 = new HashMultiMap ( null, null, (GLib.HashFunc) ImFieldDetails.hash, @@ -257,7 +257,7 @@ public class LinkPersonasTests : Folks.TestCase } else if (this._linking_method == LinkingMethod.WEB_SERVICE_ADDRESSES) { - v3 = Value (typeof (MultiMap)); + v3 = Value (typeof (MultiMap)); var wsa2 = new HashMultiMap ( null, null, (GLib.HashFunc) WebServiceFieldDetails.hash, @@ -268,7 +268,7 @@ public class LinkPersonasTests : Folks.TestCase } else if (this._linking_method == LinkingMethod.EMAIL_AS_IM_ADDRESS) { - v3 = Value (typeof (Set)); + v3 = Value (typeof (Set)); var emails = new HashSet ( (GLib.HashFunc) EmailFieldDetails.hash, (GLib.EqualFunc) EmailFieldDetails.equal); diff --git a/tests/tracker/add-persona.vala b/tests/tracker/add-persona.vala index e1d63b2..1626ee1 100644 --- a/tests/tracker/add-persona.vala +++ b/tests/tracker/add-persona.vala @@ -223,7 +223,7 @@ public class AddPersonaTests : Folks.TestCase details.insert (Folks.PersonaStore.detail_key (PersonaDetail.GENDER), (owned) v7); - Value? v8 = Value (typeof (Set)); + Value? v8 = Value (typeof (Set)); var emails = new HashSet ( (GLib.HashFunc) EmailFieldDetails.hash, (GLib.EqualFunc) EmailFieldDetails.equal); @@ -236,7 +236,7 @@ public class AddPersonaTests : Folks.TestCase Folks.PersonaStore.detail_key (PersonaDetail.EMAIL_ADDRESSES), (owned) v8); - Value? v9 = Value (typeof (MultiMap)); + Value? v9 = Value (typeof (MultiMap)); var im_addrs = new HashMultiMap (null, null, (GLib.HashFunc) ImFieldDetails.hash, (GLib.EqualFunc) ImFieldDetails.equal); @@ -246,7 +246,7 @@ public class AddPersonaTests : Folks.TestCase details.insert ( Folks.PersonaStore.detail_key (PersonaDetail.IM_ADDRESSES), v9); - Value? v10 = Value (typeof (Set)); + Value? v10 = Value (typeof (Set)); var notes = new HashSet ( (GLib.HashFunc) NoteFieldDetails.hash, (GLib.EqualFunc) NoteFieldDetails.equal); @@ -256,7 +256,7 @@ public class AddPersonaTests : Folks.TestCase details.insert (Folks.PersonaStore.detail_key (PersonaDetail.NOTES), (owned) v10); - Value? v11 = Value (typeof (Set)); + Value? v11 = Value (typeof (Set)); var phones = new HashSet ( (GLib.HashFunc) PhoneFieldDetails.hash, (GLib.EqualFunc) PhoneFieldDetails.equal); @@ -270,7 +270,7 @@ public class AddPersonaTests : Folks.TestCase Folks.PersonaStore.detail_key (PersonaDetail.PHONE_NUMBERS), (owned) v11); - Value? v12 = Value (typeof (Set)); + Value? v12 = Value (typeof (Set)); var role_fds = new HashSet ( (GLib.HashFunc) RoleFieldDetails.hash, (GLib.EqualFunc) RoleFieldDetails.equal); @@ -282,7 +282,7 @@ public class AddPersonaTests : Folks.TestCase details.insert (Folks.PersonaStore.detail_key (PersonaDetail.ROLES), (owned) v12); - Value? v13 = Value (typeof (Set)); + Value? v13 = Value (typeof (Set)); var postal_addresses = new HashSet ( (GLib.HashFunc) PostalAddressFieldDetails.hash, (GLib.EqualFunc) PostalAddressFieldDetails.equal); @@ -298,7 +298,7 @@ public class AddPersonaTests : Folks.TestCase Folks.PersonaStore.detail_key (PersonaDetail.POSTAL_ADDRESSES), (owned) v13); - Value? v14 = Value (typeof (Set)); + Value? v14 = Value (typeof (Set)); var urls = new HashSet ( (GLib.HashFunc) UrlFieldDetails.hash, (GLib.EqualFunc) UrlFieldDetails.equal); diff --git a/tests/tracker/duplicated-emails.vala b/tests/tracker/duplicated-emails.vala index 5e7e1de..a4d5f6f 100644 --- a/tests/tracker/duplicated-emails.vala +++ b/tests/tracker/duplicated-emails.vala @@ -172,7 +172,7 @@ public class DuplicatedEmailsTests : Folks.TestCase details1.insert (Folks.PersonaStore.detail_key (PersonaDetail.FULL_NAME), (owned) val); - val = Value (typeof (Set)); + val = Value (typeof (Set)); var emails1 = new HashSet ( (GLib.HashFunc) EmailFieldDetails.hash, (GLib.EqualFunc) EmailFieldDetails.equal); @@ -188,7 +188,7 @@ public class DuplicatedEmailsTests : Folks.TestCase details2.insert (Folks.PersonaStore.detail_key (PersonaDetail.FULL_NAME), (owned) val); - val = Value (typeof (Set)); + val = Value (typeof (Set)); var emails2 = new HashSet ( (GLib.HashFunc) EmailFieldDetails.hash, (GLib.EqualFunc) EmailFieldDetails.equal); diff --git a/tests/tracker/duplicated-phones.vala b/tests/tracker/duplicated-phones.vala index c8707ff..8bd59bf 100644 --- a/tests/tracker/duplicated-phones.vala +++ b/tests/tracker/duplicated-phones.vala @@ -172,7 +172,7 @@ public class DuplicatedPhonesTests : Folks.TestCase details1.insert (Folks.PersonaStore.detail_key (PersonaDetail.FULL_NAME), (owned) val); - val = Value (typeof (Set)); + val = Value (typeof (Set)); var phones1 = new HashSet ( (GLib.HashFunc) PhoneFieldDetails.hash, (GLib.EqualFunc) PhoneFieldDetails.equal); @@ -188,7 +188,7 @@ public class DuplicatedPhonesTests : Folks.TestCase details2.insert (Folks.PersonaStore.detail_key (PersonaDetail.FULL_NAME), (owned) val); - val = Value (typeof (Set)); + val = Value (typeof (Set)); var phones2 = new HashSet ( (GLib.HashFunc) PhoneFieldDetails.hash, (GLib.EqualFunc) PhoneFieldDetails.equal); diff --git a/tests/tracker/link-personas.vala b/tests/tracker/link-personas.vala index ac2bde9..a544d92 100644 --- a/tests/tracker/link-personas.vala +++ b/tests/tracker/link-personas.vala @@ -140,7 +140,7 @@ public class LinkPersonasTests : Folks.TestCase { HashTable details1 = new HashTable (str_hash, str_equal); - Value? v1 = Value (typeof (MultiMap)); + Value? v1 = Value (typeof (MultiMap)); var im_addrs1 = new HashMultiMap (null, null, (GLib.HashFunc) ImFieldDetails.hash, (GLib.EqualFunc) ImFieldDetails.equal); @@ -154,7 +154,7 @@ public class LinkPersonasTests : Folks.TestCase HashTable details2 = new HashTable (str_hash, str_equal); - Value? v3 = Value (typeof (MultiMap)); + Value? v3 = Value (typeof (MultiMap)); var im_addrs2 = new HashMultiMap (null, null, (GLib.HashFunc) ImFieldDetails.hash, (GLib.EqualFunc) ImFieldDetails.equal); diff --git a/tests/tracker/match-email-addresses.vala b/tests/tracker/match-email-addresses.vala index 6cd4871..ae5b335 100644 --- a/tests/tracker/match-email-addresses.vala +++ b/tests/tracker/match-email-addresses.vala @@ -177,7 +177,7 @@ public class MatchEmailAddressesTests : Folks.TestCase details1.insert (Folks.PersonaStore.detail_key (PersonaDetail.FULL_NAME), (owned) val); - val = Value (typeof (Set)); + val = Value (typeof (Set)); var emails1 = new HashSet ( (GLib.HashFunc) EmailFieldDetails.hash, (GLib.EqualFunc) EmailFieldDetails.equal); @@ -193,7 +193,7 @@ public class MatchEmailAddressesTests : Folks.TestCase details2.insert (Folks.PersonaStore.detail_key (PersonaDetail.FULL_NAME), (owned) val); - val = Value (typeof (Set)); + val = Value (typeof (Set)); var emails2 = new HashSet ( (GLib.HashFunc) EmailFieldDetails.hash, (GLib.EqualFunc) EmailFieldDetails.equal); diff --git a/tests/tracker/match-im-addresses.vala b/tests/tracker/match-im-addresses.vala index 84e2199..45242de 100644 --- a/tests/tracker/match-im-addresses.vala +++ b/tests/tracker/match-im-addresses.vala @@ -178,7 +178,7 @@ public class MatchIMAddressesTests : Folks.TestCase details1.insert (Folks.PersonaStore.detail_key (PersonaDetail.FULL_NAME), (owned) val); - val = Value (typeof (MultiMap)); + val = Value (typeof (MultiMap)); im_addrs = new HashMultiMap (null, null, (GLib.HashFunc) ImFieldDetails.hash, (GLib.EqualFunc) ImFieldDetails.equal); @@ -194,7 +194,7 @@ public class MatchIMAddressesTests : Folks.TestCase details2.insert (Folks.PersonaStore.detail_key (PersonaDetail.FULL_NAME), (owned) val); - val = Value (typeof (MultiMap)); + val = Value (typeof (MultiMap)); im_addrs = new HashMultiMap (null, null, (GLib.HashFunc) ImFieldDetails.hash, (GLib.EqualFunc) ImFieldDetails.equal); diff --git a/tests/tracker/match-known-emails.vala b/tests/tracker/match-known-emails.vala index 6c7fa9c..27e916c 100644 --- a/tests/tracker/match-known-emails.vala +++ b/tests/tracker/match-known-emails.vala @@ -185,7 +185,7 @@ public class MatchKnownEmailsTests : Folks.TestCase details1.insert (Folks.PersonaStore.detail_key (PersonaDetail.FULL_NAME), (owned) val); - val = Value (typeof (Set)); + val = Value (typeof (Set)); var emails1 = new HashSet ( (GLib.HashFunc) EmailFieldDetails.hash, (GLib.EqualFunc) EmailFieldDetails.equal); @@ -201,7 +201,7 @@ public class MatchKnownEmailsTests : Folks.TestCase details2.insert (Folks.PersonaStore.detail_key (PersonaDetail.FULL_NAME), (owned) val); - val = Value (typeof (Set)); + val = Value (typeof (Set)); var emails2 = new HashSet ( (GLib.HashFunc) EmailFieldDetails.hash, (GLib.EqualFunc) EmailFieldDetails.equal); diff --git a/tests/tracker/match-phone-number.vala b/tests/tracker/match-phone-number.vala index d2c441d..f0641f4 100644 --- a/tests/tracker/match-phone-number.vala +++ b/tests/tracker/match-phone-number.vala @@ -179,7 +179,7 @@ public class MatchPhoneNumberTests : Folks.TestCase details1.insert (Folks.PersonaStore.detail_key (PersonaDetail.FULL_NAME), (owned) val); - val = Value (typeof (Set)); + val = Value (typeof (Set)); var phone_numbers1 = new HashSet ( (GLib.HashFunc) PhoneFieldDetails.hash, (GLib.EqualFunc) PhoneFieldDetails.equal); @@ -195,7 +195,7 @@ public class MatchPhoneNumberTests : Folks.TestCase details2.insert (Folks.PersonaStore.detail_key (PersonaDetail.FULL_NAME), (owned) val); - val = Value (typeof (Set)); + val = Value (typeof (Set)); var phone_numbers2 = new HashSet ( (GLib.HashFunc) PhoneFieldDetails.hash, (GLib.EqualFunc) PhoneFieldDetails.equal); diff --git a/tests/tracker/remove-persona.vala b/tests/tracker/remove-persona.vala index 252b304..6c87e92 100644 --- a/tests/tracker/remove-persona.vala +++ b/tests/tracker/remove-persona.vala @@ -131,7 +131,7 @@ public class RemovePersonaTests : Folks.TestCase details.insert (Folks.PersonaStore.detail_key (PersonaDetail.FULL_NAME), (owned) v1); - Value? v2 = Value (typeof (Set)); + Value? v2 = Value (typeof (Set)); var emails = new HashSet ( (GLib.HashFunc) EmailFieldDetails.hash, (GLib.EqualFunc) EmailFieldDetails.equal); diff --git a/tests/tracker/set-duplicate-email.vala b/tests/tracker/set-duplicate-email.vala index 6619d33..766312c 100644 --- a/tests/tracker/set-duplicate-email.vala +++ b/tests/tracker/set-duplicate-email.vala @@ -202,7 +202,7 @@ public class SetDuplicateEmailTests : Folks.TestCase details1.insert (Folks.PersonaStore.detail_key (PersonaDetail.FULL_NAME), (owned) val); - val = Value (typeof (Set)); + val = Value (typeof (Set)); var emails1 = new HashSet ( (GLib.HashFunc) EmailFieldDetails.hash, (GLib.EqualFunc) EmailFieldDetails.equal);