brummer10 / XUiDesigner

A WYSIWYG LV2 GUI/plugin creator tool
BSD Zero Clause License
100 stars 3 forks source link

using floating point absolute value function 'fabs' when argument is of integer type #13

Closed yurivict closed 2 years ago

yurivict commented 2 years ago

This is a valid complaint from clang:

./src/XUiDesigner.c:508:21: warning: using floating point absolute value function 'fabs' when argument is of integer type [-Wabsolute-value]
            int v = fabs(xmotion->x_root-designer->pos_x) > fabs(xmotion->y_root-designer->pos_y) ? 
                    ^
./src/XUiDesigner.c:508:21: note: use function 'abs' instead
            int v = fabs(xmotion->x_root-designer->pos_x) > fabs(xmotion->y_root-designer->pos_y) ? 
                    ^~~~
                    abs
./src/XUiDesigner.c:508:61: warning: using floating point absolute value function 'fabs' when argument is of integer type [-Wabsolute-value]
            int v = fabs(xmotion->x_root-designer->pos_x) > fabs(xmotion->y_root-designer->pos_y) ? 
                                                            ^
./src/XUiDesigner.c:508:61: note: use function 'abs' instead
            int v = fabs(xmotion->x_root-designer->pos_x) > fabs(xmotion->y_root-designer->pos_y) ? 
                                                            ^~~~
                                                            abs
2 warnings generated.
brummer10 commented 2 years ago

True Thanks for reporting, it's fixed now.

yurivict commented 2 years ago

Thanks!