Merge pull request #1294 from marauder2k9-torque/Various-Warnings-from-Mac

various warnings
This commit is contained in:
Brian Roberts 2024-07-23 11:43:57 -05:00 committed by GitHub
commit b453b82095
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 29 additions and 24 deletions

View file

@ -232,7 +232,7 @@ class ParticleEmitter : public GameBase
void addParticle(const Point3F &pos, const Point3F &axis, const Point3F &vel, const Point3F &axisx, const U32 age_offset);
inline void setupBillboard( Particle *part,
void setupBillboard( Particle *part,
Point3F *basePts,
const MatrixF &camView,
const LinearColorF &ambientColor,

View file

@ -495,6 +495,9 @@ void ProximityMine::processTick( const Move* move )
return;
}
break;
default:
// just break out, unknown state, covers warnings for not fulfilling all possiblities in enum.
break;
}
}
}

View file

@ -407,8 +407,9 @@ U32 SFXEmitter::packUpdate(NetConnection* con, U32 mask, BitStream* stream)
stream->writeAffineTransform(mObjToWorld);
// track
if (stream->writeFlag(mask & DirtyUpdateMask))
if (stream->writeFlag(mask & DirtyUpdateMask)){
PACK_ASSET(con, Sound);
}
//if (stream->writeFlag(mDirty.test(Track)))
// sfxWrite( stream, mTrack );

View file

@ -2806,11 +2806,11 @@ DefineEngineFunction(getTimestamp, const char*, (), ,
#ifdef TORQUE_TOOLS
DefineEngineFunction(systemCommand, S32, (const char* commandLineAction, const char* callBackFunction), (""), "")
{
if (commandLineAction != "")
if (commandLineAction && commandLineAction[0] != '\0')
{
S32 result = system(commandLineAction);
if (callBackFunction != "" && callBackFunction[0])
if (callBackFunction && callBackFunction[0] != '\0')
{
if (Con::isFunction(callBackFunction))
Con::executef(callBackFunction, result);

View file

@ -553,7 +553,7 @@ static void exportScope(const EngineExportScope* scope, SimXMLDocument* xml, boo
break;
default:
AssertFatal(true, "Unknown EngineExportKind: " + exportInfo->getExportKind());
AssertFatal(false, avar("Unknown EngineExportKind: %d", exportInfo->getExportKind()));
break;
}
}

View file

@ -52,7 +52,7 @@ namespace Con
{
char buffer[4096];
va_list args;
va_start(args, &string);
va_start(args, string);
dVsprintf(buffer, sizeof(buffer), string, args);
va_end(args);

View file

@ -942,6 +942,7 @@ U32 AssignExprNode::compile(CodeStream& codeStream, U32 ip, TypeReq type)
case TypeReqString: codeStream.emit(OP_SAVEVAR_STR); break;
case TypeReqUInt: codeStream.emit(OP_SAVEVAR_UINT); break;
case TypeReqFloat: codeStream.emit(OP_SAVEVAR_FLT); break;
default: break;
}
}
else

View file

@ -97,7 +97,7 @@ namespace TorqueScript
{
char buffer[4096];
va_list args;
va_start(args, &string);
va_start(args, string);
dVsprintf(buffer, sizeof(buffer), string, args);
va_end(args);
return evaluate(buffer);

View file

@ -140,19 +140,6 @@ static void create_uuid_state(uuid_state *st)
get_pseudo_node_identifier(&st->node);
}
/*
* dav_format_opaquelocktoken - generates a text representation
* of an opaquelocktoken
*/
static void format_token(char *target, const xuuid_t *u)
{
sprintf(target, "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
u->time_low, u->time_mid, u->time_hi_and_version,
u->clock_seq_hi_and_reserved, u->clock_seq_low,
u->node[0], u->node[1], u->node[2],
u->node[3], u->node[4], u->node[5]);
}
/* convert a pair of hex digits to an integer value [0,255] */
static int dav_parse_hexpair(const char *s)
{
@ -414,9 +401,16 @@ namespace Torque
String UUID::toString() const
{
char buffer[ 1024 ];
format_token( buffer, ( xuuid_t* ) this );
return buffer;
const xuuid_t* u = (xuuid_t*)this;
StringBuilder str;
str.format("%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
u->time_low, u->time_mid, u->time_hi_and_version,
u->clock_seq_hi_and_reserved, u->clock_seq_low,
u->node[0], u->node[1], u->node[2],
u->node[3], u->node[4], u->node[5]);
return str.end();
}
bool UUID::fromString( const char* str )

View file

@ -144,4 +144,4 @@ public:
void canHitSelectedNodes(bool state = true);
};
#endif _GUISHADEREDITOR_H_
#endif //_GUISHADEREDITOR_H_

View file

@ -867,6 +867,9 @@ void WorldEditor::terrainSnapSelection(Selection* sel, U8 modifier, Point3F gizm
case AlignNegZ:
rot.set(mDegToRad(-90.0f), 0.0f, mDegToRad(180.0f));
break;
default:
break;
}
MatrixF mat = MathUtils::createOrientFromDir(ri.normal);

View file

@ -201,6 +201,9 @@ void duDebugDrawTorque::renderBuffer(Buffer &b)
buf[i].data.color.b,
buf[i].data.color.a);
break;
default:
break;
}
}
PrimBuild::end();