summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2019-05-29 18:15:45 +0200
committerMarc Mutz <marc.mutz@kdab.com>2019-05-29 18:24:30 +0200
commit54a93af966d3aca8a970e0291d237d95cc3aec64 (patch)
tree2c6cdc3c59c4bb0686be25225408c0591d944654 /src/corelib/thread
parent090085e1040110ca6ae09956db8bf8e69a268eef (diff)
QtCore: use qUtf16Printable and %ls, qErrnoWarning()
... instead of qPrintable(), %s, and explicit qt_error_string(). Saves 2KiB in text size on optimized Linux AMD64 GCC 9.1 builds. Change-Id: I98b6717da1ed1b678f01167d704a96f10da47966 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/thread')
-rw-r--r--src/corelib/thread/qmutex_unix.cpp2
-rw-r--r--src/corelib/thread/qthread_unix.cpp8
-rw-r--r--src/corelib/thread/qwaitcondition_unix.cpp2
3 files changed, 5 insertions, 7 deletions
diff --git a/src/corelib/thread/qmutex_unix.cpp b/src/corelib/thread/qmutex_unix.cpp
index a92ac4f943..df2f606a23 100644
--- a/src/corelib/thread/qmutex_unix.cpp
+++ b/src/corelib/thread/qmutex_unix.cpp
@@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE
static void report_error(int code, const char *where, const char *what)
{
if (code != 0)
- qWarning("%s: %s failure: %s", where, what, qPrintable(qt_error_string(code)));
+ qErrnoWarning(code, "%s: %s failure", where, what);
}
#ifdef QT_UNIX_SEMAPHORE
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index 8328e514a8..3d4c906dc2 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -714,8 +714,7 @@ void QThread::start(Priority priority)
#endif // _POSIX_THREAD_ATTR_STACKSIZE
if (code) {
- qWarning("QThread::start: Thread stack size error: %s",
- qPrintable(qt_error_string(code)));
+ qErrnoWarning(code, "QThread::start: Thread stack size error");
// we failed to set the stacksize, and as the documentation states,
// the thread will fail to run...
@@ -740,7 +739,7 @@ void QThread::start(Priority priority)
pthread_attr_destroy(&attr);
if (code) {
- qWarning("QThread::start: Thread creation error: %s", qPrintable(qt_error_string(code)));
+ qErrnoWarning(code, "QThread::start: Thread creation error");
d->running = false;
d->finished = false;
@@ -759,8 +758,7 @@ void QThread::terminate()
int code = pthread_cancel(from_HANDLE<pthread_t>(d->data->threadId.load()));
if (code) {
- qWarning("QThread::start: Thread termination error: %s",
- qPrintable(qt_error_string((code))));
+ qErrnoWarning(code, "QThread::start: Thread termination error");
}
#endif
}
diff --git a/src/corelib/thread/qwaitcondition_unix.cpp b/src/corelib/thread/qwaitcondition_unix.cpp
index 0ba90763cf..dd7475cec5 100644
--- a/src/corelib/thread/qwaitcondition_unix.cpp
+++ b/src/corelib/thread/qwaitcondition_unix.cpp
@@ -72,7 +72,7 @@ __attribute__((weakref("__pthread_cond_timedwait_relative")));
static void report_error(int code, const char *where, const char *what)
{
if (code != 0)
- qWarning("%s: %s failure: %s", where, what, qPrintable(qt_error_string(code)));
+ qErrnoWarning(code, "%s: %s failure", where, what);
}
void qt_initialize_pthread_cond(pthread_cond_t *cond, const char *where)