diff options
| -rw-r--r-- | src/Makefile.am | 2 | ||||
| -rw-r--r-- | src/Makefile.in | 6 | ||||
| -rw-r--r-- | src/dmstor.c | 2 | ||||
| -rw-r--r-- | src/geodesic.h | 1 | ||||
| -rw-r--r-- | src/projects.h | 6 | ||||
| -rw-r--r-- | src/strtod.c | 67 |
6 files changed, 53 insertions, 31 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 1e51f8bd..01ef27ae 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -58,7 +58,7 @@ libproj_la_SOURCES = \ \ nad_cvt.c nad_init.c nad_intr.c emess.c emess.h \ pj_apply_gridshift.c pj_datums.c pj_datum_set.c pj_transform.c \ - geocent.c geocent.h + geocent.c geocent.h strtod.c install-exec-local: diff --git a/src/Makefile.in b/src/Makefile.in index 546f44ec..f85d15d3 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -96,7 +96,7 @@ lib_LTLIBRARIES = libproj.la libproj_la_LDFLAGS = -version-info 1:0:1 -libproj_la_SOURCES = projects.h pj_list.h PJ_aeqd.c PJ_gnom.c PJ_laea.c PJ_mod_ster.c PJ_nsper.c PJ_nzmg.c PJ_ortho.c PJ_stere.c PJ_aea.c PJ_bipc.c PJ_bonne.c PJ_eqdc.c PJ_imw_p.c PJ_lcc.c PJ_mpoly.c PJ_poly.c PJ_rpoly.c PJ_sconics.c PJ_cass.c PJ_cc.c PJ_cea.c PJ_eqc.c PJ_gall.c PJ_labrd.c PJ_lsat.c PJ_merc.c PJ_mill.c PJ_ocea.c PJ_omerc.c PJ_somerc.c PJ_tcc.c PJ_tcea.c PJ_tmerc.c PJ_airy.c PJ_aitoff.c PJ_august.c PJ_bacon.c PJ_chamb.c PJ_hammer.c PJ_lagrng.c PJ_larr.c PJ_lask.c PJ_nocol.c PJ_ob_tran.c PJ_oea.c PJ_tpeqd.c PJ_vandg.c PJ_vandg2.c PJ_vandg4.c PJ_wag7.c PJ_boggs.c PJ_collg.c PJ_crast.c PJ_denoy.c PJ_eck1.c PJ_eck2.c PJ_eck3.c PJ_eck4.c PJ_eck5.c PJ_fahey.c PJ_fouc_s.c PJ_gins8.c PJ_gn_sinu.c PJ_goode.c PJ_hatano.c PJ_loxim.c PJ_mbt_fps.c PJ_mbtfpp.c PJ_mbtfpq.c PJ_moll.c PJ_nell.c PJ_nell_h.c PJ_putp2.c PJ_putp3.c PJ_putp4p.c PJ_putp5.c PJ_putp6.c PJ_robin.c PJ_sts.c PJ_urm5.c PJ_urmfps.c PJ_wag2.c PJ_wag3.c PJ_wink1.c PJ_wink2.c pj_latlong.c aasincos.c adjlon.c bch2bps.c bchgen.c biveval.c dmstor.c mk_cheby.c pj_auth.c pj_deriv.c pj_ell_set.c pj_ellps.c pj_errno.c pj_factors.c pj_fwd.c pj_init.c pj_inv.c pj_list.c pj_malloc.c pj_mlfn.c pj_msfn.c pj_open_lib.c pj_param.c pj_phi2.c pj_pr_list.c pj_qsfn.c pj_strerrno.c pj_tsfn.c pj_units.c pj_zpoly1.c rtodms.c vector1.c pj_release.c nad_cvt.c nad_init.c nad_intr.c emess.c emess.h pj_apply_gridshift.c pj_datums.c pj_datum_set.c pj_transform.c geocent.c geocent.h +libproj_la_SOURCES = projects.h pj_list.h PJ_aeqd.c PJ_gnom.c PJ_laea.c PJ_mod_ster.c PJ_nsper.c PJ_nzmg.c PJ_ortho.c PJ_stere.c PJ_aea.c PJ_bipc.c PJ_bonne.c PJ_eqdc.c PJ_imw_p.c PJ_lcc.c PJ_mpoly.c PJ_poly.c PJ_rpoly.c PJ_sconics.c PJ_cass.c PJ_cc.c PJ_cea.c PJ_eqc.c PJ_gall.c PJ_labrd.c PJ_lsat.c PJ_merc.c PJ_mill.c PJ_ocea.c PJ_omerc.c PJ_somerc.c PJ_tcc.c PJ_tcea.c PJ_tmerc.c PJ_airy.c PJ_aitoff.c PJ_august.c PJ_bacon.c PJ_chamb.c PJ_hammer.c PJ_lagrng.c PJ_larr.c PJ_lask.c PJ_nocol.c PJ_ob_tran.c PJ_oea.c PJ_tpeqd.c PJ_vandg.c PJ_vandg2.c PJ_vandg4.c PJ_wag7.c PJ_boggs.c PJ_collg.c PJ_crast.c PJ_denoy.c PJ_eck1.c PJ_eck2.c PJ_eck3.c PJ_eck4.c PJ_eck5.c PJ_fahey.c PJ_fouc_s.c PJ_gins8.c PJ_gn_sinu.c PJ_goode.c PJ_hatano.c PJ_loxim.c PJ_mbt_fps.c PJ_mbtfpp.c PJ_mbtfpq.c PJ_moll.c PJ_nell.c PJ_nell_h.c PJ_putp2.c PJ_putp3.c PJ_putp4p.c PJ_putp5.c PJ_putp6.c PJ_robin.c PJ_sts.c PJ_urm5.c PJ_urmfps.c PJ_wag2.c PJ_wag3.c PJ_wink1.c PJ_wink2.c pj_latlong.c aasincos.c adjlon.c bch2bps.c bchgen.c biveval.c dmstor.c mk_cheby.c pj_auth.c pj_deriv.c pj_ell_set.c pj_ellps.c pj_errno.c pj_factors.c pj_fwd.c pj_init.c pj_inv.c pj_list.c pj_malloc.c pj_mlfn.c pj_msfn.c pj_open_lib.c pj_param.c pj_phi2.c pj_pr_list.c pj_qsfn.c pj_strerrno.c pj_tsfn.c pj_units.c pj_zpoly1.c rtodms.c vector1.c pj_release.c nad_cvt.c nad_init.c nad_intr.c emess.c emess.h pj_apply_gridshift.c pj_datums.c pj_datum_set.c pj_transform.c geocent.c geocent.h strtod.c mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_HEADER = proj_config.h @@ -132,7 +132,7 @@ pj_open_lib.lo pj_param.lo pj_phi2.lo pj_pr_list.lo pj_qsfn.lo \ pj_strerrno.lo pj_tsfn.lo pj_units.lo pj_zpoly1.lo rtodms.lo vector1.lo \ pj_release.lo nad_cvt.lo nad_init.lo nad_intr.lo emess.lo \ pj_apply_gridshift.lo pj_datums.lo pj_datum_set.lo pj_transform.lo \ -geocent.lo +geocent.lo strtod.lo PROGRAMS = $(bin_PROGRAMS) proj_OBJECTS = proj.o gen_cheb.o p_series.o @@ -200,7 +200,7 @@ DEP_FILES = .deps/PJ_aea.P .deps/PJ_aeqd.P .deps/PJ_airy.P \ .deps/pj_phi2.P .deps/pj_pr_list.P .deps/pj_qsfn.P .deps/pj_release.P \ .deps/pj_strerrno.P .deps/pj_transform.P .deps/pj_tsfn.P \ .deps/pj_units.P .deps/pj_zpoly1.P .deps/proj.P .deps/rtodms.P \ -.deps/vector1.P +.deps/strtod.P .deps/vector1.P SOURCES = $(libproj_la_SOURCES) $(proj_SOURCES) $(nad2nad_SOURCES) $(nad2bin_SOURCES) $(geod_SOURCES) $(cs2cs_SOURCES) OBJECTS = $(libproj_la_OBJECTS) $(proj_OBJECTS) $(nad2nad_OBJECTS) $(nad2bin_OBJECTS) $(geod_OBJECTS) $(cs2cs_OBJECTS) diff --git a/src/dmstor.c b/src/dmstor.c index 5b4bccf1..44ce5e37 100644 --- a/src/dmstor.c +++ b/src/dmstor.c @@ -36,7 +36,7 @@ dmstor(const char *is, char **rs) { else sign = '+'; for (v = 0., nl = 0 ; nl < 3 ; nl = n + 1 ) { if (!(isdigit(*s) || *s == '.')) break; - if ((tv = strtod(s, &s)) == HUGE_VAL) + if ((tv = proj_strtod(s, &s)) == HUGE_VAL) return tv; switch (*s) { case 'D': case 'd': diff --git a/src/geodesic.h b/src/geodesic.h index a779c879..fc161f3b 100644 --- a/src/geodesic.h +++ b/src/geodesic.h @@ -7,6 +7,7 @@ extern "C" { #endif extern double dmstor(); +double proj_strtod(const char *, char **); struct geodesic { double A; double LAM1, PHI1, ALPHA12; diff --git a/src/projects.h b/src/projects.h index 1c65d499..76e20162 100644 --- a/src/projects.h +++ b/src/projects.h @@ -28,6 +28,9 @@ ****************************************************************************** * * $Log$ + * Revision 1.6 2000/11/30 03:37:22 warmerda + * use proj_strtod() in dmstor() + * * Revision 1.5 2000/07/06 23:36:47 warmerda * added lots of datum related stuff * @@ -270,7 +273,8 @@ struct CTABLE { FLP *cvs; /* conversion matrix */ }; /* procedure prototypes */ -double dmstor(const char *, char **); +double dmstor(const char *, char **); +double proj_strtod( const char *, char ** ); void set_rtodms(int, int); char *rtodms(char *, double, int, int); double adjlon(double); diff --git a/src/strtod.c b/src/strtod.c index 1a6b3e19..3347cf62 100644 --- a/src/strtod.c +++ b/src/strtod.c @@ -1,26 +1,41 @@ -#ifndef lint -static const char SCCSID[]="@(#)strtod.c 4.5 93/12/03 GIE REL"; -#endif -/* THIS CODE HAS BEEN MODIFIED from the distribution made by the FSF. -** However, "licensing" and header information are retained. -*/ -/* Copyright (C) 1991, 1992 Free Software Foundation, Inc. -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ +/****************************************************************************** + * $Id$ + * + * Project: PROJ.4 + * Purpose: strtod() substitute. This is used because the strtod() on + * some platforms (notably the Microsoft VC++ strtod()) chooses + * to interprete values such as "15d10" as expontial values causing + * severe problems for dmstor(). + * Author: Free Software Foundation. + * + ****************************************************************************** + * THIS CODE HAS BEEN MODIFIED from the distribution made by the FSF. + * However, "licensing" and header information are retained. + * + * Copyright (C) 1991, 1992 Free Software Foundation, Inc. + * This file is part of the GNU C Library. + * + * The GNU C Library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * The GNU C Library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with the GNU C Library; see the file COPYING.LIB. If + * not, write to the Free Software Foundation, Inc., 675 Mass Ave, + * Cambridge, MA 02139, USA. + ****************************************************************************** + * + * $Log$ + * Revision 1.2 2000/11/30 03:37:22 warmerda + * use proj_strtod() in dmstor() + * + */ #include <errno.h> #include <float.h> @@ -28,6 +43,7 @@ Cambridge, MA 02139, USA. */ #include <stdlib.h> #include <string.h> #include <math.h> + /* Convert NPTR to a double. If ENDPTR is not NULL, a pointer to the character after the last one used in the number is put in *ENDPTR. */ #ifdef DOS @@ -36,8 +52,9 @@ typedef int wchar_t; #define NULL 0 #endif #endif - double -strtod(const char *nptr, char **endptr) { + +double +proj_strtod(const char *nptr, char **endptr) { const char *s; short int sign; /* The number so far. */ |
