summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2014-01-09 19:50:01 +0000
committerMaxime Coste <frrrwww@gmail.com>2014-01-09 19:59:26 +0000
commite6884f989c2d955b8893d9b8eccc80f8cda0c7ca (patch)
treed479e69eb8f3888f6345072aacb71b32a98d4cd6 /src
parent560b4ab0b5551091754bcd331d1ac471c077aaab (diff)
Style changes, replace typedefs with usings
Diffstat (limited to 'src')
-rw-r--r--src/buffer.hh13
-rw-r--r--src/completion.hh7
-rw-r--r--src/display_buffer.hh2
-rw-r--r--src/highlighter.hh8
-rw-r--r--src/hook_manager.hh2
-rw-r--r--src/id_map.hh8
-rw-r--r--src/keys.hh2
-rw-r--r--src/parameters_parser.hh10
-rw-r--r--src/register_manager.hh2
-rw-r--r--src/selectors.hh2
-rw-r--r--src/shell_manager.hh4
-rw-r--r--src/string.hh2
12 files changed, 30 insertions, 32 deletions
diff --git a/src/buffer.hh b/src/buffer.hh
index 13b958c5..9c648625 100644
--- a/src/buffer.hh
+++ b/src/buffer.hh
@@ -6,7 +6,6 @@
#include "option_manager.hh"
#include "keymap_manager.hh"
#include "string.hh"
-#include "units.hh"
#include <vector>
#include <list>
@@ -30,11 +29,11 @@ struct BufferCoord : LineAndColumn<BufferCoord, LineCount, ByteCount>
class BufferIterator
{
public:
- typedef char value_type;
- typedef size_t difference_type;
- typedef const value_type* pointer;
- typedef const value_type& reference;
- typedef std::random_access_iterator_tag iterator_category;
+ using value_type = char;
+ using difference_type = size_t;
+ using pointer = const value_type*;
+ using reference = const value_type&;
+ using iterator_category = std::random_access_iterator_tag;
BufferIterator() : m_buffer(nullptr) {}
BufferIterator(const Buffer& buffer, BufferCoord coord);
@@ -202,7 +201,7 @@ private:
Flags m_flags;
struct Modification;
- typedef std::vector<Modification> UndoGroup;
+ using UndoGroup = std::vector<Modification>;
friend class UndoGroupOptimizer;
std::vector<UndoGroup> m_history;
diff --git a/src/completion.hh b/src/completion.hh
index 84e08dcb..70241f42 100644
--- a/src/completion.hh
+++ b/src/completion.hh
@@ -1,17 +1,18 @@
#ifndef completion_hh_INCLUDED
#define completion_hh_INCLUDED
-#include "string.hh"
-
#include <vector>
#include <functional>
+#include "units.hh"
+
namespace Kakoune
{
class Context;
-typedef std::vector<String> CandidateList;
+class String;
+using CandidateList = std::vector<String>;
struct Completions
{
diff --git a/src/display_buffer.hh b/src/display_buffer.hh
index 8ea88cec..f366bda9 100644
--- a/src/display_buffer.hh
+++ b/src/display_buffer.hh
@@ -18,7 +18,7 @@ struct DisplayCoord : LineAndColumn<DisplayCoord, LineCount, CharCount>
: LineAndColumn(line, column) {}
};
-typedef char Attribute;
+using Attribute = char;
enum Attributes
{
diff --git a/src/highlighter.hh b/src/highlighter.hh
index beba2403..ee476fa9 100644
--- a/src/highlighter.hh
+++ b/src/highlighter.hh
@@ -20,12 +20,10 @@ class Context;
// color, adding information text (line numbering for example) or replacing
// buffer content (folding for example)
-typedef std::function<void (const Context& context, DisplayBuffer& display_buffer)> HighlighterFunc;
-typedef std::pair<String, HighlighterFunc> HighlighterAndId;
-typedef memoryview<String> HighlighterParameters;
-
+using HighlighterFunc = std::function<void (const Context& context, DisplayBuffer& display_buffer)>;
+using HighlighterAndId = std::pair<String, HighlighterFunc>;
+using HighlighterParameters = memoryview<String>;
using HighlighterFactory = std::function<HighlighterAndId (HighlighterParameters params)>;
-
using HighlighterGroup = FunctionGroup<const Context&, DisplayBuffer&>;
struct HighlighterRegistry : FunctionRegistry<HighlighterFactory>,
diff --git a/src/hook_manager.hh b/src/hook_manager.hh
index 8b0d7e2d..1c86bfb1 100644
--- a/src/hook_manager.hh
+++ b/src/hook_manager.hh
@@ -10,7 +10,7 @@ namespace Kakoune
{
class Context;
-typedef std::function<void (const String&, Context&)> HookFunc;
+using HookFunc = std::function<void (const String&, Context&)>;
class HookManager
{
diff --git a/src/id_map.hh b/src/id_map.hh
index 9c80d776..32462fa5 100644
--- a/src/id_map.hh
+++ b/src/id_map.hh
@@ -13,10 +13,10 @@ template<typename Value>
class id_map
{
public:
- typedef std::pair<String, Value> value_type;
- typedef std::vector<value_type> container_type;
- typedef typename container_type::iterator iterator;
- typedef typename container_type::const_iterator const_iterator;
+ using value_type = std::pair<String, Value>;
+ using container_type = std::vector<value_type>;
+ using iterator = typename container_type::iterator;
+ using const_iterator = typename container_type::const_iterator;
void append(const value_type& value)
{
diff --git a/src/keys.hh b/src/keys.hh
index 133363a0..de775552 100644
--- a/src/keys.hh
+++ b/src/keys.hh
@@ -64,7 +64,7 @@ struct Key
{ return modifiers != other.modifiers or key != other.key; }
};
-typedef std::vector<Key> KeyList;
+using KeyList = std::vector<Key>;
KeyList parse_keys(const String& str);
String key_to_str(Key key);
diff --git a/src/parameters_parser.hh b/src/parameters_parser.hh
index 698230af..2f7e5477 100644
--- a/src/parameters_parser.hh
+++ b/src/parameters_parser.hh
@@ -74,11 +74,11 @@ struct ParametersParser
struct iterator
{
public:
- typedef String value_type;
- typedef const value_type* pointer;
- typedef const value_type& reference;
- typedef size_t difference_type;
- typedef std::forward_iterator_tag iterator_category;
+ using value_type = String;
+ using pointer = const value_type*;
+ using reference = const value_type&;
+ using difference_type = size_t;
+ using iterator_category = std::forward_iterator_tag;
iterator(const ParametersParser& parser, size_t index)
: m_parser(parser), m_index(index) {}
diff --git a/src/register_manager.hh b/src/register_manager.hh
index d12d0a94..7021c53b 100644
--- a/src/register_manager.hh
+++ b/src/register_manager.hh
@@ -11,7 +11,7 @@
namespace Kakoune
{
-typedef std::function<std::vector<String> (const Context&)> RegisterRetriever;
+using RegisterRetriever = std::function<std::vector<String> (const Context&)>;
class RegisterManager : public Singleton<RegisterManager>
{
diff --git a/src/selectors.hh b/src/selectors.hh
index 0cfa7a68..0ffdc745 100644
--- a/src/selectors.hh
+++ b/src/selectors.hh
@@ -56,7 +56,7 @@ inline Range utf8_range(const Utf8Iterator& first, const Utf8Iterator& last)
return {first.base().coord(), last.base().coord()};
}
-typedef boost::regex_iterator<BufferIterator> RegexIterator;
+using RegexIterator = boost::regex_iterator<BufferIterator>;
template<WordType word_type>
Selection select_to_next_word(const Buffer& buffer, const Selection& selection)
diff --git a/src/shell_manager.hh b/src/shell_manager.hh
index 6748b609..cee125bf 100644
--- a/src/shell_manager.hh
+++ b/src/shell_manager.hh
@@ -10,8 +10,8 @@ namespace Kakoune
{
struct Context;
-typedef std::function<String (const String& name, const Context&)> EnvVarRetriever;
-typedef std::unordered_map<String, String> EnvVarMap;
+using EnvVarRetriever = std::function<String (const String& name, const Context&)>;
+using EnvVarMap = std::unordered_map<String, String>;
class ShellManager : public Singleton<ShellManager>
{
diff --git a/src/string.hh b/src/string.hh
index 176c7269..75f2e8b0 100644
--- a/src/string.hh
+++ b/src/string.hh
@@ -11,7 +11,7 @@
namespace Kakoune
{
-typedef boost::regex Regex;
+using Regex = boost::regex;
class String : public std::string
{