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:
@@ -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
|
||||
|
@@ -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);
|
||||
|
@@ -177,7 +177,7 @@ public:
|
||||
|
||||
class ShaderNode {
|
||||
public:
|
||||
ShaderNode(const char *name);
|
||||
explicit ShaderNode(const char *name);
|
||||
virtual ~ShaderNode();
|
||||
|
||||
ShaderInput *input(const char *name);
|
||||
|
@@ -32,7 +32,7 @@ class Progress;
|
||||
|
||||
class ImageManager {
|
||||
public:
|
||||
ImageManager(const DeviceInfo& info);
|
||||
explicit ImageManager(const DeviceInfo& info);
|
||||
~ImageManager();
|
||||
|
||||
enum ImageDataType {
|
||||
|
@@ -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; }
|
||||
|
@@ -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();
|
||||
|
@@ -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. ** */
|
||||
|
||||
|
Reference in New Issue
Block a user