From: Till Theato Date: Sun, 24 Jul 2011 12:10:35 +0000 (+0000) Subject: Fix a couple of compile warnings because of unused and uninitialized variables. X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=4e2125a93b533b2d29232d9072a5a757ce2616e1;p=kdenlive Fix a couple of compile warnings because of unused and uninitialized variables. svn path=/trunk/kdenlive/; revision=5806 --- diff --git a/src/audioscopes/ffttools.cpp b/src/audioscopes/ffttools.cpp index b16106f2..3d1ae83f 100644 --- a/src/audioscopes/ffttools.cpp +++ b/src/audioscopes/ffttools.cpp @@ -292,7 +292,7 @@ const QVector FFTTools::interpolatePeakPreserving(const QVector in // If there are more than 2 samples per pixel in average, then use the maximum of them // since by only looking at the left sample we might miss some maxima. uint src = left; - int xi_prev = 0; +// int xi_prev = 0; int points; #ifdef DEBUG_FFTTOOLS @@ -316,7 +316,7 @@ const QVector FFTTools::interpolatePeakPreserving(const QVector in points++; } - xi_prev = xi; +// xi_prev = xi; } } // Fill the rest of the vector if the right border exceeds the input vector. diff --git a/src/clipproperties.cpp b/src/clipproperties.cpp index f9d79573..f0f3e051 100644 --- a/src/clipproperties.cpp +++ b/src/clipproperties.cpp @@ -269,7 +269,6 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg m_view.clip_color->setColor(QColor('#' + props.value("colour").right(8).left(6))); connect(m_view.clip_color, SIGNAL(changed(QColor)), this, SLOT(slotModified())); } else if (t == SLIDESHOW) { - bool isMime = true; if (url.fileName().startsWith(".all.")) { // the image sequence is defined by mimetype m_view.clip_path->setText(url.directory()); @@ -278,7 +277,6 @@ ClipProperties::ClipProperties(DocClipBase *clip, Timecode tc, double fps, QWidg m_view.slide_type_label->setHidden(true); m_view.image_type->setHidden(true); m_view.clip_path->setText(url.path()); - isMime = false; } m_view.tabWidget->removeTab(METATAB); diff --git a/src/colorcorrection/vectorscopegenerator.cpp b/src/colorcorrection/vectorscopegenerator.cpp index 9f3a9bd1..4ee5eccc 100644 --- a/src/colorcorrection/vectorscopegenerator.cpp +++ b/src/colorcorrection/vectorscopegenerator.cpp @@ -134,7 +134,7 @@ QImage VectorscopeGenerator::calculateVectorscope(const QSize &vectorscopeSize, int r,g,b; double dy, dr, dg, db, dmax; - double y,u,v; + double /*y,*/ u, v; QPoint pt; QRgb px; @@ -153,12 +153,13 @@ QImage VectorscopeGenerator::calculateVectorscope(const QSize &vectorscopeSize, switch (colorSpace) { case VectorscopeGenerator::ColorSpace_YUV: - y = (double) 0.001173 * r +0.002302 * g +0.0004471* b; +// y = (double) 0.001173 * r +0.002302 * g +0.0004471* b; u = (double) -0.0005781* r -0.001135 * g +0.001713 * b; v = (double) 0.002411 * r -0.002019 * g -0.0003921* b; break; case VectorscopeGenerator::ColorSpace_YPbPr: - y = (double) 0.001173 * r +0.002302 * g +0.0004471* b; + default: +// y = (double) 0.001173 * r +0.002302 * g +0.0004471* b; u = (double) -0.0006671* r -0.001299 * g +0.0019608* b; v = (double) 0.001961 * r -0.001642 * g -0.0003189* b; break; @@ -187,6 +188,7 @@ QImage VectorscopeGenerator::calculateVectorscope(const QSize &vectorscopeSize, db = dy + 517.2*u; break; case VectorscopeGenerator::ColorSpace_YPbPr: + default: dr = dy + 357.5*v; dg = dy - 87.75*u - 182*v; db = dy + 451.9*u; @@ -215,6 +217,7 @@ QImage VectorscopeGenerator::calculateVectorscope(const QSize &vectorscopeSize, db = dy + 517.2*u; break; case VectorscopeGenerator::ColorSpace_YPbPr: + default: dr = dy + 357.5*v; dg = dy - 87.75*u - 182*v; db = dy + 451.9*u; diff --git a/src/colortools.cpp b/src/colortools.cpp index d618e538..4353c790 100644 --- a/src/colortools.cpp +++ b/src/colortools.cpp @@ -291,7 +291,7 @@ QImage ColorTools::hsvCurvePlane(const QSize &size, const QColor &baseColor, Q_ASSERT(size.width() > 0); Q_ASSERT(size.height() > 0); - int xMax, yMax; + /*int xMax, yMax; switch(xVariant) { case COM_H: @@ -311,7 +311,7 @@ QImage ColorTools::hsvCurvePlane(const QSize &size, const QColor &baseColor, case COM_V: yMax = 256; break; - } + }*/ QImage plane(size, QImage::Format_ARGB32); diff --git a/src/customtrackview.cpp b/src/customtrackview.cpp index 5eb7a091..2378a79d 100644 --- a/src/customtrackview.cpp +++ b/src/customtrackview.cpp @@ -701,7 +701,6 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event) m_blockRefresh = true; m_dragGuide = NULL; - bool collision = false; if (m_tool != RAZORTOOL) activateMonitor(); else if (m_document->renderer()->playSpeed() != 0.0) { @@ -729,7 +728,6 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event) m_dragGuide = (Guide *) collisionList.at(i); if (event->button() == Qt::LeftButton) { // move it m_dragGuide->setFlag(QGraphicsItem::ItemIsMovable, true); - collision = true; m_operationMode = MOVEGUIDE; // deselect all clips so that only the guide will move m_scene->clearSelection(); @@ -3769,7 +3767,6 @@ void CustomTrackView::deleteSelectedClips() scene()->clearSelection(); QUndoCommand *deleteSelected = new QUndoCommand(); - bool resetGroup = false; int groupCount = 0; int clipCount = 0; int transitionCount = 0; @@ -3780,7 +3777,6 @@ void CustomTrackView::deleteSelectedClips() QList children = itemList.at(i)->childItems(); QList clipInfos; QList transitionInfos; - GenTime currentPos = GenTime(m_cursorPos, m_document->fps()); for (int j = 0; j < children.count(); j++) { if (children.at(j)->type() == AVWIDGET) { AbstractClipItem *clip = static_cast (children.at(j)); @@ -3806,7 +3802,6 @@ void CustomTrackView::deleteSelectedClips() if (itemList.at(i)->type() == AVWIDGET) { clipCount++; ClipItem *item = static_cast (itemList.at(i)); - if (item->parentItem()) resetGroup = true; //kDebug()<<"// DELETE CLP AT: "<info().startPos.frames(25); new AddTimelineClipCommand(this, item->xml(), item->clipProducer(), item->info(), item->effectList(), false, false, true, true, deleteSelected); emit clipItemSelected(NULL); @@ -3814,7 +3809,6 @@ void CustomTrackView::deleteSelectedClips() transitionCount++; Transition *item = static_cast (itemList.at(i)); //kDebug()<<"// DELETE TRANS AT: "<info().startPos.frames(25); - if (item->parentItem()) resetGroup = true; new AddTransitionCommand(this, item->info(), item->transitionEndTrack(), item->toXML(), true, true, deleteSelected); emit transitionItemSelected(NULL); } @@ -3845,7 +3839,6 @@ void CustomTrackView::changeClipSpeed() for (int i = 0; i < itemList.count(); i++) { if (itemList.at(i)->type() == AVWIDGET) { ClipItem *item = static_cast (itemList.at(i)); - ItemInfo info = item->info(); if (percent == -1) percent = QInputDialog::getInteger(this, i18n("Edit Clip Speed"), i18n("New speed (percents)"), item->speed() * 100, 1, 10000, 1, &ok); if (!ok) break; double speed = (double) percent / 100.0; @@ -3995,7 +3988,6 @@ void CustomTrackView::groupClips(bool group) QList itemList = scene()->selectedItems(); QList clipInfos; QList transitionInfos; - GenTime currentPos = GenTime(m_cursorPos, m_document->fps()); // Expand groups int max = itemList.count(); diff --git a/src/dvdwizardmenu.cpp b/src/dvdwizardmenu.cpp index 89ce70c7..625754c6 100644 --- a/src/dvdwizardmenu.cpp +++ b/src/dvdwizardmenu.cpp @@ -640,7 +640,6 @@ void DvdWizardMenu::loadXml(QDomElement xml) button->setBackMenu(e.attribute("backtomenu").toInt()); button->setDefaultTextColor(m_view.text_color->color()); button->setZValue(4); - QRectF r = button->sceneBoundingRect(); m_scene->addItem(button); button->setPos(e.attribute("posx").toDouble(), e.attribute("posy").toDouble()); diff --git a/src/graphicsscenerectmove.cpp b/src/graphicsscenerectmove.cpp index a905d1ae..99f93eeb 100644 --- a/src/graphicsscenerectmove.cpp +++ b/src/graphicsscenerectmove.cpp @@ -154,14 +154,12 @@ void GraphicsSceneRectMove::mousePressEvent(QGraphicsSceneMouseEvent* e) m_resizeMode = NoResize; const QList list = items(QRectF(p , QSizeF(4, 4)).toRect()); QGraphicsItem *item = NULL; - bool hasSelected = false; if (m_tool == TITLE_SELECT) { foreach(QGraphicsItem *g, list) { kDebug() << " - - CHECKING ITEM Z:" << g->zValue() << ", TYPE: " << g->type(); // check is there is a selected item in list if (g->zValue() > -1000 && g->isSelected()) { - hasSelected = true; item = g; break; } diff --git a/src/headertrack.cpp b/src/headertrack.cpp index 3cc057a6..64876175 100644 --- a/src/headertrack.cpp +++ b/src/headertrack.cpp @@ -120,7 +120,6 @@ HeaderTrack::HeaderTrack(int index, TrackInfo info, int height, QWidget *parent) void HeaderTrack::updateEffectLabel(QStringList effects) { - QColor col = track_number->palette().color(QPalette::Base); if (!effects.isEmpty()) { effect_label->setHidden(false); effect_label->setToolTip(effects.join("/")); diff --git a/src/renderwidget.cpp b/src/renderwidget.cpp index 8c2f9e9d..a654bc60 100644 --- a/src/renderwidget.cpp +++ b/src/renderwidget.cpp @@ -1720,12 +1720,12 @@ void RenderWidget::parseScriptFiles() item->setData(1, Qt::UserRole, KUrl(target).path()); item->setData(1, Qt::UserRole + 1, scriptpath.path()); } - bool activate = false; +// bool activate = false; QTreeWidgetItem *script = m_view.scripts_list->topLevelItem(0); if (script) { m_view.scripts_list->setCurrentItem(script); script->setSelected(true); - activate = true; +// activate = true; } // m_view.start_script->setEnabled(activate); // m_view.delete_script->setEnabled(activate); diff --git a/src/stopmotion/stopmotion.cpp b/src/stopmotion/stopmotion.cpp index 1055d0c2..a018fe76 100644 --- a/src/stopmotion/stopmotion.cpp +++ b/src/stopmotion/stopmotion.cpp @@ -885,6 +885,7 @@ void StopmotionWidget::slotSwitchMirror(bool isOn) const QString StopmotionWidget::createProducer(MltVideoProfile profile, const QString service, const QString resource) { + Q_UNUSED(profile) QString playlist = "producer100000pause" + resource + "" + service + ""; diff --git a/src/v4l/src.c b/src/v4l/src.c index f83dfdfb..b265b989 100644 --- a/src/v4l/src.c +++ b/src/v4l/src.c @@ -25,7 +25,7 @@ int v4l2_free_mmap(src_t *src) { src_v4l2_t *s = (src_v4l2_t *) src->state; - int i; + uint i; for(i = 0; i < s->req.count; i++) munmap(s->buffer[i].start, s->buffer[i].length);