summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-08-08 18:21:24 +0200
committerCarl Hetherington <cth@carlh.net>2023-08-08 18:21:31 +0200
commitae92f24aef30140e85a44bb179a55af02b33eb3c (patch)
tree27f0d11bc618519cf8ad4be97f18394838de9912
parent20b6a9862bbde42e9ce038b33ec049194a8146a5 (diff)
Cleanup: make some default constructors more consistent.v1.8.75
-rw-r--r--src/types.cc6
-rw-r--r--src/types.h14
2 files changed, 6 insertions, 14 deletions
diff --git a/src/types.cc b/src/types.cc
index 9b868197..e2e72ad1 100644
--- a/src/types.cc
+++ b/src/types.cc
@@ -109,12 +109,6 @@ dcp::operator!= (Fraction const & a, Fraction const & b)
}
-Colour::Colour ()
-{
-
-}
-
-
Colour::Colour (int r_, int g_, int b_)
: r (r_)
, g (g_)
diff --git a/src/types.h b/src/types.h
index 340d8613..f6e996c7 100644
--- a/src/types.h
+++ b/src/types.h
@@ -69,10 +69,7 @@ namespace dcp
*/
struct Size
{
- Size ()
- : width (0)
- , height (0)
- {}
+ Size() = default;
Size (int w, int h)
: width (w)
@@ -83,8 +80,8 @@ struct Size
return float (width) / height;
}
- int width;
- int height;
+ int width = 0;
+ int height = 0;
};
@@ -206,7 +203,8 @@ class Fraction
{
public:
/** Construct a fraction of 0/0 */
- Fraction () {}
+ Fraction() = default;
+
explicit Fraction (std::string s);
/** Construct a fraction with a specified numerator and denominator.
* @param n Numerator.
@@ -261,7 +259,7 @@ class Colour
{
public:
/** Construct a Colour, initialising it to black */
- Colour ();
+ Colour() = default;
/** Construct a Colour from R, G and B. The values run between
* 0 and 255.