diff options
Diffstat (limited to 'common/commands.cpp')
-rw-r--r-- | common/commands.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/common/commands.cpp b/common/commands.cpp index 5d38afa..91657b8 100644 --- a/common/commands.cpp +++ b/common/commands.cpp | |||
@@ -22,15 +22,13 @@ | |||
22 | 22 | ||
23 | #include <QIODevice> | 23 | #include <QIODevice> |
24 | 24 | ||
25 | namespace Sink | 25 | namespace Sink { |
26 | { | ||
27 | 26 | ||
28 | namespace Commands | 27 | namespace Commands { |
29 | { | ||
30 | 28 | ||
31 | QByteArray name(int commandId) | 29 | QByteArray name(int commandId) |
32 | { | 30 | { |
33 | switch(commandId) { | 31 | switch (commandId) { |
34 | case UnknownCommand: | 32 | case UnknownCommand: |
35 | return "Unknown"; | 33 | return "Unknown"; |
36 | case CommandCompletionCommand: | 34 | case CommandCompletionCommand: |
@@ -85,9 +83,9 @@ void write(QIODevice *device, int messageId, int commandId, const char *buffer, | |||
85 | size = 0; | 83 | size = 0; |
86 | } | 84 | } |
87 | 85 | ||
88 | device->write((const char*)&messageId, sizeof(int)); | 86 | device->write((const char *)&messageId, sizeof(int)); |
89 | device->write((const char*)&commandId, sizeof(int)); | 87 | device->write((const char *)&commandId, sizeof(int)); |
90 | device->write((const char*)&size, sizeof(uint)); | 88 | device->write((const char *)&size, sizeof(uint)); |
91 | if (buffer) { | 89 | if (buffer) { |
92 | device->write(buffer, size); | 90 | device->write(buffer, size); |
93 | } | 91 | } |
@@ -96,10 +94,10 @@ void write(QIODevice *device, int messageId, int commandId, const char *buffer, | |||
96 | void write(QIODevice *device, int messageId, int commandId, flatbuffers::FlatBufferBuilder &fbb) | 94 | void write(QIODevice *device, int messageId, int commandId, flatbuffers::FlatBufferBuilder &fbb) |
97 | { | 95 | { |
98 | const int dataSize = fbb.GetSize(); | 96 | const int dataSize = fbb.GetSize(); |
99 | device->write((const char*)&messageId, sizeof(int)); | 97 | device->write((const char *)&messageId, sizeof(int)); |
100 | device->write((const char*)&commandId, sizeof(int)); | 98 | device->write((const char *)&commandId, sizeof(int)); |
101 | device->write((const char*)&dataSize, sizeof(int)); | 99 | device->write((const char *)&dataSize, sizeof(int)); |
102 | device->write((const char*)fbb.GetBufferPointer(), dataSize); | 100 | device->write((const char *)fbb.GetBufferPointer(), dataSize); |
103 | } | 101 | } |
104 | 102 | ||
105 | } // namespace Commands | 103 | } // namespace Commands |