diff options
author | Hou Lei <houlei@uniontech.com> | 2021-02-08 11:48:23 +0800 |
---|---|---|
committer | Hou Lei <houlei@uniontech.com> | 2021-02-09 10:27:14 +0800 |
commit | 841e63cb77094a7a50fe7c9f0e210b045f7c7402 (patch) | |
tree | 4bf332911c11f45d6919b5e2edd61d9348df8557 /src/testlib | |
parent | ff510b98d99a45880cf89b9949175ceda5f084c5 (diff) |
Canonical pointer usage
Other affected rows have also been fixed.
Change-Id: Ie0a32f724bd2e40e7bfacfaa43a78190b58e4a21
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/testlib')
-rw-r--r-- | src/testlib/qasciikey.cpp | 2 | ||||
-rw-r--r-- | src/testlib/qtestcase.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/testlib/qasciikey.cpp b/src/testlib/qasciikey.cpp index 9a308da2bc..28404ec37d 100644 --- a/src/testlib/qasciikey.cpp +++ b/src/testlib/qasciikey.cpp @@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE */ Qt::Key QTest::asciiToKey(char ascii) { - switch ((unsigned char)ascii) { + switch (static_cast<unsigned char>(ascii)) { case 0x08: return Qt::Key_Backspace; case 0x09: return Qt::Key_Tab; case 0x0b: return Qt::Key_Backtab; diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp index 7c2de877da..17901eb08a 100644 --- a/src/testlib/qtestcase.cpp +++ b/src/testlib/qtestcase.cpp @@ -227,7 +227,7 @@ static void stackTrace() "detach\n" "quit\n" "EOF\n", - (int)getpid()); + static_cast<int>(getpid())); if (system(cmd) == -1) fprintf(stderr, "calling gdb failed\n"); fprintf(stderr, "=== End of stack trace ===\n"); @@ -237,7 +237,7 @@ static void stackTrace() "bt all\n" "quit\n" "EOF\n", - (int)getpid()); + static_cast<int>(getpid())); if (system(cmd) == -1) fprintf(stderr, "calling lldb failed\n"); fprintf(stderr, "=== End of stack trace ===\n"); @@ -502,7 +502,7 @@ static void qPrintDataTags(FILE *stream) static int qToInt(const char *str) { char *pEnd; - int l = (int)strtol(str, &pEnd, 10); + int l = static_cast<int>(strtol(str, &pEnd, 10)); if (*pEnd != 0) { fprintf(stderr, "Invalid numeric parameter: '%s'\n", str); exit(1); |