Changed: #825 Remove all warning when compiling Ryzom

This commit is contained in:
kervala 2010-10-24 20:23:15 +02:00
parent 77b5aab4f5
commit 65fffec520
17 changed files with 89 additions and 23 deletions

View file

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

View file

@ -868,6 +868,7 @@ CBGDownloaderAccess::~CBGDownloaderAccess()
bool CBGDownloaderAccess::getPatchCompletionFlag(bool clearFlag)
{
// 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
{
// TODO for Linux
return false;
}
//=====================================================

View file

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

View file

@ -490,7 +490,7 @@ string getDebugInformation()
if (IsInRingSession)
{
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;
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;
curl_easy_getinfo(_Curl, CURLINFO_RESPONSE_CODE, &r);
if (verbose)
{
nldebug("%u", r);
}
return true;
}
@ -157,7 +159,10 @@ bool CCurlHttpClient::sendPostWithCookie(const string &url, const string &name,
bool CCurlHttpClient::receive(string &res, bool verbose)
{
if (verbose)
{
nldebug("Receiving %u bytes", _ReceiveBuffer.size());
}
res.clear();
if (_ReceiveBuffer.size())
res.assign((const char*)&(*(_ReceiveBuffer.begin())), _ReceiveBuffer.size());

View file

@ -89,7 +89,9 @@ void CImpulseDecoder::decode(CBitMemStream &inbox, TPacketNumber receivedPacket,
}
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);
}
}
}

View file

@ -1814,7 +1814,7 @@ class CAHOpenURL : public IActionHandler
LocalFree( lpMsgBuf );
}
#else
# pragma message(Install tag not supported)
// TODO: for Linux and Mac OS
#endif
/*
@ -2823,7 +2823,7 @@ string checkLogin(const string &login, const string &password, const string &cli
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++)
{
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)
{
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());
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())
{
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++)
{
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)
{
nlwarning("bad | numbers %zu != %d", res.size(), 8);
nlwarning("bad | numbers %u != %d", (uint)res.size(), 8);
nlwarning("'%s'", lines[i].c_str());
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());
UsedServer = rand() * (sint)PatchServers.size() / (RAND_MAX+1);
UsedServer = (sint)((float)(rand() / (RAND_MAX+1)) * (sint)PatchServers.size());
ServerPath = CPath::standardizePath (sServerPath);
ServerVersion = sServerVersion;
@ -1700,29 +1700,58 @@ bool CPatchManager::readBNPHeader(const string &SourceName, vector<SBNPFile> &Fi
nlfseek64 (f, 0, SEEK_END);
uint32 nFileSize = NLMISC::CFile::getFileSize (SourceName);
nlfseek64 (f, nFileSize-sizeof(uint32), SEEK_SET);
uint32 nOffsetFromBegining;
fread (&nOffsetFromBegining, sizeof(uint32), 1, f);
if (nlfseek64 (f, nOffsetFromBegining, SEEK_SET) != 0)
if (fread (&nOffsetFromBegining, sizeof(uint32), 1, f) != 1)
{
fclose(f);
return false;
}
if (nlfseek64 (f, nOffsetFromBegining, SEEK_SET) != 0)
{
fclose(f);
return false;
}
uint32 nNbFile;
if (fread (&nNbFile, sizeof(uint32), 1, f) != 1)
{
fclose(f);
return false;
}
for (uint32 i = 0; i < nNbFile; ++i)
{
uint8 nStringSize;
char sName[256];
if (fread (&nStringSize, 1, 1, f) != 1)
{
fclose(f);
return false;
}
char sName[256];
if (fread (sName, 1, nStringSize, f) != nStringSize)
{
fclose(f);
return false;
}
sName[nStringSize] = 0;
SBNPFile tmpBNPFile;
tmpBNPFile.Name = sName;
if (fread (&tmpBNPFile.Size, sizeof(uint32), 1, f) != 1)
{
fclose(f);
return false;
}
if (fread (&tmpBNPFile.Pos, sizeof(uint32), 1, f) != 1)
{
fclose(f);
return false;
}
Files.push_back (tmpBNPFile);
}
fclose (f);
@ -1778,7 +1807,13 @@ bool CPatchManager::bnpUnpack(const string &srcBigfile, const string &dstPath, v
{
nlfseek64 (bnp, rBNPFile.Pos, SEEK_SET);
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;
if (writeError)
{
@ -2399,7 +2434,12 @@ void CCheckThread::run ()
CHashKey sha1BNPFile;
nlfseek64 (bnp, rBNPFile.Pos, SEEK_SET);
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);
delete [] pPtr;
CHashKey sha1RealFile = getSHA1(sRealFilename, true);
@ -3196,7 +3236,7 @@ bool CPatchManager::download(const std::string& patchFullname, const std::string
pPM->deleteFile(sourceFullname);
}
// file will be save to a .tmp file
std::string extension = "";
std::string extension;
if (patchFullname.size() >= zsStrLength && patchFullname.substr(patchFullname.size() - zsStrLength) == zsStr)
{
extension = zsStr;

View file

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

View file

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

View file

@ -602,7 +602,7 @@ void CMicroLifeManager::tileAdded(const NL3D::CTileAddedInfo &infos)
// 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)
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
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
if (!sfs.DontRotateAroundLocalZ)
{

View file

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

View file

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

View file

@ -127,10 +127,12 @@ void drawLoadingBitmap (float progress)
float y2 = 1;
if ((ww > 1024) || (wh > 768))
{
if ((ww - 1024) > (wh - 768))
x1 = ((ww - (wh * 1024.f) / 768.f) / 2.f) / ww;
else
y1 = ((wh - (ww * 768.f) / 1024.f) / 2.f) / wh;
}
if (x1 != 0)
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);
if(cPlace==string::npos)

View file

@ -1199,7 +1199,7 @@ void CStringManagerClient::initI18NSpecialWords(const std::string &languageCode)
STRING_MANAGER::readExcelSheet(ucs, ws);
// Get the Key and Data ColIndex.
uint nameColIndex, keyColIndex;
uint nameColIndex = 0, keyColIndex = 0;
if( !ws.findCol(ucstring("name"), nameColIndex) )
continue;
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;
float manualThunderThreshold;
float manualThunderThreshold = 0.f;
if (manual)
{
if (wc.WF)