summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2004-09-30 03:59:26 +0000
committerEric S. Raymond <esr@thyrsus.com>2004-09-30 03:59:26 +0000
commite4c5c7cee02b6536da7f11e0adc5cb4f901332c2 (patch)
tree81c2b9c57ef7f7ea8ec7a7df103bc37ed6b0df5f
parent92484d8fc90f863ac41b062900c2c56190ed61fc (diff)
downloadgpsd-e4c5c7cee02b6536da7f11e0adc5cb4f901332c2.tar.gz
More fluff removal.
-rw-r--r--drivers.c25
-rw-r--r--gps.c3
-rw-r--r--report.c6
-rw-r--r--xgpsspeed.c29
4 files changed, 19 insertions, 44 deletions
diff --git a/drivers.c b/drivers.c
index f0946a5b..a6c8dc59 100644
--- a/drivers.c
+++ b/drivers.c
@@ -16,19 +16,15 @@ void gpsd_NMEA_handle_message(struct gps_session_t *session, char *sentence)
/* visible so the direct-connect clients can use it */
{
gpsd_report(2, "<= GPS: %s\n", sentence);
- if (*sentence == '$')
- {
+ if (*sentence == '$') {
if (nmea_parse(sentence, &session->gNMEAdata) < 0)
gpsd_report(2, "unknown sentence: \"%s\"\n", sentence);
- }
- else
- {
+ } else {
#ifdef NON_NMEA_ENABLE
struct gps_type_t **dp;
/* maybe this is a trigger string for a driver we know about? */
- for (dp = gpsd_drivers; *dp; dp++)
- {
+ for (dp = gpsd_drivers; *dp; dp++) {
char *trigger = (*dp)->trigger;
if (trigger && !strncmp(sentence, trigger, strlen(trigger)) && isatty(session->gNMEAdata.gps_fd)) {
@@ -77,8 +73,7 @@ static int nmea_write_rtcm(struct gps_session_t *session, char *buf, int rtcmbyt
return write(session->gNMEAdata.gps_fd, buf, rtcmbytes);
}
-struct gps_type_t nmea =
-{
+struct gps_type_t nmea = {
'n', /* select explicitly with -T n */
"Generic NMEA", /* full name of type */
NULL, /* no recognition string, it's the default */
@@ -104,8 +99,7 @@ void fv18_initializer(struct gps_session_t *session)
nmea_send(session->gNMEAdata.gps_fd, "$PFEC,GPint,GSA01,DTM00,ZDA00,RMC01,GLL01");
}
-struct gps_type_t fv18 =
-{
+struct gps_type_t fv18 = {
'f', /* select explicitly with -T f */
"San Jose Navigation FV18", /* full name of type */
NULL, /* no recognition string */
@@ -159,8 +153,7 @@ static void tripmate_initializer(struct gps_session_t *session)
}
}
-struct gps_type_t tripmate =
-{
+struct gps_type_t tripmate = {
't', /* select explicitly with -T t */
"Delorme TripMate", /* full name of type */
"ASTRAL", /* tells us to switch */
@@ -209,8 +202,7 @@ static void earthmate_initializer(struct gps_session_t *session)
zodiac_binary.initializer(session);
}
-struct gps_type_t earthmate =
-{
+struct gps_type_t earthmate = {
'e', /* select explicitly with -T e */
"Delorme EarthMate (pre-2003, Zodiac chipset)", /* full name of type */
"EARTHA", /* tells us to switch to Earthmate */
@@ -231,8 +223,7 @@ struct gps_type_t earthmate =
*
**************************************************************************/
-struct gps_type_t logfile =
-{
+struct gps_type_t logfile = {
'l', /* select explicitly with -T l */
"Logfile", /* full name of type */
NULL, /* no recognition string */
diff --git a/gps.c b/gps.c
index 141864a4..3049bb6b 100644
--- a/gps.c
+++ b/gps.c
@@ -398,8 +398,7 @@ int main(int argc, char *argv[])
case 'p':
server = strdup(optarg);
colon = strchr(server, ':');
- if (colon != NULL)
- {
+ if (colon != NULL) {
server[colon - server] = '\0';
port = colon + 1;
}
diff --git a/report.c b/report.c
index bf97134f..63e287ef 100644
--- a/report.c
+++ b/report.c
@@ -1,12 +1,8 @@
-/*
- * Stub function, only here because the linker wants to see it even if
- * a client does not actually require it.
- */
#include <stdio.h>
#include <stdarg.h>
void gpsd_report(int errlevel, const char *fmt, ... )
-/* assemble report in printf(3) style, use stderr or syslog */
+/* stub logger for clients that don't supply one */
{
va_list ap;
diff --git a/xgpsspeed.c b/xgpsspeed.c
index 951c3d59..81f3c094 100644
--- a/xgpsspeed.c
+++ b/xgpsspeed.c
@@ -2,12 +2,10 @@
* - Derrick J Brashear <shadow@dementia.org>
* Tachometer widget from Kerberometer (xklife)
*/
-#include "config.h"
#include <unistd.h>
#include <stdlib.h>
#include <getopt.h>
#include <errno.h>
-
#include <stdio.h>
#include <math.h>
#include <X11/Intrinsic.h>
@@ -19,8 +17,8 @@
#include <X11/Xaw/Paned.h>
#include <Tachometer.h>
+#include "config.h"
#include "xgpsspeed.icon"
-
#include "gps.h"
#if defined(ultrix) || defined(SOLARIS)
@@ -28,7 +26,6 @@ extern double rint();
#endif
static struct gps_data_t *gpsdata;
-
static Widget toplevel, base, tacho, label;
static XrmOptionDescRec options[] = {
@@ -71,8 +68,7 @@ int main(int argc, char **argv)
case 'p':
server = strdup(optarg);
colon = strchr(server, ':');
- if (colon != NULL)
- {
+ if (colon != NULL) {
server[colon - server] = '\0';
port = colon + 1;
}
@@ -94,36 +90,29 @@ int main(int argc, char **argv)
&argc, argv, fallback_resources, NULL);
/**** Shell Widget ****/
- i = 0;
XtSetArg(args[0], XtNiconPixmap,
XCreateBitmapFromData(XtDisplay(toplevel),
XtScreen(toplevel)->root, xgps_bits,
xgps_width, xgps_height)); i++;
- XtSetValues(toplevel, args, i);
+ XtSetValues(toplevel, args, 1);
/**** Form widget ****/
base = XtCreateManagedWidget("pane", panedWidgetClass, toplevel, NULL, 0);
/**** Label widget (Title) ****/
- i = 0;
- XtSetArg(args[i], XtNlabel, "GPS Speedometer"); i++;
- label = XtCreateManagedWidget("title", labelWidgetClass,
- base, args, i);
+ XtSetArg(args[0], XtNlabel, "GPS Speedometer"); i++;
+ label = XtCreateManagedWidget("title", labelWidgetClass, base, args, 1);
/**** Label widget ****/
- i = 0;
- XtSetArg(args[i], XtNlabel, "Miles per Hour"); i++;
- label = XtCreateManagedWidget("name", labelWidgetClass,
- base, args, i);
+ XtSetArg(args[0], XtNlabel, "Miles per Hour"); i++;
+ label = XtCreateManagedWidget("name", labelWidgetClass, base, args, 1);
/**** Tachometer widget ****/
tacho = XtCreateManagedWidget("meter",
tachometerWidgetClass,
- base, NULL, 0);
-
+ base, NULL, 0);
XtRealizeWidget(toplevel);
-
/*
* Essentially all the interface to libgps happens below here
*/
@@ -149,7 +138,7 @@ int main(int argc, char **argv)
void Usage()
{
fprintf(stderr,
- "xgpsspeed <Toolkit Options> [-rv] [-nc needlecolor]\n");
+ "xgpsspeed <Toolkit Options> [-h] [-p server] [-nc needlecolor]\n");
exit(-1);
}