[vlmc-devel] commit: EffectUser: Killing some signedness warnings. ( Hugo Beauzée-Luyssen )

git at videolan.org git at videolan.org
Wed Sep 8 19:45:15 CEST 2010


vlmc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Wed Sep  8 18:10:12 2010 +0200| [b8c0bf27d6b1b3fe235b87b05c7ec57e5e46c6a4] | committer: Hugo Beauzée-Luyssen 

EffectUser: Killing some signedness warnings.

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=b8c0bf27d6b1b3fe235b87b05c7ec57e5e46c6a4
---

 src/EffectsEngine/EffectUser.cpp |   12 ++++++++----
 src/EffectsEngine/EffectUser.h   |    6 +++---
 2 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/src/EffectsEngine/EffectUser.cpp b/src/EffectsEngine/EffectUser.cpp
index acdf154..8d20ba5 100644
--- a/src/EffectsEngine/EffectUser.cpp
+++ b/src/EffectsEngine/EffectUser.cpp
@@ -225,8 +225,10 @@ EffectUser::effects( Effect::Type type ) const
 }
 
 void
-EffectUser::removeEffect( Effect::Type type, quint32 idx )
+EffectUser::removeEffect( Effect::Type type, qint32 idx )
 {
+    Q_ASSERT( idx >= 0 );
+
     QWriteLocker    lock( m_effectsLock );
 
     if ( type == Effect::Filter )
@@ -269,16 +271,18 @@ EffectUser::removeEffect(EffectHelper *helper)
 }
 
 void
-EffectUser::swapFilters( quint32 idx, quint32 idx2 )
+EffectUser::swapFilters( qint32 idx, qint32 idx2 )
 {
-    if ( idx >= m_filters.size() || idx2 > m_filters.size() )
+    Q_ASSERT( idx >= 0 && idx2 >= 0 );
+
+    if ( idx >= m_filters.size() || idx2 >= m_filters.size() )
         return ;
     QWriteLocker        lock( m_effectsLock );
 
     m_filters.swap( idx, idx2 );
 }
 
-quint32
+qint32
 EffectUser::count( Effect::Type type ) const
 {
     QReadLocker     lock( m_effectsLock );
diff --git a/src/EffectsEngine/EffectUser.h b/src/EffectsEngine/EffectUser.h
index ba0bc03..b0b300e 100644
--- a/src/EffectsEngine/EffectUser.h
+++ b/src/EffectsEngine/EffectUser.h
@@ -47,9 +47,9 @@ class EffectUser : public QObject
         void                            moveEffect( EffectHelper *helper, qint64 newPos );
         void                            removeEffect( EffectHelper *helper );
         const EffectsEngine::EffectList &effects( Effect::Type type ) const;
-        void                            removeEffect( Effect::Type type, quint32 idx );
-        void                            swapFilters( quint32 idx, quint32 idx2 );
-        quint32                         count( Effect::Type type ) const;
+        void                            removeEffect( Effect::Type type, qint32 idx );
+        void                            swapFilters( qint32 idx, qint32 idx2 );
+        qint32                          count( Effect::Type type ) const;
         void                            cleanEffects();
 
     protected:



More information about the Vlmc-devel mailing list