# HG changeset patch # User Teemu Piippo # Date 1487058531 -7200 # Node ID 8e0691be0b6f2a2aa52a4a734c5b049c298c7900 # Parent daa9808d626ef2af481c9de113d4045bffcd3c41 Removed the intXX type aliases and removed uses of intXX_t in favor of qintXX diff -r daa9808d626e -r 8e0691be0b6f src/basics.h --- a/src/basics.h Tue Feb 14 08:33:44 2017 +0200 +++ b/src/basics.h Tue Feb 14 09:48:51 2017 +0200 @@ -35,15 +35,6 @@ class QTextStream; class Matrix; class LDDocument; - -using int8 = qint8; -using int16 = qint16; -using int32 = qint32; -using int64 = qint64; -using uint8 = quint8; -using uint16 = quint16; -using uint32 = quint32; -using uint64 = quint64; using LDObjectList = QList; template diff -r daa9808d626e -r 8e0691be0b6f src/glRenderer.cpp --- a/src/glRenderer.cpp Tue Feb 14 08:33:44 2017 +0200 +++ b/src/glRenderer.cpp Tue Feb 14 09:48:51 2017 +0200 @@ -713,22 +713,20 @@ // Read pixels from the color buffer. glReadPixels(x0, height() - y1, areawidth, areaheight, GL_RGBA, GL_UNSIGNED_BYTE, pixelData.data()); - QSet indices; + QSet indices; // Go through each pixel read and add them to the selection. // Each pixel maps to an LDObject index injectively. // Note: black is background, those indices are skipped. for (unsigned char *pixelCursor = pixelData.begin(); pixelCursor < pixelData.end(); pixelCursor += 4) { - int32_t index = pixelCursor[0] * 0x10000 + - pixelCursor[1] * 0x100 + - pixelCursor[2] * 0x1; + qint32 index = pixelCursor[0] * 0x10000 + pixelCursor[1] * 0x100 + pixelCursor[2] * 0x1; if (index != 0) indices.insert(index); } // For each index read, resolve the LDObject behind it and add it to the selection. - for (int32_t index : indices) + for (qint32 index : indices) { LDObject* object = LDObject::fromID(index); diff -r daa9808d626e -r 8e0691be0b6f src/ldDocument.cpp --- a/src/ldDocument.cpp Tue Feb 14 08:33:44 2017 +0200 +++ b/src/ldDocument.cpp Tue Feb 14 09:48:51 2017 +0200 @@ -205,7 +205,7 @@ // ============================================================================= // -bool LDDocument::save (QString path, int64* sizeptr) +bool LDDocument::save (QString path, qint64* sizeptr) { if (isFrozen()) return false; diff -r daa9808d626e -r 8e0691be0b6f src/ldDocument.h --- a/src/ldDocument.h Tue Feb 14 08:33:44 2017 +0200 +++ b/src/ldDocument.h Tue Feb 14 09:48:51 2017 +0200 @@ -72,7 +72,7 @@ void redoVertices(); void reloadAllSubfiles(); void removeFromSelection (LDObject* obj); - bool save (QString path = "", int64* sizeptr = nullptr); + bool save (QString path = "", qint64* sizeptr = nullptr); long savePosition() const; void setDefaultName (QString value); void setFrozen(bool value); diff -r daa9808d626e -r 8e0691be0b6f src/ldObject.cpp --- a/src/ldObject.cpp Tue Feb 14 08:33:44 2017 +0200 +++ b/src/ldObject.cpp Tue Feb 14 09:48:51 2017 +0200 @@ -28,7 +28,7 @@ #include "glCompiler.h" // List of all LDObjects -QMap g_allObjects; +QMap g_allObjects; enum { MAX_LDOBJECT_IDS = (1 << 24) }; @@ -48,7 +48,7 @@ assert(_model != nullptr); // Let's hope that nobody goes to create 17 million objects anytime soon... - static int32 nextId = 1; // 0 shalt be null + static qint32 nextId = 1; // 0 shalt be null if (nextId < MAX_LDOBJECT_IDS) m_id = nextId++; else @@ -626,7 +626,7 @@ // ============================================================================= // -LDObject* LDObject::fromID(int32 id) +LDObject* LDObject::fromID(qint32 id) { return g_allObjects.value(id); } diff -r daa9808d626e -r 8e0691be0b6f src/ldObject.h --- a/src/ldObject.h Tue Feb 14 08:33:44 2017 +0200 +++ b/src/ldObject.h Tue Feb 14 09:48:51 2017 +0200 @@ -124,7 +124,7 @@ virtual QString typeName() const = 0; const Vertex& vertex (int i) const; - static LDObject* fromID(int32 id); + static LDObject* fromID(qint32 id); signals: void codeChanged(QString before, QString after); diff -r daa9808d626e -r 8e0691be0b6f src/mainwindow.cpp --- a/src/mainwindow.cpp Tue Feb 14 08:33:44 2017 +0200 +++ b/src/mainwindow.cpp Tue Feb 14 09:48:51 2017 +0200 @@ -720,7 +720,7 @@ return false; QString path = doc->fullPath(); - int64 savesize; + qint64 savesize; if (saveAs or path.isEmpty()) { diff -r daa9808d626e -r 8e0691be0b6f src/model.cpp --- a/src/model.cpp Tue Feb 14 08:33:44 2017 +0200 +++ b/src/model.cpp Tue Feb 14 09:48:51 2017 +0200 @@ -323,7 +323,7 @@ return v; } -static int32 StringToNumber (QString a, bool* ok = nullptr) +static qint32 StringToNumber (QString a, bool* ok = nullptr) { int base = 10; diff -r daa9808d626e -r 8e0691be0b6f src/partdownloadrequest.cpp --- a/src/partdownloadrequest.cpp Tue Feb 14 08:33:44 2017 +0200 +++ b/src/partdownloadrequest.cpp Tue Feb 14 09:48:51 2017 +0200 @@ -240,7 +240,7 @@ prompt()->checkIfFinished(); } -void PartDownloadRequest::updateDownloadProgress (int64 recv, int64 total) +void PartDownloadRequest::updateDownloadProgress (qint64 recv, qint64 total) { m_numBytesRead = recv; m_numBytesTotal = total;