Changed: #825 Remove all warnings when compiling Ryzom

This commit is contained in:
kervala 2010-09-03 22:55:29 +02:00
parent cf8109e469
commit 5fbbb6a1c5
33 changed files with 93 additions and 92 deletions

View file

@ -142,7 +142,7 @@ void CFXManager::update()
while (!_DeferredFXByDate.empty())
{
if (T1 < _DeferredFXByDate.begin()->first) break;
if (T1 < (sint64)_DeferredFXByDate.begin()->first) break;
const CDeferredFX &fx = _DeferredFXByDate.begin()->second;
NL3D::UParticleSystemInstance fxInstance = instantFX(fx.FXName, fx.TimeOut);
if (!fxInstance.empty())

View file

@ -1002,7 +1002,6 @@ void initPatchCheck()
// In previous code, the following was not set in R2Mode, possible bug ?...let as before anyway ...
// store the selected shard for restarting after patch
LoginShardId = Shards[ShardSelected].ShardId;
}
if (!isBGDownloadEnabled())

View file

@ -106,7 +106,7 @@ SZ_RESULT SzDecode(const CFileSize *packSizes, const CFolder *folder,
#endif
if (LzmaDecodeProperties(&state.Properties, coder->Properties.Items,
coder->Properties.Capacity) != LZMA_RESULT_OK)
(SizeT)coder->Properties.Capacity) != LZMA_RESULT_OK)
return SZE_FAIL;
state.Probs = (CProb *)allocMain->Alloc(LzmaGetNumProbs(&state.Properties) * sizeof(CProb));

View file

@ -56,6 +56,8 @@
#include <nel/misc/string_common.h>
#include <nel/misc/sstring.h>
#include <nel/misc/bit_mem_stream.h>
#include <nel/misc/o_xml.h>
#include <nel/misc/i_xml.h>
#include <nel/net/udp_sock.h>
#include <nel/net/unified_network.h>

View file

