diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-12-24 01:44:47 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-12-24 01:44:47 +0300 |
commit | 080d5b0432549af7739cab604315f08c41ee26a3 (patch) | |
tree | 1c52c54beb400a0c5eab9ba7fe669fd4ee52f52b /src/gui/fonts | |
parent | 8cf035f1eded9e002d73353fa7087902f092cf1f (diff) | |
download | manaplus-080d5b0432549af7739cab604315f08c41ee26a3.tar.gz manaplus-080d5b0432549af7739cab604315f08c41ee26a3.tar.bz2 manaplus-080d5b0432549af7739cab604315f08c41ee26a3.tar.xz manaplus-080d5b0432549af7739cab604315f08c41ee26a3.zip |
Add restrict keyword in textchunklist.
Diffstat (limited to 'src/gui/fonts')
-rw-r--r-- | src/gui/fonts/textchunklist.cpp | 20 | ||||
-rw-r--r-- | src/gui/fonts/textchunklist.h | 16 |
2 files changed, 18 insertions, 18 deletions
diff --git a/src/gui/fonts/textchunklist.cpp b/src/gui/fonts/textchunklist.cpp index 24b46bea0..9458bf947 100644 --- a/src/gui/fonts/textchunklist.cpp +++ b/src/gui/fonts/textchunklist.cpp @@ -35,7 +35,7 @@ TextChunkList::TextChunkList() : void TextChunkList::insertFirst(TextChunk *const item) { - TextChunk *const oldFirst = start; + TextChunk *restrict const oldFirst = start; if (start) start->prev = item; item->prev = nullptr; @@ -54,15 +54,15 @@ void TextChunkList::moveToFirst(TextChunk *const item) if (item == start) return; - TextChunk *const oldPrev = item->prev; + TextChunk *restrict const oldPrev = item->prev; if (oldPrev) oldPrev->next = item->next; - TextChunk *const oldNext = item->next; + TextChunk *restrict const oldNext = item->next; if (oldNext) oldNext->prev = item->prev; else end = oldPrev; - TextChunk *const oldFirst = start; + TextChunk *restrict const oldFirst = start; if (start) start->prev = item; item->prev = nullptr; @@ -75,8 +75,8 @@ void TextChunkList::remove(const TextChunk *const item) if (!item) return; - TextChunk *const oldPrev = item->prev; - TextChunk *const oldNext = item->next; + TextChunk *restrict const oldPrev = item->prev; + TextChunk *restrict const oldNext = item->next; if (oldPrev) oldPrev->next = item->next; else @@ -94,7 +94,7 @@ void TextChunkList::remove(const TextChunk *const item) void TextChunkList::removeBack() { - TextChunk *oldEnd = end; + TextChunk *restrict oldEnd = end; if (oldEnd) { end = oldEnd->prev; @@ -112,7 +112,7 @@ void TextChunkList::removeBack() void TextChunkList::removeBack(int n) { - TextChunk *item = end; + TextChunk *restrict item = end; while (n && item) { n --; @@ -140,10 +140,10 @@ void TextChunkList::clear() { search.clear(); searchWidth.clear(); - TextChunk *item = start; + TextChunk *restrict item = start; while (item) { - TextChunk *const item2 = item->next; + TextChunk *restrict const item2 = item->next; delete item; item = item2; } diff --git a/src/gui/fonts/textchunklist.h b/src/gui/fonts/textchunklist.h index f1bfc3fe6..f9cf97b92 100644 --- a/src/gui/fonts/textchunklist.h +++ b/src/gui/fonts/textchunklist.h @@ -36,20 +36,20 @@ class TextChunkList final A_DELETE_COPY(TextChunkList) - void insertFirst(TextChunk *const item) A_NONNULL(2); + void insertFirst(TextChunk *restrict const item) restrict A_NONNULL(2); - void moveToFirst(TextChunk *const item) A_NONNULL(2); + void moveToFirst(TextChunk *restrict const item) restrict A_NONNULL(2); - void remove(const TextChunk *const item); + void remove(const TextChunk *restrict const item) restrict; - void removeBack(); + void removeBack() restrict; - void removeBack(int n); + void removeBack(int n) restrict; - void clear(); + void clear() restrict; - TextChunk *start; - TextChunk *end; + TextChunk *restrict start; + TextChunk *restrict end; uint32_t size; std::map<TextChunkSmall, TextChunk*> search; std::map<std::string, TextChunk*> searchWidth; |