Explorar el Código

Add "const" to OGSF, G3D functions where appropriate

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@31994 15284696-431f-4ddb-bdfa-cd5b030d7da7
Glynn Clements hace 17 años
padre
commit
151c03bb34

+ 8 - 8
include/G3d.h

@@ -265,7 +265,7 @@ void G3d_compareFiles(char *, char *, char *, char *);
 /* grass/src/libes/g3d/filename.c */
 /* grass/src/libes/g3d/filename.c */
 void G3d_filename(char *, char *, char *, char *);
 void G3d_filename(char *, char *, char *, char *);
 /* grass/src/libes/g3d/find_grid3.c */
 /* 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 */
 /* grass/src/libes/g3d/fpcompress.c */
 void G_fpcompress_printBinary(char *, int);
 void G_fpcompress_printBinary(char *, int);
 void G_fpcompress_dissectXdrDouble(unsigned char *);
 void G_fpcompress_dissectXdrDouble(unsigned char *);
@@ -289,9 +289,9 @@ int G3d_readCats(char *, char *, struct Categories *);
 /* grass/src/libes/g3d/g3dclose.c */
 /* grass/src/libes/g3d/g3dclose.c */
 int G3d_closeCell(G3D_Map *);
 int G3d_closeCell(G3D_Map *);
 /* grass/src/libes/g3d/g3dcolor.c */
 /* 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 */
 /* grass/src/libes/g3d/g3ddefaults.c */
 void G3d_setCompressionMode(int, int, int, int);
 void G3d_setCompressionMode(int, int, int, int);
 void G3d_getCompressionMode(int *, int *, int *, int *);
 void G3d_getCompressionMode(int *, int *, int *, int *);
@@ -375,9 +375,9 @@ int G3d_isNullValueNum(void *, int);
 void G3d_setNullValue(void *, int, int);
 void G3d_setNullValue(void *, int, int);
 /* grass/src/libes/g3d/g3dopen2.c */
 /* grass/src/libes/g3d/g3dopen2.c */
 /* grass/src/libes/g3d/g3dopen.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 */
 /* grass/src/libes/g3d/g3dparam.c */
 void G3d_setStandard3dInputParams(void);
 void G3d_setStandard3dInputParams(void);
 int G3d_getStandard3dParams(int *, int *, int *, int *, int *, int *, int *, int *, int *, int *, int *, int *);
 int G3d_getStandard3dParams(int *, int *, int *, int *, int *, int *, int *, int *, int *, int *, int *, int *);
@@ -385,7 +385,7 @@ void G3d_setWindowParams(void);
 char *G3d_getWindowParams(void);
 char *G3d_getWindowParams(void);
 /* grass/src/libes/g3d/g3drange.c */
 /* grass/src/libes/g3d/g3drange.c */
 void G3d_range_updateFromTile(G3D_Map *, char *, int, int, int, int, int, int, int, int);
 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 *);
 int G3d_range_load(G3D_Map *);
 void G3d_range_min_max(G3D_Map *, double *, double *);
 void G3d_range_min_max(G3D_Map *, double *, double *);
 int G3d_range_write(G3D_Map *);
 int G3d_range_write(G3D_Map *);

+ 40 - 40
include/ogsf_proto.h

@@ -42,7 +42,7 @@ void GK_update_tension(void);
 void GK_update_frames(void);
 void GK_update_frames(void);
 void GK_set_numsteps(int);
 void GK_set_numsteps(int);
 void GK_clear_keys(void);
 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_move_key(float, float, float);
 int GK_delete_key(float, float, int);
 int GK_delete_key(float, float, int);
 int GK_add_key(float, unsigned long, int, float);
 int GK_add_key(float, unsigned long, int, float);