@ -705,7 +705,7 @@ CGroupNpc* CAIInstance::eventCreateNpcGroup(uint nbBots, NLMISC::CSheetId const&
float angle = 0.f;
if (orientation < (NLMISC::Pi * 2.0) && orientation > (-NLMISC::Pi * 2.0))
angle = orientation;
angle = (float)orientation;
else
angle = randomAngle();

View file

@ -68,7 +68,7 @@ public:
// setup the new lastTime and oldJobsRemaining values
uint32 oldJobsRemaining= CJobManager::getInstance()->getNumJobs();
lastTime= startTime;
lastTime= (uint32)startTime;
// execute daily tasks
NLMISC::CConfigFile::CVar *commandsVar = NLNET::IService::getInstance()->ConfigFile.getVarPtr("DailyCommands");

View file

@ -68,7 +68,7 @@ public:
// setup the new lastTime and oldJobsRemaining values
uint32 oldJobsRemaining= CJobManager::getInstance()->getNumJobs();
lastTime= startTime;
lastTime= (uint32)startTime;
// execute hourly tasks
NLMISC::CConfigFile::CVar *commandsVar = NLNET::IService::getInstance()->ConfigFile.getVarPtr("HourlyCommands");

View file

@ -297,7 +297,7 @@ NLMISC_CATEGORISED_COMMAND(Stats,listCharNames,"display the names of the charact
std::vector<std::string> files;
NLMISC::CPath::getPathContent(STAT_GLOBALS::getInputFilePath().c_str(),false,false,true,files);
for (uint32 i=files.size();i--;)
for (uint32 i=(uint32)files.size();i--;)
{
if (!NLMISC::testWildCard(NLMISC::CFile::getFilename(files[i]),wildcard))
{
@ -913,7 +913,7 @@ NLMISC_CATEGORISED_COMMAND(Stats,charScanScriptTestFilteredFileList,"list the se
return false;
// generating a new file list
if (args[0]==CSString("generate").left(args[0].size()))
if (args[0]==CSString("generate").left((uint)args[0].size()))
{
if (TheCharScanScriptFile==NULL)
{
@ -948,7 +948,7 @@ NLMISC_CATEGORISED_COMMAND(Stats,charScanScriptTestFilteredFileList,"list the se
}
// displaying the last generated file list
if (args[0]==CSString("display").left(args[0].size()))
if (args[0]==CSString("display").left((uint)args[0].size()))
{
nlinfo("Filtered file list for the current job");
fdc.display(&log);

View file

@ -63,7 +63,7 @@ void CCharFilterFactory::displayFilterList(NLMISC::CLog* log)
{
std::string s= _Filters[i]->getName();
if (s.size()>longestName)
longestName=s.size();
longestName=(uint32)s.size();
}
// iterate over the filters displaying names and description
@ -75,7 +75,7 @@ void CCharFilterFactory::displayFilterList(NLMISC::CLog* log)
uint32 CCharFilterFactory::getFilterBuilderCount()
{
return _Filters.size();
return (uint32)_Filters.size();
}
ICharFilterBuilder* CCharFilterFactory::getFilterBuilder(uint32 idx)

View file

@ -63,7 +63,7 @@ void CCharInfoExtractorFactory::displayInfoExtractorList(NLMISC::CLog* log)
{
std::string s= _InfoExtractors[i]->getName();
if (s.size()>longestName)
longestName=s.size();
longestName=(uint32)s.size();
}
// iterate over the infoExtractors displaying names and description
@ -75,7 +75,7 @@ void CCharInfoExtractorFactory::displayInfoExtractorList(NLMISC::CLog* log)
uint32 CCharInfoExtractorFactory::getInfoExtractorBuilderCount()
{
return _InfoExtractors.size();
return (uint32)_InfoExtractors.size();
}
ICharInfoExtractorBuilder* CCharInfoExtractorFactory::getInfoExtractorBuilder(uint32 idx)

View file

@ -233,7 +233,7 @@ void CCharScanScriptCommandRegistry::displayScriptCommands(NLMISC::CLog* log)
{
std::string s= _ScriptCommands[i]->getName();
if (s.size()>longestName)
longestName=s.size();
longestName=(uint32)s.size();
}
// iterate over the script commands displaying names and description

View file

@ -293,7 +293,7 @@ bool CCharacterScanJob::runForFile(const std::string& fileName)
c.apply(pdr);
// iterate over the filters executing their core code
for (uint32 i=_Filters.size();i--;)
for (uint32 i=(uint32)_Filters.size();i--;)
{
if (!_Filters[i]->evaluate(&c))
return true;

View file

@ -63,7 +63,7 @@ void CFileListBuilderFactory::displayFileListBuilderList(NLMISC::CLog* log)
{
std::string s= _FileLists[i]->getName();
if (s.size()>longestName)
longestName=s.size();
longestName=(uint32)s.size();
}
// iterate over the filters displaying names and description
@ -75,7 +75,7 @@ void CFileListBuilderFactory::displayFileListBuilderList(NLMISC::CLog* log)
uint32 CFileListBuilderFactory::getFileListBuilderCount()
{
return _FileLists.size();
return (uint32)_FileLists.size();
}
IFileListBuilderBuilder* CFileListBuilderFactory::getFileListBuilder(uint32 idx)

View file

@ -61,19 +61,19 @@ namespace STAT_GLOBALS
NLMISC::CSString getInputFilePath(const NLMISC::CSString& path)
{
NLMISC::CSString pathRoot= NLMISC::CPath::standardizePath(InputFileDirectory.get());
return (path.left(pathRoot.size())==pathRoot)? path: pathRoot+path;
return (path.left((uint)pathRoot.size())==pathRoot)? path: pathRoot+path;
}
NLMISC::CSString getScriptFilePath(const NLMISC::CSString& path)
{
NLMISC::CSString pathRoot= NLMISC::CPath::standardizePath(ScriptDirectory.get());
return (path.left(pathRoot.size())==pathRoot)? path: pathRoot+path;
return (path.left((uint)pathRoot.size())==pathRoot)? path: pathRoot+path;
}
NLMISC::CSString getOutputFilePath(const NLMISC::CSString& path)
{
NLMISC::CSString pathRoot= NLMISC::CPath::standardizePath(OutputDirectory.get());
return (path.left(pathRoot.size())==pathRoot)? path: pathRoot+path;
return (path.left((uint)pathRoot.size())==pathRoot)? path: pathRoot+path;
}

View file

@ -131,7 +131,7 @@ void CJobManager::serviceUpdate()
uint32 CJobManager::addJob(NLMISC::CSmartPtr<CJobManager::IJob> job)
{
nlassert(job!=NULL);
uint32 id= _Jobs.size();
uint32 id= (uint32)_Jobs.size();
_UnfinishedJobs.push_back(id);
_Jobs.push_back(job);
return id;
@ -225,6 +225,6 @@ void CJobManager::displayJob(uint32 jobId,NLMISC::CLog* log)
uint32 CJobManager::getNumJobs() const
{
return _UnfinishedJobs.size();
return (uint32)_UnfinishedJobs.size();
}

View file

@ -333,7 +333,7 @@ FILE_LIST_BUILDER(FileAge,"<min> [<max>]")
// calculate the timestamp value of midnight today
time_t theTime;
time(&theTime);
uint32 dateToday= theTime/(24*64*60)*(24*64*60);
uint32 dateToday= (uint32)(theTime/(24*64*60)*(24*64*60));
// calculate the maximum and minimum timestamp values corresponding to the dates that we've been given
uint32 minFileTime= (max==~0u)? 0: dateToday-(max*24*60*60);
@ -382,7 +382,7 @@ FILE_LIST_BUILDER(UserMostRecentFileAge,"<min> [<max>]")
// calculate the timestamp value of midnight today
time_t theTime;
time(&theTime);
uint32 dateToday= theTime/(24*64*60)*(24*64*60);
uint32 dateToday= (uint32)(theTime/(24*64*60)*(24*64*60));
// calculate the maximum and minimum timestamp values corresponding to the dates that we've been given
uint32 minFileTime= (max==~0u)? 0: dateToday-(max*24*60*60);

View file

@ -1131,7 +1131,7 @@ NLMISC_COMMAND (kill, "kill a service and send an unregister broadcast to other
NLMISC_DYNVARIABLE(uint32, NbRegisteredServices, "display the number of service that are registered in naming service")
{
if (get) *pointer = RegisteredServices.size();
if (get) *pointer = (uint32)RegisteredServices.size();
}
NLMISC_COMMAND( displayServiceInstances, "SIM: Display info on service instances", "" )

View file

@ -76,6 +76,7 @@ template<class T> bool CEqualNode<T>::propagRecord(CRecord *record)
id_node++;
it_val++;
}
return false;
}
/*

View file

@ -68,5 +68,5 @@ const IValue *CRecord::operator[](int index)
int CRecord::size()
{
return _Values.size();
return (int)_Values.size();
}

View file

@ -68,7 +68,7 @@ int CTree::getNbRecords(std::vector<CRecord *> &records,int key, IValue *value)
double CTree::log2(double val) const
{
return (log(val) / log(2));
return (log(val) / log(2.0));
}
double CTree::entropy(double a, double b) const
@ -107,8 +107,8 @@ double CTree::entropy(std::vector<double> &p) const
double CTree::gain(std::vector<CRecord *> &records, int attrib, CField *field)
{
int nb_values = field->getPossibleValues().size();
int nb_records = records.size();
int nb_values = (int)field->getPossibleValues().size();
int nb_records = (int)records.size();
CValue<bool> bool_true(true);
@ -270,7 +270,7 @@ INode *CTree::ID3(std::vector<int> &attributes, std::vector<CRecord *> &records,
// Tests if all records have the same key value, if so returns a result node with this key value.
int nb_records = records.size();
int nb_records = (int)records.size();
int nb_key_true;
int nb_key_false;
@ -380,7 +380,7 @@ void CTree::splitRecords( std::vector<CRecord *> &records, int attrib, std::vect
{
if ( result.size() < fields[attrib]->getPossibleValues().size() )
{
int nb_missing = fields[attrib]->getPossibleValues().size() - result.size();
int nb_missing = (int)(fields[attrib]->getPossibleValues().size() - result.size());
for (int i = 0; i <= nb_missing; i++ )
{
result.push_back( std::vector<CRecord *>() );

View file

@ -18,9 +18,8 @@
#include "formFlora.h"
#include "formPlant.h"
#ifdef NL_OS_WINDOWS
#define NOMINMAX
#include <windows.h>
#undef max
#undef min
#endif // NL_OS_WINDOWS
#include "nel/ligo/zone_region.h"

View file

@ -65,7 +65,7 @@ public:
void readGeorges (const CSmartPtr<NLGEORGES::UForm> &form, const CSheetId &sheetId);
/// Load/Save the values using the serial system
void serial (IStream &s);
void serial (NLMISC::IStream &s);
/**
* Event to implement any action when the sheet is no longer existent.
@ -106,7 +106,7 @@ void CSheet::readGeorges (const CSmartPtr<NLGEORGES::UForm> &form, const CSheetI
// serial
//
//-----------------------------------------------
void CSheet::serial (IStream &s)
void CSheet::serial (NLMISC::IStream &s)
{
s.serial( Alias );
}
@ -177,7 +177,7 @@ int main( int argc, char ** argv )
{
CConfigFile::CVar& cvSheetPaths = configFile.getVar("SheetPaths");
sint i;
for( i = 0; i< cvSheetPaths.size(); ++i)
for( i = 0; i< (sint)cvSheetPaths.size(); ++i)
{
sheetPaths.push_back( cvSheetPaths.asString(i) );
}
@ -213,7 +213,7 @@ int main( int argc, char ** argv )
{
CConfigFile::CVar& cvExtensions = configFile.getVar("Extensions");
sint i;
for( i = 0; i< cvExtensions.size(); ++i)
for( i = 0; i< (sint)cvExtensions.size(); ++i)
{
extensions.push_back( cvExtensions.asString(i) );
}

View file

@ -147,11 +147,11 @@ void makeAnimMeleeImpact(const std::string &animSetFile, const set<CAnimCombatSe
// try to get the name
const string tagStart= "name=\"";
uint start= lineLwr.find(tagStart);
std::string::size_type start= lineLwr.find(tagStart);
if(start!=string::npos)
{
start+= tagStart.size();
uint end= lineLwr.find("\"", start);
std::string::size_type end= lineLwr.find("\"", start);
if(end!=string::npos)
currentStateName= lineLwr.substr(start, end-start);
}
@ -168,7 +168,7 @@ void makeAnimMeleeImpact(const std::string &animSetFile, const set<CAnimCombatSe
static CAnimCombatState key;
// must translate for instance "attack1" to "A1"
key.StateCode= StateNameToStateCode[currentStateName];
set<CAnimCombatState>::iterator it= currentCombatAnimSet.States.find(key);
set<CAnimCombatState>::const_iterator it= currentCombatAnimSet.States.find(key);
if(it!=currentCombatAnimSet.States.end())
{
// else take the mean anim time
@ -215,7 +215,7 @@ void makeAnimMeleeImpact(const std::string &animSetFile, const set<CAnimCombatSe
{
string str= animSetText[i];
str+= "\n";
oFile.serialBuffer((uint8*)str.c_str(), str.size());
oFile.serialBuffer((uint8*)str.c_str(), (uint)str.size());
}
}
}

View file

@ -184,7 +184,7 @@ public:
newSection.Name = name;
newSection.DisplayName = displayname;
newSection.Description = description;
CurrentSection = Sections.size();
CurrentSection = (sint)Sections.size();
Sections.push_back(newSection);
}
@ -237,7 +237,7 @@ public:
_section.Methods.push_back(newMethod);
CurrentMethod = SMethodId(CurrentSection, _section.Methods.size()-1, this);
CurrentMethod = SMethodId(CurrentSection, (sint)_section.Methods.size()-1, this);
return CurrentMethod;
}
@ -624,7 +624,7 @@ inline void CCppOutput::clear()
inline bool searchForId(char* buffer, char** start, char** end)
{
const char* id = "$Id:";
uint len = strlen(id);
uint len = (uint)strlen(id);
for (; *buffer != '\0'; ++buffer)
{
if (strncmp(buffer, id, len) == 0)
@ -679,7 +679,7 @@ inline void CCppOutput::flush(const std::string &fileName)
{
if (f.open(fileName))
{
f.serialBuffer((uint8*)(_Buffer.c_str()), _Buffer.size());
f.serialBuffer((uint8*)(_Buffer.c_str()), (uint)_Buffer.size());
f.close();
}
else

View file

@ -77,7 +77,7 @@ string formatDescription(const string &str)
string strReplace(string str, const string &search, const string &replace)
{
uint pos;
std::string::size_type pos = 0;
while ((pos = str.find(search)) != string::npos)
str.replace(pos, search.size(), replace);
return str;
@ -776,7 +776,7 @@ void CDbNode::generateLogContent()
{
CLogMsgNode *child = LogNodes[i];
child->Id = logid;
logid += child->Logs.size();
logid += (uint)child->Logs.size();
child->generateContent();
}
@ -1805,7 +1805,7 @@ void CClassNode::computeAttributesColumns()
Attributes = mother->Attributes;
}
uint attribId = Attributes.size();
uint attribId = (uint)Attributes.size();
uint i;
for (i=0; i<Nodes.size(); ++i)
{

View file

@ -60,7 +60,7 @@ public:
template<typename T>
void set(const std::string& name, const T& value)
{
uint dotpos = name.find(EnvSeparator);
std::string::size_type dotpos = name.find(EnvSeparator);
std::string child = name.substr(0, dotpos);
if (dotpos == std::string::npos)
@ -98,7 +98,7 @@ public:
/// Does Sub Environment exist?
virtual bool envExists(const std::string& name) const
{
uint dotpos = name.find(EnvSeparator);
std::string::size_type dotpos = name.find(EnvSeparator);
std::string child = name.substr(0, dotpos);
if (child.empty())
@ -114,7 +114,7 @@ public:
/// Enter Sub Env, like getEnv() but it doesn't look in parent, and always goes in current env
virtual CTemplatizerEnv* getSubEnv(const std::string& name)
{
uint dotpos = name.find(EnvSeparator);
std::string::size_type dotpos = name.find(EnvSeparator);
std::string child = name.substr(0, dotpos);
if (child.empty())
@ -155,7 +155,7 @@ public:
/// Get Sub Env
virtual CTemplatizerEnv* getEnv(const std::string& name)
{
uint dotpos = name.find(EnvSeparator);
std::string::size_type dotpos = name.find(EnvSeparator);
std::string child = name.substr(0, dotpos);
if (child.empty())
@ -265,7 +265,7 @@ public:
/// Get Value Node
virtual bool getValueNodeAndEnv(const std::string& name, ITemplatizerBloc*& node, CTemplatizerEnv*& env)
{
uint pos = name.find_last_of(EnvSeparator);
std::string::size_type pos = name.find_last_of(EnvSeparator);
if (pos == std::string::npos)
{
node = getNode(name);
@ -434,7 +434,7 @@ public:
if (RootEnv == NULL)
return;
uint pos = var.find_last_of(EnvSeparator);
std::string::size_type pos = var.find_last_of(EnvSeparator);
if (pos == std::string::npos)
{

View file

@ -162,7 +162,7 @@ public:
/// Init
void init(const char* text, uint size = 0)
{
_Size = (size > 0 ? size : strlen(text));
_Size = (size > 0 ? size : (uint)strlen(text));
_Buffer = text;
nlassert(_Buffer != NULL);
_TempToken.Start = 0;
@ -301,7 +301,7 @@ public:
std::string str(_Buffer+token.Start, token.End-token.Start);
if (token.Token == TokenString)
{
uint pos = 0;
std::string::size_type pos = 0;
while ((pos = str.find('\\', pos)) != std::string::npos)
{
if (pos+1 == str.size())

View file

@ -33,7 +33,7 @@ using namespace NLMISC;
#define outLine( s )\
{\
out = string(s);\
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), out.size() );\
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), (uint)out.size() );\
}\
@ -135,15 +135,15 @@ struct CSkill
*/
string out;
out = string(" <STRUCT Name=\"")+ NormalizedSkillName + string("\">\n");
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), out.size() );
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), (uint)out.size() );
out = string(" <ATOM Name=\"Skill\" Value=\"")+ SkillName + string("\"/>\n");
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), out.size() );
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), (uint)out.size() );
out = string(" <ATOM Name=\"SkillCode\" Value=\"")+ Code + string("\"/>\n");
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), out.size() );
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), (uint)out.size() );
out = string(" <ATOM Name=\"MaxSkillValue\" Value=\"")+ toString(MaxValue) + string("\"/>\n");
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), out.size() );
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), (uint)out.size() );
out = string(" <ATOM Name=\"Type of Stage\" Value=\"")+ toString(StageType) + string("\"/>\n");
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), out.size() );
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), (uint)out.size() );
if (ParentSkillPtr != NULL)
{
@ -153,22 +153,22 @@ struct CSkill
{
out = string(" <ATOM Name=\"ParentSkill\" Value=\"\"/>\n");
}
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), out.size() );
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), (uint)out.size() );
if( !Children.empty())
{
out = string(" <ARRAY Name=\"ChildSkills\">\n");
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), out.size() );
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), (uint)out.size() );
for (uint i = 0 ; i < Children.size() ; ++i)
{
out = string(" <ATOM Name=\"") + Children[i]->NormalizedSkillName + string("\" Value=\"")+ Children[i]->SkillName + string("\"/>\n");
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), out.size() );
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), (uint)out.size() );
}
out = string(" </ARRAY>\n");
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), out.size() );
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), (uint)out.size() );
}
out = string(" </STRUCT>\n");
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), out.size() );
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), (uint)out.size() );
for (uint i = 0 ; i < Children.size() ; ++i)
Children[i]->writeInSheet(fo);
@ -383,13 +383,13 @@ sint main( sint argc, char ** argv )
}
string out("<?xml version=\"1.0\"?>\n");
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), out.size() );
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), (uint)out.size() );
out = string("<FORM Version=\"0.2\" State=\"modified\">\n");
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), out.size() );
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), (uint)out.size() );
out = string(" <STRUCT>\n");
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), out.size() );
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), (uint)out.size() );
out = string(" <ARRAY Name=\"SkillData\">\n");
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), out.size() );
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), (uint)out.size() );
for ( vector<CSkill*>::const_iterator itTree = SkillTree.RootSkills.begin() ; itTree != SkillTree.RootSkills.end() ; ++itTree)
{
@ -397,11 +397,11 @@ sint main( sint argc, char ** argv )
}
out = string(" </ARRAY>\n");
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), out.size() );
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), (uint)out.size() );
out = string(" </STRUCT>\n");
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), out.size() );
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), (uint)out.size() );
out = string("</FORM>\n");
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), out.size() );
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), (uint)out.size() );
fo.close();
// create the code .typ
@ -412,19 +412,19 @@ sint main( sint argc, char ** argv )
}
out = string("<TYPE Type=\"String\" UI=\"NonEditableCombo\" Default=\"None\" Version=\"0.1\" State=\"modified\">\n");
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), out.size() );
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), (uint)out.size() );
out = string(" <DEFINITION Label=\"unknown\" Value=\"unknown\"/>\n");
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), out.size() );
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), (uint)out.size() );
set<string>::const_iterator itCode;
for ( itCode = Codes.begin() ; itCode != Codes.end() ; ++itCode )
{
out = string(" <DEFINITION Label=\"") + (*itCode) + string("\" Value=\"") + (*itCode) + string("\"/>\n");
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), out.size() );
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), (uint)out.size() );
}
out = string("</TYPE>\n");
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), out.size() );
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), (uint)out.size() );
fo.close();
}
@ -460,18 +460,18 @@ sint main( sint argc, char ** argv )
// output header of .typ or .dfn file
string out("<?xml version=\"1.0\"?>\n");
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), out.size() );
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), (uint)out.size() );
if( string( argv[2] ).find(".typ") != string::npos )
{
out = string("<TYPE Type=\"String\" UI=\"NonEditableCombo\" Default=\"unknown\" Version=\"0.1\" State=\"modified\">\n");
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), out.size() );
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), (uint)out.size() );
out = string(" <DEFINITION Label=\"unknown\" Value=\"unknown\"/>\n");
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), out.size() );
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), (uint)out.size() );
}
else
{
out = string("<DFN Version=\"0.0\" State=\"modified\">\n");
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), out.size() );
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), (uint)out.size() );
}
// parse all skills to export selected ones
@ -522,7 +522,7 @@ sint main( sint argc, char ** argv )
{
out = string(" <ELEMENT Name=\"") + skill.NormalizedSkillName + string("\" Type=\"Type\" Filename=\"creature_stat.typ\"/>\n");
}
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), out.size() );
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), (uint)out.size() );
}
}
@ -534,7 +534,7 @@ sint main( sint argc, char ** argv )
{
out = string("</DFN>\n");
}
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), out.size() );
fo.serialBuffer( (uint8 *) const_cast< char * >(out.c_str()), (uint)out.size() );
fo.close();
/////////////////////////////////////////////////////////////////////////////////////

