Skip to content

Commit

Permalink
Fix a couple of gcc warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Mar 21, 2020
1 parent 757d98c commit 49991ed
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion libs/xmlutil/Document.cpp
Expand Up @@ -22,7 +22,7 @@ Document::Document(std::istream& stream) :
_xmlDoc(nullptr)
{
const std::size_t bufferSize = 4096;
static_assert(bufferSize < std::numeric_limits<int>::max());
static_assert(bufferSize < std::numeric_limits<std::size_t>::max());

std::vector<char> buffer(bufferSize);

Expand Down
2 changes: 1 addition & 1 deletion plugins/dm.conversation/ConversationEntity.cpp
Expand Up @@ -162,7 +162,7 @@ void ConversationEntity::writeToEntity()
entity->setKeyValue(cmdPrefix + "arg_" + string::to_string(a->first), a->second);
}
}
catch (std::runtime_error e) {
catch (const std::runtime_error&) {
rError() << "Unrecognised conversation command ID: " << c->second->type << std::endl;
}
}
Expand Down
2 changes: 1 addition & 1 deletion radiant/entity/curve/Curve.cpp
Expand Up @@ -107,7 +107,7 @@ bool Curve::parseCurve(const std::string& value) {

tokeniser.assertNextToken(")");
}
catch (parser::ParseException p) {
catch (const parser::ParseException& p) {
rError() << "Curve::parseCurve: " << p.what() << "\n";
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion radiant/patch/Patch.cpp
Expand Up @@ -697,7 +697,7 @@ void Patch::InsertRemove(bool bInsert, bool bColumn, bool bFirst) {
}
}
}
catch (GenericPatchException g) {
catch (const GenericPatchException& g) {
rError() << "Error manipulating patch dimensions: " << g.what() << "\n";
}

Expand Down
2 changes: 1 addition & 1 deletion radiant/selection/algorithm/Primitives.cpp
Expand Up @@ -196,7 +196,7 @@ void createCMFromSelection(const cmd::ArgumentList& args) {
fmt::format("Couldn't save to file: {0}", cmPath.string()));
}
}
catch (fs::filesystem_error f) {
catch (const fs::filesystem_error& f) {
rError() << "CollisionModel: " << f.what() << std::endl;
}

Expand Down
4 changes: 2 additions & 2 deletions radiant/selection/algorithm/Shader.cpp
Expand Up @@ -412,7 +412,7 @@ void pickShaderFromSelection(const cmd::ArgumentList& args) {
Patch& sourcePatch = getLastSelectedPatch();
GlobalShaderClipboard().setSource(sourcePatch);
}
catch (InvalidSelectionException e) {
catch (const InvalidSelectionException&) {
wxutil::Messagebox::ShowError(
_("Can't copy Shader. Couldn't retrieve patch."));
}
Expand All @@ -422,7 +422,7 @@ void pickShaderFromSelection(const cmd::ArgumentList& args) {
Face& sourceFace = getLastSelectedFace();
GlobalShaderClipboard().setSource(sourceFace);
}
catch (InvalidSelectionException e) {
catch (const InvalidSelectionException&) {
wxutil::Messagebox::ShowError(
_("Can't copy Shader. Couldn't retrieve face."));
}
Expand Down
2 changes: 1 addition & 1 deletion radiant/ui/modelselector/ModelPopulator.h
Expand Up @@ -120,7 +120,7 @@ class ModelPopulator :

return static_cast<wxThread::ExitCode>(0);
}
catch (ThreadAbortedException)
catch (const ThreadAbortedException&)
{
return static_cast<wxThread::ExitCode>(0);
}
Expand Down
4 changes: 2 additions & 2 deletions radiant/undo/UndoSystem.cpp
Expand Up @@ -25,8 +25,8 @@ namespace

// Constructor
UndoSystem::UndoSystem() :
_undoLevels(64),
_activeUndoStack(nullptr)
_activeUndoStack(nullptr),
_undoLevels(64)
{}

UndoSystem::~UndoSystem()
Expand Down

0 comments on commit 49991ed

Please sign in to comment.