Cleanup: use const

Also use assert w/ rotate_m4.
This commit is contained in:
2017-09-05 22:39:00 +10:00
parent b0bbb5f34f
commit 4d85396fe4
3 changed files with 7 additions and 4 deletions

View File

@@ -52,8 +52,8 @@
typedef struct Dial Dial;
Dial *BLI_dial_initialize(float start_position[2], float threshold);
Dial *BLI_dial_initialize(const float start_position[2], float threshold);
float BLI_dial_angle(Dial *dial, float current_position[2]);
float BLI_dial_angle(Dial *dial, const float current_position[2]);
#endif /* __BLI_DIAL_H__ */

View File

@@ -46,7 +46,7 @@ struct Dial {
};
Dial *BLI_dial_initialize(float start_position[2], float threshold)
Dial *BLI_dial_initialize(const float start_position[2], float threshold)
{
Dial *dial = MEM_callocN(sizeof(Dial), "dial");
@@ -56,7 +56,7 @@ Dial *BLI_dial_initialize(float start_position[2], float threshold)
return dial;
}
float BLI_dial_angle(Dial *dial, float current_position[2])
float BLI_dial_angle(Dial *dial, const float current_position[2])
{
float current_direction[2];

View File

@@ -1663,6 +1663,9 @@ void rotate_m4(float mat[4][4], const char axis, const float angle)
mat[0][col] = temp;
}
break;
default:
BLI_assert(0);
break;
}
}