diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2020-03-06 17:56:09 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2020-03-06 17:56:09 +0300 |
commit | 40ac8250b246743f73010152671b9e60c83c8883 (patch) | |
tree | 9cd4e196d677de75306956577c2a7230d773abe6 /source | |
parent | 926f52edf0079196ea3e70aa9c7fbe327ccc029a (diff) |
Fix narrowing from int to short when removing material slot
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/material.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index f8e1e9aeef2..219d4eaa407 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -594,8 +594,7 @@ void BKE_object_material_resize(Main *bmain, Object *ob, const short totcol, boo char *newmatbits; if (do_id_user && totcol < ob->totcol) { - short i; - for (i = totcol; i < ob->totcol; i++) { + for (int i = totcol; i < ob->totcol; i++) { id_us_min((ID *)ob->mat[i]); } } @@ -965,7 +964,6 @@ bool BKE_object_material_slot_remove(Main *bmain, Object *ob) { Material *mao, ***matarar; short *totcolp; - short a, actcol; if (ob == NULL || ob->totcol == 0) { return false; @@ -1002,7 +1000,7 @@ bool BKE_object_material_slot_remove(Main *bmain, Object *ob) id_us_min(&mao->id); } - for (a = ob->actcol; a < ob->totcol; a++) { + for (int a = ob->actcol; a < ob->totcol; a++) { (*matarar)[a - 1] = (*matarar)[a]; } (*totcolp)--; @@ -1012,7 +1010,7 @@ bool BKE_object_material_slot_remove(Main *bmain, Object *ob) *matarar = NULL; } - actcol = ob->actcol; + const int actcol = ob->actcol; for (Object *obt = bmain->objects.first; obt; obt = obt->id.next) { if (obt->data == ob->data) { @@ -1026,7 +1024,7 @@ bool BKE_object_material_slot_remove(Main *bmain, Object *ob) id_us_min(&mao->id); } - for (a = actcol; a < obt->totcol; a++) { + for (int a = actcol; a < obt->totcol; a++) { obt->mat[a - 1] = obt->mat[a]; obt->matbits[a - 1] = obt->matbits[a]; } |