mirror of https://github.com/stella-emu/stella.git
Converted from C-style 'typedef' to C++ 'using' where appropriate.
I find the newer syntax more readable, since it acts exactly like an assignment statement. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3088 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
0d5ae3acf5
commit
37d9c6c99f
|
@ -27,7 +27,7 @@ class OSystem;
|
|||
|
||||
#include "bspf.hxx"
|
||||
|
||||
typedef vector<shared_ptr<Cheat>> CheatList;
|
||||
using CheatList = vector<shared_ptr<Cheat>>;
|
||||
|
||||
/**
|
||||
This class provides an interface for performing all cheat operations
|
||||
|
|
|
@ -78,7 +78,7 @@ class Variant
|
|||
static const Variant EmptyVariant;
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
typedef vector<pair<string,Variant>> VariantList;
|
||||
using VariantList = vector<pair<string,Variant>>;
|
||||
|
||||
namespace VList {
|
||||
inline void push_back(VariantList& list, const Variant& name,
|
||||
|
|
|
@ -30,17 +30,17 @@
|
|||
|
||||
#include <cstdint>
|
||||
// Types for 8-bit signed and unsigned integers
|
||||
typedef int8_t Int8;
|
||||
typedef uint8_t uInt8;
|
||||
using Int8 = int8_t;
|
||||
using uInt8 = uint8_t;
|
||||
// Types for 16-bit signed and unsigned integers
|
||||
typedef int16_t Int16;
|
||||
typedef uint16_t uInt16;
|
||||
using Int16 = int16_t;
|
||||
using uInt16 = uint16_t;
|
||||
// Types for 32-bit signed and unsigned integers
|
||||
typedef int32_t Int32;
|
||||
typedef uint32_t uInt32;
|
||||
using Int32 = int32_t;
|
||||
using uInt32 = uint32_t;
|
||||
// Types for 64-bit signed and unsigned integers
|
||||
typedef int64_t Int64;
|
||||
typedef uint64_t uInt64;
|
||||
using Int64 = int64_t;
|
||||
using uInt64 = uint64_t;
|
||||
|
||||
// The following code should provide access to the standard C++ objects and
|
||||
// types: cout, cerr, string, ostream, istream, etc.
|
||||
|
@ -58,10 +58,10 @@ typedef uint64_t uInt64;
|
|||
using namespace std;
|
||||
|
||||
// Common array types
|
||||
typedef vector<Int32> IntArray;
|
||||
typedef vector<bool> BoolArray;
|
||||
typedef vector<uInt8> ByteArray;
|
||||
typedef vector<string> StringList;
|
||||
using IntArray = vector<Int32>;
|
||||
using BoolArray = vector<bool>;
|
||||
using ByteArray = vector<uInt8>;
|
||||
using StringList = vector<string>;
|
||||
|
||||
// Defines to help with path handling
|
||||
#if (defined(BSPF_UNIX) || defined(BSPF_MAC_OSX))
|
||||
|
|
|
@ -33,9 +33,9 @@ class CartDebugWidget;
|
|||
#include "DebuggerSystem.hxx"
|
||||
#include "System.hxx"
|
||||
|
||||
// Pointer type for CartDebug instance methods
|
||||
// Function type for CartDebug instance methods
|
||||
class CartDebug;
|
||||
typedef int (CartDebug::*CartMethod)();
|
||||
using CartMethod = int (CartDebug::*)();
|
||||
|
||||
class CartState : public DebuggerState
|
||||
{
|
||||
|
@ -81,7 +81,7 @@ class CartDebug : public DebuggerSystem
|
|||
string bytes;
|
||||
bool hllabel;
|
||||
};
|
||||
typedef vector<DisassemblyTag> DisassemblyList;
|
||||
using DisassemblyList = vector<DisassemblyTag>;
|
||||
struct Disassembly {
|
||||
DisassemblyList list;
|
||||
int fieldwidth;
|
||||
|
@ -263,8 +263,8 @@ class CartDebug : public DebuggerSystem
|
|||
void addressTypeAsString(ostream& buf, uInt16 addr) const;
|
||||
|
||||
private:
|
||||
typedef map<uInt16, string> AddrToLabel;
|
||||
typedef map<string, uInt16> LabelToAddr;
|
||||
using AddrToLabel = map<uInt16, string>;
|
||||
using LabelToAddr = map<string, uInt16>;
|
||||
|
||||
// Determine 'type' of address (ie, what part of the system accessed)
|
||||
enum AddrType {
|
||||
|
@ -280,8 +280,8 @@ class CartDebug : public DebuggerSystem
|
|||
uInt16 start;
|
||||
uInt16 end;
|
||||
};
|
||||
typedef list<uInt16> AddressList;
|
||||
typedef list<DirectiveTag> DirectiveList;
|
||||
using AddressList = list<uInt16>;
|
||||
using DirectiveList = list<DirectiveTag>;
|
||||
|
||||
struct BankInfo {
|
||||
uInt16 start; // start of address space
|
||||
|
|
|
@ -24,8 +24,8 @@
|
|||
#include "System.hxx"
|
||||
#include "DebuggerSystem.hxx"
|
||||
|
||||
// Pointer type for CpuDebug instance methods
|
||||
typedef int (CpuDebug::*CpuMethod)() const;
|
||||
// Function type for CpuDebug instance methods
|
||||
using CpuMethod = int (CpuDebug::*)() const;
|
||||
|
||||
class CpuState : public DebuggerState
|
||||
{
|
||||
|
|
|
@ -48,18 +48,8 @@ class ButtonWidget;
|
|||
#include "Stack.hxx"
|
||||
#include "bspf.hxx"
|
||||
|
||||
typedef map<string,unique_ptr<Expression>> FunctionMap;
|
||||
typedef map<string,string> FunctionDefMap;
|
||||
|
||||
/*
|
||||
// These will probably turn out to be unneeded, left for reference for now
|
||||
// pointer types for Debugger instance methods
|
||||
typedef uInt8 (Debugger::*DEBUGGER_BYTE_METHOD)();
|
||||
typedef uInt16 (Debugger::*DEBUGGER_WORD_METHOD)();
|
||||
|
||||
// call the pointed-to method on the (static) debugger object.
|
||||
#define CALL_DEBUGGER_METHOD(method) ( ( Debugger::debugger().*method)() )
|
||||
*/
|
||||
using FunctionMap = map<string,unique_ptr<Expression>>;
|
||||
using FunctionDefMap = map<string,string>;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -26,9 +26,9 @@ class TIA;
|
|||
|
||||
#include "DebuggerSystem.hxx"
|
||||
|
||||
// Pointer type for TIADebug instance methods
|
||||
// Function type for TIADebug instance methods
|
||||
class TIADebug;
|
||||
typedef int (TIADebug::*TiaMethod)() const;
|
||||
using TiaMethod = int (TIADebug::*)() const;
|
||||
|
||||
// Indices for various IntArray in TiaState
|
||||
enum {
|
||||
|
|
|
@ -263,13 +263,13 @@ class FilesystemNode
|
|||
* the semantics.
|
||||
*/
|
||||
|
||||
typedef vector<AbstractFSNode*> AbstractFSList;
|
||||
using AbstractFSList = vector<AbstractFSNode*>;
|
||||
|
||||
class AbstractFSNode
|
||||
{
|
||||
protected:
|
||||
friend class FilesystemNode;
|
||||
typedef FilesystemNode::ListMode ListMode;
|
||||
using ListMode = FilesystemNode::ListMode;
|
||||
|
||||
public:
|
||||
/**
|
||||
|
|
|
@ -46,15 +46,15 @@
|
|||
*/
|
||||
|
||||
// Setup the types used by the MD5 routines
|
||||
typedef uInt8* POINTER;
|
||||
using POINTER = uInt8*;
|
||||
|
||||
// MD5 context.
|
||||
typedef struct
|
||||
struct MD5_CTX
|
||||
{
|
||||
uInt32 state[4]; /* state (ABCD) */
|
||||
uInt32 count[2]; /* number of bits, modulo 2^64 (lsb first) */
|
||||
uInt8 buffer[64]; /* input buffer */
|
||||
} MD5_CTX;
|
||||
uInt32 state[4]; /* state (ABCD) */
|
||||
uInt32 count[2]; /* number of bits, modulo 2^64 (lsb first) */
|
||||
uInt8 buffer[64]; /* input buffer */
|
||||
};
|
||||
|
||||
// Constants for MD5Transform routine.
|
||||
#define S11 7
|
||||
|
|
|
@ -117,7 +117,7 @@ class PropertiesSet
|
|||
void print() const;
|
||||
|
||||
private:
|
||||
typedef map<string, Properties> PropsList;
|
||||
using PropsList = map<string, Properties>;
|
||||
|
||||
// The properties read from an external 'stella.pro' file
|
||||
PropsList myExternalProps;
|
||||
|
|
|
@ -128,7 +128,7 @@ class Settings
|
|||
Variant value;
|
||||
Variant initialValue;
|
||||
};
|
||||
typedef vector<Setting> SettingsArray;
|
||||
using SettingsArray = vector<Setting>;
|
||||
|
||||
const SettingsArray& getInternalSettings() const
|
||||
{ return myInternalSettings; }
|
||||
|
|
|
@ -24,7 +24,7 @@ class CheckboxWidget;
|
|||
|
||||
#include "ListWidget.hxx"
|
||||
|
||||
typedef vector<CheckboxWidget*> CheckboxArray;
|
||||
using CheckboxArray = vector<CheckboxWidget*>;
|
||||
|
||||
|
||||
/** CheckListWidget */
|
||||
|
|
|
@ -134,7 +134,7 @@ class Dialog : public GuiObject
|
|||
Focus(Widget* w = 0);
|
||||
virtual ~Focus();
|
||||
};
|
||||
typedef vector<Focus> FocusList;
|
||||
using FocusList = vector<Focus>;
|
||||
|
||||
struct TabFocus {
|
||||
TabWidget* widget;
|
||||
|
@ -148,7 +148,7 @@ class Dialog : public GuiObject
|
|||
void saveCurrentFocus(Widget* w);
|
||||
Widget* getNewFocus();
|
||||
};
|
||||
typedef vector<TabFocus> TabFocusList;
|
||||
using TabFocusList = vector<TabFocus>;
|
||||
|
||||
Focus _myFocus; // focus for base dialog
|
||||
TabFocusList _myTabList; // focus for each tab (if any)
|
||||
|
|
|
@ -35,7 +35,7 @@ struct BBX
|
|||
|
||||
/* builtin C-based proportional/fixed font structure */
|
||||
/* based on The Microwindows Project http://microwindows.org */
|
||||
typedef struct
|
||||
struct FontDesc
|
||||
{
|
||||
const char* name; /* font name */
|
||||
int maxwidth; /* max width in pixels */
|
||||
|
@ -50,7 +50,7 @@ typedef struct
|
|||
const BBX* bbx; /* character bounding box or nullptr if fixed */
|
||||
int defaultchar; /* default char (not glyph index) */
|
||||
long bits_size; /* # words of bitmap_t bits */
|
||||
} FontDesc;
|
||||
};
|
||||
|
||||
namespace GUI {
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ class Widget;
|
|||
#include "Command.hxx"
|
||||
#include "OSystem.hxx"
|
||||
|
||||
typedef vector<Widget*> WidgetArray;
|
||||
using WidgetArray = vector<Widget*>;
|
||||
|
||||
// The commands generated by various widgets
|
||||
enum {
|
||||
|
|
|
@ -59,7 +59,7 @@ class InputTextDialog : public Dialog, public CommandSender
|
|||
void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
||||
|
||||
private:
|
||||
typedef vector<EditTextWidget*> InputWidget;
|
||||
using InputWidget = vector<EditTextWidget*>;
|
||||
|
||||
InputWidget myInput;
|
||||
StaticTextWidget* myTitle;
|
||||
|
|
|
@ -62,14 +62,14 @@ class ScrollBarWidget : public Widget, public CommandSender
|
|||
int _wheel_lines;
|
||||
|
||||
private:
|
||||
typedef enum {
|
||||
enum Part {
|
||||
kNoPart,
|
||||
kUpArrowPart,
|
||||
kDownArrowPart,
|
||||
kSliderPart,
|
||||
kPageUpPart,
|
||||
kPageDownPart
|
||||
} Part;
|
||||
};
|
||||
|
||||
Part _part;
|
||||
Part _draggingPart;
|
||||
|
|
|
@ -75,7 +75,7 @@ class TabWidget : public Widget, public CommandSender
|
|||
Tab(const string& t = "", Widget* first = 0, Widget* parent = 0, bool e = true)
|
||||
: title(t), firstWidget(first), parentWidget(parent), enabled(e) { }
|
||||
};
|
||||
typedef vector<Tab> TabList;
|
||||
using TabList = vector<Tab>;
|
||||
|
||||
TabList _tabs;
|
||||
int _tabWidth;
|
||||
|
|
Loading…
Reference in New Issue