further cleanup

Thu, 03 Oct 2013 21:08:34 +0300

author
Santeri Piippo <crimsondusk64@gmail.com>
date
Thu, 03 Oct 2013 21:08:34 +0300
changeset 494
bd005c78a089
parent 493
16766ac1bbd9
child 495
cb931c2d1e8b

further cleanup

src/file.h file | annotate | diff | comparison | revisions
src/gldraw.cpp file | annotate | diff | comparison | revisions
src/primitives.h file | annotate | diff | comparison | revisions
src/types.h file | annotate | diff | comparison | revisions
src/widgets.cpp file | annotate | diff | comparison | revisions
src/widgets.h file | annotate | diff | comparison | revisions
--- a/src/file.h	Thu Oct 03 20:56:20 2013 +0300
+++ b/src/file.h	Thu Oct 03 21:08:34 2013 +0300
@@ -60,9 +60,6 @@
 		DECLARE_PROPERTY (QListWidgetItem*, listItem, setListItem)
 
 	public:
-		typedef List<LDObject*>::it it;
-		typedef List<LDObject*>::c_it c_it;
-
 		LDFile();
 		~LDFile();
 
--- a/src/gldraw.cpp	Thu Oct 03 20:56:20 2013 +0300
+++ b/src/gldraw.cpp	Thu Oct 03 21:08:34 2013 +0300
@@ -1346,8 +1346,7 @@
 			break;
 
 		case CircleMode:
