Warning-squashing

develop
Petr Mrázek 2010-05-02 02:38:18 +02:00
parent bae9939e50
commit 5b57a71ac4
30 changed files with 376 additions and 377 deletions

@ -101,7 +101,7 @@ IF(UNIX)
add_definitions(-DLINUX_BUILD)
add_definitions(-DUSE_CONFIG_H)
find_library(X11_LIBRARY X11)
SET(CMAKE_CXX_FLAGS_DEBUG "-g -Wall -pedantic")
SET(CMAKE_CXX_FLAGS_DEBUG "-g -Wall")
SET(CMAKE_CXX_FLAGS "-fvisibility=hidden")
SET(PROJECT_LIBS ${X11_LIBRARY} rt ) #dfhack-md5 dfhack-tixml

@ -589,3 +589,4 @@ bool API::ReadItemTypes(vector< vector< t_itemType > > & itemTypes)
return true;
}
*/

@ -48,6 +48,7 @@ DFHackObject* API_Alloc(const char* path_to_xml)
return (DFHackObject*)api;
}
//FIXME: X:\dfhack\DFHackAPI_C.cpp:56: warning: deleting `DFHackObject* ' is undefined
void API_Free(DFHackObject* api)
{
if(api != NULL)
@ -61,12 +62,8 @@ int API_Attach(DFHackObject* api)
{
if(api != NULL)
{
if(((DFHack::API*)api)->Attach())
return 1;
else
return 0;
return ((DFHack::API*)api)->Attach();
}
return -1;
}
@ -74,10 +71,7 @@ int API_Detach(DFHackObject* api)
{
if(api != NULL)
{
if(((DFHack::API*)api)->Detach())
return 1;
else
return 0;
return ((DFHack::API*)api)->Detach();
}
return -1;
@ -87,10 +81,7 @@ int API_isAttached(DFHackObject* api)
{
if(api != NULL)
{
if(((DFHack::API*)api)->isAttached())
return 1;
else
return 0;
return ((DFHack::API*)api)->isAttached();
}
return -1;
@ -100,10 +91,7 @@ int API_Suspend(DFHackObject* api)
{
if(api != NULL)
{
if(((DFHack::API*)api)->Suspend())
return 1;
else
return 0;
return ((DFHack::API*)api)->Suspend();
}
return -1;
@ -113,10 +101,7 @@ int API_Resume(DFHackObject* api)
{
if(api != NULL)
{
if(((DFHack::API*)api)->Resume())
return 1;
else
return 0;
return ((DFHack::API*)api)->Resume();
}
return -1;
@ -126,10 +111,7 @@ int API_isSuspended(DFHackObject* api)
{
if(api != NULL)
{
if(((DFHack::API*)api)->isSuspended())
return 1;
else
return 0;
return ((DFHack::API*)api)->isSuspended();
}
return -1;
@ -139,10 +121,7 @@ int API_ForceResume(DFHackObject* api)
{
if(api != NULL)
{
if(((DFHack::API*)api)->ForceResume())
return 1;
else
return 0;
return ((DFHack::API*)api)->ForceResume();
}
return -1;
@ -152,10 +131,7 @@ int API_AsyncSuspend(DFHackObject* api)
{
if(api != NULL)
{
if(((DFHack::API*)api)->AsyncSuspend())
return 1;
else
return 0;
return ((DFHack::API*)api)->AsyncSuspend();
}
return -1;

@ -629,3 +629,4 @@ string memory_info::getLabor (const uint32_t laborIdx)
}
throw Error::MissingMemoryDefinition("labor", laborIdx);
}

@ -96,3 +96,4 @@ using namespace std;
*/
#endif // DFCOMMONINTERNAL_H_INCLUDED

@ -14,6 +14,11 @@ using namespace std;
#include <DFMemInfo.h>
#include <DFVector.h>
/*
* This is a header full of ugly, volatile things.
* Only for use of official DFHack tools!
*/
void DumpObjStr0Vector (const char * name, DFHack::Process *p, uint32_t addr)
{
cout << "----==== " << name << " ====----" << endl;
@ -216,6 +221,5 @@ std::string PrintSplatterType (int16_t mat1, int32_t mat2, vector<DFHack::t_matg
break;
}
}
#endif

@ -32,3 +32,4 @@ namespace DFHack
};
}
#endif

@ -169,3 +169,4 @@ int32_t Buildings::GetCustomWorkshopType(t_building & building)
}
return ret;
}

@ -98,3 +98,4 @@ bool Constructions::Finish()
d->Started = false;
return true;
}

@ -834,3 +834,4 @@ bool Maps::ReadGlobalFeatures( std::vector <t_feature> & features)
}
return true;
}

@ -156,3 +156,4 @@ bool Position::getWindowSize (int32_t &width, int32_t &height)
height = coords[1];
return true;
}

