Changeset - r28216:c476df456602
[Not reviewed]
master
0 1 0
Peter Nelson - 13 months ago 2023-11-17 16:41:30
peter1138@openttd.org
Codechange: Dimension must have both width and height.

Default parameters allowed Dimension to be constructed with only a width.

Instead use separate empty and width/height constructors to ensure that either none or both are provided.
1 file changed with 2 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/core/geometry_type.hpp
Show inline comments
 
@@ -28,7 +28,8 @@ struct Dimension {
 
	uint width;
 
	uint height;
 

	
 
	Dimension(uint w = 0, uint h = 0) : width(w), height(h) {};
 
	constexpr Dimension() : width(0), height(0) {}
 
	constexpr Dimension(uint w, uint h) : width(w), height(h) {}
 

	
 
	bool operator< (const Dimension &other) const
 
	{
0 comments (0 inline, 0 general)