Skip to content

Commit

Permalink
fix converting values for OSC datagram #1
Browse files Browse the repository at this point in the history
  • Loading branch information
donarturo11 committed Dec 30, 2024
1 parent 535269a commit 7567bfd
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/OSCSender/OSCMessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ class OSCMessage

private:
void align() {
int space = 4 - _data.size()%4;
for (int i=0; i<space; i++) {
_data.append((char) 0x0);
}
size_t space = 4 - _data.size()%4;
_data.append(space, (const char) 0x0);
}
void append(std::string s) {
_data += s;
void append(std::string &s) {
_data.append(s);
align();
}
void append(uint32_t val) {
Expand All @@ -31,7 +29,7 @@ class OSCMessage
(char)((val >> 8) & 0xFF),
(char)((val) & 0xFF)
};
_data.append(d);
_data.append(d, d+4);
}
protected:
std::string _data;
Expand Down

0 comments on commit 7567bfd

Please sign in to comment.