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 f52b581031
commit e76621595b
8 changed files with 13 additions and 17 deletions

View file

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

View file

@ -63,7 +63,7 @@ struct CSharedClass : public CTransportClass
CEntityId eid; 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 () virtual void description ()
{ {

View file

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

View file

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

View file

@ -88,10 +88,10 @@ class CDfnField
{ {
public: 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 () virtual ~CDfnField ()

View file

@ -119,7 +119,7 @@ void followBorder(CInteriorSurface &surface, uint first, uint edge, uint sens, v
loop = false; loop = false;
// -1 means no neighbor at all, -2 means a neighbor that is not available yet // -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); 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))) (loop = (current->EdgeFlags[nextEdge] && !allowThis)))
{ {
// if reaches the end of the border, then quits. // 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; uint loop;
for (loop=0; loop<surf->Loops.size(); ++loop) for (loop=0; loop<surf->Loops.size(); ++loop)