@@ -59,11 +59,11 @@ int GP_new_site(void);
 int GP_num_sites(void);
 int GP_num_sites(void);
 int *GP_get_site_list(int *);
 int *GP_get_site_list(int *);
 int GP_delete_site(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_sitename(int, char *);
 int GP_get_sitemode(int, int *, int *, int *, float *, int *);
 int GP_get_sitemode(int, int *, int *, int *, float *, int *);
 int GP_set_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_attmode_none(int);
 int GP_set_zmode(int, int);
 int GP_set_zmode(int, int);
 int GP_get_zmode(int, int *);
 int GP_get_zmode(int, int *);
@@ -123,7 +123,7 @@ void *GS_Get_ClientData(int);
 int GS_num_surfs(void);
 int GS_num_surfs(void);
 int *GS_get_surf_list(int *);
 int *GS_get_surf_list(int *);
 int GS_delete_surface(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_surf(int);
 void GS_draw_wire(int);
 void GS_draw_wire(int);
 void GS_alldraw_wire(void);
 void GS_alldraw_wire(void);
@@ -186,8 +186,8 @@ void GS_get_scale(float *, float *, float *, int);
 void GS_set_fencecolor(int);
 void GS_set_fencecolor(int);
 int GS_get_fencecolor(void);
 int GS_get_fencecolor(void);
 int GS_get_distance_alongsurf(int, float, float, float, float, float *, int);
 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_init_view(void);
 void GS_clear(int);
 void GS_clear(int);
 double GS_get_aspect(void);
 double GS_get_aspect(void);
@@ -196,7 +196,7 @@ void GS_zoom_setup(int *, int *, int *, int *, int *, int *);
 int GS_write_zoom(const char *, unsigned int, unsigned int);
 int GS_write_zoom(const char *, unsigned int, unsigned int);
 void GS_draw_all_list(void);
 void GS_draw_all_list(void);
 void GS_delete_list(GLuint);
 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_draw_fringe(int, unsigned long, float, int *);
 void GS_getlight_position(int, float *, float *, float *, int *);
 void GS_getlight_position(int, float *, float *, float *, int *);
 void GS_getlight_color(int, float *, float *, float *);
 void GS_getlight_color(int, float *, float *, float *);
@@ -209,7 +209,7 @@ void GS_set_cxl_func(void (*)(void));
 void GS_set_swap_func(void (*)(void));
 void GS_set_swap_func(void (*)(void));
 
 
 /* From GS_util.c */
 /* From GS_util.c */
-double GS_geodistance (double *, double *, char *);
+double GS_geodistance (double *, double *, const char *);
 float GS_distance (float *, float *);
 float GS_distance (float *, float *);
 float GS_P2distance (float *, float *);
 float GS_P2distance (float *, float *);
 void GS_v3eq(float *, float *);
 void GS_v3eq(float *, float *);
@@ -232,7 +232,7 @@ int GV_new_vector(void);
 int GV_num_vects(void);
 int GV_num_vects(void);
 int *GV_get_vect_list(int *);
 int *GV_get_vect_list(int *);
 int GV_delete_vector(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_get_vectname(int, char *);
 int GV_set_vectmode(int, int, int, int, int);
 int GV_set_vectmode(int, int, int, int, int);
 int GV_get_vectmode(int, int *, int *, int *, int *);
 int GV_get_vectmode(int, int *, int *, int *, int *);
@@ -256,7 +256,7 @@ int GVL_new_vol(void);
 int GVL_num_vols(void);
 int GVL_num_vols(void);
 int *GVL_get_vol_list(int *);
 int *GVL_get_vol_list(int *);
 int GVL_delete_vol(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 *);
 int GVL_get_volname(int, char *);
 void GVL_set_trans(int, float, float, float);
 void GVL_set_trans(int, float, float, float);
 int GVL_get_trans(int, float *, float *, float *);
 int GVL_get_trans(int, float *, float *, float *);
@@ -279,7 +279,7 @@ int GVL_isosurf_del(int, int);
 int GVL_isosurf_get_att(int, int, int, int *, float *, char *);
 int GVL_isosurf_get_att(int, int, int, int *, float *, char *);
 int GVL_isosurf_unset_att(int, int, int);
 int GVL_isosurf_unset_att(int, int, int);
 int GVL_isosurf_set_att_const(int, int, int, float);
 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_get_flags(int, int, int *);
 int GVL_isosurf_set_flags(int, int, int);
 int GVL_isosurf_set_flags(int, int, int);
 int GVL_isosurf_num_isosurfs(int);
 int GVL_isosurf_num_isosurfs(int);
@@ -301,34 +301,33 @@ int GVL_slice_get_pos(int, int, float *, float *, float *, float *, float *, flo
 int GVL_slice_set_pos(int, int, float, float, float, float, float, float, int);
 int GVL_slice_set_pos(int, int, float, float, float, float, float, float, int);
 
 
 /* From Gp3.c */
 /* 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 */
 /* From Gs3.c */
-void Gs_warning(char *);
-void Gs_status(char *);
+void Gs_status(const char *);
 double Gs_distance(double *, double *);
 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 *);
-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 *);
-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 *);
     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 *);
     geosurf *);
