After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 777927 - Just fixing a strange piece of code
Just fixing a strange piece of code
Status: RESOLVED WONTFIX
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other All
: Normal enhancement
: NONE
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-01-30 09:52 UTC by Aleksandr Slobodeniuk
Modified: 2017-01-30 20:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch provided (819 bytes, patch)
2017-01-30 09:52 UTC, Aleksandr Slobodeniuk
needs-work Details | Review

Description Aleksandr Slobodeniuk 2017-01-30 09:52:08 UTC
Created attachment 344515 [details] [review]
patch provided

sorry if I'm wrong..
Comment 1 Arun Raghavan 2017-01-30 09:59:43 UTC
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?
Comment 2 Aleksandr Slobodeniuk 2017-01-30 10:05:22 UTC
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%.
Comment 3 Sebastian Dröge (slomo) 2017-01-30 10:06:25 UTC
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
Comment 4 Sebastian Dröge (slomo) 2017-01-30 10:08:11 UTC
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.
Comment 5 Aleksandr Slobodeniuk 2017-01-30 10:10:35 UTC
(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
Comment 6 Tim-Philipp Müller 2017-01-30 20:04:23 UTC
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.