[GRASS-SVN] r53676 - in grass/trunk: include/defs lib/proj

svn_grass at osgeo.org svn_grass at osgeo.org
Sat Nov 3 09:50:05 PDT 2012


Author: glynn
Date: 2012-11-03 09:50:04 -0700 (Sat, 03 Nov 2012)
New Revision: 53676

Modified:
   grass/trunk/include/defs/gprojects.h
   grass/trunk/lib/proj/convert.c
   grass/trunk/lib/proj/datum.c
   grass/trunk/lib/proj/do_proj.c
   grass/trunk/lib/proj/ellipse.c
   grass/trunk/lib/proj/get_proj.c
Log:
Add "const" to function parameters where appropriate


Modified: grass/trunk/include/defs/gprojects.h
===================================================================
--- grass/trunk/include/defs/gprojects.h	2012-11-03 14:48:53 UTC (rev 53675)
+++ grass/trunk/include/defs/gprojects.h	2012-11-03 16:50:04 UTC (rev 53676)
@@ -2,21 +2,21 @@
 #define GRASS_GPROJECTSDEFS_H
 
 /* do_proj.c */
-int pj_do_proj(double *, double *, struct pj_info *, struct pj_info *);
+int pj_do_proj(double *, double *, const struct pj_info *, const struct pj_info *);
 int pj_do_transform(int, double *, double *, double *,
-		    struct pj_info *, struct pj_info *);
+		    const struct pj_info *, const struct pj_info *);
 
 /* get_proj.c */
-int pj_get_kv(struct pj_info *, struct Key_Value *, struct Key_Value *);
+int pj_get_kv(struct pj_info *, const struct Key_Value *, const struct Key_Value *);
 int pj_get_string(struct pj_info *, char *);
 int GPJ_get_equivalent_latlong(struct pj_info *, struct pj_info *);
 const char *set_proj_lib(const char *);
-int pj_print_proj_params(struct pj_info *, struct pj_info *);
+int pj_print_proj_params(const struct pj_info *, const struct pj_info *);
 
 /* convert.c */
-char *GPJ_grass_to_wkt(struct Key_Value *, struct Key_Value *, int, int);
+char *GPJ_grass_to_wkt(const struct Key_Value *, const struct Key_Value *, int, int);
 #ifdef HAVE_OGR
-OGRSpatialReferenceH GPJ_grass_to_osr(struct Key_Value *, struct Key_Value *);
+OGRSpatialReferenceH GPJ_grass_to_osr(const struct Key_Value *, const struct Key_Value *);
 const char *GPJ_set_csv_loc(const char *);
 int GPJ_osr_to_grass(struct Cell_head *, struct Key_Value **,
 		     struct Key_Value **, OGRSpatialReferenceH, int);
@@ -28,7 +28,7 @@
 int GPJ_get_datum_by_name(const char *, struct gpj_datum *);
 int GPJ_get_default_datum_params_by_name(const char *, char **);
 int GPJ_get_datum_params(char **, char **);
-int GPJ__get_datum_params(struct Key_Value *, char **, char **);
+int GPJ__get_datum_params(const struct Key_Value *, char **, char **);
 void GPJ_free_datum(struct gpj_datum *);
 struct gpj_datum_transform_list *GPJ_get_datum_transform_by_name(const char *);
 void GPJ_free_datum_transform(struct gpj_datum_transform_list *);
@@ -36,7 +36,7 @@
 /* ellipse.c */
 int GPJ_get_ellipsoid_by_name(const char *, struct gpj_ellps *);
 int GPJ_get_ellipsoid_params(double *, double *, double *);
