overbodinge dingen weg gegooid
This commit is contained in:
@@ -14,11 +14,6 @@ typedef struct FIFO_element_s {
|
||||
void* nextElement;
|
||||
} FIFO_element_t;
|
||||
|
||||
// shared variables within this file
|
||||
static FIFO_element_t* FIFO_FirstElement_p = NULL;
|
||||
static FIFO_element_t* FIFO_LastElement_p = NULL;
|
||||
static unsigned int FIFO_count = 0;
|
||||
bool FIFO_Full = false;
|
||||
|
||||
bool FIFOBuffChar_put(FIFOBuffChar_t *fifo, char i) // Change the function parameters to match the declaration
|
||||
{
|
||||
@@ -165,23 +160,12 @@ FIFOBuffChar_t* FIFOBuffChar_create(void)
|
||||
}
|
||||
|
||||
// Initialize the FIFO buffer
|
||||
fifo->FirstEl_p = malloc(sizeof(struct FIFOBuffChar_element_s));
|
||||
|
||||
if (fifo->FirstEl_p == NULL) {
|
||||
// Memory allocation failed
|
||||
free(fifo);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Initialize the first element
|
||||
fifo->FirstEl_p->value = 0; // "value" of "char"
|
||||
fifo->FirstEl_p->nextEl = NULL;
|
||||
|
||||
// Point the last element to the first one
|
||||
fifo->LastEl_p = fifo->FirstEl_p;
|
||||
|
||||
// Initialize other fields of the FIFOBuffChar_t struct
|
||||
fifo->size = 1;
|
||||
|
||||
fifo->FirstEl_p = NULL;
|
||||
fifo->LastEl_p = NULL;
|
||||
fifo->size = 0;
|
||||
fifo->full = false;
|
||||
|
||||
return fifo;
|
||||
@@ -208,12 +192,6 @@ bool FIFOBuffChar_delete(FIFOBuffChar_t *fifo)
|
||||
currentElement = nextElement;
|
||||
}
|
||||
|
||||
// Reset the FIFO buffer
|
||||
FIFO_FirstElement_p = NULL;
|
||||
FIFO_LastElement_p = NULL;
|
||||
FIFO_count = 0;
|
||||
FIFO_Full = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user