-int Gs_load_3dview(char *, geoview *, geodisplay *, struct Cell_head *,
+int Gs_load_3dview(const char *, geoview *, geodisplay *, struct Cell_head *,
     geosurf *);
     geosurf *);
 int Gs_update_attrange(geosurf *, int);
 int Gs_update_attrange(geosurf *, int);
 
 
 /* From Gv3.c */
 /* From Gv3.c */
-geoline *Gv_load_vect(char *, int *);
+geoline *Gv_load_vect(const char *, int *);
 void add_Vectmem(int);
 void add_Vectmem(int);
 void sub_Vectmem(int);
 void sub_Vectmem(int);
 void show_Vectmem(void);
 void show_Vectmem(void);
@@ -371,7 +370,7 @@ int gpd_2dsite(geosite *, geosurf *, int);
 int gpd_3dsite(geosite *, float, float, int);
 int gpd_3dsite(geosite *, float, float, int);
 
 
 /* From gs.c */
 /* From gs.c */
-void gs_err(char *);
+void gs_err(const char *);
 void gs_init(void);
 void gs_init(void);
 geosurf *gs_get_surf(int);
 geosurf *gs_get_surf(int);
 geosurf *gs_get_prev_surface(int);
 geosurf *gs_get_prev_surface(int);
@@ -454,10 +453,11 @@ void gsd_draw_cplane(int);
 
 
 /* From gsd_fonts.c */
 /* From gsd_fonts.c */
 GLuint gsd_set_font(const char *);
 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);
 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 */
 /* From gsd_img_ppm.c */
 int GS_write_ppm(const char *);
 int GS_write_ppm(const char *);
