diff options
author | alberth <alberth@openttd.org> | 2010-07-24 10:14:39 +0000 |
---|---|---|
committer | alberth <alberth@openttd.org> | 2010-07-24 10:14:39 +0000 |
commit | be6c0584240caf420b2475a0be036391e842e8af (patch) | |
tree | 6111751cf5526e1eb41176782d84766c4e9ed185 /src/misc | |
parent | 645b6ce77345867fa96861843197481131566c46 (diff) | |
download | openttd-be6c0584240caf420b2475a0be036391e842e8af.tar.xz |
(svn r20211) -Codechange: Indented code should have curly braces around it.
Diffstat (limited to 'src/misc')
-rw-r--r-- | src/misc/binaryheap.hpp | 3 | ||||
-rw-r--r-- | src/misc/blob.hpp | 6 | ||||
-rw-r--r-- | src/misc/crc32.hpp | 3 |
3 files changed, 8 insertions, 4 deletions
diff --git a/src/misc/binaryheap.hpp b/src/misc/binaryheap.hpp index 65c026ac0..944032cac 100644 --- a/src/misc/binaryheap.hpp +++ b/src/misc/binaryheap.hpp @@ -87,8 +87,9 @@ protected: /* while children are valid */ while (child <= this->items) { /* choose the smaller child */ - if (child < this->items && *this->data[child + 1] < *this->data[child]) + if (child < this->items && *this->data[child + 1] < *this->data[child]) { child++; + } /* is it smaller than our parent? */ if (!(*this->data[child] < *item)) { /* the smaller child is still bigger or same as parent => we are done */ diff --git a/src/misc/blob.hpp b/src/misc/blob.hpp index ed75ca5ab..d77a1b9d8 100644 --- a/src/misc/blob.hpp +++ b/src/misc/blob.hpp @@ -263,12 +263,14 @@ public: tmp->capacity = new_size - (header_size + tail_reserve); /* copy existing data */ - if (tmp->items != 0) + if (tmp->items != 0) { memcpy(tmp + 1, data, tmp->items); + } /* replace our block with new one */ - if (Capacity() > 0) + if (Capacity() > 0) { RawFree(&Hdr()); + } Init(tmp); } diff --git a/src/misc/crc32.hpp b/src/misc/crc32.hpp index af7eac4c4..a4b0eefc4 100644 --- a/src/misc/crc32.hpp +++ b/src/misc/crc32.hpp @@ -22,8 +22,9 @@ struct CCrc32 uint8 *begin = (uint8*)pBuffer; uint8 *end = begin + nCount; - for (uint8 *cur = begin; cur < end; cur++) + for (uint8 *cur = begin; cur < end; cur++) { crc = (crc >> 8) ^ pTable[cur[0] ^ (uint8)(crc & 0xff)]; + } crc ^= 0xffffffff; return crc; |