Fix for uninitialized unit_use_radians variable with inset and bevel

This commit is contained in:
2014-05-06 19:20:03 +10:00
parent 7fddd7f013
commit 35380cdcad
3 changed files with 19 additions and 6 deletions

View File

@@ -313,6 +313,7 @@ void msub_vn_vn(float *array_tar, const float *array_src, const float f, const i
void msub_vn_vnvn(float *array_tar, const float *array_src_a, const float *array_src_b, const float f, const int size);
void interp_vn_vn(float *array_tar, const float *array_src, const float t, const int size);
void fill_vn_i(int *array_tar, const int size, const int val);
void fill_vn_short(short *array_tar, const int size, const short val);
void fill_vn_ushort(unsigned short *array_tar, const int size, const unsigned short val);
void fill_vn_fl(float *array_tar, const int size, const float val);

View File

@@ -992,6 +992,15 @@ void fill_vn_i(int *array_tar, const int size, const int val)
}
}
void fill_vn_short(short *array_tar, const int size, const short val)
{
short *tar = array_tar + (size - 1);
int i = size;
while (i--) {
*(tar--) = val;
}
}
void fill_vn_ushort(unsigned short *array_tar, const int size, const unsigned short val)
{
unsigned short *tar = array_tar + (size - 1);

View File

@@ -70,17 +70,20 @@ enum {
void initNumInput(NumInput *n)
{
n->unit_sys = USER_UNIT_NONE;
n->unit_type[0] = n->unit_type[1] = n->unit_type[2] = B_UNIT_NONE;
n->idx = 0;
n->idx_max = 0;
n->unit_sys = USER_UNIT_NONE;
fill_vn_i(n->unit_type, NUM_MAX_ELEMENTS, B_UNIT_NONE);
n->unit_use_radians = false;
n->flag = 0;
n->val_flag[0] = n->val_flag[1] = n->val_flag[2] = 0;
zero_v3(n->val_org);
fill_vn_short(n->val_flag, NUM_MAX_ELEMENTS, 0);
zero_v3(n->val);
fill_vn_fl(n->val_org, NUM_MAX_ELEMENTS, 0.0f);
fill_vn_fl(n->val_inc, NUM_MAX_ELEMENTS, 1.0f);
n->idx = 0;
n->str[0] = '\0';
n->str_cur = 0;
copy_v3_fl(n->val_inc, 1.0f);
}
/* str must be NUM_STR_REP_LEN * (idx_max + 1) length. */