aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrendan Jurd <direvus@gmail.com>2022-03-11 23:56:58 +1100
committerBrendan Jurd <direvus@gmail.com>2022-03-11 23:56:58 +1100
commitf04faeae6c9d3864362816db9b95968e54f95dc4 (patch)
treee917c5ee488a4e2c06f4c374aab093bf667e89c1
parent57b7891e75cc5b069954e4545a71c7f78697852e (diff)
downloadPROJ-f04faeae6c9d3864362816db9b95968e54f95dc4.tar.gz
PROJ-f04faeae6c9d3864362816db9b95968e54f95dc4.zip
Rename variable per PR feedback on #3111.
-rw-r--r--src/conversions/unitconvert.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/conversions/unitconvert.cpp b/src/conversions/unitconvert.cpp
index 5a5042f0..991eb2e0 100644
--- a/src/conversions/unitconvert.cpp
+++ b/src/conversions/unitconvert.cpp
@@ -254,20 +254,20 @@ static double mjd_to_yyyymmdd(double mjd) {
/************************************************************************
Date returned in YYYY-MM-DD format.
************************************************************************/
- unsigned int mjd_iter = 14 + 31;
+ unsigned int date_iter = 14 + 31;
unsigned int year = 1859, month = 0, day = 0;
unsigned int date = (int) lround(mjd);
- for (; date >= mjd_iter; year++) {
- mjd_iter += days_in_year(year);
+ for (; date >= date_iter; year++) {
+ date_iter += days_in_year(year);
}
year--;
- mjd_iter -= days_in_year(year);
+ date_iter -= days_in_year(year);
- for (month=1; mjd_iter + days_in_month(year, month) <= date; month++)
- mjd_iter += days_in_month(year, month);
+ for (month=1; date_iter + days_in_month(year, month) <= date; month++)
+ date_iter += days_in_month(year, month);
- day = date - mjd_iter + 1;
+ day = date - date_iter + 1;
return year*10000.0 + month*100.0 + day;
}