Skip to content

Commit 651628e

Browse files
committed
- changed std::iterator to c++17 style
- size_t instead of int in loops in methods of Match - spaces -> tabs
1 parent e59cb27 commit 651628e

5 files changed

Lines changed: 469 additions & 453 deletions

File tree

PythonScript/src/ANSIIterator.h

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,18 @@
55

66

77

8-
class ANSIIterator : public std::iterator<std::bidirectional_iterator_tag, char>
8+
class ANSIIterator
99
{
1010
public:
11-
ANSIIterator(const char* doc = NULL, int pos = 0, int end = 0) :
11+
12+
//std::iterator traits
13+
using iterator_category = std::bidirectional_iterator_tag;
14+
using value_type = char;
15+
using difference_type = std::ptrdiff_t;
16+
using pointer = char*;
17+
using reference = char&;
18+
19+
ANSIIterator(const char* doc = NULL, int pos = 0, int end = 0) :
1220
_doc(doc),
1321
_pos(pos),
1422
_end(end)
@@ -18,7 +26,7 @@ class ANSIIterator : public std::iterator<std::bidirectional_iterator_tag, char>
1826
// Ensure for release.
1927
if (_pos > _end)
2028
_pos = _end;
21-
29+
2230
}
2331

2432
ANSIIterator(const ANSIIterator& copy) :
@@ -62,8 +70,8 @@ class ANSIIterator : public std::iterator<std::bidirectional_iterator_tag, char>
6270
{
6371
assert(_pos > 0);
6472
--_pos;
65-
if (_pos < 0) {
66-
_pos = 0;
73+
if (_pos < 0) {
74+
_pos = 0;
6775
}
6876
return *this;
6977
}
@@ -79,7 +87,7 @@ class ANSIIterator : public std::iterator<std::bidirectional_iterator_tag, char>
7987
{
8088
return bytesLeft() <= 0;
8189
}
82-
90+
8391
int bytesLeft() const
8492
{
8593
return _end - _pos;

PythonScript/src/ConfigFile.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ ConfigFile* ConfigFile::create(const TCHAR *configDir, const TCHAR *pluginDir, H
1414

1515

1616
ConfigFile::ConfigFile(const TCHAR *configDir, const TCHAR *pluginDir, HINSTANCE hInst)
17-
: m_hInst (hInst),
18-
m_configFilename(configDir),
19-
m_pluginDir(pluginDir),
20-
m_machineScriptsDir(pluginDir),
21-
m_userScriptsDir(configDir),
22-
m_configDir(configDir)
17+
: m_hInst (hInst),
18+
m_configFilename(configDir),
19+
m_pluginDir(pluginDir),
20+
m_machineScriptsDir(pluginDir),
21+
m_userScriptsDir(configDir),
22+
m_configDir(configDir)
2323
{
2424
m_configFilename.append(_T("\\PythonScriptStartup.cnf"));
2525

0 commit comments

Comments
 (0)