@@ -469,7 +469,7 @@ int gsd_close_mpeg(void);
 int GS_write_tif(const char *);
 int GS_write_tif(const char *);
 
 
 /* From gsd_label.c */
 /* 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_curr(void);
 void gsd_remove_all(void);
 void gsd_remove_all(void);
 void gsd_call_label(void);
 void gsd_call_label(void);
@@ -618,8 +618,8 @@ int P3toPlane(Point3, Point3, Point3, float *);
 int V3Cross(Point3, Point3, Point3);
 int V3Cross(Point3, Point3, Point3);
 
 
 /* From gsds.c */
 /* 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);
 typbuff *gsds_get_typbuff(int, IFLAG);
 char *gsds_get_name(int);
 char *gsds_get_name(int);
 int gsds_free_datah(int);
 int gsds_free_datah(int);
@@ -684,7 +684,7 @@ geovol_isosurf* gvl_isosurf_get_isosurf(int, int);
 int gvl_isosurf_get_att_src(geovol_isosurf *, int);
 int gvl_isosurf_get_att_src(geovol_isosurf *, int);
 int gvl_isosurf_set_att_src(geovol_isosurf *, int, 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_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_isosurf_set_att_changed(geovol_isosurf *, int);
 
 
 int gvl_slice_init(geovol_slice *);
 int gvl_slice_init(geovol_slice *);
@@ -703,7 +703,7 @@ geovol_file *gvl_file_get_volfile(int);
 char *gvl_file_get_name(int);
 char *gvl_file_get_name(int);
 int gvl_file_get_file_type(geovol_file *);
 int gvl_file_get_file_type(geovol_file *);
 int gvl_file_get_data_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_free_datah(int);
 int gvl_file_start_read(geovol_file *);
 int gvl_file_start_read(geovol_file *);
 int gvl_file_end_read(geovol_file *);
 int gvl_file_end_read(geovol_file *);
@@ -714,7 +714,7 @@ int gvl_file_set_slices_param(geovol_file *, int, int);
 void gvl_file_get_min_max(geovol_file *, double *, double *);
 void gvl_file_get_min_max(geovol_file *, double *, double *);
 
 
 /* From Gvl3.c */
 /* 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_unload_colors_data(void *);
 int Gvl_get_color_for_value(void *, float *);
 int Gvl_get_color_for_value(void *, float *);
 
 
@@ -722,7 +722,7 @@ int Gvl_get_color_for_value(void *, float *);
 int gvl_isosurf_calc(geovol *);
 int gvl_isosurf_calc(geovol *);
 int gvl_slices_calc(geovol *);
 int gvl_slices_calc(geovol *);
 void gvl_write_char(int, unsigned char **, unsigned char);
 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 *);
 void gvl_align_data(int, unsigned char *);
 
 
 /* From gvld.c */
 /* From gvld.c */
@@ -743,7 +743,7 @@ void gsd_fringe_vert_poly (float, geosurf *, int, int);
 void gsd_fringe_vert_line (float, geosurf *, int, int);
 void gsd_fringe_vert_line (float, geosurf *, int, int);
 
 
 /* from gsd_legend.c */
 /* 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_bgn_legend_viewport(GLint, GLint, GLint, GLint);
 void gsd_end_legend_viewport(void);
 void gsd_end_legend_viewport(void);
 int gsd_make_nice_number(float *);
 int gsd_make_nice_number(float *);

+ 5 - 18
lib/g3d/find_grid3.c

@@ -11,28 +11,15 @@
  *      if name is of the form nnn in ppp then
  *      if name is of the form nnn in ppp then
  *      name = nnn and mapset = ppp
  *      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
  *  \return char *  pointer to a string with name of mapset
  *              where cell file was found, or NULL if not found
  *              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);
 }
 }

+ 5 - 5
lib/g3d/g3dcolor.c

@@ -10,14 +10,14 @@
 #include <grass/gis.h>
 #include <grass/gis.h>
 #include "G3d_intern.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_new_colors(FILE *,struct Colors *);
 static int read_old_colors(FILE *,struct Colors *);
 static int read_old_colors(FILE *,struct Colors *);
 
 
 /*---------------------------------------------------------------------------*/
 /*---------------------------------------------------------------------------*/
 
 
 int
 int
-G3d_removeColor  (char *name)
+G3d_removeColor  (const char *name)
  /* adapted from G_remove_colr */
  /* adapted from G_remove_colr */
 
 
 
 
@@ -44,7 +44,7 @@ G3d_removeColor  (char *name)
 /*---------------------------------------------------------------------------*/
 /*---------------------------------------------------------------------------*/
 
 
 int
 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 */
  /* adapted from G_read_colors */
 
 
 
 
@@ -102,7 +102,7 @@ G3d_readColors  (char *name, char *mapset, struct Colors *colors)
   return -1;
   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 ;
     FILE *fd ;
     int stat;
     int stat;
@@ -357,7 +357,7 @@ static int read_old_colors ( FILE *fd, struct Colors *colors )
 /*---------------------------------------------------------------------------*/
 /*---------------------------------------------------------------------------*/
 
 
 int
 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 */
  /* adapted from G_write_colors */
 
 
 
 

+ 3 - 3
lib/g3d/g3dopen.c

