summaryrefslogtreecommitdiff
path: root/driver_garmin.c
diff options
context:
space:
mode:
authorMatt <ukyg9e5r6k7gubiekd6@yahoo.com>2014-09-06 12:38:05 +1000
committerEric S. Raymond <esr@thyrsus.com>2014-09-05 23:38:14 -0400
commit3caef7cc5df653c9e61e9c61f20219e9c4b2034f (patch)
tree465cafdcb1005a505d206a461dae4548bac98d09 /driver_garmin.c
parent5188986bc6e4c4378f13f960ec4b89978b8f348e (diff)
downloadgpsd-3caef7cc5df653c9e61e9c61f20219e9c4b2034f.tar.gz
#ifdef out some functions that are unused when we don't have libusb
This patch silences a compiler warning by #ifdef'ing out two functions in the Garmin driver that are only called if HAVE_LIBUSB is defined.
Diffstat (limited to 'driver_garmin.c')
-rw-r--r--driver_garmin.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/driver_garmin.c b/driver_garmin.c
index 55d4a4e0..662c9b40 100644
--- a/driver_garmin.c
+++ b/driver_garmin.c
@@ -283,8 +283,10 @@ static inline double radtodeg(double rad)
static gps_mask_t PrintSERPacket(struct gps_device_t *session,
unsigned char pkt_id, int pkt_len,
unsigned char *buf);
+#if defined(HAVE_LIBUSB)
static gps_mask_t PrintUSBPacket(struct gps_device_t *session,
Packet_t * pkt);
+#endif /* HAVE_LIBUSB */
gps_mask_t PrintSERPacket(struct gps_device_t *session, unsigned char pkt_id,
int pkt_len, unsigned char *buf)
@@ -621,6 +623,7 @@ gps_mask_t PrintSERPacket(struct gps_device_t *session, unsigned char pkt_id,
}
+#if defined(HAVE_LIBUSB)
/*@ -branchstate @*/
// This works around cppcheck not looking into enough config branches
// cppcheck-suppress unusedFunction
@@ -729,9 +732,10 @@ static gps_mask_t PrintUSBPacket(struct gps_device_t *session, Packet_t * pkt)
}
/*@ +branchstate @*/
+#endif /* HAVE_LIBUSB */
-#if defined(__linux__) || defined(S_SPLINT_S)
+#if defined(HAVE_LIBUSB) && (defined(__linux__) || defined(S_SPLINT_S))
/* build and send a packet w/ USB protocol */
static void Build_Send_USB_Packet(struct gps_device_t *session,
uint32_t layer_id, uint32_t pkt_id,
@@ -771,7 +775,7 @@ static void Build_Send_USB_Packet(struct gps_device_t *session,
(void)gpsd_write(session, n, 0);
}
}
-#endif /* __linux__ || S_SPLINT_S */
+#endif /* HAVE_LIBUSB && (__linux__ || S_SPLINT_S) */
/* build and send a packet in serial protocol */
/* layer_id unused */