@@ -92,28 +92,16 @@ struct EEPtr{
9292 operator const int () const { return index; }
9393 EEPtr &operator =( int in ) { return index = in, *this ; }
9494
95-
9695 // Iterator functionality.
9796 bool operator !=( const EEPtr &ptr ) { return index != ptr.index ; }
98- EERef operator *() { return ( this ->index ); }
99-
97+ EERef operator *() { return index; }
10098
101- /* * Prefix increment/decrement **/
99+ /* * Prefix & Postfix increment/decrement **/
102100 EEPtr& operator ++() { return ++index, *this ; }
103101 EEPtr& operator --() { return --index, *this ; }
104-
105-
106- /* * Postfix increment/decrement **/
107- EEPtr operator ++ (int ){
108- int ret = index;
109- return ++index, ret;
110- }
102+ EEPtr operator ++ (int ) { return index++; }
103+ EEPtr operator -- (int ) { return index--; }
111104
112- EEPtr operator -- (int ){
113- int ret = index;
114- return --index, ret;
115- }
116-
117105 int index; // Index of current EEPROM cell.
118106};
119107
@@ -128,15 +116,15 @@ struct EEPtr{
128116struct EEPROMClass {
129117
130118 // Basic user access methods.
131- EERef operator []( const int index ) { return ( index ) ; }
132- uint8_t read ( int idx ) { return ( EERef ( idx ) ); }
119+ EERef operator []( const int idx ) { return idx ; }
120+ uint8_t read ( int idx ) { return EERef ( idx ); }
133121 void write ( int idx, uint8_t val ) { (EERef ( idx )) = val; }
134122 void update ( int idx, uint8_t val ) { EERef ( idx ).update ( val ); }
135123
136124 // STL and C++11 iteration capability.
137- EEPtr begin () { return ( 0x00 ) ; }
138- EEPtr end () { return length (); } // Standards requires this to be the item after the last valid entry. The returned pointer is invalid.
139- uint16_t length () { return E2END + 1 ; }
125+ EEPtr begin () { return 0x00 ; }
126+ EEPtr end () { return length (); } // Standards requires this to be the item after the last valid entry. The returned pointer is invalid.
127+ uint16_t length () { return E2END + 1 ; }
140128
141129 // Functionality to 'get' and 'put' objects to and from EEPROM.
142130 template < typename T > T &get ( int idx, T &t ){
0 commit comments