Changed: #825 Remove all warning when compiling Ryzom

This commit is contained in:
kervala 2010-10-24 20:23:15 +02:00
parent 1fd5c39572
commit 411405feb5
17 changed files with 89 additions and 23 deletions

View file

@ -275,7 +275,7 @@ CAnimation::TAnimId CAnimationState::chooseAnim(uint32 jobSpecialisation, EGSPD:
else else
{ {
uint i; uint i;
uint best; uint best = 0;
const uint count = (uint)_Animations.size (); const uint count = (uint)_Animations.size ();
double bestAng = 1000.0; // Big value to be > to the first element. double bestAng = 1000.0; // Big value to be > to the first element.
for (i=0; i<count; i++) for (i=0; i<count; i++)

View file

@ -868,6 +868,7 @@ CBGDownloaderAccess::~CBGDownloaderAccess()
bool CBGDownloaderAccess::getPatchCompletionFlag(bool clearFlag) bool CBGDownloaderAccess::getPatchCompletionFlag(bool clearFlag)
{ {
// TODO for Linux // TODO for Linux
return false;
} }
//===================================================== //=====================================================
@ -880,6 +881,7 @@ void CBGDownloaderAccess::startTask(const BGDownloader::CTaskDesc &taskDesc, con
bool CBGDownloaderAccess::isTaskEnded(BGDownloader::TTaskResult &result, ucstring &errorMsg) const bool CBGDownloaderAccess::isTaskEnded(BGDownloader::TTaskResult &result, ucstring &errorMsg) const
{ {
// TODO for Linux // TODO for Linux
return false;
} }
//===================================================== //=====================================================

View file

@ -518,7 +518,10 @@ void CCDBNodeBranch::readDelta( NLMISC::TGameCycle gc, CBitMemStream & f )
if ( bitfield[i] ) if ( bitfield[i] )
{ {
if(VerboseDatabase) if(VerboseDatabase)
{
nldebug( "CDB/ATOM: Reading prop[%u] of atom", i ); nldebug( "CDB/ATOM: Reading prop[%u] of atom", i );
}
atomIndex = i; atomIndex = i;
CCDBNodeLeaf *leaf = findLeafAtCount( atomIndex ); CCDBNodeLeaf *leaf = findLeafAtCount( atomIndex );
if ( leaf ) if ( leaf )

View file

@ -490,7 +490,7 @@ string getDebugInformation()
if (IsInRingSession) if (IsInRingSession)
{ {
if (getEditor().isInitialized()) if (getEditor().isInitialized())
str += toString("SessionId: %u\n", getEditor().getDMC().getEditionModule().getCurrentAdventureId()); str += toString("SessionId: %u\n", getEditor().getDMC().getEditionModule().getCurrentAdventureId().asInt());
extern R2::TUserRole UserRoleInSession; extern R2::TUserRole UserRoleInSession;
str += toString("Role: %s\n", UserRoleInSession.toString().c_str()); str += toString("Role: %s\n", UserRoleInSession.toString().c_str());
} }

View file

@ -119,7 +119,9 @@ bool CCurlHttpClient::sendRequest(const std::string& methodWB, const std::string
long r; long r;
curl_easy_getinfo(_Curl, CURLINFO_RESPONSE_CODE, &r); curl_easy_getinfo(_Curl, CURLINFO_RESPONSE_CODE, &r);
if (verbose) if (verbose)
{
nldebug("%u", r); nldebug("%u", r);
}
return true; return true;
} }
@ -157,7 +159,10 @@ bool CCurlHttpClient::sendPostWithCookie(const string &url, const string &name,
bool CCurlHttpClient::receive(string &res, bool verbose) bool CCurlHttpClient::receive(string &res, bool verbose)
{ {
if (verbose) if (verbose)
{
nldebug("Receiving %u bytes", _ReceiveBuffer.size()); nldebug("Receiving %u bytes", _ReceiveBuffer.size());
}
res.clear(); res.clear();
if (_ReceiveBuffer.size()) if (_ReceiveBuffer.size())
res.assign((const char*)&(*(_ReceiveBuffer.begin())), _ReceiveBuffer.size()); res.assign((const char*)&(*(_ReceiveBuffer.begin())), _ReceiveBuffer.size());

View file

@ -89,8 +89,10 @@ void CImpulseDecoder::decode(CBitMemStream &inbox, TPacketNumber receivedPacket,
} }
if (checkOnce) if (checkOnce)
{
nldebug("CLIMPD: at level %d (channel %d), %d actions%s (ReceivedAck=%d/lastAck=%d/nextSentPacket=%d)", level, channel, num, (keep) ? "" : " (discarded)", receivedAck, lastAck, nextSentPacket); nldebug("CLIMPD: at level %d (channel %d), %d actions%s (ReceivedAck=%d/lastAck=%d/nextSentPacket=%d)", level, channel, num, (keep) ? "" : " (discarded)", receivedAck, lastAck, nextSentPacket);
} }
}
} }
void CImpulseDecoder::reset() void CImpulseDecoder::reset()

View file

@ -1814,7 +1814,7 @@ class CAHOpenURL : public IActionHandler
LocalFree( lpMsgBuf ); LocalFree( lpMsgBuf );
} }
#else #else
# pragma message(Install tag not supported) // TODO: for Linux and Mac OS
#endif #endif
/* /*
@ -2823,7 +2823,7 @@ string checkLogin(const string &login, const string &password, const string &cli
if(pPM->isVerboseLog()) if(pPM->isVerboseLog())
{ {
nlinfo ("Exploded, with nl, %zu res", lines.size()); nlinfo ("Exploded, with nl, %u res", (uint)lines.size());
/* for (uint i = 0; i < lines.size(); i++) /* for (uint i = 0; i < lines.size(); i++)
{ {
nlinfo (" > '%s'", lines[i].c_str()); nlinfo (" > '%s'", lines[i].c_str());
@ -2832,7 +2832,7 @@ string checkLogin(const string &login, const string &password, const string &cli
if(lines.size() != nbs+1) if(lines.size() != nbs+1)
{ {
nlwarning("bad shard lines number %zu != %d", lines.size(), nbs+1); nlwarning("bad shard lines number %u != %d", (uint)lines.size(), nbs+1);
nlwarning("'%s'", res.c_str()); nlwarning("'%s'", res.c_str());
return "bad lines numbers (error code 5)"; return "bad lines numbers (error code 5)";
} }
@ -2844,7 +2844,7 @@ string checkLogin(const string &login, const string &password, const string &cli
if(pPM->isVerboseLog()) if(pPM->isVerboseLog())
{ {
nlinfo ("Exploded with '%s', %zu res", "|", res.size()); nlinfo ("Exploded with '%s', %u res", "|", (uint)res.size());
/* for (uint i = 0; i < res.size(); i++) /* for (uint i = 0; i < res.size(); i++)
{ {
nlinfo (" > '%s'", res[i].c_str()); nlinfo (" > '%s'", res[i].c_str());
@ -2853,7 +2853,7 @@ string checkLogin(const string &login, const string &password, const string &cli
if (res.size() < 7 && res.size() > 8) if (res.size() < 7 && res.size() > 8)
{ {
nlwarning("bad | numbers %zu != %d", res.size(), 8); nlwarning("bad | numbers %u != %d", (uint)res.size(), 8);
nlwarning("'%s'", lines[i].c_str()); nlwarning("'%s'", lines[i].c_str());
return "bad pipe numbers (error code 6)"; return "bad pipe numbers (error code 6)";
} }

View file

@ -254,7 +254,7 @@ void CPatchManager::init(const std::vector<std::string>& patchURIs, const std::s
} }
srand(NLMISC::CTime::getSecondsSince1970()); srand(NLMISC::CTime::getSecondsSince1970());
UsedServer = rand() * (sint)PatchServers.size() / (RAND_MAX+1); UsedServer = (sint)((float)(rand() / (RAND_MAX+1)) * (sint)PatchServers.size());
ServerPath = CPath::standardizePath (sServerPath); ServerPath = CPath::standardizePath (sServerPath);
ServerVersion = sServerVersion; ServerVersion = sServerVersion;
@ -1700,29 +1700,58 @@ bool CPatchManager::readBNPHeader(const string &SourceName, vector<SBNPFile> &Fi
nlfseek64 (f, 0, SEEK_END); nlfseek64 (f, 0, SEEK_END);
uint32 nFileSize = NLMISC::CFile::getFileSize (SourceName); uint32 nFileSize = NLMISC::CFile::getFileSize (SourceName);
nlfseek64 (f, nFileSize-sizeof(uint32), SEEK_SET); nlfseek64 (f, nFileSize-sizeof(uint32), SEEK_SET);
uint32 nOffsetFromBegining; uint32 nOffsetFromBegining;
fread (&nOffsetFromBegining, sizeof(uint32), 1, f); if (fread (&nOffsetFromBegining, sizeof(uint32), 1, f) != 1)
if (nlfseek64 (f, nOffsetFromBegining, SEEK_SET) != 0) {
fclose(f);
return false; return false;
}
if (nlfseek64 (f, nOffsetFromBegining, SEEK_SET) != 0)
{
fclose(f);
return false;
}
uint32 nNbFile; uint32 nNbFile;
if (fread (&nNbFile, sizeof(uint32), 1, f) != 1) if (fread (&nNbFile, sizeof(uint32), 1, f) != 1)
{
fclose(f);
return false; return false;
}
for (uint32 i = 0; i < nNbFile; ++i) for (uint32 i = 0; i < nNbFile; ++i)
{ {
uint8 nStringSize; uint8 nStringSize;
char sName[256];
if (fread (&nStringSize, 1, 1, f) != 1) if (fread (&nStringSize, 1, 1, f) != 1)
{
fclose(f);
return false; return false;
}
char sName[256];
if (fread (sName, 1, nStringSize, f) != nStringSize) if (fread (sName, 1, nStringSize, f) != nStringSize)
{
fclose(f);
return false; return false;
}
sName[nStringSize] = 0; sName[nStringSize] = 0;
SBNPFile tmpBNPFile; SBNPFile tmpBNPFile;
tmpBNPFile.Name = sName; tmpBNPFile.Name = sName;
if (fread (&tmpBNPFile.Size, sizeof(uint32), 1, f) != 1) if (fread (&tmpBNPFile.Size, sizeof(uint32), 1, f) != 1)
{
fclose(f);
return false; return false;
}
if (fread (&tmpBNPFile.Pos, sizeof(uint32), 1, f) != 1) if (fread (&tmpBNPFile.Pos, sizeof(uint32), 1, f) != 1)
{
fclose(f);
return false; return false;
}
Files.push_back (tmpBNPFile); Files.push_back (tmpBNPFile);
} }
fclose (f); fclose (f);
@ -1778,7 +1807,13 @@ bool CPatchManager::bnpUnpack(const string &srcBigfile, const string &dstPath, v
{ {
nlfseek64 (bnp, rBNPFile.Pos, SEEK_SET); nlfseek64 (bnp, rBNPFile.Pos, SEEK_SET);
uint8 *ptr = new uint8[rBNPFile.Size]; uint8 *ptr = new uint8[rBNPFile.Size];
fread (ptr, rBNPFile.Size, 1, bnp);
if (fread (ptr, rBNPFile.Size, 1, bnp) != 1)
{
fclose(out);
return false;
}
bool writeError = fwrite (ptr, rBNPFile.Size, 1, out) != 1; bool writeError = fwrite (ptr, rBNPFile.Size, 1, out) != 1;
if (writeError) if (writeError)
{ {
@ -2399,7 +2434,12 @@ void CCheckThread::run ()
CHashKey sha1BNPFile; CHashKey sha1BNPFile;
nlfseek64 (bnp, rBNPFile.Pos, SEEK_SET); nlfseek64 (bnp, rBNPFile.Pos, SEEK_SET);
uint8 *pPtr = new uint8[rBNPFile.Size]; uint8 *pPtr = new uint8[rBNPFile.Size];
fread (pPtr, rBNPFile.Size, 1, bnp); if (fread (pPtr, rBNPFile.Size, 1, bnp) != 1)
{
delete [] pPtr;
break;
}
sha1BNPFile = getSHA1(pPtr, rBNPFile.Size); sha1BNPFile = getSHA1(pPtr, rBNPFile.Size);
delete [] pPtr; delete [] pPtr;
CHashKey sha1RealFile = getSHA1(sRealFilename, true); CHashKey sha1RealFile = getSHA1(sRealFilename, true);
@ -3196,7 +3236,7 @@ bool CPatchManager::download(const std::string& patchFullname, const std::string
pPM->deleteFile(sourceFullname); pPM->deleteFile(sourceFullname);
} }
// file will be save to a .tmp file // file will be save to a .tmp file
std::string extension = ""; std::string extension;
if (patchFullname.size() >= zsStrLength && patchFullname.substr(patchFullname.size() - zsStrLength) == zsStr) if (patchFullname.size() >= zsStrLength && patchFullname.substr(patchFullname.size() - zsStrLength) == zsStr)
{ {
extension = zsStr; extension = zsStr;

View file

@ -34,7 +34,7 @@ using namespace NLMISC;
static std::string uint64ToHex(uint64 size) static std::string uint64ToHex(uint64 size)
{ {
char data[256]; char data[256];
sprintf(data, "%llX", size); sprintf(data, "%"NL_I64"X", size);
return std::string(data); return std::string(data);
} }

View file

@ -1071,7 +1071,7 @@ void renderAll(bool forceFullDetail)
uint maxFullDetailChar = Scene->getMaxSkeletonsInNotCLodForm(); uint maxFullDetailChar = Scene->getMaxSkeletonsInNotCLodForm();
UScene *skyScene = getSkyScene(); UScene *skyScene = getSkyScene();
UScene::TPolygonBalancingMode oldBalancingMode = Scene->getPolygonBalancingMode(); UScene::TPolygonBalancingMode oldBalancingMode = Scene->getPolygonBalancingMode();
UScene::TPolygonBalancingMode oldSkyBalancingMode; UScene::TPolygonBalancingMode oldSkyBalancingMode = UScene::PolygonBalancingOff;
if (skyScene) if (skyScene)
{ {
oldSkyBalancingMode = skyScene->getPolygonBalancingMode(); oldSkyBalancingMode = skyScene->getPolygonBalancingMode();

View file

@ -602,7 +602,7 @@ void CMicroLifeManager::tileAdded(const NL3D::CTileAddedInfo &infos)
// K ^ Normal resolves to [-y x 0] // K ^ Normal resolves to [-y x 0]
// if z is near from 1.f or -1.f then no rotation is performed (because [-y x 0] tends to 0 and can't be normalized) // if z is near from 1.f or -1.f then no rotation is performed (because [-y x 0] tends to 0 and can't be normalized)
CVector rotAxis; // rotation axis to match Z of model with normal CVector rotAxis; // rotation axis to match Z of model with normal
float angle; // angle of rotation to match Z of model with normal float angle = 0.f; // angle of rotation to match Z of model with normal
// see if want rotation // see if want rotation
if (!sfs.DontRotate) if (!sfs.DontRotate)
{ {
@ -623,7 +623,7 @@ void CMicroLifeManager::tileAdded(const NL3D::CTileAddedInfo &infos)
} }
} }
float angleAroundNormal; float angleAroundNormal = 0.f;
// see if want rotation around normal // see if want rotation around normal
if (!sfs.DontRotateAroundLocalZ) if (!sfs.DontRotateAroundLocalZ)
{ {

View file

@ -247,6 +247,9 @@ void CUserControls::update()
case ThirdMode: case ThirdMode:
thirdMode(); thirdMode();
break; break;
default:
break;
} }
_LastFrameForward = Actions.valide("forward") && !_NeedReleaseForward; _LastFrameForward = Actions.valide("forward") && !_NeedReleaseForward;
@ -1094,6 +1097,9 @@ void CUserControls::mode(const TMoveMode mode)
case ThirdMode: case ThirdMode:
thirdModeStop(); thirdModeStop();
break; break;
default:
break;
} }
// Backup the last Mode. // Backup the last Mode.
@ -1127,6 +1133,9 @@ void CUserControls::mode(const TMoveMode mode)
case ThirdMode: case ThirdMode:
thirdModeStart(); thirdModeStart();
break; break;
default:
break;
} }
}// mode // }// mode //

View file

@ -881,7 +881,7 @@ void CInterfaceChatDisplayer::clearChannel(CChatGroup::TGroupType mode, uint32 d
else if (mode == CChatGroup::dyn_chat) else if (mode == CChatGroup::dyn_chat)
{ {
// if correct dbIndex, clear // if correct dbIndex, clear
if(dynChatDbIndex>=0 && dynChatDbIndex<CChatGroup::MaxDynChanPerPlayer) if(dynChatDbIndex<CChatGroup::MaxDynChanPerPlayer)
PeopleInterraction.ChatInput.DynamicChat[dynChatDbIndex].clearMessages(); PeopleInterraction.ChatInput.DynamicChat[dynChatDbIndex].clearMessages();
else else
nlwarning("Dynamic chat %d not found for clearing", dynChatDbIndex); nlwarning("Dynamic chat %d not found for clearing", dynChatDbIndex);
@ -925,7 +925,7 @@ void impulseDynString(NLMISC::CBitMemStream &impulse)
void inpulseDynStringInChatGroup(NLMISC::CBitMemStream &impulse) void inpulseDynStringInChatGroup(NLMISC::CBitMemStream &impulse)
{ {
CChatGroup::TGroupType type; CChatGroup::TGroupType type = CChatGroup::say;
impulse.serialEnum(type); impulse.serialEnum(type);
ChatMngr.processChatStringWithNoSender(impulse, type, InterfaceChatDisplayer); ChatMngr.processChatStringWithNoSender(impulse, type, InterfaceChatDisplayer);
} }
@ -1566,6 +1566,7 @@ void impulseTPCommon2(NLMISC::CBitMemStream &impulse, bool hasSeason)
case R2::TPContext_Mainland: tpIcon = "cancel_tp_main_land.tga"; break; case R2::TPContext_Mainland: tpIcon = "cancel_tp_main_land.tga"; break;
case R2::TPContext_Edit: tpIcon = "cancel_tp_edit.tga"; break; case R2::TPContext_Edit: tpIcon = "cancel_tp_edit.tga"; break;
case R2::TPContext_IslandOwner: tpIcon = "cancel_tp_island_owner.tga"; break; case R2::TPContext_IslandOwner: tpIcon = "cancel_tp_island_owner.tga"; break;
default: break;
} }
ProgressBar.setTPMessages(tpReason, tpCancelText, tpIcon); ProgressBar.setTPMessages(tpReason, tpCancelText, tpIcon);
} }
@ -1620,6 +1621,8 @@ void impulseTPCommon2(NLMISC::CBitMemStream &impulse, bool hasSeason)
case R2::TPContext_IslandOwner: case R2::TPContext_IslandOwner:
CInterfaceManager::getInstance()->runActionHandler("r2_stop_live", NULL); CInterfaceManager::getInstance()->runActionHandler("r2_stop_live", NULL);
break; break;
default:
break;
} }
} }

View file

@ -127,10 +127,12 @@ void drawLoadingBitmap (float progress)
float y2 = 1; float y2 = 1;
if ((ww > 1024) || (wh > 768)) if ((ww > 1024) || (wh > 768))
{
if ((ww - 1024) > (wh - 768)) if ((ww - 1024) > (wh - 768))
x1 = ((ww - (wh * 1024.f) / 768.f) / 2.f) / ww; x1 = ((ww - (wh * 1024.f) / 768.f) / 2.f) / ww;
else else
y1 = ((wh - (ww * 768.f) / 1024.f) / 2.f) / wh; y1 = ((wh - (ww * 768.f) / 1024.f) / 2.f) / wh;
}
if (x1 != 0) if (x1 != 0)
x2 = 1 - x1; x2 = 1 - x1;

View file

@ -655,7 +655,7 @@ void CSessionBrowserImpl::charsFill(const std::vector <RSMGR::TCharDesc > &chars
// **************************************************************************** // ****************************************************************************
inline double ecoRingPoints(const std::string & ecoPoints, char * c) inline double ecoRingPoints(const std::string & ecoPoints, const char * c)
{ {
std::string::size_type cPlace = ecoPoints.find(c); std::string::size_type cPlace = ecoPoints.find(c);
if(cPlace==string::npos) if(cPlace==string::npos)

View file

@ -1199,7 +1199,7 @@ void CStringManagerClient::initI18NSpecialWords(const std::string &languageCode)
STRING_MANAGER::readExcelSheet(ucs, ws); STRING_MANAGER::readExcelSheet(ucs, ws);
// Get the Key and Data ColIndex. // Get the Key and Data ColIndex.
uint nameColIndex, keyColIndex; uint nameColIndex = 0, keyColIndex = 0;
if( !ws.findCol(ucstring("name"), nameColIndex) ) if( !ws.findCol(ucstring("name"), nameColIndex) )
continue; continue;
if( !ws.findCol(ucstring(specialWords[i*3+1]), keyColIndex) ) if( !ws.findCol(ucstring(specialWords[i*3+1]), keyColIndex) )

View file

@ -604,7 +604,7 @@ void CWeatherManagerClient::updateThunder(uint64 day, float hour, const CWeather
CThunderTime t1; CThunderTime t1;
float manualThunderThreshold; float manualThunderThreshold = 0.f;
if (manual) if (manual)
{ {
if (wc.WF) if (wc.WF)