diff options
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 { | |||
| 37 | ~ThreadQueueList() { | 37 | ~ThreadQueueList() { |
| 38 | for (int i = 0; i < NUM_QUEUES; ++i) | 38 | for (int i = 0; i < NUM_QUEUES; ++i) |
| 39 | { | 39 | { |
| 40 | if (queues[i].data != NULL) | 40 | if (queues[i].data != nullptr) |
| 41 | free(queues[i].data); | 41 | free(queues[i].data); |
| 42 | } | 42 | } |
| 43 | } | 43 | } |
| @@ -46,7 +46,7 @@ struct ThreadQueueList { | |||
| 46 | int contains(const IdType uid) { | 46 | int contains(const IdType uid) { |
| 47 | for (int i = 0; i < NUM_QUEUES; ++i) | 47 | for (int i = 0; i < NUM_QUEUES; ++i) |
| 48 | { | 48 | { |
| 49 | if (queues[i].data == NULL) | 49 | if (queues[i].data == nullptr) |
| 50 | continue; | 50 | continue; |
| 51 | 51 | ||
| 52 | Queue *cur = &queues[i]; | 52 | Queue *cur = &queues[i]; |
| @@ -133,7 +133,7 @@ struct ThreadQueueList { | |||
| 133 | inline void clear() { | 133 | inline void clear() { |
| 134 | for (int i = 0; i < NUM_QUEUES; ++i) | 134 | for (int i = 0; i < NUM_QUEUES; ++i) |
| 135 | { | 135 | { |
| 136 | if (queues[i].data != NULL) | 136 | if (queues[i].data != nullptr) |
| 137 | free(queues[i].data); | 137 | free(queues[i].data); |
| 138 | } | 138 | } |
| 139 | memset(queues, 0, sizeof(queues)); | 139 | memset(queues, 0, sizeof(queues)); |
| @@ -147,7 +147,7 @@ struct ThreadQueueList { | |||
| 147 | 147 | ||
| 148 | inline void prepare(u32 priority) { | 148 | inline void prepare(u32 priority) { |
| 149 | Queue *cur = &queues[priority]; | 149 | Queue *cur = &queues[priority]; |
| 150 | if (cur->next == NULL) | 150 | if (cur->next == nullptr) |
| 151 | link(priority, INITIAL_CAPACITY); | 151 | link(priority, INITIAL_CAPACITY); |
| 152 | } | 152 | } |
| 153 | 153 | ||
| @@ -176,7 +176,7 @@ private: | |||
| 176 | 176 | ||
| 177 | for (int i = (int) priority - 1; i >= 0; --i) | 177 | for (int i = (int) priority - 1; i >= 0; --i) |
| 178 | { | 178 | { |
| 179 | if (queues[i].next != NULL) | 179 | if (queues[i].next != nullptr) |
| 180 | { | 180 | { |
| 181 | cur->next = queues[i].next; | 181 | cur->next = queues[i].next; |
| 182 | queues[i].next = cur; | 182 | queues[i].next = cur; |
| @@ -193,7 +193,7 @@ private: | |||
| 193 | int size = cur->end - cur->first; | 193 | int size = cur->end - cur->first; |
| 194 | if (size >= cur->capacity - 2) { | 194 | if (size >= cur->capacity - 2) { |
| 195 | IdType *new_data = (IdType *)realloc(cur->data, cur->capacity * 2 * sizeof(IdType)); | 195 | IdType *new_data = (IdType *)realloc(cur->data, cur->capacity * 2 * sizeof(IdType)); |
| 196 | if (new_data != NULL) { | 196 | if (new_data != nullptr) { |
| 197 | cur->capacity *= 2; | 197 | cur->capacity *= 2; |
| 198 | cur->data = new_data; | 198 | cur->data = new_data; |
| 199 | } | 199 | } |