@@ -10,7 +10,7 @@
 /*---------------------------------------------------------------------------*/
 /*---------------------------------------------------------------------------*/
 
 
 void *
 void *
-G3d_openCellOldNoHeader  (char *name, char *mapset)
+G3d_openCellOldNoHeader  (const char *name, const char *mapset)
 
 
 {
 {
   G3D_Map *map;
   G3D_Map *map;
@@ -84,7 +84,7 @@ G3d_openCellOldNoHeader  (char *name, char *mapset)
  */
  */
 
 
 void *
 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; 
   G3D_Map *map; 
@@ -214,7 +214,7 @@ G3d_openCellOld  (char *name, char *mapset, G3D_Region *window, int typeIntern,
  */
  */
 
 
 void *
 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;
   G3D_Map *map;

+ 1 - 1
lib/g3d/g3drange.c

@@ -48,7 +48,7 @@ G3d_range_updateFromTile  (G3D_Map *map, char *tile, int rows, int cols, int dep
 /*---------------------------------------------------------------------------*/
 /*---------------------------------------------------------------------------*/
 
 
 int
 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 */
  /* adapted from G_read_fp_range */
 {
 {
   int fd;
   int fd;

+ 1 - 1
lib/ogsf/GK2.c

@@ -209,7 +209,7 @@ void GK_update_tension(void)
 
 
   \param name filename
   \param name filename
 */
 */
-void GK_print_keys(char *name)
+void GK_print_keys(const char *name)
 {
 {
     Keylist *k;
     Keylist *k;
     FILE *fp;
     FILE *fp;

+ 2 - 2
lib/ogsf/GP2.c

@@ -181,7 +181,7 @@ int GP_delete_site(int id)
   \return -1 on error
   \return -1 on error
   \return 1 on success
   \return 1 on success
 */
 */
-int GP_load_site(int id, char *filename)
+int GP_load_site(int id, const char *filename)
 {
 {
     geosite *gp;
     geosite *gp;
 
 
@@ -290,7 +290,7 @@ int GP_set_sitemode(int id, int atmod, int color, int width, float size,
   \return 0 for no attribute info
   \return 0 for no attribute info
   \return -1 for bad parameter
   \return -1 for bad parameter
 */
 */
-int GP_attmode_color(int id, char *filename)
+int GP_attmode_color(int id, const char *filename)
 {
 {
     geosite *gp;
     geosite *gp;
 
 

+ 5 - 5
lib/ogsf/GS2.c

@@ -822,7 +822,7 @@ void GS_draw_fringe(int id, unsigned long clr, float elev, int *where)
   \param range values range
   \param range values range
   \param pt ?
   \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)
 	       float *range, int *pt)
 {
 {
     int list_no;
     int list_no;
@@ -1584,12 +1584,12 @@ int GS_delete_surface(int id)
   \return -1 on error (invalid surface id)
   \return -1 on error (invalid surface id)
   \return ?
   \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;
     geosurf *gs;
     unsigned int changed;
     unsigned int changed;
     unsigned int atty;
     unsigned int atty;
-    char *mapset;
+    const char *mapset;
     struct Cell_head rast_head;
     struct Cell_head rast_head;
     int reuse = 0, begin, hdata, ret, neg = 0, has_null = 0;
     int reuse = 0, begin, hdata, ret, neg = 0, has_null = 0;
     typbuff *tbuff;
     typbuff *tbuff;
@@ -3242,7 +3242,7 @@ int GS_get_distance_alongsurf(int hs, float x1, float y1, float x2, float y2,
 
 
   \return ?
   \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)));
     return (Gs_save_3dview(vname, &Gv, &Gd, &wind, gs_get_surf(surfid)));
 }
 }
@@ -3255,7 +3255,7 @@ int GS_save_3dview(char *vname, int surfid)
 
 
   \return ?
   \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)));
     return (Gs_load_3dview(vname, &Gv, &Gd, &wind, gs_get_surf(surfid)));

+ 1 - 1
lib/ogsf/GS_util.c

@@ -52,7 +52,7 @@
 
 
   \return distance between two geographic coordinates in current projection
   \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;
     double meters;
 
 

+ 1 - 1
lib/ogsf/GV2.c

@@ -171,7 +171,7 @@ int GV_delete_vector(int id)
   \return -1 on error (invalid vector set id)
   \return -1 on error (invalid vector set id)
   \return 1 on success
   \return 1 on success
 */
 */
-int GV_load_vector(int id, char *filename)
+int GV_load_vector(int id, const char *filename)
 {
 {
     geovect *gv;
     geovect *gv;
 
 

+ 2 - 2
lib/ogsf/GVL2.c

@@ -229,7 +229,7 @@ int GVL_delete_vol(int id)
   \return -1 on error
   \return -1 on error
   \return 0 on success
   \return 0 on success
 */
 */
-int GVL_load_vol(int id, char *filename)
+int GVL_load_vol(int id, const char *filename)
 {
 {
     geovol *gvl;
     geovol *gvl;
     int handle;
     int handle;
@@ -843,7 +843,7 @@ int GVL_isosurf_set_att_const(int id, int isosurf_id, int att, float constant)
   \return ?
   \return ?
   \return -1 on error
   \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;
     geovol_isosurf *isosurf;
 
 

+ 5 - 5
lib/ogsf/Gp3.c

@@ -38,9 +38,9 @@
   \return 1 on success
   \return 1 on success
   \return 0 on failure
   \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;
     struct Colors sc;
     CELL cat;
     CELL cat;
     geopoint *tp;
     geopoint *tp;
@@ -87,7 +87,7 @@ int Gp_set_color(char *grassname, geopoint * gp)
   \return pointer to geopoint struct
   \return pointer to geopoint struct
   \return NULL on failure
   \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)
 			int *has_att)
 {
 {
     struct Map_info map;
     struct Map_info map;
@@ -98,13 +98,13 @@ geopoint *Gp_load_sites(char *grassname, int *nsites, int *has_z,
     struct Cell_head wind;
     struct Cell_head wind;
     RASTER_MAP_TYPE rtype;
     RASTER_MAP_TYPE rtype;
     int ndim;
     int ndim;
-    char *mapset;
+    const char *mapset;
 
 
     np = 0;
     np = 0;
     eof = 0;
     eof = 0;
     *has_z = *has_att = 0;
     *has_z = *has_att = 0;
 
 
-    mapset = G_find_vector2((const char *) grassname, "");
+    mapset = G_find_vector2(grassname, "");
     if (!mapset) {
     if (!mapset) {
 	G_warning (_("Vector map <%s> not found"),
 	G_warning (_("Vector map <%s> not found"),
 		   grassname);
 		   grassname);

+ 39 - 34
lib/ogsf/Gs3.c

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

+ 3 - 3
lib/ogsf/Gv3.c

@@ -40,7 +40,7 @@ static int Tot_mem = 0;
   \return pointer to geoline struct
   \return pointer to geoline struct
   \return NULL on failure
   \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 Map_info map;
     struct line_pnts *points;
     struct line_pnts *points;
@@ -48,9 +48,9 @@ geoline *Gv_load_vect(char *grassname, int *nlines)
     int np, i, n, nareas, nl=0, area, type, is3d;
     int np, i, n, nareas, nl=0, area, type, is3d;
     struct Cell_head  wind;
     struct Cell_head  wind;
     float vect[2][3];
     float vect[2][3];
-    char *mapset;
+    const char *mapset;
 
 
-    mapset = G_find_vector2((const char *) grassname, "");
+    mapset = G_find_vector2(grassname, "");
     if (!mapset) {
     if (!mapset) {
 	G_warning(_("Vector map <%s> not found"),
 	G_warning(_("Vector map <%s> not found"),
 		  grassname);
 		  grassname);

+ 2 - 2
lib/ogsf/Gvl3.c

@@ -30,9 +30,9 @@
   \return -1 on failure
   \return -1 on failure
   \return 1 on success
   \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;
     struct Colors *colors;
 
 
     if (NULL == (mapset = G_find_grid3(name,""))) {
     if (NULL == (mapset = G_find_grid3(name,""))) {

+ 1 - 1
lib/ogsf/gs.c

@@ -31,7 +31,7 @@ static geosurf *Surf_top;
 static int Invertmask;
 static int Invertmask;
 
 
 /***********************************************************************/
 /***********************************************************************/
-void gs_err(char *msg)
+void gs_err(const char *msg)
 {
 {
     G_warning ("%s", msg);
     G_warning ("%s", msg);
 
 

+ 5 - 5
lib/ogsf/gsd_fonts.c

@@ -34,7 +34,7 @@
 
 
   \return text width
   \return text width
 */
 */
-int gsd_get_txtwidth(char *s, int size)
+int gsd_get_txtwidth(const char *s, int size)
 {
 {
     int width, len;
     int width, len;
 
 
@@ -70,7 +70,7 @@ int gsd_get_txtheight(int size)
 
 
   \return 2
   \return 2
 */
 */
-int get_txtdescender()
+int get_txtdescender(void)
 {
 {
     return (2);
     return (2);
 }
 }
@@ -84,7 +84,7 @@ int get_txtdescender()
 
 
   \return 0
   \return 0
 */
 */
-int get_txtxoffset()
+int get_txtxoffset(void)
 {
 {
     return (0);
     return (0);
 }
 }
@@ -96,11 +96,11 @@ int get_txtxoffset()
   \param lab_pos label position
   \param lab_pos label position
   \param txt text string
   \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]);
     glRasterPos2f(lab_pos[X], lab_pos[Y]);
     glListBase(fontbase);
     glListBase(fontbase);
-    glCallLists(strlen(txt), GL_BYTE, (GLubyte *) txt);
+    glCallLists(strlen(txt), GL_UNSIGNED_BYTE, (const GLvoid *) txt);
 
 
     return;
     return;
 }
 }

+ 1 - 1
lib/ogsf/gsd_label.c

@@ -38,7 +38,7 @@ GLuint label_id;
   \param color font color
   \param color font color
   \param pt 
   \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*pt)
 {
 {
     int txt_width;
     int txt_width;

+ 4 - 3
lib/ogsf/gsd_legend.c

@@ -198,7 +198,7 @@ int gsd_make_nice_number(float *num)
 
 
   \return
   \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)
 		      float *rangef, int *pt)
 {
 {
     GLint sl, sr, sb, st;
     GLint sl, sr, sb, st;
@@ -208,7 +208,7 @@ GLuint gsd_put_legend(char *name, GLuint fontbase, int size, int *flags,
     struct Categories cats;
     struct Categories cats;
     struct Range range;
     struct Range range;
     struct FPRange fp_range;
     struct FPRange fp_range;
-    char *mapset;
+    const char *mapset;
     struct Colors colors;
     struct Colors colors;
     CELL min, max;
     CELL min, max;
     DCELL fmin, fmax;
     DCELL fmin, fmax;
@@ -370,7 +370,8 @@ GLuint gsd_put_legend(char *name, GLuint fontbase, int size, int *flags,
 	float *dividers;
 	float *dividers;
 	int labw, maxlabw, numlabs;
 	int labw, maxlabw, numlabs;
 	float labpos, labpt[3];
 	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 */
 	GLint wt, wb, wl, wr;	/* Whole legend area, not just box */
 	int xoff, yoff;
 	int xoff, yoff;
 	int incr;		/* for do_invert */
 	int incr;		/* for do_invert */

+ 2 - 2
lib/ogsf/gsd_objs.c

@@ -825,7 +825,7 @@ void dir_to_slope_aspect(float *dir, float *slope, float *aspect, int degrees)
 int gsd_north_arrow (float *pos2, float len, GLuint fontbase,
 int gsd_north_arrow (float *pos2, float len, GLuint fontbase,
 		     unsigned long arw_clr, unsigned long text_clr)
 		     unsigned long arw_clr, unsigned long text_clr)
 {
 {
-    char *txt;
+    const char *txt;
     float v[4][3];
     float v[4][3];
     float base[3][3];
     float base[3][3];
     float Ntop[] = { 0.0, 0.0, 1.0 };
     float Ntop[] = { 0.0, 0.0, 1.0 };
@@ -889,7 +889,7 @@ int gsd_north_arrow (float *pos2, float len, GLuint fontbase,
 
 
     glRasterPos3fv(base[0]);
     glRasterPos3fv(base[0]);
     glListBase(fontbase);
     glListBase(fontbase);
-    glCallLists(strlen(txt), GL_BYTE, (GLubyte *) txt);
+    glCallLists(strlen(txt), GL_UNSIGNED_BYTE, (const GLvoid *) txt);
     GS_done_draw();
     GS_done_draw();
 
 
     gsd_popmatrix();        
     gsd_popmatrix();        

+ 2 - 2
lib/ogsf/gsds.c

@@ -185,7 +185,7 @@ static int get_type(dataset * ds)
   \return data id
   \return data id
   \return -1 not found
   \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;
     static int i;
     int start;
     int start;
@@ -216,7 +216,7 @@ int gsds_findh(char *name, IFLAG * changes, IFLAG * types, int begin)
   \return -1 on failure
   \return -1 on failure
   \return data id
   \return data id
 */
 */
-int gsds_newh(char *name)
+int gsds_newh(const char *name)
 {
 {
     dataset *new;
     dataset *new;
     static int first = 1;
     static int first = 1;

+ 1 - 1
lib/ogsf/gvl.c

@@ -667,7 +667,7 @@ int gvl_isosurf_set_att_const(geovol_isosurf *isosurf, int desc, float constant)
   \return -1 on failure
   \return -1 on failure
   \return 1 on success
   \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;
     int hfile;
 
 

+ 1 - 1
lib/ogsf/gvl_calc.c

@@ -747,7 +747,7 @@ void gvl_write_char(int pos, unsigned char **data, unsigned char c)
 
 
   \param char
   \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];
     return data[pos];
 }
 }

+ 6 - 6
lib/ogsf/gvl_file.c

@@ -59,7 +59,7 @@ static int Cur_max;
 static int Rows, Cols, Depths;
 static int Rows, Cols, Depths;
 
 
 /* local functions prototypes */
 /* 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 *);
 int close_g3d_file(void *);
 
 
 /*!
 /*!
@@ -137,7 +137,7 @@ geovol_file *gvl_file_get_volfile(int id)
   \param data id
   \param data id
   \param -1 not found
   \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;
     static int i;
     int start;
     int start;
@@ -230,7 +230,7 @@ void gvl_file_get_min_max(geovol_file *vf, double *min, double *max)
   \return pointer to file
   \return pointer to file
   \return NULL on failure
   \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) {
      if (file_type == VOL_FTYPE_G3D) {
         return open_g3d_file(name, data_type, min, max);
         return open_g3d_file(name, data_type, min, max);
@@ -266,7 +266,7 @@ int close_volfile(void *map, IFLAG type)
   \return data id
   \return data id
   \return -1 on failure
   \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;
     geovol_file *new;
     static int first = 1;
     static int first = 1;
@@ -409,9 +409,9 @@ int gvl_file_free_datah(int id)
 
 
   \pointer to data
   \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;
     int itype;
     void *map;
     void *map;
 
 

+ 1 - 1
lib/ogsf/gvld.c

@@ -238,7 +238,7 @@ int gvld_isosurf(geovol * gvl)
 	nz[i] = 0;
 	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++) {
     for (z = 0; z < depths - 1; z++) {
 	zc = z * zres;
 	zc = z * zres;