GNOME Bugzilla – Bug 671545
Constify collect and lcopy strings in GTypeValueTable
Last modified: 2012-07-06 03:33:13 UTC
This avoids warnings when compiling with -Wwrite-strings, and ensures that people don't mess around with the collection and lcopy strings.
Created attachment 209154 [details] [review] Constify collect and lcopy strings in GTypeValueTable This avoids warnings when creating idiomatic value tables, like: static const GTypeValueTable _clutter_shader_float_value_table = { clutter_value_init_shader_float, clutter_value_free_shader_float, clutter_value_copy_shader_float, clutter_value_peek_pointer, "ip", clutter_value_collect_shader_float, "pp", clutter_value_lcopy_shader_float }; Because the strings are literals. And, really: nobody should be using allocated values for the collection and lcopy strings.
Review of attachment 209154 [details] [review]: Sure, looks fine to me
The following fix has been pushed: 2a87010 Constify collect and lcopy strings in GTypeValueTable
Created attachment 218146 [details] [review] Constify collect and lcopy strings in GTypeValueTable This avoids warnings when creating idiomatic value tables, like: static const GTypeValueTable _clutter_shader_float_value_table = { clutter_value_init_shader_float, clutter_value_free_shader_float, clutter_value_copy_shader_float, clutter_value_peek_pointer, "ip", clutter_value_collect_shader_float, "pp", clutter_value_lcopy_shader_float }; Because the strings are literals. And, really: nobody should be using allocated values for the collection and lcopy strings.