-		{	const staticCameraMeta* cam = &g_staticCameras[m_camera];
-			const double dist = circleDrawDist();
+		{	const double dist = circleDrawDist();
 
 			matrix transform = g_circleDrawTransforms[camera() % 3];
 
--- a/src/primitives.h	Thu Oct 03 20:56:20 2013 +0300
+++ b/src/primitives.h	Thu Oct 03 21:08:34 2013 +0300
@@ -45,9 +45,6 @@
 			Type type;
 		};
 
-		typedef List<RegexEntry>::it it;
-		typedef List<RegexEntry>::c_it c_it;
-
 		List<RegexEntry> regexes;
 		List<Primitive> prims;
 		static List<Primitive> uncat;
--- a/src/types.h	Thu Oct 03 20:56:20 2013 +0300
+++ b/src/types.h	Thu Oct 03 21:08:34 2013 +0300
@@ -76,11 +76,11 @@
 		void			zero	();
 		matrix&			operator=	(matrix other);
 
-		inline double& val (const uint idx)
+		inline double& val (int idx)
 		{	return m_vals[idx];
 		}
 
-		inline const double val (const uint idx) const
+		inline const double& val (int idx) const
 		{	return m_vals[idx];
 		}
 
@@ -88,10 +88,10 @@
 		{	return mult (other);
 		}
 
-		inline double& operator[] (const uint idx)
+		inline double& operator[] (int idx)
 		{	return val (idx);
 		}
-		inline const double& operator[] (const uint idx) const
+		inline const double& operator[] (int idx) const
 		{	return val (idx);
 		}
 
@@ -112,16 +112,18 @@
 		vertex() {}
 		vertex (double x, double y, double z);
 
-		double&			coord	(const ushort n)
+		vertex          midpoint    (const vertex& other);
+		void            move        (const vertex& other);
+		str             stringRep   (bool mangled) const;
+		void            transform   (matrix matr, vertex pos);
+
+		inline double& coord (int n)
 		{	return m_coords[n];
 		}
-		const double&	coord	(const ushort n) const
+
+		inline const double& coord (int n) const
 		{	return m_coords[n];
 		}
-		vertex			midpoint	(const vertex& other);
-		void			move	(const vertex& other);
-		str				stringRep	(bool mangled) const;
-		void			transform	(matrix matr, vertex pos);
 
 		inline double& x ()
 		{	return m_coords[X];
@@ -173,45 +175,45 @@
 // =============================================================================
 template<class T> class List
 {	public:
-		typedef typename std::deque<T>::iterator it;
-		typedef typename std::deque<T>::const_iterator c_it;
-		typedef typename std::deque<T>::reverse_iterator r_it;
-		typedef typename std::deque<T>::const_reverse_iterator cr_it;
+		typedef typename std::deque<T>::iterator Iterator;
+		typedef typename std::deque<T>::const_iterator ConstIterator;
+		typedef typename std::deque<T>::reverse_iterator ReverseIterator;
+		typedef typename std::deque<T>::const_reverse_iterator ConstReverseIterator;
 
 		List() {}
 		List (initlist<T> vals)
 		{	m_vect = vals;
 		}
 
-		inline it begin()
+		inline Iterator begin()
 		{	return m_vect.begin();
 		}
 
-		inline c_it begin() const
+		inline ConstIterator begin() const
 		{	return m_vect.cbegin();
 		}
 
-		inline it end()
+		inline Iterator end()
 		{	return m_vect.end();
 		}
 
-		inline c_it end() const
+		inline ConstIterator end() const
 		{	return m_vect.cend();
 		}
 
-		inline r_it rbegin()
+		inline ReverseIterator rbegin()
 		{	return m_vect.rbegin();
 		}
 
-		inline cr_it crbegin() const
+		inline ConstReverseIterator crbegin() const
 		{	return m_vect.crbegin();
 		}
 
-		inline r_it rend()
+		inline ReverseIterator rend()
 		{	return m_vect.rend();
 		}
 
-		inline cr_it crend() const
+		inline ConstReverseIterator crend() const
 		{	return m_vect.crend();
 		}
 
@@ -272,7 +274,7 @@
 		{	// Remove duplicate entries. For this to be effective, the List must be
 			// sorted first.
 			sort();
-			it pos = std::unique (begin(), end());
+			Iterator pos = std::unique (begin(), end());
 			resize (std::distance (begin(), pos));
 		}
 
@@ -324,17 +326,17 @@
 // =============================================================================
 template<class T> class ListReverser
 {	public:
-		typedef typename List<T>::r_it it;
+		typedef typename List<T>::ReverseIterator Iterator;
 
 		ListReverser (List<T>& vect)
 		{	m_vect = &vect;
 		}
 
-		it begin()
+		Iterator begin()
 		{	return m_vect->rbegin();
 		}
 
-		it end()
+		Iterator end()
 		{	return m_vect->rend();
 		}
 
@@ -351,17 +353,17 @@
 // =============================================================================
 template<class T> class ConstListReverser
 {	public:
-		typedef typename List<T>::cr_it it;
+		typedef typename List<T>::ConstReverseIterator Iterator;
 
 		ConstListReverser (const List<T>& vect)
 		{	m_vect = &vect;
 		}
 
-		it begin() const
+		Iterator begin() const
 		{	return m_vect->crbegin();
 		}
 
-		it end() const
+		Iterator end() const
 		{	return m_vect->crend();
 		}
 
--- a/src/widgets.cpp	Thu Oct 03 20:56:20 2013 +0300
+++ b/src/widgets.cpp	Thu Oct 03 21:08:34 2013 +0300
@@ -166,12 +166,12 @@
 
 // =============================================================================
 // -----------------------------------------------------------------------------
-RadioGroup::it RadioGroup::begin()
+RadioGroup::Iterator RadioGroup::begin()
 {	return m_objects.begin();
 }
 
 // =============================================================================
 // -----------------------------------------------------------------------------
-RadioGroup::it RadioGroup::end()
+RadioGroup::Iterator RadioGroup::end()
 {	return m_objects.end();
 }
--- a/src/widgets.h	Thu Oct 03 20:56:20 2013 +0300
+++ b/src/widgets.h	Thu Oct 03 21:08:34 2013 +0300
@@ -40,7 +40,7 @@
 {	Q_OBJECT
 
 	public:
-		typedef List<QRadioButton*>::it it;
+		typedef List<QRadioButton*>::Iterator Iterator;
 
 		explicit RadioGroup()
 		{	init (Qt::Vertical);
@@ -54,20 +54,20 @@
 		explicit RadioGroup (const QString& title, initlist<char const*> entries, int const defaultId,
 			const Qt::Orientation orient = Qt::Vertical, QWidget* parent = null);
 
-		void			addButton	(const char* entry);
-		void			addButton	(QRadioButton* button);
-		it				begin	();
-		it				end	();
-		void			init	(Qt::Orientation orient);
-		bool			isChecked	(int n) const;
-		void			rowBreak	();
-		void			setCurrentRow	(uint row);
-		void			setValue	(int val);
-		int				value	() const;
+		void            addButton	(const char* entry);
+		void            addButton	(QRadioButton* button);
+		Iterator        begin();
+		Iterator        end();
+		void            init (Qt::Orientation orient);
+		bool            isChecked (int n) const;
+		void            rowBreak();
+		void            setCurrentRow (uint row);
+		void            setValue (int val);
+		int             value() const;
 
-		QRadioButton*	operator[]	(uint n) const;
-		RadioGroup&		operator<<	(QRadioButton* button);
-		RadioGroup&		operator<<	(const char* entry);
+		QRadioButton*   operator[] (uint n) const;
+		RadioGroup&     operator<< (QRadioButton* button);
+		RadioGroup&     operator<< (const char* entry);
 
 	signals:
 		void buttonPressed (int btn);

mercurial