Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add -Wall compiler flag #375

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion heimdall/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ find_package(libusb REQUIRED)
set(LIBPIT_INCLUDE_DIRS
../libpit/source)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -Wall")

if(MINGW)
set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++ -static")
Expand Down
12 changes: 6 additions & 6 deletions heimdall/source/BridgeManager.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/* Copyright (c) 2010-2014 Benjamin Dobell, Glass Echidna

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand Down Expand Up @@ -483,7 +483,7 @@ int BridgeManager::Initialise(bool resume)
libusb_set_debug(libusbContext, LIBUSB_LOG_LEVEL_DEBUG);
break;
}

result = FindDeviceInterface();

if (result != BridgeManager::kInitialiseSucceeded)
Expand Down Expand Up @@ -737,7 +737,7 @@ bool BridgeManager::ReceivePacket(InboundPacket *packet, int timeout, int emptyT
if (receivedSize < 0)
return (false);

if (receivedSize != packet->GetSize() && !packet->IsSizeVariable())
if (static_cast<unsigned int>(receivedSize) != packet->GetSize() && !packet->IsSizeVariable())
{
if (verbose)
Interface::PrintError("Incorrect packet size received - expected size = %d, received size = %d.\n", packet->GetSize(), receivedSize);
Expand Down Expand Up @@ -937,7 +937,7 @@ int BridgeManager::ReceivePitFile(unsigned char **pitBuffer) const
}

int receiveEmptyTransferFlags = (i == transferCount - 1) ? kEmptyTransferAfter : kEmptyTransferNone;

ReceiveFilePartPacket *receiveFilePartPacket = new ReceiveFilePartPacket();
success = ReceivePacket(receiveFilePartPacket, kDefaultTimeoutReceive, receiveEmptyTransferFlags);

Expand Down
12 changes: 6 additions & 6 deletions heimdall/source/DownloadPitAction.cpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/* Copyright (c) 2010-2014 Benjamin Dobell, Glass Echidna

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand Down Expand Up @@ -72,7 +72,7 @@ int DownloadPitAction::Execute(int argc, char **argv)
bool reboot = arguments.GetArgument("no-reboot") == nullptr;
bool resume = arguments.GetArgument("resume") != nullptr;
bool verbose = arguments.GetArgument("verbose") != nullptr;

if (arguments.GetArgument("stdout-errors") != nullptr)
Interface::SetStdoutErrors(true);

Expand Down Expand Up @@ -148,7 +148,7 @@ int DownloadPitAction::Execute(int argc, char **argv)

if (fileSize > 0)
{
if (fwrite(pitBuffer, 1, fileSize, outputPitFile) != fileSize)
if (fwrite(pitBuffer, 1, fileSize, outputPitFile) != static_cast<size_t>(fileSize))
{
Interface::PrintError("Failed to write PIT data to output file.\n");
success = false;
Expand All @@ -163,7 +163,7 @@ int DownloadPitAction::Execute(int argc, char **argv)
success = false;

delete bridgeManager;

FileClose(outputPitFile);
delete [] pitBuffer;

Expand Down
8 changes: 4 additions & 4 deletions heimdall/source/Packet.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/* Copyright (c) 2010-2014 Benjamin Dobell, Glass Echidna

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
Expand Down Expand Up @@ -45,7 +45,7 @@ namespace Heimdall
memset(data, 0, size);
}

~Packet()
virtual ~Packet()
{
delete [] data;
}
Expand Down