Skip to content

Commit 6434c61

Browse files
authored
Merge branch 'openframeworks:master' into rename-getIsEnabled
2 parents 3143ff2 + 36c5927 commit 6434c61

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+3044
-2962
lines changed

.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ UseCRLF: false
208208
UseTab: Always
209209
WhitespaceSensitiveMacros:
210210
- STRINGIZE
211+
- STRINGIFY
211212
- PP_STRINGIZE
212213
- BOOST_PP_STRINGIZE
213214
- NS_SWIFT_NAME

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ unsigned long IpEndpointName::GetHostByName( const char *s )
5151
void IpEndpointName::AddressAsString( char *s ) const
5252
{
5353
if( address == ANY_ADDRESS ){
54-
std::sprintf( s, "<any>" );
54+
std::snprintf( s, ADDRESS_STRING_LENGTH, "<any>" );
5555
}else{
56-
std::sprintf( s, "%d.%d.%d.%d",
56+
std::snprintf( s, ADDRESS_STRING_LENGTH, "%d.%d.%d.%d",
5757
(int)((address >> 24) & 0xFF),
5858
(int)((address >> 16) & 0xFF),
5959
(int)((address >> 8) & 0xFF),
@@ -66,25 +66,25 @@ void IpEndpointName::AddressAndPortAsString( char *s ) const
6666
{
6767
if( port == ANY_PORT ){
6868
if( address == ANY_ADDRESS ){
69-
std::sprintf( s, "<any>:<any>" );
69+
std::snprintf( s, ADDRESS_AND_PORT_STRING_LENGTH, "<any>:<any>" );
7070
}else{
71-
std::sprintf( s, "%d.%d.%d.%d:<any>",
71+
std::snprintf( s, ADDRESS_AND_PORT_STRING_LENGTH, "%d.%d.%d.%d:<any>",
7272
(int)((address >> 24) & 0xFF),
7373
(int)((address >> 16) & 0xFF),
7474
(int)((address >> 8) & 0xFF),
7575
(int)(address & 0xFF) );
7676
}
7777
}else{
7878
if( address == ANY_ADDRESS ){
79-
std::sprintf( s, "<any>:%d", port );
79+
std::snprintf( s, ADDRESS_AND_PORT_STRING_LENGTH, "<any>:%d", port );
8080
}else{
81-
std::sprintf( s, "%d.%d.%d.%d:%d",
81+
std::snprintf( s, ADDRESS_AND_PORT_STRING_LENGTH, "%d.%d.%d.%d:%d",
8282
(int)((address >> 24) & 0xFF),
8383
(int)((address >> 16) & 0xFF),
8484
(int)((address >> 8) & 0xFF),
8585
(int)(address & 0xFF),
8686
(int)port );
8787
}
88-
}
88+
}
8989
}
9090
}

addons/ofxOsc/src/ofxOscBundle.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,81 @@
1-
// copyright (c) openFrameworks team 2010-2017
1+
// copyright (c) openFrameworks team 2010-2023
22
// copyright (c) Damian Stewart 2007-2009
33
#include "ofxOscBundle.h"
44

55
//--------------------------------------------------------------
6-
ofxOscBundle::ofxOscBundle(const ofxOscBundle &other){
6+
ofxOscBundle::ofxOscBundle(const ofxOscBundle & other) {
77
copy(other);
88
}
99

1010
//--------------------------------------------------------------
11-
ofxOscBundle& ofxOscBundle::operator=(const ofxOscBundle &other){
11+
ofxOscBundle & ofxOscBundle::operator=(const ofxOscBundle & other) {
1212
return copy(other);
1313
}
1414

1515
//--------------------------------------------------------------
16-
ofxOscBundle& ofxOscBundle::copy(const ofxOscBundle &other){
17-
if(this == &other) return *this;
16+
ofxOscBundle & ofxOscBundle::copy(const ofxOscBundle & other) {
17+
if (this == &other) return *this;
1818

1919
std::copy(other.bundles.begin(),
20-
other.bundles.end(),
21-
std::back_inserter(bundles));
20+
other.bundles.end(),
21+
std::back_inserter(bundles));
2222

2323
std::copy(other.messages.begin(),
24-
other.messages.end(),
25-
std::back_inserter(messages));
24+
other.messages.end(),
25+
std::back_inserter(messages));
2626

2727
return *this;
2828
}
2929

3030
//--------------------------------------------------------------
31-
void ofxOscBundle::clear(){
31+
void ofxOscBundle::clear() {
3232
bundles.clear();
3333
messages.clear();
3434
}
3535

3636
//--------------------------------------------------------------
37-
void ofxOscBundle::addBundle(const ofxOscBundle &bundle){
37+
void ofxOscBundle::addBundle(const ofxOscBundle & bundle) {
3838
bundles.push_back(bundle);
3939
}
4040

4141
//--------------------------------------------------------------
42-
void ofxOscBundle::addMessage(const ofxOscMessage &message){
42+
void ofxOscBundle::addMessage(const ofxOscMessage & message) {
4343
messages.push_back(message);
4444
}
4545

4646
//--------------------------------------------------------------
47-
int ofxOscBundle::getBundleCount() const{
47+
std::size_t ofxOscBundle::getBundleCount() const {
4848
return bundles.size();
4949
}
5050

5151
//--------------------------------------------------------------
52-
int ofxOscBundle::getMessageCount() const{
52+
std::size_t ofxOscBundle::getMessageCount() const {
5353
return messages.size();
5454
}
5555

5656
//--------------------------------------------------------------
57-
const ofxOscBundle& ofxOscBundle::getBundleAt(std::size_t i) const{
57+
const ofxOscBundle & ofxOscBundle::getBundleAt(std::size_t i) const {
5858
return bundles[i];
5959
}
6060

6161
//--------------------------------------------------------------
62-
ofxOscBundle& ofxOscBundle::getBundleAt(std::size_t i){
62+
ofxOscBundle & ofxOscBundle::getBundleAt(std::size_t i) {
6363
return bundles[i];
6464
}
6565

6666
//--------------------------------------------------------------
67-
const ofxOscMessage& ofxOscBundle::getMessageAt(std::size_t i) const{
67+
const ofxOscMessage & ofxOscBundle::getMessageAt(std::size_t i) const {
6868
return messages[i];
6969
}
7070

7171
//--------------------------------------------------------------
72-
ofxOscMessage& ofxOscBundle::getMessageAt(std::size_t i){
72+
ofxOscMessage & ofxOscBundle::getMessageAt(std::size_t i) {
7373
return messages[i];
7474
}
7575

7676
// friend functions
7777
//--------------------------------------------------------------
78-
std::ostream& operator<<(std::ostream &os, const ofxOscBundle &bundle) {
78+
std::ostream & operator<<(std::ostream & os, const ofxOscBundle & bundle) {
7979
os << bundle.getMessageCount() << " message(s) "
8080
<< bundle.getBundleCount() << " bundle(s)";
8181
return os;

addons/ofxOsc/src/ofxOscBundle.h

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,51 @@
1-
// copyright (c) openFrameworks team 2010-2017
1+
// copyright (c) openFrameworks team 2010-2023
22
// copyright (c) Damian Stewart 2007-2009
33
#pragma once
44

55
#include "ofxOscMessage.h"
66

77
/// \class ofxOscBundle
88
/// \brief an OSC bundle of ofxOscMessages and/or other ofxOscBundles
9-
class ofxOscBundle{
9+
class ofxOscBundle {
1010
public:
11-
12-
ofxOscBundle() {}
13-
ofxOscBundle(const ofxOscBundle& other);
14-
ofxOscBundle& operator=(const ofxOscBundle &other);
11+
ofxOscBundle() { }
12+
ofxOscBundle(const ofxOscBundle & other);
13+
ofxOscBundle & operator=(const ofxOscBundle & other);
1514
/// for operator= and copy constructor
16-
ofxOscBundle& copy(const ofxOscBundle &other);
15+
ofxOscBundle & copy(const ofxOscBundle & other);
1716

1817
/// clear bundle & message contents
1918
void clear();
2019

2120
/// add another bundle to the bundle
22-
void addBundle(const ofxOscBundle &element);
21+
void addBundle(const ofxOscBundle & element);
2322

2423
/// add a message to the bundle
25-
void addMessage(const ofxOscMessage &message);
24+
void addMessage(const ofxOscMessage & message);
2625

2726
/// \return the current bundle count
28-
int getBundleCount() const;
27+
std::size_t getBundleCount() const;
2928

3029
/// \return the current message count
31-
int getMessageCount() const;
30+
std::size_t getMessageCount() const;
3231

3332
/// \return the bundle at the given index
34-
const ofxOscBundle& getBundleAt(std::size_t i) const;
33+
const ofxOscBundle & getBundleAt(std::size_t i) const;
3534

3635
/// \return the bundle at the given index
37-
ofxOscBundle& getBundleAt(std::size_t i);
36+
ofxOscBundle & getBundleAt(std::size_t i);
3837

3938
/// \return the message at the given index
40-
const ofxOscMessage& getMessageAt(std::size_t i) const;
39+
const ofxOscMessage & getMessageAt(std::size_t i) const;
4140

4241
/// \return the message at the given index
43-
ofxOscMessage& getMessageAt(std::size_t i);
42+
ofxOscMessage & getMessageAt(std::size_t i);
4443

4544
/// output stream operator for string conversion and printing
4645
/// \return number of messages & bundles
47-
friend std::ostream& operator<<(std::ostream &os, const ofxOscBundle &sender);
46+
friend std::ostream & operator<<(std::ostream & os, const ofxOscBundle & sender);
4847

4948
private:
50-
5149
std::vector<ofxOscMessage> messages; ///< bundled messages
5250
std::vector<ofxOscBundle> bundles; ///< bundled bundles
5351
};

0 commit comments

Comments
 (0)