From 526fe4975e789e3437646adbe86608616eac21fe Mon Sep 17 00:00:00 2001 From: Kristian Evers Date: Wed, 10 Oct 2018 21:11:05 +0200 Subject: Move struct definitions for proj_list_* functions to proj.h With projects.h not being available to outside users anymore we need to define PJ_UNITS, PJ_ELLPS, PJ_PRIME_MERIDIANS and PJ_OPERATIONS elsewhere. Related pj_get_*_ref() functions have been removed in favour of their proj_ namespaced counterparts. char pointers have been changed to const char pointers. Resolves #983 Resolved #1147 Make char pointers const --- src/PJ_unitconvert.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/PJ_unitconvert.c') diff --git a/src/PJ_unitconvert.c b/src/PJ_unitconvert.c index 6e53f6df..e3824c20 100644 --- a/src/PJ_unitconvert.c +++ b/src/PJ_unitconvert.c @@ -401,17 +401,20 @@ static double get_unit_conversion_factor(const char* name, /***********************************************************************/ int i; const char* s; + const PJ_UNITS *units; + + units = proj_list_units(); /* Try first with linear units */ - for (i = 0; (s = pj_units[i].id) ; ++i) { + for (i = 0; (s = units[i].id) ; ++i) { if ( strcmp(s, name) == 0 ) { if( p_normalized_name ) { - *p_normalized_name = pj_units[i].name; + *p_normalized_name = units[i].name; } if( p_is_linear ) { *p_is_linear = 1; } - return pj_units[i].factor; + return units[i].factor; } } -- cgit v1.2.3