Issue 362
Here are some small changes from CPPCheck and also in some places I seen that some parameters could be declared const as they are not being changed.
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#include <cassert>
|
||||
#include <array>
|
||||
|
||||
namespace {
|
||||
std::tm localtime()
|
||||
@@ -239,18 +240,20 @@ namespace nana
|
||||
return days + d;
|
||||
}
|
||||
|
||||
unsigned date::month_days(unsigned year, unsigned month)
|
||||
unsigned date::month_days(const unsigned year, const unsigned month)
|
||||
{
|
||||
unsigned num[] = {31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
|
||||
if(month != 2)
|
||||
return num[month - 1];
|
||||
if (month != 2)
|
||||
{
|
||||
const std::array<unsigned, 12> days_in_month = { 31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
|
||||
return days_in_month[month - 1];
|
||||
}
|
||||
|
||||
if(((year % 4 == 0) && (year % 100)) || (year % 400 == 0))
|
||||
return 29;
|
||||
return 28;
|
||||
}
|
||||
|
||||
unsigned date::year_days(unsigned year)
|
||||
unsigned date::year_days(const unsigned year)
|
||||
{
|
||||
if(((year % 4 == 0) && (year % 100)) || (year % 400 == 0))
|
||||
return 366;
|
||||
|
||||
@@ -136,11 +136,12 @@ namespace nana
|
||||
evt_disabled_ &= ~(1 << static_cast<int>(evt_code)); // clear
|
||||
}
|
||||
|
||||
void drawer_trigger::filter_event(const std::vector<event_code> evt_codes, const bool bDisabled)
|
||||
void drawer_trigger::filter_event(const std::vector<event_code>& evt_codes, const bool bDisabled)
|
||||
{
|
||||
const auto it_end = evt_codes.end();
|
||||
for (auto it = evt_codes.begin(); it != it_end; it++)
|
||||
filter_event(*it, bDisabled);
|
||||
for (const auto& evt_code : evt_codes)
|
||||
{
|
||||
filter_event(evt_code, bDisabled);
|
||||
}
|
||||
}
|
||||
|
||||
void drawer_trigger::filter_event(const event_filter_status& evt_all_states)
|
||||
|
||||
Reference in New Issue
Block a user