Skip to content

Commit

Permalink
v.vol.rst: Initialize structure contents before passing it around (#4282
Browse files Browse the repository at this point in the history
)

* v.vol.rst: Initialize structure contents before passing it around

`skip_point` structure is not initialized when declared. This was
found using cppcheck tool.

Only when `cv` is true, `skip_point` contents are filled and the
structure is used. cppcheck raised the issue when 'cv' is false.
Technically, we don't need skip_point in such cases and not
initializing it won't affect the execution. Nevertheless, it's a
good practice to initialize structure contents at the time of
declaration.

Signed-off-by: Mohan Yelugoti <ymdatta.work@gmail.com>

* Use correct literal for double type

Co-authored-by: Nicklas Larsson <n_larsson@yahoo.com>

---------

Signed-off-by: Mohan Yelugoti <ymdatta.work@gmail.com>
Co-authored-by: Nicklas Larsson <n_larsson@yahoo.com>
  • Loading branch information
ymdatta and nilason committed Sep 10, 2024
1 parent 997624b commit a85c7b0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions vector/v.vol.rst/user2.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ int interp_call(struct octtree *root, struct octtree *tree)
int skip_index, segtest;
double xx, yy, zz /*, ww */;

skip_point.x = skip_point.y = skip_point.z = skip_point.w = 0.0;
if (tree == NULL)
return -1;
if (tree->data == NULL)
Expand Down

0 comments on commit a85c7b0

Please sign in to comment.