After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 769526 - Code cleanups and warning fixes
Code cleanups and warning fixes
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
unspecified
Other Linux
: Normal minor
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-08-04 17:29 UTC by Ernestas Kulik
Modified: 2016-08-05 10:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Clean up dead assigments (4.00 KB, patch)
2016-08-04 17:30 UTC, Ernestas Kulik
committed Details | Review
file-undo-operations: use labs() instead of abs() (1.15 KB, patch)
2016-08-04 17:30 UTC, Ernestas Kulik
none Details | Review
shell-search-provider: fix incompatible pointer assignment (987 bytes, patch)
2016-08-04 17:30 UTC, Ernestas Kulik
committed Details | Review
file-undo-operations: use ABS macro instead of abs() (1.18 KB, patch)
2016-08-04 17:55 UTC, Ernestas Kulik
committed Details | Review

Description Ernestas Kulik 2016-08-04 17:29:01 UTC
Attaching patches to clean up code and eliminate a couple of warnings.
Comment 1 Ernestas Kulik 2016-08-04 17:30:00 UTC
Created attachment 332743 [details] [review]
Clean up dead assigments

A static analyzer revealed a number of dead assignments, which
have a negative effect on readability. This commit removes them.
Comment 2 Ernestas Kulik 2016-08-04 17:30:07 UTC
Created attachment 332744 [details] [review]
file-undo-operations: use labs() instead of abs()

trash_retrieve_files_to_restore_thread() calls abs() with an argument of
type long, where as abs() accepts ints. This commit fixes that by
replacing the call with one to labs().
Comment 3 Ernestas Kulik 2016-08-04 17:30:14 UTC
Created attachment 332745 [details] [review]
shell-search-provider: fix incompatible pointer assignment

In execute_search(), there is a pointer assignment of incompatible type.
This commit fixes that by adjusting the variable type.
Comment 4 Ernestas Kulik 2016-08-04 17:55:24 UTC
Created attachment 332746 [details] [review]
file-undo-operations: use ABS macro instead of abs()

trash_retrieve_files_to_restore_thread() calls abs() with an argument of
type long, whereas abs() accepts ints. This commit fixes that by
replacing the call with the ABS macro, which is type-agnostic.
Comment 5 Razvan Chitu 2016-08-05 07:21:42 UTC
Review of attachment 332746 [details] [review]:

LGTM! I think I might've been the one who wrote abs instead of ABS, woops.
Comment 6 Razvan Chitu 2016-08-05 07:23:30 UTC
Review of attachment 332745 [details] [review]:

LGTM, thanks!
Comment 7 Razvan Chitu 2016-08-05 09:28:37 UTC
Review of attachment 332743 [details] [review]:

LGTM, thanks!
Comment 8 Carlos Soriano 2016-08-05 09:36:53 UTC
Everything fine, thanks!
Comment 9 Ernestas Kulik 2016-08-05 10:02:02 UTC
Attachment 332743 [details] pushed as 2c7620a - Clean up dead assigments
Attachment 332745 [details] pushed as d2bf6f7 - shell-search-provider: fix incompatible pointer assignment
Attachment 332746 [details] pushed as e3025d4 - file-undo-operations: use ABS macro instead of abs()