Fix coding style in vector-operations.c
This commit is contained in:
parent
188c6f5d87
commit
6d31193123
@ -46,6 +46,7 @@ double vector_2d_scalar_multipy(struct vector_2d *a, struct vector_2d *b)
|
||||
void vector_2d_normalize(struct vector_2d *vec)
|
||||
{
|
||||
double len;
|
||||
|
||||
if (!vec)
|
||||
return;
|
||||
len = sqrt(pow(vec->x, 2) + pow(vec->y, 2));
|
||||
@ -97,10 +98,9 @@ struct vector_2d *vector_2d_alloc(void)
|
||||
|
||||
void vector_2d_free(struct vector_2d *vec)
|
||||
{
|
||||
if (vec) {
|
||||
if (vec)
|
||||
free(vec);
|
||||
}
|
||||
}
|
||||
|
||||
void vector_2d_scale(struct vector_2d *vec, double scale)
|
||||
{
|
||||
@ -114,9 +114,9 @@ void vector_2d_scale(struct vector_2d *vec, double scale)
|
||||
double vector_2d_abs(struct vector_2d *vec)
|
||||
{
|
||||
double len = 0.0;
|
||||
if (vec) {
|
||||
|
||||
if (vec)
|
||||
len = sqrt(pow(vec->x, 2) + pow(vec->y, 2));
|
||||
}
|
||||
return len;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user