[GRASS-SVN] r31994 - in grass/trunk: include lib/g3d lib/ogsf

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jul 4 15:52:02 EDT 2008


Author: glynn
Date: 2008-07-04 15:52:02 -0400 (Fri, 04 Jul 2008)
New Revision: 31994

Modified:
   grass/trunk/include/G3d.h
   grass/trunk/include/ogsf_proto.h
   grass/trunk/lib/g3d/find_grid3.c
   grass/trunk/lib/g3d/g3dcolor.c
   grass/trunk/lib/g3d/g3dopen.c
   grass/trunk/lib/g3d/g3drange.c
   grass/trunk/lib/ogsf/GK2.c
   grass/trunk/lib/ogsf/GP2.c
   grass/trunk/lib/ogsf/GS2.c
   grass/trunk/lib/ogsf/GS_util.c
   grass/trunk/lib/ogsf/GV2.c
   grass/trunk/lib/ogsf/GVL2.c
   grass/trunk/lib/ogsf/Gp3.c
   grass/trunk/lib/ogsf/Gs3.c
   grass/trunk/lib/ogsf/Gv3.c
   grass/trunk/lib/ogsf/Gvl3.c
   grass/trunk/lib/ogsf/gs.c
   grass/trunk/lib/ogsf/gsd_fonts.c
   grass/trunk/lib/ogsf/gsd_label.c
   grass/trunk/lib/ogsf/gsd_legend.c
   grass/trunk/lib/ogsf/gsd_objs.c
   grass/trunk/lib/ogsf/gsds.c
   grass/trunk/lib/ogsf/gvl.c
   grass/trunk/lib/ogsf/gvl_calc.c
   grass/trunk/lib/ogsf/gvl_file.c
   grass/trunk/lib/ogsf/gvld.c
Log:
Add "const" to OGSF, G3D functions where appropriate


Modified: grass/trunk/include/G3d.h
===================================================================
--- grass/trunk/include/G3d.h	2008-07-04 12:12:32 UTC (rev 31993)
+++ grass/trunk/include/G3d.h	2008-07-04 19:52:02 UTC (rev 31994)
@@ -265,7 +265,7 @@
 /* grass/src/libes/g3d/filename.c */
 void G3d_filename(char *, char *, char *, char *);
 /* grass/src/libes/g3d/find_grid3.c */
-char *G_find_grid3(char *, char *);
+char *G_find_grid3(const char *, const char *);
 /* grass/src/libes/g3d/fpcompress.c */
 void G_fpcompress_printBinary(char *, int);
 void G_fpcompress_dissectXdrDouble(unsigned char *);
@@ -289,9 +289,9 @@
 /* grass/src/libes/g3d/g3dclose.c */
 int G3d_closeCell(G3D_Map *);
 /* grass/src/libes/g3d/g3dcolor.c */
-int G3d_removeColor(char *);
-int G3d_readColors(char *, char *, struct Colors *);
-int G3d_writeColors(char *, char *, struct Colors *);
+int G3d_removeColor(const char *);
+int G3d_readColors(const char *, const char *, struct Colors *);
+int G3d_writeColors(const char *, const char *, struct Colors *);
 /* grass/src/libes/g3d/g3ddefaults.c */
 void G3d_setCompressionMode(int, int, int, int);
 void G3d_getCompressionMode(int *, int *, int *, int *);
@@ -375,9 +375,9 @@
 void G3d_setNullValue(void *, int, int);
 /* grass/src/libes/g3d/g3dopen2.c */
 /* grass/src/libes/g3d/g3dopen.c */
-void *G3d_openCellOldNoHeader(char *, char *);
-void * G3d_openCellOld (char *, char * , G3D_Region *, int, int);
-void * G3d_openCellNew (char *, int, int, G3D_Region * );
+void *G3d_openCellOldNoHeader(const char *, const char *);
+void * G3d_openCellOld (const char *, const char * , G3D_Region *, int, int);
+void * G3d_openCellNew (const char *, int, int, G3D_Region * );
 /* grass/src/libes/g3d/g3dparam.c */
 void G3d_setStandard3dInputParams(void);
 int G3d_getStandard3dParams(int *, int *, int *, int *, int *, int *, int *, int *, int *, int *, int *, int *);
@@ -385,7 +385,7 @@
 char *G3d_getWindowParams(void);
 /* grass/src/libes/g3d/g3drange.c */
 void G3d_range_updateFromTile(G3D_Map *, char *, int, int, int, int, int, int, int, int);
-int G3d_readRange(char *, char *, struct FPRange *);
+int G3d_readRange(const char *, const char *, struct FPRange *);
 int G3d_range_load(G3D_Map *);
 void G3d_range_min_max(G3D_Map *, double *, double *);
 int G3d_range_write(G3D_Map *);

Modified: grass/trunk/include/ogsf_proto.h
===================================================================
--- grass/trunk/include/ogsf_proto.h	2008-07-04 12:12:32 UTC (rev 31993)
+++ grass/trunk/include/ogsf_proto.h	2008-07-04 19:52:02 UTC (rev 31994)
@@ -42,7 +42,7 @@
 void GK_update_frames(void);
 void GK_set_numsteps(int);
 void GK_clear_keys(void);
-void GK_print_keys(char *);
+void GK_print_keys(const char *);
 int GK_move_key(float, float, float);
 int GK_delete_key(float, float, int);
 int GK_add_key(float, unsigned long, int, float);
@@ -59,11 +59,11 @@
 int GP_num_sites(void);
 int *GP_get_site_list(int *);
 int GP_delete_site(int);
-int GP_load_site(int, char *);
+int GP_load_site(int, const char *);
 int GP_get_sitename(int, char *);
 int GP_get_sitemode(int, int *, int *, int *, float *, int *);
 int GP_set_sitemode(int, int, int, int, float, int);
