summaryrefslogtreecommitdiff
path: root/goodies
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2006-06-19 20:52:08 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2006-06-19 20:52:08 +0000
commitfb01683a1933a775f5fbc849bde3583f0afccaba (patch)
treeaa5575cfbd17cd58f7814303cd92d2511fc73916 /goodies
parentd4afee2dcd66fb452829fb88ccdc530c3c0e527d (diff)
INTEGRATION: CWS warnings01 (1.3.28); FILE MERGED
2005/10/28 12:34:00 sj 1.3.28.1: #i55991# warning free code
Diffstat (limited to 'goodies')
-rw-r--r--goodies/source/inv/monst.cxx36
-rw-r--r--goodies/source/inv/shapes.cxx47
2 files changed, 51 insertions, 32 deletions
diff --git a/goodies/source/inv/monst.cxx b/goodies/source/inv/monst.cxx
index d2fa67d3cf56..5fa1d44c8564 100644
--- a/goodies/source/inv/monst.cxx
+++ b/goodies/source/inv/monst.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: monst.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: rt $ $Date: 2005-09-09 03:07:44 $
+ * last change: $Author: hr $ $Date: 2006-06-19 21:51:14 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -47,12 +47,7 @@
#endif
Gegner::Gegner(Fighter* pFig, Bombe* pBom, ResMgr* pRes) :
- pFighter(pFig),
GegnerListe(0,0),
- bDown(FALSE),
- bLeft(TRUE),
- bAuseMode(FALSE),
- pBombe(pBom),
pBitMonst1(0L),
pBitMonst2(0L),
pBitMonst3(0L),
@@ -64,6 +59,11 @@ Gegner::Gegner(Fighter* pFig, Bombe* pBom, ResMgr* pRes) :
pBitMonst5(0L),
pBitMonst5a(0L),
pBitMonst5b(0L),
+ pBombe(pBom),
+ pFighter(pFig),
+ bDown(FALSE),
+ bLeft(TRUE),
+ bAuseMode(FALSE),
nDown(MOVEY)
{
pBitMonst1 = ImplLoadImage( MONSTER1, pRes );
@@ -140,8 +140,8 @@ void Gegner::InsertGegner(USHORT nType, USHORT x, USHORT y)
void Gegner::Move()
{
BOOL bNextDown = FALSE;
-
- for(long i=0; i<Count(); i++)
+ unsigned long i;
+ for(i=0; i<Count(); i++)
{
if(bDown)
{
@@ -183,8 +183,8 @@ void Gegner::DrawGegner(OutputDevice* pDev,Point* pStart)
srand(aTime.GetTime() % 1000);
nMaxX = pDev->GetOutputSizePixel().Width()-pStart->X();
-
- for(long i=0; i<Count();i++)
+ unsigned long i;
+ for(i=0; i<Count();i++)
{
switch(GegType(i))
{
@@ -331,10 +331,12 @@ void Gegner::DrawGegner(OutputDevice* pDev,Point* pStart)
int nScaledLimit;
// NOTE: the two expressions are the same in floatingpoint but not in integer
- if ( RAND_MAX < 32767 )
- nScaledLimit = GetRandWert() / (32767 / RAND_MAX);
+
+ int nRandMax = RAND_MAX;
+ if ( nRandMax < 32767 )
+ nScaledLimit = GetRandWert() / ( 32767 / nRandMax );
else
- nScaledLimit = GetRandWert() * (RAND_MAX / 32767);
+ nScaledLimit = GetRandWert() * ( nRandMax / 32767);
if(GegType(i) != GEGNER5)
{
@@ -362,7 +364,8 @@ long Gegner::Kollision(Rectangle& rRect, Explosion* pExpl)
Rectangle aWork;
- for(long i=0; i<Count();i++)
+ unsigned long i;
+ for( i=0; i<Count();i++)
{
aWork = GegnerKoll(i);
if((aWork.Left() <= rRect.Left() && aWork.Right() >= rRect.Right()) &&
@@ -424,7 +427,8 @@ BOOL Gegner::RemoveGegner()
void Gegner::ClearAll()
{
- for(long i=0; i<Count(); i++)
+ unsigned long i;
+ for( i=0; i<Count(); i++ )
delete GetObject(i);
Clear();
diff --git a/goodies/source/inv/shapes.cxx b/goodies/source/inv/shapes.cxx
index 9fd571226d31..26cc7442052e 100644
--- a/goodies/source/inv/shapes.cxx
+++ b/goodies/source/inv/shapes.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: shapes.cxx,v $
*
- * $Revision: 1.3 $
+ * $Revision: 1.4 $
*
- * last change: $Author: rt $ $Date: 2005-09-09 03:08:43 $
+ * last change: $Author: hr $ $Date: 2006-06-19 21:52:08 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -47,12 +47,12 @@ Image* ImplLoadImage( USHORT nId, ResMgr* pRes )
// ------------------------------------------------------------------------
Fighter::Fighter(Size& rOut, ResMgr* pRes) :
- pFight1(0L),
- pFightr(0L),
- pFightl(0L),
- bNoKey(FALSE),
+ pFightr(NULL),
+ pFightl(NULL),
eMode(FIGHT_NORM),
- nDelay(0)
+ bNoKey(FALSE),
+ nDelay(0),
+ pFight1(NULL)
{
pFight1 = ImplLoadImage( FIGHTER1, pRes );
pFightr = ImplLoadImage( FIGHTERR, pRes );
@@ -98,6 +98,8 @@ void Fighter::Paint(OutputDevice& rDev)
case FIGHT_LEFT:
rDev.DrawImage(aOut,*pFightl);
break;
+ case FIGHT_DEST:
+ break;
}
if(nDelay <= 0)
@@ -149,8 +151,8 @@ BOOL Fighter::Kollision(Rectangle aRect, Explosion* pExpl)
Munition::Munition(ResMgr* pRes) :
MunitionListe(0,1),
- pMunition1(0L),
- pMunition2(0L)
+ pMunition2( NULL ),
+ pMunition1( NULL )
{
pMunition1 = ImplLoadImage( MUNITION1,pRes );
pMunition2 = ImplLoadImage( MUNITION2,pRes );
@@ -182,7 +184,8 @@ void Munition::Start(Point& rPoint)
void Munition::Paint(OutputDevice& rDev)
{
- for(long i=0; i<Count();i++)
+ unsigned long i;
+ for(i=0; i<Count();i++)
{
switch(GetMode(i))
{
@@ -194,6 +197,8 @@ void Munition::Paint(OutputDevice& rDev)
rDev.DrawImage(GetPoint(i),*pMunition2);
SetMode(i,MUNI_MODE1);
break;
+ case MUNI_DEL:
+ break;
}
SetKoll(i,Rectangle(Point(GetPoint(i).X()+aSize.Width()/2,GetPoint(i).Y()),
@@ -250,7 +255,8 @@ Bombe::~Bombe()
void Bombe::Paint(OutputDevice& rDev)
{
- for(long i=0; i<Count();i++)
+ unsigned long i;
+ for(i=0; i<Count();i++)
{
rDev.DrawImage(GetPoint(i),*pBombe);
SetKoll(i,Rectangle(Point(GetPoint(i).X()+aSize.Width()/2,
@@ -285,14 +291,16 @@ void Bombe::RemoveBomben()
void Bombe::ClearAll()
{
- for(long i=0;i<Count();i++)
+ unsigned long i;
+ for(i=0;i<Count();i++)
delete GetObject(i);
Clear();
}
BOOL Bombe::Kollision(Rectangle aRect, Explosion* pExpl)
{
- for(long i=0;i<Count();i++)
+ unsigned long i;
+ for(i=0;i<Count();i++)
{
if((GetPoint(i).X() <= aRect.Left() && GetPoint(i).X()+aSize.Width() >= aRect.Right()) &&
(GetPoint(i).Y() <= aRect.Top() && GetPoint(i).Y()+aSize.Height() >= aRect.Bottom()))
@@ -351,7 +359,8 @@ Wall::~Wall()
void Wall::Paint(OutputDevice& rDev)
{
- for(long i=0; i<Count(); i++)
+ unsigned long i;
+ for(i=0; i<Count(); i++)
{
switch(GetMode(i))
{
@@ -385,6 +394,8 @@ void Wall::Paint(OutputDevice& rDev)
case WALL_MOD10:
rDev.DrawImage(GetPoint(i),*pWall10);
break;
+ case WALL_DEL:
+ break;
}
}
@@ -403,7 +414,8 @@ void Wall::InsertWall(const Point& rPoint)
void Wall::ClearAll()
{
- for(long i=0; i<Count(); i++)
+ unsigned long i;
+ for(i=0; i<Count(); i++)
delete GetObject(i);
Clear();
@@ -415,7 +427,8 @@ BOOL Wall::Kollision(Rectangle& rRect, BOOL bDel)
Rectangle aWork;
- for(long i=0; i<Count();i++)
+ unsigned long i;
+ for(i=0; i<Count();i++)
{
Point aPoint = GetPoint(i);
@@ -459,6 +472,8 @@ BOOL Wall::Kollision(Rectangle& rRect, BOOL bDel)
case WALL_MOD10:
SetMode(i,WALL_DEL);
break;
+ case WALL_DEL:
+ break;
}
if(bDel)