diff options
| author | Spp <spp@jorge.gr> | 2011-09-29 12:43:05 +0200 |
|---|---|---|
| committer | Spp <spp@jorge.gr> | 2011-09-29 12:43:05 +0200 |
| commit | b16d2245bbd374805d15cdca585e8b42bf139605 (patch) | |
| tree | b7b63c567112e1999a2566611363cf5e83adb1be /src/server/shared/Packets/ByteBuffer.h | |
| parent | 8b820baa7324d41df264f48e344d62584bff70f8 (diff) | |
Cosmetic: Multiple cosmetic changes
- Added missing space to 'if', 'for', 'while' and 'switch' when it's followed by '('
- Added missing space after a comma and remove space before comma (with some exceptions)
- Remove trailing spaces
- Convert tab to spaces
Note: Only affects files with extension "cpp" and "h" under /src/server
Diffstat (limited to 'src/server/shared/Packets/ByteBuffer.h')
| -rwxr-xr-x | src/server/shared/Packets/ByteBuffer.h | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/server/shared/Packets/ByteBuffer.h b/src/server/shared/Packets/ByteBuffer.h index 4db410d3876..08318aa7a5b 100755 --- a/src/server/shared/Packets/ByteBuffer.h +++ b/src/server/shared/Packets/ByteBuffer.h @@ -270,7 +270,7 @@ class ByteBuffer void read_skip(size_t skip) { - if(_rpos + skip > size()) + if (_rpos + skip > size()) throw ByteBufferException(false, _rpos, skip, size()); _rpos += skip; } @@ -284,7 +284,7 @@ class ByteBuffer template <typename T> T read(size_t pos) const { - if(pos + sizeof(T) > size()) + if (pos + sizeof(T) > size()) throw ByteBufferException(false, pos, sizeof(T), size()); T val = *((T const*)&_storage[pos]); EndianConvert(val); @@ -293,7 +293,7 @@ class ByteBuffer void read(uint8 *dest, size_t len) { - if(_rpos + len > size()) + if (_rpos + len > size()) throw ByteBufferException(false, _rpos, len, size()); memcpy(dest, &_storage[_rpos], len); _rpos += len; @@ -301,7 +301,7 @@ class ByteBuffer void readPackGUID(uint64& guid) { - if(rpos() + 1 > size()) + if (rpos() + 1 > size()) throw ByteBufferException(false, _rpos, 1, size()); guid = 0; @@ -311,9 +311,9 @@ class ByteBuffer for (int i = 0; i < 8; ++i) { - if(guidmark & (uint8(1) << i)) + if (guidmark & (uint8(1) << i)) { - if(rpos() + 1 > size()) + if (rpos() + 1 > size()) throw ByteBufferException(false, _rpos, 1, size()); uint8 bit; @@ -371,7 +371,7 @@ class ByteBuffer void append(const ByteBuffer& buffer) { - if(buffer.wpos()) + if (buffer.wpos()) append(buffer.contents(), buffer.wpos()); } @@ -390,9 +390,9 @@ class ByteBuffer uint8 packGUID[8+1]; packGUID[0] = 0; size_t size = 1; - for(uint8 i = 0;guid != 0;++i) + for (uint8 i = 0;guid != 0;++i) { - if(guid & 0xFF) + if (guid & 0xFF) { packGUID[0] |= uint8(1 << i); packGUID[size] = uint8(guid & 0xFF); @@ -406,14 +406,14 @@ class ByteBuffer void put(size_t pos, const uint8 *src, size_t cnt) { - if(pos + cnt > size()) + if (pos + cnt > size()) throw ByteBufferException(true, pos, cnt, size()); memcpy(&_storage[pos], src, cnt); } void print_storage() const { - if(!sLog->IsOutDebug()) // optimize disabled debug output + if (!sLog->IsOutDebug()) // optimize disabled debug output return; sLog->outDebug(LOG_FILTER_NETWORKIO, "STORAGE_SIZE: %lu", (unsigned long)size() ); @@ -424,7 +424,7 @@ class ByteBuffer void textlike() const { - if(!sLog->IsOutDebug()) // optimize disabled debug output + if (!sLog->IsOutDebug()) // optimize disabled debug output return; sLog->outDebug(LOG_FILTER_NETWORKIO, "STORAGE_SIZE: %lu", (unsigned long)size() ); @@ -435,7 +435,7 @@ class ByteBuffer void hexlike() const { - if(!sLog->IsOutDebug()) // optimize disabled debug output + if (!sLog->IsOutDebug()) // optimize disabled debug output return; uint32 j = 1, k = 1; @@ -510,7 +510,7 @@ inline ByteBuffer &operator>>(ByteBuffer &b, std::vector<T> &v) uint32 vsize; b >> vsize; v.clear(); - while(vsize--) + while (vsize--) { T t; b >> t; @@ -536,7 +536,7 @@ inline ByteBuffer &operator>>(ByteBuffer &b, std::list<T> &v) uint32 vsize; b >> vsize; v.clear(); - while(vsize--) + while (vsize--) { T t; b >> t; @@ -562,7 +562,7 @@ inline ByteBuffer &operator>>(ByteBuffer &b, std::map<K, V> &m) uint32 msize; b >> msize; m.clear(); - while(msize--) + while (msize--) { K k; V v; |