@ -1,6 +1,6 @@
/*
www.sourceforge.net/projects/dfhack
Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf, doomchild
Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf, doomchild
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any

@ -195,3 +195,4 @@ string Translation::TranslateName(const t_name &name, bool inEnglish)
}
return out;
}

@ -96,3 +96,4 @@ bool Vegetation::Finish()
d->Started = false;
return true;
}

@ -99,3 +99,4 @@ namespace DFHack
};
}
#endif

@ -8,7 +8,7 @@ SET(PROJECT_LIBS ${PYTHON_LIBRARIES} dfhack )
IF(UNIX)
add_definitions(-DLINUX_BUILD)
add_definitions(-DUSE_CONFIG_H)
SET(CMAKE_CXX_FLAGS_DEBUG "-g -Wall -pedantic")
SET(CMAKE_CXX_FLAGS_DEBUG "-g -Wall")
SET(PYTHON_MODULE_SUFFIX ".so")
ENDIF(UNIX)
IF(WIN32)

@ -26,7 +26,7 @@ distribution.
#define __DFCREATURES__
#include <string>
#include "Python.h"
#include <Python.h>
#include "stdio.h"
#include <vector>
#include "integers.h"

@ -135,6 +135,8 @@ static void DF_Creature_Base_dealloc(DF_Creature_Base* self)
}
}
#pragma GCC diagnostic ignored "-Wwrite-strings"
static PyMemberDef DF_Creature_Base_members[] =
{
{"origin", T_UINT, offsetof(DF_Creature_Base, origin), 0, ""},

@ -24,6 +24,7 @@ distribution.
#ifndef __DFGUI__
#define __DFGUI__
#pragma GCC diagnostic ignored "-Wwrite-strings"
#include "Python.h"
#include "integers.h"

@ -24,6 +24,7 @@ distribution.
#ifndef __DFMAPS__
#define __DFMAPS__
#pragma GCC diagnostic ignored "-Wwrite-strings"
#include "Python.h"
#include <vector>

@ -24,6 +24,7 @@ distribution.
#ifndef __DF_MEMINFO__
#define __DF_MEMINFO__
#pragma GCC diagnostic ignored "-Wwrite-strings"
#include "Python.h"
#include <string>
@ -31,7 +32,6 @@ distribution.
using namespace std;
#include "Export.h"
//#include "DFCommonInternal.h"
#include "DFMemInfo.h"
using namespace DFHack;

@ -24,6 +24,7 @@ distribution.
#ifndef __DFPOSITION__
#define __DFPOSITION__
#pragma GCC diagnostic ignored "-Wwrite-strings"
#include "Python.h"
#include "integers.h"

@ -24,6 +24,7 @@ distribution.
#ifndef __DFTRANSLATE__
#define __DFTRANSLATE__
#pragma GCC diagnostic ignored "-Wwrite-strings"
#include "Python.h"
#include <vector>

@ -97,3 +97,4 @@ enum CORE_COMMAND
NUM_CORE_CMDS
};
#endif

@ -105,5 +105,5 @@ DFPP_module Init(void);
}
}
}
#endif

@ -112,5 +112,5 @@ DFPP_module Init(void);
}
}
}
#endif

@ -126,14 +126,14 @@ int main ()
if (funct1 == 0xC300000092818B66LL)
quality = p->readWord(p_items[i]+0x92);
else if(funct1 == 0xCCCCCCCCCCC3C033)
else if (funct1 == 0xCCCCCCCCCCC3C033LL)
quality = 0;
else
printf("bad quality function address=%p\n", (void*) func1);
if (funct2 == 0xCCCCCCCCCCC3C032LL)
hasDecorations = false;
else if(funct2 == 0xCCCCCCCCCCC301B0)
else if (funct2 == 0xCCCCCCCCCCC301B0LL)
hasDecorations = true;
else
printf("bad decoration function address=%p\n", (void*) func2);
@ -163,7 +163,7 @@ int main ()
if (funcCt == 0xCCCCCCCCC3FFC883LL)
typeC = -1;
else if( (funcCt&0xFFFFFF0000FFFFFFLL) == 0xC300000000818B66 )
else if ( (funcCt&0xFFFFFF0000FFFFFFLL) == 0xC300000000818B66LL )
{
uint32_t off1 = (funcCt>>24)&0xffff;
typeC = p->readWord(p_items[i] + off1);

@ -66,3 +66,4 @@ int main (void)
#endif
return 0;
}

@ -162,7 +162,7 @@ int puttile(int x, int y, int tiletype, int color)
attroff(COLOR_PAIR(color));
}
int cprintf(char *fmt, ...)
int cprintf(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
@ -440,7 +440,7 @@ void do_features(API& DF, mapblock40d * block, uint32_t blockX, uint32_t blockY,
cprintf("You've discovered it already!");
}
char * matname = "unknown";
char * matname = (char *) "unknown";
// is stone?
if(ftr.main_material == 0)
{
@ -468,7 +468,7 @@ void do_features(API& DF, mapblock40d * block, uint32_t blockX, uint32_t blockY,
gotoxy(printX,printY+ 5);
cprintf("You've discovered it already!");
}
char * matname = "unknown";
char * matname = (char *) "unknown";
// is stone?
if(ftr.main_material == 0)
{