diff options
author | Olivier Martin <olivier.martin@arm.com> | 2014-10-30 01:05:22 +0000 |
---|---|---|
committer | darylm503 <darylm503@Edk2> | 2014-10-30 01:05:22 +0000 |
commit | 0e565888ee40264bfad5a700e0d62f4824d81c18 (patch) | |
tree | cc2842df141ff68b559f8faaf6182dbb49ed0dc8 /StdLib/LibC/Containers/Queues/Fifo.c | |
parent | b07ae3d6073f9ec69ae4316b0832fc96325c01d4 (diff) | |
download | edk2-platforms-0e565888ee40264bfad5a700e0d62f4824d81c18.tar.xz |
StdLib: Fix GCC warnings/errors caused by variables being set but not used.
Removed variables that had no effect on code behavior.
Fifo.c::FIFO_Dequeue: Replaced instances of "Self->ElementSize" with preexisting variable "SizeOfElement".
IIOutilities.c::IIO_GetInChar: Fixed variable of wrong, but compatible, type and made updating of housekeeping variables dependent upon successful completion of reading from the buffer.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
Reviewed by: Daryl McDaniel <daryl.mcdaniel@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16276 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'StdLib/LibC/Containers/Queues/Fifo.c')
-rw-r--r-- | StdLib/LibC/Containers/Queues/Fifo.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/StdLib/LibC/Containers/Queues/Fifo.c b/StdLib/LibC/Containers/Queues/Fifo.c index 73254d2e56..60def644e9 100644 --- a/StdLib/LibC/Containers/Queues/Fifo.c +++ b/StdLib/LibC/Containers/Queues/Fifo.c @@ -292,17 +292,17 @@ FIFO_Dequeue ( SizeOfElement = Self->ElementSize; // Get size of this FIFO's elements
Count = MIN(Count, Self->Count(Self, AsElements)); // Lesser of requested or actual
- QPtr = (UINTN)Self->Queue + (RDex * Self->ElementSize); // Point to Read location in FIFO
+ QPtr = (UINTN)Self->Queue + (RDex * SizeOfElement); // Point to Read location in FIFO
for(i = 0; i < Count; ++i) { // Iterate Count times...
- (void)CopyMem(pElement, (const void *)QPtr, Self->ElementSize); // Copy element from FIFO to caller's buffer
+ (void)CopyMem(pElement, (const void *)QPtr, SizeOfElement); // Copy element from FIFO to caller's buffer
RDex = (UINT32)ModuloIncrement(RDex, Self->NumElements); // Increment Read Index
if(RDex == 0) { // If the index wrapped
QPtr = (UINTN)Self->Queue; // Point back to beginning of data
}
else { // Otherwise
- QPtr += Self->ElementSize; // Point to the next element in FIFO
+ QPtr += SizeOfElement; // Point to the next element in FIFO
}
- pElement = (char*)pElement + Self->ElementSize; // Point to next element in caller's buffer
+ pElement = (char*)pElement + SizeOfElement; // Point to next element in caller's buffer
} // Iterate: for loop
if(Consume) { // If caller requests data consumption
Self->ReadIndex = RDex; // Set FIFO's Read Index to new Index
|