remove using namespace from headers ..

This commit is contained in:
Ian Curtis 2018-01-03 17:51:24 +00:00
parent 53c98283aa
commit f7678d918e
9 changed files with 30 additions and 39 deletions

View file

@ -153,9 +153,9 @@ void CInput::LoadFromConfig(const Util::Config::Node &config)
if (IsConfigurable())
{
// If so, check INI file for mapping string
string key("Input");
std::string key("Input");
key.append(id);
string mapping;
std::string mapping;
auto *node = config.TryGet(key);
if (node)
{
@ -174,7 +174,7 @@ void CInput::StoreToConfig(Util::Config::Node *config)
{
if (!IsConfigurable())
return;
string key("Input");
std::string key("Input");
key.append(id);
config->Set(key, m_mapping);
}

View file

@ -29,7 +29,6 @@
#define INCLUDED_INPUTSOURCE_H
#include <string>
using namespace std;
class CInputSystem;
struct ForceFeedbackCmd;

View file

@ -32,8 +32,6 @@
#include <cstdio>
#include <string>
#include <vector>
using namespace std;
#include "MultiInputSource.h"
#include "Util/NewConfig.h"
@ -355,9 +353,9 @@ private:
JoySettings m_defJoySettings;
// Current key, mouse and joystick settings for attached keyboards, mice and joysticks
vector<KeySettings*> m_keySettings;
vector<MouseSettings*> m_mseSettings;
vector<JoySettings*> m_joySettings;
std::vector<KeySettings*> m_keySettings;
std::vector<MouseSettings*> m_mseSettings;
std::vector<JoySettings*> m_joySettings;
// Empty input source
CMultiInputSource *m_emptySource;
@ -399,46 +397,46 @@ private:
*/
CInputSource *GetJoySource(int joyNum, EJoyPart joyPart);
void CheckAllSources(unsigned readFlags, bool fullAxisOnly, bool &mseCentered, vector<CInputSource*> &sources, string &mapping, vector<CInputSource*> &badSources);
void CheckAllSources(unsigned readFlags, bool fullAxisOnly, bool &mseCentered, std::vector<CInputSource*> &sources, std::string &mapping, std::vector<CInputSource*> &badSources);
/*
* Finds any currently activated key sources for the given keyboard number (or all keyboards if ANY_KEYBOARD supplied)
* and adds them to the sources vector, aswell as constructing the corresponding mapping(s) in the given string.
* If fullAxisOnly is true, then only sources that represent a full axis range (eg MouseXAxis) are considered.
*/
void CheckKeySources(int kbdNum, bool fullAxisOnly, vector<CInputSource*> &sources, string &mapping, vector<CInputSource*> &badSources);
void CheckKeySources(int kbdNum, bool fullAxisOnly, std::vector<CInputSource*> &sources, std::string &mapping, std::vector<CInputSource*> &badSources);
/*
* Finds any currently activated mouse sources for the given mouse number (or all mice if ANY_MOUSE supplied)
* and adds them to the sources vector, aswell as constructing the corresponding mapping(s) in the given string.
* If fullAxisOnly is true, then only sources that represent a full axis range (eg MouseXAxis) are considered.
*/
void CheckMouseSources(int mseNum, bool fullAxisOnly, bool mseCentered, vector<CInputSource*> &sources, string &mapping, vector<CInputSource*> &badSources);
void CheckMouseSources(int mseNum, bool fullAxisOnly, bool mseCentered, std::vector<CInputSource*> &sources, std::string &mapping, std::vector<CInputSource*> &badSources);
/*
* Finds any currently activated joystick sources for the given joystick number (or all joysticks if ANY_JOYSTICK supplied)
* and adds them to the sources vector, aswell as constructing the corresponding mapping(s) in the given string.
* If fullAxisOnly is true, then only sources that represent a full axis range (eg MouseXAxis) are considered.
*/
void CheckJoySources(int joyNum, bool fullAxisOnly, vector<CInputSource*> &sources, string &mapping, vector<CInputSource*> &badSources);
void CheckJoySources(int joyNum, bool fullAxisOnly, std::vector<CInputSource*> &sources, std::string &mapping, std::vector<CInputSource*> &badSources);
bool ParseInt(string str, int &num);
bool ParseInt(std::string str, int &num);
string IntToString(int num);
std::string IntToString(int num);
bool EqualsIgnoreCase(string str1, const char *str2);
bool EqualsIgnoreCase(std::string str1, const char *str2);
bool StartsWithIgnoreCase(string str1, const char *str2);
bool StartsWithIgnoreCase(std::string str1, const char *str2);
/*
* Returns true if the given string represents a valid key name.
*/
bool IsValidKeyName(string str);
bool IsValidKeyName(std::string str);
/*
* Returns the EMousePart with the given mapping name or MouseUnknown if not found.
*/
EMousePart LookupMousePart(string str);
EMousePart LookupMousePart(std::string str);
/*
* Returns the mapping name for the given EMousePart.
@ -448,26 +446,26 @@ private:
/*
* Returns the EJoyPart with the given mapping name or JoyUnknown if not found.
*/
EJoyPart LookupJoyPart(string str);
EJoyPart LookupJoyPart(std::string str);
/*
* Returns the mapping name for the given EJoyPart.
*/
const char *LookupName(EJoyPart joyPart);
size_t ParseDevMapping(string str, const char *devType, int &devNum);
size_t ParseDevMapping(std::string str, const char *devType, int &devNum);
/*
* Parses the given mapping string, possibly representing more than one mapping, and returns an input source for it or NULL if the
* mapping is invalid.
* If fullAxisOnly is true, then only mappings that represent a full axis range (eg MouseXAxis) are parsed.
*/
CInputSource* ParseMultiSource(string str, bool fullAxisOnly, bool isOr);
CInputSource* ParseMultiSource(std::string str, bool fullAxisOnly, bool isOr);
/*
* Parses the given single mapping string and returns an input source for it, or NULL if non exists.
*/
CInputSource* ParseSingleSource(string str);
CInputSource* ParseSingleSource(std::string str);
/*
* Prints the given key settings to stdout.

View file

@ -184,7 +184,7 @@ CTriggerInput::CTriggerInput(const char *inputId, const char *inputLabel, unsign
void CTriggerInput::LoadFromConfig(const Util::Config::Node &config)
{
string key("Input");
std::string key("Input");
key.append(id);
auto *node = config.TryGet(key);
if (node)
@ -193,7 +193,7 @@ void CTriggerInput::LoadFromConfig(const Util::Config::Node &config)
void CTriggerInput::StoreToConfig(Util::Config::Node *config)
{
string key("Input");
std::string key("Input");
key.append(id);
config->Set(key, (unsigned) m_autoTrigger);
}

View file

@ -30,9 +30,7 @@
#include "Types.h"
#include "Util/NewConfig.h"
#include <vector>
using namespace std;
class CInputSystem;
class CInput;
@ -53,7 +51,7 @@ private:
CInputSystem *m_system;
// Vector of all created inputs
vector<CInput*> m_inputs;
std::vector<CInput*> m_inputs;
/*
* Adds a switch input (eg button) to this collection.

View file

@ -30,9 +30,8 @@
#define INCLUDED_MULTIINPUTSOURCE_H
#include "InputSource.h"
#include <vector>
using namespace std;
/*
* Represents a collection of input sources and combines their values into a single value.
@ -56,7 +55,7 @@ public:
/*
* Returns the combined source type of the given vector of sources.
*/
static ESourceType GetCombinedType(vector<CInputSource*> &sources);
static ESourceType GetCombinedType(std::vector<CInputSource*> &sources);
/*
* Constructs an 'empty' source (ie one which is always 'off').
@ -69,7 +68,7 @@ public:
* switch inputs must be active for this input to have a value (which will be the value of the first non-switch input in the list,
* or the first switch input if there are none).
*/
CMultiInputSource(bool isOr, vector<CInputSource*> &sources);
CMultiInputSource(bool isOr, std::vector<CInputSource*> &sources);
~CMultiInputSource();

View file

@ -37,9 +37,6 @@
#include <vector>
using namespace std;
/*
* IPCIDevice:
*
@ -183,7 +180,7 @@ private:
};
// An array of device objects
vector<struct DeviceObjectLink> DeviceVector;
std::vector<struct DeviceObjectLink> DeviceVector;
};

View file

@ -451,8 +451,8 @@ private:
uint8_t *textureRAMDirty;
// Queued texture uploads
vector<QueuedUploadTextures> queuedUploadTextures;
vector<QueuedUploadTextures> queuedUploadTexturesRO; // Read-only copy of queue
std::vector<QueuedUploadTextures> queuedUploadTextures;
std::vector<QueuedUploadTextures> queuedUploadTexturesRO; // Read-only copy of queue
// Big endian bus object for DMA memory access
IBus *Bus;

View file

@ -268,7 +268,7 @@ bool OpenAudio()
// Set initial play position to be beginning of buffer and initial write position to be half-way into buffer
playPos = 0;
writePos = min<int>(audioBufferSize - BYTES_PER_FRAME, (BYTES_PER_FRAME + audioBufferSize) / 2);
writePos = std::min<int>(audioBufferSize - BYTES_PER_FRAME, (BYTES_PER_FRAME + audioBufferSize) / 2);
writeWrapped = false;
// Reset counters