diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-05-04 19:00:57 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-06-26 13:30:12 (GMT) |
commit | 4def9f12bec58e6c952361aac946fca80c27a3be (patch) | |
tree | 0f6dc4a1d9d8db8700f3369d35e65c4b3647337c /src/corelib | |
parent | b798c301d34f0f1ec69ca533bc91e575fac9843b (diff) | |
download | Qt-4def9f12bec58e6c952361aac946fca80c27a3be.zip Qt-4def9f12bec58e6c952361aac946fca80c27a3be.tar.gz Qt-4def9f12bec58e6c952361aac946fca80c27a3be.tar.bz2 |
Fixed a gcc 4.4 warning on switching a value outside the enum.
These four enum values are used in variables of type Section, but aren't in it.
With gcc 4.4, it displays a warning that the value is lower than the lowest value
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/tools/qdatetime.cpp | 7 | ||||
-rw-r--r-- | src/corelib/tools/qdatetime_p.h | 14 |
2 files changed, 13 insertions, 8 deletions
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 09cc47f..7dd9060 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -4398,6 +4398,13 @@ int QDateTimeParser::sectionMaxSize(Section s, int count) const case DateSectionMask: qWarning("QDateTimeParser::sectionMaxSize: Invalid section %s", sectionName(s).toLatin1().constData()); + + case NoSectionIndex: + case FirstSectionIndex: + case LastSectionIndex: + case CalendarPopupIndex: + // these cases can't happen + break; } return -1; } diff --git a/src/corelib/tools/qdatetime_p.h b/src/corelib/tools/qdatetime_p.h index ec931d3..3201958 100644 --- a/src/corelib/tools/qdatetime_p.h +++ b/src/corelib/tools/qdatetime_p.h @@ -138,13 +138,6 @@ public: PossibleBoth = 4 }; - enum { - NoSectionIndex = -1, - FirstSectionIndex = -2, - LastSectionIndex = -3, - CalendarPopupIndex = -4 - }; - enum Section { NoSection = 0x00000, AmPmSection = 0x00001, @@ -163,7 +156,12 @@ public: DateSectionMask = (DaySection|MonthSection|YearSection|YearSection2Digits|DayOfWeekSection), FirstSection = 0x02000|Internal, LastSection = 0x04000|Internal, - CalendarPopupSection = 0x08000|Internal + CalendarPopupSection = 0x08000|Internal, + + NoSectionIndex = -1, + FirstSectionIndex = -2, + LastSectionIndex = -3, + CalendarPopupIndex = -4 }; // duplicated from qdatetimeedit.h Q_DECLARE_FLAGS(Sections, Section) |