From e8d6be6259b5d9cc1e9fa04a2e29c88c431fa938 Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Tue, 19 Oct 2010 21:15:57 +0200 Subject: [PATCH] further win64 compilation fixes --- include/mitsuba/core/logger.h | 4 ++-- include/mitsuba/core/shvector.h | 2 +- src/libcore/shvector.cpp | 3 ++- src/libcore/zstream.cpp | 8 ++++---- src/qtgui/mainwindow.cpp | 4 ++-- src/qtgui/programsettingsdlg.cpp | 4 ++-- src/qtgui/programsettingsdlg.h | 2 +- 7 files changed, 14 insertions(+), 13 deletions(-) diff --git a/include/mitsuba/core/logger.h b/include/mitsuba/core/logger.h index b3a168ab..f28779d7 100644 --- a/include/mitsuba/core/logger.h +++ b/include/mitsuba/core/logger.h @@ -121,10 +121,10 @@ public: inline size_t getAppenderCount() const { return m_appenders.size(); } /// Return one of the appenders - inline Appender *getAppender(int index) { return m_appenders[index]; } + inline Appender *getAppender(size_t index) { return m_appenders[index]; } /// Return one of the appenders - inline const Appender *getAppender(int index) const { return m_appenders[index]; } + inline const Appender *getAppender(size_t index) const { return m_appenders[index]; } /// Set the logger's formatter implementation void setFormatter(Formatter *formatter); diff --git a/include/mitsuba/core/shvector.h b/include/mitsuba/core/shvector.h index 347048a3..9a13efbd 100644 --- a/include/mitsuba/core/shvector.h +++ b/include/mitsuba/core/shvector.h @@ -204,7 +204,7 @@ public: /// Dot product inline friend Float dot(const SHVector &v1, const SHVector &v2) { - const int size = std::min(v1.m_coeffs.size(), v2.m_coeffs.size()); + const size_t size = std::min(v1.m_coeffs.size(), v2.m_coeffs.size()); return std::inner_product( v1.m_coeffs.begin(), v1.m_coeffs.begin() + size, v2.m_coeffs.begin(), Float() diff --git a/src/libcore/shvector.cpp b/src/libcore/shvector.cpp index 7953b75f..0904c690 100644 --- a/src/libcore/shvector.cpp +++ b/src/libcore/shvector.cpp @@ -249,7 +249,8 @@ struct RotationBlockHelper { const ublas::matrix &M1, const ublas::matrix &Mp, ublas::matrix &Mn) - : M1(M1), Mp(Mp), Mn(Mn), prevLevel(Mp.size1()/2), level(prevLevel+1) { } + : M1(M1), Mp(Mp), Mn(Mn), prevLevel((int) Mp.size1()/2), + level((int) Mp.size1()/2+1) { } inline Float delta(int i, int j) const { return (i == j) ? (Float) 1 : (Float) 0; diff --git a/src/libcore/zstream.cpp b/src/libcore/zstream.cpp index f97cd59b..9fa71679 100644 --- a/src/libcore/zstream.cpp +++ b/src/libcore/zstream.cpp @@ -72,7 +72,7 @@ void ZStream::flush() { } void ZStream::write(const void *ptr, size_t size) { - m_deflateStream.avail_in = size; + m_deflateStream.avail_in = (uInt) size; m_deflateStream.next_in = (uint8_t *) ptr; int outputSize = 0; @@ -100,13 +100,13 @@ void ZStream::read(void *ptr, size_t size) { if (m_inflateStream.avail_in == 0) { size_t remaining = m_childStream->getSize() - m_childStream->getPos(); m_inflateStream.next_in = m_inflateBuffer; - m_inflateStream.avail_in = std::min(remaining, sizeof(m_inflateBuffer)); + m_inflateStream.avail_in = (uInt) std::min(remaining, sizeof(m_inflateBuffer)); if (m_inflateStream.avail_in == 0) Log(EError, "Read less data than expected (%i more bytes required)", size); m_childStream->read(m_inflateBuffer, m_inflateStream.avail_in); } - m_inflateStream.avail_out = size; + m_inflateStream.avail_out = (uInt) size; m_inflateStream.next_out = targetPtr; int retval = inflate(&m_inflateStream, Z_NO_FLUSH); @@ -121,7 +121,7 @@ void ZStream::read(void *ptr, size_t size) { Log(EError, "inflate(): memory error!"); }; - int outputSize = size - m_inflateStream.avail_out; + size_t outputSize = size - (size_t) m_inflateStream.avail_out; targetPtr += outputSize; size -= outputSize; diff --git a/src/qtgui/mainwindow.cpp b/src/qtgui/mainwindow.cpp index 221e98e4..bd32e6fc 100644 --- a/src/qtgui/mainwindow.cpp +++ b/src/qtgui/mainwindow.cpp @@ -1040,8 +1040,8 @@ void MainWindow::on_actionSettings_triggered() { return; } - int workerCount = sched->getWorkerCount(); - for (int i=0; igetWorkerCount(); + for (size_t i=0; igetWorker(i); if (worker->getClass()->derivesFrom(LocalWorker::m_theClass)) localWorkers.push_back(worker); diff --git a/src/qtgui/programsettingsdlg.cpp b/src/qtgui/programsettingsdlg.cpp index 489cf261..0fb0eb3c 100644 --- a/src/qtgui/programsettingsdlg.cpp +++ b/src/qtgui/programsettingsdlg.cpp @@ -77,10 +77,10 @@ void ProgramSettingsDialog::on_connectionList_currentItemChanged(QListWidgetItem } void ProgramSettingsDialog::refresh() { - int coreCount = 0; + size_t coreCount = 0; for (int i=0; igetCoreCount(); - int totalCount = coreCount + getLocalWorkerCount(); + size_t totalCount = coreCount + getLocalWorkerCount(); ui->statsLabel1->setText(tr("Cores attached via network: %1").arg(coreCount)); ui->statsLabel2->setText(tr("Total number of attached cores: %1").arg(totalCount)); int listenPort = ui->listenPort->text().toInt(); diff --git a/src/qtgui/programsettingsdlg.h b/src/qtgui/programsettingsdlg.h index e7753c2f..06fc1211 100644 --- a/src/qtgui/programsettingsdlg.h +++ b/src/qtgui/programsettingsdlg.h @@ -70,7 +70,7 @@ public: ui->searchPathList->addItems(paths); } - inline void setLocalWorkerCount(int count) { + inline void setLocalWorkerCount(size_t count) { ui->localWorkerBox->setValue(count); }