-int GPJ__get_ellipsoid_params(struct Key_Value *,
+int GPJ__get_ellipsoid_params(const struct Key_Value *,
 			      double *, double *, double *);
 void GPJ_free_ellps(struct gpj_ellps *);
 

Modified: grass/trunk/lib/proj/convert.c
===================================================================
--- grass/trunk/lib/proj/convert.c	2012-11-03 14:48:53 UTC (rev 53675)
+++ grass/trunk/lib/proj/convert.c	2012-11-03 16:50:04 UTC (rev 53676)
@@ -52,8 +52,8 @@
  *         WKT format
  * \return NULL on error
  */
-char *GPJ_grass_to_wkt(struct Key_Value *proj_info,
-		       struct Key_Value *proj_units,
+char *GPJ_grass_to_wkt(const struct Key_Value *proj_info,
+		       const struct Key_Value *proj_units,
 		       int esri_style, int prettify)
 {
 #ifdef HAVE_OGR
@@ -94,8 +94,8 @@
  * \return OGRSpatialReferenceH object representing the co-ordinate system
  *         defined by proj_info and proj_units or NULL if it fails
  */
-OGRSpatialReferenceH GPJ_grass_to_osr(struct Key_Value * proj_info,
-				      struct Key_Value * proj_units)
+OGRSpatialReferenceH GPJ_grass_to_osr(const struct Key_Value * proj_info,
+				      const struct Key_Value * proj_units)
 {
     struct pj_info pjinfo;
     char *proj4, *proj4mod, *wkt, *modwkt, *startmod, *lastpart;

Modified: grass/trunk/lib/proj/datum.c
===================================================================
--- grass/trunk/lib/proj/datum.c	2012-11-03 14:48:53 UTC (rev 53675)
+++ grass/trunk/lib/proj/datum.c	2012-11-03 16:50:04 UTC (rev 53676)
@@ -170,7 +170,7 @@
  * 
  **/
 
-int GPJ__get_datum_params(struct Key_Value *projinfo,
+int GPJ__get_datum_params(const struct Key_Value *projinfo,
 			  char **datumname, char **params)
 {
     int returnval = -1;

Modified: grass/trunk/lib/proj/do_proj.c
===================================================================
--- grass/trunk/lib/proj/do_proj.c	2012-11-03 14:48:53 UTC (rev 53675)
+++ grass/trunk/lib/proj/do_proj.c	2012-11-03 16:50:04 UTC (rev 53676)
@@ -61,7 +61,7 @@
  **/
 
 int pj_do_proj(double *x, double *y,
-	       struct pj_info *info_in, struct pj_info *info_out)
+	       const struct pj_info *info_in, const struct pj_info *info_out)
 {
     int ok;
     double u, v;
@@ -132,7 +132,7 @@
  **/
 
 int pj_do_transform(int count, double *x, double *y, double *h,
-		    struct pj_info *info_in, struct pj_info *info_out)
+		    const struct pj_info *info_in, const struct pj_info *info_out)
 {
     int ok;
     int has_h = 1;

Modified: grass/trunk/lib/proj/ellipse.c
===================================================================
--- grass/trunk/lib/proj/ellipse.c	2012-11-03 14:48:53 UTC (rev 53675)
+++ grass/trunk/lib/proj/ellipse.c	2012-11-03 16:50:04 UTC (rev 53676)
@@ -49,7 +49,7 @@
 }
 
 int
-GPJ__get_ellipsoid_params(struct Key_Value *proj_keys,
+GPJ__get_ellipsoid_params(const struct Key_Value *proj_keys,
 			  double *a, double *e2, double *rf)
 {
     struct gpj_ellps estruct;

Modified: grass/trunk/lib/proj/get_proj.c
===================================================================
--- grass/trunk/lib/proj/get_proj.c	2012-11-03 14:48:53 UTC (rev 53675)
+++ grass/trunk/lib/proj/get_proj.c	2012-11-03 16:50:04 UTC (rev 53676)
@@ -56,8 +56,8 @@
  *          1 otherwise
  **/
 
-int pj_get_kv(struct pj_info *info, struct Key_Value *in_proj_keys,
-	      struct Key_Value *in_units_keys)
+int pj_get_kv(struct pj_info *info, const struct Key_Value *in_proj_keys,
+	      const struct Key_Value *in_units_keys)
 {
     const char *str;
     int i;
@@ -391,7 +391,7 @@
  *         returned NULL for either co-ordinate system)
  **/
 
-int pj_print_proj_params(struct pj_info *iproj, struct pj_info *oproj)
+int pj_print_proj_params(const struct pj_info *iproj, const struct pj_info *oproj)
 {
     char *str;
 



More information about the grass-commit mailing list