From 751e906934783b467e2fd0ae6817d5e374feaee6 Mon Sep 17 00:00:00 2001
From: Zbigniew Chyla <zbigniew.chyla@nsn.com>
Date: Mon, 16 Feb 2015 01:30:08 +0100
Subject: [PATCH 1/2] Remove unused return value from nmea_send

---
 driver_garmin.c   | 10 ++++----
 driver_geostar.c  |  2 +-
 driver_nmea0183.c |  6 ++---
 driver_sirf.c     |  4 +--
 drivers.c         | 76 +++++++++++++++++++++++++++----------------------------
 gpsd.h-tail       |  2 +-
 6 files changed, 50 insertions(+), 50 deletions(-)

diff --git a/driver_garmin.c b/driver_garmin.c
index d9d4888..f3f6dd2 100644
--- a/driver_garmin.c
+++ b/driver_garmin.c
@@ -1205,13 +1205,13 @@ static void garmin_switcher(struct gps_device_t *session, int mode)
 	settle();		// wait 333mS, essential!
 
 	/* once a sec, no binary, no averaging, NMEA 2.3, WAAS */
-	(void)nmea_send(session, "$PGRMC1,1,1");
-	//(void)nmea_send(fd, "$PGRMC1,1,1,1,,,,2,W,N");
-	(void)nmea_send(session, "$PGRMI,,,,,,,R");
+	nmea_send(session, "$PGRMC1,1,1");
+	//nmea_send(fd, "$PGRMC1,1,1,1,,,,2,W,N");
+	nmea_send(session, "$PGRMI,,,,,,,R");
 	settle();		// wait 333mS, essential!
     } else {
-	(void)nmea_send(session, "$PGRMC1,1,2,1,,,,2,W,N");
-	(void)nmea_send(session, "$PGRMI,,,,,,,R");
+	nmea_send(session, "$PGRMC1,1,2,1,,,,2,W,N");
+	nmea_send(session, "$PGRMI,,,,,,,R");
 	settle();		// wait 333mS, essential!
     }
 }
diff --git a/driver_geostar.c b/driver_geostar.c
index 11e9ad7..96b8fbe 100644
--- a/driver_geostar.c
+++ b/driver_geostar.c
@@ -598,7 +598,7 @@ static void geostar_mode(struct gps_device_t *session, int mode)
 	(void)geostar_write(session, 0x46, buf, 1);
     } else if (mode == MODE_BINARY) {
 	/* Switch to binary mode */
-	(void)nmea_send(session, "$GPSGG,SWPROT");
+	nmea_send(session, "$GPSGG,SWPROT");
     } else {
 	gpsd_report(&session->context->errout, LOG_ERROR, "unknown mode %i requested\n", mode);
     }
diff --git a/driver_nmea0183.c b/driver_nmea0183.c
index af6de5f..a44fb1d 100644
--- a/driver_nmea0183.c
+++ b/driver_nmea0183.c
@@ -1155,7 +1155,7 @@ static gps_mask_t processMTK3301(int c UNUSED, char *field[],
 	 * milliseconds"
 	 */
 	if (atoi(field[5]) < 127875)
-	    (void)nmea_send(session, "$PMTK324,0,0,1,0,127875");
+	    nmea_send(session, "$PMTK324,0,0,1,0,127875");
 	return ONLINE_SET;
     case 705:			/* return device subtype */
 	(void)strlcat(session->subtype, field[1], sizeof(session->subtype));
@@ -1473,7 +1473,7 @@ ssize_t nmea_write(struct gps_device_t *session, char *buf, size_t len UNUSED)
     return gpsd_write(session, session->msgbuf, session->msgbuflen);
 }
 
-ssize_t nmea_send(struct gps_device_t * session, const char *fmt, ...)
+void nmea_send(struct gps_device_t * session, const char *fmt, ...)
 {
     char buf[BUFSIZ];
     va_list ap;
@@ -1481,5 +1481,5 @@ ssize_t nmea_send(struct gps_device_t * session, const char *fmt, ...)
     va_start(ap, fmt);
     (void)vsnprintf(buf, sizeof(buf) - 5, fmt, ap);
     va_end(ap);
-    return nmea_write(session, buf, strlen(buf));
+    (void) nmea_write(session, buf, strlen(buf));
 }
