From b0986091868f928b5e09c1a7f51654e102bf5f54 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 12 Aug 2015 22:17:27 +0200 Subject: Fix various compiler warnings. --- intern/cycles/kernel/osl/osl_closures.h | 2 +- intern/elbeem/intern/simulation_object.cpp | 2 +- intern/ghost/intern/GHOST_ContextCGL.h | 9 ------ intern/ghost/intern/GHOST_ContextCGL.mm | 7 ----- intern/ghost/intern/GHOST_SystemCocoa.mm | 2 +- intern/smoke/intern/MERSENNETWISTER.h | 44 +++++++++++++++--------------- 6 files changed, 25 insertions(+), 41 deletions(-) (limited to 'intern') diff --git a/intern/cycles/kernel/osl/osl_closures.h b/intern/cycles/kernel/osl/osl_closures.h index 97bd1b1ac92..c0bf25ac1c7 100644 --- a/intern/cycles/kernel/osl/osl_closures.h +++ b/intern/cycles/kernel/osl/osl_closures.h @@ -72,7 +72,7 @@ void name(RendererServices *, int id, void *data) \ #define CCLOSURE_PREPARE_STATIC(name, classname) static CCLOSURE_PREPARE(name, classname) #define CLOSURE_FLOAT3_PARAM(st, fld) \ - { TypeDesc::TypeVector, reckless_offsetof(st, fld), NULL, sizeof(OSL::Vec3) } + { TypeDesc::TypeVector, (int)reckless_offsetof(st, fld), NULL, sizeof(OSL::Vec3) } #define TO_VEC3(v) OSL::Vec3(v.x, v.y, v.z) #define TO_COLOR3(v) OSL::Color3(v.x, v.y, v.z) diff --git a/intern/elbeem/intern/simulation_object.cpp b/intern/elbeem/intern/simulation_object.cpp index 99c3b170634..f2f928f07dc 100644 --- a/intern/elbeem/intern/simulation_object.cpp +++ b/intern/elbeem/intern/simulation_object.cpp @@ -172,7 +172,7 @@ int SimulationObject::initializeLbmSimulation(ntlRenderGlobals *glob) mpLbm->setParticleTracer( mpParts ); if(mpElbeemSettings) { // set further settings from API struct init - if(mpElbeemSettings->outputPath) this->mOutFilename = string(mpElbeemSettings->outputPath); + this->mOutFilename = string(mpElbeemSettings->outputPath); mpLbm->initDomainTrafo( mpElbeemSettings->surfaceTrafo ); mpLbm->setSmoothing(1.0 * mpElbeemSettings->surfaceSmoothing, 1.0 * mpElbeemSettings->surfaceSmoothing); mpLbm->setIsoSubdivs(mpElbeemSettings->surfaceSubdivs); diff --git a/intern/ghost/intern/GHOST_ContextCGL.h b/intern/ghost/intern/GHOST_ContextCGL.h index 92fdbfc53de..953235669a8 100644 --- a/intern/ghost/intern/GHOST_ContextCGL.h +++ b/intern/ghost/intern/GHOST_ContextCGL.h @@ -128,18 +128,9 @@ public: private: //void initContextCGLEW() - /** The window containing the OpenGL view */ - NSWindow *m_window; - /** The openGL view */ NSOpenGLView *m_openGLView; - const int m_contextProfileMask; - const int m_contextMajorVersion; - const int m_contextMinorVersion; - const int m_contextFlags; - const int m_contextResetNotificationStrategy; - /** The OpenGL drawing context */ NSOpenGLContext *m_openGLContext; diff --git a/intern/ghost/intern/GHOST_ContextCGL.mm b/intern/ghost/intern/GHOST_ContextCGL.mm index 51895e5fa1a..6a9c23ea72b 100644 --- a/intern/ghost/intern/GHOST_ContextCGL.mm +++ b/intern/ghost/intern/GHOST_ContextCGL.mm @@ -58,16 +58,9 @@ GHOST_ContextCGL::GHOST_ContextCGL( int contextFlags, int contextResetNotificationStrategy) : GHOST_Context(stereoVisual, numOfAASamples), - m_window(window), m_openGLView(openGLView), - m_contextProfileMask(contextProfileMask), - m_contextMajorVersion(contextMajorVersion), - m_contextMinorVersion(contextMinorVersion), - m_contextFlags(contextFlags), - m_contextResetNotificationStrategy(contextResetNotificationStrategy), m_openGLContext(nil) { - assert(window != nil); assert(openGLView != nil); } diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index 02ef7546c2f..a3c48ff3b2d 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -284,7 +284,7 @@ extern "C" int GHOST_HACK_getFirstFile(char buf[FIRSTFILEBUFLG]) * CocoaAppDelegate * ObjC object to capture applicationShouldTerminate, and send quit event **/ -@interface CocoaAppDelegate : NSObject { +@interface CocoaAppDelegate : NSObject { GHOST_SystemCocoa *systemCocoa; } - (void)setSystemCocoa:(GHOST_SystemCocoa *)sysCocoa; diff --git a/intern/smoke/intern/MERSENNETWISTER.h b/intern/smoke/intern/MERSENNETWISTER.h index 5a9ccf88ae7..42b3fe19686 100644 --- a/intern/smoke/intern/MERSENNETWISTER.h +++ b/intern/smoke/intern/MERSENNETWISTER.h @@ -187,7 +187,7 @@ inline MTRand::uint32 MTRand::randInt() if( left == 0 ) reload(); --left; - register uint32 s1; + uint32 s1; s1 = *pNext++; s1 ^= (s1 >> 11); s1 ^= (s1 << 7) & 0x9d2c5680UL; @@ -232,9 +232,9 @@ inline void MTRand::seed( uint32 *const bigSeed, const uint32 seedLength ) // in each element are discarded. // Just call seed() if you want to get array from /dev/urandom initialize(19650218UL); - register int i = 1; - register uint32 j = 0; - register int k = ( (uint32)N > seedLength ? (uint32)N : seedLength ); + int i = 1; + uint32 j = 0; + int k = ( (uint32)N > seedLength ? (uint32)N : seedLength ); for( ; k; --k ) { state[i] = @@ -273,9 +273,9 @@ inline void MTRand::seed() if( urandom ) { uint32 bigSeed[N]; - register uint32 *s = bigSeed; - register int i = N; - register bool success = true; + uint32 *s = bigSeed; + int i = N; + bool success = true; while( success && i-- ) success = fread( s++, sizeof(uint32), 1, urandom ); fclose(urandom); @@ -294,9 +294,9 @@ inline void MTRand::initialize( const uint32 seed ) // See Knuth TAOCP Vol 2, 3rd Ed, p.106 for multiplier. // In previous versions, most significant bits (MSBs) of the seed affect // only MSBs of the state array. Modified 9 Jan 2002 by Makoto Matsumoto. - register uint32 *s = state; - register uint32 *r = state; - register int i = 1; + uint32 *s = state; + uint32 *r = state; + int i = 1; *s++ = seed & 0xffffffffUL; for( ; i < N; ++i ) { @@ -310,8 +310,8 @@ inline void MTRand::reload() { // Generate N new values in state // Made clearer and faster by Matthew Bellew (matthew.bellew@home.com) - register uint32 *p = state; - register int i; + uint32 *p = state; + int i; for( i = N - M; i--; ++p ) *p = twist( p[M], p[0], p[1] ); for( i = M; --i; ++p ) @@ -350,9 +350,9 @@ inline MTRand::uint32 MTRand::hash( time_t t, clock_t c ) inline void MTRand::save( uint32* saveArray ) const { - register uint32 *sa = saveArray; - register const uint32 *s = state; - register int i = N; + uint32 *sa = saveArray; + const uint32 *s = state; + int i = N; for( ; i--; *sa++ = *s++ ) {} *sa = left; } @@ -360,9 +360,9 @@ inline void MTRand::save( uint32* saveArray ) const inline void MTRand::load( uint32 *const loadArray ) { - register uint32 *s = state; - register uint32 *la = loadArray; - register int i = N; + uint32 *s = state; + uint32 *la = loadArray; + int i = N; for( ; i--; *s++ = *la++ ) {} left = *la; pNext = &state[N-left]; @@ -371,8 +371,8 @@ inline void MTRand::load( uint32 *const loadArray ) inline std::ostream& operator<<( std::ostream& os, const MTRand& mtrand ) { - register const MTRand::uint32 *s = mtrand.state; - register int i = mtrand.N; + const MTRand::uint32 *s = mtrand.state; + int i = mtrand.N; for( ; i--; os << *s++ << "\t" ) {} return os << mtrand.left; } @@ -380,8 +380,8 @@ inline std::ostream& operator<<( std::ostream& os, const MTRand& mtrand ) inline std::istream& operator>>( std::istream& is, MTRand& mtrand ) { - register MTRand::uint32 *s = mtrand.state; - register int i = mtrand.N; + MTRand::uint32 *s = mtrand.state; + int i = mtrand.N; for( ; i--; is >> *s++ ) {} is >> mtrand.left; mtrand.pNext = &mtrand.state[mtrand.N-mtrand.left]; -- cgit v1.2.3