Skip to content

Commit d2b046d

Browse files
author
tpltnt
committed
constructors made explicit
1 parent 1bd8f06 commit d2b046d

4 files changed

Lines changed: 26 additions & 26 deletions

File tree

addons/ofxOsc/libs/oscpack/src/ip/IpEndpointName.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class IpEndpointName{
4747

4848
IpEndpointName()
4949
: address( ANY_ADDRESS ), port( ANY_PORT ) {}
50-
IpEndpointName( int port_ )
50+
explicit IpEndpointName( int port_ )
5151
: address( ANY_ADDRESS ), port( port_ ) {}
5252
IpEndpointName( unsigned long ipAddress_, int port_ )
5353
: address( ipAddress_ ), port( port_ ) {}

addons/ofxOsc/libs/oscpack/src/osc/OscException.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class Exception : public std::exception {
4949
Exception( const Exception& src ) throw()
5050
: std::exception( src )
5151
, what_( src.what_ ) {}
52-
Exception( const char *w ) throw()
52+
explicit Exception( const char *w ) throw()
5353
: what_( w ) {}
5454
Exception& operator=( const Exception& src ) throw()
5555
{ what_ = src.what_; return *this; }

addons/ofxOsc/libs/oscpack/src/osc/OscReceivedElements.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,37 +50,37 @@ namespace osc{
5050

5151
class MalformedPacketException : public Exception{
5252
public:
53-
MalformedPacketException( const char *w="malformed packet" )
53+
explicit MalformedPacketException( const char *w="malformed packet" )
5454
: Exception( w ) {}
5555
};
5656

5757
class MalformedMessageException : public Exception{
5858
public:
59-
MalformedMessageException( const char *w="malformed message" )
59+
explicit MalformedMessageException( const char *w="malformed message" )
6060
: Exception( w ) {}
6161
};
6262

6363
class MalformedBundleException : public Exception{
6464
public:
65-
MalformedBundleException( const char *w="malformed bundle" )
65+
explicit MalformedBundleException( const char *w="malformed bundle" )
6666
: Exception( w ) {}
6767
};
6868

6969
class WrongArgumentTypeException : public Exception{
7070
public:
71-
WrongArgumentTypeException( const char *w="wrong argument type" )
71+
explicit WrongArgumentTypeException( const char *w="wrong argument type" )
7272
: Exception( w ) {}
7373
};
7474

7575
class MissingArgumentException : public Exception{
7676
public:
77-
MissingArgumentException( const char *w="missing argument" )
77+
explicit MissingArgumentException( const char *w="missing argument" )
7878
: Exception( w ) {}
7979
};
8080

8181
class ExcessArgumentException : public Exception{
8282
public:
83-
ExcessArgumentException( const char *w="too many arguments" )
83+
explicit ExcessArgumentException( const char *w="too many arguments" )
8484
: Exception( w ) {}
8585
};
8686

@@ -141,7 +141,7 @@ class ReceivedPacket{
141141

142142
class ReceivedBundleElement{
143143
public:
144-
ReceivedBundleElement( const char *sizePtr )
144+
explicit ReceivedBundleElement( const char *sizePtr )
145145
: sizePtr_( sizePtr ) {}
146146

147147
friend class ReceivedBundleElementIterator;
@@ -159,7 +159,7 @@ class ReceivedBundleElement{
159159

160160
class ReceivedBundleElementIterator{
161161
public:
162-
ReceivedBundleElementIterator( const char *sizePtr )
162+
explicit ReceivedBundleElementIterator( const char *sizePtr )
163163
: value_( sizePtr ) {}
164164

165165
ReceivedBundleElementIterator operator++()

addons/ofxOsc/src/ofxOscArg.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ subclasses for each possible argument type
101101
class ofxOscArgInt32 : public ofxOscArg
102102
{
103103
public:
104-
ofxOscArgInt32( std::int32_t _value ) { value = _value; };
104+
explicit ofxOscArgInt32( std::int32_t _value ) { value = _value; };
105105
~ofxOscArgInt32() {};
106106

107107
/// return the type of this argument
@@ -120,14 +120,14 @@ class ofxOscArgInt32 : public ofxOscArg
120120
class ofxOscArgInt : public ofxOscArgInt32
121121
{
122122
public:
123-
ofxOscArgInt( std::int32_t _value ) : ofxOscArgInt32(_value) {};
123+
explicit ofxOscArgInt( std::int32_t _value ) : ofxOscArgInt32(_value) {};
124124
~ofxOscArgInt(){};
125125
};
126126

127127
class ofxOscArgInt64 : public ofxOscArg
128128
{
129129
public:
130-
ofxOscArgInt64( std::int64_t _value ) { value = _value; };
130+
explicit ofxOscArgInt64( std::int64_t _value ) { value = _value; };
131131
~ofxOscArgInt64() {};
132132

133133
/// return the type of this argument
@@ -146,7 +146,7 @@ class ofxOscArgInt64 : public ofxOscArg
146146
class ofxOscArgFloat : public ofxOscArg
147147
{
148148
public:
149-
ofxOscArgFloat( float _value ) { value = _value; };
149+
explicit ofxOscArgFloat( float _value ) { value = _value; };
150150
~ofxOscArgFloat() {};
151151

152152
/// return the type of this argument
@@ -165,7 +165,7 @@ class ofxOscArgFloat : public ofxOscArg
165165
class ofxOscArgDouble : public ofxOscArg
166166
{
167167
public:
168-
ofxOscArgDouble( double _value ) { value = _value; };
168+
explicit ofxOscArgDouble( double _value ) { value = _value; };
169169
~ofxOscArgDouble() {};
170170

171171
/// return the type of this argument
@@ -184,7 +184,7 @@ class ofxOscArgDouble : public ofxOscArg
184184
class ofxOscArgString : public ofxOscArg
185185
{
186186
public:
187-
ofxOscArgString( const std::string &_value ) { value = _value; };
187+
explicit ofxOscArgString( const std::string &_value ) { value = _value; };
188188
~ofxOscArgString() {};
189189

190190
/// return the type of this argument
@@ -204,7 +204,7 @@ class ofxOscArgString : public ofxOscArg
204204
class ofxOscArgSymbol : public ofxOscArgString
205205
{
206206
public:
207-
ofxOscArgSymbol( const std::string &_value ) : ofxOscArgString(_value){};
207+
explicit ofxOscArgSymbol( const std::string &_value ) : ofxOscArgString(_value){};
208208
~ofxOscArgSymbol() {};
209209

210210
/// return the type of this argument
@@ -215,7 +215,7 @@ class ofxOscArgSymbol : public ofxOscArgString
215215
class ofxOscArgChar : public ofxOscArg
216216
{
217217
public:
218-
ofxOscArgChar( char _value ) { value = _value; };
218+
explicit ofxOscArgChar( char _value ) { value = _value; };
219219
~ofxOscArgChar() {};
220220

221221
/// return the type of this argument
@@ -234,7 +234,7 @@ class ofxOscArgChar : public ofxOscArg
234234
class ofxOscArgMidiMessage : public ofxOscArgInt32
235235
{
236236
public:
237-
ofxOscArgMidiMessage( std::int32_t _value ) : ofxOscArgInt32(_value) {};
237+
explicit ofxOscArgMidiMessage( std::int32_t _value ) : ofxOscArgInt32(_value) {};
238238
~ofxOscArgMidiMessage() {};
239239

240240
/// return the type of this argument
@@ -245,7 +245,7 @@ class ofxOscArgMidiMessage : public ofxOscArgInt32
245245
class ofxOscArgBool : public ofxOscArg
246246
{
247247
public:
248-
ofxOscArgBool( bool _value ) { value = _value; };
248+
explicit ofxOscArgBool( bool _value ) { value = _value; };
249249
~ofxOscArgBool() {};
250250

251251
/// return the type of this argument
@@ -285,7 +285,7 @@ class ofxOscArgTrigger : public ofxOscArgBool
285285
class ofxOscArgTimetag : public ofxOscArgInt64
286286
{
287287
public:
288-
ofxOscArgTimetag( std::int64_t _value ) : ofxOscArgInt64(_value) {};
288+
explicit ofxOscArgTimetag( std::int64_t _value ) : ofxOscArgInt64(_value) {};
289289
~ofxOscArgTimetag() {};
290290

291291
/// return the type of this argument
@@ -296,10 +296,10 @@ class ofxOscArgTimetag : public ofxOscArgInt64
296296
class ofxOscArgBlob : public ofxOscArg
297297
{
298298
public:
299-
ofxOscArgBlob( const ofBuffer &_value ){
300-
value = _value;
301-
}
302-
~ofxOscArgBlob(){};
299+
explicit ofxOscArgBlob( const ofBuffer &_value ){
300+
value = _value;
301+
}
302+
~ofxOscArgBlob(){};
303303

304304
/// return the type of this argument
305305
ofxOscArgType getType() { return OFXOSC_TYPE_BLOB; };
@@ -317,7 +317,7 @@ class ofxOscArgBlob : public ofxOscArg
317317
class ofxOscArgRgbaColor : public ofxOscArg
318318
{
319319
public:
320-
ofxOscArgRgbaColor( std::int32_t _value ) { value = _value; };
320+
explicit ofxOscArgRgbaColor( std::int32_t _value ) { value = _value; };
321321
~ofxOscArgRgbaColor() {};
322322

323323
/// return the type of this argument

0 commit comments

Comments
 (0)