diff --git a/etk/Color.h b/etk/Color.h index 30b9ef3..6aae881 100644 --- a/etk/Color.h +++ b/etk/Color.h @@ -8,8 +8,7 @@ #include -#ifndef __ETK_COLOR_H__ -#define __ETK_COLOR_H__ +#pragma once #include @@ -747,5 +746,4 @@ namespace etk { */ }; -#endif diff --git a/etk/Hash.h b/etk/Hash.h index 002f2e7..2bca723 100644 --- a/etk/Hash.h +++ b/etk/Hash.h @@ -8,8 +8,7 @@ #include -#ifndef __ETK_HACH_H__ -#define __ETK_HACH_H__ +#pragma once #undef __class__ #define __class__ "etk::Hash" @@ -271,5 +270,3 @@ namespace etk { #undef __class__ #define __class__ NULL -#endif - diff --git a/etk/Noise.h b/etk/Noise.h index 8418311..8d97ba6 100644 --- a/etk/Noise.h +++ b/etk/Noise.h @@ -8,8 +8,7 @@ #include -#ifndef __ETK_NOISE_H__ -#define __ETK_NOISE_H__ +#pragma once #include @@ -47,6 +46,5 @@ namespace etk { ~Noise(); float get(int32_t _x, int32_t _y) const; }; -}; +} -#endif diff --git a/etk/archive/Archive.h b/etk/archive/Archive.h index 8647a77..1cee7d9 100644 --- a/etk/archive/Archive.h +++ b/etk/archive/Archive.h @@ -9,8 +9,7 @@ #include -#ifndef __ETK_ARCHIVE_H__ -#define __ETK_ARCHIVE_H__ +#pragma once #include #include @@ -146,7 +145,5 @@ namespace etk { */ //Archive* create(const std::u32string& _fileName); }; -}; +} #endif - -#endif \ No newline at end of file diff --git a/etk/archive/Zip.h b/etk/archive/Zip.h index 65635e9..1b126cf 100644 --- a/etk/archive/Zip.h +++ b/etk/archive/Zip.h @@ -5,9 +5,7 @@ * * @license APACHE v2.0 (see license file) */ - -#ifndef __ETK_ARCHIVE_ZIP_H__ -#define __ETK_ARCHIVE_ZIP_H__ +#pragma once #include #ifdef ETK_BUILD_MINIZIP @@ -26,10 +24,9 @@ protected: // herited functions : virtual void loadFile(const std::map::iterator& it); }; - }; - }; + } + } #endif -#endif diff --git a/etk/debug.h b/etk/debug.h index 875e51a..d545549 100644 --- a/etk/debug.h +++ b/etk/debug.h @@ -8,8 +8,7 @@ #include -#ifndef __ETK_DEBUG_H__ -#define __ETK_DEBUG_H__ +#pragma once #include @@ -45,5 +44,4 @@ namespace etk { } \ } while (0) -#endif diff --git a/etk/etk.h b/etk/etk.h index 2db6550..628ec81 100644 --- a/etk/etk.h +++ b/etk/etk.h @@ -5,9 +5,7 @@ * * @license APACHE v2.0 (see license file) */ - -#ifndef __ETK_H__ -#define __ETK_H__ +#pragma once #include @@ -26,4 +24,3 @@ namespace etk { std::string getApplicationName(); } -#endif diff --git a/etk/log.h b/etk/log.h index 21677ec..71cb098 100644 --- a/etk/log.h +++ b/etk/log.h @@ -5,9 +5,7 @@ * * @license APACHE v2.0 (see license file) */ - -#ifndef __ETK_LOG_H__ -#define __ETK_LOG_H__ +#pragma once #include #include @@ -133,5 +131,3 @@ namespace etk { etk::log::logStream(logId, info, __LINE__, __class__, __func__, tmpStream); \ } \ } while(0) - -#endif diff --git a/etk/logIOs.h b/etk/logIOs.h index e0e17f0..d5ee377 100644 --- a/etk/logIOs.h +++ b/etk/logIOs.h @@ -5,9 +5,7 @@ * * @license APACHE v2.0 (see license file) */ - -#ifndef __ETK_LOG_IOS_H__ -#define __ETK_LOG_IOS_H__ +#pragma once #ifdef __cplusplus extern "C" { @@ -19,5 +17,4 @@ extern "C" { } #endif -#endif diff --git a/etk/math/Matrix.h b/etk/math/Matrix.h index 3682238..9d4f184 100644 --- a/etk/math/Matrix.h +++ b/etk/math/Matrix.h @@ -5,83 +5,74 @@ * * @license APACHE v2.0 (see license file) */ - -#ifndef __ETK_TYPES_MATRIX_H__ -#define __ETK_TYPES_MATRIX_H__ +#pragma once #include #include #include -namespace etk -{ - template class Matrix - { +namespace etk { + template class Matrix { private: - etk::Vector2D m_size; - std::vector m_data; + ivec2 m_size; + std::vector m_data; public: /***************************************************** * Constructor *****************************************************/ - Matrix(Vector2D size, T* defaultVal=NULL) : - m_size(size), - etk::Vector2D(size.x* size.y) - { - if (NULL != defaultVal) { + Matrix(ivec2 _size, T* _defaultVal=nullptr) : + m_size(_size), + etk::Vector2D(_size.x.x()* _size.y()) { + if (defaultVal != nullptr) { // copy all the elements - for(int32_t iii=0; iii<=m_size.x*m_size.y; iii++) { + for(int32_t iii=0; iii<=m_size.x()*m_size.y(); iii++) { // cast and set value : - m_data[iii] = (T)defaultVal++; + m_data[iii] = T(_defaultVal++); } } else { Clear(); } }; - Matrix(int32_t width=0, int32_t heigh=0, T* defaultVal=NULL) : - m_size(width, heigh), - etk::Vector2D(width*heigh) - { - if (NULL != defaultVal) { + Matrix(int32_t _width=0, int32_t _heigh=0, T* _defaultVal=nullptr) : + m_size(_width, _heigh), + etk::Vector2D(_width*_heigh) { + if (_defaultVal != nullptr) { // copy all the elements - for(int32_t iii=0; iii<=m_size.x*m_size.y; iii++) { + for(int32_t iii=0; iii<=m_size.x()*m_size.y(); iii++) { // cast and set value : - m_data[iii] = (T)defaultVal++; + m_data[iii] = (T)_defaultVal++; } } else { Clear(); } }; Matrix(const Matrix& obj) : - m_size(obj.m_size.x, obj.m_size.y), - etk::Vector2D(obj.m_size.x* obj.m_size.y) - { + m_size(_obj.m_size), + etk::Vector2D(_obj.m_size.x()* _obj.m_size.y()) { // copy all the elements - for(int32_t iii=0; iii<=m_size.x*m_size.y; iii++) { + for(int32_t iii=0; iii<=m_size.x()*m_size.y(); iii++) { // cast and set value : - m_data[iii] = (T)obj.m_data[iii]; + m_data[iii] = (T)_obj.m_data[iii]; } - }; - Matrix(const Matrix& obj) : - m_size(obj.m_size.x, obj.m_size.y), - etk::Vector2D(obj.m_size.x* obj.m_size.y) - { + } + Matrix(const Matrix& _obj) : + m_size(_obj.m_size), + etk::Vector2D(_obj.m_size.x()* _obj.m_size.y()) { // copy all the elements - for(int32_t iii=0; iii<=m_size.x*m_size.y; iii++) { + for(int32_t iii=0; iii<=m_size.x()*m_size.y(); iii++) { // cast and set value : - m_data[iii] = (T)obj.m_data[iii]; + m_data[iii] = (T)_obj.m_data[iii]; } - }; - Matrix(const Matrix& obj) : - m_size(obj.m_size.x, obj.m_size.y), - etk::Vector2D(obj.m_size.x* obj.m_size.y) - { + } + Matrix(const Matrix& _obj) : + m_size(_obj.m_size.x(), _obj.m_size.y()), + etk::Vector2D(_obj.m_size.x()* _obj.m_size.y()) { // copy all the elements - for(int32_t iii=0; iii<=m_size.x*m_size.y; iii++) { + for (int32_t iii=0; iii<=m_size.x()*m_size.y(); iii++) { // cast and set value : - m_data[iii] = (T)obj.m_data[iii]; + m_data[iii] = (T)_obj.m_data[iii]; } - }; + } /***************************************************** * Destructor *****************************************************/ @@ -90,58 +81,53 @@ namespace etk /***************************************************** * = assigment *****************************************************/ - const Matrix& operator= (const Matrix& obj ) - { + const Matrix& operator= (const Matrix& _obj ) { // check if it was the same pointer - if( this == &obj ) { + if (this == &_obj ) { return *this; } // copy data : - m_size = obj.m_size; - m_data = obj.m_data; + m_size = _obj.m_size; + m_data = _obj.m_data; return *this; }; - const Matrix& operator= (T& value) - { + const Matrix& operator= (T& _value) { // set data : for (int32_t iii=0; iii& obj) const - { - return (m_data == obj.m_data); + bool operator== (const Matrix& _obj) const { + return (m_data == _obj.m_data); }; /***************************************************** * != operator *****************************************************/ - bool operator!= (const Matrix& obj) const - { - return (m_data != obj.m_data); + bool operator!= (const Matrix& _obj) const { + return (m_data != _obj.m_data); }; /***************************************************** * += operator *****************************************************/ - const Matrix& operator+= (const Matrix& obj) - { - if (m_size != obj.m_size) { + const Matrix& operator+= (const Matrix& _obj) { + if (m_size != _obj.m_size) { //TK_CRITICAL("add 2 Matrix with différent size ... ==> generate the max size of all the 2 matrix"); - etk::Matrix tmpMatrix(std::max(m_size.x,obj.m_size.x), std::max(m_size.y,obj.m_size.y)); - for (int32_t jjj=0; jjj< m_size.y; jjj++) { + etk::Matrix tmpMatrix(std::max(m_size.x(),_obj.m_size.x()), std::max(m_size.y(),_obj.m_size.y())); + for (int32_t jjj=0; jjj< m_size.y(); jjj++) { T* tmpPointer = tmpMatrix[jjj]; T* tmpPointerIn = (*this)[jjj]; - for (int32_t iii=0; iii< m_size.x; iii++) { + for (int32_t iii=0; iii< m_size.x(); iii++) { tmpPointer[iii] = tmpPointerIn[iii]; } } - for (int32_t jjj=0; jjj< obj.m_size.y; jjj++) { + for (int32_t jjj=0; jjj< _obj.m_size.y(); jjj++) { T* tmpPointer = tmpMatrix[jjj]; - T* tmpPointerIn = obj[jjj]; - for (int32_t iii=0; iii< obj.m_size.x; iii++) { + T* tmpPointerIn = _obj[jjj]; + for (int32_t iii=0; iii< _obj.m_size.x(); iii++) { tmpPointer[iii] += tmpPointerIn[iii]; } } @@ -151,7 +137,7 @@ namespace etk } else { // copy data for the same size : for (int32_t iii=0; iii< m_data.size(); iii++) { - m_data[iii] += obj.m_data[iii]; + m_data[iii] += _obj.m_data[iii]; } } return *this; @@ -159,30 +145,29 @@ namespace etk /***************************************************** * + operator *****************************************************/ - Matrix operator+ (const Matrix& obj) { + Matrix operator+ (const Matrix& _obj) { Matrix tmpp(*this); - tmpp += obj; + tmpp += _obj; return tmpp; } /***************************************************** * -= operator *****************************************************/ - const Matrix& operator-= (const Matrix& obj) - { - if (m_size != obj.m_size) { + const Matrix& operator-= (const Matrix& _obj) { + if (m_size != _obj.m_size) { //TK_CRITICAL("less 2 Matrix with différent size ... ==> generate the max size of all the 2 matrix"); - etk::Matrix tmpMatrix(std::max(m_size.x,obj.m_size.x), std::max(m_size.y,obj.m_size.y)); + etk::Matrix tmpMatrix(std::max(m_size.x(),_obj.m_size.x()), std::max(m_size.y(),_obj.m_size.y())); for (int32_t jjj=0; jjj< m_size.y; jjj++) { T* tmpPointer = tmpMatrix[jjj]; T* tmpPointerIn = (*this)[jjj]; - for (int32_t iii=0; iii< m_size.x; iii++) { + for (int32_t iii=0; iii< m_size.x(); iii++) { tmpPointer[iii] = tmpPointerIn[iii]; } } - for (int32_t jjj=0; jjj< obj.m_size.y; jjj++) { + for (int32_t jjj=0; jjj< _obj.m_size.y(); jjj++) { T* tmpPointer = tmpMatrix[jjj]; - T* tmpPointerIn = obj[jjj]; - for (int32_t iii=0; iii< obj.m_size.x; iii++) { + T* tmpPointerIn = _obj[jjj]; + for (int32_t iii=0; iii< _obj.m_size.x(); iii++) { tmpPointer[iii] -= tmpPointerIn[iii]; } } @@ -192,7 +177,7 @@ namespace etk } else { // copy data for the same size : for (int32_t iii=0; iii< m_data.size(); iii++) { - m_data[iii] -= obj.m_data[iii]; + m_data[iii] -= _obj.m_data[iii]; } } return *this; @@ -200,27 +185,26 @@ namespace etk /***************************************************** * - operator *****************************************************/ - Matrix operator- (const Matrix& obj) { + Matrix operator- (const Matrix& _obj) { Matrix tmpp(*this); - tmpp += obj; + tmpp += _obj; return tmpp; } /***************************************************** * *= operator *****************************************************/ - const Matrix& operator*= (const Matrix& obj) - { - if( m_size.x != obj.m_size.y - || m_size.y != obj.m_size.x) { + const Matrix& operator*= (const Matrix& _obj) { + if( m_size.x() != _obj.m_size.y() + || m_size.y() != _obj.m_size.x()) { //TK_CRITICAL("Error while multipliying 2 matrix with different size ==> impossible case ..."); return *this; } etk::Matrix tmpMatrix(m_size); - for (int32_t jjj=0; jjj< obj.m_size.y; jjj++) { - for (int32_t iii=0; iii< obj.m_size.x; iii++) { + for (int32_t jjj=0; jjj< _obj.m_size.y(); jjj++) { + for (int32_t iii=0; iii< _obj.m_size.x(); iii++) { T tmpVal = 0; - for (int32_t kkk=0; kkk< obj.m_size.x; kkk++) { - tmpVal += (*this)[jjj][iii+kkk] * obj[jjj+kkk][iii]; + for (int32_t kkk=0; kkk< _obj.m_size.x(); kkk++) { + tmpVal += (*this)[jjj][iii+kkk] * _obj[jjj+kkk][iii]; } tmpMatrix[jjj][iii] = tmpVal; } @@ -232,25 +216,25 @@ namespace etk /***************************************************** * * operator *****************************************************/ - Matrix operator* (const Matrix& obj) { + Matrix operator* (const Matrix& _obj) { Matrix tmpp(*this); - tmpp *= obj; + tmpp *= _obj; return tmpp; } /***************************************************** * [] operator *****************************************************/ - const T* operator[] (int32_t line) const { - return &m_data[line*m_size.x]; + const T* operator[] (int32_t _line) const { + return &m_data[_line*m_size.x()]; } - T* operator[] (int32_t line) { - return &m_data[line*m_size.x]; + T* operator[] (int32_t _line) { + return &m_data[_line*m_size.x()]; } /***************************************************** * () operator *****************************************************/ - T& operator () (int32_t line, int32_t colomn) { - return m_data[line*m_size.x + colomn]; + T& operator () (int32_t _line, int32_t _colomn) { + return m_data[_line*m_size.x() + _colomn]; } /***************************************************** * - operator @@ -268,12 +252,11 @@ namespace etk * @ brief Transpose Matrix * @ return the transpose matrix */ - Matrix transpose() - { + Matrix transpose() { // create a matrix with the inverted size - Matrix tmpMatrix(m_size.x, m_size.y); - for (int32_t jjj=0; jjj< m_size.y; jjj++) { - for (int32_t iii=0; iii< m_size.x; iii++) { + Matrix tmpMatrix(m_size); + for (int32_t jjj=0; jjj< m_size.y(); jjj++) { + for (int32_t iii=0; iii< m_size.x(); iii++) { tmpMatrix(jjj,iii) = (*this)(iii,jjj); } } @@ -281,31 +264,29 @@ namespace etk }; /** * @ brief Create a convolution on the matrix : set convolution on the lines - * @ param[in] obj The convolution operator + * @ param[in] _obj The convolution operator * @ return the value of the convolution */ - Matrix& convolution(Matrix& obj) - { + Matrix& convolution(Matrix& _obj) { Matrix tmppp(1,1); // TODO : ... return tmppp; }; /** * @ brief generate a devide of the curent Matrix with the specify power of 2 - * @ param[in] decalage The power of 2 of the division + * @ param[in] _decalage The power of 2 of the division * @ return the result */ - Matrix& fix(int32_t decalage) - { + Matrix& fix(int32_t _decalage) { Matrix tmppp(m_size); T tmpVal = 0; for(int32_t iii=0; iii> decalage; + if (tmpVal < 0 && (tmpVal & ~(~0 << _decalage))) { + tmpVal = tmpVal >> _decalage; tmpVal++; } else { - tmpVal = tmpVal >> decalage; + tmpVal = tmpVal >> _decalage; } tmppp.m_data[iii] = tmpVal; } @@ -313,27 +294,25 @@ namespace etk }; /** * @ brief generate a devide of the curent Matrix with the specify power of 2 - * @ param[in] decalage The power of 2 of the division + * @ param[in] _decalage The power of 2 of the division * @ return the result */ - Matrix& round(int32_t decalage) - { + Matrix& round(int32_t _decalage) { Matrix tmppp(m_size); for(int32_t iii=0; iii> decalage; + tmppp.m_data[iii] = ( m_data[iii]+(1<<(_decalage-1)) ) >> _decalage; } return tmppp; }; /** * @ brief Generate a resised matrix - * @ param[in] size new output size + * @ param[in] _size new output size * @ return Te resied matrix */ - Matrix& resize(etk::Vector2D size) - { - Matrix tmppp(size); - for(int32_t iii=0; iii& resize(etk::Vector2D _size) { + Matrix tmppp(_size); + for(int32_t iii=0; iii& select(int32_t np, int32_t *p, int32_t nq, int32_t *q) - { - if (np < 1 || nq < 1) { + Matrix& select(int32_t _np, int32_t* _p, int32_t _nq, int32_t* _q) { + if (_np < 1 || _nq < 1) { TK_WARNING("bad index array sizes"); } - Matrix tmppp(np,nq); - for (int32_t iii=0; iii= m_size.x - || q[i] < 0 - || q[i] >= m_size.y) { + Matrix tmppp(_np, _nq); + for (int32_t iii=0; iii<_np; iii++) { + for (int32_t jjj=0; jjj<_nq; jjj++) { + if( _p[i] < 0 + || _p[i] >= m_size.x() + || _q[i] < 0 + || _q[i] >= m_size.y()) { TK_WARNING("bad index arrays"); } - tmppp(iii,jjj) = (*this)(p[i],q[j]); + tmppp(iii,jjj) = (*this)(_p[i],_q[j]); } } return tmppp; @@ -379,14 +357,13 @@ namespace etk * x x x x x * */ - void clearUpperTriangle() - { - if (m_size.x != m_size.y) { + void clearUpperTriangle() { + if (m_size.x() != m_size.y()) { TK_WARNING("better to do with square Matrix"); } - for (int32_t iii=0; iii */ - void clearLowerTriangle() - { - if (m_size.x != m_size.y) { + void clearLowerTriangle() { + if (m_size.x() != m_size.y()) { TK_WARNING("better to do with square Matrix"); } - for (int32_t iii=0; iii& input) { - if (m_size != input.m_size) + T maxDifference(const Matrix& _input) { + if (m_size != _input.m_size) TK_WARNING("better to do with same size Matrix"); } T max = 0; for(int32_t iii = 0; - iii < m_data.size() && iii < input.m_data.size(); + iii < m_data.size() && iii < _input.m_data.size(); ++iii) { - T diff = m_data[iii] - input.m_data[iii]; + T diff = m_data[iii] - _input.m_data[iii]; if (diff<0) { diff = -diff; } @@ -449,25 +424,23 @@ namespace etk */ void clear() { // copy data for the same size : - for (int32_t iii=0; iii< m_size.x*m_size.y; iii++) { + for (int32_t iii=0; iii< m_size.x()*m_size.y(); iii++) { m_data[iii] = (T)0; } }; /** * @brief Set the diagonal at 1 */ - void identity() - { + void identity() { // copy data for the same size : - for (int32_t iii=0; iii< std::mim(m_size.x, m_size.y); iii++) { + for (int32_t iii=0; iii< std::mim(m_size.x(), m_size.y()); iii++) { (*this)(iii,iii) = (T)1; } }; /** * @brief Clear and set the diagonal at 1 */ - void eye() - { + void eye() { clear(); identity(); }; @@ -475,16 +448,13 @@ namespace etk * @brief Get the size of the current Matrix. * @return Dimention of the matrix */ - Vector2D size() - { + Vector2D size() { return m_size; }; }; -}; +} // To siplify the writing of the code ==> this is not compatible with GLSL ... typedef etk::Matrix mat; typedef etk::Matrix imat; typedef etk::Matrix uimat; - -#endif diff --git a/etk/math/Matrix2.h b/etk/math/Matrix2.h index f76f8fb..4fad3bd 100644 --- a/etk/math/Matrix2.h +++ b/etk/math/Matrix2.h @@ -6,8 +6,7 @@ * @license APACHE v2.0 (see license file) */ -#ifndef __ETK_TYPES_MATRIX2_H__ -#define __ETK_TYPES_MATRIX2_H__ +#pragma once #include #include @@ -131,5 +130,4 @@ namespace etk { // simplify using of matrix ... typedef etk::Matrix2 mat2; -#endif diff --git a/etk/math/Matrix4.h b/etk/math/Matrix4.h index ec1211e..d65df4e 100644 --- a/etk/math/Matrix4.h +++ b/etk/math/Matrix4.h @@ -8,8 +8,7 @@ #include -#ifndef __ETK_TYPES_MATRIX4_H__ -#define __ETK_TYPES_MATRIX4_H__ +#pragma once #include @@ -30,9 +29,9 @@ namespace etk { Matrix4(); Matrix4(const Matrix4& _obj); Matrix4(float _a1, float _b1, float _c1, float _d1, - float _a2, float _b2, float _c2, float _d2, - float _a3, float _b3, float _c3, float _d3, - float _a4, float _b4, float _c4, float _d4); + float _a2, float _b2, float _c2, float _d2, + float _a3, float _b3, float _c3, float _d3, + float _a4, float _b4, float _c4, float _d4); Matrix4(float* _obj); /***************************************************** * Destructor @@ -154,5 +153,3 @@ typedef etk::Matrix4 mat4; #endif - -#endif diff --git a/etk/math/Plane.h b/etk/math/Plane.h index ee49bc1..e99253b 100644 --- a/etk/math/Plane.h +++ b/etk/math/Plane.h @@ -8,8 +8,7 @@ #include -#ifndef __ETK_TYPES_PLANE_H__ -#define __ETK_TYPES_PLANE_H__ +#pragma once #include #include @@ -207,7 +206,6 @@ namespace etk { return *this; } }; -}; +} -#endif diff --git a/etk/math/Vector2D.h b/etk/math/Vector2D.h index f25a3e4..bf3ebd7 100644 --- a/etk/math/Vector2D.h +++ b/etk/math/Vector2D.h @@ -9,8 +9,7 @@ #include #include -#ifndef __ETK_MATH_VECTOR2D_H__ -#define __ETK_MATH_VECTOR2D_H__ +#pragma once #include @@ -425,5 +424,5 @@ namespace etk { std::ostream& operator <<(std::ostream& _os, const std::vector& _obj); //! @previous std::ostream& operator <<(std::ostream& _os, const std::vector& _obj); -}; -#endif +} + diff --git a/etk/math/Vector3D.h b/etk/math/Vector3D.h index 9fab434..2dfbfaf 100644 --- a/etk/math/Vector3D.h +++ b/etk/math/Vector3D.h @@ -8,8 +8,7 @@ #include -#ifndef __ETK_MATH_VECTOR3D_H__ -#define __ETK_MATH_VECTOR3D_H__ +#pragma once #include @@ -498,7 +497,6 @@ namespace etk { std::ostream& operator <<(std::ostream& _os, const std::vector& _obj); //! @previous std::ostream& operator <<(std::ostream& _os, const std::vector& _obj); -}; +} -#endif diff --git a/etk/math/Vector4D.h b/etk/math/Vector4D.h index fe2e3d3..a4c4cdb 100644 --- a/etk/math/Vector4D.h +++ b/etk/math/Vector4D.h @@ -8,9 +8,6 @@ #include -#ifndef __ETK_MATH_VECTOR4D_H__ -#define __ETK_MATH_VECTOR4D_H__ - #include #ifdef ETK_BUILD_LINEARMATH #include @@ -441,7 +438,7 @@ namespace etk { std::ostream& operator <<(std::ostream& _os, const etk::Vector4D& _obj); std::ostream& operator <<(std::ostream& _os, const etk::Vector4D& _obj); std::ostream& operator <<(std::ostream& _os, const etk::Vector4D& _obj); -}; +} // To siplify the writing of the code ==> this permit to have the same name with the glsl language... typedef etk::Vector4D vec4; @@ -451,5 +448,3 @@ typedef etk::Vector4D uivec4; typedef etk::Vector4D bvec4; -#endif - diff --git a/etk/os/FSNode.h b/etk/os/FSNode.h index f28b208..6aa90da 100644 --- a/etk/os/FSNode.h +++ b/etk/os/FSNode.h @@ -8,8 +8,7 @@ #include -#ifndef __ETK_FILE_SYSTEM_NODE_H__ -#define __ETK_FILE_SYSTEM_NODE_H__ +#pragma once #include @@ -892,5 +891,4 @@ namespace etk { std::vector FSNodeExplodeMultiplePath(const std::string& _path); }; -#endif diff --git a/etk/os/FSNodeRight.h b/etk/os/FSNodeRight.h index 49f3933..3b1c180 100644 --- a/etk/os/FSNodeRight.h +++ b/etk/os/FSNodeRight.h @@ -8,8 +8,7 @@ #include -#ifndef __ETK_FILE_SYSTEM_NODE_RIGHT_H__ -#define __ETK_FILE_SYSTEM_NODE_RIGHT_H__ +#pragma once namespace etk { class FSNodeRight { @@ -54,7 +53,6 @@ namespace etk { std::string getRight() const; }; std::ostream& operator <<(std::ostream &_os, const etk::FSNodeRight &_obj); -}; +} -#endif diff --git a/etk/os/Fifo.h b/etk/os/Fifo.h index a280ab0..99a065a 100644 --- a/etk/os/Fifo.h +++ b/etk/os/Fifo.h @@ -8,8 +8,7 @@ #include -#ifndef __ETK_MESSAGE_FIFO_H__ -#define __ETK_MESSAGE_FIFO_H__ +#pragma once #include #include @@ -120,6 +119,5 @@ namespace etk { m_condition.wait_for(lock, std::chrono::microseconds(0)); }; }; -}; +} -#endif diff --git a/etk/stdTools.h b/etk/stdTools.h index e3b3486..f35cea8 100644 --- a/etk/stdTools.h +++ b/etk/stdTools.h @@ -5,9 +5,7 @@ * * @license APACHE v2.0 (see license file) */ - -#ifndef __ETK_STD_TOOLS_H__ -#define __ETK_STD_TOOLS_H__ +#pragma once #include #include @@ -569,5 +567,4 @@ int32_t strlen(const char32_t * _data); #define M_PI 3.14159265358979323846 #endif -#endif diff --git a/etk/thread/tools.h b/etk/thread/tools.h index 4ddd307..0d9ebe8 100644 --- a/etk/thread/tools.h +++ b/etk/thread/tools.h @@ -8,8 +8,7 @@ #include -#ifndef __ETK_THREAD_TOOLS_H__ -#define __ETK_THREAD_TOOLS_H__ +#pragma once #include @@ -74,5 +73,3 @@ namespace etk { int32_t getPriority(std11::thread& _thread); } } - -#endif diff --git a/etk/tool.h b/etk/tool.h index 36c8f8e..98636c9 100644 --- a/etk/tool.h +++ b/etk/tool.h @@ -8,8 +8,7 @@ #include -#ifndef __ETK_TOOL_H__ -#define __ETK_TOOL_H__ +#pragma once namespace etk { namespace tool { @@ -31,7 +30,6 @@ namespace etk { * @param[in] _val Seek value for the pseudo random system. */ void randSeek(int32_t _val); - }; -}; + } +} -#endif diff --git a/etk/types.h b/etk/types.h index 19239a5..16e0d61 100644 --- a/etk/types.h +++ b/etk/types.h @@ -5,9 +5,7 @@ * * @license APACHE v2.0 (see license file) */ - -#ifndef __ETK_TYPES_H__ -#define __ETK_TYPES_H__ +#pragma once #include @@ -60,5 +58,3 @@ namespace std11 = std; #endif #endif - -#endif diff --git a/lutin_etk.py b/lutin_etk.py index 7aed70b..2f5e4e2 100644 --- a/lutin_etk.py +++ b/lutin_etk.py @@ -106,7 +106,7 @@ def create(target, module_name): pass else: #TODO : Set it in a generic include system - my_module.add_export_flag('link', "-lpthread") + my_module.add_export_flag('link-lib', "pthread") my_module.add_path(tools.get_current_path(__file__)) return my_module diff --git a/tools/test-debug/debug.h b/tools/test-debug/debug.h index 8ceacd4..9c8b40f 100644 --- a/tools/test-debug/debug.h +++ b/tools/test-debug/debug.h @@ -8,8 +8,7 @@ #include -#ifndef __TEST_DEBUG_H__ -#define __TEST_DEBUG_H__ +#pragma once #include @@ -45,5 +44,4 @@ namespace test { } \ } while (0) -#endif