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).
This commit is contained in:
Lioncash
2014-03-12 15:33:41 -04:00
parent dccc6d8b47
commit a82675b7d5
170 changed files with 812 additions and 704 deletions

View File

@ -2,6 +2,7 @@
// Licensed under GPLv2
// Refer to the license.txt file included.
#include <string>
#include "InputCommon/ControllerInterface/ForceFeedback/ForceFeedbackDevice.h"
namespace ciface
@ -17,7 +18,7 @@ template class ForceFeedbackDevice::Force<DIPERIODIC>;
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 <typename P>
ForceFeedbackDevice::Force<P>::Force(const char* name, EffectState& state)
ForceFeedbackDevice::Force<P>::Force(const std::string& name, EffectState& state)
: m_name(name), m_state(state)
{
memset(&params, 0, sizeof(params));

View File

@ -5,6 +5,7 @@
#pragma once
#include <list>
#include <string>
#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;
};