From 73f5b19f5de58bcc6242acd8ada54bb535d8c1f4 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Thu, 20 Jan 2005 10:53:24 +0000 Subject: [PATCH] avoid using uninitialized values svn path=/trunk/kdeedu/libkdeedu/; revision=380365 --- extdate/extdatetime.cpp | 2 +- extdate/extdatetime.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extdate/extdatetime.cpp b/extdate/extdatetime.cpp index cf2db4d..ace14d8 100644 --- a/extdate/extdatetime.cpp +++ b/extdate/extdatetime.cpp @@ -145,7 +145,7 @@ void ExtDate::JDToGregorian( long int jd, int &year, int &month, int &day ) bool ExtDate::isValid() const { - return ( isValid( year(), month(), day() ) && jd() != INVALID_DAY ); + return ( jd() != INVALID_DAY && isValid( year(), month(), day() ) ); } int ExtDate::dayOfWeek() const diff --git a/extdate/extdatetime.h b/extdate/extdatetime.h index aac9551..3246593 100644 --- a/extdate/extdatetime.h +++ b/extdate/extdatetime.h @@ -33,7 +33,7 @@ extern void test2_unit(int y, int m, int d); class KDE_EXPORT ExtDate { public: - ExtDate() { m_jd = INVALID_DAY; } + ExtDate() : m_jd(INVALID_DAY), m_year(0), m_month(0), m_day(0) {} ExtDate( int y, int m, int d ); ExtDate( const QDate &q ) { ExtDate( q.year(), q.month(), q.day() ); } ExtDate( long int jd ); -- 2.47.3