diff --git a/code/nel/samples/net/class_transport/ai_service.cpp b/code/nel/samples/net/class_transport/ai_service.cpp index 523f6e0e1..1fbf31148 100644 --- a/code/nel/samples/net/class_transport/ai_service.cpp +++ b/code/nel/samples/net/class_transport/ai_service.cpp @@ -54,8 +54,8 @@ using namespace NLMISC; struct CSharedClass : public CTransportClass { - uint16 i2; uint32 i1; + uint16 i2; float f1, f2; vector vi1; diff --git a/code/nel/samples/net/class_transport/gd_service.cpp b/code/nel/samples/net/class_transport/gd_service.cpp index 788c239d4..f2cb8e31e 100644 --- a/code/nel/samples/net/class_transport/gd_service.cpp +++ b/code/nel/samples/net/class_transport/gd_service.cpp @@ -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 () { diff --git a/code/nel/samples/net/login_system/client.cpp b/code/nel/samples/net/login_system/client.cpp index 8066ec8e3..532b1a22c 100644 --- a/code/nel/samples/net/login_system/client.cpp +++ b/code/nel/samples/net/login_system/client.cpp @@ -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. diff --git a/code/nel/samples/net/multi_shards/client.cpp b/code/nel/samples/net/multi_shards/client.cpp index 6d256fd66..89bac4b95 100644 --- a/code/nel/samples/net/multi_shards/client.cpp +++ b/code/nel/samples/net/multi_shards/client.cpp @@ -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 ()) diff --git a/code/nel/samples/net/udp/graph.h b/code/nel/samples/net/udp/graph.h index 1797db65f..6fc4a05c5 100644 --- a/code/nel/samples/net/udp/graph.h +++ b/code/nel/samples/net/udp/graph.h @@ -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) { diff --git a/code/nel/tools/georges/georges2csv/georges2csv.cpp b/code/nel/tools/georges/georges2csv/georges2csv.cpp index 8b559dcab..54e874fa8 100644 --- a/code/nel/tools/georges/georges2csv/georges2csv.cpp +++ b/code/nel/tools/georges/georges2csv/georges2csv.cpp @@ -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 () diff --git a/code/nel/tools/pacs/build_indoor_rbank/build_surfaces.cpp b/code/nel/tools/pacs/build_indoor_rbank/build_surfaces.cpp index 30e652915..86f140524 100644 --- a/code/nel/tools/pacs/build_indoor_rbank/build_surfaces.cpp +++ b/code/nel/tools/pacs/build_indoor_rbank/build_surfaces.cpp @@ -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. diff --git a/code/nel/tools/pacs/build_rbank/surface_splitter.cpp b/code/nel/tools/pacs/build_rbank/surface_splitter.cpp index a82cf66ec..37cbbe753 100644 --- a/code/nel/tools/pacs/build_rbank/surface_splitter.cpp +++ b/code/nel/tools/pacs/build_rbank/surface_splitter.cpp @@ -511,7 +511,7 @@ void CSurfaceSplitter::replaceChain(CChainId chainId, const vector &ch } } - if (surf = getSurface(chain.Right)) + if ((surf = getSurface(chain.Right))) { uint loop; for (loop=0; loopLoops.size(); ++loop)