diff --git a/driver_sirf.c b/driver_sirf.c
index 20e7b51..d4241f6 100644
--- a/driver_sirf.c
+++ b/driver_sirf.c
@@ -408,7 +408,7 @@ static void sirfbin_mode(struct gps_device_t *session, int mode)
 	}
 	// gpsd only supports 8[NO]1 or 7[EO]2
 	// thus the strange use of stopbits
-	(void)nmea_send(session,
+	nmea_send(session,
 			"$PSRF100,0,%d,%d,%d,%c",
 			session->gpsdata.dev.baudrate,
 			9 - session->gpsdata.dev.stopbits,
@@ -1414,7 +1414,7 @@ static void sirfbin_event_hook(struct gps_device_t *session, event_t event)
 	if (session->lexer.type == NMEA_PACKET) {
 	    gpsd_report(&session->context->errout, LOG_PROG,
 			"SiRF: Switching chip mode to binary.\n");
-	    (void)nmea_send(session,
+	    nmea_send(session,
 			    "$PSRF100,0,%d,8,1,0",
 			    session->gpsdata.dev.baudrate);
 	}
diff --git a/drivers.c b/drivers.c
index 0003ad1..8cf04a7 100644
--- a/drivers.c
+++ b/drivers.c
@@ -150,7 +150,7 @@ static void nmea_event_hook(struct gps_device_t *session, event_t event)
 	    /* probe for Garmin serial GPS -- expect $PGRMC followed by data */
 	    gpsd_report(&session->context->errout, LOG_PROG,
 			"=> Probing for Garmin NMEA\n");
-	    (void)nmea_send(session, "$PGRMCE");
+	    nmea_send(session, "$PGRMCE");
 	    break;
 #endif /* NMEA_ENABLE */
 #ifdef SIRF_ENABLE
@@ -173,7 +173,7 @@ static void nmea_event_hook(struct gps_device_t *session, event_t event)
 	     * string.
 	     */
 	    gpsd_report(&session->context->errout, LOG_PROG, "=> Probing for SiRF\n");
-	    (void)nmea_send(session,
+	    nmea_send(session,
 			    "$PSRF100,0,%d,%d,%d,0",
 			    session->gpsdata.dev.baudrate,
 			    9 - session->gpsdata.dev.stopbits,
@@ -185,13 +185,13 @@ static void nmea_event_hook(struct gps_device_t *session, event_t event)
 	case 2:
 	    /* probe for the FV-18 -- expect $PFEC,GPint followed by data */
 	    gpsd_report(&session->context->errout, LOG_PROG, "=> Probing for FV-18\n");
-	    (void)nmea_send(session, "$PFEC,GPint");
+	    nmea_send(session, "$PFEC,GPint");
 	    break;
 	case 3:
 	    /* probe for the Trimble Copernicus */
 	    gpsd_report(&session->context->errout, LOG_PROG,
 			"=> Probing for Trimble Copernicus\n");
-	    (void)nmea_send(session, "$PTNLSNM,0139,01");
+	    nmea_send(session, "$PTNLSNM,0139,01");
 	    break;
 #endif /* NMEA_ENABLE */
 #ifdef EVERMORE_ENABLE
@@ -210,7 +210,7 @@ static void nmea_event_hook(struct gps_device_t *session, event_t event)
 	    /* probe for Furuno Electric GH-79L4-N (GPSClock); expect $PFEC,GPssd */
 	    gpsd_report(&session->context->errout, LOG_PROG,
 			"=> Probing for GPSClock\n");
-	    (void)nmea_send(session, "$PFEC,GPsrq");
+	    nmea_send(session, "$PFEC,GPsrq");
 	    break;
 #endif /* GPSCLOCK_ENABLE */
 #ifdef ASHTECH_ENABLE
@@ -218,7 +218,7 @@ static void nmea_event_hook(struct gps_device_t *session, event_t event)
 	    /* probe for Ashtech -- expect $PASHR,RID */
 	    gpsd_report(&session->context->errout, LOG_PROG,
 			"=> Probing for Ashtech\n");
-	    (void)nmea_send(session, "$PASHQ,RID");
+	    nmea_send(session, "$PASHQ,RID");
 	    break;
 #endif /* ASHTECH_ENABLE */
 #ifdef UBLOX_ENABLE
@@ -234,7 +234,7 @@ static void nmea_event_hook(struct gps_device_t *session, event_t event)
 	    /* probe for MTK-3301 -- expect $PMTK705 */
 	    gpsd_report(&session->context->errout, LOG_PROG,
 			"=> Probing for MediaTek\n");
-	    (void)nmea_send(session, "$PMTK605");
+	    nmea_send(session, "$PMTK605");
 	    break;
 #endif /* MTK3301_ENABLE */
 	default:
@@ -287,8 +287,8 @@ static void garmin_mode_switch(struct gps_device_t *session, int mode)
 /* only does anything in one direction, going to Garmin binary driver */
 {
     if (mode == MODE_BINARY) {
-	(void)nmea_send(session, "$PGRMC1,1,2,1,,,,2,W,N");
-	(void)nmea_send(session, "$PGRMI,,,,,,,R");
+	nmea_send(session, "$PGRMC1,1,2,1,,,,2,W,N");
+	nmea_send(session, "$PGRMI,,,,,,,R");
 	(void)usleep(333);	/* standard Garmin settling time */
     }
 }
@@ -317,33 +317,33 @@ static void garmin_nmea_event_hook(struct gps_device_t *session,
 	     * with a 160ms low state.
 	     * NOTE: new PPS only takes effect after next power cycle
 	     */
-	    (void)nmea_send(session, "$PGRMC,A,,100,,,,,,A,,1,2,1,30");
+	    nmea_send(session, "$PGRMC,A,,100,,,,,,A,,1,2,1,30");
 	    break;
 	case 1:
 	    /* once a sec, no averaging, NMEA 2.3, WAAS */
-	    (void)nmea_send(session, "$PGRMC1,1,1,1,,,,2,W,N");
+	    nmea_send(session, "$PGRMC1,1,1,1,,,,2,W,N");
 	    break;
 	case 2:
 	    /* get some more config info */
-	    (void)nmea_send(session, "$PGRMC1E");
+	    nmea_send(session, "$PGRMC1E");
 	    break;
 	case 3:
 	    /* turn off all output except GGA */
-	    (void)nmea_send(session, "$PGRMO,,2");
-	    (void)nmea_send(session, "$PGRMO,GPGGA,1");
+	    nmea_send(session, "$PGRMO,,2");
+	    nmea_send(session, "$PGRMO,GPGGA,1");
 	    break;
 	case 4:
 	    /* enable GPGGA, GPGSA, GPGSV, GPRMC on Garmin serial GPS */
-	    (void)nmea_send(session, "$PGRMO,GPGSA,1");
+	    nmea_send(session, "$PGRMO,GPGSA,1");
 	    break;
 	case 5:
-	    (void)nmea_send(session, "$PGRMO,GPGSV,1");
+	    nmea_send(session, "$PGRMO,GPGSV,1");
 	    break;
 	case 6:
-	    (void)nmea_send(session, "$PGRMO,GPRMC,1");
+	    nmea_send(session, "$PGRMO,GPRMC,1");
 	    break;
 	case 7:
-	    (void)nmea_send(session, "$PGRMO,PGRME,1");
+	    nmea_send(session, "$PGRMO,PGRME,1");
 	    break;
 	}
     }
@@ -391,24 +391,24 @@ static void ashtech_event_hook(struct gps_device_t *session, event_t event)
 	return;
 
     if (event == event_wakeup)
-	(void)nmea_send(session, "$PASHQ,RID");
+	nmea_send(session, "$PASHQ,RID");
     if (event == event_identified) {
 	/* turn WAAS on. can't hurt... */
-	(void)nmea_send(session, "$PASHS,WAS,ON");
+	nmea_send(session, "$PASHS,WAS,ON");
 	/* reset to known output state */
-	(void)nmea_send(session, "$PASHS,NME,ALL,A,OFF");
+	nmea_send(session, "$PASHS,NME,ALL,A,OFF");
 	/* then turn on some useful sentences */
 #ifdef __future__
 	/* we could parse these, but they're oversize so they get dropped */
-	(void)nmea_send(session, "$PASHS,NME,POS,A,ON");
-	(void)nmea_send(session, "$PASHS,NME,SAT,A,ON");
+	nmea_send(session, "$PASHS,NME,POS,A,ON");
+	nmea_send(session, "$PASHS,NME,SAT,A,ON");
 #else
-	(void)nmea_send(session, "$PASHS,NME,GGA,A,ON");
-	(void)nmea_send(session, "$PASHS,NME,GSA,A,ON");
-	(void)nmea_send(session, "$PASHS,NME,GSV,A,ON");
-	(void)nmea_send(session, "$PASHS,NME,RMC,A,ON");
+	nmea_send(session, "$PASHS,NME,GGA,A,ON");
+	nmea_send(session, "$PASHS,NME,GSA,A,ON");
+	nmea_send(session, "$PASHS,NME,GSV,A,ON");
+	nmea_send(session, "$PASHS,NME,RMC,A,ON");
 #endif
-	(void)nmea_send(session, "$PASHS,NME,ZDA,A,ON");
+	nmea_send(session, "$PASHS,NME,ZDA,A,ON");
     }
 }
 
@@ -460,7 +460,7 @@ static void fv18_event_hook(struct gps_device_t *session, event_t event)
      * but doing so is safe and cheap.
      */
     if (event == event_identified || event == event_reactivate)
-	(void)nmea_send(session,
+	nmea_send(session,
 			"$PFEC,GPint,GSA01,DTM00,ZDA01,RMC01,GLL00,VTG00,GSV05");
 }
 
@@ -569,10 +569,10 @@ static void tripmate_event_hook(struct gps_device_t *session, event_t event)
 	return;
     /* TripMate requires this response to the ASTRAL it sends at boot time */
     if (event == event_identified)
-	(void)nmea_send(session, "$IIGPQ,ASTRAL");
+	nmea_send(session, "$IIGPQ,ASTRAL");
     /* stop it sending PRWIZCH */
     if (event == event_identified || event == event_reactivate)
-	(void)nmea_send(session, "$PRWIILOG,ZCH,V,,");
+	nmea_send(session, "$PRWIILOG,ZCH,V,,");
 }
 
 /* *INDENT-OFF* */
@@ -1108,13 +1108,13 @@ static void mtk3301_event_hook(struct gps_device_t *session, event_t event)
     if (session->context->readonly)
 	return;
     if (event == event_triggermatch) {
-	(void)nmea_send(session, "$PMTK320,0");	/* power save off */
-	(void)nmea_send(session, "$PMTK300,1000,0,0,0.0,0.0");	/* Fix interval */
-	(void)nmea_send(session,
+	nmea_send(session, "$PMTK320,0");	/* power save off */
+	nmea_send(session, "$PMTK300,1000,0,0,0.0,0.0");	/* Fix interval */
+	nmea_send(session,
 			"$PMTK314,0,1,0,1,1,5,1,1,0,0,0,0,0,0,0,0,0,1,0");
-	(void)nmea_send(session, "$PMTK301,2");	/* DGPS is WAAS */
-	(void)nmea_send(session, "$PMTK313,1");	/* SBAS enable */
-	(void)nmea_send(session, "$PMTK424");	/* Query PPS pulse width */
+	nmea_send(session, "$PMTK301,2");	/* DGPS is WAAS */
+	nmea_send(session, "$PMTK313,1");	/* SBAS enable */
+	nmea_send(session, "$PMTK424");	/* Query PPS pulse width */
     }
 }
 
@@ -1130,7 +1130,7 @@ static bool mtk3301_rate_switcher(struct gps_device_t *session, double rate)
 	milliseconds = 200;
 
     (void)snprintf(buf, sizeof(buf), "$PMTK300,%u,0,0,0,0", milliseconds);
-    (void)nmea_send(session, buf);	/* Fix interval */
+    nmea_send(session, buf);	/* Fix interval */
     return true;
 }
 #endif /* RECONFIGURE_ENABLE */
diff --git a/gpsd.h-tail b/gpsd.h-tail
index eaca0cb..6ca2d8d 100644
--- a/gpsd.h-tail
+++ b/gpsd.h-tail
@@ -787,7 +787,7 @@ extern ssize_t generic_get(struct gps_device_t *);
 
 extern gps_mask_t nmea_parse(char *, struct gps_device_t *);
 extern ssize_t nmea_write(struct gps_device_t *, char *, size_t);
-extern ssize_t nmea_send(struct gps_device_t *, const char *, ... );
+extern void nmea_send(struct gps_device_t *, const char *, ... );
 extern void nmea_add_checksum(char *);
 
 extern gps_mask_t sirf_parse(struct gps_device_t *, unsigned char *, size_t);
-- 
2.1.4

