Changed: #853 Compilation on 64-bits platforms

This commit is contained in:
kervala 2010-05-24 19:09:01 +02:00
parent 8c06ff2d1a
commit 61dcfd3c80
10 changed files with 71 additions and 68 deletions

View file

@ -37,7 +37,7 @@ void splitStringCSV(const CSString& in,const CSString& separator,vector<CSString
{ {
bool lastEmpty = false; bool lastEmpty = false;
CSString s=in.strip(); 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 // there is en empty column at end of line, remember this
lastEmpty = true; lastEmpty = true;
@ -46,16 +46,16 @@ void splitStringCSV(const CSString& in,const CSString& separator,vector<CSString
while (!s.empty()) while (!s.empty())
{ {
// deal with empty columns first // 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(""); result.push_back("");
} }
if (!s.empty()) if (!s.empty())
{ {
uint pos = s.find(separator.c_str(), 0); string::size_type pos = s.find(separator.c_str(), 0);
CSString col = s.left(pos); CSString col = s.left((uint)pos);
s=s.leftCrop(pos); s=s.leftCrop((uint)pos);
if (!col.empty() && col[0] == '\"') if (!col.empty() && col[0] == '\"')
{ {
result.push_back(s.firstWordOrWords(true)); 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()) while (s.left(separator.size())!=separator && !s.empty())
result.back()+=s.firstWordOrWords(true); result.back()+=s.firstWordOrWords(true);
*/ */
s=s.leftCrop(separator.size()); s=s.leftCrop((uint)separator.size());
} }
} }
if (lastEmpty) if (lastEmpty)
@ -176,7 +176,7 @@ private:
void closeFooters() void closeFooters()
{ {
// deal with footer paragraphs // deal with footer paragraphs
for (uint32 i=tblColumnNames.size();i--;) for (uint32 i=(uint32)tblColumnNames.size();i--;)
{ {
if (headerIsOpen[tblColumnNames[i]]) if (headerIsOpen[tblColumnNames[i]])
{ {
@ -195,7 +195,7 @@ private:
CSString str = fileHeader + fileBody + fileFooter; CSString str = fileHeader + fileBody + fileFooter;
NLMISC::COFile of(filename, false, true); NLMISC::COFile of(filename, false, true);
of.serialBuffer((uint8*)str.data(), str.size()); of.serialBuffer((uint8*)str.data(), (uint)str.size());
/* out<<fileHeader; /* out<<fileHeader;
out<<fileBody; out<<fileBody;
out<<fileFooter; 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]]; CSString s=footers[tblColumnNames[i]];
for (uint32 j=1;j<lastTblCols.size()&&j<tblColumnNames.size();++j) for (uint32 j=1;j<lastTblCols.size()&&j<tblColumnNames.size();++j)

View file

@ -28,11 +28,11 @@
#include "nel/georges/u_form.h" #include "nel/georges/u_form.h"
#include "nel/georges/u_form_elm.h" #include "nel/georges/u_form_elm.h"
#include "3d/zone.h" #include "nel/3d/zone.h"
#include "3d/landscape.h" #include "nel/3d/landscape.h"
#include "3d/scene_group.h" #include "nel/3d/scene_group.h"
#include "3d/visual_collision_manager.h" #include "nel/3d/visual_collision_manager.h"
#include "3d/visual_collision_entity.h" #include "nel/3d/visual_collision_entity.h"
#include "nel/misc/o_xml.h" #include "nel/misc/o_xml.h"
#include "nel/misc/i_xml.h" #include "nel/misc/i_xml.h"

View file

@ -39,10 +39,13 @@ void CTools::mkdir (const string &dirName)
SetCurrentDirectory (newDir.c_str()); SetCurrentDirectory (newDir.c_str());
// Create upper levels // Create upper levels
newDir = ""; newDir = "";
int pos = dirName.rfind('\\'); string::size_type pos = dirName.rfind('\\');
for (int i = 0; i < pos; ++i) if (pos != string::npos)
{
for (uint i = 0; i < pos; ++i)
newDir += dirName[i]; newDir += dirName[i];
mkdir (newDir); mkdir (newDir);
}
// Create Directory // Create Directory
if (!CreateDirectory(dirName.c_str(),NULL)) if (!CreateDirectory(dirName.c_str(),NULL))
throw Exception(string("Cannot create directory ")+dirName); throw Exception(string("Cannot create directory ")+dirName);

View file

@ -59,7 +59,7 @@ CStringEx CTypeUnitDouble::FormatDouble( const double dvalue ) const
sx.insert(decimal,"."); sx.insert(decimal,".");
while( sx[sx.length()-1] == '0' ) while( sx[sx.length()-1] == '0' )
sx.left( sx.length() -1 ); sx.left( (int)sx.length() -1 );
if( sx[sx.length()-1] == '.' ) if( sx[sx.length()-1] == '.' )
sx += '0'; sx += '0';
@ -94,12 +94,12 @@ CStringEx CTypeUnitDouble::Format( const CStringEx _sxvalue ) const
value.purge(); value.purge();
while( value[0] == '<' ) while( value[0] == '<' )
{ {
unsigned int pos = value.find( '>' ); std::string::size_type pos = value.find( '>' );
if( pos == -1 ) if( pos == std::string::npos )
break; break;
CStringEx sxoperateur = value.get_mid( 1, 1 ); CStringEx sxoperateur = value.get_mid( 1, 1 );
CStringEx sxoperande = value.get_mid( 2, pos-2); CStringEx sxoperande = value.get_mid( 2, (int)pos-2);
value.right( value.size()-pos-1 ); value.right( (int)(value.size()-pos-1) );
modificationValues.push_back( std::make_pair( sxoperateur, sxoperande ) ); modificationValues.push_back( std::make_pair( sxoperateur, sxoperande ) );
} }
if( modificationValues.size() ) if( modificationValues.size() )
@ -144,12 +144,12 @@ CStringEx CTypeUnitDouble::CalculateResult( const CStringEx _sxbasevalue, const
value.purge(); value.purge();
while( value[0] == '<' ) while( value[0] == '<' )
{ {
unsigned int pos = value.find( '>' ); std::string::size_type pos = value.find( '>' );
if( pos == -1 ) if( pos == std::string::npos )
break; break;
CStringEx sxoperateur = value.get_mid( 1, 1 ); CStringEx sxoperateur = value.get_mid( 1, 1 );
CStringEx sxoperande = value.get_mid( 2, pos-2); CStringEx sxoperande = value.get_mid( 2, (int)pos-2);
value.right( value.size()-pos-1 ); value.right( (int)(value.size()-pos-1) );
modificationValues.push_back( std::make_pair( sxoperateur, sxoperande ) ); modificationValues.push_back( std::make_pair( sxoperateur, sxoperande ) );
} }
if( modificationValues.size() ) if( modificationValues.size() )

View file

@ -51,12 +51,12 @@ CStringEx CTypeUnitIntSigned::Format( const CStringEx _sxvalue ) const
value.purge(); value.purge();
while( value[0] == '<' ) while( value[0] == '<' )
{ {
unsigned int pos = value.find( '>' ); std::string::size_type pos = value.find( '>' );
if( pos == -1 ) if( pos == std::string::npos )
break; break;
CStringEx sxoperateur = value.get_mid( 1, 1 ); CStringEx sxoperateur = value.get_mid( 1, 1 );
CStringEx sxoperande = value.get_mid( 2, pos-2); 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 ) ); modificationValues.push_back( std::make_pair( sxoperateur, sxoperande ) );
} }
if( modificationValues.size() ) if( modificationValues.size() )
@ -96,12 +96,12 @@ CStringEx CTypeUnitIntSigned::CalculateResult( const CStringEx _sxbasevalue, con
value.purge(); value.purge();
while( value[0] == '<' ) while( value[0] == '<' )
{ {
unsigned int pos = value.find( '>' ); std::string::size_type pos = value.find( '>' );
if( pos == -1 ) if( pos == std::string::npos )
break; break;
CStringEx sxoperateur = value.get_mid( 1, 1 ); CStringEx sxoperateur = value.get_mid( 1, 1 );
CStringEx sxoperande = value.get_mid( 2, pos-2); CStringEx sxoperande = value.get_mid( 2, (int)pos-2);
value.right( value.size()-pos-1 ); value.right( (int)(value.size()-pos-1) );
modificationValues.push_back( std::make_pair( sxoperateur, sxoperande ) ); modificationValues.push_back( std::make_pair( sxoperateur, sxoperande ) );
} }
if( modificationValues.size() ) if( modificationValues.size() )

View file

@ -69,12 +69,12 @@ CStringEx CTypeUnitIntUnsigned::Format( const CStringEx _sxvalue ) const
value.purge(); value.purge();
while( value[0] == '<' ) while( value[0] == '<' )
{ {
unsigned int pos = value.find( '>' ); std::string::size_type pos = value.find( '>' );
if( pos == -1 ) if( pos == std::string::npos )
break; break;
CStringEx sxoperateur = value.get_mid( 1, 1 ); CStringEx sxoperateur = value.get_mid( 1, 1 );
CStringEx sxoperande = value.get_mid( 2, pos-2); CStringEx sxoperande = value.get_mid( 2, (int)pos-2);
value.right( value.size()-pos-1 ); value.right( (int)(value.size()-pos-1) );
modificationValues.push_back( std::make_pair( sxoperateur, sxoperande ) ); modificationValues.push_back( std::make_pair( sxoperateur, sxoperande ) );
} }
if( modificationValues.size() ) if( modificationValues.size() )
@ -124,12 +124,12 @@ CStringEx CTypeUnitIntUnsigned::CalculateResult( const CStringEx _sxbasevalue, c
value.purge(); value.purge();
while( value[0] == '<' ) while( value[0] == '<' )
{ {
unsigned int pos = value.find( '>' ); std::string::size_type pos = value.find( '>' );
if( pos == -1 ) if( pos == std::string::npos )
break; break;
CStringEx sxoperateur = value.get_mid( 1, 1 ); CStringEx sxoperateur = value.get_mid( 1, 1 );
CStringEx sxoperande = value.get_mid( 2, pos-2); CStringEx sxoperande = value.get_mid( 2, (int)pos-2);
value.right( value.size()-pos-1 ); value.right( (int)(value.size()-pos-1) );
modificationValues.push_back( std::make_pair( sxoperateur, sxoperande ) ); modificationValues.push_back( std::make_pair( sxoperateur, sxoperande ) );
} }
if( modificationValues.size() ) if( modificationValues.size() )

View file

@ -57,7 +57,7 @@ void findIcons(CConfigFile::CVar *var)
vector<string> files; vector<string> files;
// Scan each directory // Scan each directory
for (int i=0 ; i<var->size() ; i++) for (uint i=0 ; i<var->size() ; i++)
{ {
// clear files list // clear files list
files.clear(); files.clear();
@ -82,7 +82,7 @@ string remap2Jpg(const string &s)
{ {
// change extension from TGA to JPG // change extension from TGA to JPG
string jpg(s); string jpg(s);
uint n = jpg.find(".tga"); string::size_type n = jpg.find(".tga");
nlassert(n != string::npos); nlassert(n != string::npos);
jpg.erase(n); jpg.erase(n);
jpg += ".jpg"; jpg += ".jpg";
@ -92,7 +92,7 @@ string remap2Jpg(const string &s)
void writeString(COFile &f, 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) 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 // fix limit based on configuration file
uint n; uint n;
if (sizeLimit == 0) if (sizeLimit == 0)
n = files.size(); n = (uint)files.size();
else else
n = sizeLimit > files.size() ? files.size() : sizeLimit; n = sizeLimit > files.size() ? (uint)files.size() : sizeLimit;
// write each file using this icon // write each file using this icon
for (uint i=0 ; i<n ; i++) for (uint i=0 ; i<n ; i++)
@ -174,7 +174,7 @@ void convertImages(CConfigFile::CVar *var)
CFile::createDirectory("images"); CFile::createDirectory("images");
// Scan each directory // 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)); string path = CPath::standardizePath(var->asString(i));
vector<string> files; vector<string> files;
@ -206,7 +206,7 @@ void convertImages(CConfigFile::CVar *var)
bool endsWith( const CSString& s, const CSString& substring ) 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 ) 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() ); printf( "%s\n", dir.c_str() );
CPath::getPathContent ( dir.c_str(), true, false, true, files ); 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() ); printf( "%d files are processed", files.size() );
@ -240,7 +240,7 @@ void ProcessDirectory( const CSString& dir, const StringVector& extensions )
data.readFromFile( files[i] ); data.readFromFile( files[i] );
// Don't parse LOG // Don't parse LOG
uint n = data.find("<LOG>"); string::size_type n = data.find("<LOG>");
if (n != CSString::npos) if (n != CSString::npos)
data.erase(n); data.erase(n);
@ -328,7 +328,7 @@ void main()
var = cf.getVarPtr("Wildcard"); var = cf.getVarPtr("Wildcard");
if (var) 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++) for (uint it=0; it<listeIcones.size(); it++)
{ {
string wild = var->asString(i); string wild = var->asString(i);

View file

@ -833,7 +833,7 @@ bool CMissionCompiler::publishFiles(const std::string &serverPathPrim, const std
{ {
string dst, src = _FilesToPublish[i]; string dst, src = _FilesToPublish[i];
uint n = src.find("primitives"); string::size_type n = src.find("primitives");
if (n == string::npos) if (n == string::npos)
{ {
// text files : copy it and check include in phrase_rites_wk.txt // 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); std::vector<std::string> values = md.getPropertyArray(prim, arrayProperyName,false, false);
uint first = 0; uint first = 0;
uint last = values.size(); uint last = (uint)values.size();
compilerParams.resize(last); compilerParams.resize(last);
for ( ; first != last; ++first) for ( ; first != last; ++first)
{ {
@ -2244,7 +2244,7 @@ std::vector<TCompilerVarName> TCompilerVarName::getPropertyArrayWithTextStaticDe
std::vector<TCompilerVarName> compilerParams; std::vector<TCompilerVarName> compilerParams;
std::vector<std::string> values = md.getPropertyArray(prim, arrayProperyName,false, false); std::vector<std::string> values = md.getPropertyArray(prim, arrayProperyName,false, false);
uint first = 0; uint first = 0;
uint last = values.size(); uint last = (uint)values.size();
compilerParams.resize(last); compilerParams.resize(last);
for ( ; first != last; ++first) for ( ; first != last; ++first)
{ {

View file

@ -136,7 +136,7 @@ void processItemLine(const string &s)
if (!CSString::isValidFileNameChar(s[field.size()])) if (!CSString::isValidFileNameChar(s[field.size()]))
{ {
// get value // get value
int pos = s.find("="); string::size_type pos = s.find("=");
nlassert(pos != string::npos); nlassert(pos != string::npos);
string val(s, pos+1); string val(s, pos+1);
@ -349,7 +349,7 @@ void updateItemField(CVectorSString &lines, uint itemIndex, uint fieldIndex, uin
for (i=a ; i<b ; i++) for (i=a ; i<b ; i++)
{ {
string line = s + "= " + val; 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) if (pos != string::npos)
{ {
found = true; found = true;
@ -361,7 +361,7 @@ void updateItemField(CVectorSString &lines, uint itemIndex, uint fieldIndex, uin
i = a-1; i = a-1;
while (++i<b && !found) while (++i<b && !found)
{ {
uint pos; string::size_type pos;
// store the line "_CraftParameters" : reference line // store the line "_CraftParameters" : reference line
if (craftLine == 0) if (craftLine == 0)

View file

@ -30,9 +30,9 @@
#include "nel/georges/u_form_elm.h" #include "nel/georges/u_form_elm.h"
#include "nel/georges/u_form_loader.h" #include "nel/georges/u_form_loader.h"
#include "nel/../../src/3d/zone.h" #include "nel/3d/zone.h"
#include "nel/../../src/3d/landscape.h" #include "nel/3d/landscape.h"
#include "nel/../../src/3d/scene_group.h" #include "nel/3d/scene_group.h"
#include <windows.h> #include <windows.h>
@ -121,7 +121,7 @@ public:
pgId= min(pgId, (uint)(BAR_LENGTH-1)); pgId= min(pgId, (uint)(BAR_LENGTH-1));
sprintf (msg, "\r%s: %s", DisplayString.c_str (), progressbar[pgId]); sprintf (msg, "\r%s: %s", DisplayString.c_str (), progressbar[pgId]);
uint i; uint i;
for (i=strlen(msg); i<79; i++) for (i=(uint)strlen(msg); i<79; i++)
msg[i]=' '; msg[i]=' ';
msg[i]=0; msg[i]=0;
printf (msg); printf (msg);
@ -161,8 +161,8 @@ bool getZoneCoordByName(const char * name, uint16& x, uint16& y)
std::string zoneName(name); std::string zoneName(name);
// y // y
uint ind1 = zoneName.find("_"); std::string::size_type ind1 = zoneName.find("_");
if(ind1>=zoneName.length()) if(ind1 == std::string::npos)
{ {
nlwarning("bad file name"); nlwarning("bad file name");
return false; return false;
@ -180,7 +180,7 @@ bool getZoneCoordByName(const char * name, uint16& x, uint16& y)
// x // x
x = 0; x = 0;
uint ind2 = zoneName.length(); uint ind2 = (uint)zoneName.length();
if((ind2-ind1-1)!=2) if((ind2-ind1-1)!=2)
{ {
nlwarning("x code size is not a 2 characters code"); 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); CPath::getPathContent (options.PrimDirs[i], true, false, true, files);
// For each // For each
uint fileCount = files.size (); uint fileCount = (uint)files.size ();
for (i=0; i<fileCount; i++) for (i=0; i<fileCount; i++)
{ {
// Primitive file ? // Primitive file ?
@ -1005,7 +1005,7 @@ int main (int argc, char**argv)
uint layer = instance.AdditionnalInfo[i].SnapLayer; uint layer = instance.AdditionnalInfo[i].SnapLayer;
// Found some triangles ? // Found some triangles ?
const uint setSize = selectedHeight.size (); const uint setSize = (uint)selectedHeight.size ();
if (setSize) if (setSize)
{ {
// Look for the triangle in the good layer // Look for the triangle in the good layer