diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2009-09-17 22:27:32 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2009-09-17 22:27:32 +0000 |
commit | 1ff130651422e5d68e7f046d54df3f8606a061f3 (patch) | |
tree | 9931ead9884cbdb1e403fddb85d6ac9da79320e5 /gpsd.c | |
parent | 922975d6696c766a5c96dd3017d026ef9295178e (diff) | |
download | gpsd-1ff130651422e5d68e7f046d54df3f8606a061f3.tar.gz |
Minor code rearrangement, clearing the decks for larger ones.
All regression tests pass.
Diffstat (limited to 'gpsd.c')
-rw-r--r-- | gpsd.c | 42 |
1 files changed, 21 insertions, 21 deletions
@@ -2191,33 +2191,33 @@ int main(int argc, char *argv[]) /* raw hook and relaying functions */ for (channel = channels; channel < channels + NITEMS(channels); channel++) - if (channel->subscriber != NULL && channel->subscriber->policy.raw > 0) - { - /* - * NMEA and other textual sentences are simply copied - * to all clients in raw mode. - */ - if (channel->subscriber != NULL && channel->device != NULL && - strcmp(device->gpsdata.dev.path, channel->device->gpsdata.dev.path)==0) { - if (TEXTUAL_PACKET_TYPE(device->packet.type)) { - (void)throttled_write(channel->subscriber, (char *)device->packet.outbuffer, device->packet.outbuflen); - } else { - char buf2[MAX_PACKET_LENGTH*3+2]; + if (channel->subscriber != NULL + && channel->subscriber->policy.raw > 0 + && channel->device != NULL && + strcmp(device->gpsdata.dev.path, channel->device->gpsdata.dev.path)==0) { + if (TEXTUAL_PACKET_TYPE(device->packet.type)) { + /* + * NMEA and other textual sentences + * are simply copied to all clients in + * raw mode. + */ + (void)throttled_write(channel->subscriber, (char *)device->packet.outbuffer, device->packet.outbuflen); + } else { + char buf2[MAX_PACKET_LENGTH*3+2]; - buf2[0] = '\0'; + buf2[0] = '\0'; - /* Some kinds of data is automatically passed through */ + /* Some kinds of data is automatically passed through */ #ifdef BINARY_ENABLE #if defined(RTCM104V2_ENABLE) || defined(RTCM104V3_ENABLE) - if ((device->gpsdata.set & (RTCM2_SET | RTCM3_SET)) == 0) + if ((device->gpsdata.set & (RTCM2_SET | RTCM3_SET)) == 0) #endif /* defined(RTCM104V2_ENABLE) || defined(RTCM104V3_ENABLE) */ - gpsd_pseudonmea_dump(device, buf2, sizeof(buf2)); + gpsd_pseudonmea_dump(device, buf2, sizeof(buf2)); #endif /* BINARY_ENABLE */ - if (buf2[0] != '\0') { - gpsd_report(LOG_IO, "<= GPS (binary) %s: %s", - device->gpsdata.dev.path, buf2); - (void)throttled_write(channel->subscriber, buf2, strlen(buf2)); - } + if (buf2[0] != '\0') { + gpsd_report(LOG_IO, "<= GPS (binary) %s: %s", + device->gpsdata.dev.path, buf2); + (void)throttled_write(channel->subscriber, buf2, strlen(buf2)); } } } |