GNOME Bugzilla – Bug 777927
Just fixing a strange piece of code
Last modified: 2017-01-30 20:04:23 UTC
Created attachment 344515 [details] [review] patch provided sorry if I'm wrong..
Review of attachment 344515 [details] [review]: ::: gst/gstobject.c @@ +492,3 @@ GParamSpec * pspec, gchar ** excluded_props) { + GValue value = { 0 }; /* the important thing is that value.type = 0 */ Is there any real difference in effect between the two?
first one is like "{ 0, }" , second one is "{ 0 }". No, there's absolutely no difference. And that's the point. Looks like somebody just left the ',' char while creating this code. But (!!!) im not sure for 200%.
Review of attachment 344515 [details] [review]: ::: gst/gstobject.c @@ +492,3 @@ GParamSpec * pspec, gchar ** excluded_props) { + GValue value = { 0 }; /* the important thing is that value.type = 0 */ The proper way of doing this is "GValue value = G_VALUE_INIT;" btw
There's nothing wrong with keeping the extra , at the end, and it seems more explicit as more than a single field is initialized to zeroes here.
(In reply to Sebastian Dröge (slomo) from comment #4) > There's nothing wrong with keeping the extra , at the end, and it seems more > explicit as more than a single field is initialized to zeroes here. ok, you know better
Thanks for the bug report, but I don't think there is anything wrong with this code. It's a common idiom that's used like that in a lot of different places.