# HG changeset patch # User Santeri Piippo # Date 1380823714 -10800 # Node ID bd005c78a089e7654f8ef0a5d32197517e4adc4e # Parent 16766ac1bbd9bddc7a77db742608e320f1400e04 further cleanup diff -r 16766ac1bbd9 -r bd005c78a089 src/file.h --- 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::it it; - typedef List::c_it c_it; - LDFile(); ~LDFile(); diff -r 16766ac1bbd9 -r bd005c78a089 src/gldraw.cpp --- 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]; diff -r 16766ac1bbd9 -r bd005c78a089 src/primitives.h --- 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::it it; - typedef List::c_it c_it; - List regexes; List prims; static List uncat; diff -r 16766ac1bbd9 -r bd005c78a089 src/types.h --- 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 List { public: - typedef typename std::deque::iterator it; - typedef typename std::deque::const_iterator c_it; - typedef typename std::deque::reverse_iterator r_it; - typedef typename std::deque::const_reverse_iterator cr_it; + typedef typename std::deque::iterator Iterator; + typedef typename std::deque::const_iterator ConstIterator; + typedef typename std::deque::reverse_iterator ReverseIterator; + typedef typename std::deque::const_reverse_iterator ConstReverseIterator; List() {} List (initlist 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 ListReverser { public: - typedef typename List::r_it it; + typedef typename List::ReverseIterator Iterator; ListReverser (List& 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 ConstListReverser { public: - typedef typename List::cr_it it; + typedef typename List::ConstReverseIterator Iterator; ConstListReverser (const List& vect) { m_vect = &vect; } - it begin() const + Iterator begin() const { return m_vect->crbegin(); } - it end() const + Iterator end() const { return m_vect->crend(); } diff -r 16766ac1bbd9 -r bd005c78a089 src/widgets.cpp --- 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(); } diff -r 16766ac1bbd9 -r bd005c78a089 src/widgets.h --- 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::it it; + typedef List::Iterator Iterator; explicit RadioGroup() { init (Qt::Vertical); @@ -54,20 +54,20 @@ explicit RadioGroup (const QString& title, initlist 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);