diff --git a/code/ryzom/tools/leveldesign/csv_transform/csv_transform.cpp b/code/ryzom/tools/leveldesign/csv_transform/csv_transform.cpp index cf4cb30d4..ae405d519 100644 --- a/code/ryzom/tools/leveldesign/csv_transform/csv_transform.cpp +++ b/code/ryzom/tools/leveldesign/csv_transform/csv_transform.cpp @@ -37,7 +37,7 @@ void splitStringCSV(const CSString& in,const CSString& separator,vectorfirstChange;) + for (uint32 i=(uint32)tblColumnNames.size();(i--)>firstChange;) { CSString s=footers[tblColumnNames[i]]; for (uint32 j=1;j' ); - 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() ) diff --git a/code/ryzom/tools/leveldesign/georges_convert/type_unit_int_signed.cpp b/code/ryzom/tools/leveldesign/georges_convert/type_unit_int_signed.cpp index 8455d0c3d..ab845a251 100644 --- a/code/ryzom/tools/leveldesign/georges_convert/type_unit_int_signed.cpp +++ b/code/ryzom/tools/leveldesign/georges_convert/type_unit_int_signed.cpp @@ -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() ) diff --git a/code/ryzom/tools/leveldesign/georges_convert/type_unit_int_unsigned.cpp b/code/ryzom/tools/leveldesign/georges_convert/type_unit_int_unsigned.cpp index 3155aef63..01312b9b4 100644 --- a/code/ryzom/tools/leveldesign/georges_convert/type_unit_int_unsigned.cpp +++ b/code/ryzom/tools/leveldesign/georges_convert/type_unit_int_unsigned.cpp @@ -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() ) diff --git a/code/ryzom/tools/leveldesign/icon_search/icon_search.cpp b/code/ryzom/tools/leveldesign/icon_search/icon_search.cpp index 27d9b7e5e..64bf4f39b 100644 --- a/code/ryzom/tools/leveldesign/icon_search/icon_search.cpp +++ b/code/ryzom/tools/leveldesign/icon_search/icon_search.cpp @@ -57,7 +57,7 @@ void findIcons(CConfigFile::CVar *var) vector files; // Scan each directory - for (int i=0 ; isize() ; i++) + for (uint i=0 ; isize() ; 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 ; isize() ; i++) + for (uint i=0 ; isize() ; i++) { string path = CPath::standardizePath(var->asString(i)); vector 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(""); + string::size_type n = data.find(""); if (n != CSString::npos) data.erase(n); @@ -328,7 +328,7 @@ void main() var = cf.getVarPtr("Wildcard"); if (var) - for (int i=0 ; isize() ; i++) + for (uint i=0 ; isize() ; i++) for (uint it=0; itasString(i); diff --git a/code/ryzom/tools/leveldesign/mission_compiler_lib/mission_compiler.cpp b/code/ryzom/tools/leveldesign/mission_compiler_lib/mission_compiler.cpp index 051808791..242a7ed72 100644 --- a/code/ryzom/tools/leveldesign/mission_compiler_lib/mission_compiler.cpp +++ b/code/ryzom/tools/leveldesign/mission_compiler_lib/mission_compiler.cpp @@ -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::getPropertyArrayWithText(const s std::vector 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::getPropertyArrayWithTextStaticDe std::vector compilerParams; std::vector 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) { diff --git a/code/ryzom/tools/leveldesign/named_items_2_csv/named_items_2_csv.cpp b/code/ryzom/tools/leveldesign/named_items_2_csv/named_items_2_csv.cpp index cc1a3a31d..9b53f4110 100644 --- a/code/ryzom/tools/leveldesign/named_items_2_csv/named_items_2_csv.cpp +++ b/code/ryzom/tools/leveldesign/named_items_2_csv/named_items_2_csv.cpp @@ -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 @@ -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