summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent PINON <vincent.pinon@laposte.net>2014-05-04 22:15:20 (GMT)
committerVincent PINON <vincent.pinon@laposte.net>2014-05-04 23:02:41 (GMT)
commitbd9d3bba6d7384e9698f130e0b75157b1df3eb71 (patch)
tree385708817ddd4dcf9d37f83a0425e3db8846d9aa
parent56acd92470a1cf7e30c1163f2260dc31212458cb (diff)
Cppcheck fixs
Conflicts: src/kthumb.cpp src/mainwindow.cpp src/mltdevicecapture.cpp src/renderer.cpp
-rw-r--r--src/abstractclipitem.cpp2
-rw-r--r--src/abstractgroupitem.cpp42
-rw-r--r--src/clipstabilize.cpp2
-rw-r--r--src/colorcorrection/rgbparadegenerator.cpp4
-rw-r--r--src/customtrackscene.cpp2
-rw-r--r--src/customtrackview.cpp46
-rw-r--r--src/effectstack/parametercontainer.cpp14
-rw-r--r--src/jogshuttle.cpp6
-rw-r--r--src/kdenlivesettingsdialog.cpp2
-rw-r--r--src/kthumb.cpp1
-rw-r--r--src/lib/audio/audioEnvelope.cpp2
-rw-r--r--src/lib/external/kiss_fft/tools/kiss_fastfir.c45
-rw-r--r--src/lib/external/kiss_fft/tools/psdpng.c10
-rw-r--r--src/lib/external/media_ctrl/mediactrl.c5
-rw-r--r--src/mainwindow.cpp11
-rw-r--r--src/projectlistview.cpp4
-rw-r--r--src/renderer.cpp4
-rw-r--r--src/scopes/abstractscopewidget.cpp6
-rw-r--r--src/scopes/audioscopes/spectrogram.cpp6
-rw-r--r--src/titledocument.cpp12
-rw-r--r--src/transition.cpp2
-rw-r--r--src/v4l/v4lcapture.cpp2
-rw-r--r--src/widgets/kis_curve_widget.cpp6
-rw-r--r--src/widgets/monitoreditwidget.cpp2
24 files changed, 95 insertions, 143 deletions
diff --git a/src/abstractclipitem.cpp b/src/abstractclipitem.cpp
index 8179a83..294b954 100644
--- a/src/abstractclipitem.cpp
+++ b/src/abstractclipitem.cpp
@@ -223,7 +223,7 @@ void AbstractClipItem::resizeEnd(int posx, bool /*emitChange*/)
//kDebug() << "///////// COLLISION DETECTED!!!!!!!!!";
//kDebug() << "///////// CURRENT: " << startPos().frames(25) << "x" << endPos().frames(25) << ", RECT: " << rect() << "-" << pos();
//kDebug() << "///////// COLLISION: " << ((AbstractClipItem *)item)->startPos().frames(25) << "x" << ((AbstractClipItem *)item)->endPos().frames(25) << ", RECT: " << ((AbstractClipItem *)item)->rect() << "-" << item->pos();
- GenTime diff = ((AbstractClipItem *)item)->startPos() - startPos();
+ GenTime diff = static_cast<AbstractClipItem*>(item)->startPos() - startPos();
if (fixItem == false || diff < m_info.cropDuration) {
fixItem = true;
m_info.cropDuration = diff;
diff --git a/src/abstractgroupitem.cpp b/src/abstractgroupitem.cpp
index 2b74e01..2783cb2 100644
--- a/src/abstractgroupitem.cpp
+++ b/src/abstractgroupitem.cpp
@@ -78,7 +78,7 @@ void AbstractGroupItem::setItemLocked(bool locked)
setFlag(QGraphicsItem::ItemIsSelectable, !locked);
foreach (QGraphicsItem *child, childItems())
- ((AbstractClipItem *)child)->setItemLocked(locked);
+ static_cast<AbstractClipItem*>(child)->setItemLocked(locked);
}
bool AbstractGroupItem::isItemLocked() const
@@ -318,19 +318,11 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
return pos();
}
AbstractClipItem *item = static_cast <AbstractClipItem *>(collision);
- if (forwardMove) {
- // Moving forward, determine best pos
- QPainterPath clipPath;
- clipPath.addRect(item->sceneBoundingRect());
- QPainterPath res = shape.intersected(clipPath);
- offset = qMax(offset, (int)(res.boundingRect().width() + 0.5));
- } else {
- // Moving backward, determine best pos
- QPainterPath clipPath;
- clipPath.addRect(item->sceneBoundingRect());
- QPainterPath res = shape.intersected(clipPath);
- offset = qMax(offset, (int)(res.boundingRect().width() + 0.5));
- }
+ // Determine best pos
+ QPainterPath clipPath;
+ clipPath.addRect(item->sceneBoundingRect());
+ QPainterPath res = shape.intersected(clipPath);
+ offset = qMax(offset, (int)(res.boundingRect().width() + 0.5));
}
}
if (offset > 0) {
@@ -383,19 +375,11 @@ QVariant AbstractGroupItem::itemChange(GraphicsItemChange change, const QVariant
return pos();
}
AbstractClipItem *item = static_cast <AbstractClipItem *>(collision);
- if (forwardMove) {
- // Moving forward, determine best pos
- QPainterPath clipPath;
- clipPath.addRect(item->sceneBoundingRect());
- QPainterPath res = shape.intersected(clipPath);
- offset = qMax(offset, (int)(res.boundingRect().width() + 0.5));
- } else {
- // Moving backward, determine best pos
- QPainterPath clipPath;
- clipPath.addRect(item->sceneBoundingRect());
- QPainterPath res = shape.intersected(clipPath);
- offset = qMax(offset, (int)(res.boundingRect().width() + 0.5));
- }
+ // Determine best pos
+ QPainterPath clipPath;
+ clipPath.addRect(item->sceneBoundingRect());
+ QPainterPath res = shape.intersected(clipPath);
+ offset = qMax(offset, (int)(res.boundingRect().width() + 0.5));
}
}
if (offset > 0) {
@@ -426,13 +410,13 @@ void AbstractGroupItem::dropEvent(QGraphicsSceneDragDropEvent * event)
doc.setContent(effects, true);
QDomElement e = doc.documentElement();
e.setAttribute("kdenlive_ix", 0);
- CustomTrackView *view = (CustomTrackView *) scene()->views()[0];
+ CustomTrackView *view = static_cast<CustomTrackView*>(scene()->views()[0]);
QPointF dropPos = event->scenePos();
QList<QGraphicsItem *> selection = scene()->items(dropPos);
AbstractClipItem *dropChild = NULL;
for (int i = 0; i < selection.count(); ++i) {
if (selection.at(i)->type() == AVWidget) {
- dropChild = (AbstractClipItem *) selection.at(i);
+ dropChild = static_cast<AbstractClipItem*>(selection.at(i));
break;
}
}
diff --git a/src/clipstabilize.cpp b/src/clipstabilize.cpp
index 8c983a0..5625680 100644
--- a/src/clipstabilize.cpp
+++ b/src/clipstabilize.cpp
@@ -240,7 +240,7 @@ void ClipStabilize::slotUpdateParams()
QString name=w->objectName();
if (!name.isEmpty() && m_ui_params.contains(name)){
if (m_ui_params[name]["type"]=="int" || m_ui_params[name]["type"]=="double"){
- DoubleParameterWidget *dbl=(DoubleParameterWidget*)w;
+ DoubleParameterWidget *dbl=static_cast<DoubleParameterWidget*>(w);
m_ui_params[name]["value"]=QString::number((double)(dbl->getValue()));
}else if (m_ui_params[name]["type"]=="bool"){
QCheckBox *ch=(QCheckBox*)w;
diff --git a/src/colorcorrection/rgbparadegenerator.cpp b/src/colorcorrection/rgbparadegenerator.cpp
index 6d85d08..1dd90c4 100644
--- a/src/colorcorrection/rgbparadegenerator.cpp
+++ b/src/colorcorrection/rgbparadegenerator.cpp
@@ -52,7 +52,7 @@ QImage RGBParadeGenerator::calculateRGBParade(const QSize &paradeSize, const QIm
QRgb *col;
QPainter davinci(&parade);
- double dx, dy;
+ double dx;
const uint ww = paradeSize.width();
const uint wh = paradeSize.height();
@@ -148,7 +148,7 @@ QImage RGBParadeGenerator::calculateRGBParade(const QSize &paradeSize, const QIm
if (drawAxis) {
QRgb opx;
for (uint i = 0; i <= 10; ++i) {
- dy = (float)i/10 * (partH-1);
+ double dy = (float)i/10 * (partH-1);
for (uint x = 0; x < ww-distRight; x++) {
opx = parade.pixel(x, dy);
parade.setPixel(x,dy, qRgba(CHOP255(150+qRed(opx)), 255,
diff --git a/src/customtrackscene.cpp b/src/customtrackscene.cpp
index 35d1206..27a28e3 100644
--- a/src/customtrackscene.cpp
+++ b/src/customtrackscene.cpp
@@ -36,8 +36,8 @@ CustomTrackScene::~CustomTrackScene()
double CustomTrackScene::getSnapPointForPos(double pos, bool doSnap)
{
- double maximumOffset;
if (doSnap) {
+ double maximumOffset;
if (m_scale.x() > 3) maximumOffset = 10 / m_scale.x();
else maximumOffset = 6 / m_scale.x();
for (int i = 0; i < m_snapPoints.size(); ++i) {
diff --git a/src/customtrackview.cpp b/src/customtrackview.cpp
index 81b92e7..1eb445f 100644
--- a/src/customtrackview.cpp
+++ b/src/customtrackview.cpp
@@ -300,7 +300,7 @@ void CustomTrackView::updateSceneFrameWidth()
ClipItem *item;
for (int i = 0; i < itemList.count(); ++i) {
if (itemList.at(i)->type() == AVWidget) {
- item = (ClipItem*) itemList.at(i);
+ item = static_cast<ClipItem*>(itemList.at(i));
item->resetFrameWidth(frameWidth);
item->resetThumbs(true);
}
@@ -320,13 +320,13 @@ bool CustomTrackView::checkTrackHeight()
KdenliveSettings::setSnaptopoints(false);
for (int i = 0; i < itemList.count(); ++i) {
if (itemList.at(i)->type() == AVWidget) {
- item = (ClipItem*) itemList.at(i);
+ item = static_cast<ClipItem*>(itemList.at(i));
item->setRect(0, 0, item->rect().width(), m_tracksHeight - 1);
item->setPos((qreal) item->startPos().frames(m_document->fps()), (qreal) item->track() * m_tracksHeight + 1);
item->resetFrameWidth(frameWidth);
item->resetThumbs(true);
} else if (itemList.at(i)->type() == TransitionWidget) {
- transitionitem = (Transition*) itemList.at(i);
+ transitionitem = static_cast<Transition*>(itemList.at(i));
transitionitem->setRect(0, 0, transitionitem->rect().width(), m_tracksHeight / 3 * 2 - 1);
transitionitem->setPos((qreal) transitionitem->startPos().frames(m_document->fps()), (qreal) transitionitem->track() * m_tracksHeight + m_tracksHeight / 3 * 2);
}
@@ -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((int)(mappedXPos - m_dragItem->startPos().frames(m_document->fps())));
+ ((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((int)(m_dragItem->endPos().frames(m_document->fps()) - mappedXPos));
+ ((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();
@@ -647,7 +647,7 @@ void CustomTrackView::mouseMoveEvent(QMouseEvent * event)
// razor tool over a clip, display current frame in monitor
if (false && !m_blockRefresh && item->type() == AVWidget) {
//TODO: solve crash when showing frame when moving razor over clip
- emit showClipFrame(((ClipItem *) item)->baseClip(), QPoint(), false, mappedXPos - (clip->startPos() - clip->cropStart()).frames(m_document->fps()));
+ emit showClipFrame(static_cast<ClipItem*>(item)->baseClip(), QPoint(), false, mappedXPos - (clip->startPos() - clip->cropStart()).frames(m_document->fps()));
}
event->accept();
return;
@@ -808,7 +808,7 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event)
for (int i = 0; i < collisionList.count(); ++i) {
if (collisionList.at(i)->type() == GUIDEITEM) {
// a guide item was pressed
- m_dragGuide = (Guide *) collisionList.at(i);
+ m_dragGuide = static_cast<Guide*>(collisionList.at(i));
if (event->button() == Qt::LeftButton) { // move it
m_dragGuide->setFlag(QGraphicsItem::ItemIsMovable, true);
m_operationMode = MoveGuide;
@@ -1023,7 +1023,7 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event)
} else {
m_document->renderer()->pause();
if (m_dragItem->parentItem() && m_dragItem->parentItem() != m_selectionGroup) {
- razorGroup((AbstractGroupItem *)m_dragItem->parentItem(), cutPos);
+ razorGroup(static_cast<AbstractGroupItem*>(m_dragItem->parentItem()), cutPos);
} else {
ClipItem *clip = static_cast <ClipItem *>(m_dragItem);
RazorClipCommand* command = new RazorClipCommand(this, clip->info(), clip->effectList(), cutPos);
@@ -1207,7 +1207,7 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event)
} else transitionAccepted = false;
}
}
- if (transitionAccepted) slotAddTransition((ClipItem *) m_dragItem, info, transitiontrack);
+ if (transitionAccepted) slotAddTransition(static_cast<ClipItem*>(m_dragItem), info, transitiontrack);
else emit displayMessage(i18n("Cannot add transition"), ErrorMessage);
} else if (m_operationMode == TransitionEnd && event->modifiers() != Qt::ControlModifier) {
ItemInfo info;
@@ -1242,7 +1242,7 @@ void CustomTrackView::mousePressEvent(QMouseEvent * event)
} else transitionAccepted = false;
}
}
- if (transitionAccepted) slotAddTransition((ClipItem *) m_dragItem, info, transitiontrack, transition);
+ if (transitionAccepted) slotAddTransition(static_cast<ClipItem*>(m_dragItem), info, transitiontrack, transition);
else emit displayMessage(i18n("Cannot add transition"), ErrorMessage);
} else if ((m_operationMode == ResizeStart || m_operationMode == ResizeEnd) && m_selectionGroup) {
@@ -1474,7 +1474,7 @@ void CustomTrackView::mouseDoubleClickEvent(QMouseEvent *event)
} else {
QList<QGraphicsItem *> collisionList = items(event->pos());
if (collisionList.count() == 1 && collisionList.at(0)->type() == GUIDEITEM) {
- Guide *editGuide = (Guide *) collisionList.at(0);
+ Guide *editGuide = static_cast<Guide*>(collisionList.at(0));
if (editGuide) slotEditGuide(editGuide->info());
}
}
@@ -2572,7 +2572,7 @@ void CustomTrackView::slotAddTransitionToSelectedClips(QDomElement transition)
QList<QGraphicsItem *> itemList = scene()->selectedItems();
if (itemList.count() == 1) {
if (itemList.at(0)->type() == AVWidget) {
- ClipItem *item = (ClipItem *) itemList.at(0);
+ ClipItem *item = static_cast<ClipItem*>(itemList.at(0));
ItemInfo info;
info.track = item->track();
ClipItem *transitionClip = NULL;
@@ -2630,7 +2630,7 @@ void CustomTrackView::slotAddTransitionToSelectedClips(QDomElement transition)
}
} else 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));
ItemInfo info;
info.startPos = item->startPos();
info.endPos = info.startPos + GenTime(65, m_document->fps());
@@ -2877,7 +2877,7 @@ void CustomTrackView::dropEvent(QDropEvent * event)
groupSelectedItems(items);
} else if (items.count() == 1) {
m_dragItem = static_cast <AbstractClipItem *>(items.at(0));
- emit clipItemSelected((ClipItem*) m_dragItem, false);
+ emit clipItemSelected(static_cast<ClipItem*>(m_dragItem), false);
}
m_document->renderer()->refreshIfActive();
event->setDropAction(Qt::MoveAction);
@@ -3251,7 +3251,7 @@ void CustomTrackView::lockTrack(int ix, bool lock, bool requestUpdate)
QList<QGraphicsItem *> selection = m_scene->items(0, ix * m_tracksHeight + m_tracksHeight / 2, sceneRect().width(), m_tracksHeight / 2 - 2);
for (int i = 0; i < selection.count(); ++i) {
- if (selection.at(i)->type() == GroupWidget && (AbstractGroupItem *)selection.at(i) != m_selectionGroup) {
+ if (selection.at(i)->type() == GroupWidget && static_cast<AbstractGroupItem*>(selection.at(i)) != m_selectionGroup) {
if (selection.at(i)->parentItem() && m_selectionGroup) {
selection.removeAll((QGraphicsItem*)m_selectionGroup);
resetSelectionGroup();
@@ -3283,7 +3283,7 @@ void CustomTrackView::lockTrack(int ix, bool lock, bool requestUpdate)
hasClipOnTrack = true;
}
if (changeGroupLock && hasClipOnTrack)
- ((AbstractGroupItem*)selection.at(i))->setItemLocked(lock);
+ static_cast<AbstractGroupItem*>(selection.at(i))->setItemLocked(lock);
} else if((selection.at(i)->type() == AVWidget || selection.at(i)->type() == TransitionWidget)) {
if (selection.at(i)->parentItem()) {
if (selection.at(i)->parentItem() == m_selectionGroup) {
@@ -4903,7 +4903,7 @@ void CustomTrackView::moveGroup(QList<ItemInfo> startClip, QList<ItemInfo> start
//grp->moveBy(offset.frames(m_document->fps()), trackOffset *(qreal) m_tracksHeight);
/*m_document->clipManager()->removeGroup(grp);
m_scene->destroyItemGroup(grp);*/
- AbstractGroupItem *group = (AbstractGroupItem*) children.at(i);
+ AbstractGroupItem *group = static_cast<AbstractGroupItem*>(children.at(i));
if (!groupList.contains(group)) groupList.append(group);
children.removeAll(children.at(i));
--i;
@@ -6025,7 +6025,7 @@ QList<ItemInfo> CustomTrackView::findId(const QString &clipId)
QList<QGraphicsItem *> itemList = items();
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)
matchingInfo << item->info();
}
@@ -7172,7 +7172,7 @@ QStringList CustomTrackView::selectedClips() const
QList<QGraphicsItem *> selection = m_scene->selectedItems();
for (int i = 0; i < selection.count(); ++i) {
if (selection.at(i)->type() == AVWidget) {
- ClipItem *item = (ClipItem *)selection.at(i);
+ ClipItem *item = static_cast<ClipItem*>(selection.at(i));
clipIds << item->clipProducer();
}
}
@@ -7185,7 +7185,7 @@ QList<ClipItem *> CustomTrackView::selectedClipItems() const
QList<QGraphicsItem *> selection = m_scene->selectedItems();
for (int i = 0; i < selection.count(); ++i) {
if (selection.at(i)->type() == AVWidget) {
- clips.append((ClipItem *)selection.at(i));
+ clips.append(static_cast<ClipItem*>(selection.at(i)));
}
}
return clips;
@@ -7374,9 +7374,9 @@ void CustomTrackView::setTipAnimation(AbstractClipItem *clip, OperationType mode
((QGraphicsEllipseItem*) m_visualTip)->setBrush(m_tipColor);
((QGraphicsEllipseItem*) m_visualTip)->setPen(m_tipPen);
if (mode == FadeIn)
- m_visualTip->setPos(rect.x() + ((ClipItem *) clip)->fadeIn(), rect.y());
+ m_visualTip->setPos(rect.x() + static_cast<ClipItem*>(clip)->fadeIn(), rect.y());
else
- m_visualTip->setPos(rect.right() - ((ClipItem *) clip)->fadeOut(), rect.y());
+ m_visualTip->setPos(rect.right() - static_cast<ClipItem*>(clip)->fadeOut(), rect.y());
m_animation->setScaleAt(.5, 2, 2);
break;
@@ -7723,7 +7723,7 @@ void CustomTrackView::slotImportClipKeyframes(GraphicsRectItem type)
QList<QGraphicsItem *> children = m_selectionGroup->childItems();
for (int i = 0; i < children.count(); ++i) {
if (children.at(i)->type() == AVWidget) {
- item = (ClipItem*) children.at(i);
+ item = static_cast<ClipItem*>(children.at(i));
break;
}
}
diff --git a/src/effectstack/parametercontainer.cpp b/src/effectstack/parametercontainer.cpp
index e1e12c4..5811d7a 100644
--- a/src/effectstack/parametercontainer.cpp
+++ b/src/effectstack/parametercontainer.cpp
@@ -620,10 +620,10 @@ void ParameterContainer::slotCollectAllParameters()
DoubleParameterWidget *doubleparam = (DoubleParameterWidget*)m_valueItems.value(paramName);
setValue = locale.toString(doubleparam->getValue());
} else if (type == "list") {
- KComboBox *box = ((Listval*)m_valueItems.value(paramName))->list;
+ KComboBox *box = static_cast<Listval*>(m_valueItems.value(paramName))->list;
setValue = box->itemData(box->currentIndex()).toString();
} else if (type == "bool") {
- QCheckBox *box = ((Boolval*)m_valueItems.value(paramName))->checkBox;
+ QCheckBox *box = static_cast<Boolval*>(m_valueItems.value(paramName))->checkBox;
setValue = box->checkState() == Qt::Checked ? "1" : "0" ;
} else if (type == "color") {
ChooseColorWidget *choosecolor = ((ChooseColorWidget*)m_valueItems.value(paramName));
@@ -700,7 +700,7 @@ void ParameterContainer::slotCollectAllParameters()
setValue = widget->getSpline();
#endif
} else if (type == "wipe") {
- Wipeval *wp = (Wipeval*)m_valueItems.value(paramName);
+ Wipeval *wp = static_cast<Wipeval*>(m_valueItems.value(paramName));
wipeInfo info;
if (wp->start_left->isChecked())
info.start = LEFT;
@@ -742,11 +742,11 @@ void ParameterContainer::slotCollectAllParameters()
else if (pa.hasAttribute("intimeline"))
pa.setAttribute("intimeline", "0");
} else if (type == "url") {
- KUrlRequester *req = ((Urlval*)m_valueItems.value(paramName))->urlwidget;
+ KUrlRequester *req = static_cast<Urlval*>(m_valueItems.value(paramName))->urlwidget;
setValue = req->url().path();
} else if (type == "keywords"){
- QLineEdit *line = ((Keywordval*)m_valueItems.value(paramName))->lineeditwidget;
- QComboBox *combo = ((Keywordval*)m_valueItems.value(paramName))->comboboxwidget;
+ QLineEdit *line = static_cast<Keywordval*>(m_valueItems.value(paramName))->lineeditwidget;
+ QComboBox *combo = static_cast<Keywordval*>(m_valueItems.value(paramName))->comboboxwidget;
if(combo->currentIndex())
{
QString comboval = combo->itemData(combo->currentIndex()).toString();
@@ -755,7 +755,7 @@ void ParameterContainer::slotCollectAllParameters()
}
setValue = line->text();
} else if (type == "fontfamily") {
- QFontComboBox* fontfamily = ((Fontval*)m_valueItems.value(paramName))->fontfamilywidget;
+ QFontComboBox* fontfamily = static_cast<Fontval*>(m_valueItems.value(paramName))->fontfamilywidget;
setValue = fontfamily->currentFont().family();
}
if (!setValue.isNull())
diff --git a/src/jogshuttle.cpp b/src/jogshuttle.cpp
index 7e5f9a3..8acf0fd 100644
--- a/src/jogshuttle.cpp
+++ b/src/jogshuttle.cpp
@@ -207,10 +207,10 @@ void JogShuttle::customEvent(QEvent* e)
QEvent::Type type = e->type();
if (type == MediaCtrlEvent::Key) {
- MediaCtrlEvent* mev = (MediaCtrlEvent*)e;
+ MediaCtrlEvent* mev = static_cast<MediaCtrlEvent*>(e);
emit button(mev->value());
} else if (type == MediaCtrlEvent::Jog) {
- MediaCtrlEvent* mev = (MediaCtrlEvent*)e;
+ MediaCtrlEvent* mev = static_cast<MediaCtrlEvent*>(e);
int value = mev->value();
if (value < 0) {
@@ -219,7 +219,7 @@ void JogShuttle::customEvent(QEvent* e)
emit jogForward();
}
} else if (type == MediaCtrlEvent::Shuttle) {
- MediaCtrlEvent* mev = (MediaCtrlEvent*)e;
+ MediaCtrlEvent* mev = static_cast<MediaCtrlEvent*>(e);
emit shuttlePos(mev->value());
}
}
diff --git a/src/kdenlivesettingsdialog.cpp b/src/kdenlivesettingsdialog.cpp
index 515c848..40e449c 100644
--- a/src/kdenlivesettingsdialog.cpp
+++ b/src/kdenlivesettingsdialog.cpp
@@ -276,8 +276,8 @@ KdenliveSettingsDialog::KdenliveSettingsDialog(const QMap<QString, QString>& map
m_configSdl.kcfg_external_display->setEnabled(false);
}
- double dvgrabVersion = 0;
if (!KdenliveSettings::dvgrab_path().isEmpty()) {
+ double dvgrabVersion = 0;
QProcess *versionCheck = new QProcess;
versionCheck->setProcessChannelMode(QProcess::MergedChannels);
versionCheck->start("dvgrab", QStringList() << "--version");
diff --git a/src/kthumb.cpp b/src/kthumb.cpp
index 3bf19e2..595ee5d 100644
--- a/src/kthumb.cpp
+++ b/src/kthumb.cpp
@@ -226,7 +226,6 @@ QImage KThumb::getFrame(Mlt::Frame *frame, int frameWidth, int displayWidth, int
//const uchar* imagedata = frame->get_image(format, ow, oh);
//QImage image(imagedata, ow, oh, QImage::Format_ARGB32_Premultiplied);
-
if (!image.isNull()) {
if (ow > (2 * displayWidth)) {
// there was a scaling problem, do it manually
diff --git a/src/lib/audio/audioEnvelope.cpp b/src/lib/audio/audioEnvelope.cpp
index d2a45af..0b49851 100644
--- a/src/lib/audio/audioEnvelope.cpp
+++ b/src/lib/audio/audioEnvelope.cpp
@@ -165,7 +165,7 @@ int AudioEnvelope::startPos() const
return m_startpos;
}
-void AudioEnvelope::normalizeEnvelope(bool clampTo0)
+void AudioEnvelope::normalizeEnvelope(bool /*clampTo0*/)
{
if (m_envelope == NULL && !m_future.isRunning()) {
m_future = QtConcurrent::run(this, &AudioEnvelope::loadEnvelope);
diff --git a/src/lib/external/kiss_fft/tools/kiss_fastfir.c b/src/lib/external/kiss_fft/tools/kiss_fastfir.c
index dfd7c8c..eed90ab 100644
--- a/src/lib/external/kiss_fft/tools/kiss_fastfir.c
+++ b/src/lib/external/kiss_fft/tools/kiss_fastfir.c
@@ -18,7 +18,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
/*
Some definitions that allow real or complex filtering
*/
-#ifdef REAL_FASTFIR
+/*REAL_FASTFIR*/
#define MIN_FFT_LEN 2048
#include "kiss_fftr.h"
typedef kiss_fft_scalar kffsamp_t;
@@ -26,14 +26,6 @@ typedef kiss_fftr_cfg kfcfg_t;
#define FFT_ALLOC kiss_fftr_alloc
#define FFTFWD kiss_fftr
#define FFTINV kiss_fftri
-#else
-#define MIN_FFT_LEN 1024
-typedef kiss_fft_cpx kffsamp_t;
-typedef kiss_fft_cfg kfcfg_t;
-#define FFT_ALLOC kiss_fft_alloc
-#define FFTFWD kiss_fft
-#define FFTINV kiss_fft
-#endif
typedef struct kiss_fastfir_state *kiss_fastfir_cfg;
@@ -78,7 +70,7 @@ kiss_fastfir_cfg kiss_fastfir_alloc(
if (pnfft)
nfft=*pnfft;
- if (nfft<=0) {
+ if (nfft==0) {
/* determine fft size as next power of two at least 2x
the impulse response length*/
i=n_imp_resp-1;
@@ -86,19 +78,13 @@ kiss_fastfir_cfg kiss_fastfir_alloc(
do{
nfft<<=1;
}while (i>>=1);
-#ifdef MIN_FFT_LEN
if ( nfft < MIN_FFT_LEN )
nfft=MIN_FFT_LEN;
-#endif
}
if (pnfft)
*pnfft = nfft;
-#ifdef REAL_FASTFIR
n_freq_bins = nfft/2 + 1;
-#else
- n_freq_bins = nfft;
-#endif
/*fftcfg*/
FFT_ALLOC (nfft, 0, NULL, &len_fftcfg);
memneeded += len_fftcfg;
@@ -244,7 +230,7 @@ size_t kiss_fastfir(
}
}
-#ifdef FAST_FILT_UTIL
+/*FAST_FILT_UTIL*/
#include <unistd.h>
#include <sys/types.h>
#include <sys/mman.h>
@@ -285,12 +271,12 @@ void direct_file_filter(
do {
nread = fread (buf, sizeof (kffsamp_t), nbuf, fin);
- if (nread <= 0)
+ if (nread == 0)
break;
for (k = 0; k < nread; ++k) {
tmph = imp_resp+nlag;
-#ifdef REAL_FASTFIR
+/*REAL_FASTFIR*/
# ifdef USE_SIMD
outval = _mm_set1_ps(0);
#else
@@ -301,26 +287,6 @@ void direct_file_filter(
for (tap = 0; tap < oldestlag; ++tap)
outval += circbuf[tap] * *tmph--;
outval += buf[k] * *tmph;
-#else
-# ifdef USE_SIMD
- outval.r = outval.i = _mm_set1_ps(0);
-#else
- outval.r = outval.i = 0;
-#endif
- for (tap = oldestlag; tap < nlag; ++tap){
- C_MUL(tmp,circbuf[tap],*tmph);
- --tmph;
- C_ADDTO(outval,tmp);
- }
-
- for (tap = 0; tap < oldestlag; ++tap) {
- C_MUL(tmp,circbuf[tap],*tmph);
- --tmph;
- C_ADDTO(outval,tmp);
- }
- C_MUL(tmp,buf[k],*tmph);
- C_ADDTO(outval,tmp);
-#endif
circbuf[oldestlag++] = buf[k];
buf[k] = outval;
@@ -463,6 +429,7 @@ int main(int argc,char**argv)
if (fout!=stdout) fclose(fout);
if (fin!=stdin) fclose(fin);
+ free(h);
return 0;
}
#endif
diff --git a/src/lib/external/kiss_fft/tools/psdpng.c b/src/lib/external/kiss_fft/tools/psdpng.c
index ef9ff5b..f63cb1f 100644
--- a/src/lib/external/kiss_fft/tools/psdpng.c
+++ b/src/lib/external/kiss_fft/tools/psdpng.c
@@ -137,7 +137,7 @@ void transform_signal(void)
CHECKNULL( fbuf=(kiss_fft_cpx*)malloc(sizeof(kiss_fft_cpx)*nfreqs ) );
CHECKNULL( mag2buf=(float*)malloc(sizeof(float)*nfreqs ) );
- memset(mag2buf,0,sizeof(mag2buf)*nfreqs);
+ memset(mag2buf,0,sizeof(float)*nfreqs);
while (1) {
if (stereo) {
@@ -168,9 +168,11 @@ void transform_signal(void)
mag2buf[i] += fbuf[i].r * fbuf[i].r + fbuf[i].i * fbuf[i].i;
if (++avgctr == navg) {
+ float *new_vals;
avgctr=0;
++nrows;
- vals = (float*)realloc(vals,sizeof(float)*nrows*nfreqs);
+ new_vals = (float*)realloc(vals,sizeof(float)*nrows*nfreqs);
+ if(new_vals == NULL) return; else vals=new_vals;
float eps = 1;
for (i=0;i<nfreqs;++i)
vals[(nrows - 1) * nfreqs + i] = 10 * log10 ( mag2buf[i] / navg + eps );
@@ -188,7 +190,7 @@ void transform_signal(void)
static
void make_png(void)
{
- png_bytepp row_pointers=NULL;
+ png_bytepp row_pointers=NULL, new_row_pointers;
rgb_t * row_data=NULL;
int i;
int nfreqs = nfft/2+1;
@@ -208,6 +210,8 @@ void make_png(void)
cpx2pixels(row_data, vals, nfreqs*nrows );
row_pointers = realloc(row_pointers, nrows*sizeof(png_bytep));
+ if(new_row_pointers == NULL) return; else row_pointers=new_row_pointers;
+
for (i=0;i<nrows;++i) {
row_pointers[i] = (png_bytep)(row_data + i*nfreqs);
}
diff --git a/src/lib/external/media_ctrl/mediactrl.c b/src/lib/external/media_ctrl/mediactrl.c
index 5a1ec06..e7d72aa 100644
--- a/src/lib/external/media_ctrl/mediactrl.c
+++ b/src/lib/external/media_ctrl/mediactrl.c
@@ -201,12 +201,10 @@ int media_ctrl_get_keys_count(struct media_ctrl *ctrl)
void translate_contour_hid_event(struct media_ctrl *ctrl, struct input_event *ev, struct media_ctrl_event *me)
{
-
- int lv, cv;
-
me->type = 0;
if (ev->type == EV_REL) {
+ int cv;
/* First check the outer dial */
if (ev->code == REL_WHEEL) {
@@ -227,6 +225,7 @@ void translate_contour_hid_event(struct media_ctrl *ctrl, struct input_event *ev
me->name = _shuttle_name;
} else if (ev->code == REL_DIAL) {
+ int lv;
if ( ctrl->lastval == -1 ) ctrl->lastval = ev->value;
lv = ctrl->lastval;
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 7be7c40..a291f8b 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -147,6 +147,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
m_projectList(NULL),
m_effectList(NULL),
m_effectStack(NULL),
+
m_clipMonitor(NULL),
m_projectMonitor(NULL),
m_recMonitor(NULL),
@@ -444,11 +445,11 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
/*ScriptingPart* sp = new ScriptingPart(this, QStringList());
guiFactory()->addClient(sp);*/
- QMenu *trackMenu = (QMenu*)(factory()->container("track_menu", this));
+ QMenu *trackMenu = static_cast<QMenu*>(factory()->container("track_menu", this));
if (trackMenu) trackMenu->addActions(m_tracksActionCollection->actions());
- QMenu *saveLayout = (QMenu*)(factory()->container("layout_save_as", this));
+ QMenu *saveLayout = static_cast<QMenu*>(factory()->container("layout_save_as", this));
if (saveLayout)
connect(saveLayout, SIGNAL(triggered(QAction*)), this, SLOT(slotSaveLayout(QAction*)));
@@ -554,7 +555,7 @@ MainWindow::MainWindow(const QString &MltPath, const KUrl & Url, const QString &
m_timelineContextClipMenu->addAction(actionCollection()->action("paste_effects"));
m_timelineContextClipMenu->addSeparator();
- QMenu *markersMenu = (QMenu*)(factory()->container("marker_menu", this));
+ QMenu *markersMenu = static_cast<QMenu*>(factory()->container("marker_menu", this));
m_timelineContextClipMenu->addMenu(markersMenu);
m_timelineContextClipMenu->addSeparator();
m_timelineContextClipMenu->addMenu(m_transitionsMenu);
@@ -1807,7 +1808,7 @@ void MainWindow::setStatusBarStyleSheet(const QPalette &p)
void MainWindow::loadLayouts()
{
- QMenu *saveLayout = (QMenu*)(factory()->container("layout_save_as", this));
+ QMenu *saveLayout = static_cast<QMenu*>(factory()->container("layout_save_as", this));
if (m_loadLayout == NULL || saveLayout == NULL) return;
KSharedConfigPtr config = KGlobal::config();
KConfigGroup layoutGroup(config, "Layouts");
@@ -3946,7 +3947,7 @@ bool MainWindow::eventFilter(QObject *obj, QEvent *event)
{
if (m_findActivated) {
if (event->type() == QEvent::ShortcutOverride) {
- QKeyEvent* ke = (QKeyEvent*) event;
+ QKeyEvent* ke = static_cast<QKeyEvent*>(event);
if (ke->text().trimmed().isEmpty()) return false;
ke->accept();
return true;
diff --git a/src/projectlistview.cpp b/src/projectlistview.cpp
index af4f9bc..14728d0 100644
--- a/src/projectlistview.cpp
+++ b/src/projectlistview.cpp
@@ -277,8 +277,8 @@ void ProjectListView::dropEvent(QDropEvent *event)
foreach(QTreeWidgetItem *it, list) {
// TODO allow dragging of folders ?
if (it->type() == ProjectClipType) {
- if (it->parent()) clone = (ProjectItem*) it->parent()->takeChild(it->parent()->indexOfChild(it));
- else clone = (ProjectItem*) takeTopLevelItem(indexOfTopLevelItem(it));
+ if (it->parent()) clone = static_cast<ProjectItem*>(it->parent()->takeChild(it->parent()->indexOfChild(it)));
+ else clone = static_cast<ProjectItem*>(takeTopLevelItem(indexOfTopLevelItem(it)));
if (clone && item) {
item->addChild(clone);
QMap <QString, QString> props;
diff --git a/src/renderer.cpp b/src/renderer.cpp
index d685601..5896e8f 100644
--- a/src/renderer.cpp
+++ b/src/renderer.cpp
@@ -61,7 +61,7 @@ static void kdenlive_callback(void* /*ptr*/, int level, const char* fmt, va_list
}
-//static
+//static
void Render::consumer_frame_show(mlt_consumer, Render * self, mlt_frame frame_ptr)
{
// detect if the producer has finished playing. Is there a better way to do it?
@@ -2875,7 +2875,6 @@ bool Render::addFilterToService(Mlt::Service service, EffectsParameterList param
params.removeParam("max");
params.removeParam("factor");
params.removeParam("offset");
- int offset = 0;
// Special case, only one keyframe, means we want a constant value
if (keyFrames.count() == 1) {
Mlt::Filter *filter = new Mlt::Filter(*m_mltProfile, qstrdup(tag.toUtf8().constData()));
@@ -2900,6 +2899,7 @@ bool Render::addFilterToService(Mlt::Service service, EffectsParameterList param
} else for (int i = 0; i < keyFrames.size() - 1; ++i) {
Mlt::Filter *filter = new Mlt::Filter(*m_mltProfile, qstrdup(tag.toUtf8().constData()));
if (filter && filter->is_valid()) {
+ int offset = 0;
filter->set("kdenlive_id", qstrdup(params.paramValue("id").toUtf8().constData()));
int x1 = keyFrames.at(i).section(':', 0, 0).toInt() + offset;
double y1 = keyFrames.at(i).section(':', 1, 1).toDouble();
diff --git a/src/scopes/abstractscopewidget.cpp b/src/scopes/abstractscopewidget.cpp
index f3f0dd6..9bd7a81 100644
--- a/src/scopes/abstractscopewidget.cpp
+++ b/src/scopes/abstractscopewidget.cpp
@@ -420,8 +420,8 @@ void AbstractScopeWidget::slotHUDRenderingFinished(uint mseconds, uint oldFactor
m_semaphoreHUD.release(1);
this->update();
- int accel;
if (m_aRealtime->isChecked()) {
+ int accel;
accel = calculateAccelFactorHUD(mseconds, oldFactor);
if (m_accelFactorHUD < 1) {
accel = 1;
@@ -454,8 +454,8 @@ void AbstractScopeWidget::slotScopeRenderingFinished(uint mseconds, uint oldFact
this->update();
// Calculate the acceleration factor hint to get Ā«realtimeĀ» updates.
- int accel;
if (m_aRealtime->isChecked()) {
+ int accel;
accel = calculateAccelFactorScope(mseconds, oldFactor);
if (accel < 1) {
// If mseconds happens to be 0.
@@ -487,8 +487,8 @@ void AbstractScopeWidget::slotBackgroundRenderingFinished(uint mseconds, uint ol
m_semaphoreBackground.release(1);
this->update();
- int accel;
if (m_aRealtime->isChecked()) {
+ int accel;
accel = calculateAccelFactorBackground(mseconds, oldFactor);
if (m_accelFactorBackground < 1) {
accel = 1;
diff --git a/src/scopes/audioscopes/spectrogram.cpp b/src/scopes/audioscopes/spectrogram.cpp
index bea7ba8..db73ac3 100644
--- a/src/scopes/audioscopes/spectrogram.cpp
+++ b/src/scopes/audioscopes/spectrogram.cpp
@@ -365,7 +365,6 @@ QImage Spectrogram::renderAudioScope(uint, const QVector<int16_t> &audioFrame, c
const uint h = m_innerScopeRect.height();
const uint leftDist = m_innerScopeRect.left() - m_scopeRect.left();
const uint topDist = m_innerScopeRect.top() - m_scopeRect.top();
- float val;
uint windowSize;
uint y;
bool completeRedraw = true;
@@ -390,7 +389,7 @@ QImage Spectrogram::renderAudioScope(uint, const QVector<int16_t> &audioFrame, c
QVector<float> dbMap;
uint right;
- for (QList<QVector<float> >::iterator it = m_fftHistory.begin(); it != m_fftHistory.end(); it++) {
+ for (QList<QVector<float> >::iterator it = m_fftHistory.begin(); it != m_fftHistory.end(); ++it) {
windowSize = (*it).size();
@@ -399,6 +398,7 @@ QImage Spectrogram::renderAudioScope(uint, const QVector<int16_t> &audioFrame, c
dbMap = FFTTools::interpolatePeakPreserving((*it), m_innerScopeRect.width(), 0, right, -180);
for (int i = 0; i < dbMap.size(); ++i) {
+ float val;
val = dbMap[i];
peak = val > m_dBmax;
@@ -430,7 +430,7 @@ QImage Spectrogram::renderAudioScope(uint, const QVector<int16_t> &audioFrame, c
qDebug() << "Rendered " << y-topDist << "lines from " << m_fftHistory.size() << " available samples in " << start.elapsed() << " ms"
<< (completeRedraw ? "" : " (re-used old image)");
uint storedBytes = 0;
- for (QList< QVector<float> >::iterator it = m_fftHistory.begin(); it != m_fftHistory.end(); it++) {
+ for (QList< QVector<float> >::iterator it = m_fftHistory.begin(); it != m_fftHistory.end(); ++it) {
storedBytes += (*it).size() * sizeof((*it)[0]);
}
qDebug() << QString("Total storage used: %1 kB").arg((double)storedBytes/1000, 0, 'f', 2);
diff --git a/src/titledocument.cpp b/src/titledocument.cpp
index f76707b..f731a1f 100644
--- a/src/titledocument.cpp
+++ b/src/titledocument.cpp
@@ -149,10 +149,10 @@ QDomDocument TitleDocument::xml(QGraphicsRectItem* startv, QGraphicsRectItem* en
break;
case 3:
e.setAttribute("type", "QGraphicsRectItem");
- content.setAttribute("rect", rectFToString(((QGraphicsRectItem*)item)->rect().normalized()));
- content.setAttribute("pencolor", colorToString(((QGraphicsRectItem*)item)->pen().color()));
- content.setAttribute("penwidth", ((QGraphicsRectItem*)item)->pen().width());
- content.setAttribute("brushcolor", colorToString(((QGraphicsRectItem*)item)->brush().color()));
+ content.setAttribute("rect", rectFToString(static_cast<QGraphicsRectItem*>(item)->rect().normalized()));
+ content.setAttribute("pencolor", colorToString(static_cast<QGraphicsRectItem*>(item)->pen().color()));
+ content.setAttribute("penwidth", static_cast<QGraphicsRectItem*>(item)->pen().width());
+ content.setAttribute("brushcolor", colorToString(static_cast<QGraphicsRectItem*>(item)->brush().color()));
break;
case 8:
e.setAttribute("type", "QGraphicsTextItem");
@@ -277,7 +277,7 @@ QColor TitleDocument::getBackgroundColor() const
QList<QGraphicsItem *> items = m_scene->items();
for (int i = 0; i < items.size(); ++i) {
if (items.at(i)->zValue() == -1100) {
- color = ((QGraphicsRectItem *)items.at(i))->brush().color();
+ color = static_cast<QGraphicsRectItem*>(items.at(i))->brush().color();
return color;
}
}
@@ -509,7 +509,7 @@ int TitleDocument::loadFromXml(const QDomDocument& doc, QGraphicsRectItem* start
QList<QGraphicsItem *> items = m_scene->items();
for (int i = 0; i < items.size(); ++i) {
if (items.at(i)->zValue() == -1100) {
- ((QGraphicsRectItem *)items.at(i))->setBrush(QBrush(color));
+ static_cast<QGraphicsRectItem*>(items.at(i))->setBrush(QBrush(color));
break;
}
}
diff --git a/src/transition.cpp b/src/transition.cpp
index f29c774..2bf0ad6 100644
--- a/src/transition.cpp
+++ b/src/transition.cpp
@@ -238,11 +238,11 @@ QVariant Transition::itemChange(GraphicsItemChange change, const QVariant &value
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()) {
diff --git a/src/v4l/v4lcapture.cpp b/src/v4l/v4lcapture.cpp
index 8e6a63b..a191ec4 100644
--- a/src/v4l/v4lcapture.cpp
+++ b/src/v4l/v4lcapture.cpp
@@ -64,7 +64,7 @@ QStringList V4lCaptureHandler::getDeviceName(const QString &input)
}
else {
devName = strdup((char*) cap.card);
- if(!cap.capabilities & V4L2_CAP_VIDEO_CAPTURE) {
+ if(!(cap.capabilities & V4L2_CAP_VIDEO_CAPTURE)) {
// Device cannot capture
captureEnabled = 0;
}
diff --git a/src/widgets/kis_curve_widget.cpp b/src/widgets/kis_curve_widget.cpp
index 73edfd5..c35699d 100644
--- a/src/widgets/kis_curve_widget.cpp
+++ b/src/widgets/kis_curve_widget.cpp
@@ -306,12 +306,10 @@ void KisCurveWidget::paintEvent(QPaintEvent *)
x, wHeight - d->m_curve.value(1.0) * wHeight));
// Drawing curve handles.
- double curveX;
- double curveY;
if (!d->m_readOnlyMode) {
for (int i = 0; i < d->m_curve.points().count(); ++i) {
- curveX = d->m_curve.points().at(i).x();
- curveY = d->m_curve.points().at(i).y();
+ double curveX = d->m_curve.points().at(i).x();
+ double curveY = d->m_curve.points().at(i).y();
if (i == d->m_grab_point_index) {
p.setPen(QPen(Qt::red, 3, Qt::SolidLine));
diff --git a/src/widgets/monitoreditwidget.cpp b/src/widgets/monitoreditwidget.cpp
index fa1d0a0..c398e69 100644
--- a/src/widgets/monitoreditwidget.cpp
+++ b/src/widgets/monitoreditwidget.cpp
@@ -52,7 +52,7 @@ MonitorEditWidget::MonitorEditWidget(Render* renderer, QWidget* parent) :
m_view->setMouseTracking(true);
m_scene->setUp();
- ((QVBoxLayout*)m_ui.frameVideo->layout())->addWidget(m_view);
+ static_cast<QVBoxLayout*>(m_ui.frameVideo->layout())->addWidget(m_view);
m_customControlsLayout = new QVBoxLayout(m_ui.frameCustomControls);
m_customControlsLayout->setContentsMargins(0, 4, 0, 4);