diff --git a/SConstruct b/SConstruct index a509cefc..af48e599 100644 --- a/SConstruct +++ b/SConstruct @@ -285,8 +285,8 @@ if sys.platform == 'darwin': coreEnv_osx['CXXFLAGS'].append('-fno-strict-aliasing'); libcore_objects += coreEnv_osx.SharedObject('src/libcore/platform_darwin.mm') elif sys.platform == 'win32': - libcore_objects += coreEnv_osx.SharedObject('src/libcore/getopt.c') - libcore_objects += coreEnv_osx.SharedObject('src/libcore/platform_win32.cpp') + libcore_objects += coreEnv.SharedObject('src/libcore/getopt.c') + libcore_objects += coreEnv.SharedObject('src/libcore/platform_win32.cpp') libcore = coreEnv.SharedLibrary('src/libcore/mitsuba-core', libcore_objects); diff --git a/include/mitsuba/core/atomic.h b/include/mitsuba/core/atomic.h index 8d646b8c..4af4d365 100644 --- a/include/mitsuba/core/atomic.h +++ b/include/mitsuba/core/atomic.h @@ -29,7 +29,8 @@ MTS_NAMESPACE_BEGIN template inline bool atomicCompareAndExchangePtr(T **v, T *newValue, T *oldValue) { #if defined(WIN32) - return InterlockedCompareExchange(v, newValue, oldValue) == oldValue; + return InterlockedCompareExchangePointer( + reinterpret_cast(v), newValue, oldValue) == oldValue; #else return __sync_bool_compare_and_swap(v, oldValue, newValue); #endif diff --git a/include/mitsuba/core/stl.h b/include/mitsuba/core/stl.h index 39e2a574..c0335feb 100644 --- a/include/mitsuba/core/stl.h +++ b/include/mitsuba/core/stl.h @@ -168,8 +168,10 @@ inline bool ubi_isnan(double f) { int classification = ::_fpclass(f); return classification == _FPCLASS_QNAN || classification == _FPCLASS_SNAN; } +extern "C" { + extern MTS_EXPORT_CORE float nextafterf(float x, float y); +}; -extern float nextafterf(float x, float y); #else inline bool ubi_isnan(float f) { return std::fpclassify(f) == FP_NAN; diff --git a/include/mitsuba/render/gkdtree.h b/include/mitsuba/render/gkdtree.h index 01fe8e94..35a0d90f 100644 --- a/include/mitsuba/render/gkdtree.h +++ b/include/mitsuba/render/gkdtree.h @@ -119,7 +119,7 @@ public: * Walks through the list of chunks to find one with enough * free memory. If no chunk could be found, a new one is created. */ - template T * __restrict__ allocate(size_t size) { + template T * __restrict allocate(size_t size) { size *= sizeof(T); for (std::vector::iterator it = m_chunks.begin(); it != m_chunks.end(); ++it) { @@ -295,7 +295,7 @@ public: * create unused elements in the previous block if a new * one has to be allocated. */ - inline T * __restrict__ allocate(size_t size) { + inline T * __restrict allocate(size_t size) { #if defined(MTS_KD_DEBUG) SAssert(size <= BlockSize); #endif @@ -2174,10 +2174,10 @@ protected: } } - KDAssert(leftEventsTempEnd - leftEventsTempStart <= primsLeft * 6); - KDAssert(rightEventsTempEnd - rightEventsTempStart <= primsRight * 6); - KDAssert(newEventsLeftEnd - newEventsLeftStart <= primsBoth * 6); - KDAssert(newEventsRightEnd - newEventsRightStart <= primsBoth * 6); + KDAssert((size_type) (leftEventsTempEnd - leftEventsTempStart) <= primsLeft * 6); + KDAssert((size_type) (rightEventsTempEnd - rightEventsTempStart) <= primsRight * 6); + KDAssert((size_type) (newEventsLeftEnd - newEventsLeftStart) <= primsBoth * 6); + KDAssert((size_type) (newEventsRightEnd - newEventsRightStart) <= primsBoth * 6); ctx.pruned += prunedLeft + prunedRight; /* Sort the events from overlapping prims */ @@ -2216,8 +2216,8 @@ protected: *rightEventsEnd++ = *event; } } - KDAssert(leftEventsEnd - leftEventsStart <= bestSplit.numLeft * 6); - KDAssert(rightEventsEnd - rightEventsStart <= bestSplit.numRight * 6); + KDAssert((size_type) (leftEventsEnd - leftEventsStart) <= bestSplit.numLeft * 6); + KDAssert((size_type) (rightEventsEnd - rightEventsStart) <= bestSplit.numRight * 6); } /* Shrink the edge event storage now that we know exactly how @@ -2317,7 +2317,7 @@ protected: */ void setAABB(const AABB &aabb) { m_aabb = aabb; - m_binSize = m_aabb.getExtents() / m_binCount; + m_binSize = m_aabb.getExtents() / (Float) m_binCount; for (int axis=0; axis<3; ++axis) m_invBinSize[axis] = 1/m_binSize[axis]; } diff --git a/include/mitsuba/render/irrcache.h b/include/mitsuba/render/irrcache.h index e27bf917..c9b2feee 100644 --- a/include/mitsuba/render/irrcache.h +++ b/include/mitsuba/render/irrcache.h @@ -39,7 +39,7 @@ typedef Spectrum TranslationalGradient[3]; * * @author Wenzel Jakob */ -struct MTS_EXPORT_RENDER HemisphereSampler : public Object { +class MTS_EXPORT_RENDER HemisphereSampler : public Object { public: struct SampleEntry { Vector d; diff --git a/src/libcore/getopt.c b/src/libcore/getopt.c index 79ccd96c..cc64bdad 100644 --- a/src/libcore/getopt.c +++ b/src/libcore/getopt.c @@ -100,7 +100,7 @@ GNU application programs can use a third alternative mode in which they can distinguish the relative order of options and other arguments. */ -#include "getopt.h" +#include /* For communication from `getopt' to the caller. When `getopt' finds an option that takes an argument, diff --git a/src/librender/integrator.cpp b/src/librender/integrator.cpp index 97ee849a..51776a42 100644 --- a/src/librender/integrator.cpp +++ b/src/librender/integrator.cpp @@ -163,7 +163,7 @@ void SampleIntegrator::renderBlock(const Scene *scene, RadianceQueryRecord rRec(scene, sampler); bool needsLensSample = camera->needsLensSample(); const TabulatedFilter *filter = camera->getFilm()->getTabulatedFilter(); - Float scaleFactor = 1.0f/std::sqrt(sampler->getSampleCount()); + Float scaleFactor = 1.0f/std::sqrt((Float) sampler->getSampleCount()); if (!block->collectStatistics()) { for (y = sy; y < ey; y++) {