[openjk] 14/32: MP: Fix compiler warnings
Simon McVittie
smcv at debian.org
Sun Mar 12 18:03:03 UTC 2017
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to branch debian/master
in repository openjk.
commit 55de6a695fddc8c89e1d48b4b2701f6c01998694
Author: Xycaleth <alex at acslo.com>
Date: Sat Mar 11 12:23:24 2017 +0000
MP: Fix compiler warnings
---
codemp/rd-vanilla/G2_API.cpp | 77 ++++++++++++++++++-----------------------
codemp/rd-vanilla/tr_shader.cpp | 2 +-
2 files changed, 35 insertions(+), 44 deletions(-)
diff --git a/codemp/rd-vanilla/G2_API.cpp b/codemp/rd-vanilla/G2_API.cpp
index 31ba96c..065f3b9 100644
--- a/codemp/rd-vanilla/G2_API.cpp
+++ b/codemp/rd-vanilla/G2_API.cpp
@@ -905,7 +905,7 @@ qboolean G2API_SetSurfaceOnOff(CGhoul2Info_v &ghoul2, const char *surfaceName, c
{
CGhoul2Info *ghlInfo = NULL;
- if (&ghoul2 && ghoul2.size()>0)
+ if (ghoul2.size()>0)
{
ghlInfo = &ghoul2[0];
}
@@ -1302,7 +1302,7 @@ qboolean G2API_SetBoneAnim(CGhoul2Info_v &ghoul2, const int modelIndex, const ch
{
setFrame=0.0f;
}
- if (&ghoul2 && ghoul2.size()>modelIndex)
+ if (ghoul2.size()>modelIndex)
{
CGhoul2Info *ghlInfo = &ghoul2[modelIndex];
qboolean setPtrs = qfalse;
@@ -1504,7 +1504,7 @@ qboolean G2API_SetBoneAngles(CGhoul2Info_v &ghoul2, const int modelIndex, const
const Eorientations up, const Eorientations left, const Eorientations forward,
qhandle_t *modelList, int blendTime, int currentTime )
{
- if (&ghoul2 && ghoul2.size()>modelIndex)
+ if (ghoul2.size()>modelIndex)
{
CGhoul2Info *ghlInfo = &ghoul2[modelIndex];
qboolean setPtrs = qfalse;
@@ -1841,7 +1841,7 @@ int G2API_AddBolt(CGhoul2Info_v &ghoul2, const int modelIndex, const char *boneN
{
// assert(ghoul2.size()>modelIndex);
- if (&ghoul2 && ghoul2.size()>modelIndex)
+ if (ghoul2.size()>modelIndex)
{
CGhoul2Info *ghlInfo = &ghoul2[modelIndex];
if (G2_SetupModelPointers(ghlInfo))
@@ -1872,9 +1872,7 @@ qboolean G2API_AttachG2Model(CGhoul2Info_v &ghoul2From, int modelFrom, CGhoul2In
if (G2_SetupModelPointers(ghoul2From)&&G2_SetupModelPointers(ghoul2To))
{
// make sure we have a model to attach, a model to attach to, and a bolt on that model
- if (&ghoul2From &&
- &ghoul2To &&
- (ghoul2From.size() > modelFrom) &&
+ if ((ghoul2From.size() > modelFrom) &&
(ghoul2To.size() > toModel) &&
((ghoul2To[toModel].mBltlist[toBoltIndex].boneNumber != -1) || (ghoul2To[toModel].mBltlist[toBoltIndex].surfaceNumber != -1)))
{
@@ -1890,12 +1888,9 @@ qboolean G2API_AttachG2Model(CGhoul2Info_v &ghoul2From, int modelFrom, CGhoul2In
void G2API_SetBoltInfo(CGhoul2Info_v &ghoul2, int modelIndex, int boltInfo)
{
- if (&ghoul2)
+ if (ghoul2.size() > modelIndex)
{
- if (ghoul2.size() > modelIndex)
- {
- ghoul2[modelIndex].mModelBoltLink = boltInfo;
- }
+ ghoul2[modelIndex].mModelBoltLink = boltInfo;
}
}
@@ -1938,7 +1933,7 @@ qboolean G2API_GetBoltMatrix_SPMethod(CGhoul2Info_v &ghoul2, const int modelInde
{
assert(ghoul2.size() > modelIndex);
- if (&ghoul2 && (ghoul2.size() > modelIndex))
+ if ((ghoul2.size() > modelIndex))
{
CGhoul2Info *ghlInfo = &ghoul2[modelIndex];
@@ -2129,7 +2124,7 @@ void G2API_ListBones(CGhoul2Info *ghlInfo, int frame)
qboolean G2API_HaveWeGhoul2Models(CGhoul2Info_v &ghoul2)
{
int i;
- if (&ghoul2 && ghoul2.size())
+ if (ghoul2.size())
{
for (i=0; i<ghoul2.size();i++)
{
@@ -2498,42 +2493,38 @@ void G2API_CopySpecificG2Model(CGhoul2Info_v &ghoul2From, int modelFrom, CGhoul2
//might have been a bug in the reconstruct checking which has since been
//mangled and probably fixed. -rww
- // have we real ghoul2 models yet?
- if (&ghoul2From && &ghoul2To)
+ // assume we actually have a model to copy from
+ if (ghoul2From.size() > modelFrom)
{
- // assume we actually have a model to copy from
- if (ghoul2From.size() > modelFrom)
+ // if we don't have enough models on the to side, resize us so we do
+ if (ghoul2To.size() <= modelTo)
{
- // if we don't have enough models on the to side, resize us so we do
- if (ghoul2To.size() <= modelTo)
- {
- assert (modelTo < 5);
- ghoul2To.resize(modelTo + 1);
+ assert (modelTo < 5);
+ ghoul2To.resize(modelTo + 1);
#if 0
- forceReconstruct = qtrue;
+ forceReconstruct = qtrue;
#endif
- }
- // do the copy
+ }
+ // do the copy
- if (ghoul2To.IsValid() && ghoul2To.size() >= modelTo)
- { //remove the bonecache before we stomp over this instance.
- if (ghoul2To[modelTo].mBoneCache)
- {
- RemoveBoneCache(ghoul2To[modelTo].mBoneCache);
- ghoul2To[modelTo].mBoneCache = 0;
- }
+ if (ghoul2To.IsValid() && ghoul2To.size() >= modelTo)
+ { //remove the bonecache before we stomp over this instance.
+ if (ghoul2To[modelTo].mBoneCache)
+ {
+ RemoveBoneCache(ghoul2To[modelTo].mBoneCache);
+ ghoul2To[modelTo].mBoneCache = 0;
}
- ghoul2To[modelTo] = ghoul2From[modelFrom];
+ }
+ ghoul2To[modelTo] = ghoul2From[modelFrom];
#if 0
- if (forceReconstruct)
- { //rww - we should really do this shouldn't we? If we don't mark a reconstruct after this,
- //and we do a GetBoltMatrix in the same frame, it doesn't reconstruct the skeleton and returns
- //a completely invalid matrix
- ghoul2To[0].mSkelFrameNum = 0;
- }
-#endif
+ if (forceReconstruct)
+ { //rww - we should really do this shouldn't we? If we don't mark a reconstruct after this,
+ //and we do a GetBoltMatrix in the same frame, it doesn't reconstruct the skeleton and returns
+ //a completely invalid matrix
+ ghoul2To[0].mSkelFrameNum = 0;
}
+#endif
}
}
@@ -2626,7 +2617,7 @@ char *G2API_GetGLAName(CGhoul2Info_v &ghoul2, int modelIndex)
{
if (G2_SetupModelPointers(ghoul2))
{
- if (&ghoul2 && (ghoul2.size() > modelIndex))
+ if ((ghoul2.size() > modelIndex))
{
//model_t *mod = R_GetModelByHandle(RE_RegisterModel(ghoul2[modelIndex].mFileName));
//return mod->mdxm->animName;
@@ -2642,7 +2633,7 @@ qboolean G2API_SetNewOrigin(CGhoul2Info_v &ghoul2, const int boltIndex)
{
CGhoul2Info *ghlInfo = NULL;
- if (&ghoul2 && ghoul2.size()>0)
+ if (ghoul2.size()>0)
{
ghlInfo = &ghoul2[0];
}
diff --git a/codemp/rd-vanilla/tr_shader.cpp b/codemp/rd-vanilla/tr_shader.cpp
index 326f039..6f44ae1 100644
--- a/codemp/rd-vanilla/tr_shader.cpp
+++ b/codemp/rd-vanilla/tr_shader.cpp
@@ -3348,7 +3348,7 @@ static inline const int *R_FindLightmap( const int *lightmapIndex )
return lightmapIndex;
// bail if no world dir
- if( tr.worldDir == NULL || !*tr.worldDir )
+ if( tr.worldDir[0] == '\0' )
{
return lightmapsVertex;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/openjk.git
More information about the Pkg-games-commits
mailing list