diff options
author | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2012-11-07 15:44:56 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-11-07 16:47:15 +0100 |
commit | 285b9666706d8f42b4bc39cf166853af24214448 (patch) | |
tree | b1c1da2b8680459db99bc5e2ee13c6ae3788111a /src | |
parent | dd904c3c48c9c153a7904b0ee4da0251dd3cb9b4 (diff) |
fix sign mismatch warnings
enums are signed, while sizeof is unsigned.
as a side effect, we can optimize away one comparison by taking
advantage of the two's complement representation.
Change-Id: Ic0871306d30ad7217f2909e51e96a876a3f393dc
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/global/qlibraryinfo.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index ffdf8d0fd3..be608a4950 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -325,7 +325,7 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group) #endif { const char *path = 0; - if (loc >= 0 && loc < sizeof(qt_configure_prefix_path_strs)/sizeof(qt_configure_prefix_path_strs[0])) + if (unsigned(loc) < sizeof(qt_configure_prefix_path_strs)/sizeof(qt_configure_prefix_path_strs[0])) path = qt_configure_prefix_path_strs[loc] + 12; #ifndef Q_OS_WIN // On Windows we use the registry else if (loc == SettingsPath) @@ -338,7 +338,7 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group) } else { QString key; QString defaultValue; - if (loc >= 0 && loc < sizeof(qtConfEntries)/sizeof(qtConfEntries[0])) { + if (unsigned(loc) < sizeof(qtConfEntries)/sizeof(qtConfEntries[0])) { key = QLatin1String(qtConfEntries[loc].key); defaultValue = QLatin1String(qtConfEntries[loc].value); } |