From a82675b7d581421fa80d5d5c53253cf1d5c1a26d Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 12 Mar 2014 15:33:41 -0400 Subject: Kill off some usages of c_str. Also changes some function params, but this is ok. Some simplifications were also able to be made (ie. killing off strcmps with ==, etc). --- .../ControllerInterface/ForceFeedback/ForceFeedbackDevice.cpp | 5 +++-- .../ControllerInterface/ForceFeedback/ForceFeedbackDevice.h | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'Source/Core/InputCommon/ControllerInterface') diff --git a/Source/Core/InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.cpp b/Source/Core/InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.cpp index 036b3fda05..1117ed9856 100644 --- a/Source/Core/InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.cpp +++ b/Source/Core/InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.cpp @@ -2,6 +2,7 @@ // Licensed under GPLv2 // Refer to the license.txt file included. +#include #include "InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.h" namespace ciface @@ -17,7 +18,7 @@ template class ForceFeedbackDevice::Force; typedef struct { GUID guid; - const char* name; + const std::string name; } ForceType; static const ForceType force_type_names[] = @@ -216,7 +217,7 @@ void ForceFeedbackDevice::ForcePeriodic::SetState(const ControlState state) } template -ForceFeedbackDevice::Force

::Force(const char* name, EffectState& state) +ForceFeedbackDevice::Force

::Force(const std::string& name, EffectState& state) : m_name(name), m_state(state) { memset(¶ms, 0, sizeof(params)); diff --git a/Source/Core/InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.h b/Source/Core/InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.h index 643ca2434b..54a465d83e 100644 --- a/Source/Core/InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.h +++ b/Source/Core/InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.h @@ -5,6 +5,7 @@ #pragma once #include +#include #include "InputCommon/ControllerInterface/Device.h" @@ -41,10 +42,10 @@ private: { public: std::string GetName() const; - Force(const char* name, EffectState& state); + Force(const std::string& name, EffectState& state); void SetState(ControlState state); private: - const char* m_name; + const std::string m_name; EffectState& m_state; P params; }; -- cgit v1.2.3