aboutsummaryrefslogtreecommitdiff
path: root/src/PJ_aeqd.c
diff options
context:
space:
mode:
authorAaron Puchert <aaron.puchert@sap.com>2017-11-06 17:52:29 +0100
committerAaron Puchert <aaron.puchert@sap.com>2017-11-06 18:04:54 +0100
commitc0c95e33abf2f724e5827cbf41ede41e2939e188 (patch)
treee14c3a6ce8322d3185670ce51d7a376152c25678 /src/PJ_aeqd.c
parente7e86d14f86eb66365d6aa725c5e9b496b3ba7f7 (diff)
downloadPROJ-c0c95e33abf2f724e5827cbf41ede41e2939e188.tar.gz
PROJ-c0c95e33abf2f724e5827cbf41ede41e2939e188.zip
Use enumerations where appropriate
Enumerations have the following advantages over #define: - they clearly connect a variable and the allowed constants, - the meaning of code is not obfuscated by integer values, - they are visible to the compiler, which can warn about (possibly) incorrect usage. There should be no functional change.
Diffstat (limited to 'src/PJ_aeqd.c')
-rw-r--r--src/PJ_aeqd.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/PJ_aeqd.c b/src/PJ_aeqd.c
index f0c813f5..aa1597e4 100644
--- a/src/PJ_aeqd.c
+++ b/src/PJ_aeqd.c
@@ -31,6 +31,13 @@
#include <errno.h>
#include "projects.h"
+enum Mode {
+ N_POLE = 0,
+ S_POLE = 1,
+ EQUIT = 2,
+ OBLIQ = 3,
+};
+
struct pj_opaque {
double sinph0;
double cosph0;
@@ -40,7 +47,7 @@ struct pj_opaque {
double Mp;
double He;
double G;
- int mode;
+ enum Mode mode;
struct geod_geodesic g;
};
@@ -49,11 +56,6 @@ PROJ_HEAD(aeqd, "Azimuthal Equidistant") "\n\tAzi, Sph&Ell\n\tlat_0 guam";
#define EPS10 1.e-10
#define TOL 1.e-14
-#define N_POLE 0
-#define S_POLE 1
-#define EQUIT 2
-#define OBLIQ 3
-
static void *destructor (PJ *P, int errlev) { /* Destructor */
if (0==P)