]> git.eshelyaron.com Git - emacs.git/commitdiff
Use const char* instead of char*.
authorDan Nicolaescu <dann@ics.uci.edu>
Mon, 9 Aug 2010 09:35:21 +0000 (02:35 -0700)
committerDan Nicolaescu <dann@ics.uci.edu>
Mon, 9 Aug 2010 09:35:21 +0000 (02:35 -0700)
Reduce the number of warnings with -Wwrite-strings.
* src/xrdb.c (get_environ_db, get_system_name):
* src/unexelf.c (find_section):
* src/term.c (string_cost, string_cost_one_line, per_line_cost)
(get_named_tty, init_tty):
* src/sysdep.c (sys_subshell):
* src/sound.c (sound_perror, sound_warning, vox_open, vox_init)
(alsa_sound_perror, alsa_open, alsa_configure, alsa_init):
* src/search.c (Freplace_match):
* src/process.c (Fmake_network_process, send_process, init_process):
* src/lread.c (Fload, init_lread):
* src/keymap.c (Fdescribe_buffer_bindings, describe_map_tree):
* src/keyboard.c (parse_tool_bar_item, struct event_head):
* src/gtkutil.h (xg_get_font_name):
* src/gtkutil.c (get_dialog_title, create_dialog, xg_get_font_name)
(make_widget_for_menu_item, make_menu_item, create_menus)
(xg_make_tool_item):
* src/font.c (parse_matrix, font_parse_name):
* src/floatfns.c (rounding_driver, float_error_fn_name):
* src/filelock.c (get_boot_time_1, lock_file_1):
* src/fileio.c (barf_or_query_if_file_exists, check_writable):
* src/editfns.c (get_system_name, get_operating_system_release)
(Fencode_time, Fset_time_zone_rule):
* src/dispextern.h (string_cost, per_line_cost, get_named_tty, init_tty):
* src/buffer.c (defvar_per_buffer): Use const.

21 files changed:
src/ChangeLog
src/buffer.c
src/dispextern.h
src/editfns.c
src/fileio.c
src/filelock.c
src/floatfns.c
src/font.c
src/gtkutil.c
src/gtkutil.h
src/keyboard.c
src/keymap.c
src/keymap.h
src/lread.c
src/process.c
src/search.c
src/sound.c
src/sysdep.c
src/term.c
src/unexelf.c
src/xrdb.c

index 405a3f346e73adccd541074a8decabab0e0943be..6fd89a6339d38aa477fe42b5afd24cbee4d2cb1a 100644 (file)
@@ -1,3 +1,32 @@
+2010-08-09  Dan Nicolaescu  <dann@ics.uci.edu>
+
+       Use const char* instead of char*.
+       Reduce the number of warnings with -Wwrite-strings.
+       * xrdb.c (get_environ_db, get_system_name):
+       * unexelf.c (find_section):
+       * term.c (string_cost, string_cost_one_line, per_line_cost)
+       (get_named_tty, init_tty):
+       * sysdep.c (sys_subshell):
+       * sound.c (sound_perror, sound_warning, vox_open, vox_init)
+       (alsa_sound_perror, alsa_open, alsa_configure, alsa_init):
+       * search.c (Freplace_match):
+       * process.c (Fmake_network_process, send_process, init_process):
+       * lread.c (Fload, init_lread):
+       * keymap.c (Fdescribe_buffer_bindings, describe_map_tree):
+       * keyboard.c (parse_tool_bar_item, struct event_head):
+       * gtkutil.h (xg_get_font_name):
+       * gtkutil.c (get_dialog_title, create_dialog, xg_get_font_name)
+       (make_widget_for_menu_item, make_menu_item, create_menus)
+       (xg_make_tool_item):
+       * font.c (parse_matrix, font_parse_name):
+       * floatfns.c (rounding_driver, float_error_fn_name):
+       * filelock.c (get_boot_time_1, lock_file_1):
+       * fileio.c (barf_or_query_if_file_exists, check_writable):
+       * editfns.c (get_system_name, get_operating_system_release)
+       (Fencode_time, Fset_time_zone_rule):
+       * dispextern.h (string_cost, per_line_cost, get_named_tty, init_tty):
+       * buffer.c (defvar_per_buffer): Use const.
+
 2010-08-08  Kenichi Handa  <handa@m17n.org>
 
        * charset.c: Include <stdlib.h>
