From f1b44906f6bb145e69a9fc75bf33862476995247 Mon Sep 17 00:00:00 2001 From: Ilya Shipitsin Date: Fri, 9 Feb 2018 18:13:13 +0500 Subject: [PATCH] [src/Mayaqua/Memory.c:2014]: (style) The function 'InsertInt64' is never used. [src/Mayaqua/Memory.c:2350]: (style) The function 'PadFifoFront' is never used. [src/Mayaqua/Memory.c:2188]: (style) The function 'PeekFifo' is never used. --- src/Mayaqua/Mayaqua.h | 1 - src/Mayaqua/Memory.c | 50 ------------------------------------------- src/Mayaqua/Memory.h | 3 --- 3 files changed, 54 deletions(-) diff --git a/src/Mayaqua/Mayaqua.h b/src/Mayaqua/Mayaqua.h index 36fdc648..190ad80d 100644 --- a/src/Mayaqua/Mayaqua.h +++ b/src/Mayaqua/Mayaqua.h @@ -501,7 +501,6 @@ if (kernel_status_inited) { \ #define KS_FREEFIFO_COUNT 37 // Number of times the FIFO object is deleted #define KS_READ_FIFO_COUNT 38 // Number of calls ReadFifo #define KS_WRITE_FIFO_COUNT 39 // Number of calls WriteFifo -#define KS_PEEK_FIFO_COUNT 40 // Number of calls PeekFifo // List related #define KS_NEWLIST_COUNT 41 // Number of calls NewList #define KS_FREELIST_COUNT 42 // Number of times the object LIST was deleted diff --git a/src/Mayaqua/Memory.c b/src/Mayaqua/Memory.c index bf89ace9..fca27f36 100644 --- a/src/Mayaqua/Memory.c +++ b/src/Mayaqua/Memory.c @@ -2011,16 +2011,6 @@ void InsertInt(LIST *o, UINT i) Insert(o, Clone(&i, sizeof(UINT))); } -void InsertInt64(LIST *o, UINT64 i) -{ - // Validate arguments - if (o == NULL) - { - return; - } - - Insert(o, Clone(&i, sizeof(UINT64))); -} // Add an integer to the list (no duplicates) void AddIntDistinct(LIST *o, UINT i) @@ -2184,32 +2174,6 @@ LIST *NewListEx2(COMPARE *cmp, bool fast, bool fast_malloc) return o; } -// Peek from the FIFO -UINT PeekFifo(FIFO *f, void *p, UINT size) -{ - UINT read_size; - if (f == NULL || size == 0) - { - return 0; - } - - // KS - KS_INC(KS_PEEK_FIFO_COUNT); - - read_size = MIN(size, f->size); - if (read_size == 0) - { - return 0; - } - - if (p != NULL) - { - Copy(p, (UCHAR *)f->p + f->pos, read_size); - } - - return read_size; -} - // Read all data from FIFO BUF *ReadFifoAll(FIFO *f) { @@ -2346,20 +2310,6 @@ void WriteFifo(FIFO *f, void *p, UINT size) KS_INC(KS_WRITE_FIFO_COUNT); } -// Add a padding before the head of fifo -void PadFifoFront(FIFO *f, UINT size) -{ - // Validate arguments - if (f == NULL || size == 0) - { - return; - } - - f->memsize += size; - - f->p = ReAlloc(f->p, f->memsize); -} - // Get the current pointer of the FIFO UCHAR *GetFifoPointer(FIFO *f) { diff --git a/src/Mayaqua/Memory.h b/src/Mayaqua/Memory.h index d8bef518..27220fbd 100644 --- a/src/Mayaqua/Memory.h +++ b/src/Mayaqua/Memory.h @@ -348,14 +348,12 @@ BUF *ReadRemainBuf(BUF *b); UINT ReadBufRemainSize(BUF *b); bool CompareBuf(BUF *b1, BUF *b2); -UINT PeekFifo(FIFO *f, void *p, UINT size); UINT ReadFifo(FIFO *f, void *p, UINT size); BUF *ReadFifoAll(FIFO *f); void ShrinkFifoMemory(FIFO *f); UCHAR *GetFifoPointer(FIFO *f); UCHAR *FifoPtr(FIFO *f); void WriteFifo(FIFO *f, void *p, UINT size); -void PadFifoFront(FIFO *f, UINT size); UINT FifoSize(FIFO *f); void ReleaseFifo(FIFO *f); void CleanupFifo(FIFO *f); @@ -409,7 +407,6 @@ LIST *NewInt64List(bool sorted); int CompareInt(void *p1, void *p2); int CompareInt64(void *p1, void *p2); void InsertInt(LIST *o, UINT i); -void InsertInt64(LIST *o, UINT64 i); void InsertIntDistinct(LIST *o, UINT i); void *GetNext(QUEUE *q);