Page MenuHome

warning-fixes-11-16-2012.patch

warning-fixes-11-16-2012.patch

Index: intern/memutil/MEM_CacheLimiter.h
===================================================================
--- intern/memutil/MEM_CacheLimiter.h (revision 52266)
+++ intern/memutil/MEM_CacheLimiter.h (working copy)
@@ -247,8 +247,9 @@
if (!elem->can_destroy())
continue;
- /* by default 0 means higherst priority element */
- int priority = -(queue.size() - i - 1);
+ /* by default 0 means highest priority element */
+ /* XXX: casting a size type to int is questionable -- jwilkins */
+ int priority = -((int)(queue.size()) - i - 1);
priority = getItemPriority(elem->get()->get_data(), priority);
if (priority < best_match_priority || best_match_elem == NULL) {
Index: intern/opennl/CMakeLists.txt
===================================================================
--- intern/opennl/CMakeLists.txt (revision 52266)
+++ intern/opennl/CMakeLists.txt (working copy)
@@ -28,7 +28,7 @@
# remove debug flag here since this is not a blender maintained library
# and debug gives a lot of prints on UV unwrapping. developers can enable if they need to.
-add_definitions(-UDEBUG)
+remove_definitions(-DDEBUG)
# quiet compiler warnings about undefined defines
Index: source/blender/blenkernel/intern/collision.c
===================================================================
--- source/blender/blenkernel/intern/collision.c (revision 52266)
+++ source/blender/blenkernel/intern/collision.c (working copy)
@@ -198,6 +198,7 @@
w3[0] = 1.0f - w1[0] - w2[0];
}
+#pragma warning (disable : 4068 ) /* MSVC - disable unknown pragma warnings */
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdouble-promotion"
Index: source/blender/blenkernel/intern/dynamicpaint.c
===================================================================
--- source/blender/blenkernel/intern/dynamicpaint.c (revision 52266)
+++ source/blender/blenkernel/intern/dynamicpaint.c (working copy)
@@ -90,6 +90,7 @@
#endif
/* could enable at some point but for now there are far too many conversions */
+#pragma warning (disable : 4068 ) /* MSVC - disable unknown pragma warnings */
#pragma GCC diagnostic ignored "-Wdouble-promotion"
/* precalculated gaussian factors for 5x super sampling */
Index: source/blender/blenlib/BLI_fileops.h
===================================================================
--- source/blender/blenlib/BLI_fileops.h (revision 52266)
+++ source/blender/blenlib/BLI_fileops.h (working copy)
@@ -55,6 +55,14 @@
int BLI_delete(const char *path, int dir, int recursive);
int BLI_move(const char *path, const char *to);
int BLI_create_symlink(const char *path, const char *to);
+
+#ifdef WIN32
+#undef stat
+#define stat _stat
+#undef fstat
+#define fstat _fstat
+#endif
+
int BLI_stat(const char *path, struct stat *buffer);
/* Directories */
Index: source/blender/blenlib/BLI_math_base.h
===================================================================
--- source/blender/blenlib/BLI_math_base.h (revision 52266)
+++ source/blender/blenlib/BLI_math_base.h (working copy)
@@ -170,7 +170,7 @@
} (void)0
#endif
-#ifdef __BLI_MATH_INLINE_H__
+#if BLI_MATH_DO_INLINE
#include "intern/math_base_inline.c"
#endif
@@ -203,7 +203,7 @@
MINLINE int power_of_2_max_i(int n);
MINLINE int power_of_2_min_i(int n);
-MINLINE float shell_angle_to_dist(float angle);
+MINLINE float shell_angle_to_dist(const float angle);
#if (defined(WIN32) || defined(WIN64)) && !defined(FREE_WINDOWS)
extern double copysign(double x, double y);
Index: source/blender/blenlib/BLI_math_color.h
===================================================================
--- source/blender/blenlib/BLI_math_color.h (revision 52266)
+++ source/blender/blenlib/BLI_math_color.h (working copy)
@@ -121,7 +121,7 @@
void lift_gamma_gain_to_asc_cdl(float *lift, float *gamma, float *gain, float *offset, float *slope, float *power);
-#ifdef __BLI_MATH_INLINE_H__
+#if BLI_MATH_DO_INLINE
#include "intern/math_color_inline.c"
#endif
Index: source/blender/blenlib/BLI_math_geom.h
===================================================================
--- source/blender/blenlib/BLI_math_geom.h (revision 52266)
+++ source/blender/blenlib/BLI_math_geom.h (working copy)
@@ -36,7 +36,7 @@
#include "BLI_math_inline.h"
-#ifdef __BLI_MATH_INLINE_H__
+#if BLI_MATH_DO_INLINE
#include "intern/math_geom_inline.c"
#endif
Index: source/blender/blenlib/BLI_math_inline.h
===================================================================
--- source/blender/blenlib/BLI_math_inline.h (revision 52266)
+++ source/blender/blenlib/BLI_math_inline.h (working copy)
@@ -34,10 +34,13 @@
extern "C" {
#endif
-/* add platform/compiler checks here if it is not supported */
-#define __BLI_MATH_INLINE_H__
+/* allows file to explicitly disable inlining */
+#ifndef BLI_MATH_DO_INLINE
+ /* add platform/compiler checks here if it is not supported */
+# define BLI_MATH_DO_INLINE 1
+#endif
-#ifdef __BLI_MATH_INLINE_H__
+#if BLI_MATH_DO_INLINE
# ifdef _MSC_VER
# define MINLINE static __forceinline
# define MALWAYS_INLINE MINLINE
Index: source/blender/blenlib/BLI_math_vector.h
===================================================================
--- source/blender/blenlib/BLI_math_vector.h (revision 52266)
+++ source/blender/blenlib/BLI_math_vector.h (working copy)
@@ -36,7 +36,7 @@
#include "BLI_math_inline.h"
-#ifdef __BLI_MATH_INLINE_H__
+#if BLI_MATH_DO_INLINE
#include "intern/math_vector_inline.c"
#endif
Index: source/blender/blenlib/intern/math_base_inline.c
===================================================================
--- source/blender/blenlib/intern/math_base_inline.c (revision 52266)
+++ source/blender/blenlib/intern/math_base_inline.c (working copy)
@@ -33,6 +33,10 @@
#include <stdlib.h>
#include <string.h>
+#ifndef BLI_MATH_DO_INLINE
+#define BLI_MATH_DO_INLINE 0
+#endif
+
#include "BLI_math.h"
#ifndef __MATH_BASE_INLINE_C__
Index: source/blender/blenlib/intern/math_geom_inline.c
===================================================================
--- source/blender/blenlib/intern/math_geom_inline.c (revision 52266)
+++ source/blender/blenlib/intern/math_geom_inline.c (working copy)
@@ -28,11 +28,17 @@
*/
+#ifndef BLI_MATH_DO_INLINE
+#define BLI_MATH_DO_INLINE 0
+#endif
+
#include "BLI_math.h"
#ifndef __MATH_GEOM_INLINE_C__
#define __MATH_GEOM_INLINE_C__
+#include <string.h>
+
/****************************** Spherical Harmonics **************************/
MINLINE void zero_sh(float r[9])
Index: source/blender/blenlib/intern/math_vector_inline.c
===================================================================
--- source/blender/blenlib/intern/math_vector_inline.c (revision 52266)
+++ source/blender/blenlib/intern/math_vector_inline.c (working copy)
@@ -27,6 +27,9 @@
* \ingroup bli
*/
+#ifndef BLI_MATH_DO_INLINE
+#define BLI_MATH_DO_INLINE 0
+#endif
#include "BLI_math.h"
Index: source/blender/blenlib/intern/string.c
===================================================================
--- source/blender/blenlib/intern/string.c (revision 52266)
+++ source/blender/blenlib/intern/string.c (working copy)
@@ -56,7 +56,7 @@
return BLI_strdupn(str, strlen(str));
}
-char *BLI_strdupcat(const char *str1, const char *str2)
+char *BLI_strdupcat(const char *__restrict str1, const char *__restrict str2)
{
size_t len;
char *n;
@@ -69,7 +69,7 @@
return n;
}
-char *BLI_strncpy(char *dst, const char *src, const size_t maxncpy)
+char *BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy)
{
size_t srclen = strlen(src);
size_t cpylen = (srclen > (maxncpy - 1)) ? (maxncpy - 1) : srclen;
@@ -81,7 +81,7 @@
return dst;
}
-size_t BLI_vsnprintf(char *buffer, size_t count, const char *format, va_list arg)
+size_t BLI_vsnprintf(char *__restrict buffer, size_t count, const char *__restrict format, va_list arg)
{
size_t n;
@@ -97,7 +97,7 @@
return n;
}
-size_t BLI_snprintf(char *buffer, size_t count, const char *format, ...)
+size_t BLI_snprintf(char *__restrict buffer, size_t count, const char *__restrict format, ...)
{
size_t n;
va_list arg;
@@ -109,7 +109,7 @@
return n;
}
-char *BLI_sprintfN(const char *format, ...)
+char *BLI_sprintfN(const char *__restrict format, ...)
{
DynStr *ds;
va_list arg;
@@ -133,7 +133,7 @@
* TODO: support more fancy string escaping. current code is primitive
* this basically is an ascii version of PyUnicode_EncodeUnicodeEscape()
* which is a useful reference. */
-size_t BLI_strescape(char *dst, const char *src, const size_t maxncpy)
+size_t BLI_strescape(char *__restrict dst, const char *__restrict src, const size_t maxncpy)
{
size_t len = 0;
@@ -186,7 +186,7 @@
*
* TODO, return the offset and a length so as to avoid doing an allocation.
*/
-char *BLI_str_quoted_substrN(const char *str, const char *prefix)
+char *BLI_str_quoted_substrN(const char *__restrict str, const char *__restrict prefix)
{
size_t prefixLen = strlen(prefix);
char *startMatch, *endMatch;
@@ -207,7 +207,7 @@
/* A rather wasteful string-replacement utility, though this shall do for now...
* Feel free to replace this with an even safe + nicer alternative */
-char *BLI_replacestr(char *str, const char *oldText, const char *newText)
+char *BLI_replacestr(char *__restrict str, const char *__restrict oldText, const char *__restrict newText)
{
DynStr *ds = NULL;
size_t lenOld = strlen(oldText);
Index: source/blender/blenlib/intern/string_utf8.c
===================================================================
--- source/blender/blenlib/intern/string_utf8.c (revision 52266)
+++ source/blender/blenlib/intern/string_utf8.c (working copy)
@@ -184,7 +184,7 @@
*dst = '\0'; \
} (void)0
-char *BLI_strncpy_utf8(char *dst, const char *src, size_t maxncpy)
+char *BLI_strncpy_utf8(char *__restrict dst, const char *__restrict src, size_t maxncpy)
{
char *dst_r = dst;
@@ -196,7 +196,7 @@
return dst_r;
}
-char *BLI_strncat_utf8(char *dst, const char *src, size_t maxncpy)
+char *BLI_strncat_utf8(char *__restrict dst, const char *__restrict src, size_t maxncpy)
{
while (*dst && maxncpy > 0) {
dst++;
@@ -213,7 +213,7 @@
/* --------------------------------------------------------------------------*/
/* wchar_t / utf8 functions */
-size_t BLI_strncpy_wchar_as_utf8(char *dst, const wchar_t *src, const size_t maxncpy)
+size_t BLI_strncpy_wchar_as_utf8(char *__restrict dst, const wchar_t *__restrict src, const size_t maxncpy)
{
size_t len = 0;
@@ -289,7 +289,7 @@
return len;
}
-size_t BLI_strncpy_wchar_from_utf8(wchar_t *dst_w, const char *src_c, const size_t maxncpy)
+size_t BLI_strncpy_wchar_from_utf8(wchar_t *__restrict dst_w, const char *__restrict src_c, const size_t maxncpy)
{
int len = 0;
@@ -419,7 +419,7 @@
}
/* variant that increments the length */
-unsigned int BLI_str_utf8_as_unicode_and_size(const char *p, size_t *index)
+unsigned int BLI_str_utf8_as_unicode_and_size(const char *__restrict p, size_t *__restrict index)
{
int i, mask = 0, len;
unsigned int result;
@@ -435,7 +435,7 @@
/* another variant that steps over the index,
* note, currently this also falls back to latin1 for text drawing. */
-unsigned int BLI_str_utf8_as_unicode_step(const char *p, size_t *index)
+unsigned int BLI_str_utf8_as_unicode_step(const char *__restrict p, size_t *__restrict index)
{
int i, mask = 0, len;
unsigned int result;
Index: source/blender/blenloader/intern/readfile.c
===================================================================
--- source/blender/blenloader/intern/readfile.c (revision 52266)
+++ source/blender/blenloader/intern/readfile.c (working copy)
@@ -8339,7 +8339,7 @@
for (clip = main->movieclip.first; clip; clip = clip->id.next) {
if (clip->tracking.settings.reconstruction_success_threshold == 0.0f) {
- clip->tracking.settings.reconstruction_success_threshold = 1e-3;
+ clip->tracking.settings.reconstruction_success_threshold = 1e-3f;
}
}
}
Index: source/blender/nodes/CMakeLists.txt
===================================================================
--- source/blender/nodes/CMakeLists.txt (revision 52266)
+++ source/blender/nodes/CMakeLists.txt (working copy)
@@ -123,7 +123,6 @@
composite/nodes/node_composite_pixelate.c
composite/node_composite_tree.c
- composite/node_composite_util.c
shader/nodes/node_shader_camera.c
shader/nodes/node_shader_common.c
@@ -223,7 +222,6 @@
intern/node_common.c
intern/node_socket.c
- composite/node_composite_util.h
shader/node_shader_util.h
texture/node_texture_util.h
@@ -236,6 +234,13 @@
intern/node_common.h
)
+if(WITH_COMPOSITOR_LEGACY)
+ list(APPEND SRC
+ composite/node_composite_util.h
+ composite/node_composite_util.c
+ )
+endif()
+
if(WITH_PYTHON)
list(APPEND INC
../python
Index: source/blender/render/intern/source/convertblender.c
===================================================================
--- source/blender/render/intern/source/convertblender.c (revision 52266)
+++ source/blender/render/intern/source/convertblender.c (working copy)
@@ -125,6 +125,7 @@
#define FLT_EPSILON10 1.19209290e-06F
/* could enable at some point but for now there are far too many conversions */
+#pragma warning (disable : 4068 ) /* MSVC - disable unknown pragma warnings */
#pragma GCC diagnostic ignored "-Wdouble-promotion"
/* ------------------------------------------------------------------------- */
Index: source/blender/render/intern/source/shadeoutput.c
===================================================================
--- source/blender/render/intern/source/shadeoutput.c (revision 52266)
+++ source/blender/render/intern/source/shadeoutput.c (working copy)
@@ -58,6 +58,7 @@
#include "shading.h" /* own include */
/* could enable at some point but for now there are far too many conversions */
+#pragma warning (disable : 4068 ) /* MSVC - disable unknown pragma warnings */
#pragma GCC diagnostic ignored "-Wdouble-promotion"
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
Index: source/blender/render/intern/source/zbuf.c
===================================================================
--- source/blender/render/intern/source/zbuf.c (revision 52266)
+++ source/blender/render/intern/source/zbuf.c (working copy)
@@ -77,6 +77,7 @@
#include "zbuf.h"
/* could enable at some point but for now there are far too many conversions */
+#pragma warning (disable : 4068 ) /* MSVC - disable unknown pragma warnings */
#pragma GCC diagnostic ignored "-Wdouble-promotion"
/* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */

File Metadata

Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
b8/73/67e718ecd8f2ac9233ea5fd8fa68

Event Timeline