index 7d42489dd30b2c2003b06a592743eb28fcb07187..39fabf581bb7343b2213f2ff9e5f941fdfd5ca55 100644 (file)
@@ -5283,7 +5283,7 @@ init_buffer (void)
   } while (0)
 
 static void
-defvar_per_buffer (struct Lisp_Buffer_Objfwd *bo_fwd, char *namestring,
+defvar_per_buffer (struct Lisp_Buffer_Objfwd *bo_fwd, const char *namestring,
                   Lisp_Object *address, Lisp_Object type, char *doc)
 {
   struct Lisp_Symbol *sym;
index 44ea43492508bd215331d1aba23c980e0ba4c7b2..c36db91ea024c4c506e37f3d5048adf45f562709 100644 (file)
@@ -3275,18 +3275,18 @@ extern void tty_set_terminal_modes (struct terminal *);
 extern void tty_reset_terminal_modes (struct terminal *);
 extern void tty_turn_off_insert (struct tty_display_info *);
 extern void tty_turn_off_highlight (struct tty_display_info *);
-extern int string_cost (char *);
-extern int per_line_cost (char *);
+extern int string_cost (const char *);
+extern int per_line_cost (const char *);
 extern void calculate_costs (struct frame *);
 extern void produce_glyphs (struct it *);
 extern void produce_special_glyphs (struct it *, enum display_element_type);
 extern int tty_capable_p (struct tty_display_info *, unsigned, unsigned long, unsigned long);
 extern void set_tty_color_mode (struct tty_display_info *, struct frame *);
 extern struct terminal *get_tty_terminal (Lisp_Object, int);
-extern struct terminal *get_named_tty (char *);
+extern struct terminal *get_named_tty (const char *);
 EXFUN (Ftty_type, 1);
 extern void create_tty_output (struct frame *);
-extern struct terminal *init_tty (char *, char *, int);
+extern struct terminal *init_tty (const char *, const char *, int);
 
 
 /* Defined in scroll.c */
index 0e034cc76fd2a78d5e6adf014f2e75b4889c9b3d..1bd6682c3b605fbb714973f119712f81315375ca 100644 (file)
@@ -1404,16 +1404,16 @@ DEFUN ("system-name", Fsystem_name, Ssystem_name, 0, 0, 0,
 
 /* For the benefit of callers who don't want to include lisp.h */
 
-char *
+const char *
 get_system_name (void)
 {
   if (STRINGP (Vsystem_name))
-    return (char *) SDATA (Vsystem_name);
+    return (const char *) SDATA (Vsystem_name);
   else
     return "";
 }
 
-char *
+const char *
 get_operating_system_release (void)
 {
   if (STRINGP (Voperating_system_release))
@@ -1819,7 +1819,7 @@ usage: (encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE)  */)
   else
     {
       char tzbuf[100];
-      char *tzstring;
+      const char *tzstring;
       char **oldenv = environ, **newenv;
 
       if (EQ (zone, Qt))
@@ -2001,7 +2001,7 @@ If TZ is nil, use implementation-defined default time zone information.
 If TZ is t, use Universal Time.  */)
   (Lisp_Object tz)
 {
-  char *tzstring;
+  const char *tzstring;
 
   /* When called for the first time, save the original TZ.  */
   if (!environbuf)
index f4bad89d0c09fdb0e20f0a3a316597807f3a72ef..a04cd4e76f50af9c0b6cb23902281f4f1c8922eb 100644 (file)
@@ -1823,7 +1823,7 @@ expand_and_dir_to_file (Lisp_Object filename, Lisp_Object defdir)
    If QUICK is nonzero, we ask for y or n, not yes or no.  */
 
 void
-barf_or_query_if_file_exists (Lisp_Object absname, unsigned char *querystring, int interactive, struct stat *statptr, int quick)
+barf_or_query_if_file_exists (Lisp_Object absname, const unsigned char *querystring, int interactive, struct stat *statptr, int quick)
 {
   register Lisp_Object tem, encoded_filename;
   struct stat statbuf;
@@ -2473,7 +2473,7 @@ check_executable (char *filename)
 /* Return nonzero if file FILENAME exists and can be written.  */
 
 static int
-check_writable (char *filename)
+check_writable (const char *filename)
 {
 #ifdef MSDOS
   struct stat st;
index 25ca23fdee4b41a8cf908f4e982bcbe2c8ab9cda..15ed546bc506c58bd86f6fa47489fd5b5eed35f5 100644 (file)
@@ -118,7 +118,7 @@ static time_t boot_time;
 static int boot_time_initialized;
 
 #ifdef BOOT_TIME
-static void get_boot_time_1 (char *, int);
+static void get_boot_time_1 (const char *, int);
 #endif
 
 static time_t
@@ -249,7 +249,7 @@ get_boot_time (void)
    Success is indicated by setting BOOT_TIME to a larger value.  */
 
 void
-get_boot_time_1 (char *filename, int newest)
+get_boot_time_1 (const char *filename, int newest)
 {
   struct utmp ut, *utp;
   int desc;
@@ -360,8 +360,8 @@ lock_file_1 (char *lfname, int force)
 {
   register int err;
   time_t boot_time;
-  char *user_name;
-  char *host_name;
+  const char *user_name;
+  const char *host_name;
   char *lock_info_str;
 
   /* Call this first because it can GC.  */
index 4c1548cfd8f16909d1bd0bb584b627acac78bb92..1c3e40eefde094535114b02a2e1c8c0188827895 100644 (file)
@@ -117,7 +117,7 @@ static int in_float;
 
 static Lisp_Object float_error_arg, float_error_arg2;
 
-static char *float_error_fn_name;
+static const char *float_error_fn_name;
 
 /* Evaluate the floating point expression D, recording NUM
    as the original argument for error messages.
@@ -746,7 +746,7 @@ static Lisp_Object
 rounding_driver (Lisp_Object arg, Lisp_Object divisor,
                 double (*double_round) (double),
                 EMACS_INT (*int_round2) (EMACS_INT, EMACS_INT),
-                char *name)
+                const char *name)
 {
   CHECK_NUMBER_OR_FLOAT (arg);
 
index f902ff4c5880ca049c956a061c7ea6344e84ef52..1ac994d6375aa67cab7a2c6529fb45eb342a4cbf 100644 (file)
@@ -699,9 +699,9 @@ font_put_extra (Lisp_Object font, Lisp_Object prop, Lisp_Object val)
 \f
 /* Font name parser and unparser */
 
-static int parse_matrix (char *);
+static int parse_matrix (const char *);
 static int font_expand_wildcards (Lisp_Object *, int);
-static int font_parse_name (char *, Lisp_Object);
+static int font_parse_name (const char *, Lisp_Object);
 
 /* An enumerator for each field of an XLFD font name.  */
 enum xlfd_field_index
@@ -758,7 +758,7 @@ enum xlfd_field_mask
    -1.  */
 
 static int
-parse_matrix (char *p)
+parse_matrix (const char *p)
 {
   double matrix[4];
   char *end;
@@ -1765,7 +1765,7 @@ font_unparse_gtkname (Lisp_Object font, struct frame *f, char *name, int nbytes)
    0.  Otherwise return -1.  */
 
 static int
-font_parse_name (char *name, Lisp_Object font)
+font_parse_name (const char *name, Lisp_Object font)
 {
   if (name[0] == '-' || strchr (name, '*') || strchr (name, '?'))
     return font_parse_xlfd (name, font);
index bef52afd9e8fb396ec399865be4dcba1ddbba439..b1591b79f9c85f914b87a22cb7954cfd8f57d992 100644 (file)
@@ -1183,10 +1183,10 @@ xg_set_frame_icon (FRAME_PTR f, Pixmap icon_pixmap, Pixmap icon_mask)
 /* Return the dialog title to use for a dialog of type KEY.
    This is the encoding used by lwlib.  We use the same for GTK.  */
 
-static char *
+static const char *
 get_dialog_title (char key)
 {
-  char *title = "";
+  const char *title = "";
 
   switch (key) {
   case 'E': case 'e':
@@ -1243,7 +1243,7 @@ create_dialog (widget_value *wv,
                GCallback select_cb,
                GCallback deactivate_cb)
 {
-  char *title = get_dialog_title (wv->name[0]);
+  const char *title = get_dialog_title (wv->name[0]);
   int total_buttons = wv->name[1] - '0';
   int right_buttons = wv->name[4] - '0';
   int left_buttons;
@@ -1761,7 +1761,7 @@ xg_get_file_name (FRAME_PTR f,
    DEFAULT_NAME, if non-zero, is the default font name.  */
 
 char *
-xg_get_font_name (FRAME_PTR f, char *default_name)
+xg_get_font_name (FRAME_PTR f, const char *default_name)
 {
   GtkWidget *w;
   char *fontname = NULL;
@@ -1971,7 +1971,7 @@ menu_destroy_callback (GtkWidget *w, gpointer client_data)
    Returns the GtkHBox.  */
 
 static GtkWidget *
-make_widget_for_menu_item (char *utf8_label, char *utf8_key)
+make_widget_for_menu_item (const char *utf8_label, const char *utf8_key)
 {
   GtkWidget *wlbl;
   GtkWidget *wkey;
@@ -2009,8 +2009,8 @@ make_widget_for_menu_item (char *utf8_label, char *utf8_key)
    but the MacOS X version doesn't either, so I guess that is OK.  */
 
 static GtkWidget *
-make_menu_item (char *utf8_label,
-                char *utf8_key,
+make_menu_item (const char *utf8_label,
+                const char *utf8_key,
                 widget_value *item,
                 GSList **group)
 {
@@ -2238,7 +2238,7 @@ create_menus (widget_value *data,
               int add_tearoff_p,
               GtkWidget *topmenu,
               xg_menu_cb_data *cl_data,
-              char *name)
+              const char *name)
 {
   widget_value *item;
   GtkWidget *wmenu = topmenu;
@@ -3977,7 +3977,7 @@ static GtkToolItem *
 xg_make_tool_item (FRAME_PTR f,
                    GtkWidget *wimage,
                    GtkWidget **wbutton,
-                   char *label,
+                   const char *label,
                    int i)
 {
   GtkToolItem *ti = gtk_tool_item_new ();
index b09c82aeb0eb7e21bb852d86803dfb8ef6b42d6b..75620c54d10f8ea29f928cffabaeec23b3e6ab20 100644 (file)
@@ -133,7 +133,7 @@ extern char *xg_get_file_name (FRAME_PTR f,
                                int mustmatch_p,
                                int only_dir_p);
 
-extern char *xg_get_font_name (FRAME_PTR f, char *);
+extern char *xg_get_font_name (FRAME_PTR f, const char *);
 
 extern GtkWidget *xg_create_widget (const char *type,
                                     const char *name,
index f12395544b98e1755c2c9b356416d6fe0a43cb94..1ec3fbe7460855616a41b89edcccaff9e31468fd 100644 (file)
@@ -8326,8 +8326,8 @@ parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
       /* Try to make one from caption and key.  */
       Lisp_Object key = PROP (TOOL_BAR_ITEM_KEY);
       Lisp_Object capt = PROP (TOOL_BAR_ITEM_CAPTION);
-      char *label = SYMBOLP (key) ? (char *) SDATA (SYMBOL_NAME (key)) : "";
-      char *caption = STRINGP (capt) ? (char *) SDATA (capt) : "";
+      const char *label = SYMBOLP (key) ? (char *) SDATA (SYMBOL_NAME (key)) : "";
+      const char *caption = STRINGP (capt) ? (char *) SDATA (capt) : "";
       char buf[64];
       EMACS_INT max_lbl = 2*tool_bar_max_label_size;
       Lisp_Object new_lbl;
@@ -11532,7 +11532,7 @@ init_keyboard (void)
    event header symbols and put properties on them.  */
 struct event_head {
   Lisp_Object *var;
-  char *name;
+  const char *name;
   Lisp_Object *kind;
 };
 
index 166ec4fa22480856156dc4038e6c031f6b65bf25..cc25d350d44004b34ede6742bf20a102d9cc9c17 100644 (file)
@@ -2962,7 +2962,7 @@ The optional argument MENUS, if non-nil, says to mention menu bindings.
   register Lisp_Object start1;
   struct gcpro gcpro1;
 
-  char *alternate_heading
+  const char *alternate_heading
     = "\
 Keyboard translations:\n\n\
 You type        Translation\n\
@@ -3134,13 +3134,13 @@ You type        Translation\n\
 
 void
 describe_map_tree (Lisp_Object startmap, int partial, Lisp_Object shadow,
-                  Lisp_Object prefix, char *title, int nomenu, int transl,
+                  Lisp_Object prefix, const char *title, int nomenu, int transl,
                   int always_title, int mention_shadow)
 {
   Lisp_Object maps, orig_maps, seen, sub_shadows;
   struct gcpro gcpro1, gcpro2, gcpro3;
   int something = 0;
-  char *key_heading
+  const char *key_heading
     = "\
 key             binding\n\
 ---             -------\n";
index b47d4e8aa5b9c1336e0441b29bfc062208b6dead..c68d763204db0ad330111f65744e45ce9c34fd0f 100644 (file)
@@ -43,7 +43,7 @@ extern Lisp_Object get_keyelt (Lisp_Object, int);
 extern Lisp_Object get_keymap (Lisp_Object, int, int);
 EXFUN (Fset_keymap_parent, 2);
 extern void describe_map_tree (Lisp_Object, int, Lisp_Object, Lisp_Object,
-                               char *, int, int, int, int);
+                               const char *, int, int, int, int);
 extern int current_minor_maps (Lisp_Object **, Lisp_Object **);
 extern void initial_define_key (Lisp_Object, int, const char *);
 extern void initial_define_lispy_key (Lisp_Object, const char *, const char *);
index c69c9fadcb99403c008f4dcc51686c8cd7bb25b2..b616e30c3c659ffa82afb38482dd75900925a8a3 100644 (file)
@@ -984,7 +984,7 @@ Return t if the file exists and loads successfully.  */)
   int compiled = 0;
   Lisp_Object handler;
   int safe_p = 1;
-  char *fmode = "r";
+  const char *fmode = "r";
   Lisp_Object tmp[2];
   int version;
 
@@ -3971,7 +3971,7 @@ static Lisp_Object dump_path;
 void
 init_lread (void)
 {
-  char *normal;
+  const char *normal;
   int turn_off_warning = 0;
 
   /* Compute the default load-path.  */
index 36f5a7d5adb3612975e9009bc26123b4e9fe3c35..4a6586230775bac62d5fac2367071611f0ab44a4 100644 (file)
@@ -180,7 +180,7 @@ extern Lisp_Object QCfilter;
 #define SIGCHLD SIGCLD
 #endif /* SIGCLD */
 
-extern char *get_operating_system_release (void);
+extern const char *get_operating_system_release (void);
 
 /* Serial processes require termios or Windows.  */
 #if defined (HAVE_TERMIOS) || defined (WINDOWSNT)
@@ -3033,7 +3033,8 @@ usage: (make-network-process &rest ARGS)  */)
 #ifdef HAVE_GETADDRINFO
   struct addrinfo ai, *res, *lres;
   struct addrinfo hints;
-  char *portstring, portbuf[128];
+  const char *portstring;
+  char portbuf[128];
 #else /* HAVE_GETADDRINFO */
   struct _emacs_addrinfo
   {
@@ -5415,7 +5416,7 @@ send_process_trap (int ignore)
    This function can evaluate Lisp code and can garbage collect.  */
 
 static void
-send_process (volatile Lisp_Object proc, unsigned char *volatile buf,
+send_process (volatile Lisp_Object proc, const unsigned char *volatile buf,
              volatile int len, volatile Lisp_Object object)
 {
   /* Use volatile to protect variables from being clobbered by longjmp.  */
@@ -7423,7 +7424,7 @@ init_process (void)
      processes.  As such, we only change the default value.  */
  if (initialized)
   {
-    char *release = get_operating_system_release ();
+    const char *release = get_operating_system_release ();
     if (!release || !release[0] || (release[0] < MIN_PTY_KERNEL_VERSION
                                    && release[1] == '.')) {
       Vprocess_connection_type = Qnil;
index fbbc59f631d3ddd93aca1aa62849fb30843416cf..0e9840b2e5f20221a8a12dc9fa120b12e3141707 100644 (file)
@@ -2655,7 +2655,7 @@ since only regular expressions have distinguished subexpressions.  */)
       for (pos_byte = 0, pos = 0; pos_byte < length;)
        {
          unsigned char str[MAX_MULTIBYTE_LENGTH];
-         unsigned char *add_stuff = NULL;
+         const unsigned char *add_stuff = NULL;
          int add_len = 0;
          int idx = -1;
 
index 2b23ae400a71e35d9defbffe1002a52f6f74505e..55804c328a8bdaeef3963e379f5c19a0f8483451 100644 (file)
@@ -115,10 +115,10 @@ enum sound_attr
 };
 
 #ifdef HAVE_ALSA
-static void alsa_sound_perror (char *, int) NO_RETURN;
+static void alsa_sound_perror (const char *, int) NO_RETURN;
 #endif
-static void sound_perror (char *) NO_RETURN;
-static void sound_warning (char *);
+static void sound_perror (const char *) NO_RETURN;
+static void sound_warning (const char *);
 static int parse_sound (Lisp_Object, Lisp_Object *);
 
 /* END: Common Definitions */
@@ -329,7 +329,7 @@ static int do_play_sound (const char *, unsigned long);
 /* Like perror, but signals an error.  */
 
 static void
-sound_perror (char *msg)
+sound_perror (const char *msg)
 {
   int saved_errno = errno;
 
@@ -347,7 +347,7 @@ sound_perror (char *msg)
 /* Display a warning message.  */
 
 static void
-sound_warning (char *msg)
+sound_warning (const char *msg)
 {
   message (msg);
 }
@@ -727,7 +727,7 @@ au_play (struct sound *s, struct sound_device *sd)
 static void
 vox_open (struct sound_device *sd)
 {
-  char *file;
+  const char *file;
 
   /* Open the sound device.  Default is /dev/dsp.  */
   if (sd->file)
@@ -872,7 +872,7 @@ vox_choose_format (struct sound_device *sd, struct sound *s)
 static int
 vox_init (struct sound_device *sd)
 {
-  char *file;
+  const char *file;
   int fd;
 
   /* Open the sound device.  Default is /dev/dsp.  */
@@ -915,7 +915,7 @@ vox_write (struct sound_device *sd, const char *buffer, int nbytes)
 /* This driver is available on GNU/Linux. */
 
 static void
-alsa_sound_perror (char *msg, int err)
+alsa_sound_perror (const char *msg, int err)
 {
   error ("%s: %s", msg, snd_strerror (err));
 }
@@ -934,7 +934,7 @@ struct alsa_params
 static void
 alsa_open (struct sound_device *sd)
 {
-  char *file;
+  const char *file;
   struct alsa_params *p;
   int err;
 
@@ -1056,7 +1056,7 @@ alsa_configure (struct sound_device *sd)
       int chn;
       snd_mixer_t *handle;
       snd_mixer_elem_t *e;
-      char *file = sd->file ? sd->file : DEFAULT_ALSA_SOUND_DEVICE;
+      const char *file = sd->file ? sd->file : DEFAULT_ALSA_SOUND_DEVICE;
 
       if (snd_mixer_open (&handle, 0) >= 0)
         {
@@ -1220,7 +1220,7 @@ snd_error_quiet (const char *file, int line, const char *function, int err,
 static int
 alsa_init (struct sound_device *sd)
 {
-  char *file;
+  const char *file;
   snd_pcm_t *handle;
   int err;
 
index 331be6d59978481626902782aa3513a3941fd3eb..2ae3c509522c979ce017a1449f5b535a142f2692 100644 (file)
@@ -630,7 +630,7 @@ sys_subshell (void)
 
   if (pid == 0)
     {
-      char *sh = 0;
+      const char *sh = 0;
 
 #ifdef DOS_NT    /* MW, Aug 1993 */
       getwd (oldwd);
index 96f9ce02f9b2bea84731798d915c67383ad55fab..4f326234956cedf5d0a2fd664433fed0fe76925a 100644 (file)
@@ -1087,7 +1087,7 @@ tty_ins_del_lines (struct frame *f, int vpos, int n)
    not counting any line-dependent padding.  */
 
 int
-string_cost (char *str)
+string_cost (const char *str)
 {
   cost = 0;
   if (str)
@@ -1099,7 +1099,7 @@ string_cost (char *str)
    counting any line-dependent padding at one line.  */
 
 static int
-string_cost_one_line (char *str)
+string_cost_one_line (const char *str)
 {
   cost = 0;
   if (str)
@@ -1111,7 +1111,7 @@ string_cost_one_line (char *str)
    in tenths of characters.  */
 
 int
-per_line_cost (char *str)
+per_line_cost (const char *str)
 {
   cost = 0;
   if (str)
@@ -2301,7 +2301,7 @@ get_tty_terminal (Lisp_Object terminal, int throw)
    Returns NULL if the named terminal device is not opened.  */
 
 struct terminal *
-get_named_tty (char *name)
+get_named_tty (const char *name)
 {
   struct terminal *t;
 
@@ -3372,7 +3372,7 @@ dissociate_if_controlling_tty (int fd)
    If MUST_SUCCEED is true, then all errors are fatal. */
 
 struct terminal *
-init_tty (char *name, char *terminal_type, int must_succeed)
+init_tty (const char *name, const char *terminal_type, int must_succeed)
 {
   char *area = NULL;
   char **address = &area;
index 2ac6bbdc06e82f6fadf47f55fb8b465fff410355..0de69a4cabc6de6dacfeea6772a2e69185f72f00 100644 (file)
@@ -610,7 +610,7 @@ round_up (ElfW(Addr) x, ElfW(Addr) y)
    if NOERROR is 0; we return -1 if NOERROR is nonzero.  */
 
 static int
-find_section (char *name, char *section_names, char *file_name,
+find_section (const char *name, char *section_names, char *file_name,
              ElfW(Ehdr) *old_file_h, ElfW(Shdr) *old_section_h, int noerror)
 {
   int idx;
index 72b9e07738e99776e9871dcf389e1fcc58943230..e0d948fd3a660450719714f66881a291e12635af 100644 (file)
@@ -53,7 +53,7 @@ extern char *getenv (const char *);
 extern struct passwd *getpwuid (uid_t);
 extern struct passwd *getpwnam (const char *);
 
-extern char *get_system_name (void);
+extern const char *get_system_name (void);
 
 char *x_get_string_resource (XrmDatabase rdb, const char *name,
                             const char *class);
@@ -438,7 +438,8 @@ get_environ_db (void)
 {
   XrmDatabase db;
   char *p;
-  char *path = 0, *home = 0, *host;
+  char *path = 0, *home = 0;
+  const char *host;
 
   if ((p = getenv ("XENVIRONMENT")) == NULL)
     {