diff options
author | krzys-h <krzys_h@interia.pl> | 2013-05-01 13:19:10 +0200 |
---|---|---|
committer | krzys-h <krzys_h@interia.pl> | 2013-05-01 13:19:10 +0200 |
commit | 9e1870f6bdb24e278c06929b8bd13225a7fdf8d3 (patch) | |
tree | e95cb1832a1584ff2e6c5e02941a2d1f80c83bcd | |
parent | 293376b82d8fa313b17685b73c110a33123f9077 (diff) | |
download | colobot-9e1870f6bdb24e278c06929b8bd13225a7fdf8d3.tar.gz colobot-9e1870f6bdb24e278c06929b8bd13225a7fdf8d3.tar.bz2 colobot-9e1870f6bdb24e278c06929b8bd13225a7fdf8d3.zip |
Removed some warnings
+ fix for previous commit
-rw-r--r-- | src/object/auto/autosafe.cpp | 2 | ||||
-rw-r--r-- | src/object/motion/motionant.cpp | 2 | ||||
-rw-r--r-- | src/object/motion/motionbee.cpp | 2 | ||||
-rw-r--r-- | src/object/motion/motionhuman.cpp | 2 | ||||
-rw-r--r-- | src/object/motion/motionspider.cpp | 2 | ||||
-rw-r--r-- | src/object/motion/motionvehicle.cpp | 2 | ||||
-rw-r--r-- | src/object/task/taskbuild.cpp | 2 | ||||
-rw-r--r-- | src/object/task/taskgoto.cpp | 4 | ||||
-rw-r--r-- | src/script/script.cpp | 6 | ||||
-rw-r--r-- | src/sound/sound.h | 2 | ||||
-rw-r--r-- | src/ui/edit.cpp | 10 |
11 files changed, 19 insertions, 17 deletions
diff --git a/src/object/auto/autosafe.cpp b/src/object/auto/autosafe.cpp index fc83400..58c459a 100644 --- a/src/object/auto/autosafe.cpp +++ b/src/object/auto/autosafe.cpp @@ -400,7 +400,7 @@ int CAutoSafe::CountKeys() Math::Vector cPos, oPos; Math::Point rot; ObjectType oType; - float dist, angle, limit, cAngle, oAngle; + float dist, angle, limit = 0.0f, cAngle, oAngle = 0.0f; int i, index; cPos = m_object->GetPosition(0); diff --git a/src/object/motion/motionant.cpp b/src/object/motion/motionant.cpp index 07e743f..3eabc0e 100644 --- a/src/object/motion/motionant.cpp +++ b/src/object/motion/motionant.cpp @@ -425,7 +425,7 @@ bool CMotionAnt::EventFrame(const Event &event) { Math::Vector dir, pos, speed; Math::Point dim; - float s, a, prog, time; + float s, a, prog = 0.0f, time; float tSt[9], tNd[9]; int i, ii, st, nd, action; bool bStop; diff --git a/src/object/motion/motionbee.cpp b/src/object/motion/motionbee.cpp index e4fdd49..a0f4734 100644 --- a/src/object/motion/motionbee.cpp +++ b/src/object/motion/motionbee.cpp @@ -406,7 +406,7 @@ bool CMotionBee::EventProcess(const Event &event) bool CMotionBee::EventFrame(const Event &event) { Math::Vector dir; - float s, a, prog; + float s, a, prog = 0.0f; int action, i, st, nd; bool bStop; diff --git a/src/object/motion/motionhuman.cpp b/src/object/motion/motionhuman.cpp index 76ff353..c469a7e 100644 --- a/src/object/motion/motionhuman.cpp +++ b/src/object/motion/motionhuman.cpp @@ -677,7 +677,7 @@ bool CMotionHuman::EventFrame(const Event &event) float s, a, prog, rTime[2], lTime[2], time, rot, hr, hl; float al, ar, af; float tSt[9], tNd[9]; - float aa, bb, shield, deadFactor, level; + float aa, bb, shield, deadFactor = 0.0f, level; int i, ii, st, nd, action, legAction, armAction; bool bOnBoard, bSwim; diff --git a/src/object/motion/motionspider.cpp b/src/object/motion/motionspider.cpp index f76b65b..a9a9b9b 100644 --- a/src/object/motion/motionspider.cpp +++ b/src/object/motion/motionspider.cpp @@ -363,7 +363,7 @@ bool CMotionSpider::EventFrame(const Event &event) { Math::Vector dir, pos, speed; Math::Point dim; - float s, a, prog, time; + float s, a, prog = 0.0f, time; float tSt[12], tNd[12]; int i, ii, st, nd, action; bool bStop; diff --git a/src/object/motion/motionvehicle.cpp b/src/object/motion/motionvehicle.cpp index d65809e..966fe75 100644 --- a/src/object/motion/motionvehicle.cpp +++ b/src/object/motion/motionvehicle.cpp @@ -1650,7 +1650,7 @@ bool CMotionVehicle::EventFrameFly(const Event &event) bool CMotionVehicle::EventFrameInsect(const Event &event) { Math::Vector dir; - float s, a, prog, time; + float s, a, prog = 0.0f, time; int i, st, nd, action; bool bStop, bOnBoard; diff --git a/src/object/task/taskbuild.cpp b/src/object/task/taskbuild.cpp index b9af475..39479a6 100644 --- a/src/object/task/taskbuild.cpp +++ b/src/object/task/taskbuild.cpp @@ -557,7 +557,7 @@ Error CTaskBuild::FlatFloor() ObjectType type; Math::Vector center, pos, oPos, bPos; Math::Point c, p; - float radius, max, oRadius, bRadius, angle, dist; + float radius, max, oRadius, bRadius = 0.0f, angle, dist; int i, j; bool bLittleFlat, bBase; diff --git a/src/object/task/taskgoto.cpp b/src/object/task/taskgoto.cpp index 3177131..97331dd 100644 --- a/src/object/task/taskgoto.cpp +++ b/src/object/task/taskgoto.cpp @@ -756,7 +756,7 @@ Error CTaskGoto::Start(Math::Vector goal, float altitude, Error CTaskGoto::IsEnded() { Math::Vector pos; - float limit, angle, dist, h, level; + float limit, angle = 0.0f, dist, h, level; if ( m_engine->GetPause() ) return ERR_CONTINUE; if ( m_error != ERR_OK ) return m_error; @@ -1338,7 +1338,7 @@ bool CTaskGoto::GetHotPoint(CObject *pObj, Math::Vector &pos, bool CTaskGoto::LeakSearch(Math::Vector &pos, float &delay) { - CObject *pObj, *pObstacle; + CObject *pObj, *pObstacle = nullptr; Math::Vector iPos, oPos, bPos; float iRadius, oRadius, bRadius, dist, min, dir; int i, j; diff --git a/src/script/script.cpp b/src/script/script.cpp index a9cebe6..5c430d7 100644 --- a/src/script/script.cpp +++ b/src/script/script.cpp @@ -617,9 +617,10 @@ bool CScript::rRadar(CBotVar* var, CBotVar* result, int& exception, void* user) RadarFilter filter; float best, minDist, maxDist, sens, iAngle, angle, focus, d, a; int type, oType, i; - bool bArray; + bool bArray = false; type = OBJECT_NULL; + array = 0; angle = 0.0f; focus = Math::PI*2.0f; minDist = 0.0f*g_unit; @@ -836,7 +837,7 @@ bool CScript::rDetect(CBotVar* var, CBotVar* result, int& exception, void* user) RadarFilter filter; float bGoal, best, minDist, maxDist, sens, iAngle, angle, focus, d, a; int type, oType, i; - bool bArray; + bool bArray = false; Error err; exception = 0; @@ -844,6 +845,7 @@ bool CScript::rDetect(CBotVar* var, CBotVar* result, int& exception, void* user) if ( script->m_primaryTask == 0 ) // no task in progress? { type = OBJECT_NULL; + array = 0; angle = 0.0f; focus = 45.0f*Math::PI/180.0f; minDist = 0.0f*g_unit; diff --git a/src/sound/sound.h b/src/sound/sound.h index 0148242..e6a97df 100644 --- a/src/sound/sound.h +++ b/src/sound/sound.h @@ -167,7 +167,7 @@ class CSoundInterface * Function calls \link CSoundInterface::Cache() \endlink for each file */ inline void CacheAll(std::string path) { - for ( int i = 1; i <= 81; i++ ) { + for ( int i = 1; i <= 80; i++ ) { std::stringstream filename; filename << path << "/sound" << std::setfill('0') << std::setw(3) << i << ".wav"; if ( !Cache(static_cast<Sound>(i), filename.str()) ) diff --git a/src/ui/edit.cpp b/src/ui/edit.cpp index 7e657c8..c9831dd 100644 --- a/src/ui/edit.cpp +++ b/src/ui/edit.cpp @@ -688,7 +688,7 @@ void CEdit::MouseMove(Math::Point mouse) int CEdit::MouseDetect(Math::Point mouse) { Math::Point pos; - float indentLength, offset, size; + float indentLength = 0.0f, offset, size; int i, len, c; bool bTitle; @@ -886,7 +886,7 @@ bool CEdit::HyperGo(EventType event) void CEdit::Draw() { Math::Point pos, ppos, dim, start, end; - float size, indentLength; + float size = 0.0f, indentLength = 0.0f; int i, j, beg, len, c1, c2, o1, o2, eol, iIndex, line; if ( (m_state & STATE_VISIBLE) == 0 ) return; @@ -1877,7 +1877,7 @@ bool CEdit::WriteText(std::string filename) FILE* file; char buffer[1000+20]; int i, j, k, n; - float iDim; + float iDim = 0.0f; if ( filename[0] == 0 ) return false; file = fopen(filename.c_str(), "wb"); @@ -2397,7 +2397,7 @@ void CEdit::MoveChar(int move, bool bWord, bool bSelect) void CEdit::MoveLine(int move, bool bWord, bool bSelect) { - float column, indentLength; + float column, indentLength = 0.0f; int i, line, c; if ( move == 0 ) return; @@ -2956,7 +2956,7 @@ bool CEdit::MinMaj(bool bMaj) void CEdit::Justif() { - float width, size, indentLength; + float width, size, indentLength = 0.0f; int i, j, line, indent; bool bDual, bString, bRem; |