Skip to content

Commit 1abe428

Browse files
committed
Changes inspired by cppckeck
1 parent 28cbb3b commit 1abe428

10 files changed

Lines changed: 16 additions & 16 deletions

File tree

include/vsg/maths/box.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ namespace vsg
4242

4343
constexpr t_box& operator=(const t_box&) = default;
4444

45-
constexpr std::size_t size() const { return 6; }
45+
constexpr static std::size_t size() { return 6; }
4646

4747
value_type& operator[](std::size_t i) { return data()[i]; }
4848
value_type operator[](std::size_t i) const { return data()[i]; }

include/vsg/maths/mat2.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ namespace vsg
5959
value[1] = rhs[1];
6060
}
6161

62-
constexpr std::size_t size() const { return 4; }
63-
constexpr std::size_t columns() const { return 2; }
64-
constexpr std::size_t rows() const { return 2; }
62+
constexpr static std::size_t size() { return 4; }
63+
constexpr static std::size_t columns() { return 2; }
64+
constexpr static std::size_t rows() { return 2; }
6565

6666
column_type& operator[](std::size_t c) { return value[c]; }
6767
const column_type& operator[](std::size_t c) const { return value[c]; }

include/vsg/maths/mat3.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ namespace vsg
6666
value[2] = rhs[2];
6767
}
6868

69-
constexpr std::size_t size() const { return 9; }
70-
constexpr std::size_t columns() const { return 3; }
71-
constexpr std::size_t rows() const { return 3; }
69+
constexpr static std::size_t size() { return 9; }
70+
constexpr static std::size_t columns() { return 3; }
71+
constexpr static std::size_t rows() { return 3; }
7272

7373
column_type& operator[](std::size_t c) { return value[c]; }
7474
const column_type& operator[](std::size_t c) const { return value[c]; }

include/vsg/maths/mat4.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ namespace vsg
7575
value[3] = rhs[3];
7676
}
7777

78-
constexpr std::size_t size() const { return 16; }
79-
constexpr std::size_t columns() const { return 4; }
80-
constexpr std::size_t rows() const { return 4; }
78+
constexpr static std::size_t size() { return 16; }
79+
constexpr static std::size_t columns() { return 4; }
80+
constexpr static std::size_t rows() { return 4; }
8181

8282
column_type& operator[](std::size_t c) { return value[c]; }
8383
const column_type& operator[](std::size_t c) const { return value[c]; }

include/vsg/maths/plane.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ namespace vsg
7777
constexpr explicit t_plane(const t_vec4<T>& v) :
7878
value{v[0], v[1], v[2], v[3]} {}
7979

80-
constexpr std::size_t size() const { return 4; }
80+
constexpr static std::size_t size() { return 4; }
8181

8282
value_type& operator[](std::size_t i) { return value[i]; }
8383
value_type operator[](std::size_t i) const { return value[i]; }

include/vsg/maths/quat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ namespace vsg
6565

6666
constexpr t_quat& operator=(const t_quat&) = default;
6767

68-
constexpr std::size_t size() const { return 4; }
68+
constexpr static std::size_t size() { return 4; }
6969

7070
value_type& operator[](std::size_t i) { return value[i]; }
7171
value_type operator[](std::size_t i) const { return value[i]; }

include/vsg/maths/sphere.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ namespace vsg
7474
constexpr t_sphere(R sx, R sy, R sz, R sd) :
7575
value{sx, sy, sz, sd} {}
7676

77-
constexpr std::size_t size() const { return 4; }
77+
constexpr static std::size_t size() { return 4; }
7878

7979
value_type& operator[](std::size_t i) { return value[i]; }
8080
value_type operator[](std::size_t i) const { return value[i]; }

include/vsg/maths/vec2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ namespace vsg
6868
constexpr explicit t_vec2(const t_vec2<R>& v) :
6969
value{static_cast<T>(v.x), static_cast<T>(v.y)} {}
7070

71-
constexpr std::size_t size() const { return 2; }
71+
constexpr static std::size_t size() { return 2; }
7272

7373
value_type& operator[](std::size_t i) { return value[i]; }
7474
value_type operator[](std::size_t i) const { return value[i]; }

include/vsg/maths/vec3.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ namespace vsg
6767
constexpr explicit t_vec3(const t_vec3<R>& v) :
6868
value{static_cast<T>(v.x), static_cast<T>(v.y), static_cast<T>(v.z)} {}
6969

70-
constexpr std::size_t size() const { return 3; }
70+
constexpr static std::size_t size() { return 3; }
7171

7272
value_type& operator[](std::size_t i) { return value[i]; }
7373
value_type operator[](std::size_t i) const { return value[i]; }

include/vsg/maths/vec4.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ namespace vsg
7878
constexpr t_vec4(const t_vec3<R>& v, value_type in_w) :
7979
value{static_cast<T>(v.x), static_cast<T>(v.y), static_cast<T>(v.z), in_w} {}
8080

81-
constexpr std::size_t size() const { return 4; }
81+
constexpr static std::size_t size() { return 4; }
8282

8383
value_type& operator[](std::size_t i) { return value[i]; }
8484
value_type operator[](std::size_t i) const { return value[i]; }

0 commit comments

Comments
 (0)