From 03e3fb9ad58988d932b9f73b5e9c696296c154aa Mon Sep 17 00:00:00 2001 From: codestation Date: Sun, 29 Sep 2013 11:10:47 -0430 Subject: [PATCH] Fix handle casting in debug messages. Change statvfs64 to statvfs and leave the build system configure it, so it doesn't break on OS X. Enable pkg-config on OS X. --- cmaclient.cpp | 4 ++-- cmaevent.cpp | 2 +- main.cpp | 2 +- qcma.pro | 1 + utils.cpp | 4 ++-- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/cmaclient.cpp b/cmaclient.cpp index 35129cb..0dee836 100644 --- a/cmaclient.cpp +++ b/cmaclient.cpp @@ -53,7 +53,7 @@ void CmaClient::connectUsb() { vita_device_t *vita; - qDebug("Starting usb_thread: %u", (unsigned int)QThread::currentThreadId()); + qDebug("Starting usb_thread: %lu", (unsigned long)QThread::currentThreadId()); setActive(true); @@ -84,7 +84,7 @@ void CmaClient::connectWireless() QTime now = QTime::currentTime(); qsrand(now.msec()); - qDebug("Starting wireless_thread: %u", (unsigned int)QThread::currentThreadId()); + qDebug("Starting wireless_thread: %lu", (unsigned long)QThread::currentThreadId()); setActive(true); diff --git a/cmaevent.cpp b/cmaevent.cpp index 9d84ab3..afae735 100644 --- a/cmaevent.cpp +++ b/cmaevent.cpp @@ -40,7 +40,7 @@ CmaEvent::CmaEvent(vita_device_t *s_device) : void CmaEvent::process() { - qDebug("Starting event_thread: %u", (unsigned int)QThread::currentThreadId()); + qDebug("Starting event_thread: %lu", (unsigned long)QThread::currentThreadId()); while(true) { sema.acquire(); if(!isActive()) { diff --git a/main.cpp b/main.cpp index 833303a..87c3d49 100644 --- a/main.cpp +++ b/main.cpp @@ -76,7 +76,7 @@ int main(int argc, char *argv[]) app.installTranslator(&translator); } - qDebug("Starting main thread: %u", (unsigned int)QThread::currentThreadId()); + qDebug("Starting main thread: %lu", (unsigned long)QThread::currentThreadId()); // set the organization/application for QSettings to work properly app.setOrganizationName("qcma"); diff --git a/qcma.pro b/qcma.pro index cf9e5ee..9ea7846 100644 --- a/qcma.pro +++ b/qcma.pro @@ -101,3 +101,4 @@ unix { win32:RC_FILE = qcma.rc win32:QMAKE_CXXFLAGS += -mno-ms-bitfields +macx:QT_CONFIG -= no-pkg-config diff --git a/utils.cpp b/utils.cpp index 6647340..14e8847 100644 --- a/utils.cpp +++ b/utils.cpp @@ -40,9 +40,9 @@ bool getDiskSpace(const QString &dir, quint64 *free, quint64 *total) } #else - struct statvfs64 stat; + struct statvfs stat; - if(statvfs64(dir.toUtf8().data(), &stat) == 0) { + if(statvfs(dir.toUtf8().data(), &stat) == 0) { *total = stat.f_frsize * stat.f_blocks; *free = stat.f_frsize * stat.f_bfree; return true;