From 78465cfac8b0b6b27409285ac1894152a7ce335c Mon Sep 17 00:00:00 2001 From: Artem Prilutskiy Date: Sat, 6 Aug 2016 19:48:13 +0300 Subject: [PATCH] .. --- RingBuffer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/RingBuffer.c b/RingBuffer.c index b5c22aa..40aa09c 100644 --- a/RingBuffer.c +++ b/RingBuffer.c @@ -8,7 +8,7 @@ void PokeData(struct RingBuffer* buffer, uint32_t number, uint8_t* data, size_t number %= BUFFER_LENGTH; buffer->delay += buffer->marks == 0; // Postpone processing if buffer empty - buffer->marks |= 1 << number; // Set processing flag for the record + buffer->marks |= 1 << number; // Set processing mark for the record struct BufferRecord* record = buffer->records + number; @@ -31,14 +31,14 @@ void ProcessBuffer(struct RingBuffer* buffer, int handle, struct sockaddr_in* ad return; } - size_t mark = (1 << buffer->index); + size_t mark = 1 << buffer->index; if (buffer->marks & mark) { // Transmit scheduled data struct BufferRecord* record = buffer->records + buffer->index; sendto(handle, record->data, record->length, 0, (struct sockaddr*)address, sizeof(struct sockaddr_in)); - // Clear processing flag + // Clear processing mark buffer->marks ^= mark; }