mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-22 23:26:15 +00:00
Changed: #853 Compilation on 64-bits platforms
This commit is contained in:
parent
b43d310895
commit
13032ad189
10 changed files with 71 additions and 68 deletions
|
@ -37,7 +37,7 @@ void splitStringCSV(const CSString& in,const CSString& separator,vector<CSString
|
|||
{
|
||||
bool lastEmpty = false;
|
||||
CSString s=in.strip();
|
||||
if (s.right(separator.size()) == separator)
|
||||
if (s.right((uint)separator.size()) == separator)
|
||||
{
|
||||
// there is en empty column at end of line, remember this
|
||||
lastEmpty = true;
|
||||
|
@ -46,16 +46,16 @@ void splitStringCSV(const CSString& in,const CSString& separator,vector<CSString
|
|||
while (!s.empty())
|
||||
{
|
||||
// deal with empty columns first
|
||||
while (s.left(separator.size())==separator)
|
||||
while (s.left((uint)separator.size())==separator)
|
||||
{
|
||||
s=s.leftCrop(separator.size());
|
||||
s=s.leftCrop((uint)separator.size());
|
||||
result.push_back("");
|
||||
}
|
||||
if (!s.empty())
|
||||
{
|
||||
uint pos = s.find(separator.c_str(), 0);
|
||||
CSString col = s.left(pos);
|
||||
s=s.leftCrop(pos);
|
||||
string::size_type pos = s.find(separator.c_str(), 0);
|
||||
CSString col = s.left((uint)pos);
|
||||
s=s.leftCrop((uint)pos);
|
||||
if (!col.empty() && col[0] == '\"')
|
||||
{
|
||||
result.push_back(s.firstWordOrWords(true));
|
||||
|
@ -67,7 +67,7 @@ void splitStringCSV(const CSString& in,const CSString& separator,vector<CSString
|
|||
while (s.left(separator.size())!=separator && !s.empty())
|
||||
result.back()+=s.firstWordOrWords(true);
|
||||
*/
|
||||
s=s.leftCrop(separator.size());
|
||||
s=s.leftCrop((uint)separator.size());
|
||||
}
|
||||
}
|
||||
if (lastEmpty)
|
||||
|
@ -176,7 +176,7 @@ private:
|
|||
void closeFooters()
|
||||
{
|
||||
// deal with footer paragraphs
|
||||
for (uint32 i=tblColumnNames.size();i--;)
|
||||
for (uint32 i=(uint32)tblColumnNames.size();i--;)
|
||||
{
|
||||
if (headerIsOpen[tblColumnNames[i]])
|
||||
{
|
||||
|
@ -195,7 +195,7 @@ private:
|
|||
CSString str = fileHeader + fileBody + fileFooter;
|
||||
|
||||
NLMISC::COFile of(filename, false, true);
|
||||
of.serialBuffer((uint8*)str.data(), str.size());
|
||||
of.serialBuffer((uint8*)str.data(), (uint)str.size());
|
||||
/* out<<fileHeader;
|
||||
out<<fileBody;
|
||||
out<<fileFooter;
|
||||
|
@ -236,7 +236,7 @@ private:
|
|||
}
|
||||
}
|
||||
|
||||
for (uint32 i=tblColumnNames.size();(i--)>firstChange;)
|
||||
for (uint32 i=(uint32)tblColumnNames.size();(i--)>firstChange;)
|
||||
{
|
||||
CSString s=footers[tblColumnNames[i]];
|
||||
for (uint32 j=1;j<lastTblCols.size()&&j<tblColumnNames.size();++j)
|
||||
|
|
|
@ -28,11 +28,11 @@
|
|||
#include "nel/georges/u_form.h"
|
||||
#include "nel/georges/u_form_elm.h"
|
||||
|
||||
#include "3d/zone.h"
|
||||
#include "3d/landscape.h"
|
||||
#include "3d/scene_group.h"
|
||||
#include "3d/visual_collision_manager.h"
|
||||
#include "3d/visual_collision_entity.h"
|
||||
#include "nel/3d/zone.h"
|
||||
#include "nel/3d/landscape.h"
|
||||
#include "nel/3d/scene_group.h"
|
||||
#include "nel/3d/visual_collision_manager.h"
|
||||
#include "nel/3d/visual_collision_entity.h"
|
||||
|
||||
#include "nel/misc/o_xml.h"
|
||||
#include "nel/misc/i_xml.h"
|
||||
|
|
|
@ -39,10 +39,13 @@ void CTools::mkdir (const string &dirName)
|
|||
SetCurrentDirectory (newDir.c_str());
|
||||
// Create upper levels
|
||||
newDir = "";
|
||||
int pos = dirName.rfind('\\');
|
||||
for (int i = 0; i < pos; ++i)
|
||||
newDir += dirName[i];
|
||||
mkdir (newDir);
|
||||
string::size_type pos = dirName.rfind('\\');
|
||||
if (pos != string::npos)
|
||||
{
|
||||
for (uint i = 0; i < pos; ++i)
|
||||
newDir += dirName[i];
|
||||
mkdir (newDir);
|
||||
}
|
||||
// Create Directory
|
||||
if (!CreateDirectory(dirName.c_str(),NULL))
|
||||
throw Exception(string("Cannot create directory ")+dirName);
|
||||
|
|
|
@ -59,7 +59,7 @@ CStringEx CTypeUnitDouble::FormatDouble( const double dvalue ) const
|
|||
sx.insert(decimal,".");
|
||||
|
||||
while( sx[sx.length()-1] == '0' )
|
||||
sx.left( sx.length() -1 );
|
||||
sx.left( (int)sx.length() -1 );
|
||||
|
||||
if( sx[sx.length()-1] == '.' )
|
||||
sx += '0';
|
||||
|
@ -94,12 +94,12 @@ CStringEx CTypeUnitDouble::Format( const CStringEx _sxvalue ) const
|
|||
value.purge();
|
||||
while( value[0] == '<' )
|
||||
{
|
||||
unsigned int pos = value.find( '>' );
|
||||
if( pos == -1 )
|
||||
std::string::size_type pos = value.find( '>' );
|
||||
if( pos == std::string::npos )
|
||||
break;
|
||||
CStringEx sxoperateur = value.get_mid( 1, 1 );
|
||||
CStringEx sxoperande = value.get_mid( 2, pos-2);
|
||||
value.right( value.size()-pos-1 );
|
||||
CStringEx sxoperande = value.get_mid( 2, (int)pos-2);
|
||||
value.right( (int)(value.size()-pos-1) );
|
||||
modificationValues.push_back( std::make_pair( sxoperateur, sxoperande ) );
|
||||
}
|
||||
if( modificationValues.size() )
|
||||
|
@ -144,12 +144,12 @@ CStringEx CTypeUnitDouble::CalculateResult( const CStringEx _sxbasevalue, const
|
|||
value.purge();
|
||||
while( value[0] == '<' )
|
||||
{
|
||||
unsigned int pos = value.find( '>' );
|
||||
if( pos == -1 )
|
||||
std::string::size_type pos = value.find( '>' );
|
||||
if( pos == std::string::npos )
|
||||
break;
|
||||
CStringEx sxoperateur = value.get_mid( 1, 1 );
|
||||
CStringEx sxoperande = value.get_mid( 2, pos-2);
|
||||
value.right( value.size()-pos-1 );
|
||||
CStringEx sxoperande = value.get_mid( 2, (int)pos-2);
|
||||
value.right( (int)(value.size()-pos-1) );
|
||||
modificationValues.push_back( std::make_pair( sxoperateur, sxoperande ) );
|
||||
}
|
||||
if( modificationValues.size() )
|
||||
|
|
|
@ -51,12 +51,12 @@ CStringEx CTypeUnitIntSigned::Format( const CStringEx _sxvalue ) const
|
|||
value.purge();
|
||||
while( value[0] == '<' )
|
||||
{
|
||||
unsigned int pos = value.find( '>' );
|
||||
if( pos == -1 )
|
||||
std::string::size_type pos = value.find( '>' );
|
||||
if( pos == std::string::npos )
|
||||
break;
|
||||
CStringEx sxoperateur = value.get_mid( 1, 1 );
|
||||
CStringEx sxoperande = value.get_mid( 2, pos-2);
|
||||
value.right( value.size()-pos-1 );
|
||||
value.right( (int)(value.size()-pos-1) );
|
||||
modificationValues.push_back( std::make_pair( sxoperateur, sxoperande ) );
|
||||
}
|
||||
if( modificationValues.size() )
|
||||
|
@ -96,12 +96,12 @@ CStringEx CTypeUnitIntSigned::CalculateResult( const CStringEx _sxbasevalue, con
|
|||
value.purge();
|
||||
while( value[0] == '<' )
|
||||
{
|
||||
unsigned int pos = value.find( '>' );
|
||||
if( pos == -1 )
|
||||
std::string::size_type pos = value.find( '>' );
|
||||
if( pos == std::string::npos )
|
||||
break;
|
||||
CStringEx sxoperateur = value.get_mid( 1, 1 );
|
||||
CStringEx sxoperande = value.get_mid( 2, pos-2);
|
||||
value.right( value.size()-pos-1 );
|
||||
CStringEx sxoperande = value.get_mid( 2, (int)pos-2);
|
||||
value.right( (int)(value.size()-pos-1) );
|
||||
modificationValues.push_back( std::make_pair( sxoperateur, sxoperande ) );
|
||||
}
|
||||
if( modificationValues.size() )
|
||||
|
|
|
@ -69,12 +69,12 @@ CStringEx CTypeUnitIntUnsigned::Format( const CStringEx _sxvalue ) const
|
|||
value.purge();
|
||||
while( value[0] == '<' )
|
||||
{
|
||||
unsigned int pos = value.find( '>' );
|
||||
if( pos == -1 )
|
||||
std::string::size_type pos = value.find( '>' );
|
||||
if( pos == std::string::npos )
|
||||
break;
|
||||
CStringEx sxoperateur = value.get_mid( 1, 1 );
|
||||
CStringEx sxoperande = value.get_mid( 2, pos-2);
|
||||
value.right( value.size()-pos-1 );
|
||||
CStringEx sxoperande = value.get_mid( 2, (int)pos-2);
|
||||
value.right( (int)(value.size()-pos-1) );
|
||||
modificationValues.push_back( std::make_pair( sxoperateur, sxoperande ) );
|
||||
}
|
||||
if( modificationValues.size() )
|
||||
|
@ -124,12 +124,12 @@ CStringEx CTypeUnitIntUnsigned::CalculateResult( const CStringEx _sxbasevalue, c
|
|||
value.purge();
|
||||
while( value[0] == '<' )
|
||||
{
|
||||
unsigned int pos = value.find( '>' );
|
||||
if( pos == -1 )
|
||||
std::string::size_type pos = value.find( '>' );
|
||||
if( pos == std::string::npos )
|
||||
break;
|
||||
CStringEx sxoperateur = value.get_mid( 1, 1 );
|
||||
CStringEx sxoperande = value.get_mid( 2, pos-2);
|
||||
value.right( value.size()-pos-1 );
|
||||
CStringEx sxoperande = value.get_mid( 2, (int)pos-2);
|
||||
value.right( (int)(value.size()-pos-1) );
|
||||
modificationValues.push_back( std::make_pair( sxoperateur, sxoperande ) );
|
||||
}
|
||||
if( modificationValues.size() )
|
||||
|
|
|
@ -57,7 +57,7 @@ void findIcons(CConfigFile::CVar *var)
|
|||
vector<string> files;
|
||||
|
||||
// Scan each directory
|
||||
for (int i=0 ; i<var->size() ; i++)
|
||||
for (uint i=0 ; i<var->size() ; i++)
|
||||
{
|
||||
// clear files list
|
||||
files.clear();
|
||||
|
@ -82,7 +82,7 @@ string remap2Jpg(const string &s)
|
|||
{
|
||||
// change extension from TGA to JPG
|
||||
string jpg(s);
|
||||
uint n = jpg.find(".tga");
|
||||
string::size_type n = jpg.find(".tga");
|
||||
nlassert(n != string::npos);
|
||||
jpg.erase(n);
|
||||
jpg += ".jpg";
|
||||
|
@ -92,7 +92,7 @@ string remap2Jpg(const string &s)
|
|||
|
||||
void writeString(COFile &f, const string &s)
|
||||
{
|
||||
f.serialBuffer((uint8*)s.c_str(), s.size());
|
||||
f.serialBuffer((uint8*)s.c_str(), (uint)s.size());
|
||||
}
|
||||
|
||||
void writeHTMLline(COFile &f, const string &icon, const StringVector files, uint sizeLimit)
|
||||
|
@ -113,9 +113,9 @@ void writeHTMLline(COFile &f, const string &icon, const StringVector files, uint
|
|||
// fix limit based on configuration file
|
||||
uint n;
|
||||
if (sizeLimit == 0)
|
||||
n = files.size();
|
||||
n = (uint)files.size();
|
||||
else
|
||||
n = sizeLimit > files.size() ? files.size() : sizeLimit;
|
||||
n = sizeLimit > files.size() ? (uint)files.size() : sizeLimit;
|
||||
|
||||
// write each file using this icon
|
||||
for (uint i=0 ; i<n ; i++)
|
||||
|
@ -174,7 +174,7 @@ void convertImages(CConfigFile::CVar *var)
|
|||
CFile::createDirectory("images");
|
||||
|
||||
// Scan each directory
|
||||
for (int i=0 ; i<var->size() ; i++)
|
||||
for (uint i=0 ; i<var->size() ; i++)
|
||||
{
|
||||
string path = CPath::standardizePath(var->asString(i));
|
||||
vector<string> files;
|
||||
|
@ -206,7 +206,7 @@ void convertImages(CConfigFile::CVar *var)
|
|||
|
||||
bool endsWith( const CSString& s, const CSString& substring )
|
||||
{
|
||||
return ( s.right( substring.size() ) == substring );
|
||||
return ( s.right( (uint)substring.size() ) == substring );
|
||||
}
|
||||
|
||||
void ProcessDirectory( const CSString& dir, const StringVector& extensions )
|
||||
|
@ -220,7 +220,7 @@ void ProcessDirectory( const CSString& dir, const StringVector& extensions )
|
|||
printf( "%s\n", dir.c_str() );
|
||||
CPath::getPathContent ( dir.c_str(), true, false, true, files );
|
||||
|
||||
sixieme = files.size() / 6;
|
||||
sixieme = (int)files.size() / 6;
|
||||
|
||||
printf( "%d files are processed", files.size() );
|
||||
|
||||
|
@ -240,7 +240,7 @@ void ProcessDirectory( const CSString& dir, const StringVector& extensions )
|
|||
data.readFromFile( files[i] );
|
||||
|
||||
// Don't parse LOG
|
||||
uint n = data.find("<LOG>");
|
||||
string::size_type n = data.find("<LOG>");
|
||||
if (n != CSString::npos)
|
||||
data.erase(n);
|
||||
|
||||
|
@ -328,7 +328,7 @@ void main()
|
|||
|
||||
var = cf.getVarPtr("Wildcard");
|
||||
if (var)
|
||||
for (int i=0 ; i<var->size() ; i++)
|
||||
for (uint i=0 ; i<var->size() ; i++)
|
||||
for (uint it=0; it<listeIcones.size(); it++)
|
||||
{
|
||||
string wild = var->asString(i);
|
||||
|
|
|
@ -833,7 +833,7 @@ bool CMissionCompiler::publishFiles(const std::string &serverPathPrim, const std
|
|||
{
|
||||
string dst, src = _FilesToPublish[i];
|
||||
|
||||
uint n = src.find("primitives");
|
||||
string::size_type n = src.find("primitives");
|
||||
if (n == string::npos)
|
||||
{
|
||||
// text files : copy it and check include in phrase_rites_wk.txt
|
||||
|
@ -2229,7 +2229,7 @@ std::vector<TCompilerVarName> TCompilerVarName::getPropertyArrayWithText(const s
|
|||
|
||||
std::vector<std::string> values = md.getPropertyArray(prim, arrayProperyName,false, false);
|
||||
uint first = 0;
|
||||
uint last = values.size();
|
||||
uint last = (uint)values.size();
|
||||
compilerParams.resize(last);
|
||||
for ( ; first != last; ++first)
|
||||
{
|
||||
|
@ -2244,7 +2244,7 @@ std::vector<TCompilerVarName> TCompilerVarName::getPropertyArrayWithTextStaticDe
|
|||
std::vector<TCompilerVarName> compilerParams;
|
||||
std::vector<std::string> values = md.getPropertyArray(prim, arrayProperyName,false, false);
|
||||
uint first = 0;
|
||||
uint last = values.size();
|
||||
uint last = (uint)values.size();
|
||||
compilerParams.resize(last);
|
||||
for ( ; first != last; ++first)
|
||||
{
|
||||
|
|
|
@ -136,7 +136,7 @@ void processItemLine(const string &s)
|
|||
if (!CSString::isValidFileNameChar(s[field.size()]))
|
||||
{
|
||||
// get value
|
||||
int pos = s.find("=");
|
||||
string::size_type pos = s.find("=");
|
||||
nlassert(pos != string::npos);
|
||||
string val(s, pos+1);
|
||||
|
||||
|
@ -349,7 +349,7 @@ void updateItemField(CVectorSString &lines, uint itemIndex, uint fieldIndex, uin
|
|||
for (i=a ; i<b ; i++)
|
||||
{
|
||||
string line = s + "= " + val;
|
||||
uint pos = pos = lines[i].find(line.c_str());
|
||||
string::size_type pos = lines[i].find(line.c_str());
|
||||
if (pos != string::npos)
|
||||
{
|
||||
found = true;
|
||||
|
@ -361,7 +361,7 @@ void updateItemField(CVectorSString &lines, uint itemIndex, uint fieldIndex, uin
|
|||
i = a-1;
|
||||
while (++i<b && !found)
|
||||
{
|
||||
uint pos;
|
||||
string::size_type pos;
|
||||
|
||||
// store the line "_CraftParameters" : reference line
|
||||
if (craftLine == 0)
|
||||
|
|
|
@ -30,9 +30,9 @@
|
|||
#include "nel/georges/u_form_elm.h"
|
||||
#include "nel/georges/u_form_loader.h"
|
||||
|
||||
#include "nel/../../src/3d/zone.h"
|
||||
#include "nel/../../src/3d/landscape.h"
|
||||
#include "nel/../../src/3d/scene_group.h"
|
||||
#include "nel/3d/zone.h"
|
||||
#include "nel/3d/landscape.h"
|
||||
#include "nel/3d/scene_group.h"
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
|
@ -121,7 +121,7 @@ public:
|
|||
pgId= min(pgId, (uint)(BAR_LENGTH-1));
|
||||
sprintf (msg, "\r%s: %s", DisplayString.c_str (), progressbar[pgId]);
|
||||
uint i;
|
||||
for (i=strlen(msg); i<79; i++)
|
||||
for (i=(uint)strlen(msg); i<79; i++)
|
||||
msg[i]=' ';
|
||||
msg[i]=0;
|
||||
printf (msg);
|
||||
|
@ -161,8 +161,8 @@ bool getZoneCoordByName(const char * name, uint16& x, uint16& y)
|
|||
std::string zoneName(name);
|
||||
|
||||
// y
|
||||
uint ind1 = zoneName.find("_");
|
||||
if(ind1>=zoneName.length())
|
||||
std::string::size_type ind1 = zoneName.find("_");
|
||||
if(ind1 == std::string::npos)
|
||||
{
|
||||
nlwarning("bad file name");
|
||||
return false;
|
||||
|
@ -180,7 +180,7 @@ bool getZoneCoordByName(const char * name, uint16& x, uint16& y)
|
|||
|
||||
// x
|
||||
x = 0;
|
||||
uint ind2 = zoneName.length();
|
||||
uint ind2 = (uint)zoneName.length();
|
||||
if((ind2-ind1-1)!=2)
|
||||
{
|
||||
nlwarning("x code size is not a 2 characters code");
|
||||
|
@ -868,7 +868,7 @@ int main (int argc, char**argv)
|
|||
CPath::getPathContent (options.PrimDirs[i], true, false, true, files);
|
||||
|
||||
// For each
|
||||
uint fileCount = files.size ();
|
||||
uint fileCount = (uint)files.size ();
|
||||
for (i=0; i<fileCount; i++)
|
||||
{
|
||||
// Primitive file ?
|
||||
|
@ -1005,7 +1005,7 @@ int main (int argc, char**argv)
|
|||
uint layer = instance.AdditionnalInfo[i].SnapLayer;
|
||||
|
||||
// Found some triangles ?
|
||||
const uint setSize = selectedHeight.size ();
|
||||
const uint setSize = (uint)selectedHeight.size ();
|
||||
if (setSize)
|
||||
{
|
||||
// Look for the triangle in the good layer
|
||||
|
|
Loading…
Reference in a new issue