Cycles: Use explicit qualifier for single-argument constructors

Almost in all cases we want such constructors to be explicit, there are
exceptions but only in few places.
This commit is contained in:
Sergey Sharybin
2016-05-11 16:50:10 +02:00
parent d57f416e47
commit 92774ff792
20 changed files with 30 additions and 30 deletions

View File

@@ -134,8 +134,8 @@ public:
AttributeElement triangle_element, curve_element;
int triangle_offset, curve_offset;
AttributeRequest(ustring name_);
AttributeRequest(AttributeStandard std);
explicit AttributeRequest(ustring name_);
explicit AttributeRequest(AttributeStandard std);
};
/* AttributeRequestSet

View File

@@ -73,7 +73,7 @@ public:
/* random number generator state */
device_vector<uint> rng_state;
RenderBuffers(Device *device);
explicit RenderBuffers(Device *device);
~RenderBuffers();
void reset(Device *device, BufferParams& params);

View File

@@ -177,7 +177,7 @@ public:
class ShaderNode {
public:
ShaderNode(const char *name);
explicit ShaderNode(const char *name);
virtual ~ShaderNode();
ShaderInput *input(const char *name);

View File

@@ -32,7 +32,7 @@ class Progress;
class ImageManager {
public:
ImageManager(const DeviceInfo& info);
explicit ImageManager(const DeviceInfo& info);
~ImageManager();
enum ImageDataType {

View File

@@ -75,7 +75,7 @@ public:
class TextureNode : public ShaderNode {
public:
TextureNode(const char *name_) : ShaderNode(name_) {}
explicit TextureNode(const char *name_) : ShaderNode(name_) {}
TextureMapping tex_mapping;
virtual bool equals(const ShaderNode *other) {
@@ -87,7 +87,7 @@ public:
/* Any node which uses image manager's slot should be a subclass of this one. */
class ImageSlotTextureNode : public TextureNode {
public:
ImageSlotTextureNode(const char *name_) : TextureNode(name_) {
explicit ImageSlotTextureNode(const char *name_) : TextureNode(name_) {
special_type = SHADER_SPECIAL_TYPE_IMAGE_SLOT;
}
int slot;
@@ -379,7 +379,7 @@ public:
class BsdfNode : public ShaderNode {
public:
BsdfNode(bool scattering = false);
explicit BsdfNode(bool scattering = false);
SHADER_NODE_BASE_CLASS(BsdfNode);
bool has_spatial_varying() { return true; }

View File

@@ -129,7 +129,7 @@ public:
function<void(RenderTile&)> write_render_tile_cb;
function<void(RenderTile&)> update_render_tile_cb;
Session(const SessionParams& params);
explicit Session(const SessionParams& params);
~Session();
void start();

View File

@@ -150,7 +150,7 @@ protected:
/* Global state of the compiler accessible from the compilation routines. */
struct CompilerState {
CompilerState(ShaderGraph *graph);
explicit CompilerState(ShaderGraph *graph);
/* ** Global state, used by various compilation steps. ** */