From: Willem Toorop Date: Mon, 14 Jun 2021 09:52:12 +0000 (+0200) Subject: Rename northerness and easterness variables X-Git-Tag: 1.8.0-rc.1~25^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a0aa797fd28be5400668083de7e72c730c21b16;p=thirdparty%2Fldns.git Rename northerness and easterness variables In something meaningful with existing (instead of made up) words. --- diff --git a/host2str.c b/host2str.c index 3765bcb4..c98bb738 100644 --- a/host2str.c +++ b/host2str.c @@ -713,8 +713,8 @@ ldns_rdf2buffer_str_loc(ldns_buffer *output, const ldns_rdf *rdf) uint32_t longitude; uint32_t latitude; uint32_t altitude; - char northerness; - char easterness; + char latitude_hemisphere; + char longitude_hemisphere; uint32_t h; uint32_t m; double s; @@ -738,10 +738,10 @@ ldns_rdf2buffer_str_loc(ldns_buffer *output, const ldns_rdf *rdf) altitude = ldns_read_uint32(&ldns_rdf_data(rdf)[12]); if (latitude > equator) { - northerness = 'N'; + latitude_hemisphere = 'N'; latitude = latitude - equator; } else { - northerness = 'S'; + latitude_hemisphere = 'S'; latitude = equator - latitude; } h = latitude / (1000 * 60 * 60); @@ -750,13 +750,13 @@ ldns_rdf2buffer_str_loc(ldns_buffer *output, const ldns_rdf *rdf) latitude = latitude % (1000 * 60); s = (double) latitude / 1000.0; ldns_buffer_printf(output, "%02u %02u %0.3f %c ", - h, m, s, northerness); + h, m, s, latitude_hemisphere); if (longitude > equator) { - easterness = 'E'; + longitude_hemisphere = 'E'; longitude = longitude - equator; } else { - easterness = 'W'; + longitude_hemisphere = 'W'; longitude = equator - longitude; } h = longitude / (1000 * 60 * 60); @@ -765,8 +765,7 @@ ldns_rdf2buffer_str_loc(ldns_buffer *output, const ldns_rdf *rdf) longitude = longitude % (1000 * 60); s = (double) longitude / (1000.0); ldns_buffer_printf(output, "%02u %02u %0.3f %c ", - h, m, s, easterness); - + h, m, s, longitude_hemisphere); s = ((double) altitude) / 100; s -= 100000; diff --git a/str2host.c b/str2host.c index e114213c..7f424b40 100644 --- a/str2host.c +++ b/str2host.c @@ -926,8 +926,8 @@ ldns_str2rdf_loc(ldns_rdf **rd, const char *str) uint8_t vert_pre_b = 1, vert_pre_e = 3; double s = 0.0; - bool northerness; - bool easterness; + bool northern_hemisphere; + bool eastern_hemisphere; char *my_str = (char *) str; @@ -963,9 +963,9 @@ north: } if (*my_str == 'N') { - northerness = true; + northern_hemisphere = true; } else if (*my_str == 'S') { - northerness = false; + northern_hemisphere = false; } else { return LDNS_STATUS_INVALID_STR; } @@ -979,7 +979,7 @@ north: latitude = (uint32_t) s; latitude += 1000 * 60 * m; latitude += 1000 * 60 * 60 * h; - if (northerness) { + if (northern_hemisphere) { latitude = equator + latitude; } else { latitude = equator - latitude; @@ -1020,9 +1020,9 @@ east: } if (*my_str == 'E') { - easterness = true; + eastern_hemisphere = true; } else if (*my_str == 'W') { - easterness = false; + eastern_hemisphere = false; } else { return LDNS_STATUS_INVALID_STR; } @@ -1037,7 +1037,7 @@ east: longitude += 1000 * 60 * m; longitude += 1000 * 60 * 60 * h; - if (easterness) { + if (eastern_hemisphere) { longitude += equator; } else { longitude = equator - longitude;