Fix compiler warnings.

As seen with Xcode 5.0.2.

qmacclipboard.mm:108:30: warning: cast to 'void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast]
        promiseKeeper(paste, (PasteboardItemID)promise.itemId, flavor, this);
                             ^
qmacclipboard.mm:316:56: warning: cast to 'void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast]
                        PasteboardPutItemFlavor(paste, (PasteboardItemID)itemID, QCFString(flavor), 0, kPasteboardFlavorNoFlags);
                                                       ^

Change-Id: I94b8ea2ff32d606d4cab28981b26c2ef516035dc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
bb10
Erik Verbruggen 2013-11-22 13:02:23 +01:00 committed by The Qt Project
parent 3061dc4abd
commit b84072a431
1 changed files with 4 additions and 3 deletions

View File

@ -105,7 +105,8 @@ QMacPasteboard::~QMacPasteboard()
for (int i = 0; i < promises.count(); ++i) {
const Promise &promise = promises.at(i);
QCFString flavor = QCFString(promise.convertor->flavorFor(promise.mime));
promiseKeeper(paste, (PasteboardItemID)promise.itemId, flavor, this);
NSInteger pbItemId = promise.itemId;
promiseKeeper(paste, reinterpret_cast<PasteboardItemID>(pbItemId), flavor, this);
}
if (paste)
@ -311,9 +312,9 @@ QMacPasteboard::setMimeData(QMimeData *mime_src)
int numItems = c->count(mime_src);
for (int item = 0; item < numItems; ++item) {
const int itemID = item+1; //id starts at 1
const NSInteger itemID = item+1; //id starts at 1
promises.append(QMacPasteboard::Promise(itemID, c, mimeType, mimeData, item));
PasteboardPutItemFlavor(paste, (PasteboardItemID)itemID, QCFString(flavor), 0, kPasteboardFlavorNoFlags);
PasteboardPutItemFlavor(paste, reinterpret_cast<PasteboardItemID>(itemID), QCFString(flavor), 0, kPasteboardFlavorNoFlags);
#ifdef DEBUG_PASTEBOARD
qDebug(" - adding %d %s [%s] <%s> [%d]",
itemID, qPrintable(mimeType), qPrintable(flavor), qPrintable(c->convertorName()), item);