View file

@ -129,7 +129,7 @@ NLMISC_COMMAND(listCharNames,"display the names of the characters int he listed
std::vector<std::string> files;
NLMISC::CPath::getPathContent(SourceDirectory.get().c_str(),false,false,true,files);
for (uint32 i=files.size();i--;)
for (uint32 i=(uint32)files.size();i--;)
{
if (!NLMISC::testWildCard(NLMISC::CFile::getFilename(files[i]),wildcard))
{

View file

@ -63,7 +63,7 @@ void CCharFilterFactory::displayFilterList(NLMISC::CLog* log)
{
std::string s= _Filters[i]->getName();
if (s.size()>longestName)
longestName=s.size();
longestName=(uint32)s.size();
}
// iterate over the filters displaying names and description
@ -75,7 +75,7 @@ void CCharFilterFactory::displayFilterList(NLMISC::CLog* log)
uint32 CCharFilterFactory::getFilterBuilderCount()
{
return _Filters.size();
return (uint32)_Filters.size();
}
ICharFilterBuilder* CCharFilterFactory::getFilterBuilder(uint32 idx)

View file

@ -63,7 +63,7 @@ void CCharInfoExtractorFactory::displayInfoExtractorList(NLMISC::CLog* log)
{
std::string s= _InfoExtractors[i]->getName();
if (s.size()>longestName)
longestName=s.size();
longestName=(uint32)s.size();
}
// iterate over the infoExtractors displaying names and description
@ -75,7 +75,7 @@ void CCharInfoExtractorFactory::displayInfoExtractorList(NLMISC::CLog* log)
uint32 CCharInfoExtractorFactory::getInfoExtractorBuilderCount()
{
return _InfoExtractors.size();
return (uint32)_InfoExtractors.size();
}
ICharInfoExtractorBuilder* CCharInfoExtractorFactory::getInfoExtractorBuilder(uint32 idx)

View file

@ -73,7 +73,7 @@ bool CCharScanScript::addScriptFile(const std::string& fileName)
void CCharScanScript::applyToJob(CCharacterScanJob& job)
{
// iterate backwards over the script files in order to apply the most important files last
for (uint32 i=_ScriptFiles.size();i--;)
for (uint32 i=(uint32)_ScriptFiles.size();i--;)
{
_ScriptFiles[i].applyToJob(job);
}
@ -230,7 +230,7 @@ void CCharScanScriptCommandRegistry::displayScriptCommands(NLMISC::CLog* log)
{
std::string s= _ScriptCommands[i]->getName();
if (s.size()>longestName)
longestName=s.size();
longestName=(uint32)s.size();
}
// iterate over the script commands displaying names and description

View file

@ -86,7 +86,7 @@ void CJobManager::serviceUpdate()
uint32 CJobManager::addJob(NLMISC::CSmartPtr<CJobManager::IJob> job)
{
nlassert(job!=NULL);
uint32 id= _Jobs.size();
uint32 id= (uint32)_Jobs.size();
_UnfinishedJobs.push_back(id);
_Jobs.push_back(job);
return id;