# This can also be an environment variable.
# OPENEXR_FOUND, If false, do not try to use OpenEXR.
#
-# For indervidual library access these advanced settings are available
+# For individual library access these advanced settings are available
# OPENEXR_HALF_LIBRARY, Path to Half library
# OPENEXR_IEX_LIBRARY, Path to Half library
# OPENEXR_ILMIMF_LIBRARY, Path to Ilmimf library
#include "AUD_Buffer.h"
#define AUD_U8_0 0x80
-#define AUD_S16_MAX 0x7FFF
-#define AUD_S16_MIN 0x8000
+#define AUD_S16_MAX ((int16_t)0x7FFF)
+#define AUD_S16_MIN ((int16_t)0x8000)
#define AUD_S16_FLT 32767.0f
-#define AUD_S32_MAX 0x7FFFFFFF
-#define AUD_S32_MIN 0x80000000
+#define AUD_S32_MAX ((int32_t)0x7FFFFFFF)
+#define AUD_S32_MIN ((int32_t)0x80000000)
#define AUD_S32_FLT 2147483647.0f
#define AUD_FLT_MAX 1.0f
#define AUD_FLT_MIN -1.0f
left\
}\
\
- P = -P;\
+ P = 0 - P;\
\
end = (int_to_fp(m_len) - P) / P_increment - 1;\
if(m_cache_valid - m_n - 2 < end)\
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);
/* 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:
#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__)
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]);
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]);
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;
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;
(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;
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));
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 */