Commit 98b7d1bc authored by Laurent Montel's avatar Laurent Montel 😁

Add nullptr

parent 006d3182
......@@ -55,7 +55,7 @@ static QStringList allHolidayFiles(const QString &location = QString())
class Q_DECL_HIDDEN HolidayRegion::HolidayRegionPrivate
{
public:
HolidayRegionPrivate(const QString &regionCode) : mDriver(0),
HolidayRegionPrivate(const QString &regionCode) : mDriver(nullptr),
mRegionCode(regionCode)
{
if (!mRegionCode.isEmpty()) {
......@@ -67,7 +67,7 @@ public:
init();
}
HolidayRegionPrivate(const QFileInfo &regionFile) : mDriver(0),
HolidayRegionPrivate(const QFileInfo &regionFile) : mDriver(nullptr),
mHolidayFile(regionFile)
{
init();
......
......@@ -462,7 +462,7 @@ yyreduce:
char *s = (yysemantic_stack_[(2) - (2)].sval);
driver.setFileCountryCode(QString::fromUtf8(s));
free(s);
(yysemantic_stack_[(2) - (2)].sval) = NULL;
(yysemantic_stack_[(2) - (2)].sval) = nullptr;
}
break;
......@@ -483,7 +483,7 @@ yyreduce:
char *s = (yysemantic_stack_[(2) - (2)].sval);
driver.setFileLanguageCode(QString::fromUtf8(s));
free(s);
(yysemantic_stack_[(2) - (2)].sval) = NULL;
(yysemantic_stack_[(2) - (2)].sval) = nullptr;
}
break;
......@@ -504,7 +504,7 @@ yyreduce:
char *s = (yysemantic_stack_[(2) - (2)].sval);
driver.setFileName(QString::fromUtf8(s));
free(s);
(yysemantic_stack_[(2) - (2)].sval) = NULL;
(yysemantic_stack_[(2) - (2)].sval) = nullptr;
}
break;
......@@ -525,7 +525,7 @@ yyreduce:
char *s = (yysemantic_stack_[(2) - (2)].sval);
driver.setFileDescription(QString::fromUtf8(s));
free(s);
(yysemantic_stack_[(2) - (2)].sval) = NULL;
(yysemantic_stack_[(2) - (2)].sval) = nullptr;
}
break;
......@@ -537,7 +537,7 @@ yyreduce:
char *s = (yysemantic_stack_[(1) - (1)].sval);
driver.setEventName(QString::fromUtf8(s));
free(s);
(yysemantic_stack_[(1) - (1)].sval) = NULL;
(yysemantic_stack_[(1) - (1)].sval) = nullptr;
}
break;
......@@ -837,7 +837,7 @@ yyreduce:
char *s = (yysemantic_stack_[(1) - (1)].sval);
(yyval.ival) = driver.julianDayFromEventName(s);
free(s);
(yysemantic_stack_[(1) - (1)].sval) = NULL;
(yysemantic_stack_[(1) - (1)].sval) = nullptr;
}
break;
......@@ -1541,7 +1541,7 @@ const HolidayParserPlan::yytname_[] = {
"countrycode", "languagecode", "name", "description", "list",
"eventname", "categories", "calendar", "eventrule", "offset",
"conditionaloffset", "wdaycondition", "length", "date", "reldate",
"month", "monthnumber", "expr", "pexpr", "number", 0
"month", "monthnumber", "expr", "pexpr", "number", nullptr
};
#endif
......
......@@ -2791,7 +2791,7 @@ yyFlexLexer::yyFlexLexer(std::istream *arg_yyin, std::ostream *arg_yyout)
{
yyin = arg_yyin;
yyout = arg_yyout;
yy_c_buf_p = 0;
yy_c_buf_p = nullptr;
yy_init = 0;
yy_start = 0;
yy_flex_debug = 0;
......@@ -2805,13 +2805,13 @@ yyFlexLexer::yyFlexLexer(std::istream *arg_yyin, std::ostream *arg_yyout)
yy_more_offset = yy_prev_more_offset = 0;
yy_start_stack_ptr = yy_start_stack_depth = 0;
yy_start_stack = NULL;
yy_start_stack = nullptr;
yy_buffer_stack = 0;
yy_buffer_stack = nullptr;
yy_buffer_stack_top = 0;
yy_buffer_stack_max = 0;
yy_state_buf = 0;
yy_state_buf = nullptr;
}
......@@ -2965,7 +2965,7 @@ int yyFlexLexer::yy_get_next_buffer()
} else
/* Can't grow it, we don't own it. */
{
b->yy_ch_buf = 0;
b->yy_ch_buf = nullptr;
}
if (! b->yy_ch_buf)
......@@ -3342,7 +3342,7 @@ void yyFlexLexer::yy_delete_buffer(YY_BUFFER_STATE b)
}
if (b == YY_CURRENT_BUFFER) { /* Not sure if we should pop here. */
YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) nullptr;
}
if (b->yy_is_our_buffer) {
......@@ -3442,7 +3442,7 @@ void yyFlexLexer::yy_flush_buffer(YY_BUFFER_STATE b)
void yyFlexLexer::yypush_buffer_state(YY_BUFFER_STATE new_buffer)
/* %endif */
{
if (new_buffer == NULL) {
if (new_buffer == nullptr) {
return;
}
......@@ -3484,7 +3484,7 @@ void yyFlexLexer::yypop_buffer_state(void)
}
yy_delete_buffer(YY_CURRENT_BUFFER);
YY_CURRENT_BUFFER_LVALUE = NULL;
YY_CURRENT_BUFFER_LVALUE = nullptr;
if ((yy_buffer_stack_top) > 0) {
--(yy_buffer_stack_top);
}
......
......@@ -386,7 +386,7 @@ bool QCalendarSystemPrivate::isLeapYear(int year) const
void QCalendarSystemPrivate::julianDayToDate(qint64 jd, int *year, int *month, int *day) const
{
int yy, mm, dd;
int yy = 0, mm, dd;
switch (calendarSystem()) {
......@@ -740,7 +740,7 @@ int QCalendarSystem::year(const QDate &date) const
int y = 0;
if (isValid(date)) {
d->julianDayToDate(date.toJulianDay(), &y, 0, 0);
d->julianDayToDate(date.toJulianDay(), &y, nullptr, nullptr);
}
return y;
......@@ -751,7 +751,7 @@ int QCalendarSystem::month(const QDate &date) const
int m = 0;
if (isValid(date)) {
d->julianDayToDate(date.toJulianDay(), 0, &m, 0);
d->julianDayToDate(date.toJulianDay(), nullptr, &m, nullptr);
}
return m;
......@@ -762,7 +762,7 @@ int QCalendarSystem::day(const QDate &date) const
int dd = 0;
if (isValid(date)) {
d->julianDayToDate(date.toJulianDay(), 0, 0, &dd);
d->julianDayToDate(date.toJulianDay(), nullptr, nullptr, &dd);
}
return dd;
......@@ -772,7 +772,7 @@ int QCalendarSystem::quarter(const QDate &date) const
{
if (isValid(date)) {
int month;
d->julianDayToDate(date.toJulianDay(), 0, &month, 0);
d->julianDayToDate(date.toJulianDay(), nullptr, &month, nullptr);
return d->quarter(month);
} else {
return 0;
......@@ -970,7 +970,7 @@ int QCalendarSystem::daysInMonth(const QDate &date) const
{
if (isValid(date)) {
int year, month;
d->julianDayToDate(date.toJulianDay(), &year, &month, 0);
d->julianDayToDate(date.toJulianDay(), &year, &month, nullptr);
return d->daysInMonth(year, month);
} else {
return 0;
......@@ -1154,7 +1154,7 @@ void QCalendarSystem::dateDifference(const QDate &fromDate, const QDate &toDate,
if (isValid(fromDate) && isValid(toDate) && fromDate != toDate) {
if (toDate < fromDate) {
dateDifference(toDate, fromDate, &dy, &dm, &dd, 0);
dateDifference(toDate, fromDate, &dy, &dm, &dd, nullptr);
dir = -1;
} else {
int y1, m1, d1, y2, m2, d2;
......@@ -1241,7 +1241,7 @@ QDate QCalendarSystem::lastDayOfYear(int year) const
QDate QCalendarSystem::firstDayOfMonth(const QDate &dt) const
{
int year, month;
getDate(dt, &year, &month, 0);
getDate(dt, &year, &month, nullptr);
return date(year, month, 1);
}
......@@ -1253,7 +1253,7 @@ QDate QCalendarSystem::firstDayOfMonth(int year, int month) const
QDate QCalendarSystem::lastDayOfMonth(const QDate &dt) const
{
int year, month;
getDate(dt, &year, &month, 0);
getDate(dt, &year, &month, nullptr);
return date(year, month, daysInMonth(year, month));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment