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>bb10
parent
dd904c3c48
commit
285b966670
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue