diff --git a/lib/ll_queue.c b/lib/ll_queue.c index 35edf8ac..6a12c584 100644 --- a/lib/ll_queue.c +++ b/lib/ll_queue.c @@ -13,10 +13,12 @@ static void check_waiters(struct ll_queue* q); static void add_to_hash(struct ll_queue* q, struct ll_entry* entry); static void remove_from_hash(struct ll_queue* q, struct ll_entry* entry); +#define xxx 1 + // Вспомогательная функция для преобразования данных в запись static inline struct ll_entry* data_to_entry(void* data) { if (!data) return NULL; - return ((struct ll_entry*)data) - 1; + return ((struct ll_entry*)data) - xxx; } // ==================== Управление очередью ==================== @@ -118,7 +120,7 @@ void* queue_data_new(size_t data_size) { DEBUG_DEBUG(DEBUG_CATEGORY_LL_QUEUE, "queue_data_new: created entry %p, size=%zu", entry, data_size); - return (void*)(entry + 1); + return (void*)(entry + xxx); } void* queue_data_new_from_pool(struct memory_pool* pool) { @@ -134,7 +136,7 @@ void* queue_data_new_from_pool(struct memory_pool* pool) { DEBUG_DEBUG(DEBUG_CATEGORY_LL_QUEUE, "queue_data_new_from_pool: created entry %p from pool %p", entry, pool); - return (void*)(entry + 1); + return (void*)(entry + xxx); } void queue_data_free(void* data) { @@ -314,7 +316,7 @@ void* queue_data_get(struct ll_queue* q) { // Проверить ожидающие коллбэки check_waiters(q); - return (void*)(entry + 1); + return (void*)(entry + xxx); } int queue_entry_count(struct ll_queue* q) { @@ -361,7 +363,7 @@ void* queue_find_data_by_id(struct ll_queue* q, uint32_t id) { while (entry) { if (entry->id == id) { - return (void*)(entry + 1); + return (void*)(entry + xxx); } entry = entry->hash_next; }