avoid runtime overflow (1 << 31), for RNA and armature layer UI.

This commit is contained in:
2013-08-04 00:01:41 +00:00
parent dd037a85a0
commit 5881fe5d67
3 changed files with 11 additions and 13 deletions

View File

@@ -355,7 +355,7 @@ static void ui_item_array(uiLayout *layout, uiBlock *block, const char *name, in
PropertyType type;
PropertySubType subtype;
uiLayout *sub;
int a, b;
unsigned int a, b;
/* retrieve type and subtype */
type = RNA_property_type(prop);
@@ -373,8 +373,8 @@ static void ui_item_array(uiLayout *layout, uiBlock *block, const char *name, in
/* special check for layer layout */
int butw, buth, unit;
int cols = (len >= 20) ? 2 : 1;
int colbuts = len / (2 * cols);
int layer_used = 0;
const unsigned int colbuts = len / (2 * cols);
unsigned int layer_used = 0;
uiBlockSetCurLayout(block, uiLayoutAbsolute(layout, FALSE));