Added "explicit" specifier to constructors that would otherwise allow undesirable implicit conversion from integer types.

Signed-off-by: Augustin Cavalier <[email protected]>
This commit is contained in:
Jim Barry
2017-03-08 15:59:46 -05:00
committed by Augustin Cavalier
parent 2651cf9b02
commit d47434c2ec
+2 -2
View File
@@ -55,7 +55,7 @@ namespace agg
gray8() {}
//--------------------------------------------------------------------
gray8(unsigned v_, unsigned a_=base_mask) :
explicit gray8(unsigned v_, unsigned a_=base_mask) :
v(int8u(v_)), a(int8u(a_)) {}
//--------------------------------------------------------------------
@@ -242,7 +242,7 @@ namespace agg
gray16() {}
//--------------------------------------------------------------------
gray16(unsigned v_, unsigned a_=base_mask) :
explicit gray16(unsigned v_, unsigned a_=base_mask) :
v(int16u(v_)), a(int16u(a_)) {}
//--------------------------------------------------------------------