-int GP_attmode_color(int, char *);
+int GP_attmode_color(int, const char *);
 int GP_attmode_none(int);
 int GP_set_zmode(int, int);
 int GP_get_zmode(int, int *);
@@ -123,7 +123,7 @@
 int GS_num_surfs(void);
 int *GS_get_surf_list(int *);
 int GS_delete_surface(int);
-int GS_load_att_map(int, char *, int);
+int GS_load_att_map(int, const char *, int);
 void GS_draw_surf(int);
 void GS_draw_wire(int);
 void GS_alldraw_wire(void);
@@ -186,8 +186,8 @@
 void GS_set_fencecolor(int);
 int GS_get_fencecolor(void);
 int GS_get_distance_alongsurf(int, float, float, float, float, float *, int);
-int GS_save_3dview(char *, int);
-int GS_load_3dview(char *, int);
+int GS_save_3dview(const char *, int);
+int GS_load_3dview(const char *, int);
 void GS_init_view(void);
 void GS_clear(int);
 double GS_get_aspect(void);
@@ -196,7 +196,7 @@
 int GS_write_zoom(const char *, unsigned int, unsigned int);
 void GS_draw_all_list(void);
 void GS_delete_list(GLuint);
-int GS_draw_legend(char *, GLuint, int, int *, float *, int *);
+int GS_draw_legend(const char *, GLuint, int, int *, float *, int *);
 void GS_draw_fringe(int, unsigned long, float, int *);
 void GS_getlight_position(int, float *, float *, float *, int *);
 void GS_getlight_color(int, float *, float *, float *);
@@ -209,7 +209,7 @@
 void GS_set_swap_func(void (*)(void));
 
 /* From GS_util.c */
-double GS_geodistance (double *, double *, char *);
+double GS_geodistance (double *, double *, const char *);
 float GS_distance (float *, float *);
 float GS_P2distance (float *, float *);
 void GS_v3eq(float *, float *);
@@ -232,7 +232,7 @@
 int GV_num_vects(void);
 int *GV_get_vect_list(int *);
 int GV_delete_vector(int);
-int GV_load_vector(int, char *);
+int GV_load_vector(int, const char *);
 int GV_get_vectname(int, char *);
 int GV_set_vectmode(int, int, int, int, int);
 int GV_get_vectmode(int, int *, int *, int *, int *);
@@ -256,7 +256,7 @@
 int GVL_num_vols(void);
 int *GVL_get_vol_list(int *);
 int GVL_delete_vol(int);
-int GVL_load_vol(int, char *);
+int GVL_load_vol(int, const char *);
 int GVL_get_volname(int, char *);
 void GVL_set_trans(int, float, float, float);
 int GVL_get_trans(int, float *, float *, float *);
@@ -279,7 +279,7 @@
 int GVL_isosurf_get_att(int, int, int, int *, float *, char *);
 int GVL_isosurf_unset_att(int, int, int);
 int GVL_isosurf_set_att_const(int, int, int, float);
-int GVL_isosurf_set_att_map(int, int, int, char *);
+int GVL_isosurf_set_att_map(int, int, int, const char *);
 int GVL_isosurf_get_flags(int, int, int *);
 int GVL_isosurf_set_flags(int, int, int);
 int GVL_isosurf_num_isosurfs(int);
@@ -301,34 +301,33 @@
 int GVL_slice_set_pos(int, int, float, float, float, float, float, float, int);
 
 /* From Gp3.c */
-int Gp_set_color(char *, geopoint *);
-geopoint *Gp_load_sites(char *, int *, int *, int *);
+int Gp_set_color(const char *, geopoint *);
+geopoint *Gp_load_sites(const char *, int *, int *, int *);
 
 /* From Gs3.c */
-void Gs_warning(char *);
-void Gs_status(char *);
+void Gs_status(const char *);
 double Gs_distance(double *, double *);
