From 61596d5bb365a96b4b19adf0ef72ec1ea47212aa Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 17 Feb 2012 19:21:47 +0000 Subject: patch [#30227] Various MSVC (32-bit) Warning and Typo Fixes made some small edits - removed changes to AVI reading since the data types are apart of the format spec. - absf -> abs for a double value in render code. --- source/blender/blenkernel/BKE_image.h | 4 ++-- source/blender/blenkernel/intern/pointcache.c | 2 +- source/blender/blenlib/BLI_utildefines.h | 11 +++++++---- source/blender/blenlib/intern/math_color_inline.c | 2 +- source/blender/blenloader/intern/readfile.c | 13 +++++++------ source/blender/editors/mesh/editmesh_lib.c | 2 +- source/blender/python/intern/bpy_app.c | 7 ------- source/blender/render/intern/source/shadeoutput.c | 2 +- 8 files changed, 20 insertions(+), 23 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_image.h b/source/blender/blenkernel/BKE_image.h index 5055372b68f..722ead80ad9 100644 --- a/source/blender/blenkernel/BKE_image.h +++ b/source/blender/blenkernel/BKE_image.h @@ -54,10 +54,10 @@ int BKE_alphatest_ibuf(struct ImBuf *ibuf); int BKE_write_ibuf_stamp(struct Scene *scene, struct Object *camera, struct ImBuf *ibuf, const char *name, struct ImageFormatData *imf); int BKE_write_ibuf(struct ImBuf *ibuf, const char *name, struct ImageFormatData *imf); int BKE_write_ibuf_as(struct ImBuf *ibuf, const char *name, struct ImageFormatData *imf, const short is_copy); -void BKE_makepicstring(char *string, const char *base, const char *relbase, int frame, char imtype, const short use_ext, const short use_frames); +void BKE_makepicstring(char *string, const char *base, const char *relbase, int frame, const char imtype, const short use_ext, const short use_frames); int BKE_add_image_extension(char *string, const char imtype); char BKE_ftype_to_imtype(const int ftype); -int BKE_imtype_to_ftype(char imtype); +int BKE_imtype_to_ftype(const char imtype); int BKE_imtype_is_movie(const char imtype); int BKE_imtype_supports_zbuf(const char imtype); diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index 6fd89db10e7..bf9ed8b17e3 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -2285,7 +2285,7 @@ void BKE_ptcache_id_time(PTCacheID *pid, Scene *scene, float cfra, int *startfra /* float offset; unused for now */ float time, nexttime; - /* TODO: this has to be sorter out once bsystem_time gets redone, */ + /* TODO: this has to be sorted out once bsystem_time gets redone, */ /* now caches can handle interpolating etc. too - jahka */ /* time handling for point cache: diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h index 4a5ccd311c6..ef8a6015adb 100644 --- a/source/blender/blenlib/BLI_utildefines.h +++ b/source/blender/blenlib/BLI_utildefines.h @@ -225,10 +225,13 @@ #define GET_INT_FROM_POINTER(i) ((int)(intptr_t)(i)) /* Macro to convert a value to string in the preprocessor - * STRINGIFY_ARG: gives the defined name in the string - * STRINGIFY: gives the defined value. */ -#define STRINGIFY_ARG(x) #x -#define STRINGIFY(x) STRINGIFY_ARG(x) + * STRINGIFY_ARG: gives the argument as a string + * STRINGIFY_APPEND: appends any argument 'b' onto the string argument 'a', + * used by STRINGIFY because some preprocessors warn about zero arguments + * STRINGIFY: gives the argument's value as a string */ +#define STRINGIFY_ARG(x) "" #x +#define STRINGIFY_APPEND(a, b) "" a #b +#define STRINGIFY(x) STRINGIFY_APPEND("", x) /* useful for debugging */ #define AT __FILE__ ":" STRINGIFY(__LINE__) diff --git a/source/blender/blenlib/intern/math_color_inline.c b/source/blender/blenlib/intern/math_color_inline.c index 386452ed592..f8b986e799b 100644 --- a/source/blender/blenlib/intern/math_color_inline.c +++ b/source/blender/blenlib/intern/math_color_inline.c @@ -163,7 +163,7 @@ MINLINE void linearrgb_to_srgb_ushort4_predivide(unsigned short srgb[4], const f for(i=0; i<3; ++i) { t = linear[i] * inv_alpha; - srgb[i] = (t < 1.0f)? to_srgb_table_lookup(t) * alpha : FTOUSHORT(linearrgb_to_srgb(t) * alpha); + srgb[i] = (t < 1.0f)? (unsigned short)(to_srgb_table_lookup(t) * alpha) : FTOUSHORT(linearrgb_to_srgb(t) * alpha); } srgb[3] = FTOUSHORT(linear[3]); diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index fc8f8e2e2e1..a1378857c01 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3838,7 +3838,7 @@ static void direct_link_mesh(FileData *fd, Mesh *mesh) if((fd->flags & FD_FLAGS_SWITCH_ENDIAN) && mesh->tface) { TFace *tf= mesh->tface; - unsigned int i; + int i; for (i=0; i< (mesh->totface); i++, tf++) { SWITCH_INT(tf->col[0]); @@ -7497,15 +7497,16 @@ static void do_versions_nodetree_convert_angle(bNodeTree *ntree) void do_versions_image_settings_2_60(Scene *sce) { - /* note: rd->subimtype is moved into indervidual settings now and no longer + /* note: rd->subimtype is moved into individual settings now and no longer * exists */ RenderData *rd= &sce->r; ImageFormatData *imf= &sce->r.im_format; - imf->imtype= rd->imtype; - imf->planes= rd->planes; - imf->compress= rd->quality; - imf->quality= rd->quality; + /* we know no data loss happens here, the old values were in char range */ + imf->imtype= (char)rd->imtype; + imf->planes= (char)rd->planes; + imf->compress= (char)rd->quality; + imf->quality= (char)rd->quality; /* default, was stored in multiple places, may override later */ imf->depth= R_IMF_CHAN_DEPTH_8; diff --git a/source/blender/editors/mesh/editmesh_lib.c b/source/blender/editors/mesh/editmesh_lib.c index 5ec147a742b..2895f5c34e6 100644 --- a/source/blender/editors/mesh/editmesh_lib.c +++ b/source/blender/editors/mesh/editmesh_lib.c @@ -2410,7 +2410,7 @@ UvElementMap *EM_make_uv_element_map(EditMesh *em, int selected, int do_islands) vmap->totalUVs = totuv; - for(efa = em->faces.first; efa; a++, efa = efa->next) { + for(efa = em->faces.first; efa; efa = efa->next) { if(!selected || ((!efa->h) && (efa->f & SELECT))) { nverts = (efa->v4)? 4: 3; diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c index ea95c4ebd85..0641c220001 100644 --- a/source/blender/python/intern/bpy_app.c +++ b/source/blender/python/intern/bpy_app.c @@ -94,9 +94,6 @@ static PyStructSequence_Desc app_info_desc = { (sizeof(app_info_fields) / sizeof(PyStructSequence_Field)) - 1 }; -#define DO_EXPAND(VAL) VAL ## 1 -#define EXPAND(VAL) DO_EXPAND(VAL) - static PyObject *make_app_info(void) { PyObject *app_info; @@ -119,11 +116,7 @@ static PyObject *make_app_info(void) SetObjItem(PyUnicode_FromFormat("%d.%02d (sub %d)", BLENDER_VERSION / 100, BLENDER_VERSION % 100, BLENDER_SUBVERSION)); -#if defined(BLENDER_VERSION_CHAR) && EXPAND(BLENDER_VERSION_CHAR) != 1 SetStrItem(STRINGIFY(BLENDER_VERSION_CHAR)); -#else - SetStrItem(""); -#endif SetStrItem(STRINGIFY(BLENDER_VERSION_CYCLE)); SetStrItem(BLI_program_path()); SetObjItem(PyBool_FromLong(G.background)); diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c index 9aac7aae53e..2f620bb96d4 100644 --- a/source/blender/render/intern/source/shadeoutput.c +++ b/source/blender/render/intern/source/shadeoutput.c @@ -206,7 +206,7 @@ static void spothalo(struct LampRen *lar, ShadeInput *shi, float *intens) maxz*= lar->sh_zfac; maxy= lar->imat[0][1]*p1[0]+lar->imat[1][1]*p1[1]+lar->imat[2][1]*p1[2]; - if( fabsf(nray[2]) < FLT_EPSILON ) use_yco= 1; + if( fabs(nray[2]) < FLT_EPSILON ) use_yco= 1; } /* scale z to make sure volume is normalized */ -- cgit v1.2.3