Changed: #825 Remove all warning when compiling Ryzom on Linux (patch provided by ThibG)

This commit is contained in:
kervala 2010-06-14 11:39:25 +02:00
parent 35ff72952e
commit c637ff51df
8 changed files with 13 additions and 17 deletions

View file

@ -54,8 +54,8 @@ using namespace NLMISC;
struct CSharedClass : public CTransportClass
{
uint16 i2;
uint32 i1;
uint16 i2;
float f1, f2;
vector<uint32> vi1;

View file

@ -63,7 +63,7 @@ struct CSharedClass : public CTransportClass
CEntityId eid;
CSharedClass () : i1(10), i2(10), f1(10), i3(10), str("str10") { vi1.push_back(111); vi1.push_back(222); vi1.push_back(255); }
CSharedClass () : i1(10), i2(10), i3(10), f1(10), str("str10") { vi1.push_back(111); vi1.push_back(222); vi1.push_back(255); }
virtual void description ()
{

View file

@ -84,8 +84,7 @@ int main (int argc, char **argv)
{
char buf[256];
printf("Login: ");
// gcc says: warning: the `gets' function is dangerous and should not be used.
Login = gets(buf);
Login = fgets(buf, 256, stdin);
}
ucstring Password = ConfigFile.getVar("Password").asString();
@ -93,8 +92,7 @@ int main (int argc, char **argv)
{
char buf[256];
printf("Password: ");
// gcc says: warning: the `gets' function is dangerous and should not be used.
Password = gets(buf);
Password = fgets(buf, 256, stdin);
}
// crypt with md5 the password
CHashKeyMD5 hk = getMD5((uint8*)Password.c_str(), Password.size());
@ -120,9 +118,7 @@ int main (int argc, char **argv)
if(sid == 0)
{
printf("Enter the SharId you want to connect to: ");
char buf[256];
gets(buf);
sid = atoi(buf);
scanf("%d", sid);
}
/* Try to connect to the shard number 0 in the list.

View file

@ -60,11 +60,11 @@ void main (int argc, char **argv)
char buf[256];
printf("Login: ");
gets(buf);
fgets(buf, 256, stdin);
string Login(buf);
printf("Password: ");
gets(buf);
fgets(buf, 256, stdin);
string Password(buf);
if (Login.empty ())

View file

@ -56,8 +56,8 @@ public:
NLMISC::TTime CurrentQuantumStart;
CGraph (std::string name, float x, float y, float width, float height, NLMISC::CRGBA backColor, NLMISC::TTime quantum, float maxValue)
: Name(name), X(x), Y(y), Width(width), Height(height), BackColor(backColor), Quantum(quantum),
CurrentQuantumStart(NLMISC::CTime::getLocalTime()), MaxValue(maxValue), Peak(0.0f)
: Name(name), X(x), Y(y), Width(width), Height(height), BackColor(backColor), MaxValue(maxValue), Peak(0.0f), Quantum(quantum),
CurrentQuantumStart(NLMISC::CTime::getLocalTime())
{
if (_Graphs == NULL)
{

View file

@ -88,10 +88,10 @@ class CDfnField
{
public:
explicit CDfnField (const std::string &name) : _name(name), _isAnArray(false)
explicit CDfnField (const std::string &name) : _isAnArray(false), _name(name)
{}
CDfnField (const std::string &name, const bool &isAnArray) : _name(name), _isAnArray(isAnArray)
CDfnField (const std::string &name, const bool &isAnArray) : _isAnArray(isAnArray), _name(name)
{}
virtual ~CDfnField ()

View file

@ -119,7 +119,7 @@ void followBorder(CInteriorSurface &surface, uint first, uint edge, uint sens, v
loop = false;
// -1 means no neighbor at all, -2 means a neighbor that is not available yet
sint32 thisOpposite = (next != NULL) ? next->InternalSurface : (current->Visibility[nextEdge] ? -1 : -2);
if (thisOpposite != currentSurfId && thisOpposite != oppositeSurfId ||
if ((thisOpposite != currentSurfId && thisOpposite != oppositeSurfId) ||
(loop = (current->EdgeFlags[nextEdge] && !allowThis)))
{
// if reaches the end of the border, then quits.

View file

@ -511,7 +511,7 @@ void CSurfaceSplitter::replaceChain(CChainId chainId, const vector<CChainId> &ch
}
}
if (surf = getSurface(chain.Right))
if ((surf = getSurface(chain.Right)))
{
uint loop;
for (loop=0; loop<surf->Loops.size(); ++loop)