diff options
author | Noel Grandin <noel@peralex.com> | 2015-09-30 10:29:19 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-10-01 10:43:24 +0000 |
commit | 58aea3f36c14414f95668e229a7350598f6c53a8 (patch) | |
tree | 70c115dffd44576313cefd49e4164d293895e4bd /hwpfilter | |
parent | 3fcbfe10857631212d8b8db9a079bb9692ed78bc (diff) |
loplugin:unusedmethods
- improvements to the plugin to find more method calls
- improvements to python script to remove more false+
- fix the FORCE_COMPILE_ALL build flag to include code in
the $WORKDIR
Change-Id: I4d6015dcb9b9d60c26f0bcee8abad807177a7836
Reviewed-on: https://gerrit.libreoffice.org/19064
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'hwpfilter')
-rw-r--r-- | hwpfilter/source/hutil.cxx | 9 | ||||
-rw-r--r-- | hwpfilter/source/hutil.h | 4 | ||||
-rw-r--r-- | hwpfilter/source/hwplib.h | 6 | ||||
-rw-r--r-- | hwpfilter/source/list.hxx | 146 |
4 files changed, 0 insertions, 165 deletions
diff --git a/hwpfilter/source/hutil.cxx b/hwpfilter/source/hutil.cxx index 2faf89897a81..4597f84530c8 100644 --- a/hwpfilter/source/hutil.cxx +++ b/hwpfilter/source/hutil.cxx @@ -82,13 +82,4 @@ void str2hstr(const char *c, hchar * i) } -int hstrlen(const hchar * s) -{ - int n = 0; - - while (*s++) - n++; - return n; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/hwpfilter/source/hutil.h b/hwpfilter/source/hutil.h index 9f9fbec3a572..d856b74de173 100644 --- a/hwpfilter/source/hutil.h +++ b/hwpfilter/source/hutil.h @@ -29,10 +29,6 @@ void num2roman(int num, char *buf); * Transfer 8bit string to 16bit string used internally in hwp */ void str2hstr(const char *c, hchar *i); -/** - * @returns Length of 16bit hwp string - */ -int hstrlen(const hchar *s); #endif /* UTIL_H_*/ diff --git a/hwpfilter/source/hwplib.h b/hwpfilter/source/hwplib.h index 87a5bf9f936d..5d1324d537cb 100644 --- a/hwpfilter/source/hwplib.h +++ b/hwpfilter/source/hwplib.h @@ -53,12 +53,6 @@ typedef struct int x, y; } ZZPoint; -inline void allocPoint(ZZPoint &target, ZZPoint &src) -{ - target.x = src.x; - target.y = src.y; -} - /** * @short Size */ diff --git a/hwpfilter/source/list.hxx b/hwpfilter/source/list.hxx index e205657a7f48..a605acad0dae 100644 --- a/hwpfilter/source/list.hxx +++ b/hwpfilter/source/list.hxx @@ -45,22 +45,6 @@ public: /// construct list with one element (pItem) or no element (pItem == NULL) LinkedList( T* pItem = 0 ); ~LinkedList(); - - T* find( const int n ); /// return nth element in list - T* first(); /// return first element in list - T* last(); /// return last element in list - - int count() const; /// return number of elements in list - int empty() const; /// determine whether list contains any elements - - /// insert pItem into list at position n; at end if n == -1; return count() - int insert( T* pItem, int n = -1 ); - - /// remove nth element from list - T* remove( const int n ); - - /// remove given element from list - int remove( T* pItem ); }; /** iterator class for LinkedList<T>. Iterator may travel outside of @@ -78,19 +62,12 @@ public: LinkedListIterator( LinkedList<T>* pList = 0 ); ~LinkedListIterator(); - T* current(); /// return current element, or NULL if invalid - void set( const int n ); /// set iterator to position n - - void reset( ); /// set iterator to first element - // bug-compatible with original LinkedList.h/cxx: Ignore parameter! void operator++( int ); /// advance iterator by one step (ignore n !!!) void operator--( int ); /// go one step backwards (ignore n !!!) void operator++(); /// advance iterator by one step void operator--(); /// go one step backwards -private: - bool valid(); }; @@ -122,98 +99,6 @@ LinkedList<T>::~LinkedList() } template<class T> -T* LinkedList<T>::find( const int n ) -{ - ASSERT( n >= 0 && n < static_cast<int>( maList.size() ) ); - return maList[n]; -} - -template<class T> -T* LinkedList<T>::first() -{ - return find( 0 ); -} - -template<class T> -T* LinkedList<T>::last() -{ - return find( count() - 1 ); -} - -template<class T> -int LinkedList<T>::count() const -{ - return static_cast<int>( maList.size() ); -} - -template<class T> -int LinkedList<T>::empty() const -{ - return count() == 0; -} - -template<class T> -int LinkedList<T>::insert( T* pItem, int n ) -{ - ASSERT( pItem != NULL ); - ASSERT( n >= -1 && n <= static_cast<int>( maList.size() )); - - if( n == -1 ) - { - maList.push_back( pItem ); - } - else - { - maList.insert( maList.begin() + n, pItem ); - } - - return static_cast<int>( maList.size() ); -} - -template<class T> -T* LinkedList<T>::remove( const int n ) -{ - ASSERT( n >= -1 && n <= static_cast<int>( maList.size() ) ); - - T* pItem = maList[ n ]; - ASSERT( pItem != NULL ); - - maList.erase( maList.begin() + n ); - return pItem; -} - -template<class T> -int LinkedList<T>::remove( T* pItem ) -{ - ASSERT( pItem != NULL ); - - int i = 0; - typename list_t::iterator aIter = maList.begin(); - typename list_t::iterator aEnd = maList.end(); - while( aIter != aEnd && *aIter != pItem ) - { - ++i; - ++aIter; - } - - if( aIter != aEnd ) - { - // found! - ASSERT( *aIter == pItem ); - maList.erase( aIter ); - } - else - { - // else: not found - i = -1; - } - - return i; -} - - - -template<class T> LinkedListIterator<T>::LinkedListIterator( LinkedList<T>* pList ) : mpList( pList ), mnPosition( 0 ) @@ -227,29 +112,6 @@ LinkedListIterator<T>::~LinkedListIterator() } template<class T> -T* LinkedListIterator<T>::current() -{ - return valid() ? mpList->find( mnPosition ) : NULL; -} - -template<class T> -void LinkedListIterator<T>::set( const int nIndex ) -{ - ASSERT( mpList != NULL ); - mnPosition = nIndex; - ASSERT( valid() ); -} - - -template<class T> -void LinkedListIterator<T>::reset() -{ - ASSERT( mpList != NULL ); - mnPosition = 0; - ASSERT( valid() ); -} - -template<class T> void LinkedListIterator<T>::operator++( int ) { ASSERT( mpList != NULL ); @@ -281,14 +143,6 @@ void LinkedListIterator<T>::operator--() mnPosition --; } -template<class T> -bool LinkedListIterator<T>::valid() -{ - return mpList != NULL - && mnPosition >= 0 - && mnPosition < mpList->count(); -} - #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |