Navigation Menu

Skip to content

Commit

Permalink
Another round of clang warnings fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Mar 4, 2017
1 parent 8c6adcb commit 9d4430e
Show file tree
Hide file tree
Showing 18 changed files with 59 additions and 73 deletions.
2 changes: 1 addition & 1 deletion plugins/dm.editing/AIHeadPropertyEditor.h
Expand Up @@ -38,7 +38,7 @@ class AIHeadPropertyEditor :
const std::string& key,
const std::string& options) override;

std::string runDialog(Entity* entity, const std::string& key);
std::string runDialog(Entity* entity, const std::string& key) override;

private:
void onChooseButton(wxCommandEvent& ev);
Expand Down
2 changes: 1 addition & 1 deletion plugins/dm.editing/AIVocalSetPropertyEditor.h
Expand Up @@ -38,7 +38,7 @@ class AIVocalSetPropertyEditor :
const std::string& key,
const std::string& options) override;

std::string runDialog(Entity* entity, const std::string& key);
std::string runDialog(Entity* entity, const std::string& key) override;

private:
void onChooseButton(wxCommandEvent& ev);
Expand Down
3 changes: 0 additions & 3 deletions plugins/dm.gui/ReadableEditorDialog.cpp
Expand Up @@ -46,9 +46,6 @@ namespace
const char* const NO_ENTITY_ERROR = N_("Cannot run Readable Editor on this selection.\n"
"Please select a single XData entity.");

const char* const LABEL_PAGE_RELATED = N_("Page Editing:");
const char* const LABEL_GENERAL_PROPERTIES = N_("General Properties:");

enum MenuItemId
{
InsertWholePage = 1,
Expand Down
3 changes: 2 additions & 1 deletion plugins/dm.objectives/ComponentType.cpp
Expand Up @@ -2,6 +2,7 @@
#include "util/ObjectivesException.h"
#include "i18n.h"
#include <algorithm>
#include "string/convert.h"

namespace objectives
{
Expand Down Expand Up @@ -166,7 +167,7 @@ ComponentType ComponentType::getComponentType(int id)
if (i != getMap().end())
return i->second;
else
throw ObjectivesException("Invalid ComponentType ID: " + id);
throw ObjectivesException("Invalid ComponentType ID: " + string::to_string(id));
}

}
3 changes: 0 additions & 3 deletions plugins/dm.stimresponse/EffectEditor.cpp
Expand Up @@ -20,9 +20,6 @@ namespace ui
namespace
{
const char* const WINDOW_TITLE = N_("Edit Response Effect");
const int WINDOW_MIN_WIDTH = 300;
const int WINDOW_MIN_HEIGHT = 50;

// The name of the _SELF entity as parsed by the response scripts
const char* const GKEY_ENTITY_SELF = "/stimResponseSystem/selfEntity";
}
Expand Down
5 changes: 0 additions & 5 deletions plugins/dm.stimresponse/ResponseEditor.cpp
Expand Up @@ -20,11 +20,6 @@
namespace ui
{

namespace
{
const char* const LABEL_RESPONSE_EFFECTS = N_("Response Effects");
}

ResponseEditor::ResponseEditor(wxWindow* parent, StimTypes& stimTypes) :
ClassEditor(parent, stimTypes)
{
Expand Down
10 changes: 5 additions & 5 deletions plugins/dm.stimresponse/ResponseEditor.h
Expand Up @@ -50,17 +50,17 @@ class ResponseEditor :

/** greebo: Sets the new entity (updates the treeviews)
*/
virtual void setEntity(const SREntityPtr& entity);
virtual void setEntity(const SREntityPtr& entity) override;

/** greebo: Updates the widgets (e.g. after a selection change)
*/
void update();
void update() override;

private:
/** greebo: Updates the associated text fields when a check box
* is toggled.
*/
void checkBoxToggled(wxCheckBox* toggleButton);
void checkBoxToggled(wxCheckBox* toggleButton) override;

/** greebo: Adds a new response effect to the list.
*/
Expand Down Expand Up @@ -98,15 +98,15 @@ class ResponseEditor :

/** greebo: Adds a new default response to the entity
*/
void addSR();
void addSR() override;

// Widget creator helpers
void createContextMenu();
void createEffectWidgets(); // Response effect list

/** greebo: Gets called when the response selection gets changed
*/
virtual void selectionChanged();
virtual void selectionChanged() override;

void openSRListContextMenu() override;

Expand Down
20 changes: 10 additions & 10 deletions plugins/model/PicoModelNode.h
Expand Up @@ -55,12 +55,12 @@ class PicoModelNode :

// SkinnedModel implementation
// Skin changed notify
void skinChanged(const std::string& newSkinName);
void skinChanged(const std::string& newSkinName) override;
// Returns the name of the currently active skin
std::string getSkin() const;
std::string getSkin() const override;

// Bounded implementation
virtual const AABB& localAABB() const;
virtual const AABB& localAABB() const override;

// Lights changed function
void lightsChanged()
Expand All @@ -69,20 +69,20 @@ class PicoModelNode :
}

// SelectionTestable implementation
void testSelect(Selector& selector, SelectionTest& test);
void testSelect(Selector& selector, SelectionTest& test) override;

virtual std::string name() const;
Type getNodeType() const;
virtual std::string name() const override;
Type getNodeType() const override;

const RenderablePicoModelPtr& getModel() const;
void setModel(const RenderablePicoModelPtr& model);

// LitObject test function
bool intersectsLight(const RendererLight& light) const;
bool intersectsLight(const RendererLight& light) const override;
// Add a light to this model instance
void insertLight(const RendererLight& light);
void insertLight(const RendererLight& light) override;
// Clear all lights from this model instance
void clearLights();
void clearLights() override;

// Renderable implementation
void renderSolid(RenderableCollector& collector, const VolumeTest& volume) const override;
Expand All @@ -95,7 +95,7 @@ class PicoModelNode :
}

