Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/unused includes #1091

Merged
merged 3 commits into from
Jul 24, 2022
Merged

Fix/unused includes #1091

merged 3 commits into from
Jul 24, 2022

Conversation

dforsi
Copy link
Contributor

@dforsi dforsi commented Jul 24, 2022

This PR deletes some includes that the tool iwyu says that are unused.
It seems safe to remove them because make doesn't show new warnings and make check still succeeds:

PASS: testcpp.sh
============================================================================
Testsuite summary for Hamlib 4.5~git
============================================================================
# TOTAL: 1
# PASS:  1
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
[...]
PASS: testrig.sh
PASS: testfreq.sh
PASS: testbcd.sh
PASS: testloc.sh
PASS: testrigcaps.sh
PASS: testcache.sh
PASS: testcookie.sh
PASS: testgrid.sh
============================================================================
Testsuite summary for Hamlib 4.5~git
============================================================================
# TOTAL: 8
# PASS:  8
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================

There are more includes that could be deleted or moved from a *.h to the corresponding *.c, but these other changes are better done in a future PR:

- #include <arpa/inet.h>
- #include <cal.h>
- #include <config.h>
- #include <ctype.h>
- #include <errno.h>
- #include <fcntl.h>
- #include <getopt.h>
- #include <hamlib/amplifier.h>
- #include <hamlib/config.h>
- #include <hamlib/rig.h>
- #include <hamlib/rotator.h>
- #include <iofunc.h>
- #include <limits.h>
- #include <linux/types.h>
- #include <misc.h>
- #include <netinet/in.h>
- #include <network.h>
- #include <pthread.h>
- #include <register.h>
- #include <serial.h>
- #include <signal.h>
- #include <stdarg.h>
- #include <stdbool.h>
- #include <stdint.h>
- #include <stdlib.h>
- #include <sys/ioctl.h>
- #include <sys/param.h>
- #include <sys/socket.h>
- #include <sys/stat.h>
- #include <sys/time.h>
- #include <sys/types.h>
- #include <token.h>
- #include <tones.h>
- #include <unistd.h>

Removes includes of time.h sys/time.h hamlibdatetime.h
Removes includes of stdio.h stdlib.h string.h unistd.h
@mdblack98 mdblack98 merged commit 74b4d7b into Hamlib:master Jul 24, 2022
@dforsi dforsi mentioned this pull request Jul 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants