diff options
author | Steffen Pankratz <kratz00@gmx.de> | 2016-03-06 13:45:37 +0100 |
---|---|---|
committer | Steffen Pankratz <kratz00@gmx.de> | 2016-03-06 13:45:37 +0100 |
commit | 05d4c747a97124dbf92af9f718fefe475074ce41 (patch) | |
tree | b4744005c1b59b7cff03f8a117e5beec4360ac51 | |
parent | 2bab8d9473cc237f6665a9cfe784942e0a2038e8 (diff) | |
download | external_heimdall-05d4c747a97124dbf92af9f718fefe475074ce41.zip external_heimdall-05d4c747a97124dbf92af9f718fefe475074ce41.tar.gz external_heimdall-05d4c747a97124dbf92af9f718fefe475074ce41.tar.bz2 |
- fixed compiler warning: dead initialization (the values are never read)
In order to not get compiler warnings about 'unused return values'
a void cast is used, which also makes it clear the the returned values
are ignored on purpose
-rw-r--r-- | heimdall/source/PrintPitAction.cpp | 2 | ||||
-rw-r--r-- | heimdall/source/SendFilePartPacket.h | 4 |
2 files changed, 2 insertions, 4 deletions
diff --git a/heimdall/source/PrintPitAction.cpp b/heimdall/source/PrintPitAction.cpp index 12c28d1..7ae8e6b 100644 --- a/heimdall/source/PrintPitAction.cpp +++ b/heimdall/source/PrintPitAction.cpp @@ -139,7 +139,7 @@ int PrintPitAction::Execute(int argc, char **argv) // Load the local pit file into memory. unsigned char *pitFileBuffer = new unsigned char[localPitFileSize]; - size_t dataRead = fread(pitFileBuffer, 1, localPitFileSize, localPitFile); // dataRead is discarded, it's here to remove warnings. + (void)fread(pitFileBuffer, 1, localPitFileSize, localPitFile); FileClose(localPitFile); PitData *pitData = new PitData(); diff --git a/heimdall/source/SendFilePartPacket.h b/heimdall/source/SendFilePartPacket.h index 38e9dbe..561bf58 100644 --- a/heimdall/source/SendFilePartPacket.h +++ b/heimdall/source/SendFilePartPacket.h @@ -46,9 +46,7 @@ namespace Heimdall // min(fileSize, size)
unsigned int bytesToRead = (fileSize < size) ? fileSize - position : size;
-
- // bytesRead is discarded (it's just there to stop GCC warnings)
- unsigned int bytesRead = fread(data, 1, bytesToRead, file);
+ (void)fread(data, 1, bytesToRead, file);
}
SendFilePartPacket(unsigned char *buffer, unsigned int size) : OutboundPacket(size)
|