summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent PINON <vincent.pinon@laposte.net>2014-05-05 06:03:09 (GMT)
committerVincent PINON <vincent.pinon@laposte.net>2014-05-05 06:03:09 (GMT)
commit7d8f495c5721e5b3bf51f78a73429818a3595fa4 (patch)
treea45e373e59d45ecfd2ab77b22c013d7304fe1be5
parentbd9d3bba6d7384e9698f130e0b75157b1df3eb71 (diff)
Cppcheck fixs
-rw-r--r--src/clipitem.cpp4
-rw-r--r--src/customtrackview.cpp8
-rw-r--r--src/lib/external/kiss_fft/tools/kiss_fastfir.c3
-rw-r--r--src/mainwindow.cpp6
4 files changed, 9 insertions, 12 deletions
diff --git a/src/clipitem.cpp b/src/clipitem.cpp
index fc40c10..2454ea3 100644
--- a/src/clipitem.cpp
+++ b/src/clipitem.cpp
@@ -1411,11 +1411,11 @@ QVariant ClipItem::itemChange(GraphicsItemChange change, const QVariant &value)
items = scene()->items(sceneShape, Qt::IntersectsItemShape);
items.removeAll(this);
bool forwardMove = newPos.x() > pos().x();
- int offset = 0;
if (!items.isEmpty()) {
for (int i = 0; i < items.count(); ++i) {
if (!items.at(i)->isEnabled()) continue;
if (items.at(i)->type() == type()) {
+ int offset = 0;
// Collision!
QPointF otherPos = items.at(i)->pos();
if ((int) otherPos.y() != (int) pos().y()) {
@@ -1821,7 +1821,7 @@ void ClipItem::dropEvent(QGraphicsSceneDragDropEvent * event)
// single effect dropped
e.removeAttribute("kdenlive_ix");
}
- CustomTrackView *view = (CustomTrackView *) scene()->views().first();
+ CustomTrackView *view = static_cast<CustomTrackView*>(scene()->views().first());
if (view) view->slotDropEffect(this, e, m_info.startPos, track());
}
else return;
diff --git a/src/customtrackview.cpp b/src/customtrackview.cpp
index 1eb445f..350c934 100644
--- a/src/customtrackview.cpp
+++ b/src/customtrackview.cpp
@@ -490,9 +490,9 @@ void CustomTrackView::mouseMoveEvent(QMouseEvent * event)
QString offset = m_document->timecode().getDisplayTimecode(m_dragItem->cropDuration() - m_dragItemInfo.cropDuration, KdenliveSettings::frametimecode());
emit displayMessage(i18n("Duration:") + ' ' + duration + ' ' + i18n("Offset:") + ' ' + offset, InformationMessage);
} else if (m_operationMode == FadeIn && move) {
- ((ClipItem*) m_dragItem)->setFadeIn(static_cast<int>(mappedXPos - m_dragItem->startPos().frames(m_document->fps())));
+ static_cast<ClipItem*>(m_dragItem)->setFadeIn(static_cast<int>(mappedXPos - m_dragItem->startPos().frames(m_document->fps())));
} else if (m_operationMode == FadeOut && move) {
- ((ClipItem*) m_dragItem)->setFadeOut(static_cast<int>(m_dragItem->endPos().frames(m_document->fps()) - mappedXPos));
+ static_cast<ClipItem*>(m_dragItem)->setFadeOut(static_cast<int>(m_dragItem->endPos().frames(m_document->fps()) - mappedXPos));
} else if (m_operationMode == KeyFrame && move) {
GenTime keyFramePos = GenTime(mappedXPos, m_document->fps()) - m_dragItem->startPos() + m_dragItem->cropStart();
double pos = mapToScene(event->pos()).toPoint().y();
@@ -3585,7 +3585,7 @@ void CustomTrackView::deleteClip(const QString &clipId)
int count = 0;
for (int i = 0; i < itemList.count(); ++i) {
if (itemList.at(i)->type() == AVWidget) {
- ClipItem *item = (ClipItem *)itemList.at(i);
+ ClipItem *item = static_cast<ClipItem*>(itemList.at(i));
if (item->clipProducer() == clipId) {
count++;
if (item->parentItem()) {
@@ -3733,7 +3733,7 @@ void CustomTrackView::mouseReleaseEvent(QMouseEvent * event)
for (int i = 0; i < items.count(); ++i) {
if (items.at(i)->type() == GroupWidget) {
- AbstractGroupItem* group = (AbstractGroupItem*)items.at(i);
+ AbstractGroupItem* group = static_cast<AbstractGroupItem*>(items.at(i));
if (!groups.contains(group)) groups.append(group);
items += items.at(i)->childItems();
}
diff --git a/src/lib/external/kiss_fft/tools/kiss_fastfir.c b/src/lib/external/kiss_fft/tools/kiss_fastfir.c
index eed90ab..d68ddb7 100644
--- a/src/lib/external/kiss_fft/tools/kiss_fastfir.c
+++ b/src/lib/external/kiss_fft/tools/kiss_fastfir.c
@@ -252,9 +252,6 @@ void direct_file_filter(
size_t nbuf;
size_t oldestlag = 0;
size_t k, tap;
-#ifndef REAL_FASTFIR
- kffsamp_t tmp;
-#endif
nbuf = 4096;
buf = (kffsamp_t *) malloc ( sizeof (kffsamp_t) * nbuf);
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index a291f8b..6a2fc1f 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -2021,7 +2021,7 @@ void MainWindow::activateDocument()
if (m_timelineArea->currentWidget() == NULL || !m_timelineArea->isEnabled()) {
return;
}
- TrackView *currentTab = (TrackView *) m_timelineArea->currentWidget();
+ TrackView *currentTab = static_cast<TrackView*>(m_timelineArea->currentWidget());
KdenliveDoc *currentDoc = currentTab->document();
connectDocumentInfo(currentDoc);
connectDocument(currentTab, currentDoc);
@@ -2039,7 +2039,7 @@ bool MainWindow::closeCurrentDocument(bool saveChanges)
ix = 0;
}
m_timelineArea->setCurrentIndex(ix);
- TrackView *tabToClose = (TrackView *) w;
+ TrackView *tabToClose = static_cast<TrackView*>(w);
KdenliveDoc *docToClose = tabToClose->document();
if (docToClose && docToClose->isModified() && saveChanges) {
QString message;
@@ -2217,7 +2217,7 @@ void MainWindow::openFile(const KUrl &url)
bool isOpened = false;
int i;
for (i = 0; i < ct; ++i) {
- TrackView *tab = (TrackView *) m_timelineArea->widget(i);
+ TrackView *tab = static_cast<TrackView*>(m_timelineArea->widget(i));
KdenliveDoc *doc = tab->document();
if (doc->url() == url) {
isOpened = true;