// Traceable implementation
bool getIntersection(const Ray& ray, Vector3& intersection);
bool getIntersection(const Ray& ray, Vector3& intersection) override;

protected:
virtual void _onTransformationChanged() override;
Expand Down
22 changes: 12 additions & 10 deletions plugins/model/RenderablePicoModel.h
Expand Up @@ -148,54 +148,56 @@ class RenderablePicoModel :
* model selector but not the main renderer, which uses the front-end render
* method.
*/
void render(const RenderInfo& info) const;
void render(const RenderInfo& info) const override;

/**
* Return the number of surfaces in this model.
*/
int getSurfaceCount() const {
int getSurfaceCount() const override
{
return static_cast<int>(_surfVec.size());
}

/**
* Return the number of vertices in this model, by summing the vertex
* counts for each surface.
*/
int getVertexCount() const;
int getVertexCount() const override;

/** Return the polycount (tricount) of this model by summing the surface
* polycounts.
*/

int getPolyCount() const;
int getPolyCount() const override;

const IModelSurface& getSurface(unsigned surfaceNum) const;
const IModelSurface& getSurface(unsigned surfaceNum) const override;

/**
* Return the enclosing AABB for this model.
*/
const AABB& localAABB() const {
const AABB& localAABB() const override
{
return _localAABB;
}

/** Return the list of active materials for this model.
*/
const std::vector<std::string>& getActiveMaterials() const;
const std::vector<std::string>& getActiveMaterials() const override;

// Sets the filename this model was loaded from
void setFilename(const std::string& name);

// Returns the filename this model was loaded from
virtual std::string getFilename() const;
virtual std::string getFilename() const override;

// Returns the VFS path to the model file
virtual std::string getModelPath() const;
virtual std::string getModelPath() const override;

void setModelPath(const std::string& modelPath);

/** Apply the given skin to this model.
*/
void applySkin(const ModelSkin& skin);
void applySkin(const ModelSkin& skin) override;

/**
* Selection test. Test each surface against the SelectionTest object and
Expand Down
5 changes: 2 additions & 3 deletions plugins/shaders/textures/GLTextureManager.cpp
Expand Up @@ -8,9 +8,8 @@
#include "TextureManipulator.h"
#include "parser/DefTokeniser.h"

namespace {
const int MAX_TEXTURE_QUALITY = 3;

namespace
{
const std::string SHADER_NOT_FOUND = "notex.bmp";
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/uimanager/SoundChooser.h
Expand Up @@ -82,7 +82,7 @@ class SoundChooser :
// Set the selected sound shader, and focuses the treeview to the new selection
void setSelectedShader(const std::string& shader);

virtual int ShowModal();
virtual int ShowModal() override;

// Run the dialog and return the selected shader - this will be empty if the user clicks cancel
virtual std::string chooseResource(const std::string& preselected = std::string()) override;
Expand Down
3 changes: 0 additions & 3 deletions plugins/uimanager/colourscheme/ColourSchemeEditor.cpp
Expand Up @@ -21,9 +21,6 @@ namespace ui

namespace
{
// Constants
const int NUM_COLUMNS = 3;

const char* const EDITOR_WINDOW_TITLE = N_("Edit Colour Schemes");
}

Expand Down
32 changes: 16 additions & 16 deletions plugins/vfspk3/Doom3FileSystem.h
Expand Up @@ -30,35 +30,35 @@ class Doom3FileSystem :
// Constructor
Doom3FileSystem();

void initDirectory(const std::string& path);
void initialise();
void shutdown();
void initDirectory(const std::string& path) override;
void initialise() override;
void shutdown() override;

int getFileCount(const std::string& filename);
ArchiveFilePtr openFile(const std::string& filename);
ArchiveTextFilePtr openTextFile(const std::string& filename);
int getFileCount(const std::string& filename) override;
ArchiveFilePtr openFile(const std::string& filename) override;
ArchiveTextFilePtr openTextFile(const std::string& filename) override;

ArchiveFilePtr openFileInAbsolutePath(const std::string& filename);
ArchiveTextFilePtr openTextFileInAbsolutePath(const std::string& filename);
ArchiveFilePtr openFileInAbsolutePath(const std::string& filename) override;
ArchiveTextFilePtr openTextFileInAbsolutePath(const std::string& filename) override;

std::size_t loadFile(const std::string& filename, void **buffer);
void freeFile(void *p);
std::size_t loadFile(const std::string& filename, void **buffer) override;
void freeFile(void *p) override;

// Call the specified callback function for each file matching extension
// inside basedir.
void forEachFile(const std::string& basedir, const std::string& extension,
const VisitorFunc& visitorFunc, std::size_t depth);
const VisitorFunc& visitorFunc, std::size_t depth) override;

void forEachFileInAbsolutePath(const std::string& path,
const std::string& extension,
const VisitorFunc& visitorFunc,
std::size_t depth = 1);
std::size_t depth = 1) override;

std::string findFile(const std::string& name);
std::string findRoot(const std::string& name);
std::string findFile(const std::string& name) override;
std::string findRoot(const std::string& name) override;

virtual void addObserver(Observer& observer);
virtual void removeObserver(Observer& observer);
virtual void addObserver(Observer& observer) override;
virtual void removeObserver(Observer& observer) override;

// RegisterableModule implementation
const std::string& getName() const override;
Expand Down
4 changes: 2 additions & 2 deletions radiant/patch/Patch.cpp
Expand Up @@ -1925,8 +1925,8 @@ void Patch::constructPlane(const AABB& aabb, int axis, std::size_t width, std::s
vStart[y] = aabb.origin[y] - aabb.extents[y];
vStart[z] = aabb.origin[z];

float xAdj = fabsf((vStart[x] - (aabb.origin[x] + aabb.extents[x])) / (float)(_width - 1));
float yAdj = fabsf((vStart[y] - (aabb.origin[y] + aabb.extents[y])) / (float)(_height - 1));
float xAdj = std::abs((vStart[x] - (aabb.origin[x] + aabb.extents[x])) / (float)(_width - 1));
float yAdj = std::abs((vStart[y] - (aabb.origin[y] + aabb.extents[y])) / (float)(_height - 1));

Vector3 vTmp;
vTmp[z] = vStart[z];
Expand Down
2 changes: 0 additions & 2 deletions radiant/selection/ManipulateMouseTool.cpp
Expand Up @@ -179,8 +179,6 @@ void ManipulateMouseTool::handleMouseMove(const render::View& view, const Vector
_debugText += (boost::format("\nTest reversal x,y,z = (%5.3lf %5.3lf %5.3lf)") % worldPosH.x() % worldPosH.y() % worldPosH.z()).str();
#endif

Vector2 constrainedDevicePoint(devicePoint);

// Constrain the movement to the axes, if the modifier is held
bool constrainedFlag = wxGetKeyState(WXK_SHIFT);

Expand Down
4 changes: 2 additions & 2 deletions radiant/selection/algorithm/SelectionPolicies.h
Expand Up @@ -66,7 +66,7 @@ class SelectionPolicy_Touching
const AABB& other(node->worldAABB());

for (unsigned int i = 0; i < 3; ++i) {
if (fabsf(box.origin[i] - other.origin[i]) > (box.extents[i] + other.extents[i])) {
if (std::abs(box.origin[i] - other.origin[i]) > (box.extents[i] + other.extents[i])) {
return false;
}
}
Expand Down Expand Up @@ -96,7 +96,7 @@ class SelectionPolicy_Inside
}

for (unsigned int i = 0; i < 3; ++i) {
if (fabsf(box.origin[i] - other.origin[i]) > (box.extents[i] - other.extents[i])) {
if (std::abs(box.origin[i] - other.origin[i]) > (box.extents[i] - other.extents[i])) {
return false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion radiant/selection/group/SelectionGroup.h
Expand Up @@ -76,7 +76,7 @@ class SelectionGroup :
});
}

std::size_t size() const
std::size_t size() const override
{
return _nodes.size();
}
Expand Down
8 changes: 4 additions & 4 deletions radiant/ui/mainframe/MainFrame.h
Expand Up @@ -58,10 +58,10 @@ class MainFrame :
void toggleFullscreenCameraView(const cmd::ArgumentList& args);

// RegisterableModule implementation
const std::string& getName() const;
const StringSet& getDependencies() const;
void initialiseModule(const ApplicationContext& ctx);
void shutdownModule();
const std::string& getName() const override;
const StringSet& getDependencies() const override;
void initialiseModule(const ApplicationContext& ctx) override;
void shutdownModule() override;

private:
void create();
Expand Down

0 comments on commit 9d4430e

Please sign in to comment.