[Bf-blender-cvs] [b098609] master: Fix various compiler warnings.
Brecht Van Lommel
noreply at git.blender.org
Sat Oct 10 17:37:03 CEST 2015
Commit: b0986091868f928b5e09c1a7f51654e102bf5f54
Author: Brecht Van Lommel
Date: Wed Aug 12 22:17:27 2015 +0200
Branches: master
https://developer.blender.org/rBb0986091868f928b5e09c1a7f51654e102bf5f54
Fix various compiler warnings.
===================================================================
M extern/clew/include/clew.h
M intern/cycles/kernel/osl/osl_closures.h
M intern/elbeem/intern/simulation_object.cpp
M intern/ghost/intern/GHOST_ContextCGL.h
M intern/ghost/intern/GHOST_ContextCGL.mm
M intern/ghost/intern/GHOST_SystemCocoa.mm
M intern/smoke/intern/MERSENNETWISTER.h
M source/blender/blenlib/BLI_alloca.h
M source/blender/blenlib/BLI_math_inline.h
M source/blender/blenlib/BLI_utildefines.h
M source/blender/blenlib/intern/BLI_filelist.c
M source/blender/bmesh/intern/bmesh_opdefines.c
M source/blender/compositor/operations/COM_GaussianBokehBlurOperation.cpp
M source/blender/compositor/operations/COM_RenderLayersProg.cpp
M source/blender/depsgraph/intern/depsgraph_debug.cc
M source/blender/editors/physics/particle_object.c
M source/blender/editors/space_file/fsmenu.c
M source/blender/freestyle/intern/geometry/Noise.cpp
M source/blender/freestyle/intern/stroke/Stroke.cpp
M source/blender/gpu/GPU_material.h
M source/blender/gpu/intern/gpu_debug.c
M source/blender/imbuf/intern/dds/ColorBlock.cpp
M source/blender/imbuf/intern/dds/Common.h
M source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
M source/blender/imbuf/intern/dds/FlipDXT.cpp
M source/blender/makesrna/intern/makesrna.c
M source/blender/python/intern/bpy_rna_callback.c
M source/blender/quicktime/quicktime_export.h
M source/gameengine/VideoTexture/VideoFFmpeg.cpp
===================================================================
diff --git a/extern/clew/include/clew.h b/extern/clew/include/clew.h
index 1b72f81..60a7c8f 100644
--- a/extern/clew/include/clew.h
+++ b/extern/clew/include/clew.h
@@ -2781,7 +2781,7 @@ CLEW_FUN_EXPORT PFNCLGETGLCONTEXTINFOKHR __clewGetGLContextInfoKH
#define CLEW_ERROR_ATEXIT_FAILED -2 //!< Error code for failing to queue the closing of the dynamic library to atexit()
//! \brief Load OpenCL dynamic library and set function entry points
-int clewInit ();
+int clewInit (void);
//! \brief Convert an OpenCL error code to its string equivalent
const char* clewErrorString (cl_int error);
diff --git a/intern/cycles/kernel/osl/osl_closures.h b/intern/cycles/kernel/osl/osl_closures.h
index 97bd1b1..c0bf25a 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 99c3b170..f2f928f 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 92fdbfc..9532356 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 51895e5..6a9c23e 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 02ef754..a3c48ff 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
**/
- at interface CocoaAppDelegate : NSObject {
+ at interface CocoaAppDelegate : NSObject <NSFileManagerDelegate> {
GHOST_SystemCocoa *systemCocoa;
}
- (void)setSystemCocoa:(GHOST_SystemCocoa *)sysCocoa;
diff --git a/intern/smoke/intern/MERSENNETWISTER.h b/intern/smoke/intern/MERSENNETWISTER.h
index 5a9ccf8..42b3fe1 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 at 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];
diff --git a/source/blender/blenlib/BLI_alloca.h b/source/blender/blenlib/BLI_alloca.h
index fd81494..b44e6c6 100644
--- a/source/blender/blenlib/BLI_alloca.h
+++ b/source/blender/blenlib/BLI_alloca.h
@@ -34,8 +34,13 @@
#endif
#if defined(__GNUC__) || defined(__clang__)
+#if defined(__cplusplus) && (__cplusplus > 199711L)
+#define BLI_array_alloca(arr, realsize) \
+ (decltype(arr))alloca(sizeof(*arr) * (realsize))
+#else
#define BLI_array_alloca(arr, realsize) \
(typeof(arr))alloca(sizeof(*arr) * (realsize))
+#endif
#else
#define BLI_array_alloca(arr, realsize) \
alloca(sizeof(*arr) * (realsize))
diff --git a/source/blender/blenlib/BLI_math_inline.h b/source/blender/blenlib/BLI_math_inline.h
index 2bf3b95..840cf24 100644
--- a/source/blender/blenlib/BLI_math_inline.h
+++ b/source/blender/blenlib/BLI_math_inline.h
@@ -46,9 +46,9 @@ extern "C" {
# define MINLINE static inline
# if (defined(__APPLE__) && defined(__ppc__))
/* static inline __attribute__ here breaks osx ppc gcc42 build */
-# define MALWAYS_INLINE static __attribute__((always_inline))
+# define MALWAYS_INLINE static __attribute__((always_inline)) __attribute__((unused))
# else
-# define MALWAYS_INLINE static inline __attribute__((always_inline))
+# define MALWAYS_INLINE static inline __attribute__((always_inline)) __attribute__((unused))
# endif
# endif
#else
diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h
index 65e8dcd..df6f578 100644
--- a/source/blender/blenlib/BLI_utildefines.h
+++ b/source/blender/blenlib/BLI_utildefines.h
@@ -623,9 +623,9 @@ extern "C" {
#else
# if (defined(__APPLE__) && defined(__ppc__))
/* static inline __attribute__ here breaks osx ppc gcc42 build */
-# define BLI_INLINE static __attribute__((always_inline))
+# define BLI_INLINE static __attribute__((always_inline)) __attribute__((__unused__))
# else
-# define BLI_INLINE static inline __attribute__((always_inline))
+# define BLI_INLINE static inline __attribute__((always_inline)) __attribute__((__unused__))
# endif
#endif
diff --git a/source/blender/blenlib/intern/BLI_filelist.c b/source/blender/blenlib/intern/BLI_filelist.c
index 62690ff..527d993 100644
--- a/source/blender/blenlib/intern/BLI_filelist.c
+++ b/source/blender/blenlib/intern/BLI_filelist.c
@@ -333,7 +333,8 @@ void BLI_filelist_entry_datetime_to_string(
const struct stat *st, const int64_t ts, const bool compact,
char r
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list