Skip to content

Commit

Permalink
Remove DebugNew define file
Browse files Browse the repository at this point in the history
- Only works for VS
- Had to be added to every file and at the end
- Visual Leak Detector is much better
  • Loading branch information
Flamefire committed Apr 26, 2016
1 parent 0f5b23c commit cb524d7
Show file tree
Hide file tree
Showing 311 changed files with 58 additions and 1,017 deletions.
5 changes: 1 addition & 4 deletions build_version.cpp
Expand Up @@ -17,10 +17,7 @@

#include <build_version.h>
#include <build_version_defines.h>
#include <cstring>

// Include last!
#include "DebugNew.h" // IWYU pragma: keep
#include <cstring>

const char* GetWindowTitle()
{
Expand Down
3 changes: 0 additions & 3 deletions driver/audio/SDL/src/AudioSDL.cpp
Expand Up @@ -30,9 +30,6 @@
#include <iostream>
#include <fstream>

// Include last!
#include "DebugNew.h" // IWYU pragma: keep

static AudioSDL* nthis = NULL;

/**
Expand Down
5 changes: 1 addition & 4 deletions driver/audio/SDL/src/SoundSDL_Effect.cpp
Expand Up @@ -17,10 +17,7 @@

#include "main.h" // IWYU pragma: keep
#include "SoundSDL_Effect.h"
#include <SDL_mixer.h>

// Include last!
#include "DebugNew.h" // IWYU pragma: keep
#include <SDL_mixer.h>

SoundSDL_Effect::SoundSDL_Effect() : sound(NULL)
{
Expand Down
5 changes: 1 addition & 4 deletions driver/audio/SDL/src/SoundSDL_Music.cpp
Expand Up @@ -16,10 +16,7 @@
// along with Return To The Roots. If not, see <http://www.gnu.org/licenses/>.

#include "main.h" // IWYU pragma: keep
#include "SoundSDL_Music.h"

// Include last!
#include "DebugNew.h" // IWYU pragma: keep
#include "SoundSDL_Music.h"

SoundSDL_Music::SoundSDL_Music() : music(NULL)
{
Expand Down
5 changes: 1 addition & 4 deletions driver/src/AudioDriver.cpp
Expand Up @@ -18,10 +18,7 @@
#include "main.h" // IWYU pragma: keep
#include "AudioDriver.h"
#include "Sound.h"
#include <cstddef>

// Include last!
#include "DebugNew.h" // IWYU pragma: keep
#include <cstddef>
class AudioDriverLoaderInterface;

// Do not inline! That would break DLL compatibility: http://stackoverflow.com/questions/32444520/how-to-handle-destructors-in-dll-exported-interfaces
Expand Down
21 changes: 0 additions & 21 deletions driver/src/DebugNew.h

This file was deleted.

5 changes: 1 addition & 4 deletions driver/src/DriverInterface.cpp
Expand Up @@ -16,10 +16,7 @@
// along with Return To The Roots. If not, see <http://www.gnu.org/licenses/>.

#include "main.h" // IWYU pragma: keep
#include "DriverInterfaceVersion.h"

// Include last!
#include "DebugNew.h" // IWYU pragma: keep
#include "DriverInterfaceVersion.h"

#ifdef _WIN32
# define DRIVERDLLAPI extern "C" __declspec(dllexport)
Expand Down
5 changes: 1 addition & 4 deletions driver/src/Sound.cpp
Expand Up @@ -16,10 +16,7 @@
// along with Return To The Roots. If not, see <http://www.gnu.org/licenses/>.

#include "main.h" // IWYU pragma: keep
#include "Sound.h"

// Include last!
#include "DebugNew.h" // IWYU pragma: keep
#include "Sound.h"

/** @class Sound
*
Expand Down
5 changes: 1 addition & 4 deletions driver/src/VideoDriver.cpp
Expand Up @@ -17,10 +17,7 @@

#include "main.h" // IWYU pragma: keep
#include "VideoDriver.h"
#include <algorithm>

// Include last!
#include "DebugNew.h" // IWYU pragma: keep
#include <algorithm>

// Do not inline! That would break DLL compatibility: http://stackoverflow.com/questions/32444520/how-to-handle-destructors-in-dll-exported-interfaces
IVideoDriver::~IVideoDriver(){}
Expand Down
3 changes: 0 additions & 3 deletions driver/video/GLFW/src/GLFW.cpp
Expand Up @@ -22,9 +22,6 @@
#include <VideoInterface.h>
#include <build_version.h>

// Include last!
#include "DebugNew.h" // IWYU pragma: keep

///////////////////////////////////////////////////////////////////////////////
/**
* Instanzierungsfunktion von @p VideoGLFW.
Expand Down
3 changes: 0 additions & 3 deletions driver/video/GLFW/src/oem.cpp
Expand Up @@ -20,9 +20,6 @@
#include "main.h" // IWYU pragma: keep
#include "oem.h"

// Include last!
#include "DebugNew.h" // IWYU pragma: keep

#ifndef _WIN32

///////////////////////////////////////////////////////////////////////////////
Expand Down
3 changes: 0 additions & 3 deletions driver/video/SDL/src/VideoSDL.cpp
Expand Up @@ -33,9 +33,6 @@
#include <SDL_syswm.h>
#endif // _WIN32

// Include last!
#include "DebugNew.h" // IWYU pragma: keep

/**
* Instanzierungsfunktion von @p VideoSDL.
*
Expand Down
5 changes: 1 addition & 4 deletions driver/video/WinAPI/src/WinAPI.cpp
Expand Up @@ -25,10 +25,7 @@
#include <GL/gl.h>
#include <cstdlib>
#include <cstring>
#include <sstream>

// Include last!
#include "DebugNew.h" // IWYU pragma: keep
#include <sstream>

/**
* Zeiger auf die aktuelle Instanz.
Expand Down
2 changes: 1 addition & 1 deletion libsiedler2
Submodule libsiedler2 updated 51 files
+1 −4 src/ArchivInfo.cpp
+1 −4 src/ArchivItem.cpp
+1 −4 src/ArchivItem_Bitmap.cpp
+0 −3 src/ArchivItem_BitmapBase.cpp
+1 −4 src/ArchivItem_Bitmap_Player.cpp
+1 −4 src/ArchivItem_Bitmap_RLE.cpp
+1 −4 src/ArchivItem_Bitmap_Raw.cpp
+1 −4 src/ArchivItem_Bitmap_Shadow.cpp
+1 −4 src/ArchivItem_Bob.cpp
+1 −4 src/ArchivItem_Font.cpp
+1 −4 src/ArchivItem_Ini.cpp
+1 −4 src/ArchivItem_Map.cpp
+1 −4 src/ArchivItem_Map_Header.cpp
+1 −4 src/ArchivItem_Palette.cpp
+1 −4 src/ArchivItem_Raw.cpp
+1 −4 src/ArchivItem_Sound.cpp
+1 −4 src/ArchivItem_Sound_Midi.cpp
+1 −4 src/ArchivItem_Sound_Other.cpp
+1 −4 src/ArchivItem_Sound_Wave.cpp
+1 −4 src/ArchivItem_Sound_XMidi.cpp
+1 −4 src/ArchivItem_Text.cpp
+0 −21 src/DebugNew.h
+1 −4 src/LoadACT.cpp
+1 −4 src/LoadBBM.cpp
+1 −4 src/LoadBMP.cpp
+1 −4 src/LoadBOB.cpp
+1 −4 src/LoadDATIDX.cpp
+1 −4 src/LoadINI.cpp
+1 −4 src/LoadLBM.cpp
+1 −4 src/LoadLST.cpp
+1 −4 src/LoadMAP.cpp
+1 −4 src/LoadSND.cpp
+1 −4 src/LoadTLST.cpp
+1 −4 src/LoadTXT.cpp
+1 −4 src/LoadType.cpp
+1 −4 src/MIDI_Track.cpp
+0 −3 src/StandardAllocator.cpp
+1 −4 src/WriteACT.cpp
+1 −4 src/WriteBBM.cpp
+1 −4 src/WriteBMP.cpp
+1 −4 src/WriteBOB.cpp
+1 −4 src/WriteDATIDX.cpp
+1 −4 src/WriteINI.cpp
+1 −4 src/WriteLBM.cpp
+1 −4 src/WriteLST.cpp
+1 −4 src/WriteMAP.cpp
+1 −4 src/WriteTXT.cpp
+1 −4 src/WriteType.cpp
+1 −4 src/XMIDI_Track.cpp
+1 −4 src/libsiedler2.cpp
+1 −4 src/oem.cpp
2 changes: 1 addition & 1 deletion mygettext
5 changes: 1 addition & 4 deletions src/CatapultStone.cpp
Expand Up @@ -32,10 +32,7 @@
#include "Random.h"
#include "gameData/MapConsts.h"

#include <cmath>

// Include last!
#include "DebugNew.h" // IWYU pragma: keep
#include <cmath>
class noBase;

CatapultStone::CatapultStone(const MapPoint dest_building, const MapPoint dest_map,
Expand Down
5 changes: 1 addition & 4 deletions src/CollisionDetection.cpp
Expand Up @@ -18,10 +18,7 @@
#include "defines.h" // IWYU pragma: keep
#include "CollisionDetection.h"
#include "Rect.h"
#include <cstdlib>

// Include last!
#include "DebugNew.h" // IWYU pragma: keep
#include <cstdlib>

///////////////////////////////////////////////////////////////////////////////

Expand Down
3 changes: 0 additions & 3 deletions src/DataChangedObservable.cpp
Expand Up @@ -19,9 +19,6 @@
#include "DataChangedObservable.h"
#include "IDataChangedListener.h"

// Include last!
#include "DebugNew.h" // IWYU pragma: keep

DataChangedObservable::~DataChangedObservable()
{
NotifyListeners(0);
Expand Down
3 changes: 0 additions & 3 deletions src/Debug.cpp
Expand Up @@ -42,9 +42,6 @@
#include <boost/interprocess/smart_ptr/unique_ptr.hpp>
#include <bzlib.h>

// Include last!
#include "DebugNew.h" // IWYU pragma: keep

#ifdef _WIN32

typedef USHORT (WINAPI* CaptureStackBackTraceType)(ULONG, ULONG, PVOID*, PULONG);
Expand Down
21 changes: 0 additions & 21 deletions src/DebugNew.h

This file was deleted.

5 changes: 1 addition & 4 deletions src/EventManager.cpp
Expand Up @@ -22,10 +22,7 @@
#include "SerializedGameData.h"
#include "helpers/containerUtils.h"
#include "helpers/mapTraits.h"
#include "Log.h"

// Include last!
#include "DebugNew.h" // IWYU pragma: keep
#include "Log.h"

EventManager::~EventManager()
{
Expand Down
5 changes: 1 addition & 4 deletions src/ExtensionList.cpp
Expand Up @@ -16,10 +16,7 @@
// along with Return To The Roots. If not, see <http://www.gnu.org/licenses/>.

#include "defines.h" // IWYU pragma: keep
#include "ExtensionList.h"

// Include last!
#include "DebugNew.h" // IWYU pragma: keep
#include "ExtensionList.h"

// WGL_EXT_swap_control
PFNWGLSWAPINTERVALFARPROC wglSwapIntervalEXT = NULL;
Expand Down
5 changes: 1 addition & 4 deletions src/FOWObjects.cpp
Expand Up @@ -22,10 +22,7 @@
#include "gameData/BuildingConsts.h"
#include "ogl/glArchivItem_Bitmap.h"
#include "Loader.h"
#include "libutil/src/colors.h"

// Include last!
#include "DebugNew.h" // IWYU pragma: keep
#include "libutil/src/colors.h"

/// Berechnet die dunklere Spielerfarbe zum Zeichnen
unsigned CalcPlayerFOWDrawColor(const unsigned color)
Expand Down
5 changes: 1 addition & 4 deletions src/FileChecksum.cpp
Expand Up @@ -17,10 +17,7 @@

#include "defines.h" // IWYU pragma: keep
#include "FileChecksum.h"
#include <cstdio>

// Include last!
#include "DebugNew.h" // IWYU pragma: keep
#include <cstdio>

unsigned int CalcChecksumOfFile(const char* const path)
{
Expand Down
3 changes: 0 additions & 3 deletions src/FindWhConditions.cpp
Expand Up @@ -20,9 +20,6 @@
#include "buildings/nobBaseWarehouse.h"
#include "gameData/ShieldConsts.h"

// Include last!
#include "DebugNew.h" // IWYU pragma: keep

namespace FW
{

Expand Down
3 changes: 0 additions & 3 deletions src/FramesInfo.cpp
Expand Up @@ -19,9 +19,6 @@
#include "FramesInfo.h"
#include "helpers/mathFuncs.h"

// Include last!
#include "DebugNew.h" // IWYU pragma: keep

FramesInfo::FramesInfo()
{
Clear();
Expand Down
3 changes: 0 additions & 3 deletions src/GameClient.cpp
Expand Up @@ -59,9 +59,6 @@
#include <iostream>
#include <fstream>

// Include last!
#include "DebugNew.h" // IWYU pragma: keep

void GameClient::ClientConfig::Clear()
{
server.clear();
Expand Down
5 changes: 1 addition & 4 deletions src/GameClientCommands.cpp
Expand Up @@ -21,10 +21,7 @@
#include "GameClientPlayer.h"

#include "ClientInterface.h"
#include "GameMessages.h"

// Include last!
#include "DebugNew.h" // IWYU pragma: keep
#include "GameMessages.h"

/**
* Chatbefehl, hängt eine Textnachricht in die Sende-Queue.
Expand Down
5 changes: 1 addition & 4 deletions src/GameClientGF_Game.cpp
Expand Up @@ -18,10 +18,7 @@
#include "defines.h" // IWYU pragma: keep
#include "GameClient.h"
#include "Random.h"
#include "libutil/src/Log.h"

// Include last!
#include "DebugNew.h" // IWYU pragma: keep
#include "libutil/src/Log.h"

void GameClient::ExecuteNWF()
{
Expand Down
5 changes: 1 addition & 4 deletions src/GameClientGF_Replay.cpp
Expand Up @@ -22,10 +22,7 @@
#include "Random.h"
#include "GameManager.h"
#include "ClientInterface.h"
#include "libutil/src/Log.h"

// Include last!
#include "DebugNew.h" // IWYU pragma: keep
#include "libutil/src/Log.h"

void GameClient::ExecuteGameFrame_Replay()
{
Expand Down
5 changes: 1 addition & 4 deletions src/GameClientPlayer.cpp
Expand Up @@ -49,10 +49,7 @@
#include "TradePathCache.h"
#include "libutil/src/Log.h"
#include <stdint.h>
#include <limits>

// Include last!
#include "DebugNew.h" // IWYU pragma: keep
#include <limits>

// Standardbelegung der Transportreihenfolge festlegen
const boost::array<unsigned char, WARE_TYPES_COUNT> STD_TRANSPORT =
Expand Down
3 changes: 0 additions & 3 deletions src/GameCommand.cpp
Expand Up @@ -22,9 +22,6 @@

#include <stdexcept>

// Include last!
#include "DebugNew.h" // IWYU pragma: keep

namespace gc{

GameCommand* GameCommand::Deserialize(const Type gst, Serializer& ser)
Expand Down
5 changes: 1 addition & 4 deletions src/GameCommands.cpp
Expand Up @@ -24,10 +24,7 @@
#include "buildings/nobHarborBuilding.h"
#include "nodeObjs/noShip.h"
#include "world/GameWorldGame.h"
#include <iostream>

// Include last!
#include "DebugNew.h" // IWYU pragma: keep
#include <iostream>

namespace gc{

Expand Down
3 changes: 0 additions & 3 deletions src/GameEvent.cpp
Expand Up @@ -19,9 +19,6 @@
#include "GameEvent.h"
#include "SerializedGameData.h"

// Include last!
#include "DebugNew.h" // IWYU pragma: keep

GameEvent::GameEvent(SerializedGameData& sgd, const unsigned obj_id):
GameObject(sgd, obj_id),
obj(sgd.PopObject<GameObject>(GOT_UNKNOWN)),
Expand Down

0 comments on commit cb524d7

Please sign in to comment.