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

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>
This commit is contained in:
Jim Barry 2014-06-10 21:17:58 +00:00 committed by Augustin Cavalier
parent 2651cf9b02
commit d47434c2ec
1 changed files with 2 additions and 2 deletions

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_)) {}
//--------------------------------------------------------------------