DIRECTOR: Fix Shadowing And Format Security GCC Compiler Warnings

This commit is contained in:
D G Turner 2024-05-15 19:26:39 +01:00
parent d09a6a924e
commit 63d6c577ac
5 changed files with 12 additions and 12 deletions

View File

@ -316,12 +316,12 @@ struct MemberExprNode : ExprNode {
Common::SharedPtr<Node> memberID;
Common::SharedPtr<Node> castID;
MemberExprNode(Common::String type_, Common::SharedPtr<Node> memberID, Common::SharedPtr<Node> castID)
MemberExprNode(Common::String type_, Common::SharedPtr<Node> memberID_, Common::SharedPtr<Node> castID_)
: ExprNode(kMemberExprNode), type(type_) {
this->memberID = Common::move(memberID);
this->memberID = Common::move(memberID_);
this->memberID->parent = this;
if (castID) {
this->castID = Common::move(castID);
if (castID_) {
this->castID = Common::move(castID_);
this->castID->parent = this;
}
}
@ -425,8 +425,8 @@ struct RepeatWithToStmtNode : LoopNode {
Common::SharedPtr<Node> end;
Common::SharedPtr<BlockNode> block;
RepeatWithToStmtNode(uint32 startIndex_, Common::String v, Common::SharedPtr<Node> s, bool up, Common::SharedPtr<Node> e)
: LoopNode(kRepeatWithToStmtNode, startIndex_), up(up) {
RepeatWithToStmtNode(uint32 startIndex_, Common::String v, Common::SharedPtr<Node> s, bool up_, Common::SharedPtr<Node> e)
: LoopNode(kRepeatWithToStmtNode, startIndex_), up(up_) {
varName = v;
start = Common::move(s);
start->parent = this;

View File

@ -44,8 +44,8 @@ struct ScriptContext {
Common::Array<ScriptContextMapEntry> sectionMap;
Common::StableMap<uint32, Script *> scripts;
ScriptContext(unsigned int version, ChunkResolver *resolver) : version(version),
resolver(resolver),
ScriptContext(unsigned int version_, ChunkResolver *resolver_) : version(version_),
resolver(resolver_),
lnam(nullptr) {}
void read(Common::SeekableReadStream &stream);

View File

@ -169,7 +169,7 @@ Common::SharedPtr<Node> Handler::readVar(int varType) {
case 0x6: // field
return Common::SharedPtr<Node>(new MemberExprNode("field", Common::move(id), Common::move(castID)));
default:
warning(Common::String::format("findVar: unhandled var type %d", varType).c_str());
warning("%s", Common::String::format("findVar: unhandled var type %d", varType).c_str());
break;
}
return Common::SharedPtr<Node>(new ErrorNode());

View File

@ -17,8 +17,8 @@ namespace LingoDec {
/* Script */
Script::Script(unsigned int version) :
version(version),
Script::Script(unsigned int version_) :
version(version_),
context(nullptr) {}
Script::~Script() = default;

View File

@ -74,7 +74,7 @@ struct Script {
unsigned int version;
ScriptContext *context;
Script(unsigned int version);
Script(unsigned int version_);
~Script();
void read(Common::SeekableReadStream &stream);
Common::Array<int16> readVarnamesTable(Common::SeekableReadStream &stream, uint16 count, uint32 offset);