Bug 34881 - Don't use const with GList
Summary: Don't use const with GList
Status: RESOLVED FIXED
Alias: None
Product: Wocky
Classification: Unclassified
Component: General (show other bugs)
Version: git master
Hardware: Other All
: medium normal
Assignee: Telepathy bugs list
QA Contact: Telepathy bugs list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-01 11:33 UTC by Olivier Crête
Modified: 2012-11-21 18:01 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Don't put const before G*List, it does not make sense (5.86 KB, patch)
2011-03-01 11:33 UTC, Olivier Crête
Details | Splinter Review
Don't put const before GSList, the g_slist* functions aren't const-marked (1.05 KB, patch)
2011-03-01 11:35 UTC, Olivier Crête
Details | Splinter Review
Don't put const before G*List, it does not make sense (6.01 KB, patch)
2011-07-05 10:57 UTC, Will Thompson
Details | Splinter Review
wocky_auth_registry_has_mechanism: fix coding style (818 bytes, patch)
2011-07-05 10:57 UTC, Will Thompson
Details | Splinter Review
wocky_auth_registry_has_mechanism: simplify! (827 bytes, patch)
2011-07-05 10:57 UTC, Will Thompson
Details | Splinter Review

Description Olivier Crête 2011-03-01 11:33:54 UTC
Created attachment 43985 [details] [review]
Don't put const before G*List, it does not make sense

The use const with GList/GSList causes it not to build with -Wall -Werror on Meego.

And anyway, it doesn't make sense.
Comment 1 Olivier Crête 2011-03-01 11:35:23 UTC
Created attachment 43986 [details] [review]
Don't put const before GSList, the g_slist* functions aren't const-marked

Also for Gabble (I'm too lazy to open another bug for something so moronic)
Comment 2 Will Thompson 2011-07-05 10:39:39 UTC
I think I basically agree—it's weird that you were seeing warnings on MeeGo though, I don't see them here.

That said, if you're gonna go through and remove all the 'const's, at least remove the casts that are only necessary because of them. e.g.:

 static gboolean
-wocky_auth_registry_has_mechanism (const GSList *list, const gchar *mech) {
+wocky_auth_registry_has_mechanism (GSList *list, const gchar *mech) {
   GSList *t;
 
   t = g_slist_find_custom ((GSList *) list, mech, (GCompareFunc) g_strcmp0);

                            ^^^^^^^^^^^^^^^
Comment 3 Olivier Crête 2011-07-05 10:46:00 UTC
I just removed the ones that were blocking the build at that specific point in time...
Comment 4 Will Thompson 2011-07-05 10:57:27 UTC
Created attachment 48778 [details] [review]
Don't put const before G*List, it does not make sense
Comment 5 Will Thompson 2011-07-05 10:57:31 UTC
Created attachment 48779 [details] [review]
wocky_auth_registry_has_mechanism: fix coding style
Comment 6 Will Thompson 2011-07-05 10:57:34 UTC
Created attachment 48780 [details] [review]
wocky_auth_registry_has_mechanism: simplify!
Comment 7 Simon McVittie 2012-02-23 04:04:27 UTC
Comment on attachment 48778 [details] [review]
Don't put const before G*List, it does not make sense

Review of attachment 48778 [details] [review]:
-----------------------------------------------------------------

Looks good to me
Comment 8 Simon McVittie 2012-02-23 04:05:07 UTC
Comment on attachment 48779 [details] [review]
wocky_auth_registry_has_mechanism: fix coding style

Review of attachment 48779 [details] [review]:
-----------------------------------------------------------------

OK
Comment 9 Simon McVittie 2012-02-23 04:05:32 UTC
Comment on attachment 48780 [details] [review]
wocky_auth_registry_has_mechanism: simplify!

Review of attachment 48780 [details] [review]:
-----------------------------------------------------------------

Yes
Comment 10 Simon McVittie 2012-02-23 04:06:44 UTC
I assume the three patches attached by Will supersede the first of the two attached by Olivier? If so, r+.
Comment 11 Will Thompson 2012-11-21 18:01:18 UTC
Merged for Gabble 0.17.2.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.