diff options
author | Rohit Nirmal <rohitnirmal9@gmail.com> | 2014-12-03 19:57:57 +0100 |
---|---|---|
committer | Rohit Nirmal <rohitnirmal9@gmail.com> | 2014-12-03 19:57:57 +0100 |
commit | 8a624239703c046d89ebeaf3ea13c87af75b550f (patch) | |
tree | 19546d2b06c71add6140f322a8aab0c918bbd9ca /src/common/thread_queue_list.h | |
parent | Merge pull request #236 from rohit-n/sign-compare (diff) | |
download | yuzu-8a624239703c046d89ebeaf3ea13c87af75b550f.tar yuzu-8a624239703c046d89ebeaf3ea13c87af75b550f.tar.gz yuzu-8a624239703c046d89ebeaf3ea13c87af75b550f.tar.bz2 yuzu-8a624239703c046d89ebeaf3ea13c87af75b550f.tar.lz yuzu-8a624239703c046d89ebeaf3ea13c87af75b550f.tar.xz yuzu-8a624239703c046d89ebeaf3ea13c87af75b550f.tar.zst yuzu-8a624239703c046d89ebeaf3ea13c87af75b550f.zip |
Diffstat (limited to 'src/common/thread_queue_list.h')
-rw-r--r-- | src/common/thread_queue_list.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/common/thread_queue_list.h b/src/common/thread_queue_list.h index 59efbce4c..7e3b620c7 100644 --- a/src/common/thread_queue_list.h +++ b/src/common/thread_queue_list.h @@ -37,7 +37,7 @@ struct ThreadQueueList { ~ThreadQueueList() { for (int i = 0; i < NUM_QUEUES; ++i) { - if (queues[i].data != NULL) + if (queues[i].data != nullptr) free(queues[i].data); } } @@ -46,7 +46,7 @@ struct ThreadQueueList { int contains(const IdType uid) { for (int i = 0; i < NUM_QUEUES; ++i) { - if (queues[i].data == NULL) + if (queues[i].data == nullptr) continue; Queue *cur = &queues[i]; @@ -133,7 +133,7 @@ struct ThreadQueueList { inline void clear() { for (int i = 0; i < NUM_QUEUES; ++i) { - if (queues[i].data != NULL) + if (queues[i].data != nullptr) free(queues[i].data); } memset(queues, 0, sizeof(queues)); @@ -147,7 +147,7 @@ struct ThreadQueueList { inline void prepare(u32 priority) { Queue *cur = &queues[priority]; - if (cur->next == NULL) + if (cur->next == nullptr) link(priority, INITIAL_CAPACITY); } @@ -176,7 +176,7 @@ private: for (int i = (int) priority - 1; i >= 0; --i) { - if (queues[i].next != NULL) + if (queues[i].next != nullptr) { cur->next = queues[i].next; queues[i].next = cur; @@ -193,7 +193,7 @@ private: int size = cur->end - cur->first; if (size >= cur->capacity - 2) { IdType *new_data = (IdType *)realloc(cur->data, cur->capacity * 2 * sizeof(IdType)); - if (new_data != NULL) { + if (new_data != nullptr) { cur->capacity *= 2; cur->data = new_data; } |