-int Gs_loadmap_as_float(struct Cell_head *, char *, float *, struct BM *,
+int Gs_loadmap_as_float(struct Cell_head *, const char *, float *, struct BM *,
     int *);
-int Gs_loadmap_as_int(struct Cell_head *, char *, int *, struct BM *, int *);
-int Gs_numtype(char *, int *);
-int Gs_loadmap_as_short(struct Cell_head *, char *, short *, struct BM *,
+int Gs_loadmap_as_int(struct Cell_head *, const char *, int *, struct BM *, int *);
+int Gs_numtype(const char *, int *);
+int Gs_loadmap_as_short(struct Cell_head *, const char *, short *, struct BM *,
     int *);
-int Gs_loadmap_as_char(struct Cell_head *, char *, unsigned char *,
+int Gs_loadmap_as_char(struct Cell_head *, const char *, unsigned char *,
     struct BM *, int *);
-int Gs_loadmap_as_bitmap(struct Cell_head *, char *, struct BM *);
-int Gs_build_256lookup(char *, int *);
-void Gs_pack_colors(char *, int *, int, int);
-void Gs_pack_colors_float(char *, float *, int *, int, int);
-int Gs_get_cat_label(char *, int, int, char *);
-int Gs_save_3dview(char *, geoview *, geodisplay *, struct Cell_head *,
+int Gs_loadmap_as_bitmap(struct Cell_head *, const char *, struct BM *);
+int Gs_build_256lookup(const char *, int *);
+void Gs_pack_colors(const char *, int *, int, int);
+void Gs_pack_colors_float(const char *, float *, int *, int, int);
+int Gs_get_cat_label(const char *, int, int, char *);
+int Gs_save_3dview(const char *, geoview *, geodisplay *, struct Cell_head *,
     geosurf *);
-int Gs_load_3dview(char *, geoview *, geodisplay *, struct Cell_head *,
+int Gs_load_3dview(const char *, geoview *, geodisplay *, struct Cell_head *,
     geosurf *);
 int Gs_update_attrange(geosurf *, int);
 
 /* From Gv3.c */
-geoline *Gv_load_vect(char *, int *);
+geoline *Gv_load_vect(const char *, int *);
 void add_Vectmem(int);
 void sub_Vectmem(int);
 void show_Vectmem(void);
@@ -371,7 +370,7 @@
 int gpd_3dsite(geosite *, float, float, int);
 
 /* From gs.c */
-void gs_err(char *);
+void gs_err(const char *);
 void gs_init(void);
 geosurf *gs_get_surf(int);
 geosurf *gs_get_prev_surface(int);
@@ -454,10 +453,11 @@
 
 /* From gsd_fonts.c */
 GLuint gsd_set_font(const char *);
-int gsd_get_txtwidth(char *, int );
+int gsd_get_txtwidth(const char *, int );
 int gsd_get_txtheight(int size);
-void do_label_display(GLuint, float *, char *);
-int get_txtxoffset();
+void do_label_display(GLuint, float *, const char *);
+int get_txtdescender(void);
+int get_txtxoffset(void);
 
 /* From gsd_img_ppm.c */
 int GS_write_ppm(const char *);
@@ -469,7 +469,7 @@
 int GS_write_tif(const char *);
 
 /* From gsd_label.c */
-void gs_put_label(char *, GLuint , int , unsigned long, int *);
+void gs_put_label(const char *, GLuint , int , unsigned long, int *);
 void gsd_remove_curr(void);
 void gsd_remove_all(void);
 void gsd_call_label(void);
@@ -618,8 +618,8 @@
 int V3Cross(Point3, Point3, Point3);
 
 /* From gsds.c */
-int gsds_findh(char *, IFLAG *, IFLAG *, int);
-int gsds_newh(char *);
+int gsds_findh(const char *, IFLAG *, IFLAG *, int);
+int gsds_newh(const char *);
 typbuff *gsds_get_typbuff(int, IFLAG);
 char *gsds_get_name(int);
 int gsds_free_datah(int);
@@ -684,7 +684,7 @@
 int gvl_isosurf_get_att_src(geovol_isosurf *, int);
 int gvl_isosurf_set_att_src(geovol_isosurf *, int, int);
 int gvl_isosurf_set_att_const(geovol_isosurf *, int, float);
-int gvl_isosurf_set_att_map(geovol_isosurf *, int, char *);
+int gvl_isosurf_set_att_map(geovol_isosurf *, int, const char *);
 int gvl_isosurf_set_att_changed(geovol_isosurf *, int);
 
 int gvl_slice_init(geovol_slice *);
@@ -703,7 +703,7 @@
 char *gvl_file_get_name(int);
 int gvl_file_get_file_type(geovol_file *);
 int gvl_file_get_data_type(geovol_file *);
-int gvl_file_newh(char *, IFLAG);
+int gvl_file_newh(const char *, IFLAG);
 int gvl_file_free_datah(int);
 int gvl_file_start_read(geovol_file *);
 int gvl_file_end_read(geovol_file *);
@@ -714,7 +714,7 @@
 void gvl_file_get_min_max(geovol_file *, double *, double *);
 
 /* From Gvl3.c */
-int Gvl_load_colors_data(void **, char *);
+int Gvl_load_colors_data(void **, const char *);
 int Gvl_unload_colors_data(void *);
 int Gvl_get_color_for_value(void *, float *);
 
@@ -722,7 +722,7 @@
 int gvl_isosurf_calc(geovol *);
 int gvl_slices_calc(geovol *);
 void gvl_write_char(int, unsigned char **, unsigned char);
-unsigned char gvl_read_char(int, unsigned char *);
+unsigned char gvl_read_char(int, const unsigned char *);
 void gvl_align_data(int, unsigned char *);
 
 /* From gvld.c */
@@ -743,7 +743,7 @@
 void gsd_fringe_vert_line (float, geosurf *, int, int);
 
 /* from gsd_legend.c */
-GLuint gsd_put_legend(char *, GLuint, int , int *, float *, int *);
+GLuint gsd_put_legend(const char *, GLuint, int , int *, float *, int *);
 void gsd_bgn_legend_viewport(GLint, GLint, GLint, GLint);
 void gsd_end_legend_viewport(void);
 int gsd_make_nice_number(float *);

Modified: grass/trunk/lib/g3d/find_grid3.c
===================================================================
--- grass/trunk/lib/g3d/find_grid3.c	2008-07-04 12:12:32 UTC (rev 31993)
+++ grass/trunk/lib/g3d/find_grid3.c	2008-07-04 19:52:02 UTC (rev 31994)
@@ -11,28 +11,15 @@
  *      if name is of the form nnn in ppp then
  *      name = nnn and mapset = ppp
  *
- *  \param char *name       file name to look for
- *  \param char *mapset     mapset to search. if mapset is ""
- *                         will search in mapset search list
+ *  \param const char *name       file name to look for
+ *  \param const char *mapset     mapset to search. if mapset is ""
+ *                                will search in mapset search list
  *  \return char *  pointer to a string with name of mapset
  *              where cell file was found, or NULL if not found
  */
 
-char *
-G_find_grid3  (char *cell, char *mset)
+char *G_find_grid3(const char *name, const char *mapset)
 
 {
-    char name[256], mapset[256], element[512];
-
-    if (cell == NULL || *cell == 0)
-        return 0;
-
-    if(G__name_is_fully_qualified (cell, name, mapset))
-        sprintf (element, "grid3/%s", name);
-    else
-        sprintf (element, "grid3/%s", cell);
-
-    return (G_find_file (element, "cell", mset));
-    /* actually looks for the data, not the directory */
-
+    return G_find_file2_misc ("grid3", "cell", name, mapset);
 }

Modified: grass/trunk/lib/g3d/g3dcolor.c
===================================================================
--- grass/trunk/lib/g3d/g3dcolor.c	2008-07-04 12:12:32 UTC (rev 31993)
+++ grass/trunk/lib/g3d/g3dcolor.c	2008-07-04 19:52:02 UTC (rev 31994)
@@ -10,14 +10,14 @@
 #include <grass/gis.h>
 #include "G3d_intern.h"
 
-static int read_colors(char *,char *,char *,struct Colors *);
+static int read_colors(const char *,const char *,const char *,struct Colors *);
 static int read_new_colors(FILE *,struct Colors *);
 static int read_old_colors(FILE *,struct Colors *);
 
 /*---------------------------------------------------------------------------*/
 
 int
-G3d_removeColor  (char *name)
+G3d_removeColor  (const char *name)
  /* adapted from G_remove_colr */
 
 
@@ -44,7 +44,7 @@
 /*---------------------------------------------------------------------------*/
 
 int
-G3d_readColors  (char *name, char *mapset, struct Colors *colors)
+G3d_readColors  (const char *name, const char *mapset, struct Colors *colors)
  /* adapted from G_read_colors */
 
 
@@ -102,7 +102,7 @@
   return -1;
 }
 
-static int read_colors( char *element , char *name , char *mapset , struct Colors *colors)
+static int read_colors( const char *element , const char *name , const char *mapset , struct Colors *colors)
 {
     FILE *fd ;
     int stat;
@@ -357,7 +357,7 @@
 /*---------------------------------------------------------------------------*/
 
 int
-G3d_writeColors  (char *name, char *mapset, struct Colors *colors)
+G3d_writeColors  (const char *name, const char *mapset, struct Colors *colors)
  /* adapted from G_write_colors */
 
 

Modified: grass/trunk/lib/g3d/g3dopen.c
===================================================================
--- grass/trunk/lib/g3d/g3dopen.c	2008-07-04 12:12:32 UTC (rev 31993)
+++ grass/trunk/lib/g3d/g3dopen.c	2008-07-04 19:52:02 UTC (rev 31994)
@@ -10,7 +10,7 @@
 /*---------------------------------------------------------------------------*/
 
 void *
-G3d_openCellOldNoHeader  (char *name, char *mapset)
+G3d_openCellOldNoHeader  (const char *name, const char *mapset)
 
 {
   G3D_Map *map;
@@ -84,7 +84,7 @@
  */
 
 void *
-G3d_openCellOld  (char *name, char *mapset, G3D_Region *window, int typeIntern, int cache)
+G3d_openCellOld  (const char *name, const char *mapset, G3D_Region *window, int typeIntern, int cache)
 
 {
   G3D_Map *map; 
@@ -214,7 +214,7 @@
  */
 
 void *
-G3d_openCellNew  (char *name, int typeIntern, int cache, G3D_Region *region)
+G3d_openCellNew  (const char *name, int typeIntern, int cache, G3D_Region *region)
 
 {
   G3D_Map *map;

Modified: grass/trunk/lib/g3d/g3drange.c
===================================================================
--- grass/trunk/lib/g3d/g3drange.c	2008-07-04 12:12:32 UTC (rev 31993)
+++ grass/trunk/lib/g3d/g3drange.c	2008-07-04 19:52:02 UTC (rev 31994)
@@ -48,7 +48,7 @@
 /*---------------------------------------------------------------------------*/
 
 int
-G3d_readRange  (char *name, char *mapset, struct FPRange *drange)
+G3d_readRange  (const char *name, const char *mapset, struct FPRange *drange)
  /* adapted from G_read_fp_range */
 {
   int fd;

Modified: grass/trunk/lib/ogsf/GK2.c
===================================================================
--- grass/trunk/lib/ogsf/GK2.c	2008-07-04 12:12:32 UTC (rev 31993)
+++ grass/trunk/lib/ogsf/GK2.c	2008-07-04 19:52:02 UTC (rev 31994)
@@ -209,7 +209,7 @@
 
   \param name filename
 */
-void GK_print_keys(char *name)
+void GK_print_keys(const char *name)
 {
     Keylist *k;
     FILE *fp;

Modified: grass/trunk/lib/ogsf/GP2.c
===================================================================
--- grass/trunk/lib/ogsf/GP2.c	2008-07-04 12:12:32 UTC (rev 31993)
+++ grass/trunk/lib/ogsf/GP2.c	2008-07-04 19:52:02 UTC (rev 31994)
@@ -181,7 +181,7 @@
   \return -1 on error
   \return 1 on success
 */
-int GP_load_site(int id, char *filename)
+int GP_load_site(int id, const char *filename)
 {
     geosite *gp;
 
@@ -290,7 +290,7 @@
   \return 0 for no attribute info
   \return -1 for bad parameter
 */
-int GP_attmode_color(int id, char *filename)
+int GP_attmode_color(int id, const char *filename)
 {
     geosite *gp;
 

Modified: grass/trunk/lib/ogsf/GS2.c
===================================================================
--- grass/trunk/lib/ogsf/GS2.c	2008-07-04 12:12:32 UTC (rev 31993)
+++ grass/trunk/lib/ogsf/GS2.c	2008-07-04 19:52:02 UTC (rev 31994)
@@ -822,7 +822,7 @@
   \param range values range
   \param pt ?
 */
-int GS_draw_legend(char *name, GLuint fontbase, int size, int *flags,
+int GS_draw_legend(const char *name, GLuint fontbase, int size, int *flags,
 	       float *range, int *pt)
 {
     int list_no;
@@ -1584,12 +1584,12 @@
   \return -1 on error (invalid surface id)
   \return ?
 */
-int GS_load_att_map(int id, char *filename, int att)
+int GS_load_att_map(int id, const char *filename, int att)
 {
     geosurf *gs;
     unsigned int changed;
     unsigned int atty;
-    char *mapset;
+    const char *mapset;
     struct Cell_head rast_head;
     int reuse = 0, begin, hdata, ret, neg = 0, has_null = 0;
     typbuff *tbuff;
@@ -3242,7 +3242,7 @@
 
   \return ?
 */
-int GS_save_3dview(char *vname, int surfid)
+int GS_save_3dview(const char *vname, int surfid)
 {
     return (Gs_save_3dview(vname, &Gv, &Gd, &wind, gs_get_surf(surfid)));
 }
@@ -3255,7 +3255,7 @@
 
   \return ?
 */
-int GS_load_3dview(char *vname, int surfid)
+int GS_load_3dview(const char *vname, int surfid)
 {
 
     return (Gs_load_3dview(vname, &Gv, &Gd, &wind, gs_get_surf(surfid)));

Modified: grass/trunk/lib/ogsf/GS_util.c
===================================================================
--- grass/trunk/lib/ogsf/GS_util.c	2008-07-04 12:12:32 UTC (rev 31993)
+++ grass/trunk/lib/ogsf/GS_util.c	2008-07-04 19:52:02 UTC (rev 31994)
@@ -52,7 +52,7 @@
 
   \return distance between two geographic coordinates in current projection
 */
-double GS_geodistance(double *from, double *to, char *units)
+double GS_geodistance(double *from, double *to, const char *units)
 {
     double meters;
 

Modified: grass/trunk/lib/ogsf/GV2.c
===================================================================
--- grass/trunk/lib/ogsf/GV2.c	2008-07-04 12:12:32 UTC (rev 31993)
+++ grass/trunk/lib/ogsf/GV2.c	2008-07-04 19:52:02 UTC (rev 31994)
@@ -171,7 +171,7 @@
   \return -1 on error (invalid vector set id)
   \return 1 on success
 */
-int GV_load_vector(int id, char *filename)
+int GV_load_vector(int id, const char *filename)
 {
     geovect *gv;
 

Modified: grass/trunk/lib/ogsf/GVL2.c
===================================================================
--- grass/trunk/lib/ogsf/GVL2.c	2008-07-04 12:12:32 UTC (rev 31993)
+++ grass/trunk/lib/ogsf/GVL2.c	2008-07-04 19:52:02 UTC (rev 31994)
@@ -229,7 +229,7 @@
   \return -1 on error
   \return 0 on success
 */
-int GVL_load_vol(int id, char *filename)
+int GVL_load_vol(int id, const char *filename)
 {
     geovol *gvl;
     int handle;
@@ -843,7 +843,7 @@
   \return ?
   \return -1 on error
 */
-int GVL_isosurf_set_att_map(int id, int isosurf_id, int att, char *filename)
+int GVL_isosurf_set_att_map(int id, int isosurf_id, int att, const char *filename)
 {
     geovol_isosurf *isosurf;
 

Modified: grass/trunk/lib/ogsf/Gp3.c
===================================================================
--- grass/trunk/lib/ogsf/Gp3.c	2008-07-04 12:12:32 UTC (rev 31993)
+++ grass/trunk/lib/ogsf/Gp3.c	2008-07-04 19:52:02 UTC (rev 31994)
@@ -38,9 +38,9 @@
   \return 1 on success
   \return 0 on failure
 */
-int Gp_set_color(char *grassname, geopoint * gp)
+int Gp_set_color(const char *grassname, geopoint * gp)
 {
-    char *col_map;
+    const char *col_map;
     struct Colors sc;
     CELL cat;
     geopoint *tp;
@@ -87,7 +87,7 @@
   \return pointer to geopoint struct
   \return NULL on failure
 */
-geopoint *Gp_load_sites(char *grassname, int *nsites, int *has_z,
+geopoint *Gp_load_sites(const char *grassname, int *nsites, int *has_z,
 			int *has_att)
 {
     struct Map_info map;
@@ -98,13 +98,13 @@
     struct Cell_head wind;
     RASTER_MAP_TYPE rtype;
     int ndim;
-    char *mapset;
+    const char *mapset;
 
     np = 0;
     eof = 0;
     *has_z = *has_att = 0;
 
-    mapset = G_find_vector2((const char *) grassname, "");
+    mapset = G_find_vector2(grassname, "");
     if (!mapset) {
 	G_warning (_("Vector map <%s> not found"),
 		   grassname);

Modified: grass/trunk/lib/ogsf/Gs3.c
===================================================================
--- grass/trunk/lib/ogsf/Gs3.c	2008-07-04 12:12:32 UTC (rev 31993)
+++ grass/trunk/lib/ogsf/Gs3.c	2008-07-04 19:52:02 UTC (rev 31994)
@@ -76,7 +76,7 @@
  * may be replaced by a user's function. 
  * Or else use G_set_error_routine.
  */
-void Gs_status(char *str)
+void Gs_status(const char *str)
 {
     G_debug(3, "%s", str);
 
@@ -123,11 +123,12 @@
   \return 1 on success
   \return 0 on failure
 */
-int Gs_loadmap_as_float(struct Cell_head *wind, char *map_name, float *buff,
+int Gs_loadmap_as_float(struct Cell_head *wind, const char *map_name, float *buff,
 			struct BM *nullmap, int *has_null)
 {
     FILEDESC cellfile;
-    char *map_set, *nullflags;
+    const char *map_set;
+    char *nullflags;
     int offset, row, col;
 
     G_debug(3, "Gs_loadmap_as_float(): name=%s", map_name);
@@ -198,11 +199,12 @@
   \return 1 on success
   \return 0 on failure
 */
-int Gs_loadmap_as_int(struct Cell_head *wind, char *map_name, int *buff,
+int Gs_loadmap_as_int(struct Cell_head *wind, const char *map_name, int *buff,
 		      struct BM *nullmap, int *has_null)
 {
     FILEDESC cellfile;
-    char *map_set, *nullflags;
+    const char *map_set;
+    char *nullflags;
     int offset, row, col;
 
     G_debug(3, "Gs_loadmap_as_int");
@@ -261,11 +263,11 @@
   \return -1 if map is integer and G_read_range() fails
   \return data type (ARRY_*)
 */
-int Gs_numtype(char *filename, int *negflag)
+int Gs_numtype(const char *filename, int *negflag)
 {
     CELL max = 0, min = 0;
     struct Range range;
-    char *mapset;
+    const char *mapset;
     int shortbits, charbits, bitplace;
     static int max_short, max_char;
     static int first = 1;
@@ -344,11 +346,12 @@
   \return -2 if read ok, but 1 or more values were too large (small)
   to fit into a short (in which case the max (min) short is used)
 */
-int Gs_loadmap_as_short(struct Cell_head *wind, char *map_name, short *buff,
+int Gs_loadmap_as_short(struct Cell_head *wind, const char *map_name, short *buff,
 			struct BM *nullmap, int *has_null)
 {
     FILEDESC cellfile;
-    char *map_set, *nullflags;
+    const char *map_set;
+    char *nullflags;
     int *ti, *tmp_buf;
     int offset, row, col, val, max_short, overflow, shortsize, bitplace;
     short *ts;
@@ -459,11 +462,12 @@
   were too large (small) to fit into an unsigned char.
   (in which case the max (min) char is used)
 */
-int Gs_loadmap_as_char(struct Cell_head *wind, char *map_name,
+int Gs_loadmap_as_char(struct Cell_head *wind, const char *map_name,
 		       unsigned char *buff, struct BM *nullmap, int *has_null)
 {
     FILEDESC cellfile;
-    char *map_set, *nullflags;
+    const char *map_set;
+    char *nullflags;
     int *ti, *tmp_buf;
     int offset, row, col, val, max_char, overflow, charsize, bitplace;
     unsigned char *tc;
@@ -569,11 +573,12 @@
   \returns 1 on success
   \return -1 on failure
 */
-int Gs_loadmap_as_bitmap(struct Cell_head *wind, char *map_name,
+int Gs_loadmap_as_bitmap(struct Cell_head *wind, const char *map_name,
 			 struct BM *buff)
 {
     FILEDESC cellfile;
-    char *map_set, *nullflags;
+    const char *map_set;
+    char *nullflags;
     int *tmp_buf;
     int row, col;
 
@@ -638,9 +643,9 @@
   \return 1 on success
   \return 0 on failure
 */
-int Gs_build_256lookup(char *filename, int *buff)
+int Gs_build_256lookup(const char *filename, int *buff)
 {
-    char *map;
+    const char *mapset;
     struct Colors colrules;
     CELL min, max, cats[256];
     int i;
@@ -648,14 +653,14 @@
 
     G_debug(3, "building color table");
 
-    map = G_find_cell2(filename, "");
-    if (!map) {
+    mapset = G_find_cell2(filename, "");
+    if (!mapset) {
 	G_warning(_("Raster map <%s> not found"),
 		  filename);
 	return 0;
     }
 
-    G_read_colors(filename, map, &colrules);
+    G_read_colors(filename, mapset, &colrules);
     G_get_color_range(&min, &max, &colrules);
 
     if (min < 0 || max > 255) {
@@ -698,15 +703,15 @@
   \param rows number of rows
   \param cols number of cols
 */
-void Gs_pack_colors(char *filename, int *buff, int rows, int cols)
+void Gs_pack_colors(const char *filename, int *buff, int rows, int cols)
 {
-    char *map;
+    const char *mapset;
     struct Colors colrules;
     unsigned char *r, *g, *b, *set;
     int *cur, i, j;
 
-    map = G_find_cell2(filename, "");
-    if (!map) {
+    mapset = G_find_cell2(filename, "");
+    if (!mapset) {
 	G_warning(_("Raster map <%s> not found"),
 		  filename);
 	return;
@@ -717,7 +722,7 @@
     b = (unsigned char *) G_malloc(cols);
     set = (unsigned char *) G_malloc(cols);
 
-    G_read_colors(filename, map, &colrules);
+    G_read_colors(filename, mapset, &colrules);
 
     cur = buff;
 
@@ -766,17 +771,17 @@
   \param rows number of rows
   \param cols number of cols
 */
-void Gs_pack_colors_float(char *filename, float *fbuf, int *ibuf, int rows,
+void Gs_pack_colors_float(const char *filename, float *fbuf, int *ibuf, int rows,
 			  int cols)
 {
-    char *map;
+    const char *mapset;
     struct Colors colrules;
     unsigned char *r, *g, *b, *set;
     int i, j, *icur;
     FCELL *fcur;
 
-    map = G_find_cell2(filename, "");
-    if (!map) {
+    mapset = G_find_cell2(filename, "");
+    if (!mapset) {
 	G_warning(_("Raster map <%s> not found"),
 		  filename);
 	return;
@@ -787,7 +792,7 @@
     b = (unsigned char *) G_malloc(cols);
     set = (unsigned char *) G_malloc(cols);
 
-    G_read_colors(filename, map, &colrules);
+    G_read_colors(filename, mapset, &colrules);
 
     fcur = fbuf;
     icur = ibuf;
@@ -836,10 +841,10 @@
   \return 1 on success
   \return 0 on failure
 */
-int Gs_get_cat_label(char *filename, int drow, int dcol, char *catstr)
+int Gs_get_cat_label(const char *filename, int drow, int dcol, char *catstr)
 {
     struct Categories cats;
-    char *mapset;
+    const char *mapset;
     CELL *buf;
     DCELL *dbuf;
     RASTER_MAP_TYPE map_type;
@@ -916,10 +921,10 @@
   \return -1 on error
   \return ?
 */
-int Gs_save_3dview(char *vname, geoview * gv, geodisplay * gd,
+int Gs_save_3dview(const char *vname, geoview * gv, geodisplay * gd,
 		   struct Cell_head *w, geosurf * defsurf)
 {
-    char *mapset;
+    const char *mapset;
     struct G_3dview v;
     float zmax, zmin;
 
@@ -1014,10 +1019,10 @@
 
   \return 1
 */
-int Gs_load_3dview(char *vname, geoview * gv, geodisplay * gd,
+int Gs_load_3dview(const char *vname, geoview * gv, geodisplay * gd,
 		   struct Cell_head *w, geosurf * defsurf)
 {
-    char *mapset;
+    const char *mapset;
     struct G_3dview v;
     int ret = -1;
     float pt[3];

Modified: grass/trunk/lib/ogsf/Gv3.c
===================================================================
--- grass/trunk/lib/ogsf/Gv3.c	2008-07-04 12:12:32 UTC (rev 31993)
+++ grass/trunk/lib/ogsf/Gv3.c	2008-07-04 19:52:02 UTC (rev 31994)
@@ -40,7 +40,7 @@
   \return pointer to geoline struct
   \return NULL on failure
 */
-geoline *Gv_load_vect(char *grassname, int *nlines)
+geoline *Gv_load_vect(const char *grassname, int *nlines)
 {
     struct Map_info map;
     struct line_pnts *points;
@@ -48,9 +48,9 @@
     int np, i, n, nareas, nl=0, area, type, is3d;
     struct Cell_head  wind;
     float vect[2][3];
-    char *mapset;
+    const char *mapset;
 
-    mapset = G_find_vector2((const char *) grassname, "");
+    mapset = G_find_vector2(grassname, "");
     if (!mapset) {
 	G_warning(_("Vector map <%s> not found"),
 		  grassname);

Modified: grass/trunk/lib/ogsf/Gvl3.c
===================================================================
--- grass/trunk/lib/ogsf/Gvl3.c	2008-07-04 12:12:32 UTC (rev 31993)
+++ grass/trunk/lib/ogsf/Gvl3.c	2008-07-04 19:52:02 UTC (rev 31994)
@@ -30,9 +30,9 @@
   \return -1 on failure
   \return 1 on success
 */
-int Gvl_load_colors_data(void **color_data, char *name)
+int Gvl_load_colors_data(void **color_data, const char *name)
 {
-    char *mapset;
+    const char *mapset;
     struct Colors *colors;
 
     if (NULL == (mapset = G_find_grid3(name,""))) {

Modified: grass/trunk/lib/ogsf/gs.c
===================================================================
--- grass/trunk/lib/ogsf/gs.c	2008-07-04 12:12:32 UTC (rev 31993)
+++ grass/trunk/lib/ogsf/gs.c	2008-07-04 19:52:02 UTC (rev 31994)
@@ -31,7 +31,7 @@
 static int Invertmask;
 
 /***********************************************************************/
-void gs_err(char *msg)
+void gs_err(const char *msg)
 {
     G_warning ("%s", msg);
 

Modified: grass/trunk/lib/ogsf/gsd_fonts.c
===================================================================
--- grass/trunk/lib/ogsf/gsd_fonts.c	2008-07-04 12:12:32 UTC (rev 31993)
+++ grass/trunk/lib/ogsf/gsd_fonts.c	2008-07-04 19:52:02 UTC (rev 31994)
@@ -34,7 +34,7 @@
 
   \return text width
 */
-int gsd_get_txtwidth(char *s, int size)
+int gsd_get_txtwidth(const char *s, int size)
 {
     int width, len;
 
@@ -70,7 +70,7 @@
 
   \return 2
 */
-int get_txtdescender()
+int get_txtdescender(void)
 {
     return (2);
 }
@@ -84,7 +84,7 @@
 
   \return 0
 */
-int get_txtxoffset()
+int get_txtxoffset(void)
 {
     return (0);
 }
@@ -96,11 +96,11 @@
   \param lab_pos label position
   \param txt text string
 */
-void do_label_display(GLuint fontbase, float *lab_pos, char *txt)
+void do_label_display(GLuint fontbase, float *lab_pos, const char *txt)
 {
     glRasterPos2f(lab_pos[X], lab_pos[Y]);
     glListBase(fontbase);
-    glCallLists(strlen(txt), GL_BYTE, (GLubyte *) txt);
+    glCallLists(strlen(txt), GL_UNSIGNED_BYTE, (const GLvoid *) txt);
 
     return;
 }

Modified: grass/trunk/lib/ogsf/gsd_label.c
===================================================================
--- grass/trunk/lib/ogsf/gsd_label.c	2008-07-04 12:12:32 UTC (rev 31993)
+++ grass/trunk/lib/ogsf/gsd_label.c	2008-07-04 19:52:02 UTC (rev 31994)
@@ -38,7 +38,7 @@
   \param color font color
   \param pt 
 */
-void gs_put_label(char *text, GLuint fontbase, int size, unsigned long color,
+void gs_put_label(const char *text, GLuint fontbase, int size, unsigned long color,
 		  int*pt)
 {
     int txt_width;

Modified: grass/trunk/lib/ogsf/gsd_legend.c
===================================================================
--- grass/trunk/lib/ogsf/gsd_legend.c	2008-07-04 12:12:32 UTC (rev 31993)
+++ grass/trunk/lib/ogsf/gsd_legend.c	2008-07-04 19:52:02 UTC (rev 31994)
@@ -198,7 +198,7 @@
 
   \return
 */
-GLuint gsd_put_legend(char *name, GLuint fontbase, int size, int *flags,
+GLuint gsd_put_legend(const char *name, GLuint fontbase, int size, int *flags,
 		      float *rangef, int *pt)
 {
     GLint sl, sr, sb, st;
@@ -208,7 +208,7 @@
     struct Categories cats;
     struct Range range;
     struct FPRange fp_range;
-    char *mapset;
+    const char *mapset;
     struct Colors colors;
     CELL min, max;
     DCELL fmin, fmax;
@@ -370,7 +370,8 @@
 	float *dividers;
 	int labw, maxlabw, numlabs;
 	float labpos, labpt[3];
-	char *cstr, buff[80];
+	const char *cstr;
+	char buff[80];
 	GLint wt, wb, wl, wr;	/* Whole legend area, not just box */
 	int xoff, yoff;
 	int incr;		/* for do_invert */

Modified: grass/trunk/lib/ogsf/gsd_objs.c
===================================================================
--- grass/trunk/lib/ogsf/gsd_objs.c	2008-07-04 12:12:32 UTC (rev 31993)
+++ grass/trunk/lib/ogsf/gsd_objs.c	2008-07-04 19:52:02 UTC (rev 31994)
@@ -825,7 +825,7 @@
 int gsd_north_arrow (float *pos2, float len, GLuint fontbase,
 		     unsigned long arw_clr, unsigned long text_clr)
 {
-    char *txt;
+    const char *txt;
     float v[4][3];
     float base[3][3];
     float Ntop[] = { 0.0, 0.0, 1.0 };
@@ -889,7 +889,7 @@
 
     glRasterPos3fv(base[0]);
     glListBase(fontbase);
-    glCallLists(strlen(txt), GL_BYTE, (GLubyte *) txt);
+    glCallLists(strlen(txt), GL_UNSIGNED_BYTE, (const GLvoid *) txt);
     GS_done_draw();
 
     gsd_popmatrix();        

Modified: grass/trunk/lib/ogsf/gsds.c
===================================================================
--- grass/trunk/lib/ogsf/gsds.c	2008-07-04 12:12:32 UTC (rev 31993)
+++ grass/trunk/lib/ogsf/gsds.c	2008-07-04 19:52:02 UTC (rev 31994)
@@ -185,7 +185,7 @@
   \return data id
   \return -1 not found
 */
-int gsds_findh(char *name, IFLAG * changes, IFLAG * types, int begin)
+int gsds_findh(const char *name, IFLAG * changes, IFLAG * types, int begin)
 {
     static int i;
     int start;
@@ -216,7 +216,7 @@
   \return -1 on failure
   \return data id
 */
-int gsds_newh(char *name)
+int gsds_newh(const char *name)
 {
     dataset *new;
     static int first = 1;

Modified: grass/trunk/lib/ogsf/gvl.c
===================================================================
--- grass/trunk/lib/ogsf/gvl.c	2008-07-04 12:12:32 UTC (rev 31993)
+++ grass/trunk/lib/ogsf/gvl.c	2008-07-04 19:52:02 UTC (rev 31994)
@@ -667,7 +667,7 @@
   \return -1 on failure
   \return 1 on success
 */
-int gvl_isosurf_set_att_map(geovol_isosurf *isosurf, int desc, char *filename)
+int gvl_isosurf_set_att_map(geovol_isosurf *isosurf, int desc, const char *filename)
 {
     int hfile;
 

Modified: grass/trunk/lib/ogsf/gvl_calc.c
===================================================================
--- grass/trunk/lib/ogsf/gvl_calc.c	2008-07-04 12:12:32 UTC (rev 31993)
+++ grass/trunk/lib/ogsf/gvl_calc.c	2008-07-04 19:52:02 UTC (rev 31994)
@@ -747,7 +747,7 @@
 
   \param char
 */
-unsigned char gvl_read_char(int pos, unsigned char *data)
+unsigned char gvl_read_char(int pos, const unsigned char *data)
 {
     return data[pos];
 }

Modified: grass/trunk/lib/ogsf/gvl_file.c
===================================================================
--- grass/trunk/lib/ogsf/gvl_file.c	2008-07-04 12:12:32 UTC (rev 31993)
+++ grass/trunk/lib/ogsf/gvl_file.c	2008-07-04 19:52:02 UTC (rev 31994)
@@ -59,7 +59,7 @@
 static int Rows, Cols, Depths;
 
 /* local functions prototypes */
-void *open_g3d_file(char *, IFLAG *, double *, double *);
+void *open_g3d_file(const char *, IFLAG *, double *, double *);
 int close_g3d_file(void *);
 
 /*!
@@ -137,7 +137,7 @@
   \param data id
   \param -1 not found
 */
-int find_datah(char *name, IFLAG type, int begin)
+int find_datah(const char *name, IFLAG type, int begin)
 {
     static int i;
     int start;
@@ -230,7 +230,7 @@
   \return pointer to file
   \return NULL on failure
 */
-void *open_volfile(char *name, IFLAG file_type, IFLAG *data_type, double *min, double *max)
+void *open_volfile(const char *name, IFLAG file_type, IFLAG *data_type, double *min, double *max)
 {
      if (file_type == VOL_FTYPE_G3D) {
         return open_g3d_file(name, data_type, min, max);
@@ -266,7 +266,7 @@
   \return data id
   \return -1 on failure
 */
-int gvl_file_newh(char *name, IFLAG file_type)
+int gvl_file_newh(const char *name, IFLAG file_type)
 {
     geovol_file *new;
     static int first = 1;
@@ -409,9 +409,9 @@
 
   \pointer to data
 */
-void *open_g3d_file(char *filename, IFLAG *type, double *min, double *max)
+void *open_g3d_file(const char *filename, IFLAG *type, double *min, double *max)
 {
-    char *mapset;
+    const char *mapset;
     int itype;
     void *map;
 

Modified: grass/trunk/lib/ogsf/gvld.c
===================================================================
--- grass/trunk/lib/ogsf/gvld.c	2008-07-04 12:12:32 UTC (rev 31993)
+++ grass/trunk/lib/ogsf/gvld.c	2008-07-04 19:52:02 UTC (rev 31994)
@@ -238,7 +238,7 @@
 	nz[i] = 0;
     }
 
-    G_debug (3, "  intialize OK", gvl_file_get_name(gvl->hfile), i);
+    G_debug (3, "  intialize OK");
 
     for (z = 0; z < depths - 1; z++) {
 	zc = z * zres;



More information about the grass-commit mailing list