Просмотр исходного кода

src: add explicit keyword to more ctors

Daniele Bartolini 3 лет назад
Родитель
Сommit
87ac27d572
3 измененных файлов с 5 добавлено и 5 удалено
  1. 1 1
      src/device/main_android.cpp
  2. 2 2
      src/device/main_linux.cpp
  3. 2 2
      src/resource/unit_compiler.h

+ 1 - 1
src/device/main_android.cpp

@@ -38,7 +38,7 @@ struct AndroidDevice
 	Thread _main_thread;
 	DeviceOptions *_opts;
 
-	AndroidDevice(Allocator &a)
+	explicit AndroidDevice(Allocator &a)
 		: _events(a)
 		, _queue(push_event)
 		, _opts(NULL)

+ 2 - 2
src/device/main_linux.cpp

@@ -185,7 +185,7 @@ struct Joypad
 	int _fd[CROWN_MAX_JOYPADS];
 	AxisData _axis[CROWN_MAX_JOYPADS];
 
-	Joypad(DeviceEventQueue &queue)
+	explicit Joypad(DeviceEventQueue &queue)
 		: _queue(&queue)
 	{
 		memset(&_fd, 0, sizeof(_fd));
@@ -323,7 +323,7 @@ struct LinuxDevice
 	s16 _mouse_last_y;
 	CursorMode::Enum _cursor_mode;
 
-	LinuxDevice(Allocator &a)
+	explicit LinuxDevice(Allocator &a)
 		: _x11_display(NULL)
 		, _wm_delete_window(None)
 		, _net_wm_state(None)

+ 2 - 2
src/resource/unit_compiler.h

@@ -28,7 +28,7 @@ struct UnitCompiler
 		Buffer _data;
 		CompileFunction _compiler;
 
-		ComponentTypeData(Allocator &a)
+		explicit ComponentTypeData(Allocator &a)
 			: _num(0)
 			, _unit_index(a)
 			, _data(a)
@@ -65,7 +65,7 @@ struct UnitCompiler
 	s32 compile_component(Buffer &output, StringId32 type, const char *json);
 
 	///
-	UnitCompiler(CompileOptions &opts);
+	explicit UnitCompiler(CompileOptions &opts);
 
 	///
 	~UnitCompiler();