Merge pull request #38 from virinext/fix_warnings

Fix various warnings
This commit is contained in:
dabrain34 2017-06-06 15:11:48 +02:00 committed by GitHub
commit fc3d259a39
5 changed files with 20 additions and 18 deletions

View file

@ -27,7 +27,7 @@ void
ElementProperties::addParamEnum (GParamSpec *param, GstElement *element, ElementProperties::addParamEnum (GParamSpec *param, GstElement *element,
QGridLayout *play) QGridLayout *play)
{ {
GValue value = { 0 }; GValue value = G_VALUE_INIT;
g_value_init (&value, param->value_type); g_value_init (&value, param->value_type);
if (param->flags & G_PARAM_READABLE) if (param->flags & G_PARAM_READABLE)
@ -69,7 +69,7 @@ void
ElementProperties::addParamFlags (GParamSpec *param, GstElement *element, ElementProperties::addParamFlags (GParamSpec *param, GstElement *element,
QGridLayout *play) QGridLayout *play)
{ {
GValue value = { 0 }; GValue value = G_VALUE_INIT;
g_value_init (&value, param->value_type); g_value_init (&value, param->value_type);
if (param->flags & G_PARAM_READABLE) if (param->flags & G_PARAM_READABLE)
@ -80,7 +80,7 @@ ElementProperties::addParamFlags (GParamSpec *param, GstElement *element,
} }
QString propertyName = g_param_spec_get_name (param); QString propertyName = g_param_spec_get_name (param);
int propertyValue; size_t propertyValue;
propertyValue = g_value_get_flags (&value); propertyValue = g_value_get_flags (&value);
@ -119,7 +119,7 @@ ElementProperties::addParamSimple (GParamSpec *param, GstElement *element,
if (param->flags & G_PARAM_WRITABLE) if (param->flags & G_PARAM_WRITABLE)
readOnly = false; readOnly = false;
GValue value = { 0 }; GValue value = G_VALUE_INIT;
g_value_init (&value, param->value_type); g_value_init (&value, param->value_type);
if (param->flags & G_PARAM_READABLE) if (param->flags & G_PARAM_READABLE)
@ -178,7 +178,7 @@ ElementProperties::addParamSimple (GParamSpec *param, GstElement *element,
break; break;
} }
case G_TYPE_CHAR: { case G_TYPE_CHAR: {
propertyValue = QString::number (g_value_get_char (&value)); propertyValue = QString::number (g_value_get_schar (&value));
break; break;
} }
case G_TYPE_UCHAR: { case G_TYPE_UCHAR: {

View file

@ -119,6 +119,7 @@ GraphDisplay::update (const std::vector<ElementInfo> &info)
void void
GraphDisplay::paintEvent (QPaintEvent *event) GraphDisplay::paintEvent (QPaintEvent *event)
{ {
Q_UNUSED(event);
QPainter painter (this); QPainter painter (this);
QPen defaultPen = painter.pen (); QPen defaultPen = painter.pen ();
for (std::size_t i = 0; i < m_displayInfo.size (); i++) { for (std::size_t i = 0; i < m_displayInfo.size (); i++) {
@ -848,6 +849,7 @@ GraphDisplay::requestPad (std::size_t elementId)
void void
GraphDisplay::addRequestPad (int row, int collumn) GraphDisplay::addRequestPad (int row, int collumn)
{ {
Q_UNUSED(collumn);
QTableWidget *ptwgt = dynamic_cast<QTableWidget *> (QObject::sender ()); QTableWidget *ptwgt = dynamic_cast<QTableWidget *> (QObject::sender ());
qulonglong v = ptwgt->property ("element").toULongLong (); qulonglong v = ptwgt->property ("element").toULongLong ();

View file

@ -16,7 +16,7 @@ get_str_caps_limited (gchar* str)
gchar* result; gchar* result;
if (strlen (str) > MAX_STR_CAPS_SIZE) { if (strlen (str) > MAX_STR_CAPS_SIZE) {
result = g_strndup (str, MAX_STR_CAPS_SIZE); result = g_strndup (str, MAX_STR_CAPS_SIZE);
for (int i = strlen (result) - 1; i > strlen (result) - 4; i--) for (size_t i = strlen (result) - 1; i > strlen (result) - 4; i--)
result[i] = '.'; result[i] = '.';
} }
else else
@ -28,6 +28,7 @@ static void
typefind_have_type_callback (GstElement * typefind, guint probability, typefind_have_type_callback (GstElement * typefind, guint probability,
GstCaps * caps, GraphManager * thiz) GstCaps * caps, GraphManager * thiz)
{ {
Q_UNUSED(typefind);
gchar *caps_description = gst_caps_to_string (caps); gchar *caps_description = gst_caps_to_string (caps);
qDebug () << "Found caps " << caps_description << " with probability " qDebug () << "Found caps " << caps_description << " with probability "
<< probability; << probability;
@ -226,7 +227,7 @@ GraphManager::Connect (const char *srcElement, const char *srcPad,
gboolean seekRes = gst_element_seek_simple (m_pGraph, GST_FORMAT_TIME, gboolean seekRes = gst_element_seek_simple (m_pGraph, GST_FORMAT_TIME,
GST_SEEK_FLAG_FLUSH, 0); GST_SEEK_FLAG_FLUSH, 0);
Q_UNUSED(seekRes);
gst_object_unref (src); gst_object_unref (src);
gst_object_unref (dst); gst_object_unref (dst);
@ -236,6 +237,7 @@ GraphManager::Connect (const char *srcElement, const char *srcPad,
bool bool
GraphManager::Connect (const char *srcElement, const char *dstElement) GraphManager::Connect (const char *srcElement, const char *dstElement)
{ {
GstElement *src = gst_bin_get_by_name (GST_BIN (m_pGraph), srcElement); GstElement *src = gst_bin_get_by_name (GST_BIN (m_pGraph), srcElement);
GstElement *dst = gst_bin_get_by_name (GST_BIN (m_pGraph), dstElement); GstElement *dst = gst_bin_get_by_name (GST_BIN (m_pGraph), dstElement);
@ -243,7 +245,7 @@ GraphManager::Connect (const char *srcElement, const char *dstElement)
gboolean seekRes = gst_element_seek_simple (m_pGraph, GST_FORMAT_TIME, gboolean seekRes = gst_element_seek_simple (m_pGraph, GST_FORMAT_TIME,
GST_SEEK_FLAG_FLUSH, 0); GST_SEEK_FLAG_FLUSH, 0);
Q_UNUSED(seekRes);
/* add a callback to handle have-type signal */ /* add a callback to handle have-type signal */
if (g_str_has_prefix (dstElement, "typefindelement")) { if (g_str_has_prefix (dstElement, "typefindelement")) {
g_signal_connect (dst, "have-type", g_signal_connect (dst, "have-type",
@ -284,8 +286,7 @@ GraphManager::GetInfo ()
size_t id = 0; size_t id = 0;
while (!done) { while (!done) {
#if GST_VERSION_MAJOR >= 1 #if GST_VERSION_MAJOR >= 1
GValue value = GValue value = G_VALUE_INIT;
{ 0};
switch (gst_iterator_next (iter, &value)) switch (gst_iterator_next (iter, &value))
{ {
case GST_ITERATOR_OK: case GST_ITERATOR_OK:
@ -314,8 +315,7 @@ GraphManager::GetInfo ()
GstPad *pad; GstPad *pad;
while (!padDone) { while (!padDone) {
#if GST_VERSION_MAJOR >= 1 #if GST_VERSION_MAJOR >= 1
GValue padVal = GValue padVal = G_VALUE_INIT;
{ 0};
switch (gst_iterator_next (padItr, &padVal)) switch (gst_iterator_next (padItr, &padVal))
{ {
case GST_ITERATOR_OK: case GST_ITERATOR_OK:

View file

@ -21,8 +21,7 @@ clearPipeline (GstElement *pipeline)
bool done = false; bool done = false;
while (!done) { while (!done) {
#if GST_VERSION_MAJOR >= 1 #if GST_VERSION_MAJOR >= 1
GValue value = GValue value = G_VALUE_INIT;
{ 0};
switch (gst_iterator_next (iter, &value)) switch (gst_iterator_next (iter, &value))
{ {
case GST_ITERATOR_OK: case GST_ITERATOR_OK:
@ -84,7 +83,7 @@ writeProperties (QXmlStreamWriter &xmlWriter, const GstElement *element)
if ((param->flags & G_PARAM_READABLE) if ((param->flags & G_PARAM_READABLE)
&& (param->flags & G_PARAM_WRITABLE)) { && (param->flags & G_PARAM_WRITABLE)) {
GValue value = { 0 }; GValue value = G_VALUE_INIT;
g_value_init (&value, param->value_type); g_value_init (&value, param->value_type);
g_object_get_property (G_OBJECT (element), param->name, &value); g_object_get_property (G_OBJECT (element), param->name, &value);

View file

@ -172,6 +172,7 @@ PluginsListDialog::~PluginsListDialog ()
void void
PluginsListDialog::showInfo (QListWidgetItem *pitem, QListWidgetItem *previous) PluginsListDialog::showInfo (QListWidgetItem *pitem, QListWidgetItem *previous)
{ {
Q_UNUSED(previous);
qDebug () << "Show Info: " << pitem->text (); qDebug () << "Show Info: " << pitem->text ();
m_plblInfo->clear (); m_plblInfo->clear ();
QString descr; QString descr;
@ -278,8 +279,8 @@ PluginsListDialog::eventFilter (QObject *obj, QEvent *event)
if (event->type () == QEvent::KeyPress) { if (event->type () == QEvent::KeyPress) {
QKeyEvent *key = static_cast<QKeyEvent*> (event); QKeyEvent *key = static_cast<QKeyEvent*> (event);
if ((key->key () == Qt::Key_Enter) if (((key->key () == Qt::Key_Enter)
|| (key->key () == Qt::Key_Return) && m_pPlugins->currentItem ()) { || (key->key () == Qt::Key_Return)) && m_pPlugins->currentItem ()) {
insert (m_pPlugins->currentItem ()); insert (m_pPlugins->currentItem ());
return true; return true;
} }
@ -291,7 +292,7 @@ PluginsListDialog::eventFilter (QObject *obj, QEvent *event)
void void
PluginsListDialog::filterPlagins (const QString &text) PluginsListDialog::filterPlagins (const QString &text)
{ {
for (std::size_t i = 0; i < m_pPlugins->count (); i++) { for (int i = 0; i < m_pPlugins->count (); i++) {
QListWidgetItem *pitem = m_pPlugins->item (i); QListWidgetItem *pitem = m_pPlugins->item (i);
if (pitem->text ().contains (text)) if (pitem->text ().contains (text))