Use const char* instead of char*.
[bpt/emacs.git] / src / xdisp.c
index 9ee1f87..80df99f 100644 (file)
@@ -430,7 +430,7 @@ Lisp_Object QCmap, QCpointer;
 Lisp_Object Qrect, Qcircle, Qpoly;
 
 /* Tool bar styles */
-Lisp_Object Qtext, Qboth, Qboth_horiz, Qtext_image_horiz;
+Lisp_Object Qboth, Qboth_horiz, Qtext_image_horiz;
 
 /* Non-zero means print newline to stdout before next mini-buffer
    message.  */
@@ -992,12 +992,12 @@ static int display_line (struct it *);
 static int display_mode_lines (struct window *);
 static int display_mode_line (struct window *, enum face_id, Lisp_Object);
 static int display_mode_element (struct it *, int, int, int, Lisp_Object, Lisp_Object, int);
-static int store_mode_line_string (char *, Lisp_Object, int, int, int, Lisp_Object);
-static char *decode_mode_spec (struct window *, int, int, int,
-                               Lisp_Object *);
+static int store_mode_line_string (const char *, Lisp_Object, int, int, int, Lisp_Object);
+static const char *decode_mode_spec (struct window *, int, int, int,
+                                    Lisp_Object *);
 static void display_menu_bar (struct window *);
 static int display_count_lines (int, int, int, int, int *);
-static int display_string (unsigned char *, Lisp_Object, Lisp_Object,
+static int display_string (const unsigned char *, Lisp_Object, Lisp_Object,
                            EMACS_INT, EMACS_INT, struct it *, int, int, int, int);
 static void compute_line_metrics (struct it *);
 static void run_redisplay_end_trigger_hook (struct it *);
@@ -1020,7 +1020,7 @@ static int next_element_from_stretch (struct it *);
 static void load_overlay_strings (struct it *, int);
 static int init_from_display_pos (struct it *, struct window *,
                                   struct display_pos *);
-static void reseat_to_string (struct it *, unsigned char *,
+static void reseat_to_string (struct it *, const unsigned char *,
                               Lisp_Object, int, int, int, int);
 static enum move_it_result
        move_it_in_display_line_to (struct it *, EMACS_INT, int,
@@ -1035,8 +1035,8 @@ static int forward_to_next_line_start (struct it *, int *);
 static struct text_pos string_pos_nchars_ahead (struct text_pos,
                                                 Lisp_Object, int);
 static struct text_pos string_pos (int, Lisp_Object);
-static struct text_pos c_string_pos (int, unsigned char *, int);
-static int number_of_chars (unsigned char *, int);
+static struct text_pos c_string_pos (int, const unsigned char *, int);
+static int number_of_chars (const unsigned char *, int);
 static void compute_stop_pos (struct it *);
 static void compute_string_pos (struct text_pos *, struct text_pos,
                                 Lisp_Object);
@@ -1548,7 +1548,7 @@ string_pos (int charpos, Lisp_Object string)
    means recognize multibyte characters.  */
 
 static struct text_pos
-c_string_pos (int charpos, unsigned char *s, int multibyte_p)
+c_string_pos (int charpos, const unsigned char *s, int multibyte_p)
 {
   struct text_pos pos;
 
@@ -1580,7 +1580,7 @@ c_string_pos (int charpos, unsigned char *s, int multibyte_p)
    non-zero means recognize multibyte characters.  */
 
 static int
-number_of_chars (unsigned char *s, int multibyte_p)
+number_of_chars (const unsigned char *s, int multibyte_p)
 {
   int nchars;
 
@@ -5581,7 +5581,7 @@ reseat_1 (struct it *it, struct text_pos pos, int set_stop_p)
    calling this function.  */
 
 static void
-reseat_to_string (struct it *it, unsigned char *s, Lisp_Object string,
+reseat_to_string (struct it *it, const unsigned char *s, Lisp_Object string,
                  int charpos, int precision, int field_width, int multibyte)
 {
   /* No region in strings.  */
@@ -18538,7 +18538,7 @@ display_mode_element (struct it *it, int depth, int field_width, int precision,
                  {
                    int multibyte;
                    int bytepos, charpos;
-                   unsigned char *spec;
+                   const unsigned char *spec;
                    Lisp_Object string;
 
                    bytepos = percent_position;
@@ -18808,7 +18808,7 @@ display_mode_element (struct it *it, int depth, int field_width, int precision,
  */
 
 static int
-store_mode_line_string (char *string, Lisp_Object lisp_string, int copy_string,
+store_mode_line_string (const char *string, Lisp_Object lisp_string, int copy_string,
                        int field_width, int precision, Lisp_Object props)
 {
   int len;
@@ -19224,7 +19224,7 @@ decode_mode_spec_coding (Lisp_Object coding_system, register char *buf, int eol_
 
 static char lots_of_dashes[] = "--------------------------------------------------------------------------------------------------------------------------------------------";
 
-static char *
+static const char *
 decode_mode_spec (struct window *w, register int c, int field_width,
                  int precision, Lisp_Object *string)
 {
@@ -19784,7 +19784,7 @@ display_count_lines (int start, int start_byte, int limit_byte, int count,
    Value is the number of columns displayed.  */
 
 static int
-display_string (unsigned char *string, Lisp_Object lisp_string, Lisp_Object face_string,
+display_string (const unsigned char *string, Lisp_Object lisp_string, Lisp_Object face_string,
                EMACS_INT face_string_pos, EMACS_INT start, struct it *it,
                int field_width, int precision, int max_x, int multibyte)
 {