corrections from an article about using PVS-Studio static checker with blender - http://www.viva64.com/en/b/0145/
This commit is contained in:
@@ -2414,7 +2414,7 @@ float uiLayoutGetScaleX(uiLayout *layout)
|
|||||||
|
|
||||||
float uiLayoutGetScaleY(uiLayout *layout)
|
float uiLayoutGetScaleY(uiLayout *layout)
|
||||||
{
|
{
|
||||||
return layout->scale[0];
|
return layout->scale[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
/********************** Layout *******************/
|
/********************** Layout *******************/
|
||||||
|
|||||||
@@ -358,7 +358,7 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre
|
|||||||
if (OB_TYPE_SUPPORT_MATERIAL(base->object->type)) {
|
if (OB_TYPE_SUPPORT_MATERIAL(base->object->type)) {
|
||||||
/* don't use assign_material, it changed mat->id.us, which shows in the UI */
|
/* don't use assign_material, it changed mat->id.us, which shows in the UI */
|
||||||
Material ***matar = give_matarar(base->object);
|
Material ***matar = give_matarar(base->object);
|
||||||
int actcol = MAX2(base->object->actcol > 0, 1) - 1;
|
int actcol = MAX2(base->object->actcol - 1, 0);
|
||||||
|
|
||||||
if (matar && actcol < base->object->totcol)
|
if (matar && actcol < base->object->totcol)
|
||||||
(*matar)[actcol] = mat;
|
(*matar)[actcol] = mat;
|
||||||
|
|||||||
@@ -603,7 +603,7 @@ void rna_object_vcollayer_name_set(PointerRNA *ptr, const char *value, char *res
|
|||||||
static int rna_Object_active_material_index_get(PointerRNA *ptr)
|
static int rna_Object_active_material_index_get(PointerRNA *ptr)
|
||||||
{
|
{
|
||||||
Object *ob = (Object*)ptr->id.data;
|
Object *ob = (Object*)ptr->id.data;
|
||||||
return MAX2(ob->actcol-1, 0);
|
return MAX2(ob->actcol - 1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rna_Object_active_material_index_set(PointerRNA *ptr, int value)
|
static void rna_Object_active_material_index_set(PointerRNA *ptr, int value)
|
||||||
|
|||||||
@@ -511,8 +511,8 @@ static PyObject *bpy_bmlayercollection_subscript_slice(BPy_BMLayerCollection *se
|
|||||||
|
|
||||||
BPY_BM_CHECK_OBJ(self);
|
BPY_BM_CHECK_OBJ(self);
|
||||||
|
|
||||||
if (start >= start) start = len - 1;
|
if (start >= len) start = len - 1;
|
||||||
if (stop >= stop) stop = len - 1;
|
if (stop >= len) stop = len - 1;
|
||||||
|
|
||||||
tuple = PyTuple_New(stop - start);
|
tuple = PyTuple_New(stop - start);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user