From: asterix Date: Thu, 8 Oct 2009 15:01:39 +0000 (+0000) Subject: Reformat code. X-Git-Tag: 2.3.0~35 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=efc33d8c4107aa7e95b20c4728836df4171e17a9;p=bertos.git Reformat code. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3048 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/bertos/net/nmea.c b/bertos/net/nmea.c index 9f2d67d8..93985e79 100644 --- a/bertos/net/nmea.c +++ b/bertos/net/nmea.c @@ -51,6 +51,7 @@ #include #include #include +#include static uint32_t tokenToInt(const char *s, int precision) @@ -112,20 +113,13 @@ static udegree_t nmea_latitude(const char *plat, const char *phem) int ns; if (*phem == 0) - { return 0; - } - /* north lat is +, south lat is - */ if (*phem == 'N') - { ns = 1; - } else - { ns = -1; - } return ns * convertToDegree(plat); @@ -135,19 +129,14 @@ static udegree_t nmea_longitude(const char *plot, const char *phem) { int ew; + if (*phem == 0) + return 0; + /* west long is negative, east long is positive */ if (*phem == 'E') - { ew = 1; - } - else { + else ew = -1; - } - - if (*phem == 0) - { - return 0; - } return ew * convertToDegree(plot); } @@ -157,9 +146,7 @@ static uint16_t nmea_altitude(const char *palt, const char *punits) uint32_t alt; if (*palt == 0) - { return 0; - } alt = atoi(palt);