diff options
Diffstat (limited to 'plugins/HistoryStats')
-rw-r--r-- | plugins/HistoryStats/src/_langext.h | 5 | ||||
-rw-r--r-- | plugins/HistoryStats/src/dlgoption_subglobal.cpp | 6 | ||||
-rw-r--r-- | plugins/HistoryStats/src/dlgoption_suboutput.cpp | 2 | ||||
-rw-r--r-- | plugins/HistoryStats/src/settings.cpp | 7 | ||||
-rw-r--r-- | plugins/HistoryStats/src/statistic.cpp | 2 |
5 files changed, 7 insertions, 15 deletions
diff --git a/plugins/HistoryStats/src/_langext.h b/plugins/HistoryStats/src/_langext.h index ffe1626643..f5e94694f7 100644 --- a/plugins/HistoryStats/src/_langext.h +++ b/plugins/HistoryStats/src/_langext.h @@ -11,9 +11,6 @@ #define BOOL_(cpp_bool) \
((cpp_bool) ? TRUE : FALSE)
-#define array_len(array_var) \
- (sizeof(array_var) / sizeof((array_var)[0]))
-
#define range_each_(index_var, lo_bound, up_bound) \
for (int index_var = (lo_bound); index_var < (up_bound); ++index_var)
@@ -21,7 +18,7 @@ range_each_(index_var, 0, (up_bound))
#define array_each_(index_var, array_var) \
- range_each_(index_var, 0, array_len(array_var))
+ range_each_(index_var, 0, _countof(array_var))
#define vector_each_(index_var, vector_var) \
for (int index_var = 0; index_var != (vector_var).size(); ++index_var)
diff --git a/plugins/HistoryStats/src/dlgoption_subglobal.cpp b/plugins/HistoryStats/src/dlgoption_subglobal.cpp index 27d8071290..09208fa6d0 100644 --- a/plugins/HistoryStats/src/dlgoption_subglobal.cpp +++ b/plugins/HistoryStats/src/dlgoption_subglobal.cpp @@ -32,7 +32,7 @@ INT_PTR CALLBACK DlgOption::SubGlobal::staticInfoProc(HWND hDlg, UINT msg, WPARA int nCurLink = 0;
if (!linkTexts.empty()) {
- while (!linkTexts.empty() && nCurLink < array_len(LinkIDs)) {
+ while (!linkTexts.empty() && nCurLink < _countof(LinkIDs)) {
ext::string::size_type posTexts = linkTexts.rfind('|');
ext::string::size_type posURLs = linkURLs.rfind('|');
@@ -57,7 +57,7 @@ INT_PTR CALLBACK DlgOption::SubGlobal::staticInfoProc(HWND hDlg, UINT msg, WPARA int nHeightAdd = 0;
- while (nCurLink < array_len(LinkIDs)) {
+ while (nCurLink < _countof(LinkIDs)) {
HWND hLink = GetDlgItem(hDlg, LinkIDs[nCurLink]);
RECT rLink;
@@ -114,7 +114,7 @@ INT_PTR CALLBACK DlgOption::SubGlobal::staticInfoProc(HWND hDlg, UINT msg, WPARA HWND hStatic = reinterpret_cast<HWND>(lParam);
TCHAR szClassName[64];
- if (GetClassName(hStatic, szClassName, array_len(szClassName)) && ext::strfunc::cmp(szClassName, WC_EDIT) == 0) {
+ if (GetClassName(hStatic, szClassName, _countof(szClassName)) && ext::strfunc::cmp(szClassName, WC_EDIT) == 0) {
HDC hDC = reinterpret_cast<HDC>(wParam);
SetBkColor(hDC, GetSysColor(COLOR_WINDOW));
diff --git a/plugins/HistoryStats/src/dlgoption_suboutput.cpp b/plugins/HistoryStats/src/dlgoption_suboutput.cpp index a4b5de4231..dce580a1f6 100644 --- a/plugins/HistoryStats/src/dlgoption_suboutput.cpp +++ b/plugins/HistoryStats/src/dlgoption_suboutput.cpp @@ -178,7 +178,7 @@ void DlgOption::SubOutput::onWMInitDialog() };
m_SortKeyToIndex.resize(Settings::skLAST - Settings::skFIRST + 1);
- m_IndexToSortKey.resize(array_len(sortKeys));
+ m_IndexToSortKey.resize(_countof(sortKeys));
array_each_(i, sortKeys)
{
diff --git a/plugins/HistoryStats/src/settings.cpp b/plugins/HistoryStats/src/settings.cpp index 3afbb3aaa5..ce15912a01 100644 --- a/plugins/HistoryStats/src/settings.cpp +++ b/plugins/HistoryStats/src/settings.cpp @@ -21,12 +21,7 @@ Settings::CharMapper::CharMapper(const Settings& settings) }
LCID lcid = GetUserDefaultLCID();
- int len = LCMapString(
- lcid, LCMAP_LINGUISTIC_CASING | LCMAP_LOWERCASE,
- m_CharMap + 1, array_len(m_CharMap) - 1,
- m_CharMap + 1, array_len(m_CharMap) - 1);
-
- assert(len == array_len(m_CharMap) - 1);
+ LCMapString(lcid, LCMAP_LINGUISTIC_CASING | LCMAP_LOWERCASE, m_CharMap + 1, _countof(m_CharMap)-1, m_CharMap + 1, _countof(m_CharMap)-1);
upto_each_(i, 3)
{
diff --git a/plugins/HistoryStats/src/statistic.cpp b/plugins/HistoryStats/src/statistic.cpp index c0207baac8..acaf5fe0eb 100644 --- a/plugins/HistoryStats/src/statistic.cpp +++ b/plugins/HistoryStats/src/statistic.cpp @@ -1348,7 +1348,7 @@ bool Statistic::createStatisticsSteps() { &Statistic::stepWriteHTML, LPGENT("Creating HTML") }
};
- setProgressMax(false, array_len(stepsInfo));
+ setProgressMax(false, _countof(stepsInfo));
array_each_(i, stepsInfo)
{
|