From 5a1c3c29aca08e2add63bf294dc6dd0eb26cba4b Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Sun, 2 May 2021 02:27:51 +0200 Subject: QSaveFile: code tidies Turn a cast into a call to QFlags::toInt(), plus a cast. This is in preparation for a future patch that will remove the implicit conversion. So why not casting directly? Because we don't know if the QFlags is backed by int or uint, so using the wrong cast won't compile; and we MUST pass unsigned because of the %x specifier. Granted, one could've used a static_assert, but I prefer a more flexible and idiomatic solution. Change-Id: I32a3e0ed69b925e8d56268ec84d9e668ca540188 Reviewed-by: Thiago Macieira --- src/corelib/io/qsavefile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/io') diff --git a/src/corelib/io/qsavefile.cpp b/src/corelib/io/qsavefile.cpp index 067ccda3df..afe39287bd 100644 --- a/src/corelib/io/qsavefile.cpp +++ b/src/corelib/io/qsavefile.cpp @@ -204,7 +204,7 @@ bool QSaveFile::open(OpenMode mode) // In the future we could implement ReadWrite by copying from the existing file to the temp file... // The implications of NewOnly and ExistingOnly when used with QSaveFile need to be considered carefully... if (mode & (ReadOnly | Append | NewOnly | ExistingOnly)) { - qWarning("QSaveFile::open: Unsupported open mode 0x%x", int(mode)); + qWarning("QSaveFile::open: Unsupported open mode 0x%x", uint(mode.toInt())); return false; } -- cgit v1.2.3