! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Fix compiler warnings (Clang)
Status:
RESOLVED: FIXED

Comments

Description Olivier Duchateau 2019-04-04 19:56:27 CEST
Created attachment 8387 
Fix compiler warnings

On FreeBSD (amd64) default compiler is clang, I get some warnings (bad cast, and duplicate declaration).

For src/misc/parole-file.h I have a lot of warnings like this:

>In file included from ../../src/parole-medialist.h:28:
>../../src/misc/parole-file.h:78:1: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
>G_CONST_RETURN *parole_file_get_directory           (const ParoleFile *file) G_GNUC_PURE;
>                                                                                                                              ^
>/usr/local/include/glib-2.0/glib/gmacros.h:363:24: note: expanded from macro 'G_CONST_RETURN'
>#define G_CONST_RETURN const
>                                            ^

In src/gst/parole-gst.c, I have

>parole-gst.c:1504:41: warning: implicit conversion from enumeration type 'GstStateChangeReturn' to different enumeration type 'GstState' [-Wenum-conversion]
>                                        GST_STATE_RETURN(gst->priv->playbin),
>                                        ^~~~~~~~~~~~~~~~~~~~~~~~
>/usr/local/include/gstreamer-1.0/gst/gstelement.h:141:66: note: expanded from macro 'GST_STATE_RETURN'
>#define GST_STATE_RETURN(elem)          (GST_ELEMENT_CAST(elem)->last_return)
>                                                                    ~~~~~~~~~~~~~~~~~^~~~~~~

The documentation says GST_STATE_RETURN returns the last GstStateChangeReturn value. It is not GstState. In GstElement struct only ones GstState members are:
- target_state
- current_state
- next_state

I think new "state" be target_state member of GstElement.
Comment 1 Git Bot editbugs 2019-07-22 18:50:03 CEST
Olivier Duchateau referenced this bugreport in commit 0947791e375342a2b5796c7a444204385fc6e8ba

Fix compiler warnings (clang) (bug #15260)"

https://git.xfce.org/apps/parole/commit?id=0947791e375342a2b5796c7a444204385fc6e8ba
Comment 2 Sean Davis editbugs 2019-07-22 18:50:22 CEST
Thanks for the patches! Applied above.

Bug #15260

Reported by:
Olivier Duchateau
Reported on: 2019-04-04
Last modified on: 2019-07-22

People

Assignee:
Simon Steinbeiss
CC List:
2 users

Version

Attachments

Fix compiler warnings (2.42 KB, patch)
2019-04-04 19:56 CEST , Olivier Duchateau
no flags

Additional information