NoDebug& operator<<(bool){return*this;}
};
#endif
+
+//qSort is deprecated, long live lSort
+#include <algorithm>
+
+template<class Cont>
+static inline void lSort(Cont &c)
+{
+ std::sort(c.begin(),c.end());
+}
/* **************************************************************
m_posix=PosixRule(posix);
//sort and add end times
- qSort(m_file);
+ lSort(m_file);
for(int i=0;i<(m_file.size()-1);i++)
m_file[i].setEnd(m_file[i+1].startTime());
if(m_file.size())
else ret<<end;
//calculate end of rules
- qSort(ret);
+ lSort(ret);
for(int i=1;i<ret.size();i++)
ret[i-1].m_end=ret[i].m_start;
//truncate last rule, we do not need it
rl<<createRule(y+1,true)<<createRule(y+1,false);
rl<<createRule(y+2,true)<<createRule(y+2,false);
//sort and extend
- qSort(rl);
+ lSort(rl);
for(int i=1;i<rl.size();i++)
rl[i-1].m_end=rl[i].m_start;
//find the first one that is later and on a different offset
#include <QtGlobal>
#include <QByteArray>
+#ifndef Q_FALLTHROUGH
+//introduced in Qt 5.14, for backward compat:
+#define Q_FALLTHROUGH()
+#endif
+
namespace TimeZoneLib {
/**the amount of seconds per Day*/
//calculate 1st of month
// for each month: add the days of the previous one, and the previous, ...
switch(month){
- case 12:ret+=30;//nov
- case 11:ret+=31;//oct
- case 10:ret+=30;//sep
- case 9:ret+=31;//aug
- case 8:ret+=31;//jul
- case 7:ret+=30;//jun
- case 6:ret+=31;//may
- case 5:ret+=30;//apr
- case 4:ret+=31;//mar
- case 3:ret+=28;if(isLeapYear(year))ret++;//feb
- case 2:ret+=31;//jan
+ case 12:ret+=30;Q_FALLTHROUGH(); //nov
+ case 11:ret+=31;Q_FALLTHROUGH(); //oct
+ case 10:ret+=30;Q_FALLTHROUGH(); //sep
+ case 9:ret+=31;Q_FALLTHROUGH(); //aug
+ case 8:ret+=31;Q_FALLTHROUGH(); //jul
+ case 7:ret+=30;Q_FALLTHROUGH(); //jun
+ case 6:ret+=31;Q_FALLTHROUGH(); //may
+ case 5:ret+=30;Q_FALLTHROUGH(); //apr
+ case 4:ret+=31;Q_FALLTHROUGH(); //mar
+ case 3:ret+=28;if(isLeapYear(year))ret++;Q_FALLTHROUGH(); //feb
+ case 2:ret+=31;Q_FALLTHROUGH(); //jan
default:break;
}
//add day